summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--CMakeL10n.txt3
-rw-r--r--CMakeLists.txt23
-rw-r--r--ConfigureChecks.cmake15
m---------admin0
m---------cmake0
-rw-r--r--config.h.cmake6
-rw-r--r--doc/CMakeLists.txt29
-rw-r--r--doc/kcoloredit/index.docbook8
-rw-r--r--doc/kdvi/index.docbook8
-rw-r--r--doc/kghostview/index.docbook8
-rw-r--r--doc/kolourpaint/index.docbook12
-rw-r--r--doc/kpdf/index.docbook13
-rw-r--r--doc/kpovmodeler/index.docbook12
-rw-r--r--doc/kruler/index.docbook8
-rw-r--r--doc/ksnapshot/index.docbook11
-rw-r--r--doc/kuickshow/index.docbook11
-rw-r--r--doc/kview/index.docbook7
-rw-r--r--doc/man/CMakeLists.txt18
-rw-r--r--doc/man/kcoloredit/CMakeLists.txt7
-rw-r--r--doc/man/kcoloredit/kcolorchooser.154
-rw-r--r--doc/man/kcoloredit/kcoloredit.167
-rw-r--r--doc/man/kdvi/CMakeLists.txt7
-rw-r--r--doc/man/kdvi/kdvi.199
-rw-r--r--doc/man/kfax/CMakeLists.txt7
-rw-r--r--doc/man/kfax/kfax.1102
-rw-r--r--doc/man/kfaxview/CMakeLists.txt7
-rw-r--r--doc/man/kfaxview/kfaxview.166
-rw-r--r--doc/man/kghostview/CMakeLists.txt7
-rw-r--r--doc/man/kghostview/kghostview.189
-rw-r--r--doc/man/kolourpaint/CMakeLists.txt7
-rw-r--r--doc/man/kolourpaint/kolourpaint.175
-rw-r--r--doc/man/kooka/CMakeLists.txt7
-rw-r--r--doc/man/kooka/kooka.189
-rw-r--r--doc/man/kpdf/CMakeLists.txt7
-rw-r--r--doc/man/kpdf/kpdf.1168
-rw-r--r--doc/man/kpovmodeler/CMakeLists.txt7
-rw-r--r--doc/man/kpovmodeler/kpovmodeler.182
-rw-r--r--doc/man/kruler/CMakeLists.txt7
-rw-r--r--doc/man/kruler/kruler.181
-rw-r--r--doc/man/ksnapshot/CMakeLists.txt7
-rw-r--r--doc/man/ksnapshot/ksnapshot.171
-rw-r--r--doc/man/kuickshow/CMakeLists.txt7
-rw-r--r--doc/man/kuickshow/kuickshow.199
-rw-r--r--doc/man/kview/CMakeLists.txt7
-rw-r--r--doc/man/kview/kview.178
-rw-r--r--doc/man/kviewshell/CMakeLists.txt7
-rw-r--r--doc/man/kviewshell/kviewshell.175
-rw-r--r--doc/man/tdeiconedit/CMakeLists.txt7
-rw-r--r--doc/man/tdeiconedit/tdeiconedit.189
-rw-r--r--doc/tdeiconedit/index.docbook11
-rw-r--r--kamera/kcontrol/CMakeL10n.txt6
-rw-r--r--kamera/kcontrol/CMakeLists.txt2
-rw-r--r--kamera/kcontrol/kamera.desktop183
-rw-r--r--kcoloredit/CMakeL10n.txt6
-rw-r--r--kcoloredit/CMakeLists.txt7
-rw-r--r--kcoloredit/kcolorchooser.desktop96
-rw-r--r--kcoloredit/kcoloredit.desktop84
-rw-r--r--kdvi/CMakeL10n.txt6
-rw-r--r--kdvi/CMakeLists.txt15
-rw-r--r--kdvi/TeXFont.h1
-rw-r--r--kdvi/TeXFontDefinition.h1
-rw-r--r--kdvi/TeXFont_PFB.h1
-rw-r--r--kdvi/TeXFont_PK.h2
-rw-r--r--kdvi/TeXFont_TFM.h1
-rw-r--r--kdvi/bigEndianByteReader.h1
-rw-r--r--kdvi/dvi.h1
-rw-r--r--kdvi/dviFile.h1
-rw-r--r--kdvi/dviPageCache.h1
-rw-r--r--kdvi/dviRenderer.h1
-rw-r--r--kdvi/dviWidget.h1
-rw-r--r--kdvi/dvisourcesplitter.h1
-rw-r--r--kdvi/fontEncoding.h1
-rw-r--r--kdvi/fontEncodingPool.h1
-rw-r--r--kdvi/fontMap.h1
-rw-r--r--kdvi/fontpool.h1
-rw-r--r--kdvi/fontprogress.h1
-rw-r--r--kdvi/glyph.h2
-rw-r--r--kdvi/infodialog.h1
-rw-r--r--kdvi/kdvi.desktop74
-rw-r--r--kdvi/kdvi.h1
-rw-r--r--kdvi/kdvi_multipage.h1
-rw-r--r--kdvi/kdvimultipage.desktop10
-rw-r--r--kdvi/kprinterwrapper.h1
-rw-r--r--kdvi/optionDialogFontsWidget.h1
-rw-r--r--kdvi/optionDialogSpecialWidget.h1
-rw-r--r--kdvi/performanceMeasurement.h2
-rw-r--r--kdvi/prebookmark.h1
-rw-r--r--kdvi/psgs.h1
-rw-r--r--kdvi/renderedDviPagePixmap.h1
-rw-r--r--kdvi/xdvi.h1
-rw-r--r--kfax/CMakeL10n.txt6
-rw-r--r--kfax/CMakeLists.txt2
-rw-r--r--kfax/kfax.desktop74
-rw-r--r--kfaxview/CMakeL10n.txt6
-rw-r--r--kfaxview/CMakeLists.txt14
-rw-r--r--kfaxview/kfaxmultipage.desktop51
-rw-r--r--kfaxview/kfaxmultipage_tiff.desktop48
-rw-r--r--kfaxview/kfaxview.desktop66
-rw-r--r--kfaxview/libkfaximage/faxinit.cpp4
-rw-r--r--kgamma/kcmkgamma/CMakeL10n.txt6
-rw-r--r--kgamma/kcmkgamma/CMakeLists.txt5
-rw-r--r--kgamma/kcmkgamma/kgamma.desktop112
-rw-r--r--kghostview/CMakeL10n.txt6
-rw-r--r--kghostview/CMakeLists.txt14
-rw-r--r--kghostview/dscparse/dscparse.cpp3
-rw-r--r--kghostview/dscparse/dscparse.h2
-rw-r--r--kghostview/dscparse/dscparse_adapter.cpp18
-rw-r--r--kghostview/dscparse/dscparse_adapter.h56
-rw-r--r--kghostview/infodialog.cpp2
-rw-r--r--kghostview/infodialog.h2
-rw-r--r--kghostview/kdscerrordialog.cpp2
-rw-r--r--kghostview/kdscerrordialog.h3
-rw-r--r--kghostview/kghostview.desktop77
-rw-r--r--kghostview/kghostview.kcfg2
-rw-r--r--kghostview/kghostview_part.desktop11
-rw-r--r--kghostview/kgv.h2
-rw-r--r--kghostview/kgv_miniwidget.cpp3
-rw-r--r--kghostview/kgv_miniwidget.h2
-rw-r--r--kghostview/kgv_view.cpp3
-rw-r--r--kghostview/kgv_view.h2
-rw-r--r--kghostview/kgvconfigdialog.cpp3
-rw-r--r--kghostview/kgvconfigdialog.h3
-rw-r--r--kghostview/kgvdocument.cpp5
-rw-r--r--kghostview/kgvdocument.h2
-rw-r--r--kghostview/kgvmainwidget.cpp2
-rw-r--r--kghostview/kgvmainwidget.h2
-rw-r--r--kghostview/kgvpagedecorator.cpp2
-rw-r--r--kghostview/kgvpagedecorator.h2
-rw-r--r--kghostview/kgvpageview.cpp2
-rw-r--r--kghostview/kgvpageview.h2
-rw-r--r--kghostview/kgvshell.cpp3
-rw-r--r--kghostview/kgvshell.h2
-rw-r--r--kghostview/kpswidget.cpp2
-rw-r--r--kghostview/kpswidget.h3
-rw-r--r--kghostview/logwindow.h2
-rw-r--r--kghostview/main.cpp2
-rw-r--r--kghostview/marklist.cpp2
-rw-r--r--kghostview/marklist.h2
-rw-r--r--kghostview/ps.h4
-rw-r--r--kghostview/scrollbox.cpp2
-rw-r--r--kghostview/scrollbox.h2
-rw-r--r--kghostview/thumbnailservice.h2
-rw-r--r--kghostview/version.h3
-rw-r--r--kghostview/viewcontrol.cpp3
-rw-r--r--kghostview/viewcontrol.h2
-rw-r--r--kmrml/kmrml/CMakeL10n.txt6
-rw-r--r--kmrml/kmrml/CMakeLists.txt22
-rw-r--r--kmrml/kmrml/kcontrol/CMakeLists.txt5
-rw-r--r--kmrml/kmrml/kcontrol/kcmkmrml.desktop161
-rw-r--r--kmrml/kmrml/kcontrol/serverconfigwidget.ui5
-rw-r--r--kmrml/kmrml/mrml-servicemenu.desktop59
-rw-r--r--kmrml/kmrml/mrml.desktop53
-rw-r--r--kmrml/kmrml/mrml_part.desktop53
-rw-r--r--kmrml/kmrml/server/CMakeLists.txt6
-rw-r--r--kmrml/kmrml/server/daemonwatcher.desktop94
-rw-r--r--kolourpaint/CMakeL10n.txt6
-rw-r--r--kolourpaint/CMakeLists.txt2
-rw-r--r--kolourpaint/kolourpaint.desktop73
-rw-r--r--kooka/CMakeL10n.txt6
-rw-r--r--kooka/CMakeLists.txt2
-rw-r--r--kooka/kooka.desktop66
-rw-r--r--kpdf/CMakeL10n.txt6
-rw-r--r--kpdf/CMakeLists.txt11
-rw-r--r--kpdf/Makefile.am2
-rw-r--r--kpdf/TODO2
-rw-r--r--kpdf/conf/kpdf.kcfg3
-rw-r--r--kpdf/core/generator_pdf/generator_pdf.cpp4
-rw-r--r--kpdf/kpdf_part.desktop3
-rw-r--r--kpdf/part.h2
-rw-r--r--kpdf/part.rc1
-rw-r--r--kpdf/shell/CMakeLists.txt6
-rw-r--r--kpdf/shell/kpdf.desktop71
-rw-r--r--kpdf/shell/main.cpp2
-rw-r--r--kpdf/shell/shell.h2
-rw-r--r--kpdf/ui/pageview.cpp66
-rw-r--r--kpdf/ui/pageview.h1
-rw-r--r--kpdf/xpdf/fofi/CMakeLists.txt4
-rw-r--r--kpdf/xpdf/fofi/FoFiBase.cc156
-rw-r--r--kpdf/xpdf/fofi/FoFiBase.cpp156
-rw-r--r--kpdf/xpdf/fofi/FoFiEncodings.cc994
-rw-r--r--kpdf/xpdf/fofi/FoFiEncodings.cpp994
-rw-r--r--kpdf/xpdf/fofi/FoFiTrueType.cc2040
-rw-r--r--kpdf/xpdf/fofi/FoFiTrueType.cpp2040
-rw-r--r--kpdf/xpdf/fofi/FoFiType1.cc257
-rw-r--r--kpdf/xpdf/fofi/FoFiType1.cpp257
-rw-r--r--kpdf/xpdf/fofi/FoFiType1C.cc2603
-rw-r--r--kpdf/xpdf/fofi/FoFiType1C.cpp2603
-rw-r--r--kpdf/xpdf/fofi/Makefile.am4
-rw-r--r--kpdf/xpdf/goo/CMakeLists.txt2
-rw-r--r--kpdf/xpdf/goo/GHash.cc380
-rw-r--r--kpdf/xpdf/goo/GHash.cpp380
-rw-r--r--kpdf/xpdf/goo/GList.cc97
-rw-r--r--kpdf/xpdf/goo/GList.cpp97
-rw-r--r--kpdf/xpdf/goo/GString.cc718
-rw-r--r--kpdf/xpdf/goo/GString.cpp718
-rw-r--r--kpdf/xpdf/goo/Makefile.am2
-rw-r--r--kpdf/xpdf/goo/gfile.cc731
-rw-r--r--kpdf/xpdf/goo/gfile.cpp731
-rw-r--r--kpdf/xpdf/goo/gmem.cpp (renamed from kpdf/xpdf/goo/gmem.cc)0
-rw-r--r--kpdf/xpdf/goo/gmempp.cc32
-rw-r--r--kpdf/xpdf/goo/gmempp.cpp32
-rw-r--r--kpdf/xpdf/splash/CMakeLists.txt13
-rw-r--r--kpdf/xpdf/splash/Makefile.am8
-rw-r--r--kpdf/xpdf/splash/Splash.cc3347
-rw-r--r--kpdf/xpdf/splash/Splash.cpp3347
-rw-r--r--kpdf/xpdf/splash/SplashBitmap.cc207
-rw-r--r--kpdf/xpdf/splash/SplashBitmap.cpp207
-rw-r--r--kpdf/xpdf/splash/SplashClip.cc382
-rw-r--r--kpdf/xpdf/splash/SplashClip.cpp382
-rw-r--r--kpdf/xpdf/splash/SplashFTFont.cc375
-rw-r--r--kpdf/xpdf/splash/SplashFTFont.cpp375
-rw-r--r--kpdf/xpdf/splash/SplashFTFontEngine.cc194
-rw-r--r--kpdf/xpdf/splash/SplashFTFontEngine.cpp194
-rw-r--r--kpdf/xpdf/splash/SplashFTFontFile.cc125
-rw-r--r--kpdf/xpdf/splash/SplashFTFontFile.cpp125
-rw-r--r--kpdf/xpdf/splash/SplashFont.cc201
-rw-r--r--kpdf/xpdf/splash/SplashFont.cpp201
-rw-r--r--kpdf/xpdf/splash/SplashFontEngine.cc295
-rw-r--r--kpdf/xpdf/splash/SplashFontEngine.cpp295
-rw-r--r--kpdf/xpdf/splash/SplashFontFile.cc108
-rw-r--r--kpdf/xpdf/splash/SplashFontFile.cpp108
-rw-r--r--kpdf/xpdf/splash/SplashFontFileID.cc23
-rw-r--r--kpdf/xpdf/splash/SplashFontFileID.cpp23
-rw-r--r--kpdf/xpdf/splash/SplashPath.cc184
-rw-r--r--kpdf/xpdf/splash/SplashPath.cpp184
-rw-r--r--kpdf/xpdf/splash/SplashPattern.cc40
-rw-r--r--kpdf/xpdf/splash/SplashPattern.cpp40
-rw-r--r--kpdf/xpdf/splash/SplashScreen.cc385
-rw-r--r--kpdf/xpdf/splash/SplashScreen.cpp385
-rw-r--r--kpdf/xpdf/splash/SplashState.cc165
-rw-r--r--kpdf/xpdf/splash/SplashState.cpp165
-rw-r--r--kpdf/xpdf/splash/SplashT1Font.cc292
-rw-r--r--kpdf/xpdf/splash/SplashT1Font.cpp292
-rw-r--r--kpdf/xpdf/splash/SplashT1FontEngine.cc122
-rw-r--r--kpdf/xpdf/splash/SplashT1FontEngine.cpp122
-rw-r--r--kpdf/xpdf/splash/SplashT1FontFile.cc117
-rw-r--r--kpdf/xpdf/splash/SplashT1FontFile.cpp117
-rw-r--r--kpdf/xpdf/splash/SplashTypes.h2
-rw-r--r--kpdf/xpdf/splash/SplashXPath.cc443
-rw-r--r--kpdf/xpdf/splash/SplashXPath.cpp443
-rw-r--r--kpdf/xpdf/splash/SplashXPathScanner.cc429
-rw-r--r--kpdf/xpdf/splash/SplashXPathScanner.cpp429
-rw-r--r--kpdf/xpdf/xpdf/Annot.cc1556
-rw-r--r--kpdf/xpdf/xpdf/Annot.cpp1556
-rw-r--r--kpdf/xpdf/xpdf/Array.cc88
-rw-r--r--kpdf/xpdf/xpdf/Array.cpp88
-rw-r--r--kpdf/xpdf/xpdf/BuiltinFont.cc65
-rw-r--r--kpdf/xpdf/xpdf/BuiltinFont.cpp65
-rw-r--r--kpdf/xpdf/xpdf/BuiltinFontTables.cc4284
-rw-r--r--kpdf/xpdf/xpdf/BuiltinFontTables.cpp4284
-rw-r--r--kpdf/xpdf/xpdf/CMakeLists.txt19
-rw-r--r--kpdf/xpdf/xpdf/CMap.cc408
-rw-r--r--kpdf/xpdf/xpdf/CMap.cpp408
-rw-r--r--kpdf/xpdf/xpdf/Catalog.cc443
-rw-r--r--kpdf/xpdf/xpdf/Catalog.cpp443
-rw-r--r--kpdf/xpdf/xpdf/CharCodeToUnicode.cc540
-rw-r--r--kpdf/xpdf/xpdf/CharCodeToUnicode.cpp540
-rw-r--r--kpdf/xpdf/xpdf/Decrypt.cc776
-rw-r--r--kpdf/xpdf/xpdf/Decrypt.cpp776
-rw-r--r--kpdf/xpdf/xpdf/Dict.cc95
-rw-r--r--kpdf/xpdf/xpdf/Dict.cpp95
-rw-r--r--kpdf/xpdf/xpdf/FontEncodingTables.cc1824
-rw-r--r--kpdf/xpdf/xpdf/FontEncodingTables.cpp1824
-rw-r--r--kpdf/xpdf/xpdf/Function.cc1575
-rw-r--r--kpdf/xpdf/xpdf/Function.cpp1575
-rw-r--r--kpdf/xpdf/xpdf/Gfx.cc4189
-rw-r--r--kpdf/xpdf/xpdf/Gfx.cpp4189
-rw-r--r--kpdf/xpdf/xpdf/GfxFont.cc1616
-rw-r--r--kpdf/xpdf/xpdf/GfxFont.cpp1616
-rw-r--r--kpdf/xpdf/xpdf/GfxState.cc4137
-rw-r--r--kpdf/xpdf/xpdf/GfxState.cpp4137
-rw-r--r--kpdf/xpdf/xpdf/GfxState.h2
-rw-r--r--kpdf/xpdf/xpdf/GlobalParams.cc2989
-rw-r--r--kpdf/xpdf/xpdf/GlobalParams.cpp2989
-rw-r--r--kpdf/xpdf/xpdf/JArithmeticDecoder.cc322
-rw-r--r--kpdf/xpdf/xpdf/JArithmeticDecoder.cpp322
-rw-r--r--kpdf/xpdf/xpdf/JBIG2Stream.cc3648
-rw-r--r--kpdf/xpdf/xpdf/JBIG2Stream.cpp3648
-rw-r--r--kpdf/xpdf/xpdf/JPXStream.cc3144
-rw-r--r--kpdf/xpdf/xpdf/JPXStream.cpp3144
-rw-r--r--kpdf/xpdf/xpdf/Lexer.cc521
-rw-r--r--kpdf/xpdf/xpdf/Lexer.cpp521
-rw-r--r--kpdf/xpdf/xpdf/Link.cc784
-rw-r--r--kpdf/xpdf/xpdf/Link.cpp784
-rw-r--r--kpdf/xpdf/xpdf/Makefile.am16
-rw-r--r--kpdf/xpdf/xpdf/NameToCharCode.cc116
-rw-r--r--kpdf/xpdf/xpdf/NameToCharCode.cpp116
-rw-r--r--kpdf/xpdf/xpdf/Object.cc233
-rw-r--r--kpdf/xpdf/xpdf/Object.cpp233
-rw-r--r--kpdf/xpdf/xpdf/Outline.cc151
-rw-r--r--kpdf/xpdf/xpdf/Outline.cpp151
-rw-r--r--kpdf/xpdf/xpdf/OutputDev.cc131
-rw-r--r--kpdf/xpdf/xpdf/OutputDev.cpp131
-rw-r--r--kpdf/xpdf/xpdf/PDFDoc.cc433
-rw-r--r--kpdf/xpdf/xpdf/PDFDoc.cpp433
-rw-r--r--kpdf/xpdf/xpdf/PDFDocEncoding.cpp (renamed from kpdf/xpdf/xpdf/PDFDocEncoding.cc)0
-rw-r--r--kpdf/xpdf/xpdf/PSOutputDev.cc6307
-rw-r--r--kpdf/xpdf/xpdf/PSOutputDev.cpp6307
-rw-r--r--kpdf/xpdf/xpdf/PSTokenizer.cc135
-rw-r--r--kpdf/xpdf/xpdf/PSTokenizer.cpp135
-rw-r--r--kpdf/xpdf/xpdf/Page.cc558
-rw-r--r--kpdf/xpdf/xpdf/Page.cpp558
-rw-r--r--kpdf/xpdf/xpdf/Parser.cc227
-rw-r--r--kpdf/xpdf/xpdf/Parser.cpp227
-rw-r--r--kpdf/xpdf/xpdf/PreScanOutputDev.cc257
-rw-r--r--kpdf/xpdf/xpdf/PreScanOutputDev.cpp257
-rw-r--r--kpdf/xpdf/xpdf/SecurityHandler.cc390
-rw-r--r--kpdf/xpdf/xpdf/SecurityHandler.cpp390
-rw-r--r--kpdf/xpdf/xpdf/SplashOutputDev.cc2851
-rw-r--r--kpdf/xpdf/xpdf/SplashOutputDev.cpp2851
-rw-r--r--kpdf/xpdf/xpdf/Stream.cc4698
-rw-r--r--kpdf/xpdf/xpdf/Stream.cpp4698
-rw-r--r--kpdf/xpdf/xpdf/TextOutputDev.cc4090
-rw-r--r--kpdf/xpdf/xpdf/TextOutputDev.cpp4090
-rw-r--r--kpdf/xpdf/xpdf/UnicodeMap.cc293
-rw-r--r--kpdf/xpdf/xpdf/UnicodeMap.cpp293
-rw-r--r--kpdf/xpdf/xpdf/UnicodeTypeTable.cc949
-rw-r--r--kpdf/xpdf/xpdf/UnicodeTypeTable.cpp949
-rw-r--r--kpdf/xpdf/xpdf/XRef.cc933
-rw-r--r--kpdf/xpdf/xpdf/XRef.cpp933
-rw-r--r--kpovmodeler/CMakeL10n.txt6
-rw-r--r--kpovmodeler/CMakeLists.txt10
-rw-r--r--kpovmodeler/ConfigureChecks.cmake9
-rw-r--r--kpovmodeler/kpovmodeler.desktop46
-rw-r--r--kpovmodeler/pm2dcontrolpoint.h1
-rw-r--r--kpovmodeler/pm3dcontrolpoint.h1
-rw-r--r--kpovmodeler/pmactions.cpp2
-rw-r--r--kpovmodeler/pmactions.h1
-rw-r--r--kpovmodeler/pmaddcommand.h1
-rw-r--r--kpovmodeler/pmallcommands.h1
-rw-r--r--kpovmodeler/pmalledits.h1
-rw-r--r--kpovmodeler/pmallobjects.h1
-rw-r--r--kpovmodeler/pmbicubicpatch.h1
-rw-r--r--kpovmodeler/pmbicubicpatchedit.h1
-rw-r--r--kpovmodeler/pmblendmapmodifiers.h1
-rw-r--r--kpovmodeler/pmblendmapmodifiersedit.h1
-rw-r--r--kpovmodeler/pmblob.h1
-rw-r--r--kpovmodeler/pmblobcylinder.h1
-rw-r--r--kpovmodeler/pmblobcylinderedit.h1
-rw-r--r--kpovmodeler/pmblobedit.h1
-rw-r--r--kpovmodeler/pmblobsphere.h1
-rw-r--r--kpovmodeler/pmboundedby.h1
-rw-r--r--kpovmodeler/pmboundedbyedit.h1
-rw-r--r--kpovmodeler/pmbox.h1
-rw-r--r--kpovmodeler/pmboxedit.h1
-rw-r--r--kpovmodeler/pmbumpmap.h1
-rw-r--r--kpovmodeler/pmbumpmapedit.h1
-rw-r--r--kpovmodeler/pmcamera.h1
-rw-r--r--kpovmodeler/pmcameraedit.h1
-rw-r--r--kpovmodeler/pmclippedby.h1
-rw-r--r--kpovmodeler/pmclippedbyedit.h1
-rw-r--r--kpovmodeler/pmcolor.h1
-rw-r--r--kpovmodeler/pmcoloredit.h1
-rw-r--r--kpovmodeler/pmcommand.h1
-rw-r--r--kpovmodeler/pmcommandmanager.h1
-rw-r--r--kpovmodeler/pmcomment.h1
-rw-r--r--kpovmodeler/pmcommentedit.h1
-rw-r--r--kpovmodeler/pmcompositeobject.h1
-rw-r--r--kpovmodeler/pmcone.h1
-rw-r--r--kpovmodeler/pmconeedit.h1
-rw-r--r--kpovmodeler/pmcontrolpoint.h1
-rw-r--r--kpovmodeler/pmcsg.h1
-rw-r--r--kpovmodeler/pmcsgedit.h1
-rw-r--r--kpovmodeler/pmcylinder.h1
-rw-r--r--kpovmodeler/pmcylinderedit.h1
-rw-r--r--kpovmodeler/pmdatachangecommand.h1
-rw-r--r--kpovmodeler/pmdebug.h1
-rw-r--r--kpovmodeler/pmdeclare.h1
-rw-r--r--kpovmodeler/pmdeclareedit.h1
-rw-r--r--kpovmodeler/pmdeletecommand.h1
-rw-r--r--kpovmodeler/pmdensity.h1
-rw-r--r--kpovmodeler/pmdensityedit.h1
-rw-r--r--kpovmodeler/pmdetailobject.h1
-rw-r--r--kpovmodeler/pmdetailobjectedit.h1
-rw-r--r--kpovmodeler/pmdialogeditbase.h1
-rw-r--r--kpovmodeler/pmdialogview.h1
-rw-r--r--kpovmodeler/pmdisc.h1
-rw-r--r--kpovmodeler/pmdiscedit.h1
-rw-r--r--kpovmodeler/pmdistancecontrolpoint.h1
-rw-r--r--kpovmodeler/pmdocumentationmap.h1
-rw-r--r--kpovmodeler/pmenumproperty.h1
-rw-r--r--kpovmodeler/pmerrordialog.h1
-rw-r--r--kpovmodeler/pmerrorflags.h1
-rw-r--r--kpovmodeler/pmface.h1
-rw-r--r--kpovmodeler/pmfactory.h1
-rw-r--r--kpovmodeler/pmfinish.h1
-rw-r--r--kpovmodeler/pmfinishedit.h1
-rw-r--r--kpovmodeler/pmfog.h1
-rw-r--r--kpovmodeler/pmfogedit.h1
-rw-r--r--kpovmodeler/pmglobalphotons.h1
-rw-r--r--kpovmodeler/pmglobalphotonsedit.h1
-rw-r--r--kpovmodeler/pmglobalsettings.h1
-rw-r--r--kpovmodeler/pmglobalsettingsedit.h1
-rw-r--r--kpovmodeler/pmglview.h1
-rw-r--r--kpovmodeler/pmgraphicalobject.h1
-rw-r--r--kpovmodeler/pmgraphicalobjectedit.h1
-rw-r--r--kpovmodeler/pmheightfield.h1
-rw-r--r--kpovmodeler/pmheightfieldedit.h1
-rw-r--r--kpovmodeler/pmheightfieldroam.h1
-rw-r--r--kpovmodeler/pmimagemap.h1
-rw-r--r--kpovmodeler/pmimagemapedit.h1
-rw-r--r--kpovmodeler/pminserterrordialog.h1
-rw-r--r--kpovmodeler/pminsertpopup.h1
-rw-r--r--kpovmodeler/pminsertrulesystem.h1
-rw-r--r--kpovmodeler/pminterior.h1
-rw-r--r--kpovmodeler/pminterioredit.h1
-rw-r--r--kpovmodeler/pminteriortexture.h1
-rw-r--r--kpovmodeler/pminteriortextureedit.h1
-rw-r--r--kpovmodeler/pmisosurface.h1
-rw-r--r--kpovmodeler/pmisosurfaceedit.h1
-rw-r--r--kpovmodeler/pmjuliafractal.h1
-rw-r--r--kpovmodeler/pmjuliafractaledit.h1
-rw-r--r--kpovmodeler/pmlathe.h1
-rw-r--r--kpovmodeler/pmlatheedit.h1
-rw-r--r--kpovmodeler/pmlibrarybrowser.h1
-rw-r--r--kpovmodeler/pmlibraryentrypreview.h1
-rw-r--r--kpovmodeler/pmlibraryhandle.h1
-rw-r--r--kpovmodeler/pmlibraryhandleedit.h1
-rw-r--r--kpovmodeler/pmlibraryiconview.cpp1
-rw-r--r--kpovmodeler/pmlibraryiconview.h1
-rw-r--r--kpovmodeler/pmlibrarymanager.h1
-rw-r--r--kpovmodeler/pmlibraryobject.cpp1
-rw-r--r--kpovmodeler/pmlibraryobject.h1
-rw-r--r--kpovmodeler/pmlibraryobjectsearch.h1
-rw-r--r--kpovmodeler/pmlight.h1
-rw-r--r--kpovmodeler/pmlightedit.h1
-rw-r--r--kpovmodeler/pmlightgroup.h1
-rw-r--r--kpovmodeler/pmlightgroupedit.h1
-rw-r--r--kpovmodeler/pmline.h1
-rw-r--r--kpovmodeler/pmlineedits.h1
-rw-r--r--kpovmodeler/pmlistpattern.h1
-rw-r--r--kpovmodeler/pmlistpatternedit.h1
-rw-r--r--kpovmodeler/pmlookslike.h1
-rw-r--r--kpovmodeler/pmmapmemento.h1
-rw-r--r--kpovmodeler/pmmaterial.h1
-rw-r--r--kpovmodeler/pmmaterialedit.h1
-rw-r--r--kpovmodeler/pmmaterialmap.h1
-rw-r--r--kpovmodeler/pmmaterialmapedit.h1
-rw-r--r--kpovmodeler/pmmath.h1
-rw-r--r--kpovmodeler/pmmatrix.h1
-rw-r--r--kpovmodeler/pmmedia.h1
-rw-r--r--kpovmodeler/pmmediaedit.h1
-rw-r--r--kpovmodeler/pmmemento.h1
-rw-r--r--kpovmodeler/pmmesh.h1
-rw-r--r--kpovmodeler/pmmeshedit.h1
-rw-r--r--kpovmodeler/pmmessage.h1
-rw-r--r--kpovmodeler/pmmetaobject.h1
-rw-r--r--kpovmodeler/pmmovecommand.h1
-rw-r--r--kpovmodeler/pmnamedobject.h1
-rw-r--r--kpovmodeler/pmnamedobjectedit.h1
-rw-r--r--kpovmodeler/pmnormal.h1
-rw-r--r--kpovmodeler/pmnormaledit.h1
-rw-r--r--kpovmodeler/pmobject.h1
-rw-r--r--kpovmodeler/pmobjectaction.h1
-rw-r--r--kpovmodeler/pmobjectdrag.h1
-rw-r--r--kpovmodeler/pmobjectlink.h1
-rw-r--r--kpovmodeler/pmobjectlinkedit.h1
-rw-r--r--kpovmodeler/pmobjectselect.h1
-rw-r--r--kpovmodeler/pmoutputdevice.h1
-rw-r--r--kpovmodeler/pmpalettevalue.h1
-rw-r--r--kpovmodeler/pmpalettevalueedit.h1
-rw-r--r--kpovmodeler/pmpalettevaluememento.h1
-rw-r--r--kpovmodeler/pmparser.h1
-rw-r--r--kpovmodeler/pmpart.h1
-rw-r--r--kpovmodeler/pmpartiface.h1
-rw-r--r--kpovmodeler/pmpattern.h1
-rw-r--r--kpovmodeler/pmpatternedit.h1
-rw-r--r--kpovmodeler/pmphotons.h1
-rw-r--r--kpovmodeler/pmphotonsedit.h1
-rw-r--r--kpovmodeler/pmpigment.h1
-rw-r--r--kpovmodeler/pmpigmentedit.h1
-rw-r--r--kpovmodeler/pmplane.h1
-rw-r--r--kpovmodeler/pmplaneedit.h1
-rw-r--r--kpovmodeler/pmplanenormalcontrolpoint.h1
-rw-r--r--kpovmodeler/pmpoint.h1
-rw-r--r--kpovmodeler/pmpolynom.h1
-rw-r--r--kpovmodeler/pmpolynomedit.h1
-rw-r--r--kpovmodeler/pmpolynomexponents.h1
-rw-r--r--kpovmodeler/pmpovraymatrix.h1
-rw-r--r--kpovmodeler/pmpovraymatrixedit.h1
-rw-r--r--kpovmodeler/pmpovrayoutputwidget.h1
-rw-r--r--kpovmodeler/pmpovrayparser.h1
-rw-r--r--kpovmodeler/pmprism.h1
-rw-r--r--kpovmodeler/pmprismedit.h1
-rw-r--r--kpovmodeler/pmprismmemento.h1
-rw-r--r--kpovmodeler/pmprojectedthrough.h1
-rw-r--r--kpovmodeler/pmprototypemanager.h1
-rw-r--r--kpovmodeler/pmquickcolor.h1
-rw-r--r--kpovmodeler/pmquickcoloredit.h1
-rw-r--r--kpovmodeler/pmradiosity.h1
-rw-r--r--kpovmodeler/pmradiosityedit.h1
-rw-r--r--kpovmodeler/pmrainbow.h1
-rw-r--r--kpovmodeler/pmrainbowedit.h1
-rw-r--r--kpovmodeler/pmraw.h1
-rw-r--r--kpovmodeler/pmrawedit.h1
-rw-r--r--kpovmodeler/pmrecursiveobjectiterator.h1
-rw-r--r--kpovmodeler/pmrendermanager.h1
-rw-r--r--kpovmodeler/pmrendermode.cpp8
-rw-r--r--kpovmodeler/pmrendermode.h5
-rw-r--r--kpovmodeler/pmrendermodesdialog.cpp19
-rw-r--r--kpovmodeler/pmrendermodesdialog.h2
-rw-r--r--kpovmodeler/pmresourcelocator.h1
-rw-r--r--kpovmodeler/pmrotate.h1
-rw-r--r--kpovmodeler/pmrotatecontrolpoint.h1
-rw-r--r--kpovmodeler/pmrotateedit.h1
-rw-r--r--kpovmodeler/pmscale.h1
-rw-r--r--kpovmodeler/pmscalecontrolpoint.h1
-rw-r--r--kpovmodeler/pmscaleedit.h1
-rw-r--r--kpovmodeler/pmscanner.h1
-rw-r--r--kpovmodeler/pmscene.h1
-rw-r--r--kpovmodeler/pmserializer.h1
-rw-r--r--kpovmodeler/pmsettingsdialog.h1
-rw-r--r--kpovmodeler/pmshell.h1
-rw-r--r--kpovmodeler/pmskysphere.h1
-rw-r--r--kpovmodeler/pmskysphereedit.h1
-rw-r--r--kpovmodeler/pmslope.h1
-rw-r--r--kpovmodeler/pmslopeedit.h1
-rw-r--r--kpovmodeler/pmsolidcolor.h1
-rw-r--r--kpovmodeler/pmsolidcoloredit.h1
-rw-r--r--kpovmodeler/pmsolidobject.h1
-rw-r--r--kpovmodeler/pmsolidobjectedit.h1
-rw-r--r--kpovmodeler/pmsor.h1
-rw-r--r--kpovmodeler/pmsorcontrolpoint.h1
-rw-r--r--kpovmodeler/pmsoredit.h1
-rw-r--r--kpovmodeler/pmsorsegment.cpp1
-rw-r--r--kpovmodeler/pmsorsegment.h1
-rw-r--r--kpovmodeler/pmsphere.h1
-rw-r--r--kpovmodeler/pmspheresweep.h1
-rw-r--r--kpovmodeler/pmspheresweepedit.h1
-rw-r--r--kpovmodeler/pmsplinememento.h1
-rw-r--r--kpovmodeler/pmsplinesegment.cpp1
-rw-r--r--kpovmodeler/pmsplinesegment.h1
-rw-r--r--kpovmodeler/pmsqe.h1
-rw-r--r--kpovmodeler/pmsqeedit.h1
-rw-r--r--kpovmodeler/pmsymboltable.h1
-rw-r--r--kpovmodeler/pmtext.h1
-rw-r--r--kpovmodeler/pmtextedit.h1
-rw-r--r--kpovmodeler/pmtexture.h1
-rw-r--r--kpovmodeler/pmtexturebase.h1
-rw-r--r--kpovmodeler/pmtexturebaseedit.h1
-rw-r--r--kpovmodeler/pmtextureedit.h1
-rw-r--r--kpovmodeler/pmtexturemap.h1
-rw-r--r--kpovmodeler/pmtexturemapedit.h1
-rw-r--r--kpovmodeler/pmtokens.h1
-rw-r--r--kpovmodeler/pmtranslate.h1
-rw-r--r--kpovmodeler/pmtranslatecontrolpoint.h1
-rw-r--r--kpovmodeler/pmtranslateedit.h1
-rw-r--r--kpovmodeler/pmtreeview.h1
-rw-r--r--kpovmodeler/pmtreeviewitem.h1
-rw-r--r--kpovmodeler/pmtriangle.h1
-rw-r--r--kpovmodeler/pmtriangleedit.h1
-rw-r--r--kpovmodeler/pmtruetypecache.h1
-rw-r--r--kpovmodeler/pmvalue.h1
-rw-r--r--kpovmodeler/pmvariant.h1
-rw-r--r--kpovmodeler/pmvector.h1
-rw-r--r--kpovmodeler/pmvectorcontrolpoint.h1
-rw-r--r--kpovmodeler/pmvectoredit.h1
-rw-r--r--kpovmodeler/pmvectorlistedit.h1
-rw-r--r--kpovmodeler/pmview.h1
-rw-r--r--kpovmodeler/pmviewlayoutmanager.h1
-rw-r--r--kpovmodeler/pmviewstructure.h1
-rw-r--r--kpovmodeler/pmwarp.h1
-rw-r--r--kpovmodeler/pmwarpedit.h1
-rw-r--r--kpovmodeler/pmxmlhelper.h1
-rw-r--r--kpovmodeler/pmxmlparser.h1
-rw-r--r--kruler/CMakeL10n.txt12
-rw-r--r--kruler/CMakeLists.txt11
-rw-r--r--kruler/eventsrc183
-rw-r--r--kruler/kruler.desktop77
-rw-r--r--ksnapshot/CMakeL10n.txt6
-rw-r--r--ksnapshot/CMakeLists.txt2
-rw-r--r--ksnapshot/ksnapshot.desktop65
-rw-r--r--ksnapshot/ksnapshot.h2
-rw-r--r--ksvg/CMakeL10n.txt6
-rw-r--r--ksvg/CMakeLists.txt4
-rw-r--r--ksvg/ConfigureChecks.cmake9
-rw-r--r--ksvg/Makefile.am180
-rw-r--r--ksvg/core/CMakeLists.txt10
-rw-r--r--ksvg/core/CanvasFactory.cpp2
-rw-r--r--ksvg/core/CanvasFactory.h2
-rw-r--r--ksvg/core/CanvasItem.h2
-rw-r--r--ksvg/core/CanvasItems.cpp2
-rw-r--r--ksvg/core/CanvasItems.h2
-rw-r--r--ksvg/core/DocumentFactory.cpp2
-rw-r--r--ksvg/core/DocumentFactory.h2
-rw-r--r--ksvg/core/KSVGCanvas.cpp2
-rw-r--r--ksvg/core/KSVGCanvas.h6
-rw-r--r--ksvg/core/KSVGHelper.cpp2
-rw-r--r--ksvg/core/KSVGHelper.h2
-rw-r--r--ksvg/core/KSVGLoader.cpp2
-rw-r--r--ksvg/core/KSVGLoader.h2
-rw-r--r--ksvg/core/KSVGReader.cc506
-rw-r--r--ksvg/core/KSVGReader.cpp504
-rw-r--r--ksvg/core/KSVGTextChunk.cpp2
-rw-r--r--ksvg/core/KSVGTextChunk.h2
-rw-r--r--ksvg/core/Makefile.am2
-rw-r--r--ksvg/core/ksvgrenderer.desktop48
-rw-r--r--ksvg/data/SVGAElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGAngleImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedAngleImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedBooleanImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedEnumerationImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedIntegerImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedLengthImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedLengthListImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedNumberImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedNumberListImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedPathDataImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedPointsImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedPreserveAspectRatioImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedRectImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedStringImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimatedTransformListImpl.lut.h2
-rw-r--r--ksvg/data/SVGAnimationElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGCircleElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGClipPathElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGColorImpl.lut.h2
-rw-r--r--ksvg/data/SVGColorProfileElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGCursorElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGDocumentImpl.lut.h2
-rw-r--r--ksvg/data/SVGEcma.lut.h2
-rw-r--r--ksvg/data/SVGElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGEllipseElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGEventImpl.lut.h2
-rw-r--r--ksvg/data/SVGExternalResourcesRequiredImpl.lut.h2
-rw-r--r--ksvg/data/SVGFitToViewBoxImpl.lut.h2
-rw-r--r--ksvg/data/SVGForeignObjectElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGGlyphElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGGlyphRefElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGGradientElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGICCColorImpl.lut.h2
-rw-r--r--ksvg/data/SVGImageElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGLangSpaceImpl.lut.h2
-rw-r--r--ksvg/data/SVGLengthImpl.lut.h2
-rw-r--r--ksvg/data/SVGLengthListImpl.lut.h2
-rw-r--r--ksvg/data/SVGLineElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGLinearGradientElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGLocatableImpl.lut.h2
-rw-r--r--ksvg/data/SVGMarkerElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGMaskElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGMatrixImpl.lut.h2
-rw-r--r--ksvg/data/SVGNumberImpl.lut.h2
-rw-r--r--ksvg/data/SVGNumberListImpl.lut.h2
-rw-r--r--ksvg/data/SVGPaintImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegArcImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegCurvetoCubicImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegCurvetoCubicSmoothImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegCurvetoQuadraticImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegLinetoHorizontalImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegLinetoImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegLinetoVerticalImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegListImpl.lut.h2
-rw-r--r--ksvg/data/SVGPathSegMovetoImpl.lut.h2
-rw-r--r--ksvg/data/SVGPatternElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGPointImpl.lut.h2
-rw-r--r--ksvg/data/SVGPointListImpl.lut.h2
-rw-r--r--ksvg/data/SVGPreserveAspectRatioImpl.lut.h2
-rw-r--r--ksvg/data/SVGRadialGradientElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGRectElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGRectImpl.lut.h2
-rw-r--r--ksvg/data/SVGSVGElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGScriptElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGStopElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGStringListImpl.lut.h2
-rw-r--r--ksvg/data/SVGStylableImpl.lut.h2
-rw-r--r--ksvg/data/SVGStyleElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGSymbolElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGTestsImpl.lut.h2
-rw-r--r--ksvg/data/SVGTextContentElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGTextPathElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGTextPositioningElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGTransformImpl.lut.h2
-rw-r--r--ksvg/data/SVGTransformListImpl.lut.h2
-rw-r--r--ksvg/data/SVGTransformableImpl.lut.h2
-rw-r--r--ksvg/data/SVGURIReferenceImpl.lut.h2
-rw-r--r--ksvg/data/SVGUseElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGViewElementImpl.lut.h2
-rw-r--r--ksvg/data/SVGZoomAndPanImpl.lut.h2
-rw-r--r--ksvg/data/SVGZoomEventImpl.lut.h2
-rw-r--r--ksvg/dom/CMakeLists.txt92
-rw-r--r--ksvg/dom/Makefile.am42
-rw-r--r--ksvg/dom/SVGAElement.cc80
-rw-r--r--ksvg/dom/SVGAElement.cpp78
-rw-r--r--ksvg/dom/SVGAElement.h1
-rw-r--r--ksvg/dom/SVGAltGlyphDefElement.cc67
-rw-r--r--ksvg/dom/SVGAltGlyphDefElement.cpp65
-rw-r--r--ksvg/dom/SVGAltGlyphDefElement.h2
-rw-r--r--ksvg/dom/SVGAltGlyphElement.cc80
-rw-r--r--ksvg/dom/SVGAltGlyphElement.cpp78
-rw-r--r--ksvg/dom/SVGAltGlyphElement.h2
-rw-r--r--ksvg/dom/SVGAngle.cc120
-rw-r--r--ksvg/dom/SVGAngle.cpp118
-rw-r--r--ksvg/dom/SVGAngle.h2
-rw-r--r--ksvg/dom/SVGAnimateColorElement.cc67
-rw-r--r--ksvg/dom/SVGAnimateColorElement.cpp65
-rw-r--r--ksvg/dom/SVGAnimateColorElement.h2
-rw-r--r--ksvg/dom/SVGAnimateElement.cc67
-rw-r--r--ksvg/dom/SVGAnimateElement.cpp65
-rw-r--r--ksvg/dom/SVGAnimateElement.h2
-rw-r--r--ksvg/dom/SVGAnimateMotionElement.cc65
-rw-r--r--ksvg/dom/SVGAnimateMotionElement.cpp63
-rw-r--r--ksvg/dom/SVGAnimateMotionElement.h2
-rw-r--r--ksvg/dom/SVGAnimateTransformElement.cc67
-rw-r--r--ksvg/dom/SVGAnimateTransformElement.cpp65
-rw-r--r--ksvg/dom/SVGAnimateTransformElement.h2
-rw-r--r--ksvg/dom/SVGAnimatedAngle.cc79
-rw-r--r--ksvg/dom/SVGAnimatedAngle.cpp77
-rw-r--r--ksvg/dom/SVGAnimatedAngle.h2
-rw-r--r--ksvg/dom/SVGAnimatedBoolean.cc84
-rw-r--r--ksvg/dom/SVGAnimatedBoolean.cpp82
-rw-r--r--ksvg/dom/SVGAnimatedBoolean.h2
-rw-r--r--ksvg/dom/SVGAnimatedEnumeration.cc84
-rw-r--r--ksvg/dom/SVGAnimatedEnumeration.cpp82
-rw-r--r--ksvg/dom/SVGAnimatedEnumeration.h2
-rw-r--r--ksvg/dom/SVGAnimatedInteger.cc84
-rw-r--r--ksvg/dom/SVGAnimatedInteger.cpp82
-rw-r--r--ksvg/dom/SVGAnimatedInteger.h2
-rw-r--r--ksvg/dom/SVGAnimatedLength.cc79
-rw-r--r--ksvg/dom/SVGAnimatedLength.cpp77
-rw-r--r--ksvg/dom/SVGAnimatedLength.h2
-rw-r--r--ksvg/dom/SVGAnimatedLengthList.cc78
-rw-r--r--ksvg/dom/SVGAnimatedLengthList.cpp76
-rw-r--r--ksvg/dom/SVGAnimatedNumber.cc84
-rw-r--r--ksvg/dom/SVGAnimatedNumber.cpp82
-rw-r--r--ksvg/dom/SVGAnimatedNumber.h2
-rw-r--r--ksvg/dom/SVGAnimatedNumberList.cc78
-rw-r--r--ksvg/dom/SVGAnimatedNumberList.cpp76
-rw-r--r--ksvg/dom/SVGAnimatedPathData.cc91
-rw-r--r--ksvg/dom/SVGAnimatedPathData.cpp89
-rw-r--r--ksvg/dom/SVGAnimatedPathData.h2
-rw-r--r--ksvg/dom/SVGAnimatedPoints.cc79
-rw-r--r--ksvg/dom/SVGAnimatedPoints.cpp77
-rw-r--r--ksvg/dom/SVGAnimatedPoints.h2
-rw-r--r--ksvg/dom/SVGAnimatedPreserveAspectRatio.cc79
-rw-r--r--ksvg/dom/SVGAnimatedPreserveAspectRatio.cpp77
-rw-r--r--ksvg/dom/SVGAnimatedPreserveAspectRatio.h1
-rw-r--r--ksvg/dom/SVGAnimatedRect.cc79
-rw-r--r--ksvg/dom/SVGAnimatedRect.cpp77
-rw-r--r--ksvg/dom/SVGAnimatedRect.h1
-rw-r--r--ksvg/dom/SVGAnimatedString.cc84
-rw-r--r--ksvg/dom/SVGAnimatedString.cpp82
-rw-r--r--ksvg/dom/SVGAnimatedString.h2
-rw-r--r--ksvg/dom/SVGAnimatedTransformList.cc79
-rw-r--r--ksvg/dom/SVGAnimatedTransformList.cpp77
-rw-r--r--ksvg/dom/SVGAnimatedTransformList.h2
-rw-r--r--ksvg/dom/SVGAnimationElement.cc93
-rw-r--r--ksvg/dom/SVGAnimationElement.cpp91
-rw-r--r--ksvg/dom/SVGAnimationElement.h2
-rw-r--r--ksvg/dom/SVGCSSRule.cc66
-rw-r--r--ksvg/dom/SVGCSSRule.cpp64
-rw-r--r--ksvg/dom/SVGCSSRule.h2
-rw-r--r--ksvg/dom/SVGCircleElement.cc92
-rw-r--r--ksvg/dom/SVGCircleElement.cpp90
-rw-r--r--ksvg/dom/SVGCircleElement.h2
-rw-r--r--ksvg/dom/SVGClipPathElement.cc79
-rw-r--r--ksvg/dom/SVGClipPathElement.cpp77
-rw-r--r--ksvg/dom/SVGClipPathElement.h2
-rw-r--r--ksvg/dom/SVGColor.cc105
-rw-r--r--ksvg/dom/SVGColor.cpp103
-rw-r--r--ksvg/dom/SVGColor.h2
-rw-r--r--ksvg/dom/SVGColorProfileElement.cc105
-rw-r--r--ksvg/dom/SVGColorProfileElement.cpp103
-rw-r--r--ksvg/dom/SVGColorProfileElement.h2
-rw-r--r--ksvg/dom/SVGColorProfileRule.cc103
-rw-r--r--ksvg/dom/SVGColorProfileRule.cpp101
-rw-r--r--ksvg/dom/SVGColorProfileRule.h2
-rw-r--r--ksvg/dom/SVGComponentTransferFunctionElement.cc112
-rw-r--r--ksvg/dom/SVGComponentTransferFunctionElement.cpp110
-rw-r--r--ksvg/dom/SVGComponentTransferFunctionElement.h2
-rw-r--r--ksvg/dom/SVGCursorElement.cc83
-rw-r--r--ksvg/dom/SVGCursorElement.cpp81
-rw-r--r--ksvg/dom/SVGCursorElement.h2
-rw-r--r--ksvg/dom/SVGDefinitionSrcElement.cc67
-rw-r--r--ksvg/dom/SVGDefinitionSrcElement.cpp65
-rw-r--r--ksvg/dom/SVGDefinitionSrcElement.h2
-rw-r--r--ksvg/dom/SVGDefsElement.cc72
-rw-r--r--ksvg/dom/SVGDefsElement.cpp70
-rw-r--r--ksvg/dom/SVGDefsElement.h2
-rw-r--r--ksvg/dom/SVGDescElement.cc69
-rw-r--r--ksvg/dom/SVGDescElement.cpp67
-rw-r--r--ksvg/dom/SVGDescElement.h2
-rw-r--r--ksvg/dom/SVGDocument.cc138
-rw-r--r--ksvg/dom/SVGDocument.cpp136
-rw-r--r--ksvg/dom/SVGDocument.h2
-rw-r--r--ksvg/dom/SVGElement.cc124
-rw-r--r--ksvg/dom/SVGElement.cpp122
-rw-r--r--ksvg/dom/SVGElement.h2
-rw-r--r--ksvg/dom/SVGElementInstance.cc117
-rw-r--r--ksvg/dom/SVGElementInstance.cpp115
-rw-r--r--ksvg/dom/SVGElementInstance.h2
-rw-r--r--ksvg/dom/SVGElementInstanceList.cc79
-rw-r--r--ksvg/dom/SVGElementInstanceList.cpp77
-rw-r--r--ksvg/dom/SVGElementInstanceList.h2
-rw-r--r--ksvg/dom/SVGEllipseElement.cc98
-rw-r--r--ksvg/dom/SVGEllipseElement.cpp96
-rw-r--r--ksvg/dom/SVGEllipseElement.h2
-rw-r--r--ksvg/dom/SVGEvent.cc187
-rw-r--r--ksvg/dom/SVGEvent.cpp185
-rw-r--r--ksvg/dom/SVGEvent.h2
-rw-r--r--ksvg/dom/SVGException.h2
-rw-r--r--ksvg/dom/SVGExternalResourcesRequired.cc65
-rw-r--r--ksvg/dom/SVGExternalResourcesRequired.cpp63
-rw-r--r--ksvg/dom/SVGExternalResourcesRequired.h2
-rw-r--r--ksvg/dom/SVGFEBlendElement.cc88
-rw-r--r--ksvg/dom/SVGFEBlendElement.cpp86
-rw-r--r--ksvg/dom/SVGFEBlendElement.h2
-rw-r--r--ksvg/dom/SVGFEColorMatrixElement.cc89
-rw-r--r--ksvg/dom/SVGFEColorMatrixElement.cpp87
-rw-r--r--ksvg/dom/SVGFEColorMatrixElement.h2
-rw-r--r--ksvg/dom/SVGFEComponentTransferElement.cc75
-rw-r--r--ksvg/dom/SVGFEComponentTransferElement.cpp73
-rw-r--r--ksvg/dom/SVGFEComponentTransferElement.h2
-rw-r--r--ksvg/dom/SVGFECompositeElement.cc113
-rw-r--r--ksvg/dom/SVGFECompositeElement.cpp111
-rw-r--r--ksvg/dom/SVGFECompositeElement.h2
-rw-r--r--ksvg/dom/SVGFEConvolveMatrixElement.cc140
-rw-r--r--ksvg/dom/SVGFEConvolveMatrixElement.cpp138
-rw-r--r--ksvg/dom/SVGFEConvolveMatrixElement.h2
-rw-r--r--ksvg/dom/SVGFEDiffuseLightingElement.cc88
-rw-r--r--ksvg/dom/SVGFEDiffuseLightingElement.cpp86
-rw-r--r--ksvg/dom/SVGFEDiffuseLightingElement.h2
-rw-r--r--ksvg/dom/SVGFEDisplacementMapElement.cc101
-rw-r--r--ksvg/dom/SVGFEDisplacementMapElement.cpp99
-rw-r--r--ksvg/dom/SVGFEDisplacementMapElement.h2
-rw-r--r--ksvg/dom/SVGFEDistantLightElement.cc80
-rw-r--r--ksvg/dom/SVGFEDistantLightElement.cpp78
-rw-r--r--ksvg/dom/SVGFEDistantLightElement.h2
-rw-r--r--ksvg/dom/SVGFEFloodElement.cc76
-rw-r--r--ksvg/dom/SVGFEFloodElement.cpp74
-rw-r--r--ksvg/dom/SVGFEFloodElement.h2
-rw-r--r--ksvg/dom/SVGFEFuncAElement.cc67
-rw-r--r--ksvg/dom/SVGFEFuncAElement.cpp65
-rw-r--r--ksvg/dom/SVGFEFuncAElement.h2
-rw-r--r--ksvg/dom/SVGFEFuncBElement.cc67
-rw-r--r--ksvg/dom/SVGFEFuncBElement.cpp65
-rw-r--r--ksvg/dom/SVGFEFuncBElement.h2
-rw-r--r--ksvg/dom/SVGFEFuncGElement.cc67
-rw-r--r--ksvg/dom/SVGFEFuncGElement.cpp65
-rw-r--r--ksvg/dom/SVGFEFuncGElement.h2
-rw-r--r--ksvg/dom/SVGFEFuncRElement.cc67
-rw-r--r--ksvg/dom/SVGFEFuncRElement.cpp65
-rw-r--r--ksvg/dom/SVGFEFuncRElement.h2
-rw-r--r--ksvg/dom/SVGFEGaussianBlurElement.cc94
-rw-r--r--ksvg/dom/SVGFEGaussianBlurElement.cpp92
-rw-r--r--ksvg/dom/SVGFEGaussianBlurElement.h2
-rw-r--r--ksvg/dom/SVGFEImageElement.cc72
-rw-r--r--ksvg/dom/SVGFEImageElement.cpp70
-rw-r--r--ksvg/dom/SVGFEImageElement.h2
-rw-r--r--ksvg/dom/SVGFEMergeElement.cc68
-rw-r--r--ksvg/dom/SVGFEMergeElement.cpp66
-rw-r--r--ksvg/dom/SVGFEMergeElement.h2
-rw-r--r--ksvg/dom/SVGFEMergeNodeElement.cc74
-rw-r--r--ksvg/dom/SVGFEMergeNodeElement.cpp72
-rw-r--r--ksvg/dom/SVGFEMergeNodeElement.h2
-rw-r--r--ksvg/dom/SVGFEMorphologyElement.cc95
-rw-r--r--ksvg/dom/SVGFEMorphologyElement.cpp93
-rw-r--r--ksvg/dom/SVGFEMorphologyElement.h2
-rw-r--r--ksvg/dom/SVGFEOffsetElement.cc88
-rw-r--r--ksvg/dom/SVGFEOffsetElement.cpp86
-rw-r--r--ksvg/dom/SVGFEOffsetElement.h2
-rw-r--r--ksvg/dom/SVGFEPointLightElement.cc86
-rw-r--r--ksvg/dom/SVGFEPointLightElement.cpp84
-rw-r--r--ksvg/dom/SVGFEPointLightElement.h2
-rw-r--r--ksvg/dom/SVGFESpecularLightingElement.cc94
-rw-r--r--ksvg/dom/SVGFESpecularLightingElement.cpp92
-rw-r--r--ksvg/dom/SVGFESpecularLightingElement.h2
-rw-r--r--ksvg/dom/SVGFESpotLightElement.cc116
-rw-r--r--ksvg/dom/SVGFESpotLightElement.cpp114
-rw-r--r--ksvg/dom/SVGFESpotLightElement.h2
-rw-r--r--ksvg/dom/SVGFETileElement.cc75
-rw-r--r--ksvg/dom/SVGFETileElement.cpp73
-rw-r--r--ksvg/dom/SVGFETileElement.h2
-rw-r--r--ksvg/dom/SVGFETurbulenceElement.cc107
-rw-r--r--ksvg/dom/SVGFETurbulenceElement.cpp105
-rw-r--r--ksvg/dom/SVGFETurbulenceElement.h2
-rw-r--r--ksvg/dom/SVGFilterElement.cc128
-rw-r--r--ksvg/dom/SVGFilterElement.cpp126
-rw-r--r--ksvg/dom/SVGFilterElement.h2
-rw-r--r--ksvg/dom/SVGFilterPrimitiveStandardAttributes.cc88
-rw-r--r--ksvg/dom/SVGFilterPrimitiveStandardAttributes.cpp86
-rw-r--r--ksvg/dom/SVGFilterPrimitiveStandardAttributes.h2
-rw-r--r--ksvg/dom/SVGFitToViewBox.cc72
-rw-r--r--ksvg/dom/SVGFitToViewBox.cpp70
-rw-r--r--ksvg/dom/SVGFitToViewBox.h2
-rw-r--r--ksvg/dom/SVGFontElement.cc69
-rw-r--r--ksvg/dom/SVGFontElement.cpp67
-rw-r--r--ksvg/dom/SVGFontElement.h2
-rw-r--r--ksvg/dom/SVGFontFaceElement.cc67
-rw-r--r--ksvg/dom/SVGFontFaceElement.cpp65
-rw-r--r--ksvg/dom/SVGFontFaceElement.h2
-rw-r--r--ksvg/dom/SVGFontFaceFormatElement.cc67
-rw-r--r--ksvg/dom/SVGFontFaceFormatElement.cpp65
-rw-r--r--ksvg/dom/SVGFontFaceFormatElement.h2
-rw-r--r--ksvg/dom/SVGFontFaceNameElement.cc67
-rw-r--r--ksvg/dom/SVGFontFaceNameElement.cpp65
-rw-r--r--ksvg/dom/SVGFontFaceNameElement.h2
-rw-r--r--ksvg/dom/SVGFontFaceSrcElement.cc67
-rw-r--r--ksvg/dom/SVGFontFaceSrcElement.cpp65
-rw-r--r--ksvg/dom/SVGFontFaceSrcElement.h2
-rw-r--r--ksvg/dom/SVGFontFaceUriElement.cc67
-rw-r--r--ksvg/dom/SVGFontFaceUriElement.cpp65
-rw-r--r--ksvg/dom/SVGFontFaceUriElement.h2
-rw-r--r--ksvg/dom/SVGForeignObjectElement.cc97
-rw-r--r--ksvg/dom/SVGForeignObjectElement.cpp95
-rw-r--r--ksvg/dom/SVGForeignObjectElement.h2
-rw-r--r--ksvg/dom/SVGGElement.cc72
-rw-r--r--ksvg/dom/SVGGElement.cpp70
-rw-r--r--ksvg/dom/SVGGElement.h2
-rw-r--r--ksvg/dom/SVGGlyphElement.cc68
-rw-r--r--ksvg/dom/SVGGlyphElement.cpp66
-rw-r--r--ksvg/dom/SVGGlyphElement.h2
-rw-r--r--ksvg/dom/SVGGlyphRefElement.cc81
-rw-r--r--ksvg/dom/SVGGlyphRefElement.cpp79
-rw-r--r--ksvg/dom/SVGGlyphRefElement.h2
-rw-r--r--ksvg/dom/SVGGradientElement.cc80
-rw-r--r--ksvg/dom/SVGGradientElement.cpp78
-rw-r--r--ksvg/dom/SVGGradientElement.h2
-rw-r--r--ksvg/dom/SVGHKernElement.cc67
-rw-r--r--ksvg/dom/SVGHKernElement.cpp65
-rw-r--r--ksvg/dom/SVGHKernElement.h2
-rw-r--r--ksvg/dom/SVGICCColor.cc85
-rw-r--r--ksvg/dom/SVGICCColor.cpp83
-rw-r--r--ksvg/dom/SVGICCColor.h2
-rw-r--r--ksvg/dom/SVGImageElement.cc106
-rw-r--r--ksvg/dom/SVGImageElement.cpp104
-rw-r--r--ksvg/dom/SVGImageElement.h2
-rw-r--r--ksvg/dom/SVGLangSpace.cc82
-rw-r--r--ksvg/dom/SVGLangSpace.cpp80
-rw-r--r--ksvg/dom/SVGLangSpace.h2
-rw-r--r--ksvg/dom/SVGLength.cc135
-rw-r--r--ksvg/dom/SVGLength.cpp133
-rw-r--r--ksvg/dom/SVGLength.h2
-rw-r--r--ksvg/dom/SVGLengthList.cc115
-rw-r--r--ksvg/dom/SVGLengthList.cpp113
-rw-r--r--ksvg/dom/SVGLengthList.h2
-rw-r--r--ksvg/dom/SVGLineElement.cc98
-rw-r--r--ksvg/dom/SVGLineElement.cpp96
-rw-r--r--ksvg/dom/SVGLineElement.h2
-rw-r--r--ksvg/dom/SVGLinearGradientElement.cc92
-rw-r--r--ksvg/dom/SVGLinearGradientElement.cpp90
-rw-r--r--ksvg/dom/SVGLinearGradientElement.h3
-rw-r--r--ksvg/dom/SVGLocatable.cc97
-rw-r--r--ksvg/dom/SVGLocatable.cpp95
-rw-r--r--ksvg/dom/SVGLocatable.h2
-rw-r--r--ksvg/dom/SVGMPathElement.cc69
-rw-r--r--ksvg/dom/SVGMPathElement.cpp67
-rw-r--r--ksvg/dom/SVGMPathElement.h2
-rw-r--r--ksvg/dom/SVGMarkerElement.cc129
-rw-r--r--ksvg/dom/SVGMarkerElement.cpp127
-rw-r--r--ksvg/dom/SVGMarkerElement.h2
-rw-r--r--ksvg/dom/SVGMaskElement.cc109
-rw-r--r--ksvg/dom/SVGMaskElement.cpp107
-rw-r--r--ksvg/dom/SVGMaskElement.h2
-rw-r--r--ksvg/dom/SVGMatrix.cc210
-rw-r--r--ksvg/dom/SVGMatrix.cpp208
-rw-r--r--ksvg/dom/SVGMatrix.h2
-rw-r--r--ksvg/dom/SVGMetadataElement.cc67
-rw-r--r--ksvg/dom/SVGMetadataElement.cpp65
-rw-r--r--ksvg/dom/SVGMetadataElement.h2
-rw-r--r--ksvg/dom/SVGMissingGlyphElement.cc68
-rw-r--r--ksvg/dom/SVGMissingGlyphElement.cpp66
-rw-r--r--ksvg/dom/SVGMissingGlyphElement.h2
-rw-r--r--ksvg/dom/SVGNumber.cc78
-rw-r--r--ksvg/dom/SVGNumber.cpp76
-rw-r--r--ksvg/dom/SVGNumber.h2
-rw-r--r--ksvg/dom/SVGNumberList.cc115
-rw-r--r--ksvg/dom/SVGNumberList.cpp113
-rw-r--r--ksvg/dom/SVGNumberList.h2
-rw-r--r--ksvg/dom/SVGPaint.cc93
-rw-r--r--ksvg/dom/SVGPaint.cpp91
-rw-r--r--ksvg/dom/SVGPaint.h2
-rw-r--r--ksvg/dom/SVGPathElement.cc200
-rw-r--r--ksvg/dom/SVGPathElement.cpp198
-rw-r--r--ksvg/dom/SVGPathElement.h2
-rw-r--r--ksvg/dom/SVGPathSeg.cc69
-rw-r--r--ksvg/dom/SVGPathSeg.cpp67
-rw-r--r--ksvg/dom/SVGPathSeg.h2
-rw-r--r--ksvg/dom/SVGPathSegArc.cc238
-rw-r--r--ksvg/dom/SVGPathSegArc.cpp236
-rw-r--r--ksvg/dom/SVGPathSegArc.h2
-rw-r--r--ksvg/dom/SVGPathSegClosePath.cc46
-rw-r--r--ksvg/dom/SVGPathSegClosePath.cpp44
-rw-r--r--ksvg/dom/SVGPathSegClosePath.h2
-rw-r--r--ksvg/dom/SVGPathSegCurvetoCubic.cc214
-rw-r--r--ksvg/dom/SVGPathSegCurvetoCubic.cpp212
-rw-r--r--ksvg/dom/SVGPathSegCurvetoCubic.h2
-rw-r--r--ksvg/dom/SVGPathSegCurvetoCubicSmooth.cc166
-rw-r--r--ksvg/dom/SVGPathSegCurvetoCubicSmooth.cpp164
-rw-r--r--ksvg/dom/SVGPathSegCurvetoCubicSmooth.h2
-rw-r--r--ksvg/dom/SVGPathSegCurvetoQuadratic.cc166
-rw-r--r--ksvg/dom/SVGPathSegCurvetoQuadratic.cpp164
-rw-r--r--ksvg/dom/SVGPathSegCurvetoQuadratic.h2
-rw-r--r--ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cc118
-rw-r--r--ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cpp116
-rw-r--r--ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.h2
-rw-r--r--ksvg/dom/SVGPathSegLineto.cc118
-rw-r--r--ksvg/dom/SVGPathSegLineto.cpp116
-rw-r--r--ksvg/dom/SVGPathSegLineto.h2
-rw-r--r--ksvg/dom/SVGPathSegLinetoHorizontal.cc94
-rw-r--r--ksvg/dom/SVGPathSegLinetoHorizontal.cpp92
-rw-r--r--ksvg/dom/SVGPathSegLinetoHorizontal.h2
-rw-r--r--ksvg/dom/SVGPathSegLinetoVertical.cc94
-rw-r--r--ksvg/dom/SVGPathSegLinetoVertical.cpp92
-rw-r--r--ksvg/dom/SVGPathSegLinetoVertical.h2
-rw-r--r--ksvg/dom/SVGPathSegList.cc114
-rw-r--r--ksvg/dom/SVGPathSegList.cpp112
-rw-r--r--ksvg/dom/SVGPathSegList.h2
-rw-r--r--ksvg/dom/SVGPathSegMoveto.cc118
-rw-r--r--ksvg/dom/SVGPathSegMoveto.cpp116
-rw-r--r--ksvg/dom/SVGPathSegMoveto.h2
-rw-r--r--ksvg/dom/SVGPatternElement.cc117
-rw-r--r--ksvg/dom/SVGPatternElement.cpp115
-rw-r--r--ksvg/dom/SVGPatternElement.h2
-rw-r--r--ksvg/dom/SVGPoint.cc97
-rw-r--r--ksvg/dom/SVGPoint.cpp95
-rw-r--r--ksvg/dom/SVGPoint.h2
-rw-r--r--ksvg/dom/SVGPointList.cpp (renamed from ksvg/dom/SVGPointList.cc)0
-rw-r--r--ksvg/dom/SVGPolygonElement.cpp (renamed from ksvg/dom/SVGPolygonElement.cc)0
-rw-r--r--ksvg/dom/SVGPolygonElement.h2
-rw-r--r--ksvg/dom/SVGPolylineElement.cpp (renamed from ksvg/dom/SVGPolylineElement.cc)0
-rw-r--r--ksvg/dom/SVGPolylineElement.h2
-rw-r--r--ksvg/dom/SVGPreserveAspectRatio.cc81
-rw-r--r--ksvg/dom/SVGPreserveAspectRatio.cpp79
-rw-r--r--ksvg/dom/SVGPreserveAspectRatio.h2
-rw-r--r--ksvg/dom/SVGRadialGradientElement.cc98
-rw-r--r--ksvg/dom/SVGRadialGradientElement.cpp96
-rw-r--r--ksvg/dom/SVGRadialGradientElement.h2
-rw-r--r--ksvg/dom/SVGRect.cc114
-rw-r--r--ksvg/dom/SVGRect.cpp112
-rw-r--r--ksvg/dom/SVGRect.h2
-rw-r--r--ksvg/dom/SVGRectElement.cc109
-rw-r--r--ksvg/dom/SVGRectElement.cpp107
-rw-r--r--ksvg/dom/SVGRectElement.h2
-rw-r--r--ksvg/dom/SVGRenderingIntent.h2
-rw-r--r--ksvg/dom/SVGSVGElement.cc337
-rw-r--r--ksvg/dom/SVGSVGElement.cpp335
-rw-r--r--ksvg/dom/SVGSVGElement.h2
-rw-r--r--ksvg/dom/SVGScriptElement.cc81
-rw-r--r--ksvg/dom/SVGScriptElement.cpp79
-rw-r--r--ksvg/dom/SVGScriptElement.h2
-rw-r--r--ksvg/dom/SVGSetElement.cc67
-rw-r--r--ksvg/dom/SVGSetElement.cpp65
-rw-r--r--ksvg/dom/SVGSetElement.h2
-rw-r--r--ksvg/dom/SVGStopElement.cc75
-rw-r--r--ksvg/dom/SVGStopElement.cpp73
-rw-r--r--ksvg/dom/SVGStopElement.h2
-rw-r--r--ksvg/dom/SVGStringList.cc115
-rw-r--r--ksvg/dom/SVGStringList.cpp113
-rw-r--r--ksvg/dom/SVGStringList.h2
-rw-r--r--ksvg/dom/SVGStylable.cc76
-rw-r--r--ksvg/dom/SVGStylable.cpp74
-rw-r--r--ksvg/dom/SVGStylable.h3
-rw-r--r--ksvg/dom/SVGStyleElement.cc115
-rw-r--r--ksvg/dom/SVGStyleElement.cpp113
-rw-r--r--ksvg/dom/SVGStyleElement.h2
-rw-r--r--ksvg/dom/SVGSwitchElement.cc72
-rw-r--r--ksvg/dom/SVGSwitchElement.cpp70
-rw-r--r--ksvg/dom/SVGSwitchElement.h2
-rw-r--r--ksvg/dom/SVGSymbolElement.cc71
-rw-r--r--ksvg/dom/SVGSymbolElement.cpp69
-rw-r--r--ksvg/dom/SVGSymbolElement.h2
-rw-r--r--ksvg/dom/SVGTRefElement.cc68
-rw-r--r--ksvg/dom/SVGTRefElement.cpp66
-rw-r--r--ksvg/dom/SVGTRefElement.h2
-rw-r--r--ksvg/dom/SVGTSpanElement.cc67
-rw-r--r--ksvg/dom/SVGTSpanElement.cpp65
-rw-r--r--ksvg/dom/SVGTSpanElement.h2
-rw-r--r--ksvg/dom/SVGTests.cc83
-rw-r--r--ksvg/dom/SVGTests.cpp81
-rw-r--r--ksvg/dom/SVGTests.h2
-rw-r--r--ksvg/dom/SVGTextContentElement.cpp (renamed from ksvg/dom/SVGTextContentElement.cc)0
-rw-r--r--ksvg/dom/SVGTextElement.cpp (renamed from ksvg/dom/SVGTextElement.cc)0
-rw-r--r--ksvg/dom/SVGTextPathElement.cc89
-rw-r--r--ksvg/dom/SVGTextPathElement.cpp87
-rw-r--r--ksvg/dom/SVGTextPathElement.h2
-rw-r--r--ksvg/dom/SVGTextPositioningElement.cpp (renamed from ksvg/dom/SVGTextPositioningElement.cc)0
-rw-r--r--ksvg/dom/SVGTitleElement.cc69
-rw-r--r--ksvg/dom/SVGTitleElement.cpp67
-rw-r--r--ksvg/dom/SVGTitleElement.h2
-rw-r--r--ksvg/dom/SVGTransform.cc119
-rw-r--r--ksvg/dom/SVGTransform.cpp117
-rw-r--r--ksvg/dom/SVGTransform.h2
-rw-r--r--ksvg/dom/SVGTransformList.cc129
-rw-r--r--ksvg/dom/SVGTransformList.cpp127
-rw-r--r--ksvg/dom/SVGTransformList.h2
-rw-r--r--ksvg/dom/SVGTransformable.cc67
-rw-r--r--ksvg/dom/SVGTransformable.cpp65
-rw-r--r--ksvg/dom/SVGTransformable.h2
-rw-r--r--ksvg/dom/SVGURIReference.cc63
-rw-r--r--ksvg/dom/SVGURIReference.cpp61
-rw-r--r--ksvg/dom/SVGURIReference.h2
-rw-r--r--ksvg/dom/SVGUnitTypes.h2
-rw-r--r--ksvg/dom/SVGUseElement.cc111
-rw-r--r--ksvg/dom/SVGUseElement.cpp109
-rw-r--r--ksvg/dom/SVGUseElement.h2
-rw-r--r--ksvg/dom/SVGVKernElement.cc67
-rw-r--r--ksvg/dom/SVGVKernElement.cpp65
-rw-r--r--ksvg/dom/SVGVKernElement.h2
-rw-r--r--ksvg/dom/SVGViewElement.cc77
-rw-r--r--ksvg/dom/SVGViewElement.cpp75
-rw-r--r--ksvg/dom/SVGViewElement.h2
-rw-r--r--ksvg/dom/SVGViewSpec.cc107
-rw-r--r--ksvg/dom/SVGViewSpec.cpp105
-rw-r--r--ksvg/dom/SVGViewSpec.h2
-rw-r--r--ksvg/dom/SVGWindow.cc175
-rw-r--r--ksvg/dom/SVGWindow.cpp173
-rw-r--r--ksvg/dom/SVGWindow.h2
-rw-r--r--ksvg/dom/SVGZoomAndPan.cc70
-rw-r--r--ksvg/dom/SVGZoomAndPan.cpp68
-rw-r--r--ksvg/dom/SVGZoomAndPan.h2
-rw-r--r--ksvg/dom/SVGZoomEvent.cc99
-rw-r--r--ksvg/dom/SVGZoomEvent.cpp97
-rw-r--r--ksvg/dom/SVGZoomEvent.h2
-rw-r--r--ksvg/ecma/ksvg_cacheimpl.h2
-rw-r--r--ksvg/ecma/ksvg_ecma.cpp2
-rw-r--r--ksvg/ecma/ksvg_ecma.h2
-rw-r--r--ksvg/ecma/ksvg_ecmaeventlistener.cpp2
-rw-r--r--ksvg/ecma/ksvg_ecmaeventlistener.h2
-rw-r--r--ksvg/ecma/ksvg_helper.cpp2
-rw-r--r--ksvg/ecma/ksvg_lookup.h2
-rw-r--r--ksvg/ecma/ksvg_scriptinterpreter.cpp2
-rw-r--r--ksvg/ecma/ksvg_scriptinterpreter.h2
-rw-r--r--ksvg/impl/CMakeLists.txt119
-rw-r--r--ksvg/impl/Makefile.am118
-rw-r--r--ksvg/impl/SVGAElementImpl.cc117
-rw-r--r--ksvg/impl/SVGAElementImpl.cpp115
-rw-r--r--ksvg/impl/SVGAElementImpl.h1
-rw-r--r--ksvg/impl/SVGAltGlyphDefElementImpl.cc33
-rw-r--r--ksvg/impl/SVGAltGlyphDefElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGAltGlyphDefElementImpl.h2
-rw-r--r--ksvg/impl/SVGAltGlyphElementImpl.cc50
-rw-r--r--ksvg/impl/SVGAltGlyphElementImpl.cpp47
-rw-r--r--ksvg/impl/SVGAltGlyphElementImpl.h2
-rw-r--r--ksvg/impl/SVGAngleImpl.cc277
-rw-r--r--ksvg/impl/SVGAngleImpl.cpp275
-rw-r--r--ksvg/impl/SVGAngleImpl.h2
-rw-r--r--ksvg/impl/SVGAnimateColorElementImpl.cc98
-rw-r--r--ksvg/impl/SVGAnimateColorElementImpl.cpp96
-rw-r--r--ksvg/impl/SVGAnimateColorElementImpl.h2
-rw-r--r--ksvg/impl/SVGAnimateElementImpl.cc191
-rw-r--r--ksvg/impl/SVGAnimateElementImpl.cpp189
-rw-r--r--ksvg/impl/SVGAnimateElementImpl.h2
-rw-r--r--ksvg/impl/SVGAnimateMotionElementImpl.cc102
-rw-r--r--ksvg/impl/SVGAnimateMotionElementImpl.cpp100
-rw-r--r--ksvg/impl/SVGAnimateMotionElementImpl.h2
-rw-r--r--ksvg/impl/SVGAnimateTransformElementImpl.cc257
-rw-r--r--ksvg/impl/SVGAnimateTransformElementImpl.cpp255
-rw-r--r--ksvg/impl/SVGAnimateTransformElementImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedAngleImpl.cc83
-rw-r--r--ksvg/impl/SVGAnimatedAngleImpl.cpp81
-rw-r--r--ksvg/impl/SVGAnimatedAngleImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedBooleanImpl.cc93
-rw-r--r--ksvg/impl/SVGAnimatedBooleanImpl.cpp91
-rw-r--r--ksvg/impl/SVGAnimatedBooleanImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedEnumerationImpl.cc93
-rw-r--r--ksvg/impl/SVGAnimatedEnumerationImpl.cpp91
-rw-r--r--ksvg/impl/SVGAnimatedEnumerationImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedIntegerImpl.cc91
-rw-r--r--ksvg/impl/SVGAnimatedIntegerImpl.cpp89
-rw-r--r--ksvg/impl/SVGAnimatedIntegerImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedLengthImpl.cc96
-rw-r--r--ksvg/impl/SVGAnimatedLengthImpl.cpp94
-rw-r--r--ksvg/impl/SVGAnimatedLengthImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedLengthListImpl.cc95
-rw-r--r--ksvg/impl/SVGAnimatedLengthListImpl.cpp93
-rw-r--r--ksvg/impl/SVGAnimatedNumberImpl.cc94
-rw-r--r--ksvg/impl/SVGAnimatedNumberImpl.cpp92
-rw-r--r--ksvg/impl/SVGAnimatedNumberImpl.h1
-rw-r--r--ksvg/impl/SVGAnimatedNumberListImpl.cc82
-rw-r--r--ksvg/impl/SVGAnimatedNumberListImpl.cpp80
-rw-r--r--ksvg/impl/SVGAnimatedPathDataImpl.cc108
-rw-r--r--ksvg/impl/SVGAnimatedPathDataImpl.cpp106
-rw-r--r--ksvg/impl/SVGAnimatedPathDataImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedPointsImpl.cc139
-rw-r--r--ksvg/impl/SVGAnimatedPointsImpl.cpp137
-rw-r--r--ksvg/impl/SVGAnimatedPointsImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cc83
-rw-r--r--ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cpp81
-rw-r--r--ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedRectImpl.cc81
-rw-r--r--ksvg/impl/SVGAnimatedRectImpl.cpp79
-rw-r--r--ksvg/impl/SVGAnimatedRectImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedStringImpl.cc90
-rw-r--r--ksvg/impl/SVGAnimatedStringImpl.cpp88
-rw-r--r--ksvg/impl/SVGAnimatedStringImpl.h2
-rw-r--r--ksvg/impl/SVGAnimatedTransformListImpl.cc83
-rw-r--r--ksvg/impl/SVGAnimatedTransformListImpl.cpp81
-rw-r--r--ksvg/impl/SVGAnimatedTransformListImpl.h2
-rw-r--r--ksvg/impl/SVGAnimationElementImpl.cc465
-rw-r--r--ksvg/impl/SVGAnimationElementImpl.cpp463
-rw-r--r--ksvg/impl/SVGAnimationElementImpl.h2
-rw-r--r--ksvg/impl/SVGBBoxTarget.cc55
-rw-r--r--ksvg/impl/SVGBBoxTarget.cpp53
-rw-r--r--ksvg/impl/SVGBBoxTarget.h2
-rw-r--r--ksvg/impl/SVGCSSRuleImpl.cc33
-rw-r--r--ksvg/impl/SVGCSSRuleImpl.cpp31
-rw-r--r--ksvg/impl/SVGCSSRuleImpl.h2
-rw-r--r--ksvg/impl/SVGCircleElementImpl.cc178
-rw-r--r--ksvg/impl/SVGCircleElementImpl.cpp176
-rw-r--r--ksvg/impl/SVGCircleElementImpl.h2
-rw-r--r--ksvg/impl/SVGClipPathElementImpl.cc104
-rw-r--r--ksvg/impl/SVGClipPathElementImpl.cpp102
-rw-r--r--ksvg/impl/SVGClipPathElementImpl.h2
-rw-r--r--ksvg/impl/SVGColorImpl.cc540
-rw-r--r--ksvg/impl/SVGColorImpl.cpp538
-rw-r--r--ksvg/impl/SVGColorImpl.h2
-rw-r--r--ksvg/impl/SVGColorProfileElementImpl.cc271
-rw-r--r--ksvg/impl/SVGColorProfileElementImpl.cpp269
-rw-r--r--ksvg/impl/SVGColorProfileElementImpl.h2
-rw-r--r--ksvg/impl/SVGColorProfileRuleImpl.cc63
-rw-r--r--ksvg/impl/SVGColorProfileRuleImpl.cpp61
-rw-r--r--ksvg/impl/SVGColorProfileRuleImpl.h2
-rw-r--r--ksvg/impl/SVGComponentTransferFunctionElementImpl.cc105
-rw-r--r--ksvg/impl/SVGComponentTransferFunctionElementImpl.cpp103
-rw-r--r--ksvg/impl/SVGComponentTransferFunctionElementImpl.h2
-rw-r--r--ksvg/impl/SVGContainerImpl.cc135
-rw-r--r--ksvg/impl/SVGContainerImpl.cpp133
-rw-r--r--ksvg/impl/SVGContainerImpl.h2
-rw-r--r--ksvg/impl/SVGCursorElementImpl.cc104
-rw-r--r--ksvg/impl/SVGCursorElementImpl.cpp102
-rw-r--r--ksvg/impl/SVGCursorElementImpl.h2
-rw-r--r--ksvg/impl/SVGDefinitionSrcElementImpl.cc33
-rw-r--r--ksvg/impl/SVGDefinitionSrcElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGDefinitionSrcElementImpl.h2
-rw-r--r--ksvg/impl/SVGDefsElementImpl.cc34
-rw-r--r--ksvg/impl/SVGDefsElementImpl.cpp32
-rw-r--r--ksvg/impl/SVGDefsElementImpl.h2
-rw-r--r--ksvg/impl/SVGDescElementImpl.cc39
-rw-r--r--ksvg/impl/SVGDescElementImpl.cpp37
-rw-r--r--ksvg/impl/SVGDescElementImpl.h2
-rw-r--r--ksvg/impl/SVGDocumentImpl.cc705
-rw-r--r--ksvg/impl/SVGDocumentImpl.cpp703
-rw-r--r--ksvg/impl/SVGDocumentImpl.h2
-rw-r--r--ksvg/impl/SVGEcma.cc844
-rw-r--r--ksvg/impl/SVGEcma.cpp842
-rw-r--r--ksvg/impl/SVGEcma.h2
-rw-r--r--ksvg/impl/SVGElementImpl.cc713
-rw-r--r--ksvg/impl/SVGElementImpl.cpp711
-rw-r--r--ksvg/impl/SVGElementImpl.h2
-rw-r--r--ksvg/impl/SVGElementInstanceImpl.cc108
-rw-r--r--ksvg/impl/SVGElementInstanceImpl.cpp106
-rw-r--r--ksvg/impl/SVGElementInstanceImpl.h2
-rw-r--r--ksvg/impl/SVGElementInstanceListImpl.cc44
-rw-r--r--ksvg/impl/SVGElementInstanceListImpl.cpp42
-rw-r--r--ksvg/impl/SVGElementInstanceListImpl.h2
-rw-r--r--ksvg/impl/SVGEllipseElementImpl.cc200
-rw-r--r--ksvg/impl/SVGEllipseElementImpl.cpp198
-rw-r--r--ksvg/impl/SVGEllipseElementImpl.h2
-rw-r--r--ksvg/impl/SVGEventImpl.cc992
-rw-r--r--ksvg/impl/SVGEventImpl.cpp990
-rw-r--r--ksvg/impl/SVGEventImpl.h2
-rw-r--r--ksvg/impl/SVGExternalResourcesRequiredImpl.cc88
-rw-r--r--ksvg/impl/SVGExternalResourcesRequiredImpl.cpp86
-rw-r--r--ksvg/impl/SVGExternalResourcesRequiredImpl.h2
-rw-r--r--ksvg/impl/SVGFEBlendElementImpl.cc64
-rw-r--r--ksvg/impl/SVGFEBlendElementImpl.cpp62
-rw-r--r--ksvg/impl/SVGFEBlendElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEColorMatrixElementImpl.cc65
-rw-r--r--ksvg/impl/SVGFEColorMatrixElementImpl.cpp63
-rw-r--r--ksvg/impl/SVGFEColorMatrixElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEComponentTransferElementImpl.cc43
-rw-r--r--ksvg/impl/SVGFEComponentTransferElementImpl.cpp41
-rw-r--r--ksvg/impl/SVGFEComponentTransferElementImpl.h2
-rw-r--r--ksvg/impl/SVGFECompositeElementImpl.cc105
-rw-r--r--ksvg/impl/SVGFECompositeElementImpl.cpp103
-rw-r--r--ksvg/impl/SVGFECompositeElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEConvolveMatrixElementImpl.cc149
-rw-r--r--ksvg/impl/SVGFEConvolveMatrixElementImpl.cpp147
-rw-r--r--ksvg/impl/SVGFEConvolveMatrixElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEDiffuseLightingElementImpl.cc64
-rw-r--r--ksvg/impl/SVGFEDiffuseLightingElementImpl.cpp62
-rw-r--r--ksvg/impl/SVGFEDiffuseLightingElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEDisplacementMapElementImpl.cc85
-rw-r--r--ksvg/impl/SVGFEDisplacementMapElementImpl.cpp83
-rw-r--r--ksvg/impl/SVGFEDisplacementMapElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEDistantLightElementImpl.cc53
-rw-r--r--ksvg/impl/SVGFEDistantLightElementImpl.cpp51
-rw-r--r--ksvg/impl/SVGFEDistantLightElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEFloodElementImpl.cc43
-rw-r--r--ksvg/impl/SVGFEFloodElementImpl.cpp41
-rw-r--r--ksvg/impl/SVGFEFloodElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEFuncAElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFEFuncAElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFEFuncAElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEFuncBElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFEFuncBElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFEFuncBElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEFuncGElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFEFuncGElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFEFuncGElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEFuncRElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFEFuncRElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFEFuncRElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEGaussianBlurElementImpl.cc68
-rw-r--r--ksvg/impl/SVGFEGaussianBlurElementImpl.cpp66
-rw-r--r--ksvg/impl/SVGFEGaussianBlurElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEImageElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFEImageElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFEImageElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEMergeElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFEMergeElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFEMergeElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEMergeNodeElementImpl.cc43
-rw-r--r--ksvg/impl/SVGFEMergeNodeElementImpl.cpp41
-rw-r--r--ksvg/impl/SVGFEMergeNodeElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEMorphologyElementImpl.cc75
-rw-r--r--ksvg/impl/SVGFEMorphologyElementImpl.cpp73
-rw-r--r--ksvg/impl/SVGFEMorphologyElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEOffsetElementImpl.cc64
-rw-r--r--ksvg/impl/SVGFEOffsetElementImpl.cpp62
-rw-r--r--ksvg/impl/SVGFEOffsetElementImpl.h2
-rw-r--r--ksvg/impl/SVGFEPointLightElementImpl.cc63
-rw-r--r--ksvg/impl/SVGFEPointLightElementImpl.cpp61
-rw-r--r--ksvg/impl/SVGFEPointLightElementImpl.h2
-rw-r--r--ksvg/impl/SVGFESpecularLightingElementImpl.cc74
-rw-r--r--ksvg/impl/SVGFESpecularLightingElementImpl.cpp72
-rw-r--r--ksvg/impl/SVGFESpecularLightingElementImpl.h2
-rw-r--r--ksvg/impl/SVGFESpotLightElementImpl.cc113
-rw-r--r--ksvg/impl/SVGFESpotLightElementImpl.cpp111
-rw-r--r--ksvg/impl/SVGFESpotLightElementImpl.h2
-rw-r--r--ksvg/impl/SVGFETileElementImpl.cc43
-rw-r--r--ksvg/impl/SVGFETileElementImpl.cpp41
-rw-r--r--ksvg/impl/SVGFETileElementImpl.h2
-rw-r--r--ksvg/impl/SVGFETurbulenceElementImpl.cc100
-rw-r--r--ksvg/impl/SVGFETurbulenceElementImpl.cpp98
-rw-r--r--ksvg/impl/SVGFETurbulenceElementImpl.h2
-rw-r--r--ksvg/impl/SVGFilterElementImpl.cc119
-rw-r--r--ksvg/impl/SVGFilterElementImpl.cpp117
-rw-r--r--ksvg/impl/SVGFilterElementImpl.h2
-rw-r--r--ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cc84
-rw-r--r--ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cpp82
-rw-r--r--ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.h2
-rw-r--r--ksvg/impl/SVGFitToViewBoxImpl.cc141
-rw-r--r--ksvg/impl/SVGFitToViewBoxImpl.cpp139
-rw-r--r--ksvg/impl/SVGFitToViewBoxImpl.h2
-rw-r--r--ksvg/impl/SVGFontElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFontElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFontElementImpl.h2
-rw-r--r--ksvg/impl/SVGFontFaceElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFontFaceElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFontFaceElementImpl.h2
-rw-r--r--ksvg/impl/SVGFontFaceFormatElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFontFaceFormatElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFontFaceFormatElementImpl.h2
-rw-r--r--ksvg/impl/SVGFontFaceNameElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFontFaceNameElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFontFaceNameElementImpl.h2
-rw-r--r--ksvg/impl/SVGFontFaceSrcElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFontFaceSrcElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFontFaceSrcElementImpl.h2
-rw-r--r--ksvg/impl/SVGFontFaceUriElementImpl.cc33
-rw-r--r--ksvg/impl/SVGFontFaceUriElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGFontFaceUriElementImpl.h2
-rw-r--r--ksvg/impl/SVGForeignObjectElementImpl.cc121
-rw-r--r--ksvg/impl/SVGForeignObjectElementImpl.cpp119
-rw-r--r--ksvg/impl/SVGForeignObjectElementImpl.h2
-rw-r--r--ksvg/impl/SVGGElementImpl.cc36
-rw-r--r--ksvg/impl/SVGGElementImpl.cpp34
-rw-r--r--ksvg/impl/SVGGElementImpl.h2
-rw-r--r--ksvg/impl/SVGGlyphElementImpl.cc98
-rw-r--r--ksvg/impl/SVGGlyphElementImpl.cpp96
-rw-r--r--ksvg/impl/SVGGlyphElementImpl.h2
-rw-r--r--ksvg/impl/SVGGlyphRefElementImpl.cc134
-rw-r--r--ksvg/impl/SVGGlyphRefElementImpl.cpp132
-rw-r--r--ksvg/impl/SVGGlyphRefElementImpl.h2
-rw-r--r--ksvg/impl/SVGGradientElementImpl.cc264
-rw-r--r--ksvg/impl/SVGGradientElementImpl.cpp262
-rw-r--r--ksvg/impl/SVGGradientElementImpl.h2
-rw-r--r--ksvg/impl/SVGHKernElementImpl.cc33
-rw-r--r--ksvg/impl/SVGHKernElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGHKernElementImpl.h2
-rw-r--r--ksvg/impl/SVGHelperImpl.cc230
-rw-r--r--ksvg/impl/SVGHelperImpl.cpp228
-rw-r--r--ksvg/impl/SVGHelperImpl.h2
-rw-r--r--ksvg/impl/SVGICCColorImpl.cc107
-rw-r--r--ksvg/impl/SVGICCColorImpl.cpp105
-rw-r--r--ksvg/impl/SVGICCColorImpl.h2
-rw-r--r--ksvg/impl/SVGImageElementImpl.cc522
-rw-r--r--ksvg/impl/SVGImageElementImpl.cpp520
-rw-r--r--ksvg/impl/SVGImageElementImpl.h2
-rw-r--r--ksvg/impl/SVGLangSpaceImpl.cc130
-rw-r--r--ksvg/impl/SVGLangSpaceImpl.cpp128
-rw-r--r--ksvg/impl/SVGLangSpaceImpl.h2
-rw-r--r--ksvg/impl/SVGLengthImpl.cc510
-rw-r--r--ksvg/impl/SVGLengthImpl.cpp508
-rw-r--r--ksvg/impl/SVGLengthImpl.h2
-rw-r--r--ksvg/impl/SVGLengthListImpl.cc64
-rw-r--r--ksvg/impl/SVGLengthListImpl.cpp62
-rw-r--r--ksvg/impl/SVGLengthListImpl.h2
-rw-r--r--ksvg/impl/SVGLineElementImpl.cc213
-rw-r--r--ksvg/impl/SVGLineElementImpl.cpp211
-rw-r--r--ksvg/impl/SVGLineElementImpl.h2
-rw-r--r--ksvg/impl/SVGLinearGradientElementImpl.cc201
-rw-r--r--ksvg/impl/SVGLinearGradientElementImpl.cpp199
-rw-r--r--ksvg/impl/SVGLinearGradientElementImpl.h2
-rw-r--r--ksvg/impl/SVGLocatableImpl.cc208
-rw-r--r--ksvg/impl/SVGLocatableImpl.cpp206
-rw-r--r--ksvg/impl/SVGLocatableImpl.h2
-rw-r--r--ksvg/impl/SVGMPathElementImpl.cc33
-rw-r--r--ksvg/impl/SVGMPathElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGMPathElementImpl.h2
-rw-r--r--ksvg/impl/SVGMarkerElementImpl.cc424
-rw-r--r--ksvg/impl/SVGMarkerElementImpl.cpp422
-rw-r--r--ksvg/impl/SVGMarkerElementImpl.h2
-rw-r--r--ksvg/impl/SVGMaskElementImpl.cc542
-rw-r--r--ksvg/impl/SVGMaskElementImpl.cpp540
-rw-r--r--ksvg/impl/SVGMaskElementImpl.h2
-rw-r--r--ksvg/impl/SVGMatrixImpl.cc460
-rw-r--r--ksvg/impl/SVGMatrixImpl.cpp458
-rw-r--r--ksvg/impl/SVGMatrixImpl.h2
-rw-r--r--ksvg/impl/SVGMetadataElementImpl.cc33
-rw-r--r--ksvg/impl/SVGMetadataElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGMetadataElementImpl.h2
-rw-r--r--ksvg/impl/SVGMissingGlyphElementImpl.cc33
-rw-r--r--ksvg/impl/SVGMissingGlyphElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGMissingGlyphElementImpl.h2
-rw-r--r--ksvg/impl/SVGNumberImpl.cc83
-rw-r--r--ksvg/impl/SVGNumberImpl.cpp81
-rw-r--r--ksvg/impl/SVGNumberImpl.h2
-rw-r--r--ksvg/impl/SVGNumberListImpl.cc64
-rw-r--r--ksvg/impl/SVGNumberListImpl.cpp62
-rw-r--r--ksvg/impl/SVGNumberListImpl.h2
-rw-r--r--ksvg/impl/SVGPaintImpl.cc175
-rw-r--r--ksvg/impl/SVGPaintImpl.cpp173
-rw-r--r--ksvg/impl/SVGPaintImpl.h2
-rw-r--r--ksvg/impl/SVGPaintServerImpl.cc55
-rw-r--r--ksvg/impl/SVGPaintServerImpl.cpp52
-rw-r--r--ksvg/impl/SVGPaintServerImpl.h3
-rw-r--r--ksvg/impl/SVGPathElementImpl.cc868
-rw-r--r--ksvg/impl/SVGPathElementImpl.cpp866
-rw-r--r--ksvg/impl/SVGPathElementImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegArcImpl.cc495
-rw-r--r--ksvg/impl/SVGPathSegArcImpl.cpp493
-rw-r--r--ksvg/impl/SVGPathSegArcImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegClosePathImpl.cc46
-rw-r--r--ksvg/impl/SVGPathSegClosePathImpl.cpp44
-rw-r--r--ksvg/impl/SVGPathSegClosePathImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegCurvetoCubicImpl.cc325
-rw-r--r--ksvg/impl/SVGPathSegCurvetoCubicImpl.cpp323
-rw-r--r--ksvg/impl/SVGPathSegCurvetoCubicImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cc298
-rw-r--r--ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cpp296
-rw-r--r--ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cc260
-rw-r--r--ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cpp258
-rw-r--r--ksvg/impl/SVGPathSegCurvetoQuadraticImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cc235
-rw-r--r--ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cpp233
-rw-r--r--ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegImpl.cc107
-rw-r--r--ksvg/impl/SVGPathSegImpl.cpp105
-rw-r--r--ksvg/impl/SVGPathSegImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegLinetoHorizontalImpl.cc167
-rw-r--r--ksvg/impl/SVGPathSegLinetoHorizontalImpl.cpp165
-rw-r--r--ksvg/impl/SVGPathSegLinetoHorizontalImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegLinetoImpl.cc196
-rw-r--r--ksvg/impl/SVGPathSegLinetoImpl.cpp194
-rw-r--r--ksvg/impl/SVGPathSegLinetoImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegLinetoVerticalImpl.cc165
-rw-r--r--ksvg/impl/SVGPathSegLinetoVerticalImpl.cpp163
-rw-r--r--ksvg/impl/SVGPathSegLinetoVerticalImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegListImpl.cc64
-rw-r--r--ksvg/impl/SVGPathSegListImpl.cpp62
-rw-r--r--ksvg/impl/SVGPathSegListImpl.h2
-rw-r--r--ksvg/impl/SVGPathSegMovetoImpl.cc196
-rw-r--r--ksvg/impl/SVGPathSegMovetoImpl.cpp194
-rw-r--r--ksvg/impl/SVGPathSegMovetoImpl.h2
-rw-r--r--ksvg/impl/SVGPatternElementImpl.cpp (renamed from ksvg/impl/SVGPatternElementImpl.cc)0
-rw-r--r--ksvg/impl/SVGPatternElementImpl.h2
-rw-r--r--ksvg/impl/SVGPointImpl.cc108
-rw-r--r--ksvg/impl/SVGPointImpl.cpp106
-rw-r--r--ksvg/impl/SVGPointListImpl.cc64
-rw-r--r--ksvg/impl/SVGPointListImpl.cpp62
-rw-r--r--ksvg/impl/SVGPointListImpl.h2
-rw-r--r--ksvg/impl/SVGPolyElementImpl.cc141
-rw-r--r--ksvg/impl/SVGPolyElementImpl.cpp139
-rw-r--r--ksvg/impl/SVGPolyElementImpl.h2
-rw-r--r--ksvg/impl/SVGPolygonElementImpl.cc88
-rw-r--r--ksvg/impl/SVGPolygonElementImpl.cpp86
-rw-r--r--ksvg/impl/SVGPolygonElementImpl.h2
-rw-r--r--ksvg/impl/SVGPolylineElementImpl.cc100
-rw-r--r--ksvg/impl/SVGPolylineElementImpl.cpp98
-rw-r--r--ksvg/impl/SVGPolylineElementImpl.h2
-rw-r--r--ksvg/impl/SVGPreserveAspectRatioImpl.cc217
-rw-r--r--ksvg/impl/SVGPreserveAspectRatioImpl.cpp215
-rw-r--r--ksvg/impl/SVGPreserveAspectRatioImpl.h2
-rw-r--r--ksvg/impl/SVGRadialGradientElementImpl.cc216
-rw-r--r--ksvg/impl/SVGRadialGradientElementImpl.cpp214
-rw-r--r--ksvg/impl/SVGRadialGradientElementImpl.h2
-rw-r--r--ksvg/impl/SVGRectElementImpl.cc244
-rw-r--r--ksvg/impl/SVGRectElementImpl.cpp242
-rw-r--r--ksvg/impl/SVGRectElementImpl.h2
-rw-r--r--ksvg/impl/SVGRectImpl.cc157
-rw-r--r--ksvg/impl/SVGRectImpl.cpp155
-rw-r--r--ksvg/impl/SVGRectImpl.h2
-rw-r--r--ksvg/impl/SVGSVGElementImpl.cc982
-rw-r--r--ksvg/impl/SVGSVGElementImpl.cpp980
-rw-r--r--ksvg/impl/SVGSVGElementImpl.h2
-rw-r--r--ksvg/impl/SVGScriptElementImpl.cc185
-rw-r--r--ksvg/impl/SVGScriptElementImpl.cpp183
-rw-r--r--ksvg/impl/SVGScriptElementImpl.h2
-rw-r--r--ksvg/impl/SVGSetElementImpl.cc48
-rw-r--r--ksvg/impl/SVGSetElementImpl.cpp46
-rw-r--r--ksvg/impl/SVGSetElementImpl.h2
-rw-r--r--ksvg/impl/SVGShapeImpl.cc162
-rw-r--r--ksvg/impl/SVGShapeImpl.cpp160
-rw-r--r--ksvg/impl/SVGShapeImpl.h2
-rw-r--r--ksvg/impl/SVGStopElementImpl.cc125
-rw-r--r--ksvg/impl/SVGStopElementImpl.cpp123
-rw-r--r--ksvg/impl/SVGStopElementImpl.h2
-rw-r--r--ksvg/impl/SVGStringListImpl.cc93
-rw-r--r--ksvg/impl/SVGStringListImpl.cpp91
-rw-r--r--ksvg/impl/SVGStringListImpl.h2
-rw-r--r--ksvg/impl/SVGStylableImpl.cc1309
-rw-r--r--ksvg/impl/SVGStylableImpl.cpp1307
-rw-r--r--ksvg/impl/SVGStylableImpl.h2
-rw-r--r--ksvg/impl/SVGStyleElementImpl.cc135
-rw-r--r--ksvg/impl/SVGStyleElementImpl.cpp133
-rw-r--r--ksvg/impl/SVGStyleElementImpl.h2
-rw-r--r--ksvg/impl/SVGSwitchElementImpl.cc58
-rw-r--r--ksvg/impl/SVGSwitchElementImpl.cpp56
-rw-r--r--ksvg/impl/SVGSwitchElementImpl.h2
-rw-r--r--ksvg/impl/SVGSymbolElementImpl.cc106
-rw-r--r--ksvg/impl/SVGSymbolElementImpl.cpp104
-rw-r--r--ksvg/impl/SVGSymbolElementImpl.h2
-rw-r--r--ksvg/impl/SVGTRefElementImpl.cc76
-rw-r--r--ksvg/impl/SVGTRefElementImpl.cpp74
-rw-r--r--ksvg/impl/SVGTRefElementImpl.h2
-rw-r--r--ksvg/impl/SVGTSpanElementImpl.cc64
-rw-r--r--ksvg/impl/SVGTSpanElementImpl.cpp62
-rw-r--r--ksvg/impl/SVGTSpanElementImpl.h2
-rw-r--r--ksvg/impl/SVGTestsImpl.cc178
-rw-r--r--ksvg/impl/SVGTestsImpl.cpp176
-rw-r--r--ksvg/impl/SVGTestsImpl.h2
-rw-r--r--ksvg/impl/SVGTextContentElementImpl.cc285
-rw-r--r--ksvg/impl/SVGTextContentElementImpl.cpp283
-rw-r--r--ksvg/impl/SVGTextContentElementImpl.h2
-rw-r--r--ksvg/impl/SVGTextElementImpl.cc124
-rw-r--r--ksvg/impl/SVGTextElementImpl.cpp122
-rw-r--r--ksvg/impl/SVGTextElementImpl.h2
-rw-r--r--ksvg/impl/SVGTextPathElementImpl.cc240
-rw-r--r--ksvg/impl/SVGTextPathElementImpl.cpp238
-rw-r--r--ksvg/impl/SVGTextPathElementImpl.h2
-rw-r--r--ksvg/impl/SVGTextPositioningElementImpl.cc198
-rw-r--r--ksvg/impl/SVGTextPositioningElementImpl.cpp196
-rw-r--r--ksvg/impl/SVGTextPositioningElementImpl.h2
-rw-r--r--ksvg/impl/SVGTimeScheduler.cc234
-rw-r--r--ksvg/impl/SVGTimeScheduler.cpp232
-rw-r--r--ksvg/impl/SVGTimeScheduler.h2
-rw-r--r--ksvg/impl/SVGTitleElementImpl.cc39
-rw-r--r--ksvg/impl/SVGTitleElementImpl.cpp37
-rw-r--r--ksvg/impl/SVGTitleElementImpl.h2
-rw-r--r--ksvg/impl/SVGTransformImpl.cc240
-rw-r--r--ksvg/impl/SVGTransformImpl.cpp238
-rw-r--r--ksvg/impl/SVGTransformImpl.h2
-rw-r--r--ksvg/impl/SVGTransformListImpl.cc103
-rw-r--r--ksvg/impl/SVGTransformListImpl.cpp101
-rw-r--r--ksvg/impl/SVGTransformListImpl.h2
-rw-r--r--ksvg/impl/SVGTransformableImpl.cc169
-rw-r--r--ksvg/impl/SVGTransformableImpl.cpp167
-rw-r--r--ksvg/impl/SVGTransformableImpl.h2
-rw-r--r--ksvg/impl/SVGURIReferenceImpl.cc135
-rw-r--r--ksvg/impl/SVGURIReferenceImpl.cpp133
-rw-r--r--ksvg/impl/SVGURIReferenceImpl.h2
-rw-r--r--ksvg/impl/SVGUnitConverter.h2
-rw-r--r--ksvg/impl/SVGUseElementImpl.cc409
-rw-r--r--ksvg/impl/SVGUseElementImpl.cpp407
-rw-r--r--ksvg/impl/SVGUseElementImpl.h2
-rw-r--r--ksvg/impl/SVGVKernElementImpl.cc33
-rw-r--r--ksvg/impl/SVGVKernElementImpl.cpp31
-rw-r--r--ksvg/impl/SVGVKernElementImpl.h2
-rw-r--r--ksvg/impl/SVGViewElementImpl.cc94
-rw-r--r--ksvg/impl/SVGViewElementImpl.cpp92
-rw-r--r--ksvg/impl/SVGViewElementImpl.h2
-rw-r--r--ksvg/impl/SVGViewSpecImpl.cc98
-rw-r--r--ksvg/impl/SVGViewSpecImpl.cpp96
-rw-r--r--ksvg/impl/SVGViewSpecImpl.h2
-rw-r--r--ksvg/impl/SVGWindowImpl.cc187
-rw-r--r--ksvg/impl/SVGWindowImpl.cpp185
-rw-r--r--ksvg/impl/SVGWindowImpl.h2
-rw-r--r--ksvg/impl/SVGZoomAndPanImpl.cc112
-rw-r--r--ksvg/impl/SVGZoomAndPanImpl.cpp110
-rw-r--r--ksvg/impl/SVGZoomAndPanImpl.h2
-rw-r--r--ksvg/impl/SVGZoomEventImpl.cc111
-rw-r--r--ksvg/impl/SVGZoomEventImpl.cpp109
-rw-r--r--ksvg/impl/SVGZoomEventImpl.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Affine.cpp2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Affine.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/BezierPath.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/CMakeLists.txt2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Cache.h7
-rw-r--r--ksvg/impl/libs/libtext2path/src/Converter.cpp2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Converter.h6
-rw-r--r--ksvg/impl/libs/libtext2path/src/Font.cpp2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Font.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Glyph.cpp2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Glyph.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/GlyphTracer.cpp2
-rw-r--r--ksvg/impl/libs/libtext2path/src/GlyphTracer.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Point.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/QtUnicode.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Rectangle.cpp2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Rectangle.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/Tools.h2
-rw-r--r--ksvg/impl/libs/libtext2path/src/myboost/assert.hpp24
-rw-r--r--ksvg/impl/libs/libtext2path/src/myboost/checked_delete.hpp61
-rw-r--r--ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.hpp74
-rw-r--r--ksvg/impl/libs/libtext2path/src/myboost/shared_count.hpp367
-rw-r--r--ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.hpp395
-rw-r--r--ksvg/impl/libs/libtext2path/src/myboost/throw_exception.hpp30
-rw-r--r--ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib-drawable.c1
-rw-r--r--ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib.c1
-rw-r--r--ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.c2
-rw-r--r--ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.h2
-rw-r--r--ksvg/impl/svgpathparser.cpp (renamed from ksvg/impl/svgpathparser.cc)0
-rw-r--r--ksvg/plugin/CMakeLists.txt9
-rw-r--r--ksvg/plugin/backends/agg/AggCanvasFactory.cpp2
-rw-r--r--ksvg/plugin/backends/agg/AggCanvasFactory.h2
-rw-r--r--ksvg/plugin/backends/agg/AggCanvasItems.cpp2
-rw-r--r--ksvg/plugin/backends/agg/AggCanvasItems.h2
-rw-r--r--ksvg/plugin/backends/agg/BezierPathAgg.cpp2
-rw-r--r--ksvg/plugin/backends/agg/BezierPathAgg.h2
-rw-r--r--ksvg/plugin/backends/agg/GlyphTracerAgg.cpp2
-rw-r--r--ksvg/plugin/backends/agg/GlyphTracerAgg.h2
-rw-r--r--ksvg/plugin/backends/agg/ksvgaggcanvas.desktop93
-rw-r--r--ksvg/plugin/backends/libart/BezierPathLibart.cpp2
-rw-r--r--ksvg/plugin/backends/libart/BezierPathLibart.h2
-rw-r--r--ksvg/plugin/backends/libart/CMakeLists.txt9
-rw-r--r--ksvg/plugin/backends/libart/GlyphTracerLibart.cpp2
-rw-r--r--ksvg/plugin/backends/libart/GlyphTracerLibart.h2
-rw-r--r--ksvg/plugin/backends/libart/LibartCanvas.cpp2
-rw-r--r--ksvg/plugin/backends/libart/LibartCanvas.h2
-rw-r--r--ksvg/plugin/backends/libart/LibartCanvasFactory.cpp2
-rw-r--r--ksvg/plugin/backends/libart/LibartCanvasFactory.h2
-rw-r--r--ksvg/plugin/backends/libart/LibartCanvasItems.cpp2
-rw-r--r--ksvg/plugin/backends/libart/ksvglibartcanvas.desktop93
-rw-r--r--ksvg/plugin/ksvg_factory.h2
-rw-r--r--ksvg/plugin/ksvg_plugin.cpp2
-rw-r--r--ksvg/plugin/ksvg_plugin.h2
-rw-r--r--ksvg/plugin/ksvg_widget.cpp2
-rw-r--r--ksvg/plugin/ksvg_widget.h2
-rw-r--r--ksvg/plugin/ksvgplugin.desktop78
-rw-r--r--ksvg/plugin/svgcreator.cpp2
-rw-r--r--ksvg/plugin/svgcreator.h2
-rw-r--r--ksvg/plugin/svgthumbnail.desktop43
-rwxr-xr-xksvg/scripts/check_hashtablesize.pl4
-rwxr-xr-xksvg/scripts/gen.sh24
-rwxr-xr-xksvg/scripts/genimpl.sh21
-rwxr-xr-xksvg/scripts/getjs.php2
-rw-r--r--ksvg/scripts/makecc2
-rw-r--r--ksvg/scripts/makeimpl8
-rw-r--r--ksvg/test/external/CMakeLists.txt3
-rw-r--r--ksvg/test/external/Makefile.am2
-rw-r--r--ksvg/test/external/SVGTestWidget.cc206
-rw-r--r--ksvg/test/external/SVGTestWidget.cpp204
-rw-r--r--ksvg/test/external/printnodetest.h2
-rw-r--r--ksvg/test/external/svgdisplay.cpp (renamed from ksvg/test/external/svgdisplay.cc)0
-rw-r--r--kuickshow/src/CMakeL10n.txt6
-rw-r--r--kuickshow/src/CMakeLists.txt3
-rw-r--r--kuickshow/src/kuickshow.desktop80
-rw-r--r--kview/CMakeL10n.txt6
-rw-r--r--kview/CMakeLists.txt7
-rw-r--r--kview/ChangeLog2
-rw-r--r--kview/TODO2
-rw-r--r--kview/config/CMakeLists.txt7
-rw-r--r--kview/config/kviewconfmodules.cpp3
-rw-r--r--kview/config/kviewconfmodules.h3
-rw-r--r--kview/config/kviewgeneralconfig.desktop116
-rw-r--r--kview/config/plugins/CMakeLists.txt6
-rw-r--r--kview/config/plugins/kviewpluginsconfig.cpp3
-rw-r--r--kview/config/plugins/kviewpluginsconfig.desktop103
-rw-r--r--kview/config/plugins/kviewpluginsconfig.h3
-rw-r--r--kview/kimageviewer/CMakeLists.txt8
-rw-r--r--kview/kimageviewer/canvas.cpp2
-rw-r--r--kview/kimageviewer/canvas.h3
-rw-r--r--kview/kimageviewer/kimageviewer.desktop57
-rw-r--r--kview/kimageviewer/kimageviewercanvas.desktop56
-rw-r--r--kview/kimageviewer/viewer.cpp1
-rw-r--r--kview/kimageviewer/viewer.h3
-rw-r--r--kview/kview.cpp3
-rw-r--r--kview/kview.desktop81
-rw-r--r--kview/kview.h3
-rw-r--r--kview/kviewcanvas/CMakeLists.txt6
-rw-r--r--kview/kviewcanvas/ChangeLog2
-rw-r--r--kview/kviewcanvas/config/CMakeLists.txt8
-rw-r--r--kview/kviewcanvas/config/confmodules.cpp3
-rw-r--r--kview/kviewcanvas/config/confmodules.h3
-rw-r--r--kview/kviewcanvas/config/defaults.h2
-rw-r--r--kview/kviewcanvas/config/kviewcanvasconfig.desktop103
-rw-r--r--kview/kviewcanvas/kimagecanvas.cpp2
-rw-r--r--kview/kviewcanvas/kimagecanvas.h3
-rw-r--r--kview/kviewcanvas/kimageholder.cpp2
-rw-r--r--kview/kviewcanvas/kimageholder.h3
-rw-r--r--kview/kviewcanvas/kviewcanvas.desktop57
-rw-r--r--kview/kviewviewer/CMakeLists.txt7
-rw-r--r--kview/kviewviewer/ChangeLog2
-rw-r--r--kview/kviewviewer/config/CMakeLists.txt8
-rw-r--r--kview/kviewviewer/config/kviewviewerpluginsconfig.cpp3
-rw-r--r--kview/kviewviewer/config/kviewviewerpluginsconfig.desktop103
-rw-r--r--kview/kviewviewer/config/kviewviewerpluginsconfig.h3
-rw-r--r--kview/kviewviewer/imagesettings.cpp2
-rw-r--r--kview/kviewviewer/imagesettings.h4
-rw-r--r--kview/kviewviewer/kviewkonqextension.cpp4
-rw-r--r--kview/kviewviewer/kviewkonqextension.h3
-rw-r--r--kview/kviewviewer/kviewviewer.cpp4
-rw-r--r--kview/kviewviewer/kviewviewer.desktop109
-rw-r--r--kview/kviewviewer/kviewviewer.h3
-rw-r--r--kview/kviewviewer/kviewvieweriface.h2
-rw-r--r--kview/kviewviewer/printimagesettings.ui4
-rw-r--r--kview/main.cpp2
-rw-r--r--kview/modules/browser/CMakeLists.txt14
-rw-r--r--kview/modules/browser/kmyfileitemlist.h3
-rw-r--r--kview/modules/browser/kviewbrowser.cpp2
-rw-r--r--kview/modules/browser/kviewbrowser.desktop115
-rw-r--r--kview/modules/browser/kviewbrowser.h2
-rw-r--r--kview/modules/effects/CMakeLists.txt14
-rw-r--r--kview/modules/effects/kvieweffects.cpp2
-rw-r--r--kview/modules/effects/kvieweffects.desktop105
-rw-r--r--kview/modules/effects/kvieweffects.h2
-rw-r--r--kview/modules/presenter/CMakeLists.txt14
-rw-r--r--kview/modules/presenter/config/CMakeLists.txt8
-rw-r--r--kview/modules/presenter/config/kviewpresenterconfig.cpp3
-rw-r--r--kview/modules/presenter/config/kviewpresenterconfig.desktop108
-rw-r--r--kview/modules/presenter/config/kviewpresenterconfig.h3
-rw-r--r--kview/modules/presenter/imagelistdialog.ui19
-rw-r--r--kview/modules/presenter/imagelistitem.cpp2
-rw-r--r--kview/modules/presenter/imagelistitem.h2
-rw-r--r--kview/modules/presenter/kviewpresenter.cpp2
-rw-r--r--kview/modules/presenter/kviewpresenter.desktop104
-rw-r--r--kview/modules/presenter/kviewpresenter.h2
-rw-r--r--kview/modules/presenter/kviewpresenterconfmodule.cpp3
-rw-r--r--kview/modules/presenter/kviewpresenterconfmodule.h3
-rw-r--r--kview/modules/scale/kview_scale.cpp2
-rw-r--r--kview/modules/scale/kview_scale.desktop116
-rw-r--r--kview/modules/scale/kview_scale.h2
-rw-r--r--kview/modules/scanner/CMakeLists.txt14
-rw-r--r--kview/modules/scanner/kviewscanner.cpp2
-rw-r--r--kview/modules/scanner/kviewscanner.desktop113
-rw-r--r--kview/modules/scanner/kviewscanner.h2
-rw-r--r--kview/modules/template/kviewtemplate.cpp2
-rw-r--r--kview/modules/template/kviewtemplate.desktop115
-rw-r--r--kview/modules/template/kviewtemplate.h2
-rw-r--r--kview/photobook/CMakeLists.txt8
-rw-r--r--kview/photobook/photobook.desktop119
-rw-r--r--kviewshell/CMakeL10n.txt6
-rw-r--r--kviewshell/CMakeLists.txt15
-rw-r--r--kviewshell/anchor.h1
-rw-r--r--kviewshell/bookmark.h1
-rw-r--r--kviewshell/documentPageCache.h1
-rw-r--r--kviewshell/documentRenderer.h1
-rw-r--r--kviewshell/documentWidget.h1
-rw-r--r--kviewshell/emptyRenderer.h1
-rw-r--r--kviewshell/empty_multipage.h1
-rw-r--r--kviewshell/emptymultipage.desktop22
-rw-r--r--kviewshell/history.h1
-rw-r--r--kviewshell/hyperlink.h1
-rw-r--r--kviewshell/kprintDialogPage_pageoptions.h1
-rw-r--r--kviewshell/kviewpart.h1
-rw-r--r--kviewshell/kviewpart_iface.h1
-rw-r--r--kviewshell/kviewshell.h1
-rw-r--r--kviewshell/length.h1
-rw-r--r--kviewshell/marklist.h1
-rw-r--r--kviewshell/pageNumber.h1
-rw-r--r--kviewshell/pageSize.h1
-rw-r--r--kviewshell/pageSizeDialog.h1
-rw-r--r--kviewshell/pageSizeWidget.h1
-rw-r--r--kviewshell/pageView.h1
-rw-r--r--kviewshell/plugins/djvu/CMakeLists.txt7
-rw-r--r--kviewshell/plugins/djvu/djvumultipage.desktop48
-rw-r--r--kviewshell/plugins/djvu/libdjvu/Arrays.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/Arrays.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/BSByteStream.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/BSByteStream.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/BSEncodeByteStream.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/ByteStream.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/ByteStream.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DataPool.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DataPool.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmDir.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmDir0.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmDoc.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVmNav.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuAnno.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuDocument.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuFile.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuFileCache.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuGlobal.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuGlobalMemory.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuImage.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuInfo.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuInfo.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuMessage.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuNavDir.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuNavDir.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuPalette.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuPort.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuText.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuText.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuToPS.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GBitmap.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GBitmap.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GContainer.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GContainer.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GException.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GException.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GIFFManager.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GIFFManager.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GMapAreas.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GOS.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GOS.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GPixmap.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GPixmap.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GRect.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GRect.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GScaler.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GScaler.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GSmartPointer.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GString.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GString.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GThreads.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GThreads.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GURL.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GURL.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/GUnicode.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/IFFByteStream.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/IW44Image.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/IW44Image.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/JB2Image.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/JB2Image.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/JPEGDecoder.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/MMRDecoder.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/MMX.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/MMX.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/Template.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/XMLParser.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/XMLParser.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/XMLTags.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/XMLTags.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/ZPCodec.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/ZPCodec.h1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/configure.in.in8
-rw-r--r--kviewshell/plugins/djvu/libdjvu/debug.cpp1
-rw-r--r--kviewshell/plugins/djvu/libdjvu/debug.h1
-rw-r--r--kviewshell/renderedDocumentPage.h1
-rw-r--r--kviewshell/renderedDocumentPagePixmap.h1
-rw-r--r--kviewshell/renderedDocumentPagePrinter.h1
-rw-r--r--kviewshell/searchWidget.h1
-rw-r--r--kviewshell/selection.h1
-rw-r--r--kviewshell/simplePageSize.h1
-rw-r--r--kviewshell/sizePreview.h1
-rw-r--r--kviewshell/tableOfContents.h1
-rw-r--r--kviewshell/tdemultipage.desktop28
-rw-r--r--kviewshell/tdemultipage.h1
-rw-r--r--kviewshell/tdemultipageInterface.h1
-rw-r--r--kviewshell/textBox.h1
-rw-r--r--kviewshell/zoom.h1
-rw-r--r--kviewshell/zoomlimits.h1
-rw-r--r--libkscan/CMakeL10n.txt6
-rw-r--r--libkscan/CMakeLists.txt5
-rw-r--r--libkscan/scanservice.desktop64
-rw-r--r--tdefile-plugins/CMakeL10n.txt6
-rw-r--r--tdefile-plugins/bmp/CMakeLists.txt6
-rw-r--r--tdefile-plugins/bmp/tdefile_bmp.desktop58
-rw-r--r--tdefile-plugins/dds/CMakeLists.txt6
-rw-r--r--tdefile-plugins/dds/tdefile_dds.desktop45
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/CMakeLists.txt15
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake6
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/Makefile.am12
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc402
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp421
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-fontinfo.cpp (renamed from tdefile-plugins/dependencies/poppler-tqt/poppler-fontinfo.cc)0
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc267
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-link.cpp273
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cc95
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cpp95
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc377
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp383
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp (renamed from tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc)0
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-private.h9
-rw-r--r--tdefile-plugins/dvi/CMakeLists.txt6
-rw-r--r--tdefile-plugins/dvi/tdefile_dvi.desktop52
-rw-r--r--tdefile-plugins/exr/CMakeLists.txt6
-rw-r--r--tdefile-plugins/exr/tdefile_exr.cpp1
-rw-r--r--tdefile-plugins/exr/tdefile_exr.desktop49
-rw-r--r--tdefile-plugins/gif/CMakeLists.txt6
-rw-r--r--tdefile-plugins/gif/tdefile_gif.desktop58
-rw-r--r--tdefile-plugins/ico/CMakeLists.txt6
-rw-r--r--tdefile-plugins/ico/tdefile_ico.desktop57
-rw-r--r--tdefile-plugins/jpeg/CMakeLists.txt6
-rw-r--r--tdefile-plugins/jpeg/tdefile_jpeg.desktop56
-rw-r--r--tdefile-plugins/pcx/CMakeLists.txt6
-rw-r--r--tdefile-plugins/pcx/tdefile_pcx.cpp4
-rw-r--r--tdefile-plugins/pcx/tdefile_pcx.desktop54
-rw-r--r--tdefile-plugins/pcx/tdefile_pcx.h4
-rw-r--r--tdefile-plugins/pdf/CMakeLists.txt6
-rw-r--r--tdefile-plugins/pdf/tdefile_pdf.desktop57
-rw-r--r--tdefile-plugins/png/CMakeLists.txt6
-rw-r--r--tdefile-plugins/png/tdefile_png.desktop57
-rw-r--r--tdefile-plugins/pnm/CMakeLists.txt6
-rw-r--r--tdefile-plugins/pnm/tdefile_pnm.desktop52
-rw-r--r--tdefile-plugins/ps/CMakeLists.txt6
-rw-r--r--tdefile-plugins/ps/gscreator.cpp2
-rw-r--r--tdefile-plugins/ps/gsthumbnail.desktop53
-rw-r--r--tdefile-plugins/ps/tdefile_ps.desktop59
-rw-r--r--tdefile-plugins/raw/CMakeLists.txt6
-rw-r--r--tdefile-plugins/raw/tdefile_raw.desktop45
-rw-r--r--tdefile-plugins/rgb/CMakeLists.txt6
-rw-r--r--tdefile-plugins/rgb/tdefile_rgb.desktop53
-rw-r--r--tdefile-plugins/tga/CMakeLists.txt6
-rw-r--r--tdefile-plugins/tga/tdefile_tga.desktop56
-rw-r--r--tdefile-plugins/tiff/CMakeLists.txt6
-rw-r--r--tdefile-plugins/tiff/tdefile_tiff.desktop59
-rw-r--r--tdefile-plugins/xbm/CMakeLists.txt6
-rw-r--r--tdefile-plugins/xbm/tdefile_xbm.desktop57
-rw-r--r--tdefile-plugins/xpm/CMakeLists.txt6
-rw-r--r--tdefile-plugins/xpm/tdefile_xpm.desktop45
-rw-r--r--tdeiconedit/CMakeL10n.txt6
-rw-r--r--tdeiconedit/CMakeLists.txt2
-rw-r--r--tdeiconedit/palettetoolbar.cpp4
-rw-r--r--tdeiconedit/palettetoolbar.h4
-rw-r--r--tdeiconedit/tdeiconedit.desktop82
-rw-r--r--tdeiconedit/tdeicongrid.cpp1
-rw-r--r--translations/desktop_files/kamera.desktop/af.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ar.po32
-rw-r--r--translations/desktop_files/kamera.desktop/az.po32
-rw-r--r--translations/desktop_files/kamera.desktop/bg.po34
-rw-r--r--translations/desktop_files/kamera.desktop/br.po32
-rw-r--r--translations/desktop_files/kamera.desktop/bs.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ca.po32
-rw-r--r--translations/desktop_files/kamera.desktop/cs.po32
-rw-r--r--translations/desktop_files/kamera.desktop/cy.po32
-rw-r--r--translations/desktop_files/kamera.desktop/da.po32
-rw-r--r--translations/desktop_files/kamera.desktop/de.po32
-rw-r--r--translations/desktop_files/kamera.desktop/el.po32
-rw-r--r--translations/desktop_files/kamera.desktop/eo.po32
-rw-r--r--translations/desktop_files/kamera.desktop/es.po32
-rw-r--r--translations/desktop_files/kamera.desktop/et.po32
-rw-r--r--translations/desktop_files/kamera.desktop/eu.po32
-rw-r--r--translations/desktop_files/kamera.desktop/fa.po32
-rw-r--r--translations/desktop_files/kamera.desktop/fi.po32
-rw-r--r--translations/desktop_files/kamera.desktop/fr.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ga.po32
-rw-r--r--translations/desktop_files/kamera.desktop/gl.po32
-rw-r--r--translations/desktop_files/kamera.desktop/he.po32
-rw-r--r--translations/desktop_files/kamera.desktop/hi.po32
-rw-r--r--translations/desktop_files/kamera.desktop/hr.po32
-rw-r--r--translations/desktop_files/kamera.desktop/hu.po32
-rw-r--r--translations/desktop_files/kamera.desktop/id.po32
-rw-r--r--translations/desktop_files/kamera.desktop/is.po32
-rw-r--r--translations/desktop_files/kamera.desktop/it.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ja.po32
-rw-r--r--translations/desktop_files/kamera.desktop/kamera.desktop.pot32
-rw-r--r--translations/desktop_files/kamera.desktop/kk.po32
-rw-r--r--translations/desktop_files/kamera.desktop/km.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ko.po32
-rw-r--r--translations/desktop_files/kamera.desktop/lt.po32
-rw-r--r--translations/desktop_files/kamera.desktop/lv.po32
-rw-r--r--translations/desktop_files/kamera.desktop/mk.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ms.po32
-rw-r--r--translations/desktop_files/kamera.desktop/mt.po32
-rw-r--r--translations/desktop_files/kamera.desktop/nb.po32
-rw-r--r--translations/desktop_files/kamera.desktop/nds.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ne.po32
-rw-r--r--translations/desktop_files/kamera.desktop/nl.po32
-rw-r--r--translations/desktop_files/kamera.desktop/nn.po32
-rw-r--r--translations/desktop_files/kamera.desktop/nso.po32
-rw-r--r--translations/desktop_files/kamera.desktop/pa.po32
-rw-r--r--translations/desktop_files/kamera.desktop/pl.po32
-rw-r--r--translations/desktop_files/kamera.desktop/pt.po32
-rw-r--r--translations/desktop_files/kamera.desktop/pt_BR.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ro.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ru.po32
-rw-r--r--translations/desktop_files/kamera.desktop/se.po32
-rw-r--r--translations/desktop_files/kamera.desktop/sk.po32
-rw-r--r--translations/desktop_files/kamera.desktop/sl.po32
-rw-r--r--translations/desktop_files/kamera.desktop/sr.po32
-rw-r--r--translations/desktop_files/kamera.desktop/sr@Latn.po32
-rw-r--r--translations/desktop_files/kamera.desktop/sv.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ta.po32
-rw-r--r--translations/desktop_files/kamera.desktop/tg.po32
-rw-r--r--translations/desktop_files/kamera.desktop/th.po32
-rw-r--r--translations/desktop_files/kamera.desktop/tr.po32
-rw-r--r--translations/desktop_files/kamera.desktop/uk.po32
-rw-r--r--translations/desktop_files/kamera.desktop/uz.po32
-rw-r--r--translations/desktop_files/kamera.desktop/uz@cyrillic.po32
-rw-r--r--translations/desktop_files/kamera.desktop/ven.po33
-rw-r--r--translations/desktop_files/kamera.desktop/xh.po32
-rw-r--r--translations/desktop_files/kamera.desktop/zh_CN.po32
-rw-r--r--translations/desktop_files/kamera.desktop/zh_HK.po32
-rw-r--r--translations/desktop_files/kamera.desktop/zh_TW.po32
-rw-r--r--translations/desktop_files/kamera.desktop/zu.po32
-rw-r--r--translations/desktop_files/kcoloredit-desktops/af.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ar.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/bg.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/br.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/bs.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ca.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/cs.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/cy.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/da.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/de.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/el.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/en_GB.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/eo.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/es.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/et.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/eu.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/fa.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/fi.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/fr.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/gl.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/he.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/hi.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/hr.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/hu.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/is.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/it.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ja.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/kcoloredit-desktops.pot37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/kk.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/km.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/lt.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/lv.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/mk.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ms.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/mt.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/nb.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/nds.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ne.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/nl.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/nn.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/nso.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/pa.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/pl.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/pt.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/pt_BR.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ro.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ru.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/se.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/sk.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/sl.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/sr.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/sr@Latn.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/sv.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ta.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/tg.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/th.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/tr.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/uk.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/uz.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/uz@cyrillic.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/ven.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/wa.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/xh.po38
-rw-r--r--translations/desktop_files/kcoloredit-desktops/zh_CN.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/zh_HK.po39
-rw-r--r--translations/desktop_files/kcoloredit-desktops/zh_TW.po37
-rw-r--r--translations/desktop_files/kcoloredit-desktops/zu.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/af.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/ar.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/az.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/bg.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/br.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/bs.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ca.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/cs.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/cy.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/da.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/de.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/el.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/eo.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/es.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/et.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/eu.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/fa.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/fi.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/fr.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ga.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/gl.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/he.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/hi.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/hr.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/hu.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/id.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/is.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/it.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/ja.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/kdvi-desktops.pot37
-rw-r--r--translations/desktop_files/kdvi-desktops/kk.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/km.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ko.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/lt.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/lv.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/mk.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ms.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/mt.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/nb.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/nds.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ne.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/nl.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/nn.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/pa.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/pl.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/pt.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/pt_BR.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ro.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ru.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/rw.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/se.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/sk.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/sl.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/sr.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/sr@Latn.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/sv.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ta.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/tg.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/th.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/tr.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/uk.po39
-rw-r--r--translations/desktop_files/kdvi-desktops/uz.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/uz@cyrillic.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/ven.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/wa.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/xh.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/zh_CN.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/zh_HK.po37
-rw-r--r--translations/desktop_files/kdvi-desktops/zh_TW.po38
-rw-r--r--translations/desktop_files/kdvi-desktops/zu.po37
-rw-r--r--translations/desktop_files/kfax.desktop/af.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ar.po27
-rw-r--r--translations/desktop_files/kfax.desktop/bg.po27
-rw-r--r--translations/desktop_files/kfax.desktop/br.po27
-rw-r--r--translations/desktop_files/kfax.desktop/bs.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ca.po27
-rw-r--r--translations/desktop_files/kfax.desktop/cs.po27
-rw-r--r--translations/desktop_files/kfax.desktop/cy.po27
-rw-r--r--translations/desktop_files/kfax.desktop/da.po27
-rw-r--r--translations/desktop_files/kfax.desktop/de.po27
-rw-r--r--translations/desktop_files/kfax.desktop/el.po27
-rw-r--r--translations/desktop_files/kfax.desktop/eo.po27
-rw-r--r--translations/desktop_files/kfax.desktop/es.po27
-rw-r--r--translations/desktop_files/kfax.desktop/et.po27
-rw-r--r--translations/desktop_files/kfax.desktop/eu.po27
-rw-r--r--translations/desktop_files/kfax.desktop/fa.po27
-rw-r--r--translations/desktop_files/kfax.desktop/fi.po27
-rw-r--r--translations/desktop_files/kfax.desktop/fr.po27
-rw-r--r--translations/desktop_files/kfax.desktop/gl.po27
-rw-r--r--translations/desktop_files/kfax.desktop/he.po27
-rw-r--r--translations/desktop_files/kfax.desktop/hi.po27
-rw-r--r--translations/desktop_files/kfax.desktop/hr.po27
-rw-r--r--translations/desktop_files/kfax.desktop/hu.po27
-rw-r--r--translations/desktop_files/kfax.desktop/is.po27
-rw-r--r--translations/desktop_files/kfax.desktop/it.po28
-rw-r--r--translations/desktop_files/kfax.desktop/ja.po27
-rw-r--r--translations/desktop_files/kfax.desktop/kfax.desktop.pot27
-rw-r--r--translations/desktop_files/kfax.desktop/kk.po27
-rw-r--r--translations/desktop_files/kfax.desktop/km.po27
-rw-r--r--translations/desktop_files/kfax.desktop/lt.po27
-rw-r--r--translations/desktop_files/kfax.desktop/lv.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ms.po27
-rw-r--r--translations/desktop_files/kfax.desktop/nb.po27
-rw-r--r--translations/desktop_files/kfax.desktop/nds.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ne.po27
-rw-r--r--translations/desktop_files/kfax.desktop/nl.po27
-rw-r--r--translations/desktop_files/kfax.desktop/nn.po27
-rw-r--r--translations/desktop_files/kfax.desktop/pa.po27
-rw-r--r--translations/desktop_files/kfax.desktop/pl.po27
-rw-r--r--translations/desktop_files/kfax.desktop/pt.po27
-rw-r--r--translations/desktop_files/kfax.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ro.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ru.po27
-rw-r--r--translations/desktop_files/kfax.desktop/se.po27
-rw-r--r--translations/desktop_files/kfax.desktop/sk.po27
-rw-r--r--translations/desktop_files/kfax.desktop/sl.po27
-rw-r--r--translations/desktop_files/kfax.desktop/sr.po27
-rw-r--r--translations/desktop_files/kfax.desktop/sr@Latn.po27
-rw-r--r--translations/desktop_files/kfax.desktop/sv.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ta.po27
-rw-r--r--translations/desktop_files/kfax.desktop/tg.po27
-rw-r--r--translations/desktop_files/kfax.desktop/th.po27
-rw-r--r--translations/desktop_files/kfax.desktop/tr.po27
-rw-r--r--translations/desktop_files/kfax.desktop/uk.po29
-rw-r--r--translations/desktop_files/kfax.desktop/uz.po27
-rw-r--r--translations/desktop_files/kfax.desktop/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/kfax.desktop/ven.po27
-rw-r--r--translations/desktop_files/kfax.desktop/wa.po27
-rw-r--r--translations/desktop_files/kfax.desktop/xh.po27
-rw-r--r--translations/desktop_files/kfax.desktop/zh_CN.po27
-rw-r--r--translations/desktop_files/kfax.desktop/zh_HK.po27
-rw-r--r--translations/desktop_files/kfax.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/kfax.desktop/zu.po27
-rw-r--r--translations/desktop_files/kfaxview-desktops/af.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ar.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/bg.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/br.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/bs.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ca.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/cs.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/cy.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/da.po44
-rw-r--r--translations/desktop_files/kfaxview-desktops/de.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/el.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/eo.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/es.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/et.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/eu.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/fa.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/fi.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/fr.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/gl.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/he.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/hi.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/hr.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/hu.po44
-rw-r--r--translations/desktop_files/kfaxview-desktops/is.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/it.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ja.po44
-rw-r--r--translations/desktop_files/kfaxview-desktops/kfaxview-desktops.pot42
-rw-r--r--translations/desktop_files/kfaxview-desktops/kk.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/km.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/lt.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/lv.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ms.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/nb.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/nds.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ne.po42
-rw-r--r--translations/desktop_files/kfaxview-desktops/nl.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/nn.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/pa.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/pl.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/pt.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/pt_BR.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ro.po44
-rw-r--r--translations/desktop_files/kfaxview-desktops/ru.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/se.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/sk.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/sl.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/sr.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/sr@Latn.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/sv.po42
-rw-r--r--translations/desktop_files/kfaxview-desktops/ta.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/tg.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/th.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/tr.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/uk.po44
-rw-r--r--translations/desktop_files/kfaxview-desktops/uz.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/uz@cyrillic.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/ven.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/wa.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/xh.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/zh_CN.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/zh_HK.po43
-rw-r--r--translations/desktop_files/kfaxview-desktops/zh_TW.po42
-rw-r--r--translations/desktop_files/kfaxview-desktops/zu.po43
-rw-r--r--translations/desktop_files/kgamma.desktop/ar.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/az.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/bg.po34
-rw-r--r--translations/desktop_files/kgamma.desktop/bs.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ca.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/cs.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/cy.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/da.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/de.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/el.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/eo.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/es.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/et.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/eu.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/fa.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/fi.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/fr.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ga.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/gl.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/he.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/hi.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/hr.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/hu.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/is.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/it.po33
-rw-r--r--translations/desktop_files/kgamma.desktop/ja.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/kgamma.desktop.pot32
-rw-r--r--translations/desktop_files/kgamma.desktop/kk.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/km.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/lt.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ms.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/nb.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/nds.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ne.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/nl.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/nn.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/pa.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/pl.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/pt.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/pt_BR.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ro.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ru.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/sk.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/sl.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/sr.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/sr@Latn.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/sv.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/ta.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/tg.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/th.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/tr.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/uk.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/uz@cyrillic.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/wa.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/xh.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/zh_CN.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/zh_HK.po32
-rw-r--r--translations/desktop_files/kgamma.desktop/zh_TW.po32
-rw-r--r--translations/desktop_files/kghostview-desktops/af.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ar.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/bg.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/br.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/bs.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ca.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/cs.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/cy.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/da.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/de.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/el.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/eo.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/es.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/et.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/eu.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/fa.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/fi.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/fr.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ga.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/gl.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/he.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/hi.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/hr.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/hu.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/is.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/it.po28
-rw-r--r--translations/desktop_files/kghostview-desktops/ja.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/kghostview-desktops.pot27
-rw-r--r--translations/desktop_files/kghostview-desktops/kk.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/km.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/lt.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/lv.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ms.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/nb.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/nds.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ne.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/nl.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/nn.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/nso.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/pa.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/pl.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/pt.po28
-rw-r--r--translations/desktop_files/kghostview-desktops/pt_BR.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ro.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ru.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/se.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/sk.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/sl.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/sr.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/sr@Latn.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/sv.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ta.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/tg.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/th.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/tr.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/uk.po29
-rw-r--r--translations/desktop_files/kghostview-desktops/uz.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/ven.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/wa.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/xh.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/zh_CN.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/zh_HK.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/zh_TW.po27
-rw-r--r--translations/desktop_files/kghostview-desktops/zu.po27
-rw-r--r--translations/desktop_files/kmrml-desktops/af.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ar.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/bg.po59
-rw-r--r--translations/desktop_files/kmrml-desktops/br.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/bs.po58
-rw-r--r--translations/desktop_files/kmrml-desktops/ca.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/cs.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/cy.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/da.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/de.po59
-rw-r--r--translations/desktop_files/kmrml-desktops/el.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/eo.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/es.po58
-rw-r--r--translations/desktop_files/kmrml-desktops/et.po58
-rw-r--r--translations/desktop_files/kmrml-desktops/eu.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/fa.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/fi.po59
-rw-r--r--translations/desktop_files/kmrml-desktops/fr.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ga.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/gl.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/he.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/hi.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/hu.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/is.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/it.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ja.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/kk.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/km.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/kmrml-desktops.pot57
-rw-r--r--translations/desktop_files/kmrml-desktops/lt.po60
-rw-r--r--translations/desktop_files/kmrml-desktops/ms.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/nb.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/nds.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ne.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/nl.po59
-rw-r--r--translations/desktop_files/kmrml-desktops/nn.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/nso.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/pa.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/pl.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/pt.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/pt_BR.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ro.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ru.po60
-rw-r--r--translations/desktop_files/kmrml-desktops/se.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/sk.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/sl.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/sr.po58
-rw-r--r--translations/desktop_files/kmrml-desktops/sr@Latn.po58
-rw-r--r--translations/desktop_files/kmrml-desktops/sv.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ta.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/tg.po59
-rw-r--r--translations/desktop_files/kmrml-desktops/th.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/tr.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/uk.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/uz.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/uz@cyrillic.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/ven.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/wa.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/xh.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/zh_CN.po58
-rw-r--r--translations/desktop_files/kmrml-desktops/zh_HK.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/zh_TW.po57
-rw-r--r--translations/desktop_files/kmrml-desktops/zu.po57
-rw-r--r--translations/desktop_files/kolourpaint.desktop/af.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ar.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/bg.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/br.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/bs.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ca.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/cs.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/cy.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/da.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/de.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/el.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/eo.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/es.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/et.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/eu.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/fa.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/fi.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/fr.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ga.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/gl.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/he.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/hi.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/hr.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/hu.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/is.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/it.po28
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ja.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/kk.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/km.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/kolourpaint.desktop.pot27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/lt.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/lv.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ms.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/mt.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/nb.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/nds.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ne.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/nl.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/nn.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/nso.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/pa.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/pl.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/pt.po28
-rw-r--r--translations/desktop_files/kolourpaint.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ro.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ru.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/rw.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/se.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/sk.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/sl.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/sr.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/sr@Latn.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/sv.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ta.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/tg.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/th.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/tr.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/uk.po29
-rw-r--r--translations/desktop_files/kolourpaint.desktop/uz.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/ven.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/wa.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/xh.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/zh_CN.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/zh_HK.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/kolourpaint.desktop/zu.po27
-rw-r--r--translations/desktop_files/kooka.desktop/af.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ar.po27
-rw-r--r--translations/desktop_files/kooka.desktop/bg.po27
-rw-r--r--translations/desktop_files/kooka.desktop/bs.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ca.po27
-rw-r--r--translations/desktop_files/kooka.desktop/cs.po27
-rw-r--r--translations/desktop_files/kooka.desktop/cy.po27
-rw-r--r--translations/desktop_files/kooka.desktop/da.po27
-rw-r--r--translations/desktop_files/kooka.desktop/de.po27
-rw-r--r--translations/desktop_files/kooka.desktop/el.po27
-rw-r--r--translations/desktop_files/kooka.desktop/eo.po27
-rw-r--r--translations/desktop_files/kooka.desktop/es.po27
-rw-r--r--translations/desktop_files/kooka.desktop/et.po27
-rw-r--r--translations/desktop_files/kooka.desktop/eu.po27
-rw-r--r--translations/desktop_files/kooka.desktop/fa.po27
-rw-r--r--translations/desktop_files/kooka.desktop/fi.po27
-rw-r--r--translations/desktop_files/kooka.desktop/fr.po27
-rw-r--r--translations/desktop_files/kooka.desktop/gl.po27
-rw-r--r--translations/desktop_files/kooka.desktop/he.po27
-rw-r--r--translations/desktop_files/kooka.desktop/hi.po27
-rw-r--r--translations/desktop_files/kooka.desktop/hr.po27
-rw-r--r--translations/desktop_files/kooka.desktop/hu.po27
-rw-r--r--translations/desktop_files/kooka.desktop/is.po27
-rw-r--r--translations/desktop_files/kooka.desktop/it.po28
-rw-r--r--translations/desktop_files/kooka.desktop/ja.po27
-rw-r--r--translations/desktop_files/kooka.desktop/kk.po27
-rw-r--r--translations/desktop_files/kooka.desktop/km.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ko.po27
-rw-r--r--translations/desktop_files/kooka.desktop/kooka.desktop.pot27
-rw-r--r--translations/desktop_files/kooka.desktop/lt.po27
-rw-r--r--translations/desktop_files/kooka.desktop/lv.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ms.po27
-rw-r--r--translations/desktop_files/kooka.desktop/nb.po27
-rw-r--r--translations/desktop_files/kooka.desktop/nds.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ne.po27
-rw-r--r--translations/desktop_files/kooka.desktop/nl.po27
-rw-r--r--translations/desktop_files/kooka.desktop/nn.po27
-rw-r--r--translations/desktop_files/kooka.desktop/pa.po27
-rw-r--r--translations/desktop_files/kooka.desktop/pl.po27
-rw-r--r--translations/desktop_files/kooka.desktop/pt.po27
-rw-r--r--translations/desktop_files/kooka.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ro.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ru.po27
-rw-r--r--translations/desktop_files/kooka.desktop/sk.po27
-rw-r--r--translations/desktop_files/kooka.desktop/sl.po27
-rw-r--r--translations/desktop_files/kooka.desktop/sr.po27
-rw-r--r--translations/desktop_files/kooka.desktop/sr@Latn.po27
-rw-r--r--translations/desktop_files/kooka.desktop/sv.po27
-rw-r--r--translations/desktop_files/kooka.desktop/ta.po27
-rw-r--r--translations/desktop_files/kooka.desktop/tg.po27
-rw-r--r--translations/desktop_files/kooka.desktop/th.po27
-rw-r--r--translations/desktop_files/kooka.desktop/tr.po27
-rw-r--r--translations/desktop_files/kooka.desktop/uk.po29
-rw-r--r--translations/desktop_files/kooka.desktop/ven.po27
-rw-r--r--translations/desktop_files/kooka.desktop/wa.po27
-rw-r--r--translations/desktop_files/kooka.desktop/xh.po27
-rw-r--r--translations/desktop_files/kooka.desktop/zh_CN.po27
-rw-r--r--translations/desktop_files/kooka.desktop/zh_HK.po27
-rw-r--r--translations/desktop_files/kooka.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/kooka.desktop/zu.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ar.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/az.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/bg.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/br.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/bs.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ca.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/cs.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/cy.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/da.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/de.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/el.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/eo.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/es.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/et.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/eu.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/fa.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/fi.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/fr.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ga.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/gl.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/he.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/hi.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/hr.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/hu.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/id.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/is.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/it.po28
-rw-r--r--translations/desktop_files/kpdf-desktops/ja.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/kk.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/km.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/kpdf-desktops.pot27
-rw-r--r--translations/desktop_files/kpdf-desktops/lt.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/lv.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/mk.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ms.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/mt.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/nb.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/nds.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ne.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/nl.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/nn.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/pa.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/pl.po29
-rw-r--r--translations/desktop_files/kpdf-desktops/pt.po28
-rw-r--r--translations/desktop_files/kpdf-desktops/pt_BR.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ro.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ru.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/rw.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/se.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/sk.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/sl.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/sr.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/sr@Latn.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/sv.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ta.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/tg.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/th.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/tr.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/uk.po29
-rw-r--r--translations/desktop_files/kpdf-desktops/uz.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/ven.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/wa.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/xh.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/zh_CN.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/zh_HK.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/zh_TW.po27
-rw-r--r--translations/desktop_files/kpdf-desktops/zu.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ca.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/cs.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/cy.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/da.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/de.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/en_GB.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/eo.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/es.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/et.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/eu.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/fa.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/fi.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/fr.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/gl.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/he.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/hu.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/is.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/it.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ja.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/kk.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/km.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/kpovmodeler.desktop.pot27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ms.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/nb.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/nds.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ne.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/nn.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/pl.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/pt.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/pt_BR.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ro.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ru.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/sl.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/sr.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/sr@Latn.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/sv.po27
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/ta.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/tr.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/uk.po29
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/zh_CN.po28
-rw-r--r--translations/desktop_files/kpovmodeler.desktop/zh_HK.po28
-rw-r--r--translations/desktop_files/kruler-eventsrc/af.po34
-rw-r--r--translations/desktop_files/kruler-eventsrc/ar.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/az.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/bg.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/bs.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ca.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/cs.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/cy.po34
-rw-r--r--translations/desktop_files/kruler-eventsrc/da.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/de.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/el.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/eo.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/es.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/et.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/eu.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/fa.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/fi.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/fr.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ga.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/gl.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/he.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/hi.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/hr.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/hu.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/is.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/it.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ja.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/kk.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/km.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ko.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/kruler-eventsrc.pot32
-rw-r--r--translations/desktop_files/kruler-eventsrc/lt.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/lv.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ms.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/mt.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/nb.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/nds.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ne.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/nl.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/nn.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/nso.po33
-rw-r--r--translations/desktop_files/kruler-eventsrc/pl.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/pt.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/pt_BR.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ro.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ru.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/se.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/sk.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/sl.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/sr.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/sr@Latn.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/sv.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ta.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/tg.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/th.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/tr.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/uk.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/uz.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/uz@cyrillic.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/ven.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/xh.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/zh_CN.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/zh_HK.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/zh_TW.po32
-rw-r--r--translations/desktop_files/kruler-eventsrc/zu.po32
-rw-r--r--translations/desktop_files/kruler.desktop/af.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ar.po27
-rw-r--r--translations/desktop_files/kruler.desktop/bg.po27
-rw-r--r--translations/desktop_files/kruler.desktop/bs.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ca.po27
-rw-r--r--translations/desktop_files/kruler.desktop/cs.po27
-rw-r--r--translations/desktop_files/kruler.desktop/cy.po27
-rw-r--r--translations/desktop_files/kruler.desktop/da.po27
-rw-r--r--translations/desktop_files/kruler.desktop/de.po27
-rw-r--r--translations/desktop_files/kruler.desktop/el.po27
-rw-r--r--translations/desktop_files/kruler.desktop/eo.po27
-rw-r--r--translations/desktop_files/kruler.desktop/es.po27
-rw-r--r--translations/desktop_files/kruler.desktop/et.po27
-rw-r--r--translations/desktop_files/kruler.desktop/eu.po27
-rw-r--r--translations/desktop_files/kruler.desktop/fa.po27
-rw-r--r--translations/desktop_files/kruler.desktop/fi.po27
-rw-r--r--translations/desktop_files/kruler.desktop/fr.po27
-rw-r--r--translations/desktop_files/kruler.desktop/gl.po27
-rw-r--r--translations/desktop_files/kruler.desktop/he.po27
-rw-r--r--translations/desktop_files/kruler.desktop/hi.po27
-rw-r--r--translations/desktop_files/kruler.desktop/hr.po27
-rw-r--r--translations/desktop_files/kruler.desktop/hu.po27
-rw-r--r--translations/desktop_files/kruler.desktop/is.po27
-rw-r--r--translations/desktop_files/kruler.desktop/it.po28
-rw-r--r--translations/desktop_files/kruler.desktop/ja.po27
-rw-r--r--translations/desktop_files/kruler.desktop/kk.po27
-rw-r--r--translations/desktop_files/kruler.desktop/km.po27
-rw-r--r--translations/desktop_files/kruler.desktop/kruler.desktop.pot27
-rw-r--r--translations/desktop_files/kruler.desktop/lt.po27
-rw-r--r--translations/desktop_files/kruler.desktop/lv.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ms.po27
-rw-r--r--translations/desktop_files/kruler.desktop/nb.po27
-rw-r--r--translations/desktop_files/kruler.desktop/nds.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ne.po27
-rw-r--r--translations/desktop_files/kruler.desktop/nl.po27
-rw-r--r--translations/desktop_files/kruler.desktop/nn.po27
-rw-r--r--translations/desktop_files/kruler.desktop/pl.po27
-rw-r--r--translations/desktop_files/kruler.desktop/pt.po27
-rw-r--r--translations/desktop_files/kruler.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ro.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ru.po27
-rw-r--r--translations/desktop_files/kruler.desktop/se.po27
-rw-r--r--translations/desktop_files/kruler.desktop/sk.po27
-rw-r--r--translations/desktop_files/kruler.desktop/sl.po27
-rw-r--r--translations/desktop_files/kruler.desktop/sr.po27
-rw-r--r--translations/desktop_files/kruler.desktop/sr@Latn.po27
-rw-r--r--translations/desktop_files/kruler.desktop/sv.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ta.po27
-rw-r--r--translations/desktop_files/kruler.desktop/tg.po27
-rw-r--r--translations/desktop_files/kruler.desktop/th.po27
-rw-r--r--translations/desktop_files/kruler.desktop/tr.po27
-rw-r--r--translations/desktop_files/kruler.desktop/uk.po29
-rw-r--r--translations/desktop_files/kruler.desktop/uz.po27
-rw-r--r--translations/desktop_files/kruler.desktop/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/kruler.desktop/ven.po27
-rw-r--r--translations/desktop_files/kruler.desktop/zh_CN.po27
-rw-r--r--translations/desktop_files/kruler.desktop/zh_HK.po27
-rw-r--r--translations/desktop_files/kruler.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/kruler.desktop/zu.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/af.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ar.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/bg.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/bs.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ca.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/cs.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/cy.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/da.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/de.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/el.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/eo.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/es.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/et.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/eu.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/fa.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/fi.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/fr.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ga.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/gl.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/he.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/hi.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/hr.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/hu.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/is.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/it.po28
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ja.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/kk.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/km.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ksnapshot.desktop.pot27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/lt.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/lv.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ms.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/mt.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/nb.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/nds.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ne.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/nl.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/nn.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/nso.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/pl.po29
-rw-r--r--translations/desktop_files/ksnapshot.desktop/pt.po28
-rw-r--r--translations/desktop_files/ksnapshot.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ro.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ru.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/rw.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/se.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/sk.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/sl.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/sr.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/sr@Latn.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/sv.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ta.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/tg.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/th.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/tr.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/uk.po29
-rw-r--r--translations/desktop_files/ksnapshot.desktop/uz.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/ven.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/wa.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/xh.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/zh_CN.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/zh_HK.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/ksnapshot.desktop/zu.po27
-rw-r--r--translations/desktop_files/ksvg-desktops/ar.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/az.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/bs.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/ca.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/cs.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/cy.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/da.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/de.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/el.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/eo.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/es.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/et.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/eu.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/fa.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/fi.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/fr.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ga.po60
-rw-r--r--translations/desktop_files/ksvg-desktops/gl.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/he.po59
-rw-r--r--translations/desktop_files/ksvg-desktops/hi.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/hr.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/hu.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/is.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/it.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/ja.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/kk.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/km.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ksvg-desktops.pot57
-rw-r--r--translations/desktop_files/ksvg-desktops/lt.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/lv.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ms.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/mt.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/nb.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/nds.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ne.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/nl.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/nn.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/pl.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/pt.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/pt_BR.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ro.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ru.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/sk.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/sl.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/sr.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/sr@Latn.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/sv.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/ta.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/tg.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/tr.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/uk.po59
-rw-r--r--translations/desktop_files/ksvg-desktops/uz.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/uz@cyrillic.po58
-rw-r--r--translations/desktop_files/ksvg-desktops/ven.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/xh.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/zh_CN.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/zh_HK.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/zh_TW.po57
-rw-r--r--translations/desktop_files/ksvg-desktops/zu.po57
-rw-r--r--translations/desktop_files/kuickshow.desktop/af.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ar.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/bg.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/br.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/bs.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ca.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/cs.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/cy.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/da.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/de.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/el.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/eo.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/es.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/et.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/eu.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/fa.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/fi.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/fr.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ga.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/gl.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/he.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/hi.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/hr.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/hu.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/is.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/it.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ja.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/kk.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/km.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ko.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/kuickshow.desktop.pot27
-rw-r--r--translations/desktop_files/kuickshow.desktop/lt.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/lv.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ms.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/mt.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/nb.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/nds.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ne.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/nl.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/nn.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/nso.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/pa.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/pl.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/pt.po28
-rw-r--r--translations/desktop_files/kuickshow.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ro.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ru.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/rw.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/se.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/sk.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/sl.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/sr.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/sr@Latn.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/sv.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ta.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/tg.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/th.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/tr.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/uk.po29
-rw-r--r--translations/desktop_files/kuickshow.desktop/uz.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/uz@cyrillic.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/ven.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/wa.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/xh.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/zh_CN.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/zh_HK.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/kuickshow.desktop/zu.po27
-rw-r--r--translations/desktop_files/kview-desktops/af.po166
-rw-r--r--translations/desktop_files/kview-desktops/ar.po164
-rw-r--r--translations/desktop_files/kview-desktops/az.po161
-rw-r--r--translations/desktop_files/kview-desktops/bg.po170
-rw-r--r--translations/desktop_files/kview-desktops/br.po166
-rw-r--r--translations/desktop_files/kview-desktops/bs.po166
-rw-r--r--translations/desktop_files/kview-desktops/ca.po165
-rw-r--r--translations/desktop_files/kview-desktops/cs.po165
-rw-r--r--translations/desktop_files/kview-desktops/cy.po165
-rw-r--r--translations/desktop_files/kview-desktops/da.po165
-rw-r--r--translations/desktop_files/kview-desktops/de.po167
-rw-r--r--translations/desktop_files/kview-desktops/el.po170
-rw-r--r--translations/desktop_files/kview-desktops/eo.po164
-rw-r--r--translations/desktop_files/kview-desktops/es.po168
-rw-r--r--translations/desktop_files/kview-desktops/et.po165
-rw-r--r--translations/desktop_files/kview-desktops/eu.po166
-rw-r--r--translations/desktop_files/kview-desktops/fa.po166
-rw-r--r--translations/desktop_files/kview-desktops/fi.po167
-rw-r--r--translations/desktop_files/kview-desktops/fo.po161
-rw-r--r--translations/desktop_files/kview-desktops/fr.po166
-rw-r--r--translations/desktop_files/kview-desktops/ga.po168
-rw-r--r--translations/desktop_files/kview-desktops/gl.po165
-rw-r--r--translations/desktop_files/kview-desktops/he.po165
-rw-r--r--translations/desktop_files/kview-desktops/hi.po164
-rw-r--r--translations/desktop_files/kview-desktops/hr.po166
-rw-r--r--translations/desktop_files/kview-desktops/hu.po167
-rw-r--r--translations/desktop_files/kview-desktops/id.po161
-rw-r--r--translations/desktop_files/kview-desktops/is.po165
-rw-r--r--translations/desktop_files/kview-desktops/it.po167
-rw-r--r--translations/desktop_files/kview-desktops/ja.po165
-rw-r--r--translations/desktop_files/kview-desktops/kk.po165
-rw-r--r--translations/desktop_files/kview-desktops/km.po165
-rw-r--r--translations/desktop_files/kview-desktops/kview-desktops.pot161
-rw-r--r--translations/desktop_files/kview-desktops/lt.po166
-rw-r--r--translations/desktop_files/kview-desktops/lv.po168
-rw-r--r--translations/desktop_files/kview-desktops/mk.po161
-rw-r--r--translations/desktop_files/kview-desktops/ms.po165
-rw-r--r--translations/desktop_files/kview-desktops/mt.po168
-rw-r--r--translations/desktop_files/kview-desktops/nb.po166
-rw-r--r--translations/desktop_files/kview-desktops/nds.po165
-rw-r--r--translations/desktop_files/kview-desktops/ne.po164
-rw-r--r--translations/desktop_files/kview-desktops/nl.po165
-rw-r--r--translations/desktop_files/kview-desktops/nn.po166
-rw-r--r--translations/desktop_files/kview-desktops/nso.po169
-rw-r--r--translations/desktop_files/kview-desktops/pa.po166
-rw-r--r--translations/desktop_files/kview-desktops/pl.po165
-rw-r--r--translations/desktop_files/kview-desktops/pt.po166
-rw-r--r--translations/desktop_files/kview-desktops/pt_BR.po166
-rw-r--r--translations/desktop_files/kview-desktops/ro.po167
-rw-r--r--translations/desktop_files/kview-desktops/ru.po166
-rw-r--r--translations/desktop_files/kview-desktops/rw.po168
-rw-r--r--translations/desktop_files/kview-desktops/se.po165
-rw-r--r--translations/desktop_files/kview-desktops/sk.po166
-rw-r--r--translations/desktop_files/kview-desktops/sl.po165
-rw-r--r--translations/desktop_files/kview-desktops/sr.po165
-rw-r--r--translations/desktop_files/kview-desktops/sr@Latn.po165
-rw-r--r--translations/desktop_files/kview-desktops/sv.po164
-rw-r--r--translations/desktop_files/kview-desktops/ta.po164
-rw-r--r--translations/desktop_files/kview-desktops/tg.po165
-rw-r--r--translations/desktop_files/kview-desktops/th.po168
-rw-r--r--translations/desktop_files/kview-desktops/tr.po165
-rw-r--r--translations/desktop_files/kview-desktops/uk.po168
-rw-r--r--translations/desktop_files/kview-desktops/uz.po168
-rw-r--r--translations/desktop_files/kview-desktops/uz@cyrillic.po168
-rw-r--r--translations/desktop_files/kview-desktops/ven.po172
-rw-r--r--translations/desktop_files/kview-desktops/wa.po166
-rw-r--r--translations/desktop_files/kview-desktops/xh.po168
-rw-r--r--translations/desktop_files/kview-desktops/zh_CN.po165
-rw-r--r--translations/desktop_files/kview-desktops/zh_HK.po165
-rw-r--r--translations/desktop_files/kview-desktops/zh_TW.po165
-rw-r--r--translations/desktop_files/kview-desktops/zu.po170
-rw-r--r--translations/desktop_files/kviewshell-desktops/bg.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/br.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/bs.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/ca.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/cs.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/da.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/de.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/el.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/es.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/et.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/eu.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/fa.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/fi.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/fr.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/gl.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/hu.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/is.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/it.po38
-rw-r--r--translations/desktop_files/kviewshell-desktops/ja.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/kk.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/km.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/kviewshell-desktops.pot37
-rw-r--r--translations/desktop_files/kviewshell-desktops/lt.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/ms.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/nb.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/nds.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/ne.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/nl.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/nn.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/pl.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/pt.po38
-rw-r--r--translations/desktop_files/kviewshell-desktops/pt_BR.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/ro.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/ru.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/sk.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/sl.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/sr.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/sr@Latn.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/sv.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/ta.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/tr.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/uk.po39
-rw-r--r--translations/desktop_files/kviewshell-desktops/zh_CN.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/zh_HK.po37
-rw-r--r--translations/desktop_files/kviewshell-desktops/zh_TW.po37
-rw-r--r--translations/desktop_files/scanservice.desktop/af.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ar.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/az.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/bg.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/br.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ca.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/cs.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/cy.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/da.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/de.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/el.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/eo.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/es.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/et.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/eu.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/fa.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/fi.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/fr.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/gl.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/he.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/hi.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/hr.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/hu.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/is.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/it.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ja.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/kk.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/km.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ko.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/lt.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/lv.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ms.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/mt.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/nb.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/nds.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ne.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/nl.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/nn.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/nso.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/pl.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/pt.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/pt_BR.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ro.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ru.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/scanservice.desktop.pot22
-rw-r--r--translations/desktop_files/scanservice.desktop/se.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/sk.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/sl.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/sr.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/sr@Latn.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/sv.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ta.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/tg.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/th.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/tr.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/uk.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/uz.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/uz@cyrillic.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/ven.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/wa.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/xh.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/zh_CN.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/zh_HK.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/zh_TW.po22
-rw-r--r--translations/desktop_files/scanservice.desktop/zu.po22
-rw-r--r--translations/desktop_files/tdefile-desktops/af.po118
-rw-r--r--translations/desktop_files/tdefile-desktops/ar.po114
-rw-r--r--translations/desktop_files/tdefile-desktops/br.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/bs.po113
-rw-r--r--translations/desktop_files/tdefile-desktops/ca.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/cs.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/cy.po113
-rw-r--r--translations/desktop_files/tdefile-desktops/da.po113
-rw-r--r--translations/desktop_files/tdefile-desktops/de.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/el.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/eo.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/es.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/et.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/eu.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/fa.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/fi.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/fr.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ga.po119
-rw-r--r--translations/desktop_files/tdefile-desktops/gl.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/he.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/hi.po114
-rw-r--r--translations/desktop_files/tdefile-desktops/hr.po117
-rw-r--r--translations/desktop_files/tdefile-desktops/hu.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/is.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/it.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ja.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/kk.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/km.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/lt.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/lv.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ms.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/nb.po120
-rw-r--r--translations/desktop_files/tdefile-desktops/nds.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ne.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/nl.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/nn.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/nso.po117
-rw-r--r--translations/desktop_files/tdefile-desktops/pa.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/pl.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/pt.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/pt_BR.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ro.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ru.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/rw.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/se.po113
-rw-r--r--translations/desktop_files/tdefile-desktops/sk.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/sl.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/sr.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/sr@Latn.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/sv.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ta.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/tdefile-desktops.pot112
-rw-r--r--translations/desktop_files/tdefile-desktops/tg.po113
-rw-r--r--translations/desktop_files/tdefile-desktops/th.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/tr.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/uk.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/uz.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/uz@cyrillic.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/ven.po117
-rw-r--r--translations/desktop_files/tdefile-desktops/wa.po114
-rw-r--r--translations/desktop_files/tdefile-desktops/xh.po117
-rw-r--r--translations/desktop_files/tdefile-desktops/zh_CN.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/zh_HK.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/zh_TW.po112
-rw-r--r--translations/desktop_files/tdefile-desktops/zu.po117
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/af.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ar.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/bg.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/br.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/bs.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ca.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/cs.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/cy.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/da.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/de.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/el.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/eo.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/es.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/et.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/eu.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/fa.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/fi.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/fr.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ga.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/gl.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/he.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/hi.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/hr.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/hu.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/is.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/it.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ja.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/kk.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/km.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/lt.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/lv.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ms.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/nb.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/nds.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ne.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/nl.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/nn.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/nso.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/pa.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/pl.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/pt.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/pt_BR.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ro.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ru.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/se.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/sk.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/sl.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/sr.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/sr@Latn.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/sv.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ta.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/tdeiconedit.desktop.pot27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/tg.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/th.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/tr.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/uk.po29
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/uz.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/uz@cyrillic.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/ven.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/wa.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/xh.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/zh_CN.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/zh_HK.po28
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/zh_TW.po27
-rw-r--r--translations/desktop_files/tdeiconedit.desktop/zu.po28
3338 files changed, 174840 insertions, 121123 deletions
diff --git a/.gitmodules b/.gitmodules
index bdec8fca..934def7f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
[submodule "admin"]
path = admin
url = https://system@scm.trinitydesktop.org/scm/git/tde-common-admin
-[submodule "cmake"]
- path = cmake
- url = https://system@scm.trinitydesktop.org/scm/git/tde-common-cmake
diff --git a/CMakeL10n.txt b/CMakeL10n.txt
index 7fbe8207..aa98c1fe 100644
--- a/CMakeL10n.txt
+++ b/CMakeL10n.txt
@@ -9,12 +9,11 @@
#
#################################################
-cmake_minimum_required( VERSION 2.8 )
+cmake_minimum_required( VERSION 3.1 )
##### include our cmake modules #################
-set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEL10n )
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e1497647..6156ee3e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,13 +9,12 @@
#
#################################################
-cmake_minimum_required( VERSION 2.8 )
+cmake_minimum_required( VERSION 3.1 )
##### general package setup #####################
project( tdegraphics )
-set( VERSION R14.0.7 )
##### include essential cmake modules ###########
@@ -31,10 +30,14 @@ include( CheckSymbolExists )
##### include our cmake modules #################
-set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
+##### set version number ########################
+
+tde_set_project_version( )
+
+
##### setup install paths #######################
include( TDESetupPaths )
@@ -43,11 +46,13 @@ tde_setup_paths( )
##### optional stuff ############################
+OPTION( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+
option( WITH_T1LIB "Enable t1lib support" OFF )
-option( WITH_PAPER "Enable libpaper support" OFF )
-OPTION( WITH_TIFF "Enable tiff support (tdefile-plugins)" OFF )
-OPTION( WITH_OPENEXR "Enable openexr support (tdefile-plugins)" OFF )
-OPTION( WITH_PDF "Enable pdf support (tdefile-plugins)" OFF )
+option( WITH_PAPER "Enable libpaper support" ${WITH_ALL_OPTIONS} )
+OPTION( WITH_TIFF "Enable tiff support (tdefile-plugins)" ${WITH_ALL_OPTIONS} )
+OPTION( WITH_OPENEXR "Enable openexr support (tdefile-plugins)" ${WITH_ALL_OPTIONS} )
+OPTION( WITH_PDF "Enable pdf support (tdefile-plugins)" ${WITH_ALL_OPTIONS} )
##### options comments ##########################
@@ -131,10 +136,8 @@ tde_conditional_add_subdirectory( BUILD_KCOLOREDIT kcoloredit )
tde_conditional_add_subdirectory( BUILD_KDVI kdvi )
tde_conditional_add_subdirectory( BUILD_KFAX kfax )
tde_conditional_add_subdirectory( BUILD_KFAXVIEW kfaxview )
-tde_conditional_add_subdirectory( BUILD_TDEFILE_PLUGINS tdefile-plugins )
tde_conditional_add_subdirectory( BUILD_KGAMMA kgamma )
tde_conditional_add_subdirectory( BUILD_KGHOSTVIEW kghostview )
-tde_conditional_add_subdirectory( BUILD_TDEICONEDIT tdeiconedit )
tde_conditional_add_subdirectory( BUILD_KMRML kmrml )
tde_conditional_add_subdirectory( BUILD_KOLOURPAINT kolourpaint )
tde_conditional_add_subdirectory( BUILD_KOOKA kooka )
@@ -146,6 +149,8 @@ tde_conditional_add_subdirectory( BUILD_KSVG ksvg )
tde_conditional_add_subdirectory( BUILD_KUICKSHOW kuickshow )
tde_conditional_add_subdirectory( BUILD_KVIEW kview )
tde_conditional_add_subdirectory( BUILD_LIBKSCAN libkscan )
+tde_conditional_add_subdirectory( BUILD_TDEFILE_PLUGINS tdefile-plugins )
+tde_conditional_add_subdirectory( BUILD_TDEICONEDIT tdeiconedit )
##### write configure files #####################
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 3a6eae15..24585108 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -29,12 +29,23 @@ if( WITH_GCC_VISIBILITY )
endif( )
-# freetype2
+##### check for freetype #####################
if( BUILD_KDVI OR BUILD_KPDF OR BUILD_KSVG )
pkg_search_module( FREETYPE freetype2 )
if( FREETYPE_FOUND )
set( HAVE_FREETYPE 1 )
else( )
- tde_message_fatal( "freetype2 is required, but was not found on your system" )
+ tde_message_fatal( "freetype is required, but was not found on your system" )
endif( )
endif( )
+
+
+##### check for fontconfig ######################
+if( BUILD_KPDF OR BUILD_KSVG )
+ pkg_search_module( FONTCONFIG fontconfig )
+ if( FONTCONFIG_FOUND )
+ set( HAVE_FONTCONFIG 1 CACHE INTERNAL "" FORCE )
+ else( )
+ message(FATAL_ERROR "fontconfig is required, but not found on your system" )
+ endif( )
+endif( )
diff --git a/admin b/admin
-Subproject f9148018b2f8a11fd830712c1b508046cc34ff2
+Subproject a9e0c7eb508ebea59f1fc26d4a6858c4b6feea3
diff --git a/cmake b/cmake
deleted file mode 160000
-Subproject c51d14850ff2ed8051e840db9df1698f84af421
diff --git a/config.h.cmake b/config.h.cmake
index 4cb152be..fea46aaf 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,6 +1,12 @@
#cmakedefine VERSION "@VERSION@"
// poppler-tqt
+#cmakedefine HAVE_POPPLER_2203
+#cmakedefine HAVE_POPPLER_2112
+#cmakedefine HAVE_POPPLER_2111
+#cmakedefine HAVE_POPPLER_2108
+#cmakedefine HAVE_POPPLER_086
+#cmakedefine HAVE_POPPLER_083
#cmakedefine HAVE_POPPLER_082
#cmakedefine HAVE_POPPLER_076
#cmakedefine HAVE_POPPLER_072
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index df842e47..753dd0b7 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,12 +1,19 @@
-#################################################
-#
-# (C) 2010-2011 Serghei Amelian
-# serghei (DOT) amelian (AT) gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
+add_subdirectory( man )
-tde_auto_add_subdirectories( )
+tde_conditional_add_subdirectory( BUILD_KAMERA kamera )
+tde_conditional_add_subdirectory( BUILD_KCOLOREDIT kcoloredit )
+tde_conditional_add_subdirectory( BUILD_KDVI kdvi )
+tde_conditional_add_subdirectory( BUILD_KFAX kfax )
+tde_conditional_add_subdirectory( BUILD_KFAXVIEW kfaxview )
+tde_conditional_add_subdirectory( BUILD_KGAMMA kgamma )
+tde_conditional_add_subdirectory( BUILD_KGHOSTVIEW kghostview )
+tde_conditional_add_subdirectory( BUILD_KOLOURPAINT kolourpaint )
+tde_conditional_add_subdirectory( BUILD_KOOKA kooka )
+tde_conditional_add_subdirectory( BUILD_KPDF kpdf )
+tde_conditional_add_subdirectory( BUILD_KPOVMODELER kpovmodeler )
+tde_conditional_add_subdirectory( BUILD_KRULER kruler )
+tde_conditional_add_subdirectory( BUILD_KSNAPSHOT ksnapshot )
+tde_conditional_add_subdirectory( BUILD_KUICKSHOW kuickshow )
+tde_conditional_add_subdirectory( BUILD_KVIEW kview )
+tde_conditional_add_subdirectory( BUILD_TDEICONEDIT tdeiconedit )
+tde_conditional_add_subdirectory( BUILD_KAMERA tdeioslave )
diff --git a/doc/kcoloredit/index.docbook b/doc/kcoloredit/index.docbook
index 7f0214ef..a64e00f6 100644
--- a/doc/kcoloredit/index.docbook
+++ b/doc/kcoloredit/index.docbook
@@ -458,11 +458,3 @@ different actions.</para>
</appendix>
</book>
-<!--
-Local Variables:
-mode: sgml
-sgml-omittag: nil
-sgml-shorttag: t
-End:
--->
-
diff --git a/doc/kdvi/index.docbook b/doc/kdvi/index.docbook
index 0c8e1ce5..c0e3de0e 100644
--- a/doc/kdvi/index.docbook
+++ b/doc/kdvi/index.docbook
@@ -1061,11 +1061,3 @@ Works only for visiting one buffer at a time."
&documentation.index;
</book>
-<!--
-Local Variables:
-mode: sgml
-sgml-omittag: nil
-sgml-shorttag: t
-End:
--->
-
diff --git a/doc/kghostview/index.docbook b/doc/kghostview/index.docbook
index a635ab63..b952e524 100644
--- a/doc/kghostview/index.docbook
+++ b/doc/kghostview/index.docbook
@@ -745,11 +745,3 @@ url="http://apps.kde.com">http://apps.kde.com</ulink>. </para>
&documentation.index;
</book>
-<!--
-Local Variables:
-mode: sgml
-sgml-omittag: nil
-sgml-shorttag: t
-End:
--->
-
diff --git a/doc/kolourpaint/index.docbook b/doc/kolourpaint/index.docbook
index 6a568a62..d59b41bd 100644
--- a/doc/kolourpaint/index.docbook
+++ b/doc/kolourpaint/index.docbook
@@ -1487,15 +1487,3 @@ installed on this system and you do not need to follow these generic instruction
&documentation.index;
</book>
-
-<!--
-Local Variables:
-mode: xml
-sgml-minimize-attributes:nil
-sgml-general-insert-case:lower
-sgml-indent-step:0
-sgml-indent-data:nil
-End:
-
-vim:tabstop=2:shiftwidth=2:expandtab
--->
diff --git a/doc/kpdf/index.docbook b/doc/kpdf/index.docbook
index a4308ac2..c6164cb9 100644
--- a/doc/kpdf/index.docbook
+++ b/doc/kpdf/index.docbook
@@ -917,16 +917,3 @@
</appendix>
&documentation.index;
</book>
-
-
-<!--
-Local Variables:
-mode: sgml
-sgml-minimize-attributes:nil
-sgml-general-insert-case:lower
-sgml-indent-step:0
-sgml-indent-data:nil
-End:
-
-// vim:ts=2:sw=2:tw=78:noet
--->
diff --git a/doc/kpovmodeler/index.docbook b/doc/kpovmodeler/index.docbook
index 86bc469a..f8123b19 100644
--- a/doc/kpovmodeler/index.docbook
+++ b/doc/kpovmodeler/index.docbook
@@ -2086,15 +2086,3 @@ linkend="gloss-bump-map">bump map</link>.</para>
</appendix>
</book>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-minimize-attributes:nil
-sgml-general-insert-case:lower
-sgml-indent-step:0
-sgml-indent-data:nil
-End:
-
-// vim:ts=2:sw=2:tw=78:noet
--->
diff --git a/doc/kruler/index.docbook b/doc/kruler/index.docbook
index 4d1a494c..075dfbf1 100644
--- a/doc/kruler/index.docbook
+++ b/doc/kruler/index.docbook
@@ -349,11 +349,3 @@ background color for &kruler;.</para>
&documentation.index;
</book>
-<!--
-Local Variables:
-mode: sgml
-sgml-minimize-attributes: nil
-sgml-general-insert-case: lower
-End:
--->
-
diff --git a/doc/ksnapshot/index.docbook b/doc/ksnapshot/index.docbook
index 0fe19f83..780efe0b 100644
--- a/doc/ksnapshot/index.docbook
+++ b/doc/ksnapshot/index.docbook
@@ -522,14 +522,3 @@ as shown below.
&documentation.index;
</book>
-
-<!--
-Local Variables:
-sgml-minimize-attributes: nil
-sgml-general-insert-case: lower
-End:
--->
-
-
-
-
diff --git a/doc/kuickshow/index.docbook b/doc/kuickshow/index.docbook
index bc16d2de..3f12bad0 100644
--- a/doc/kuickshow/index.docbook
+++ b/doc/kuickshow/index.docbook
@@ -1028,14 +1028,3 @@ url="http://apps.kde.org/kapp">http://apps.kde.org/kapp</ulink>.
&documentation.index;
</book>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-minimize-attributes:nil
-sgml-general-insert-case:lower
-sgml-indent-step:0
-sgml-indent-data:nil
-End:
--->
-
diff --git a/doc/kview/index.docbook b/doc/kview/index.docbook
index 72221c99..e9687154 100644
--- a/doc/kview/index.docbook
+++ b/doc/kview/index.docbook
@@ -826,10 +826,3 @@ tdelibs/kimgio.</para>
&documentation.index;
</book>
-<!--
-Local Variables:
-mode: sgml
-sgml-minimize-attributes: nil
-sgml-general-insert-case: lower
-End:
--->
diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt
new file mode 100644
index 00000000..5a2be20d
--- /dev/null
+++ b/doc/man/CMakeLists.txt
@@ -0,0 +1,18 @@
+if( BUILD_KVIEWSHELL OR BUILD_KDVI OR BUILD_KFAX )
+ add_subdirectory( kviewshell )
+endif( )
+
+tde_conditional_add_subdirectory( BUILD_KCOLOREDIT kcoloredit )
+tde_conditional_add_subdirectory( BUILD_KDVI kdvi )
+tde_conditional_add_subdirectory( BUILD_KFAX kfax )
+tde_conditional_add_subdirectory( BUILD_KFAXVIEW kfaxview )
+tde_conditional_add_subdirectory( BUILD_KGHOSTVIEW kghostview )
+tde_conditional_add_subdirectory( BUILD_KOLOURPAINT kolourpaint )
+tde_conditional_add_subdirectory( BUILD_KOOKA kooka )
+tde_conditional_add_subdirectory( BUILD_KPDF kpdf )
+tde_conditional_add_subdirectory( BUILD_KPOVMODELER kpovmodeler )
+tde_conditional_add_subdirectory( BUILD_KRULER kruler )
+tde_conditional_add_subdirectory( BUILD_KSNAPSHOT ksnapshot )
+tde_conditional_add_subdirectory( BUILD_KUICKSHOW kuickshow )
+tde_conditional_add_subdirectory( BUILD_KVIEW kview )
+tde_conditional_add_subdirectory( BUILD_TDEICONEDIT tdeiconedit )
diff --git a/doc/man/kcoloredit/CMakeLists.txt b/doc/man/kcoloredit/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kcoloredit/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kcoloredit/kcolorchooser.1 b/doc/man/kcoloredit/kcolorchooser.1
new file mode 100644
index 00000000..d0fd9cfb
--- /dev/null
+++ b/doc/man/kcoloredit/kcolorchooser.1
@@ -0,0 +1,54 @@
+.TH KCOLORCHOOSER "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kcolorchooser \- TDE Color Chooser
+.SH SYNOPSIS
+.B kcolorchooser
+[\fIQt-options\fR] [\fITDE-options\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B kcolorchooser
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+TDE Color Chooser
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH AUTHOR
+KColorChooser was written by
+.nh
+Waldo Bastian <bastian@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kcoloredit/kcoloredit.1 b/doc/man/kcoloredit/kcoloredit.1
new file mode 100644
index 00000000..3318864e
--- /dev/null
+++ b/doc/man/kcoloredit/kcoloredit.1
@@ -0,0 +1,67 @@
+.TH KCOLOREDIT "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kcoloredit \- TDE Color Palette Editor
+.SH SYNOPSIS
+.B kcoloredit
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIFile\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B kcoloredit
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+.B KColorEdit
+is a palette files editor. It can be used for editing color palettes and for color choosing and naming.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+File
+file to open
+.SH "SEE ALSO"
+The full documentation for
+.B kcoloredit
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kcoloredit
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KColorEdit was written by
+.nh
+Artur Rataj <art@zeus.polsl.gliwice.pl>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kdvi/CMakeLists.txt b/doc/man/kdvi/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kdvi/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kdvi/kdvi.1 b/doc/man/kdvi/kdvi.1
new file mode 100644
index 00000000..f1df971a
--- /dev/null
+++ b/doc/man/kdvi/kdvi.1
@@ -0,0 +1,99 @@
+.TH KDVI "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kdvi \- TDE DVI Viewer
+.SH SYNOPSIS
+.B kviewshell
+[\fIQt-options\fR] [\fITDE-options\fR] \fIpart file(s)\fR
+.SH DESCRIPTION
+This manual page documents briefly the
+.B kdvi
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B KDVI
+is a plugin for the KViewshell program which allows KViewshell to
+display DVI-files (.dvi) which are produced by the TeX typesetting
+system. KDVI supports many extensions of the DVI standard, for
+instance the inclusion of PostScript graphics or hyperlinks. More
+details, examples and all the technical specifications can be found in
+the file KDVI-features.dvi (or see KDVI-features.tex for the TeX
+source of that file).
+.P
+For up-to-date information, consult KDVI's home page.
+.P
+TeX is a high-end typesetting system geared towards scientific, and in
+particular mathematical typesetting. More information about TeX and
+DVI can be found on the homepage of the TeX user group or the German
+German DANTE e.V..
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+part
+The part to use
+.SH OPTIONS
+.TP
+\fB\-\-unique\fR
+Check if the file is loaded in another kviewshell. If it is, bring up the other kviewshell. Otherwise, load the file.
+.TP
+\fB\-\-paper\fR
+Sets paper size (not implemented at the moment, only for compatibility with lyx)
+.TP
+file(s)
+Files to load
+.SH "SEE ALSO"
+The full documentation for
+.B kdvi
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kdvi
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KViewShell was written by
+.nh
+Matthias Hoelzer-Kluepfel <mhk@caldera.de>,
+David Sweet <dsweet@kde.org>,
+Mark Donohoe,
+Markku Hihnala,
+David Faure,
+Daniel Duley,
+Espen Sand and
+Stefan Kebekus <kebekus@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kfax/CMakeLists.txt b/doc/man/kfax/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kfax/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kfax/kfax.1 b/doc/man/kfax/kfax.1
new file mode 100644
index 00000000..ac7583cc
--- /dev/null
+++ b/doc/man/kfax/kfax.1
@@ -0,0 +1,102 @@
+.TH KFAX "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kfax \- TDE Fax Viewer
+.SH SYNOPSIS
+.B kfax
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIoptions\fR] \fIfile(s)\fR
+.SH DESCRIPTION
+This manual page documents briefly the
+.B kfax
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+A program to display raw and tiffed fax images (g3, g3-2d, g4).
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH OPTIONS
+.TP
+\fB\-f\fR, \fB\-\-fine\fR
+Fine resolution
+.TP
+\fB\-n\fR, \fB\-\-normal\fR
+Normal resolution
+.TP
+\fB\-\-height\fR
+Height (number of fax lines)
+.TP
+\fB\-w\fR, \fB\-\-width\fR
+Width (dots per fax line)
+.TP
+\fB\-l\fR, \fB\-\-landscape\fR
+Turn image 90 degrees (landscape mode)
+.TP
+\fB\-u\fR, \fB\-\-upsidedown\fR
+Turn image upside down
+.TP
+\fB\-i\fR, \fB\-\-invert\fR
+Invert black and white.
+.TP
+\fB\-m\fR, \fB\-\-mem\fR <bytes>
+Limit memory use to 'bytes'. [8M]
+.TP
+\fB\-r\fR, \fB\-\-reverse\fR
+Fax data is packed lsb first
+.TP
+\fB\-2\fR
+Raw files are g3-2d
+.TP
+\fB\-4\fR
+Raw files are g4
+.SS "Arguments:"
+.TP
+file(s)
+Fax file(s) to show
+.SH "SEE ALSO"
+The full documentation for
+.B kfax
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kfax
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KFax was written by
+.nh
+Bernd Johannes Wuebben <wuebben@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kfaxview/CMakeLists.txt b/doc/man/kfaxview/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kfaxview/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kfaxview/kfaxview.1 b/doc/man/kfaxview/kfaxview.1
new file mode 100644
index 00000000..592c64c0
--- /dev/null
+++ b/doc/man/kfaxview/kfaxview.1
@@ -0,0 +1,66 @@
+.TH KFAXVIEWER "1" "October 2007" TDE "TDE Application"
+.SH NAME
+kfaxviewer \- TDE fax viewer using kviewshell
+.SH SYNOPSIS
+.B kfaxview
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIoptions\fR] \fIfile(s)\fR
+.SH DESCRIPTION
+This manual page briefly documents the
+.B kfaxview
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program doesn't have a manual page.
+.PP
+A fax viewer for TDE using kviewshell.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH OPTIONS
+.TP
+\fB\-\-unique\fR
+Check if the file is loaded in another KFaxView instance.
+If it is, bring up the other KFaxView. Otherwise, load the file.
+.TP
+\fB\-g\fR, \fB\-\-goto\fR <pagenumber>
+Navigate to this page
+.TP
+.SS "Arguments:"
+.TP
+file(s)
+Files to load
+.SH AUTHOR
+KFaxview was written by
+.nh
+Stefan Kebekus <kebekus@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Francesco Pedrini<francesco.pedrini@gmail.com>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
+
diff --git a/doc/man/kghostview/CMakeLists.txt b/doc/man/kghostview/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kghostview/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kghostview/kghostview.1 b/doc/man/kghostview/kghostview.1
new file mode 100644
index 00000000..be63ba0f
--- /dev/null
+++ b/doc/man/kghostview/kghostview.1
@@ -0,0 +1,89 @@
+.TH KGHOSTVIEW "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kghostview \- TDE PS/PDF Viewer
+.SH SYNOPSIS
+.B kghostview
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIURL\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B KGhostView
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+.B KGhostView
+displays and prints PostScript (.ps, .eps) and Portable
+Document Format (.pdf) files. It a port to TDE of Tim Theisen's
+Ghostview program which uses Alladin Ghostscript to view documents
+prepared in Adobe's PostScript page description
+language. PostScript is the major page description language for
+printing on UNIX(rg systems and this application can be used to preview
+material intended for printing or for reading documents online.
+.P
+You can use KGhostView with all recent versions of Ghostscript. Newer
+versions offer much improved performance which you can take advantage
+of with KGhostView.
+.P
+If a document does not conform to the Adobe document structuring
+convention the functionality of the viewer is limited. For example, if
+there is no table of contents, skipping around the document and
+marking pages is not possible.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+URL
+Location to open
+.SH "SEE ALSO"
+The full documentation for
+.B KGhostView
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kghostview
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KGhostView was written by
+.nh
+Wilco Greven <greven@kde.org>,
+David Sweet <dsweet@kde.org>,
+Mark Donohoe <donohoe@kde.org>,
+David Faure <faure@kde.org>,
+Daniel Duley <mosfet@kde.org> and
+Espen Sand <espen@kde.org>
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kolourpaint/CMakeLists.txt b/doc/man/kolourpaint/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kolourpaint/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kolourpaint/kolourpaint.1 b/doc/man/kolourpaint/kolourpaint.1
new file mode 100644
index 00000000..42a126a8
--- /dev/null
+++ b/doc/man/kolourpaint/kolourpaint.1
@@ -0,0 +1,75 @@
+.TH KPAINT "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kolourpaint \- TDE Paint Program
+.SH SYNOPSIS
+.B kolourpaint
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIfile\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B KPaint
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B KPaint
+is a simple bitmap drawing program that can also be used to modify
+existing image files and convert between image file formats.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+file
+File or URL to open
+.SH "SEE ALSO"
+The full documentation for
+.B KPaint
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kolourpaint
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KPaint was written by
+.nh
+Richard J. Moore <rich@kde.org>,
+Robert Williams <rwilliams@jrcmaui.com>,
+Mario Weilguni <mweilguni@kde.org>,
+Christian Oppel <uzs84g@uni-bonn.de>,
+John Califf <jcaliff@compuzone.net> and
+Laurent Montel <lmontel@mandrakesoft.com>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kooka/CMakeLists.txt b/doc/man/kooka/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kooka/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kooka/kooka.1 b/doc/man/kooka/kooka.1
new file mode 100644
index 00000000..a8f34e41
--- /dev/null
+++ b/doc/man/kooka/kooka.1
@@ -0,0 +1,89 @@
+.TH KOOKA "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kooka \- TDE Scan & OCR Program
+.SH SYNOPSIS
+.B kooka
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIoptions\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B Kooka
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+.B Kooka
+is a TDE application which provides access to scanner
+hardware using the SANE library.
+.P
+Kooka helps you scan, save your
+image in the correct image format and perform \fBO\fRptical
+\fBC\fRharacter \fBR\fRecognition on it,using \fIgocr\fR, Joerg
+Schulenburg's and friends' Open Source ocr program.
+.P
+Kooka is a TDE application that enables easy scanning using SANE
+libraries. Therefore, SANE the package must be installed to use
+Kooka. Clear and concise use was the focus of its development.
+.P
+Character recognition is also provided by the built-in text
+recognition program gocr. Install gocr to use this
+functionality. After character recognition is complete, the recognized
+material can be opened in the text editor Kate with just one click,
+where you can edit the contents.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH OPTIONS
+.TP
+\fB\-d\fR
+the SANE compatible device specification (e.g. umax:/dev/sg0) []
+.TP
+\fB\-g\fR
+gallery mode - do not connect to scanner []
+.SH "SEE ALSO"
+The full documentation for
+.B Kooka
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kooka
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+Kooka was written by
+.nh
+Klaas Freitag <freitag@suse.de> and
+Mat Colton <mat@colton.de>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kpdf/CMakeLists.txt b/doc/man/kpdf/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kpdf/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kpdf/kpdf.1 b/doc/man/kpdf/kpdf.1
new file mode 100644
index 00000000..fc0c5953
--- /dev/null
+++ b/doc/man/kpdf/kpdf.1
@@ -0,0 +1,168 @@
+.\" This file was generated by (a slightly modified) kdemangen.pl and edited by hand
+.TH KPDF 1 "June 2006" "Trinity Desktop Environment" "pdf viewer"
+.SH NAME
+kpdf
+\- a TDE pdf viewer based on xpdf
+.SH SYNOPSIS
+\fBkpdf\fP [Qt\-options] [TDE\-options] [URL]
+.SH DESCRIPTION
+\fBkpdf\fP is a TDE PDF viewer based on \fBxpdf\fP code. Although being based on \fBxpdf\fP code, \fBkpdf\fP has some unique features like continuous mode and presentation support.
+.sp 1
+The PDF format is widely used for publishing documents that are mostly not meant to be edited again. \fBkpdf\fP is only a viewer for these files and therefore it doesn't provide any functionality to edit or create PDF documents.
+.SH OPTIONS
+.SS
+.SS Arguments:
+.TP
+.B URL
+Document to open
+.SS Generic options:
+.TP
+.B \-\-help
+Show help about options
+.TP
+.B \-\-help\-qt
+Show Qt specific options
+.TP
+.B \-\-help\-tde
+Show TDE specific options
+.TP
+.B \-\-help\-all
+Show all options
+.TP
+.B \-\-author
+Show author information
+.TP
+.B \-v, \-\-version
+Show version information
+.TP
+.B \-\-license
+Show license information
+.TP
+.B \-\-
+End of options
+.SS
+.SS Qt options:
+.TP
+.B \-\-display <displayname>
+Use the X-server display 'displayname'
+.TP
+.B \-\-session <sessionId>
+Restore the application for the given 'sessionId'
+.TP
+.B \-\-cmap
+Causes the application to install a private color
+map on an 8\-bit display
+.TP
+.B \-\-ncols <count>
+Limits the number of colors allocated in the color
+cube on an 8\-bit display, if the application is
+using the QApplication::ManyColor color
+specification
+.TP
+.B \-\-nograb
+tells Qt to never grab the mouse or the keyboard
+.TP
+.B \-\-dograb
+running under a debugger can cause an implicit
+\-nograb, use \-dograb to override
+.TP
+.B \-\-sync
+switches to synchronous mode for debugging
+.TP
+.B \-\-fn, \-\-font <fontname>
+defines the application font
+.TP
+.B \-\-bg, \-\-background <color>
+sets the default background color and an
+application palette (light and dark shades are
+calculated)
+.TP
+.B \-\-fg, \-\-foreground <color>
+sets the default foreground color
+.TP
+.B \-\-btn, \-\-button <color>
+sets the default button color
+.TP
+.B \-\-name <name>
+sets the application name
+.TP
+.B \-\-title <title>
+sets the application title (caption)
+.TP
+.B \-\-visual TrueColor
+forces the application to use a TrueColor visual on
+an 8\-bit display
+.TP
+.B \-\-inputstyle <inputstyle>
+sets XIM (X Input Method) input style. Possible
+values are onthespot, overthespot, offthespot and
+root
+.TP
+.B \-\-im <XIM server>
+set XIM server
+.TP
+.B \-\-noxim
+disable XIM
+.TP
+.B \-\-reverse
+mirrors the whole layout of widgets
+.SS
+.SS TDE options:
+.TP
+.B \-\-caption <caption>
+Use 'caption' as name in the titlebar
+.TP
+.B \-\-icon <icon>
+Use 'icon' as the application icon
+.TP
+.B \-\-miniicon <icon>
+Use 'icon' as the icon in the titlebar
+.TP
+.B \-\-config <filename>
+Use alternative configuration file
+.TP
+.B \-\-dcopserver <server>
+Use the DCOP Server specified by 'server'
+.TP
+.B \-\-nocrashhandler
+Disable crash handler, to get core dumps
+.TP
+.B \-\-waitforwm
+Waits for a WM_NET compatible windowmanager
+.TP
+.B \-\-style <style>
+sets the application GUI style
+.TP
+.B \-\-geometry <geometry>
+sets the client geometry of the main widget - see man X for the argument format
+.SS
+
+.SH SEE ALSO
+\fBxpdf\fP(1)
+.sp 1
+Full user documentation is available through the TDE Help Center. You can also enter the URL
+.BR help:/kpdf/
+directly into konqueror or you can run
+.BR "khelpcenter help:/kpdf/"
+from the command\-line.
+.br
+.SH AUTHORS
+.nf
+Wilco Greven <greven@kde.org>
+.br
+Christophe Devriese <oelewapperke@oelewapperke.org>
+.br
+Laurent Montel <montel@kde.org>
+.br
+Albert Astals Cid <astals11@terra.es>
+.br
+Enrico Ros <eros.kde@email.it>
+.br
+
+.br
+.fi
+Please use http://bugs.trinitydesktop.org to report bugs; do not mail the authors directly.
+.PP
+This manual page was written by Holger Hartmann <Holger_Hartmann@gmx.de> for the Debian Project, but may be used by others. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
+.PP
+On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common\-licenses/GPL.
diff --git a/doc/man/kpovmodeler/CMakeLists.txt b/doc/man/kpovmodeler/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kpovmodeler/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kpovmodeler/kpovmodeler.1 b/doc/man/kpovmodeler/kpovmodeler.1
new file mode 100644
index 00000000..3d536d26
--- /dev/null
+++ b/doc/man/kpovmodeler/kpovmodeler.1
@@ -0,0 +1,82 @@
+.TH KPOVMODELER "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kpovmodeler \- TDE Povray Modeler
+.SH SYNOPSIS
+.B kpovmodeler
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIfile\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B Povray Modeler
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B KPovModeler
+is a 3D modeling application to generate POV-Ray scenes.
+.P
+While it is not necessary to fully understand the POV-Ray application
+in order to make good use of KPovModeler, it is highly recommended
+that you read and try to understand the POV-Ray documentation.
+.P
+To find out more about POV-Ray go to www.povray.org.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+file
+File to open
+.SH OPTIONS
+.TP
+\fB\-\-no\-opengl\fR
+Disables OpenGL rendering
+.SH "SEE ALSO"
+The full documentation for
+.B Povray Modeler
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kpovmodeler
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KPovModeler was written by
+.nh
+Andreas Zehender <zehender@kde.org>,
+Luis Passos Carvalho <lpassos@mail.telepac.pt>,
+Philippe Van Hecke <lephiloux@tiscalinet.be> and
+.hy
+Leonardo Skorianez <skorianez@bol.com.br>.
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kruler/CMakeLists.txt b/doc/man/kruler/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kruler/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kruler/kruler.1 b/doc/man/kruler/kruler.1
new file mode 100644
index 00000000..9e32021c
--- /dev/null
+++ b/doc/man/kruler/kruler.1
@@ -0,0 +1,81 @@
+.TH KRULER "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kruler \- TDE Screen Ruler
+.SH SYNOPSIS
+.B kruler
+[\fIQt-options\fR] [\fITDE-options\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B KRuler
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+.B KRuler
+is a very simple application, with only one aim in life. To
+measure distances on your screen.
+.P
+To start KRuler, choose Graphics->TDE Screen Ruler from your T menu.
+.P
+left mouse button clicking on the KRuler will turn the cursor into a
+hand icon, and enable you to drag KRuler around the screen.
+.P
+When you move the mouse over KRuler, your cursor will turn into an
+elongated arrow, with a circle at one end. As you move the cursor,
+KRuler will display how far from the point marked 0 the circle on the
+end of the cursor currently is. KRuler will also display the HTML
+color code of the color currently under the circle. This is very
+useful for picking out colors from an image. If you move the mouse far
+enough that the arrow cursor is no longer touching KRuler, the cursor
+will revert to normal, allowing you to carry on working with your
+other applications.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH "SEE ALSO"
+The full documentation for
+.B KRuler
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kruler
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+TDE Screen Ruler was written by
+.nh
+Till Krech <till@snafu.de>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/ksnapshot/CMakeLists.txt b/doc/man/ksnapshot/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/ksnapshot/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/ksnapshot/ksnapshot.1 b/doc/man/ksnapshot/ksnapshot.1
new file mode 100644
index 00000000..250ca0ef
--- /dev/null
+++ b/doc/man/ksnapshot/ksnapshot.1
@@ -0,0 +1,71 @@
+.TH KSNAPSHOT "1" "September 2002" TDE "TDE Application"
+.SH NAME
+ksnapshot \- TDE Screen Capture Program
+.SH SYNOPSIS
+.B ksnapshot
+[\fIQt-options\fR] [\fITDE-options\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B KSnapshot
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B KSnapshot
+is a simple applet for taking screenshots. It is capable of
+capturing images of either the whole desktop or just a single
+window. The images can then be saved in a variety of formats.
+.PP
+TDE Screenshot utility
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH "SEE ALSO"
+The full documentation for
+.B KSnapshot
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/ksnapshot
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KSnapshot was written by
+.nh
+Richard J. Moore <rich@kde.org>,
+Matthias Ettrich <ettrich@kde.org> and
+Aaron J. Seigo <aseigo@olympusproject.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kuickshow/CMakeLists.txt b/doc/man/kuickshow/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kuickshow/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kuickshow/kuickshow.1 b/doc/man/kuickshow/kuickshow.1
new file mode 100644
index 00000000..bf5caf30
--- /dev/null
+++ b/doc/man/kuickshow/kuickshow.1
@@ -0,0 +1,99 @@
+.TH KUICKSHOW "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kuickshow \- TDE Image Viewer
+.SH SYNOPSIS
+.B kuickshow
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIoptions\fR] [\fIfiles\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B Kuickshow
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B KuickShow
+is a comfortable image browser/viewer. It displays a
+filebrowser where you can select images which are then shown.
+.P
+The following image formats are supported:
+.P
+.RS
+\(bu jpg
+.br
+\(bu gif
+.br
+\(bu tiff
+.br
+\(bu png
+.br
+\(bu bmp
+.br
+\(bu psd
+.br
+\(bu xmp
+.br
+\(bu xbm
+.br
+\(bu eim
+.RE
+.P
+Images can be displayed either in their own window, as large as the
+image, or fullscreen.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SH OPTIONS
+.TP
+\fB\-\-lastdir\fR
+Start in the last visited directory, not the current working directory
+.SS "Arguments:"
+.TP
+files
+Optional image filenames/urls to show
+.SH "SEE ALSO"
+The full documentation for
+.B Kuickshow
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kuickshow
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KuickShow was written by
+.nh
+Carsten Pfeiffer <pfeiffer@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kview/CMakeLists.txt b/doc/man/kview/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kview/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kview/kview.1 b/doc/man/kview/kview.1
new file mode 100644
index 00000000..64a2b692
--- /dev/null
+++ b/doc/man/kview/kview.1
@@ -0,0 +1,78 @@
+.TH KVIEW "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kview \- TDE Image Viewer
+.SH SYNOPSIS
+.B kview
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIURL\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B KView
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B KView
+is an image viewer for the Trinity desktop. You can view graphics of
+many different formats such as PostScript, TIFF etc. By saving your
+files in a different format than the original you can easily convert
+images to other graphics formats. In addition, KView provides some
+nice little features for doing simple image processing, like
+stretching/shrinking, rotation and filtering. You can tile your images
+directly onto the desktop as a background picture, or arrange them in
+a little slideshow.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+URL
+Image to open
+.SH "SEE ALSO"
+The full documentation for
+.B KView
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/kview
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+KView was written by
+.nh
+Matthias Kretz <kretz@kde.org>,
+Sirtaj Singh Kang <taj@kde.org>
+and Simon Hausmann <hausmann@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/kviewshell/CMakeLists.txt b/doc/man/kviewshell/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/kviewshell/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/kviewshell/kviewshell.1 b/doc/man/kviewshell/kviewshell.1
new file mode 100644
index 00000000..83d0e24d
--- /dev/null
+++ b/doc/man/kviewshell/kviewshell.1
@@ -0,0 +1,75 @@
+.TH KVIEWSHELL "1" "September 2002" TDE "TDE Application"
+.SH NAME
+kviewshell \- Generic framework for viewer applications
+.SH SYNOPSIS
+.B kviewshell
+[\fIQt-options\fR] [\fITDE-options\fR] \fIpart file(s)\fR
+.SH DESCRIPTION
+This manual page documents briefly the
+.B kviewshell
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.PP
+Generic framework for viewer applications.
+.P
+This program is part of the official TDE graphics module.
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+part
+The part to use
+.SH OPTIONS
+.TP
+\fB\-\-unique\fR
+Check if the file is loaded in another kviewshell. If it is, bring up the other kviewshell. Otherwise, load the file.
+.TP
+\fB\-\-paper\fR
+Sets paper size (not implemented at the moment, only for compatibility with lyx)
+.TP
+file(s)
+Files to load
+.SH AUTHOR
+KViewShell was written by
+.nh
+Matthias Hoelzer-Kluepfel <mhk@caldera.de>,
+David Sweet <dsweet@kde.org>,
+Mark Donohoe,
+Markku Hihnala,
+David Faure,
+Daniel Duley,
+Espen Sand,
+and Stefan Kebekus <kebekus@kde.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/man/tdeiconedit/CMakeLists.txt b/doc/man/tdeiconedit/CMakeLists.txt
new file mode 100644
index 00000000..24ccd704
--- /dev/null
+++ b/doc/man/tdeiconedit/CMakeLists.txt
@@ -0,0 +1,7 @@
+file( GLOB _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1 )
+
+INSTALL(
+ FILES ${_man_files}
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ COMPONENT doc
+)
diff --git a/doc/man/tdeiconedit/tdeiconedit.1 b/doc/man/tdeiconedit/tdeiconedit.1
new file mode 100644
index 00000000..70bcb510
--- /dev/null
+++ b/doc/man/tdeiconedit/tdeiconedit.1
@@ -0,0 +1,89 @@
+.TH TDEICONEDIT "1" "September 2002" TDE "TDE Application"
+.SH NAME
+tdeiconedit \- TDE Icon Editor
+.SH SYNOPSIS
+.B tdeiconedit
+[\fIQt-options\fR] [\fITDE-options\fR] [\fIfile(s)\fR]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B TDEIconEdit
+TDE Application.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+.P
+.B TDEIconEdit
+is designed to help create icons for TDE using the standard
+icon palette.
+.PP
+TDE Icon Editor
+.SH AUTHOR
+TDEIconEdit was written by
+.nh
+Thomas Tanghus <tanghus@kde.org>,
+John Califf <jcaliff@compuzone.net>,
+Laurent Montel <lmontel@mandrakesoft.com> and
+Aaron J. Seigo <aseigo@olympusproject.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
+.SS "Generic options:"
+.TP
+\fB\-\-help\fR
+Show help about options
+.TP
+\fB\-\-help\-qt\fR
+Show Qt specific options
+.TP
+\fB\-\-help\-tde\fR
+Show TDE specific options
+.TP
+\fB\-\-help\-all\fR
+Show all options
+.TP
+\fB\-\-author\fR
+Show author information
+.TP
+\fB\-v\fR, \fB\-\-version\fR
+Show version information
+.TP
+\fB\-\-license\fR
+Show license information
+.TP
+\fB\-\-\fR
+End of options
+.SS "Arguments:"
+.TP
+file(s)
+Icon file(s) to open
+.SH "SEE ALSO"
+The full documentation for
+.B TDEIconEdit
+is maintained as a docbook manual. If the
+.B khelpcenter
+program is properly installed at your site, the command
+.IP
+.B khelpcenter help:/tdeiconedit
+.PP
+should give you access to the complete manual.
+.SH AUTHOR
+TDEIconEdit was written by
+.nh
+Thomas Tanghus <tanghus@kde.org>,
+John Califf <jcaliff@compuzone.net>,
+Laurent Montel <lmontel@mandrakesoft.com>
+and Aaron J. Seigo <aseigo@olympusproject.org>.
+.hy
+.br
+Please use http://bugs.trinitydesktop.org to report bugs, do not mail the authors directly.
+.br
+This manual page was prepared by
+.nh
+Karolina Lindqvist <pgd\-karolinali@algonet.se>
+.hy
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/doc/tdeiconedit/index.docbook b/doc/tdeiconedit/index.docbook
index 9dd1ad61..8422f737 100644
--- a/doc/tdeiconedit/index.docbook
+++ b/doc/tdeiconedit/index.docbook
@@ -1070,14 +1070,3 @@ XMLGUI, Lots of fixes and cleanup</para></listitem>
</book>
-
-<!--
-Local Variables:
-mode: sgml
-sgml-indent-step:0
-sgml-indent-data:nil
-sgml-omittag:nil
-sgml-shorttag:t
-End:
--->
-
diff --git a/kamera/kcontrol/CMakeL10n.txt b/kamera/kcontrol/CMakeL10n.txt
index 75a9a1a7..d6ff2c57 100644
--- a/kamera/kcontrol/CMakeL10n.txt
+++ b/kamera/kcontrol/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kcmkamera" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kamera.desktop/"
+ SOURCES kamera.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kamera/kcontrol/CMakeLists.txt b/kamera/kcontrol/CMakeLists.txt
index c901d4b4..e27ffccb 100644
--- a/kamera/kcontrol/CMakeLists.txt
+++ b/kamera/kcontrol/CMakeLists.txt
@@ -24,7 +24,7 @@ link_directories(
#### other data #################################
-install( FILES kamera.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( kamera.desktop )
#### kamera (module) ############################
diff --git a/kamera/kcontrol/kamera.desktop b/kamera/kcontrol/kamera.desktop
index aea50041..0a4292e0 100644
--- a/kamera/kcontrol/kamera.desktop
+++ b/kamera/kcontrol/kamera.desktop
@@ -1,188 +1,7 @@
[Desktop Entry]
+Name=Digital Camera
Comment=Configure Kamera
-Comment[af]=Konfigureer Kamera
-Comment[ar]=إعداد Kamera
-Comment[az]=Kameranı Quraşdır
-Comment[bg]=Настройване на цифров фотоапарат
-Comment[br]=Kefluniañ Kamera
-Comment[bs]=Podesi kameru
-Comment[ca]=Configura Kamera
-Comment[cs]=Nastavení Kamery
-Comment[cy]=Ffurfweddu Kamera
-Comment[da]=Indstil kamera
-Comment[de]=Kamera einrichten
-Comment[el]=Ρύθμιση Kamera
-Comment[eo]=Agordu fotilon
-Comment[es]=Configura Kamera
-Comment[et]=Kaamera seadistamine
-Comment[eu]=Konfiguratu Kamera
-Comment[fa]=پیکربندی Kamera
-Comment[fi]=Kameran asetukset
-Comment[fr]=Configuration de Kamera
-Comment[ga]=Cumraigh Kamera
-Comment[gl]=Configurar Kamera
-Comment[he]=שינוי הגדרות Kamera
-Comment[hi]=कॉन्फ़िगर केमरा
-Comment[hr]=Podesi Kameru
-Comment[hu]=A digitális fényképezőgépek beállításai
-Comment[id]=Konfigurasi kamera
-Comment[is]=Stilla samskiptaforrit stafrænna myndavéla (Kamera)
-Comment[it]=Configura Kamera
-Comment[ja]=カメラの設定
-Comment[kk]=Kamera баптаулары
-Comment[km]=កំណត់​រចនាសម្ព័ន្ធ Kamera
-Comment[ko]=카메라 설정
-Comment[lt]=Konfigūruoti Kamera
-Comment[mk]=Конфигурирајте ја Kamera
-Comment[ms]=Konfigurasi Kamera
-Comment[mt]=Ikkonfigura Kamera
-Comment[nb]=Tilpass Kamera
-Comment[nds]=Kamera instellen
-Comment[ne]=क्यामेरा कन्फिगर गर्नुहोस्
-Comment[nl]=Camera instellen
-Comment[nn]=Set opp Kamera
-Comment[nso]=Beakanya Kamera
-Comment[pa]=ਕੈਮਰਾ ਸੰਰਚਨਾ
-Comment[pl]=Konfiguracja Kamery
-Comment[pt]=Configuração do Kamera
-Comment[pt_BR]=Configurar Kamera
-Comment[ro]=Configurează aparatul foto digital
-Comment[ru]=Настройка камеры
-Comment[se]=Heivet govvenapperáhta
-Comment[sk]=Nastaviť program Kamera
-Comment[sl]=Nastavitve fotoaparata
-Comment[sr]=Подеси Kamera-у
-Comment[sr@Latn]=Podesi Kamera-u
-Comment[sv]=Anpassa kamera
-Comment[ta]=காமிராவை அமை
-Comment[tg]=Танзимоти камера
-Comment[th]=ปรับแต่ง Kamera
-Comment[tr]=Kamera'yı Yapılandır
-Comment[uk]=Налаштувати Kamera
-Comment[uz]=Fotoaparatni moslash
-Comment[uz@cyrillic]=Фотоапаратни мослаш
-Comment[ven]=Dzudzanya kamera
-Comment[xh]=Qwalasela Umfoti
-Comment[zh_CN]=配置 Kamera
-Comment[zh_HK]=設定 Kamera
-Comment[zh_TW]=設定照相機
-Comment[zu]=Hlanganisa ikhamera
Keywords=gphoto;camera;digicam;webcam;kamera;
-Keywords[ar]=gphoto;كاميرا;كاميرا رقمية;كاميرا ويب;kamera;
-Keywords[az]=gphoto;kamera;digicam;veb kamera;Kamera;webcam;
-Keywords[bg]=фото; апарат; фотоапарат; камера; цифров; цифрова; gphoto; camera; digicam; webcam; kamera;
-Keywords[br]=gphoto;kamera;digicam;webcam;kamera;
-Keywords[ca]=gphoto;càmera;digicam;webcam;kamera;
-Keywords[cs]=gphoto;Kamera;Digitální kamera;Webová kamera;Foto;
-Keywords[da]=gphoto;kamera;digicam;webcam;
-Keywords[de]=gphoto;Kamera;Digicam;Webcam;Digitalkamera;
-Keywords[el]=gphoto;κάμερα;digicam;webcam;kamera;
-Keywords[eo]=gphoto;kamerao;fotilo;cifereca fotilo;TTT-fotilo;
-Keywords[es]=gphoto;cámara;digicam;webcam;kamera;
-Keywords[et]=gphoto;kaamera;digitaalkaamera;veebikaamera;kamera;
-Keywords[eu]=gphoto;kamera;digicam;webcam;kamera;
-Keywords[fa]=gphoto، دوربین، دوربین رقمی، دوربین وب، kamera;
-Keywords[fi]=gphoto;kamera;digicam;webcam;
-Keywords[fr]=gphoto;camera;digicam;webcam;kamera;caméscope;caméra;appareil photo;
-Keywords[he]=gphoto;kamera;מצלמה;מצלמת רשת;מצלמה דיגיטלית; amera;digicam;webcam;
-Keywords[hi]=जीफोटो;केमरा;डिजिकेम;वेबकेम;केमरा;
-Keywords[hu]=gphoto;fényképezőgép;digitális fényképezőgép;webkamera;videókamera;
-Keywords[is]=gphoto;myndavél;stafræn myndavél;webcam;kamera;
-Keywords[it]=gphoto;fotocamera;macchina fotografica digitale;webcam;kamera;
-Keywords[ja]=gphoto;カメラ;デジカム;ウェブカム;kamera;
-Keywords[km]=gphoto;ម៉ាស៊ីន​ថត​រូប;digicam;ម៉ាស៊ីនថត​តាម​បណ្ដាញ;kamera;
-Keywords[ko]=gphoto;camera;digicam;webcam;kamera;사진;카메라;사진기;웹캠;
-Keywords[lv]=gfoto;camera;digicam;webcam;kamera;
-Keywords[nb]=gphoto;kamera;digicam;webcam;webkamera;
-Keywords[nds]=gphoto;Kamera;Webcam;Kamera;Nettkamera;
-Keywords[ne]=जी फोटो; क्यामेरा; डिजिक्याम; वेबक्याम; कामेरा;
-Keywords[nl]=gphoto;camera;digicam;webcam;kamera;foto;
-Keywords[nn]=gphoto;fotoapparat;digitalt kamera;webkamera;vevkamera;kamera;
-Keywords[pl]=gphoto;kamera;kamera cyfrowa;kamera sieciowa;
-Keywords[pt]=gphoto;câmara;digicam;webcam;kamera;
-Keywords[pt_BR]=gphoto;câmera;câmera digital;webcam;kamera;
-Keywords[ro]=gphoto;aparat;foto;digicam;webcam;camera;kamera;
-Keywords[ru]=gphoto;camera;digicam;webcam;kamera;камера;фото;
-Keywords[sl]=gphoto;kamera;digicam;webcam;foto;fotoaparat;spletna kamera;
-Keywords[sr]=gphoto;camera;digicam;webcam;kamera;камера;
-Keywords[sr@Latn]=gphoto;camera;digicam;webcam;kamera;kamera;
-Keywords[sv]=gphoto;kamera;digital kamera;webbkamera;kamera;
-Keywords[ta]=ஜிபோட்டோ; காமிரா; டிஜிகேம்;வலைதள காமிரா; காமிரா;
-Keywords[tg]=gphoto;camera;digicam;webcam;kamera;камера;фото;
-Keywords[tr]=gphoto;kamera;digicam;web kamera;Kamera;webcam;
-Keywords[uk]=gphoto;камера;цифрова камера;камера Тенет;kamera;
-Keywords[ven]=Tshinepe tsha g;Tshaudzhia zwifanyiso;digicam;webcam;Tshaudzhiazwifanyiso;
-Keywords[xh]=gphoto;umfoti;digicam;webcam;umfoti;
-Keywords[zh_CN]=gphoto;camera;digicam;webcam;kamera;照相机;数码相机;摄像头;
-Keywords[zh_TW]=gphoto;camera;digicam;webcam;kamera;照相機;
-Keywords[zu]=gphoto;ikhamera;digicam;webcam;ikhamera;
-Name=Digital Camera
-Name[af]=Digitaal Kamera
-Name[ar]=كاميرا رقمية
-Name[az]=Digital Kamera
-Name[bg]=Фотоапарат
-Name[br]=Kamera niverel
-Name[bs]=Digitalna kamera
-Name[ca]=Càmera digital
-Name[cs]=Digitální fotoaparát
-Name[cy]=Camera Digidol
-Name[da]=Digitalt kamera
-Name[de]=Digitalkamera
-Name[el]=Ψηφιακή κάμερα
-Name[eo]=Cifereca fotilo
-Name[es]=Cámara digital
-Name[et]=Digitaalkaamera
-Name[eu]=Kamera digitala
-Name[fa]=دوربین رقمی
-Name[fi]=Digitaalikamera
-Name[fr]=Appareil photo numérique
-Name[ga]=Ceamara Digiteach
-Name[gl]=Cámara dixital
-Name[he]=מצלמה דיגיטלית
-Name[hi]=डिजिटल कैमरा
-Name[hr]=Digitalna kamera
-Name[hu]=Digitális fényképezőgép
-Name[is]=Stafræn myndavél
-Name[it]=Macchina fotografica digitale
-Name[ja]=デジタルカメラ
-Name[kk]=Цифрлық камера
-Name[km]=ម៉ាស៊ីន​ថតរូប​ឌីជីថល
-Name[lt]=Skaitmeninė kamera
-Name[lv]=Digitālā Kamera
-Name[mk]=Дигитална камера
-Name[ms]=Kamera Digital
-Name[mt]=Kamera diġitali
-Name[nb]=Digitalkamera
-Name[nds]=Digitaalkamera
-Name[ne]= डिजिटल क्यामेरा
-Name[nl]=Digitale camera
-Name[nn]=Digitalkamera
-Name[nso]=Camera ya Digital
-Name[pa]=ਡਿਜ਼ੀਟਲ ਕੈਮਰਾ
-Name[pl]=Aparat cyfrowy
-Name[pt]=Máquina Fotográfica Digital
-Name[pt_BR]=Câmera Digital
-Name[ro]=Aparat foto digital
-Name[ru]=Цифровая камера
-Name[se]=Digitalalaš govvenapperáhtta
-Name[sk]=Digitálny fotoaparát
-Name[sl]=Digitalni fotoaparat
-Name[sr]=Дигитална камера
-Name[sr@Latn]=Digitalna kamera
-Name[sv]=Digitalkamera
-Name[ta]= Digital Camera
-Name[tg]=Камераи digital
-Name[th]=กล้องดิจิตอล
-Name[tr]=Sayısal Kamera
-Name[uk]=Цифровий фотоапарат
-Name[uz]=Fotoaparat
-Name[uz@cyrillic]=Фотоапарат
-Name[ven]=Tshau dzhia zwifanyiso tsha didzhithala
-Name[xh]=Ikhamera Yesuntswana
-Name[zh_CN]=数码相机
-Name[zh_HK]=數碼相機
-Name[zh_TW]=數位相機
-Name[zu]=Ikhamera ebonisa inani ngalinye
Terminal=false
Type=Application
X-TDE-Library=kamera
diff --git a/kcoloredit/CMakeL10n.txt b/kcoloredit/CMakeL10n.txt
index f5a1a6b9..2d7336c4 100644
--- a/kcoloredit/CMakeL10n.txt
+++ b/kcoloredit/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kcoloredit" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kcoloredit-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kcoloredit/CMakeLists.txt b/kcoloredit/CMakeLists.txt
index ad3d5552..ddd209b2 100644
--- a/kcoloredit/CMakeLists.txt
+++ b/kcoloredit/CMakeLists.txt
@@ -25,9 +25,10 @@ link_directories(
tde_install_icons( kcoloredit kcolorchooser )
-install( FILES
- kcoloredit.desktop kcolorchooser.desktop
- DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kcoloredit.desktop kcolorchooser.desktop
+ PO_DIR kcoloredit-desktops
+)
install( FILES
kcoloreditui.rc
diff --git a/kcoloredit/kcolorchooser.desktop b/kcoloredit/kcolorchooser.desktop
index 1cb1f5da..dfef24c6 100644
--- a/kcoloredit/kcolorchooser.desktop
+++ b/kcoloredit/kcolorchooser.desktop
@@ -6,103 +6,7 @@ Path=
Terminal=false
X-DocPath=kcoloredit/index.html
GenericName=Color Chooser
-GenericName[af]=Kleur Kieser
-GenericName[ar]=برنامج اختيار الألوان
-GenericName[bg]=Избор на цвят
-GenericName[br]=Dibaber livioù
-GenericName[bs]=Izbornik boja
-GenericName[ca]=Elecció de colors
-GenericName[cs]=Výběr barev
-GenericName[cy]=Dewis Lliwiau
-GenericName[da]=Farvevælger
-GenericName[de]=Farbauswahl
-GenericName[el]=Επιλογέας χρωμάτων
-GenericName[en_GB]=Colour Chooser
-GenericName[eo]=Ilo por elekti koloron
-GenericName[es]=Selector de colores
-GenericName[et]=Värvivalija
-GenericName[eu]=Kolore hautatzailea
-GenericName[fa]=انتخاب‌‌کنندۀ رنگ
-GenericName[fi]=Värivalitsin
-GenericName[fr]=Sélecteur de couleur
-GenericName[gl]=Selecionador de cores
-GenericName[he]=בוחר צבעים
-GenericName[hi]=रंग चयनक
-GenericName[hr]=Izbornik boja
-GenericName[hu]=Színválasztó
-GenericName[is]=Litavalstól
-GenericName[it]=Selettore di colori
-GenericName[ja]=色の選択
-GenericName[kk]=Түсті таңдау
-GenericName[km]=កម្មវិធី​ជ្រើស​ពណ៌
-GenericName[lt]=Spalvų parinkiklis
-GenericName[lv]=Krāsu Izvēlētājs
-GenericName[mk]=Избирач на бои
-GenericName[ms]=Pemilih Warna
-GenericName[mt]=Agħżel Kulur
-GenericName[nb]=Fargevelger
-GenericName[nds]=Klöörutwahl
-GenericName[ne]=रङ चयनकर्ता
-GenericName[nl]=Kleurenkiezer
-GenericName[nn]=Fargeveljar
-GenericName[pa]=ਰੰਗ ਸੰਰਚਨਾ
-GenericName[pl]=Wybór koloru
-GenericName[pt]=Selector de Cores
-GenericName[pt_BR]=Seletor de Cores
-GenericName[ro]=Selector de culori
-GenericName[ru]=Выбор цвета
-GenericName[se]=Ivdneválljejeaddji
-GenericName[sk]=Výber farieb
-GenericName[sl]=Izbirnik barv
-GenericName[sr]=Бирач боја
-GenericName[sr@Latn]=Birač boja
-GenericName[sv]=Färgväljare
-GenericName[ta]=வண்ணத் தேர்வு
-GenericName[tg]=Интихоби ранг
-GenericName[th]=เครื่องมือเลือกสีของ TDE
-GenericName[tr]=Renk Seçici
-GenericName[uk]=Селектор кольорів
-GenericName[uz]=Rang tanlovchi
-GenericName[uz@cyrillic]=Ранг танловчи
-GenericName[ven]=Munangi wa Muvhala
-GenericName[wa]=Tchoezixheu di coleurs
-GenericName[xh]=Mkhethi Wombala
-GenericName[zh_CN]=颜色选择程序
-GenericName[zh_HK]=顏色選擇器
-GenericName[zh_TW]=顏色選擇程式
-GenericName[zu]=Umkhethi Wombala
Name=KColorChooser
-Name[af]=K-kleur-kieser
-Name[ar]=برنامج KColorChooser
-Name[ca]=Elecció de colors
-Name[cs]=Výběr barev
-Name[cy]=KDewisLliw
-Name[eo]=Kolorelektilo
-Name[fi]=Värivalitsin
-Name[hi]=के-कलर-चूसर
-Name[hr]=Izbornik boja
-Name[is]=Litaval
-Name[lv]=KKrāsuIzvēlētājs
-Name[nb]=Fargevelger
-Name[ne]=केडीई रङ चयनकर्ता
-Name[nn]=TDE-fargeveljar
-Name[nso]=KMokgethi wa Mmala
-Name[pa]=ਕੇਰੰਗਚੋਣਕਾਰ
-Name[pl]=Wybór koloru
-Name[pt_BR]=KSeletor de Cores
-Name[ro]=Selector culori
-Name[se]=TDE-ivdneválljejeaddji
-Name[sv]=Kcolorchooser
-Name[ta]=கேவண்ணத் தேர்வு
-Name[th]=เครื่องมือเลือกสี - K
-Name[tr]=K Renk Seçici
-Name[uk]=Селектор кольорів
-Name[uz]=Rang tanlovchi
-Name[uz@cyrillic]=Ранг танловчи
-Name[ven]=Tshinangi tsha muvhala tsha K
-Name[xh]=Umkhethi Wombala i K
-Name[zh_TW]=KColorChooser 顏色選擇器
-Name[zu]=Umkhethi Wombala ka K
X-DCOP-ServiceType=Multi
Categories=Qt;TDE;Graphics;
diff --git a/kcoloredit/kcoloredit.desktop b/kcoloredit/kcoloredit.desktop
index 26663c32..960996e4 100644
--- a/kcoloredit/kcoloredit.desktop
+++ b/kcoloredit/kcoloredit.desktop
@@ -6,91 +6,7 @@ Path=
Terminal=false
X-DocPath=kcoloredit/index.html
GenericName=Color Palette Editor
-GenericName[af]=Kleur Palet Redigeerder
-GenericName[ar]=محرر لوحة الألوان
-GenericName[bg]=Редактор на цветове
-GenericName[br]=Aozer livaoueg
-GenericName[bs]=Editor palete boja
-GenericName[ca]=Editor de la paleta de colors
-GenericName[cs]=Editor palety barev
-GenericName[cy]=Golygydd Palet Lliwiau
-GenericName[da]=Farvepaletredigering
-GenericName[de]=Editor für Farbpaletten
-GenericName[el]=Επεξεργαστής παλέτας χρωμάτων
-GenericName[en_GB]=Colour Palette Editor
-GenericName[eo]=Paletroredaktilo
-GenericName[es]=Editor de paleta de color
-GenericName[et]=Värvipaleti redaktor
-GenericName[eu]=Koloreko paleta editorea
-GenericName[fa]=ویرایشگر پالت رنگ
-GenericName[fi]=Väripalettien muokkain
-GenericName[fr]=Éditeur de palette de couleurs
-GenericName[gl]=Editor de paletas de cores
-GenericName[he]=עורך לוחות צבעים
-GenericName[hi]=रंग पट्टिका संपादक
-GenericName[hr]=Uređivač palete
-GenericName[hu]=Palettaszerkesztő
-GenericName[is]=Sýsla með litaspjöld
-GenericName[it]=Editor di tavolozza
-GenericName[ja]=カラーパレットエディタ
-GenericName[kk]=Түстер палитрасын өңдеу
-GenericName[km]=កម្មវិធី​និពន្ធ​ក្ដារ​លាយ​ពណ៌
-GenericName[lt]=Spalvų paletės redaktorius
-GenericName[lv]=Krāsu Paletes Redaktors
-GenericName[mk]=Уредувач на палета
-GenericName[ms]=Editor Palet Warna
-GenericName[mt]=Editur tal-palett ta' kului
-GenericName[nb]=Palett-redigerer
-GenericName[nds]=Klörensett-Editor
-GenericName[ne]=रङदानी सम्पादक
-GenericName[nl]=Kleurenpaletbewerker
-GenericName[nn]=Palettredigering
-GenericName[pa]=ਰੰਗ ਪੱਟੀ ਸੰਪਾਦਕ
-GenericName[pl]=Edytor palety (kolorów)
-GenericName[pt]=Editor de Paletas de Cores
-GenericName[pt_BR]=Editor de Paleta de Cores
-GenericName[ro]=Editor paletă de culori
-GenericName[ru]=Редактор палитры
-GenericName[se]=Ivdnepaleahta doaimmaheaddji
-GenericName[sk]=Editor palety farieb
-GenericName[sl]=Urejevalnik barvne palete
-GenericName[sr]=Уређивач палете боја
-GenericName[sr@Latn]=Uređivač palete boja
-GenericName[sv]=Färgpaletteditor
-GenericName[ta]=வண்ணகளஞ்சியம்
-GenericName[tg]=Муҳаррири палитра
-GenericName[th]=เครื่องมือแก้ไขจานสีของ TDE
-GenericName[tr]=Renk Paleti Düzenleyici
-GenericName[uk]=Редактор палітри кольорів
-GenericName[ven]=Musengulusi wa phalete ya muvhala
-GenericName[wa]=Aspougneu del palete di coleurs
-GenericName[zh_CN]=调色板编辑器
-GenericName[zh_HK]=調色板編輯器
-GenericName[zh_TW]=調色板編輯器
-GenericName[zu]=Umhleli Wombala we Palette
Name=KColorEdit
-Name[af]=K-kleur-redigeer
-Name[ar]=برنامج KColorEdit
-Name[cs]=Editor barev
-Name[cy]=KGolyguLliw
-Name[eo]=Kolorredaktilo
-Name[hi]=के-कलर-एडिट
-Name[hr]=Uređivač boja
-Name[lv]=KKrāsuRedaktors
-Name[ne]=केडीई रङ सम्पादन
-Name[nso]=KPhetoso ya Mmala
-Name[pa]=ਕੇਰੰਗ ਸੰਪਾਦਕ
-Name[pl]=Edytor kolorów
-Name[pt_BR]=KEditor de Cores
-Name[ro]=Editor culori
-Name[sv]=Kcoloredit
-Name[ta]=கேவண்ணம் திருத்தம்
-Name[th]=แก้ไขค่าสี - K
-Name[tr]=K Renk Düzenleyici
-Name[ven]=U sengulusa muvhala ha K
-Name[xh]=Umhleli Wombala ye K
-Name[zh_TW]=KColorEdit 顏色編輯器
-Name[zu]=Umhleli Wombala ka K
X-DCOP-ServiceType=Multi
Categories=Qt;TDE;Graphics;
diff --git a/kdvi/CMakeL10n.txt b/kdvi/CMakeL10n.txt
index ad14af79..7d30e76d 100644
--- a/kdvi/CMakeL10n.txt
+++ b/kdvi/CMakeL10n.txt
@@ -4,3 +4,9 @@ tde_l10n_create_template(
CATALOG "kdvi"
SOURCES "." "tips"
)
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kdvi-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kdvi/CMakeLists.txt b/kdvi/CMakeLists.txt
index 9c1ef8da..006137a2 100644
--- a/kdvi/CMakeLists.txt
+++ b/kdvi/CMakeLists.txt
@@ -28,13 +28,16 @@ link_directories(
#### other data #################################
-install( FILES
- kdvi.desktop
- DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kdvi.desktop
+ PO_DIR kdvi-desktops
+)
-install( FILES
- kdvimultipage.desktop
- DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kdvimultipage.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kdvi-desktops
+)
install( FILES
kdvi.kcfg
diff --git a/kdvi/TeXFont.h b/kdvi/TeXFont.h
index 39fedb76..77923f12 100644
--- a/kdvi/TeXFont.h
+++ b/kdvi/TeXFont.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// TeXFont.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/TeXFontDefinition.h b/kdvi/TeXFontDefinition.h
index a059a405..6c345967 100644
--- a/kdvi/TeXFontDefinition.h
+++ b/kdvi/TeXFontDefinition.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/*
* The layout of a font information block.
* There is one of these for every loaded font or magnification thereof.
diff --git a/kdvi/TeXFont_PFB.h b/kdvi/TeXFont_PFB.h
index ed80d72b..4c3c2a7b 100644
--- a/kdvi/TeXFont_PFB.h
+++ b/kdvi/TeXFont_PFB.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// TeXFont_PFB.cpp
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/TeXFont_PK.h b/kdvi/TeXFont_PK.h
index ab9c6b5c..c85eff47 100644
--- a/kdvi/TeXFont_PK.h
+++ b/kdvi/TeXFont_PK.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
#ifndef _TEXFONT_PK_H
#define _TEXFONT_PK_H
diff --git a/kdvi/TeXFont_TFM.h b/kdvi/TeXFont_TFM.h
index 1d10dc1b..5c86aaf9 100644
--- a/kdvi/TeXFont_TFM.h
+++ b/kdvi/TeXFont_TFM.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// TeXFont_TFM.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/bigEndianByteReader.h b/kdvi/bigEndianByteReader.h
index 269d97d1..8bcc53f2 100644
--- a/kdvi/bigEndianByteReader.h
+++ b/kdvi/bigEndianByteReader.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* This file is part of KDVI (C) 2001 by Stefan Kebekus (kebekus@kde.org)
This library is free software; you can redistribute it and/or
diff --git a/kdvi/dvi.h b/kdvi/dvi.h
index 62178f49..87ac22c1 100644
--- a/kdvi/dvi.h
+++ b/kdvi/dvi.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/*
* Mnemonics for bytes in dvi file.
*/
diff --git a/kdvi/dviFile.h b/kdvi/dviFile.h
index b82d19de..5f6dd671 100644
--- a/kdvi/dviFile.h
+++ b/kdvi/dviFile.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: dviFile
//
diff --git a/kdvi/dviPageCache.h b/kdvi/dviPageCache.h
index 68e41c90..5a070422 100644
--- a/kdvi/dviPageCache.h
+++ b/kdvi/dviPageCache.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/***************************************************************************
* Copyright (C) 2005 by Wilfried Huss *
* Wilfried.Huss@gmx.at *
diff --git a/kdvi/dviRenderer.h b/kdvi/dviRenderer.h
index 6dc76545..75236721 100644
--- a/kdvi/dviRenderer.h
+++ b/kdvi/dviRenderer.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: dviRenderer
//
diff --git a/kdvi/dviWidget.h b/kdvi/dviWidget.h
index 7b2a50aa..1ebe375c 100644
--- a/kdvi/dviWidget.h
+++ b/kdvi/dviWidget.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: DVIWidget
//
diff --git a/kdvi/dvisourcesplitter.h b/kdvi/dvisourcesplitter.h
index 35b84e7a..626911ad 100644
--- a/kdvi/dvisourcesplitter.h
+++ b/kdvi/dvisourcesplitter.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// C++ Interface: dvisourcesplitter
//
diff --git a/kdvi/fontEncoding.h b/kdvi/fontEncoding.h
index 8ce0d18b..ecd73454 100644
--- a/kdvi/fontEncoding.h
+++ b/kdvi/fontEncoding.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// fontEncoding.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/fontEncodingPool.h b/kdvi/fontEncodingPool.h
index 05736137..7ddc8f43 100644
--- a/kdvi/fontEncodingPool.h
+++ b/kdvi/fontEncodingPool.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// fontEncodingPool.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/fontMap.h b/kdvi/fontMap.h
index 4e02f742..8b5c0bc5 100644
--- a/kdvi/fontMap.h
+++ b/kdvi/fontMap.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// fontMap.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/fontpool.h b/kdvi/fontpool.h
index d5575ff9..9c3425c9 100644
--- a/kdvi/fontpool.h
+++ b/kdvi/fontpool.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// fontpool.h
//
// (C) 2001-2004 Stefan Kebekus
diff --git a/kdvi/fontprogress.h b/kdvi/fontprogress.h
index 73b135e4..6090968b 100644
--- a/kdvi/fontprogress.h
+++ b/kdvi/fontprogress.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// fontprogress.h
//
diff --git a/kdvi/glyph.h b/kdvi/glyph.h
index 2265c6df..596adbce 100644
--- a/kdvi/glyph.h
+++ b/kdvi/glyph.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
#ifndef _GLYPH_H
#define _GLYPH_H
diff --git a/kdvi/infodialog.h b/kdvi/infodialog.h
index 36946ded..643911e2 100644
--- a/kdvi/infodialog.h
+++ b/kdvi/infodialog.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// infodialog.h
//
// (C) 2001 Stefan Kebekus
diff --git a/kdvi/kdvi.desktop b/kdvi/kdvi.desktop
index 3eb980c3..111f6a0c 100644
--- a/kdvi/kdvi.desktop
+++ b/kdvi/kdvi.desktop
@@ -1,80 +1,6 @@
[Desktop Entry]
GenericName=DVI Viewer
-GenericName[af]=Dvi Aansig
-GenericName[ar]=عارض ملفات DVI
-GenericName[az]=DVI Nümayişçisi
-GenericName[bg]=Преглед на документи DVI
-GenericName[br]=Gweler DVI
-GenericName[bs]=Preglednik DVI dokumenata
-GenericName[ca]=Visualitzador de DVI
-GenericName[cs]=Prohlížeč DVI souborů
-GenericName[cy]=Gwelydd DVI
-GenericName[da]=DVI-fremviser
-GenericName[de]=DVI-Betrachter
-GenericName[el]=Προβολέας DVI
-GenericName[eo]=DVI-rigardilo
-GenericName[es]=Visor de documentos DVI
-GenericName[et]=DVI failide vaataja
-GenericName[eu]=DVI ikustailea
-GenericName[fa]=مشاهده‌گر DVI
-GenericName[fi]=DVI-näytin
-GenericName[fr]=Afficheur DVI
-GenericName[ga]=Amharcán DVI
-GenericName[gl]=Visor de DVI
-GenericName[he]=מציג DVI
-GenericName[hi]=डीवीआई प्रदर्शक
-GenericName[hr]=Preglednik DVI dokumenata
-GenericName[hu]=DVI-nézegető
-GenericName[id]=Viewer DVI
-GenericName[is]=DVI sjá
-GenericName[it]=Visore DVI
-GenericName[ja]=DVI ビューア
-GenericName[kk]=DVI файлдарын қарау
-GenericName[km]=កម្មវិធី​មើល DVI
-GenericName[ko]=DVI 보기
-GenericName[lt]=DVI Žiūriklis
-GenericName[lv]=DVI Skatītājs
-GenericName[mk]=Прикажувач на DVI
-GenericName[ms]=Pemapar DVI
-GenericName[mt]=Werrej DVI
-GenericName[nb]=DVI-fremviser
-GenericName[nds]=DVI-Kieker
-GenericName[ne]=DVI दर्शक
-GenericName[nl]=DVI-weergaveprogramma
-GenericName[nn]=DVI-lesar
-GenericName[pa]=DVI ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka plików DVI
-GenericName[pt]=Visualizador de DVIs
-GenericName[pt_BR]=Visualizador de DVI
-GenericName[ro]=Vizualizor DVI
-GenericName[ru]=Просмотр файлов DVI
-GenericName[rw]=Ikigaragaza DVI
-GenericName[se]=DVI čájeheaddji
-GenericName[sk]=Prehliadač DVI súborov
-GenericName[sl]=Pregledovalnik datotek DVI
-GenericName[sr]=DVI приказивач
-GenericName[sr@Latn]=DVI prikazivač
-GenericName[sv]=DVI-visare
-GenericName[ta]=DVI காட்சி
-GenericName[tg]=Намоиши файли DVI
-GenericName[th]=ตัวแสดงผล DVI
-GenericName[tr]=DVI Görüntüleyici
-GenericName[uk]=Переглядач DVI
-GenericName[uz]=DVI koʻruvchi
-GenericName[uz@cyrillic]=DVI кўрувчи
-GenericName[ven]=Muvhoni wa DVI
-GenericName[wa]=Håyneu di fitchîs DVI
-GenericName[xh]=Umboniseli we DVI
-GenericName[zh_CN]=DVI 查看器
-GenericName[zh_HK]=DVI 檢視器
-GenericName[zh_TW]=DVI 檢視器
-GenericName[zu]=Umboniseli we DVI
Name=KDVI
-Name[af]=Kdvi
-Name[ar]=برنامج KDVI
-Name[eo]=DVI-rigardilo
-Name[hi]=के-डीवीआई
-Name[zh_TW]=KDVI 檢視器
MimeType=application/x-dvi;application/x-gzdvi;application/x-bz2dvi;
X-TDE-InitialPreference=6
Exec=kdvi %f -caption "%c" %i %m
diff --git a/kdvi/kdvi.h b/kdvi/kdvi.h
index c04fe189..c204b660 100644
--- a/kdvi/kdvi.h
+++ b/kdvi/kdvi.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// kdvi.h
//
// global variables and definitions for kdvi.
diff --git a/kdvi/kdvi_multipage.h b/kdvi/kdvi_multipage.h
index 29adbe26..996c33da 100644
--- a/kdvi/kdvi_multipage.h
+++ b/kdvi/kdvi_multipage.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef KDVIMULTIPAGE_H
#define KDVIMULTIPAGE_H
diff --git a/kdvi/kdvimultipage.desktop b/kdvi/kdvimultipage.desktop
index 9d3f6915..3ffa2cc0 100644
--- a/kdvi/kdvimultipage.desktop
+++ b/kdvi/kdvimultipage.desktop
@@ -2,16 +2,6 @@
Type=Service
Comment=DVI
Name=KDVIMultiPage
-Name[es]=KDVIMultiPágina
-Name[fr]=Multi-page KDVI
-Name[hu]=KDVITöbbOldalas
-Name[nb]=KDVI Flerside
-Name[ne]=केडीभीआई बहुपृष्ठ
-Name[nl]=KDVIMultiPagina
-Name[nn]=KDVI-fleirside
-Name[pt]=KDVIMultiPágina
-Name[ro]=KDVI Pagini Multiple
-Name[sv]=KDVI flera sidor
X-TDE-ServiceTypes=KViewShell/MultiPage
X-TDE-Library=kdvipart
X-TDE-MimeTypes=application/x-dvi
diff --git a/kdvi/kprinterwrapper.h b/kdvi/kprinterwrapper.h
index d7133f03..d276abb4 100644
--- a/kdvi/kprinterwrapper.h
+++ b/kdvi/kprinterwrapper.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// kprinterwrapper.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/optionDialogFontsWidget.h b/kdvi/optionDialogFontsWidget.h
index 975a826e..f2462e8e 100644
--- a/kdvi/optionDialogFontsWidget.h
+++ b/kdvi/optionDialogFontsWidget.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// optionDialogFontsWidget.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/optionDialogSpecialWidget.h b/kdvi/optionDialogSpecialWidget.h
index b7772107..2c90ded3 100644
--- a/kdvi/optionDialogSpecialWidget.h
+++ b/kdvi/optionDialogSpecialWidget.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// optionDialogSpecialWidget.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt
diff --git a/kdvi/performanceMeasurement.h b/kdvi/performanceMeasurement.h
index d7e4c9b4..d9f82e16 100644
--- a/kdvi/performanceMeasurement.h
+++ b/kdvi/performanceMeasurement.h
@@ -1,5 +1,3 @@
-// -*- C++ -*-
-
//#define PERFORMANCE_MEASUREMENT
#ifdef PERFORMANCE_MEASUREMENT
diff --git a/kdvi/prebookmark.h b/kdvi/prebookmark.h
index 412652b9..0b277b3f 100644
--- a/kdvi/prebookmark.h
+++ b/kdvi/prebookmark.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/***************************************************************************
* Copyright (C) 2005 by Stefan Kebekus *
* kebekus@kde.org *
diff --git a/kdvi/psgs.h b/kdvi/psgs.h
index 74dc1015..8e5e6ed5 100644
--- a/kdvi/psgs.h
+++ b/kdvi/psgs.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// ghostscript_interface
//
diff --git a/kdvi/renderedDviPagePixmap.h b/kdvi/renderedDviPagePixmap.h
index 9f020057..166a11e9 100644
--- a/kdvi/renderedDviPagePixmap.h
+++ b/kdvi/renderedDviPagePixmap.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/***************************************************************************
* Copyright (C) 2005 by Wilfried Huss *
* Wilfried.Huss@gmx.at *
diff --git a/kdvi/xdvi.h b/kdvi/xdvi.h
index 0770cd8b..d3602164 100644
--- a/kdvi/xdvi.h
+++ b/kdvi/xdvi.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef _xdvi_h
#define _xdvi_h
diff --git a/kfax/CMakeL10n.txt b/kfax/CMakeL10n.txt
index 13088803..6a956427 100644
--- a/kfax/CMakeL10n.txt
+++ b/kfax/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kfax" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kfax.desktop/"
+ SOURCES kfax.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kfax/CMakeLists.txt b/kfax/CMakeLists.txt
index 0ace8632..ac20f8d3 100644
--- a/kfax/CMakeLists.txt
+++ b/kfax/CMakeLists.txt
@@ -23,7 +23,7 @@ link_directories(
#### other data #################################
-install( FILES kfax.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( kfax.desktop )
install( FILES kfax.tif kfaxlogo.xpm DESTINATION ${DATA_INSTALL_DIR}/kfax/pics )
install( FILES kfaxui.rc DESTINATION ${DATA_INSTALL_DIR}/kfax )
diff --git a/kfax/kfax.desktop b/kfax/kfax.desktop
index 9d6c674a..71e7b1c2 100644
--- a/kfax/kfax.desktop
+++ b/kfax/kfax.desktop
@@ -1,81 +1,7 @@
[Desktop Entry]
MimeType=image/fax-g3;image/tiff;
GenericName=Fax Viewer
-GenericName[af]=Faks Aansig
-GenericName[ar]=عارض الفاكس
-GenericName[bg]=Преглед на факсове
-GenericName[br]=Gweler faks
-GenericName[bs]=Preglednik faxova
-GenericName[ca]=Visualitzador de fax
-GenericName[cs]=Prohlížeč faxů
-GenericName[cy]=Gwelydd Ffacs
-GenericName[da]=Fax-fremviser
-GenericName[de]=Faxbetrachter
-GenericName[el]=Προβολέας φαξ
-GenericName[eo]=Faksrigardilo
-GenericName[es]=Visor de faxes
-GenericName[et]=Fakside vaataja
-GenericName[eu]=Fax ikustailua
-GenericName[fa]=مشاهده‌گر دورنگار
-GenericName[fi]=Faksinäytin
-GenericName[fr]=Afficheur de fax
-GenericName[gl]=Visor de fax
-GenericName[he]=מציג פקסים
-GenericName[hi]=फ़ैक्स प्रदर्शक
-GenericName[hr]=Preglednik faksova
-GenericName[hu]=Faxnézegető
-GenericName[is]=Fax sjá
-GenericName[it]=Visore di fax
-GenericName[ja]=ファクスビューア
-GenericName[kk]=Факсты қарау
-GenericName[km]=កម្មវិធី​មើល​ទូរសារ
-GenericName[lt]=Faksų žiūriklis
-GenericName[lv]=Faksu Skatītājs
-GenericName[ms]=Pemapar Faks
-GenericName[nb]=Faksfremviser
-GenericName[nds]=Faxkieker
-GenericName[ne]=फ्याक्स द्रष्टा
-GenericName[nl]=Faxweergaveprogramma
-GenericName[nn]=Faksvisar
-GenericName[pa]=ਫੈਕਸ ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka faksów
-GenericName[pt]=Visualizador de Faxes
-GenericName[pt_BR]=Visualizador de Faxes
-GenericName[ro]=Vizualizor FAX
-GenericName[ru]=Просмотр факсов
-GenericName[se]=Fáksačájeheaddji
-GenericName[sk]=Prehliadač faxov
-GenericName[sl]=Pregledovalnik faksov
-GenericName[sr]=Приказивач факсова
-GenericName[sr@Latn]=Prikazivač faksova
-GenericName[sv]=Faxvisare
-GenericName[ta]=ஃபாக்ஸ் காட்சி
-GenericName[tg]=Хондани факс
-GenericName[th]=เครื่องมือแสดงโทรสารของ TDE
-GenericName[tr]=Faks Görüntüleyici
-GenericName[uk]=Переглядач факсів
-GenericName[uz]=Faks koʻruvchi
-GenericName[uz@cyrillic]=Факс кўрувчи
-GenericName[ven]=Muvhoni wa Fekisi
-GenericName[wa]=Håyneu di facs
-GenericName[xh]=Umboniseli Wefax
-GenericName[zh_CN]=传真查看器
-GenericName[zh_HK]=傳真檢視器
-GenericName[zh_TW]=傳真檢視器
-GenericName[zu]=Umbonisi wefax
Name=KFax
-Name[af]=K-faks
-Name[ar]=برنامج KFax
-Name[cy]=KFfacs
-Name[eo]=Faksrigardilo
-Name[hi]=के-फ़ैक्स
-Name[lv]=KFakss
-Name[ne]=केडीई फ्याक्स
-Name[sv]=Kfax
-Name[ta]=கேஃபாக்ஸ்
-Name[ven]=Fekisi ya K
-Name[wa]=KFacs
-Name[zh_TW]=KFax 傳真檢視器
Exec=kfax %f -caption "%c" %i %m
Icon=kfax
Path=
diff --git a/kfaxview/CMakeL10n.txt b/kfaxview/CMakeL10n.txt
index 82cdf01f..727ad8e2 100644
--- a/kfaxview/CMakeL10n.txt
+++ b/kfaxview/CMakeL10n.txt
@@ -6,3 +6,9 @@ tde_l10n_create_template(
)
tde_l10n_auto_add_subdirectories( )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kfaxview-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kfaxview/CMakeLists.txt b/kfaxview/CMakeLists.txt
index dcb8b751..a50133bb 100644
--- a/kfaxview/CMakeLists.txt
+++ b/kfaxview/CMakeLists.txt
@@ -30,9 +30,19 @@ link_directories(
#### other data #################################
tde_install_icons( kfaxview )
-install( FILES kfaxview.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE kfaxview.desktop
+ PO_DIR kfaxview-desktops
+)
+
install( FILES ${CMAKE_SOURCE_DIR}/kviewshell/kviewshell.rc DESTINATION ${DATA_INSTALL_DIR}/kfaxview/kviewshell.rc )
-install( FILES kfaxmultipage.desktop kfaxmultipage_tiff.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE kfaxmultipage.desktop kfaxmultipage_tiff.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kfaxview-desktops
+)
#### kfaxviewpart (module) ######################
diff --git a/kfaxview/kfaxmultipage.desktop b/kfaxview/kfaxmultipage.desktop
index dcbad7b5..3c60f0d5 100644
--- a/kfaxview/kfaxmultipage.desktop
+++ b/kfaxview/kfaxmultipage.desktop
@@ -1,59 +1,8 @@
[Desktop Entry]
Name=kfaxview
-Name[hu]=KFaxView
-Name[ja]=KfaxView
-Name[nb]=Kfaxview
-Name[ne]=केडीई फ्याक्स दृश्य
-Name[ro]=KFaxiView
-Name[sv]=Kfaxview
-Name[zh_CN]=KFaxView
Icon=kfaxview
Type=Service
Comment=KViewShell plugin for fax files
-Comment[bg]=Приставка за факс файлове
-Comment[br]=Lugent KViewShell evit ar restroù faks
-Comment[bs]=KViewShell dodatak za fax datoteke
-Comment[ca]=Connector pel KViewShell per a fitxers de fax
-Comment[cs]=KViewShell modul pro faxové soubory
-Comment[da]=Kviewshell-plugin for telefaxfiler
-Comment[de]=Ein Modul für KViewShell zum Betrachten von Faxdateien
-Comment[el]=Πρόσθετο του KViewShell για αρχεία φαξ
-Comment[eo]=KViewShell-kromaĵo for faksdosieroj
-Comment[es]=Extensión KViewShell para archivos de fax
-Comment[et]=KView faksifailide plugin
-Comment[eu]=Fax fitxategientzatko KViewShell-en plugina
-Comment[fa]=وصلۀ KViewShell برای پرونده‌های دورنگار
-Comment[fi]=KViewShell sovelma faksitiedostoille
-Comment[fr]=Module KViewShell pour les fichiers de fax
-Comment[gl]=Extensión de KViewShell para ficheiros de fax
-Comment[hu]=KViewShell-modul faxfájlokhoz
-Comment[is]=KViewShell íforrit fyrir faxskrár
-Comment[it]=Plugin KViewShell per file di fax
-Comment[ja]=ファクスファイル用の KViewShell プラグイン
-Comment[kk]=Факс файлдарын қарау плагин модулі
-Comment[km]=កម្មវិធី​ជំនួយ KViewShell សម្រាប់​ឯកសារ​ទូរសារ
-Comment[lt]=KViewShell priedas fakso byloms
-Comment[ms]=Plugin KViewShell untuk fail faks
-Comment[nb]=KViewShell programtillegg for faksfiler
-Comment[nds]="KViewShell"-Moduul för Faxdateien
-Comment[ne]=फ्याक्स फाइलका लागि केडीई दृश्य शेल प्लगइन
-Comment[nl]=KViewShell-plugin voor faxbestanden
-Comment[nn]=KViewShell-programtillegg for faksfiler
-Comment[pl]=Wtyczka KViewShell do plików faksów
-Comment[pt]='Plugin' do KViewShell para ficheiros de Fax
-Comment[pt_BR]=Plugin KViewShell para arquivos de fax
-Comment[ru]=Компонент просмотра факсов
-Comment[sk]=KViewShell modul pre faxové súbory
-Comment[sl]=Vstavek za KViewShell za fakse
-Comment[sr]=KViewShell-ов прикључак за факс фајлове
-Comment[sr@Latn]=KViewShell-ov priključak za faks fajlove
-Comment[sv]=Kviewshell-insticksprogram för telefaxfiler
-Comment[th]=ปลั๊กอินสำหรับแสดงแฟ้มโทรสารของ KViewShell
-Comment[tr]=Faks dosyaları için KViewShell eklentisi
-Comment[uk]=Втулок перегляду файлів факсів для KViewShell
-Comment[zh_CN]=传真文件的 KViewShell 插件
-Comment[zh_HK]=傳真檔的 KViewShell 插件
-Comment[zh_TW]=KViewShell 傳真檔外掛程式
X-TDE-ServiceTypes=KViewShell/MultiPage
X-TDE-MimeTypes=image/fax-g3
X-TDE-Library=kfaxviewpart
diff --git a/kfaxview/kfaxmultipage_tiff.desktop b/kfaxview/kfaxmultipage_tiff.desktop
index 467380a5..4621f61f 100644
--- a/kfaxview/kfaxmultipage_tiff.desktop
+++ b/kfaxview/kfaxmultipage_tiff.desktop
@@ -1,56 +1,8 @@
[Desktop Entry]
Name=kfaxview_tiff
-Name[da]=Kfaxview TIFF
-Name[ne]=केडीई फ्याक्स दृश्य टिफ
-Name[sv]=Kfaxview TIFF
-Name[zh_CN]=KFaxView_tiff
Icon=kfaxview
Type=Service
Comment=KViewShell plugin for fax files
-Comment[bg]=Приставка за факс файлове
-Comment[br]=Lugent KViewShell evit ar restroù faks
-Comment[bs]=KViewShell dodatak za fax datoteke
-Comment[ca]=Connector pel KViewShell per a fitxers de fax
-Comment[cs]=KViewShell modul pro faxové soubory
-Comment[da]=Kviewshell-plugin for telefaxfiler
-Comment[de]=Ein Modul für KViewShell zum Betrachten von Faxdateien
-Comment[el]=Πρόσθετο του KViewShell για αρχεία φαξ
-Comment[eo]=KViewShell-kromaĵo for faksdosieroj
-Comment[es]=Extensión KViewShell para archivos de fax
-Comment[et]=KView faksifailide plugin
-Comment[eu]=Fax fitxategientzatko KViewShell-en plugina
-Comment[fa]=وصلۀ KViewShell برای پرونده‌های دورنگار
-Comment[fi]=KViewShell sovelma faksitiedostoille
-Comment[fr]=Module KViewShell pour les fichiers de fax
-Comment[gl]=Extensión de KViewShell para ficheiros de fax
-Comment[hu]=KViewShell-modul faxfájlokhoz
-Comment[is]=KViewShell íforrit fyrir faxskrár
-Comment[it]=Plugin KViewShell per file di fax
-Comment[ja]=ファクスファイル用の KViewShell プラグイン
-Comment[kk]=Факс файлдарын қарау плагин модулі
-Comment[km]=កម្មវិធី​ជំនួយ KViewShell សម្រាប់​ឯកសារ​ទូរសារ
-Comment[lt]=KViewShell priedas fakso byloms
-Comment[ms]=Plugin KViewShell untuk fail faks
-Comment[nb]=KViewShell programtillegg for faksfiler
-Comment[nds]="KViewShell"-Moduul för Faxdateien
-Comment[ne]=फ्याक्स फाइलका लागि केडीई दृश्य शेल प्लगइन
-Comment[nl]=KViewShell-plugin voor faxbestanden
-Comment[nn]=KViewShell-programtillegg for faksfiler
-Comment[pl]=Wtyczka KViewShell do plików faksów
-Comment[pt]='Plugin' do KViewShell para ficheiros de Fax
-Comment[pt_BR]=Plugin KViewShell para arquivos de fax
-Comment[ru]=Компонент просмотра факсов
-Comment[sk]=KViewShell modul pre faxové súbory
-Comment[sl]=Vstavek za KViewShell za fakse
-Comment[sr]=KViewShell-ов прикључак за факс фајлове
-Comment[sr@Latn]=KViewShell-ov priključak za faks fajlove
-Comment[sv]=Kviewshell-insticksprogram för telefaxfiler
-Comment[th]=ปลั๊กอินสำหรับแสดงแฟ้มโทรสารของ KViewShell
-Comment[tr]=Faks dosyaları için KViewShell eklentisi
-Comment[uk]=Втулок перегляду файлів факсів для KViewShell
-Comment[zh_CN]=传真文件的 KViewShell 插件
-Comment[zh_HK]=傳真檔的 KViewShell 插件
-Comment[zh_TW]=KViewShell 傳真檔外掛程式
X-TDE-ServiceTypes=KViewShell/MultiPage
X-TDE-MimeTypes=image/tiff
X-TDE-Library=kfaxviewpart
diff --git a/kfaxview/kfaxview.desktop b/kfaxview/kfaxview.desktop
index 380e5021..80843a3b 100644
--- a/kfaxview/kfaxview.desktop
+++ b/kfaxview/kfaxview.desktop
@@ -1,72 +1,6 @@
[Desktop Entry]
GenericName=Fax Viewer
-GenericName[af]=Faks Aansig
-GenericName[ar]=عارض الفاكس
-GenericName[bg]=Преглед на факсове
-GenericName[br]=Gweler faks
-GenericName[bs]=Preglednik faxova
-GenericName[ca]=Visualitzador de fax
-GenericName[cs]=Prohlížeč faxů
-GenericName[cy]=Gwelydd Ffacs
-GenericName[da]=Fax-fremviser
-GenericName[de]=Faxbetrachter
-GenericName[el]=Προβολέας φαξ
-GenericName[eo]=Faksrigardilo
-GenericName[es]=Visor de faxes
-GenericName[et]=Fakside vaataja
-GenericName[eu]=Fax ikustailua
-GenericName[fa]=مشاهده‌گر دورنگار
-GenericName[fi]=Faksinäytin
-GenericName[fr]=Afficheur de fax
-GenericName[gl]=Visor de fax
-GenericName[he]=מציג פקסים
-GenericName[hi]=फ़ैक्स प्रदर्शक
-GenericName[hr]=Preglednik faksova
-GenericName[hu]=Faxnézegető
-GenericName[is]=Fax sjá
-GenericName[it]=Visore di fax
-GenericName[ja]=ファクスビューア
-GenericName[kk]=Факсты қарау
-GenericName[km]=កម្មវិធី​មើល​ទូរសារ
-GenericName[lt]=Faksų žiūriklis
-GenericName[lv]=Faksu Skatītājs
-GenericName[ms]=Pemapar Faks
-GenericName[nb]=Faksfremviser
-GenericName[nds]=Faxkieker
-GenericName[ne]=फ्याक्स द्रष्टा
-GenericName[nl]=Faxweergaveprogramma
-GenericName[nn]=Faksvisar
-GenericName[pa]=ਫੈਕਸ ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka faksów
-GenericName[pt]=Visualizador de Faxes
-GenericName[pt_BR]=Visualizador de Faxes
-GenericName[ro]=Vizualizor FAX
-GenericName[ru]=Просмотр факсов
-GenericName[se]=Fáksačájeheaddji
-GenericName[sk]=Prehliadač faxov
-GenericName[sl]=Pregledovalnik faksov
-GenericName[sr]=Приказивач факсова
-GenericName[sr@Latn]=Prikazivač faksova
-GenericName[sv]=Faxvisare
-GenericName[ta]=ஃபாக்ஸ் காட்சி
-GenericName[tg]=Хондани факс
-GenericName[th]=เครื่องมือแสดงโทรสารของ TDE
-GenericName[tr]=Faks Görüntüleyici
-GenericName[uk]=Переглядач факсів
-GenericName[uz]=Faks koʻruvchi
-GenericName[uz@cyrillic]=Факс кўрувчи
-GenericName[ven]=Muvhoni wa Fekisi
-GenericName[wa]=Håyneu di facs
-GenericName[xh]=Umboniseli Wefax
-GenericName[zh_CN]=传真查看器
-GenericName[zh_HK]=傳真檢視器
-GenericName[zh_TW]=傳真檢視器
-GenericName[zu]=Umbonisi wefax
Name=KFaxView
-Name[nb]=Kfaxview
-Name[ne]=केडीई फ्याक्स दृश्य
-Name[sv]=Kfaxview
-Name[zh_TW]=KFaxView 傳真檢視
MimeType=image/fax-g3;
X-TDE-InitialPreference=6
Exec=kfaxview %f
diff --git a/kfaxview/libkfaximage/faxinit.cpp b/kfaxview/libkfaximage/faxinit.cpp
index aa6166aa..fa4517d2 100644
--- a/kfaxview/libkfaximage/faxinit.cpp
+++ b/kfaxview/libkfaximage/faxinit.cpp
@@ -319,11 +319,11 @@ FillTable(struct tabent *T, int Size, const struct proto *P, int State)
void
fax_init_tables(void)
{
- static bool already_initialized = 0;
+ static bool already_initialized = false;
if (already_initialized)
return;
- ++already_initialized;
+ already_initialized = true;
FillTable(MainTable, 7, Pass, S_Pass);
FillTable(MainTable, 7, Horiz, S_Horiz);
diff --git a/kgamma/kcmkgamma/CMakeL10n.txt b/kgamma/kcmkgamma/CMakeL10n.txt
index 66bef6bc..4707ef82 100644
--- a/kgamma/kcmkgamma/CMakeL10n.txt
+++ b/kgamma/kcmkgamma/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kgamma" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kgamma.desktop/"
+ SOURCES kgamma.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kgamma/kcmkgamma/CMakeLists.txt b/kgamma/kcmkgamma/CMakeLists.txt
index ade17bf5..9d09b857 100644
--- a/kgamma/kcmkgamma/CMakeLists.txt
+++ b/kgamma/kcmkgamma/CMakeLists.txt
@@ -25,7 +25,10 @@ link_directories(
#### other data #################################
-install( FILES kgamma.desktop DESTINATION ${APPS_INSTALL_DIR}/.hidden )
+tde_create_translated_desktop(
+ SOURCE kgamma.desktop
+ DESTINATION ${APPS_INSTALL_DIR}/.hidden
+)
#### kcmkgamma (module) #########################
diff --git a/kgamma/kcmkgamma/kgamma.desktop b/kgamma/kcmkgamma/kgamma.desktop
index b0ccdb12..8be6ae5d 100644
--- a/kgamma/kcmkgamma/kgamma.desktop
+++ b/kgamma/kcmkgamma/kgamma.desktop
@@ -11,119 +11,7 @@ X-TDE-ModuleType=Library
X-TDE-Test-Module=true
Name=Gamma
-Name[ar]=غاما
-Name[az]=Qamma
-Name[bg]=Гама
-Name[cs]=Gama
-Name[cy]=Gama
-Name[el]=Γάμμα
-Name[eo]=Gamo
-Name[fa]=گاما
-Name[ga]=Gáma
-Name[gl]=Gama
-Name[he]=גאמה
-Name[hr]=Gama
-Name[hu]=Gamma-korrekció
-Name[is]=Litatíðni (gamma)
-Name[kk]=Гамма
-Name[km]=ហ្គាម៉ា
-Name[ne]=गामा
-Name[pa]=ਗ਼ਾਮਾ
-Name[pt]=Gama
-Name[ru]=Гамма
-Name[sl]=Gama
-Name[sr]=Гама
-Name[sr@Latn]=Gama
-Name[ta]=காமா
-Name[tg]=Гамма
-Name[th]=แกมมา
-Name[uk]=Гама
-Name[uz@cyrillic]=Гамма
-Name[wa]=Gama
-Name[xh]=Unobumba wesithathu konoobumba besiGrike
-Name[zh_HK]=伽馬(Gamma)
Comment=A monitor calibration tool
-Comment[ar]=أداة مراقبة وتعيير
-Comment[bg]=Калибриране на монитора
-Comment[bs]=Alat za kalibraciju monitora
-Comment[ca]=Una eina de calibració del monitor
-Comment[cs]=Nástroj pro kalibraci monitoru
-Comment[cy]=Erfyn graddnodi dangosydd
-Comment[da]=Et skærmkalibreringsværktøj
-Comment[de]=Ein Kalibrierungswerkzeug für Monitore
-Comment[el]=Ένα εργαλείο ρύθμισης της οθόνης
-Comment[eo]=Ekrankalibrilo
-Comment[es]=Una herramienta de calibración del monitor
-Comment[et]=Monitori kalibreerija
-Comment[eu]=Monitoreak kalibratzeko tresna
-Comment[fa]=ابزار درجه‌بندی نمایشگر
-Comment[fi]=Näytön asetustyökalu
-Comment[fr]=Outil de calibrage de moniteur
-Comment[gl]=Unha utilidade para calibrar o monitor
-Comment[hi]=मॉनीटर केलिब्रेशन औज़ार
-Comment[hu]=Monitorbeállító program
-Comment[is]=Tól til að stilla skjáinn
-Comment[it]=Calibrazione del monitor
-Comment[ja]=モニタ測定ツール
-Comment[kk]=Мониторды калибрлеу құралы
-Comment[km]=ឧបករណ៍​ក្រិត​របស់​ម៉ូនីទ័រ
-Comment[lt]=Monitoriaus kalibravimo įrankis
-Comment[ms]=Alat tentukur monitor
-Comment[nb]=Et verktøy for å kalibrere skjermen
-Comment[nds]=En Afstimmwarktüüch för Monitoren
-Comment[ne]=मोनिटर क्यालिब्रेसन उपकरण
-Comment[nl]=Gereedschap om de kleurweergave goed in te stellen
-Comment[nn]=Eit verktøy for å kalibrera skjermen
-Comment[pl]=Narzędzie do kalibracji monitora
-Comment[pt]=Ferramenta de calibração do monitor
-Comment[pt_BR]=Uma ferramenta de calibragem de monitor
-Comment[ro]=Un utilitar de calibrat monitorul
-Comment[ru]=Утилита для калибровки монитора
-Comment[sk]=Kalibračný nástroj pre monitor
-Comment[sl]=Kalibracijsko orodje za monitorje
-Comment[sr]=Алат за калибрацију монитора
-Comment[sr@Latn]=Alat za kalibraciju monitora
-Comment[sv]=Kalibreringsverktyg för skärmen
-Comment[ta]=திரை நிலைக்கருவி
-Comment[tg]=Утилита барои калибратсия кардани монитор
-Comment[th]=เครื่องมือปรับความเที่ยงตรงของจอภาพ
-Comment[tr]=Monitör kalibrasyon aracı
-Comment[uk]=Засіб для калібрування монітора
-Comment[zh_CN]=监视器校准工具
-Comment[zh_HK]=顯示器調校工具
-Comment[zh_TW]=監視器校準工具
Keywords=KGamma; kgamma; Gamma; gamma;
-Keywords[bg]=калибриране; гама; яркост; цвят; монитор; екран; KGamma; kgamma; Gamma; gamma;
-Keywords[cs]=KGamma; kgamma; gama;
-Keywords[de]=KGamma;kgamma;Gamma;gamma;
-Keywords[el]=KGamma; kgamma; Γάμμα; γάμμα;
-Keywords[ga]=KGamma; kgamma; Gamma; gamma; Gáma;
-Keywords[gl]=KGamma; kgamma; Gamma; gamma; gama;
-Keywords[he]=KGamma; kgamma; Gamma; gamma; גאמה;
-Keywords[hi]=के-गामा;केगामा;गामा;गामा;
-Keywords[hu]=KGamma;kgamma;gamma;gamma-korrekció;
-Keywords[it]=KGamma;gamma;
-Keywords[ja]=KGamma; kgamma; ガンマ; Gamma; gamma;
-Keywords[km]=KGamma; kgamma;ហ្គ៉ាម៉ា;
-Keywords[lt]=KGamma; kgamma; Gamma; gamma; gama;
-Keywords[nds]=KGamma;kgamma;Gamma;gamma;
-Keywords[ne]=के गामा; के गामा; गामा; गामा;
-Keywords[nl]=KGamma;kgamma;Gamma;gamma;kleurweergave;
-Keywords[nn]=KGamma;gamma;
-Keywords[pl]=KGamma; kgamma; Gamma; gamma; jasność;ciemność;rozjaśnienie;
-Keywords[pt]=kgamma; gama;
-Keywords[pt_BR]=KGama; kgama; Gama; gama;
-Keywords[ro]=KGamma;kgamma;gama;gamma;
-Keywords[ru]=KGamma;kgamma;Gamma;gamma;гамма;монитор;
-Keywords[sk]=KGamma; kgamma; gamma;
-Keywords[sl]=KGamma;kgamma;Gama;gama;
-Keywords[sr]=KGamma; kgamma; Gamma; gamma; гама;
-Keywords[sr@Latn]=KGamma; kgamma; Gamma; gamma; gama;
-Keywords[ta]=கேகாமா; கேகாமா; காமா; காமா;
-Keywords[tg]=KGamma;kgamma;Gamma;gamma;гамма;монитор;
-Keywords[uk]=KGamma; kgamma; Gamma; gamma; гама; яскравість;
-Keywords[uz@cyrillic]=KGamma; kgamma; Гамма; гамма;
-Keywords[wa]=KGamma; kgamma; Gama; gama;
-Keywords[zh_CN]=KGamma; kgamma; Gamma; gamma;伽玛;
diff --git a/kghostview/CMakeL10n.txt b/kghostview/CMakeL10n.txt
index decf8918..0624536e 100644
--- a/kghostview/CMakeL10n.txt
+++ b/kghostview/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kghostview" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kghostview-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kghostview/CMakeLists.txt b/kghostview/CMakeLists.txt
index 316f387e..11e30d20 100644
--- a/kghostview/CMakeLists.txt
+++ b/kghostview/CMakeLists.txt
@@ -28,8 +28,18 @@ link_directories(
#### other data #################################
tde_install_icons( kghostview )
-install( FILES kghostview.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
-install( FILES kghostview_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE kghostview.desktop
+ PO_DIR kghostview-desktops
+)
+
+tde_create_translated_desktop(
+ SOURCE kghostview_part.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kghostview-desktops
+)
+
install( FILES kgv_part.rc kghostviewui.rc DESTINATION ${DATA_INSTALL_DIR}/kghostview )
install( FILES kghostview.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES kghostview.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
diff --git a/kghostview/dscparse/dscparse.cpp b/kghostview/dscparse/dscparse.cpp
index 7b85395f..ba473cc8 100644
--- a/kghostview/dscparse/dscparse.cpp
+++ b/kghostview/dscparse/dscparse.cpp
@@ -3427,6 +3427,3 @@ dsc_error(CDSC *dsc, unsigned int explanation,
/* treat DSC as being correct */
return CDSC_RESPONSE_CANCEL;
}
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/dscparse/dscparse.h b/kghostview/dscparse/dscparse.h
index a82a3218..d290c0d4 100644
--- a/kghostview/dscparse/dscparse.h
+++ b/kghostview/dscparse/dscparse.h
@@ -469,5 +469,3 @@ int dsc_set_page_bbox(P6(CDSC *dsc, unsigned int page_number,
int llx, int lly, int urx, int ury));
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/dscparse/dscparse_adapter.cpp b/kghostview/dscparse/dscparse_adapter.cpp
index 17ae0231..5aae47b8 100644
--- a/kghostview/dscparse/dscparse_adapter.cpp
+++ b/kghostview/dscparse/dscparse_adapter.cpp
@@ -282,20 +282,20 @@ const CDSCMEDIA* KDSC::page_media() const
return _cdsc->page_media;
}
-auto_ptr<KDSCBBOX> KDSC::bbox() const
+unique_ptr<KDSCBBOX> KDSC::bbox() const
{
- if( _cdsc->bbox == 0 )
- return auto_ptr<KDSCBBOX>( 0 );
+ if( _cdsc->bbox == nullptr )
+ return unique_ptr<KDSCBBOX>( nullptr );
else
- return auto_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->bbox ) );
+ return unique_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->bbox ) );
}
-auto_ptr<KDSCBBOX> KDSC::page_bbox() const
+unique_ptr<KDSCBBOX> KDSC::page_bbox() const
{
- if( _cdsc->page_bbox == 0 )
- return auto_ptr<KDSCBBOX>( 0 );
+ if( _cdsc->page_bbox == nullptr )
+ return unique_ptr<KDSCBBOX>( nullptr );
else
- return auto_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->page_bbox ) );
+ return unique_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->page_bbox ) );
}
TQString KDSC::dsc_title() const
@@ -416,5 +416,3 @@ bool KDSCScanHandlerByLine::scanData( char* buf, unsigned int count )
else
return true;
}
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/dscparse/dscparse_adapter.h b/kghostview/dscparse/dscparse_adapter.h
index c5c1cbf9..77855972 100644
--- a/kghostview/dscparse/dscparse_adapter.h
+++ b/kghostview/dscparse/dscparse_adapter.h
@@ -28,51 +28,6 @@
#include "dscparse.h"
-#if defined(__GNUC__)
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)
-/*
- * We add a quick 'n' dirty inline implementation of auto_ptr for older
- * releases of GCC, which don't include an auto_ptr implementation in
- * <memory>.
- */
-
-template <class T> class auto_ptr {
-private:
- T* _ptr;
-
-public:
- typedef T element_type;
- explicit auto_ptr(T* p = 0) : _ptr(p) {}
- auto_ptr(auto_ptr& a) : _ptr(a.release()) {}
- template <class T1> auto_ptr(auto_ptr<T1>& a) : _ptr(a.release()) {}
- auto_ptr& operator=(auto_ptr& a) {
- if (&a != this) {
- delete _ptr;
- _ptr = a.release();
- }
- return *this;
- }
- template <class T1>
- auto_ptr& operator=(auto_ptr<T1>& a) {
- if (a.get() != this->get()) {
- delete _ptr;
- _ptr = a.release();
- }
- return *this;
- }
- ~auto_ptr() { delete _ptr; }
-
- T& operator*() const { return *_ptr; }
- T* operator->() const { return _ptr; }
- T* get() const { return _ptr; }
- T* release() { T* tmp = _ptr; _ptr = 0; return tmp; }
- void reset(T* p = 0) { delete _ptr; _ptr = p; }
-};
-
-#endif
-#endif
-
-
class KDSCBBOX
{
public:
@@ -304,13 +259,8 @@ public:
CDSCMEDIA** media() const;
const CDSCMEDIA* page_media() const;
-#if defined(__GNUC__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93))
- auto_ptr<KDSCBBOX> bbox() const;
- auto_ptr<KDSCBBOX> page_bbox() const;
-#else
- std::auto_ptr<KDSCBBOX> bbox() const;
- std::auto_ptr<KDSCBBOX> page_bbox() const;
-#endif
+ std::unique_ptr<KDSCBBOX> bbox() const;
+ std::unique_ptr<KDSCBBOX> page_bbox() const;
// CDSCDOSEPS *doseps;
@@ -382,5 +332,3 @@ protected:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/infodialog.cpp b/kghostview/infodialog.cpp
index e4a76006..7b4a9e92 100644
--- a/kghostview/infodialog.cpp
+++ b/kghostview/infodialog.cpp
@@ -127,5 +127,3 @@ void InfoDialog::setup( const TQString &fileName, const TQString &documentTitle,
}
#include "infodialog.moc"
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/infodialog.h b/kghostview/infodialog.h
index d02860f0..65d973f3 100644
--- a/kghostview/infodialog.h
+++ b/kghostview/infodialog.h
@@ -41,5 +41,3 @@ class InfoDialog : public KDialogBase
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kdscerrordialog.cpp b/kghostview/kdscerrordialog.cpp
index 350acb4d..32219bc9 100644
--- a/kghostview/kdscerrordialog.cpp
+++ b/kghostview/kdscerrordialog.cpp
@@ -166,5 +166,3 @@ void KDSCErrorDialog::slotIgnoreAll()
_response = IgnoreAll;
accept();
}
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kdscerrordialog.h b/kghostview/kdscerrordialog.h
index 32acf864..97d311e5 100644
--- a/kghostview/kdscerrordialog.h
+++ b/kghostview/kdscerrordialog.h
@@ -70,6 +70,3 @@ private:
};
#endif
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kghostview.desktop b/kghostview/kghostview.desktop
index 6fbd167e..c9d2ef90 100644
--- a/kghostview/kghostview.desktop
+++ b/kghostview/kghostview.desktop
@@ -1,87 +1,12 @@
[Desktop Entry]
Name=KGhostView
-Name[af]=Kghostview
-Name[ar]=برنامج KGhostView
-Name[eo]=Postskriptrigardilo
-Name[hi]=के-घोस्ट-व्यू
-Name[hu]=KGhostview
-Name[ne]=केडीई घोस्ट दृश्य
-Name[sv]=Kghostview
-Name[ta]=கேமற்றொரு காட்சி
-Name[tr]=GhostView
-Name[ven]=Mbonalelo ya tshipuku tsha K
-Name[xh]=Imboniselo yeKGhost
+GenericName=PS/PDF Viewer
MimeType=application/pdf;application/postscript;image/x-eps;application/x-gzpostscript;application/illustrator;
X-TDE-InitialPreference=6
Exec=kghostview %u -caption "%c" %i %m
Icon=kghostview
Type=Application
X-DocPath=kghostview/index.html
-GenericName=PS/PDF Viewer
-GenericName[af]=Ps/Pdf Aansig
-GenericName[ar]=عارض PS/PDF
-GenericName[bg]=Преглед на документи PS/PDF
-GenericName[br]=Gweler PS/PDF
-GenericName[bs]=Preglednik PS/PDF dokumenata
-GenericName[ca]=Visualitzador de PS/PDF
-GenericName[cs]=Prohlížeč PS/PDF souborů
-GenericName[cy]=Gwelydd PS/PDF
-GenericName[da]=PS/PDF-fremviser
-GenericName[de]=PS/PDF-Betrachter
-GenericName[el]=Προβολέας PS/PDF
-GenericName[eo]=PS/PDF-rigardilo
-GenericName[es]=Visor de documentos PS/PDF
-GenericName[et]=PS/PDF-failide näitaja
-GenericName[eu]=PS/PDF ikustailua
-GenericName[fa]=مشاهده‌گر PS/PDF
-GenericName[fi]=PS/PDF-näytin
-GenericName[fr]=Afficheur PostScript et PDF
-GenericName[ga]=Amharcán PS/PDF
-GenericName[gl]=Visor PS/PDF
-GenericName[he]=מציג PS/PDF
-GenericName[hi]=PS/PDF प्रदर्शक
-GenericName[hr]=Preglednik PS/PDF dokumenata
-GenericName[hu]=PS/PDF-megjelenítő
-GenericName[is]=PS/PDF sjá
-GenericName[it]=Visore PS/PDF
-GenericName[ja]=PS/PDF ビューア
-GenericName[kk]=PS/PDF файлдарын қарау
-GenericName[km]=កម្មវិធី​មើល PS/PDF
-GenericName[lt]=PS/PDF žiūriklis
-GenericName[lv]=PS/PDF Skatītājs
-GenericName[ms]=Pemapar PS/PDF
-GenericName[nb]=PS-/PDF-fremviser
-GenericName[nds]=PostScript-/PDF-Kieker
-GenericName[ne]=PS/PDF दर्शक
-GenericName[nl]=PostScript/PDF-weergaveprogramma
-GenericName[nn]=PS/PDF-lesar
-GenericName[nso]=Molebeledi wa PS/PDF
-GenericName[pa]=PS/PDF ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka plików PS/PDF
-GenericName[pt]=Visualizador de PS/PDF
-GenericName[pt_BR]=Visualizador PDF/PS
-GenericName[ro]=Vizualizor PS/PDF
-GenericName[ru]=Просмотр Postscript и PDF
-GenericName[se]=PS/PDF-čájeheaddji
-GenericName[sk]=Prehliadač PS/PDF
-GenericName[sl]=Pregledovalnik datotek PS/PDF
-GenericName[sr]=PS/PDF приказивач
-GenericName[sr@Latn]=PS/PDF prikazivač
-GenericName[sv]=PS/PDF-visare
-GenericName[ta]=PS/PDF காட்சி
-GenericName[tg]=Хондани PS/PDF
-GenericName[th]=เครื่องมือแสดงแฟ้มโพสต์สคริปต์ PS/PDF
-GenericName[tr]=PS/PDF Görüntüleyici
-GenericName[uk]=Переглядач PDF/PS
-GenericName[uz]=PS/PDF koʻruvchi
-GenericName[uz@cyrillic]=PS/PDF кўрувчи
-GenericName[ven]=Muvhoni wa PS/PDF
-GenericName[wa]=Håyneu di documints PS/PDF
-GenericName[xh]=Umboniseli we PS/PDF
-GenericName[zh_CN]=PS/PDF 查看器
-GenericName[zh_HK]=PS/PDF 檢視器
-GenericName[zh_TW]=PS/PDF 檢視器
-GenericName[zu]=Umboniseli we PS/PDF
Terminal=false
Categories=Qt;TDE;Graphics;
NoDisplay=true
diff --git a/kghostview/kghostview.kcfg b/kghostview/kghostview.kcfg
index 441e1bb3..dd3d3cf2 100644
--- a/kghostview/kghostview.kcfg
+++ b/kghostview/kghostview.kcfg
@@ -78,5 +78,3 @@
</entry>
</group>
</kcfg>
-<!-- vim:set ts=4 -->
-
diff --git a/kghostview/kghostview_part.desktop b/kghostview/kghostview_part.desktop
index 23c6616f..6383094f 100644
--- a/kghostview/kghostview_part.desktop
+++ b/kghostview/kghostview_part.desktop
@@ -1,16 +1,5 @@
[Desktop Entry]
Name=KGhostView
-Name[af]=Kghostview
-Name[ar]=برنامج KGhostView
-Name[eo]=Postskriptrigardilo
-Name[hi]=के-घोस्ट-व्यू
-Name[hu]=KGhostview
-Name[ne]=केडीई घोस्ट दृश्य
-Name[sv]=Kghostview
-Name[ta]=கேமற்றொரு காட்சி
-Name[tr]=GhostView
-Name[ven]=Mbonalelo ya tshipuku tsha K
-Name[xh]=Imboniselo yeKGhost
MimeType=application/pdf;application/postscript;image/x-eps;application/x-gzpostscript;application/illustrator
X-TDE-InitialPreference=6
Icon=kghostview
diff --git a/kghostview/kgv.h b/kghostview/kgv.h
index 669d94f1..206876cb 100644
--- a/kghostview/kgv.h
+++ b/kghostview/kgv.h
@@ -11,5 +11,3 @@ typedef TQValueList<int> PageList;
}
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgv_miniwidget.cpp b/kghostview/kgv_miniwidget.cpp
index 4d862c36..5d6ca3df 100644
--- a/kghostview/kgv_miniwidget.cpp
+++ b/kghostview/kgv_miniwidget.cpp
@@ -568,6 +568,3 @@ void KGVMiniWidget::setDisplayOptions( const DisplayOptions& newOptions )
}
#include "kgv_miniwidget.moc"
-
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/kgv_miniwidget.h b/kghostview/kgv_miniwidget.h
index afa1e326..2e370153 100644
--- a/kghostview/kgv_miniwidget.h
+++ b/kghostview/kgv_miniwidget.h
@@ -170,5 +170,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/kgv_view.cpp b/kghostview/kgv_view.cpp
index 225cebb0..0701c659 100644
--- a/kghostview/kgv_view.cpp
+++ b/kghostview/kgv_view.cpp
@@ -1032,6 +1032,3 @@ void KGVPart::showPopup( int, int, const TQPoint& pos )
}
#include "kgv_view.moc"
-
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/kgv_view.h b/kghostview/kgv_view.h
index ee863731..04365ad4 100644
--- a/kghostview/kgv_view.h
+++ b/kghostview/kgv_view.h
@@ -267,5 +267,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/kgvconfigdialog.cpp b/kghostview/kgvconfigdialog.cpp
index d76a7343..c2ce2d2a 100644
--- a/kghostview/kgvconfigdialog.cpp
+++ b/kghostview/kgvconfigdialog.cpp
@@ -149,6 +149,3 @@ void ConfigDialog::showSettings( KGVPart* main ) {
TQObject::connect( dialog, TQT_SIGNAL( settingsChanged() ), main, TQT_SLOT( slotConfigurationChanged() ) );
dialog->show();
}
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvconfigdialog.h b/kghostview/kgvconfigdialog.h
index 3f7ddead..a94157c2 100644
--- a/kghostview/kgvconfigdialog.h
+++ b/kghostview/kgvconfigdialog.h
@@ -27,6 +27,3 @@ namespace ConfigDialog {
}
#endif
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvdocument.cpp b/kghostview/kgvdocument.cpp
index 81691509..ae0742da 100644
--- a/kghostview/kgvdocument.cpp
+++ b/kghostview/kgvdocument.cpp
@@ -171,7 +171,7 @@ bool KGVDocument::uncompressFile()
// If the file is gzipped, gunzip it to the temporary file _tmpUnzipped.
kdDebug(4500) << "KGVDocument::uncompressFile()" << endl;
- auto_ptr<TQIODevice> filterDev( KFilterDev::deviceForFile( _fileName, _mimetype, true ) );
+ unique_ptr<TQIODevice> filterDev( KFilterDev::deviceForFile( _fileName, _mimetype, true ) );
if ( !filterDev.get() ) {
KMimeType::Ptr mt = KMimeType::mimeType(_mimetype);
if ( (_fileName.right( 3 ) == ".gz") || mt->is("application/x-gzip") ) {
@@ -859,6 +859,3 @@ void Pdf2dsc::processExited()
}
#include "kgvdocument.moc"
-
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/kgvdocument.h b/kghostview/kgvdocument.h
index 3a9764f3..5076b78b 100644
--- a/kghostview/kgvdocument.h
+++ b/kghostview/kgvdocument.h
@@ -193,5 +193,3 @@ inline bool KGVDocument::isOpen() const
#endif
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/kgvmainwidget.cpp b/kghostview/kgvmainwidget.cpp
index 5e9bd40b..025b4cdb 100644
--- a/kghostview/kgvmainwidget.cpp
+++ b/kghostview/kgvmainwidget.cpp
@@ -46,5 +46,3 @@ void KGVMainWidget::dragEnterEvent( TQDragEnterEvent * ev )
}
#include "kgvmainwidget.moc"
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvmainwidget.h b/kghostview/kgvmainwidget.h
index 4ca6bf23..f18856b1 100644
--- a/kghostview/kgvmainwidget.h
+++ b/kghostview/kgvmainwidget.h
@@ -42,5 +42,3 @@ protected:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvpagedecorator.cpp b/kghostview/kgvpagedecorator.cpp
index b6304c1d..c92f628b 100644
--- a/kghostview/kgvpagedecorator.cpp
+++ b/kghostview/kgvpagedecorator.cpp
@@ -102,5 +102,3 @@ void KGVPageDecorator::updateMask()
p.end();
setMask( bm );
}
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvpagedecorator.h b/kghostview/kgvpagedecorator.h
index d3942afc..250c1da4 100644
--- a/kghostview/kgvpagedecorator.h
+++ b/kghostview/kgvpagedecorator.h
@@ -77,5 +77,3 @@ inline unsigned int KGVPageDecorator::borderWidth() const
}
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvpageview.cpp b/kghostview/kgvpageview.cpp
index 4761391b..336bad6d 100644
--- a/kghostview/kgvpageview.cpp
+++ b/kghostview/kgvpageview.cpp
@@ -250,5 +250,3 @@ void KGVPageView::centerContents()
}
#include "kgvpageview.moc"
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvpageview.h b/kghostview/kgvpageview.h
index 91e8c11b..b7c4cd09 100644
--- a/kghostview/kgvpageview.h
+++ b/kghostview/kgvpageview.h
@@ -102,5 +102,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvshell.cpp b/kghostview/kgvshell.cpp
index 753a4213..0835efb3 100644
--- a/kghostview/kgvshell.cpp
+++ b/kghostview/kgvshell.cpp
@@ -365,6 +365,3 @@ void KGVShell::slotRMBClick()
{
_popup->exec( TQCursor::pos() );
}
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kgvshell.h b/kghostview/kgvshell.h
index f273cfbb..70879a4f 100644
--- a/kghostview/kgvshell.h
+++ b/kghostview/kgvshell.h
@@ -89,5 +89,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kpswidget.cpp b/kghostview/kpswidget.cpp
index aae2f479..cdce1dbb 100644
--- a/kghostview/kpswidget.cpp
+++ b/kghostview/kpswidget.cpp
@@ -526,5 +526,3 @@ bool KPSWidget::x11Event( XEvent* e )
}
#include "kpswidget.moc"
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/kpswidget.h b/kghostview/kpswidget.h
index 71ffe704..0dd556fa 100644
--- a/kghostview/kpswidget.h
+++ b/kghostview/kpswidget.h
@@ -383,6 +383,3 @@ inline CDSC_ORIENTATION_ENUM KPSWidget::orientation() const
*/
#endif // __KPSWIDGET_H__
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/logwindow.h b/kghostview/logwindow.h
index b8650f33..8f3b2f11 100644
--- a/kghostview/logwindow.h
+++ b/kghostview/logwindow.h
@@ -52,5 +52,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
diff --git a/kghostview/main.cpp b/kghostview/main.cpp
index bc91d6ad..cd11b877 100644
--- a/kghostview/main.cpp
+++ b/kghostview/main.cpp
@@ -67,5 +67,3 @@ int main( int argc, char** argv )
args->clear();
return app.exec();
}
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/marklist.cpp b/kghostview/marklist.cpp
index e05d521c..b84924eb 100644
--- a/kghostview/marklist.cpp
+++ b/kghostview/marklist.cpp
@@ -243,5 +243,3 @@ void MarkList::viewportResizeEvent ( TQResizeEvent * )
}
}
}
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/marklist.h b/kghostview/marklist.h
index 54992a88..6ccc5800 100644
--- a/kghostview/marklist.h
+++ b/kghostview/marklist.h
@@ -86,5 +86,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/ps.h b/kghostview/ps.h
index 3cb4ea9c..15fa319f 100644
--- a/kghostview/ps.h
+++ b/kghostview/ps.h
@@ -38,7 +38,3 @@ char *pscopyuntil(FILE *from, FILE *to, long begin, long end,
const char *comment);
#endif
-
-/*
- * vim:sw=4:sts=4:ts=8:noet
- */
diff --git a/kghostview/scrollbox.cpp b/kghostview/scrollbox.cpp
index 87d68418..e50f353a 100644
--- a/kghostview/scrollbox.cpp
+++ b/kghostview/scrollbox.cpp
@@ -130,5 +130,3 @@ void ScrollBox::clear()
}
#include "scrollbox.moc"
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/scrollbox.h b/kghostview/scrollbox.h
index 9a9f77e1..5cdd96b0 100644
--- a/kghostview/scrollbox.h
+++ b/kghostview/scrollbox.h
@@ -57,5 +57,3 @@ private:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/thumbnailservice.h b/kghostview/thumbnailservice.h
index 0b1262f1..6c861e77 100644
--- a/kghostview/thumbnailservice.h
+++ b/kghostview/thumbnailservice.h
@@ -87,7 +87,5 @@ class ThumbnailService : public TQObject {
bool _busy;
bool _enabled;
};
-
-// vim:sw=4:sts=4:ts=8:sta:tw=78:noet
#endif // THUMBNAILSERVICE_H
diff --git a/kghostview/version.h b/kghostview/version.h
index 81cf5df2..d76c2d5d 100644
--- a/kghostview/version.h
+++ b/kghostview/version.h
@@ -1,4 +1 @@
#define KGHOSTVIEW_VERSION "0.20"
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/viewcontrol.cpp b/kghostview/viewcontrol.cpp
index 6c0cf0f5..aa46048b 100644
--- a/kghostview/viewcontrol.cpp
+++ b/kghostview/viewcontrol.cpp
@@ -189,6 +189,3 @@ ViewControl::slotOrientSelection (int i)
prevorient = i;
}
}
-
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kghostview/viewcontrol.h b/kghostview/viewcontrol.h
index db78ba79..3e4a24b9 100644
--- a/kghostview/viewcontrol.h
+++ b/kghostview/viewcontrol.h
@@ -41,5 +41,3 @@ signals:
};
#endif
-
-// vim:sw=4:sts=4:ts=8:noet
diff --git a/kmrml/kmrml/CMakeL10n.txt b/kmrml/kmrml/CMakeL10n.txt
index 2ebb7cf2..7a6286e3 100644
--- a/kmrml/kmrml/CMakeL10n.txt
+++ b/kmrml/kmrml/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kmrml" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kmrml-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kmrml/kmrml/CMakeLists.txt b/kmrml/kmrml/CMakeLists.txt
index 07a0b40e..90f7e3ce 100644
--- a/kmrml/kmrml/CMakeLists.txt
+++ b/kmrml/kmrml/CMakeLists.txt
@@ -28,9 +28,25 @@ link_directories(
#### other data #################################
-install( FILES mrml.protocol mrml_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-install( FILES mrml.desktop DESTINATION ${MIME_INSTALL_DIR}/text )
-install( FILES mrml-servicemenu.desktop DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus )
+install( FILES mrml.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE mrml_part.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kmrml-desktops
+)
+
+tde_create_translated_desktop(
+ SOURCE mrml.desktop
+ DESTINATION ${MIME_INSTALL_DIR}/text
+ PO_DIR kmrml-desktops
+)
+
+tde_create_translated_desktop(
+ SOURCE mrml-servicemenu.desktop
+ DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
+ PO_DIR kmrml-desktops
+)
#### tdeio_mrml (module) ##########################
diff --git a/kmrml/kmrml/kcontrol/CMakeLists.txt b/kmrml/kmrml/kcontrol/CMakeLists.txt
index 6ff6fbb6..7c259547 100644
--- a/kmrml/kmrml/kcontrol/CMakeLists.txt
+++ b/kmrml/kmrml/kcontrol/CMakeLists.txt
@@ -23,7 +23,10 @@ link_directories(
#### other data #################################
-INSTALL( FILES kcmkmrml.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kcmkmrml.desktop
+ PO_DIR kmrml-desktops
+)
#### kcm_kmrml (module) ###########################
diff --git a/kmrml/kmrml/kcontrol/kcmkmrml.desktop b/kmrml/kmrml/kcontrol/kcmkmrml.desktop
index f4fe6536..1e90be30 100644
--- a/kmrml/kmrml/kcontrol/kcmkmrml.desktop
+++ b/kmrml/kmrml/kcontrol/kcmkmrml.desktop
@@ -7,170 +7,9 @@ X-TDE-ModuleType=Library
X-TDE-Library=kmrml
Name=Image Index
-Name[ar]=فهرس الصور
-Name[bg]=Графичен индекс
-Name[br]=Meneger ar skeudenn
-Name[bs]=Indeks slika
-Name[ca]=Índex d'imatge
-Name[cs]=Rejstřík obrázků
-Name[cy]=Mynegai Delweddau
-Name[da]=Billedindeks
-Name[de]=Bildindex
-Name[el]=Ευρετήριο εικόνων
-Name[eo]=Bildindekso
-Name[es]=Índice de imágenes
-Name[et]=Pildiindeks
-Name[eu]=Irudiaren indizea
-Name[fa]=نمایۀ تصویر
-Name[fi]=Kuvahakemisto
-Name[fr]=Indexation des images
-Name[gl]=Índice imaxe
-Name[he]=אינדקס תמונות
-Name[hi]=छवि सूची
-Name[hu]=Képkereső
-Name[is]=Myndayfirlit
-Name[it]=Indice di immagini
-Name[ja]=画像インデックス
-Name[kk]=Кескіндер индексі
-Name[km]=លិបិក្រម​រូបភាព
-Name[lt]=Paveikslėlių rodyklė
-Name[ms]=Indeks Imej
-Name[nb]=Bildeindeks
-Name[nds]=Bildindex
-Name[ne]=छवि अनुक्रमणिका
-Name[nl]=Afbeeldingenindex
-Name[nn]=Biletindeks
-Name[nso]=Palo ya Ponagalo
-Name[pl]=Spis obrazków
-Name[pt]=Índice de Imagens
-Name[pt_BR]=Índice de Imagens
-Name[ro]=Index imagini
-Name[ru]=Индексирование изображений
-Name[se]=Govvaindeaksa
-Name[sk]=Katalóg obrázkov
-Name[sl]=Seznam slik
-Name[sr]=Индекс слика
-Name[sr@Latn]=Indeks slika
-Name[sv]=Bildindex
-Name[ta]=பிம்ப அட்டவணை
-Name[tg]=Индексатсия кардани тасвирот
-Name[th]=ดัชนีรูปภาพ
-Name[tr]=Resim İndeksi
-Name[uk]=Індекс зображень
-Name[uz]=Rasm indeksi
-Name[uz@cyrillic]=Расм индекси
-Name[ven]=Index ya tshifanyiso
-Name[wa]=Indecse des imådjes
-Name[xh]=Isalathisi Somfanekiso
-Name[zh_CN]=图像索引
-Name[zh_HK]=圖像索引
-Name[zh_TW]=影像索引
-Name[zu]=Isiqalo Sesithombe
Comment=Configuration for using the GNU Image Finding Tool
-Comment[ar]=اعدادات لاستخدام أداة GNU للبحث عن الصور
-Comment[bg]=Настройване на програмата за индексиране и търсене на изображения
-Comment[bs]=Podešavanje za upotrebu GNU Alata za pronalaženje slika
-Comment[ca]=Configuració per a l'ús de l'eina de cerca d'imatges GNU
-Comment[cs]=Konfigurace používání nástroje GNU Image Finding Tool
-Comment[cy]=Ffurfweddiad am ddefnyddio'r Erfyn Canfod Delweddau GNU
-Comment[da]=Indstilling for brug af GNU Image Finding Tool
-Comment[de]=Einrichtung für die Benutzung des GNU Bildersuchwerkzeugs (GNU Image Finding Tool)
-Comment[el]=Ρύθμιση για τη χρήση του εργαλείου αναζήτησης εικόνων GIFT
-Comment[es]=Configuración para utilizar la herramienta de búsqueda de imágenes de GNU
-Comment[et]=Seadistused GNU pildileidmisrakenduse kasutamiseks
-Comment[eu]=GNU irudi aurkitzailea erabiltzeko konfigurazioa
-Comment[fa]=پیکربندی برای استفاده از ابزار یافتن تصویر GNU
-Comment[fi]=Asetukset GNU Image Finding Tool -ohjelman käyttöä varten
-Comment[fr]=Configuration pour l'utilisation du GNU Image Finding Tool
-Comment[gl]=Configuración para empregar a «GNU Image Finding Tool»
-Comment[he]=שינוי הגדרות כלי חיפוש התמונות של GNU
-Comment[hi]=ग्नू छवि खोज औज़ार को उपयोग करने के लिए कॉन्फ़िगरेशन
-Comment[hu]=A GIFT képkereső szolgáltatás beállításai
-Comment[is]=Stillingar til þess að nota GNU myndleitartólið
-Comment[it]=Configurazione della ricerca delle immagini
-Comment[ja]=GIFT (GNU Image Finding Tool) を使用するための設定
-Comment[kk]=GNU Image Finding Tool кескінді табу құралын пайдалану баптаулары
-Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ដើម្បី​ប្រើ​ឧបករណ៍​ស្វែងរក​រូបភាព​របស់ GNU
-Comment[lt]=GNU paveikslėlių paieškos įrankio konfigūracija
-Comment[ms]=Konfigurasi untuk mengguna Alat Carian Imej GNU
-Comment[nb]=Tilpass GNU bildesøkingsverktøy
-Comment[nds]=Inrichten för dat GNU-Bildsöökwarktüüch
-Comment[ne]=GNU छवि फेला पार्ने उपकरण प्रयोगका लागि कन्फिगरेसन
-Comment[nl]=Configuratie voor het gebruik van de GNU Image Finding Tool
-Comment[nn]=Oppsett av GNU Image Finding Tool
-Comment[pl]=Konfiguracja Gifta (narzędzia do szukania obrazków GNU)
-Comment[pt]=Configuração da Ferramenta de Procura de Imagens da GNU
-Comment[pt_BR]=Configuração para o uso da Ferramenta de Procura de Imagens GNU
-Comment[ro]=Configurare pentru GNU Image Finding Tool
-Comment[ru]=Настройка использования программы поиска изображений GNU Image Finding Tool
-Comment[se]=Heivet GNU Image Finding Tool
-Comment[sk]=Konfigurácia pre GNU Image Finding Tool
-Comment[sl]=Nastavitve za uporabo orodja GNU za iskanje slik
-Comment[sr]=Подешавање коришћења GNU-овог алата за тражење слика
-Comment[sr@Latn]=Podešavanje korišćenja GNU-ovog alata za traženje slika
-Comment[sv]=Inställning för att använda GNU:s bildsökverktyg
-Comment[ta]=GNU பிம்ப தேடுதல் கருவியை பயன்படுத்துவதற்கான அமைப்பு
-Comment[tg]=Танзимоти истифодабарии барномаиҷустуҷӯи тасвироти GNU Image Finding Tool
-Comment[tr]=GNU Resim Bulma Aracı yapılandırması
-Comment[uk]=Налаштування засобу пошуку зображень GNU
-Comment[ven]=Nzudzanyo yau shumisa tshishumiswa tshau toda tshifanyiso tsha GNU
-Comment[wa]=Apontiaedje po-z eployî l' usteye di cweraedje d' imådjes di GNU
-Comment[xh]=Uqwalaselo lokusebenzisa Isixhobo Sokufumana Umfanekiso we GNU
-Comment[zh_CN]=使用 GNU 图像查找工具的配置
-Comment[zh_HK]=GNU 圖像搜尋工具的設定
-Comment[zh_TW]= GNU 影像搜尋工具組態
-Comment[zu]=Inhlanganiselo yokusebenzisa Ithuluzi Lokuthola Isithombe se-GNU
Keywords=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;
-Keywords[ar]=صور;بحث;استعلام;Find;Gift;kmrml;mrml;CBIR;
-Keywords[bg]=изображения; търсене; заявка; картинка; картинки; снимки; Images; Search; Query; Find; Gift; kmrml; mrml; CBIR;
-Keywords[bs]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;slike;pretraga;upit;nađi;
-Keywords[ca]=Imatges;Cerca;Consulta;Busca;Gift;kmrml;mrml;CBIR;
-Keywords[cs]=Obrázky;Hledat;Dotaz;Najít;Gift;kmrml;mrml;CBIR;
-Keywords[cy]=Delweddau;Chwilio;Canfod;Gift;kmrml;mrml;CBIR;
-Keywords[da]=Billeder;Søgning;Forespørgsel;Find;Gave;kmrml;mrml;CBIR;
-Keywords[de]=Bilder;Suche;Anfrage;finden;Geschenk;kmrml;mrml;CBIR;
-Keywords[el]=Εικόνες;Αναζήτηση;Ερώτηση;Αναζήτηση;Gift;kmrml;mrml;CBIR;
-Keywords[es]=Imágenes;Búsqueda;Consulta;Buscar;Gift;kmrml;mrml;CBIR;
-Keywords[et]=pildid;otsing;päring;leia;Gift;kmrml;mrml;CBIR;
-Keywords[eu]=Irudiak;Bilaketa;Bilatu;Galdetu;Gift;kmrml;mrml;CBIR;
-Keywords[fa]=تصاویر، جستجو، پرس‌و‌جو، یافتن، Gift،kmrml،mrml،CBIR;
-Keywords[fi]=Kuvat;Haku;Etsi;Lahja;kmrml;mrml;CBIR;
-Keywords[fr]=Images;Recherche;Requête;Chercher;Gift;kmrml;mrml;CBIR;
-Keywords[gl]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR; imaxes; procura;
-Keywords[he]=תמונות;חיפוש;שאילתה;Gift;kmrml;mrml;CBIR; Images;Search;Query;Find;
-Keywords[hi]=छवि; खोज;ढूंढ;तलाश;उपहार;केएमआरएमएल;एमआरएमएल;सीबीआईआर;
-Keywords[hu]=képek;keresés;lekérdezés;találat;Gift;kmrml;mrml;CBIR;
-Keywords[it]=immagini;ricerca;trovare;Gift;kmrml;mrml;CBIR;
-Keywords[ja]=画像;検索;クエリ;検索;Gift;kmrml;mrml;CBIR;
-Keywords[km]=រូបភាព;ស្វែងរក;សួរ;រក;Gift;kmrml;mrml;CBIR;
-Keywords[lt]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR; paveikslėliai;paieška;paklausimas;
-Keywords[nb]=Bilder;Søk;Spørringer;Finn;Gift;kmrml;mrml;CBIR;
-Keywords[nds]=Biller;Söök;Anfraag;söken;Gaav;kmrml;mrml;CBIR;
-Keywords[nl]=illustraties;figuren;figuur;afbeeldingen;plaatjes;zoeken;find;gift;kmrml;mrml;CBIR;images;
-Keywords[nn]=bilete;søk;spørjing;finn;gåve;kmrml;mrml;CBIR;
-Keywords[nso]=Diponagalo;Nyaka;Kgokgonego;Hwetsa;Mpho;kmrml;mrml;CBIR;
-Keywords[pl]=Obrazki;Szukanie;Zapytanie;Szukaj;Gift;kmrml;mrml;CBIR;
-Keywords[pt]=Imagens;Procurar;Pesquisar;Encontrar;Prenda;kmrml;mrml;CBIR;
-Keywords[pt_BR]=Imagens;Busca;Consulta;Procurar;Presente;kmrml;mrml;CBIR;
-Keywords[ro]=imagini;căutare;caută;interogare;găseşte;dar;kmrml;mrml;CBIR;
-Keywords[ru]=изображения;поиск;запрос;kmrml;mrml;CBIR;
-Keywords[sk]=Obrázky;Hľadanie;Dotazy;Nájsť;kmrml;mrml;CBIR;
-Keywords[sl]=slike;iskanje;povpraševanje;išči;najdi;gift;kmrml;mrml;CBIR;
-Keywords[sr]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;слике;тражи;упит;нађи;поклон;
-Keywords[sr@Latn]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;slike;traži;upit;nađi;poklon;
-Keywords[sv]=Bilder;Sök;Förfrågan;Hitta;Gift;kmrml;mrml;CBIR;
-Keywords[ta]=பிம்பங்கள்; தேடு; கேள்வி; கண்டுபிடி;பரிசு;kmrml;mrml;CBIR;
-Keywords[tg]=тасвирот;ҷустуҷӯӣ;дархост;kmrml;mrml;CBIR;
-Keywords[tr]=Resimler;Ara;Arama;kmrml;mrml;CBIR;
-Keywords[uk]=зображення;пошук;запит;знайти;подарунок;kmrml;mrml;CBIR;
-Keywords[ven]=Zwifanyiso;Toda;Mbudziso;Wana;Mpho;kmrml;mrml;CBIR;
-Keywords[wa]=Imådjes;Cweri;Cweraedje;Trover;Gift;kmrml;mrml;CBIR;
-Keywords[xh]=Imifanekiso;Uphendlo;Ubuzo;fumana;Isiphiwo;kmrml;mrml;CBIR;
-Keywords[zh_CN]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;图像;搜索;查询;查找;礼物;
-Keywords[zh_HK]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;圖像;搜尋;查詢;尋找;
-Keywords[zh_TW]=Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;影像;搜尋;查詢;尋找;
-Keywords[zu]=Izithombe;Funa;Buza;Thola;Isipho;kmrml;mrml;CBIR;
Categories=Qt;TDE;Settings;X-TDE-settings-system;
diff --git a/kmrml/kmrml/kcontrol/serverconfigwidget.ui b/kmrml/kmrml/kcontrol/serverconfigwidget.ui
index 5f3a34cd..e9b76309 100644
--- a/kmrml/kmrml/kcontrol/serverconfigwidget.ui
+++ b/kmrml/kmrml/kcontrol/serverconfigwidget.ui
@@ -269,4 +269,9 @@
<tabstop>m_passEdit</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
+<includes>
+ <include location="global" impldecl="in implementation">kcombobox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">knuminput.h</include>
+</includes>
</UI>
diff --git a/kmrml/kmrml/mrml-servicemenu.desktop b/kmrml/kmrml/mrml-servicemenu.desktop
index ee0bdd62..6a3fe7ff 100644
--- a/kmrml/kmrml/mrml-servicemenu.desktop
+++ b/kmrml/kmrml/mrml-servicemenu.desktop
@@ -4,64 +4,5 @@ Actions=search;
[Desktop Action search]
Name=Search for Similar Images...
-Name[af]=Soektog vir Soortgelyk Beelde...
-Name[ar]=بحث عن الصور المتشابهه...
-Name[bg]=Търсене на подобни изображения...
-Name[bs]=Traženje sličnih slika...
-Name[ca]=Cerca imatges similars...
-Name[cs]=Hledat podobný obrázek...
-Name[cy]=Chwilio am Ddelweddau Tebyg...
-Name[da]=Søg efter lignende filer...
-Name[de]=Nach ähnlichen Bildern suchen ...
-Name[el]=Αναζήτηση για παρόμοιες εικόνες...
-Name[eo]=Serĉi Similajn Bildojn...
-Name[es]=Búsqueda de imágenes similares...
-Name[et]=Otsi sarnaseid pilte...
-Name[eu]=Bilatu antzeko irudiak...
-Name[fa]=جستجو برای تصاویر مشابه...
-Name[fi]=Etsi samankaltaisia kuvia...
-Name[fr]=Recherche d'images semblables...
-Name[gl]=Procurar imaxes semellantes...
-Name[he]=חיפוש תמונות דומות...
-Name[hi]=एक जैसे छवियों के लिए ढूंढें...
-Name[hu]=Ehhez hasonló képek keresése...
-Name[is]=Leita að svipuðum myndum...
-Name[it]=Cerca immagini simili...
-Name[ja]=同じような画像を検索...
-Name[kk]=Ұқсас кескіндерді іздеу...
-Name[km]=ស្វែងរក​រូបភាព​ស្រដៀង​គ្នា...
-Name[lt]=Panašių paveikslėlių paieška...
-Name[ms]=Cari Imej Serupa...
-Name[nb]=Søk etter liknende bilder …
-Name[nds]=Na lieke Biller söken...
-Name[ne]=उस्तै छविका लागि खोजी गर्नुहोस्...
-Name[nl]=Zoeken naar vergelijkbare afbeeldingen...
-Name[nn]=Søk etter liknande bilete …
-Name[nso]=Nyako ya Diponagalo tseo di Swanago...
-Name[pl]=Szukaj podobnych obrazków
-Name[pt]=Procurar por Imagens Semelhantes...
-Name[pt_BR]=Procurar por Imagens Parecidas...
-Name[ro]=Caută imagini similare...
-Name[ru]=Поиск похожих изображений...
-Name[se]=Oza seammalágana govaid …
-Name[sk]=Hľadať podobné obrázky...
-Name[sl]=Išči podobne slike ...
-Name[sr]=Потражи сличне слике...
-Name[sr@Latn]=Potraži slične slike...
-Name[sv]=Sök efter liknande bilder...
-Name[ta]=இதே போன்ற பிம்பங்களை தேடுக...
-Name[tg]=Ҷустуҷӯи тасвироти якхела...
-Name[th]=ค้นหาภาพที่เหมือนกัน...
-Name[tr]=Benzer Resimleri Ara...
-Name[uk]=Пошук схожих зображень...
-Name[uz]=Oʻxshash rasmlarni qidirish
-Name[uz@cyrillic]=Ўхшаш расмларни қидириш
-Name[ven]=Todani zwifanyiso zwielanaho...
-Name[wa]=Cweri après des rshonnantès imådjes...
-Name[xh]=Phendla Imifanekiso Efanayo...
-Name[zh_CN]=搜索类似图像...
-Name[zh_HK]=尋找類似的圖像...
-Name[zh_TW]=尋找類似的影像...
-Name[zu]=Sesha ukuthola Izithombe Ezifanayo....
Icon=image-x-generic
Exec=mrmlsearch %U
diff --git a/kmrml/kmrml/mrml.desktop b/kmrml/kmrml/mrml.desktop
index c31b9f08..9a5dc67c 100644
--- a/kmrml/kmrml/mrml.desktop
+++ b/kmrml/kmrml/mrml.desktop
@@ -1,58 +1,5 @@
[Desktop Entry]
Comment=Multimedia Retrieval Markup Language Document
-Comment[af]=Multimedia Onttrekking Opmerk Taal Dokument
-Comment[ar]=مستند لغة ترميز استرجاع الوسائط المتعددة
-Comment[bs]=Multimedia Retrieval Markup Language dokument
-Comment[ca]=Document de llenguatge de marcatge de recuperació multimèdia
-Comment[cs]=Multimedia Retrieval Markup Language dokument
-Comment[cy]=Dogfen Multimedia Retrieval Markup Language
-Comment[da]=Multimedia Retrieval Markup Language-dokument
-Comment[de]=Multimedia Suche- und Beschreibungssprache-Dokument (MRML-Dokument)
-Comment[el]=Έγγραφο Multimedia Retrieval Markup Language
-Comment[es]=Documento de lenguaje de descripción de descargas multimedia
-Comment[et]=Multimeedia otsingu märgistuskeele (MRML) dokument
-Comment[eu]=Multimedia Retrieval Markup Language dokumentua
-Comment[fa]=سند زبان نشان‌گذاری بازیابی چند رسانه‌ای
-Comment[fi]=Multimedianhakuasiakirja
-Comment[fr]=Document en langage Multimedia Retrieval Markup (MRML)
-Comment[he]=מסמך שפת סימון לאחזור מולטימדיה
-Comment[hi]=मल्टीमीडिया रिट्राइवल मार्कअप लैंग्वेज दस्तावेज़
-Comment[hu]=MRML-fájl
-Comment[is]=Multimedia Retrieval Markup Language skjal
-Comment[it]=Documento MRML
-Comment[ja]=Multimedia Retrieval Markup Language ドキュメント
-Comment[kk]=MRML (Multimedia Retrieval Markup Language) құжаты
-Comment[km]=ឯកសារ Multimedia Retrieval Markup Language
-Comment[lt]=Multimedia Retrieval Markup kalbos dokumentas
-Comment[ms]=Dokumen Bahasa Capaian Tandatas Multimedia
-Comment[nb]=«Multimedia Retrieval Markup Language»-dokument
-Comment[nds]=Dokment in de Affraag-Utteekspraak för Multimedia-Dokmenten
-Comment[ne]=मल्टिमिडिया पुन: प्राप्ति मार्कअप भाषा कागजात
-Comment[nl]=Multimedia Retrieval Markup Language-document
-Comment[nn]=«Multimedia Retrieval Markup Language»-dokument
-Comment[nso]=Tokomane ya Leleme la Peakanyo ya Kutullo ya Multimedia
-Comment[pl]=Dokument MRML (Język Znacznikowy Pozyskiwania Multimediów)
-Comment[pt]=Documento de Multimedia Retrieval Markup Language
-Comment[pt_BR]=Documento da Linguagem de Marcação de Recuperação Multimídia
-Comment[ro]=Document MRML (limbaj de marcare pentru căutări multimedia)
-Comment[ru]=Документ MRML (Multimedia Retrieval Markup Language)
-Comment[se]=«Multimedia Retrieval Markup Language»-dokumeanta
-Comment[sk]=Dokument Multimedia Retrieval Markup Language
-Comment[sl]=Dokument Multimedia Retrieval Markup Language
-Comment[sr]=Документ у обележивачком језику за добављање мултимедије (MRML)
-Comment[sr@Latn]=Dokument u obeleživačkom jeziku za dobavljanje multimedije (MRML)
-Comment[sv]=Multimedia Retrieval Markup Language-dokument
-Comment[ta]=பல் ஊடக திரும்பப்பெறு அடையாள மொழி ஆவணம்
-Comment[tg]=Санади MRML (Multimedia Retrieval Markup Language)
-Comment[th]=เอกสาร Multimedia Retrieval Markup Language
-Comment[tr]=Multimedia Retrieval Markup Language Belgesi
-Comment[uk]=Документ формату зберігання мультимедіа
-Comment[ven]=Manwalwa a luambo lwau humbula zwa khasho nnzhi
-Comment[xh]=Uxwebhu Lolwimi Lophawulo phezulu Lokufumana i Multimedia
-Comment[zh_CN]=多媒体检索标记语言文档
-Comment[zh_HK]=多媒體取得標記語言文件
-Comment[zh_TW]=多媒體補償標記語言文件
-Comment[zu]=Ushicilelo Lwe-Multimedia Retrieval Markup Language
Icon=text-html
Type=MimeType
MimeType=text/mrml
diff --git a/kmrml/kmrml/mrml_part.desktop b/kmrml/kmrml/mrml_part.desktop
index 3557a474..227bf207 100644
--- a/kmrml/kmrml/mrml_part.desktop
+++ b/kmrml/kmrml/mrml_part.desktop
@@ -2,59 +2,6 @@
Type=Service
Exec=blahfoo
Name=MRML View
-Name[ar]=برنامج MRML View
-Name[br]=Gwel MRML
-Name[ca]=Vista MRML
-Name[cs]=MRML pohled
-Name[cy]=Gwelydd MRML
-Name[da]=MRML-visning
-Name[de]=MRML-Ansicht
-Name[el]=Προβολή MRML
-Name[eo]=MRML-Rigardo
-Name[es]=Vista de MRML
-Name[et]=MRML vaade
-Name[eu]=MRML ikuspegia
-Name[fa]=نمای MRML
-Name[fi]=MRML-näkymä
-Name[fr]=Affichage MRML
-Name[ga]=Amharc MRML
-Name[gl]=Visor MRML
-Name[he]=תצוגת MRML
-Name[hi]=MRML दृश्य
-Name[hu]=MRML-nézet
-Name[is]=MRML sýn
-Name[it]=Visione MRML
-Name[ja]=MRML ビュー
-Name[kk]=MRML файлдарды қарау
-Name[km]=ទិដ្ឋភាព MRML
-Name[lt]=MRML peržiūra
-Name[ms]=Paparan MRML
-Name[nds]=MRML-Ansicht
-Name[ne]=MRML दृश्य
-Name[nl]=MRML-weergave
-Name[nso]=Pono ya MRML
-Name[pa]=MRML ਝਲਕ
-Name[pl]=Widok MRML
-Name[pt]=Janela de MRML
-Name[pt_BR]=Visualização de MRML
-Name[ro]=Vizualizare MRML
-Name[ru]=Просмотр MRML
-Name[se]=MRML-čájeheapmi
-Name[sk]=Prehliadač MRML
-Name[sl]=Pregledovalnik MRML
-Name[sr]=MRML приказивач
-Name[sr@Latn]=MRML prikazivač
-Name[ta]=MRML காட்சி
-Name[tg]=Намоиши MRML
-Name[th]=ดู MRML
-Name[tr]=MRML Görünümü
-Name[uk]=Перегляд MRML
-Name[ven]=Mbonalelo ya MRML
-Name[xh]=MRML Imbono
-Name[zh_CN]=MRML 查看器
-Name[zh_HK]=MRML 檢視
-Name[zh_TW]=MRML 檢視器
-Name[zu]=Umbukiso we-MRML
MimeType=text/mrml
X-TDE-ServiceTypes=KParts/ReadOnlyPart
X-TDE-Library=libkmrmlpart
diff --git a/kmrml/kmrml/server/CMakeLists.txt b/kmrml/kmrml/server/CMakeLists.txt
index 652d5c07..54dbe884 100644
--- a/kmrml/kmrml/server/CMakeLists.txt
+++ b/kmrml/kmrml/server/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-INSTALL( FILES daemonwatcher.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded )
+tde_create_translated_desktop(
+ SOURCE daemonwatcher.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/kded
+ PO_DIR kmrml-desktops
+)
#### kded_daemonwatcher (module) ################
diff --git a/kmrml/kmrml/server/daemonwatcher.desktop b/kmrml/kmrml/server/daemonwatcher.desktop
index 5d71f45a..8177e51e 100644
--- a/kmrml/kmrml/server/daemonwatcher.desktop
+++ b/kmrml/kmrml/server/daemonwatcher.desktop
@@ -1,101 +1,7 @@
[Desktop Entry]
Type=Service
Name=KDED KMRML Daemon Watcher
-Name[ar]=مراقب KDED KMRML Daemon
-Name[bs]=KDED KMRML nadzor demona
-Name[ca]=Dimoni vigilant KDED KMRL
-Name[cs]=Sledovač KMRML démonů
-Name[cy]=Gwyliwr Ellyll KMRML KDED
-Name[da]=KDED KMRML-dæmon-overvåger
-Name[de]=Überwachung der KDE-Bildersuche
-Name[el]=Επόπτης δαίμονα KMRML KDED
-Name[es]=Guardián del demonio KDED KMRML
-Name[et]=KDED KMRML deemoni jälgija
-Name[eu]=KDED KMRML deabru behatzailea
-Name[fa]=پایشگر شبح KDED KMRML
-Name[fi]=KDED KMRML-palvelimen tarkkailija
-Name[fr]=Observateur KDE du démon KMRML
-Name[gl]=Vixiante do daemon de KDED KMRML
-Name[he]=צופה תהליכי הרקע של KDED KMRML
-Name[hi]=KDED KMRML डेमन वाचर
-Name[hu]=KDED KMRML szolgáltatásfigyelő
-Name[is]=Eftirlit með KDED KMRML þjóninum
-Name[it]=Controllo del demone KDED KMRML
-Name[ja]=KDED KMRML デーモンウォッチャー
-Name[kk]=KDED KMRML қызметі
-Name[km]=កម្មវិធី​ឃ្លាំមើល​ដេមិន KDED KMRML
-Name[lt]=KDED KMRML tarnybos stebėtojas
-Name[ms]=Pemerhati Daemon KDED KMRML
-Name[nb]=KDED KMRML nisseovervåker
-Name[nds]=KMRML-Luerdämoon för KDED
-Name[ne]=KDED KMRML डेइमन दर्शक
-Name[nl]=KDED KMRML-daemonbeheer
-Name[nn]=KDED KMRML-nisseovervaking
-Name[pl]=Monitor usług KMRML
-Name[pt]=Monitor KMRML de Servidores KDED
-Name[pt_BR]=Sentinela de Serviços KDED
-Name[ro]=Demon KDED pentru MRML
-Name[ru]=Служба MRML
-Name[se]=KDED KMRML-duogášprográmmagoziheaddji
-Name[sk]=Sledovanie démona KDED KMRML
-Name[sl]=Opazovalnik demona KMRML za KDED
-Name[sr]=KDED KMRML демон за праћење
-Name[sr@Latn]=KDED KMRML demon za praćenje
-Name[sv]=KDED KMRML-demonbevakare
-Name[ta]=KDED டிமென் வாட்சர்
-Name[tg]=Мудири демони KDED KMRML
-Name[th]=ตัวเฝ้าดูแดมอน KDED KMRML
-Name[tr]=KDED KMRML Aracı İzleyici
-Name[uk]=Спостерігач демону KDED KMRML
-Name[zh_CN]=KDED KMRML 守护程序监视器
-Name[zh_HK]=KDED KMRML 系統程式監察器
-Name[zh_TW]=KDED KMRML 伺服程式監看器
Comment=Starts daemons on demand and restarts them on failure
-Comment[bg]=Стартиране на демоните при заявка и рестартиране на демони при грешка
-Comment[bs]=Pokreće demone po potrebi i restartuje ih ako se sruše
-Comment[ca]=Engega els dimonis sota petició i els torna a engegar si fallen
-Comment[cs]=Spouští démony na požádání a restartuje je při selhání
-Comment[da]=Starter dæmoner ved forespørgsel og genstarter dem ved fejl
-Comment[de]=Startet KMRML-Dienste bei Bedarf und im Fehlerfall neu
-Comment[el]=Εκκινεί δαίμονες όταν ζητηθεί και τους επανεκκινεί κατά την αποτυχία
-Comment[es]=Inicia los demonios bajo demanda y los reinicia si fallan
-Comment[et]=Käivitab nõudmisel deemoneid ja taaskäivitab neid ebaõnnestumise korral
-Comment[eu]=Demonioak hasi eta bukau egiten ditu eskatzen zaionean
-Comment[fa]=شبحها را بر اساس نیاز آغاز می‌کند و هنگام خرابی آنها را بازآغازی می‌کند
-Comment[fi]=Käynnistää palvelimia tarpeen mukaan ja uudelleenkäynnistää ne virheen yhteydessä
-Comment[fr]=Lance les démons à la demande et les redémarre en cas d'échec
-Comment[gl]=Iniciar daemons cando sexa preciso e reinicialos se fallan.
-Comment[he]=מפעיל תהליכי רקע לפי דרישה ומפעיל אותם מחדש במקרה של כשל
-Comment[hu]=Szükség esetén elindítja, hiba esetén újraindítja a szolgáltatásokat
-Comment[is]=Ræsir þjóna þegar þarf og endurræsir þá ef þeir bregðast
-Comment[it]=Avvia i demoni su richiesta e li riavvia in caso di problemi
-Comment[ja]=デーモンをオンデマンドで起動し、失敗したときは再起動します。
-Comment[kk]=Талап бойынша қызметті жегу, жаңылса қайта жегу
-Comment[km]=ចាប់ផ្ដើម​ដេមិន​នៅ​ពេល​ត្រូវការ ហើយ​ចាប់ផ្ដើម​ពួក​វា​ឡើង​វិញ​នៅ​ពេល​បរាជ័យ
-Comment[lt]=Paleidžia tarnybas pagal pareikalavimą ir paleidžia iš naujo nesėkmės atveju
-Comment[ms]=Mulakan daemons atas permintaan dan mula semula atas kegagalan
-Comment[nb]=Starter nisser på forespørsler og starter dem igjen ved feil.
-Comment[nds]=Start Achtergrundperzessen op Nafraag un bi Fehlers nieg
-Comment[ne]=माग गरेको बेलामा डेइमन सुरु गर्दछ र अफफल भएमा फेरि सुरु गर्दछ
-Comment[nl]=Start achtergrondprogramma's op en herstart deze indien nodig
-Comment[nn]=Startar nissar når dei trengst og startar dei om att ved feil
-Comment[pl]=Uruchamia usługi na żądanie i wznawia je po awarii
-Comment[pt]=Inicia os servidores a pedido e reinicia-os em caso de falha
-Comment[pt_BR]=Inicia serviços sob demanda e reinicia-os em caso de falha
-Comment[ro]=Porneşte demonii la cerere şi îi reporneşte în caz de eroare
-Comment[ru]=Поддержка протокола MRML
-Comment[sk]=Spustí démonov podľa požiadaviek a pri zlyhaní ich reštartuje
-Comment[sl]=Na zahtevo zažene demone in jih ob napaki znova zažene
-Comment[sr]=На захтев покреће демоне и поново их покреће ако се сруше
-Comment[sr@Latn]=Na zahtev pokreće demone i ponovo ih pokreće ako se sruše
-Comment[sv]=Starta demoner vid behov och starta om dem vid fel
-Comment[ta]=அவசிய நேரத்தில் டிமென்னை துவக்குகிறது. இயலாதபோது திரும்ப துவக்குகிறது
-Comment[tg]=Оғози демон аз рӯи дархост ва ҳангоми нуқсони он аз сари нав оғоз намудан.
-Comment[tr]=İstek halinde programı başlatır ve hata durumunda yeniden başlatır.
-Comment[uk]=Запускає демони при потребі та перезапускає їх при аварії
-Comment[zh_CN]=按需启动守护程序并在失败时重新启动
-Comment[zh_HK]=依要求啟動系統程式並在失敗時重新啟動它們。
-Comment[zh_TW]=需要時啟動守護程式,失敗的話重新啟動
X-TDE-ServiceTypes=KDEDModule
X-TDE-ModuleType=Library
X-TDE-Library=daemonwatcher
diff --git a/kolourpaint/CMakeL10n.txt b/kolourpaint/CMakeL10n.txt
index 2895b85d..bcc1f9bf 100644
--- a/kolourpaint/CMakeL10n.txt
+++ b/kolourpaint/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kolourpaint" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kolourpaint.desktop/"
+ SOURCES kolourpaint.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kolourpaint/CMakeLists.txt b/kolourpaint/CMakeLists.txt
index ee5f064c..288675bb 100644
--- a/kolourpaint/CMakeLists.txt
+++ b/kolourpaint/CMakeLists.txt
@@ -35,7 +35,7 @@ link_directories(
##### other data ################################
-install( FILES kolourpaint.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( kolourpaint.desktop )
install( FILES kolourpaintui.rc DESTINATION ${DATA_INSTALL_DIR}/kolourpaint )
diff --git a/kolourpaint/kolourpaint.desktop b/kolourpaint/kolourpaint.desktop
index 310f47c6..5b2d4108 100644
--- a/kolourpaint/kolourpaint.desktop
+++ b/kolourpaint/kolourpaint.desktop
@@ -1,79 +1,7 @@
[Desktop Entry]
Name=KolourPaint
-Name[nb]=KPaint
-Name[ne]=रङ पेन्ट
-Name[pa]=ਕੇ-ਰੰਗ-ਪੇਂਟ
-Name[sv]=Kolourpaint
-Name[ta]=நிற பெயின்ட்
-Name[zh_TW]=KolourPaint 小畫家
GenericName=Paint Program
-GenericName[af]=Verf Program
-GenericName[ar]=برنامج تلوين
-GenericName[bg]=Графичен редактор
-GenericName[br]=Goulev tresañ
-GenericName[bs]=Jednostavni program za crtanje
-GenericName[ca]=Programa de pintura
-GenericName[cs]=Kreslící program
-GenericName[cy]=Rhaglen Peintio
-GenericName[da]=Maleprogram
-GenericName[de]=Mal- und Zeichenprogramm
-GenericName[el]=Πρόγραμμα ζωγραφικής
-GenericName[eo]=Pentrilo
-GenericName[es]=Programa de pintura
-GenericName[et]=Joonistusprogramm
-GenericName[eu]=Marrazteko programa
-GenericName[fa]=برنامۀ رنگ
-GenericName[fi]=Piirto-ohjelma
-GenericName[fr]=Petit programme de dessin
-GenericName[ga]=Clár Péinteála
-GenericName[gl]=Programa de debuxo
-GenericName[he]=תוכנית ציור
-GenericName[hi]=छवि बनाने का प्रोग्राम
-GenericName[hr]=Program za slikanje
-GenericName[hu]=Rajzolóprogram
-GenericName[is]=Teikniforrit
-GenericName[it]=Programma di disegno
-GenericName[ja]=ペイントプログラム
-GenericName[kk]=Сурет салу бағдарламасы
-GenericName[km]=កម្មវិធី​គូរ
-GenericName[lt]=Piešimo programa
-GenericName[lv]=Krāsošanas Programma
-GenericName[ms]=Program Mewarna
-GenericName[mt]=Programm sempliċi tat-tpinġija
-GenericName[nb]=Maleprogram
-GenericName[nds]=Maalprogramm
-GenericName[ne]=पेन्ट कार्यक्रम
-GenericName[nl]=Tekenprogramma
-GenericName[nn]=Måleprogram
-GenericName[nso]=Lenaneo la Paint
-GenericName[pa]=ਰੰਗ ਕਾਰਜ
-GenericName[pl]=Program Paint
-GenericName[pt]=Programa de Pintura
-GenericName[pt_BR]=Programa de Pintura
-GenericName[ro]=Program de desenare
-GenericName[ru]=Графический редактор
-GenericName[rw]=Porogaramu Gusiga irangi
-GenericName[se]=Málenprográmma
-GenericName[sk]=Kreslenie
-GenericName[sl]=Slikarski program
-GenericName[sr]=Програм за сликање
-GenericName[sr@Latn]=Program za slikanje
-GenericName[sv]=Ritprogram
-GenericName[ta]=பெயிண்ட் நிரலி
-GenericName[tg]=Муҳаррири графикӣ
-GenericName[th]=โปรแกรมวาดภาพธรรมดาๆ
-GenericName[tr]=Boyama Programı
-GenericName[uk]=Програма для малювання
-GenericName[uz]=Chizish dasturi
-GenericName[uz@cyrillic]=Чизиш дастури
-GenericName[ven]=Mbekanyamushumo ya Pennde
-GenericName[wa]=Program di dessinaedje
-GenericName[xh]=Udweliso lwenkqubo lwepeyinti
-GenericName[zh_CN]=绘图程序
-GenericName[zh_HK]=繪圖程式
-GenericName[zh_TW]=繪圖程式
-GenericName[zu]=Elila Iprogremu Kapende
Icon=kolourpaint
Type=Application
@@ -88,4 +16,3 @@ Categories=Qt;TDE;Graphics;
Terminal=false
X-TDE-StartupNotify=true
X-DCOP-ServiceType=Multi
-
diff --git a/kooka/CMakeL10n.txt b/kooka/CMakeL10n.txt
index ab6ede2b..19ec78c2 100644
--- a/kooka/CMakeL10n.txt
+++ b/kooka/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kooka" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kooka.desktop/"
+ SOURCES kooka.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kooka/CMakeLists.txt b/kooka/CMakeLists.txt
index 24e3e091..e2fdcb00 100644
--- a/kooka/CMakeLists.txt
+++ b/kooka/CMakeLists.txt
@@ -28,7 +28,7 @@ link_directories(
##### other data ################################
-install( FILES kooka.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( kooka.desktop )
install( FILES kookarc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES kookaui.rc DESTINATION ${DATA_INSTALL_DIR}/kooka )
diff --git a/kooka/kooka.desktop b/kooka/kooka.desktop
index 24552df2..dcb82d0a 100644
--- a/kooka/kooka.desktop
+++ b/kooka/kooka.desktop
@@ -6,73 +6,7 @@ Path=
Terminal=false
X-DocPath=kooka/index.html
GenericName=Scan & OCR Program
-GenericName[af]=Skandeer & Optiese karakter herkenning Program
-GenericName[ar]=برنامج للمسح الضوئي
-GenericName[bg]=Сканиране
-GenericName[bs]=Program za skeniranje i OCR
-GenericName[ca]=Programa d'escaneig i OCR
-GenericName[cs]=Program pro skenování a OCR
-GenericName[cy]=Rhaglen Sganio ac OCR
-GenericName[da]=Skanne- & OCR-program
-GenericName[de]=Scan- und OCR-Programm
-GenericName[el]=Πρόγραμμα Σάρωσης & OCR
-GenericName[eo]=Bildbitiga programo kaj tekstrekono
-GenericName[es]=OCR y explorador con un escáner
-GenericName[et]=Skaneerimise ja OMT rakendus
-GenericName[eu]=Eskaneatzeko eta OCR programa
-GenericName[fa]=پویش و برنامۀ OCR
-GenericName[fi]=Skannaus- ja tekstintunnistusohjelma
-GenericName[fr]=Numérisation et reconnaissance de caractères
-GenericName[gl]=Programa para escanear e facer OCR
-GenericName[he]=תוכנית סריקה וזיהוי תווים אופטי
-GenericName[hi]=स्कैन व ऑप्टिकल कैरेक्टर रिकॉग्नीशन प्रोग्राम (OCR)
-GenericName[hr]=Program za skaniranje i OCR
-GenericName[hu]=Lapolvasó
-GenericName[is]=Forrit til að skanna inn myndir
-GenericName[it]=Programma di scansione e OCR
-GenericName[ja]=スキャン & OCR プログラム
-GenericName[kk]=Сканерге түсіру және танып-талдау
-GenericName[km]=កម្មវិធី​ស្កេន & OCR
-GenericName[lt]=Skanavimo ir teksto atpažinimo programa
-GenericName[lv]=Skanēšanas un OCR Programma
-GenericName[ms]=Program Imbas & OCR
-GenericName[nb]=Et skanne-og OCR-program
-GenericName[nds]=Inlees- un OTR-Programm
-GenericName[ne]=स्क्यान र OCR कार्यक्रम
-GenericName[nl]=Scan- en OCR-programma
-GenericName[nn]=Skanne- og tekstattkjenningsprogram
-GenericName[pl]=Program do skanowania i rozpoznawania pisma
-GenericName[pt]=Programa de Digitalização e OCR
-GenericName[pt_BR]=Um programa de Digitalização & OCR
-GenericName[ro]=Scanare imagini şi OCR
-GenericName[ru]=Сканирование и распознавание текста
-GenericName[sk]=Skenovací program s OCR
-GenericName[sl]=Program za skeniranje in prepoznavanje znakov
-GenericName[sr]=Програм за скенирање и препознавање текста
-GenericName[sr@Latn]=Program za skeniranje i prepoznavanje teksta
-GenericName[sv]=Bildläsar- och OCR-program
-GenericName[ta]=வருடு & OCR நிரலி
-GenericName[tg]=Барномаи сканеронӣ ва шиносоии матн
-GenericName[th]=โปรแกรมสแกนภาพและ OCR
-GenericName[tr]=Tarayıcı ve karakter tanıma programı
-GenericName[uk]=Програма сканування та розпізнавання символів
-GenericName[ven]=U nanga & Mbekanyamushumo ya OCR
-GenericName[wa]=Programe di scanaedje eyet di ricnoxhance di tecse
-GenericName[xh]=Udweliso Lwenkqubo Yemita Yovavanyo
-GenericName[zh_CN]=扫描和文字识别程序
-GenericName[zh_HK]=掃描和文字辦識程式
-GenericName[zh_TW]=掃描和文字辦識程式
-GenericName[zu]=Scan & OCR Iprogremu
Name=Kooka
-Name[ar]=برنامج Kooka
-Name[eo]=Kokao
-Name[hi]=कूका
-Name[is]=Skanni
-Name[ko]=쿠카
-Name[ne]=कोओका
-Name[pa]=ਕੋਕਾ
-Name[ta]=கூக்கா
-Name[zh_TW]=Kooka 掃描器
X-DCOP-ServiceType=Multi
Categories=Qt;TDE;Graphics;
diff --git a/kpdf/CMakeL10n.txt b/kpdf/CMakeL10n.txt
index d223ae9d..9373a9c0 100644
--- a/kpdf/CMakeL10n.txt
+++ b/kpdf/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kpdf" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kpdf-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kpdf/CMakeLists.txt b/kpdf/CMakeLists.txt
index ccef1e04..b35af955 100644
--- a/kpdf/CMakeLists.txt
+++ b/kpdf/CMakeLists.txt
@@ -33,7 +33,13 @@ link_directories(
##### other data ################################
tde_install_icons( kpdf )
-install( FILES kpdf_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE kpdf_part.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kpdf-desktops
+)
+
install( FILES part.rc DESTINATION ${DATA_INSTALL_DIR}/kpdfpart )
@@ -45,7 +51,8 @@ tde_add_kpart( libkpdfpart AUTOMOC
LINK
kpdfconf-static kpdfui-static kpdfcore-static generatorkimgio-static
generatorpdf-static xpdf-static goo-static splash-static fofi-static
- tdeutils-shared tdeprint-shared tdeparts-shared ${PAPER_LIBRARY} ${XFT_LIBRARIES}
+ tdeutils-shared tdeprint-shared tdeparts-shared
+ ${PAPER_LIBRARY} ${XFT_LIBRARIES} ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES}
DEPENDENCIES kpdfconf-static
DESTINATION ${PLUGIN_INSTALL_DIR}
)
diff --git a/kpdf/Makefile.am b/kpdf/Makefile.am
index 187989f7..270bc883 100644
--- a/kpdf/Makefile.am
+++ b/kpdf/Makefile.am
@@ -6,7 +6,7 @@ METASOURCES = AUTO
messages: rc.cpp
$(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui"` >> rc.cpp
- $(XGETTEXT) `find . -name "*.cpp" -o -name "*.cc" -o -name "*.h"` -o $(podir)/kpdf.pot
+ $(XGETTEXT) `find . -name "*.cpp" -o -name "*.h"` -o $(podir)/kpdf.pot
KDE_ICON = kpdf
diff --git a/kpdf/TODO b/kpdf/TODO
index d917fd1d..53f0cc17 100644
--- a/kpdf/TODO
+++ b/kpdf/TODO
@@ -46,7 +46,7 @@ More items (first items will enter 'In progress list' first):
-> take care of TODOs in code
-> ADD: click over image allows "save image" [60% done (activerect of type image)]
-> export all text in plain_text/html
--> extract(export?) images (have a look at ImageOutputDev.cc and pdfimages.cc from xpdf (not in our xpdf sources))
+-> extract(export?) images (have a look at ImageOutputDev.cpp and pdfimages.cpp from xpdf (not in our xpdf sources))
-> text selection in wordprocessor style (very hard)
-> zoom: fit text (with configurable margin)
-> bookview: 3d opengl widget for viewing the document as a real book (turning pages, etc..)
diff --git a/kpdf/conf/kpdf.kcfg b/kpdf/conf/kpdf.kcfg
index 9f54b412..7f84081e 100644
--- a/kpdf/conf/kpdf.kcfg
+++ b/kpdf/conf/kpdf.kcfg
@@ -76,6 +76,9 @@
<entry key="ViewContinuous" type="Bool" >
<default>true</default>
</entry>
+ <entry key="ViewCoverPage" type="Bool" >
+ <default>false</default>
+ </entry>
<entry key="ViewColumns" type="UInt" >
<default>1</default>
<min>1</min>
diff --git a/kpdf/core/generator_pdf/generator_pdf.cpp b/kpdf/core/generator_pdf/generator_pdf.cpp
index 4af2c1a4..dcb0252c 100644
--- a/kpdf/core/generator_pdf/generator_pdf.cpp
+++ b/kpdf/core/generator_pdf/generator_pdf.cpp
@@ -778,7 +778,7 @@ void PDFGenerator::scanFont(GfxFont *font, TDEListView *list, Ref **fonts, int &
TQString PDFGenerator::getDocumentInfo( const TQString & data, bool canReturnNull ) const
// note: MUTEX is LOCKED while calling this
{
- // [Albert] Code adapted from pdfinfo.cc on xpdf
+ // [Albert] Code adapted from pdfinfo.cpp on xpdf
Object info;
if ( !pdfdoc )
return canReturnNull ? TQString() : i18n( "Unknown" );
@@ -805,7 +805,7 @@ TQString PDFGenerator::getDocumentInfo( const TQString & data, bool canReturnNul
TQString PDFGenerator::getDocumentDate( const TQString & data ) const
// note: MUTEX is LOCKED while calling this
{
- // [Albert] Code adapted from pdfinfo.cc on xpdf
+ // [Albert] Code adapted from pdfinfo.cpp on xpdf
if ( !pdfdoc )
return i18n( "Unknown Date" );
diff --git a/kpdf/kpdf_part.desktop b/kpdf/kpdf_part.desktop
index a3620ada..138b8a68 100644
--- a/kpdf/kpdf_part.desktop
+++ b/kpdf/kpdf_part.desktop
@@ -1,9 +1,6 @@
[Desktop Entry]
Icon=kpdf
Name=KPDF
-Name[ar]=برنامج KPDF
-Name[hi]=के-पीडीएफ
-Name[zh_TW]=KPDF 檢視器
MimeType=application/pdf
X-TDE-InitialPreference=7
X-TDE-ServiceTypes=KParts/ReadOnlyPart
diff --git a/kpdf/part.h b/kpdf/part.h
index 50be072f..afa39250 100644
--- a/kpdf/part.h
+++ b/kpdf/part.h
@@ -210,5 +210,3 @@ public slots:
}
#endif
-
-// vim:ts=2:sw=2:tw=78:et
diff --git a/kpdf/part.rc b/kpdf/part.rc
index 194e94ac..d69959d4 100644
--- a/kpdf/part.rc
+++ b/kpdf/part.rc
@@ -24,6 +24,7 @@
<Separator/>
<Action name="view_continuous"/>
<Action name="view_twopages"/>
+ <Action name="view_coverpage"/>
</Menu>
<Menu name="go"><text>&amp;Go</text>
<Action name="previous_page"/>
diff --git a/kpdf/shell/CMakeLists.txt b/kpdf/shell/CMakeLists.txt
index 74553840..30691f02 100644
--- a/kpdf/shell/CMakeLists.txt
+++ b/kpdf/shell/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
##### other data ################################
-install( FILES kpdf.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kpdf.desktop
+ PO_DIR kpdf-desktops
+)
+
install( FILES shell.rc DESTINATION ${DATA_INSTALL_DIR}/kpdf )
diff --git a/kpdf/shell/kpdf.desktop b/kpdf/shell/kpdf.desktop
index dc4a96a9..630fcf2e 100644
--- a/kpdf/shell/kpdf.desktop
+++ b/kpdf/shell/kpdf.desktop
@@ -2,81 +2,10 @@
MimeType=application/pdf;
Terminal=false
Name=KPDF
-Name[ar]=برنامج KPDF
-Name[hi]=के-पीडीएफ
-Name[zh_TW]=KPDF 檢視器
GenericName=PDF Viewer
-GenericName[ar]=عارض ملفات PDF
-GenericName[az]=PDF Nümayişçisi
-GenericName[bg]=Преглед на документи PDF
-GenericName[br]=Gweler PDF
-GenericName[bs]=Preglednik PDF dokumenata
-GenericName[ca]=Visualitzador de PDF
-GenericName[cs]=Prohlížeč PDF souborů
-GenericName[cy]=Gwelydd PDF
-GenericName[da]=PDF-fremviser
-GenericName[de]=PDF-Betrachter
-GenericName[el]=Προβολέας PDF
-GenericName[eo]=PDF-rigardilo
-GenericName[es]=Visor de PDF
-GenericName[et]=PDF-failide näitaja
-GenericName[eu]=PDF ikustailua
-GenericName[fa]=مشاهده‌گر PDF
-GenericName[fi]=PDF-näytin
-GenericName[fr]=Afficheur PDF
-GenericName[ga]=Amharcán PDF
-GenericName[gl]=Visor PDF
-GenericName[he]=מציג PDF
-GenericName[hi]=पीडीएफ प्रदर्शक
-GenericName[hr]=Preglednik PDF dokumenata
-GenericName[hu]=PDF-nézegető
-GenericName[id]=Viewer PDF
-GenericName[is]=PDF sjá
-GenericName[it]=Visore PDF
-GenericName[ja]=PDF ビューア
-GenericName[kk]=PDF файлдарын қарау
-GenericName[km]=កម្មវិធី​មើល PDF
-GenericName[lt]=PDF Žiūriklis
-GenericName[lv]=PDF Skatītājs
-GenericName[mk]=Прикажувач на PDF датотеки
-GenericName[ms]=Pemapar PDF
-GenericName[mt]=Werrej PDF
-GenericName[nb]=PDF-fremviser
-GenericName[nds]=PDF-Kieker
-GenericName[ne]=PDF दर्शक
-GenericName[nl]=PDF-weergaveprogramma
-GenericName[nn]=PDF-lesar
-GenericName[pa]=PDF ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka plików PDF
-GenericName[pt]=Visualizador de PDFs
-GenericName[pt_BR]=Visualizador de arquivos PDF
-GenericName[ro]=Vizualizor PDF
-GenericName[ru]=Просмотр PDF
-GenericName[rw]=Mugaragaza PDF
-GenericName[se]=PDF-čájeheaddji
-GenericName[sk]=Prehliadač PDF
-GenericName[sl]=Pregledovalnik datotek PDF
-GenericName[sr]=PDF приказивач
-GenericName[sr@Latn]=PDF prikazivač
-GenericName[sv]=PDF-visare
-GenericName[ta]=PS/PDF காட்சி
-GenericName[tg]=Хондани санадоти PDF
-GenericName[th]=ตัวแสดงผล PDF
-GenericName[tr]=PDF Görüntüleyici
-GenericName[uk]=Переглядач PDF
-GenericName[uz]=PDF koʻruvchi
-GenericName[uz@cyrillic]=PDF кўрувчи
-GenericName[ven]=Tshivhoni tsha PDF
-GenericName[wa]=Håyneu di documints PDF
-GenericName[xh]=Umboniseli we PDF
-GenericName[zh_CN]=PDF 查看器
-GenericName[zh_HK]=PDF 檢視器
-GenericName[zh_TW]=PDF 檢視器
-GenericName[zu]=Umboniseli we PDF
Exec=kpdf %U %i -caption "%c"
Icon=kpdf
Type=Application
X-DocPath=kpdf/index.html
X-TDE-InitialPreference=7
Categories=Qt;TDE;Office;Viewer;
-
diff --git a/kpdf/shell/main.cpp b/kpdf/shell/main.cpp
index 1ed61999..9b8d0a18 100644
--- a/kpdf/shell/main.cpp
+++ b/kpdf/shell/main.cpp
@@ -78,5 +78,3 @@ int main(int argc, char** argv)
return app.exec();
}
-
-// vim:ts=2:sw=2:tw=78:et
diff --git a/kpdf/shell/shell.h b/kpdf/shell/shell.h
index 560be8fd..6c2e4057 100644
--- a/kpdf/shell/shell.h
+++ b/kpdf/shell/shell.h
@@ -109,5 +109,3 @@ namespace KPDF
}
#endif
-
-// vim:ts=2:sw=2:tw=78:et
diff --git a/kpdf/ui/pageview.cpp b/kpdf/ui/pageview.cpp
index 58c46101..97302be4 100644
--- a/kpdf/ui/pageview.cpp
+++ b/kpdf/ui/pageview.cpp
@@ -2,7 +2,7 @@
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* *
- * With portions of code from kpdf/kpdf_pagewidget.cc by: *
+ * With portions of code from kpdf/kpdf_pagewidget.cpp by: *
* Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
* Copyright (C) 2003 by Christophe Devriese *
* <Christophe.Devriese@student.kuleuven.ac.be> *
@@ -114,6 +114,7 @@ public:
TDEToggleAction * aZoomFitText;
TDEToggleAction * aViewTwoPages;
TDEToggleAction * aViewContinuous;
+ TDEToggleAction * aViewCoverPage;
TDEAction * aPrevAction;
};
@@ -282,6 +283,11 @@ void PageView::setupActions( TDEActionCollection * ac )
connect( d->aViewContinuous, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotContinuousToggled( bool ) ) );
d->aViewContinuous->setChecked( KpdfSettings::viewContinuous() );
+ d->aViewCoverPage = new TDEToggleAction( i18n("Co&ver Page"), "contents2", 0, ac, "view_coverpage" );
+ connect( d->aViewCoverPage, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotCoverPageToggled( bool ) ) );
+ d->aViewCoverPage->setChecked( KpdfSettings::viewCoverPage() );
+ d->aViewCoverPage->setEnabled( KpdfSettings::viewColumns() > 1 );
+
// Mouse-Mode actions
d->aMouseNormal = new TDERadioAction( i18n("&Browse Tool"), "input-mouse", 0, TQT_TQOBJECT(this), TQT_SLOT( slotSetMouseNormal() ), ac, "mouse_drag" );
d->aMouseNormal->setExclusiveGroup( "MouseType" );
@@ -1056,8 +1062,8 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
double nX = (double)(selRect.left() + selRect.right()) / (2.0 * (double)contentsWidth());
double nY = (double)(selRect.top() + selRect.bottom()) / (2.0 * (double)contentsHeight());
- // zoom up to 400%
- if ( d->zoomFactor <= 4.0 || zoom <= 1.0 )
+ // zoom up to 800%
+ if ( d->zoomFactor <= 8.0 || zoom <= 1.0 )
{
d->zoomFactor *= zoom;
viewport()->setUpdatesEnabled( false );
@@ -1537,8 +1543,8 @@ void PageView::updateZoom( ZoomMode newZoomMode )
d->zoomFactor = -1;
break;
}
- if ( newFactor > 4.0 )
- newFactor = 4.0;
+ if ( newFactor > 8.0 )
+ newFactor = 8.0;
if ( newFactor < 0.1 )
newFactor = 0.1;
@@ -1582,13 +1588,13 @@ void PageView::updateZoomText()
// add percent items
TQString double_oh( "00" );
- const float zoomValue[10] = { 0.125, 0.25, 0.333, 0.5, 0.667, 0.75, 1, 1.25, 1.50, 2 };
+ const float zoomValue[11] = { 0.125, 0.25, 0.333, 0.5, 0.667, 0.75, 1, 1.25, 1.50, 2, 4 };
int idx = 0,
selIdx = 2; // use 3 if "fit text" present
bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio
- while ( idx < 10 || !inserted )
+ while ( idx < 11 || !inserted )
{
- float value = idx < 10 ? zoomValue[ idx ] : newFactor;
+ float value = idx < 11 ? zoomValue[ idx ] : newFactor;
if ( !inserted && newFactor < (value - 0.0001) )
value = newFactor;
else
@@ -1652,6 +1658,7 @@ void PageView::doTypeAheadSearch()
void PageView::slotRelayoutPages()
// called by: notifySetup, viewportResizeEvent, slotTwoPagesToggled, slotContinuousToggled, updateZoom
{
+ bool coverPageMode = ( KpdfSettings::viewColumns() == 2 && KpdfSettings::viewCoverPage() );
// set an empty container if we have no pages
int pageCount = d->items.count();
if ( pageCount < 1 )
@@ -1682,11 +1689,12 @@ void PageView::slotRelayoutPages()
{
// Here we find out column's width and row's height to compute a table
// so we can place widgets 'centered in virtual cells'.
- int nCols = KpdfSettings::viewColumns(),
- nRows = (int)ceil( (float)pageCount / (float)nCols ),
+ int pageShift = coverPageMode ? 1 : 0,
+ nCols = KpdfSettings::viewColumns(),
+ nRows = (int)ceil( (float)(pageCount + pageShift) / (float)nCols ),
* colWidth = new int[ nCols ],
* rowHeight = new int[ nRows ],
- cIdx = 0,
+ cIdx = pageShift,
rIdx = 0;
for ( int i = 0; i < nCols; i++ )
colWidth[ i ] = viewportWidth / nCols;
@@ -1716,13 +1724,18 @@ void PageView::slotRelayoutPages()
// 2) arrange widgets inside cells
int insertX = 0,
insertY = 4; // 2 + 4*d->zoomFactor ?
- cIdx = 0;
+ cIdx = pageShift;
rIdx = 0;
+
for ( iIt = d->items.begin(); iIt != iEnd; ++iIt )
{
PageViewItem * item = *iIt;
int cWidth = colWidth[ cIdx ],
rHeight = rowHeight[ rIdx ];
+
+ if( coverPageMode && item->pageNumber() == 0 ) // align widget right inside viewport
+ insertX+=cWidth;
+
// center widget inside 'cells'
item->moveTo( insertX + (cWidth - item->width()) / 2,
insertY + (rHeight - item->height()) / 2 );
@@ -1776,14 +1789,24 @@ void PageView::slotRelayoutPages()
// 2) hide all widgets except the displayable ones and dispose those
int insertX = 0;
cIdx = 0;
+
+ if( coverPageMode && (int)d->document->currentPage() == 0 )
+ ++cIdx;
+
for ( iIt = d->items.begin(); iIt != iEnd; ++iIt )
{
PageViewItem * item = *iIt;
if ( item == currentItem || (cIdx > 0 && cIdx < nCols) )
{
- // center widget inside 'cells'
- item->moveTo( insertX + (colWidth[ cIdx ] - item->width()) / 2,
- (fullHeight - item->height()) / 2 );
+ if( KpdfSettings::viewCoverPage() && (int)d->document->currentPage() == 0 ) {
+ // center widget inside viewport
+ item->moveTo( insertX + (viewportWidth - item->width()) / 2,
+ (viewportHeight - item->height()) / 2 );
+ } else {
+ // center widget inside 'cells'
+ item->moveTo( insertX + (colWidth[ cIdx ] - item->width()) / 2,
+ (fullHeight - item->height()) / 2 );
+ }
// advance col index
insertX += colWidth[ cIdx ];
cIdx++;
@@ -2110,6 +2133,8 @@ void PageView::slotTwoPagesToggled( bool on )
if ( d->document->pages() > 0 )
slotRelayoutPages();
}
+
+ d->aViewCoverPage->setEnabled( on );
}
void PageView::slotContinuousToggled( bool on )
@@ -2123,6 +2148,17 @@ void PageView::slotContinuousToggled( bool on )
}
}
+void PageView::slotCoverPageToggled( bool on )
+{
+ if ( KpdfSettings::viewCoverPage() != on )
+ {
+ KpdfSettings::setViewCoverPage( on );
+ KpdfSettings::writeConfig();
+ if ( d->document->pages() > 0 )
+ slotRelayoutPages();
+ }
+}
+
void PageView::slotSetMouseNormal()
{
d->mouseMode = MouseNormal;
diff --git a/kpdf/ui/pageview.h b/kpdf/ui/pageview.h
index 901ec9e6..267c58f5 100644
--- a/kpdf/ui/pageview.h
+++ b/kpdf/ui/pageview.h
@@ -140,6 +140,7 @@ class PageView : public TQScrollView, public DocumentObserver
void slotRotateLeft();
void slotTwoPagesToggled( bool );
void slotContinuousToggled( bool );
+ void slotCoverPageToggled( bool );
void slotSetMouseNormal();
void slotSetMouseZoom();
void slotSetMouseSelect();
diff --git a/kpdf/xpdf/fofi/CMakeLists.txt b/kpdf/xpdf/fofi/CMakeLists.txt
index e98957f3..2f983315 100644
--- a/kpdf/xpdf/fofi/CMakeLists.txt
+++ b/kpdf/xpdf/fofi/CMakeLists.txt
@@ -21,6 +21,6 @@ include_directories(
tde_add_library( fofi STATIC_PIC
SOURCES
- FoFiBase.cc FoFiEncodings.cc FoFiTrueType.cc FoFiType1.cc
- FoFiType1C.cc
+ FoFiBase.cpp FoFiEncodings.cpp FoFiTrueType.cpp FoFiType1.cpp
+ FoFiType1C.cpp
)
diff --git a/kpdf/xpdf/fofi/FoFiBase.cc b/kpdf/xpdf/fofi/FoFiBase.cc
deleted file mode 100644
index 28d0b8ca..00000000
--- a/kpdf/xpdf/fofi/FoFiBase.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-//========================================================================
-//
-// FoFiBase.cc
-//
-// Copyright 1999-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include "gmem.h"
-#include "FoFiBase.h"
-
-//------------------------------------------------------------------------
-// FoFiBase
-//------------------------------------------------------------------------
-
-FoFiBase::FoFiBase(char *fileA, int lenA, GBool freeFileDataA) {
- fileData = file = (Guchar *)fileA;
- len = lenA;
- freeFileData = freeFileDataA;
-}
-
-FoFiBase::~FoFiBase() {
- if (freeFileData) {
- gfree(fileData);
- }
-}
-
-char *FoFiBase::readFile(char *fileName, int *fileLen) {
- FILE *f;
- char *buf;
- int n;
-
- if (!(f = fopen(fileName, "rb"))) {
- return NULL;
- }
- fseek(f, 0, SEEK_END);
- n = (int)ftell(f);
- fseek(f, 0, SEEK_SET);
- buf = (char *)gmalloc(n);
- if ((int)fread(buf, 1, n, f) != n) {
- gfree(buf);
- fclose(f);
- return NULL;
- }
- fclose(f);
- *fileLen = n;
- return buf;
-}
-
-int FoFiBase::getS8(int pos, GBool *ok) {
- int x;
-
- if (pos < 0 || pos >= len) {
- *ok = gFalse;
- return 0;
- }
- x = file[pos];
- if (x & 0x80) {
- x |= ~0xff;
- }
- return x;
-}
-
-int FoFiBase::getU8(int pos, GBool *ok) {
- if (pos < 0 || pos >= len) {
- *ok = gFalse;
- return 0;
- }
- return file[pos];
-}
-
-int FoFiBase::getS16BE(int pos, GBool *ok) {
- int x;
-
- if (pos < 0 || pos+1 >= len) {
- *ok = gFalse;
- return 0;
- }
- x = file[pos];
- x = (x << 8) + file[pos+1];
- if (x & 0x8000) {
- x |= ~0xffff;
- }
- return x;
-}
-
-int FoFiBase::getU16BE(int pos, GBool *ok) {
- int x;
-
- if (pos < 0 || pos+1 >= len) {
- *ok = gFalse;
- return 0;
- }
- x = file[pos];
- x = (x << 8) + file[pos+1];
- return x;
-}
-
-int FoFiBase::getS32BE(int pos, GBool *ok) {
- int x;
-
- if (pos < 0 || pos+3 >= len) {
- *ok = gFalse;
- return 0;
- }
- x = file[pos];
- x = (x << 8) + file[pos+1];
- x = (x << 8) + file[pos+2];
- x = (x << 8) + file[pos+3];
- if (x & 0x80000000) {
- x |= ~0xffffffff;
- }
- return x;
-}
-
-Guint FoFiBase::getU32BE(int pos, GBool *ok) {
- Guint x;
-
- if (pos < 0 || pos+3 >= len) {
- *ok = gFalse;
- return 0;
- }
- x = file[pos];
- x = (x << 8) + file[pos+1];
- x = (x << 8) + file[pos+2];
- x = (x << 8) + file[pos+3];
- return x;
-}
-
-Guint FoFiBase::getUVarBE(int pos, int size, GBool *ok) {
- Guint x;
- int i;
-
- if (pos < 0 || pos + size > len) {
- *ok = gFalse;
- return 0;
- }
- x = 0;
- for (i = 0; i < size; ++i) {
- x = (x << 8) + file[pos + i];
- }
- return x;
-}
-
-GBool FoFiBase::checkRegion(int pos, int size) {
- return pos >= 0 &&
- pos + size >= pos &&
- pos + size <= len;
-}
diff --git a/kpdf/xpdf/fofi/FoFiBase.cpp b/kpdf/xpdf/fofi/FoFiBase.cpp
new file mode 100644
index 00000000..af6fe112
--- /dev/null
+++ b/kpdf/xpdf/fofi/FoFiBase.cpp
@@ -0,0 +1,156 @@
+//========================================================================
+//
+// FoFiBase.cpp
+//
+// Copyright 1999-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include "gmem.h"
+#include "FoFiBase.h"
+
+//------------------------------------------------------------------------
+// FoFiBase
+//------------------------------------------------------------------------
+
+FoFiBase::FoFiBase(char *fileA, int lenA, GBool freeFileDataA) {
+ fileData = file = (Guchar *)fileA;
+ len = lenA;
+ freeFileData = freeFileDataA;
+}
+
+FoFiBase::~FoFiBase() {
+ if (freeFileData) {
+ gfree(fileData);
+ }
+}
+
+char *FoFiBase::readFile(char *fileName, int *fileLen) {
+ FILE *f;
+ char *buf;
+ int n;
+
+ if (!(f = fopen(fileName, "rb"))) {
+ return NULL;
+ }
+ fseek(f, 0, SEEK_END);
+ n = (int)ftell(f);
+ fseek(f, 0, SEEK_SET);
+ buf = (char *)gmalloc(n);
+ if ((int)fread(buf, 1, n, f) != n) {
+ gfree(buf);
+ fclose(f);
+ return NULL;
+ }
+ fclose(f);
+ *fileLen = n;
+ return buf;
+}
+
+int FoFiBase::getS8(int pos, GBool *ok) {
+ int x;
+
+ if (pos < 0 || pos >= len) {
+ *ok = gFalse;
+ return 0;
+ }
+ x = file[pos];
+ if (x & 0x80) {
+ x |= ~0xff;
+ }
+ return x;
+}
+
+int FoFiBase::getU8(int pos, GBool *ok) {
+ if (pos < 0 || pos >= len) {
+ *ok = gFalse;
+ return 0;
+ }
+ return file[pos];
+}
+
+int FoFiBase::getS16BE(int pos, GBool *ok) {
+ int x;
+
+ if (pos < 0 || pos+1 >= len) {
+ *ok = gFalse;
+ return 0;
+ }
+ x = file[pos];
+ x = (x << 8) + file[pos+1];
+ if (x & 0x8000) {
+ x |= ~0xffff;
+ }
+ return x;
+}
+
+int FoFiBase::getU16BE(int pos, GBool *ok) {
+ int x;
+
+ if (pos < 0 || pos+1 >= len) {
+ *ok = gFalse;
+ return 0;
+ }
+ x = file[pos];
+ x = (x << 8) + file[pos+1];
+ return x;
+}
+
+int FoFiBase::getS32BE(int pos, GBool *ok) {
+ int x;
+
+ if (pos < 0 || pos+3 >= len) {
+ *ok = gFalse;
+ return 0;
+ }
+ x = file[pos];
+ x = (x << 8) + file[pos+1];
+ x = (x << 8) + file[pos+2];
+ x = (x << 8) + file[pos+3];
+ if (x & 0x80000000) {
+ x |= ~0xffffffff;
+ }
+ return x;
+}
+
+Guint FoFiBase::getU32BE(int pos, GBool *ok) {
+ Guint x;
+
+ if (pos < 0 || pos+3 >= len) {
+ *ok = gFalse;
+ return 0;
+ }
+ x = file[pos];
+ x = (x << 8) + file[pos+1];
+ x = (x << 8) + file[pos+2];
+ x = (x << 8) + file[pos+3];
+ return x;
+}
+
+Guint FoFiBase::getUVarBE(int pos, int size, GBool *ok) {
+ Guint x;
+ int i;
+
+ if (pos < 0 || pos + size > len) {
+ *ok = gFalse;
+ return 0;
+ }
+ x = 0;
+ for (i = 0; i < size; ++i) {
+ x = (x << 8) + file[pos + i];
+ }
+ return x;
+}
+
+GBool FoFiBase::checkRegion(int pos, int size) {
+ return pos >= 0 &&
+ pos + size >= pos &&
+ pos + size <= len;
+}
diff --git a/kpdf/xpdf/fofi/FoFiEncodings.cc b/kpdf/xpdf/fofi/FoFiEncodings.cc
deleted file mode 100644
index 37a17f5d..00000000
--- a/kpdf/xpdf/fofi/FoFiEncodings.cc
+++ /dev/null
@@ -1,994 +0,0 @@
-//========================================================================
-//
-// FoFiEncodings.cc
-//
-// Copyright 1999-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include "FoFiEncodings.h"
-
-//------------------------------------------------------------------------
-// Type 1 and 1C font data
-//------------------------------------------------------------------------
-
-char *fofiType1StandardEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quoteright",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
- "bracketright",
- "asciicircum",
- "underscore",
- "quoteleft",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
- "braceright",
- "asciitilde",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdown",
- "cent",
- "sterling",
- "fraction",
- "yen",
- "florin",
- "section",
- "currency",
- "quotesingle",
- "quotedblleft",
- "guillemotleft",
- "guilsinglleft",
- "guilsinglright",
- "fi",
- "fl",
- NULL,
- "endash",
- "dagger",
- "daggerdbl",
- "periodcentered",
- NULL,
- "paragraph",
- "bullet",
- "quotesinglbase",
- "quotedblbase",
- "quotedblright",
- "guillemotright",
- "ellipsis",
- "perthousand",
- NULL,
- "questiondown",
- NULL,
- "grave",
- "acute",
- "circumflex",
- "tilde",
- "macron",
- "breve",
- "dotaccent",
- "dieresis",
- NULL,
- "ring",
- "cedilla",
- NULL,
- "hungarumlaut",
- "ogonek",
- "caron",
- "emdash",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "AE",
- NULL,
- "ordfeminine",
- NULL,
- NULL,
- NULL,
- NULL,
- "Lslash",
- "Oslash",
- "OE",
- "ordmasculine",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "ae",
- NULL,
- NULL,
- NULL,
- "dotlessi",
- NULL,
- NULL,
- "lslash",
- "oslash",
- "oe",
- "germandbls",
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-char *fofiType1ExpertEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclamsmall",
- "Hungarumlautsmall",
- NULL,
- "dollaroldstyle",
- "dollarsuperior",
- "ampersandsmall",
- "Acutesmall",
- "parenleftsuperior",
- "parenrightsuperior",
- "twodotenleader",
- "onedotenleader",
- "comma",
- "hyphen",
- "period",
- "fraction",
- "zerooldstyle",
- "oneoldstyle",
- "twooldstyle",
- "threeoldstyle",
- "fouroldstyle",
- "fiveoldstyle",
- "sixoldstyle",
- "sevenoldstyle",
- "eightoldstyle",
- "nineoldstyle",
- "colon",
- "semicolon",
- "commasuperior",
- "threequartersemdash",
- "periodsuperior",
- "questionsmall",
- NULL,
- "asuperior",
- "bsuperior",
- "centsuperior",
- "dsuperior",
- "esuperior",
- NULL,
- NULL,
- NULL,
- "isuperior",
- NULL,
- NULL,
- "lsuperior",
- "msuperior",
- "nsuperior",
- "osuperior",
- NULL,
- NULL,
- "rsuperior",
- "ssuperior",
- "tsuperior",
- NULL,
- "ff",
- "fi",
- "fl",
- "ffi",
- "ffl",
- "parenleftinferior",
- NULL,
- "parenrightinferior",
- "Circumflexsmall",
- "hyphensuperior",
- "Gravesmall",
- "Asmall",
- "Bsmall",
- "Csmall",
- "Dsmall",
- "Esmall",
- "Fsmall",
- "Gsmall",
- "Hsmall",
- "Ismall",
- "Jsmall",
- "Ksmall",
- "Lsmall",
- "Msmall",
- "Nsmall",
- "Osmall",
- "Psmall",
- "Qsmall",
- "Rsmall",
- "Ssmall",
- "Tsmall",
- "Usmall",
- "Vsmall",
- "Wsmall",
- "Xsmall",
- "Ysmall",
- "Zsmall",
- "colonmonetary",
- "onefitted",
- "rupiah",
- "Tildesmall",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdownsmall",
- "centoldstyle",
- "Lslashsmall",
- NULL,
- NULL,
- "Scaronsmall",
- "Zcaronsmall",
- "Dieresissmall",
- "Brevesmall",
- "Caronsmall",
- NULL,
- "Dotaccentsmall",
- NULL,
- NULL,
- "Macronsmall",
- NULL,
- NULL,
- "figuredash",
- "hypheninferior",
- NULL,
- NULL,
- "Ogoneksmall",
- "Ringsmall",
- "Cedillasmall",
- NULL,
- NULL,
- NULL,
- "onequarter",
- "onehalf",
- "threequarters",
- "questiondownsmall",
- "oneeighth",
- "threeeighths",
- "fiveeighths",
- "seveneighths",
- "onethird",
- "twothirds",
- NULL,
- NULL,
- "zerosuperior",
- "onesuperior",
- "twosuperior",
- "threesuperior",
- "foursuperior",
- "fivesuperior",
- "sixsuperior",
- "sevensuperior",
- "eightsuperior",
- "ninesuperior",
- "zeroinferior",
- "oneinferior",
- "twoinferior",
- "threeinferior",
- "fourinferior",
- "fiveinferior",
- "sixinferior",
- "seveninferior",
- "eightinferior",
- "nineinferior",
- "centinferior",
- "dollarinferior",
- "periodinferior",
- "commainferior",
- "Agravesmall",
- "Aacutesmall",
- "Acircumflexsmall",
- "Atildesmall",
- "Adieresissmall",
- "Aringsmall",
- "AEsmall",
- "Ccedillasmall",
- "Egravesmall",
- "Eacutesmall",
- "Ecircumflexsmall",
- "Edieresissmall",
- "Igravesmall",
- "Iacutesmall",
- "Icircumflexsmall",
- "Idieresissmall",
- "Ethsmall",
- "Ntildesmall",
- "Ogravesmall",
- "Oacutesmall",
- "Ocircumflexsmall",
- "Otildesmall",
- "Odieresissmall",
- "OEsmall",
- "Oslashsmall",
- "Ugravesmall",
- "Uacutesmall",
- "Ucircumflexsmall",
- "Udieresissmall",
- "Yacutesmall",
- "Thornsmall",
- "Ydieresissmall"
-};
-
-//------------------------------------------------------------------------
-// Type 1C font data
-//------------------------------------------------------------------------
-
-char *fofiType1CStdStrings[391] = {
- ".notdef",
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quoteright",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
- "bracketright",
- "asciicircum",
- "underscore",
- "quoteleft",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
- "braceright",
- "asciitilde",
- "exclamdown",
- "cent",
- "sterling",
- "fraction",
- "yen",
- "florin",
- "section",
- "currency",
- "quotesingle",
- "quotedblleft",
- "guillemotleft",
- "guilsinglleft",
- "guilsinglright",
- "fi",
- "fl",
- "endash",
- "dagger",
- "daggerdbl",
- "periodcentered",
- "paragraph",
- "bullet",
- "quotesinglbase",
- "quotedblbase",
- "quotedblright",
- "guillemotright",
- "ellipsis",
- "perthousand",
- "questiondown",
- "grave",
- "acute",
- "circumflex",
- "tilde",
- "macron",
- "breve",
- "dotaccent",
- "dieresis",
- "ring",
- "cedilla",
- "hungarumlaut",
- "ogonek",
- "caron",
- "emdash",
- "AE",
- "ordfeminine",
- "Lslash",
- "Oslash",
- "OE",
- "ordmasculine",
- "ae",
- "dotlessi",
- "lslash",
- "oslash",
- "oe",
- "germandbls",
- "onesuperior",
- "logicalnot",
- "mu",
- "trademark",
- "Eth",
- "onehalf",
- "plusminus",
- "Thorn",
- "onequarter",
- "divide",
- "brokenbar",
- "degree",
- "thorn",
- "threequarters",
- "twosuperior",
- "registered",
- "minus",
- "eth",
- "multiply",
- "threesuperior",
- "copyright",
- "Aacute",
- "Acircumflex",
- "Adieresis",
- "Agrave",
- "Aring",
- "Atilde",
- "Ccedilla",
- "Eacute",
- "Ecircumflex",
- "Edieresis",
- "Egrave",
- "Iacute",
- "Icircumflex",
- "Idieresis",
- "Igrave",
- "Ntilde",
- "Oacute",
- "Ocircumflex",
- "Odieresis",
- "Ograve",
- "Otilde",
- "Scaron",
- "Uacute",
- "Ucircumflex",
- "Udieresis",
- "Ugrave",
- "Yacute",
- "Ydieresis",
- "Zcaron",
- "aacute",
- "acircumflex",
- "adieresis",
- "agrave",
- "aring",
- "atilde",
- "ccedilla",
- "eacute",
- "ecircumflex",
- "edieresis",
- "egrave",
- "iacute",
- "icircumflex",
- "idieresis",
- "igrave",
- "ntilde",
- "oacute",
- "ocircumflex",
- "odieresis",
- "ograve",
- "otilde",
- "scaron",
- "uacute",
- "ucircumflex",
- "udieresis",
- "ugrave",
- "yacute",
- "ydieresis",
- "zcaron",
- "exclamsmall",
- "Hungarumlautsmall",
- "dollaroldstyle",
- "dollarsuperior",
- "ampersandsmall",
- "Acutesmall",
- "parenleftsuperior",
- "parenrightsuperior",
- "twodotenleader",
- "onedotenleader",
- "zerooldstyle",
- "oneoldstyle",
- "twooldstyle",
- "threeoldstyle",
- "fouroldstyle",
- "fiveoldstyle",
- "sixoldstyle",
- "sevenoldstyle",
- "eightoldstyle",
- "nineoldstyle",
- "commasuperior",
- "threequartersemdash",
- "periodsuperior",
- "questionsmall",
- "asuperior",
- "bsuperior",
- "centsuperior",
- "dsuperior",
- "esuperior",
- "isuperior",
- "lsuperior",
- "msuperior",
- "nsuperior",
- "osuperior",
- "rsuperior",
- "ssuperior",
- "tsuperior",
- "ff",
- "ffi",
- "ffl",
- "parenleftinferior",
- "parenrightinferior",
- "Circumflexsmall",
- "hyphensuperior",
- "Gravesmall",
- "Asmall",
- "Bsmall",
- "Csmall",
- "Dsmall",
- "Esmall",
- "Fsmall",
- "Gsmall",
- "Hsmall",
- "Ismall",
- "Jsmall",
- "Ksmall",
- "Lsmall",
- "Msmall",
- "Nsmall",
- "Osmall",
- "Psmall",
- "Qsmall",
- "Rsmall",
- "Ssmall",
- "Tsmall",
- "Usmall",
- "Vsmall",
- "Wsmall",
- "Xsmall",
- "Ysmall",
- "Zsmall",
- "colonmonetary",
- "onefitted",
- "rupiah",
- "Tildesmall",
- "exclamdownsmall",
- "centoldstyle",
- "Lslashsmall",
- "Scaronsmall",
- "Zcaronsmall",
- "Dieresissmall",
- "Brevesmall",
- "Caronsmall",
- "Dotaccentsmall",
- "Macronsmall",
- "figuredash",
- "hypheninferior",
- "Ogoneksmall",
- "Ringsmall",
- "Cedillasmall",
- "questiondownsmall",
- "oneeighth",
- "threeeighths",
- "fiveeighths",
- "seveneighths",
- "onethird",
- "twothirds",
- "zerosuperior",
- "foursuperior",
- "fivesuperior",
- "sixsuperior",
- "sevensuperior",
- "eightsuperior",
- "ninesuperior",
- "zeroinferior",
- "oneinferior",
- "twoinferior",
- "threeinferior",
- "fourinferior",
- "fiveinferior",
- "sixinferior",
- "seveninferior",
- "eightinferior",
- "nineinferior",
- "centinferior",
- "dollarinferior",
- "periodinferior",
- "commainferior",
- "Agravesmall",
- "Aacutesmall",
- "Acircumflexsmall",
- "Atildesmall",
- "Adieresissmall",
- "Aringsmall",
- "AEsmall",
- "Ccedillasmall",
- "Egravesmall",
- "Eacutesmall",
- "Ecircumflexsmall",
- "Edieresissmall",
- "Igravesmall",
- "Iacutesmall",
- "Icircumflexsmall",
- "Idieresissmall",
- "Ethsmall",
- "Ntildesmall",
- "Ogravesmall",
- "Oacutesmall",
- "Ocircumflexsmall",
- "Otildesmall",
- "Odieresissmall",
- "OEsmall",
- "Oslashsmall",
- "Ugravesmall",
- "Uacutesmall",
- "Ucircumflexsmall",
- "Udieresissmall",
- "Yacutesmall",
- "Thornsmall",
- "Ydieresissmall",
- "001.000",
- "001.001",
- "001.002",
- "001.003",
- "Black",
- "Bold",
- "Book",
- "Light",
- "Medium",
- "Regular",
- "Roman",
- "Semibold"
-};
-
-Gushort fofiType1CISOAdobeCharset[229] = {
- 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
-};
-
-Gushort fofiType1CExpertCharset[166] = {
- 0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
- 243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
- 251, 252, 253, 254, 255, 256, 257, 258, 259, 260,
- 261, 262, 263, 264, 265, 266, 109, 110, 267, 268,
- 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
- 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
- 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
- 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,
- 158, 155, 163, 319, 320, 321, 322, 323, 324, 325,
- 326, 150, 164, 169, 327, 328, 329, 330, 331, 332,
- 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
- 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
- 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
- 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
- 373, 374, 375, 376, 377, 378
-};
-
-Gushort fofiType1CExpertSubsetCharset[87] = {
- 0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
- 15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
- 247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
- 256, 257, 258, 259, 260, 261, 262, 263, 264, 265,
- 266, 109, 110, 267, 268, 269, 270, 272, 300, 301,
- 302, 305, 314, 315, 158, 155, 163, 320, 321, 322,
- 323, 324, 325, 326, 150, 164, 169, 327, 328, 329,
- 330, 331, 332, 333, 334, 335, 336, 337, 338, 339,
- 340, 341, 342, 343, 344, 345, 346
-};
diff --git a/kpdf/xpdf/fofi/FoFiEncodings.cpp b/kpdf/xpdf/fofi/FoFiEncodings.cpp
new file mode 100644
index 00000000..3c0d39a3
--- /dev/null
+++ b/kpdf/xpdf/fofi/FoFiEncodings.cpp
@@ -0,0 +1,994 @@
+//========================================================================
+//
+// FoFiEncodings.cpp
+//
+// Copyright 1999-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include "FoFiEncodings.h"
+
+//------------------------------------------------------------------------
+// Type 1 and 1C font data
+//------------------------------------------------------------------------
+
+char *fofiType1StandardEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotesingle",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ NULL,
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ NULL,
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ NULL,
+ "questiondown",
+ NULL,
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ NULL,
+ "ring",
+ "cedilla",
+ NULL,
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "AE",
+ NULL,
+ "ordfeminine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ae",
+ NULL,
+ NULL,
+ NULL,
+ "dotlessi",
+ NULL,
+ NULL,
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+char *fofiType1ExpertEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclamsmall",
+ "Hungarumlautsmall",
+ NULL,
+ "dollaroldstyle",
+ "dollarsuperior",
+ "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior",
+ "parenrightsuperior",
+ "twodotenleader",
+ "onedotenleader",
+ "comma",
+ "hyphen",
+ "period",
+ "fraction",
+ "zerooldstyle",
+ "oneoldstyle",
+ "twooldstyle",
+ "threeoldstyle",
+ "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle",
+ "sevenoldstyle",
+ "eightoldstyle",
+ "nineoldstyle",
+ "colon",
+ "semicolon",
+ "commasuperior",
+ "threequartersemdash",
+ "periodsuperior",
+ "questionsmall",
+ NULL,
+ "asuperior",
+ "bsuperior",
+ "centsuperior",
+ "dsuperior",
+ "esuperior",
+ NULL,
+ NULL,
+ NULL,
+ "isuperior",
+ NULL,
+ NULL,
+ "lsuperior",
+ "msuperior",
+ "nsuperior",
+ "osuperior",
+ NULL,
+ NULL,
+ "rsuperior",
+ "ssuperior",
+ "tsuperior",
+ NULL,
+ "ff",
+ "fi",
+ "fl",
+ "ffi",
+ "ffl",
+ "parenleftinferior",
+ NULL,
+ "parenrightinferior",
+ "Circumflexsmall",
+ "hyphensuperior",
+ "Gravesmall",
+ "Asmall",
+ "Bsmall",
+ "Csmall",
+ "Dsmall",
+ "Esmall",
+ "Fsmall",
+ "Gsmall",
+ "Hsmall",
+ "Ismall",
+ "Jsmall",
+ "Ksmall",
+ "Lsmall",
+ "Msmall",
+ "Nsmall",
+ "Osmall",
+ "Psmall",
+ "Qsmall",
+ "Rsmall",
+ "Ssmall",
+ "Tsmall",
+ "Usmall",
+ "Vsmall",
+ "Wsmall",
+ "Xsmall",
+ "Ysmall",
+ "Zsmall",
+ "colonmonetary",
+ "onefitted",
+ "rupiah",
+ "Tildesmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdownsmall",
+ "centoldstyle",
+ "Lslashsmall",
+ NULL,
+ NULL,
+ "Scaronsmall",
+ "Zcaronsmall",
+ "Dieresissmall",
+ "Brevesmall",
+ "Caronsmall",
+ NULL,
+ "Dotaccentsmall",
+ NULL,
+ NULL,
+ "Macronsmall",
+ NULL,
+ NULL,
+ "figuredash",
+ "hypheninferior",
+ NULL,
+ NULL,
+ "Ogoneksmall",
+ "Ringsmall",
+ "Cedillasmall",
+ NULL,
+ NULL,
+ NULL,
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "questiondownsmall",
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ "onethird",
+ "twothirds",
+ NULL,
+ NULL,
+ "zerosuperior",
+ "onesuperior",
+ "twosuperior",
+ "threesuperior",
+ "foursuperior",
+ "fivesuperior",
+ "sixsuperior",
+ "sevensuperior",
+ "eightsuperior",
+ "ninesuperior",
+ "zeroinferior",
+ "oneinferior",
+ "twoinferior",
+ "threeinferior",
+ "fourinferior",
+ "fiveinferior",
+ "sixinferior",
+ "seveninferior",
+ "eightinferior",
+ "nineinferior",
+ "centinferior",
+ "dollarinferior",
+ "periodinferior",
+ "commainferior",
+ "Agravesmall",
+ "Aacutesmall",
+ "Acircumflexsmall",
+ "Atildesmall",
+ "Adieresissmall",
+ "Aringsmall",
+ "AEsmall",
+ "Ccedillasmall",
+ "Egravesmall",
+ "Eacutesmall",
+ "Ecircumflexsmall",
+ "Edieresissmall",
+ "Igravesmall",
+ "Iacutesmall",
+ "Icircumflexsmall",
+ "Idieresissmall",
+ "Ethsmall",
+ "Ntildesmall",
+ "Ogravesmall",
+ "Oacutesmall",
+ "Ocircumflexsmall",
+ "Otildesmall",
+ "Odieresissmall",
+ "OEsmall",
+ "Oslashsmall",
+ "Ugravesmall",
+ "Uacutesmall",
+ "Ucircumflexsmall",
+ "Udieresissmall",
+ "Yacutesmall",
+ "Thornsmall",
+ "Ydieresissmall"
+};
+
+//------------------------------------------------------------------------
+// Type 1C font data
+//------------------------------------------------------------------------
+
+char *fofiType1CStdStrings[391] = {
+ ".notdef",
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotesingle",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ "questiondown",
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ "ring",
+ "cedilla",
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ "AE",
+ "ordfeminine",
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ "ae",
+ "dotlessi",
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ "onesuperior",
+ "logicalnot",
+ "mu",
+ "trademark",
+ "Eth",
+ "onehalf",
+ "plusminus",
+ "Thorn",
+ "onequarter",
+ "divide",
+ "brokenbar",
+ "degree",
+ "thorn",
+ "threequarters",
+ "twosuperior",
+ "registered",
+ "minus",
+ "eth",
+ "multiply",
+ "threesuperior",
+ "copyright",
+ "Aacute",
+ "Acircumflex",
+ "Adieresis",
+ "Agrave",
+ "Aring",
+ "Atilde",
+ "Ccedilla",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Egrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Igrave",
+ "Ntilde",
+ "Oacute",
+ "Ocircumflex",
+ "Odieresis",
+ "Ograve",
+ "Otilde",
+ "Scaron",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Ugrave",
+ "Yacute",
+ "Ydieresis",
+ "Zcaron",
+ "aacute",
+ "acircumflex",
+ "adieresis",
+ "agrave",
+ "aring",
+ "atilde",
+ "ccedilla",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "egrave",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "igrave",
+ "ntilde",
+ "oacute",
+ "ocircumflex",
+ "odieresis",
+ "ograve",
+ "otilde",
+ "scaron",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "ugrave",
+ "yacute",
+ "ydieresis",
+ "zcaron",
+ "exclamsmall",
+ "Hungarumlautsmall",
+ "dollaroldstyle",
+ "dollarsuperior",
+ "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior",
+ "parenrightsuperior",
+ "twodotenleader",
+ "onedotenleader",
+ "zerooldstyle",
+ "oneoldstyle",
+ "twooldstyle",
+ "threeoldstyle",
+ "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle",
+ "sevenoldstyle",
+ "eightoldstyle",
+ "nineoldstyle",
+ "commasuperior",
+ "threequartersemdash",
+ "periodsuperior",
+ "questionsmall",
+ "asuperior",
+ "bsuperior",
+ "centsuperior",
+ "dsuperior",
+ "esuperior",
+ "isuperior",
+ "lsuperior",
+ "msuperior",
+ "nsuperior",
+ "osuperior",
+ "rsuperior",
+ "ssuperior",
+ "tsuperior",
+ "ff",
+ "ffi",
+ "ffl",
+ "parenleftinferior",
+ "parenrightinferior",
+ "Circumflexsmall",
+ "hyphensuperior",
+ "Gravesmall",
+ "Asmall",
+ "Bsmall",
+ "Csmall",
+ "Dsmall",
+ "Esmall",
+ "Fsmall",
+ "Gsmall",
+ "Hsmall",
+ "Ismall",
+ "Jsmall",
+ "Ksmall",
+ "Lsmall",
+ "Msmall",
+ "Nsmall",
+ "Osmall",
+ "Psmall",
+ "Qsmall",
+ "Rsmall",
+ "Ssmall",
+ "Tsmall",
+ "Usmall",
+ "Vsmall",
+ "Wsmall",
+ "Xsmall",
+ "Ysmall",
+ "Zsmall",
+ "colonmonetary",
+ "onefitted",
+ "rupiah",
+ "Tildesmall",
+ "exclamdownsmall",
+ "centoldstyle",
+ "Lslashsmall",
+ "Scaronsmall",
+ "Zcaronsmall",
+ "Dieresissmall",
+ "Brevesmall",
+ "Caronsmall",
+ "Dotaccentsmall",
+ "Macronsmall",
+ "figuredash",
+ "hypheninferior",
+ "Ogoneksmall",
+ "Ringsmall",
+ "Cedillasmall",
+ "questiondownsmall",
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ "onethird",
+ "twothirds",
+ "zerosuperior",
+ "foursuperior",
+ "fivesuperior",
+ "sixsuperior",
+ "sevensuperior",
+ "eightsuperior",
+ "ninesuperior",
+ "zeroinferior",
+ "oneinferior",
+ "twoinferior",
+ "threeinferior",
+ "fourinferior",
+ "fiveinferior",
+ "sixinferior",
+ "seveninferior",
+ "eightinferior",
+ "nineinferior",
+ "centinferior",
+ "dollarinferior",
+ "periodinferior",
+ "commainferior",
+ "Agravesmall",
+ "Aacutesmall",
+ "Acircumflexsmall",
+ "Atildesmall",
+ "Adieresissmall",
+ "Aringsmall",
+ "AEsmall",
+ "Ccedillasmall",
+ "Egravesmall",
+ "Eacutesmall",
+ "Ecircumflexsmall",
+ "Edieresissmall",
+ "Igravesmall",
+ "Iacutesmall",
+ "Icircumflexsmall",
+ "Idieresissmall",
+ "Ethsmall",
+ "Ntildesmall",
+ "Ogravesmall",
+ "Oacutesmall",
+ "Ocircumflexsmall",
+ "Otildesmall",
+ "Odieresissmall",
+ "OEsmall",
+ "Oslashsmall",
+ "Ugravesmall",
+ "Uacutesmall",
+ "Ucircumflexsmall",
+ "Udieresissmall",
+ "Yacutesmall",
+ "Thornsmall",
+ "Ydieresissmall",
+ "001.000",
+ "001.001",
+ "001.002",
+ "001.003",
+ "Black",
+ "Bold",
+ "Book",
+ "Light",
+ "Medium",
+ "Regular",
+ "Roman",
+ "Semibold"
+};
+
+Gushort fofiType1CISOAdobeCharset[229] = {
+ 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
+};
+
+Gushort fofiType1CExpertCharset[166] = {
+ 0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
+ 237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
+ 243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
+ 251, 252, 253, 254, 255, 256, 257, 258, 259, 260,
+ 261, 262, 263, 264, 265, 266, 109, 110, 267, 268,
+ 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
+ 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
+ 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
+ 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,
+ 158, 155, 163, 319, 320, 321, 322, 323, 324, 325,
+ 326, 150, 164, 169, 327, 328, 329, 330, 331, 332,
+ 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
+ 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
+ 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
+ 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
+ 373, 374, 375, 376, 377, 378
+};
+
+Gushort fofiType1CExpertSubsetCharset[87] = {
+ 0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
+ 15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
+ 247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
+ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265,
+ 266, 109, 110, 267, 268, 269, 270, 272, 300, 301,
+ 302, 305, 314, 315, 158, 155, 163, 320, 321, 322,
+ 323, 324, 325, 326, 150, 164, 169, 327, 328, 329,
+ 330, 331, 332, 333, 334, 335, 336, 337, 338, 339,
+ 340, 341, 342, 343, 344, 345, 346
+};
diff --git a/kpdf/xpdf/fofi/FoFiTrueType.cc b/kpdf/xpdf/fofi/FoFiTrueType.cc
deleted file mode 100644
index a205a068..00000000
--- a/kpdf/xpdf/fofi/FoFiTrueType.cc
+++ /dev/null
@@ -1,2040 +0,0 @@
-//========================================================================
-//
-// FoFiTrueType.cc
-//
-// Copyright 1999-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gtypes.h"
-#include "gmem.h"
-#include "GString.h"
-#include "GHash.h"
-#include "FoFiType1C.h"
-#include "FoFiTrueType.h"
-
-//
-// Terminology
-// -----------
-//
-// character code = number used as an element of a text string
-//
-// character name = glyph name = name for a particular glyph within a
-// font
-//
-// glyph index = GID = position (within some internal table in the font)
-// where the instructions to draw a particular glyph are
-// stored
-//
-// Type 1 fonts
-// ------------
-//
-// Type 1 fonts contain:
-//
-// Encoding: array of glyph names, maps char codes to glyph names
-//
-// Encoding[charCode] = charName
-//
-// CharStrings: dictionary of instructions, keyed by character names,
-// maps character name to glyph data
-//
-// CharStrings[charName] = glyphData
-//
-// TrueType fonts
-// --------------
-//
-// TrueType fonts contain:
-//
-// 'cmap' table: mapping from character code to glyph index; there may
-// be multiple cmaps in a TrueType font
-//
-// cmap[charCode] = gid
-//
-// 'post' table: mapping from glyph index to glyph name
-//
-// post[gid] = glyphName
-//
-// Type 42 fonts
-// -------------
-//
-// Type 42 fonts contain:
-//
-// Encoding: array of glyph names, maps char codes to glyph names
-//
-// Encoding[charCode] = charName
-//
-// CharStrings: dictionary of glyph indexes, keyed by character names,
-// maps character name to glyph index
-//
-// CharStrings[charName] = gid
-//
-
-//------------------------------------------------------------------------
-
-#define ttcfTag 0x74746366
-
-//------------------------------------------------------------------------
-
-struct TrueTypeTable {
- Guint tag;
- Guint checksum;
- int offset;
- int origOffset;
- int len;
-};
-
-struct TrueTypeCmap {
- int platform;
- int encoding;
- int offset;
- int len;
- int fmt;
-};
-
-struct TrueTypeLoca {
- int idx;
- int origOffset;
- int newOffset;
- int len;
-};
-
-#define cmapTag 0x636d6170
-#define glyfTag 0x676c7966
-#define headTag 0x68656164
-#define hheaTag 0x68686561
-#define hmtxTag 0x686d7478
-#define locaTag 0x6c6f6361
-#define nameTag 0x6e616d65
-#define os2Tag 0x4f532f32
-#define postTag 0x706f7374
-
-static int cmpTrueTypeLocaOffset(const void *p1, const void *p2) {
- TrueTypeLoca *loca1 = (TrueTypeLoca *)p1;
- TrueTypeLoca *loca2 = (TrueTypeLoca *)p2;
-
- if (loca1->origOffset == loca2->origOffset) {
- return loca1->idx - loca2->idx;
- }
- return loca1->origOffset - loca2->origOffset;
-}
-
-static int cmpTrueTypeLocaIdx(const void *p1, const void *p2) {
- TrueTypeLoca *loca1 = (TrueTypeLoca *)p1;
- TrueTypeLoca *loca2 = (TrueTypeLoca *)p2;
-
- return loca1->idx - loca2->idx;
-}
-
-static int cmpTrueTypeTableTag(const void *p1, const void *p2) {
- TrueTypeTable *tab1 = (TrueTypeTable *)p1;
- TrueTypeTable *tab2 = (TrueTypeTable *)p2;
-
- return (int)tab1->tag - (int)tab2->tag;
-}
-
-//------------------------------------------------------------------------
-
-struct T42Table {
- char *tag; // 4-byte tag
- GBool required; // required by the TrueType spec?
-};
-
-// TrueType tables to be embedded in Type 42 fonts.
-// NB: the table names must be in alphabetical order here.
-#define nT42Tables 11
-static T42Table t42Tables[nT42Tables] = {
- { "cvt ", gTrue },
- { "fpgm", gTrue },
- { "glyf", gTrue },
- { "head", gTrue },
- { "hhea", gTrue },
- { "hmtx", gTrue },
- { "loca", gTrue },
- { "maxp", gTrue },
- { "prep", gTrue },
- { "vhea", gFalse },
- { "vmtx", gFalse }
-};
-#define t42HeadTable 3
-#define t42LocaTable 6
-#define t42GlyfTable 2
-#define t42VheaTable 9
-#define t42VmtxTable 10
-
-//------------------------------------------------------------------------
-
-// Glyph names in some arbitrary standard order that Apple uses for
-// their TrueType fonts.
-static char *macGlyphNames[258] = {
- ".notdef", "null", "CR", "space",
- "exclam", "quotedbl", "numbersign", "dollar",
- "percent", "ampersand", "quotesingle", "parenleft",
- "parenright", "asterisk", "plus", "comma",
- "hyphen", "period", "slash", "zero",
- "one", "two", "three", "four",
- "five", "six", "seven", "eight",
- "nine", "colon", "semicolon", "less",
- "equal", "greater", "question", "at",
- "A", "B", "C", "D",
- "E", "F", "G", "H",
- "I", "J", "K", "L",
- "M", "N", "O", "P",
- "Q", "R", "S", "T",
- "U", "V", "W", "X",
- "Y", "Z", "bracketleft", "backslash",
- "bracketright", "asciicircum", "underscore", "grave",
- "a", "b", "c", "d",
- "e", "f", "g", "h",
- "i", "j", "k", "l",
- "m", "n", "o", "p",
- "q", "r", "s", "t",
- "u", "v", "w", "x",
- "y", "z", "braceleft", "bar",
- "braceright", "asciitilde", "Adieresis", "Aring",
- "Ccedilla", "Eacute", "Ntilde", "Odieresis",
- "Udieresis", "aacute", "agrave", "acircumflex",
- "adieresis", "atilde", "aring", "ccedilla",
- "eacute", "egrave", "ecircumflex", "edieresis",
- "iacute", "igrave", "icircumflex", "idieresis",
- "ntilde", "oacute", "ograve", "ocircumflex",
- "odieresis", "otilde", "uacute", "ugrave",
- "ucircumflex", "udieresis", "dagger", "degree",
- "cent", "sterling", "section", "bullet",
- "paragraph", "germandbls", "registered", "copyright",
- "trademark", "acute", "dieresis", "notequal",
- "AE", "Oslash", "infinity", "plusminus",
- "lessequal", "greaterequal", "yen", "mu1",
- "partialdiff", "summation", "product", "pi",
- "integral", "ordfeminine", "ordmasculine", "Ohm",
- "ae", "oslash", "questiondown", "exclamdown",
- "logicalnot", "radical", "florin", "approxequal",
- "increment", "guillemotleft", "guillemotright", "ellipsis",
- "nbspace", "Agrave", "Atilde", "Otilde",
- "OE", "oe", "endash", "emdash",
- "quotedblleft", "quotedblright", "quoteleft", "quoteright",
- "divide", "lozenge", "ydieresis", "Ydieresis",
- "fraction", "currency", "guilsinglleft", "guilsinglright",
- "fi", "fl", "daggerdbl", "periodcentered",
- "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex",
- "Ecircumflex", "Aacute", "Edieresis", "Egrave",
- "Iacute", "Icircumflex", "Idieresis", "Igrave",
- "Oacute", "Ocircumflex", "applelogo", "Ograve",
- "Uacute", "Ucircumflex", "Ugrave", "dotlessi",
- "circumflex", "tilde", "overscore", "breve",
- "dotaccent", "ring", "cedilla", "hungarumlaut",
- "ogonek", "caron", "Lslash", "lslash",
- "Scaron", "scaron", "Zcaron", "zcaron",
- "brokenbar", "Eth", "eth", "Yacute",
- "yacute", "Thorn", "thorn", "minus",
- "multiply", "onesuperior", "twosuperior", "threesuperior",
- "onehalf", "onequarter", "threequarters", "franc",
- "Gbreve", "gbreve", "Idot", "Scedilla",
- "scedilla", "Cacute", "cacute", "Ccaron",
- "ccaron", "dmacron"
-};
-
-//------------------------------------------------------------------------
-// FoFiTrueType
-//------------------------------------------------------------------------
-
-FoFiTrueType *FoFiTrueType::make(char *fileA, int lenA, int faceIndexA) {
- FoFiTrueType *ff;
-
- ff = new FoFiTrueType(fileA, lenA, gFalse, faceIndexA);
- if (!ff->parsedOk) {
- delete ff;
- return NULL;
- }
- return ff;
-}
-
-FoFiTrueType *FoFiTrueType::load(char *fileName, int faceIndexA) {
- FoFiTrueType *ff;
- char *fileA;
- int lenA;
-
- if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
- return NULL;
- }
- ff = new FoFiTrueType(fileA, lenA, gTrue, faceIndexA);
- if (!ff->parsedOk) {
- delete ff;
- return NULL;
- }
- return ff;
-}
-
-FoFiTrueType::FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA, int faceIndexA):
- FoFiBase(fileA, lenA, freeFileDataA)
-{
- tables = NULL;
- nTables = 0;
- cmaps = NULL;
- nCmaps = 0;
- nameToGID = NULL;
- parsedOk = gFalse;
- faceIndex = faceIndexA;
-
- parse();
-}
-
-FoFiTrueType::~FoFiTrueType() {
- gfree(tables);
- gfree(cmaps);
- if (nameToGID) {
- delete nameToGID;
- }
-}
-
-int FoFiTrueType::getNumCmaps() {
- return nCmaps;
-}
-
-int FoFiTrueType::getCmapPlatform(int i) {
- return cmaps[i].platform;
-}
-
-int FoFiTrueType::getCmapEncoding(int i) {
- return cmaps[i].encoding;
-}
-
-int FoFiTrueType::findCmap(int platform, int encoding) {
- int i;
-
- for (i = 0; i < nCmaps; ++i) {
- if (cmaps[i].platform == platform && cmaps[i].encoding == encoding) {
- return i;
- }
- }
- return -1;
-}
-
-Gushort FoFiTrueType::mapCodeToGID(int i, int c) {
- Gushort gid;
- int segCnt, segEnd, segStart, segDelta, segOffset;
- int cmapFirst, cmapLen;
- int pos, a, b, m;
- GBool ok;
-
- if (i < 0 || i >= nCmaps) {
- return 0;
- }
- ok = gTrue;
- pos = cmaps[i].offset;
- switch (cmaps[i].fmt) {
- case 0:
- if (c < 0 || c >= cmaps[i].len - 6) {
- return 0;
- }
- gid = getU8(cmaps[i].offset + 6 + c, &ok);
- break;
- case 4:
- segCnt = getU16BE(pos + 6, &ok) / 2;
- a = -1;
- b = segCnt - 1;
- segEnd = getU16BE(pos + 14 + 2*b, &ok);
- if (c > segEnd) {
- // malformed font -- the TrueType spec requires the last segEnd
- // to be 0xffff
- return 0;
- }
- // invariant: seg[a].end < code <= seg[b].end
- while (b - a > 1 && ok) {
- m = (a + b) / 2;
- segEnd = getU16BE(pos + 14 + 2*m, &ok);
- if (segEnd < c) {
- a = m;
- } else {
- b = m;
- }
- }
- segStart = getU16BE(pos + 16 + 2*segCnt + 2*b, &ok);
- segDelta = getU16BE(pos + 16 + 4*segCnt + 2*b, &ok);
- segOffset = getU16BE(pos + 16 + 6*segCnt + 2*b, &ok);
- if (c < segStart) {
- return 0;
- }
- if (segOffset == 0) {
- gid = (c + segDelta) & 0xffff;
- } else {
- gid = getU16BE(pos + 16 + 6*segCnt + 2*b +
- segOffset + 2 * (c - segStart), &ok);
- if (gid != 0) {
- gid = (gid + segDelta) & 0xffff;
- }
- }
- break;
- case 6:
- cmapFirst = getU16BE(pos + 6, &ok);
- cmapLen = getU16BE(pos + 8, &ok);
- if (c < cmapFirst || c >= cmapFirst + cmapLen) {
- return 0;
- }
- gid = getU16BE(pos + 10 + 2 * (c - cmapFirst), &ok);
- break;
- default:
- return 0;
- }
- if (!ok) {
- return 0;
- }
- return gid;
-}
-
-int FoFiTrueType::mapNameToGID(char *name) {
- if (!nameToGID) {
- return 0;
- }
- return nameToGID->lookupInt(name);
-}
-
-Gushort *FoFiTrueType::getCIDToGIDMap(int *nCIDs) {
- FoFiType1C *ff;
- Gushort *map;
- int i;
-
- *nCIDs = 0;
- if (!openTypeCFF) {
- return NULL;
- }
- i = seekTable("CFF ");
- if (!checkRegion(tables[i].offset, tables[i].len)) {
- return NULL;
- }
- if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
- tables[i].len))) {
- return NULL;
- }
- map = ff->getCIDToGIDMap(nCIDs);
- delete ff;
- return map;
-}
-
-int FoFiTrueType::getEmbeddingRights() {
- int i, fsType;
- GBool ok;
-
- if ((i = seekTable("OS/2")) < 0) {
- return 4;
- }
- ok = gTrue;
- fsType = getU16BE(tables[i].offset + 8, &ok);
- if (!ok) {
- return 4;
- }
- if (fsType & 0x0008) {
- return 2;
- }
- if (fsType & 0x0004) {
- return 1;
- }
- if (fsType & 0x0002) {
- return 0;
- }
- return 3;
-}
-
-void FoFiTrueType::convertToType42(char *psName, char **encoding,
- Gushort *codeToGID,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- GString *buf;
- GBool ok;
-
- if (openTypeCFF) {
- return;
- }
-
- // write the header
- ok = gTrue;
- buf = GString::format("%!PS-TrueTypeFont-{0:2g}\n",
- (double)getS32BE(0, &ok) / 65536.0);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
-
- // begin the font dictionary
- (*outputFunc)(outputStream, "10 dict begin\n", 14);
- (*outputFunc)(outputStream, "/FontName /", 11);
- (*outputFunc)(outputStream, psName, strlen(psName));
- (*outputFunc)(outputStream, " def\n", 5);
- (*outputFunc)(outputStream, "/FontType 42 def\n", 17);
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- buf = GString::format("/FontBBox [{0:d} {1:d} {2:d} {3:d}] def\n",
- bbox[0], bbox[1], bbox[2], bbox[3]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/PaintType 0 def\n", 17);
-
- // write the guts of the dictionary
- cvtEncoding(encoding, outputFunc, outputStream);
- cvtCharStrings(encoding, codeToGID, outputFunc, outputStream);
- cvtSfnts(outputFunc, outputStream, NULL, gFalse);
-
- // end the dictionary and define the font
- (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
-}
-
-void FoFiTrueType::convertToType1(char *psName, char **newEncoding,
- GBool ascii, FoFiOutputFunc outputFunc,
- void *outputStream) {
- FoFiType1C *ff;
- int i;
-
- if (!openTypeCFF) {
- return;
- }
- i = seekTable("CFF ");
- if (!checkRegion(tables[i].offset, tables[i].len)) {
- return;
- }
- if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
- tables[i].len))) {
- return;
- }
- ff->convertToType1(psName, newEncoding, ascii, outputFunc, outputStream);
- delete ff;
-}
-
-void FoFiTrueType::convertToCIDType2(char *psName,
- Gushort *cidMap, int nCIDs,
- GBool needVerticalMetrics,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- GString *buf;
- Gushort cid;
- GBool ok;
- int i, j, k;
-
- if (openTypeCFF) {
- return;
- }
-
- // write the header
- ok = gTrue;
- buf = GString::format("%!PS-TrueTypeFont-{0:2g}\n",
- (double)getS32BE(0, &ok) / 65536.0);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
-
- // begin the font dictionary
- (*outputFunc)(outputStream, "20 dict begin\n", 14);
- (*outputFunc)(outputStream, "/CIDFontName /", 14);
- (*outputFunc)(outputStream, psName, strlen(psName));
- (*outputFunc)(outputStream, " def\n", 5);
- (*outputFunc)(outputStream, "/CIDFontType 2 def\n", 19);
- (*outputFunc)(outputStream, "/FontType 42 def\n", 17);
- (*outputFunc)(outputStream, "/CIDSystemInfo 3 dict dup begin\n", 32);
- (*outputFunc)(outputStream, " /Registry (Adobe) def\n", 24);
- (*outputFunc)(outputStream, " /Ordering (Identity) def\n", 27);
- (*outputFunc)(outputStream, " /Supplement 0 def\n", 20);
- (*outputFunc)(outputStream, " end def\n", 10);
- (*outputFunc)(outputStream, "/GDBytes 2 def\n", 15);
- if (cidMap) {
- buf = GString::format("/CIDCount {0:d} def\n", nCIDs);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- if (nCIDs > 32767) {
- (*outputFunc)(outputStream, "/CIDMap [", 9);
- for (i = 0; i < nCIDs; i += 32768 - 16) {
- (*outputFunc)(outputStream, "<\n", 2);
- for (j = 0; j < 32768 - 16 && i+j < nCIDs; j += 16) {
- (*outputFunc)(outputStream, " ", 2);
- for (k = 0; k < 16 && i+j+k < nCIDs; ++k) {
- cid = cidMap[i+j+k];
- buf = GString::format("{0:02x}{1:02x}",
- (cid >> 8) & 0xff, cid & 0xff);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "\n", 1);
- }
- (*outputFunc)(outputStream, " >", 3);
- }
- (*outputFunc)(outputStream, "\n", 1);
- (*outputFunc)(outputStream, "] def\n", 6);
- } else {
- (*outputFunc)(outputStream, "/CIDMap <\n", 10);
- for (i = 0; i < nCIDs; i += 16) {
- (*outputFunc)(outputStream, " ", 2);
- for (j = 0; j < 16 && i+j < nCIDs; ++j) {
- cid = cidMap[i+j];
- buf = GString::format("{0:02x}{1:02x}",
- (cid >> 8) & 0xff, cid & 0xff);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "\n", 1);
- }
- (*outputFunc)(outputStream, "> def\n", 6);
- }
- } else {
- // direct mapping - just fill the string(s) with s[i]=i
- buf = GString::format("/CIDCount {0:d} def\n", nGlyphs);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- if (nGlyphs > 32767) {
- (*outputFunc)(outputStream, "/CIDMap [\n", 10);
- for (i = 0; i < nGlyphs; i += 32767) {
- j = nGlyphs - i < 32767 ? nGlyphs - i : 32767;
- buf = GString::format(" {0:d} string 0 1 {1:d} {{\n", 2 * j, j - 1);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format(" 2 copy dup 2 mul exch {0:d} add -8 bitshift put\n",
- i);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format(" 1 index exch dup 2 mul 1 add exch {0:d} add"
- " 255 and put\n", i);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, " } for\n", 8);
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- } else {
- buf = GString::format("/CIDMap {0:d} string\n", 2 * nGlyphs);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format(" 0 1 {0:d} {{\n", nGlyphs - 1);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream,
- " 2 copy dup 2 mul exch -8 bitshift put\n", 42);
- (*outputFunc)(outputStream,
- " 1 index exch dup 2 mul 1 add exch 255 and put\n", 50);
- (*outputFunc)(outputStream, " } for\n", 8);
- (*outputFunc)(outputStream, "def\n", 4);
- }
- }
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- buf = GString::format("/FontBBox [{0:d} {1:d} {2:d} {3:d}] def\n",
- bbox[0], bbox[1], bbox[2], bbox[3]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/PaintType 0 def\n", 17);
- (*outputFunc)(outputStream, "/Encoding [] readonly def\n", 26);
- (*outputFunc)(outputStream, "/CharStrings 1 dict dup begin\n", 30);
- (*outputFunc)(outputStream, " /.notdef 0 def\n", 17);
- (*outputFunc)(outputStream, " end readonly def\n", 19);
-
- // write the guts of the dictionary
- cvtSfnts(outputFunc, outputStream, NULL, needVerticalMetrics);
-
- // end the dictionary and define the font
- (*outputFunc)(outputStream,
- "CIDFontName currentdict end /CIDFont defineresource pop\n",
- 56);
-}
-
-void FoFiTrueType::convertToCIDType0(char *psName,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- FoFiType1C *ff;
- int i;
-
- if (!openTypeCFF) {
- return;
- }
- i = seekTable("CFF ");
- if (!checkRegion(tables[i].offset, tables[i].len)) {
- return;
- }
- if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
- tables[i].len))) {
- return;
- }
- ff->convertToCIDType0(psName, outputFunc, outputStream);
- delete ff;
-}
-
-void FoFiTrueType::convertToType0(char *psName, Gushort *cidMap, int nCIDs,
- GBool needVerticalMetrics,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- GString *buf;
- GString *sfntsName;
- int n, i, j;
-
- if (openTypeCFF) {
- return;
- }
-
- // write the Type 42 sfnts array
- sfntsName = (new GString(psName))->append("_sfnts");
- cvtSfnts(outputFunc, outputStream, sfntsName, needVerticalMetrics);
- delete sfntsName;
-
- // write the descendant Type 42 fonts
- n = cidMap ? nCIDs : nGlyphs;
- for (i = 0; i < n; i += 256) {
- (*outputFunc)(outputStream, "10 dict begin\n", 14);
- (*outputFunc)(outputStream, "/FontName /", 11);
- (*outputFunc)(outputStream, psName, strlen(psName));
- buf = GString::format("_{0:02x} def\n", i >> 8);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/FontType 42 def\n", 17);
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- buf = GString::format("/FontBBox [{0:d} {1:d} {2:d} {3:d}] def\n",
- bbox[0], bbox[1], bbox[2], bbox[3]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/PaintType 0 def\n", 17);
- (*outputFunc)(outputStream, "/sfnts ", 7);
- (*outputFunc)(outputStream, psName, strlen(psName));
- (*outputFunc)(outputStream, "_sfnts def\n", 11);
- (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
- for (j = 0; j < 256 && i+j < n; ++j) {
- buf = GString::format("dup {0:d} /c{1:02x} put\n", j, j);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "readonly def\n", 13);
- (*outputFunc)(outputStream, "/CharStrings 257 dict dup begin\n", 32);
- (*outputFunc)(outputStream, "/.notdef 0 def\n", 15);
- for (j = 0; j < 256 && i+j < n; ++j) {
- buf = GString::format("/c{0:02x} {1:d} def\n",
- j, cidMap ? cidMap[i+j] : i+j);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "end readonly def\n", 17);
- (*outputFunc)(outputStream,
- "FontName currentdict end definefont pop\n", 40);
- }
-
- // write the Type 0 parent font
- (*outputFunc)(outputStream, "16 dict begin\n", 14);
- (*outputFunc)(outputStream, "/FontName /", 11);
- (*outputFunc)(outputStream, psName, strlen(psName));
- (*outputFunc)(outputStream, " def\n", 5);
- (*outputFunc)(outputStream, "/FontType 0 def\n", 16);
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- (*outputFunc)(outputStream, "/FMapType 2 def\n", 16);
- (*outputFunc)(outputStream, "/Encoding [\n", 12);
- for (i = 0; i < n; i += 256) {
- buf = GString::format("{0:d}\n", i >> 8);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- (*outputFunc)(outputStream, "/FDepVector [\n", 14);
- for (i = 0; i < n; i += 256) {
- (*outputFunc)(outputStream, "/", 1);
- (*outputFunc)(outputStream, psName, strlen(psName));
- buf = GString::format("_{0:02x} findfont\n", i >> 8);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
-}
-
-void FoFiTrueType::convertToType0(char *psName,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- FoFiType1C *ff;
- int i;
-
- if (!openTypeCFF) {
- return;
- }
- i = seekTable("CFF ");
- if (!checkRegion(tables[i].offset, tables[i].len)) {
- return;
- }
- if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
- tables[i].len))) {
- return;
- }
- ff->convertToType0(psName, outputFunc, outputStream);
- delete ff;
-}
-
-void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
- void *outputStream, char *name,
- Gushort *codeToGID) {
- // this substitute cmap table maps char codes 0000-ffff directly to
- // glyphs 0000-ffff
- static char cmapTab[36] = {
- 0, 0, // table version number
- 0, 1, // number of encoding tables
- 0, 1, // platform ID
- 0, 0, // encoding ID
- 0, 0, 0, 12, // offset of subtable
- 0, 4, // subtable format
- 0, 24, // subtable length
- 0, 0, // subtable version
- 0, 2, // segment count * 2
- 0, 2, // 2 * 2 ^ floor(log2(segCount))
- 0, 0, // floor(log2(segCount))
- 0, 0, // 2*segCount - 2*2^floor(log2(segCount))
- (char)0xff, (char)0xff, // endCount[0]
- 0, 0, // reserved
- 0, 0, // startCount[0]
- 0, 0, // idDelta[0]
- 0, 0 // pad to a mulitple of four bytes
- };
- static char nameTab[8] = {
- 0, 0, // format
- 0, 0, // number of name records
- 0, 6, // offset to start of string storage
- 0, 0 // pad to multiple of four bytes
- };
- static char postTab[32] = {
- 0, 1, 0, 0, // format
- 0, 0, 0, 0, // italic angle
- 0, 0, // underline position
- 0, 0, // underline thickness
- 0, 0, 0, 0, // fixed pitch
- 0, 0, 0, 0, // min Type 42 memory
- 0, 0, 0, 0, // max Type 42 memory
- 0, 0, 0, 0, // min Type 1 memory
- 0, 0, 0, 0 // max Type 1 memory
- };
- static char os2Tab[86] = {
- 0, 1, // version
- 0, 1, // xAvgCharWidth
- 0, 0, // usWeightClass
- 0, 0, // usWidthClass
- 0, 0, // fsType
- 0, 0, // ySubscriptXSize
- 0, 0, // ySubscriptYSize
- 0, 0, // ySubscriptXOffset
- 0, 0, // ySubscriptYOffset
- 0, 0, // ySuperscriptXSize
- 0, 0, // ySuperscriptYSize
- 0, 0, // ySuperscriptXOffset
- 0, 0, // ySuperscriptYOffset
- 0, 0, // yStrikeoutSize
- 0, 0, // yStrikeoutPosition
- 0, 0, // sFamilyClass
- 0, 0, 0, 0, 0, // panose
- 0, 0, 0, 0, 0,
- 0, 0, 0, 0, // ulUnicodeRange1
- 0, 0, 0, 0, // ulUnicodeRange2
- 0, 0, 0, 0, // ulUnicodeRange3
- 0, 0, 0, 0, // ulUnicodeRange4
- 0, 0, 0, 0, // achVendID
- 0, 0, // fsSelection
- 0, 0, // usFirstCharIndex
- 0, 0, // usLastCharIndex
- 0, 0, // sTypoAscender
- 0, 0, // sTypoDescender
- 0, 0, // sTypoLineGap
- 0, 0, // usWinAscent
- 0, 0, // usWinDescent
- 0, 0, 0, 0, // ulCodePageRange1
- 0, 0, 0, 0 // ulCodePageRange2
- };
- GBool missingCmap, missingName, missingPost, missingOS2;
- GBool unsortedLoca, badCmapLen, abbrevHMTX;
- int nZeroLengthTables;
- int nHMetrics, advWidth, lsb;
- TrueTypeLoca *locaTable;
- TrueTypeTable *newTables;
- char *newNameTab, *newCmapTab, *newHHEATab, *newHMTXTab;
- int nNewTables, cmapIdx, cmapLen, glyfLen, newNameLen, newCmapLen, next;
- int newHHEALen, newHMTXLen;
- Guint locaChecksum, glyfChecksum, fileChecksum;
- char *tableDir;
- char locaBuf[4], checksumBuf[4];
- GBool ok;
- Guint t;
- int pos, i, j, k, n;
-
- if (openTypeCFF) {
- return;
- }
-
- // check for missing tables
- // (Note: if the OS/2 table is missing, the Microsoft PCL5 driver
- // will embed a PCL TrueType font with the pitch field set to zero,
- // which apparently causes divide-by-zero errors. As far as I can
- // tell, the only important field in the OS/2 table is
- // xAvgCharWidth.)
- missingCmap = (cmapIdx = seekTable("cmap")) < 0;
- missingName = seekTable("name") < 0;
- missingPost = seekTable("post") < 0;
- missingOS2 = seekTable("OS/2") < 0;
-
- // read the loca table, check to see if it's sorted
- locaTable = (TrueTypeLoca *)gmallocn(nGlyphs + 1, sizeof(TrueTypeLoca));
- unsortedLoca = gFalse;
- i = seekTable("loca");
- pos = tables[i].offset;
- ok = gTrue;
- for (i = 0; i <= nGlyphs; ++i) {
- if (locaFmt) {
- locaTable[i].origOffset = (int)getU32BE(pos + i*4, &ok);
- } else {
- locaTable[i].origOffset = 2 * getU16BE(pos + i*2, &ok);
- }
- if (i > 0 && locaTable[i].origOffset < locaTable[i-1].origOffset) {
- unsortedLoca = gTrue;
- }
- // glyph descriptions must be at least 12 bytes long (nContours,
- // xMin, yMin, xMax, yMax, instructionLength - two bytes each);
- // invalid glyph descriptions (even if they're never used) make
- // Windows choke, so we work around that problem here (ideally,
- // this would parse the glyph descriptions in the glyf table and
- // remove any that were invalid, but this quick test is a decent
- // start)
- if (i > 0 &&
- locaTable[i].origOffset - locaTable[i-1].origOffset > 0 &&
- locaTable[i].origOffset - locaTable[i-1].origOffset < 12) {
- locaTable[i-1].origOffset = locaTable[i].origOffset;
- unsortedLoca = gTrue;
- }
- locaTable[i].idx = i;
- }
-
- // check for zero-length tables
- nZeroLengthTables = 0;
- for (i = 0; i < nTables; ++i) {
- if (tables[i].len == 0) {
- ++nZeroLengthTables;
- }
- }
-
- // check for an incorrect cmap table length
- badCmapLen = gFalse;
- cmapLen = 0; // make gcc happy
- if (!missingCmap) {
- cmapLen = cmaps[0].offset + cmaps[0].len;
- for (i = 1; i < nCmaps; ++i) {
- if (cmaps[i].offset + cmaps[i].len > cmapLen) {
- cmapLen = cmaps[i].offset + cmaps[i].len;
- }
- }
- cmapLen -= tables[cmapIdx].offset;
- if (cmapLen > tables[cmapIdx].len) {
- badCmapLen = gTrue;
- }
- }
-
- // check for an abbreviated hmtx table (this is completely legal,
- // but confuses the Microsoft PCL5 printer driver, which generates
- // embedded fonts with the pitch field set to zero)
- i = seekTable("hhea");
- nHMetrics = getU16BE(tables[i].offset + 34, &ok);
- abbrevHMTX = nHMetrics < nGlyphs;
-
- // if nothing is broken, just write the TTF file as is
- if (!missingCmap && !missingName && !missingPost && !missingOS2 &&
- !unsortedLoca && !badCmapLen && !abbrevHMTX && nZeroLengthTables == 0 &&
- !name && !codeToGID) {
- (*outputFunc)(outputStream, (char *)file, len);
- goto done1;
- }
-
- // sort the 'loca' table: some (non-compliant) fonts have
- // out-of-order loca tables; in order to correctly handle the case
- // where (compliant) fonts have empty entries in the middle of the
- // table, cmpTrueTypeLocaOffset uses offset as its primary sort key,
- // and idx as its secondary key (ensuring that adjacent entries with
- // the same pos value remain in the same order)
- glyfLen = 0; // make gcc happy
- if (unsortedLoca) {
- qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
- &cmpTrueTypeLocaOffset);
- for (i = 0; i < nGlyphs; ++i) {
- locaTable[i].len = locaTable[i+1].origOffset - locaTable[i].origOffset;
- }
- locaTable[nGlyphs].len = 0;
- qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
- &cmpTrueTypeLocaIdx);
- pos = 0;
- for (i = 0; i <= nGlyphs; ++i) {
- locaTable[i].newOffset = pos;
- pos += locaTable[i].len;
- if (pos & 3) {
- pos += 4 - (pos & 3);
- }
- }
- glyfLen = pos;
- }
-
- // compute checksums for the loca and glyf tables
- locaChecksum = glyfChecksum = 0;
- if (unsortedLoca) {
- if (locaFmt) {
- for (j = 0; j <= nGlyphs; ++j) {
- locaChecksum += locaTable[j].newOffset;
- }
- } else {
- for (j = 0; j <= nGlyphs; j += 2) {
- locaChecksum += locaTable[j].newOffset << 16;
- if (j + 1 <= nGlyphs) {
- locaChecksum += locaTable[j+1].newOffset;
- }
- }
- }
- pos = tables[seekTable("glyf")].offset;
- for (j = 0; j < nGlyphs; ++j) {
- n = locaTable[j].len;
- if (n > 0) {
- k = locaTable[j].origOffset;
- if (checkRegion(pos + k, n)) {
- glyfChecksum += computeTableChecksum(file + pos + k, n);
- }
- }
- }
- }
-
- // construct the new name table
- if (name) {
- n = strlen(name);
- newNameLen = (6 + 4*12 + 2 * (3*n + 7) + 3) & ~3;
- newNameTab = (char *)gmalloc(newNameLen);
- memset(newNameTab, 0, newNameLen);
- newNameTab[0] = 0; // format selector
- newNameTab[1] = 0;
- newNameTab[2] = 0; // number of name records
- newNameTab[3] = 4;
- newNameTab[4] = 0; // offset to start of string storage
- newNameTab[5] = 6 + 4*12;
- next = 0;
- for (i = 0; i < 4; ++i) {
- newNameTab[6 + i*12 + 0] = 0; // platform ID = Microsoft
- newNameTab[6 + i*12 + 1] = 3;
- newNameTab[6 + i*12 + 2] = 0; // encoding ID = Unicode
- newNameTab[6 + i*12 + 3] = 1;
- newNameTab[6 + i*12 + 4] = 0x04; // language ID = American English
- newNameTab[6 + i*12 + 5] = 0x09;
- newNameTab[6 + i*12 + 6] = 0; // name ID
- newNameTab[6 + i*12 + 7] = i + 1;
- newNameTab[6 + i*12 + 8] = i+1 == 2 ? 0 : ((2*n) >> 8); // string length
- newNameTab[6 + i*12 + 9] = i+1 == 2 ? 14 : ((2*n) & 0xff);
- newNameTab[6 + i*12 + 10] = next >> 8; // string offset
- newNameTab[6 + i*12 + 11] = next & 0xff;
- if (i+1 == 2) {
- memcpy(newNameTab + 6 + 4*12 + next, "\0R\0e\0g\0u\0l\0a\0r", 14);
- next += 14;
- } else {
- for (j = 0; j < n; ++j) {
- newNameTab[6 + 4*12 + next + 2*j] = 0;
- newNameTab[6 + 4*12 + next + 2*j + 1] = name[j];
- }
- next += 2*n;
- }
- }
- } else {
- newNameLen = 0;
- newNameTab = NULL;
- }
-
- // construct the new cmap table
- if (codeToGID) {
- newCmapLen = 44 + 256 * 2;
- newCmapTab = (char *)gmalloc(newCmapLen);
- newCmapTab[0] = 0; // table version number = 0
- newCmapTab[1] = 0;
- newCmapTab[2] = 0; // number of encoding tables = 1
- newCmapTab[3] = 1;
- newCmapTab[4] = 0; // platform ID = Microsoft
- newCmapTab[5] = 3;
- newCmapTab[6] = 0; // encoding ID = Unicode
- newCmapTab[7] = 1;
- newCmapTab[8] = 0; // offset of subtable
- newCmapTab[9] = 0;
- newCmapTab[10] = 0;
- newCmapTab[11] = 12;
- newCmapTab[12] = 0; // subtable format = 4
- newCmapTab[13] = 4;
- newCmapTab[14] = 0x02; // subtable length
- newCmapTab[15] = 0x20;
- newCmapTab[16] = 0; // subtable version = 0
- newCmapTab[17] = 0;
- newCmapTab[18] = 0; // segment count * 2
- newCmapTab[19] = 4;
- newCmapTab[20] = 0; // 2 * 2 ^ floor(log2(segCount))
- newCmapTab[21] = 4;
- newCmapTab[22] = 0; // floor(log2(segCount))
- newCmapTab[23] = 1;
- newCmapTab[24] = 0; // 2*segCount - 2*2^floor(log2(segCount))
- newCmapTab[25] = 0;
- newCmapTab[26] = 0x00; // endCount[0]
- newCmapTab[27] = (char)0xff;
- newCmapTab[28] = (char)0xff; // endCount[1]
- newCmapTab[29] = (char)0xff;
- newCmapTab[30] = 0; // reserved
- newCmapTab[31] = 0;
- newCmapTab[32] = 0x00; // startCount[0]
- newCmapTab[33] = 0x00;
- newCmapTab[34] = (char)0xff; // startCount[1]
- newCmapTab[35] = (char)0xff;
- newCmapTab[36] = 0; // idDelta[0]
- newCmapTab[37] = 0;
- newCmapTab[38] = 0; // idDelta[1]
- newCmapTab[39] = 1;
- newCmapTab[40] = 0; // idRangeOffset[0]
- newCmapTab[41] = 4;
- newCmapTab[42] = 0; // idRangeOffset[1]
- newCmapTab[43] = 0;
- for (i = 0; i < 256; ++i) {
- newCmapTab[44 + 2*i] = codeToGID[i] >> 8;
- newCmapTab[44 + 2*i + 1] = codeToGID[i] & 0xff;
- }
- } else {
- newCmapLen = 0;
- newCmapTab = NULL;
- }
-
- // generate the new hmtx table and the updated hhea table
- if (abbrevHMTX) {
- i = seekTable("hhea");
- pos = tables[i].offset;
- newHHEALen = 36;
- newHHEATab = (char *)gmalloc(newHHEALen);
- for (i = 0; i < newHHEALen; ++i) {
- newHHEATab[i] = getU8(pos++, &ok);
- }
- newHHEATab[34] = nGlyphs >> 8;
- newHHEATab[35] = nGlyphs & 0xff;
- i = seekTable("hmtx");
- pos = tables[i].offset;
- newHMTXLen = 4 * nGlyphs;
- newHMTXTab = (char *)gmalloc(newHMTXLen);
- advWidth = 0;
- for (i = 0; i < nHMetrics; ++i) {
- advWidth = getU16BE(pos, &ok);
- lsb = getU16BE(pos + 2, &ok);
- pos += 4;
- newHMTXTab[4*i ] = advWidth >> 8;
- newHMTXTab[4*i + 1] = advWidth & 0xff;
- newHMTXTab[4*i + 2] = lsb >> 8;
- newHMTXTab[4*i + 3] = lsb & 0xff;
- }
- for (; i < nGlyphs; ++i) {
- lsb = getU16BE(pos, &ok);
- pos += 2;
- newHMTXTab[4*i ] = advWidth >> 8;
- newHMTXTab[4*i + 1] = advWidth & 0xff;
- newHMTXTab[4*i + 2] = lsb >> 8;
- newHMTXTab[4*i + 3] = lsb & 0xff;
- }
- } else {
- newHHEATab = newHMTXTab = NULL;
- newHHEALen = newHMTXLen = 0; // make gcc happy
- }
-
- // construct the new table directory:
- // - keep all original tables with non-zero length
- // - fix the cmap table's length, if necessary
- // - add missing tables
- // - sort the table by tag
- // - compute new table positions, including 4-byte alignment
- // - (re)compute table checksums
- nNewTables = nTables - nZeroLengthTables +
- (missingCmap ? 1 : 0) + (missingName ? 1 : 0) +
- (missingPost ? 1 : 0) + (missingOS2 ? 1 : 0);
- newTables = (TrueTypeTable *)gmallocn(nNewTables, sizeof(TrueTypeTable));
- j = 0;
- for (i = 0; i < nTables; ++i) {
- if (tables[i].len > 0) {
- newTables[j] = tables[i];
- newTables[j].origOffset = tables[i].offset;
- if (checkRegion(tables[i].offset, newTables[i].len)) {
- newTables[j].checksum =
- computeTableChecksum(file + tables[i].offset, tables[i].len);
- if (tables[i].tag == headTag) {
- // don't include the file checksum
- newTables[j].checksum -= getU32BE(tables[i].offset + 8, &ok);
- }
- }
- if (newTables[j].tag == cmapTag && codeToGID) {
- newTables[j].len = newCmapLen;
- newTables[j].checksum = computeTableChecksum((Guchar *)newCmapTab,
- newCmapLen);
- } else if (newTables[j].tag == cmapTag && badCmapLen) {
- newTables[j].len = cmapLen;
- } else if (newTables[j].tag == locaTag && unsortedLoca) {
- newTables[j].len = (nGlyphs + 1) * (locaFmt ? 4 : 2);
- newTables[j].checksum = locaChecksum;
- } else if (newTables[j].tag == glyfTag && unsortedLoca) {
- newTables[j].len = glyfLen;
- newTables[j].checksum = glyfChecksum;
- } else if (newTables[j].tag == nameTag && name) {
- newTables[j].len = newNameLen;
- newTables[j].checksum = computeTableChecksum((Guchar *)newNameTab,
- newNameLen);
- } else if (newTables[j].tag == hheaTag && abbrevHMTX) {
- newTables[j].len = newHHEALen;
- newTables[j].checksum = computeTableChecksum((Guchar *)newHHEATab,
- newHHEALen);
- } else if (newTables[j].tag == hmtxTag && abbrevHMTX) {
- newTables[j].len = newHMTXLen;
- newTables[j].checksum = computeTableChecksum((Guchar *)newHMTXTab,
- newHMTXLen);
- }
- ++j;
- }
- }
- if (missingCmap) {
- newTables[j].tag = cmapTag;
- if (codeToGID) {
- newTables[j].checksum = computeTableChecksum((Guchar *)newCmapTab,
- newCmapLen);
- newTables[j].len = newCmapLen;
- } else {
- newTables[j].checksum = computeTableChecksum((Guchar *)cmapTab,
- sizeof(cmapTab));
- newTables[j].len = sizeof(cmapTab);
- }
- ++j;
- }
- if (missingName) {
- newTables[j].tag = nameTag;
- if (name) {
- newTables[j].checksum = computeTableChecksum((Guchar *)newNameTab,
- newNameLen);
- newTables[j].len = newNameLen;
- } else {
- newTables[j].checksum = computeTableChecksum((Guchar *)nameTab,
- sizeof(nameTab));
- newTables[j].len = sizeof(nameTab);
- }
- ++j;
- }
- if (missingPost) {
- newTables[j].tag = postTag;
- newTables[j].checksum = computeTableChecksum((Guchar *)postTab,
- sizeof(postTab));
- newTables[j].len = sizeof(postTab);
- ++j;
- }
- if (missingOS2) {
- newTables[j].tag = os2Tag;
- newTables[j].checksum = computeTableChecksum((Guchar *)os2Tab,
- sizeof(os2Tab));
- newTables[j].len = sizeof(os2Tab);
- ++j;
- }
- qsort(newTables, nNewTables, sizeof(TrueTypeTable),
- &cmpTrueTypeTableTag);
- pos = 12 + nNewTables * 16;
- for (i = 0; i < nNewTables; ++i) {
- newTables[i].offset = pos;
- pos += newTables[i].len;
- if (pos & 3) {
- pos += 4 - (pos & 3);
- }
- }
-
- // write the table directory
- tableDir = (char *)gmalloc(12 + nNewTables * 16);
- tableDir[0] = 0x00; // sfnt version
- tableDir[1] = 0x01;
- tableDir[2] = 0x00;
- tableDir[3] = 0x00;
- tableDir[4] = (char)((nNewTables >> 8) & 0xff); // numTables
- tableDir[5] = (char)(nNewTables & 0xff);
- for (i = -1, t = (Guint)nNewTables; t; ++i, t >>= 1) ;
- t = 1 << (4 + i);
- tableDir[6] = (char)((t >> 8) & 0xff); // searchRange
- tableDir[7] = (char)(t & 0xff);
- tableDir[8] = (char)((i >> 8) & 0xff); // entrySelector
- tableDir[9] = (char)(i & 0xff);
- t = nNewTables * 16 - t;
- tableDir[10] = (char)((t >> 8) & 0xff); // rangeShift
- tableDir[11] = (char)(t & 0xff);
- pos = 12;
- for (i = 0; i < nNewTables; ++i) {
- tableDir[pos ] = (char)(newTables[i].tag >> 24);
- tableDir[pos+ 1] = (char)(newTables[i].tag >> 16);
- tableDir[pos+ 2] = (char)(newTables[i].tag >> 8);
- tableDir[pos+ 3] = (char) newTables[i].tag;
- tableDir[pos+ 4] = (char)(newTables[i].checksum >> 24);
- tableDir[pos+ 5] = (char)(newTables[i].checksum >> 16);
- tableDir[pos+ 6] = (char)(newTables[i].checksum >> 8);
- tableDir[pos+ 7] = (char) newTables[i].checksum;
- tableDir[pos+ 8] = (char)(newTables[i].offset >> 24);
- tableDir[pos+ 9] = (char)(newTables[i].offset >> 16);
- tableDir[pos+10] = (char)(newTables[i].offset >> 8);
- tableDir[pos+11] = (char) newTables[i].offset;
- tableDir[pos+12] = (char)(newTables[i].len >> 24);
- tableDir[pos+13] = (char)(newTables[i].len >> 16);
- tableDir[pos+14] = (char)(newTables[i].len >> 8);
- tableDir[pos+15] = (char) newTables[i].len;
- pos += 16;
- }
- (*outputFunc)(outputStream, tableDir, 12 + nNewTables * 16);
-
- // compute the file checksum
- fileChecksum = computeTableChecksum((Guchar *)tableDir,
- 12 + nNewTables * 16);
- for (i = 0; i < nNewTables; ++i) {
- fileChecksum += newTables[i].checksum;
- }
- fileChecksum = 0xb1b0afba - fileChecksum;
-
- // write the tables
- for (i = 0; i < nNewTables; ++i) {
- if (newTables[i].tag == headTag) {
- if (checkRegion(newTables[i].origOffset, newTables[i].len)) {
- (*outputFunc)(outputStream, (char *)file + newTables[i].origOffset, 8);
- checksumBuf[0] = fileChecksum >> 24;
- checksumBuf[1] = fileChecksum >> 16;
- checksumBuf[2] = fileChecksum >> 8;
- checksumBuf[3] = fileChecksum;
- (*outputFunc)(outputStream, checksumBuf, 4);
- (*outputFunc)(outputStream,
- (char *)file + newTables[i].origOffset + 12,
- newTables[i].len - 12);
- } else {
- for (j = 0; j < newTables[i].len; ++j) {
- (*outputFunc)(outputStream, "\0", 1);
- }
- }
- } else if (newTables[i].tag == cmapTag && codeToGID) {
- (*outputFunc)(outputStream, newCmapTab, newTables[i].len);
- } else if (newTables[i].tag == cmapTag && missingCmap) {
- (*outputFunc)(outputStream, cmapTab, newTables[i].len);
- } else if (newTables[i].tag == nameTag && name) {
- (*outputFunc)(outputStream, newNameTab, newTables[i].len);
- } else if (newTables[i].tag == nameTag && missingName) {
- (*outputFunc)(outputStream, nameTab, newTables[i].len);
- } else if (newTables[i].tag == postTag && missingPost) {
- (*outputFunc)(outputStream, postTab, newTables[i].len);
- } else if (newTables[i].tag == os2Tag && missingOS2) {
- (*outputFunc)(outputStream, os2Tab, newTables[i].len);
- } else if (newTables[i].tag == hheaTag && abbrevHMTX) {
- (*outputFunc)(outputStream, newHHEATab, newTables[i].len);
- } else if (newTables[i].tag == hmtxTag && abbrevHMTX) {
- (*outputFunc)(outputStream, newHMTXTab, newTables[i].len);
- } else if (newTables[i].tag == locaTag && unsortedLoca) {
- for (j = 0; j <= nGlyphs; ++j) {
- if (locaFmt) {
- locaBuf[0] = (char)(locaTable[j].newOffset >> 24);
- locaBuf[1] = (char)(locaTable[j].newOffset >> 16);
- locaBuf[2] = (char)(locaTable[j].newOffset >> 8);
- locaBuf[3] = (char) locaTable[j].newOffset;
- (*outputFunc)(outputStream, locaBuf, 4);
- } else {
- locaBuf[0] = (char)(locaTable[j].newOffset >> 9);
- locaBuf[1] = (char)(locaTable[j].newOffset >> 1);
- (*outputFunc)(outputStream, locaBuf, 2);
- }
- }
- } else if (newTables[i].tag == glyfTag && unsortedLoca) {
- pos = tables[seekTable("glyf")].offset;
- for (j = 0; j < nGlyphs; ++j) {
- n = locaTable[j].len;
- if (n > 0) {
- k = locaTable[j].origOffset;
- if (checkRegion(pos + k, n)) {
- (*outputFunc)(outputStream, (char *)file + pos + k, n);
- } else {
- for (k = 0; k < n; ++k) {
- (*outputFunc)(outputStream, "\0", 1);
- }
- }
- if ((k = locaTable[j].len & 3)) {
- (*outputFunc)(outputStream, "\0\0\0\0", 4 - k);
- }
- }
- }
- } else {
- if (checkRegion(newTables[i].origOffset, newTables[i].len)) {
- (*outputFunc)(outputStream, (char *)file + newTables[i].origOffset,
- newTables[i].len);
- } else {
- for (j = 0; j < newTables[i].len; ++j) {
- (*outputFunc)(outputStream, "\0", 1);
- }
- }
- }
- if (newTables[i].len & 3) {
- (*outputFunc)(outputStream, "\0\0\0", 4 - (newTables[i].len & 3));
- }
- }
-
- gfree(newHMTXTab);
- gfree(newHHEATab);
- gfree(newCmapTab);
- gfree(newNameTab);
- gfree(tableDir);
- gfree(newTables);
- done1:
- gfree(locaTable);
-}
-
-void FoFiTrueType::cvtEncoding(char **encoding,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- char *name;
- GString *buf;
- int i;
-
- (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
- if (encoding) {
- for (i = 0; i < 256; ++i) {
- if (!(name = encoding[i])) {
- name = ".notdef";
- }
- buf = GString::format("dup {0:d} /", i);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, name, strlen(name));
- (*outputFunc)(outputStream, " put\n", 5);
- }
- } else {
- for (i = 0; i < 256; ++i) {
- buf = GString::format("dup {0:d} /c{1:02x} put\n", i, i);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- }
- (*outputFunc)(outputStream, "readonly def\n", 13);
-}
-
-void FoFiTrueType::cvtCharStrings(char **encoding,
- Gushort *codeToGID,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- char *name;
- GString *buf;
- char buf2[16];
- int i, k;
-
- // always define '.notdef'
- (*outputFunc)(outputStream, "/CharStrings 256 dict dup begin\n", 32);
- (*outputFunc)(outputStream, "/.notdef 0 def\n", 15);
-
- // if there's no 'cmap' table, punt
- if (nCmaps == 0) {
- goto err;
- }
-
- // map char name to glyph index:
- // 1. use encoding to map name to char code
- // 2. use codeToGID to map char code to glyph index
- // N.B. We do this in reverse order because font subsets can have
- // weird encodings that use the same character name twice, and
- // the first definition is probably the one we want.
- k = 0; // make gcc happy
- for (i = 255; i >= 0; --i) {
- if (encoding) {
- name = encoding[i];
- } else {
- sprintf(buf2, "c%02x", i);
- name = buf2;
- }
- if (name && strcmp(name, ".notdef")) {
- k = codeToGID[i];
- // note: Distiller (maybe Adobe's PS interpreter in general)
- // doesn't like TrueType fonts that have CharStrings entries
- // which point to nonexistent glyphs, hence the (k < nGlyphs)
- // test
- if (k > 0 && k < nGlyphs) {
- (*outputFunc)(outputStream, "/", 1);
- (*outputFunc)(outputStream, name, strlen(name));
- buf = GString::format(" {0:d} def\n", k);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- }
- }
-
- err:
- (*outputFunc)(outputStream, "end readonly def\n", 17);
-}
-
-void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
- void *outputStream, GString *name,
- GBool needVerticalMetrics) {
- Guchar headData[54];
- TrueTypeLoca *locaTable;
- Guchar *locaData;
- TrueTypeTable newTables[nT42Tables];
- Guchar tableDir[12 + nT42Tables*16];
- GBool ok;
- Guint checksum;
- int nNewTables;
- int length, pos, glyfPos, i, j, k;
- Guchar vheaTab[36] = {
- 0, 1, 0, 0, // table version number
- 0, 0, // ascent
- 0, 0, // descent
- 0, 0, // reserved
- 0, 0, // max advance height
- 0, 0, // min top side bearing
- 0, 0, // min bottom side bearing
- 0, 0, // y max extent
- 0, 0, // caret slope rise
- 0, 1, // caret slope run
- 0, 0, // caret offset
- 0, 0, // reserved
- 0, 0, // reserved
- 0, 0, // reserved
- 0, 0, // reserved
- 0, 0, // metric data format
- 0, 1 // number of advance heights in vmtx table
- };
- Guchar *vmtxTab;
- GBool needVhea, needVmtx;
- int advance;
-
- // construct the 'head' table, zero out the font checksum
- i = seekTable("head");
- pos = tables[i].offset;
- if (!checkRegion(pos, 54)) {
- return;
- }
- memcpy(headData, file + pos, 54);
- headData[8] = headData[9] = headData[10] = headData[11] = (Guchar)0;
-
- // read the original 'loca' table, pad entries out to 4 bytes, and
- // sort it into proper order -- some (non-compliant) fonts have
- // out-of-order loca tables; in order to correctly handle the case
- // where (compliant) fonts have empty entries in the middle of the
- // table, cmpTrueTypeLocaPos uses offset as its primary sort key,
- // and idx as its secondary key (ensuring that adjacent entries with
- // the same pos value remain in the same order)
- locaTable = (TrueTypeLoca *)gmallocn(nGlyphs + 1, sizeof(TrueTypeLoca));
- i = seekTable("loca");
- pos = tables[i].offset;
- ok = gTrue;
- for (i = 0; i <= nGlyphs; ++i) {
- locaTable[i].idx = i;
- if (locaFmt) {
- locaTable[i].origOffset = (int)getU32BE(pos + i*4, &ok);
- } else {
- locaTable[i].origOffset = 2 * getU16BE(pos + i*2, &ok);
- }
- }
- qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
- &cmpTrueTypeLocaOffset);
- for (i = 0; i < nGlyphs; ++i) {
- locaTable[i].len = locaTable[i+1].origOffset - locaTable[i].origOffset;
- }
- locaTable[nGlyphs].len = 0;
- qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
- &cmpTrueTypeLocaIdx);
- pos = 0;
- for (i = 0; i <= nGlyphs; ++i) {
- locaTable[i].newOffset = pos;
- pos += locaTable[i].len;
- if (pos & 3) {
- pos += 4 - (pos & 3);
- }
- }
-
- // construct the new 'loca' table
- locaData = (Guchar *)gmallocn(nGlyphs + 1, (locaFmt ? 4 : 2));
- for (i = 0; i <= nGlyphs; ++i) {
- pos = locaTable[i].newOffset;
- if (locaFmt) {
- locaData[4*i ] = (Guchar)(pos >> 24);
- locaData[4*i+1] = (Guchar)(pos >> 16);
- locaData[4*i+2] = (Guchar)(pos >> 8);
- locaData[4*i+3] = (Guchar) pos;
- } else {
- locaData[2*i ] = (Guchar)(pos >> 9);
- locaData[2*i+1] = (Guchar)(pos >> 1);
- }
- }
-
- // count the number of tables
- nNewTables = 0;
- for (i = 0; i < nT42Tables; ++i) {
- if (t42Tables[i].required ||
- seekTable(t42Tables[i].tag) >= 0) {
- ++nNewTables;
- }
- }
- vmtxTab = NULL; // make gcc happy
- advance = 0; // make gcc happy
- if (needVerticalMetrics) {
- needVhea = seekTable("vhea") < 0;
- needVmtx = seekTable("vmtx") < 0;
- if (needVhea || needVmtx) {
- i = seekTable("head");
- advance = getU16BE(tables[i].offset + 18, &ok); // units per em
- if (needVhea) {
- ++nNewTables;
- }
- if (needVmtx) {
- ++nNewTables;
- }
- }
- }
-
- // construct the new table headers, including table checksums
- // (pad each table out to a multiple of 4 bytes)
- pos = 12 + nNewTables*16;
- k = 0;
- for (i = 0; i < nT42Tables; ++i) {
- length = -1;
- checksum = 0; // make gcc happy
- if (i == t42HeadTable) {
- length = 54;
- checksum = computeTableChecksum(headData, 54);
- } else if (i == t42LocaTable) {
- length = (nGlyphs + 1) * (locaFmt ? 4 : 2);
- checksum = computeTableChecksum(locaData, length);
- } else if (i == t42GlyfTable) {
- length = 0;
- checksum = 0;
- glyfPos = tables[seekTable("glyf")].offset;
- for (j = 0; j < nGlyphs; ++j) {
- length += locaTable[j].len;
- if (length & 3) {
- length += 4 - (length & 3);
- }
- if (checkRegion(glyfPos + locaTable[j].origOffset, locaTable[j].len)) {
- checksum +=
- computeTableChecksum(file + glyfPos + locaTable[j].origOffset,
- locaTable[j].len);
- }
- }
- } else {
- if ((j = seekTable(t42Tables[i].tag)) >= 0) {
- length = tables[j].len;
- if (checkRegion(tables[j].offset, length)) {
- checksum = computeTableChecksum(file + tables[j].offset, length);
- }
- } else if (needVerticalMetrics && i == t42VheaTable) {
- vheaTab[10] = advance / 256; // max advance height
- vheaTab[11] = advance % 256;
- length = sizeof(vheaTab);
- checksum = computeTableChecksum(vheaTab, length);
- } else if (needVerticalMetrics && i == t42VmtxTable) {
- length = 4 + (nGlyphs - 1) * 4;
- vmtxTab = (Guchar *)gmalloc(length);
- vmtxTab[0] = advance / 256;
- vmtxTab[1] = advance % 256;
- for (j = 2; j < length; j += 2) {
- vmtxTab[j] = 0;
- vmtxTab[j+1] = 0;
- }
- checksum = computeTableChecksum(vmtxTab, length);
- } else if (t42Tables[i].required) {
- //~ error(-1, "Embedded TrueType font is missing a required table ('%s')",
- //~ t42Tables[i].tag);
- length = 0;
- checksum = 0;
- }
- }
- if (length >= 0) {
- newTables[k].tag = ((t42Tables[i].tag[0] & 0xff) << 24) |
- ((t42Tables[i].tag[1] & 0xff) << 16) |
- ((t42Tables[i].tag[2] & 0xff) << 8) |
- (t42Tables[i].tag[3] & 0xff);
- newTables[k].checksum = checksum;
- newTables[k].offset = pos;
- newTables[k].len = length;
- pos += length;
- if (pos & 3) {
- pos += 4 - (length & 3);
- }
- ++k;
- }
- }
-
- // construct the table directory
- tableDir[0] = 0x00; // sfnt version
- tableDir[1] = 0x01;
- tableDir[2] = 0x00;
- tableDir[3] = 0x00;
- tableDir[4] = 0; // numTables
- tableDir[5] = nNewTables;
- tableDir[6] = 0; // searchRange
- tableDir[7] = (Guchar)128;
- tableDir[8] = 0; // entrySelector
- tableDir[9] = 3;
- tableDir[10] = 0; // rangeShift
- tableDir[11] = (Guchar)(16 * nNewTables - 128);
- pos = 12;
- for (i = 0; i < nNewTables; ++i) {
- tableDir[pos ] = (Guchar)(newTables[i].tag >> 24);
- tableDir[pos+ 1] = (Guchar)(newTables[i].tag >> 16);
- tableDir[pos+ 2] = (Guchar)(newTables[i].tag >> 8);
- tableDir[pos+ 3] = (Guchar) newTables[i].tag;
- tableDir[pos+ 4] = (Guchar)(newTables[i].checksum >> 24);
- tableDir[pos+ 5] = (Guchar)(newTables[i].checksum >> 16);
- tableDir[pos+ 6] = (Guchar)(newTables[i].checksum >> 8);
- tableDir[pos+ 7] = (Guchar) newTables[i].checksum;
- tableDir[pos+ 8] = (Guchar)(newTables[i].offset >> 24);
- tableDir[pos+ 9] = (Guchar)(newTables[i].offset >> 16);
- tableDir[pos+10] = (Guchar)(newTables[i].offset >> 8);
- tableDir[pos+11] = (Guchar) newTables[i].offset;
- tableDir[pos+12] = (Guchar)(newTables[i].len >> 24);
- tableDir[pos+13] = (Guchar)(newTables[i].len >> 16);
- tableDir[pos+14] = (Guchar)(newTables[i].len >> 8);
- tableDir[pos+15] = (Guchar) newTables[i].len;
- pos += 16;
- }
-
- // compute the font checksum and store it in the head table
- checksum = computeTableChecksum(tableDir, 12 + nNewTables*16);
- for (i = 0; i < nNewTables; ++i) {
- checksum += newTables[i].checksum;
- }
- checksum = 0xb1b0afba - checksum; // because the TrueType spec says so
- headData[ 8] = (Guchar)(checksum >> 24);
- headData[ 9] = (Guchar)(checksum >> 16);
- headData[10] = (Guchar)(checksum >> 8);
- headData[11] = (Guchar) checksum;
-
- // start the sfnts array
- if (name) {
- (*outputFunc)(outputStream, "/", 1);
- (*outputFunc)(outputStream, name->getCString(), name->getLength());
- (*outputFunc)(outputStream, " [\n", 3);
- } else {
- (*outputFunc)(outputStream, "/sfnts [\n", 9);
- }
-
- // write the table directory
- dumpString(tableDir, 12 + nNewTables*16, outputFunc, outputStream);
-
- // write the tables
- for (i = 0; i < nNewTables; ++i) {
- if (i == t42HeadTable) {
- dumpString(headData, 54, outputFunc, outputStream);
- } else if (i == t42LocaTable) {
- length = (nGlyphs + 1) * (locaFmt ? 4 : 2);
- dumpString(locaData, length, outputFunc, outputStream);
- } else if (i == t42GlyfTable) {
- glyfPos = tables[seekTable("glyf")].offset;
- for (j = 0; j < nGlyphs; ++j) {
- if (locaTable[j].len > 0 &&
- checkRegion(glyfPos + locaTable[j].origOffset, locaTable[j].len)) {
- dumpString(file + glyfPos + locaTable[j].origOffset,
- locaTable[j].len, outputFunc, outputStream);
- }
- }
- } else {
- // length == 0 means the table is missing and the error was
- // already reported during the construction of the table
- // headers
- if ((length = newTables[i].len) > 0) {
- if ((j = seekTable(t42Tables[i].tag)) >= 0 &&
- checkRegion(tables[j].offset, tables[j].len)) {
- dumpString(file + tables[j].offset, tables[j].len,
- outputFunc, outputStream);
- } else if (needVerticalMetrics && i == t42VheaTable) {
- dumpString(vheaTab, length, outputFunc, outputStream);
- } else if (needVerticalMetrics && i == t42VmtxTable) {
- dumpString(vmtxTab, length, outputFunc, outputStream);
- gfree(vmtxTab);
- }
- }
- }
- }
-
- // end the sfnts array
- (*outputFunc)(outputStream, "] def\n", 6);
-
- gfree(locaData);
- gfree(locaTable);
-}
-
-void FoFiTrueType::dumpString(Guchar *s, int length,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- GString *buf;
- int pad, i, j;
-
- (*outputFunc)(outputStream, "<", 1);
- for (i = 0; i < length; i += 32) {
- for (j = 0; j < 32 && i+j < length; ++j) {
- buf = GString::format("{0:02x}", s[i+j] & 0xff);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (i % (65536 - 32) == 65536 - 64) {
- (*outputFunc)(outputStream, ">\n<", 3);
- } else if (i+32 < length) {
- (*outputFunc)(outputStream, "\n", 1);
- }
- }
- if (length & 3) {
- pad = 4 - (length & 3);
- for (i = 0; i < pad; ++i) {
- (*outputFunc)(outputStream, "00", 2);
- }
- }
- // add an extra zero byte because the Adobe Type 42 spec says so
- (*outputFunc)(outputStream, "00>\n", 4);
-}
-
-Guint FoFiTrueType::computeTableChecksum(Guchar *data, int length) {
- Guint checksum, word;
- int i;
-
- checksum = 0;
- for (i = 0; i+3 < length; i += 4) {
- word = ((data[i ] & 0xff) << 24) +
- ((data[i+1] & 0xff) << 16) +
- ((data[i+2] & 0xff) << 8) +
- (data[i+3] & 0xff);
- checksum += word;
- }
- if (length & 3) {
- word = 0;
- i = length & ~3;
- switch (length & 3) {
- case 3:
- word |= (data[i+2] & 0xff) << 8;
- case 2:
- word |= (data[i+1] & 0xff) << 16;
- case 1:
- word |= (data[i ] & 0xff) << 24;
- break;
- }
- checksum += word;
- }
- return checksum;
-}
-
-void FoFiTrueType::parse() {
- Guint topTag;
- int pos, ver, i, j;
-
- parsedOk = gTrue;
-
- // look for a collection (TTC)
- topTag = getU32BE(0, &parsedOk);
- if (!parsedOk) {
- return;
- }
- if (topTag == ttcfTag) {
- /* TTC font */
- int dircount;
-
- dircount = getU32BE(8, &parsedOk);
- if (!parsedOk)
- return;
- if (! dircount) {
- parsedOk = gFalse;
- return;
- }
-
- if (faceIndex >= dircount)
- faceIndex = 0;
- pos = getU32BE(12 + faceIndex * 4, &parsedOk);
- if (! parsedOk)
- return;
- } else {
- pos = 0;
- }
-
- // check the sfnt version
- ver = getU32BE(pos, &parsedOk);
- if (!parsedOk) {
- return;
- }
- openTypeCFF = ver == 0x4f54544f; // 'OTTO'
-
- // read the table directory
- nTables = getU16BE(pos + 4, &parsedOk);
- if (!parsedOk) {
- return;
- }
- tables = (TrueTypeTable *)gmallocn(nTables, sizeof(TrueTypeTable));
- pos += 12;
- for (i = 0; i < nTables; ++i) {
- tables[i].tag = getU32BE(pos, &parsedOk);
- tables[i].checksum = getU32BE(pos + 4, &parsedOk);
- tables[i].offset = (int)getU32BE(pos + 8, &parsedOk);
- tables[i].len = (int)getU32BE(pos + 12, &parsedOk);
- if (tables[i].offset + tables[i].len < tables[i].offset ||
- tables[i].offset + tables[i].len > len) {
- parsedOk = gFalse;
- }
- pos += 16;
- }
- if (!parsedOk) {
- return;
- }
-
- // check for tables that are required by both the TrueType spec and
- // the Type 42 spec
- if (seekTable("head") < 0 ||
- seekTable("hhea") < 0 ||
- seekTable("maxp") < 0 ||
- seekTable("hmtx") < 0 ||
- (!openTypeCFF && seekTable("loca") < 0) ||
- (!openTypeCFF && seekTable("glyf") < 0) ||
- (openTypeCFF && seekTable("CFF ") < 0)) {
- parsedOk = gFalse;
- return;
- }
-
- // read the cmaps
- if ((i = seekTable("cmap")) >= 0) {
- pos = tables[i].offset + 2;
- nCmaps = getU16BE(pos, &parsedOk);
- pos += 2;
- if (!parsedOk) {
- return;
- }
- cmaps = (TrueTypeCmap *)gmallocn(nCmaps, sizeof(TrueTypeCmap));
- for (j = 0; j < nCmaps; ++j) {
- cmaps[j].platform = getU16BE(pos, &parsedOk);
- cmaps[j].encoding = getU16BE(pos + 2, &parsedOk);
- cmaps[j].offset = tables[i].offset + getU32BE(pos + 4, &parsedOk);
- pos += 8;
- cmaps[j].fmt = getU16BE(cmaps[j].offset, &parsedOk);
- cmaps[j].len = getU16BE(cmaps[j].offset + 2, &parsedOk);
- }
- if (!parsedOk) {
- return;
- }
- } else {
- nCmaps = 0;
- }
-
- // get the number of glyphs from the maxp table
- i = seekTable("maxp");
- nGlyphs = getU16BE(tables[i].offset + 4, &parsedOk);
- if (!parsedOk) {
- return;
- }
-
- // get the bbox and loca table format from the head table
- i = seekTable("head");
- bbox[0] = getS16BE(tables[i].offset + 36, &parsedOk);
- bbox[1] = getS16BE(tables[i].offset + 38, &parsedOk);
- bbox[2] = getS16BE(tables[i].offset + 40, &parsedOk);
- bbox[3] = getS16BE(tables[i].offset + 42, &parsedOk);
- locaFmt = getS16BE(tables[i].offset + 50, &parsedOk);
- if (!parsedOk) {
- return;
- }
-
- // make sure the loca table is sane (correct length and entries are
- // in bounds)
- if (!openTypeCFF) {
- i = seekTable("loca");
- if (tables[i].len < 0) {
- parsedOk = gFalse;
- return;
- }
- if (tables[i].len < (nGlyphs + 1) * (locaFmt ? 4 : 2)) {
- nGlyphs = tables[i].len / (locaFmt ? 4 : 2) - 1;
- }
- for (j = 0; j <= nGlyphs; ++j) {
- if (locaFmt) {
- pos = (int)getU32BE(tables[i].offset + j*4, &parsedOk);
- } else {
- pos = getU16BE(tables[i].offset + j*2, &parsedOk);
- }
- if (pos < 0 || pos > len) {
- parsedOk = gFalse;
- }
- }
- if (!parsedOk) {
- return;
- }
- }
-
- // read the post table
- readPostTable();
-}
-
-void FoFiTrueType::readPostTable() {
- GString *name;
- int tablePos, postFmt, stringIdx, stringPos;
- GBool ok;
- int i, j, n, m;
-
- ok = gTrue;
- if ((i = seekTable("post")) < 0) {
- return;
- }
- tablePos = tables[i].offset;
- postFmt = getU32BE(tablePos, &ok);
- if (!ok) {
- goto err;
- }
- if (postFmt == 0x00010000) {
- nameToGID = new GHash(gTrue);
- for (i = 0; i < 258; ++i) {
- nameToGID->add(new GString(macGlyphNames[i]), i);
- }
- } else if (postFmt == 0x00020000) {
- nameToGID = new GHash(gTrue);
- n = getU16BE(tablePos + 32, &ok);
- if (!ok) {
- goto err;
- }
- if (n > nGlyphs) {
- n = nGlyphs;
- }
- stringIdx = 0;
- stringPos = tablePos + 34 + 2*n;
- for (i = 0; i < n; ++i) {
- j = getU16BE(tablePos + 34 + 2*i, &ok);
- if (j < 258) {
- nameToGID->removeInt(macGlyphNames[j]);
- nameToGID->add(new GString(macGlyphNames[j]), i);
- } else {
- j -= 258;
- if (j != stringIdx) {
- for (stringIdx = 0, stringPos = tablePos + 34 + 2*n;
- stringIdx < j;
- ++stringIdx, stringPos += 1 + getU8(stringPos, &ok)) ;
- if (!ok) {
- goto err;
- }
- }
- m = getU8(stringPos, &ok);
- if (!ok || !checkRegion(stringPos + 1, m)) {
- goto err;
- }
- name = new GString((char *)&file[stringPos + 1], m);
- nameToGID->removeInt(name);
- nameToGID->add(name, i);
- ++stringIdx;
- stringPos += 1 + m;
- }
- }
- } else if (postFmt == 0x00028000) {
- nameToGID = new GHash(gTrue);
- for (i = 0; i < nGlyphs; ++i) {
- j = getU8(tablePos + 32 + i, &ok);
- if (!ok) {
- goto err;
- }
- if (j < 258) {
- nameToGID->removeInt(macGlyphNames[j]);
- nameToGID->add(new GString(macGlyphNames[j]), i);
- }
- }
- }
-
- return;
-
- err:
- if (nameToGID) {
- delete nameToGID;
- nameToGID = NULL;
- }
-}
-
-int FoFiTrueType::seekTable(char *tag) {
- Guint tagI;
- int i;
-
- tagI = ((tag[0] & 0xff) << 24) |
- ((tag[1] & 0xff) << 16) |
- ((tag[2] & 0xff) << 8) |
- (tag[3] & 0xff);
- for (i = 0; i < nTables; ++i) {
- if (tables[i].tag == tagI) {
- return i;
- }
- }
- return -1;
-}
diff --git a/kpdf/xpdf/fofi/FoFiTrueType.cpp b/kpdf/xpdf/fofi/FoFiTrueType.cpp
new file mode 100644
index 00000000..18253335
--- /dev/null
+++ b/kpdf/xpdf/fofi/FoFiTrueType.cpp
@@ -0,0 +1,2040 @@
+//========================================================================
+//
+// FoFiTrueType.cpp
+//
+// Copyright 1999-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gtypes.h"
+#include "gmem.h"
+#include "GString.h"
+#include "GHash.h"
+#include "FoFiType1C.h"
+#include "FoFiTrueType.h"
+
+//
+// Terminology
+// -----------
+//
+// character code = number used as an element of a text string
+//
+// character name = glyph name = name for a particular glyph within a
+// font
+//
+// glyph index = GID = position (within some internal table in the font)
+// where the instructions to draw a particular glyph are
+// stored
+//
+// Type 1 fonts
+// ------------
+//
+// Type 1 fonts contain:
+//
+// Encoding: array of glyph names, maps char codes to glyph names
+//
+// Encoding[charCode] = charName
+//
+// CharStrings: dictionary of instructions, keyed by character names,
+// maps character name to glyph data
+//
+// CharStrings[charName] = glyphData
+//
+// TrueType fonts
+// --------------
+//
+// TrueType fonts contain:
+//
+// 'cmap' table: mapping from character code to glyph index; there may
+// be multiple cmaps in a TrueType font
+//
+// cmap[charCode] = gid
+//
+// 'post' table: mapping from glyph index to glyph name
+//
+// post[gid] = glyphName
+//
+// Type 42 fonts
+// -------------
+//
+// Type 42 fonts contain:
+//
+// Encoding: array of glyph names, maps char codes to glyph names
+//
+// Encoding[charCode] = charName
+//
+// CharStrings: dictionary of glyph indexes, keyed by character names,
+// maps character name to glyph index
+//
+// CharStrings[charName] = gid
+//
+
+//------------------------------------------------------------------------
+
+#define ttcfTag 0x74746366
+
+//------------------------------------------------------------------------
+
+struct TrueTypeTable {
+ Guint tag;
+ Guint checksum;
+ int offset;
+ int origOffset;
+ int len;
+};
+
+struct TrueTypeCmap {
+ int platform;
+ int encoding;
+ int offset;
+ int len;
+ int fmt;
+};
+
+struct TrueTypeLoca {
+ int idx;
+ int origOffset;
+ int newOffset;
+ int len;
+};
+
+#define cmapTag 0x636d6170
+#define glyfTag 0x676c7966
+#define headTag 0x68656164
+#define hheaTag 0x68686561
+#define hmtxTag 0x686d7478
+#define locaTag 0x6c6f6361
+#define nameTag 0x6e616d65
+#define os2Tag 0x4f532f32
+#define postTag 0x706f7374
+
+static int cmpTrueTypeLocaOffset(const void *p1, const void *p2) {
+ TrueTypeLoca *loca1 = (TrueTypeLoca *)p1;
+ TrueTypeLoca *loca2 = (TrueTypeLoca *)p2;
+
+ if (loca1->origOffset == loca2->origOffset) {
+ return loca1->idx - loca2->idx;
+ }
+ return loca1->origOffset - loca2->origOffset;
+}
+
+static int cmpTrueTypeLocaIdx(const void *p1, const void *p2) {
+ TrueTypeLoca *loca1 = (TrueTypeLoca *)p1;
+ TrueTypeLoca *loca2 = (TrueTypeLoca *)p2;
+
+ return loca1->idx - loca2->idx;
+}
+
+static int cmpTrueTypeTableTag(const void *p1, const void *p2) {
+ TrueTypeTable *tab1 = (TrueTypeTable *)p1;
+ TrueTypeTable *tab2 = (TrueTypeTable *)p2;
+
+ return (int)tab1->tag - (int)tab2->tag;
+}
+
+//------------------------------------------------------------------------
+
+struct T42Table {
+ char *tag; // 4-byte tag
+ GBool required; // required by the TrueType spec?
+};
+
+// TrueType tables to be embedded in Type 42 fonts.
+// NB: the table names must be in alphabetical order here.
+#define nT42Tables 11
+static T42Table t42Tables[nT42Tables] = {
+ { "cvt ", gTrue },
+ { "fpgm", gTrue },
+ { "glyf", gTrue },
+ { "head", gTrue },
+ { "hhea", gTrue },
+ { "hmtx", gTrue },
+ { "loca", gTrue },
+ { "maxp", gTrue },
+ { "prep", gTrue },
+ { "vhea", gFalse },
+ { "vmtx", gFalse }
+};
+#define t42HeadTable 3
+#define t42LocaTable 6
+#define t42GlyfTable 2
+#define t42VheaTable 9
+#define t42VmtxTable 10
+
+//------------------------------------------------------------------------
+
+// Glyph names in some arbitrary standard order that Apple uses for
+// their TrueType fonts.
+static char *macGlyphNames[258] = {
+ ".notdef", "null", "CR", "space",
+ "exclam", "quotedbl", "numbersign", "dollar",
+ "percent", "ampersand", "quotesingle", "parenleft",
+ "parenright", "asterisk", "plus", "comma",
+ "hyphen", "period", "slash", "zero",
+ "one", "two", "three", "four",
+ "five", "six", "seven", "eight",
+ "nine", "colon", "semicolon", "less",
+ "equal", "greater", "question", "at",
+ "A", "B", "C", "D",
+ "E", "F", "G", "H",
+ "I", "J", "K", "L",
+ "M", "N", "O", "P",
+ "Q", "R", "S", "T",
+ "U", "V", "W", "X",
+ "Y", "Z", "bracketleft", "backslash",
+ "bracketright", "asciicircum", "underscore", "grave",
+ "a", "b", "c", "d",
+ "e", "f", "g", "h",
+ "i", "j", "k", "l",
+ "m", "n", "o", "p",
+ "q", "r", "s", "t",
+ "u", "v", "w", "x",
+ "y", "z", "braceleft", "bar",
+ "braceright", "asciitilde", "Adieresis", "Aring",
+ "Ccedilla", "Eacute", "Ntilde", "Odieresis",
+ "Udieresis", "aacute", "agrave", "acircumflex",
+ "adieresis", "atilde", "aring", "ccedilla",
+ "eacute", "egrave", "ecircumflex", "edieresis",
+ "iacute", "igrave", "icircumflex", "idieresis",
+ "ntilde", "oacute", "ograve", "ocircumflex",
+ "odieresis", "otilde", "uacute", "ugrave",
+ "ucircumflex", "udieresis", "dagger", "degree",
+ "cent", "sterling", "section", "bullet",
+ "paragraph", "germandbls", "registered", "copyright",
+ "trademark", "acute", "dieresis", "notequal",
+ "AE", "Oslash", "infinity", "plusminus",
+ "lessequal", "greaterequal", "yen", "mu1",
+ "partialdiff", "summation", "product", "pi",
+ "integral", "ordfeminine", "ordmasculine", "Ohm",
+ "ae", "oslash", "questiondown", "exclamdown",
+ "logicalnot", "radical", "florin", "approxequal",
+ "increment", "guillemotleft", "guillemotright", "ellipsis",
+ "nbspace", "Agrave", "Atilde", "Otilde",
+ "OE", "oe", "endash", "emdash",
+ "quotedblleft", "quotedblright", "quoteleft", "quoteright",
+ "divide", "lozenge", "ydieresis", "Ydieresis",
+ "fraction", "currency", "guilsinglleft", "guilsinglright",
+ "fi", "fl", "daggerdbl", "periodcentered",
+ "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex",
+ "Ecircumflex", "Aacute", "Edieresis", "Egrave",
+ "Iacute", "Icircumflex", "Idieresis", "Igrave",
+ "Oacute", "Ocircumflex", "applelogo", "Ograve",
+ "Uacute", "Ucircumflex", "Ugrave", "dotlessi",
+ "circumflex", "tilde", "overscore", "breve",
+ "dotaccent", "ring", "cedilla", "hungarumlaut",
+ "ogonek", "caron", "Lslash", "lslash",
+ "Scaron", "scaron", "Zcaron", "zcaron",
+ "brokenbar", "Eth", "eth", "Yacute",
+ "yacute", "Thorn", "thorn", "minus",
+ "multiply", "onesuperior", "twosuperior", "threesuperior",
+ "onehalf", "onequarter", "threequarters", "franc",
+ "Gbreve", "gbreve", "Idot", "Scedilla",
+ "scedilla", "Cacute", "cacute", "Ccaron",
+ "ccaron", "dmacron"
+};
+
+//------------------------------------------------------------------------
+// FoFiTrueType
+//------------------------------------------------------------------------
+
+FoFiTrueType *FoFiTrueType::make(char *fileA, int lenA, int faceIndexA) {
+ FoFiTrueType *ff;
+
+ ff = new FoFiTrueType(fileA, lenA, gFalse, faceIndexA);
+ if (!ff->parsedOk) {
+ delete ff;
+ return NULL;
+ }
+ return ff;
+}
+
+FoFiTrueType *FoFiTrueType::load(char *fileName, int faceIndexA) {
+ FoFiTrueType *ff;
+ char *fileA;
+ int lenA;
+
+ if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
+ return NULL;
+ }
+ ff = new FoFiTrueType(fileA, lenA, gTrue, faceIndexA);
+ if (!ff->parsedOk) {
+ delete ff;
+ return NULL;
+ }
+ return ff;
+}
+
+FoFiTrueType::FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA, int faceIndexA):
+ FoFiBase(fileA, lenA, freeFileDataA)
+{
+ tables = NULL;
+ nTables = 0;
+ cmaps = NULL;
+ nCmaps = 0;
+ nameToGID = NULL;
+ parsedOk = gFalse;
+ faceIndex = faceIndexA;
+
+ parse();
+}
+
+FoFiTrueType::~FoFiTrueType() {
+ gfree(tables);
+ gfree(cmaps);
+ if (nameToGID) {
+ delete nameToGID;
+ }
+}
+
+int FoFiTrueType::getNumCmaps() {
+ return nCmaps;
+}
+
+int FoFiTrueType::getCmapPlatform(int i) {
+ return cmaps[i].platform;
+}
+
+int FoFiTrueType::getCmapEncoding(int i) {
+ return cmaps[i].encoding;
+}
+
+int FoFiTrueType::findCmap(int platform, int encoding) {
+ int i;
+
+ for (i = 0; i < nCmaps; ++i) {
+ if (cmaps[i].platform == platform && cmaps[i].encoding == encoding) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+Gushort FoFiTrueType::mapCodeToGID(int i, int c) {
+ Gushort gid;
+ int segCnt, segEnd, segStart, segDelta, segOffset;
+ int cmapFirst, cmapLen;
+ int pos, a, b, m;
+ GBool ok;
+
+ if (i < 0 || i >= nCmaps) {
+ return 0;
+ }
+ ok = gTrue;
+ pos = cmaps[i].offset;
+ switch (cmaps[i].fmt) {
+ case 0:
+ if (c < 0 || c >= cmaps[i].len - 6) {
+ return 0;
+ }
+ gid = getU8(cmaps[i].offset + 6 + c, &ok);
+ break;
+ case 4:
+ segCnt = getU16BE(pos + 6, &ok) / 2;
+ a = -1;
+ b = segCnt - 1;
+ segEnd = getU16BE(pos + 14 + 2*b, &ok);
+ if (c > segEnd) {
+ // malformed font -- the TrueType spec requires the last segEnd
+ // to be 0xffff
+ return 0;
+ }
+ // invariant: seg[a].end < code <= seg[b].end
+ while (b - a > 1 && ok) {
+ m = (a + b) / 2;
+ segEnd = getU16BE(pos + 14 + 2*m, &ok);
+ if (segEnd < c) {
+ a = m;
+ } else {
+ b = m;
+ }
+ }
+ segStart = getU16BE(pos + 16 + 2*segCnt + 2*b, &ok);
+ segDelta = getU16BE(pos + 16 + 4*segCnt + 2*b, &ok);
+ segOffset = getU16BE(pos + 16 + 6*segCnt + 2*b, &ok);
+ if (c < segStart) {
+ return 0;
+ }
+ if (segOffset == 0) {
+ gid = (c + segDelta) & 0xffff;
+ } else {
+ gid = getU16BE(pos + 16 + 6*segCnt + 2*b +
+ segOffset + 2 * (c - segStart), &ok);
+ if (gid != 0) {
+ gid = (gid + segDelta) & 0xffff;
+ }
+ }
+ break;
+ case 6:
+ cmapFirst = getU16BE(pos + 6, &ok);
+ cmapLen = getU16BE(pos + 8, &ok);
+ if (c < cmapFirst || c >= cmapFirst + cmapLen) {
+ return 0;
+ }
+ gid = getU16BE(pos + 10 + 2 * (c - cmapFirst), &ok);
+ break;
+ default:
+ return 0;
+ }
+ if (!ok) {
+ return 0;
+ }
+ return gid;
+}
+
+int FoFiTrueType::mapNameToGID(char *name) {
+ if (!nameToGID) {
+ return 0;
+ }
+ return nameToGID->lookupInt(name);
+}
+
+Gushort *FoFiTrueType::getCIDToGIDMap(int *nCIDs) {
+ FoFiType1C *ff;
+ Gushort *map;
+ int i;
+
+ *nCIDs = 0;
+ if (!openTypeCFF) {
+ return NULL;
+ }
+ i = seekTable("CFF ");
+ if (!checkRegion(tables[i].offset, tables[i].len)) {
+ return NULL;
+ }
+ if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
+ tables[i].len))) {
+ return NULL;
+ }
+ map = ff->getCIDToGIDMap(nCIDs);
+ delete ff;
+ return map;
+}
+
+int FoFiTrueType::getEmbeddingRights() {
+ int i, fsType;
+ GBool ok;
+
+ if ((i = seekTable("OS/2")) < 0) {
+ return 4;
+ }
+ ok = gTrue;
+ fsType = getU16BE(tables[i].offset + 8, &ok);
+ if (!ok) {
+ return 4;
+ }
+ if (fsType & 0x0008) {
+ return 2;
+ }
+ if (fsType & 0x0004) {
+ return 1;
+ }
+ if (fsType & 0x0002) {
+ return 0;
+ }
+ return 3;
+}
+
+void FoFiTrueType::convertToType42(char *psName, char **encoding,
+ Gushort *codeToGID,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ GString *buf;
+ GBool ok;
+
+ if (openTypeCFF) {
+ return;
+ }
+
+ // write the header
+ ok = gTrue;
+ buf = GString::format("%!PS-TrueTypeFont-{0:2g}\n",
+ (double)getS32BE(0, &ok) / 65536.0);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+
+ // begin the font dictionary
+ (*outputFunc)(outputStream, "10 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/FontName /", 11);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ (*outputFunc)(outputStream, " def\n", 5);
+ (*outputFunc)(outputStream, "/FontType 42 def\n", 17);
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ buf = GString::format("/FontBBox [{0:d} {1:d} {2:d} {3:d}] def\n",
+ bbox[0], bbox[1], bbox[2], bbox[3]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/PaintType 0 def\n", 17);
+
+ // write the guts of the dictionary
+ cvtEncoding(encoding, outputFunc, outputStream);
+ cvtCharStrings(encoding, codeToGID, outputFunc, outputStream);
+ cvtSfnts(outputFunc, outputStream, NULL, gFalse);
+
+ // end the dictionary and define the font
+ (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
+}
+
+void FoFiTrueType::convertToType1(char *psName, char **newEncoding,
+ GBool ascii, FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ FoFiType1C *ff;
+ int i;
+
+ if (!openTypeCFF) {
+ return;
+ }
+ i = seekTable("CFF ");
+ if (!checkRegion(tables[i].offset, tables[i].len)) {
+ return;
+ }
+ if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
+ tables[i].len))) {
+ return;
+ }
+ ff->convertToType1(psName, newEncoding, ascii, outputFunc, outputStream);
+ delete ff;
+}
+
+void FoFiTrueType::convertToCIDType2(char *psName,
+ Gushort *cidMap, int nCIDs,
+ GBool needVerticalMetrics,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ GString *buf;
+ Gushort cid;
+ GBool ok;
+ int i, j, k;
+
+ if (openTypeCFF) {
+ return;
+ }
+
+ // write the header
+ ok = gTrue;
+ buf = GString::format("%!PS-TrueTypeFont-{0:2g}\n",
+ (double)getS32BE(0, &ok) / 65536.0);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+
+ // begin the font dictionary
+ (*outputFunc)(outputStream, "20 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/CIDFontName /", 14);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ (*outputFunc)(outputStream, " def\n", 5);
+ (*outputFunc)(outputStream, "/CIDFontType 2 def\n", 19);
+ (*outputFunc)(outputStream, "/FontType 42 def\n", 17);
+ (*outputFunc)(outputStream, "/CIDSystemInfo 3 dict dup begin\n", 32);
+ (*outputFunc)(outputStream, " /Registry (Adobe) def\n", 24);
+ (*outputFunc)(outputStream, " /Ordering (Identity) def\n", 27);
+ (*outputFunc)(outputStream, " /Supplement 0 def\n", 20);
+ (*outputFunc)(outputStream, " end def\n", 10);
+ (*outputFunc)(outputStream, "/GDBytes 2 def\n", 15);
+ if (cidMap) {
+ buf = GString::format("/CIDCount {0:d} def\n", nCIDs);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ if (nCIDs > 32767) {
+ (*outputFunc)(outputStream, "/CIDMap [", 9);
+ for (i = 0; i < nCIDs; i += 32768 - 16) {
+ (*outputFunc)(outputStream, "<\n", 2);
+ for (j = 0; j < 32768 - 16 && i+j < nCIDs; j += 16) {
+ (*outputFunc)(outputStream, " ", 2);
+ for (k = 0; k < 16 && i+j+k < nCIDs; ++k) {
+ cid = cidMap[i+j+k];
+ buf = GString::format("{0:02x}{1:02x}",
+ (cid >> 8) & 0xff, cid & 0xff);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+ (*outputFunc)(outputStream, " >", 3);
+ }
+ (*outputFunc)(outputStream, "\n", 1);
+ (*outputFunc)(outputStream, "] def\n", 6);
+ } else {
+ (*outputFunc)(outputStream, "/CIDMap <\n", 10);
+ for (i = 0; i < nCIDs; i += 16) {
+ (*outputFunc)(outputStream, " ", 2);
+ for (j = 0; j < 16 && i+j < nCIDs; ++j) {
+ cid = cidMap[i+j];
+ buf = GString::format("{0:02x}{1:02x}",
+ (cid >> 8) & 0xff, cid & 0xff);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+ (*outputFunc)(outputStream, "> def\n", 6);
+ }
+ } else {
+ // direct mapping - just fill the string(s) with s[i]=i
+ buf = GString::format("/CIDCount {0:d} def\n", nGlyphs);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ if (nGlyphs > 32767) {
+ (*outputFunc)(outputStream, "/CIDMap [\n", 10);
+ for (i = 0; i < nGlyphs; i += 32767) {
+ j = nGlyphs - i < 32767 ? nGlyphs - i : 32767;
+ buf = GString::format(" {0:d} string 0 1 {1:d} {{\n", 2 * j, j - 1);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format(" 2 copy dup 2 mul exch {0:d} add -8 bitshift put\n",
+ i);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format(" 1 index exch dup 2 mul 1 add exch {0:d} add"
+ " 255 and put\n", i);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, " } for\n", 8);
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ } else {
+ buf = GString::format("/CIDMap {0:d} string\n", 2 * nGlyphs);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format(" 0 1 {0:d} {{\n", nGlyphs - 1);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream,
+ " 2 copy dup 2 mul exch -8 bitshift put\n", 42);
+ (*outputFunc)(outputStream,
+ " 1 index exch dup 2 mul 1 add exch 255 and put\n", 50);
+ (*outputFunc)(outputStream, " } for\n", 8);
+ (*outputFunc)(outputStream, "def\n", 4);
+ }
+ }
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ buf = GString::format("/FontBBox [{0:d} {1:d} {2:d} {3:d}] def\n",
+ bbox[0], bbox[1], bbox[2], bbox[3]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/PaintType 0 def\n", 17);
+ (*outputFunc)(outputStream, "/Encoding [] readonly def\n", 26);
+ (*outputFunc)(outputStream, "/CharStrings 1 dict dup begin\n", 30);
+ (*outputFunc)(outputStream, " /.notdef 0 def\n", 17);
+ (*outputFunc)(outputStream, " end readonly def\n", 19);
+
+ // write the guts of the dictionary
+ cvtSfnts(outputFunc, outputStream, NULL, needVerticalMetrics);
+
+ // end the dictionary and define the font
+ (*outputFunc)(outputStream,
+ "CIDFontName currentdict end /CIDFont defineresource pop\n",
+ 56);
+}
+
+void FoFiTrueType::convertToCIDType0(char *psName,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ FoFiType1C *ff;
+ int i;
+
+ if (!openTypeCFF) {
+ return;
+ }
+ i = seekTable("CFF ");
+ if (!checkRegion(tables[i].offset, tables[i].len)) {
+ return;
+ }
+ if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
+ tables[i].len))) {
+ return;
+ }
+ ff->convertToCIDType0(psName, outputFunc, outputStream);
+ delete ff;
+}
+
+void FoFiTrueType::convertToType0(char *psName, Gushort *cidMap, int nCIDs,
+ GBool needVerticalMetrics,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ GString *buf;
+ GString *sfntsName;
+ int n, i, j;
+
+ if (openTypeCFF) {
+ return;
+ }
+
+ // write the Type 42 sfnts array
+ sfntsName = (new GString(psName))->append("_sfnts");
+ cvtSfnts(outputFunc, outputStream, sfntsName, needVerticalMetrics);
+ delete sfntsName;
+
+ // write the descendant Type 42 fonts
+ n = cidMap ? nCIDs : nGlyphs;
+ for (i = 0; i < n; i += 256) {
+ (*outputFunc)(outputStream, "10 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/FontName /", 11);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ buf = GString::format("_{0:02x} def\n", i >> 8);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/FontType 42 def\n", 17);
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ buf = GString::format("/FontBBox [{0:d} {1:d} {2:d} {3:d}] def\n",
+ bbox[0], bbox[1], bbox[2], bbox[3]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/PaintType 0 def\n", 17);
+ (*outputFunc)(outputStream, "/sfnts ", 7);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ (*outputFunc)(outputStream, "_sfnts def\n", 11);
+ (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
+ for (j = 0; j < 256 && i+j < n; ++j) {
+ buf = GString::format("dup {0:d} /c{1:02x} put\n", j, j);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "readonly def\n", 13);
+ (*outputFunc)(outputStream, "/CharStrings 257 dict dup begin\n", 32);
+ (*outputFunc)(outputStream, "/.notdef 0 def\n", 15);
+ for (j = 0; j < 256 && i+j < n; ++j) {
+ buf = GString::format("/c{0:02x} {1:d} def\n",
+ j, cidMap ? cidMap[i+j] : i+j);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "end readonly def\n", 17);
+ (*outputFunc)(outputStream,
+ "FontName currentdict end definefont pop\n", 40);
+ }
+
+ // write the Type 0 parent font
+ (*outputFunc)(outputStream, "16 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/FontName /", 11);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ (*outputFunc)(outputStream, " def\n", 5);
+ (*outputFunc)(outputStream, "/FontType 0 def\n", 16);
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ (*outputFunc)(outputStream, "/FMapType 2 def\n", 16);
+ (*outputFunc)(outputStream, "/Encoding [\n", 12);
+ for (i = 0; i < n; i += 256) {
+ buf = GString::format("{0:d}\n", i >> 8);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ (*outputFunc)(outputStream, "/FDepVector [\n", 14);
+ for (i = 0; i < n; i += 256) {
+ (*outputFunc)(outputStream, "/", 1);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ buf = GString::format("_{0:02x} findfont\n", i >> 8);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
+}
+
+void FoFiTrueType::convertToType0(char *psName,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ FoFiType1C *ff;
+ int i;
+
+ if (!openTypeCFF) {
+ return;
+ }
+ i = seekTable("CFF ");
+ if (!checkRegion(tables[i].offset, tables[i].len)) {
+ return;
+ }
+ if (!(ff = FoFiType1C::make((char *)file + tables[i].offset,
+ tables[i].len))) {
+ return;
+ }
+ ff->convertToType0(psName, outputFunc, outputStream);
+ delete ff;
+}
+
+void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
+ void *outputStream, char *name,
+ Gushort *codeToGID) {
+ // this substitute cmap table maps char codes 0000-ffff directly to
+ // glyphs 0000-ffff
+ static char cmapTab[36] = {
+ 0, 0, // table version number
+ 0, 1, // number of encoding tables
+ 0, 1, // platform ID
+ 0, 0, // encoding ID
+ 0, 0, 0, 12, // offset of subtable
+ 0, 4, // subtable format
+ 0, 24, // subtable length
+ 0, 0, // subtable version
+ 0, 2, // segment count * 2
+ 0, 2, // 2 * 2 ^ floor(log2(segCount))
+ 0, 0, // floor(log2(segCount))
+ 0, 0, // 2*segCount - 2*2^floor(log2(segCount))
+ (char)0xff, (char)0xff, // endCount[0]
+ 0, 0, // reserved
+ 0, 0, // startCount[0]
+ 0, 0, // idDelta[0]
+ 0, 0 // pad to a mulitple of four bytes
+ };
+ static char nameTab[8] = {
+ 0, 0, // format
+ 0, 0, // number of name records
+ 0, 6, // offset to start of string storage
+ 0, 0 // pad to multiple of four bytes
+ };
+ static char postTab[32] = {
+ 0, 1, 0, 0, // format
+ 0, 0, 0, 0, // italic angle
+ 0, 0, // underline position
+ 0, 0, // underline thickness
+ 0, 0, 0, 0, // fixed pitch
+ 0, 0, 0, 0, // min Type 42 memory
+ 0, 0, 0, 0, // max Type 42 memory
+ 0, 0, 0, 0, // min Type 1 memory
+ 0, 0, 0, 0 // max Type 1 memory
+ };
+ static char os2Tab[86] = {
+ 0, 1, // version
+ 0, 1, // xAvgCharWidth
+ 0, 0, // usWeightClass
+ 0, 0, // usWidthClass
+ 0, 0, // fsType
+ 0, 0, // ySubscriptXSize
+ 0, 0, // ySubscriptYSize
+ 0, 0, // ySubscriptXOffset
+ 0, 0, // ySubscriptYOffset
+ 0, 0, // ySuperscriptXSize
+ 0, 0, // ySuperscriptYSize
+ 0, 0, // ySuperscriptXOffset
+ 0, 0, // ySuperscriptYOffset
+ 0, 0, // yStrikeoutSize
+ 0, 0, // yStrikeoutPosition
+ 0, 0, // sFamilyClass
+ 0, 0, 0, 0, 0, // panose
+ 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, // ulUnicodeRange1
+ 0, 0, 0, 0, // ulUnicodeRange2
+ 0, 0, 0, 0, // ulUnicodeRange3
+ 0, 0, 0, 0, // ulUnicodeRange4
+ 0, 0, 0, 0, // achVendID
+ 0, 0, // fsSelection
+ 0, 0, // usFirstCharIndex
+ 0, 0, // usLastCharIndex
+ 0, 0, // sTypoAscender
+ 0, 0, // sTypoDescender
+ 0, 0, // sTypoLineGap
+ 0, 0, // usWinAscent
+ 0, 0, // usWinDescent
+ 0, 0, 0, 0, // ulCodePageRange1
+ 0, 0, 0, 0 // ulCodePageRange2
+ };
+ GBool missingCmap, missingName, missingPost, missingOS2;
+ GBool unsortedLoca, badCmapLen, abbrevHMTX;
+ int nZeroLengthTables;
+ int nHMetrics, advWidth, lsb;
+ TrueTypeLoca *locaTable;
+ TrueTypeTable *newTables;
+ char *newNameTab, *newCmapTab, *newHHEATab, *newHMTXTab;
+ int nNewTables, cmapIdx, cmapLen, glyfLen, newNameLen, newCmapLen, next;
+ int newHHEALen, newHMTXLen;
+ Guint locaChecksum, glyfChecksum, fileChecksum;
+ char *tableDir;
+ char locaBuf[4], checksumBuf[4];
+ GBool ok;
+ Guint t;
+ int pos, i, j, k, n;
+
+ if (openTypeCFF) {
+ return;
+ }
+
+ // check for missing tables
+ // (Note: if the OS/2 table is missing, the Microsoft PCL5 driver
+ // will embed a PCL TrueType font with the pitch field set to zero,
+ // which apparently causes divide-by-zero errors. As far as I can
+ // tell, the only important field in the OS/2 table is
+ // xAvgCharWidth.)
+ missingCmap = (cmapIdx = seekTable("cmap")) < 0;
+ missingName = seekTable("name") < 0;
+ missingPost = seekTable("post") < 0;
+ missingOS2 = seekTable("OS/2") < 0;
+
+ // read the loca table, check to see if it's sorted
+ locaTable = (TrueTypeLoca *)gmallocn(nGlyphs + 1, sizeof(TrueTypeLoca));
+ unsortedLoca = gFalse;
+ i = seekTable("loca");
+ pos = tables[i].offset;
+ ok = gTrue;
+ for (i = 0; i <= nGlyphs; ++i) {
+ if (locaFmt) {
+ locaTable[i].origOffset = (int)getU32BE(pos + i*4, &ok);
+ } else {
+ locaTable[i].origOffset = 2 * getU16BE(pos + i*2, &ok);
+ }
+ if (i > 0 && locaTable[i].origOffset < locaTable[i-1].origOffset) {
+ unsortedLoca = gTrue;
+ }
+ // glyph descriptions must be at least 12 bytes long (nContours,
+ // xMin, yMin, xMax, yMax, instructionLength - two bytes each);
+ // invalid glyph descriptions (even if they're never used) make
+ // Windows choke, so we work around that problem here (ideally,
+ // this would parse the glyph descriptions in the glyf table and
+ // remove any that were invalid, but this quick test is a decent
+ // start)
+ if (i > 0 &&
+ locaTable[i].origOffset - locaTable[i-1].origOffset > 0 &&
+ locaTable[i].origOffset - locaTable[i-1].origOffset < 12) {
+ locaTable[i-1].origOffset = locaTable[i].origOffset;
+ unsortedLoca = gTrue;
+ }
+ locaTable[i].idx = i;
+ }
+
+ // check for zero-length tables
+ nZeroLengthTables = 0;
+ for (i = 0; i < nTables; ++i) {
+ if (tables[i].len == 0) {
+ ++nZeroLengthTables;
+ }
+ }
+
+ // check for an incorrect cmap table length
+ badCmapLen = gFalse;
+ cmapLen = 0; // make gcc happy
+ if (!missingCmap) {
+ cmapLen = cmaps[0].offset + cmaps[0].len;
+ for (i = 1; i < nCmaps; ++i) {
+ if (cmaps[i].offset + cmaps[i].len > cmapLen) {
+ cmapLen = cmaps[i].offset + cmaps[i].len;
+ }
+ }
+ cmapLen -= tables[cmapIdx].offset;
+ if (cmapLen > tables[cmapIdx].len) {
+ badCmapLen = gTrue;
+ }
+ }
+
+ // check for an abbreviated hmtx table (this is completely legal,
+ // but confuses the Microsoft PCL5 printer driver, which generates
+ // embedded fonts with the pitch field set to zero)
+ i = seekTable("hhea");
+ nHMetrics = getU16BE(tables[i].offset + 34, &ok);
+ abbrevHMTX = nHMetrics < nGlyphs;
+
+ // if nothing is broken, just write the TTF file as is
+ if (!missingCmap && !missingName && !missingPost && !missingOS2 &&
+ !unsortedLoca && !badCmapLen && !abbrevHMTX && nZeroLengthTables == 0 &&
+ !name && !codeToGID) {
+ (*outputFunc)(outputStream, (char *)file, len);
+ goto done1;
+ }
+
+ // sort the 'loca' table: some (non-compliant) fonts have
+ // out-of-order loca tables; in order to correctly handle the case
+ // where (compliant) fonts have empty entries in the middle of the
+ // table, cmpTrueTypeLocaOffset uses offset as its primary sort key,
+ // and idx as its secondary key (ensuring that adjacent entries with
+ // the same pos value remain in the same order)
+ glyfLen = 0; // make gcc happy
+ if (unsortedLoca) {
+ qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
+ &cmpTrueTypeLocaOffset);
+ for (i = 0; i < nGlyphs; ++i) {
+ locaTable[i].len = locaTable[i+1].origOffset - locaTable[i].origOffset;
+ }
+ locaTable[nGlyphs].len = 0;
+ qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
+ &cmpTrueTypeLocaIdx);
+ pos = 0;
+ for (i = 0; i <= nGlyphs; ++i) {
+ locaTable[i].newOffset = pos;
+ pos += locaTable[i].len;
+ if (pos & 3) {
+ pos += 4 - (pos & 3);
+ }
+ }
+ glyfLen = pos;
+ }
+
+ // compute checksums for the loca and glyf tables
+ locaChecksum = glyfChecksum = 0;
+ if (unsortedLoca) {
+ if (locaFmt) {
+ for (j = 0; j <= nGlyphs; ++j) {
+ locaChecksum += locaTable[j].newOffset;
+ }
+ } else {
+ for (j = 0; j <= nGlyphs; j += 2) {
+ locaChecksum += locaTable[j].newOffset << 16;
+ if (j + 1 <= nGlyphs) {
+ locaChecksum += locaTable[j+1].newOffset;
+ }
+ }
+ }
+ pos = tables[seekTable("glyf")].offset;
+ for (j = 0; j < nGlyphs; ++j) {
+ n = locaTable[j].len;
+ if (n > 0) {
+ k = locaTable[j].origOffset;
+ if (checkRegion(pos + k, n)) {
+ glyfChecksum += computeTableChecksum(file + pos + k, n);
+ }
+ }
+ }
+ }
+
+ // construct the new name table
+ if (name) {
+ n = strlen(name);
+ newNameLen = (6 + 4*12 + 2 * (3*n + 7) + 3) & ~3;
+ newNameTab = (char *)gmalloc(newNameLen);
+ memset(newNameTab, 0, newNameLen);
+ newNameTab[0] = 0; // format selector
+ newNameTab[1] = 0;
+ newNameTab[2] = 0; // number of name records
+ newNameTab[3] = 4;
+ newNameTab[4] = 0; // offset to start of string storage
+ newNameTab[5] = 6 + 4*12;
+ next = 0;
+ for (i = 0; i < 4; ++i) {
+ newNameTab[6 + i*12 + 0] = 0; // platform ID = Microsoft
+ newNameTab[6 + i*12 + 1] = 3;
+ newNameTab[6 + i*12 + 2] = 0; // encoding ID = Unicode
+ newNameTab[6 + i*12 + 3] = 1;
+ newNameTab[6 + i*12 + 4] = 0x04; // language ID = American English
+ newNameTab[6 + i*12 + 5] = 0x09;
+ newNameTab[6 + i*12 + 6] = 0; // name ID
+ newNameTab[6 + i*12 + 7] = i + 1;
+ newNameTab[6 + i*12 + 8] = i+1 == 2 ? 0 : ((2*n) >> 8); // string length
+ newNameTab[6 + i*12 + 9] = i+1 == 2 ? 14 : ((2*n) & 0xff);
+ newNameTab[6 + i*12 + 10] = next >> 8; // string offset
+ newNameTab[6 + i*12 + 11] = next & 0xff;
+ if (i+1 == 2) {
+ memcpy(newNameTab + 6 + 4*12 + next, "\0R\0e\0g\0u\0l\0a\0r", 14);
+ next += 14;
+ } else {
+ for (j = 0; j < n; ++j) {
+ newNameTab[6 + 4*12 + next + 2*j] = 0;
+ newNameTab[6 + 4*12 + next + 2*j + 1] = name[j];
+ }
+ next += 2*n;
+ }
+ }
+ } else {
+ newNameLen = 0;
+ newNameTab = NULL;
+ }
+
+ // construct the new cmap table
+ if (codeToGID) {
+ newCmapLen = 44 + 256 * 2;
+ newCmapTab = (char *)gmalloc(newCmapLen);
+ newCmapTab[0] = 0; // table version number = 0
+ newCmapTab[1] = 0;
+ newCmapTab[2] = 0; // number of encoding tables = 1
+ newCmapTab[3] = 1;
+ newCmapTab[4] = 0; // platform ID = Microsoft
+ newCmapTab[5] = 3;
+ newCmapTab[6] = 0; // encoding ID = Unicode
+ newCmapTab[7] = 1;
+ newCmapTab[8] = 0; // offset of subtable
+ newCmapTab[9] = 0;
+ newCmapTab[10] = 0;
+ newCmapTab[11] = 12;
+ newCmapTab[12] = 0; // subtable format = 4
+ newCmapTab[13] = 4;
+ newCmapTab[14] = 0x02; // subtable length
+ newCmapTab[15] = 0x20;
+ newCmapTab[16] = 0; // subtable version = 0
+ newCmapTab[17] = 0;
+ newCmapTab[18] = 0; // segment count * 2
+ newCmapTab[19] = 4;
+ newCmapTab[20] = 0; // 2 * 2 ^ floor(log2(segCount))
+ newCmapTab[21] = 4;
+ newCmapTab[22] = 0; // floor(log2(segCount))
+ newCmapTab[23] = 1;
+ newCmapTab[24] = 0; // 2*segCount - 2*2^floor(log2(segCount))
+ newCmapTab[25] = 0;
+ newCmapTab[26] = 0x00; // endCount[0]
+ newCmapTab[27] = (char)0xff;
+ newCmapTab[28] = (char)0xff; // endCount[1]
+ newCmapTab[29] = (char)0xff;
+ newCmapTab[30] = 0; // reserved
+ newCmapTab[31] = 0;
+ newCmapTab[32] = 0x00; // startCount[0]
+ newCmapTab[33] = 0x00;
+ newCmapTab[34] = (char)0xff; // startCount[1]
+ newCmapTab[35] = (char)0xff;
+ newCmapTab[36] = 0; // idDelta[0]
+ newCmapTab[37] = 0;
+ newCmapTab[38] = 0; // idDelta[1]
+ newCmapTab[39] = 1;
+ newCmapTab[40] = 0; // idRangeOffset[0]
+ newCmapTab[41] = 4;
+ newCmapTab[42] = 0; // idRangeOffset[1]
+ newCmapTab[43] = 0;
+ for (i = 0; i < 256; ++i) {
+ newCmapTab[44 + 2*i] = codeToGID[i] >> 8;
+ newCmapTab[44 + 2*i + 1] = codeToGID[i] & 0xff;
+ }
+ } else {
+ newCmapLen = 0;
+ newCmapTab = NULL;
+ }
+
+ // generate the new hmtx table and the updated hhea table
+ if (abbrevHMTX) {
+ i = seekTable("hhea");
+ pos = tables[i].offset;
+ newHHEALen = 36;
+ newHHEATab = (char *)gmalloc(newHHEALen);
+ for (i = 0; i < newHHEALen; ++i) {
+ newHHEATab[i] = getU8(pos++, &ok);
+ }
+ newHHEATab[34] = nGlyphs >> 8;
+ newHHEATab[35] = nGlyphs & 0xff;
+ i = seekTable("hmtx");
+ pos = tables[i].offset;
+ newHMTXLen = 4 * nGlyphs;
+ newHMTXTab = (char *)gmalloc(newHMTXLen);
+ advWidth = 0;
+ for (i = 0; i < nHMetrics; ++i) {
+ advWidth = getU16BE(pos, &ok);
+ lsb = getU16BE(pos + 2, &ok);
+ pos += 4;
+ newHMTXTab[4*i ] = advWidth >> 8;
+ newHMTXTab[4*i + 1] = advWidth & 0xff;
+ newHMTXTab[4*i + 2] = lsb >> 8;
+ newHMTXTab[4*i + 3] = lsb & 0xff;
+ }
+ for (; i < nGlyphs; ++i) {
+ lsb = getU16BE(pos, &ok);
+ pos += 2;
+ newHMTXTab[4*i ] = advWidth >> 8;
+ newHMTXTab[4*i + 1] = advWidth & 0xff;
+ newHMTXTab[4*i + 2] = lsb >> 8;
+ newHMTXTab[4*i + 3] = lsb & 0xff;
+ }
+ } else {
+ newHHEATab = newHMTXTab = NULL;
+ newHHEALen = newHMTXLen = 0; // make gcc happy
+ }
+
+ // construct the new table directory:
+ // - keep all original tables with non-zero length
+ // - fix the cmap table's length, if necessary
+ // - add missing tables
+ // - sort the table by tag
+ // - compute new table positions, including 4-byte alignment
+ // - (re)compute table checksums
+ nNewTables = nTables - nZeroLengthTables +
+ (missingCmap ? 1 : 0) + (missingName ? 1 : 0) +
+ (missingPost ? 1 : 0) + (missingOS2 ? 1 : 0);
+ newTables = (TrueTypeTable *)gmallocn(nNewTables, sizeof(TrueTypeTable));
+ j = 0;
+ for (i = 0; i < nTables; ++i) {
+ if (tables[i].len > 0) {
+ newTables[j] = tables[i];
+ newTables[j].origOffset = tables[i].offset;
+ if (checkRegion(tables[i].offset, newTables[i].len)) {
+ newTables[j].checksum =
+ computeTableChecksum(file + tables[i].offset, tables[i].len);
+ if (tables[i].tag == headTag) {
+ // don't include the file checksum
+ newTables[j].checksum -= getU32BE(tables[i].offset + 8, &ok);
+ }
+ }
+ if (newTables[j].tag == cmapTag && codeToGID) {
+ newTables[j].len = newCmapLen;
+ newTables[j].checksum = computeTableChecksum((Guchar *)newCmapTab,
+ newCmapLen);
+ } else if (newTables[j].tag == cmapTag && badCmapLen) {
+ newTables[j].len = cmapLen;
+ } else if (newTables[j].tag == locaTag && unsortedLoca) {
+ newTables[j].len = (nGlyphs + 1) * (locaFmt ? 4 : 2);
+ newTables[j].checksum = locaChecksum;
+ } else if (newTables[j].tag == glyfTag && unsortedLoca) {
+ newTables[j].len = glyfLen;
+ newTables[j].checksum = glyfChecksum;
+ } else if (newTables[j].tag == nameTag && name) {
+ newTables[j].len = newNameLen;
+ newTables[j].checksum = computeTableChecksum((Guchar *)newNameTab,
+ newNameLen);
+ } else if (newTables[j].tag == hheaTag && abbrevHMTX) {
+ newTables[j].len = newHHEALen;
+ newTables[j].checksum = computeTableChecksum((Guchar *)newHHEATab,
+ newHHEALen);
+ } else if (newTables[j].tag == hmtxTag && abbrevHMTX) {
+ newTables[j].len = newHMTXLen;
+ newTables[j].checksum = computeTableChecksum((Guchar *)newHMTXTab,
+ newHMTXLen);
+ }
+ ++j;
+ }
+ }
+ if (missingCmap) {
+ newTables[j].tag = cmapTag;
+ if (codeToGID) {
+ newTables[j].checksum = computeTableChecksum((Guchar *)newCmapTab,
+ newCmapLen);
+ newTables[j].len = newCmapLen;
+ } else {
+ newTables[j].checksum = computeTableChecksum((Guchar *)cmapTab,
+ sizeof(cmapTab));
+ newTables[j].len = sizeof(cmapTab);
+ }
+ ++j;
+ }
+ if (missingName) {
+ newTables[j].tag = nameTag;
+ if (name) {
+ newTables[j].checksum = computeTableChecksum((Guchar *)newNameTab,
+ newNameLen);
+ newTables[j].len = newNameLen;
+ } else {
+ newTables[j].checksum = computeTableChecksum((Guchar *)nameTab,
+ sizeof(nameTab));
+ newTables[j].len = sizeof(nameTab);
+ }
+ ++j;
+ }
+ if (missingPost) {
+ newTables[j].tag = postTag;
+ newTables[j].checksum = computeTableChecksum((Guchar *)postTab,
+ sizeof(postTab));
+ newTables[j].len = sizeof(postTab);
+ ++j;
+ }
+ if (missingOS2) {
+ newTables[j].tag = os2Tag;
+ newTables[j].checksum = computeTableChecksum((Guchar *)os2Tab,
+ sizeof(os2Tab));
+ newTables[j].len = sizeof(os2Tab);
+ ++j;
+ }
+ qsort(newTables, nNewTables, sizeof(TrueTypeTable),
+ &cmpTrueTypeTableTag);
+ pos = 12 + nNewTables * 16;
+ for (i = 0; i < nNewTables; ++i) {
+ newTables[i].offset = pos;
+ pos += newTables[i].len;
+ if (pos & 3) {
+ pos += 4 - (pos & 3);
+ }
+ }
+
+ // write the table directory
+ tableDir = (char *)gmalloc(12 + nNewTables * 16);
+ tableDir[0] = 0x00; // sfnt version
+ tableDir[1] = 0x01;
+ tableDir[2] = 0x00;
+ tableDir[3] = 0x00;
+ tableDir[4] = (char)((nNewTables >> 8) & 0xff); // numTables
+ tableDir[5] = (char)(nNewTables & 0xff);
+ for (i = -1, t = (Guint)nNewTables; t; ++i, t >>= 1) ;
+ t = 1 << (4 + i);
+ tableDir[6] = (char)((t >> 8) & 0xff); // searchRange
+ tableDir[7] = (char)(t & 0xff);
+ tableDir[8] = (char)((i >> 8) & 0xff); // entrySelector
+ tableDir[9] = (char)(i & 0xff);
+ t = nNewTables * 16 - t;
+ tableDir[10] = (char)((t >> 8) & 0xff); // rangeShift
+ tableDir[11] = (char)(t & 0xff);
+ pos = 12;
+ for (i = 0; i < nNewTables; ++i) {
+ tableDir[pos ] = (char)(newTables[i].tag >> 24);
+ tableDir[pos+ 1] = (char)(newTables[i].tag >> 16);
+ tableDir[pos+ 2] = (char)(newTables[i].tag >> 8);
+ tableDir[pos+ 3] = (char) newTables[i].tag;
+ tableDir[pos+ 4] = (char)(newTables[i].checksum >> 24);
+ tableDir[pos+ 5] = (char)(newTables[i].checksum >> 16);
+ tableDir[pos+ 6] = (char)(newTables[i].checksum >> 8);
+ tableDir[pos+ 7] = (char) newTables[i].checksum;
+ tableDir[pos+ 8] = (char)(newTables[i].offset >> 24);
+ tableDir[pos+ 9] = (char)(newTables[i].offset >> 16);
+ tableDir[pos+10] = (char)(newTables[i].offset >> 8);
+ tableDir[pos+11] = (char) newTables[i].offset;
+ tableDir[pos+12] = (char)(newTables[i].len >> 24);
+ tableDir[pos+13] = (char)(newTables[i].len >> 16);
+ tableDir[pos+14] = (char)(newTables[i].len >> 8);
+ tableDir[pos+15] = (char) newTables[i].len;
+ pos += 16;
+ }
+ (*outputFunc)(outputStream, tableDir, 12 + nNewTables * 16);
+
+ // compute the file checksum
+ fileChecksum = computeTableChecksum((Guchar *)tableDir,
+ 12 + nNewTables * 16);
+ for (i = 0; i < nNewTables; ++i) {
+ fileChecksum += newTables[i].checksum;
+ }
+ fileChecksum = 0xb1b0afba - fileChecksum;
+
+ // write the tables
+ for (i = 0; i < nNewTables; ++i) {
+ if (newTables[i].tag == headTag) {
+ if (checkRegion(newTables[i].origOffset, newTables[i].len)) {
+ (*outputFunc)(outputStream, (char *)file + newTables[i].origOffset, 8);
+ checksumBuf[0] = fileChecksum >> 24;
+ checksumBuf[1] = fileChecksum >> 16;
+ checksumBuf[2] = fileChecksum >> 8;
+ checksumBuf[3] = fileChecksum;
+ (*outputFunc)(outputStream, checksumBuf, 4);
+ (*outputFunc)(outputStream,
+ (char *)file + newTables[i].origOffset + 12,
+ newTables[i].len - 12);
+ } else {
+ for (j = 0; j < newTables[i].len; ++j) {
+ (*outputFunc)(outputStream, "\0", 1);
+ }
+ }
+ } else if (newTables[i].tag == cmapTag && codeToGID) {
+ (*outputFunc)(outputStream, newCmapTab, newTables[i].len);
+ } else if (newTables[i].tag == cmapTag && missingCmap) {
+ (*outputFunc)(outputStream, cmapTab, newTables[i].len);
+ } else if (newTables[i].tag == nameTag && name) {
+ (*outputFunc)(outputStream, newNameTab, newTables[i].len);
+ } else if (newTables[i].tag == nameTag && missingName) {
+ (*outputFunc)(outputStream, nameTab, newTables[i].len);
+ } else if (newTables[i].tag == postTag && missingPost) {
+ (*outputFunc)(outputStream, postTab, newTables[i].len);
+ } else if (newTables[i].tag == os2Tag && missingOS2) {
+ (*outputFunc)(outputStream, os2Tab, newTables[i].len);
+ } else if (newTables[i].tag == hheaTag && abbrevHMTX) {
+ (*outputFunc)(outputStream, newHHEATab, newTables[i].len);
+ } else if (newTables[i].tag == hmtxTag && abbrevHMTX) {
+ (*outputFunc)(outputStream, newHMTXTab, newTables[i].len);
+ } else if (newTables[i].tag == locaTag && unsortedLoca) {
+ for (j = 0; j <= nGlyphs; ++j) {
+ if (locaFmt) {
+ locaBuf[0] = (char)(locaTable[j].newOffset >> 24);
+ locaBuf[1] = (char)(locaTable[j].newOffset >> 16);
+ locaBuf[2] = (char)(locaTable[j].newOffset >> 8);
+ locaBuf[3] = (char) locaTable[j].newOffset;
+ (*outputFunc)(outputStream, locaBuf, 4);
+ } else {
+ locaBuf[0] = (char)(locaTable[j].newOffset >> 9);
+ locaBuf[1] = (char)(locaTable[j].newOffset >> 1);
+ (*outputFunc)(outputStream, locaBuf, 2);
+ }
+ }
+ } else if (newTables[i].tag == glyfTag && unsortedLoca) {
+ pos = tables[seekTable("glyf")].offset;
+ for (j = 0; j < nGlyphs; ++j) {
+ n = locaTable[j].len;
+ if (n > 0) {
+ k = locaTable[j].origOffset;
+ if (checkRegion(pos + k, n)) {
+ (*outputFunc)(outputStream, (char *)file + pos + k, n);
+ } else {
+ for (k = 0; k < n; ++k) {
+ (*outputFunc)(outputStream, "\0", 1);
+ }
+ }
+ if ((k = locaTable[j].len & 3)) {
+ (*outputFunc)(outputStream, "\0\0\0\0", 4 - k);
+ }
+ }
+ }
+ } else {
+ if (checkRegion(newTables[i].origOffset, newTables[i].len)) {
+ (*outputFunc)(outputStream, (char *)file + newTables[i].origOffset,
+ newTables[i].len);
+ } else {
+ for (j = 0; j < newTables[i].len; ++j) {
+ (*outputFunc)(outputStream, "\0", 1);
+ }
+ }
+ }
+ if (newTables[i].len & 3) {
+ (*outputFunc)(outputStream, "\0\0\0", 4 - (newTables[i].len & 3));
+ }
+ }
+
+ gfree(newHMTXTab);
+ gfree(newHHEATab);
+ gfree(newCmapTab);
+ gfree(newNameTab);
+ gfree(tableDir);
+ gfree(newTables);
+ done1:
+ gfree(locaTable);
+}
+
+void FoFiTrueType::cvtEncoding(char **encoding,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ char *name;
+ GString *buf;
+ int i;
+
+ (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
+ if (encoding) {
+ for (i = 0; i < 256; ++i) {
+ if (!(name = encoding[i])) {
+ name = ".notdef";
+ }
+ buf = GString::format("dup {0:d} /", i);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, name, strlen(name));
+ (*outputFunc)(outputStream, " put\n", 5);
+ }
+ } else {
+ for (i = 0; i < 256; ++i) {
+ buf = GString::format("dup {0:d} /c{1:02x} put\n", i, i);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ }
+ (*outputFunc)(outputStream, "readonly def\n", 13);
+}
+
+void FoFiTrueType::cvtCharStrings(char **encoding,
+ Gushort *codeToGID,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ char *name;
+ GString *buf;
+ char buf2[16];
+ int i, k;
+
+ // always define '.notdef'
+ (*outputFunc)(outputStream, "/CharStrings 256 dict dup begin\n", 32);
+ (*outputFunc)(outputStream, "/.notdef 0 def\n", 15);
+
+ // if there's no 'cmap' table, punt
+ if (nCmaps == 0) {
+ goto err;
+ }
+
+ // map char name to glyph index:
+ // 1. use encoding to map name to char code
+ // 2. use codeToGID to map char code to glyph index
+ // N.B. We do this in reverse order because font subsets can have
+ // weird encodings that use the same character name twice, and
+ // the first definition is probably the one we want.
+ k = 0; // make gcc happy
+ for (i = 255; i >= 0; --i) {
+ if (encoding) {
+ name = encoding[i];
+ } else {
+ sprintf(buf2, "c%02x", i);
+ name = buf2;
+ }
+ if (name && strcmp(name, ".notdef")) {
+ k = codeToGID[i];
+ // note: Distiller (maybe Adobe's PS interpreter in general)
+ // doesn't like TrueType fonts that have CharStrings entries
+ // which point to nonexistent glyphs, hence the (k < nGlyphs)
+ // test
+ if (k > 0 && k < nGlyphs) {
+ (*outputFunc)(outputStream, "/", 1);
+ (*outputFunc)(outputStream, name, strlen(name));
+ buf = GString::format(" {0:d} def\n", k);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ }
+ }
+
+ err:
+ (*outputFunc)(outputStream, "end readonly def\n", 17);
+}
+
+void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
+ void *outputStream, GString *name,
+ GBool needVerticalMetrics) {
+ Guchar headData[54];
+ TrueTypeLoca *locaTable;
+ Guchar *locaData;
+ TrueTypeTable newTables[nT42Tables];
+ Guchar tableDir[12 + nT42Tables*16];
+ GBool ok;
+ Guint checksum;
+ int nNewTables;
+ int length, pos, glyfPos, i, j, k;
+ Guchar vheaTab[36] = {
+ 0, 1, 0, 0, // table version number
+ 0, 0, // ascent
+ 0, 0, // descent
+ 0, 0, // reserved
+ 0, 0, // max advance height
+ 0, 0, // min top side bearing
+ 0, 0, // min bottom side bearing
+ 0, 0, // y max extent
+ 0, 0, // caret slope rise
+ 0, 1, // caret slope run
+ 0, 0, // caret offset
+ 0, 0, // reserved
+ 0, 0, // reserved
+ 0, 0, // reserved
+ 0, 0, // reserved
+ 0, 0, // metric data format
+ 0, 1 // number of advance heights in vmtx table
+ };
+ Guchar *vmtxTab;
+ GBool needVhea, needVmtx;
+ int advance;
+
+ // construct the 'head' table, zero out the font checksum
+ i = seekTable("head");
+ pos = tables[i].offset;
+ if (!checkRegion(pos, 54)) {
+ return;
+ }
+ memcpy(headData, file + pos, 54);
+ headData[8] = headData[9] = headData[10] = headData[11] = (Guchar)0;
+
+ // read the original 'loca' table, pad entries out to 4 bytes, and
+ // sort it into proper order -- some (non-compliant) fonts have
+ // out-of-order loca tables; in order to correctly handle the case
+ // where (compliant) fonts have empty entries in the middle of the
+ // table, cmpTrueTypeLocaPos uses offset as its primary sort key,
+ // and idx as its secondary key (ensuring that adjacent entries with
+ // the same pos value remain in the same order)
+ locaTable = (TrueTypeLoca *)gmallocn(nGlyphs + 1, sizeof(TrueTypeLoca));
+ i = seekTable("loca");
+ pos = tables[i].offset;
+ ok = gTrue;
+ for (i = 0; i <= nGlyphs; ++i) {
+ locaTable[i].idx = i;
+ if (locaFmt) {
+ locaTable[i].origOffset = (int)getU32BE(pos + i*4, &ok);
+ } else {
+ locaTable[i].origOffset = 2 * getU16BE(pos + i*2, &ok);
+ }
+ }
+ qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
+ &cmpTrueTypeLocaOffset);
+ for (i = 0; i < nGlyphs; ++i) {
+ locaTable[i].len = locaTable[i+1].origOffset - locaTable[i].origOffset;
+ }
+ locaTable[nGlyphs].len = 0;
+ qsort(locaTable, nGlyphs + 1, sizeof(TrueTypeLoca),
+ &cmpTrueTypeLocaIdx);
+ pos = 0;
+ for (i = 0; i <= nGlyphs; ++i) {
+ locaTable[i].newOffset = pos;
+ pos += locaTable[i].len;
+ if (pos & 3) {
+ pos += 4 - (pos & 3);
+ }
+ }
+
+ // construct the new 'loca' table
+ locaData = (Guchar *)gmallocn(nGlyphs + 1, (locaFmt ? 4 : 2));
+ for (i = 0; i <= nGlyphs; ++i) {
+ pos = locaTable[i].newOffset;
+ if (locaFmt) {
+ locaData[4*i ] = (Guchar)(pos >> 24);
+ locaData[4*i+1] = (Guchar)(pos >> 16);
+ locaData[4*i+2] = (Guchar)(pos >> 8);
+ locaData[4*i+3] = (Guchar) pos;
+ } else {
+ locaData[2*i ] = (Guchar)(pos >> 9);
+ locaData[2*i+1] = (Guchar)(pos >> 1);
+ }
+ }
+
+ // count the number of tables
+ nNewTables = 0;
+ for (i = 0; i < nT42Tables; ++i) {
+ if (t42Tables[i].required ||
+ seekTable(t42Tables[i].tag) >= 0) {
+ ++nNewTables;
+ }
+ }
+ vmtxTab = NULL; // make gcc happy
+ advance = 0; // make gcc happy
+ if (needVerticalMetrics) {
+ needVhea = seekTable("vhea") < 0;
+ needVmtx = seekTable("vmtx") < 0;
+ if (needVhea || needVmtx) {
+ i = seekTable("head");
+ advance = getU16BE(tables[i].offset + 18, &ok); // units per em
+ if (needVhea) {
+ ++nNewTables;
+ }
+ if (needVmtx) {
+ ++nNewTables;
+ }
+ }
+ }
+
+ // construct the new table headers, including table checksums
+ // (pad each table out to a multiple of 4 bytes)
+ pos = 12 + nNewTables*16;
+ k = 0;
+ for (i = 0; i < nT42Tables; ++i) {
+ length = -1;
+ checksum = 0; // make gcc happy
+ if (i == t42HeadTable) {
+ length = 54;
+ checksum = computeTableChecksum(headData, 54);
+ } else if (i == t42LocaTable) {
+ length = (nGlyphs + 1) * (locaFmt ? 4 : 2);
+ checksum = computeTableChecksum(locaData, length);
+ } else if (i == t42GlyfTable) {
+ length = 0;
+ checksum = 0;
+ glyfPos = tables[seekTable("glyf")].offset;
+ for (j = 0; j < nGlyphs; ++j) {
+ length += locaTable[j].len;
+ if (length & 3) {
+ length += 4 - (length & 3);
+ }
+ if (checkRegion(glyfPos + locaTable[j].origOffset, locaTable[j].len)) {
+ checksum +=
+ computeTableChecksum(file + glyfPos + locaTable[j].origOffset,
+ locaTable[j].len);
+ }
+ }
+ } else {
+ if ((j = seekTable(t42Tables[i].tag)) >= 0) {
+ length = tables[j].len;
+ if (checkRegion(tables[j].offset, length)) {
+ checksum = computeTableChecksum(file + tables[j].offset, length);
+ }
+ } else if (needVerticalMetrics && i == t42VheaTable) {
+ vheaTab[10] = advance / 256; // max advance height
+ vheaTab[11] = advance % 256;
+ length = sizeof(vheaTab);
+ checksum = computeTableChecksum(vheaTab, length);
+ } else if (needVerticalMetrics && i == t42VmtxTable) {
+ length = 4 + (nGlyphs - 1) * 4;
+ vmtxTab = (Guchar *)gmalloc(length);
+ vmtxTab[0] = advance / 256;
+ vmtxTab[1] = advance % 256;
+ for (j = 2; j < length; j += 2) {
+ vmtxTab[j] = 0;
+ vmtxTab[j+1] = 0;
+ }
+ checksum = computeTableChecksum(vmtxTab, length);
+ } else if (t42Tables[i].required) {
+ //~ error(-1, "Embedded TrueType font is missing a required table ('%s')",
+ //~ t42Tables[i].tag);
+ length = 0;
+ checksum = 0;
+ }
+ }
+ if (length >= 0) {
+ newTables[k].tag = ((t42Tables[i].tag[0] & 0xff) << 24) |
+ ((t42Tables[i].tag[1] & 0xff) << 16) |
+ ((t42Tables[i].tag[2] & 0xff) << 8) |
+ (t42Tables[i].tag[3] & 0xff);
+ newTables[k].checksum = checksum;
+ newTables[k].offset = pos;
+ newTables[k].len = length;
+ pos += length;
+ if (pos & 3) {
+ pos += 4 - (length & 3);
+ }
+ ++k;
+ }
+ }
+
+ // construct the table directory
+ tableDir[0] = 0x00; // sfnt version
+ tableDir[1] = 0x01;
+ tableDir[2] = 0x00;
+ tableDir[3] = 0x00;
+ tableDir[4] = 0; // numTables
+ tableDir[5] = nNewTables;
+ tableDir[6] = 0; // searchRange
+ tableDir[7] = (Guchar)128;
+ tableDir[8] = 0; // entrySelector
+ tableDir[9] = 3;
+ tableDir[10] = 0; // rangeShift
+ tableDir[11] = (Guchar)(16 * nNewTables - 128);
+ pos = 12;
+ for (i = 0; i < nNewTables; ++i) {
+ tableDir[pos ] = (Guchar)(newTables[i].tag >> 24);
+ tableDir[pos+ 1] = (Guchar)(newTables[i].tag >> 16);
+ tableDir[pos+ 2] = (Guchar)(newTables[i].tag >> 8);
+ tableDir[pos+ 3] = (Guchar) newTables[i].tag;
+ tableDir[pos+ 4] = (Guchar)(newTables[i].checksum >> 24);
+ tableDir[pos+ 5] = (Guchar)(newTables[i].checksum >> 16);
+ tableDir[pos+ 6] = (Guchar)(newTables[i].checksum >> 8);
+ tableDir[pos+ 7] = (Guchar) newTables[i].checksum;
+ tableDir[pos+ 8] = (Guchar)(newTables[i].offset >> 24);
+ tableDir[pos+ 9] = (Guchar)(newTables[i].offset >> 16);
+ tableDir[pos+10] = (Guchar)(newTables[i].offset >> 8);
+ tableDir[pos+11] = (Guchar) newTables[i].offset;
+ tableDir[pos+12] = (Guchar)(newTables[i].len >> 24);
+ tableDir[pos+13] = (Guchar)(newTables[i].len >> 16);
+ tableDir[pos+14] = (Guchar)(newTables[i].len >> 8);
+ tableDir[pos+15] = (Guchar) newTables[i].len;
+ pos += 16;
+ }
+
+ // compute the font checksum and store it in the head table
+ checksum = computeTableChecksum(tableDir, 12 + nNewTables*16);
+ for (i = 0; i < nNewTables; ++i) {
+ checksum += newTables[i].checksum;
+ }
+ checksum = 0xb1b0afba - checksum; // because the TrueType spec says so
+ headData[ 8] = (Guchar)(checksum >> 24);
+ headData[ 9] = (Guchar)(checksum >> 16);
+ headData[10] = (Guchar)(checksum >> 8);
+ headData[11] = (Guchar) checksum;
+
+ // start the sfnts array
+ if (name) {
+ (*outputFunc)(outputStream, "/", 1);
+ (*outputFunc)(outputStream, name->getCString(), name->getLength());
+ (*outputFunc)(outputStream, " [\n", 3);
+ } else {
+ (*outputFunc)(outputStream, "/sfnts [\n", 9);
+ }
+
+ // write the table directory
+ dumpString(tableDir, 12 + nNewTables*16, outputFunc, outputStream);
+
+ // write the tables
+ for (i = 0; i < nNewTables; ++i) {
+ if (i == t42HeadTable) {
+ dumpString(headData, 54, outputFunc, outputStream);
+ } else if (i == t42LocaTable) {
+ length = (nGlyphs + 1) * (locaFmt ? 4 : 2);
+ dumpString(locaData, length, outputFunc, outputStream);
+ } else if (i == t42GlyfTable) {
+ glyfPos = tables[seekTable("glyf")].offset;
+ for (j = 0; j < nGlyphs; ++j) {
+ if (locaTable[j].len > 0 &&
+ checkRegion(glyfPos + locaTable[j].origOffset, locaTable[j].len)) {
+ dumpString(file + glyfPos + locaTable[j].origOffset,
+ locaTable[j].len, outputFunc, outputStream);
+ }
+ }
+ } else {
+ // length == 0 means the table is missing and the error was
+ // already reported during the construction of the table
+ // headers
+ if ((length = newTables[i].len) > 0) {
+ if ((j = seekTable(t42Tables[i].tag)) >= 0 &&
+ checkRegion(tables[j].offset, tables[j].len)) {
+ dumpString(file + tables[j].offset, tables[j].len,
+ outputFunc, outputStream);
+ } else if (needVerticalMetrics && i == t42VheaTable) {
+ dumpString(vheaTab, length, outputFunc, outputStream);
+ } else if (needVerticalMetrics && i == t42VmtxTable) {
+ dumpString(vmtxTab, length, outputFunc, outputStream);
+ gfree(vmtxTab);
+ }
+ }
+ }
+ }
+
+ // end the sfnts array
+ (*outputFunc)(outputStream, "] def\n", 6);
+
+ gfree(locaData);
+ gfree(locaTable);
+}
+
+void FoFiTrueType::dumpString(Guchar *s, int length,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ GString *buf;
+ int pad, i, j;
+
+ (*outputFunc)(outputStream, "<", 1);
+ for (i = 0; i < length; i += 32) {
+ for (j = 0; j < 32 && i+j < length; ++j) {
+ buf = GString::format("{0:02x}", s[i+j] & 0xff);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (i % (65536 - 32) == 65536 - 64) {
+ (*outputFunc)(outputStream, ">\n<", 3);
+ } else if (i+32 < length) {
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+ }
+ if (length & 3) {
+ pad = 4 - (length & 3);
+ for (i = 0; i < pad; ++i) {
+ (*outputFunc)(outputStream, "00", 2);
+ }
+ }
+ // add an extra zero byte because the Adobe Type 42 spec says so
+ (*outputFunc)(outputStream, "00>\n", 4);
+}
+
+Guint FoFiTrueType::computeTableChecksum(Guchar *data, int length) {
+ Guint checksum, word;
+ int i;
+
+ checksum = 0;
+ for (i = 0; i+3 < length; i += 4) {
+ word = ((data[i ] & 0xff) << 24) +
+ ((data[i+1] & 0xff) << 16) +
+ ((data[i+2] & 0xff) << 8) +
+ (data[i+3] & 0xff);
+ checksum += word;
+ }
+ if (length & 3) {
+ word = 0;
+ i = length & ~3;
+ switch (length & 3) {
+ case 3:
+ word |= (data[i+2] & 0xff) << 8;
+ case 2:
+ word |= (data[i+1] & 0xff) << 16;
+ case 1:
+ word |= (data[i ] & 0xff) << 24;
+ break;
+ }
+ checksum += word;
+ }
+ return checksum;
+}
+
+void FoFiTrueType::parse() {
+ Guint topTag;
+ int pos, ver, i, j;
+
+ parsedOk = gTrue;
+
+ // look for a collection (TTC)
+ topTag = getU32BE(0, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ if (topTag == ttcfTag) {
+ /* TTC font */
+ int dircount;
+
+ dircount = getU32BE(8, &parsedOk);
+ if (!parsedOk)
+ return;
+ if (! dircount) {
+ parsedOk = gFalse;
+ return;
+ }
+
+ if (faceIndex >= dircount)
+ faceIndex = 0;
+ pos = getU32BE(12 + faceIndex * 4, &parsedOk);
+ if (! parsedOk)
+ return;
+ } else {
+ pos = 0;
+ }
+
+ // check the sfnt version
+ ver = getU32BE(pos, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ openTypeCFF = ver == 0x4f54544f; // 'OTTO'
+
+ // read the table directory
+ nTables = getU16BE(pos + 4, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ tables = (TrueTypeTable *)gmallocn(nTables, sizeof(TrueTypeTable));
+ pos += 12;
+ for (i = 0; i < nTables; ++i) {
+ tables[i].tag = getU32BE(pos, &parsedOk);
+ tables[i].checksum = getU32BE(pos + 4, &parsedOk);
+ tables[i].offset = (int)getU32BE(pos + 8, &parsedOk);
+ tables[i].len = (int)getU32BE(pos + 12, &parsedOk);
+ if (tables[i].offset + tables[i].len < tables[i].offset ||
+ tables[i].offset + tables[i].len > len) {
+ parsedOk = gFalse;
+ }
+ pos += 16;
+ }
+ if (!parsedOk) {
+ return;
+ }
+
+ // check for tables that are required by both the TrueType spec and
+ // the Type 42 spec
+ if (seekTable("head") < 0 ||
+ seekTable("hhea") < 0 ||
+ seekTable("maxp") < 0 ||
+ seekTable("hmtx") < 0 ||
+ (!openTypeCFF && seekTable("loca") < 0) ||
+ (!openTypeCFF && seekTable("glyf") < 0) ||
+ (openTypeCFF && seekTable("CFF ") < 0)) {
+ parsedOk = gFalse;
+ return;
+ }
+
+ // read the cmaps
+ if ((i = seekTable("cmap")) >= 0) {
+ pos = tables[i].offset + 2;
+ nCmaps = getU16BE(pos, &parsedOk);
+ pos += 2;
+ if (!parsedOk) {
+ return;
+ }
+ cmaps = (TrueTypeCmap *)gmallocn(nCmaps, sizeof(TrueTypeCmap));
+ for (j = 0; j < nCmaps; ++j) {
+ cmaps[j].platform = getU16BE(pos, &parsedOk);
+ cmaps[j].encoding = getU16BE(pos + 2, &parsedOk);
+ cmaps[j].offset = tables[i].offset + getU32BE(pos + 4, &parsedOk);
+ pos += 8;
+ cmaps[j].fmt = getU16BE(cmaps[j].offset, &parsedOk);
+ cmaps[j].len = getU16BE(cmaps[j].offset + 2, &parsedOk);
+ }
+ if (!parsedOk) {
+ return;
+ }
+ } else {
+ nCmaps = 0;
+ }
+
+ // get the number of glyphs from the maxp table
+ i = seekTable("maxp");
+ nGlyphs = getU16BE(tables[i].offset + 4, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+
+ // get the bbox and loca table format from the head table
+ i = seekTable("head");
+ bbox[0] = getS16BE(tables[i].offset + 36, &parsedOk);
+ bbox[1] = getS16BE(tables[i].offset + 38, &parsedOk);
+ bbox[2] = getS16BE(tables[i].offset + 40, &parsedOk);
+ bbox[3] = getS16BE(tables[i].offset + 42, &parsedOk);
+ locaFmt = getS16BE(tables[i].offset + 50, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+
+ // make sure the loca table is sane (correct length and entries are
+ // in bounds)
+ if (!openTypeCFF) {
+ i = seekTable("loca");
+ if (tables[i].len < 0) {
+ parsedOk = gFalse;
+ return;
+ }
+ if (tables[i].len < (nGlyphs + 1) * (locaFmt ? 4 : 2)) {
+ nGlyphs = tables[i].len / (locaFmt ? 4 : 2) - 1;
+ }
+ for (j = 0; j <= nGlyphs; ++j) {
+ if (locaFmt) {
+ pos = (int)getU32BE(tables[i].offset + j*4, &parsedOk);
+ } else {
+ pos = getU16BE(tables[i].offset + j*2, &parsedOk);
+ }
+ if (pos < 0 || pos > len) {
+ parsedOk = gFalse;
+ }
+ }
+ if (!parsedOk) {
+ return;
+ }
+ }
+
+ // read the post table
+ readPostTable();
+}
+
+void FoFiTrueType::readPostTable() {
+ GString *name;
+ int tablePos, postFmt, stringIdx, stringPos;
+ GBool ok;
+ int i, j, n, m;
+
+ ok = gTrue;
+ if ((i = seekTable("post")) < 0) {
+ return;
+ }
+ tablePos = tables[i].offset;
+ postFmt = getU32BE(tablePos, &ok);
+ if (!ok) {
+ goto err;
+ }
+ if (postFmt == 0x00010000) {
+ nameToGID = new GHash(gTrue);
+ for (i = 0; i < 258; ++i) {
+ nameToGID->add(new GString(macGlyphNames[i]), i);
+ }
+ } else if (postFmt == 0x00020000) {
+ nameToGID = new GHash(gTrue);
+ n = getU16BE(tablePos + 32, &ok);
+ if (!ok) {
+ goto err;
+ }
+ if (n > nGlyphs) {
+ n = nGlyphs;
+ }
+ stringIdx = 0;
+ stringPos = tablePos + 34 + 2*n;
+ for (i = 0; i < n; ++i) {
+ j = getU16BE(tablePos + 34 + 2*i, &ok);
+ if (j < 258) {
+ nameToGID->removeInt(macGlyphNames[j]);
+ nameToGID->add(new GString(macGlyphNames[j]), i);
+ } else {
+ j -= 258;
+ if (j != stringIdx) {
+ for (stringIdx = 0, stringPos = tablePos + 34 + 2*n;
+ stringIdx < j;
+ ++stringIdx, stringPos += 1 + getU8(stringPos, &ok)) ;
+ if (!ok) {
+ goto err;
+ }
+ }
+ m = getU8(stringPos, &ok);
+ if (!ok || !checkRegion(stringPos + 1, m)) {
+ goto err;
+ }
+ name = new GString((char *)&file[stringPos + 1], m);
+ nameToGID->removeInt(name);
+ nameToGID->add(name, i);
+ ++stringIdx;
+ stringPos += 1 + m;
+ }
+ }
+ } else if (postFmt == 0x00028000) {
+ nameToGID = new GHash(gTrue);
+ for (i = 0; i < nGlyphs; ++i) {
+ j = getU8(tablePos + 32 + i, &ok);
+ if (!ok) {
+ goto err;
+ }
+ if (j < 258) {
+ nameToGID->removeInt(macGlyphNames[j]);
+ nameToGID->add(new GString(macGlyphNames[j]), i);
+ }
+ }
+ }
+
+ return;
+
+ err:
+ if (nameToGID) {
+ delete nameToGID;
+ nameToGID = NULL;
+ }
+}
+
+int FoFiTrueType::seekTable(char *tag) {
+ Guint tagI;
+ int i;
+
+ tagI = ((tag[0] & 0xff) << 24) |
+ ((tag[1] & 0xff) << 16) |
+ ((tag[2] & 0xff) << 8) |
+ (tag[3] & 0xff);
+ for (i = 0; i < nTables; ++i) {
+ if (tables[i].tag == tagI) {
+ return i;
+ }
+ }
+ return -1;
+}
diff --git a/kpdf/xpdf/fofi/FoFiType1.cc b/kpdf/xpdf/fofi/FoFiType1.cc
deleted file mode 100644
index 88b35ecc..00000000
--- a/kpdf/xpdf/fofi/FoFiType1.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-//========================================================================
-//
-// FoFiType1.cc
-//
-// Copyright 1999-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "FoFiEncodings.h"
-#include "FoFiType1.h"
-
-//------------------------------------------------------------------------
-// FoFiType1
-//------------------------------------------------------------------------
-
-FoFiType1 *FoFiType1::make(char *fileA, int lenA) {
- return new FoFiType1(fileA, lenA, gFalse);
-}
-
-FoFiType1 *FoFiType1::load(char *fileName) {
- char *fileA;
- int lenA;
-
- if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
- return NULL;
- }
- return new FoFiType1(fileA, lenA, gTrue);
-}
-
-FoFiType1::FoFiType1(char *fileA, int lenA, GBool freeFileDataA):
- FoFiBase(fileA, lenA, freeFileDataA)
-{
- name = NULL;
- encoding = NULL;
- parsed = gFalse;
-}
-
-FoFiType1::~FoFiType1() {
- int i;
-
- if (name) {
- gfree(name);
- }
- if (encoding && encoding != fofiType1StandardEncoding) {
- for (i = 0; i < 256; ++i) {
- gfree(encoding[i]);
- }
- gfree(encoding);
- }
-}
-
-char *FoFiType1::getName() {
- if (!parsed) {
- parse();
- }
- return name;
-}
-
-char **FoFiType1::getEncoding() {
- if (!parsed) {
- parse();
- }
- return encoding;
-}
-
-void FoFiType1::writeEncoded(char **newEncoding,
- FoFiOutputFunc outputFunc, void *outputStream) {
- char buf[512];
- char *line, *line2, *p;
- int i;
-
- // copy everything up to the encoding
- for (line = (char *)file;
- line && strncmp(line, "/Encoding", 9);
- line = getNextLine(line)) ;
- if (!line) {
- // no encoding - just copy the whole font file
- (*outputFunc)(outputStream, (char *)file, len);
- return;
- }
- (*outputFunc)(outputStream, (char *)file, line - (char *)file);
-
- // write the new encoding
- (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
- (*outputFunc)(outputStream,
- "0 1 255 {1 index exch /.notdef put} for\n", 40);
- for (i = 0; i < 256; ++i) {
- if (newEncoding[i]) {
- sprintf(buf, "dup %d /%s put\n", i, newEncoding[i]);
- (*outputFunc)(outputStream, buf, strlen(buf));
- }
- }
- (*outputFunc)(outputStream, "readonly def\n", 13);
-
- // find the end of the encoding data
- //~ this ought to parse PostScript tokens
- if (!strncmp(line, "/Encoding StandardEncoding def", 30)) {
- line = getNextLine(line);
- } else {
- // skip "/Encoding" + one whitespace char,
- // then look for 'def' preceded by PostScript whitespace
- p = line + 10;
- line = NULL;
- for (; p < (char *)file + len; ++p) {
- if ((*p == ' ' || *p == '\t' || *p == '\x0a' ||
- *p == '\x0d' || *p == '\x0c' || *p == '\0') &&
- p + 4 <= (char *)file + len &&
- !strncmp(p + 1, "def", 3)) {
- line = p + 4;
- break;
- }
- }
- }
-
- // some fonts have two /Encoding entries in their dictionary, so we
- // check for a second one here
- if (line) {
- for (line2 = line, i = 0;
- i < 20 && line2 && strncmp(line2, "/Encoding", 9);
- line2 = getNextLine(line2), ++i) ;
- if (i < 20 && line2) {
- (*outputFunc)(outputStream, line, line2 - line);
- if (!strncmp(line2, "/Encoding StandardEncoding def", 30)) {
- line = getNextLine(line2);
- } else {
- // skip "/Encoding" + one whitespace char,
- // then look for 'def' preceded by PostScript whitespace
- p = line2 + 10;
- line = NULL;
- for (; p < (char *)file + len; ++p) {
- if ((*p == ' ' || *p == '\t' || *p == '\x0a' ||
- *p == '\x0d' || *p == '\x0c' || *p == '\0') &&
- p + 4 <= (char *)file + len &&
- !strncmp(p + 1, "def", 3)) {
- line = p + 4;
- break;
- }
- }
- }
- }
-
- // copy everything after the encoding
- if (line) {
- (*outputFunc)(outputStream, line, ((char *)file + len) - line);
- }
- }
-}
-
-char *FoFiType1::getNextLine(char *line) {
- while (line < (char *)file + len && *line != '\x0a' && *line != '\x0d') {
- ++line;
- }
- if (line < (char *)file + len && *line == '\x0d') {
- ++line;
- }
- if (line < (char *)file + len && *line == '\x0a') {
- ++line;
- }
- if (line >= (char *)file + len) {
- return NULL;
- }
- return line;
-}
-
-void FoFiType1::parse() {
- char *line, *line1, *p, *p2;
- char buf[256];
- char c;
- int n, code, i, j;
-
- for (i = 1, line = (char *)file;
- i <= 100 && line && (!name || !encoding);
- ++i) {
-
- // get font name
- if (!name && !strncmp(line, "/FontName", 9)) {
- strncpy(buf, line, 255);
- buf[255] = '\0';
- if ((p = strchr(buf+9, '/')) &&
- (p = strtok(p+1, " \t\n\r"))) {
- name = copyString(p);
- }
- line = getNextLine(line);
-
- // get encoding
- } else if (!encoding &&
- !strncmp(line, "/Encoding StandardEncoding def", 30)) {
- encoding = fofiType1StandardEncoding;
- } else if (!encoding &&
- !strncmp(line, "/Encoding 256 array", 19)) {
- encoding = (char **)gmallocn(256, sizeof(char *));
- for (j = 0; j < 256; ++j) {
- encoding[j] = NULL;
- }
- for (j = 0, line = getNextLine(line);
- j < 300 && line && (line1 = getNextLine(line));
- ++j, line = line1) {
- if ((n = line1 - line) > 255) {
- n = 255;
- }
- strncpy(buf, line, n);
- buf[n] = '\0';
- for (p = buf; *p == ' ' || *p == '\t'; ++p) ;
- if (!strncmp(p, "dup", 3)) {
- for (p += 3; *p == ' ' || *p == '\t'; ++p) ;
- for (p2 = p; *p2 >= '0' && *p2 <= '9'; ++p2) ;
- if (*p2) {
- c = *p2;
- *p2 = '\0';
- code = atoi(p);
- *p2 = c;
- if (code == 8 && *p2 == '#') {
- code = 0;
- for (++p2; *p2 >= '0' && *p2 <= '7'; ++p2) {
- code = code * 8 + (*p2 - '0');
- }
- }
- if (code >= 0 && code < 256) {
- for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
- if (*p == '/') {
- ++p;
- for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
- *p2 = '\0';
- encoding[code] = copyString(p);
- }
- }
- }
- } else {
- p = strtok(buf, " \t\n\r");
- if (p)
- {
- if (!strcmp(p, "def")) break;
- if (!strcmp(p, "readonly")) break;
- // the spec does not says this but i'm mantaining old xpdf behaviour that accepts "foo def" as end of the encoding array
- p = strtok(buf, " \t\n\r");
- if (p && !strcmp(p, "def")) break;
- }
- }
- }
- //~ check for getinterval/putinterval junk
-
- } else {
- line = getNextLine(line);
- }
- }
-
- parsed = gTrue;
-}
diff --git a/kpdf/xpdf/fofi/FoFiType1.cpp b/kpdf/xpdf/fofi/FoFiType1.cpp
new file mode 100644
index 00000000..f6e676a2
--- /dev/null
+++ b/kpdf/xpdf/fofi/FoFiType1.cpp
@@ -0,0 +1,257 @@
+//========================================================================
+//
+// FoFiType1.cpp
+//
+// Copyright 1999-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "FoFiEncodings.h"
+#include "FoFiType1.h"
+
+//------------------------------------------------------------------------
+// FoFiType1
+//------------------------------------------------------------------------
+
+FoFiType1 *FoFiType1::make(char *fileA, int lenA) {
+ return new FoFiType1(fileA, lenA, gFalse);
+}
+
+FoFiType1 *FoFiType1::load(char *fileName) {
+ char *fileA;
+ int lenA;
+
+ if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
+ return NULL;
+ }
+ return new FoFiType1(fileA, lenA, gTrue);
+}
+
+FoFiType1::FoFiType1(char *fileA, int lenA, GBool freeFileDataA):
+ FoFiBase(fileA, lenA, freeFileDataA)
+{
+ name = NULL;
+ encoding = NULL;
+ parsed = gFalse;
+}
+
+FoFiType1::~FoFiType1() {
+ int i;
+
+ if (name) {
+ gfree(name);
+ }
+ if (encoding && encoding != fofiType1StandardEncoding) {
+ for (i = 0; i < 256; ++i) {
+ gfree(encoding[i]);
+ }
+ gfree(encoding);
+ }
+}
+
+char *FoFiType1::getName() {
+ if (!parsed) {
+ parse();
+ }
+ return name;
+}
+
+char **FoFiType1::getEncoding() {
+ if (!parsed) {
+ parse();
+ }
+ return encoding;
+}
+
+void FoFiType1::writeEncoded(char **newEncoding,
+ FoFiOutputFunc outputFunc, void *outputStream) {
+ char buf[512];
+ char *line, *line2, *p;
+ int i;
+
+ // copy everything up to the encoding
+ for (line = (char *)file;
+ line && strncmp(line, "/Encoding", 9);
+ line = getNextLine(line)) ;
+ if (!line) {
+ // no encoding - just copy the whole font file
+ (*outputFunc)(outputStream, (char *)file, len);
+ return;
+ }
+ (*outputFunc)(outputStream, (char *)file, line - (char *)file);
+
+ // write the new encoding
+ (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
+ (*outputFunc)(outputStream,
+ "0 1 255 {1 index exch /.notdef put} for\n", 40);
+ for (i = 0; i < 256; ++i) {
+ if (newEncoding[i]) {
+ sprintf(buf, "dup %d /%s put\n", i, newEncoding[i]);
+ (*outputFunc)(outputStream, buf, strlen(buf));
+ }
+ }
+ (*outputFunc)(outputStream, "readonly def\n", 13);
+
+ // find the end of the encoding data
+ //~ this ought to parse PostScript tokens
+ if (!strncmp(line, "/Encoding StandardEncoding def", 30)) {
+ line = getNextLine(line);
+ } else {
+ // skip "/Encoding" + one whitespace char,
+ // then look for 'def' preceded by PostScript whitespace
+ p = line + 10;
+ line = NULL;
+ for (; p < (char *)file + len; ++p) {
+ if ((*p == ' ' || *p == '\t' || *p == '\x0a' ||
+ *p == '\x0d' || *p == '\x0c' || *p == '\0') &&
+ p + 4 <= (char *)file + len &&
+ !strncmp(p + 1, "def", 3)) {
+ line = p + 4;
+ break;
+ }
+ }
+ }
+
+ // some fonts have two /Encoding entries in their dictionary, so we
+ // check for a second one here
+ if (line) {
+ for (line2 = line, i = 0;
+ i < 20 && line2 && strncmp(line2, "/Encoding", 9);
+ line2 = getNextLine(line2), ++i) ;
+ if (i < 20 && line2) {
+ (*outputFunc)(outputStream, line, line2 - line);
+ if (!strncmp(line2, "/Encoding StandardEncoding def", 30)) {
+ line = getNextLine(line2);
+ } else {
+ // skip "/Encoding" + one whitespace char,
+ // then look for 'def' preceded by PostScript whitespace
+ p = line2 + 10;
+ line = NULL;
+ for (; p < (char *)file + len; ++p) {
+ if ((*p == ' ' || *p == '\t' || *p == '\x0a' ||
+ *p == '\x0d' || *p == '\x0c' || *p == '\0') &&
+ p + 4 <= (char *)file + len &&
+ !strncmp(p + 1, "def", 3)) {
+ line = p + 4;
+ break;
+ }
+ }
+ }
+ }
+
+ // copy everything after the encoding
+ if (line) {
+ (*outputFunc)(outputStream, line, ((char *)file + len) - line);
+ }
+ }
+}
+
+char *FoFiType1::getNextLine(char *line) {
+ while (line < (char *)file + len && *line != '\x0a' && *line != '\x0d') {
+ ++line;
+ }
+ if (line < (char *)file + len && *line == '\x0d') {
+ ++line;
+ }
+ if (line < (char *)file + len && *line == '\x0a') {
+ ++line;
+ }
+ if (line >= (char *)file + len) {
+ return NULL;
+ }
+ return line;
+}
+
+void FoFiType1::parse() {
+ char *line, *line1, *p, *p2;
+ char buf[256];
+ char c;
+ int n, code, i, j;
+
+ for (i = 1, line = (char *)file;
+ i <= 100 && line && (!name || !encoding);
+ ++i) {
+
+ // get font name
+ if (!name && !strncmp(line, "/FontName", 9)) {
+ strncpy(buf, line, 255);
+ buf[255] = '\0';
+ if ((p = strchr(buf+9, '/')) &&
+ (p = strtok(p+1, " \t\n\r"))) {
+ name = copyString(p);
+ }
+ line = getNextLine(line);
+
+ // get encoding
+ } else if (!encoding &&
+ !strncmp(line, "/Encoding StandardEncoding def", 30)) {
+ encoding = fofiType1StandardEncoding;
+ } else if (!encoding &&
+ !strncmp(line, "/Encoding 256 array", 19)) {
+ encoding = (char **)gmallocn(256, sizeof(char *));
+ for (j = 0; j < 256; ++j) {
+ encoding[j] = NULL;
+ }
+ for (j = 0, line = getNextLine(line);
+ j < 300 && line && (line1 = getNextLine(line));
+ ++j, line = line1) {
+ if ((n = line1 - line) > 255) {
+ n = 255;
+ }
+ strncpy(buf, line, n);
+ buf[n] = '\0';
+ for (p = buf; *p == ' ' || *p == '\t'; ++p) ;
+ if (!strncmp(p, "dup", 3)) {
+ for (p += 3; *p == ' ' || *p == '\t'; ++p) ;
+ for (p2 = p; *p2 >= '0' && *p2 <= '9'; ++p2) ;
+ if (*p2) {
+ c = *p2;
+ *p2 = '\0';
+ code = atoi(p);
+ *p2 = c;
+ if (code == 8 && *p2 == '#') {
+ code = 0;
+ for (++p2; *p2 >= '0' && *p2 <= '7'; ++p2) {
+ code = code * 8 + (*p2 - '0');
+ }
+ }
+ if (code >= 0 && code < 256) {
+ for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
+ if (*p == '/') {
+ ++p;
+ for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
+ *p2 = '\0';
+ encoding[code] = copyString(p);
+ }
+ }
+ }
+ } else {
+ p = strtok(buf, " \t\n\r");
+ if (p)
+ {
+ if (!strcmp(p, "def")) break;
+ if (!strcmp(p, "readonly")) break;
+ // the spec does not says this but i'm mantaining old xpdf behaviour that accepts "foo def" as end of the encoding array
+ p = strtok(buf, " \t\n\r");
+ if (p && !strcmp(p, "def")) break;
+ }
+ }
+ }
+ //~ check for getinterval/putinterval junk
+
+ } else {
+ line = getNextLine(line);
+ }
+ }
+
+ parsed = gTrue;
+}
diff --git a/kpdf/xpdf/fofi/FoFiType1C.cc b/kpdf/xpdf/fofi/FoFiType1C.cc
deleted file mode 100644
index 3b28f321..00000000
--- a/kpdf/xpdf/fofi/FoFiType1C.cc
+++ /dev/null
@@ -1,2603 +0,0 @@
-//========================================================================
-//
-// FoFiType1C.cc
-//
-// Copyright 1999-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include "gmem.h"
-#include "GString.h"
-#include "FoFiEncodings.h"
-#include "FoFiType1C.h"
-
-//------------------------------------------------------------------------
-
-static char hexChars[17] = "0123456789ABCDEF";
-
-//------------------------------------------------------------------------
-// FoFiType1C
-//------------------------------------------------------------------------
-
-FoFiType1C *FoFiType1C::make(char *fileA, int lenA) {
- FoFiType1C *ff;
-
- ff = new FoFiType1C(fileA, lenA, gFalse);
- if (!ff->parse()) {
- delete ff;
- return NULL;
- }
- return ff;
-}
-
-FoFiType1C *FoFiType1C::load(char *fileName) {
- FoFiType1C *ff;
- char *fileA;
- int lenA;
-
- if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
- return NULL;
- }
- ff = new FoFiType1C(fileA, lenA, gTrue);
- if (!ff->parse()) {
- delete ff;
- return NULL;
- }
- return ff;
-}
-
-FoFiType1C::FoFiType1C(char *fileA, int lenA, GBool freeFileDataA):
- FoFiBase(fileA, lenA, freeFileDataA)
-{
- name = NULL;
- encoding = NULL;
- privateDicts = NULL;
- fdSelect = NULL;
- charset = NULL;
-}
-
-FoFiType1C::~FoFiType1C() {
- int i;
-
- if (name) {
- delete name;
- }
- if (encoding &&
- encoding != fofiType1StandardEncoding &&
- encoding != fofiType1ExpertEncoding) {
- for (i = 0; i < 256; ++i) {
- gfree(encoding[i]);
- }
- gfree(encoding);
- }
- if (privateDicts) {
- gfree(privateDicts);
- }
- if (fdSelect) {
- gfree(fdSelect);
- }
- if (charset &&
- charset != fofiType1CISOAdobeCharset &&
- charset != fofiType1CExpertCharset &&
- charset != fofiType1CExpertSubsetCharset) {
- gfree(charset);
- }
-}
-
-char *FoFiType1C::getName() {
- return name ? name->getCString() : (char *)NULL;
-}
-
-char **FoFiType1C::getEncoding() {
- return encoding;
-}
-
-Gushort *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
- Gushort *map;
- int n, i;
-
- // a CID font's top dict has ROS as the first operator
- if (topDict.firstOp != 0x0c1e) {
- *nCIDs = 0;
- return NULL;
- }
-
- // in a CID font, the charset data is the GID-to-CID mapping, so all
- // we have to do is reverse it
- n = 0;
- for (i = 0; i < nGlyphs; ++i) {
- if (charset[i] > n) {
- n = charset[i];
- }
- }
- ++n;
- map = (Gushort *)gmallocn(n, sizeof(Gushort));
- memset(map, 0, n * sizeof(Gushort));
- for (i = 0; i < nGlyphs; ++i) {
- map[charset[i]] = i;
- }
- *nCIDs = n;
- return map;
-}
-
-void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- int psNameLen;
- Type1CEexecBuf eb;
- Type1CIndex subrIdx;
- Type1CIndexVal val;
- GString *buf;
- char buf2[256];
- char **enc;
- GBool ok;
- int i;
-
- if (psName) {
- psNameLen = strlen(psName);
- } else {
- psName = name->getCString();
- psNameLen = name->getLength();
- }
-
- // write header and font dictionary, up to encoding
- ok = gTrue;
- (*outputFunc)(outputStream, "%!FontType1-1.0: ", 17);
- (*outputFunc)(outputStream, psName, psNameLen);
- if (topDict.versionSID != 0) {
- getString(topDict.versionSID, buf2, &ok);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- }
- (*outputFunc)(outputStream, "\n", 1);
- // the dictionary needs room for 12 entries: the following 9, plus
- // Private and CharStrings (in the eexec section) and FID (which is
- // added by definefont)
- (*outputFunc)(outputStream, "12 dict begin\n", 14);
- (*outputFunc)(outputStream, "/FontInfo 10 dict dup begin\n", 28);
- if (topDict.versionSID != 0) {
- (*outputFunc)(outputStream, "/version (", 10);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") readonly def\n", 15);
- }
- if (topDict.noticeSID != 0) {
- getString(topDict.noticeSID, buf2, &ok);
- (*outputFunc)(outputStream, "/Notice (", 9);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") readonly def\n", 15);
- }
- if (topDict.copyrightSID != 0) {
- getString(topDict.copyrightSID, buf2, &ok);
- (*outputFunc)(outputStream, "/Copyright (", 12);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") readonly def\n", 15);
- }
- if (topDict.fullNameSID != 0) {
- getString(topDict.fullNameSID, buf2, &ok);
- (*outputFunc)(outputStream, "/FullName (", 11);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") readonly def\n", 15);
- }
- if (topDict.familyNameSID != 0) {
- getString(topDict.familyNameSID, buf2, &ok);
- (*outputFunc)(outputStream, "/FamilyName (", 13);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") readonly def\n", 15);
- }
- if (topDict.weightSID != 0) {
- getString(topDict.weightSID, buf2, &ok);
- (*outputFunc)(outputStream, "/Weight (", 9);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") readonly def\n", 15);
- }
- if (topDict.isFixedPitch) {
- (*outputFunc)(outputStream, "/isFixedPitch true def\n", 23);
- } else {
- (*outputFunc)(outputStream, "/isFixedPitch false def\n", 24);
- }
- buf = GString::format("/ItalicAngle {0:.4g} def\n", topDict.italicAngle);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format("/UnderlinePosition {0:.4g} def\n",
- topDict.underlinePosition);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format("/UnderlineThickness {0:.4g} def\n",
- topDict.underlineThickness);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "end readonly def\n", 17);
- (*outputFunc)(outputStream, "/FontName /", 11);
- (*outputFunc)(outputStream, psName, psNameLen);
- (*outputFunc)(outputStream, " def\n", 5);
- buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/FontType 1 def\n", 16);
- buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] readonly def\n",
- topDict.fontMatrix[0], topDict.fontMatrix[1],
- topDict.fontMatrix[2], topDict.fontMatrix[3],
- topDict.fontMatrix[4], topDict.fontMatrix[5]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] readonly def\n",
- topDict.fontBBox[0], topDict.fontBBox[1],
- topDict.fontBBox[2], topDict.fontBBox[3]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format("/StrokeWidth {0:.4g} def\n", topDict.strokeWidth);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- if (topDict.uniqueID != 0) {
- buf = GString::format("/UniqueID {0:d} def\n", topDict.uniqueID);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
-
- // write the encoding
- (*outputFunc)(outputStream, "/Encoding ", 10);
- if (!newEncoding && encoding == fofiType1StandardEncoding) {
- (*outputFunc)(outputStream, "StandardEncoding def\n", 21);
- } else {
- (*outputFunc)(outputStream, "256 array\n", 10);
- (*outputFunc)(outputStream,
- "0 1 255 {1 index exch /.notdef put} for\n", 40);
- enc = newEncoding ? newEncoding : encoding;
- for (i = 0; i < 256; ++i) {
- if (enc[i]) {
- buf = GString::format("dup {0:d} /{1:s} put\n", i, enc[i]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- }
- (*outputFunc)(outputStream, "readonly def\n", 13);
- }
- (*outputFunc)(outputStream, "currentdict end\n", 16);
-
- // start the binary section
- (*outputFunc)(outputStream, "currentfile eexec\n", 18);
- eb.outputFunc = outputFunc;
- eb.outputStream = outputStream;
- eb.ascii = ascii;
- eb.r1 = 55665;
- eb.line = 0;
-
- // write the private dictionary
- eexecWrite(&eb, "\x83\xca\x73\xd5");
- eexecWrite(&eb, "dup /Private 32 dict dup begin\n");
- eexecWrite(&eb, "/RD {string currentfile exch readstring pop}"
- " executeonly def\n");
- eexecWrite(&eb, "/ND {noaccess def} executeonly def\n");
- eexecWrite(&eb, "/NP {noaccess put} executeonly def\n");
- eexecWrite(&eb, "/MinFeature {16 16} def\n");
- eexecWrite(&eb, "/password 5839 def\n");
- if (privateDicts[0].nBlueValues) {
- eexecWrite(&eb, "/BlueValues [");
- for (i = 0; i < privateDicts[0].nBlueValues; ++i) {
- buf = GString::format("{0:s}{1:d}",
- i > 0 ? " " : "", privateDicts[0].blueValues[i]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[0].nOtherBlues) {
- eexecWrite(&eb, "/OtherBlues [");
- for (i = 0; i < privateDicts[0].nOtherBlues; ++i) {
- buf = GString::format("{0:s}{1:d}",
- i > 0 ? " " : "", privateDicts[0].otherBlues[i]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[0].nFamilyBlues) {
- eexecWrite(&eb, "/FamilyBlues [");
- for (i = 0; i < privateDicts[0].nFamilyBlues; ++i) {
- buf = GString::format("{0:s}{1:d}",
- i > 0 ? " " : "", privateDicts[0].familyBlues[i]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[0].nFamilyOtherBlues) {
- eexecWrite(&eb, "/FamilyOtherBlues [");
- for (i = 0; i < privateDicts[0].nFamilyOtherBlues; ++i) {
- buf = GString::format("{0:s}{1:d}", i > 0 ? " " : "",
- privateDicts[0].familyOtherBlues[i]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[0].blueScale != 0.039625) {
- buf = GString::format("/BlueScale {0:.4g} def\n",
- privateDicts[0].blueScale);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].blueShift != 7) {
- buf = GString::format("/BlueShift {0:d} def\n", privateDicts[0].blueShift);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].blueFuzz != 1) {
- buf = GString::format("/BlueFuzz {0:d} def\n", privateDicts[0].blueFuzz);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].hasStdHW) {
- buf = GString::format("/StdHW [{0:.4g}] def\n", privateDicts[0].stdHW);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].hasStdVW) {
- buf = GString::format("/StdVW [{0:.4g}] def\n", privateDicts[0].stdVW);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].nStemSnapH) {
- eexecWrite(&eb, "/StemSnapH [");
- for (i = 0; i < privateDicts[0].nStemSnapH; ++i) {
- buf = GString::format("{0:s}{1:.4g}",
- i > 0 ? " " : "", privateDicts[0].stemSnapH[i]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[0].nStemSnapV) {
- eexecWrite(&eb, "/StemSnapV [");
- for (i = 0; i < privateDicts[0].nStemSnapV; ++i) {
- buf = GString::format("{0:s}{1:.4g}",
- i > 0 ? " " : "", privateDicts[0].stemSnapV[i]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[0].hasForceBold) {
- buf = GString::format("/ForceBold {0:s} def\n",
- privateDicts[0].forceBold ? "true" : "false");
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].forceBoldThreshold != 0) {
- buf = GString::format("/ForceBoldThreshold {0:.4g} def\n",
- privateDicts[0].forceBoldThreshold);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].languageGroup != 0) {
- buf = GString::format("/LanguageGroup {0:d} def\n",
- privateDicts[0].languageGroup);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[0].expansionFactor != 0.06) {
- buf = GString::format("/ExpansionFactor {0:.4g} def\n",
- privateDicts[0].expansionFactor);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
-
- // set up subroutines
- ok = gTrue;
- getIndex(privateDicts[0].subrsOffset, &subrIdx, &ok);
- if (!ok) {
- subrIdx.pos = -1;
- }
-
- // write the CharStrings
- buf = GString::format("2 index /CharStrings {0:d} dict dup begin\n",
- nGlyphs);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- for (i = 0; i < nGlyphs; ++i) {
- ok = gTrue;
- getIndexVal(&charStringsIdx, i, &val, &ok);
- if (ok) {
- getString(charset[i], buf2, &ok);
- if (ok) {
- eexecCvtGlyph(&eb, buf2, val.pos, val.len, &subrIdx, &privateDicts[0]);
- }
- }
- }
- eexecWrite(&eb, "end\n");
- eexecWrite(&eb, "end\n");
- eexecWrite(&eb, "readonly put\n");
- eexecWrite(&eb, "noaccess put\n");
- eexecWrite(&eb, "dup /FontName get exch definefont pop\n");
- eexecWrite(&eb, "mark currentfile closefile\n");
-
- // trailer
- if (ascii && eb.line > 0) {
- (*outputFunc)(outputStream, "\n", 1);
- }
- for (i = 0; i < 8; ++i) {
- (*outputFunc)(outputStream, "0000000000000000000000000000000000000000000000000000000000000000\n", 65);
- }
- (*outputFunc)(outputStream, "cleartomark\n", 12);
-}
-
-void FoFiType1C::convertToCIDType0(char *psName,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- int *cidMap;
- GString *charStrings;
- int *charStringOffsets;
- Type1CIndex subrIdx;
- Type1CIndexVal val;
- int nCIDs, gdBytes;
- GString *buf;
- char buf2[256];
- GBool ok;
- int gid, offset, n, i, j, k;
-
- // compute the CID count and build the CID-to-GID mapping
- nCIDs = 0;
- for (i = 0; i < nGlyphs; ++i) {
- if (charset[i] >= nCIDs) {
- nCIDs = charset[i] + 1;
- }
- }
- cidMap = (int *)gmallocn(nCIDs, sizeof(int));
- for (i = 0; i < nCIDs; ++i) {
- cidMap[i] = -1;
- }
- for (i = 0; i < nGlyphs; ++i) {
- cidMap[charset[i]] = i;
- }
-
- // build the charstrings
- charStrings = new GString();
- charStringOffsets = (int *)gmallocn(nCIDs + 1, sizeof(int));
- for (i = 0; i < nCIDs; ++i) {
- charStringOffsets[i] = charStrings->getLength();
- if ((gid = cidMap[i]) >= 0) {
- ok = gTrue;
- getIndexVal(&charStringsIdx, gid, &val, &ok);
- if (ok) {
- getIndex(privateDicts[fdSelect[gid]].subrsOffset, &subrIdx, &ok);
- if (!ok) {
- subrIdx.pos = -1;
- }
- cvtGlyph(val.pos, val.len, charStrings,
- &subrIdx, &privateDicts[fdSelect[gid]], gTrue);
- }
- }
- }
- charStringOffsets[nCIDs] = charStrings->getLength();
-
- // compute gdBytes = number of bytes needed for charstring offsets
- // (offset size needs to account for the charstring offset table,
- // with a worst case of five bytes per entry, plus the charstrings
- // themselves)
- i = (nCIDs + 1) * 5 + charStrings->getLength();
- if (i < 0x100) {
- gdBytes = 1;
- } else if (i < 0x10000) {
- gdBytes = 2;
- } else if (i < 0x1000000) {
- gdBytes = 3;
- } else {
- gdBytes = 4;
- }
-
- // begin the font dictionary
- (*outputFunc)(outputStream, "/CIDInit /ProcSet findresource begin\n", 37);
- (*outputFunc)(outputStream, "20 dict begin\n", 14);
- (*outputFunc)(outputStream, "/CIDFontName /", 14);
- (*outputFunc)(outputStream, psName, strlen(psName));
- (*outputFunc)(outputStream, " def\n", 5);
- (*outputFunc)(outputStream, "/CIDFontType 0 def\n", 19);
- (*outputFunc)(outputStream, "/CIDSystemInfo 3 dict dup begin\n", 32);
- if (topDict.registrySID > 0 && topDict.orderingSID > 0) {
- ok = gTrue;
- getString(topDict.registrySID, buf2, &ok);
- if (ok) {
- (*outputFunc)(outputStream, " /Registry (", 13);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") def\n", 6);
- }
- ok = gTrue;
- getString(topDict.orderingSID, buf2, &ok);
- if (ok) {
- (*outputFunc)(outputStream, " /Ordering (", 13);
- (*outputFunc)(outputStream, buf2, strlen(buf2));
- (*outputFunc)(outputStream, ") def\n", 6);
- }
- } else {
- (*outputFunc)(outputStream, " /Registry (Adobe) def\n", 24);
- (*outputFunc)(outputStream, " /Ordering (Identity) def\n", 27);
- }
- buf = GString::format(" /Supplement {0:d} def\n", topDict.supplement);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "end def\n", 8);
- if (topDict.hasFontMatrix) {
- buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
- topDict.fontMatrix[0], topDict.fontMatrix[1],
- topDict.fontMatrix[2], topDict.fontMatrix[3],
- topDict.fontMatrix[4], topDict.fontMatrix[5]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- } else if (privateDicts[0].hasFontMatrix) {
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- } else {
- (*outputFunc)(outputStream,
- "/FontMatrix [0.001 0 0 0.001 0 0] def\n", 38);
- }
- buf = GString::format("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
- topDict.fontBBox[0], topDict.fontBBox[1],
- topDict.fontBBox[2], topDict.fontBBox[3]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/FontInfo 1 dict dup begin\n", 27);
- (*outputFunc)(outputStream, " /FSType 8 def\n", 16);
- (*outputFunc)(outputStream, "end def\n", 8);
-
- // CIDFont-specific entries
- buf = GString::format("/CIDCount {0:d} def\n", nCIDs);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/FDBytes 1 def\n", 15);
- buf = GString::format("/GDBytes {0:d} def\n", gdBytes);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/CIDMapOffset 0 def\n", 20);
- if (topDict.paintType != 0) {
- buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format("/StrokeWidth {0:.4g} def\n", topDict.strokeWidth);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
-
- // FDArray entry
- buf = GString::format("/FDArray {0:d} array\n", nFDs);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- for (i = 0; i < nFDs; ++i) {
- buf = GString::format("dup {0:d} 10 dict begin\n", i);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/FontType 1 def\n", 16);
- if (privateDicts[i].hasFontMatrix) {
- buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
- privateDicts[i].fontMatrix[0],
- privateDicts[i].fontMatrix[1],
- privateDicts[i].fontMatrix[2],
- privateDicts[i].fontMatrix[3],
- privateDicts[i].fontMatrix[4],
- privateDicts[i].fontMatrix[5]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- } else {
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- }
- buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/Private 32 dict begin\n", 23);
- if (privateDicts[i].nBlueValues) {
- (*outputFunc)(outputStream, "/BlueValues [", 13);
- for (j = 0; j < privateDicts[i].nBlueValues; ++j) {
- buf = GString::format("{0:s}{1:d}",
- j > 0 ? " " : "", privateDicts[i].blueValues[j]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- }
- if (privateDicts[i].nOtherBlues) {
- (*outputFunc)(outputStream, "/OtherBlues [", 13);
- for (j = 0; j < privateDicts[i].nOtherBlues; ++j) {
- buf = GString::format("{0:s}{1:d}",
- j > 0 ? " " : "", privateDicts[i].otherBlues[j]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- }
- if (privateDicts[i].nFamilyBlues) {
- (*outputFunc)(outputStream, "/FamilyBlues [", 14);
- for (j = 0; j < privateDicts[i].nFamilyBlues; ++j) {
- buf = GString::format("{0:s}{1:d}",
- j > 0 ? " " : "",
- privateDicts[i].familyBlues[j]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- }
- if (privateDicts[i].nFamilyOtherBlues) {
- (*outputFunc)(outputStream, "/FamilyOtherBlues [", 19);
- for (j = 0; j < privateDicts[i].nFamilyOtherBlues; ++j) {
- buf = GString::format("{0:s}{1:d}", j > 0 ? " " : "",
- privateDicts[i].familyOtherBlues[j]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- }
- if (privateDicts[i].blueScale != 0.039625) {
- buf = GString::format("/BlueScale {0:.4g} def\n",
- privateDicts[i].blueScale);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].blueShift != 7) {
- buf = GString::format("/BlueShift {0:d} def\n",
- privateDicts[i].blueShift);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].blueFuzz != 1) {
- buf = GString::format("/BlueFuzz {0:d} def\n", privateDicts[i].blueFuzz);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].hasStdHW) {
- buf = GString::format("/StdHW [{0:.4g}] def\n", privateDicts[i].stdHW);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].hasStdVW) {
- buf = GString::format("/StdVW [{0:.4g}] def\n", privateDicts[i].stdVW);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].nStemSnapH) {
- (*outputFunc)(outputStream, "/StemSnapH [", 12);
- for (j = 0; j < privateDicts[i].nStemSnapH; ++j) {
- buf = GString::format("{0:s}{1:.4g}",
- j > 0 ? " " : "", privateDicts[i].stemSnapH[j]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- }
- if (privateDicts[i].nStemSnapV) {
- (*outputFunc)(outputStream, "/StemSnapV [", 12);
- for (j = 0; j < privateDicts[i].nStemSnapV; ++j) {
- buf = GString::format("{0:s}{1:.4g}",
- j > 0 ? " " : "", privateDicts[i].stemSnapV[j]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- }
- if (privateDicts[i].hasForceBold) {
- buf = GString::format("/ForceBold {0:s} def\n",
- privateDicts[i].forceBold ? "true" : "false");
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].forceBoldThreshold != 0) {
- buf = GString::format("/ForceBoldThreshold {0:.4g} def\n",
- privateDicts[i].forceBoldThreshold);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].languageGroup != 0) {
- buf = GString::format("/LanguageGroup {0:d} def\n",
- privateDicts[i].languageGroup);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (privateDicts[i].expansionFactor != 0.06) {
- buf = GString::format("/ExpansionFactor {0:.4g} def\n",
- privateDicts[i].expansionFactor);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "currentdict end def\n", 20);
- (*outputFunc)(outputStream, "currentdict end put\n", 20);
- }
- (*outputFunc)(outputStream, "def\n", 4);
-
- // start the binary section
- offset = (nCIDs + 1) * (1 + gdBytes);
- buf = GString::format("(Hex) {0:d} StartData\n",
- offset + charStrings->getLength());
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
-
- // write the charstring offset (CIDMap) table
- for (i = 0; i <= nCIDs; i += 6) {
- for (j = 0; j < 6 && i+j <= nCIDs; ++j) {
- if (i+j < nCIDs && cidMap[i+j] >= 0) {
- buf2[0] = (char)fdSelect[cidMap[i+j]];
- } else {
- buf2[0] = (char)0;
- }
- n = offset + charStringOffsets[i+j];
- for (k = gdBytes; k >= 1; --k) {
- buf2[k] = (char)(n & 0xff);
- n >>= 8;
- }
- for (k = 0; k <= gdBytes; ++k) {
- buf = GString::format("{0:02x}", buf2[k] & 0xff);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- }
- (*outputFunc)(outputStream, "\n", 1);
- }
-
- // write the charstring data
- n = charStrings->getLength();
- for (i = 0; i < n; i += 32) {
- for (j = 0; j < 32 && i+j < n; ++j) {
- buf = GString::format("{0:02x}", charStrings->getChar(i+j) & 0xff);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (i + 32 >= n) {
- (*outputFunc)(outputStream, ">", 1);
- }
- (*outputFunc)(outputStream, "\n", 1);
- }
-
- gfree(charStringOffsets);
- delete charStrings;
- gfree(cidMap);
-}
-
-void FoFiType1C::convertToType0(char *psName,
- FoFiOutputFunc outputFunc,
- void *outputStream) {
- int *cidMap;
- Type1CIndex subrIdx;
- Type1CIndexVal val;
- int nCIDs;
- GString *buf;
- Type1CEexecBuf eb;
- GBool ok;
- int fd, i, j, k;
-
- // compute the CID count and build the CID-to-GID mapping
- nCIDs = 0;
- for (i = 0; i < nGlyphs; ++i) {
- if (charset[i] >= nCIDs) {
- nCIDs = charset[i] + 1;
- }
- }
- cidMap = (int *)gmallocn(nCIDs, sizeof(int));
- for (i = 0; i < nCIDs; ++i) {
- cidMap[i] = -1;
- }
- for (i = 0; i < nGlyphs; ++i) {
- cidMap[charset[i]] = i;
- }
-
- // write the descendant Type 1 fonts
- for (i = 0; i < nCIDs; i += 256) {
-
- //~ this assumes that all CIDs in this block have the same FD --
- //~ to handle multiple FDs correctly, need to somehow divide the
- //~ font up by FD; as a kludge we ignore CID 0, which is .notdef
- fd = 0;
- for (j = i==0 ? 1 : 0; j < 256 && i+j < nCIDs; ++j) {
- if (cidMap[i+j] >= 0) {
- fd = fdSelect[cidMap[i+j]];
- break;
- }
- }
-
- // font dictionary (unencrypted section)
- (*outputFunc)(outputStream, "16 dict begin\n", 14);
- (*outputFunc)(outputStream, "/FontName /", 11);
- (*outputFunc)(outputStream, psName, strlen(psName));
- buf = GString::format("_{0:02x} def\n", i >> 8);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, "/FontType 1 def\n", 16);
- if (privateDicts[fd].hasFontMatrix) {
- buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
- privateDicts[fd].fontMatrix[0],
- privateDicts[fd].fontMatrix[1],
- privateDicts[fd].fontMatrix[2],
- privateDicts[fd].fontMatrix[3],
- privateDicts[fd].fontMatrix[4],
- privateDicts[fd].fontMatrix[5]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- } else if (topDict.hasFontMatrix) {
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- } else {
- (*outputFunc)(outputStream,
- "/FontMatrix [0.001 0 0 0.001 0 0] def\n", 38);
- }
- buf = GString::format("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
- topDict.fontBBox[0], topDict.fontBBox[1],
- topDict.fontBBox[2], topDict.fontBBox[3]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- if (topDict.paintType != 0) {
- buf = GString::format("/StrokeWidth {0:.4g} def\n", topDict.strokeWidth);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
- for (j = 0; j < 256 && i+j < nCIDs; ++j) {
- buf = GString::format("dup {0:d} /c{1:02x} put\n", j, j);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- if (j < 256) {
- buf = GString::format("{0:d} 1 255 {{ 1 index exch /.notdef put }} for\n",
- j);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "readonly def\n", 13);
- (*outputFunc)(outputStream, "currentdict end\n", 16);
-
- // start the binary section
- (*outputFunc)(outputStream, "currentfile eexec\n", 18);
- eb.outputFunc = outputFunc;
- eb.outputStream = outputStream;
- eb.ascii = gTrue;
- eb.r1 = 55665;
- eb.line = 0;
-
- // start the private dictionary
- eexecWrite(&eb, "\x83\xca\x73\xd5");
- eexecWrite(&eb, "dup /Private 32 dict dup begin\n");
- eexecWrite(&eb, "/RD {string currentfile exch readstring pop}"
- " executeonly def\n");
- eexecWrite(&eb, "/ND {noaccess def} executeonly def\n");
- eexecWrite(&eb, "/NP {noaccess put} executeonly def\n");
- eexecWrite(&eb, "/MinFeature {16 16} def\n");
- eexecWrite(&eb, "/password 5839 def\n");
- if (privateDicts[fd].nBlueValues) {
- eexecWrite(&eb, "/BlueValues [");
- for (k = 0; k < privateDicts[fd].nBlueValues; ++k) {
- buf = GString::format("{0:s}{1:d}",
- k > 0 ? " " : "",
- privateDicts[fd].blueValues[k]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[fd].nOtherBlues) {
- eexecWrite(&eb, "/OtherBlues [");
- for (k = 0; k < privateDicts[fd].nOtherBlues; ++k) {
- buf = GString::format("{0:s}{1:d}",
- k > 0 ? " " : "",
- privateDicts[fd].otherBlues[k]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[fd].nFamilyBlues) {
- eexecWrite(&eb, "/FamilyBlues [");
- for (k = 0; k < privateDicts[fd].nFamilyBlues; ++k) {
- buf = GString::format("{0:s}{1:d}", k > 0 ? " " : "",
- privateDicts[fd].familyBlues[k]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[fd].nFamilyOtherBlues) {
- eexecWrite(&eb, "/FamilyOtherBlues [");
- for (k = 0; k < privateDicts[fd].nFamilyOtherBlues; ++k) {
- buf = GString::format("{0:s}{1:d}", k > 0 ? " " : "",
- privateDicts[fd].familyOtherBlues[k]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[fd].blueScale != 0.039625) {
- buf = GString::format("/BlueScale {0:.4g} def\n",
- privateDicts[fd].blueScale);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].blueShift != 7) {
- buf = GString::format("/BlueShift {0:d} def\n",
- privateDicts[fd].blueShift);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].blueFuzz != 1) {
- buf = GString::format("/BlueFuzz {0:d} def\n",
- privateDicts[fd].blueFuzz);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].hasStdHW) {
- buf = GString::format("/StdHW [{0:.4g}] def\n", privateDicts[fd].stdHW);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].hasStdVW) {
- buf = GString::format("/StdVW [{0:.4g}] def\n", privateDicts[fd].stdVW);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].nStemSnapH) {
- eexecWrite(&eb, "/StemSnapH [");
- for (k = 0; k < privateDicts[fd].nStemSnapH; ++k) {
- buf = GString::format("{0:s}{1:.4g}",
- k > 0 ? " " : "", privateDicts[fd].stemSnapH[k]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[fd].nStemSnapV) {
- eexecWrite(&eb, "/StemSnapV [");
- for (k = 0; k < privateDicts[fd].nStemSnapV; ++k) {
- buf = GString::format("{0:s}{1:.4g}",
- k > 0 ? " " : "", privateDicts[fd].stemSnapV[k]);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- eexecWrite(&eb, "] def\n");
- }
- if (privateDicts[fd].hasForceBold) {
- buf = GString::format("/ForceBold {0:s} def\n",
- privateDicts[fd].forceBold ? "true" : "false");
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].forceBoldThreshold != 0) {
- buf = GString::format("/ForceBoldThreshold {0:.4g} def\n",
- privateDicts[fd].forceBoldThreshold);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].languageGroup != 0) {
- buf = GString::format("/LanguageGroup {0:d} def\n",
- privateDicts[fd].languageGroup);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
- if (privateDicts[fd].expansionFactor != 0.06) {
- buf = GString::format("/ExpansionFactor {0:.4g} def\n",
- privateDicts[fd].expansionFactor);
- eexecWrite(&eb, buf->getCString());
- delete buf;
- }
-
- // set up the subroutines
- ok = gTrue;
- getIndex(privateDicts[fd].subrsOffset, &subrIdx, &ok);
- if (!ok) {
- subrIdx.pos = -1;
- }
-
- // start the CharStrings
- eexecWrite(&eb, "2 index /CharStrings 256 dict dup begin\n");
-
- // write the .notdef CharString
- ok = gTrue;
- getIndexVal(&charStringsIdx, 0, &val, &ok);
- if (ok) {
- eexecCvtGlyph(&eb, ".notdef", val.pos, val.len,
- &subrIdx, &privateDicts[fd]);
- }
-
- // write the CharStrings
- for (j = 0; j < 256 && i+j < nCIDs; ++j) {
- if (cidMap[i+j] >= 0) {
- ok = gTrue;
- getIndexVal(&charStringsIdx, cidMap[i+j], &val, &ok);
- if (ok) {
- buf = GString::format("c{0:02x}", j);
- eexecCvtGlyph(&eb, buf->getCString(), val.pos, val.len,
- &subrIdx, &privateDicts[fd]);
- delete buf;
- }
- }
- }
- eexecWrite(&eb, "end\n");
- eexecWrite(&eb, "end\n");
- eexecWrite(&eb, "readonly put\n");
- eexecWrite(&eb, "noaccess put\n");
- eexecWrite(&eb, "dup /FontName get exch definefont pop\n");
- eexecWrite(&eb, "mark currentfile closefile\n");
-
- // trailer
- if (eb.line > 0) {
- (*outputFunc)(outputStream, "\n", 1);
- }
- for (j = 0; j < 8; ++j) {
- (*outputFunc)(outputStream, "0000000000000000000000000000000000000000000000000000000000000000\n", 65);
- }
- (*outputFunc)(outputStream, "cleartomark\n", 12);
- }
-
- // write the Type 0 parent font
- (*outputFunc)(outputStream, "16 dict begin\n", 14);
- (*outputFunc)(outputStream, "/FontName /", 11);
- (*outputFunc)(outputStream, psName, strlen(psName));
- (*outputFunc)(outputStream, " def\n", 5);
- (*outputFunc)(outputStream, "/FontType 0 def\n", 16);
- if (topDict.hasFontMatrix) {
- buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
- topDict.fontMatrix[0], topDict.fontMatrix[1],
- topDict.fontMatrix[2], topDict.fontMatrix[3],
- topDict.fontMatrix[4], topDict.fontMatrix[5]);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- } else {
- (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
- }
- (*outputFunc)(outputStream, "/FMapType 2 def\n", 16);
- (*outputFunc)(outputStream, "/Encoding [\n", 12);
- for (i = 0; i < nCIDs; i += 256) {
- buf = GString::format("{0:d}\n", i >> 8);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- (*outputFunc)(outputStream, "/FDepVector [\n", 14);
- for (i = 0; i < nCIDs; i += 256) {
- (*outputFunc)(outputStream, "/", 1);
- (*outputFunc)(outputStream, psName, strlen(psName));
- buf = GString::format("_{0:02x} findfont\n", i >> 8);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- (*outputFunc)(outputStream, "] def\n", 6);
- (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
-
- gfree(cidMap);
-}
-
-void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName,
- int offset, int nBytes,
- Type1CIndex *subrIdx,
- Type1CPrivateDict *pDict) {
- GString *buf;
- GString *charBuf;
-
- // generate the charstring
- charBuf = new GString();
- cvtGlyph(offset, nBytes, charBuf, subrIdx, pDict, gTrue);
-
- buf = GString::format("/{0:s} {1:d} RD ", glyphName, charBuf->getLength());
- eexecWrite(eb, buf->getCString());
- delete buf;
- eexecWriteCharstring(eb, (Guchar *)charBuf->getCString(),
- charBuf->getLength());
- eexecWrite(eb, " ND\n");
-
- delete charBuf;
-}
-
-void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf,
- Type1CIndex *subrIdx, Type1CPrivateDict *pDict,
- GBool top) {
- Type1CIndexVal val;
- GBool ok, dFP;
- double d, dx, dy;
- Gushort r2;
- Guchar byte;
- int pos, subrBias, start, i, k;
-
- start = charBuf->getLength();
- if (top) {
- charBuf->append((char)73);
- charBuf->append((char)58);
- charBuf->append((char)147);
- charBuf->append((char)134);
- nOps = 0;
- nHints = 0;
- firstOp = gTrue;
- openPath = gFalse;
- }
-
- pos = offset;
- while (pos < offset + nBytes) {
- ok = gTrue;
- pos = getOp(pos, gTrue, &ok);
- if (!ok) {
- break;
- }
- if (!ops[nOps - 1].isNum) {
- --nOps; // drop the operator
- switch (ops[nOps].op) {
- case 0x0001: // hstem
- if (firstOp) {
- cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
- }
- if (nOps & 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hstem", nOps);
- }
- d = 0;
- dFP = gFalse;
- for (k = 0; k < nOps; k += 2) {
- // convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
- if (ops[k+1].num < 0) {
- d += ops[k].num + ops[k+1].num;
- dFP |= ops[k].isFP | ops[k+1].isFP;
- cvtNum(d, dFP, charBuf);
- cvtNum(-ops[k+1].num, ops[k+1].isFP, charBuf);
- } else {
- d += ops[k].num;
- dFP |= ops[k].isFP;
- cvtNum(d, dFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- d += ops[k+1].num;
- dFP |= ops[k+1].isFP;
- }
- charBuf->append((char)1);
- }
- nHints += nOps / 2;
- nOps = 0;
- break;
- case 0x0003: // vstem
- if (firstOp) {
- cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
- }
- if (nOps & 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 vstem", nOps);
- }
- d = 0;
- dFP = gFalse;
- for (k = 0; k < nOps; k += 2) {
- // convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
- if (ops[k+1].num < 0) {
- d += ops[k].num + ops[k+1].num;
- dFP |= ops[k].isFP | ops[k+1].isFP;
- cvtNum(d, dFP, charBuf);
- cvtNum(-ops[k+1].num, ops[k+1].isFP, charBuf);
- } else {
- d += ops[k].num;
- dFP |= ops[k].isFP;
- cvtNum(d, dFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- d += ops[k+1].num;
- dFP |= ops[k+1].isFP;
- }
- charBuf->append((char)3);
- }
- nHints += nOps / 2;
- nOps = 0;
- break;
- case 0x0004: // vmoveto
- if (firstOp) {
- cvtGlyphWidth(nOps == 2, charBuf, pDict);
- firstOp = gFalse;
- }
- if (openPath) {
- charBuf->append((char)9);
- openPath = gFalse;
- }
- if (nOps != 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 vmoveto", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- charBuf->append((char)4);
- nOps = 0;
- break;
- case 0x0005: // rlineto
- if (nOps < 2 || nOps % 2 != 0) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 rlineto", nOps);
- }
- for (k = 0; k < nOps; k += 2) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- charBuf->append((char)5);
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0006: // hlineto
- if (nOps < 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hlineto", nOps);
- }
- for (k = 0; k < nOps; ++k) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- charBuf->append((char)((k & 1) ? 7 : 6));
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0007: // vlineto
- if (nOps < 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 vlineto", nOps);
- }
- for (k = 0; k < nOps; ++k) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- charBuf->append((char)((k & 1) ? 6 : 7));
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0008: // rrcurveto
- if (nOps < 6 || nOps % 6 != 0) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 rrcurveto", nOps);
- }
- for (k = 0; k < nOps; k += 6) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
- charBuf->append((char)8);
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x000a: // callsubr
- if (nOps >= 1) {
- subrBias = (subrIdx->len < 1240)
- ? 107 : (subrIdx->len < 33900) ? 1131 : 32768;
- k = subrBias + (int)ops[nOps - 1].num;
- --nOps;
- ok = gTrue;
- getIndexVal(subrIdx, k, &val, &ok);
- if (ok) {
- cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
- }
- } else {
- //~ error(-1, "Too few args to Type 2 callsubr");
- }
- // don't clear the stack
- break;
- case 0x000b: // return
- // don't clear the stack
- break;
- case 0x000e: // endchar / seac
- if (firstOp) {
- cvtGlyphWidth(nOps == 1 || nOps == 5, charBuf, pDict);
- firstOp = gFalse;
- }
- if (openPath) {
- charBuf->append((char)9);
- openPath = gFalse;
- }
- if (nOps == 4) {
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- charBuf->append((char)12)->append((char)6);
- } else if (nOps == 0) {
- charBuf->append((char)14);
- } else {
- //~ error(-1, "Wrong number of args (%d) to Type 2 endchar", nOps);
- }
- nOps = 0;
- break;
- case 0x000f: // (obsolete)
- // this op is ignored, but we need the glyph width
- if (firstOp) {
- cvtGlyphWidth(nOps > 0, charBuf, pDict);
- firstOp = gFalse;
- }
- nOps = 0;
- break;
- case 0x0010: // blend
- //~ error(-1, "Unimplemented Type 2 charstring op: %d", file[i]);
- nOps = 0;
- break;
- case 0x0012: // hstemhm
- // ignored
- if (firstOp) {
- cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
- }
- if (nOps & 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hstemhm", nOps);
- }
- nHints += nOps / 2;
- nOps = 0;
- break;
- case 0x0013: // hintmask
- // ignored
- if (firstOp) {
- cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
- }
- if (nOps > 0) {
- if (nOps & 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hintmask/vstemhm",
- //~ nOps);
- }
- nHints += nOps / 2;
- }
- pos += (nHints + 7) >> 3;
- nOps = 0;
- break;
- case 0x0014: // cntrmask
- // ignored
- if (firstOp) {
- cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
- }
- if (nOps > 0) {
- if (nOps & 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 cntrmask/vstemhm",
- //~ nOps);
- }
- nHints += nOps / 2;
- }
- pos += (nHints + 7) >> 3;
- nOps = 0;
- break;
- case 0x0015: // rmoveto
- if (firstOp) {
- cvtGlyphWidth(nOps == 3, charBuf, pDict);
- firstOp = gFalse;
- }
- if (openPath) {
- charBuf->append((char)9);
- openPath = gFalse;
- }
- if (nOps != 2) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 rmoveto", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- charBuf->append((char)21);
- nOps = 0;
- break;
- case 0x0016: // hmoveto
- if (firstOp) {
- cvtGlyphWidth(nOps == 2, charBuf, pDict);
- firstOp = gFalse;
- }
- if (openPath) {
- charBuf->append((char)9);
- openPath = gFalse;
- }
- if (nOps != 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hmoveto", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- charBuf->append((char)22);
- nOps = 0;
- break;
- case 0x0017: // vstemhm
- // ignored
- if (firstOp) {
- cvtGlyphWidth(nOps & 1, charBuf, pDict);
- firstOp = gFalse;
- }
- if (nOps & 1) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 vstemhm", nOps);
- }
- nHints += nOps / 2;
- nOps = 0;
- break;
- case 0x0018: // rcurveline
- if (nOps < 8 || (nOps - 2) % 6 != 0) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 rcurveline", nOps);
- }
- for (k = 0; k < nOps - 2; k += 6) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
- charBuf->append((char)8);
- }
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
- charBuf->append((char)5);
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0019: // rlinecurve
- if (nOps < 8 || (nOps - 6) % 2 != 0) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 rlinecurve", nOps);
- }
- for (k = 0; k < nOps - 6; k += 2) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
- charBuf->append((char)5);
- }
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
- charBuf->append((char)8);
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x001a: // vvcurveto
- if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 vvcurveto", nOps);
- }
- if (nOps % 2 == 1) {
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[4].num, ops[4].isFP, charBuf);
- charBuf->append((char)8);
- k = 5;
- } else {
- k = 0;
- }
- for (; k < nOps; k += 4) {
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- charBuf->append((char)8);
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x001b: // hhcurveto
- if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hhcurveto", nOps);
- }
- if (nOps % 2 == 1) {
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- charBuf->append((char)8);
- k = 5;
- } else {
- k = 0;
- }
- for (; k < nOps; k += 4) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- charBuf->append((char)8);
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x001d: // callgsubr
- if (nOps >= 1) {
- k = gsubrBias + (int)ops[nOps - 1].num;
- --nOps;
- ok = gTrue;
- getIndexVal(&gsubrIdx, k, &val, &ok);
- if (ok) {
- cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
- }
- } else {
- //~ error(-1, "Too few args to Type 2 callgsubr");
- }
- // don't clear the stack
- break;
- case 0x001e: // vhcurveto
- if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 vhcurveto", nOps);
- }
- for (k = 0; k < nOps && k != nOps-5; k += 4) {
- if (k % 8 == 0) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- charBuf->append((char)30);
- } else {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- charBuf->append((char)31);
- }
- }
- if (k == nOps-5) {
- if (k % 8 == 0) {
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- } else {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- }
- charBuf->append((char)8);
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x001f: // hvcurveto
- if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hvcurveto", nOps);
- }
- for (k = 0; k < nOps && k != nOps-5; k += 4) {
- if (k % 8 == 0) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- charBuf->append((char)31);
- } else {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- charBuf->append((char)30);
- }
- }
- if (k == nOps-5) {
- if (k % 8 == 0) {
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- } else {
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[k].num, ops[k].isFP, charBuf);
- cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
- cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
- cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
- cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
- }
- charBuf->append((char)8);
- }
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0c00: // dotsection (should be Type 1 only?)
- // ignored
- nOps = 0;
- break;
- case 0x0c03: // and
- case 0x0c04: // or
- case 0x0c05: // not
- case 0x0c08: // store
- case 0x0c09: // abs
- case 0x0c0a: // add
- case 0x0c0b: // sub
- case 0x0c0c: // div
- case 0x0c0d: // load
- case 0x0c0e: // neg
- case 0x0c0f: // eq
- case 0x0c12: // drop
- case 0x0c14: // put
- case 0x0c15: // get
- case 0x0c16: // ifelse
- case 0x0c17: // random
- case 0x0c18: // mul
- case 0x0c1a: // sqrt
- case 0x0c1b: // dup
- case 0x0c1c: // exch
- case 0x0c1d: // index
- case 0x0c1e: // roll
- //~ error(-1, "Unimplemented Type 2 charstring op: 12.%d", file[i+1]);
- nOps = 0;
- break;
- case 0x0c22: // hflex
- if (nOps != 7) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hflex", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- charBuf->append((char)8);
- cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[5].num, ops[5].isFP, charBuf);
- cvtNum(-ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[6].num, ops[6].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- charBuf->append((char)8);
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0c23: // flex
- if (nOps != 13) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 flex", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(ops[5].num, ops[5].isFP, charBuf);
- charBuf->append((char)8);
- cvtNum(ops[6].num, ops[6].isFP, charBuf);
- cvtNum(ops[7].num, ops[7].isFP, charBuf);
- cvtNum(ops[8].num, ops[8].isFP, charBuf);
- cvtNum(ops[9].num, ops[9].isFP, charBuf);
- cvtNum(ops[10].num, ops[10].isFP, charBuf);
- cvtNum(ops[11].num, ops[11].isFP, charBuf);
- charBuf->append((char)8);
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0c24: // hflex1
- if (nOps != 9) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 hflex1", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- charBuf->append((char)8);
- cvtNum(ops[5].num, ops[5].isFP, charBuf);
- cvtNum(0, gFalse, charBuf);
- cvtNum(ops[6].num, ops[6].isFP, charBuf);
- cvtNum(ops[7].num, ops[7].isFP, charBuf);
- cvtNum(ops[8].num, ops[8].isFP, charBuf);
- cvtNum(-(ops[1].num + ops[3].num + ops[7].num),
- ops[1].isFP | ops[3].isFP | ops[7].isFP, charBuf);
- charBuf->append((char)8);
- nOps = 0;
- openPath = gTrue;
- break;
- case 0x0c25: // flex1
- if (nOps != 11) {
- //~ error(-1, "Wrong number of args (%d) to Type 2 flex1", nOps);
- }
- cvtNum(ops[0].num, ops[0].isFP, charBuf);
- cvtNum(ops[1].num, ops[1].isFP, charBuf);
- cvtNum(ops[2].num, ops[2].isFP, charBuf);
- cvtNum(ops[3].num, ops[3].isFP, charBuf);
- cvtNum(ops[4].num, ops[4].isFP, charBuf);
- cvtNum(ops[5].num, ops[5].isFP, charBuf);
- charBuf->append((char)8);
- cvtNum(ops[6].num, ops[6].isFP, charBuf);
- cvtNum(ops[7].num, ops[7].isFP, charBuf);
- cvtNum(ops[8].num, ops[8].isFP, charBuf);
- cvtNum(ops[9].num, ops[9].isFP, charBuf);
- dx = ops[0].num + ops[2].num + ops[4].num + ops[6].num + ops[8].num;
- dy = ops[1].num + ops[3].num + ops[5].num + ops[7].num + ops[9].num;
- if (fabs(dx) > fabs(dy)) {
- cvtNum(ops[10].num, ops[10].isFP, charBuf);
- cvtNum(-dy, ops[1].isFP | ops[3].isFP | ops[5].isFP |
- ops[7].isFP | ops[9].isFP, charBuf);
- } else {
- cvtNum(-dx, ops[0].isFP | ops[2].isFP | ops[4].isFP |
- ops[6].isFP | ops[8].isFP, charBuf);
- cvtNum(ops[10].num, ops[10].isFP, charBuf);
- }
- charBuf->append((char)8);
- nOps = 0;
- openPath = gTrue;
- break;
- default:
- //~ error(-1, "Illegal Type 2 charstring op: %04x",
- //~ ops[nOps].op);
- nOps = 0;
- break;
- }
- }
- }
-
- // charstring encryption
- if (top) {
- r2 = 4330;
- for (i = start; i < charBuf->getLength(); ++i) {
- byte = charBuf->getChar(i) ^ (r2 >> 8);
- charBuf->setChar(i, byte);
- r2 = (byte + r2) * 52845 + 22719;
- }
- }
-}
-
-void FoFiType1C::cvtGlyphWidth(GBool useOp, GString *charBuf,
- Type1CPrivateDict *pDict) {
- double w;
- GBool wFP;
- int i;
-
- if (useOp) {
- w = pDict->nominalWidthX + ops[0].num;
- wFP = pDict->nominalWidthXFP | ops[0].isFP;
- for (i = 1; i < nOps; ++i) {
- ops[i-1] = ops[i];
- }
- --nOps;
- } else {
- w = pDict->defaultWidthX;
- wFP = pDict->defaultWidthXFP;
- }
- cvtNum(0, gFalse, charBuf);
- cvtNum(w, wFP, charBuf);
- charBuf->append((char)13);
-}
-
-void FoFiType1C::cvtNum(double x, GBool isFP, GString *charBuf) {
- Guchar buf[12];
- int y, n;
-
- n = 0;
- if (isFP) {
- if (x >= -32768 && x < 32768) {
- y = (int)(x * 256.0);
- buf[0] = 255;
- buf[1] = (Guchar)(y >> 24);
- buf[2] = (Guchar)(y >> 16);
- buf[3] = (Guchar)(y >> 8);
- buf[4] = (Guchar)y;
- buf[5] = 255;
- buf[6] = 0;
- buf[7] = 0;
- buf[8] = 1;
- buf[9] = 0;
- buf[10] = 12;
- buf[11] = 12;
- n = 12;
- } else {
- //~ error(-1, "Type 2 fixed point constant out of range");
- }
- } else {
- y = (int)x;
- if (y >= -107 && y <= 107) {
- buf[0] = (Guchar)(y + 139);
- n = 1;
- } else if (y > 107 && y <= 1131) {
- y -= 108;
- buf[0] = (Guchar)((y >> 8) + 247);
- buf[1] = (Guchar)(y & 0xff);
- n = 2;
- } else if (y < -107 && y >= -1131) {
- y = -y - 108;
- buf[0] = (Guchar)((y >> 8) + 251);
- buf[1] = (Guchar)(y & 0xff);
- n = 2;
- } else {
- buf[0] = 255;
- buf[1] = (Guchar)(y >> 24);
- buf[2] = (Guchar)(y >> 16);
- buf[3] = (Guchar)(y >> 8);
- buf[4] = (Guchar)y;
- n = 5;
- }
- }
- charBuf->append((char *)buf, n);
-}
-
-void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, char *s) {
- Guchar *p;
- Guchar x;
-
- for (p = (Guchar *)s; *p; ++p) {
- x = *p ^ (eb->r1 >> 8);
- eb->r1 = (x + eb->r1) * 52845 + 22719;
- if (eb->ascii) {
- (*eb->outputFunc)(eb->outputStream, &hexChars[x >> 4], 1);
- (*eb->outputFunc)(eb->outputStream, &hexChars[x & 0x0f], 1);
- eb->line += 2;
- if (eb->line == 64) {
- (*eb->outputFunc)(eb->outputStream, "\n", 1);
- eb->line = 0;
- }
- } else {
- (*eb->outputFunc)(eb->outputStream, (char *)&x, 1);
- }
- }
-}
-
-void FoFiType1C::eexecWriteCharstring(Type1CEexecBuf *eb,
- Guchar *s, int n) {
- Guchar x;
- int i;
-
- // eexec encryption
- for (i = 0; i < n; ++i) {
- x = s[i] ^ (eb->r1 >> 8);
- eb->r1 = (x + eb->r1) * 52845 + 22719;
- if (eb->ascii) {
- (*eb->outputFunc)(eb->outputStream, &hexChars[x >> 4], 1);
- (*eb->outputFunc)(eb->outputStream, &hexChars[x & 0x0f], 1);
- eb->line += 2;
- if (eb->line == 64) {
- (*eb->outputFunc)(eb->outputStream, "\n", 1);
- eb->line = 0;
- }
- } else {
- (*eb->outputFunc)(eb->outputStream, (char *)&x, 1);
- }
- }
-}
-
-GBool FoFiType1C::parse() {
- Type1CIndex fdIdx;
- Type1CIndexVal val;
- int i;
-
- parsedOk = gTrue;
-
- // some tools embed Type 1C fonts with an extra whitespace char at
- // the beginning
- if (len > 0 && file[0] != '\x01') {
- ++file;
- --len;
- }
-
- // find the indexes
- getIndex(getU8(2, &parsedOk), &nameIdx, &parsedOk);
- getIndex(nameIdx.endPos, &topDictIdx, &parsedOk);
- getIndex(topDictIdx.endPos, &stringIdx, &parsedOk);
- getIndex(stringIdx.endPos, &gsubrIdx, &parsedOk);
- if (!parsedOk) {
- return gFalse;
- }
- gsubrBias = (gsubrIdx.len < 1240) ? 107
- : (gsubrIdx.len < 33900) ? 1131 : 32768;
-
- // read the first font name
- getIndexVal(&nameIdx, 0, &val, &parsedOk);
- if (!parsedOk) {
- return gFalse;
- }
- name = new GString((char *)&file[val.pos], val.len);
-
- // read the top dict for the first font
- readTopDict();
-
- // for CID fonts: read the FDArray dicts and private dicts
- if (topDict.firstOp == 0x0c1e) {
- if (topDict.fdArrayOffset == 0) {
- nFDs = 1;
- privateDicts = (Type1CPrivateDict *)gmalloc(sizeof(Type1CPrivateDict));
- readPrivateDict(0, 0, &privateDicts[0]);
- } else {
- getIndex(topDict.fdArrayOffset, &fdIdx, &parsedOk);
- if (!parsedOk) {
- return gFalse;
- }
- nFDs = fdIdx.len;
- privateDicts = (Type1CPrivateDict *)
- gmallocn(nFDs, sizeof(Type1CPrivateDict));
- for (i = 0; i < nFDs; ++i) {
- getIndexVal(&fdIdx, i, &val, &parsedOk);
- if (!parsedOk) {
- return gFalse;
- }
- readFD(val.pos, val.len, &privateDicts[i]);
- }
- }
-
- // for 8-bit fonts: read the private dict
- } else {
- privateDicts = (Type1CPrivateDict *)gmalloc(sizeof(Type1CPrivateDict));
- readPrivateDict(topDict.privateOffset, topDict.privateSize,
- &privateDicts[0]);
- }
-
- // check for parse errors in the private dict(s)
- if (!parsedOk) {
- return gFalse;
- }
-
- // get the charstrings index
- if (topDict.charStringsOffset <= 0) {
- parsedOk = gFalse;
- return gFalse;
- }
- getIndex(topDict.charStringsOffset, &charStringsIdx, &parsedOk);
- if (!parsedOk) {
- return gFalse;
- }
- nGlyphs = charStringsIdx.len;
-
- // for CID fonts: read the FDSelect table
- if (topDict.firstOp == 0x0c1e) {
- readFDSelect();
- if (!parsedOk) {
- return gFalse;
- }
- }
-
- // read the charset
- if (!readCharset()) {
- parsedOk = gFalse;
- return gFalse;
- }
-
- // for 8-bit fonts: build the encoding
- if (topDict.firstOp != 0x0c14 && topDict.firstOp != 0x0c1e) {
- buildEncoding();
- if (!parsedOk) {
- return gFalse;
- }
- }
-
- return parsedOk;
-}
-
-void FoFiType1C::readTopDict() {
- Type1CIndexVal topDictPtr;
- int pos;
-
- topDict.firstOp = -1;
- topDict.versionSID = 0;
- topDict.noticeSID = 0;
- topDict.copyrightSID = 0;
- topDict.fullNameSID = 0;
- topDict.familyNameSID = 0;
- topDict.weightSID = 0;
- topDict.isFixedPitch = 0;
- topDict.italicAngle = 0;
- topDict.underlinePosition = -100;
- topDict.underlineThickness = 50;
- topDict.paintType = 0;
- topDict.charstringType = 2;
- topDict.fontMatrix[0] = 0.001;
- topDict.fontMatrix[1] = 0;
- topDict.fontMatrix[2] = 0;
- topDict.fontMatrix[3] = 0.001;
- topDict.fontMatrix[4] = 0;
- topDict.fontMatrix[5] = 0;
- topDict.hasFontMatrix = gFalse;
- topDict.uniqueID = 0;
- topDict.fontBBox[0] = 0;
- topDict.fontBBox[1] = 0;
- topDict.fontBBox[2] = 0;
- topDict.fontBBox[3] = 0;
- topDict.strokeWidth = 0;
- topDict.charsetOffset = 0;
- topDict.encodingOffset = 0;
- topDict.charStringsOffset = 0;
- topDict.privateSize = 0;
- topDict.privateOffset = 0;
- topDict.registrySID = 0;
- topDict.orderingSID = 0;
- topDict.supplement = 0;
- topDict.fdArrayOffset = 0;
- topDict.fdSelectOffset = 0;
-
- getIndexVal(&topDictIdx, 0, &topDictPtr, &parsedOk);
- pos = topDictPtr.pos;
- nOps = 0;
- while (pos < topDictPtr.pos + topDictPtr.len) {
- pos = getOp(pos, gFalse, &parsedOk);
- if (!parsedOk) {
- break;
- }
- if (!ops[nOps - 1].isNum) {
- --nOps; // drop the operator
- if (topDict.firstOp < 0) {
- topDict.firstOp = ops[nOps].op;
- }
- switch (ops[nOps].op) {
- case 0x0000: topDict.versionSID = (int)ops[0].num; break;
- case 0x0001: topDict.noticeSID = (int)ops[0].num; break;
- case 0x0c00: topDict.copyrightSID = (int)ops[0].num; break;
- case 0x0002: topDict.fullNameSID = (int)ops[0].num; break;
- case 0x0003: topDict.familyNameSID = (int)ops[0].num; break;
- case 0x0004: topDict.weightSID = (int)ops[0].num; break;
- case 0x0c01: topDict.isFixedPitch = (int)ops[0].num; break;
- case 0x0c02: topDict.italicAngle = ops[0].num; break;
- case 0x0c03: topDict.underlinePosition = ops[0].num; break;
- case 0x0c04: topDict.underlineThickness = ops[0].num; break;
- case 0x0c05: topDict.paintType = (int)ops[0].num; break;
- case 0x0c06: topDict.charstringType = (int)ops[0].num; break;
- case 0x0c07: topDict.fontMatrix[0] = ops[0].num;
- topDict.fontMatrix[1] = ops[1].num;
- topDict.fontMatrix[2] = ops[2].num;
- topDict.fontMatrix[3] = ops[3].num;
- topDict.fontMatrix[4] = ops[4].num;
- topDict.fontMatrix[5] = ops[5].num;
- topDict.hasFontMatrix = gTrue; break;
- case 0x000d: topDict.uniqueID = (int)ops[0].num; break;
- case 0x0005: topDict.fontBBox[0] = ops[0].num;
- topDict.fontBBox[1] = ops[1].num;
- topDict.fontBBox[2] = ops[2].num;
- topDict.fontBBox[3] = ops[3].num; break;
- case 0x0c08: topDict.strokeWidth = ops[0].num; break;
- case 0x000f: topDict.charsetOffset = (int)ops[0].num; break;
- case 0x0010: topDict.encodingOffset = (int)ops[0].num; break;
- case 0x0011: topDict.charStringsOffset = (int)ops[0].num; break;
- case 0x0012: topDict.privateSize = (int)ops[0].num;
- topDict.privateOffset = (int)ops[1].num; break;
- case 0x0c1e: topDict.registrySID = (int)ops[0].num;
- topDict.orderingSID = (int)ops[1].num;
- topDict.supplement = (int)ops[2].num; break;
- case 0x0c24: topDict.fdArrayOffset = (int)ops[0].num; break;
- case 0x0c25: topDict.fdSelectOffset = (int)ops[0].num; break;
- }
- nOps = 0;
- }
- }
-}
-
-// Read a CID font dict (FD) - this pulls out the private dict
-// pointer, and reads the private dict. It also pulls the FontMatrix
-// (if any) out of the FD.
-void FoFiType1C::readFD(int offset, int length, Type1CPrivateDict *pDict) {
- int pos, pSize, pOffset;
- double fontMatrix[6];
- GBool hasFontMatrix;
-
- hasFontMatrix = gFalse;
- pSize = pOffset = 0;
- pos = offset;
- nOps = 0;
- while (pos < offset + length) {
- pos = getOp(pos, gFalse, &parsedOk);
- if (!parsedOk) {
- return;
- }
- if (!ops[nOps - 1].isNum) {
- if (ops[nOps - 1].op == 0x0012) {
- if (nOps < 3) {
- parsedOk = gFalse;
- return;
- }
- pSize = (int)ops[0].num;
- pOffset = (int)ops[1].num;
- break;
- } else if (ops[nOps - 1].op == 0x0c07) {
- fontMatrix[0] = ops[0].num;
- fontMatrix[1] = ops[1].num;
- fontMatrix[2] = ops[2].num;
- fontMatrix[3] = ops[3].num;
- fontMatrix[4] = ops[4].num;
- fontMatrix[5] = ops[5].num;
- hasFontMatrix = gTrue;
- }
- nOps = 0;
- }
- }
- readPrivateDict(pOffset, pSize, pDict);
- if (hasFontMatrix) {
- pDict->fontMatrix[0] = fontMatrix[0];
- pDict->fontMatrix[1] = fontMatrix[1];
- pDict->fontMatrix[2] = fontMatrix[2];
- pDict->fontMatrix[3] = fontMatrix[3];
- pDict->fontMatrix[4] = fontMatrix[4];
- pDict->fontMatrix[5] = fontMatrix[5];
- pDict->hasFontMatrix = gTrue;
- }
-}
-
-void FoFiType1C::readPrivateDict(int offset, int length,
- Type1CPrivateDict *pDict) {
- int pos;
-
- pDict->hasFontMatrix = gFalse;
- pDict->nBlueValues = 0;
- pDict->nOtherBlues = 0;
- pDict->nFamilyBlues = 0;
- pDict->nFamilyOtherBlues = 0;
- pDict->blueScale = 0.039625;
- pDict->blueShift = 7;
- pDict->blueFuzz = 1;
- pDict->hasStdHW = gFalse;
- pDict->hasStdVW = gFalse;
- pDict->nStemSnapH = 0;
- pDict->nStemSnapV = 0;
- pDict->hasForceBold = gFalse;
- pDict->forceBoldThreshold = 0;
- pDict->languageGroup = 0;
- pDict->expansionFactor = 0.06;
- pDict->initialRandomSeed = 0;
- pDict->subrsOffset = 0;
- pDict->defaultWidthX = 0;
- pDict->defaultWidthXFP = gFalse;
- pDict->nominalWidthX = 0;
- pDict->nominalWidthXFP = gFalse;
-
- // no dictionary
- if (offset == 0 || length == 0) {
- return;
- }
-
- pos = offset;
- nOps = 0;
- while (pos < offset + length) {
- pos = getOp(pos, gFalse, &parsedOk);
- if (!parsedOk) {
- break;
- }
- if (!ops[nOps - 1].isNum) {
- --nOps; // drop the operator
- switch (ops[nOps].op) {
- case 0x0006:
- pDict->nBlueValues = getDeltaIntArray(pDict->blueValues,
- type1CMaxBlueValues);
- break;
- case 0x0007:
- pDict->nOtherBlues = getDeltaIntArray(pDict->otherBlues,
- type1CMaxOtherBlues);
- break;
- case 0x0008:
- pDict->nFamilyBlues = getDeltaIntArray(pDict->familyBlues,
- type1CMaxBlueValues);
- break;
- case 0x0009:
- pDict->nFamilyOtherBlues = getDeltaIntArray(pDict->familyOtherBlues,
- type1CMaxOtherBlues);
- break;
- case 0x0c09:
- pDict->blueScale = ops[0].num;
- break;
- case 0x0c0a:
- pDict->blueShift = (int)ops[0].num;
- break;
- case 0x0c0b:
- pDict->blueFuzz = (int)ops[0].num;
- break;
- case 0x000a:
- pDict->stdHW = ops[0].num;
- pDict->hasStdHW = gTrue;
- break;
- case 0x000b:
- pDict->stdVW = ops[0].num;
- pDict->hasStdVW = gTrue;
- break;
- case 0x0c0c:
- pDict->nStemSnapH = getDeltaFPArray(pDict->stemSnapH,
- type1CMaxStemSnap);
- break;
- case 0x0c0d:
- pDict->nStemSnapV = getDeltaFPArray(pDict->stemSnapV,
- type1CMaxStemSnap);
- break;
- case 0x0c0e:
- pDict->forceBold = ops[0].num != 0;
- pDict->hasForceBold = gTrue;
- break;
- case 0x0c0f:
- pDict->forceBoldThreshold = ops[0].num;
- break;
- case 0x0c11:
- pDict->languageGroup = (int)ops[0].num;
- break;
- case 0x0c12:
- pDict->expansionFactor = ops[0].num;
- break;
- case 0x0c13:
- pDict->initialRandomSeed = (int)ops[0].num;
- break;
- case 0x0013:
- pDict->subrsOffset = offset + (int)ops[0].num;
- break;
- case 0x0014:
- pDict->defaultWidthX = ops[0].num;
- pDict->defaultWidthXFP = ops[0].isFP;
- break;
- case 0x0015:
- pDict->nominalWidthX = ops[0].num;
- pDict->nominalWidthXFP = ops[0].isFP;
- break;
- }
- nOps = 0;
- }
- }
-}
-
-void FoFiType1C::readFDSelect() {
- int fdSelectFmt, pos, nRanges, gid0, gid1, fd, i, j;
-
- fdSelect = (Guchar *)gmalloc(nGlyphs);
- if (topDict.fdSelectOffset == 0) {
- for (i = 0; i < nGlyphs; ++i) {
- fdSelect[i] = 0;
- }
- } else {
- pos = topDict.fdSelectOffset;
- fdSelectFmt = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- if (fdSelectFmt == 0) {
- if (!checkRegion(pos, nGlyphs)) {
- parsedOk = gFalse;
- return;
- }
- memcpy(fdSelect, file + pos, nGlyphs);
- } else if (fdSelectFmt == 3) {
- nRanges = getU16BE(pos, &parsedOk);
- pos += 2;
- gid0 = getU16BE(pos, &parsedOk);
- pos += 2;
- for (i = 1; i <= nRanges; ++i) {
- fd = getU8(pos++, &parsedOk);
- gid1 = getU16BE(pos, &parsedOk);
- if (!parsedOk) {
- return;
- }
- pos += 2;
- if (gid0 > gid1 || gid1 > nGlyphs) {
- //~ error(-1, "Bad FDSelect table in CID font");
- parsedOk = gFalse;
- return;
- }
- for (j = gid0; j < gid1; ++j) {
- fdSelect[j] = fd;
- }
- gid0 = gid1;
- }
- } else {
- //~ error(-1, "Unknown FDSelect table format in CID font");
- for (i = 0; i < nGlyphs; ++i) {
- fdSelect[i] = 0;
- }
- }
- }
-}
-
-void FoFiType1C::buildEncoding() {
- char buf[256];
- int nCodes, nRanges, encFormat;
- int pos, c, sid, nLeft, nSups, i, j;
-
- if (topDict.encodingOffset == 0) {
- encoding = fofiType1StandardEncoding;
-
- } else if (topDict.encodingOffset == 1) {
- encoding = fofiType1ExpertEncoding;
-
- } else {
- encoding = (char **)gmallocn(256, sizeof(char *));
- for (i = 0; i < 256; ++i) {
- encoding[i] = NULL;
- }
- pos = topDict.encodingOffset;
- encFormat = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- if ((encFormat & 0x7f) == 0) {
- nCodes = 1 + getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- if (nCodes > nGlyphs) {
- nCodes = nGlyphs;
- }
- for (i = 1; i < nCodes; ++i) {
- c = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- if (encoding[c]) {
- gfree(encoding[c]);
- }
- encoding[c] = copyString(getString(charset[i], buf, &parsedOk));
- }
- } else if ((encFormat & 0x7f) == 1) {
- nRanges = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- nCodes = 1;
- for (i = 0; i < nRanges; ++i) {
- c = getU8(pos++, &parsedOk);
- nLeft = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- for (j = 0; j <= nLeft && nCodes < nGlyphs; ++j) {
- if (c < 256) {
- if (encoding[c]) {
- gfree(encoding[c]);
- }
- encoding[c] = copyString(getString(charset[nCodes], buf,
- &parsedOk));
- }
- ++nCodes;
- ++c;
- }
- }
- }
- if (encFormat & 0x80) {
- nSups = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- return;
- }
- for (i = 0; i < nSups; ++i) {
- c = getU8(pos++, &parsedOk);;
- if (!parsedOk) {
- return;;
- }
- sid = getU16BE(pos, &parsedOk);
- pos += 2;
- if (!parsedOk) {
- return;
- }
- if (encoding[c]) {
- gfree(encoding[c]);
- }
- encoding[c] = copyString(getString(sid, buf, &parsedOk));
- }
- }
- }
-}
-
-GBool FoFiType1C::readCharset() {
- int charsetFormat, c, pos;
- int nLeft, i, j;
-
- if (topDict.charsetOffset == 0) {
- charset = fofiType1CISOAdobeCharset;
- } else if (topDict.charsetOffset == 1) {
- charset = fofiType1CExpertCharset;
- } else if (topDict.charsetOffset == 2) {
- charset = fofiType1CExpertSubsetCharset;
- } else {
- charset = (Gushort *)gmallocn(nGlyphs, sizeof(Gushort));
- for (i = 0; i < nGlyphs; ++i) {
- charset[i] = 0;
- }
- pos = topDict.charsetOffset;
- charsetFormat = getU8(pos++, &parsedOk);
- if (charsetFormat == 0) {
- for (i = 1; i < nGlyphs; ++i) {
- charset[i] = (Gushort)getU16BE(pos, &parsedOk);
- pos += 2;
- if (!parsedOk) {
- break;
- }
- }
- } else if (charsetFormat == 1) {
- i = 1;
- while (i < nGlyphs) {
- c = getU16BE(pos, &parsedOk);
- pos += 2;
- nLeft = getU8(pos++, &parsedOk);
- if (!parsedOk) {
- break;
- }
- for (j = 0; j <= nLeft && i < nGlyphs; ++j) {
- charset[i++] = (Gushort)c++;
- }
- }
- } else if (charsetFormat == 2) {
- i = 1;
- while (i < nGlyphs) {
- c = getU16BE(pos, &parsedOk);
- pos += 2;
- nLeft = getU16BE(pos, &parsedOk);
- pos += 2;
- if (!parsedOk) {
- break;
- }
- for (j = 0; j <= nLeft && i < nGlyphs; ++j) {
- charset[i++] = (Gushort)c++;
- }
- }
- }
- if (!parsedOk) {
- gfree(charset);
- charset = NULL;
- return gFalse;
- }
- }
- return gTrue;
-}
-
-int FoFiType1C::getOp(int pos, GBool charstring, GBool *ok) {
- static char nybChars[16] = "0123456789.ee -";
- Type1COp op;
- char buf[65];
- int b0, b1, nyb0, nyb1, x, i;
-
- b0 = getU8(pos++, ok);
- op.isNum = gTrue;
- op.isFP = gFalse;
-
- if (b0 == 28) {
- x = getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- if (x & 0x8000) {
- x |= ~0xffff;
- }
- op.num = x;
-
- } else if (!charstring && b0 == 29) {
- x = getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- if (x & 0x80000000) {
- x |= ~0xffffffff;
- }
- op.num = x;
-
- } else if (!charstring && b0 == 30) {
- i = 0;
- do {
- b1 = getU8(pos++, ok);
- nyb0 = b1 >> 4;
- nyb1 = b1 & 0x0f;
- if (nyb0 == 0xf) {
- break;
- }
- buf[i++] = nybChars[nyb0];
- if (i == 64) {
- break;
- }
- if (nyb0 == 0xc) {
- buf[i++] = '-';
- }
- if (i == 64) {
- break;
- }
- if (nyb1 == 0xf) {
- break;
- }
- buf[i++] = nybChars[nyb1];
- if (i == 64) {
- break;
- }
- if (nyb1 == 0xc) {
- buf[i++] = '-';
- }
- } while (i < 64);
- buf[i] = '\0';
- op.num = atof(buf);
- op.isFP = gTrue;
-
- } else if (b0 >= 32 && b0 <= 246) {
- op.num = b0 - 139;
-
- } else if (b0 >= 247 && b0 <= 250) {
- op.num = ((b0 - 247) << 8) + getU8(pos++, ok) + 108;
-
- } else if (b0 >= 251 && b0 <= 254) {
- op.num = -((b0 - 251) << 8) - getU8(pos++, ok) - 108;
-
- } else if (charstring && b0 == 255) {
- x = getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- x = (x << 8) | getU8(pos++, ok);
- if (x & 0x80000000) {
- x |= ~0xffffffff;
- }
- op.num = (double)x / 65536.0;
- op.isFP = gTrue;
-
- } else if (b0 == 12) {
- op.isNum = gFalse;
- op.op = 0x0c00 + getU8(pos++, ok);
-
- } else {
- op.isNum = gFalse;
- op.op = b0;
- }
-
- if (nOps < 49) {
- ops[nOps++] = op;
- }
-
- return pos;
-}
-
-// Convert the delta-encoded ops array to an array of ints.
-int FoFiType1C::getDeltaIntArray(int *arr, int maxLen) {
- int x;
- int n, i;
-
- if ((n = nOps) > maxLen) {
- n = maxLen;
- }
- x = 0;
- for (i = 0; i < n; ++i) {
- x += (int)ops[i].num;
- arr[i] = x;
- }
- return n;
-}
-
-// Convert the delta-encoded ops array to an array of doubles.
-int FoFiType1C::getDeltaFPArray(double *arr, int maxLen) {
- double x;
- int n, i;
-
- if ((n = nOps) > maxLen) {
- n = maxLen;
- }
- x = 0;
- for (i = 0; i < n; ++i) {
- x += ops[i].num;
- arr[i] = x;
- }
- return n;
-}
-
-void FoFiType1C::getIndex(int pos, Type1CIndex *idx, GBool *ok) {
- idx->pos = pos;
- idx->len = getU16BE(pos, ok);
- if (idx->len == 0) {
- // empty indexes are legal and contain just the length field
- idx->offSize = 0;
- idx->startPos = idx->endPos = pos + 2;
- } else {
- idx->offSize = getU8(pos + 2, ok);
- if (idx->offSize < 1 || idx->offSize > 4) {
- *ok = gFalse;
- }
- idx->startPos = pos + 3 + (idx->len + 1) * idx->offSize - 1;
- if (idx->startPos < 0 || idx->startPos >= len) {
- *ok = gFalse;
- }
- idx->endPos = idx->startPos + getUVarBE(pos + 3 + idx->len * idx->offSize,
- idx->offSize, ok);
- if (idx->endPos < idx->startPos || idx->endPos > len) {
- *ok = gFalse;
- }
- }
-}
-
-void FoFiType1C::getIndexVal(Type1CIndex *idx, int i,
- Type1CIndexVal *val, GBool *ok) {
- int pos0, pos1;
-
- if (i < 0 || i >= idx->len) {
- *ok = gFalse;
- return;
- }
- pos0 = idx->startPos + getUVarBE(idx->pos + 3 + i * idx->offSize,
- idx->offSize, ok);
- pos1 = idx->startPos + getUVarBE(idx->pos + 3 + (i + 1) * idx->offSize,
- idx->offSize, ok);
- if (pos0 < idx->startPos || pos0 > idx->endPos ||
- pos1 <= idx->startPos || pos1 > idx->endPos ||
- pos1 < pos0) {
- *ok = gFalse;
- }
- val->pos = pos0;
- val->len = pos1 - pos0;
-}
-
-char *FoFiType1C::getString(int sid, char *buf, GBool *ok) {
- Type1CIndexVal val;
- int n;
-
- if (sid < 391) {
- strcpy(buf, fofiType1CStdStrings[sid]);
- } else {
- sid -= 391;
- getIndexVal(&stringIdx, sid, &val, ok);
- if (*ok) {
- if ((n = val.len) > 255) {
- n = 255;
- }
- strncpy(buf, (char *)&file[val.pos], n);
- buf[n] = '\0';
- } else {
- buf[0] = '\0';
- }
- }
- return buf;
-}
diff --git a/kpdf/xpdf/fofi/FoFiType1C.cpp b/kpdf/xpdf/fofi/FoFiType1C.cpp
new file mode 100644
index 00000000..f2ca88dc
--- /dev/null
+++ b/kpdf/xpdf/fofi/FoFiType1C.cpp
@@ -0,0 +1,2603 @@
+//========================================================================
+//
+// FoFiType1C.cpp
+//
+// Copyright 1999-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "gmem.h"
+#include "GString.h"
+#include "FoFiEncodings.h"
+#include "FoFiType1C.h"
+
+//------------------------------------------------------------------------
+
+static char hexChars[17] = "0123456789ABCDEF";
+
+//------------------------------------------------------------------------
+// FoFiType1C
+//------------------------------------------------------------------------
+
+FoFiType1C *FoFiType1C::make(char *fileA, int lenA) {
+ FoFiType1C *ff;
+
+ ff = new FoFiType1C(fileA, lenA, gFalse);
+ if (!ff->parse()) {
+ delete ff;
+ return NULL;
+ }
+ return ff;
+}
+
+FoFiType1C *FoFiType1C::load(char *fileName) {
+ FoFiType1C *ff;
+ char *fileA;
+ int lenA;
+
+ if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
+ return NULL;
+ }
+ ff = new FoFiType1C(fileA, lenA, gTrue);
+ if (!ff->parse()) {
+ delete ff;
+ return NULL;
+ }
+ return ff;
+}
+
+FoFiType1C::FoFiType1C(char *fileA, int lenA, GBool freeFileDataA):
+ FoFiBase(fileA, lenA, freeFileDataA)
+{
+ name = NULL;
+ encoding = NULL;
+ privateDicts = NULL;
+ fdSelect = NULL;
+ charset = NULL;
+}
+
+FoFiType1C::~FoFiType1C() {
+ int i;
+
+ if (name) {
+ delete name;
+ }
+ if (encoding &&
+ encoding != fofiType1StandardEncoding &&
+ encoding != fofiType1ExpertEncoding) {
+ for (i = 0; i < 256; ++i) {
+ gfree(encoding[i]);
+ }
+ gfree(encoding);
+ }
+ if (privateDicts) {
+ gfree(privateDicts);
+ }
+ if (fdSelect) {
+ gfree(fdSelect);
+ }
+ if (charset &&
+ charset != fofiType1CISOAdobeCharset &&
+ charset != fofiType1CExpertCharset &&
+ charset != fofiType1CExpertSubsetCharset) {
+ gfree(charset);
+ }
+}
+
+char *FoFiType1C::getName() {
+ return name ? name->getCString() : (char *)NULL;
+}
+
+char **FoFiType1C::getEncoding() {
+ return encoding;
+}
+
+Gushort *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
+ Gushort *map;
+ int n, i;
+
+ // a CID font's top dict has ROS as the first operator
+ if (topDict.firstOp != 0x0c1e) {
+ *nCIDs = 0;
+ return NULL;
+ }
+
+ // in a CID font, the charset data is the GID-to-CID mapping, so all
+ // we have to do is reverse it
+ n = 0;
+ for (i = 0; i < nGlyphs; ++i) {
+ if (charset[i] > n) {
+ n = charset[i];
+ }
+ }
+ ++n;
+ map = (Gushort *)gmallocn(n, sizeof(Gushort));
+ memset(map, 0, n * sizeof(Gushort));
+ for (i = 0; i < nGlyphs; ++i) {
+ map[charset[i]] = i;
+ }
+ *nCIDs = n;
+ return map;
+}
+
+void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ int psNameLen;
+ Type1CEexecBuf eb;
+ Type1CIndex subrIdx;
+ Type1CIndexVal val;
+ GString *buf;
+ char buf2[256];
+ char **enc;
+ GBool ok;
+ int i;
+
+ if (psName) {
+ psNameLen = strlen(psName);
+ } else {
+ psName = name->getCString();
+ psNameLen = name->getLength();
+ }
+
+ // write header and font dictionary, up to encoding
+ ok = gTrue;
+ (*outputFunc)(outputStream, "%!FontType1-1.0: ", 17);
+ (*outputFunc)(outputStream, psName, psNameLen);
+ if (topDict.versionSID != 0) {
+ getString(topDict.versionSID, buf2, &ok);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ }
+ (*outputFunc)(outputStream, "\n", 1);
+ // the dictionary needs room for 12 entries: the following 9, plus
+ // Private and CharStrings (in the eexec section) and FID (which is
+ // added by definefont)
+ (*outputFunc)(outputStream, "12 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/FontInfo 10 dict dup begin\n", 28);
+ if (topDict.versionSID != 0) {
+ (*outputFunc)(outputStream, "/version (", 10);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") readonly def\n", 15);
+ }
+ if (topDict.noticeSID != 0) {
+ getString(topDict.noticeSID, buf2, &ok);
+ (*outputFunc)(outputStream, "/Notice (", 9);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") readonly def\n", 15);
+ }
+ if (topDict.copyrightSID != 0) {
+ getString(topDict.copyrightSID, buf2, &ok);
+ (*outputFunc)(outputStream, "/Copyright (", 12);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") readonly def\n", 15);
+ }
+ if (topDict.fullNameSID != 0) {
+ getString(topDict.fullNameSID, buf2, &ok);
+ (*outputFunc)(outputStream, "/FullName (", 11);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") readonly def\n", 15);
+ }
+ if (topDict.familyNameSID != 0) {
+ getString(topDict.familyNameSID, buf2, &ok);
+ (*outputFunc)(outputStream, "/FamilyName (", 13);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") readonly def\n", 15);
+ }
+ if (topDict.weightSID != 0) {
+ getString(topDict.weightSID, buf2, &ok);
+ (*outputFunc)(outputStream, "/Weight (", 9);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") readonly def\n", 15);
+ }
+ if (topDict.isFixedPitch) {
+ (*outputFunc)(outputStream, "/isFixedPitch true def\n", 23);
+ } else {
+ (*outputFunc)(outputStream, "/isFixedPitch false def\n", 24);
+ }
+ buf = GString::format("/ItalicAngle {0:.4g} def\n", topDict.italicAngle);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format("/UnderlinePosition {0:.4g} def\n",
+ topDict.underlinePosition);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format("/UnderlineThickness {0:.4g} def\n",
+ topDict.underlineThickness);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "end readonly def\n", 17);
+ (*outputFunc)(outputStream, "/FontName /", 11);
+ (*outputFunc)(outputStream, psName, psNameLen);
+ (*outputFunc)(outputStream, " def\n", 5);
+ buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/FontType 1 def\n", 16);
+ buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] readonly def\n",
+ topDict.fontMatrix[0], topDict.fontMatrix[1],
+ topDict.fontMatrix[2], topDict.fontMatrix[3],
+ topDict.fontMatrix[4], topDict.fontMatrix[5]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] readonly def\n",
+ topDict.fontBBox[0], topDict.fontBBox[1],
+ topDict.fontBBox[2], topDict.fontBBox[3]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format("/StrokeWidth {0:.4g} def\n", topDict.strokeWidth);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ if (topDict.uniqueID != 0) {
+ buf = GString::format("/UniqueID {0:d} def\n", topDict.uniqueID);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+
+ // write the encoding
+ (*outputFunc)(outputStream, "/Encoding ", 10);
+ if (!newEncoding && encoding == fofiType1StandardEncoding) {
+ (*outputFunc)(outputStream, "StandardEncoding def\n", 21);
+ } else {
+ (*outputFunc)(outputStream, "256 array\n", 10);
+ (*outputFunc)(outputStream,
+ "0 1 255 {1 index exch /.notdef put} for\n", 40);
+ enc = newEncoding ? newEncoding : encoding;
+ for (i = 0; i < 256; ++i) {
+ if (enc[i]) {
+ buf = GString::format("dup {0:d} /{1:s} put\n", i, enc[i]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ }
+ (*outputFunc)(outputStream, "readonly def\n", 13);
+ }
+ (*outputFunc)(outputStream, "currentdict end\n", 16);
+
+ // start the binary section
+ (*outputFunc)(outputStream, "currentfile eexec\n", 18);
+ eb.outputFunc = outputFunc;
+ eb.outputStream = outputStream;
+ eb.ascii = ascii;
+ eb.r1 = 55665;
+ eb.line = 0;
+
+ // write the private dictionary
+ eexecWrite(&eb, "\x83\xca\x73\xd5");
+ eexecWrite(&eb, "dup /Private 32 dict dup begin\n");
+ eexecWrite(&eb, "/RD {string currentfile exch readstring pop}"
+ " executeonly def\n");
+ eexecWrite(&eb, "/ND {noaccess def} executeonly def\n");
+ eexecWrite(&eb, "/NP {noaccess put} executeonly def\n");
+ eexecWrite(&eb, "/MinFeature {16 16} def\n");
+ eexecWrite(&eb, "/password 5839 def\n");
+ if (privateDicts[0].nBlueValues) {
+ eexecWrite(&eb, "/BlueValues [");
+ for (i = 0; i < privateDicts[0].nBlueValues; ++i) {
+ buf = GString::format("{0:s}{1:d}",
+ i > 0 ? " " : "", privateDicts[0].blueValues[i]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[0].nOtherBlues) {
+ eexecWrite(&eb, "/OtherBlues [");
+ for (i = 0; i < privateDicts[0].nOtherBlues; ++i) {
+ buf = GString::format("{0:s}{1:d}",
+ i > 0 ? " " : "", privateDicts[0].otherBlues[i]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[0].nFamilyBlues) {
+ eexecWrite(&eb, "/FamilyBlues [");
+ for (i = 0; i < privateDicts[0].nFamilyBlues; ++i) {
+ buf = GString::format("{0:s}{1:d}",
+ i > 0 ? " " : "", privateDicts[0].familyBlues[i]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[0].nFamilyOtherBlues) {
+ eexecWrite(&eb, "/FamilyOtherBlues [");
+ for (i = 0; i < privateDicts[0].nFamilyOtherBlues; ++i) {
+ buf = GString::format("{0:s}{1:d}", i > 0 ? " " : "",
+ privateDicts[0].familyOtherBlues[i]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[0].blueScale != 0.039625) {
+ buf = GString::format("/BlueScale {0:.4g} def\n",
+ privateDicts[0].blueScale);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].blueShift != 7) {
+ buf = GString::format("/BlueShift {0:d} def\n", privateDicts[0].blueShift);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].blueFuzz != 1) {
+ buf = GString::format("/BlueFuzz {0:d} def\n", privateDicts[0].blueFuzz);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].hasStdHW) {
+ buf = GString::format("/StdHW [{0:.4g}] def\n", privateDicts[0].stdHW);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].hasStdVW) {
+ buf = GString::format("/StdVW [{0:.4g}] def\n", privateDicts[0].stdVW);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].nStemSnapH) {
+ eexecWrite(&eb, "/StemSnapH [");
+ for (i = 0; i < privateDicts[0].nStemSnapH; ++i) {
+ buf = GString::format("{0:s}{1:.4g}",
+ i > 0 ? " " : "", privateDicts[0].stemSnapH[i]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[0].nStemSnapV) {
+ eexecWrite(&eb, "/StemSnapV [");
+ for (i = 0; i < privateDicts[0].nStemSnapV; ++i) {
+ buf = GString::format("{0:s}{1:.4g}",
+ i > 0 ? " " : "", privateDicts[0].stemSnapV[i]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[0].hasForceBold) {
+ buf = GString::format("/ForceBold {0:s} def\n",
+ privateDicts[0].forceBold ? "true" : "false");
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].forceBoldThreshold != 0) {
+ buf = GString::format("/ForceBoldThreshold {0:.4g} def\n",
+ privateDicts[0].forceBoldThreshold);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].languageGroup != 0) {
+ buf = GString::format("/LanguageGroup {0:d} def\n",
+ privateDicts[0].languageGroup);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[0].expansionFactor != 0.06) {
+ buf = GString::format("/ExpansionFactor {0:.4g} def\n",
+ privateDicts[0].expansionFactor);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+
+ // set up subroutines
+ ok = gTrue;
+ getIndex(privateDicts[0].subrsOffset, &subrIdx, &ok);
+ if (!ok) {
+ subrIdx.pos = -1;
+ }
+
+ // write the CharStrings
+ buf = GString::format("2 index /CharStrings {0:d} dict dup begin\n",
+ nGlyphs);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ for (i = 0; i < nGlyphs; ++i) {
+ ok = gTrue;
+ getIndexVal(&charStringsIdx, i, &val, &ok);
+ if (ok) {
+ getString(charset[i], buf2, &ok);
+ if (ok) {
+ eexecCvtGlyph(&eb, buf2, val.pos, val.len, &subrIdx, &privateDicts[0]);
+ }
+ }
+ }
+ eexecWrite(&eb, "end\n");
+ eexecWrite(&eb, "end\n");
+ eexecWrite(&eb, "readonly put\n");
+ eexecWrite(&eb, "noaccess put\n");
+ eexecWrite(&eb, "dup /FontName get exch definefont pop\n");
+ eexecWrite(&eb, "mark currentfile closefile\n");
+
+ // trailer
+ if (ascii && eb.line > 0) {
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+ for (i = 0; i < 8; ++i) {
+ (*outputFunc)(outputStream, "0000000000000000000000000000000000000000000000000000000000000000\n", 65);
+ }
+ (*outputFunc)(outputStream, "cleartomark\n", 12);
+}
+
+void FoFiType1C::convertToCIDType0(char *psName,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ int *cidMap;
+ GString *charStrings;
+ int *charStringOffsets;
+ Type1CIndex subrIdx;
+ Type1CIndexVal val;
+ int nCIDs, gdBytes;
+ GString *buf;
+ char buf2[256];
+ GBool ok;
+ int gid, offset, n, i, j, k;
+
+ // compute the CID count and build the CID-to-GID mapping
+ nCIDs = 0;
+ for (i = 0; i < nGlyphs; ++i) {
+ if (charset[i] >= nCIDs) {
+ nCIDs = charset[i] + 1;
+ }
+ }
+ cidMap = (int *)gmallocn(nCIDs, sizeof(int));
+ for (i = 0; i < nCIDs; ++i) {
+ cidMap[i] = -1;
+ }
+ for (i = 0; i < nGlyphs; ++i) {
+ cidMap[charset[i]] = i;
+ }
+
+ // build the charstrings
+ charStrings = new GString();
+ charStringOffsets = (int *)gmallocn(nCIDs + 1, sizeof(int));
+ for (i = 0; i < nCIDs; ++i) {
+ charStringOffsets[i] = charStrings->getLength();
+ if ((gid = cidMap[i]) >= 0) {
+ ok = gTrue;
+ getIndexVal(&charStringsIdx, gid, &val, &ok);
+ if (ok) {
+ getIndex(privateDicts[fdSelect[gid]].subrsOffset, &subrIdx, &ok);
+ if (!ok) {
+ subrIdx.pos = -1;
+ }
+ cvtGlyph(val.pos, val.len, charStrings,
+ &subrIdx, &privateDicts[fdSelect[gid]], gTrue);
+ }
+ }
+ }
+ charStringOffsets[nCIDs] = charStrings->getLength();
+
+ // compute gdBytes = number of bytes needed for charstring offsets
+ // (offset size needs to account for the charstring offset table,
+ // with a worst case of five bytes per entry, plus the charstrings
+ // themselves)
+ i = (nCIDs + 1) * 5 + charStrings->getLength();
+ if (i < 0x100) {
+ gdBytes = 1;
+ } else if (i < 0x10000) {
+ gdBytes = 2;
+ } else if (i < 0x1000000) {
+ gdBytes = 3;
+ } else {
+ gdBytes = 4;
+ }
+
+ // begin the font dictionary
+ (*outputFunc)(outputStream, "/CIDInit /ProcSet findresource begin\n", 37);
+ (*outputFunc)(outputStream, "20 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/CIDFontName /", 14);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ (*outputFunc)(outputStream, " def\n", 5);
+ (*outputFunc)(outputStream, "/CIDFontType 0 def\n", 19);
+ (*outputFunc)(outputStream, "/CIDSystemInfo 3 dict dup begin\n", 32);
+ if (topDict.registrySID > 0 && topDict.orderingSID > 0) {
+ ok = gTrue;
+ getString(topDict.registrySID, buf2, &ok);
+ if (ok) {
+ (*outputFunc)(outputStream, " /Registry (", 13);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") def\n", 6);
+ }
+ ok = gTrue;
+ getString(topDict.orderingSID, buf2, &ok);
+ if (ok) {
+ (*outputFunc)(outputStream, " /Ordering (", 13);
+ (*outputFunc)(outputStream, buf2, strlen(buf2));
+ (*outputFunc)(outputStream, ") def\n", 6);
+ }
+ } else {
+ (*outputFunc)(outputStream, " /Registry (Adobe) def\n", 24);
+ (*outputFunc)(outputStream, " /Ordering (Identity) def\n", 27);
+ }
+ buf = GString::format(" /Supplement {0:d} def\n", topDict.supplement);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "end def\n", 8);
+ if (topDict.hasFontMatrix) {
+ buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
+ topDict.fontMatrix[0], topDict.fontMatrix[1],
+ topDict.fontMatrix[2], topDict.fontMatrix[3],
+ topDict.fontMatrix[4], topDict.fontMatrix[5]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ } else if (privateDicts[0].hasFontMatrix) {
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ } else {
+ (*outputFunc)(outputStream,
+ "/FontMatrix [0.001 0 0 0.001 0 0] def\n", 38);
+ }
+ buf = GString::format("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
+ topDict.fontBBox[0], topDict.fontBBox[1],
+ topDict.fontBBox[2], topDict.fontBBox[3]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/FontInfo 1 dict dup begin\n", 27);
+ (*outputFunc)(outputStream, " /FSType 8 def\n", 16);
+ (*outputFunc)(outputStream, "end def\n", 8);
+
+ // CIDFont-specific entries
+ buf = GString::format("/CIDCount {0:d} def\n", nCIDs);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/FDBytes 1 def\n", 15);
+ buf = GString::format("/GDBytes {0:d} def\n", gdBytes);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/CIDMapOffset 0 def\n", 20);
+ if (topDict.paintType != 0) {
+ buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format("/StrokeWidth {0:.4g} def\n", topDict.strokeWidth);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+
+ // FDArray entry
+ buf = GString::format("/FDArray {0:d} array\n", nFDs);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ for (i = 0; i < nFDs; ++i) {
+ buf = GString::format("dup {0:d} 10 dict begin\n", i);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/FontType 1 def\n", 16);
+ if (privateDicts[i].hasFontMatrix) {
+ buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
+ privateDicts[i].fontMatrix[0],
+ privateDicts[i].fontMatrix[1],
+ privateDicts[i].fontMatrix[2],
+ privateDicts[i].fontMatrix[3],
+ privateDicts[i].fontMatrix[4],
+ privateDicts[i].fontMatrix[5]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ } else {
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ }
+ buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/Private 32 dict begin\n", 23);
+ if (privateDicts[i].nBlueValues) {
+ (*outputFunc)(outputStream, "/BlueValues [", 13);
+ for (j = 0; j < privateDicts[i].nBlueValues; ++j) {
+ buf = GString::format("{0:s}{1:d}",
+ j > 0 ? " " : "", privateDicts[i].blueValues[j]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ }
+ if (privateDicts[i].nOtherBlues) {
+ (*outputFunc)(outputStream, "/OtherBlues [", 13);
+ for (j = 0; j < privateDicts[i].nOtherBlues; ++j) {
+ buf = GString::format("{0:s}{1:d}",
+ j > 0 ? " " : "", privateDicts[i].otherBlues[j]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ }
+ if (privateDicts[i].nFamilyBlues) {
+ (*outputFunc)(outputStream, "/FamilyBlues [", 14);
+ for (j = 0; j < privateDicts[i].nFamilyBlues; ++j) {
+ buf = GString::format("{0:s}{1:d}",
+ j > 0 ? " " : "",
+ privateDicts[i].familyBlues[j]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ }
+ if (privateDicts[i].nFamilyOtherBlues) {
+ (*outputFunc)(outputStream, "/FamilyOtherBlues [", 19);
+ for (j = 0; j < privateDicts[i].nFamilyOtherBlues; ++j) {
+ buf = GString::format("{0:s}{1:d}", j > 0 ? " " : "",
+ privateDicts[i].familyOtherBlues[j]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ }
+ if (privateDicts[i].blueScale != 0.039625) {
+ buf = GString::format("/BlueScale {0:.4g} def\n",
+ privateDicts[i].blueScale);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].blueShift != 7) {
+ buf = GString::format("/BlueShift {0:d} def\n",
+ privateDicts[i].blueShift);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].blueFuzz != 1) {
+ buf = GString::format("/BlueFuzz {0:d} def\n", privateDicts[i].blueFuzz);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].hasStdHW) {
+ buf = GString::format("/StdHW [{0:.4g}] def\n", privateDicts[i].stdHW);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].hasStdVW) {
+ buf = GString::format("/StdVW [{0:.4g}] def\n", privateDicts[i].stdVW);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].nStemSnapH) {
+ (*outputFunc)(outputStream, "/StemSnapH [", 12);
+ for (j = 0; j < privateDicts[i].nStemSnapH; ++j) {
+ buf = GString::format("{0:s}{1:.4g}",
+ j > 0 ? " " : "", privateDicts[i].stemSnapH[j]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ }
+ if (privateDicts[i].nStemSnapV) {
+ (*outputFunc)(outputStream, "/StemSnapV [", 12);
+ for (j = 0; j < privateDicts[i].nStemSnapV; ++j) {
+ buf = GString::format("{0:s}{1:.4g}",
+ j > 0 ? " " : "", privateDicts[i].stemSnapV[j]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ }
+ if (privateDicts[i].hasForceBold) {
+ buf = GString::format("/ForceBold {0:s} def\n",
+ privateDicts[i].forceBold ? "true" : "false");
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].forceBoldThreshold != 0) {
+ buf = GString::format("/ForceBoldThreshold {0:.4g} def\n",
+ privateDicts[i].forceBoldThreshold);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].languageGroup != 0) {
+ buf = GString::format("/LanguageGroup {0:d} def\n",
+ privateDicts[i].languageGroup);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (privateDicts[i].expansionFactor != 0.06) {
+ buf = GString::format("/ExpansionFactor {0:.4g} def\n",
+ privateDicts[i].expansionFactor);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "currentdict end def\n", 20);
+ (*outputFunc)(outputStream, "currentdict end put\n", 20);
+ }
+ (*outputFunc)(outputStream, "def\n", 4);
+
+ // start the binary section
+ offset = (nCIDs + 1) * (1 + gdBytes);
+ buf = GString::format("(Hex) {0:d} StartData\n",
+ offset + charStrings->getLength());
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+
+ // write the charstring offset (CIDMap) table
+ for (i = 0; i <= nCIDs; i += 6) {
+ for (j = 0; j < 6 && i+j <= nCIDs; ++j) {
+ if (i+j < nCIDs && cidMap[i+j] >= 0) {
+ buf2[0] = (char)fdSelect[cidMap[i+j]];
+ } else {
+ buf2[0] = (char)0;
+ }
+ n = offset + charStringOffsets[i+j];
+ for (k = gdBytes; k >= 1; --k) {
+ buf2[k] = (char)(n & 0xff);
+ n >>= 8;
+ }
+ for (k = 0; k <= gdBytes; ++k) {
+ buf = GString::format("{0:02x}", buf2[k] & 0xff);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ }
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+
+ // write the charstring data
+ n = charStrings->getLength();
+ for (i = 0; i < n; i += 32) {
+ for (j = 0; j < 32 && i+j < n; ++j) {
+ buf = GString::format("{0:02x}", charStrings->getChar(i+j) & 0xff);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (i + 32 >= n) {
+ (*outputFunc)(outputStream, ">", 1);
+ }
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+
+ gfree(charStringOffsets);
+ delete charStrings;
+ gfree(cidMap);
+}
+
+void FoFiType1C::convertToType0(char *psName,
+ FoFiOutputFunc outputFunc,
+ void *outputStream) {
+ int *cidMap;
+ Type1CIndex subrIdx;
+ Type1CIndexVal val;
+ int nCIDs;
+ GString *buf;
+ Type1CEexecBuf eb;
+ GBool ok;
+ int fd, i, j, k;
+
+ // compute the CID count and build the CID-to-GID mapping
+ nCIDs = 0;
+ for (i = 0; i < nGlyphs; ++i) {
+ if (charset[i] >= nCIDs) {
+ nCIDs = charset[i] + 1;
+ }
+ }
+ cidMap = (int *)gmallocn(nCIDs, sizeof(int));
+ for (i = 0; i < nCIDs; ++i) {
+ cidMap[i] = -1;
+ }
+ for (i = 0; i < nGlyphs; ++i) {
+ cidMap[charset[i]] = i;
+ }
+
+ // write the descendant Type 1 fonts
+ for (i = 0; i < nCIDs; i += 256) {
+
+ //~ this assumes that all CIDs in this block have the same FD --
+ //~ to handle multiple FDs correctly, need to somehow divide the
+ //~ font up by FD; as a kludge we ignore CID 0, which is .notdef
+ fd = 0;
+ for (j = i==0 ? 1 : 0; j < 256 && i+j < nCIDs; ++j) {
+ if (cidMap[i+j] >= 0) {
+ fd = fdSelect[cidMap[i+j]];
+ break;
+ }
+ }
+
+ // font dictionary (unencrypted section)
+ (*outputFunc)(outputStream, "16 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/FontName /", 11);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ buf = GString::format("_{0:02x} def\n", i >> 8);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, "/FontType 1 def\n", 16);
+ if (privateDicts[fd].hasFontMatrix) {
+ buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
+ privateDicts[fd].fontMatrix[0],
+ privateDicts[fd].fontMatrix[1],
+ privateDicts[fd].fontMatrix[2],
+ privateDicts[fd].fontMatrix[3],
+ privateDicts[fd].fontMatrix[4],
+ privateDicts[fd].fontMatrix[5]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ } else if (topDict.hasFontMatrix) {
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ } else {
+ (*outputFunc)(outputStream,
+ "/FontMatrix [0.001 0 0 0.001 0 0] def\n", 38);
+ }
+ buf = GString::format("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
+ topDict.fontBBox[0], topDict.fontBBox[1],
+ topDict.fontBBox[2], topDict.fontBBox[3]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ buf = GString::format("/PaintType {0:d} def\n", topDict.paintType);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ if (topDict.paintType != 0) {
+ buf = GString::format("/StrokeWidth {0:.4g} def\n", topDict.strokeWidth);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
+ for (j = 0; j < 256 && i+j < nCIDs; ++j) {
+ buf = GString::format("dup {0:d} /c{1:02x} put\n", j, j);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ if (j < 256) {
+ buf = GString::format("{0:d} 1 255 {{ 1 index exch /.notdef put }} for\n",
+ j);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "readonly def\n", 13);
+ (*outputFunc)(outputStream, "currentdict end\n", 16);
+
+ // start the binary section
+ (*outputFunc)(outputStream, "currentfile eexec\n", 18);
+ eb.outputFunc = outputFunc;
+ eb.outputStream = outputStream;
+ eb.ascii = gTrue;
+ eb.r1 = 55665;
+ eb.line = 0;
+
+ // start the private dictionary
+ eexecWrite(&eb, "\x83\xca\x73\xd5");
+ eexecWrite(&eb, "dup /Private 32 dict dup begin\n");
+ eexecWrite(&eb, "/RD {string currentfile exch readstring pop}"
+ " executeonly def\n");
+ eexecWrite(&eb, "/ND {noaccess def} executeonly def\n");
+ eexecWrite(&eb, "/NP {noaccess put} executeonly def\n");
+ eexecWrite(&eb, "/MinFeature {16 16} def\n");
+ eexecWrite(&eb, "/password 5839 def\n");
+ if (privateDicts[fd].nBlueValues) {
+ eexecWrite(&eb, "/BlueValues [");
+ for (k = 0; k < privateDicts[fd].nBlueValues; ++k) {
+ buf = GString::format("{0:s}{1:d}",
+ k > 0 ? " " : "",
+ privateDicts[fd].blueValues[k]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[fd].nOtherBlues) {
+ eexecWrite(&eb, "/OtherBlues [");
+ for (k = 0; k < privateDicts[fd].nOtherBlues; ++k) {
+ buf = GString::format("{0:s}{1:d}",
+ k > 0 ? " " : "",
+ privateDicts[fd].otherBlues[k]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[fd].nFamilyBlues) {
+ eexecWrite(&eb, "/FamilyBlues [");
+ for (k = 0; k < privateDicts[fd].nFamilyBlues; ++k) {
+ buf = GString::format("{0:s}{1:d}", k > 0 ? " " : "",
+ privateDicts[fd].familyBlues[k]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[fd].nFamilyOtherBlues) {
+ eexecWrite(&eb, "/FamilyOtherBlues [");
+ for (k = 0; k < privateDicts[fd].nFamilyOtherBlues; ++k) {
+ buf = GString::format("{0:s}{1:d}", k > 0 ? " " : "",
+ privateDicts[fd].familyOtherBlues[k]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[fd].blueScale != 0.039625) {
+ buf = GString::format("/BlueScale {0:.4g} def\n",
+ privateDicts[fd].blueScale);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].blueShift != 7) {
+ buf = GString::format("/BlueShift {0:d} def\n",
+ privateDicts[fd].blueShift);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].blueFuzz != 1) {
+ buf = GString::format("/BlueFuzz {0:d} def\n",
+ privateDicts[fd].blueFuzz);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].hasStdHW) {
+ buf = GString::format("/StdHW [{0:.4g}] def\n", privateDicts[fd].stdHW);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].hasStdVW) {
+ buf = GString::format("/StdVW [{0:.4g}] def\n", privateDicts[fd].stdVW);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].nStemSnapH) {
+ eexecWrite(&eb, "/StemSnapH [");
+ for (k = 0; k < privateDicts[fd].nStemSnapH; ++k) {
+ buf = GString::format("{0:s}{1:.4g}",
+ k > 0 ? " " : "", privateDicts[fd].stemSnapH[k]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[fd].nStemSnapV) {
+ eexecWrite(&eb, "/StemSnapV [");
+ for (k = 0; k < privateDicts[fd].nStemSnapV; ++k) {
+ buf = GString::format("{0:s}{1:.4g}",
+ k > 0 ? " " : "", privateDicts[fd].stemSnapV[k]);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ eexecWrite(&eb, "] def\n");
+ }
+ if (privateDicts[fd].hasForceBold) {
+ buf = GString::format("/ForceBold {0:s} def\n",
+ privateDicts[fd].forceBold ? "true" : "false");
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].forceBoldThreshold != 0) {
+ buf = GString::format("/ForceBoldThreshold {0:.4g} def\n",
+ privateDicts[fd].forceBoldThreshold);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].languageGroup != 0) {
+ buf = GString::format("/LanguageGroup {0:d} def\n",
+ privateDicts[fd].languageGroup);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+ if (privateDicts[fd].expansionFactor != 0.06) {
+ buf = GString::format("/ExpansionFactor {0:.4g} def\n",
+ privateDicts[fd].expansionFactor);
+ eexecWrite(&eb, buf->getCString());
+ delete buf;
+ }
+
+ // set up the subroutines
+ ok = gTrue;
+ getIndex(privateDicts[fd].subrsOffset, &subrIdx, &ok);
+ if (!ok) {
+ subrIdx.pos = -1;
+ }
+
+ // start the CharStrings
+ eexecWrite(&eb, "2 index /CharStrings 256 dict dup begin\n");
+
+ // write the .notdef CharString
+ ok = gTrue;
+ getIndexVal(&charStringsIdx, 0, &val, &ok);
+ if (ok) {
+ eexecCvtGlyph(&eb, ".notdef", val.pos, val.len,
+ &subrIdx, &privateDicts[fd]);
+ }
+
+ // write the CharStrings
+ for (j = 0; j < 256 && i+j < nCIDs; ++j) {
+ if (cidMap[i+j] >= 0) {
+ ok = gTrue;
+ getIndexVal(&charStringsIdx, cidMap[i+j], &val, &ok);
+ if (ok) {
+ buf = GString::format("c{0:02x}", j);
+ eexecCvtGlyph(&eb, buf->getCString(), val.pos, val.len,
+ &subrIdx, &privateDicts[fd]);
+ delete buf;
+ }
+ }
+ }
+ eexecWrite(&eb, "end\n");
+ eexecWrite(&eb, "end\n");
+ eexecWrite(&eb, "readonly put\n");
+ eexecWrite(&eb, "noaccess put\n");
+ eexecWrite(&eb, "dup /FontName get exch definefont pop\n");
+ eexecWrite(&eb, "mark currentfile closefile\n");
+
+ // trailer
+ if (eb.line > 0) {
+ (*outputFunc)(outputStream, "\n", 1);
+ }
+ for (j = 0; j < 8; ++j) {
+ (*outputFunc)(outputStream, "0000000000000000000000000000000000000000000000000000000000000000\n", 65);
+ }
+ (*outputFunc)(outputStream, "cleartomark\n", 12);
+ }
+
+ // write the Type 0 parent font
+ (*outputFunc)(outputStream, "16 dict begin\n", 14);
+ (*outputFunc)(outputStream, "/FontName /", 11);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ (*outputFunc)(outputStream, " def\n", 5);
+ (*outputFunc)(outputStream, "/FontType 0 def\n", 16);
+ if (topDict.hasFontMatrix) {
+ buf = GString::format("/FontMatrix [{0:.8g} {1:.8g} {2:.8g} {3:.8g} {4:.8g} {5:.8g}] def\n",
+ topDict.fontMatrix[0], topDict.fontMatrix[1],
+ topDict.fontMatrix[2], topDict.fontMatrix[3],
+ topDict.fontMatrix[4], topDict.fontMatrix[5]);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ } else {
+ (*outputFunc)(outputStream, "/FontMatrix [1 0 0 1 0 0] def\n", 30);
+ }
+ (*outputFunc)(outputStream, "/FMapType 2 def\n", 16);
+ (*outputFunc)(outputStream, "/Encoding [\n", 12);
+ for (i = 0; i < nCIDs; i += 256) {
+ buf = GString::format("{0:d}\n", i >> 8);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ (*outputFunc)(outputStream, "/FDepVector [\n", 14);
+ for (i = 0; i < nCIDs; i += 256) {
+ (*outputFunc)(outputStream, "/", 1);
+ (*outputFunc)(outputStream, psName, strlen(psName));
+ buf = GString::format("_{0:02x} findfont\n", i >> 8);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ (*outputFunc)(outputStream, "] def\n", 6);
+ (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
+
+ gfree(cidMap);
+}
+
+void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName,
+ int offset, int nBytes,
+ Type1CIndex *subrIdx,
+ Type1CPrivateDict *pDict) {
+ GString *buf;
+ GString *charBuf;
+
+ // generate the charstring
+ charBuf = new GString();
+ cvtGlyph(offset, nBytes, charBuf, subrIdx, pDict, gTrue);
+
+ buf = GString::format("/{0:s} {1:d} RD ", glyphName, charBuf->getLength());
+ eexecWrite(eb, buf->getCString());
+ delete buf;
+ eexecWriteCharstring(eb, (Guchar *)charBuf->getCString(),
+ charBuf->getLength());
+ eexecWrite(eb, " ND\n");
+
+ delete charBuf;
+}
+
+void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf,
+ Type1CIndex *subrIdx, Type1CPrivateDict *pDict,
+ GBool top) {
+ Type1CIndexVal val;
+ GBool ok, dFP;
+ double d, dx, dy;
+ Gushort r2;
+ Guchar byte;
+ int pos, subrBias, start, i, k;
+
+ start = charBuf->getLength();
+ if (top) {
+ charBuf->append((char)73);
+ charBuf->append((char)58);
+ charBuf->append((char)147);
+ charBuf->append((char)134);
+ nOps = 0;
+ nHints = 0;
+ firstOp = gTrue;
+ openPath = gFalse;
+ }
+
+ pos = offset;
+ while (pos < offset + nBytes) {
+ ok = gTrue;
+ pos = getOp(pos, gTrue, &ok);
+ if (!ok) {
+ break;
+ }
+ if (!ops[nOps - 1].isNum) {
+ --nOps; // drop the operator
+ switch (ops[nOps].op) {
+ case 0x0001: // hstem
+ if (firstOp) {
+ cvtGlyphWidth(nOps & 1, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (nOps & 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hstem", nOps);
+ }
+ d = 0;
+ dFP = gFalse;
+ for (k = 0; k < nOps; k += 2) {
+ // convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
+ if (ops[k+1].num < 0) {
+ d += ops[k].num + ops[k+1].num;
+ dFP |= ops[k].isFP | ops[k+1].isFP;
+ cvtNum(d, dFP, charBuf);
+ cvtNum(-ops[k+1].num, ops[k+1].isFP, charBuf);
+ } else {
+ d += ops[k].num;
+ dFP |= ops[k].isFP;
+ cvtNum(d, dFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ d += ops[k+1].num;
+ dFP |= ops[k+1].isFP;
+ }
+ charBuf->append((char)1);
+ }
+ nHints += nOps / 2;
+ nOps = 0;
+ break;
+ case 0x0003: // vstem
+ if (firstOp) {
+ cvtGlyphWidth(nOps & 1, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (nOps & 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 vstem", nOps);
+ }
+ d = 0;
+ dFP = gFalse;
+ for (k = 0; k < nOps; k += 2) {
+ // convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
+ if (ops[k+1].num < 0) {
+ d += ops[k].num + ops[k+1].num;
+ dFP |= ops[k].isFP | ops[k+1].isFP;
+ cvtNum(d, dFP, charBuf);
+ cvtNum(-ops[k+1].num, ops[k+1].isFP, charBuf);
+ } else {
+ d += ops[k].num;
+ dFP |= ops[k].isFP;
+ cvtNum(d, dFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ d += ops[k+1].num;
+ dFP |= ops[k+1].isFP;
+ }
+ charBuf->append((char)3);
+ }
+ nHints += nOps / 2;
+ nOps = 0;
+ break;
+ case 0x0004: // vmoveto
+ if (firstOp) {
+ cvtGlyphWidth(nOps == 2, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (openPath) {
+ charBuf->append((char)9);
+ openPath = gFalse;
+ }
+ if (nOps != 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 vmoveto", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ charBuf->append((char)4);
+ nOps = 0;
+ break;
+ case 0x0005: // rlineto
+ if (nOps < 2 || nOps % 2 != 0) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 rlineto", nOps);
+ }
+ for (k = 0; k < nOps; k += 2) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ charBuf->append((char)5);
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0006: // hlineto
+ if (nOps < 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hlineto", nOps);
+ }
+ for (k = 0; k < nOps; ++k) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ charBuf->append((char)((k & 1) ? 7 : 6));
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0007: // vlineto
+ if (nOps < 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 vlineto", nOps);
+ }
+ for (k = 0; k < nOps; ++k) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ charBuf->append((char)((k & 1) ? 6 : 7));
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0008: // rrcurveto
+ if (nOps < 6 || nOps % 6 != 0) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 rrcurveto", nOps);
+ }
+ for (k = 0; k < nOps; k += 6) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
+ charBuf->append((char)8);
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x000a: // callsubr
+ if (nOps >= 1) {
+ subrBias = (subrIdx->len < 1240)
+ ? 107 : (subrIdx->len < 33900) ? 1131 : 32768;
+ k = subrBias + (int)ops[nOps - 1].num;
+ --nOps;
+ ok = gTrue;
+ getIndexVal(subrIdx, k, &val, &ok);
+ if (ok) {
+ cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
+ }
+ } else {
+ //~ error(-1, "Too few args to Type 2 callsubr");
+ }
+ // don't clear the stack
+ break;
+ case 0x000b: // return
+ // don't clear the stack
+ break;
+ case 0x000e: // endchar / seac
+ if (firstOp) {
+ cvtGlyphWidth(nOps == 1 || nOps == 5, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (openPath) {
+ charBuf->append((char)9);
+ openPath = gFalse;
+ }
+ if (nOps == 4) {
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ charBuf->append((char)12)->append((char)6);
+ } else if (nOps == 0) {
+ charBuf->append((char)14);
+ } else {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 endchar", nOps);
+ }
+ nOps = 0;
+ break;
+ case 0x000f: // (obsolete)
+ // this op is ignored, but we need the glyph width
+ if (firstOp) {
+ cvtGlyphWidth(nOps > 0, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ nOps = 0;
+ break;
+ case 0x0010: // blend
+ //~ error(-1, "Unimplemented Type 2 charstring op: %d", file[i]);
+ nOps = 0;
+ break;
+ case 0x0012: // hstemhm
+ // ignored
+ if (firstOp) {
+ cvtGlyphWidth(nOps & 1, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (nOps & 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hstemhm", nOps);
+ }
+ nHints += nOps / 2;
+ nOps = 0;
+ break;
+ case 0x0013: // hintmask
+ // ignored
+ if (firstOp) {
+ cvtGlyphWidth(nOps & 1, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (nOps > 0) {
+ if (nOps & 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hintmask/vstemhm",
+ //~ nOps);
+ }
+ nHints += nOps / 2;
+ }
+ pos += (nHints + 7) >> 3;
+ nOps = 0;
+ break;
+ case 0x0014: // cntrmask
+ // ignored
+ if (firstOp) {
+ cvtGlyphWidth(nOps & 1, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (nOps > 0) {
+ if (nOps & 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 cntrmask/vstemhm",
+ //~ nOps);
+ }
+ nHints += nOps / 2;
+ }
+ pos += (nHints + 7) >> 3;
+ nOps = 0;
+ break;
+ case 0x0015: // rmoveto
+ if (firstOp) {
+ cvtGlyphWidth(nOps == 3, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (openPath) {
+ charBuf->append((char)9);
+ openPath = gFalse;
+ }
+ if (nOps != 2) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 rmoveto", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ charBuf->append((char)21);
+ nOps = 0;
+ break;
+ case 0x0016: // hmoveto
+ if (firstOp) {
+ cvtGlyphWidth(nOps == 2, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (openPath) {
+ charBuf->append((char)9);
+ openPath = gFalse;
+ }
+ if (nOps != 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hmoveto", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ charBuf->append((char)22);
+ nOps = 0;
+ break;
+ case 0x0017: // vstemhm
+ // ignored
+ if (firstOp) {
+ cvtGlyphWidth(nOps & 1, charBuf, pDict);
+ firstOp = gFalse;
+ }
+ if (nOps & 1) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 vstemhm", nOps);
+ }
+ nHints += nOps / 2;
+ nOps = 0;
+ break;
+ case 0x0018: // rcurveline
+ if (nOps < 8 || (nOps - 2) % 6 != 0) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 rcurveline", nOps);
+ }
+ for (k = 0; k < nOps - 2; k += 6) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
+ charBuf->append((char)8);
+ }
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
+ charBuf->append((char)5);
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0019: // rlinecurve
+ if (nOps < 8 || (nOps - 6) % 2 != 0) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 rlinecurve", nOps);
+ }
+ for (k = 0; k < nOps - 6; k += 2) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
+ charBuf->append((char)5);
+ }
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
+ charBuf->append((char)8);
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x001a: // vvcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 vvcurveto", nOps);
+ }
+ if (nOps % 2 == 1) {
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[4].num, ops[4].isFP, charBuf);
+ charBuf->append((char)8);
+ k = 5;
+ } else {
+ k = 0;
+ }
+ for (; k < nOps; k += 4) {
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ charBuf->append((char)8);
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x001b: // hhcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hhcurveto", nOps);
+ }
+ if (nOps % 2 == 1) {
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ cvtNum(ops[4].num, ops[4].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ charBuf->append((char)8);
+ k = 5;
+ } else {
+ k = 0;
+ }
+ for (; k < nOps; k += 4) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ charBuf->append((char)8);
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x001d: // callgsubr
+ if (nOps >= 1) {
+ k = gsubrBias + (int)ops[nOps - 1].num;
+ --nOps;
+ ok = gTrue;
+ getIndexVal(&gsubrIdx, k, &val, &ok);
+ if (ok) {
+ cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
+ }
+ } else {
+ //~ error(-1, "Too few args to Type 2 callgsubr");
+ }
+ // don't clear the stack
+ break;
+ case 0x001e: // vhcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 vhcurveto", nOps);
+ }
+ for (k = 0; k < nOps && k != nOps-5; k += 4) {
+ if (k % 8 == 0) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ charBuf->append((char)30);
+ } else {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ charBuf->append((char)31);
+ }
+ }
+ if (k == nOps-5) {
+ if (k % 8 == 0) {
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ } else {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ }
+ charBuf->append((char)8);
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x001f: // hvcurveto
+ if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hvcurveto", nOps);
+ }
+ for (k = 0; k < nOps && k != nOps-5; k += 4) {
+ if (k % 8 == 0) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ charBuf->append((char)31);
+ } else {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ charBuf->append((char)30);
+ }
+ }
+ if (k == nOps-5) {
+ if (k % 8 == 0) {
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ } else {
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[k].num, ops[k].isFP, charBuf);
+ cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+ cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
+ cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+ cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+ }
+ charBuf->append((char)8);
+ }
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0c00: // dotsection (should be Type 1 only?)
+ // ignored
+ nOps = 0;
+ break;
+ case 0x0c03: // and
+ case 0x0c04: // or
+ case 0x0c05: // not
+ case 0x0c08: // store
+ case 0x0c09: // abs
+ case 0x0c0a: // add
+ case 0x0c0b: // sub
+ case 0x0c0c: // div
+ case 0x0c0d: // load
+ case 0x0c0e: // neg
+ case 0x0c0f: // eq
+ case 0x0c12: // drop
+ case 0x0c14: // put
+ case 0x0c15: // get
+ case 0x0c16: // ifelse
+ case 0x0c17: // random
+ case 0x0c18: // mul
+ case 0x0c1a: // sqrt
+ case 0x0c1b: // dup
+ case 0x0c1c: // exch
+ case 0x0c1d: // index
+ case 0x0c1e: // roll
+ //~ error(-1, "Unimplemented Type 2 charstring op: 12.%d", file[i+1]);
+ nOps = 0;
+ break;
+ case 0x0c22: // hflex
+ if (nOps != 7) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hflex", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ charBuf->append((char)8);
+ cvtNum(ops[4].num, ops[4].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[5].num, ops[5].isFP, charBuf);
+ cvtNum(-ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[6].num, ops[6].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ charBuf->append((char)8);
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0c23: // flex
+ if (nOps != 13) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 flex", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ cvtNum(ops[4].num, ops[4].isFP, charBuf);
+ cvtNum(ops[5].num, ops[5].isFP, charBuf);
+ charBuf->append((char)8);
+ cvtNum(ops[6].num, ops[6].isFP, charBuf);
+ cvtNum(ops[7].num, ops[7].isFP, charBuf);
+ cvtNum(ops[8].num, ops[8].isFP, charBuf);
+ cvtNum(ops[9].num, ops[9].isFP, charBuf);
+ cvtNum(ops[10].num, ops[10].isFP, charBuf);
+ cvtNum(ops[11].num, ops[11].isFP, charBuf);
+ charBuf->append((char)8);
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0c24: // hflex1
+ if (nOps != 9) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 hflex1", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ cvtNum(ops[4].num, ops[4].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ charBuf->append((char)8);
+ cvtNum(ops[5].num, ops[5].isFP, charBuf);
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(ops[6].num, ops[6].isFP, charBuf);
+ cvtNum(ops[7].num, ops[7].isFP, charBuf);
+ cvtNum(ops[8].num, ops[8].isFP, charBuf);
+ cvtNum(-(ops[1].num + ops[3].num + ops[7].num),
+ ops[1].isFP | ops[3].isFP | ops[7].isFP, charBuf);
+ charBuf->append((char)8);
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ case 0x0c25: // flex1
+ if (nOps != 11) {
+ //~ error(-1, "Wrong number of args (%d) to Type 2 flex1", nOps);
+ }
+ cvtNum(ops[0].num, ops[0].isFP, charBuf);
+ cvtNum(ops[1].num, ops[1].isFP, charBuf);
+ cvtNum(ops[2].num, ops[2].isFP, charBuf);
+ cvtNum(ops[3].num, ops[3].isFP, charBuf);
+ cvtNum(ops[4].num, ops[4].isFP, charBuf);
+ cvtNum(ops[5].num, ops[5].isFP, charBuf);
+ charBuf->append((char)8);
+ cvtNum(ops[6].num, ops[6].isFP, charBuf);
+ cvtNum(ops[7].num, ops[7].isFP, charBuf);
+ cvtNum(ops[8].num, ops[8].isFP, charBuf);
+ cvtNum(ops[9].num, ops[9].isFP, charBuf);
+ dx = ops[0].num + ops[2].num + ops[4].num + ops[6].num + ops[8].num;
+ dy = ops[1].num + ops[3].num + ops[5].num + ops[7].num + ops[9].num;
+ if (fabs(dx) > fabs(dy)) {
+ cvtNum(ops[10].num, ops[10].isFP, charBuf);
+ cvtNum(-dy, ops[1].isFP | ops[3].isFP | ops[5].isFP |
+ ops[7].isFP | ops[9].isFP, charBuf);
+ } else {
+ cvtNum(-dx, ops[0].isFP | ops[2].isFP | ops[4].isFP |
+ ops[6].isFP | ops[8].isFP, charBuf);
+ cvtNum(ops[10].num, ops[10].isFP, charBuf);
+ }
+ charBuf->append((char)8);
+ nOps = 0;
+ openPath = gTrue;
+ break;
+ default:
+ //~ error(-1, "Illegal Type 2 charstring op: %04x",
+ //~ ops[nOps].op);
+ nOps = 0;
+ break;
+ }
+ }
+ }
+
+ // charstring encryption
+ if (top) {
+ r2 = 4330;
+ for (i = start; i < charBuf->getLength(); ++i) {
+ byte = charBuf->getChar(i) ^ (r2 >> 8);
+ charBuf->setChar(i, byte);
+ r2 = (byte + r2) * 52845 + 22719;
+ }
+ }
+}
+
+void FoFiType1C::cvtGlyphWidth(GBool useOp, GString *charBuf,
+ Type1CPrivateDict *pDict) {
+ double w;
+ GBool wFP;
+ int i;
+
+ if (useOp) {
+ w = pDict->nominalWidthX + ops[0].num;
+ wFP = pDict->nominalWidthXFP | ops[0].isFP;
+ for (i = 1; i < nOps; ++i) {
+ ops[i-1] = ops[i];
+ }
+ --nOps;
+ } else {
+ w = pDict->defaultWidthX;
+ wFP = pDict->defaultWidthXFP;
+ }
+ cvtNum(0, gFalse, charBuf);
+ cvtNum(w, wFP, charBuf);
+ charBuf->append((char)13);
+}
+
+void FoFiType1C::cvtNum(double x, GBool isFP, GString *charBuf) {
+ Guchar buf[12];
+ int y, n;
+
+ n = 0;
+ if (isFP) {
+ if (x >= -32768 && x < 32768) {
+ y = (int)(x * 256.0);
+ buf[0] = 255;
+ buf[1] = (Guchar)(y >> 24);
+ buf[2] = (Guchar)(y >> 16);
+ buf[3] = (Guchar)(y >> 8);
+ buf[4] = (Guchar)y;
+ buf[5] = 255;
+ buf[6] = 0;
+ buf[7] = 0;
+ buf[8] = 1;
+ buf[9] = 0;
+ buf[10] = 12;
+ buf[11] = 12;
+ n = 12;
+ } else {
+ //~ error(-1, "Type 2 fixed point constant out of range");
+ }
+ } else {
+ y = (int)x;
+ if (y >= -107 && y <= 107) {
+ buf[0] = (Guchar)(y + 139);
+ n = 1;
+ } else if (y > 107 && y <= 1131) {
+ y -= 108;
+ buf[0] = (Guchar)((y >> 8) + 247);
+ buf[1] = (Guchar)(y & 0xff);
+ n = 2;
+ } else if (y < -107 && y >= -1131) {
+ y = -y - 108;
+ buf[0] = (Guchar)((y >> 8) + 251);
+ buf[1] = (Guchar)(y & 0xff);
+ n = 2;
+ } else {
+ buf[0] = 255;
+ buf[1] = (Guchar)(y >> 24);
+ buf[2] = (Guchar)(y >> 16);
+ buf[3] = (Guchar)(y >> 8);
+ buf[4] = (Guchar)y;
+ n = 5;
+ }
+ }
+ charBuf->append((char *)buf, n);
+}
+
+void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, char *s) {
+ Guchar *p;
+ Guchar x;
+
+ for (p = (Guchar *)s; *p; ++p) {
+ x = *p ^ (eb->r1 >> 8);
+ eb->r1 = (x + eb->r1) * 52845 + 22719;
+ if (eb->ascii) {
+ (*eb->outputFunc)(eb->outputStream, &hexChars[x >> 4], 1);
+ (*eb->outputFunc)(eb->outputStream, &hexChars[x & 0x0f], 1);
+ eb->line += 2;
+ if (eb->line == 64) {
+ (*eb->outputFunc)(eb->outputStream, "\n", 1);
+ eb->line = 0;
+ }
+ } else {
+ (*eb->outputFunc)(eb->outputStream, (char *)&x, 1);
+ }
+ }
+}
+
+void FoFiType1C::eexecWriteCharstring(Type1CEexecBuf *eb,
+ Guchar *s, int n) {
+ Guchar x;
+ int i;
+
+ // eexec encryption
+ for (i = 0; i < n; ++i) {
+ x = s[i] ^ (eb->r1 >> 8);
+ eb->r1 = (x + eb->r1) * 52845 + 22719;
+ if (eb->ascii) {
+ (*eb->outputFunc)(eb->outputStream, &hexChars[x >> 4], 1);
+ (*eb->outputFunc)(eb->outputStream, &hexChars[x & 0x0f], 1);
+ eb->line += 2;
+ if (eb->line == 64) {
+ (*eb->outputFunc)(eb->outputStream, "\n", 1);
+ eb->line = 0;
+ }
+ } else {
+ (*eb->outputFunc)(eb->outputStream, (char *)&x, 1);
+ }
+ }
+}
+
+GBool FoFiType1C::parse() {
+ Type1CIndex fdIdx;
+ Type1CIndexVal val;
+ int i;
+
+ parsedOk = gTrue;
+
+ // some tools embed Type 1C fonts with an extra whitespace char at
+ // the beginning
+ if (len > 0 && file[0] != '\x01') {
+ ++file;
+ --len;
+ }
+
+ // find the indexes
+ getIndex(getU8(2, &parsedOk), &nameIdx, &parsedOk);
+ getIndex(nameIdx.endPos, &topDictIdx, &parsedOk);
+ getIndex(topDictIdx.endPos, &stringIdx, &parsedOk);
+ getIndex(stringIdx.endPos, &gsubrIdx, &parsedOk);
+ if (!parsedOk) {
+ return gFalse;
+ }
+ gsubrBias = (gsubrIdx.len < 1240) ? 107
+ : (gsubrIdx.len < 33900) ? 1131 : 32768;
+
+ // read the first font name
+ getIndexVal(&nameIdx, 0, &val, &parsedOk);
+ if (!parsedOk) {
+ return gFalse;
+ }
+ name = new GString((char *)&file[val.pos], val.len);
+
+ // read the top dict for the first font
+ readTopDict();
+
+ // for CID fonts: read the FDArray dicts and private dicts
+ if (topDict.firstOp == 0x0c1e) {
+ if (topDict.fdArrayOffset == 0) {
+ nFDs = 1;
+ privateDicts = (Type1CPrivateDict *)gmalloc(sizeof(Type1CPrivateDict));
+ readPrivateDict(0, 0, &privateDicts[0]);
+ } else {
+ getIndex(topDict.fdArrayOffset, &fdIdx, &parsedOk);
+ if (!parsedOk) {
+ return gFalse;
+ }
+ nFDs = fdIdx.len;
+ privateDicts = (Type1CPrivateDict *)
+ gmallocn(nFDs, sizeof(Type1CPrivateDict));
+ for (i = 0; i < nFDs; ++i) {
+ getIndexVal(&fdIdx, i, &val, &parsedOk);
+ if (!parsedOk) {
+ return gFalse;
+ }
+ readFD(val.pos, val.len, &privateDicts[i]);
+ }
+ }
+
+ // for 8-bit fonts: read the private dict
+ } else {
+ privateDicts = (Type1CPrivateDict *)gmalloc(sizeof(Type1CPrivateDict));
+ readPrivateDict(topDict.privateOffset, topDict.privateSize,
+ &privateDicts[0]);
+ }
+
+ // check for parse errors in the private dict(s)
+ if (!parsedOk) {
+ return gFalse;
+ }
+
+ // get the charstrings index
+ if (topDict.charStringsOffset <= 0) {
+ parsedOk = gFalse;
+ return gFalse;
+ }
+ getIndex(topDict.charStringsOffset, &charStringsIdx, &parsedOk);
+ if (!parsedOk) {
+ return gFalse;
+ }
+ nGlyphs = charStringsIdx.len;
+
+ // for CID fonts: read the FDSelect table
+ if (topDict.firstOp == 0x0c1e) {
+ readFDSelect();
+ if (!parsedOk) {
+ return gFalse;
+ }
+ }
+
+ // read the charset
+ if (!readCharset()) {
+ parsedOk = gFalse;
+ return gFalse;
+ }
+
+ // for 8-bit fonts: build the encoding
+ if (topDict.firstOp != 0x0c14 && topDict.firstOp != 0x0c1e) {
+ buildEncoding();
+ if (!parsedOk) {
+ return gFalse;
+ }
+ }
+
+ return parsedOk;
+}
+
+void FoFiType1C::readTopDict() {
+ Type1CIndexVal topDictPtr;
+ int pos;
+
+ topDict.firstOp = -1;
+ topDict.versionSID = 0;
+ topDict.noticeSID = 0;
+ topDict.copyrightSID = 0;
+ topDict.fullNameSID = 0;
+ topDict.familyNameSID = 0;
+ topDict.weightSID = 0;
+ topDict.isFixedPitch = 0;
+ topDict.italicAngle = 0;
+ topDict.underlinePosition = -100;
+ topDict.underlineThickness = 50;
+ topDict.paintType = 0;
+ topDict.charstringType = 2;
+ topDict.fontMatrix[0] = 0.001;
+ topDict.fontMatrix[1] = 0;
+ topDict.fontMatrix[2] = 0;
+ topDict.fontMatrix[3] = 0.001;
+ topDict.fontMatrix[4] = 0;
+ topDict.fontMatrix[5] = 0;
+ topDict.hasFontMatrix = gFalse;
+ topDict.uniqueID = 0;
+ topDict.fontBBox[0] = 0;
+ topDict.fontBBox[1] = 0;
+ topDict.fontBBox[2] = 0;
+ topDict.fontBBox[3] = 0;
+ topDict.strokeWidth = 0;
+ topDict.charsetOffset = 0;
+ topDict.encodingOffset = 0;
+ topDict.charStringsOffset = 0;
+ topDict.privateSize = 0;
+ topDict.privateOffset = 0;
+ topDict.registrySID = 0;
+ topDict.orderingSID = 0;
+ topDict.supplement = 0;
+ topDict.fdArrayOffset = 0;
+ topDict.fdSelectOffset = 0;
+
+ getIndexVal(&topDictIdx, 0, &topDictPtr, &parsedOk);
+ pos = topDictPtr.pos;
+ nOps = 0;
+ while (pos < topDictPtr.pos + topDictPtr.len) {
+ pos = getOp(pos, gFalse, &parsedOk);
+ if (!parsedOk) {
+ break;
+ }
+ if (!ops[nOps - 1].isNum) {
+ --nOps; // drop the operator
+ if (topDict.firstOp < 0) {
+ topDict.firstOp = ops[nOps].op;
+ }
+ switch (ops[nOps].op) {
+ case 0x0000: topDict.versionSID = (int)ops[0].num; break;
+ case 0x0001: topDict.noticeSID = (int)ops[0].num; break;
+ case 0x0c00: topDict.copyrightSID = (int)ops[0].num; break;
+ case 0x0002: topDict.fullNameSID = (int)ops[0].num; break;
+ case 0x0003: topDict.familyNameSID = (int)ops[0].num; break;
+ case 0x0004: topDict.weightSID = (int)ops[0].num; break;
+ case 0x0c01: topDict.isFixedPitch = (int)ops[0].num; break;
+ case 0x0c02: topDict.italicAngle = ops[0].num; break;
+ case 0x0c03: topDict.underlinePosition = ops[0].num; break;
+ case 0x0c04: topDict.underlineThickness = ops[0].num; break;
+ case 0x0c05: topDict.paintType = (int)ops[0].num; break;
+ case 0x0c06: topDict.charstringType = (int)ops[0].num; break;
+ case 0x0c07: topDict.fontMatrix[0] = ops[0].num;
+ topDict.fontMatrix[1] = ops[1].num;
+ topDict.fontMatrix[2] = ops[2].num;
+ topDict.fontMatrix[3] = ops[3].num;
+ topDict.fontMatrix[4] = ops[4].num;
+ topDict.fontMatrix[5] = ops[5].num;
+ topDict.hasFontMatrix = gTrue; break;
+ case 0x000d: topDict.uniqueID = (int)ops[0].num; break;
+ case 0x0005: topDict.fontBBox[0] = ops[0].num;
+ topDict.fontBBox[1] = ops[1].num;
+ topDict.fontBBox[2] = ops[2].num;
+ topDict.fontBBox[3] = ops[3].num; break;
+ case 0x0c08: topDict.strokeWidth = ops[0].num; break;
+ case 0x000f: topDict.charsetOffset = (int)ops[0].num; break;
+ case 0x0010: topDict.encodingOffset = (int)ops[0].num; break;
+ case 0x0011: topDict.charStringsOffset = (int)ops[0].num; break;
+ case 0x0012: topDict.privateSize = (int)ops[0].num;
+ topDict.privateOffset = (int)ops[1].num; break;
+ case 0x0c1e: topDict.registrySID = (int)ops[0].num;
+ topDict.orderingSID = (int)ops[1].num;
+ topDict.supplement = (int)ops[2].num; break;
+ case 0x0c24: topDict.fdArrayOffset = (int)ops[0].num; break;
+ case 0x0c25: topDict.fdSelectOffset = (int)ops[0].num; break;
+ }
+ nOps = 0;
+ }
+ }
+}
+
+// Read a CID font dict (FD) - this pulls out the private dict
+// pointer, and reads the private dict. It also pulls the FontMatrix
+// (if any) out of the FD.
+void FoFiType1C::readFD(int offset, int length, Type1CPrivateDict *pDict) {
+ int pos, pSize, pOffset;
+ double fontMatrix[6];
+ GBool hasFontMatrix;
+
+ hasFontMatrix = gFalse;
+ pSize = pOffset = 0;
+ pos = offset;
+ nOps = 0;
+ while (pos < offset + length) {
+ pos = getOp(pos, gFalse, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ if (!ops[nOps - 1].isNum) {
+ if (ops[nOps - 1].op == 0x0012) {
+ if (nOps < 3) {
+ parsedOk = gFalse;
+ return;
+ }
+ pSize = (int)ops[0].num;
+ pOffset = (int)ops[1].num;
+ break;
+ } else if (ops[nOps - 1].op == 0x0c07) {
+ fontMatrix[0] = ops[0].num;
+ fontMatrix[1] = ops[1].num;
+ fontMatrix[2] = ops[2].num;
+ fontMatrix[3] = ops[3].num;
+ fontMatrix[4] = ops[4].num;
+ fontMatrix[5] = ops[5].num;
+ hasFontMatrix = gTrue;
+ }
+ nOps = 0;
+ }
+ }
+ readPrivateDict(pOffset, pSize, pDict);
+ if (hasFontMatrix) {
+ pDict->fontMatrix[0] = fontMatrix[0];
+ pDict->fontMatrix[1] = fontMatrix[1];
+ pDict->fontMatrix[2] = fontMatrix[2];
+ pDict->fontMatrix[3] = fontMatrix[3];
+ pDict->fontMatrix[4] = fontMatrix[4];
+ pDict->fontMatrix[5] = fontMatrix[5];
+ pDict->hasFontMatrix = gTrue;
+ }
+}
+
+void FoFiType1C::readPrivateDict(int offset, int length,
+ Type1CPrivateDict *pDict) {
+ int pos;
+
+ pDict->hasFontMatrix = gFalse;
+ pDict->nBlueValues = 0;
+ pDict->nOtherBlues = 0;
+ pDict->nFamilyBlues = 0;
+ pDict->nFamilyOtherBlues = 0;
+ pDict->blueScale = 0.039625;
+ pDict->blueShift = 7;
+ pDict->blueFuzz = 1;
+ pDict->hasStdHW = gFalse;
+ pDict->hasStdVW = gFalse;
+ pDict->nStemSnapH = 0;
+ pDict->nStemSnapV = 0;
+ pDict->hasForceBold = gFalse;
+ pDict->forceBoldThreshold = 0;
+ pDict->languageGroup = 0;
+ pDict->expansionFactor = 0.06;
+ pDict->initialRandomSeed = 0;
+ pDict->subrsOffset = 0;
+ pDict->defaultWidthX = 0;
+ pDict->defaultWidthXFP = gFalse;
+ pDict->nominalWidthX = 0;
+ pDict->nominalWidthXFP = gFalse;
+
+ // no dictionary
+ if (offset == 0 || length == 0) {
+ return;
+ }
+
+ pos = offset;
+ nOps = 0;
+ while (pos < offset + length) {
+ pos = getOp(pos, gFalse, &parsedOk);
+ if (!parsedOk) {
+ break;
+ }
+ if (!ops[nOps - 1].isNum) {
+ --nOps; // drop the operator
+ switch (ops[nOps].op) {
+ case 0x0006:
+ pDict->nBlueValues = getDeltaIntArray(pDict->blueValues,
+ type1CMaxBlueValues);
+ break;
+ case 0x0007:
+ pDict->nOtherBlues = getDeltaIntArray(pDict->otherBlues,
+ type1CMaxOtherBlues);
+ break;
+ case 0x0008:
+ pDict->nFamilyBlues = getDeltaIntArray(pDict->familyBlues,
+ type1CMaxBlueValues);
+ break;
+ case 0x0009:
+ pDict->nFamilyOtherBlues = getDeltaIntArray(pDict->familyOtherBlues,
+ type1CMaxOtherBlues);
+ break;
+ case 0x0c09:
+ pDict->blueScale = ops[0].num;
+ break;
+ case 0x0c0a:
+ pDict->blueShift = (int)ops[0].num;
+ break;
+ case 0x0c0b:
+ pDict->blueFuzz = (int)ops[0].num;
+ break;
+ case 0x000a:
+ pDict->stdHW = ops[0].num;
+ pDict->hasStdHW = gTrue;
+ break;
+ case 0x000b:
+ pDict->stdVW = ops[0].num;
+ pDict->hasStdVW = gTrue;
+ break;
+ case 0x0c0c:
+ pDict->nStemSnapH = getDeltaFPArray(pDict->stemSnapH,
+ type1CMaxStemSnap);
+ break;
+ case 0x0c0d:
+ pDict->nStemSnapV = getDeltaFPArray(pDict->stemSnapV,
+ type1CMaxStemSnap);
+ break;
+ case 0x0c0e:
+ pDict->forceBold = ops[0].num != 0;
+ pDict->hasForceBold = gTrue;
+ break;
+ case 0x0c0f:
+ pDict->forceBoldThreshold = ops[0].num;
+ break;
+ case 0x0c11:
+ pDict->languageGroup = (int)ops[0].num;
+ break;
+ case 0x0c12:
+ pDict->expansionFactor = ops[0].num;
+ break;
+ case 0x0c13:
+ pDict->initialRandomSeed = (int)ops[0].num;
+ break;
+ case 0x0013:
+ pDict->subrsOffset = offset + (int)ops[0].num;
+ break;
+ case 0x0014:
+ pDict->defaultWidthX = ops[0].num;
+ pDict->defaultWidthXFP = ops[0].isFP;
+ break;
+ case 0x0015:
+ pDict->nominalWidthX = ops[0].num;
+ pDict->nominalWidthXFP = ops[0].isFP;
+ break;
+ }
+ nOps = 0;
+ }
+ }
+}
+
+void FoFiType1C::readFDSelect() {
+ int fdSelectFmt, pos, nRanges, gid0, gid1, fd, i, j;
+
+ fdSelect = (Guchar *)gmalloc(nGlyphs);
+ if (topDict.fdSelectOffset == 0) {
+ for (i = 0; i < nGlyphs; ++i) {
+ fdSelect[i] = 0;
+ }
+ } else {
+ pos = topDict.fdSelectOffset;
+ fdSelectFmt = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ if (fdSelectFmt == 0) {
+ if (!checkRegion(pos, nGlyphs)) {
+ parsedOk = gFalse;
+ return;
+ }
+ memcpy(fdSelect, file + pos, nGlyphs);
+ } else if (fdSelectFmt == 3) {
+ nRanges = getU16BE(pos, &parsedOk);
+ pos += 2;
+ gid0 = getU16BE(pos, &parsedOk);
+ pos += 2;
+ for (i = 1; i <= nRanges; ++i) {
+ fd = getU8(pos++, &parsedOk);
+ gid1 = getU16BE(pos, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ pos += 2;
+ if (gid0 > gid1 || gid1 > nGlyphs) {
+ //~ error(-1, "Bad FDSelect table in CID font");
+ parsedOk = gFalse;
+ return;
+ }
+ for (j = gid0; j < gid1; ++j) {
+ fdSelect[j] = fd;
+ }
+ gid0 = gid1;
+ }
+ } else {
+ //~ error(-1, "Unknown FDSelect table format in CID font");
+ for (i = 0; i < nGlyphs; ++i) {
+ fdSelect[i] = 0;
+ }
+ }
+ }
+}
+
+void FoFiType1C::buildEncoding() {
+ char buf[256];
+ int nCodes, nRanges, encFormat;
+ int pos, c, sid, nLeft, nSups, i, j;
+
+ if (topDict.encodingOffset == 0) {
+ encoding = fofiType1StandardEncoding;
+
+ } else if (topDict.encodingOffset == 1) {
+ encoding = fofiType1ExpertEncoding;
+
+ } else {
+ encoding = (char **)gmallocn(256, sizeof(char *));
+ for (i = 0; i < 256; ++i) {
+ encoding[i] = NULL;
+ }
+ pos = topDict.encodingOffset;
+ encFormat = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ if ((encFormat & 0x7f) == 0) {
+ nCodes = 1 + getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ if (nCodes > nGlyphs) {
+ nCodes = nGlyphs;
+ }
+ for (i = 1; i < nCodes; ++i) {
+ c = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ if (encoding[c]) {
+ gfree(encoding[c]);
+ }
+ encoding[c] = copyString(getString(charset[i], buf, &parsedOk));
+ }
+ } else if ((encFormat & 0x7f) == 1) {
+ nRanges = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ nCodes = 1;
+ for (i = 0; i < nRanges; ++i) {
+ c = getU8(pos++, &parsedOk);
+ nLeft = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ for (j = 0; j <= nLeft && nCodes < nGlyphs; ++j) {
+ if (c < 256) {
+ if (encoding[c]) {
+ gfree(encoding[c]);
+ }
+ encoding[c] = copyString(getString(charset[nCodes], buf,
+ &parsedOk));
+ }
+ ++nCodes;
+ ++c;
+ }
+ }
+ }
+ if (encFormat & 0x80) {
+ nSups = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ return;
+ }
+ for (i = 0; i < nSups; ++i) {
+ c = getU8(pos++, &parsedOk);;
+ if (!parsedOk) {
+ return;;
+ }
+ sid = getU16BE(pos, &parsedOk);
+ pos += 2;
+ if (!parsedOk) {
+ return;
+ }
+ if (encoding[c]) {
+ gfree(encoding[c]);
+ }
+ encoding[c] = copyString(getString(sid, buf, &parsedOk));
+ }
+ }
+ }
+}
+
+GBool FoFiType1C::readCharset() {
+ int charsetFormat, c, pos;
+ int nLeft, i, j;
+
+ if (topDict.charsetOffset == 0) {
+ charset = fofiType1CISOAdobeCharset;
+ } else if (topDict.charsetOffset == 1) {
+ charset = fofiType1CExpertCharset;
+ } else if (topDict.charsetOffset == 2) {
+ charset = fofiType1CExpertSubsetCharset;
+ } else {
+ charset = (Gushort *)gmallocn(nGlyphs, sizeof(Gushort));
+ for (i = 0; i < nGlyphs; ++i) {
+ charset[i] = 0;
+ }
+ pos = topDict.charsetOffset;
+ charsetFormat = getU8(pos++, &parsedOk);
+ if (charsetFormat == 0) {
+ for (i = 1; i < nGlyphs; ++i) {
+ charset[i] = (Gushort)getU16BE(pos, &parsedOk);
+ pos += 2;
+ if (!parsedOk) {
+ break;
+ }
+ }
+ } else if (charsetFormat == 1) {
+ i = 1;
+ while (i < nGlyphs) {
+ c = getU16BE(pos, &parsedOk);
+ pos += 2;
+ nLeft = getU8(pos++, &parsedOk);
+ if (!parsedOk) {
+ break;
+ }
+ for (j = 0; j <= nLeft && i < nGlyphs; ++j) {
+ charset[i++] = (Gushort)c++;
+ }
+ }
+ } else if (charsetFormat == 2) {
+ i = 1;
+ while (i < nGlyphs) {
+ c = getU16BE(pos, &parsedOk);
+ pos += 2;
+ nLeft = getU16BE(pos, &parsedOk);
+ pos += 2;
+ if (!parsedOk) {
+ break;
+ }
+ for (j = 0; j <= nLeft && i < nGlyphs; ++j) {
+ charset[i++] = (Gushort)c++;
+ }
+ }
+ }
+ if (!parsedOk) {
+ gfree(charset);
+ charset = NULL;
+ return gFalse;
+ }
+ }
+ return gTrue;
+}
+
+int FoFiType1C::getOp(int pos, GBool charstring, GBool *ok) {
+ static char nybChars[16] = "0123456789.ee -";
+ Type1COp op;
+ char buf[65];
+ int b0, b1, nyb0, nyb1, x, i;
+
+ b0 = getU8(pos++, ok);
+ op.isNum = gTrue;
+ op.isFP = gFalse;
+
+ if (b0 == 28) {
+ x = getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ if (x & 0x8000) {
+ x |= ~0xffff;
+ }
+ op.num = x;
+
+ } else if (!charstring && b0 == 29) {
+ x = getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ if (x & 0x80000000) {
+ x |= ~0xffffffff;
+ }
+ op.num = x;
+
+ } else if (!charstring && b0 == 30) {
+ i = 0;
+ do {
+ b1 = getU8(pos++, ok);
+ nyb0 = b1 >> 4;
+ nyb1 = b1 & 0x0f;
+ if (nyb0 == 0xf) {
+ break;
+ }
+ buf[i++] = nybChars[nyb0];
+ if (i == 64) {
+ break;
+ }
+ if (nyb0 == 0xc) {
+ buf[i++] = '-';
+ }
+ if (i == 64) {
+ break;
+ }
+ if (nyb1 == 0xf) {
+ break;
+ }
+ buf[i++] = nybChars[nyb1];
+ if (i == 64) {
+ break;
+ }
+ if (nyb1 == 0xc) {
+ buf[i++] = '-';
+ }
+ } while (i < 64);
+ buf[i] = '\0';
+ op.num = atof(buf);
+ op.isFP = gTrue;
+
+ } else if (b0 >= 32 && b0 <= 246) {
+ op.num = b0 - 139;
+
+ } else if (b0 >= 247 && b0 <= 250) {
+ op.num = ((b0 - 247) << 8) + getU8(pos++, ok) + 108;
+
+ } else if (b0 >= 251 && b0 <= 254) {
+ op.num = -((b0 - 251) << 8) - getU8(pos++, ok) - 108;
+
+ } else if (charstring && b0 == 255) {
+ x = getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ x = (x << 8) | getU8(pos++, ok);
+ if (x & 0x80000000) {
+ x |= ~0xffffffff;
+ }
+ op.num = (double)x / 65536.0;
+ op.isFP = gTrue;
+
+ } else if (b0 == 12) {
+ op.isNum = gFalse;
+ op.op = 0x0c00 + getU8(pos++, ok);
+
+ } else {
+ op.isNum = gFalse;
+ op.op = b0;
+ }
+
+ if (nOps < 49) {
+ ops[nOps++] = op;
+ }
+
+ return pos;
+}
+
+// Convert the delta-encoded ops array to an array of ints.
+int FoFiType1C::getDeltaIntArray(int *arr, int maxLen) {
+ int x;
+ int n, i;
+
+ if ((n = nOps) > maxLen) {
+ n = maxLen;
+ }
+ x = 0;
+ for (i = 0; i < n; ++i) {
+ x += (int)ops[i].num;
+ arr[i] = x;
+ }
+ return n;
+}
+
+// Convert the delta-encoded ops array to an array of doubles.
+int FoFiType1C::getDeltaFPArray(double *arr, int maxLen) {
+ double x;
+ int n, i;
+
+ if ((n = nOps) > maxLen) {
+ n = maxLen;
+ }
+ x = 0;
+ for (i = 0; i < n; ++i) {
+ x += ops[i].num;
+ arr[i] = x;
+ }
+ return n;
+}
+
+void FoFiType1C::getIndex(int pos, Type1CIndex *idx, GBool *ok) {
+ idx->pos = pos;
+ idx->len = getU16BE(pos, ok);
+ if (idx->len == 0) {
+ // empty indexes are legal and contain just the length field
+ idx->offSize = 0;
+ idx->startPos = idx->endPos = pos + 2;
+ } else {
+ idx->offSize = getU8(pos + 2, ok);
+ if (idx->offSize < 1 || idx->offSize > 4) {
+ *ok = gFalse;
+ }
+ idx->startPos = pos + 3 + (idx->len + 1) * idx->offSize - 1;
+ if (idx->startPos < 0 || idx->startPos >= len) {
+ *ok = gFalse;
+ }
+ idx->endPos = idx->startPos + getUVarBE(pos + 3 + idx->len * idx->offSize,
+ idx->offSize, ok);
+ if (idx->endPos < idx->startPos || idx->endPos > len) {
+ *ok = gFalse;
+ }
+ }
+}
+
+void FoFiType1C::getIndexVal(Type1CIndex *idx, int i,
+ Type1CIndexVal *val, GBool *ok) {
+ int pos0, pos1;
+
+ if (i < 0 || i >= idx->len) {
+ *ok = gFalse;
+ return;
+ }
+ pos0 = idx->startPos + getUVarBE(idx->pos + 3 + i * idx->offSize,
+ idx->offSize, ok);
+ pos1 = idx->startPos + getUVarBE(idx->pos + 3 + (i + 1) * idx->offSize,
+ idx->offSize, ok);
+ if (pos0 < idx->startPos || pos0 > idx->endPos ||
+ pos1 <= idx->startPos || pos1 > idx->endPos ||
+ pos1 < pos0) {
+ *ok = gFalse;
+ }
+ val->pos = pos0;
+ val->len = pos1 - pos0;
+}
+
+char *FoFiType1C::getString(int sid, char *buf, GBool *ok) {
+ Type1CIndexVal val;
+ int n;
+
+ if (sid < 391) {
+ strcpy(buf, fofiType1CStdStrings[sid]);
+ } else {
+ sid -= 391;
+ getIndexVal(&stringIdx, sid, &val, ok);
+ if (*ok) {
+ if ((n = val.len) > 255) {
+ n = 255;
+ }
+ strncpy(buf, (char *)&file[val.pos], n);
+ buf[n] = '\0';
+ } else {
+ buf[0] = '\0';
+ }
+ }
+ return buf;
+}
diff --git a/kpdf/xpdf/fofi/Makefile.am b/kpdf/xpdf/fofi/Makefile.am
index 7ca93922..9a1ec4aa 100644
--- a/kpdf/xpdf/fofi/Makefile.am
+++ b/kpdf/xpdf/fofi/Makefile.am
@@ -1,8 +1,8 @@
INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../goo $(all_includes)
libfofi_la_LDFLAGS = $(all_libraries)
-libfofi_la_SOURCES = FoFiBase.cc FoFiEncodings.cc FoFiTrueType.cc \
- FoFiType1.cc FoFiType1C.cc
+libfofi_la_SOURCES = FoFiBase.cpp FoFiEncodings.cpp FoFiTrueType.cpp \
+ FoFiType1.cpp FoFiType1C.cpp
METASOURCES = AUTO
diff --git a/kpdf/xpdf/goo/CMakeLists.txt b/kpdf/xpdf/goo/CMakeLists.txt
index 5a5a0ac8..dd6dc2d1 100644
--- a/kpdf/xpdf/goo/CMakeLists.txt
+++ b/kpdf/xpdf/goo/CMakeLists.txt
@@ -22,5 +22,5 @@ include_directories(
tde_add_library( goo STATIC_PIC
SOURCES
- GHash.cc GList.cc GString.cc gfile.cc gmem.cc gmempp.cc
+ GHash.cpp GList.cpp GString.cpp gfile.cpp gmem.cpp gmempp.cpp
)
diff --git a/kpdf/xpdf/goo/GHash.cc b/kpdf/xpdf/goo/GHash.cc
deleted file mode 100644
index b51a7643..00000000
--- a/kpdf/xpdf/goo/GHash.cc
+++ /dev/null
@@ -1,380 +0,0 @@
-//========================================================================
-//
-// GHash.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "gmem.h"
-#include "GString.h"
-#include "GHash.h"
-
-//------------------------------------------------------------------------
-
-struct GHashBucket {
- GString *key;
- union {
- void *p;
- int i;
- } val;
- GHashBucket *next;
-};
-
-struct GHashIter {
- int h;
- GHashBucket *p;
-};
-
-//------------------------------------------------------------------------
-
-GHash::GHash(GBool deleteKeysA) {
- int h;
-
- deleteKeys = deleteKeysA;
- size = 7;
- tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
- for (h = 0; h < size; ++h) {
- tab[h] = NULL;
- }
- len = 0;
-}
-
-GHash::~GHash() {
- GHashBucket *p;
- int h;
-
- for (h = 0; h < size; ++h) {
- while (tab[h]) {
- p = tab[h];
- tab[h] = p->next;
- if (deleteKeys) {
- delete p->key;
- }
- delete p;
- }
- }
- gfree(tab);
-}
-
-void GHash::add(GString *key, void *val) {
- GHashBucket *p;
- int h;
-
- // expand the table if necessary
- if (len >= size) {
- expand();
- }
-
- // add the new symbol
- p = new GHashBucket;
- p->key = key;
- p->val.p = val;
- h = hash(key);
- p->next = tab[h];
- tab[h] = p;
- ++len;
-}
-
-void GHash::add(GString *key, int val) {
- GHashBucket *p;
- int h;
-
- // expand the table if necessary
- if (len >= size) {
- expand();
- }
-
- // add the new symbol
- p = new GHashBucket;
- p->key = key;
- p->val.i = val;
- h = hash(key);
- p->next = tab[h];
- tab[h] = p;
- ++len;
-}
-
-void GHash::replace(GString *key, void *val) {
- GHashBucket *p;
- int h;
-
- if ((p = find(key, &h))) {
- p->val.p = val;
- delete key;
- } else {
- add(key, val);
- }
-}
-
-void GHash::replace(GString *key, int val) {
- GHashBucket *p;
- int h;
-
- if ((p = find(key, &h))) {
- p->val.i = val;
- delete key;
- } else {
- add(key, val);
- }
-}
-
-void *GHash::lookup(GString *key) {
- GHashBucket *p;
- int h;
-
- if (!(p = find(key, &h))) {
- return NULL;
- }
- return p->val.p;
-}
-
-int GHash::lookupInt(GString *key) {
- GHashBucket *p;
- int h;
-
- if (!(p = find(key, &h))) {
- return 0;
- }
- return p->val.i;
-}
-
-void *GHash::lookup(char *key) {
- GHashBucket *p;
- int h;
-
- if (!(p = find(key, &h))) {
- return NULL;
- }
- return p->val.p;
-}
-
-int GHash::lookupInt(char *key) {
- GHashBucket *p;
- int h;
-
- if (!(p = find(key, &h))) {
- return 0;
- }
- return p->val.i;
-}
-
-void *GHash::remove(GString *key) {
- GHashBucket *p;
- GHashBucket **q;
- void *val;
- int h;
-
- if (!(p = find(key, &h))) {
- return NULL;
- }
- q = &tab[h];
- while (*q != p) {
- q = &((*q)->next);
- }
- *q = p->next;
- if (deleteKeys) {
- delete p->key;
- }
- val = p->val.p;
- delete p;
- --len;
- return val;
-}
-
-int GHash::removeInt(GString *key) {
- GHashBucket *p;
- GHashBucket **q;
- int val;
- int h;
-
- if (!(p = find(key, &h))) {
- return 0;
- }
- q = &tab[h];
- while (*q != p) {
- q = &((*q)->next);
- }
- *q = p->next;
- if (deleteKeys) {
- delete p->key;
- }
- val = p->val.i;
- delete p;
- --len;
- return val;
-}
-
-void *GHash::remove(char *key) {
- GHashBucket *p;
- GHashBucket **q;
- void *val;
- int h;
-
- if (!(p = find(key, &h))) {
- return NULL;
- }
- q = &tab[h];
- while (*q != p) {
- q = &((*q)->next);
- }
- *q = p->next;
- if (deleteKeys) {
- delete p->key;
- }
- val = p->val.p;
- delete p;
- --len;
- return val;
-}
-
-int GHash::removeInt(char *key) {
- GHashBucket *p;
- GHashBucket **q;
- int val;
- int h;
-
- if (!(p = find(key, &h))) {
- return 0;
- }
- q = &tab[h];
- while (*q != p) {
- q = &((*q)->next);
- }
- *q = p->next;
- if (deleteKeys) {
- delete p->key;
- }
- val = p->val.i;
- delete p;
- --len;
- return val;
-}
-
-void GHash::startIter(GHashIter **iter) {
- *iter = new GHashIter;
- (*iter)->h = -1;
- (*iter)->p = NULL;
-}
-
-GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
- if (!*iter) {
- return gFalse;
- }
- if ((*iter)->p) {
- (*iter)->p = (*iter)->p->next;
- }
- while (!(*iter)->p) {
- if (++(*iter)->h == size) {
- delete *iter;
- *iter = NULL;
- return gFalse;
- }
- (*iter)->p = tab[(*iter)->h];
- }
- *key = (*iter)->p->key;
- *val = (*iter)->p->val.p;
- return gTrue;
-}
-
-GBool GHash::getNext(GHashIter **iter, GString **key, int *val) {
- if (!*iter) {
- return gFalse;
- }
- if ((*iter)->p) {
- (*iter)->p = (*iter)->p->next;
- }
- while (!(*iter)->p) {
- if (++(*iter)->h == size) {
- delete *iter;
- *iter = NULL;
- return gFalse;
- }
- (*iter)->p = tab[(*iter)->h];
- }
- *key = (*iter)->p->key;
- *val = (*iter)->p->val.i;
- return gTrue;
-}
-
-void GHash::killIter(GHashIter **iter) {
- delete *iter;
- *iter = NULL;
-}
-
-void GHash::expand() {
- GHashBucket **oldTab;
- GHashBucket *p;
- int oldSize, h, i;
-
- oldSize = size;
- oldTab = tab;
- size = 2*size + 1;
- tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
- for (h = 0; h < size; ++h) {
- tab[h] = NULL;
- }
- for (i = 0; i < oldSize; ++i) {
- while (oldTab[i]) {
- p = oldTab[i];
- oldTab[i] = oldTab[i]->next;
- h = hash(p->key);
- p->next = tab[h];
- tab[h] = p;
- }
- }
- gfree(oldTab);
-}
-
-GHashBucket *GHash::find(GString *key, int *h) {
- GHashBucket *p;
-
- *h = hash(key);
- for (p = tab[*h]; p; p = p->next) {
- if (!p->key->cmp(key)) {
- return p;
- }
- }
- return NULL;
-}
-
-GHashBucket *GHash::find(char *key, int *h) {
- GHashBucket *p;
-
- *h = hash(key);
- for (p = tab[*h]; p; p = p->next) {
- if (!p->key->cmp(key)) {
- return p;
- }
- }
- return NULL;
-}
-
-int GHash::hash(GString *key) {
- char *p;
- unsigned int h;
- int i;
-
- h = 0;
- for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
- h = 17 * h + (int)(*p & 0xff);
- }
- return (int)(h % size);
-}
-
-int GHash::hash(char *key) {
- char *p;
- unsigned int h;
-
- h = 0;
- for (p = key; *p; ++p) {
- h = 17 * h + (int)(*p & 0xff);
- }
- return (int)(h % size);
-}
diff --git a/kpdf/xpdf/goo/GHash.cpp b/kpdf/xpdf/goo/GHash.cpp
new file mode 100644
index 00000000..f642a261
--- /dev/null
+++ b/kpdf/xpdf/goo/GHash.cpp
@@ -0,0 +1,380 @@
+//========================================================================
+//
+// GHash.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "gmem.h"
+#include "GString.h"
+#include "GHash.h"
+
+//------------------------------------------------------------------------
+
+struct GHashBucket {
+ GString *key;
+ union {
+ void *p;
+ int i;
+ } val;
+ GHashBucket *next;
+};
+
+struct GHashIter {
+ int h;
+ GHashBucket *p;
+};
+
+//------------------------------------------------------------------------
+
+GHash::GHash(GBool deleteKeysA) {
+ int h;
+
+ deleteKeys = deleteKeysA;
+ size = 7;
+ tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
+ for (h = 0; h < size; ++h) {
+ tab[h] = NULL;
+ }
+ len = 0;
+}
+
+GHash::~GHash() {
+ GHashBucket *p;
+ int h;
+
+ for (h = 0; h < size; ++h) {
+ while (tab[h]) {
+ p = tab[h];
+ tab[h] = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ delete p;
+ }
+ }
+ gfree(tab);
+}
+
+void GHash::add(GString *key, void *val) {
+ GHashBucket *p;
+ int h;
+
+ // expand the table if necessary
+ if (len >= size) {
+ expand();
+ }
+
+ // add the new symbol
+ p = new GHashBucket;
+ p->key = key;
+ p->val.p = val;
+ h = hash(key);
+ p->next = tab[h];
+ tab[h] = p;
+ ++len;
+}
+
+void GHash::add(GString *key, int val) {
+ GHashBucket *p;
+ int h;
+
+ // expand the table if necessary
+ if (len >= size) {
+ expand();
+ }
+
+ // add the new symbol
+ p = new GHashBucket;
+ p->key = key;
+ p->val.i = val;
+ h = hash(key);
+ p->next = tab[h];
+ tab[h] = p;
+ ++len;
+}
+
+void GHash::replace(GString *key, void *val) {
+ GHashBucket *p;
+ int h;
+
+ if ((p = find(key, &h))) {
+ p->val.p = val;
+ delete key;
+ } else {
+ add(key, val);
+ }
+}
+
+void GHash::replace(GString *key, int val) {
+ GHashBucket *p;
+ int h;
+
+ if ((p = find(key, &h))) {
+ p->val.i = val;
+ delete key;
+ } else {
+ add(key, val);
+ }
+}
+
+void *GHash::lookup(GString *key) {
+ GHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ return p->val.p;
+}
+
+int GHash::lookupInt(GString *key) {
+ GHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ return p->val.i;
+}
+
+void *GHash::lookup(char *key) {
+ GHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ return p->val.p;
+}
+
+int GHash::lookupInt(char *key) {
+ GHashBucket *p;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ return p->val.i;
+}
+
+void *GHash::remove(GString *key) {
+ GHashBucket *p;
+ GHashBucket **q;
+ void *val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.p;
+ delete p;
+ --len;
+ return val;
+}
+
+int GHash::removeInt(GString *key) {
+ GHashBucket *p;
+ GHashBucket **q;
+ int val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.i;
+ delete p;
+ --len;
+ return val;
+}
+
+void *GHash::remove(char *key) {
+ GHashBucket *p;
+ GHashBucket **q;
+ void *val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return NULL;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.p;
+ delete p;
+ --len;
+ return val;
+}
+
+int GHash::removeInt(char *key) {
+ GHashBucket *p;
+ GHashBucket **q;
+ int val;
+ int h;
+
+ if (!(p = find(key, &h))) {
+ return 0;
+ }
+ q = &tab[h];
+ while (*q != p) {
+ q = &((*q)->next);
+ }
+ *q = p->next;
+ if (deleteKeys) {
+ delete p->key;
+ }
+ val = p->val.i;
+ delete p;
+ --len;
+ return val;
+}
+
+void GHash::startIter(GHashIter **iter) {
+ *iter = new GHashIter;
+ (*iter)->h = -1;
+ (*iter)->p = NULL;
+}
+
+GBool GHash::getNext(GHashIter **iter, GString **key, void **val) {
+ if (!*iter) {
+ return gFalse;
+ }
+ if ((*iter)->p) {
+ (*iter)->p = (*iter)->p->next;
+ }
+ while (!(*iter)->p) {
+ if (++(*iter)->h == size) {
+ delete *iter;
+ *iter = NULL;
+ return gFalse;
+ }
+ (*iter)->p = tab[(*iter)->h];
+ }
+ *key = (*iter)->p->key;
+ *val = (*iter)->p->val.p;
+ return gTrue;
+}
+
+GBool GHash::getNext(GHashIter **iter, GString **key, int *val) {
+ if (!*iter) {
+ return gFalse;
+ }
+ if ((*iter)->p) {
+ (*iter)->p = (*iter)->p->next;
+ }
+ while (!(*iter)->p) {
+ if (++(*iter)->h == size) {
+ delete *iter;
+ *iter = NULL;
+ return gFalse;
+ }
+ (*iter)->p = tab[(*iter)->h];
+ }
+ *key = (*iter)->p->key;
+ *val = (*iter)->p->val.i;
+ return gTrue;
+}
+
+void GHash::killIter(GHashIter **iter) {
+ delete *iter;
+ *iter = NULL;
+}
+
+void GHash::expand() {
+ GHashBucket **oldTab;
+ GHashBucket *p;
+ int oldSize, h, i;
+
+ oldSize = size;
+ oldTab = tab;
+ size = 2*size + 1;
+ tab = (GHashBucket **)gmallocn(size, sizeof(GHashBucket *));
+ for (h = 0; h < size; ++h) {
+ tab[h] = NULL;
+ }
+ for (i = 0; i < oldSize; ++i) {
+ while (oldTab[i]) {
+ p = oldTab[i];
+ oldTab[i] = oldTab[i]->next;
+ h = hash(p->key);
+ p->next = tab[h];
+ tab[h] = p;
+ }
+ }
+ gfree(oldTab);
+}
+
+GHashBucket *GHash::find(GString *key, int *h) {
+ GHashBucket *p;
+
+ *h = hash(key);
+ for (p = tab[*h]; p; p = p->next) {
+ if (!p->key->cmp(key)) {
+ return p;
+ }
+ }
+ return NULL;
+}
+
+GHashBucket *GHash::find(char *key, int *h) {
+ GHashBucket *p;
+
+ *h = hash(key);
+ for (p = tab[*h]; p; p = p->next) {
+ if (!p->key->cmp(key)) {
+ return p;
+ }
+ }
+ return NULL;
+}
+
+int GHash::hash(GString *key) {
+ char *p;
+ unsigned int h;
+ int i;
+
+ h = 0;
+ for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
+ h = 17 * h + (int)(*p & 0xff);
+ }
+ return (int)(h % size);
+}
+
+int GHash::hash(char *key) {
+ char *p;
+ unsigned int h;
+
+ h = 0;
+ for (p = key; *p; ++p) {
+ h = 17 * h + (int)(*p & 0xff);
+ }
+ return (int)(h % size);
+}
diff --git a/kpdf/xpdf/goo/GList.cc b/kpdf/xpdf/goo/GList.cc
deleted file mode 100644
index fb5fd628..00000000
--- a/kpdf/xpdf/goo/GList.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-//========================================================================
-//
-// GList.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "GList.h"
-
-//------------------------------------------------------------------------
-// GList
-//------------------------------------------------------------------------
-
-GList::GList() {
- size = 8;
- data = (void **)gmallocn(size, sizeof(void*));
- length = 0;
- inc = 0;
-}
-
-GList::GList(int sizeA) {
- size = sizeA;
- data = (void **)gmallocn(size, sizeof(void*));
- length = 0;
- inc = 0;
-}
-
-GList::~GList() {
- gfree(data);
-}
-
-void GList::append(void *p) {
- if (length >= size) {
- expand();
- }
- data[length++] = p;
-}
-
-void GList::append(GList *list) {
- int i;
-
- while (length + list->length > size) {
- expand();
- }
- for (i = 0; i < list->length; ++i) {
- data[length++] = list->data[i];
- }
-}
-
-void GList::insert(int i, void *p) {
- if (length >= size) {
- expand();
- }
- if (i < length) {
- memmove(data+i+1, data+i, (length - i) * sizeof(void *));
- }
- data[i] = p;
- ++length;
-}
-
-void *GList::del(int i) {
- void *p;
-
- p = data[i];
- if (i < length - 1) {
- memmove(data+i, data+i+1, (length - i - 1) * sizeof(void *));
- }
- --length;
- if (size - length >= ((inc > 0) ? inc : size/2)) {
- shrink();
- }
- return p;
-}
-
-void GList::sort(int (*cmp)(const void *obj1, const void *obj2)) {
- qsort(data, length, sizeof(void *), cmp);
-}
-
-void GList::expand() {
- size += (inc > 0) ? inc : size;
- data = (void **)greallocn(data, size, sizeof(void*));
-}
-
-void GList::shrink() {
- size -= (inc > 0) ? inc : size/2;
- data = (void **)greallocn(data, size, sizeof(void*));
-}
diff --git a/kpdf/xpdf/goo/GList.cpp b/kpdf/xpdf/goo/GList.cpp
new file mode 100644
index 00000000..2a4e4695
--- /dev/null
+++ b/kpdf/xpdf/goo/GList.cpp
@@ -0,0 +1,97 @@
+//========================================================================
+//
+// GList.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "GList.h"
+
+//------------------------------------------------------------------------
+// GList
+//------------------------------------------------------------------------
+
+GList::GList() {
+ size = 8;
+ data = (void **)gmallocn(size, sizeof(void*));
+ length = 0;
+ inc = 0;
+}
+
+GList::GList(int sizeA) {
+ size = sizeA;
+ data = (void **)gmallocn(size, sizeof(void*));
+ length = 0;
+ inc = 0;
+}
+
+GList::~GList() {
+ gfree(data);
+}
+
+void GList::append(void *p) {
+ if (length >= size) {
+ expand();
+ }
+ data[length++] = p;
+}
+
+void GList::append(GList *list) {
+ int i;
+
+ while (length + list->length > size) {
+ expand();
+ }
+ for (i = 0; i < list->length; ++i) {
+ data[length++] = list->data[i];
+ }
+}
+
+void GList::insert(int i, void *p) {
+ if (length >= size) {
+ expand();
+ }
+ if (i < length) {
+ memmove(data+i+1, data+i, (length - i) * sizeof(void *));
+ }
+ data[i] = p;
+ ++length;
+}
+
+void *GList::del(int i) {
+ void *p;
+
+ p = data[i];
+ if (i < length - 1) {
+ memmove(data+i, data+i+1, (length - i - 1) * sizeof(void *));
+ }
+ --length;
+ if (size - length >= ((inc > 0) ? inc : size/2)) {
+ shrink();
+ }
+ return p;
+}
+
+void GList::sort(int (*cmp)(const void *obj1, const void *obj2)) {
+ qsort(data, length, sizeof(void *), cmp);
+}
+
+void GList::expand() {
+ size += (inc > 0) ? inc : size;
+ data = (void **)greallocn(data, size, sizeof(void*));
+}
+
+void GList::shrink() {
+ size -= (inc > 0) ? inc : size/2;
+ data = (void **)greallocn(data, size, sizeof(void*));
+}
diff --git a/kpdf/xpdf/goo/GString.cc b/kpdf/xpdf/goo/GString.cc
deleted file mode 100644
index e21fd3ea..00000000
--- a/kpdf/xpdf/goo/GString.cc
+++ /dev/null
@@ -1,718 +0,0 @@
-//========================================================================
-//
-// GString.cc
-//
-// Simple variable-length string type.
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include "gmem.h"
-#include "GString.h"
-
-//------------------------------------------------------------------------
-
-union GStringFormatArg {
- int i;
- Guint ui;
- long l;
- Gulong ul;
- double f;
- char c;
- char *s;
- GString *gs;
-};
-
-enum GStringFormatType {
- fmtIntDecimal,
- fmtIntHex,
- fmtIntOctal,
- fmtIntBinary,
- fmtUIntDecimal,
- fmtUIntHex,
- fmtUIntOctal,
- fmtUIntBinary,
- fmtLongDecimal,
- fmtLongHex,
- fmtLongOctal,
- fmtLongBinary,
- fmtULongDecimal,
- fmtULongHex,
- fmtULongOctal,
- fmtULongBinary,
- fmtDouble,
- fmtDoubleTrim,
- fmtChar,
- fmtString,
- fmtGString,
- fmtSpace
-};
-
-static char *formatStrings[] = {
- "d", "x", "o", "b", "ud", "ux", "uo", "ub",
- "ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb",
- "f", "g",
- "c",
- "s",
- "t",
- "w",
- NULL
-};
-
-//------------------------------------------------------------------------
-
-static inline int size(int len) {
- int delta;
- for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
- // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
- return (len + delta) & ~(delta - 1);
-}
-
-inline void GString::resize(int length1) {
- char *s1;
-
- if (!s) {
- s = new char[size(length1)];
- } else if (size(length1) != size(length)) {
- s1 = new char[size(length1)];
- if (length1 < length) {
- memcpy(s1, s, length1);
- s1[length1] = '\0';
- } else {
- memcpy(s1, s, length + 1);
- }
- delete[] s;
- s = s1;
- }
-}
-
-GString::GString() {
- s = NULL;
- resize(length = 0);
- s[0] = '\0';
-}
-
-GString::GString(const char *sA) {
- int n = strlen(sA);
-
- s = NULL;
- resize(length = n);
- memcpy(s, sA, n + 1);
-}
-
-GString::GString(const char *sA, int lengthA) {
- s = NULL;
- resize(length = lengthA);
- memcpy(s, sA, length * sizeof(char));
- s[length] = '\0';
-}
-
-GString::GString(GString *str, int idx, int lengthA) {
- s = NULL;
- resize(length = lengthA);
- memcpy(s, str->getCString() + idx, length);
- s[length] = '\0';
-}
-
-GString::GString(GString *str) {
- s = NULL;
- resize(length = str->getLength());
- memcpy(s, str->getCString(), length + 1);
-}
-
-GString::GString(GString *str1, GString *str2) {
- int n1 = str1->getLength();
- int n2 = str2->getLength();
-
- s = NULL;
- resize(length = n1 + n2);
- memcpy(s, str1->getCString(), n1);
- memcpy(s + n1, str2->getCString(), n2 + 1);
-}
-
-GString *GString::fromInt(int x) {
- char buf[24]; // enough space for 64-bit ints plus a little extra
- char *p;
- int len;
-
- formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
- return new GString(p, len);
-}
-
-GString *GString::format(char *fmt, ...) {
- va_list argList;
- GString *s;
-
- s = new GString();
- va_start(argList, fmt);
- s->appendfv(fmt, argList);
- va_end(argList);
- return s;
-}
-
-GString *GString::formatv(char *fmt, va_list argList) {
- GString *s;
-
- s = new GString();
- s->appendfv(fmt, argList);
- return s;
-}
-
-GString::~GString() {
- delete[] s;
-}
-
-GString *GString::clear() {
- s[length = 0] = '\0';
- resize(0);
- return this;
-}
-
-GString *GString::append(char c) {
- resize(length + 1);
- s[length++] = c;
- s[length] = '\0';
- return this;
-}
-
-GString *GString::append(GString *str) {
- int n = str->getLength();
-
- resize(length + n);
- memcpy(s + length, str->getCString(), n + 1);
- length += n;
- return this;
-}
-
-GString *GString::append(const char *str) {
- int n = strlen(str);
-
- resize(length + n);
- memcpy(s + length, str, n + 1);
- length += n;
- return this;
-}
-
-GString *GString::append(const char *str, int lengthA) {
- resize(length + lengthA);
- memcpy(s + length, str, lengthA);
- length += lengthA;
- s[length] = '\0';
- return this;
-}
-
-GString *GString::appendf(char *fmt, ...) {
- va_list argList;
-
- va_start(argList, fmt);
- appendfv(fmt, argList);
- va_end(argList);
- return this;
-}
-
-GString *GString::appendfv(char *fmt, va_list argList) {
- GStringFormatArg *args;
- int argsLen, argsSize;
- GStringFormatArg arg;
- int idx, width, prec;
- GBool reverseAlign, zeroFill;
- GStringFormatType ft;
- char buf[65];
- int len, i;
- char *p0, *p1, *str;
-
- argsLen = 0;
- argsSize = 8;
- args = (GStringFormatArg *)gmallocn(argsSize, sizeof(GStringFormatArg));
-
- p0 = fmt;
- while (*p0) {
- if (*p0 == '{') {
- ++p0;
- if (*p0 == '{') {
- ++p0;
- append('{');
- } else {
-
- // parse the format string
- if (!(*p0 >= '0' && *p0 <= '9')) {
- break;
- }
- idx = *p0 - '0';
- for (++p0; *p0 >= '0' && *p0 <= '9'; ++p0) {
- idx = 10 * idx + (*p0 - '0');
- }
- if (*p0 != ':') {
- break;
- }
- ++p0;
- if (*p0 == '-') {
- reverseAlign = gTrue;
- ++p0;
- } else {
- reverseAlign = gFalse;
- }
- width = 0;
- zeroFill = *p0 == '0';
- for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
- width = 10 * width + (*p0 - '0');
- }
- if (*p0 == '.') {
- ++p0;
- prec = 0;
- for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
- prec = 10 * prec + (*p0 - '0');
- }
- } else {
- prec = 0;
- }
- for (ft = (GStringFormatType)0;
- formatStrings[ft];
- ft = (GStringFormatType)(ft + 1)) {
- if (!strncmp(p0, formatStrings[ft], strlen(formatStrings[ft]))) {
- break;
- }
- }
- if (!formatStrings[ft]) {
- break;
- }
- p0 += strlen(formatStrings[ft]);
- if (*p0 != '}') {
- break;
- }
- ++p0;
-
- // fetch the argument
- if (idx > argsLen) {
- break;
- }
- if (idx == argsLen) {
- if (argsLen == argsSize) {
- argsSize *= 2;
- args = (GStringFormatArg *)greallocn(args, argsSize,
- sizeof(GStringFormatArg));
- }
- switch (ft) {
- case fmtIntDecimal:
- case fmtIntHex:
- case fmtIntOctal:
- case fmtIntBinary:
- case fmtSpace:
- args[argsLen].i = va_arg(argList, int);
- break;
- case fmtUIntDecimal:
- case fmtUIntHex:
- case fmtUIntOctal:
- case fmtUIntBinary:
- args[argsLen].ui = va_arg(argList, Guint);
- break;
- case fmtLongDecimal:
- case fmtLongHex:
- case fmtLongOctal:
- case fmtLongBinary:
- args[argsLen].l = va_arg(argList, long);
- break;
- case fmtULongDecimal:
- case fmtULongHex:
- case fmtULongOctal:
- case fmtULongBinary:
- args[argsLen].ul = va_arg(argList, Gulong);
- break;
- case fmtDouble:
- case fmtDoubleTrim:
- args[argsLen].f = va_arg(argList, double);
- break;
- case fmtChar:
- args[argsLen].c = (char)va_arg(argList, int);
- break;
- case fmtString:
- args[argsLen].s = va_arg(argList, char *);
- break;
- case fmtGString:
- args[argsLen].gs = va_arg(argList, GString *);
- break;
- }
- ++argsLen;
- }
-
- // format the argument
- arg = args[idx];
- switch (ft) {
- case fmtIntDecimal:
- formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
- break;
- case fmtIntHex:
- formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
- break;
- case fmtIntOctal:
- formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
- break;
- case fmtIntBinary:
- formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
- break;
- case fmtUIntDecimal:
- formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 10,
- &str, &len);
- break;
- case fmtUIntHex:
- formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 16,
- &str, &len);
- break;
- case fmtUIntOctal:
- formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
- break;
- case fmtUIntBinary:
- formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
- break;
- case fmtLongDecimal:
- formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
- break;
- case fmtLongHex:
- formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
- break;
- case fmtLongOctal:
- formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
- break;
- case fmtLongBinary:
- formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
- break;
- case fmtULongDecimal:
- formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 10,
- &str, &len);
- break;
- case fmtULongHex:
- formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 16,
- &str, &len);
- break;
- case fmtULongOctal:
- formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
- break;
- case fmtULongBinary:
- formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
- break;
- case fmtDouble:
- formatDouble(arg.f, buf, sizeof(buf), prec, gFalse, &str, &len);
- break;
- case fmtDoubleTrim:
- formatDouble(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
- break;
- case fmtChar:
- buf[0] = arg.c;
- str = buf;
- len = 1;
- reverseAlign = !reverseAlign;
- break;
- case fmtString:
- str = arg.s;
- len = strlen(str);
- reverseAlign = !reverseAlign;
- break;
- case fmtGString:
- str = arg.gs->getCString();
- len = arg.gs->getLength();
- reverseAlign = !reverseAlign;
- break;
- case fmtSpace:
- str = buf;
- len = 0;
- width = arg.i;
- break;
- }
-
- // append the formatted arg, handling width and alignment
- if (!reverseAlign && len < width) {
- for (i = len; i < width; ++i) {
- append(' ');
- }
- }
- append(str, len);
- if (reverseAlign && len < width) {
- for (i = len; i < width; ++i) {
- append(' ');
- }
- }
- }
-
- } else if (*p0 == '}') {
- ++p0;
- if (*p0 == '}') {
- ++p0;
- }
- append('}');
-
- } else {
- for (p1 = p0 + 1; *p1 && *p1 != '{' && *p1 != '}'; ++p1) ;
- append(p0, p1 - p0);
- p0 = p1;
- }
- }
-
- gfree(args);
- return this;
-}
-
-void GString::formatInt(long x, char *buf, int bufSize,
- GBool zeroFill, int width, int base,
- char **p, int *len) {
- static char vals[17] = "0123456789abcdef";
- GBool neg;
- int start, i, j;
-
- i = bufSize;
- if ((neg = x < 0)) {
- x = -x;
- }
- start = neg ? 1 : 0;
- if (x == 0) {
- buf[--i] = '0';
- } else {
- while (i > start && x) {
- buf[--i] = vals[x % base];
- x /= base;
- }
- }
- if (zeroFill) {
- for (j = bufSize - i; i > start && j < width - start; ++j) {
- buf[--i] = '0';
- }
- }
- if (neg) {
- buf[--i] = '-';
- }
- *p = buf + i;
- *len = bufSize - i;
-}
-
-void GString::formatUInt(Gulong x, char *buf, int bufSize,
- GBool zeroFill, int width, int base,
- char **p, int *len) {
- static char vals[17] = "0123456789abcdef";
- int i, j;
-
- i = bufSize;
- if (x == 0) {
- buf[--i] = '0';
- } else {
- while (i > 0 && x) {
- buf[--i] = vals[x % base];
- x /= base;
- }
- }
- if (zeroFill) {
- for (j = bufSize - i; i > 0 && j < width; ++j) {
- buf[--i] = '0';
- }
- }
- *p = buf + i;
- *len = bufSize - i;
-}
-
-void GString::formatDouble(double x, char *buf, int bufSize, int prec,
- GBool trim, char **p, int *len) {
- GBool neg, started;
- double x2;
- int d, i, j;
-
- if ((neg = x < 0)) {
- x = -x;
- }
- x = floor(x * pow(10, prec) + 0.5);
- i = bufSize;
- started = !trim;
- for (j = 0; j < prec && i > 1; ++j) {
- x2 = floor(0.1 * (x + 0.5));
- d = (int)floor(x - 10 * x2 + 0.5);
- if (started || d != 0) {
- buf[--i] = '0' + d;
- started = gTrue;
- }
- x = x2;
- }
- if (i > 1 && started) {
- buf[--i] = '.';
- }
- if (i > 1) {
- do {
- x2 = floor(0.1 * (x + 0.5));
- d = (int)floor(x - 10 * x2 + 0.5);
- buf[--i] = '0' + d;
- x = x2;
- } while (i > 1 && x);
- }
- if (neg) {
- buf[--i] = '-';
- }
- *p = buf + i;
- *len = bufSize - i;
-}
-
-GString *GString::insert(int i, char c) {
- int j;
-
- resize(length + 1);
- for (j = length + 1; j > i; --j)
- s[j] = s[j-1];
- s[i] = c;
- ++length;
- return this;
-}
-
-GString *GString::insert(int i, GString *str) {
- int n = str->getLength();
- int j;
-
- resize(length + n);
- for (j = length; j >= i; --j)
- s[j+n] = s[j];
- memcpy(s+i, str->getCString(), n);
- length += n;
- return this;
-}
-
-GString *GString::insert(int i, const char *str) {
- int n = strlen(str);
- int j;
-
- resize(length + n);
- for (j = length; j >= i; --j)
- s[j+n] = s[j];
- memcpy(s+i, str, n);
- length += n;
- return this;
-}
-
-GString *GString::insert(int i, const char *str, int lengthA) {
- int j;
-
- resize(length + lengthA);
- for (j = length; j >= i; --j)
- s[j+lengthA] = s[j];
- memcpy(s+i, str, lengthA);
- length += lengthA;
- return this;
-}
-
-GString *GString::del(int i, int n) {
- int j;
-
- if (n > 0) {
- if (i + n > length) {
- n = length - i;
- }
- for (j = i; j <= length - n; ++j) {
- s[j] = s[j + n];
- }
- resize(length -= n);
- }
- return this;
-}
-
-GString *GString::upperCase() {
- int i;
-
- for (i = 0; i < length; ++i) {
- if (islower(s[i]))
- s[i] = toupper(s[i]);
- }
- return this;
-}
-
-GString *GString::lowerCase() {
- int i;
-
- for (i = 0; i < length; ++i) {
- if (isupper(s[i]))
- s[i] = tolower(s[i]);
- }
- return this;
-}
-
-int GString::cmp(GString *str) {
- int n1, n2, i, x;
- char *p1, *p2;
-
- n1 = length;
- n2 = str->length;
- for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
- x = *p1 - *p2;
- if (x != 0) {
- return x;
- }
- }
- return n1 - n2;
-}
-
-int GString::cmpN(GString *str, int n) {
- int n1, n2, i, x;
- char *p1, *p2;
-
- n1 = length;
- n2 = str->length;
- for (i = 0, p1 = s, p2 = str->s;
- i < n1 && i < n2 && i < n;
- ++i, ++p1, ++p2) {
- x = *p1 - *p2;
- if (x != 0) {
- return x;
- }
- }
- if (i == n) {
- return 0;
- }
- return n1 - n2;
-}
-
-int GString::cmp(const char *sA) {
- int n1, i, x;
- const char *p1, *p2;
-
- n1 = length;
- for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
- x = *p1 - *p2;
- if (x != 0) {
- return x;
- }
- }
- if (i < n1) {
- return 1;
- }
- if (*p2) {
- return -1;
- }
- return 0;
-}
-
-int GString::cmpN(const char *sA, int n) {
- int n1, i, x;
- const char *p1, *p2;
-
- n1 = length;
- for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) {
- x = *p1 - *p2;
- if (x != 0) {
- return x;
- }
- }
- if (i == n) {
- return 0;
- }
- if (i < n1) {
- return 1;
- }
- if (*p2) {
- return -1;
- }
- return 0;
-}
diff --git a/kpdf/xpdf/goo/GString.cpp b/kpdf/xpdf/goo/GString.cpp
new file mode 100644
index 00000000..89f122e1
--- /dev/null
+++ b/kpdf/xpdf/goo/GString.cpp
@@ -0,0 +1,718 @@
+//========================================================================
+//
+// GString.cpp
+//
+// Simple variable-length string type.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+#include "gmem.h"
+#include "GString.h"
+
+//------------------------------------------------------------------------
+
+union GStringFormatArg {
+ int i;
+ Guint ui;
+ long l;
+ Gulong ul;
+ double f;
+ char c;
+ char *s;
+ GString *gs;
+};
+
+enum GStringFormatType {
+ fmtIntDecimal,
+ fmtIntHex,
+ fmtIntOctal,
+ fmtIntBinary,
+ fmtUIntDecimal,
+ fmtUIntHex,
+ fmtUIntOctal,
+ fmtUIntBinary,
+ fmtLongDecimal,
+ fmtLongHex,
+ fmtLongOctal,
+ fmtLongBinary,
+ fmtULongDecimal,
+ fmtULongHex,
+ fmtULongOctal,
+ fmtULongBinary,
+ fmtDouble,
+ fmtDoubleTrim,
+ fmtChar,
+ fmtString,
+ fmtGString,
+ fmtSpace
+};
+
+static char *formatStrings[] = {
+ "d", "x", "o", "b", "ud", "ux", "uo", "ub",
+ "ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb",
+ "f", "g",
+ "c",
+ "s",
+ "t",
+ "w",
+ NULL
+};
+
+//------------------------------------------------------------------------
+
+static inline int size(int len) {
+ int delta;
+ for (delta = 8; delta < len && delta < 0x100000; delta <<= 1) ;
+ // this is ((len + 1) + (delta - 1)) & ~(delta - 1)
+ return (len + delta) & ~(delta - 1);
+}
+
+inline void GString::resize(int length1) {
+ char *s1;
+
+ if (!s) {
+ s = new char[size(length1)];
+ } else if (size(length1) != size(length)) {
+ s1 = new char[size(length1)];
+ if (length1 < length) {
+ memcpy(s1, s, length1);
+ s1[length1] = '\0';
+ } else {
+ memcpy(s1, s, length + 1);
+ }
+ delete[] s;
+ s = s1;
+ }
+}
+
+GString::GString() {
+ s = NULL;
+ resize(length = 0);
+ s[0] = '\0';
+}
+
+GString::GString(const char *sA) {
+ int n = strlen(sA);
+
+ s = NULL;
+ resize(length = n);
+ memcpy(s, sA, n + 1);
+}
+
+GString::GString(const char *sA, int lengthA) {
+ s = NULL;
+ resize(length = lengthA);
+ memcpy(s, sA, length * sizeof(char));
+ s[length] = '\0';
+}
+
+GString::GString(GString *str, int idx, int lengthA) {
+ s = NULL;
+ resize(length = lengthA);
+ memcpy(s, str->getCString() + idx, length);
+ s[length] = '\0';
+}
+
+GString::GString(GString *str) {
+ s = NULL;
+ resize(length = str->getLength());
+ memcpy(s, str->getCString(), length + 1);
+}
+
+GString::GString(GString *str1, GString *str2) {
+ int n1 = str1->getLength();
+ int n2 = str2->getLength();
+
+ s = NULL;
+ resize(length = n1 + n2);
+ memcpy(s, str1->getCString(), n1);
+ memcpy(s + n1, str2->getCString(), n2 + 1);
+}
+
+GString *GString::fromInt(int x) {
+ char buf[24]; // enough space for 64-bit ints plus a little extra
+ char *p;
+ int len;
+
+ formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
+ return new GString(p, len);
+}
+
+GString *GString::format(char *fmt, ...) {
+ va_list argList;
+ GString *s;
+
+ s = new GString();
+ va_start(argList, fmt);
+ s->appendfv(fmt, argList);
+ va_end(argList);
+ return s;
+}
+
+GString *GString::formatv(char *fmt, va_list argList) {
+ GString *s;
+
+ s = new GString();
+ s->appendfv(fmt, argList);
+ return s;
+}
+
+GString::~GString() {
+ delete[] s;
+}
+
+GString *GString::clear() {
+ s[length = 0] = '\0';
+ resize(0);
+ return this;
+}
+
+GString *GString::append(char c) {
+ resize(length + 1);
+ s[length++] = c;
+ s[length] = '\0';
+ return this;
+}
+
+GString *GString::append(GString *str) {
+ int n = str->getLength();
+
+ resize(length + n);
+ memcpy(s + length, str->getCString(), n + 1);
+ length += n;
+ return this;
+}
+
+GString *GString::append(const char *str) {
+ int n = strlen(str);
+
+ resize(length + n);
+ memcpy(s + length, str, n + 1);
+ length += n;
+ return this;
+}
+
+GString *GString::append(const char *str, int lengthA) {
+ resize(length + lengthA);
+ memcpy(s + length, str, lengthA);
+ length += lengthA;
+ s[length] = '\0';
+ return this;
+}
+
+GString *GString::appendf(char *fmt, ...) {
+ va_list argList;
+
+ va_start(argList, fmt);
+ appendfv(fmt, argList);
+ va_end(argList);
+ return this;
+}
+
+GString *GString::appendfv(char *fmt, va_list argList) {
+ GStringFormatArg *args;
+ int argsLen, argsSize;
+ GStringFormatArg arg;
+ int idx, width, prec;
+ GBool reverseAlign, zeroFill;
+ GStringFormatType ft;
+ char buf[65];
+ int len, i;
+ char *p0, *p1, *str;
+
+ argsLen = 0;
+ argsSize = 8;
+ args = (GStringFormatArg *)gmallocn(argsSize, sizeof(GStringFormatArg));
+
+ p0 = fmt;
+ while (*p0) {
+ if (*p0 == '{') {
+ ++p0;
+ if (*p0 == '{') {
+ ++p0;
+ append('{');
+ } else {
+
+ // parse the format string
+ if (!(*p0 >= '0' && *p0 <= '9')) {
+ break;
+ }
+ idx = *p0 - '0';
+ for (++p0; *p0 >= '0' && *p0 <= '9'; ++p0) {
+ idx = 10 * idx + (*p0 - '0');
+ }
+ if (*p0 != ':') {
+ break;
+ }
+ ++p0;
+ if (*p0 == '-') {
+ reverseAlign = gTrue;
+ ++p0;
+ } else {
+ reverseAlign = gFalse;
+ }
+ width = 0;
+ zeroFill = *p0 == '0';
+ for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
+ width = 10 * width + (*p0 - '0');
+ }
+ if (*p0 == '.') {
+ ++p0;
+ prec = 0;
+ for (; *p0 >= '0' && *p0 <= '9'; ++p0) {
+ prec = 10 * prec + (*p0 - '0');
+ }
+ } else {
+ prec = 0;
+ }
+ for (ft = (GStringFormatType)0;
+ formatStrings[ft];
+ ft = (GStringFormatType)(ft + 1)) {
+ if (!strncmp(p0, formatStrings[ft], strlen(formatStrings[ft]))) {
+ break;
+ }
+ }
+ if (!formatStrings[ft]) {
+ break;
+ }
+ p0 += strlen(formatStrings[ft]);
+ if (*p0 != '}') {
+ break;
+ }
+ ++p0;
+
+ // fetch the argument
+ if (idx > argsLen) {
+ break;
+ }
+ if (idx == argsLen) {
+ if (argsLen == argsSize) {
+ argsSize *= 2;
+ args = (GStringFormatArg *)greallocn(args, argsSize,
+ sizeof(GStringFormatArg));
+ }
+ switch (ft) {
+ case fmtIntDecimal:
+ case fmtIntHex:
+ case fmtIntOctal:
+ case fmtIntBinary:
+ case fmtSpace:
+ args[argsLen].i = va_arg(argList, int);
+ break;
+ case fmtUIntDecimal:
+ case fmtUIntHex:
+ case fmtUIntOctal:
+ case fmtUIntBinary:
+ args[argsLen].ui = va_arg(argList, Guint);
+ break;
+ case fmtLongDecimal:
+ case fmtLongHex:
+ case fmtLongOctal:
+ case fmtLongBinary:
+ args[argsLen].l = va_arg(argList, long);
+ break;
+ case fmtULongDecimal:
+ case fmtULongHex:
+ case fmtULongOctal:
+ case fmtULongBinary:
+ args[argsLen].ul = va_arg(argList, Gulong);
+ break;
+ case fmtDouble:
+ case fmtDoubleTrim:
+ args[argsLen].f = va_arg(argList, double);
+ break;
+ case fmtChar:
+ args[argsLen].c = (char)va_arg(argList, int);
+ break;
+ case fmtString:
+ args[argsLen].s = va_arg(argList, char *);
+ break;
+ case fmtGString:
+ args[argsLen].gs = va_arg(argList, GString *);
+ break;
+ }
+ ++argsLen;
+ }
+
+ // format the argument
+ arg = args[idx];
+ switch (ft) {
+ case fmtIntDecimal:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
+ break;
+ case fmtIntHex:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
+ break;
+ case fmtIntOctal:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtIntBinary:
+ formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtUIntDecimal:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 10,
+ &str, &len);
+ break;
+ case fmtUIntHex:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 16,
+ &str, &len);
+ break;
+ case fmtUIntOctal:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtUIntBinary:
+ formatUInt(arg.ui, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtLongDecimal:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 10, &str, &len);
+ break;
+ case fmtLongHex:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 16, &str, &len);
+ break;
+ case fmtLongOctal:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtLongBinary:
+ formatInt(arg.l, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtULongDecimal:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 10,
+ &str, &len);
+ break;
+ case fmtULongHex:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 16,
+ &str, &len);
+ break;
+ case fmtULongOctal:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 8, &str, &len);
+ break;
+ case fmtULongBinary:
+ formatUInt(arg.ul, buf, sizeof(buf), zeroFill, width, 2, &str, &len);
+ break;
+ case fmtDouble:
+ formatDouble(arg.f, buf, sizeof(buf), prec, gFalse, &str, &len);
+ break;
+ case fmtDoubleTrim:
+ formatDouble(arg.f, buf, sizeof(buf), prec, gTrue, &str, &len);
+ break;
+ case fmtChar:
+ buf[0] = arg.c;
+ str = buf;
+ len = 1;
+ reverseAlign = !reverseAlign;
+ break;
+ case fmtString:
+ str = arg.s;
+ len = strlen(str);
+ reverseAlign = !reverseAlign;
+ break;
+ case fmtGString:
+ str = arg.gs->getCString();
+ len = arg.gs->getLength();
+ reverseAlign = !reverseAlign;
+ break;
+ case fmtSpace:
+ str = buf;
+ len = 0;
+ width = arg.i;
+ break;
+ }
+
+ // append the formatted arg, handling width and alignment
+ if (!reverseAlign && len < width) {
+ for (i = len; i < width; ++i) {
+ append(' ');
+ }
+ }
+ append(str, len);
+ if (reverseAlign && len < width) {
+ for (i = len; i < width; ++i) {
+ append(' ');
+ }
+ }
+ }
+
+ } else if (*p0 == '}') {
+ ++p0;
+ if (*p0 == '}') {
+ ++p0;
+ }
+ append('}');
+
+ } else {
+ for (p1 = p0 + 1; *p1 && *p1 != '{' && *p1 != '}'; ++p1) ;
+ append(p0, p1 - p0);
+ p0 = p1;
+ }
+ }
+
+ gfree(args);
+ return this;
+}
+
+void GString::formatInt(long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len) {
+ static char vals[17] = "0123456789abcdef";
+ GBool neg;
+ int start, i, j;
+
+ i = bufSize;
+ if ((neg = x < 0)) {
+ x = -x;
+ }
+ start = neg ? 1 : 0;
+ if (x == 0) {
+ buf[--i] = '0';
+ } else {
+ while (i > start && x) {
+ buf[--i] = vals[x % base];
+ x /= base;
+ }
+ }
+ if (zeroFill) {
+ for (j = bufSize - i; i > start && j < width - start; ++j) {
+ buf[--i] = '0';
+ }
+ }
+ if (neg) {
+ buf[--i] = '-';
+ }
+ *p = buf + i;
+ *len = bufSize - i;
+}
+
+void GString::formatUInt(Gulong x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+ char **p, int *len) {
+ static char vals[17] = "0123456789abcdef";
+ int i, j;
+
+ i = bufSize;
+ if (x == 0) {
+ buf[--i] = '0';
+ } else {
+ while (i > 0 && x) {
+ buf[--i] = vals[x % base];
+ x /= base;
+ }
+ }
+ if (zeroFill) {
+ for (j = bufSize - i; i > 0 && j < width; ++j) {
+ buf[--i] = '0';
+ }
+ }
+ *p = buf + i;
+ *len = bufSize - i;
+}
+
+void GString::formatDouble(double x, char *buf, int bufSize, int prec,
+ GBool trim, char **p, int *len) {
+ GBool neg, started;
+ double x2;
+ int d, i, j;
+
+ if ((neg = x < 0)) {
+ x = -x;
+ }
+ x = floor(x * pow(10, prec) + 0.5);
+ i = bufSize;
+ started = !trim;
+ for (j = 0; j < prec && i > 1; ++j) {
+ x2 = floor(0.1 * (x + 0.5));
+ d = (int)floor(x - 10 * x2 + 0.5);
+ if (started || d != 0) {
+ buf[--i] = '0' + d;
+ started = gTrue;
+ }
+ x = x2;
+ }
+ if (i > 1 && started) {
+ buf[--i] = '.';
+ }
+ if (i > 1) {
+ do {
+ x2 = floor(0.1 * (x + 0.5));
+ d = (int)floor(x - 10 * x2 + 0.5);
+ buf[--i] = '0' + d;
+ x = x2;
+ } while (i > 1 && x);
+ }
+ if (neg) {
+ buf[--i] = '-';
+ }
+ *p = buf + i;
+ *len = bufSize - i;
+}
+
+GString *GString::insert(int i, char c) {
+ int j;
+
+ resize(length + 1);
+ for (j = length + 1; j > i; --j)
+ s[j] = s[j-1];
+ s[i] = c;
+ ++length;
+ return this;
+}
+
+GString *GString::insert(int i, GString *str) {
+ int n = str->getLength();
+ int j;
+
+ resize(length + n);
+ for (j = length; j >= i; --j)
+ s[j+n] = s[j];
+ memcpy(s+i, str->getCString(), n);
+ length += n;
+ return this;
+}
+
+GString *GString::insert(int i, const char *str) {
+ int n = strlen(str);
+ int j;
+
+ resize(length + n);
+ for (j = length; j >= i; --j)
+ s[j+n] = s[j];
+ memcpy(s+i, str, n);
+ length += n;
+ return this;
+}
+
+GString *GString::insert(int i, const char *str, int lengthA) {
+ int j;
+
+ resize(length + lengthA);
+ for (j = length; j >= i; --j)
+ s[j+lengthA] = s[j];
+ memcpy(s+i, str, lengthA);
+ length += lengthA;
+ return this;
+}
+
+GString *GString::del(int i, int n) {
+ int j;
+
+ if (n > 0) {
+ if (i + n > length) {
+ n = length - i;
+ }
+ for (j = i; j <= length - n; ++j) {
+ s[j] = s[j + n];
+ }
+ resize(length -= n);
+ }
+ return this;
+}
+
+GString *GString::upperCase() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (islower(s[i]))
+ s[i] = toupper(s[i]);
+ }
+ return this;
+}
+
+GString *GString::lowerCase() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (isupper(s[i]))
+ s[i] = tolower(s[i]);
+ }
+ return this;
+}
+
+int GString::cmp(GString *str) {
+ int n1, n2, i, x;
+ char *p1, *p2;
+
+ n1 = length;
+ n2 = str->length;
+ for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ return n1 - n2;
+}
+
+int GString::cmpN(GString *str, int n) {
+ int n1, n2, i, x;
+ char *p1, *p2;
+
+ n1 = length;
+ n2 = str->length;
+ for (i = 0, p1 = s, p2 = str->s;
+ i < n1 && i < n2 && i < n;
+ ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ if (i == n) {
+ return 0;
+ }
+ return n1 - n2;
+}
+
+int GString::cmp(const char *sA) {
+ int n1, i, x;
+ const char *p1, *p2;
+
+ n1 = length;
+ for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ if (i < n1) {
+ return 1;
+ }
+ if (*p2) {
+ return -1;
+ }
+ return 0;
+}
+
+int GString::cmpN(const char *sA, int n) {
+ int n1, i, x;
+ const char *p1, *p2;
+
+ n1 = length;
+ for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) {
+ x = *p1 - *p2;
+ if (x != 0) {
+ return x;
+ }
+ }
+ if (i == n) {
+ return 0;
+ }
+ if (i < n1) {
+ return 1;
+ }
+ if (*p2) {
+ return -1;
+ }
+ return 0;
+}
diff --git a/kpdf/xpdf/goo/Makefile.am b/kpdf/xpdf/goo/Makefile.am
index 04933cee..00ffad0d 100644
--- a/kpdf/xpdf/goo/Makefile.am
+++ b/kpdf/xpdf/goo/Makefile.am
@@ -1,5 +1,5 @@
INCLUDES = -I$(srcdir)/..
-libgoo_la_SOURCES = GHash.cc GList.cc GString.cc gfile.cc gmem.cc gmempp.cc
+libgoo_la_SOURCES = GHash.cpp GList.cpp GString.cpp gfile.cpp gmem.cpp gmempp.cpp
noinst_LTLIBRARIES = libgoo.la
diff --git a/kpdf/xpdf/goo/gfile.cc b/kpdf/xpdf/goo/gfile.cc
deleted file mode 100644
index 54a7be3d..00000000
--- a/kpdf/xpdf/goo/gfile.cc
+++ /dev/null
@@ -1,731 +0,0 @@
-//========================================================================
-//
-// gfile.cc
-//
-// Miscellaneous file and directory name manipulation.
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef WIN32
-# include <time.h>
-#else
-# if defined(MACOS)
-# include <sys/stat.h>
-# elif !defined(ACORN)
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <fcntl.h>
-# endif
-# include <limits.h>
-# include <string.h>
-# if !defined(VMS) && !defined(ACORN) && !defined(MACOS)
-# include <pwd.h>
-# endif
-# if defined(VMS) && (__DECCXX_VER < 50200000)
-# include <unixlib.h>
-# endif
-#endif // WIN32
-#include "GString.h"
-#include "gfile.h"
-
-// Some systems don't define this, so just make it something reasonably
-// large.
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
-
-//------------------------------------------------------------------------
-
-GString *getHomeDir() {
-#ifdef VMS
- //---------- VMS ----------
- return new GString("SYS$LOGIN:");
-
-#elif defined(__EMX__) || defined(WIN32)
- //---------- OS/2+EMX and Win32 ----------
- char *s;
- GString *ret;
-
- if ((s = getenv("HOME")))
- ret = new GString(s);
- else
- ret = new GString(".");
- return ret;
-
-#elif defined(ACORN)
- //---------- RISCOS ----------
- return new GString("@");
-
-#elif defined(MACOS)
- //---------- MacOS ----------
- return new GString(":");
-
-#else
- //---------- Unix ----------
- char *s;
- struct passwd *pw;
- GString *ret;
-
- if ((s = getenv("HOME"))) {
- ret = new GString(s);
- } else {
- if ((s = getenv("USER")))
- pw = getpwnam(s);
- else
- pw = getpwuid(getuid());
- if (pw)
- ret = new GString(pw->pw_dir);
- else
- ret = new GString(".");
- }
- return ret;
-#endif
-}
-
-GString *getCurrentDir() {
- char buf[PATH_MAX+1];
-
-#if defined(__EMX__)
- if (_getcwd2(buf, sizeof(buf)))
-#elif defined(WIN32)
- if (GetCurrentDirectory(sizeof(buf), buf))
-#elif defined(ACORN)
- if (strcpy(buf, "@"))
-#elif defined(MACOS)
- if (strcpy(buf, ":"))
-#else
- if (getcwd(buf, sizeof(buf)))
-#endif
- return new GString(buf);
- return new GString();
-}
-
-GString *appendToPath(GString *path, char *fileName) {
-#if defined(VMS)
- //---------- VMS ----------
- //~ this should handle everything necessary for file
- //~ requesters, but it's certainly not complete
- char *p0, *p1, *p2;
- char *q1;
-
- p0 = path->getCString();
- p1 = p0 + path->getLength() - 1;
- if (!strcmp(fileName, "-")) {
- if (*p1 == ']') {
- for (p2 = p1; p2 > p0 && *p2 != '.' && *p2 != '['; --p2) ;
- if (*p2 == '[')
- ++p2;
- path->del(p2 - p0, p1 - p2);
- } else if (*p1 == ':') {
- path->append("[-]");
- } else {
- path->clear();
- path->append("[-]");
- }
- } else if ((q1 = strrchr(fileName, '.')) && !strncmp(q1, ".DIR;", 5)) {
- if (*p1 == ']') {
- path->insert(p1 - p0, '.');
- path->insert(p1 - p0 + 1, fileName, q1 - fileName);
- } else if (*p1 == ':') {
- path->append('[');
- path->append(']');
- path->append(fileName, q1 - fileName);
- } else {
- path->clear();
- path->append(fileName, q1 - fileName);
- }
- } else {
- if (*p1 != ']' && *p1 != ':')
- path->clear();
- path->append(fileName);
- }
- return path;
-
-#elif defined(WIN32)
- //---------- Win32 ----------
- GString *tmp;
- char buf[256];
- char *fp;
-
- tmp = new GString(path);
- tmp->append('/');
- tmp->append(fileName);
- GetFullPathName(tmp->getCString(), sizeof(buf), buf, &fp);
- delete tmp;
- path->clear();
- path->append(buf);
- return path;
-
-#elif defined(ACORN)
- //---------- RISCOS ----------
- char *p;
- int i;
-
- path->append(".");
- i = path->getLength();
- path->append(fileName);
- for (p = path->getCString() + i; *p; ++p) {
- if (*p == '/') {
- *p = '.';
- } else if (*p == '.') {
- *p = '/';
- }
- }
- return path;
-
-#elif defined(MACOS)
- //---------- MacOS ----------
- char *p;
- int i;
-
- path->append(":");
- i = path->getLength();
- path->append(fileName);
- for (p = path->getCString() + i; *p; ++p) {
- if (*p == '/') {
- *p = ':';
- } else if (*p == '.') {
- *p = ':';
- }
- }
- return path;
-
-#elif defined(__EMX__)
- //---------- OS/2+EMX ----------
- int i;
-
- // appending "." does nothing
- if (!strcmp(fileName, "."))
- return path;
-
- // appending ".." goes up one directory
- if (!strcmp(fileName, "..")) {
- for (i = path->getLength() - 2; i >= 0; --i) {
- if (path->getChar(i) == '/' || path->getChar(i) == '\\' ||
- path->getChar(i) == ':')
- break;
- }
- if (i <= 0) {
- if (path->getChar(0) == '/' || path->getChar(0) == '\\') {
- path->del(1, path->getLength() - 1);
- } else if (path->getLength() >= 2 && path->getChar(1) == ':') {
- path->del(2, path->getLength() - 2);
- } else {
- path->clear();
- path->append("..");
- }
- } else {
- if (path->getChar(i-1) == ':')
- ++i;
- path->del(i, path->getLength() - i);
- }
- return path;
- }
-
- // otherwise, append "/" and new path component
- if (path->getLength() > 0 &&
- path->getChar(path->getLength() - 1) != '/' &&
- path->getChar(path->getLength() - 1) != '\\')
- path->append('/');
- path->append(fileName);
- return path;
-
-#else
- //---------- Unix ----------
- int i;
-
- // appending "." does nothing
- if (!strcmp(fileName, "."))
- return path;
-
- // appending ".." goes up one directory
- if (!strcmp(fileName, "..")) {
- for (i = path->getLength() - 2; i >= 0; --i) {
- if (path->getChar(i) == '/')
- break;
- }
- if (i <= 0) {
- if (path->getChar(0) == '/') {
- path->del(1, path->getLength() - 1);
- } else {
- path->clear();
- path->append("..");
- }
- } else {
- path->del(i, path->getLength() - i);
- }
- return path;
- }
-
- // otherwise, append "/" and new path component
- if (path->getLength() > 0 &&
- path->getChar(path->getLength() - 1) != '/')
- path->append('/');
- path->append(fileName);
- return path;
-#endif
-}
-
-GString *grabPath(char *fileName) {
-#ifdef VMS
- //---------- VMS ----------
- char *p;
-
- if ((p = strrchr(fileName, ']')))
- return new GString(fileName, p + 1 - fileName);
- if ((p = strrchr(fileName, ':')))
- return new GString(fileName, p + 1 - fileName);
- return new GString();
-
-#elif defined(__EMX__) || defined(WIN32)
- //---------- OS/2+EMX and Win32 ----------
- char *p;
-
- if ((p = strrchr(fileName, '/')))
- return new GString(fileName, p - fileName);
- if ((p = strrchr(fileName, '\\')))
- return new GString(fileName, p - fileName);
- if ((p = strrchr(fileName, ':')))
- return new GString(fileName, p + 1 - fileName);
- return new GString();
-
-#elif defined(ACORN)
- //---------- RISCOS ----------
- char *p;
-
- if ((p = strrchr(fileName, '.')))
- return new GString(fileName, p - fileName);
- return new GString();
-
-#elif defined(MACOS)
- //---------- MacOS ----------
- char *p;
-
- if ((p = strrchr(fileName, ':')))
- return new GString(fileName, p - fileName);
- return new GString();
-
-#else
- //---------- Unix ----------
- char *p;
-
- if ((p = strrchr(fileName, '/')))
- return new GString(fileName, p - fileName);
- return new GString();
-#endif
-}
-
-GBool isAbsolutePath(char *path) {
-#ifdef VMS
- //---------- VMS ----------
- return strchr(path, ':') ||
- (path[0] == '[' && path[1] != '.' && path[1] != '-');
-
-#elif defined(__EMX__) || defined(WIN32)
- //---------- OS/2+EMX and Win32 ----------
- return path[0] == '/' || path[0] == '\\' || path[1] == ':';
-
-#elif defined(ACORN)
- //---------- RISCOS ----------
- return path[0] == '$';
-
-#elif defined(MACOS)
- //---------- MacOS ----------
- return path[0] != ':';
-
-#else
- //---------- Unix ----------
- return path[0] == '/';
-#endif
-}
-
-GString *makePathAbsolute(GString *path) {
-#ifdef VMS
- //---------- VMS ----------
- char buf[PATH_MAX+1];
-
- if (!isAbsolutePath(path->getCString())) {
- if (getcwd(buf, sizeof(buf))) {
- path->insert(0, buf);
- }
- }
- return path;
-
-#elif defined(WIN32)
- //---------- Win32 ----------
- char buf[_MAX_PATH];
- char *fp;
-
- buf[0] = '\0';
- if (!GetFullPathName(path->getCString(), _MAX_PATH, buf, &fp)) {
- path->clear();
- return path;
- }
- path->clear();
- path->append(buf);
- return path;
-
-#elif defined(ACORN)
- //---------- RISCOS ----------
- path->insert(0, '@');
- return path;
-
-#elif defined(MACOS)
- //---------- MacOS ----------
- path->del(0, 1);
- return path;
-
-#else
- //---------- Unix and OS/2+EMX ----------
- struct passwd *pw;
- char buf[PATH_MAX+1];
- GString *s;
- char *p1, *p2;
- int n;
-
- if (path->getChar(0) == '~') {
- if (path->getChar(1) == '/' ||
-#ifdef __EMX__
- path->getChar(1) == '\\' ||
-#endif
- path->getLength() == 1) {
- path->del(0, 1);
- s = getHomeDir();
- path->insert(0, s);
- delete s;
- } else {
- p1 = path->getCString() + 1;
-#ifdef __EMX__
- for (p2 = p1; *p2 && *p2 != '/' && *p2 != '\\'; ++p2) ;
-#else
- for (p2 = p1; *p2 && *p2 != '/'; ++p2) ;
-#endif
- if ((n = p2 - p1) > PATH_MAX)
- n = PATH_MAX;
- strncpy(buf, p1, n);
- buf[n] = '\0';
- if ((pw = getpwnam(buf))) {
- path->del(0, p2 - p1 + 1);
- path->insert(0, pw->pw_dir);
- }
- }
- } else if (!isAbsolutePath(path->getCString())) {
- if (getcwd(buf, sizeof(buf))) {
-#ifndef __EMX__
- path->insert(0, '/');
-#endif
- path->insert(0, buf);
- }
- }
- return path;
-#endif
-}
-
-time_t getModTime(char *fileName) {
-#ifdef WIN32
- //~ should implement this, but it's (currently) only used in xpdf
- return 0;
-#else
- struct stat statBuf;
-
- if (stat(fileName, &statBuf)) {
- return 0;
- }
- return statBuf.st_mtime;
-#endif
-}
-
-GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
-#if defined(WIN32)
- //---------- Win32 ----------
- char *tempDir;
- GString *s, *s2;
- char buf[32];
- FILE *f2;
- int t, i;
-
- // this has the standard race condition problem, but I haven't found
- // a better way to generate temp file names with extensions on
- // Windows
- if ((tempDir = getenv("TEMP"))) {
- s = new GString(tempDir);
- s->append('\\');
- } else {
- s = new GString();
- }
- s->append("x");
- t = (int)time(NULL);
- for (i = 0; i < 1000; ++i) {
- sprintf(buf, "%d", t + i);
- s2 = s->copy()->append(buf);
- if (ext) {
- s2->append(ext);
- }
- if (!(f2 = fopen(s2->getCString(), "r"))) {
- if (!(f2 = fopen(s2->getCString(), mode))) {
- delete s2;
- delete s;
- return gFalse;
- }
- *name = s2;
- *f = f2;
- delete s;
- return gTrue;
- }
- fclose(f2);
- delete s2;
- }
- delete s;
- return gFalse;
-#elif defined(VMS) || defined(__EMX__) || defined(ACORN) || defined(MACOS)
- //---------- non-Unix ----------
- char *s;
-
- // There is a security hole here: an attacker can create a symlink
- // with this file name after the tmpnam call and before the fopen
- // call. I will happily accept fixes to this function for non-Unix
- // OSs.
- if (!(s = tmpnam(NULL))) {
- return gFalse;
- }
- *name = new GString(s);
- if (ext) {
- (*name)->append(ext);
- }
- if (!(*f = fopen((*name)->getCString(), mode))) {
- delete (*name);
- return gFalse;
- }
- return gTrue;
-#else
- //---------- Unix ----------
- char *s;
- int fd;
-
- if (ext) {
-#if HAVE_MKSTEMPS
- if ((s = getenv("TMPDIR"))) {
- *name = new GString(s);
- } else {
- *name = new GString("/tmp");
- }
- (*name)->append("/XXXXXX")->append(ext);
- fd = mkstemps((*name)->getCString(), strlen(ext));
-#else
- if (!(s = tmpnam(NULL))) {
- return gFalse;
- }
- *name = new GString(s);
- (*name)->append(ext);
- fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
-#endif
- } else {
-#if HAVE_MKSTEMP
- if ((s = getenv("TMPDIR"))) {
- *name = new GString(s);
- } else {
- *name = new GString("/tmp");
- }
- (*name)->append("/XXXXXX");
- fd = mkstemp((*name)->getCString());
-#else // HAVE_MKSTEMP
- if (!(s = tmpnam(NULL))) {
- return gFalse;
- }
- *name = new GString(s);
- fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
-#endif // HAVE_MKSTEMP
- }
- if (fd < 0 || !(*f = fdopen(fd, mode))) {
- delete *name;
- return gFalse;
- }
- return gTrue;
-#endif
-}
-
-GBool executeCommand(char *cmd) {
-#ifdef VMS
- return system(cmd) ? gTrue : gFalse;
-#else
- return system(cmd) ? gFalse : gTrue;
-#endif
-}
-
-char *getLine(char *buf, int size, FILE *f) {
- int c, i;
-
- i = 0;
- while (i < size - 1) {
- if ((c = fgetc(f)) == EOF) {
- break;
- }
- buf[i++] = (char)c;
- if (c == '\x0a') {
- break;
- }
- if (c == '\x0d') {
- c = fgetc(f);
- if (c == '\x0a' && i < size - 1) {
- buf[i++] = (char)c;
- } else if (c != EOF) {
- ungetc(c, f);
- }
- break;
- }
- }
- buf[i] = '\0';
- if (i == 0) {
- return NULL;
- }
- return buf;
-}
-
-//------------------------------------------------------------------------
-// GDir and GDirEntry
-//------------------------------------------------------------------------
-
-GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
-#ifdef VMS
- char *p;
-#elif defined(WIN32)
- int fa;
- GString *s;
-#elif defined(ACORN)
-#else
- struct stat st;
- GString *s;
-#endif
-
- name = new GString(nameA);
- dir = gFalse;
- if (doStat) {
-#ifdef VMS
- if (!strcmp(nameA, "-") ||
- ((p = strrchr(nameA, '.')) && !strncmp(p, ".DIR;", 5)))
- dir = gTrue;
-#elif defined(ACORN)
-#else
- s = new GString(dirPath);
- appendToPath(s, nameA);
-#ifdef WIN32
- fa = GetFileAttributes(s->getCString());
- dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
-#else
- if (stat(s->getCString(), &st) == 0)
- dir = S_ISDIR(st.st_mode);
-#endif
- delete s;
-#endif
- }
-}
-
-GDirEntry::~GDirEntry() {
- delete name;
-}
-
-GDir::GDir(char *name, GBool doStatA) {
- path = new GString(name);
- doStat = doStatA;
-#if defined(WIN32)
- GString *tmp;
-
- tmp = path->copy();
- tmp->append("/*.*");
- hnd = FindFirstFile(tmp->getCString(), &ffd);
- delete tmp;
-#elif defined(ACORN)
-#elif defined(MACOS)
-#else
- dir = opendir(name);
-#ifdef VMS
- needParent = strchr(name, '[') != NULL;
-#endif
-#endif
-}
-
-GDir::~GDir() {
- delete path;
-#if defined(WIN32)
- if (hnd) {
- FindClose(hnd);
- hnd = NULL;
- }
-#elif defined(ACORN)
-#elif defined(MACOS)
-#else
- if (dir)
- closedir(dir);
-#endif
-}
-
-GDirEntry *GDir::getNextEntry() {
- GDirEntry *e;
-
-#if defined(WIN32)
- if (hnd) {
- e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
- if (hnd && !FindNextFile(hnd, &ffd)) {
- FindClose(hnd);
- hnd = NULL;
- }
- } else {
- e = NULL;
- }
-#elif defined(ACORN)
-#elif defined(MACOS)
-#elif defined(VMS)
- struct dirent *ent;
- e = NULL;
- if (dir) {
- if (needParent) {
- e = new GDirEntry(path->getCString(), "-", doStat);
- needParent = gFalse;
- return e;
- }
- ent = readdir(dir);
- if (ent) {
- e = new GDirEntry(path->getCString(), ent->d_name, doStat);
- }
- }
-#else
- struct dirent *ent;
- e = NULL;
- if (dir) {
- ent = (struct dirent *)readdir(dir);
- if (ent && !strcmp(ent->d_name, ".")) {
- ent = (struct dirent *)readdir(dir);
- }
- if (ent) {
- e = new GDirEntry(path->getCString(), ent->d_name, doStat);
- }
- }
-#endif
-
- return e;
-}
-
-void GDir::rewind() {
-#ifdef WIN32
- GString *tmp;
-
- if (hnd)
- FindClose(hnd);
- tmp = path->copy();
- tmp->append("/*.*");
- hnd = FindFirstFile(tmp->getCString(), &ffd);
- delete tmp;
-#elif defined(ACORN)
-#elif defined(MACOS)
-#else
- if (dir)
- rewinddir(dir);
-#ifdef VMS
- needParent = strchr(path->getCString(), '[') != NULL;
-#endif
-#endif
-}
diff --git a/kpdf/xpdf/goo/gfile.cpp b/kpdf/xpdf/goo/gfile.cpp
new file mode 100644
index 00000000..bb75b855
--- /dev/null
+++ b/kpdf/xpdf/goo/gfile.cpp
@@ -0,0 +1,731 @@
+//========================================================================
+//
+// gfile.cpp
+//
+// Miscellaneous file and directory name manipulation.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef WIN32
+# include <time.h>
+#else
+# if defined(MACOS)
+# include <sys/stat.h>
+# elif !defined(ACORN)
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
+# endif
+# include <limits.h>
+# include <string.h>
+# if !defined(VMS) && !defined(ACORN) && !defined(MACOS)
+# include <pwd.h>
+# endif
+# if defined(VMS) && (__DECCXX_VER < 50200000)
+# include <unixlib.h>
+# endif
+#endif // WIN32
+#include "GString.h"
+#include "gfile.h"
+
+// Some systems don't define this, so just make it something reasonably
+// large.
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+//------------------------------------------------------------------------
+
+GString *getHomeDir() {
+#ifdef VMS
+ //---------- VMS ----------
+ return new GString("SYS$LOGIN:");
+
+#elif defined(__EMX__) || defined(WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ char *s;
+ GString *ret;
+
+ if ((s = getenv("HOME")))
+ ret = new GString(s);
+ else
+ ret = new GString(".");
+ return ret;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ return new GString("@");
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ return new GString(":");
+
+#else
+ //---------- Unix ----------
+ char *s;
+ struct passwd *pw;
+ GString *ret;
+
+ if ((s = getenv("HOME"))) {
+ ret = new GString(s);
+ } else {
+ if ((s = getenv("USER")))
+ pw = getpwnam(s);
+ else
+ pw = getpwuid(getuid());
+ if (pw)
+ ret = new GString(pw->pw_dir);
+ else
+ ret = new GString(".");
+ }
+ return ret;
+#endif
+}
+
+GString *getCurrentDir() {
+ char buf[PATH_MAX+1];
+
+#if defined(__EMX__)
+ if (_getcwd2(buf, sizeof(buf)))
+#elif defined(WIN32)
+ if (GetCurrentDirectory(sizeof(buf), buf))
+#elif defined(ACORN)
+ if (strcpy(buf, "@"))
+#elif defined(MACOS)
+ if (strcpy(buf, ":"))
+#else
+ if (getcwd(buf, sizeof(buf)))
+#endif
+ return new GString(buf);
+ return new GString();
+}
+
+GString *appendToPath(GString *path, char *fileName) {
+#if defined(VMS)
+ //---------- VMS ----------
+ //~ this should handle everything necessary for file
+ //~ requesters, but it's certainly not complete
+ char *p0, *p1, *p2;
+ char *q1;
+
+ p0 = path->getCString();
+ p1 = p0 + path->getLength() - 1;
+ if (!strcmp(fileName, "-")) {
+ if (*p1 == ']') {
+ for (p2 = p1; p2 > p0 && *p2 != '.' && *p2 != '['; --p2) ;
+ if (*p2 == '[')
+ ++p2;
+ path->del(p2 - p0, p1 - p2);
+ } else if (*p1 == ':') {
+ path->append("[-]");
+ } else {
+ path->clear();
+ path->append("[-]");
+ }
+ } else if ((q1 = strrchr(fileName, '.')) && !strncmp(q1, ".DIR;", 5)) {
+ if (*p1 == ']') {
+ path->insert(p1 - p0, '.');
+ path->insert(p1 - p0 + 1, fileName, q1 - fileName);
+ } else if (*p1 == ':') {
+ path->append('[');
+ path->append(']');
+ path->append(fileName, q1 - fileName);
+ } else {
+ path->clear();
+ path->append(fileName, q1 - fileName);
+ }
+ } else {
+ if (*p1 != ']' && *p1 != ':')
+ path->clear();
+ path->append(fileName);
+ }
+ return path;
+
+#elif defined(WIN32)
+ //---------- Win32 ----------
+ GString *tmp;
+ char buf[256];
+ char *fp;
+
+ tmp = new GString(path);
+ tmp->append('/');
+ tmp->append(fileName);
+ GetFullPathName(tmp->getCString(), sizeof(buf), buf, &fp);
+ delete tmp;
+ path->clear();
+ path->append(buf);
+ return path;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ char *p;
+ int i;
+
+ path->append(".");
+ i = path->getLength();
+ path->append(fileName);
+ for (p = path->getCString() + i; *p; ++p) {
+ if (*p == '/') {
+ *p = '.';
+ } else if (*p == '.') {
+ *p = '/';
+ }
+ }
+ return path;
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ char *p;
+ int i;
+
+ path->append(":");
+ i = path->getLength();
+ path->append(fileName);
+ for (p = path->getCString() + i; *p; ++p) {
+ if (*p == '/') {
+ *p = ':';
+ } else if (*p == '.') {
+ *p = ':';
+ }
+ }
+ return path;
+
+#elif defined(__EMX__)
+ //---------- OS/2+EMX ----------
+ int i;
+
+ // appending "." does nothing
+ if (!strcmp(fileName, "."))
+ return path;
+
+ // appending ".." goes up one directory
+ if (!strcmp(fileName, "..")) {
+ for (i = path->getLength() - 2; i >= 0; --i) {
+ if (path->getChar(i) == '/' || path->getChar(i) == '\\' ||
+ path->getChar(i) == ':')
+ break;
+ }
+ if (i <= 0) {
+ if (path->getChar(0) == '/' || path->getChar(0) == '\\') {
+ path->del(1, path->getLength() - 1);
+ } else if (path->getLength() >= 2 && path->getChar(1) == ':') {
+ path->del(2, path->getLength() - 2);
+ } else {
+ path->clear();
+ path->append("..");
+ }
+ } else {
+ if (path->getChar(i-1) == ':')
+ ++i;
+ path->del(i, path->getLength() - i);
+ }
+ return path;
+ }
+
+ // otherwise, append "/" and new path component
+ if (path->getLength() > 0 &&
+ path->getChar(path->getLength() - 1) != '/' &&
+ path->getChar(path->getLength() - 1) != '\\')
+ path->append('/');
+ path->append(fileName);
+ return path;
+
+#else
+ //---------- Unix ----------
+ int i;
+
+ // appending "." does nothing
+ if (!strcmp(fileName, "."))
+ return path;
+
+ // appending ".." goes up one directory
+ if (!strcmp(fileName, "..")) {
+ for (i = path->getLength() - 2; i >= 0; --i) {
+ if (path->getChar(i) == '/')
+ break;
+ }
+ if (i <= 0) {
+ if (path->getChar(0) == '/') {
+ path->del(1, path->getLength() - 1);
+ } else {
+ path->clear();
+ path->append("..");
+ }
+ } else {
+ path->del(i, path->getLength() - i);
+ }
+ return path;
+ }
+
+ // otherwise, append "/" and new path component
+ if (path->getLength() > 0 &&
+ path->getChar(path->getLength() - 1) != '/')
+ path->append('/');
+ path->append(fileName);
+ return path;
+#endif
+}
+
+GString *grabPath(char *fileName) {
+#ifdef VMS
+ //---------- VMS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, ']')))
+ return new GString(fileName, p + 1 - fileName);
+ if ((p = strrchr(fileName, ':')))
+ return new GString(fileName, p + 1 - fileName);
+ return new GString();
+
+#elif defined(__EMX__) || defined(WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '/')))
+ return new GString(fileName, p - fileName);
+ if ((p = strrchr(fileName, '\\')))
+ return new GString(fileName, p - fileName);
+ if ((p = strrchr(fileName, ':')))
+ return new GString(fileName, p + 1 - fileName);
+ return new GString();
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '.')))
+ return new GString(fileName, p - fileName);
+ return new GString();
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ char *p;
+
+ if ((p = strrchr(fileName, ':')))
+ return new GString(fileName, p - fileName);
+ return new GString();
+
+#else
+ //---------- Unix ----------
+ char *p;
+
+ if ((p = strrchr(fileName, '/')))
+ return new GString(fileName, p - fileName);
+ return new GString();
+#endif
+}
+
+GBool isAbsolutePath(char *path) {
+#ifdef VMS
+ //---------- VMS ----------
+ return strchr(path, ':') ||
+ (path[0] == '[' && path[1] != '.' && path[1] != '-');
+
+#elif defined(__EMX__) || defined(WIN32)
+ //---------- OS/2+EMX and Win32 ----------
+ return path[0] == '/' || path[0] == '\\' || path[1] == ':';
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ return path[0] == '$';
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ return path[0] != ':';
+
+#else
+ //---------- Unix ----------
+ return path[0] == '/';
+#endif
+}
+
+GString *makePathAbsolute(GString *path) {
+#ifdef VMS
+ //---------- VMS ----------
+ char buf[PATH_MAX+1];
+
+ if (!isAbsolutePath(path->getCString())) {
+ if (getcwd(buf, sizeof(buf))) {
+ path->insert(0, buf);
+ }
+ }
+ return path;
+
+#elif defined(WIN32)
+ //---------- Win32 ----------
+ char buf[_MAX_PATH];
+ char *fp;
+
+ buf[0] = '\0';
+ if (!GetFullPathName(path->getCString(), _MAX_PATH, buf, &fp)) {
+ path->clear();
+ return path;
+ }
+ path->clear();
+ path->append(buf);
+ return path;
+
+#elif defined(ACORN)
+ //---------- RISCOS ----------
+ path->insert(0, '@');
+ return path;
+
+#elif defined(MACOS)
+ //---------- MacOS ----------
+ path->del(0, 1);
+ return path;
+
+#else
+ //---------- Unix and OS/2+EMX ----------
+ struct passwd *pw;
+ char buf[PATH_MAX+1];
+ GString *s;
+ char *p1, *p2;
+ int n;
+
+ if (path->getChar(0) == '~') {
+ if (path->getChar(1) == '/' ||
+#ifdef __EMX__
+ path->getChar(1) == '\\' ||
+#endif
+ path->getLength() == 1) {
+ path->del(0, 1);
+ s = getHomeDir();
+ path->insert(0, s);
+ delete s;
+ } else {
+ p1 = path->getCString() + 1;
+#ifdef __EMX__
+ for (p2 = p1; *p2 && *p2 != '/' && *p2 != '\\'; ++p2) ;
+#else
+ for (p2 = p1; *p2 && *p2 != '/'; ++p2) ;
+#endif
+ if ((n = p2 - p1) > PATH_MAX)
+ n = PATH_MAX;
+ strncpy(buf, p1, n);
+ buf[n] = '\0';
+ if ((pw = getpwnam(buf))) {
+ path->del(0, p2 - p1 + 1);
+ path->insert(0, pw->pw_dir);
+ }
+ }
+ } else if (!isAbsolutePath(path->getCString())) {
+ if (getcwd(buf, sizeof(buf))) {
+#ifndef __EMX__
+ path->insert(0, '/');
+#endif
+ path->insert(0, buf);
+ }
+ }
+ return path;
+#endif
+}
+
+time_t getModTime(char *fileName) {
+#ifdef WIN32
+ //~ should implement this, but it's (currently) only used in xpdf
+ return 0;
+#else
+ struct stat statBuf;
+
+ if (stat(fileName, &statBuf)) {
+ return 0;
+ }
+ return statBuf.st_mtime;
+#endif
+}
+
+GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
+#if defined(WIN32)
+ //---------- Win32 ----------
+ char *tempDir;
+ GString *s, *s2;
+ char buf[32];
+ FILE *f2;
+ int t, i;
+
+ // this has the standard race condition problem, but I haven't found
+ // a better way to generate temp file names with extensions on
+ // Windows
+ if ((tempDir = getenv("TEMP"))) {
+ s = new GString(tempDir);
+ s->append('\\');
+ } else {
+ s = new GString();
+ }
+ s->append("x");
+ t = (int)time(NULL);
+ for (i = 0; i < 1000; ++i) {
+ sprintf(buf, "%d", t + i);
+ s2 = s->copy()->append(buf);
+ if (ext) {
+ s2->append(ext);
+ }
+ if (!(f2 = fopen(s2->getCString(), "r"))) {
+ if (!(f2 = fopen(s2->getCString(), mode))) {
+ delete s2;
+ delete s;
+ return gFalse;
+ }
+ *name = s2;
+ *f = f2;
+ delete s;
+ return gTrue;
+ }
+ fclose(f2);
+ delete s2;
+ }
+ delete s;
+ return gFalse;
+#elif defined(VMS) || defined(__EMX__) || defined(ACORN) || defined(MACOS)
+ //---------- non-Unix ----------
+ char *s;
+
+ // There is a security hole here: an attacker can create a symlink
+ // with this file name after the tmpnam call and before the fopen
+ // call. I will happily accept fixes to this function for non-Unix
+ // OSs.
+ if (!(s = tmpnam(NULL))) {
+ return gFalse;
+ }
+ *name = new GString(s);
+ if (ext) {
+ (*name)->append(ext);
+ }
+ if (!(*f = fopen((*name)->getCString(), mode))) {
+ delete (*name);
+ return gFalse;
+ }
+ return gTrue;
+#else
+ //---------- Unix ----------
+ char *s;
+ int fd;
+
+ if (ext) {
+#if HAVE_MKSTEMPS
+ if ((s = getenv("TMPDIR"))) {
+ *name = new GString(s);
+ } else {
+ *name = new GString("/tmp");
+ }
+ (*name)->append("/XXXXXX")->append(ext);
+ fd = mkstemps((*name)->getCString(), strlen(ext));
+#else
+ if (!(s = tmpnam(NULL))) {
+ return gFalse;
+ }
+ *name = new GString(s);
+ (*name)->append(ext);
+ fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
+#endif
+ } else {
+#if HAVE_MKSTEMP
+ if ((s = getenv("TMPDIR"))) {
+ *name = new GString(s);
+ } else {
+ *name = new GString("/tmp");
+ }
+ (*name)->append("/XXXXXX");
+ fd = mkstemp((*name)->getCString());
+#else // HAVE_MKSTEMP
+ if (!(s = tmpnam(NULL))) {
+ return gFalse;
+ }
+ *name = new GString(s);
+ fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
+#endif // HAVE_MKSTEMP
+ }
+ if (fd < 0 || !(*f = fdopen(fd, mode))) {
+ delete *name;
+ return gFalse;
+ }
+ return gTrue;
+#endif
+}
+
+GBool executeCommand(char *cmd) {
+#ifdef VMS
+ return system(cmd) ? gTrue : gFalse;
+#else
+ return system(cmd) ? gFalse : gTrue;
+#endif
+}
+
+char *getLine(char *buf, int size, FILE *f) {
+ int c, i;
+
+ i = 0;
+ while (i < size - 1) {
+ if ((c = fgetc(f)) == EOF) {
+ break;
+ }
+ buf[i++] = (char)c;
+ if (c == '\x0a') {
+ break;
+ }
+ if (c == '\x0d') {
+ c = fgetc(f);
+ if (c == '\x0a' && i < size - 1) {
+ buf[i++] = (char)c;
+ } else if (c != EOF) {
+ ungetc(c, f);
+ }
+ break;
+ }
+ }
+ buf[i] = '\0';
+ if (i == 0) {
+ return NULL;
+ }
+ return buf;
+}
+
+//------------------------------------------------------------------------
+// GDir and GDirEntry
+//------------------------------------------------------------------------
+
+GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
+#ifdef VMS
+ char *p;
+#elif defined(WIN32)
+ int fa;
+ GString *s;
+#elif defined(ACORN)
+#else
+ struct stat st;
+ GString *s;
+#endif
+
+ name = new GString(nameA);
+ dir = gFalse;
+ if (doStat) {
+#ifdef VMS
+ if (!strcmp(nameA, "-") ||
+ ((p = strrchr(nameA, '.')) && !strncmp(p, ".DIR;", 5)))
+ dir = gTrue;
+#elif defined(ACORN)
+#else
+ s = new GString(dirPath);
+ appendToPath(s, nameA);
+#ifdef WIN32
+ fa = GetFileAttributes(s->getCString());
+ dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
+#else
+ if (stat(s->getCString(), &st) == 0)
+ dir = S_ISDIR(st.st_mode);
+#endif
+ delete s;
+#endif
+ }
+}
+
+GDirEntry::~GDirEntry() {
+ delete name;
+}
+
+GDir::GDir(char *name, GBool doStatA) {
+ path = new GString(name);
+ doStat = doStatA;
+#if defined(WIN32)
+ GString *tmp;
+
+ tmp = path->copy();
+ tmp->append("/*.*");
+ hnd = FindFirstFile(tmp->getCString(), &ffd);
+ delete tmp;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ dir = opendir(name);
+#ifdef VMS
+ needParent = strchr(name, '[') != NULL;
+#endif
+#endif
+}
+
+GDir::~GDir() {
+ delete path;
+#if defined(WIN32)
+ if (hnd) {
+ FindClose(hnd);
+ hnd = NULL;
+ }
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir)
+ closedir(dir);
+#endif
+}
+
+GDirEntry *GDir::getNextEntry() {
+ GDirEntry *e;
+
+#if defined(WIN32)
+ if (hnd) {
+ e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
+ if (hnd && !FindNextFile(hnd, &ffd)) {
+ FindClose(hnd);
+ hnd = NULL;
+ }
+ } else {
+ e = NULL;
+ }
+#elif defined(ACORN)
+#elif defined(MACOS)
+#elif defined(VMS)
+ struct dirent *ent;
+ e = NULL;
+ if (dir) {
+ if (needParent) {
+ e = new GDirEntry(path->getCString(), "-", doStat);
+ needParent = gFalse;
+ return e;
+ }
+ ent = readdir(dir);
+ if (ent) {
+ e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ }
+ }
+#else
+ struct dirent *ent;
+ e = NULL;
+ if (dir) {
+ ent = (struct dirent *)readdir(dir);
+ if (ent && !strcmp(ent->d_name, ".")) {
+ ent = (struct dirent *)readdir(dir);
+ }
+ if (ent) {
+ e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ }
+ }
+#endif
+
+ return e;
+}
+
+void GDir::rewind() {
+#ifdef WIN32
+ GString *tmp;
+
+ if (hnd)
+ FindClose(hnd);
+ tmp = path->copy();
+ tmp->append("/*.*");
+ hnd = FindFirstFile(tmp->getCString(), &ffd);
+ delete tmp;
+#elif defined(ACORN)
+#elif defined(MACOS)
+#else
+ if (dir)
+ rewinddir(dir);
+#ifdef VMS
+ needParent = strchr(path->getCString(), '[') != NULL;
+#endif
+#endif
+}
diff --git a/kpdf/xpdf/goo/gmem.cc b/kpdf/xpdf/goo/gmem.cpp
index d8962aba..d8962aba 100644
--- a/kpdf/xpdf/goo/gmem.cc
+++ b/kpdf/xpdf/goo/gmem.cpp
diff --git a/kpdf/xpdf/goo/gmempp.cc b/kpdf/xpdf/goo/gmempp.cc
deleted file mode 100644
index b1ee970d..00000000
--- a/kpdf/xpdf/goo/gmempp.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-//========================================================================
-//
-// gmempp.cc
-//
-// Use gmalloc/gfree for C++ new/delete operators.
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-#include "gmem.h"
-
-#ifdef DEBUG_MEM
-
-void *operator new(size_t size) {
- return gmalloc((int)size);
-}
-
-void *operator new[](size_t size) {
- return gmalloc((int)size);
-}
-
-void operator delete(void *p) {
- gfree(p);
-}
-
-void operator delete[](void *p) {
- gfree(p);
-}
-
-#endif
diff --git a/kpdf/xpdf/goo/gmempp.cpp b/kpdf/xpdf/goo/gmempp.cpp
new file mode 100644
index 00000000..4804889b
--- /dev/null
+++ b/kpdf/xpdf/goo/gmempp.cpp
@@ -0,0 +1,32 @@
+//========================================================================
+//
+// gmempp.cpp
+//
+// Use gmalloc/gfree for C++ new/delete operators.
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+#include "gmem.h"
+
+#ifdef DEBUG_MEM
+
+void *operator new(size_t size) {
+ return gmalloc((int)size);
+}
+
+void *operator new[](size_t size) {
+ return gmalloc((int)size);
+}
+
+void operator delete(void *p) {
+ gfree(p);
+}
+
+void operator delete[](void *p) {
+ gfree(p);
+}
+
+#endif
diff --git a/kpdf/xpdf/splash/CMakeLists.txt b/kpdf/xpdf/splash/CMakeLists.txt
index a7573b6c..a9c3d72b 100644
--- a/kpdf/xpdf/splash/CMakeLists.txt
+++ b/kpdf/xpdf/splash/CMakeLists.txt
@@ -23,10 +23,11 @@ include_directories(
tde_add_library( splash STATIC_PIC
SOURCES
- Splash.cc SplashBitmap.cc SplashClip.cc SplashFTFont.cc
- SplashFTFontEngine.cc SplashFTFontFile.cc SplashFont.cc
- SplashFontEngine.cc SplashFontFile.cc SplashFontFileID.cc
- SplashPath.cc SplashPattern.cc SplashScreen.cc SplashState.cc
- SplashT1Font.cc SplashT1FontEngine.cc SplashT1FontFile.cc
- SplashXPath.cc SplashXPathScanner.cc
+ Splash.cpp SplashBitmap.cpp SplashClip.cpp SplashFTFont.cpp
+ SplashFTFontEngine.cpp SplashFTFontFile.cpp SplashFont.cpp
+ SplashFontEngine.cpp SplashFontFile.cpp SplashFontFileID.cpp
+ SplashPath.cpp SplashPattern.cpp SplashScreen.cpp SplashState.cpp
+ SplashT1Font.cpp SplashT1FontEngine.cpp SplashT1FontFile.cpp
+ SplashXPath.cpp SplashXPathScanner.cpp
+ LINK ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES}
)
diff --git a/kpdf/xpdf/splash/Makefile.am b/kpdf/xpdf/splash/Makefile.am
index 34d41419..724eaa6a 100644
--- a/kpdf/xpdf/splash/Makefile.am
+++ b/kpdf/xpdf/splash/Makefile.am
@@ -1,8 +1,8 @@
INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../fofi -I$(srcdir)/../goo $(LIBFREETYPE_CFLAGS) $(USER_INCLUDES)
-libsplash_la_SOURCES = Splash.cc SplashBitmap.cc SplashClip.cc SplashFTFont.cc SplashFTFontEngine.cc \
- SplashFTFontFile.cc SplashFont.cc SplashFontEngine.cc SplashFontFile.cc SplashFontFileID.cc \
- SplashPath.cc SplashPattern.cc SplashScreen.cc SplashState.cc SplashT1Font.cc \
- SplashT1FontEngine.cc SplashT1FontFile.cc SplashXPath.cc SplashXPathScanner.cc
+libsplash_la_SOURCES = Splash.cpp SplashBitmap.cpp SplashClip.cpp SplashFTFont.cpp SplashFTFontEngine.cpp \
+ SplashFTFontFile.cpp SplashFont.cpp SplashFontEngine.cpp SplashFontFile.cpp SplashFontFileID.cpp \
+ SplashPath.cpp SplashPattern.cpp SplashScreen.cpp SplashState.cpp SplashT1Font.cpp \
+ SplashT1FontEngine.cpp SplashT1FontFile.cpp SplashXPath.cpp SplashXPathScanner.cpp
noinst_LTLIBRARIES = libsplash.la
diff --git a/kpdf/xpdf/splash/Splash.cc b/kpdf/xpdf/splash/Splash.cc
deleted file mode 100644
index 2b91e4e7..00000000
--- a/kpdf/xpdf/splash/Splash.cc
+++ /dev/null
@@ -1,3347 +0,0 @@
-//========================================================================
-//
-// Splash.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include "gmem.h"
-#include "SplashErrorCodes.h"
-#include "SplashMath.h"
-#include "SplashBitmap.h"
-#include "SplashState.h"
-#include "SplashPath.h"
-#include "SplashXPath.h"
-#include "SplashXPathScanner.h"
-#include "SplashPattern.h"
-#include "SplashScreen.h"
-#include "SplashFont.h"
-#include "SplashGlyphBitmap.h"
-#include "Splash.h"
-
-//------------------------------------------------------------------------
-
-// distance of Bezier control point from center for circle approximation
-// = (4 * (sqrt(2) - 1) / 3) * r
-#define bezierCircle ((SplashCoord)0.55228475)
-#define bezierCircle2 ((SplashCoord)(0.5 * 0.55228475))
-
-// Divide a 16-bit value (in [0, 255*255]) by 255, returning an 8-bit result.
-static inline Guchar div255(int x) {
- return (Guchar)((x + (x >> 8) + 0x80) >> 8);
-}
-
-//------------------------------------------------------------------------
-// SplashPipe
-//------------------------------------------------------------------------
-
-#define splashPipeMaxStages 9
-
-struct SplashPipe {
- // pixel coordinates
- int x, y;
-
- // source pattern
- SplashPattern *pattern;
-
- // source alpha and color
- SplashCoord aInput;
- GBool usesShape;
- Guchar aSrc;
- SplashColorPtr cSrc;
- SplashColor cSrcVal;
-
- // non-isolated group alpha0
- Guchar *alpha0Ptr;
-
- // soft mask
- SplashColorPtr softMaskPtr;
-
- // destination alpha and color
- SplashColorPtr destColorPtr;
- int destColorMask;
- Guchar *destAlphaPtr;
-
- // shape
- SplashCoord shape;
-
- // result alpha and color
- GBool noTransparency;
- SplashPipeResultColorCtrl resultColorCtrl;
-
- // non-isolated group correction
- int nonIsolatedGroup;
-};
-
-SplashPipeResultColorCtrl Splash::pipeResultColorNoAlphaBlend[] = {
- splashPipeResultColorNoAlphaBlendMono,
- splashPipeResultColorNoAlphaBlendMono,
- splashPipeResultColorNoAlphaBlendRGB,
- splashPipeResultColorNoAlphaBlendRGB
-#if SPLASH_CMYK
- ,
- splashPipeResultColorNoAlphaBlendCMYK
-#endif
-};
-
-SplashPipeResultColorCtrl Splash::pipeResultColorAlphaNoBlend[] = {
- splashPipeResultColorAlphaNoBlendMono,
- splashPipeResultColorAlphaNoBlendMono,
- splashPipeResultColorAlphaNoBlendRGB,
- splashPipeResultColorAlphaNoBlendRGB
-#if SPLASH_CMYK
- ,
- splashPipeResultColorAlphaNoBlendCMYK
-#endif
-};
-
-SplashPipeResultColorCtrl Splash::pipeResultColorAlphaBlend[] = {
- splashPipeResultColorAlphaBlendMono,
- splashPipeResultColorAlphaBlendMono,
- splashPipeResultColorAlphaBlendRGB,
- splashPipeResultColorAlphaBlendRGB
-#if SPLASH_CMYK
- ,
- splashPipeResultColorAlphaBlendCMYK
-#endif
-};
-
-//------------------------------------------------------------------------
-
-static void blendXor(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = src[i] ^ dest[i];
- }
-}
-
-//------------------------------------------------------------------------
-// modified region
-//------------------------------------------------------------------------
-
-void Splash::clearModRegion() {
- modXMin = bitmap->getWidth();
- modYMin = bitmap->getHeight();
- modXMax = -1;
- modYMax = -1;
-}
-
-inline void Splash::updateModX(int x) {
- if (x < modXMin) {
- modXMin = x;
- }
- if (x > modXMax) {
- modXMax = x;
- }
-}
-
-inline void Splash::updateModY(int y) {
- if (y < modYMin) {
- modYMin = y;
- }
- if (y > modYMax) {
- modYMax = y;
- }
-}
-
-//------------------------------------------------------------------------
-// pipeline
-//------------------------------------------------------------------------
-
-inline void Splash::pipeInit(SplashPipe *pipe, int x, int y,
- SplashPattern *pattern, SplashColorPtr cSrc,
- SplashCoord aInput, GBool usesShape,
- GBool nonIsolatedGroup) {
- pipeSetXY(pipe, x, y);
- pipe->pattern = NULL;
-
- // source color
- if (pattern) {
- if (pattern->isStatic()) {
- pattern->getColor(x, y, pipe->cSrcVal);
- } else {
- pipe->pattern = pattern;
- }
- pipe->cSrc = pipe->cSrcVal;
- } else {
- pipe->cSrc = cSrc;
- }
-
- // source alpha
- pipe->aInput = aInput;
- if (!state->softMask) {
- if (usesShape) {
- pipe->aInput *= 255;
- } else {
- pipe->aSrc = (Guchar)splashRound(pipe->aInput * 255);
- }
- }
- pipe->usesShape = usesShape;
-
- // result alpha
- if (aInput == 1 && !state->softMask && !usesShape &&
- !state->inNonIsolatedGroup) {
- pipe->noTransparency = gTrue;
- } else {
- pipe->noTransparency = gFalse;
- }
-
- // result color
- if (pipe->noTransparency) {
- // the !state->blendFunc case is handled separately in pipeRun
- pipe->resultColorCtrl = pipeResultColorNoAlphaBlend[bitmap->mode];
- } else if (!state->blendFunc) {
- pipe->resultColorCtrl = pipeResultColorAlphaNoBlend[bitmap->mode];
- } else {
- pipe->resultColorCtrl = pipeResultColorAlphaBlend[bitmap->mode];
- }
-
- // non-isolated group correction
- if (nonIsolatedGroup) {
- pipe->nonIsolatedGroup = splashColorModeNComps[bitmap->mode];
- } else {
- pipe->nonIsolatedGroup = 0;
- }
-}
-
-inline void Splash::pipeRun(SplashPipe *pipe) {
- Guchar aSrc, aDest, alpha2, alpha0, aResult;
- SplashColor cDest, cBlend;
- Guchar cResult0, cResult1, cResult2, cResult3;
-
- //----- source color
-
- // static pattern: handled in pipeInit
- // fixed color: handled in pipeInit
-
- // dynamic pattern
- if (pipe->pattern) {
- pipe->pattern->getColor(pipe->x, pipe->y, pipe->cSrcVal);
- }
-
- if (pipe->noTransparency && !state->blendFunc) {
-
- //----- write destination pixel
-
- switch (bitmap->mode) {
- case splashModeMono1:
- cResult0 = pipe->cSrc[0];
- if (state->screen->test(pipe->x, pipe->y, cResult0)) {
- *pipe->destColorPtr |= pipe->destColorMask;
- } else {
- *pipe->destColorPtr &= ~pipe->destColorMask;
- }
- if (!(pipe->destColorMask >>= 1)) {
- pipe->destColorMask = 0x80;
- ++pipe->destColorPtr;
- }
- break;
- case splashModeMono8:
- *pipe->destColorPtr++ = pipe->cSrc[0];
- break;
- case splashModeRGB8:
- *pipe->destColorPtr++ = pipe->cSrc[0];
- *pipe->destColorPtr++ = pipe->cSrc[1];
- *pipe->destColorPtr++ = pipe->cSrc[2];
- break;
- case splashModeBGR8:
- *pipe->destColorPtr++ = pipe->cSrc[2];
- *pipe->destColorPtr++ = pipe->cSrc[1];
- *pipe->destColorPtr++ = pipe->cSrc[0];
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- *pipe->destColorPtr++ = pipe->cSrc[0];
- *pipe->destColorPtr++ = pipe->cSrc[1];
- *pipe->destColorPtr++ = pipe->cSrc[2];
- *pipe->destColorPtr++ = pipe->cSrc[3];
- break;
-#endif
- }
- if (pipe->destAlphaPtr) {
- *pipe->destAlphaPtr++ = 255;
- }
-
- } else {
-
- //----- read destination pixel
-
- switch (bitmap->mode) {
- case splashModeMono1:
- cDest[0] = (*pipe->destColorPtr & pipe->destColorMask) ? 0xff : 0x00;
- break;
- case splashModeMono8:
- cDest[0] = *pipe->destColorPtr;
- break;
- case splashModeRGB8:
- cDest[0] = pipe->destColorPtr[0];
- cDest[1] = pipe->destColorPtr[1];
- cDest[2] = pipe->destColorPtr[2];
- break;
- case splashModeBGR8:
- cDest[0] = pipe->destColorPtr[2];
- cDest[1] = pipe->destColorPtr[1];
- cDest[2] = pipe->destColorPtr[0];
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- cDest[0] = pipe->destColorPtr[0];
- cDest[1] = pipe->destColorPtr[1];
- cDest[2] = pipe->destColorPtr[2];
- cDest[3] = pipe->destColorPtr[3];
- break;
-#endif
- }
- if (pipe->destAlphaPtr) {
- aDest = *pipe->destAlphaPtr;
- } else {
- aDest = 0xff;
- }
-
- //----- blend function
-
- if (state->blendFunc) {
- (*state->blendFunc)(pipe->cSrc, cDest, cBlend, bitmap->mode);
- }
-
- //----- source alpha
-
- if (state->softMask) {
- if (pipe->usesShape) {
- aSrc = (Guchar)splashRound(pipe->aInput * *pipe->softMaskPtr++
- * pipe->shape);
- } else {
- aSrc = (Guchar)splashRound(pipe->aInput * *pipe->softMaskPtr++);
- }
- } else if (pipe->usesShape) {
- // pipe->aInput is premultiplied by 255 in pipeInit
- aSrc = (Guchar)splashRound(pipe->aInput * pipe->shape);
- } else {
- // precomputed in pipeInit
- aSrc = pipe->aSrc;
- }
-
- //----- result alpha and non-isolated group element correction
-
- if (pipe->noTransparency) {
- alpha2 = aResult = 255;
- } else {
- aResult = aSrc + aDest - div255(aSrc * aDest);
-
- if (pipe->alpha0Ptr) {
- alpha0 = *pipe->alpha0Ptr++;
- alpha2 = aResult + alpha0 - div255(aResult * alpha0);
- } else {
- alpha2 = aResult;
- }
- }
-
- //----- result color
-
- cResult0 = cResult1 = cResult2 = cResult3 = 0; // make gcc happy
-
- switch (pipe->resultColorCtrl) {
-
-#if SPLASH_CMYK
- case splashPipeResultColorNoAlphaBlendCMYK:
- cResult3 = div255((255 - aDest) * pipe->cSrc[3] + aDest * cBlend[3]);
-#endif
- case splashPipeResultColorNoAlphaBlendRGB:
- cResult2 = div255((255 - aDest) * pipe->cSrc[2] + aDest * cBlend[2]);
- cResult1 = div255((255 - aDest) * pipe->cSrc[1] + aDest * cBlend[1]);
- case splashPipeResultColorNoAlphaBlendMono:
- cResult0 = div255((255 - aDest) * pipe->cSrc[0] + aDest * cBlend[0]);
- break;
-
- case splashPipeResultColorAlphaNoBlendMono:
- if (alpha2 == 0) {
- cResult0 = 0;
- } else {
- cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
- aSrc * pipe->cSrc[0]) / alpha2);
- }
- break;
- case splashPipeResultColorAlphaNoBlendRGB:
- if (alpha2 == 0) {
- cResult0 = 0;
- cResult1 = 0;
- cResult2 = 0;
- } else {
- cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
- aSrc * pipe->cSrc[0]) / alpha2);
- cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
- aSrc * pipe->cSrc[1]) / alpha2);
- cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
- aSrc * pipe->cSrc[2]) / alpha2);
- }
- break;
-#if SPLASH_CMYK
- case splashPipeResultColorAlphaNoBlendCMYK:
- if (alpha2 == 0) {
- cResult0 = 0;
- cResult1 = 0;
- cResult2 = 0;
- cResult3 = 0;
- } else {
- cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
- aSrc * pipe->cSrc[0]) / alpha2);
- cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
- aSrc * pipe->cSrc[1]) / alpha2);
- cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
- aSrc * pipe->cSrc[2]) / alpha2);
- cResult3 = (Guchar)(((alpha2 - aSrc) * cDest[3] +
- aSrc * pipe->cSrc[3]) / alpha2);
- }
- break;
-#endif
-
- case splashPipeResultColorAlphaBlendMono:
- if (alpha2 == 0) {
- cResult0 = 0;
- } else {
- cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
- aSrc * ((255 - aDest) * pipe->cSrc[0] +
- aDest * cBlend[0]) / 255) /
- alpha2);
- }
- break;
- case splashPipeResultColorAlphaBlendRGB:
- if (alpha2 == 0) {
- cResult0 = 0;
- cResult1 = 0;
- cResult2 = 0;
- } else {
- cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
- aSrc * ((255 - aDest) * pipe->cSrc[0] +
- aDest * cBlend[0]) / 255) /
- alpha2);
- cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
- aSrc * ((255 - aDest) * pipe->cSrc[1] +
- aDest * cBlend[1]) / 255) /
- alpha2);
- cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
- aSrc * ((255 - aDest) * pipe->cSrc[2] +
- aDest * cBlend[2]) / 255) /
- alpha2);
- }
- break;
-#if SPLASH_CMYK
- case splashPipeResultColorAlphaBlendCMYK:
- if (alpha2 == 0) {
- cResult0 = 0;
- cResult1 = 0;
- cResult2 = 0;
- cResult3 = 0;
- } else {
- cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
- aSrc * ((255 - aDest) * pipe->cSrc[0] +
- aDest * cBlend[0]) / 255) /
- alpha2);
- cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
- aSrc * ((255 - aDest) * pipe->cSrc[1] +
- aDest * cBlend[1]) / 255) /
- alpha2);
- cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
- aSrc * ((255 - aDest) * pipe->cSrc[2] +
- aDest * cBlend[2]) / 255) /
- alpha2);
- cResult3 = (Guchar)(((alpha2 - aSrc) * cDest[3] +
- aSrc * ((255 - aDest) * pipe->cSrc[3] +
- aDest * cBlend[3]) / 255) /
- alpha2);
- }
- break;
-#endif
- }
-
- //----- non-isolated group correction
-
- if (aResult != 0) {
- switch (pipe->nonIsolatedGroup) {
-#if SPLASH_CMYK
- case 4:
- cResult3 += (cResult3 - cDest[3]) * aDest *
- (255 - aResult) / (255 * aResult);
-#endif
- case 3:
- cResult2 += (cResult2 - cDest[2]) * aDest *
- (255 - aResult) / (255 * aResult);
- cResult1 += (cResult1 - cDest[1]) * aDest *
- (255 - aResult) / (255 * aResult);
- case 1:
- cResult0 += (cResult0 - cDest[0]) * aDest *
- (255 - aResult) / (255 * aResult);
- case 0:
- break;
- }
- }
-
- //----- write destination pixel
-
- switch (bitmap->mode) {
- case splashModeMono1:
- if (state->screen->test(pipe->x, pipe->y, cResult0)) {
- *pipe->destColorPtr |= pipe->destColorMask;
- } else {
- *pipe->destColorPtr &= ~pipe->destColorMask;
- }
- if (!(pipe->destColorMask >>= 1)) {
- pipe->destColorMask = 0x80;
- ++pipe->destColorPtr;
- }
- break;
- case splashModeMono8:
- *pipe->destColorPtr++ = cResult0;
- break;
- case splashModeRGB8:
- *pipe->destColorPtr++ = cResult0;
- *pipe->destColorPtr++ = cResult1;
- *pipe->destColorPtr++ = cResult2;
- break;
- case splashModeBGR8:
- *pipe->destColorPtr++ = cResult2;
- *pipe->destColorPtr++ = cResult1;
- *pipe->destColorPtr++ = cResult0;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- *pipe->destColorPtr++ = cResult0;
- *pipe->destColorPtr++ = cResult1;
- *pipe->destColorPtr++ = cResult2;
- *pipe->destColorPtr++ = cResult3;
- break;
-#endif
- }
- if (pipe->destAlphaPtr) {
- *pipe->destAlphaPtr++ = aResult;
- }
-
- }
-
- ++pipe->x;
-}
-
-inline void Splash::pipeSetXY(SplashPipe *pipe, int x, int y) {
- pipe->x = x;
- pipe->y = y;
- if (state->softMask) {
- pipe->softMaskPtr =
- &state->softMask->data[y * state->softMask->rowSize + x];
- }
- switch (bitmap->mode) {
- case splashModeMono1:
- pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + (x >> 3)];
- pipe->destColorMask = 0x80 >> (x & 7);
- break;
- case splashModeMono8:
- pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + x];
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x];
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x];
- break;
-#endif
- }
- if (bitmap->alpha) {
- pipe->destAlphaPtr = &bitmap->alpha[y * bitmap->width + x];
- } else {
- pipe->destAlphaPtr = NULL;
- }
- if (state->inNonIsolatedGroup && alpha0Bitmap->alpha) {
- pipe->alpha0Ptr =
- &alpha0Bitmap->alpha[(alpha0Y + y) * alpha0Bitmap->width +
- (alpha0X + x)];
- } else {
- pipe->alpha0Ptr = NULL;
- }
-}
-
-inline void Splash::pipeIncX(SplashPipe *pipe) {
- ++pipe->x;
- if (state->softMask) {
- ++pipe->softMaskPtr;
- }
- switch (bitmap->mode) {
- case splashModeMono1:
- if (!(pipe->destColorMask >>= 1)) {
- pipe->destColorMask = 0x80;
- ++pipe->destColorPtr;
- }
- break;
- case splashModeMono8:
- ++pipe->destColorPtr;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- pipe->destColorPtr += 3;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- pipe->destColorPtr += 4;
- break;
-#endif
- }
- if (pipe->destAlphaPtr) {
- ++pipe->destAlphaPtr;
- }
- if (pipe->alpha0Ptr) {
- ++pipe->alpha0Ptr;
- }
-}
-
-inline void Splash::drawPixel(SplashPipe *pipe, int x, int y, GBool noClip) {
- if (noClip || state->clip->test(x, y)) {
- pipeSetXY(pipe, x, y);
- pipeRun(pipe);
- updateModX(x);
- updateModY(y);
- }
-}
-
-inline void Splash::drawAAPixelInit() {
- aaBufY = -1;
-}
-
-inline void Splash::drawAAPixel(SplashPipe *pipe, int x, int y) {
-#if splashAASize == 4
- static int bitCount4[16] = { 0, 1, 1, 2, 1, 2, 2, 3,
- 1, 2, 2, 3, 2, 3, 3, 4 };
- int w;
-#else
- int xx, yy;
-#endif
- SplashColorPtr p;
- int x0, x1, t;
-
- if (x < 0 || x >= bitmap->width ||
- y < state->clip->getYMinI() || y > state->clip->getYMaxI()) {
- return;
- }
-
- // update aaBuf
- if (y != aaBufY) {
- memset(aaBuf->getDataPtr(), 0xff,
- aaBuf->getRowSize() * aaBuf->getHeight());
- x0 = 0;
- x1 = bitmap->width - 1;
- state->clip->clipAALine(aaBuf, &x0, &x1, y);
- aaBufY = y;
- }
-
- // compute the shape value
-#if splashAASize == 4
- p = aaBuf->getDataPtr() + (x >> 1);
- w = aaBuf->getRowSize();
- if (x & 1) {
- t = bitCount4[*p & 0x0f] + bitCount4[p[w] & 0x0f] +
- bitCount4[p[2*w] & 0x0f] + bitCount4[p[3*w] & 0x0f];
- } else {
- t = bitCount4[*p >> 4] + bitCount4[p[w] >> 4] +
- bitCount4[p[2*w] >> 4] + bitCount4[p[3*w] >> 4];
- }
-#else
- t = 0;
- for (yy = 0; yy < splashAASize; ++yy) {
- for (xx = 0; xx < splashAASize; ++xx) {
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() +
- ((x * splashAASize + xx) >> 3);
- t += (*p >> (7 - ((x * splashAASize + xx) & 7))) & 1;
- }
- }
-#endif
-
- // draw the pixel
- if (t != 0) {
- pipeSetXY(pipe, x, y);
- pipe->shape *= aaGamma[t];
- pipeRun(pipe);
- updateModX(x);
- updateModY(y);
- }
-}
-
-inline void Splash::drawSpan(SplashPipe *pipe, int x0, int x1, int y,
- GBool noClip) {
- int x;
-
- pipeSetXY(pipe, x0, y);
- if (noClip) {
- for (x = x0; x <= x1; ++x) {
- pipeRun(pipe);
- }
- updateModX(x0);
- updateModX(x1);
- updateModY(y);
- } else {
- for (x = x0; x <= x1; ++x) {
- if (state->clip->test(x, y)) {
- pipeRun(pipe);
- updateModX(x);
- updateModY(y);
- } else {
- pipeIncX(pipe);
- }
- }
- }
-}
-
-inline void Splash::drawAALine(SplashPipe *pipe, int x0, int x1, int y) {
-#if splashAASize == 4
- static int bitCount4[16] = { 0, 1, 1, 2, 1, 2, 2, 3,
- 1, 2, 2, 3, 2, 3, 3, 4 };
- SplashColorPtr p0, p1, p2, p3;
- int t;
-#else
- SplashColorPtr p;
- int xx, yy, t;
-#endif
- int x;
-
-#if splashAASize == 4
- p0 = aaBuf->getDataPtr() + (x0 >> 1);
- p1 = p0 + aaBuf->getRowSize();
- p2 = p1 + aaBuf->getRowSize();
- p3 = p2 + aaBuf->getRowSize();
-#endif
- pipeSetXY(pipe, x0, y);
- for (x = x0; x <= x1; ++x) {
-
- // compute the shape value
-#if splashAASize == 4
- if (x & 1) {
- t = bitCount4[*p0 & 0x0f] + bitCount4[*p1 & 0x0f] +
- bitCount4[*p2 & 0x0f] + bitCount4[*p3 & 0x0f];
- ++p0; ++p1; ++p2; ++p3;
- } else {
- t = bitCount4[*p0 >> 4] + bitCount4[*p1 >> 4] +
- bitCount4[*p2 >> 4] + bitCount4[*p3 >> 4];
- }
-#else
- t = 0;
- for (yy = 0; yy < splashAASize; ++yy) {
- for (xx = 0; xx < splashAASize; ++xx) {
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() +
- ((x * splashAASize + xx) >> 3);
- t += (*p >> (7 - ((x * splashAASize + xx) & 7))) & 1;
- }
- }
-#endif
-
- if (t != 0) {
- pipe->shape = aaGamma[t];
- pipeRun(pipe);
- updateModX(x);
- updateModY(y);
- } else {
- pipeIncX(pipe);
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-// Transform a point from user space to device space.
-inline void Splash::transform(SplashCoord *matrix,
- SplashCoord xi, SplashCoord yi,
- SplashCoord *xo, SplashCoord *yo) {
- // [ m[0] m[1] 0 ]
- // [xo yo 1] = [xi yi 1] * [ m[2] m[3] 0 ]
- // [ m[4] m[5] 1 ]
- *xo = xi * matrix[0] + yi * matrix[2] + matrix[4];
- *yo = xi * matrix[1] + yi * matrix[3] + matrix[5];
-}
-
-//------------------------------------------------------------------------
-// Splash
-//------------------------------------------------------------------------
-
-Splash::Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA,
- SplashScreenParams *screenParams) {
- int i;
-
- bitmap = bitmapA;
- vectorAntialias = vectorAntialiasA;
- state = new SplashState(bitmap->width, bitmap->height, vectorAntialias,
- screenParams);
- if (vectorAntialias) {
- aaBuf = new SplashBitmap(splashAASize * bitmap->width, splashAASize,
- 1, splashModeMono1, gFalse);
- for (i = 0; i <= splashAASize * splashAASize; ++i) {
- aaGamma[i] = splashPow((SplashCoord)i /
- (SplashCoord)(splashAASize * splashAASize),
- 1.5);
- }
- } else {
- aaBuf = NULL;
- }
- clearModRegion();
- debugMode = gFalse;
-}
-
-Splash::Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA,
- SplashScreen *screenA) {
- int i;
-
- bitmap = bitmapA;
- vectorAntialias = vectorAntialiasA;
- state = new SplashState(bitmap->width, bitmap->height, vectorAntialias,
- screenA);
- if (vectorAntialias) {
- aaBuf = new SplashBitmap(splashAASize * bitmap->width, splashAASize,
- 1, splashModeMono1, gFalse);
- for (i = 0; i <= splashAASize * splashAASize; ++i) {
- aaGamma[i] = splashPow((SplashCoord)i /
- (SplashCoord)(splashAASize * splashAASize),
- 1.5);
- }
- } else {
- aaBuf = NULL;
- }
- clearModRegion();
- debugMode = gFalse;
-}
-
-Splash::~Splash() {
- while (state->next) {
- restoreState();
- }
- delete state;
- if (vectorAntialias) {
- delete aaBuf;
- }
-}
-
-//------------------------------------------------------------------------
-// state read
-//------------------------------------------------------------------------
-
-SplashCoord *Splash::getMatrix() {
- return state->matrix;
-}
-
-SplashPattern *Splash::getStrokePattern() {
- return state->strokePattern;
-}
-
-SplashPattern *Splash::getFillPattern() {
- return state->fillPattern;
-}
-
-SplashScreen *Splash::getScreen() {
- return state->screen;
-}
-
-SplashBlendFunc Splash::getBlendFunc() {
- return state->blendFunc;
-}
-
-SplashCoord Splash::getStrokeAlpha() {
- return state->strokeAlpha;
-}
-
-SplashCoord Splash::getFillAlpha() {
- return state->fillAlpha;
-}
-
-SplashCoord Splash::getLineWidth() {
- return state->lineWidth;
-}
-
-int Splash::getLineCap() {
- return state->lineCap;
-}
-
-int Splash::getLineJoin() {
- return state->lineJoin;
-}
-
-SplashCoord Splash::getMiterLimit() {
- return state->miterLimit;
-}
-
-SplashCoord Splash::getFlatness() {
- return state->flatness;
-}
-
-SplashCoord *Splash::getLineDash() {
- return state->lineDash;
-}
-
-int Splash::getLineDashLength() {
- return state->lineDashLength;
-}
-
-SplashCoord Splash::getLineDashPhase() {
- return state->lineDashPhase;
-}
-
-SplashClip *Splash::getClip() {
- return state->clip;
-}
-
-SplashBitmap *Splash::getSoftMask() {
- return state->softMask;
-}
-
-GBool Splash::getInNonIsolatedGroup() {
- return state->inNonIsolatedGroup;
-}
-
-//------------------------------------------------------------------------
-// state write
-//------------------------------------------------------------------------
-
-void Splash::setMatrix(SplashCoord *matrix) {
- memcpy(state->matrix, matrix, 6 * sizeof(SplashCoord));
-}
-
-void Splash::setStrokePattern(SplashPattern *strokePattern) {
- state->setStrokePattern(strokePattern);
-}
-
-void Splash::setFillPattern(SplashPattern *fillPattern) {
- state->setFillPattern(fillPattern);
-}
-
-void Splash::setScreen(SplashScreen *screen) {
- state->setScreen(screen);
-}
-
-void Splash::setBlendFunc(SplashBlendFunc func) {
- state->blendFunc = func;
-}
-
-void Splash::setStrokeAlpha(SplashCoord alpha) {
- state->strokeAlpha = alpha;
-}
-
-void Splash::setFillAlpha(SplashCoord alpha) {
- state->fillAlpha = alpha;
-}
-
-void Splash::setLineWidth(SplashCoord lineWidth) {
- state->lineWidth = lineWidth;
-}
-
-void Splash::setLineCap(int lineCap) {
- state->lineCap = lineCap;
-}
-
-void Splash::setLineJoin(int lineJoin) {
- state->lineJoin = lineJoin;
-}
-
-void Splash::setMiterLimit(SplashCoord miterLimit) {
- state->miterLimit = miterLimit;
-}
-
-void Splash::setFlatness(SplashCoord flatness) {
- if (flatness < 1) {
- state->flatness = 1;
- } else {
- state->flatness = flatness;
- }
-}
-
-void Splash::setLineDash(SplashCoord *lineDash, int lineDashLength,
- SplashCoord lineDashPhase) {
- state->setLineDash(lineDash, lineDashLength, lineDashPhase);
-}
-
-void Splash::setStrokeAdjust(GBool strokeAdjust) {
- state->strokeAdjust = strokeAdjust;
-}
-
-void Splash::clipResetToRect(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1) {
- state->clip->resetToRect(x0, y0, x1, y1);
-}
-
-SplashError Splash::clipToRect(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1) {
- return state->clip->clipToRect(x0, y0, x1, y1);
-}
-
-SplashError Splash::clipToPath(SplashPath *path, GBool eo) {
- return state->clip->clipToPath(path, state->matrix, state->flatness, eo);
-}
-
-void Splash::setSoftMask(SplashBitmap *softMask) {
- state->setSoftMask(softMask);
-}
-
-void Splash::setInNonIsolatedGroup(SplashBitmap *alpha0BitmapA,
- int alpha0XA, int alpha0YA) {
- alpha0Bitmap = alpha0BitmapA;
- alpha0X = alpha0XA;
- alpha0Y = alpha0YA;
- state->inNonIsolatedGroup = gTrue;
-}
-
-//------------------------------------------------------------------------
-// state save/restore
-//------------------------------------------------------------------------
-
-void Splash::saveState() {
- SplashState *newState;
-
- newState = state->copy();
- newState->next = state;
- state = newState;
-}
-
-SplashError Splash::restoreState() {
- SplashState *oldState;
-
- if (!state->next) {
- return splashErrNoSave;
- }
- oldState = state;
- state = state->next;
- delete oldState;
- return splashOk;
-}
-
-//------------------------------------------------------------------------
-// drawing operations
-//------------------------------------------------------------------------
-
-void Splash::clear(SplashColorPtr color, Guchar alpha) {
- SplashColorPtr row, p;
- Guchar mono;
- int x, y;
-
- switch (bitmap->mode) {
- case splashModeMono1:
- mono = (color[0] & 0x80) ? 0xff : 0x00;
- if (bitmap->rowSize < 0) {
- memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
- mono, -bitmap->rowSize * bitmap->height);
- } else {
- memset(bitmap->data, mono, bitmap->rowSize * bitmap->height);
- }
- break;
- case splashModeMono8:
- if (bitmap->rowSize < 0) {
- memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
- color[0], -bitmap->rowSize * bitmap->height);
- } else {
- memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
- }
- break;
- case splashModeRGB8:
- if (color[0] == color[1] && color[1] == color[2]) {
- if (bitmap->rowSize < 0) {
- memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
- color[0], -bitmap->rowSize * bitmap->height);
- } else {
- memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
- }
- } else {
- row = bitmap->data;
- for (y = 0; y < bitmap->height; ++y) {
- p = row;
- for (x = 0; x < bitmap->width; ++x) {
- *p++ = color[2];
- *p++ = color[1];
- *p++ = color[0];
- }
- row += bitmap->rowSize;
- }
- }
- break;
- case splashModeBGR8:
- if (color[0] == color[1] && color[1] == color[2]) {
- if (bitmap->rowSize < 0) {
- memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
- color[0], -bitmap->rowSize * bitmap->height);
- } else {
- memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
- }
- } else {
- row = bitmap->data;
- for (y = 0; y < bitmap->height; ++y) {
- p = row;
- for (x = 0; x < bitmap->width; ++x) {
- *p++ = color[0];
- *p++ = color[1];
- *p++ = color[2];
- }
- row += bitmap->rowSize;
- }
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- if (color[0] == color[1] && color[1] == color[2] && color[2] == color[3]) {
- if (bitmap->rowSize < 0) {
- memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
- color[0], -bitmap->rowSize * bitmap->height);
- } else {
- memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
- }
- } else {
- row = bitmap->data;
- for (y = 0; y < bitmap->height; ++y) {
- p = row;
- for (x = 0; x < bitmap->width; ++x) {
- *p++ = color[0];
- *p++ = color[1];
- *p++ = color[2];
- *p++ = color[3];
- }
- row += bitmap->rowSize;
- }
- }
- break;
-#endif
- }
-
- if (bitmap->alpha) {
- memset(bitmap->alpha, alpha, bitmap->width * bitmap->height);
- }
-
- updateModX(0);
- updateModY(0);
- updateModX(bitmap->width - 1);
- updateModY(bitmap->height - 1);
-}
-
-SplashError Splash::stroke(SplashPath *path) {
- SplashPath *path2, *dPath;
-
- if (debugMode) {
- printf("stroke [dash:%d] [width:%.2f]:\n",
- state->lineDashLength, (double)state->lineWidth);
- dumpPath(path);
- }
- opClipRes = splashClipAllOutside;
- if (path->length == 0) {
- return splashErrEmptyPath;
- }
- path2 = flattenPath(path, state->matrix, state->flatness);
- if (state->lineDashLength > 0) {
- dPath = makeDashedPath(path2);
- delete path2;
- path2 = dPath;
- }
- if (state->lineWidth == 0) {
- strokeNarrow(path2);
- } else {
- strokeWide(path2);
- }
- delete path2;
- return splashOk;
-}
-
-void Splash::strokeNarrow(SplashPath *path) {
- SplashPipe pipe;
- SplashXPath *xPath;
- SplashXPathSeg *seg;
- int x0, x1, x2, x3, y0, y1, x, y, t;
- SplashCoord dx, dy, dxdy;
- SplashClipResult clipRes;
- int nClipRes[3];
- int i;
-
- nClipRes[0] = nClipRes[1] = nClipRes[2] = 0;
-
- xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse);
-
- pipeInit(&pipe, 0, 0, state->strokePattern, NULL, state->strokeAlpha,
- gFalse, gFalse);
-
- for (i = 0, seg = xPath->segs; i < xPath->length; ++i, ++seg) {
-
- x0 = splashFloor(seg->x0);
- x1 = splashFloor(seg->x1);
- y0 = splashFloor(seg->y0);
- y1 = splashFloor(seg->y1);
-
- // horizontal segment
- if (y0 == y1) {
- if (x0 > x1) {
- t = x0; x0 = x1; x1 = t;
- }
- if ((clipRes = state->clip->testSpan(x0, x1, y0))
- != splashClipAllOutside) {
- drawSpan(&pipe, x0, x1, y0, clipRes == splashClipAllInside);
- }
-
- // segment with |dx| > |dy|
- } else if (splashAbs(seg->dxdy) > 1) {
- dx = seg->x1 - seg->x0;
- dy = seg->y1 - seg->y0;
- dxdy = seg->dxdy;
- if (y0 > y1) {
- t = y0; y0 = y1; y1 = t;
- t = x0; x0 = x1; x1 = t;
- dx = -dx;
- dy = -dy;
- }
- if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0,
- x0 <= x1 ? x1 : x0, y1))
- != splashClipAllOutside) {
- if (dx > 0) {
- x2 = x0;
- x3 = splashFloor(seg->x0 + ((SplashCoord)y0 + 1 - seg->y0) * dxdy);
- drawSpan(&pipe, x2, (x2 <= x3 - 1) ? x3 - 1 : x2, y0,
- clipRes == splashClipAllInside);
- x2 = x3;
- for (y = y0 + 1; y <= y1 - 1; ++y) {
- x3 = splashFloor(seg->x0 + ((SplashCoord)y + 1 - seg->y0) * dxdy);
- drawSpan(&pipe, x2, x3 - 1, y, clipRes == splashClipAllInside);
- x2 = x3;
- }
- drawSpan(&pipe, x2, x2 <= x1 ? x1 : x2, y1,
- clipRes == splashClipAllInside);
- } else {
- x2 = x0;
- x3 = splashFloor(seg->x0 + ((SplashCoord)y0 + 1 - seg->y0) * dxdy);
- drawSpan(&pipe, (x3 + 1 <= x2) ? x3 + 1 : x2, x2, y0,
- clipRes == splashClipAllInside);
- x2 = x3;
- for (y = y0 + 1; y <= y1 - 1; ++y) {
- x3 = splashFloor(seg->x0 + ((SplashCoord)y + 1 - seg->y0) * dxdy);
- drawSpan(&pipe, x3 + 1, x2, y, clipRes == splashClipAllInside);
- x2 = x3;
- }
- drawSpan(&pipe, x1, (x1 <= x2) ? x2 : x1, y1,
- clipRes == splashClipAllInside);
- }
- }
-
- // segment with |dy| > |dx|
- } else {
- dxdy = seg->dxdy;
- if (y0 > y1) {
- t = x0; x0 = x1; x1 = t;
- t = y0; y0 = y1; y1 = t;
- }
- if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0,
- x0 <= x1 ? x1 : x0, y1))
- != splashClipAllOutside) {
- drawPixel(&pipe, x0, y0, clipRes == splashClipAllInside);
- for (y = y0 + 1; y <= y1 - 1; ++y) {
- x = splashFloor(seg->x0 + ((SplashCoord)y - seg->y0) * dxdy);
- drawPixel(&pipe, x, y, clipRes == splashClipAllInside);
- }
- drawPixel(&pipe, x1, y1, clipRes == splashClipAllInside);
- }
- }
- ++nClipRes[clipRes];
- }
- if (nClipRes[splashClipPartial] ||
- (nClipRes[splashClipAllInside] && nClipRes[splashClipAllOutside])) {
- opClipRes = splashClipPartial;
- } else if (nClipRes[splashClipAllInside]) {
- opClipRes = splashClipAllInside;
- } else {
- opClipRes = splashClipAllOutside;
- }
-
- delete xPath;
-}
-
-void Splash::strokeWide(SplashPath *path) {
- SplashPath *path2;
-
- path2 = makeStrokePath(path, gFalse);
- fillWithPattern(path2, gFalse, state->strokePattern, state->strokeAlpha);
- delete path2;
-}
-
-SplashPath *Splash::flattenPath(SplashPath *path, SplashCoord *matrix,
- SplashCoord flatness) {
- SplashPath *fPath;
- SplashCoord flatness2;
- Guchar flag;
- int i;
-
- fPath = new SplashPath();
- flatness2 = flatness * flatness;
- i = 0;
- while (i < path->length) {
- flag = path->flags[i];
- if (flag & splashPathFirst) {
- fPath->moveTo(path->pts[i].x, path->pts[i].y);
- ++i;
- } else {
- if (flag & splashPathCurve) {
- flattenCurve(path->pts[i-1].x, path->pts[i-1].y,
- path->pts[i ].x, path->pts[i ].y,
- path->pts[i+1].x, path->pts[i+1].y,
- path->pts[i+2].x, path->pts[i+2].y,
- matrix, flatness2, fPath);
- i += 3;
- } else {
- fPath->lineTo(path->pts[i].x, path->pts[i].y);
- ++i;
- }
- if (path->flags[i-1] & splashPathClosed) {
- fPath->close();
- }
- }
- }
- return fPath;
-}
-
-void Splash::flattenCurve(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
- SplashCoord x2, SplashCoord y2,
- SplashCoord x3, SplashCoord y3,
- SplashCoord *matrix, SplashCoord flatness2,
- SplashPath *fPath) {
- SplashCoord cx[splashMaxCurveSplits + 1][3];
- SplashCoord cy[splashMaxCurveSplits + 1][3];
- int cNext[splashMaxCurveSplits + 1];
- SplashCoord xl0, xl1, xl2, xr0, xr1, xr2, xr3, xx1, xx2, xh;
- SplashCoord yl0, yl1, yl2, yr0, yr1, yr2, yr3, yy1, yy2, yh;
- SplashCoord dx, dy, mx, my, tx, ty, d1, d2;
- int p1, p2, p3;
-
- // initial segment
- p1 = 0;
- p2 = splashMaxCurveSplits;
- cx[p1][0] = x0; cy[p1][0] = y0;
- cx[p1][1] = x1; cy[p1][1] = y1;
- cx[p1][2] = x2; cy[p1][2] = y2;
- cx[p2][0] = x3; cy[p2][0] = y3;
- cNext[p1] = p2;
-
- while (p1 < splashMaxCurveSplits) {
-
- // get the next segment
- xl0 = cx[p1][0]; yl0 = cy[p1][0];
- xx1 = cx[p1][1]; yy1 = cy[p1][1];
- xx2 = cx[p1][2]; yy2 = cy[p1][2];
- p2 = cNext[p1];
- xr3 = cx[p2][0]; yr3 = cy[p2][0];
-
- // compute the distances (in device space) from the control points
- // to the midpoint of the straight line (this is a bit of a hack,
- // but it's much faster than computing the actual distances to the
- // line)
- transform(matrix, (xl0 + xr3) * 0.5, (yl0 + yr3) * 0.5, &mx, &my);
- transform(matrix, xx1, yy1, &tx, &ty);
- dx = tx - mx;
- dy = ty - my;
- d1 = dx*dx + dy*dy;
- transform(matrix, xx2, yy2, &tx, &ty);
- dx = tx - mx;
- dy = ty - my;
- d2 = dx*dx + dy*dy;
-
- // if the curve is flat enough, or no more subdivisions are
- // allowed, add the straight line segment
- if (p2 - p1 == 1 || (d1 <= flatness2 && d2 <= flatness2)) {
- fPath->lineTo(xr3, yr3);
- p1 = p2;
-
- // otherwise, subdivide the curve
- } else {
- xl1 = (xl0 + xx1) * 0.5;
- yl1 = (yl0 + yy1) * 0.5;
- xh = (xx1 + xx2) * 0.5;
- yh = (yy1 + yy2) * 0.5;
- xl2 = (xl1 + xh) * 0.5;
- yl2 = (yl1 + yh) * 0.5;
- xr2 = (xx2 + xr3) * 0.5;
- yr2 = (yy2 + yr3) * 0.5;
- xr1 = (xh + xr2) * 0.5;
- yr1 = (yh + yr2) * 0.5;
- xr0 = (xl2 + xr1) * 0.5;
- yr0 = (yl2 + yr1) * 0.5;
- // add the new subdivision points
- p3 = (p1 + p2) / 2;
- cx[p1][1] = xl1; cy[p1][1] = yl1;
- cx[p1][2] = xl2; cy[p1][2] = yl2;
- cNext[p1] = p3;
- cx[p3][0] = xr0; cy[p3][0] = yr0;
- cx[p3][1] = xr1; cy[p3][1] = yr1;
- cx[p3][2] = xr2; cy[p3][2] = yr2;
- cNext[p3] = p2;
- }
- }
-}
-
-SplashPath *Splash::makeDashedPath(SplashPath *path) {
- SplashPath *dPath;
- SplashCoord lineDashTotal;
- SplashCoord lineDashStartPhase, lineDashDist, segLen;
- SplashCoord x0, y0, x1, y1, xa, ya;
- GBool lineDashStartOn, lineDashOn, newPath;
- int lineDashStartIdx, lineDashIdx;
- int i, j, k;
-
- lineDashTotal = 0;
- for (i = 0; i < state->lineDashLength; ++i) {
- lineDashTotal += state->lineDash[i];
- }
- lineDashStartPhase = state->lineDashPhase;
- i = splashFloor(lineDashStartPhase / lineDashTotal);
- lineDashStartPhase -= (SplashCoord)i * lineDashTotal;
- lineDashStartOn = gTrue;
- lineDashStartIdx = 0;
- while (lineDashStartPhase >= state->lineDash[lineDashStartIdx]) {
- lineDashStartOn = !lineDashStartOn;
- lineDashStartPhase -= state->lineDash[lineDashStartIdx];
- ++lineDashStartIdx;
- }
-
- dPath = new SplashPath();
-
- // process each subpath
- i = 0;
- while (i < path->length) {
-
- // find the end of the subpath
- for (j = i;
- j < path->length - 1 && !(path->flags[j] & splashPathLast);
- ++j) ;
-
- // initialize the dash parameters
- lineDashOn = lineDashStartOn;
- lineDashIdx = lineDashStartIdx;
- lineDashDist = state->lineDash[lineDashIdx] - lineDashStartPhase;
-
- // process each segment of the subpath
- newPath = gTrue;
- for (k = i; k < j; ++k) {
-
- // grab the segment
- x0 = path->pts[k].x;
- y0 = path->pts[k].y;
- x1 = path->pts[k+1].x;
- y1 = path->pts[k+1].y;
- segLen = splashDist(x0, y0, x1, y1);
-
- // process the segment
- while (segLen > 0) {
-
- if (lineDashDist >= segLen) {
- if (lineDashOn) {
- if (newPath) {
- dPath->moveTo(x0, y0);
- newPath = gFalse;
- }
- dPath->lineTo(x1, y1);
- }
- lineDashDist -= segLen;
- segLen = 0;
-
- } else {
- xa = x0 + (lineDashDist / segLen) * (x1 - x0);
- ya = y0 + (lineDashDist / segLen) * (y1 - y0);
- if (lineDashOn) {
- if (newPath) {
- dPath->moveTo(x0, y0);
- newPath = gFalse;
- }
- dPath->lineTo(xa, ya);
- }
- x0 = xa;
- y0 = ya;
- segLen -= lineDashDist;
- lineDashDist = 0;
- }
-
- // get the next entry in the dash array
- if (lineDashDist <= 0) {
- lineDashOn = !lineDashOn;
- if (++lineDashIdx == state->lineDashLength) {
- lineDashIdx = 0;
- }
- lineDashDist = state->lineDash[lineDashIdx];
- newPath = gTrue;
- }
- }
- }
- i = j + 1;
- }
-
- return dPath;
-}
-
-SplashError Splash::fill(SplashPath *path, GBool eo) {
- if (debugMode) {
- printf("fill [eo:%d]:\n", eo);
- dumpPath(path);
- }
- return fillWithPattern(path, eo, state->fillPattern, state->fillAlpha);
-}
-
-SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
- SplashPattern *pattern,
- SplashCoord alpha) {
- SplashPipe pipe;
- SplashXPath *xPath;
- SplashXPathScanner *scanner;
- int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y;
- SplashClipResult clipRes, clipRes2;
-
- if (path->length == 0) {
- return splashErrEmptyPath;
- }
- xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
- if (vectorAntialias) {
- xPath->aaScale();
- }
- xPath->sort();
- if (!&xPath->segs[0])
- {
- delete xPath;
- return splashErrEmptyPath;
- }
- scanner = new SplashXPathScanner(xPath, eo);
-
- // get the min and max x and y values
- if (vectorAntialias) {
- scanner->getBBoxAA(&xMinI, &yMinI, &xMaxI, &yMaxI);
- } else {
- scanner->getBBox(&xMinI, &yMinI, &xMaxI, &yMaxI);
- }
-
- // check clipping
- if ((clipRes = state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI))
- != splashClipAllOutside) {
-
- // limit the y range
- if (yMinI < state->clip->getYMinI()) {
- yMinI = state->clip->getYMinI();
- }
- if (yMaxI > state->clip->getYMaxI()) {
- yMaxI = state->clip->getYMaxI();
- }
-
- pipeInit(&pipe, 0, yMinI, pattern, NULL, alpha, vectorAntialias, gFalse);
-
- // draw the spans
- if (vectorAntialias) {
- for (y = yMinI; y <= yMaxI; ++y) {
- scanner->renderAALine(aaBuf, &x0, &x1, y);
- if (clipRes != splashClipAllInside) {
- state->clip->clipAALine(aaBuf, &x0, &x1, y);
- }
- drawAALine(&pipe, x0, x1, y);
- }
- } else {
- for (y = yMinI; y <= yMaxI; ++y) {
- while (scanner->getNextSpan(y, &x0, &x1)) {
- if (clipRes == splashClipAllInside) {
- drawSpan(&pipe, x0, x1, y, gTrue);
- } else {
- // limit the x range
- if (x0 < state->clip->getXMinI()) {
- x0 = state->clip->getXMinI();
- }
- if (x1 > state->clip->getXMaxI()) {
- x1 = state->clip->getXMaxI();
- }
- clipRes2 = state->clip->testSpan(x0, x1, y);
- drawSpan(&pipe, x0, x1, y, clipRes2 == splashClipAllInside);
- }
- }
- }
- }
- }
- opClipRes = clipRes;
-
- delete scanner;
- delete xPath;
- return splashOk;
-}
-
-SplashError Splash::xorFill(SplashPath *path, GBool eo) {
- SplashPipe pipe;
- SplashXPath *xPath;
- SplashXPathScanner *scanner;
- int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y;
- SplashClipResult clipRes, clipRes2;
- SplashBlendFunc origBlendFunc;
-
- if (path->length == 0) {
- return splashErrEmptyPath;
- }
- xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
- xPath->sort();
- scanner = new SplashXPathScanner(xPath, eo);
-
- // get the min and max x and y values
- scanner->getBBox(&xMinI, &yMinI, &xMaxI, &yMaxI);
-
- // check clipping
- if ((clipRes = state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI))
- != splashClipAllOutside) {
-
- // limit the y range
- if (yMinI < state->clip->getYMinI()) {
- yMinI = state->clip->getYMinI();
- }
- if (yMaxI > state->clip->getYMaxI()) {
- yMaxI = state->clip->getYMaxI();
- }
-
- origBlendFunc = state->blendFunc;
- state->blendFunc = &blendXor;
- pipeInit(&pipe, 0, yMinI, state->fillPattern, NULL, 1, gFalse, gFalse);
-
- // draw the spans
- for (y = yMinI; y <= yMaxI; ++y) {
- while (scanner->getNextSpan(y, &x0, &x1)) {
- if (clipRes == splashClipAllInside) {
- drawSpan(&pipe, x0, x1, y, gTrue);
- } else {
- // limit the x range
- if (x0 < state->clip->getXMinI()) {
- x0 = state->clip->getXMinI();
- }
- if (x1 > state->clip->getXMaxI()) {
- x1 = state->clip->getXMaxI();
- }
- clipRes2 = state->clip->testSpan(x0, x1, y);
- drawSpan(&pipe, x0, x1, y, clipRes2 == splashClipAllInside);
- }
- }
- }
- state->blendFunc = origBlendFunc;
- }
- opClipRes = clipRes;
-
- delete scanner;
- delete xPath;
- return splashOk;
-}
-
-SplashError Splash::fillChar(SplashCoord x, SplashCoord y,
- int c, SplashFont *font) {
- SplashGlyphBitmap glyph;
- SplashCoord xt, yt;
- int x0, y0, xFrac, yFrac;
- SplashClipResult clipRes;
-
- if (debugMode) {
- printf("fillChar: x=%.2f y=%.2f c=%3d=0x%02x='%c'\n",
- (double)x, (double)y, c, c, c);
- }
- transform(state->matrix, x, y, &xt, &yt);
- x0 = splashFloor(xt);
- xFrac = splashFloor((xt - x0) * splashFontFraction);
- y0 = splashFloor(yt);
- yFrac = splashFloor((yt - y0) * splashFontFraction);
- if (!font->getGlyph(c, xFrac, yFrac, &glyph, x0, y0, state->clip, &clipRes)) {
- return splashErrNoGlyph;
- }
- if (clipRes != splashClipAllOutside) {
- fillGlyph2(x0, y0, &glyph, clipRes == splashClipAllInside);
- }
- opClipRes = clipRes;
- if (glyph.freeData) {
- gfree(glyph.data);
- }
- return splashOk;
-}
-
-void Splash::fillGlyph(SplashCoord x, SplashCoord y,
- SplashGlyphBitmap *glyph) {
- SplashCoord xt, yt;
- int x0, y0;
-
- transform(state->matrix, x, y, &xt, &yt);
- x0 = splashFloor(xt);
- y0 = splashFloor(yt);
- SplashClipResult clipRes = state->clip->testRect(x0 - glyph->x,
- y0 - glyph->y,
- x0 - glyph->x + glyph->w - 1,
- y0 - glyph->y + glyph->h - 1);
- if (clipRes != splashClipAllOutside) {
- fillGlyph2(x0, y0, glyph, clipRes == splashClipAllInside);
- }
- opClipRes = clipRes;
-}
-
-void Splash::fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph, GBool noClip) {
- SplashPipe pipe;
- int alpha0, alpha;
- Guchar *p;
- int x1, y1, xx, xx1, yy;
-
- p = glyph->data;
- int xStart = x0 - glyph->x;
- int yStart = y0 - glyph->y;
- int xxLimit = glyph->w;
- int yyLimit = glyph->h;
-
- if (yStart < 0)
- {
- p += glyph->w * -yStart; // move p to the beginning of the first painted row
- yyLimit += yStart;
- yStart = 0;
- }
-
- if (xStart < 0)
- {
- p += -xStart; // move p to the first painted pixel
- xxLimit += xStart;
- xStart = 0;
- }
-
- if (xxLimit + xStart >= bitmap->width) xxLimit = bitmap->width - xStart;
- if (yyLimit + yStart >= bitmap->height) yyLimit = bitmap->height - yStart;
-
- if (noClip) {
- if (glyph->aa) {
- pipeInit(&pipe, xStart, yStart,
- state->fillPattern, NULL, state->fillAlpha, gTrue, gFalse);
- for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
- pipeSetXY(&pipe, xStart, y1);
- for (xx = 0, x1 = xStart; xx < xxLimit; ++xx, ++x1) {
- alpha = p[xx];
- if (alpha != 0) {
- pipe.shape = (SplashCoord)(alpha / 255.0);
- pipeRun(&pipe);
- updateModX(x1);
- updateModY(y1);
- } else {
- pipeIncX(&pipe);
- }
- }
- p += glyph->w;
- }
- } else {
- const int widthEight = (int)ceil(glyph->w / 8.0);
-
- pipeInit(&pipe, xStart, yStart,
- state->fillPattern, NULL, state->fillAlpha, gFalse, gFalse);
- for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
- pipeSetXY(&pipe, xStart, y1);
- for (xx = 0, x1 = xStart; xx < xxLimit; xx += 8) {
- alpha0 = p[xx / 8];
- for (xx1 = 0; xx1 < 8 && xx + xx1 < xxLimit; ++xx1, ++x1) {
- if (alpha0 & 0x80) {
- pipeRun(&pipe);
- updateModX(x1);
- updateModY(y1);
- } else {
- pipeIncX(&pipe);
- }
- alpha0 <<= 1;
- }
- }
- p += widthEight;
- }
- }
- } else {
- if (glyph->aa) {
- pipeInit(&pipe, xStart, yStart,
- state->fillPattern, NULL, state->fillAlpha, gTrue, gFalse);
- for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
- pipeSetXY(&pipe, xStart, y1);
- for (xx = 0, x1 = xStart; xx < xxLimit; ++xx, ++x1) {
- if (state->clip->test(x1, y1)) {
- alpha = p[xx];
- if (alpha != 0) {
- pipe.shape = (SplashCoord)(alpha / 255.0);
- pipeRun(&pipe);
- updateModX(x1);
- updateModY(y1);
- } else {
- pipeIncX(&pipe);
- }
- } else {
- pipeIncX(&pipe);
- }
- }
- p += glyph->w;
- }
- } else {
- const int widthEight = (int)ceil(glyph->w / 8.0);
-
- pipeInit(&pipe, xStart, yStart,
- state->fillPattern, NULL, state->fillAlpha, gFalse, gFalse);
- for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
- pipeSetXY(&pipe, xStart, y1);
- for (xx = 0, x1 = xStart; xx < xxLimit; xx += 8) {
- alpha0 = p[xx / 8];
- for (xx1 = 0; xx1 < 8 && xx + xx1 < xxLimit; ++xx1, ++x1) {
- if (state->clip->test(x1, y1)) {
- if (alpha0 & 0x80) {
- pipeRun(&pipe);
- updateModX(x1);
- updateModY(y1);
- } else {
- pipeIncX(&pipe);
- }
- } else {
- pipeIncX(&pipe);
- }
- alpha0 <<= 1;
- }
- }
- p += widthEight;
- }
- }
- }
-}
-
-SplashError Splash::fillImageMask(SplashImageMaskSource src, void *srcData,
- int w, int h, SplashCoord *mat,
- GBool glyphMode) {
- SplashPipe pipe;
- GBool rot;
- SplashCoord xScale, yScale, xShear, yShear, yShear1;
- int tx, tx2, ty, ty2, scaledWidth, scaledHeight, xSign, ySign;
- int ulx, uly, llx, lly, urx, ury, lrx, lry;
- int ulx1, uly1, llx1, lly1, urx1, ury1, lrx1, lry1;
- int xMin, xMax, yMin, yMax;
- SplashClipResult clipRes, clipRes2;
- int yp, yq, yt, yStep, lastYStep;
- int xp, xq, xt, xStep, xSrc;
- int k1, spanXMin, spanXMax, spanY;
- SplashColorPtr pixBuf, p;
- int pixAcc;
- int x, y, x1, x2, y2;
- SplashCoord y1;
- int n, m, i, j;
-
- if (debugMode) {
- printf("fillImageMask: w=%d h=%d mat=[%.2f %.2f %.2f %.2f %.2f %.2f]\n",
- w, h, (double)mat[0], (double)mat[1], (double)mat[2],
- (double)mat[3], (double)mat[4], (double)mat[5]);
- }
-
- if (w == 0 && h == 0) return splashErrZeroImage;
-
- // check for singular matrix
- if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.000001) {
- return splashErrSingularMatrix;
- }
-
- // compute scale, shear, rotation, translation parameters
- rot = splashAbs(mat[1]) > splashAbs(mat[0]);
- if (rot) {
- xScale = -mat[1];
- yScale = mat[2] - (mat[0] * mat[3]) / mat[1];
- xShear = -mat[3] / yScale;
- yShear = -mat[0] / mat[1];
- } else {
- xScale = mat[0];
- yScale = mat[3] - (mat[1] * mat[2]) / mat[0];
- xShear = mat[2] / yScale;
- yShear = mat[1] / mat[0];
- }
- // Note 1: The PDF spec says that all pixels whose *centers* lie
- // within the region get painted -- but that doesn't seem to match
- // up with what Acrobat actually does: it ends up leaving gaps
- // between image stripes. So we use the same rule here as for
- // fills: any pixel that overlaps the region gets painted.
- // Note 2: The "glyphMode" flag is a kludge: it switches back to
- // "correct" behavior (matching the spec), for use in rendering Type
- // 3 fonts.
- // Note 3: The +/-0.01 in these computations is to avoid floating
- // point precision problems which can lead to gaps between image
- // stripes (it can cause image stripes to overlap, but that's a much
- // less visible problem).
- if (glyphMode) {
- if (xScale >= 0) {
- tx = splashRound(mat[4]);
- tx2 = splashRound(mat[4] + xScale) - 1;
- } else {
- tx = splashRound(mat[4]) - 1;
- tx2 = splashRound(mat[4] + xScale);
- }
- } else {
- if (xScale >= 0) {
- tx = splashFloor(mat[4] - 0.01);
- tx2 = splashFloor(mat[4] + xScale + 0.01);
- } else {
- tx = splashFloor(mat[4] + 0.01);
- tx2 = splashFloor(mat[4] + xScale - 0.01);
- }
- }
- scaledWidth = abs(tx2 - tx) + 1;
- if (glyphMode) {
- if (yScale >= 0) {
- ty = splashRound(mat[5]);
- ty2 = splashRound(mat[5] + yScale) - 1;
- } else {
- ty = splashRound(mat[5]) - 1;
- ty2 = splashRound(mat[5] + yScale);
- }
- } else {
- if (yScale >= 0) {
- ty = splashFloor(mat[5] - 0.01);
- ty2 = splashFloor(mat[5] + yScale + 0.01);
- } else {
- ty = splashFloor(mat[5] + 0.01);
- ty2 = splashFloor(mat[5] + yScale - 0.01);
- }
- }
- scaledHeight = abs(ty2 - ty) + 1;
- xSign = (xScale < 0) ? -1 : 1;
- ySign = (yScale < 0) ? -1 : 1;
- yShear1 = (SplashCoord)xSign * yShear;
-
- // clipping
- ulx1 = 0;
- uly1 = 0;
- urx1 = xSign * (scaledWidth - 1);
- ury1 = (int)(yShear * urx1);
- llx1 = splashRound(xShear * ySign * (scaledHeight - 1));
- lly1 = ySign * (scaledHeight - 1) + (int)(yShear * llx1);
- lrx1 = xSign * (scaledWidth - 1) +
- splashRound(xShear * ySign * (scaledHeight - 1));
- lry1 = ySign * (scaledHeight - 1) + (int)(yShear * lrx1);
- if (rot) {
- ulx = tx + uly1; uly = ty - ulx1;
- urx = tx + ury1; ury = ty - urx1;
- llx = tx + lly1; lly = ty - llx1;
- lrx = tx + lry1; lry = ty - lrx1;
- } else {
- ulx = tx + ulx1; uly = ty + uly1;
- urx = tx + urx1; ury = ty + ury1;
- llx = tx + llx1; lly = ty + lly1;
- lrx = tx + lrx1; lry = ty + lry1;
- }
- xMin = (ulx < urx) ? (ulx < llx) ? (ulx < lrx) ? ulx : lrx
- : (llx < lrx) ? llx : lrx
- : (urx < llx) ? (urx < lrx) ? urx : lrx
- : (llx < lrx) ? llx : lrx;
- xMax = (ulx > urx) ? (ulx > llx) ? (ulx > lrx) ? ulx : lrx
- : (llx > lrx) ? llx : lrx
- : (urx > llx) ? (urx > lrx) ? urx : lrx
- : (llx > lrx) ? llx : lrx;
- yMin = (uly < ury) ? (uly < lly) ? (uly < lry) ? uly : lry
- : (lly < lry) ? lly : lry
- : (ury < lly) ? (ury < lry) ? ury : lry
- : (lly < lry) ? lly : lry;
- yMax = (uly > ury) ? (uly > lly) ? (uly > lry) ? uly : lry
- : (lly > lry) ? lly : lry
- : (ury > lly) ? (ury > lry) ? ury : lry
- : (lly > lry) ? lly : lry;
- clipRes = state->clip->testRect(xMin, yMin, xMax, yMax);
- opClipRes = clipRes;
-
- // compute Bresenham parameters for x and y scaling
- yp = h / scaledHeight;
- yq = h % scaledHeight;
- xp = w / scaledWidth;
- xq = w % scaledWidth;
-
- // allocate pixel buffer
- if (yp < 0 || yp > INT_MAX - 1) {
- return splashErrBadArg;
- }
- pixBuf = (SplashColorPtr)gmallocn(yp + 1, w);
-
- // initialize the pixel pipe
- pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha,
- gTrue, gFalse);
- if (vectorAntialias) {
- drawAAPixelInit();
- }
-
- // init y scale Bresenham
- yt = 0;
- lastYStep = 1;
-
- for (y = 0; y < scaledHeight; ++y) {
-
- // y scale Bresenham
- yStep = yp;
- yt += yq;
- if (yt >= scaledHeight) {
- yt -= scaledHeight;
- ++yStep;
- }
-
- // read row(s) from image
- n = (yp > 0) ? yStep : lastYStep;
- if (n > 0) {
- p = pixBuf;
- for (i = 0; i < n; ++i) {
- (*src)(srcData, p);
- p += w;
- }
- }
- lastYStep = yStep;
-
- // loop-invariant constants
- k1 = splashRound(xShear * ySign * y);
-
- // clipping test
- if (clipRes != splashClipAllInside &&
- !rot &&
- (int)(yShear * k1) ==
- (int)(yShear * (xSign * (scaledWidth - 1) + k1))) {
- if (xSign > 0) {
- spanXMin = tx + k1;
- spanXMax = spanXMin + (scaledWidth - 1);
- } else {
- spanXMax = tx + k1;
- spanXMin = spanXMax - (scaledWidth - 1);
- }
- spanY = ty + ySign * y + (int)(yShear * k1);
- clipRes2 = state->clip->testSpan(spanXMin, spanXMax, spanY);
- if (clipRes2 == splashClipAllOutside) {
- continue;
- }
- } else {
- clipRes2 = clipRes;
- }
-
- // init x scale Bresenham
- xt = 0;
- xSrc = 0;
-
- // x shear
- x1 = k1;
-
- // y shear
- y1 = (SplashCoord)ySign * y + yShear * x1;
- // this is a kludge: if yShear1 is negative, then (int)y1 would
- // change immediately after the first pixel, which is not what we
- // want
- if (yShear1 < 0) {
- y1 += 0.999;
- }
-
- // loop-invariant constants
- n = yStep > 0 ? yStep : 1;
-
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the alpha value for (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- p = pixBuf + xSrc;
- pixAcc = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc += *p++;
- }
- p += w - m;
- }
-
- // blend fill color with background
- if (pixAcc != 0) {
- pipe.shape = (pixAcc == n * m)
- ? (SplashCoord)1
- : (SplashCoord)pixAcc / (SplashCoord)(n * m);
- if (vectorAntialias && clipRes2 != splashClipAllInside) {
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2, clipRes2 == splashClipAllInside);
- }
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- }
-
- // free memory
- gfree(pixBuf);
-
- return splashOk;
-}
-
-SplashError Splash::drawImage(SplashImageSource src, void *srcData,
- SplashColorMode srcMode, GBool srcAlpha,
- int w, int h, SplashCoord *mat) {
- SplashPipe pipe;
- GBool ok, rot;
- SplashCoord xScale, yScale, xShear, yShear, yShear1;
- int tx, tx2, ty, ty2, scaledWidth, scaledHeight, xSign, ySign;
- int ulx, uly, llx, lly, urx, ury, lrx, lry;
- int ulx1, uly1, llx1, lly1, urx1, ury1, lrx1, lry1;
- int xMin, xMax, yMin, yMax;
- SplashClipResult clipRes, clipRes2;
- int yp, yq, yt, yStep, lastYStep;
- int xp, xq, xt, xStep, xSrc;
- int k1, spanXMin, spanXMax, spanY;
- SplashColorPtr colorBuf, p;
- SplashColor pix;
- Guchar *alphaBuf, *q;
-#if SPLASH_CMYK
- int pixAcc0, pixAcc1, pixAcc2, pixAcc3;
-#else
- int pixAcc0, pixAcc1, pixAcc2;
-#endif
- int alphaAcc;
- SplashCoord pixMul, alphaMul, alpha;
- int x, y, x1, x2, y2;
- SplashCoord y1;
- int nComps, n, m, i, j;
-
- if (debugMode) {
- printf("drawImage: srcMode=%d srcAlpha=%d w=%d h=%d mat=[%.2f %.2f %.2f %.2f %.2f %.2f]\n",
- srcMode, srcAlpha, w, h, (double)mat[0], (double)mat[1], (double)mat[2],
- (double)mat[3], (double)mat[4], (double)mat[5]);
- }
-
- // check color modes
- ok = gFalse; // make gcc happy
- nComps = 0; // make gcc happy
- switch (bitmap->mode) {
- case splashModeMono1:
- case splashModeMono8:
- ok = srcMode == splashModeMono8;
- nComps = 1;
- break;
- case splashModeRGB8:
- ok = srcMode == splashModeRGB8;
- nComps = 3;
- break;
- case splashModeBGR8:
- ok = srcMode == splashModeBGR8;
- nComps = 3;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- ok = srcMode == splashModeCMYK8;
- nComps = 4;
- break;
-#endif
- }
- if (!ok) {
- return splashErrModeMismatch;
- }
-
- // check for singular matrix
- if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.000001) {
- return splashErrSingularMatrix;
- }
-
- // compute scale, shear, rotation, translation parameters
- rot = splashAbs(mat[1]) > splashAbs(mat[0]);
- if (rot) {
- xScale = -mat[1];
- yScale = mat[2] - (mat[0] * mat[3]) / mat[1];
- xShear = -mat[3] / yScale;
- yShear = -mat[0] / mat[1];
- } else {
- xScale = mat[0];
- yScale = mat[3] - (mat[1] * mat[2]) / mat[0];
- xShear = mat[2] / yScale;
- yShear = mat[1] / mat[0];
- }
- // Note 1: The PDF spec says that all pixels whose *centers* lie
- // within the region get painted -- but that doesn't seem to match
- // up with what Acrobat actually does: it ends up leaving gaps
- // between image stripes. So we use the same rule here as for
- // fills: any pixel that overlaps the region gets painted.
- // Note 2: The +/-0.01 in these computations is to avoid floating
- // point precision problems which can lead to gaps between image
- // stripes (it can cause image stripes to overlap, but that's a much
- // less visible problem).
- if (xScale >= 0) {
- tx = splashFloor(mat[4] - 0.01);
- tx2 = splashFloor(mat[4] + xScale + 0.01);
- } else {
- tx = splashFloor(mat[4] + 0.01);
- tx2 = splashFloor(mat[4] + xScale - 0.01);
- }
- scaledWidth = abs(tx2 - tx) + 1;
- if (yScale >= 0) {
- ty = splashFloor(mat[5] - 0.01);
- ty2 = splashFloor(mat[5] + yScale + 0.01);
- } else {
- ty = splashFloor(mat[5] + 0.01);
- ty2 = splashFloor(mat[5] + yScale - 0.01);
- }
- scaledHeight = abs(ty2 - ty) + 1;
- xSign = (xScale < 0) ? -1 : 1;
- ySign = (yScale < 0) ? -1 : 1;
- yShear1 = (SplashCoord)xSign * yShear;
-
- // clipping
- ulx1 = 0;
- uly1 = 0;
- urx1 = xSign * (scaledWidth - 1);
- ury1 = (int)(yShear * urx1);
- llx1 = splashRound(xShear * ySign * (scaledHeight - 1));
- lly1 = ySign * (scaledHeight - 1) + (int)(yShear * llx1);
- lrx1 = xSign * (scaledWidth - 1) +
- splashRound(xShear * ySign * (scaledHeight - 1));
- lry1 = ySign * (scaledHeight - 1) + (int)(yShear * lrx1);
- if (rot) {
- ulx = tx + uly1; uly = ty - ulx1;
- urx = tx + ury1; ury = ty - urx1;
- llx = tx + lly1; lly = ty - llx1;
- lrx = tx + lry1; lry = ty - lrx1;
- } else {
- ulx = tx + ulx1; uly = ty + uly1;
- urx = tx + urx1; ury = ty + ury1;
- llx = tx + llx1; lly = ty + lly1;
- lrx = tx + lrx1; lry = ty + lry1;
- }
- xMin = (ulx < urx) ? (ulx < llx) ? (ulx < lrx) ? ulx : lrx
- : (llx < lrx) ? llx : lrx
- : (urx < llx) ? (urx < lrx) ? urx : lrx
- : (llx < lrx) ? llx : lrx;
- xMax = (ulx > urx) ? (ulx > llx) ? (ulx > lrx) ? ulx : lrx
- : (llx > lrx) ? llx : lrx
- : (urx > llx) ? (urx > lrx) ? urx : lrx
- : (llx > lrx) ? llx : lrx;
- yMin = (uly < ury) ? (uly < lly) ? (uly < lry) ? uly : lry
- : (lly < lry) ? lly : lry
- : (ury < lly) ? (ury < lry) ? ury : lry
- : (lly < lry) ? lly : lry;
- yMax = (uly > ury) ? (uly > lly) ? (uly > lry) ? uly : lry
- : (lly > lry) ? lly : lry
- : (ury > lly) ? (ury > lry) ? ury : lry
- : (lly > lry) ? lly : lry;
- clipRes = state->clip->testRect(xMin, yMin, xMax, yMax);
- opClipRes = clipRes;
- if (clipRes == splashClipAllOutside) {
- return splashOk;
- }
-
- // compute Bresenham parameters for x and y scaling
- yp = h / scaledHeight;
- yq = h % scaledHeight;
- xp = w / scaledWidth;
- xq = w % scaledWidth;
-
- // allocate pixel buffers
- if (yp < 0 || yp > INT_MAX - 1 || w > INT_MAX / nComps) {
- return splashErrBadArg;
- }
- colorBuf = (SplashColorPtr)gmallocn(yp + 1, w * nComps);
- if (srcAlpha) {
- alphaBuf = (Guchar *)gmallocn(yp + 1, w);
- } else {
- alphaBuf = NULL;
- }
-
- pixAcc0 = pixAcc1 = pixAcc2 = 0; // make gcc happy
-#if SPLASH_CMYK
- pixAcc3 = 0; // make gcc happy
-#endif
-
- // initialize the pixel pipe
- pipeInit(&pipe, 0, 0, NULL, pix, state->fillAlpha,
- srcAlpha || (vectorAntialias && clipRes != splashClipAllInside),
- gFalse);
- if (vectorAntialias) {
- drawAAPixelInit();
- }
-
- if (srcAlpha) {
-
- // init y scale Bresenham
- yt = 0;
- lastYStep = 1;
-
- for (y = 0; y < scaledHeight; ++y) {
-
- // y scale Bresenham
- yStep = yp;
- yt += yq;
- if (yt >= scaledHeight) {
- yt -= scaledHeight;
- ++yStep;
- }
-
- // read row(s) from image
- n = (yp > 0) ? yStep : lastYStep;
- if (n > 0) {
- p = colorBuf;
- q = alphaBuf;
- for (i = 0; i < n; ++i) {
- (*src)(srcData, p, q);
- p += w * nComps;
- q += w;
- }
- }
- lastYStep = yStep;
-
- // loop-invariant constants
- k1 = splashRound(xShear * ySign * y);
-
- // clipping test
- if (clipRes != splashClipAllInside &&
- !rot &&
- (int)(yShear * k1) ==
- (int)(yShear * (xSign * (scaledWidth - 1) + k1))) {
- if (xSign > 0) {
- spanXMin = tx + k1;
- spanXMax = spanXMin + (scaledWidth - 1);
- } else {
- spanXMax = tx + k1;
- spanXMin = spanXMax - (scaledWidth - 1);
- }
- spanY = ty + ySign * y + (int)(yShear * k1);
- clipRes2 = state->clip->testSpan(spanXMin, spanXMax, spanY);
- if (clipRes2 == splashClipAllOutside) {
- continue;
- }
- } else {
- clipRes2 = clipRes;
- }
-
- // init x scale Bresenham
- xt = 0;
- xSrc = 0;
-
- // x shear
- x1 = k1;
-
- // y shear
- y1 = (SplashCoord)ySign * y + yShear * x1;
- // this is a kludge: if yShear1 is negative, then (int)y1 would
- // change immediately after the first pixel, which is not what
- // we want
- if (yShear1 < 0) {
- y1 += 0.999;
- }
-
- // loop-invariant constants
- n = yStep > 0 ? yStep : 1;
-
- switch (srcMode) {
-
- case splashModeMono1:
- case splashModeMono8:
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the filtered pixel at (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- alphaAcc = 0;
- p = colorBuf + xSrc;
- q = alphaBuf + xSrc;
- pixAcc0 = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc0 += *p++;
- alphaAcc += *q++;
- }
- p += w - m;
- q += w - m;
- }
- pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
- alphaMul = pixMul * (1.0 / 255.0);
- alpha = (SplashCoord)alphaAcc * alphaMul;
-
- if (alpha > 0) {
- pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
-
- // set pixel
- pipe.shape = alpha;
- if (vectorAntialias && clipRes != splashClipAllInside) {
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2,
- clipRes2 == splashClipAllInside);
- }
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- break;
-
- case splashModeRGB8:
- case splashModeBGR8:
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the filtered pixel at (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- alphaAcc = 0;
- p = colorBuf + xSrc * 3;
- q = alphaBuf + xSrc;
- pixAcc0 = pixAcc1 = pixAcc2 = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc0 += *p++;
- pixAcc1 += *p++;
- pixAcc2 += *p++;
- alphaAcc += *q++;
- }
- p += 3 * (w - m);
- q += w - m;
- }
- pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
- alphaMul = pixMul * (1.0 / 255.0);
- alpha = (SplashCoord)alphaAcc * alphaMul;
-
- if (alpha > 0) {
- pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
- pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
- pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
-
- // set pixel
- pipe.shape = alpha;
- if (vectorAntialias && clipRes != splashClipAllInside) {
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2,
- clipRes2 == splashClipAllInside);
- }
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- break;
-
-#if SPLASH_CMYK
- case splashModeCMYK8:
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the filtered pixel at (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- alphaAcc = 0;
- p = colorBuf + xSrc * 4;
- q = alphaBuf + xSrc;
- pixAcc0 = pixAcc1 = pixAcc2 = pixAcc3 = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc0 += *p++;
- pixAcc1 += *p++;
- pixAcc2 += *p++;
- pixAcc3 += *p++;
- alphaAcc += *q++;
- }
- p += 4 * (w - m);
- q += w - m;
- }
- pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
- alphaMul = pixMul * (1.0 / 255.0);
- alpha = (SplashCoord)alphaAcc * alphaMul;
-
- if (alpha > 0) {
- pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
- pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
- pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
- pix[3] = (int)((SplashCoord)pixAcc3 * pixMul);
-
- // set pixel
- pipe.shape = alpha;
- if (vectorAntialias && clipRes != splashClipAllInside) {
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2,
- clipRes2 == splashClipAllInside);
- }
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- break;
-#endif // SPLASH_CMYK
- }
- }
-
- } else {
-
- // init y scale Bresenham
- yt = 0;
- lastYStep = 1;
-
- for (y = 0; y < scaledHeight; ++y) {
-
- // y scale Bresenham
- yStep = yp;
- yt += yq;
- if (yt >= scaledHeight) {
- yt -= scaledHeight;
- ++yStep;
- }
-
- // read row(s) from image
- n = (yp > 0) ? yStep : lastYStep;
- if (n > 0) {
- p = colorBuf;
- for (i = 0; i < n; ++i) {
- (*src)(srcData, p, NULL);
- p += w * nComps;
- }
- }
- lastYStep = yStep;
-
- // loop-invariant constants
- k1 = splashRound(xShear * ySign * y);
-
- // clipping test
- if (clipRes != splashClipAllInside &&
- !rot &&
- (int)(yShear * k1) ==
- (int)(yShear * (xSign * (scaledWidth - 1) + k1))) {
- if (xSign > 0) {
- spanXMin = tx + k1;
- spanXMax = spanXMin + (scaledWidth - 1);
- } else {
- spanXMax = tx + k1;
- spanXMin = spanXMax - (scaledWidth - 1);
- }
- spanY = ty + ySign * y + (int)(yShear * k1);
- clipRes2 = state->clip->testSpan(spanXMin, spanXMax, spanY);
- if (clipRes2 == splashClipAllOutside) {
- continue;
- }
- } else {
- clipRes2 = clipRes;
- }
-
- // init x scale Bresenham
- xt = 0;
- xSrc = 0;
-
- // x shear
- x1 = k1;
-
- // y shear
- y1 = (SplashCoord)ySign * y + yShear * x1;
- // this is a kludge: if yShear1 is negative, then (int)y1 would
- // change immediately after the first pixel, which is not what
- // we want
- if (yShear1 < 0) {
- y1 += 0.999;
- }
-
- // loop-invariant constants
- n = yStep > 0 ? yStep : 1;
-
- switch (srcMode) {
-
- case splashModeMono1:
- case splashModeMono8:
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the filtered pixel at (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- p = colorBuf + xSrc;
- pixAcc0 = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc0 += *p++;
- }
- p += w - m;
- }
- pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
-
- pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
-
- // set pixel
- if (vectorAntialias && clipRes != splashClipAllInside) {
- pipe.shape = (SplashCoord)1;
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2,
- clipRes2 == splashClipAllInside);
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- break;
-
- case splashModeRGB8:
- case splashModeBGR8:
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the filtered pixel at (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- p = colorBuf + xSrc * 3;
- pixAcc0 = pixAcc1 = pixAcc2 = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc0 += *p++;
- pixAcc1 += *p++;
- pixAcc2 += *p++;
- }
- p += 3 * (w - m);
- }
- pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
-
- pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
- pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
- pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
-
- // set pixel
- if (vectorAntialias && clipRes != splashClipAllInside) {
- pipe.shape = (SplashCoord)1;
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2,
- clipRes2 == splashClipAllInside);
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- break;
-
-#if SPLASH_CMYK
- case splashModeCMYK8:
- for (x = 0; x < scaledWidth; ++x) {
-
- // x scale Bresenham
- xStep = xp;
- xt += xq;
- if (xt >= scaledWidth) {
- xt -= scaledWidth;
- ++xStep;
- }
-
- // rotation
- if (rot) {
- x2 = (int)y1;
- y2 = -x1;
- } else {
- x2 = x1;
- y2 = (int)y1;
- }
-
- // compute the filtered pixel at (x,y) after the x and y scaling
- // operations
- m = xStep > 0 ? xStep : 1;
- p = colorBuf + xSrc * 4;
- pixAcc0 = pixAcc1 = pixAcc2 = pixAcc3 = 0;
- for (i = 0; i < n; ++i) {
- for (j = 0; j < m; ++j) {
- pixAcc0 += *p++;
- pixAcc1 += *p++;
- pixAcc2 += *p++;
- pixAcc3 += *p++;
- }
- p += 4 * (w - m);
- }
- pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
-
- pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
- pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
- pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
- pix[3] = (int)((SplashCoord)pixAcc3 * pixMul);
-
- // set pixel
- if (vectorAntialias && clipRes != splashClipAllInside) {
- pipe.shape = (SplashCoord)1;
- drawAAPixel(&pipe, tx + x2, ty + y2);
- } else {
- drawPixel(&pipe, tx + x2, ty + y2,
- clipRes2 == splashClipAllInside);
- }
-
- // x scale Bresenham
- xSrc += xStep;
-
- // x shear
- x1 += xSign;
-
- // y shear
- y1 += yShear1;
- }
- break;
-#endif // SPLASH_CMYK
- }
- }
-
- }
-
- gfree(colorBuf);
- gfree(alphaBuf);
-
- return splashOk;
-}
-
-SplashError Splash::composite(SplashBitmap *src, int xSrc, int ySrc,
- int xDest, int yDest, int w, int h,
- GBool noClip, GBool nonIsolated) {
- SplashPipe pipe;
- SplashColor pixel;
- Guchar alpha;
- Guchar *ap;
- int x, y;
-
- if (src->mode != bitmap->mode) {
- return splashErrModeMismatch;
- }
-
- if (src->alpha) {
- pipeInit(&pipe, xDest, yDest, NULL, pixel, state->fillAlpha,
- gTrue, nonIsolated);
- for (y = 0; y < h; ++y) {
- pipeSetXY(&pipe, xDest, yDest + y);
- ap = src->getAlphaPtr() + (ySrc + y) * src->getWidth() + xSrc;
- for (x = 0; x < w; ++x) {
- src->getPixel(xSrc + x, ySrc + y, pixel);
- alpha = *ap++;
- if (noClip || state->clip->test(xDest + x, yDest + y)) {
- // this uses shape instead of alpha, which isn't technically
- // correct, but works out the same
- pipe.shape = (SplashCoord)(alpha / 255.0);
- pipeRun(&pipe);
- updateModX(xDest + x);
- updateModY(yDest + y);
- } else {
- pipeIncX(&pipe);
- }
- }
- }
- } else {
- pipeInit(&pipe, xDest, yDest, NULL, pixel, state->fillAlpha,
- gFalse, nonIsolated);
- for (y = 0; y < h; ++y) {
- pipeSetXY(&pipe, xDest, yDest + y);
- for (x = 0; x < w; ++x) {
- src->getPixel(xSrc + x, ySrc + y, pixel);
- if (noClip || state->clip->test(xDest + x, yDest + y)) {
- pipeRun(&pipe);
- updateModX(xDest + x);
- updateModY(yDest + y);
- } else {
- pipeIncX(&pipe);
- }
- }
- }
- }
-
- return splashOk;
-}
-
-void Splash::compositeBackground(SplashColorPtr color) {
- SplashColorPtr p;
- Guchar *q;
- Guchar alpha, alpha1, c, color0, color1, color2, color3;
- int x, y, mask;
-
- switch (bitmap->mode) {
- case splashModeMono1:
- color0 = color[0];
- for (y = 0; y < bitmap->height; ++y) {
- p = &bitmap->data[y * bitmap->rowSize];
- q = &bitmap->alpha[y * bitmap->width];
- mask = 0x80;
- for (x = 0; x < bitmap->width; ++x) {
- alpha = *q++;
- alpha1 = 255 - alpha;
- c = (*p & mask) ? 0xff : 0x00;
- c = div255(alpha1 * color0 + alpha * c);
- if (c & 0x80) {
- *p |= mask;
- } else {
- *p &= ~mask;
- }
- if (!(mask >>= 1)) {
- mask = 0x80;
- ++p;
- }
- }
- }
- break;
- case splashModeMono8:
- color0 = color[0];
- for (y = 0; y < bitmap->height; ++y) {
- p = &bitmap->data[y * bitmap->rowSize];
- q = &bitmap->alpha[y * bitmap->width];
- for (x = 0; x < bitmap->width; ++x) {
- alpha = *q++;
- alpha1 = 255 - alpha;
- p[0] = div255(alpha1 * color0 + alpha * p[0]);
- ++p;
- }
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- color0 = color[0];
- color1 = color[1];
- color2 = color[2];
- for (y = 0; y < bitmap->height; ++y) {
- p = &bitmap->data[y * bitmap->rowSize];
- q = &bitmap->alpha[y * bitmap->width];
- for (x = 0; x < bitmap->width; ++x) {
- alpha = *q++;
- alpha1 = 255 - alpha;
- p[0] = div255(alpha1 * color0 + alpha * p[0]);
- p[1] = div255(alpha1 * color1 + alpha * p[1]);
- p[2] = div255(alpha1 * color2 + alpha * p[2]);
- p += 3;
- }
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- color0 = color[0];
- color1 = color[1];
- color2 = color[2];
- color3 = color[3];
- for (y = 0; y < bitmap->height; ++y) {
- p = &bitmap->data[y * bitmap->rowSize];
- q = &bitmap->alpha[y * bitmap->width];
- for (x = 0; x < bitmap->width; ++x) {
- alpha = *q++;
- alpha1 = 255 - alpha;
- p[0] = div255(alpha1 * color0 + alpha * p[0]);
- p[1] = div255(alpha1 * color1 + alpha * p[1]);
- p[2] = div255(alpha1 * color2 + alpha * p[2]);
- p[3] = div255(alpha1 * color3 + alpha * p[3]);
- p += 4;
- }
- }
- break;
-#endif
- }
- memset(bitmap->alpha, 255, bitmap->width * bitmap->height);
-}
-
-SplashError Splash::blitTransparent(SplashBitmap *src, int xSrc, int ySrc,
- int xDest, int yDest, int w, int h) {
- SplashColor pixel;
- SplashColorPtr p;
- Guchar *q;
- int x, y, mask;
-
- if (src->mode != bitmap->mode) {
- return splashErrModeMismatch;
- }
-
- switch (bitmap->mode) {
- case splashModeMono1:
- for (y = 0; y < h; ++y) {
- p = &bitmap->data[(yDest + y) * bitmap->rowSize + (xDest >> 3)];
- mask = 0x80 >> (xDest & 7);
- for (x = 0; x < w; ++x) {
- src->getPixel(xSrc + x, ySrc + y, pixel);
- if (pixel[0]) {
- *p |= mask;
- } else {
- *p &= ~mask;
- }
- if (!(mask >>= 1)) {
- mask = 0x80;
- ++p;
- }
- }
- }
- break;
- case splashModeMono8:
- for (y = 0; y < h; ++y) {
- p = &bitmap->data[(yDest + y) * bitmap->rowSize + xDest];
- for (x = 0; x < w; ++x) {
- src->getPixel(xSrc + x, ySrc + y, pixel);
- *p++ = pixel[0];
- }
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- for (y = 0; y < h; ++y) {
- p = &bitmap->data[(yDest + y) * bitmap->rowSize + 3 * xDest];
- for (x = 0; x < w; ++x) {
- src->getPixel(xSrc + x, ySrc + y, pixel);
- *p++ = pixel[0];
- *p++ = pixel[1];
- *p++ = pixel[2];
- }
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- for (y = 0; y < h; ++y) {
- p = &bitmap->data[(yDest + y) * bitmap->rowSize + 4 * xDest];
- for (x = 0; x < w; ++x) {
- src->getPixel(xSrc + x, ySrc + y, pixel);
- *p++ = pixel[0];
- *p++ = pixel[1];
- *p++ = pixel[2];
- *p++ = pixel[3];
- }
- }
- break;
-#endif
- }
-
- if (bitmap->alpha) {
- for (y = 0; y < h; ++y) {
- q = &bitmap->alpha[(yDest + y) * bitmap->width + xDest];
- for (x = 0; x < w; ++x) {
- *q++ = 0x00;
- }
- }
- }
-
- return splashOk;
-}
-
-SplashPath *Splash::makeStrokePath(SplashPath *path, GBool flatten) {
- SplashPath *pathIn, *pathOut;
- SplashCoord w, d, dx, dy, wdx, wdy, dxNext, dyNext, wdxNext, wdyNext;
- SplashCoord crossprod, dotprod, miter, m;
- GBool first, last, closed;
- int subpathStart, next, i;
- int left0, left1, left2, right0, right1, right2, join0, join1, join2;
- int leftFirst, rightFirst, firstPt;
-
- if (flatten) {
- pathIn = flattenPath(path, state->matrix, state->flatness);
- if (state->lineDashLength > 0) {
- pathOut = makeDashedPath(pathIn);
- delete pathIn;
- pathIn = pathOut;
- }
- } else {
- pathIn = path;
- }
-
- subpathStart = 0; // make gcc happy
- closed = gFalse; // make gcc happy
- left0 = left1 = right0 = right1 = join0 = join1 = 0; // make gcc happy
- leftFirst = rightFirst = firstPt = 0; // make gcc happy
-
- pathOut = new SplashPath();
- w = state->lineWidth;
-
- for (i = 0; i < pathIn->length - 1; ++i) {
- if (pathIn->flags[i] & splashPathLast) {
- continue;
- }
- if ((first = pathIn->flags[i] & splashPathFirst)) {
- subpathStart = i;
- closed = pathIn->flags[i] & splashPathClosed;
- }
- last = pathIn->flags[i+1] & splashPathLast;
-
- // compute the deltas for segment (i, i+1)
- d = splashDist(pathIn->pts[i].x, pathIn->pts[i].y,
- pathIn->pts[i+1].x, pathIn->pts[i+1].y);
- if (d == 0) {
- // we need to draw end caps on zero-length lines
- //~ not clear what the behavior should be for splashLineCapButt
- //~ with d==0
- dx = 0;
- dy = 1;
- } else {
- d = (SplashCoord)1 / d;
- dx = d * (pathIn->pts[i+1].x - pathIn->pts[i].x);
- dy = d * (pathIn->pts[i+1].y - pathIn->pts[i].y);
- }
- wdx = (SplashCoord)0.5 * w * dx;
- wdy = (SplashCoord)0.5 * w * dy;
-
- // compute the deltas for segment (i+1, next)
- next = last ? subpathStart + 1 : i + 2;
- d = splashDist(pathIn->pts[i+1].x, pathIn->pts[i+1].y,
- pathIn->pts[next].x, pathIn->pts[next].y);
- if (d == 0) {
- // we need to draw end caps on zero-length lines
- //~ not clear what the behavior should be for splashLineCapButt
- //~ with d==0
- dxNext = 0;
- dyNext = 1;
- } else {
- d = (SplashCoord)1 / d;
- dxNext = d * (pathIn->pts[next].x - pathIn->pts[i+1].x);
- dyNext = d * (pathIn->pts[next].y - pathIn->pts[i+1].y);
- }
- wdxNext = (SplashCoord)0.5 * w * dxNext;
- wdyNext = (SplashCoord)0.5 * w * dyNext;
-
- // draw the start cap
- pathOut->moveTo(pathIn->pts[i].x - wdy, pathIn->pts[i].y + wdx);
- if (i == subpathStart) {
- firstPt = pathOut->length - 1;
- }
- if (first && !closed) {
- switch (state->lineCap) {
- case splashLineCapButt:
- pathOut->lineTo(pathIn->pts[i].x + wdy, pathIn->pts[i].y - wdx);
- break;
- case splashLineCapRound:
- pathOut->curveTo(pathIn->pts[i].x - wdy - bezierCircle * wdx,
- pathIn->pts[i].y + wdx - bezierCircle * wdy,
- pathIn->pts[i].x - wdx - bezierCircle * wdy,
- pathIn->pts[i].y - wdy + bezierCircle * wdx,
- pathIn->pts[i].x - wdx,
- pathIn->pts[i].y - wdy);
- pathOut->curveTo(pathIn->pts[i].x - wdx + bezierCircle * wdy,
- pathIn->pts[i].y - wdy - bezierCircle * wdx,
- pathIn->pts[i].x + wdy - bezierCircle * wdx,
- pathIn->pts[i].y - wdx - bezierCircle * wdy,
- pathIn->pts[i].x + wdy,
- pathIn->pts[i].y - wdx);
- break;
- case splashLineCapProjecting:
- pathOut->lineTo(pathIn->pts[i].x - wdx - wdy,
- pathIn->pts[i].y + wdx - wdy);
- pathOut->lineTo(pathIn->pts[i].x - wdx + wdy,
- pathIn->pts[i].y - wdx - wdy);
- pathOut->lineTo(pathIn->pts[i].x + wdy,
- pathIn->pts[i].y - wdx);
- break;
- }
- } else {
- pathOut->lineTo(pathIn->pts[i].x + wdy, pathIn->pts[i].y - wdx);
- }
-
- // draw the left side of the segment rectangle
- left2 = pathOut->length - 1;
- pathOut->lineTo(pathIn->pts[i+1].x + wdy, pathIn->pts[i+1].y - wdx);
-
- // draw the end cap
- if (last && !closed) {
- switch (state->lineCap) {
- case splashLineCapButt:
- pathOut->lineTo(pathIn->pts[i+1].x - wdy, pathIn->pts[i+1].y + wdx);
- break;
- case splashLineCapRound:
- pathOut->curveTo(pathIn->pts[i+1].x + wdy + bezierCircle * wdx,
- pathIn->pts[i+1].y - wdx + bezierCircle * wdy,
- pathIn->pts[i+1].x + wdx + bezierCircle * wdy,
- pathIn->pts[i+1].y + wdy - bezierCircle * wdx,
- pathIn->pts[i+1].x + wdx,
- pathIn->pts[i+1].y + wdy);
- pathOut->curveTo(pathIn->pts[i+1].x + wdx - bezierCircle * wdy,
- pathIn->pts[i+1].y + wdy + bezierCircle * wdx,
- pathIn->pts[i+1].x - wdy + bezierCircle * wdx,
- pathIn->pts[i+1].y + wdx + bezierCircle * wdy,
- pathIn->pts[i+1].x - wdy,
- pathIn->pts[i+1].y + wdx);
- break;
- case splashLineCapProjecting:
- pathOut->lineTo(pathIn->pts[i+1].x + wdy + wdx,
- pathIn->pts[i+1].y - wdx + wdy);
- pathOut->lineTo(pathIn->pts[i+1].x - wdy + wdx,
- pathIn->pts[i+1].y + wdx + wdy);
- pathOut->lineTo(pathIn->pts[i+1].x - wdy,
- pathIn->pts[i+1].y + wdx);
- break;
- }
- } else {
- pathOut->lineTo(pathIn->pts[i+1].x - wdy, pathIn->pts[i+1].y + wdx);
- }
-
- // draw the right side of the segment rectangle
- right2 = pathOut->length - 1;
- pathOut->close();
-
- // draw the join
- join2 = pathOut->length;
- if (!last || closed) {
- crossprod = dx * dyNext - dy * dxNext;
- dotprod = -(dx * dxNext + dy * dyNext);
- if (dotprod > 0.99999) {
- // avoid a divide-by-zero -- set miter to something arbitrary
- // such that sqrt(miter) will exceed miterLimit (and m is never
- // used in that situation)
- miter = (state->miterLimit + 1) * (state->miterLimit + 1);
- m = 0;
- } else {
- miter = (SplashCoord)2 / ((SplashCoord)1 - dotprod);
- if (miter < 1) {
- // this can happen because of floating point inaccuracies
- miter = 1;
- }
- m = splashSqrt(miter - 1);
- }
-
- // round join
- if (state->lineJoin == splashLineJoinRound) {
- pathOut->moveTo(pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y);
- pathOut->curveTo(pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y + bezierCircle2 * w,
- pathIn->pts[i+1].x + bezierCircle2 * w,
- pathIn->pts[i+1].y + (SplashCoord)0.5 * w,
- pathIn->pts[i+1].x,
- pathIn->pts[i+1].y + (SplashCoord)0.5 * w);
- pathOut->curveTo(pathIn->pts[i+1].x - bezierCircle2 * w,
- pathIn->pts[i+1].y + (SplashCoord)0.5 * w,
- pathIn->pts[i+1].x - (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y + bezierCircle2 * w,
- pathIn->pts[i+1].x - (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y);
- pathOut->curveTo(pathIn->pts[i+1].x - (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y - bezierCircle2 * w,
- pathIn->pts[i+1].x - bezierCircle2 * w,
- pathIn->pts[i+1].y - (SplashCoord)0.5 * w,
- pathIn->pts[i+1].x,
- pathIn->pts[i+1].y - (SplashCoord)0.5 * w);
- pathOut->curveTo(pathIn->pts[i+1].x + bezierCircle2 * w,
- pathIn->pts[i+1].y - (SplashCoord)0.5 * w,
- pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y - bezierCircle2 * w,
- pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
- pathIn->pts[i+1].y);
-
- } else {
- pathOut->moveTo(pathIn->pts[i+1].x, pathIn->pts[i+1].y);
-
- // angle < 180
- if (crossprod < 0) {
- pathOut->lineTo(pathIn->pts[i+1].x - wdyNext,
- pathIn->pts[i+1].y + wdxNext);
- // miter join inside limit
- if (state->lineJoin == splashLineJoinMiter &&
- splashSqrt(miter) <= state->miterLimit) {
- pathOut->lineTo(pathIn->pts[i+1].x - wdy + wdx * m,
- pathIn->pts[i+1].y + wdx + wdy * m);
- pathOut->lineTo(pathIn->pts[i+1].x - wdy,
- pathIn->pts[i+1].y + wdx);
- // bevel join or miter join outside limit
- } else {
- pathOut->lineTo(pathIn->pts[i+1].x - wdy, pathIn->pts[i+1].y + wdx);
- }
-
- // angle >= 180
- } else {
- pathOut->lineTo(pathIn->pts[i+1].x + wdy,
- pathIn->pts[i+1].y - wdx);
- // miter join inside limit
- if (state->lineJoin == splashLineJoinMiter &&
- splashSqrt(miter) <= state->miterLimit) {
- pathOut->lineTo(pathIn->pts[i+1].x + wdy + wdx * m,
- pathIn->pts[i+1].y - wdx + wdy * m);
- pathOut->lineTo(pathIn->pts[i+1].x + wdyNext,
- pathIn->pts[i+1].y - wdxNext);
- // bevel join or miter join outside limit
- } else {
- pathOut->lineTo(pathIn->pts[i+1].x + wdyNext,
- pathIn->pts[i+1].y - wdxNext);
- }
- }
- }
-
- pathOut->close();
- }
-
- // add stroke adjustment hints
- if (state->strokeAdjust) {
- if (i >= subpathStart + 1) {
- if (i >= subpathStart + 2) {
- pathOut->addStrokeAdjustHint(left1, right1, left0 + 1, right0);
- pathOut->addStrokeAdjustHint(left1, right1, join0, left2);
- } else {
- pathOut->addStrokeAdjustHint(left1, right1, firstPt, left2);
- }
- pathOut->addStrokeAdjustHint(left1, right1, right2 + 1, right2 + 1);
- }
- left0 = left1;
- left1 = left2;
- right0 = right1;
- right1 = right2;
- join0 = join1;
- join1 = join2;
- if (i == subpathStart) {
- leftFirst = left2;
- rightFirst = right2;
- }
- if (last) {
- if (i >= subpathStart + 2) {
- pathOut->addStrokeAdjustHint(left1, right1, left0 + 1, right0);
- pathOut->addStrokeAdjustHint(left1, right1,
- join0, pathOut->length - 1);
- } else {
- pathOut->addStrokeAdjustHint(left1, right1,
- firstPt, pathOut->length - 1);
- }
- if (closed) {
- pathOut->addStrokeAdjustHint(left1, right1, firstPt, leftFirst);
- pathOut->addStrokeAdjustHint(left1, right1,
- rightFirst + 1, rightFirst + 1);
- pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
- left1 + 1, right1);
- pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
- join1, pathOut->length - 1);
- }
- }
- }
- }
-
- if (pathIn != path) {
- delete pathIn;
- }
-
- return pathOut;
-}
-
-void Splash::dumpPath(SplashPath *path) {
- int i;
-
- for (i = 0; i < path->length; ++i) {
- printf(" %3d: x=%8.2f y=%8.2f%s%s%s%s\n",
- i, (double)path->pts[i].x, (double)path->pts[i].y,
- (path->flags[i] & splashPathFirst) ? " first" : "",
- (path->flags[i] & splashPathLast) ? " last" : "",
- (path->flags[i] & splashPathClosed) ? " closed" : "",
- (path->flags[i] & splashPathCurve) ? " curve" : "");
- }
-}
-
-void Splash::dumpXPath(SplashXPath *path) {
- int i;
-
- for (i = 0; i < path->length; ++i) {
- printf(" %4d: x0=%8.2f y0=%8.2f x1=%8.2f y1=%8.2f %s%s%s%s%s%s%s\n",
- i, (double)path->segs[i].x0, (double)path->segs[i].y0,
- (double)path->segs[i].x1, (double)path->segs[i].y1,
- (path->segs[i].flags & splashXPathFirst) ? "F" : " ",
- (path->segs[i].flags & splashXPathLast) ? "L" : " ",
- (path->segs[i].flags & splashXPathEnd0) ? "0" : " ",
- (path->segs[i].flags & splashXPathEnd1) ? "1" : " ",
- (path->segs[i].flags & splashXPathHoriz) ? "H" : " ",
- (path->segs[i].flags & splashXPathVert) ? "V" : " ",
- (path->segs[i].flags & splashXPathFlip) ? "P" : " ");
- }
-}
diff --git a/kpdf/xpdf/splash/Splash.cpp b/kpdf/xpdf/splash/Splash.cpp
new file mode 100644
index 00000000..2cfc1ee2
--- /dev/null
+++ b/kpdf/xpdf/splash/Splash.cpp
@@ -0,0 +1,3347 @@
+//========================================================================
+//
+// Splash.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include "gmem.h"
+#include "SplashErrorCodes.h"
+#include "SplashMath.h"
+#include "SplashBitmap.h"
+#include "SplashState.h"
+#include "SplashPath.h"
+#include "SplashXPath.h"
+#include "SplashXPathScanner.h"
+#include "SplashPattern.h"
+#include "SplashScreen.h"
+#include "SplashFont.h"
+#include "SplashGlyphBitmap.h"
+#include "Splash.h"
+
+//------------------------------------------------------------------------
+
+// distance of Bezier control point from center for circle approximation
+// = (4 * (sqrt(2) - 1) / 3) * r
+#define bezierCircle ((SplashCoord)0.55228475)
+#define bezierCircle2 ((SplashCoord)(0.5 * 0.55228475))
+
+// Divide a 16-bit value (in [0, 255*255]) by 255, returning an 8-bit result.
+static inline Guchar div255(int x) {
+ return (Guchar)((x + (x >> 8) + 0x80) >> 8);
+}
+
+//------------------------------------------------------------------------
+// SplashPipe
+//------------------------------------------------------------------------
+
+#define splashPipeMaxStages 9
+
+struct SplashPipe {
+ // pixel coordinates
+ int x, y;
+
+ // source pattern
+ SplashPattern *pattern;
+
+ // source alpha and color
+ SplashCoord aInput;
+ GBool usesShape;
+ Guchar aSrc;
+ SplashColorPtr cSrc;
+ SplashColor cSrcVal;
+
+ // non-isolated group alpha0
+ Guchar *alpha0Ptr;
+
+ // soft mask
+ SplashColorPtr softMaskPtr;
+
+ // destination alpha and color
+ SplashColorPtr destColorPtr;
+ int destColorMask;
+ Guchar *destAlphaPtr;
+
+ // shape
+ SplashCoord shape;
+
+ // result alpha and color
+ GBool noTransparency;
+ SplashPipeResultColorCtrl resultColorCtrl;
+
+ // non-isolated group correction
+ int nonIsolatedGroup;
+};
+
+SplashPipeResultColorCtrl Splash::pipeResultColorNoAlphaBlend[] = {
+ splashPipeResultColorNoAlphaBlendMono,
+ splashPipeResultColorNoAlphaBlendMono,
+ splashPipeResultColorNoAlphaBlendRGB,
+ splashPipeResultColorNoAlphaBlendRGB
+#if SPLASH_CMYK
+ ,
+ splashPipeResultColorNoAlphaBlendCMYK
+#endif
+};
+
+SplashPipeResultColorCtrl Splash::pipeResultColorAlphaNoBlend[] = {
+ splashPipeResultColorAlphaNoBlendMono,
+ splashPipeResultColorAlphaNoBlendMono,
+ splashPipeResultColorAlphaNoBlendRGB,
+ splashPipeResultColorAlphaNoBlendRGB
+#if SPLASH_CMYK
+ ,
+ splashPipeResultColorAlphaNoBlendCMYK
+#endif
+};
+
+SplashPipeResultColorCtrl Splash::pipeResultColorAlphaBlend[] = {
+ splashPipeResultColorAlphaBlendMono,
+ splashPipeResultColorAlphaBlendMono,
+ splashPipeResultColorAlphaBlendRGB,
+ splashPipeResultColorAlphaBlendRGB
+#if SPLASH_CMYK
+ ,
+ splashPipeResultColorAlphaBlendCMYK
+#endif
+};
+
+//------------------------------------------------------------------------
+
+static void blendXor(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = src[i] ^ dest[i];
+ }
+}
+
+//------------------------------------------------------------------------
+// modified region
+//------------------------------------------------------------------------
+
+void Splash::clearModRegion() {
+ modXMin = bitmap->getWidth();
+ modYMin = bitmap->getHeight();
+ modXMax = -1;
+ modYMax = -1;
+}
+
+inline void Splash::updateModX(int x) {
+ if (x < modXMin) {
+ modXMin = x;
+ }
+ if (x > modXMax) {
+ modXMax = x;
+ }
+}
+
+inline void Splash::updateModY(int y) {
+ if (y < modYMin) {
+ modYMin = y;
+ }
+ if (y > modYMax) {
+ modYMax = y;
+ }
+}
+
+//------------------------------------------------------------------------
+// pipeline
+//------------------------------------------------------------------------
+
+inline void Splash::pipeInit(SplashPipe *pipe, int x, int y,
+ SplashPattern *pattern, SplashColorPtr cSrc,
+ SplashCoord aInput, GBool usesShape,
+ GBool nonIsolatedGroup) {
+ pipeSetXY(pipe, x, y);
+ pipe->pattern = NULL;
+
+ // source color
+ if (pattern) {
+ if (pattern->isStatic()) {
+ pattern->getColor(x, y, pipe->cSrcVal);
+ } else {
+ pipe->pattern = pattern;
+ }
+ pipe->cSrc = pipe->cSrcVal;
+ } else {
+ pipe->cSrc = cSrc;
+ }
+
+ // source alpha
+ pipe->aInput = aInput;
+ if (!state->softMask) {
+ if (usesShape) {
+ pipe->aInput *= 255;
+ } else {
+ pipe->aSrc = (Guchar)splashRound(pipe->aInput * 255);
+ }
+ }
+ pipe->usesShape = usesShape;
+
+ // result alpha
+ if (aInput == 1 && !state->softMask && !usesShape &&
+ !state->inNonIsolatedGroup) {
+ pipe->noTransparency = gTrue;
+ } else {
+ pipe->noTransparency = gFalse;
+ }
+
+ // result color
+ if (pipe->noTransparency) {
+ // the !state->blendFunc case is handled separately in pipeRun
+ pipe->resultColorCtrl = pipeResultColorNoAlphaBlend[bitmap->mode];
+ } else if (!state->blendFunc) {
+ pipe->resultColorCtrl = pipeResultColorAlphaNoBlend[bitmap->mode];
+ } else {
+ pipe->resultColorCtrl = pipeResultColorAlphaBlend[bitmap->mode];
+ }
+
+ // non-isolated group correction
+ if (nonIsolatedGroup) {
+ pipe->nonIsolatedGroup = splashColorModeNComps[bitmap->mode];
+ } else {
+ pipe->nonIsolatedGroup = 0;
+ }
+}
+
+inline void Splash::pipeRun(SplashPipe *pipe) {
+ Guchar aSrc, aDest, alpha2, alpha0, aResult;
+ SplashColor cDest, cBlend;
+ Guchar cResult0, cResult1, cResult2, cResult3;
+
+ //----- source color
+
+ // static pattern: handled in pipeInit
+ // fixed color: handled in pipeInit
+
+ // dynamic pattern
+ if (pipe->pattern) {
+ pipe->pattern->getColor(pipe->x, pipe->y, pipe->cSrcVal);
+ }
+
+ if (pipe->noTransparency && !state->blendFunc) {
+
+ //----- write destination pixel
+
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ cResult0 = pipe->cSrc[0];
+ if (state->screen->test(pipe->x, pipe->y, cResult0)) {
+ *pipe->destColorPtr |= pipe->destColorMask;
+ } else {
+ *pipe->destColorPtr &= ~pipe->destColorMask;
+ }
+ if (!(pipe->destColorMask >>= 1)) {
+ pipe->destColorMask = 0x80;
+ ++pipe->destColorPtr;
+ }
+ break;
+ case splashModeMono8:
+ *pipe->destColorPtr++ = pipe->cSrc[0];
+ break;
+ case splashModeRGB8:
+ *pipe->destColorPtr++ = pipe->cSrc[0];
+ *pipe->destColorPtr++ = pipe->cSrc[1];
+ *pipe->destColorPtr++ = pipe->cSrc[2];
+ break;
+ case splashModeBGR8:
+ *pipe->destColorPtr++ = pipe->cSrc[2];
+ *pipe->destColorPtr++ = pipe->cSrc[1];
+ *pipe->destColorPtr++ = pipe->cSrc[0];
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ *pipe->destColorPtr++ = pipe->cSrc[0];
+ *pipe->destColorPtr++ = pipe->cSrc[1];
+ *pipe->destColorPtr++ = pipe->cSrc[2];
+ *pipe->destColorPtr++ = pipe->cSrc[3];
+ break;
+#endif
+ }
+ if (pipe->destAlphaPtr) {
+ *pipe->destAlphaPtr++ = 255;
+ }
+
+ } else {
+
+ //----- read destination pixel
+
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ cDest[0] = (*pipe->destColorPtr & pipe->destColorMask) ? 0xff : 0x00;
+ break;
+ case splashModeMono8:
+ cDest[0] = *pipe->destColorPtr;
+ break;
+ case splashModeRGB8:
+ cDest[0] = pipe->destColorPtr[0];
+ cDest[1] = pipe->destColorPtr[1];
+ cDest[2] = pipe->destColorPtr[2];
+ break;
+ case splashModeBGR8:
+ cDest[0] = pipe->destColorPtr[2];
+ cDest[1] = pipe->destColorPtr[1];
+ cDest[2] = pipe->destColorPtr[0];
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ cDest[0] = pipe->destColorPtr[0];
+ cDest[1] = pipe->destColorPtr[1];
+ cDest[2] = pipe->destColorPtr[2];
+ cDest[3] = pipe->destColorPtr[3];
+ break;
+#endif
+ }
+ if (pipe->destAlphaPtr) {
+ aDest = *pipe->destAlphaPtr;
+ } else {
+ aDest = 0xff;
+ }
+
+ //----- blend function
+
+ if (state->blendFunc) {
+ (*state->blendFunc)(pipe->cSrc, cDest, cBlend, bitmap->mode);
+ }
+
+ //----- source alpha
+
+ if (state->softMask) {
+ if (pipe->usesShape) {
+ aSrc = (Guchar)splashRound(pipe->aInput * *pipe->softMaskPtr++
+ * pipe->shape);
+ } else {
+ aSrc = (Guchar)splashRound(pipe->aInput * *pipe->softMaskPtr++);
+ }
+ } else if (pipe->usesShape) {
+ // pipe->aInput is premultiplied by 255 in pipeInit
+ aSrc = (Guchar)splashRound(pipe->aInput * pipe->shape);
+ } else {
+ // precomputed in pipeInit
+ aSrc = pipe->aSrc;
+ }
+
+ //----- result alpha and non-isolated group element correction
+
+ if (pipe->noTransparency) {
+ alpha2 = aResult = 255;
+ } else {
+ aResult = aSrc + aDest - div255(aSrc * aDest);
+
+ if (pipe->alpha0Ptr) {
+ alpha0 = *pipe->alpha0Ptr++;
+ alpha2 = aResult + alpha0 - div255(aResult * alpha0);
+ } else {
+ alpha2 = aResult;
+ }
+ }
+
+ //----- result color
+
+ cResult0 = cResult1 = cResult2 = cResult3 = 0; // make gcc happy
+
+ switch (pipe->resultColorCtrl) {
+
+#if SPLASH_CMYK
+ case splashPipeResultColorNoAlphaBlendCMYK:
+ cResult3 = div255((255 - aDest) * pipe->cSrc[3] + aDest * cBlend[3]);
+#endif
+ case splashPipeResultColorNoAlphaBlendRGB:
+ cResult2 = div255((255 - aDest) * pipe->cSrc[2] + aDest * cBlend[2]);
+ cResult1 = div255((255 - aDest) * pipe->cSrc[1] + aDest * cBlend[1]);
+ case splashPipeResultColorNoAlphaBlendMono:
+ cResult0 = div255((255 - aDest) * pipe->cSrc[0] + aDest * cBlend[0]);
+ break;
+
+ case splashPipeResultColorAlphaNoBlendMono:
+ if (alpha2 == 0) {
+ cResult0 = 0;
+ } else {
+ cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
+ aSrc * pipe->cSrc[0]) / alpha2);
+ }
+ break;
+ case splashPipeResultColorAlphaNoBlendRGB:
+ if (alpha2 == 0) {
+ cResult0 = 0;
+ cResult1 = 0;
+ cResult2 = 0;
+ } else {
+ cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
+ aSrc * pipe->cSrc[0]) / alpha2);
+ cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
+ aSrc * pipe->cSrc[1]) / alpha2);
+ cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
+ aSrc * pipe->cSrc[2]) / alpha2);
+ }
+ break;
+#if SPLASH_CMYK
+ case splashPipeResultColorAlphaNoBlendCMYK:
+ if (alpha2 == 0) {
+ cResult0 = 0;
+ cResult1 = 0;
+ cResult2 = 0;
+ cResult3 = 0;
+ } else {
+ cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
+ aSrc * pipe->cSrc[0]) / alpha2);
+ cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
+ aSrc * pipe->cSrc[1]) / alpha2);
+ cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
+ aSrc * pipe->cSrc[2]) / alpha2);
+ cResult3 = (Guchar)(((alpha2 - aSrc) * cDest[3] +
+ aSrc * pipe->cSrc[3]) / alpha2);
+ }
+ break;
+#endif
+
+ case splashPipeResultColorAlphaBlendMono:
+ if (alpha2 == 0) {
+ cResult0 = 0;
+ } else {
+ cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
+ aSrc * ((255 - aDest) * pipe->cSrc[0] +
+ aDest * cBlend[0]) / 255) /
+ alpha2);
+ }
+ break;
+ case splashPipeResultColorAlphaBlendRGB:
+ if (alpha2 == 0) {
+ cResult0 = 0;
+ cResult1 = 0;
+ cResult2 = 0;
+ } else {
+ cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
+ aSrc * ((255 - aDest) * pipe->cSrc[0] +
+ aDest * cBlend[0]) / 255) /
+ alpha2);
+ cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
+ aSrc * ((255 - aDest) * pipe->cSrc[1] +
+ aDest * cBlend[1]) / 255) /
+ alpha2);
+ cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
+ aSrc * ((255 - aDest) * pipe->cSrc[2] +
+ aDest * cBlend[2]) / 255) /
+ alpha2);
+ }
+ break;
+#if SPLASH_CMYK
+ case splashPipeResultColorAlphaBlendCMYK:
+ if (alpha2 == 0) {
+ cResult0 = 0;
+ cResult1 = 0;
+ cResult2 = 0;
+ cResult3 = 0;
+ } else {
+ cResult0 = (Guchar)(((alpha2 - aSrc) * cDest[0] +
+ aSrc * ((255 - aDest) * pipe->cSrc[0] +
+ aDest * cBlend[0]) / 255) /
+ alpha2);
+ cResult1 = (Guchar)(((alpha2 - aSrc) * cDest[1] +
+ aSrc * ((255 - aDest) * pipe->cSrc[1] +
+ aDest * cBlend[1]) / 255) /
+ alpha2);
+ cResult2 = (Guchar)(((alpha2 - aSrc) * cDest[2] +
+ aSrc * ((255 - aDest) * pipe->cSrc[2] +
+ aDest * cBlend[2]) / 255) /
+ alpha2);
+ cResult3 = (Guchar)(((alpha2 - aSrc) * cDest[3] +
+ aSrc * ((255 - aDest) * pipe->cSrc[3] +
+ aDest * cBlend[3]) / 255) /
+ alpha2);
+ }
+ break;
+#endif
+ }
+
+ //----- non-isolated group correction
+
+ if (aResult != 0) {
+ switch (pipe->nonIsolatedGroup) {
+#if SPLASH_CMYK
+ case 4:
+ cResult3 += (cResult3 - cDest[3]) * aDest *
+ (255 - aResult) / (255 * aResult);
+#endif
+ case 3:
+ cResult2 += (cResult2 - cDest[2]) * aDest *
+ (255 - aResult) / (255 * aResult);
+ cResult1 += (cResult1 - cDest[1]) * aDest *
+ (255 - aResult) / (255 * aResult);
+ case 1:
+ cResult0 += (cResult0 - cDest[0]) * aDest *
+ (255 - aResult) / (255 * aResult);
+ case 0:
+ break;
+ }
+ }
+
+ //----- write destination pixel
+
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ if (state->screen->test(pipe->x, pipe->y, cResult0)) {
+ *pipe->destColorPtr |= pipe->destColorMask;
+ } else {
+ *pipe->destColorPtr &= ~pipe->destColorMask;
+ }
+ if (!(pipe->destColorMask >>= 1)) {
+ pipe->destColorMask = 0x80;
+ ++pipe->destColorPtr;
+ }
+ break;
+ case splashModeMono8:
+ *pipe->destColorPtr++ = cResult0;
+ break;
+ case splashModeRGB8:
+ *pipe->destColorPtr++ = cResult0;
+ *pipe->destColorPtr++ = cResult1;
+ *pipe->destColorPtr++ = cResult2;
+ break;
+ case splashModeBGR8:
+ *pipe->destColorPtr++ = cResult2;
+ *pipe->destColorPtr++ = cResult1;
+ *pipe->destColorPtr++ = cResult0;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ *pipe->destColorPtr++ = cResult0;
+ *pipe->destColorPtr++ = cResult1;
+ *pipe->destColorPtr++ = cResult2;
+ *pipe->destColorPtr++ = cResult3;
+ break;
+#endif
+ }
+ if (pipe->destAlphaPtr) {
+ *pipe->destAlphaPtr++ = aResult;
+ }
+
+ }
+
+ ++pipe->x;
+}
+
+inline void Splash::pipeSetXY(SplashPipe *pipe, int x, int y) {
+ pipe->x = x;
+ pipe->y = y;
+ if (state->softMask) {
+ pipe->softMaskPtr =
+ &state->softMask->data[y * state->softMask->rowSize + x];
+ }
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + (x >> 3)];
+ pipe->destColorMask = 0x80 >> (x & 7);
+ break;
+ case splashModeMono8:
+ pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + x];
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x];
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x];
+ break;
+#endif
+ }
+ if (bitmap->alpha) {
+ pipe->destAlphaPtr = &bitmap->alpha[y * bitmap->width + x];
+ } else {
+ pipe->destAlphaPtr = NULL;
+ }
+ if (state->inNonIsolatedGroup && alpha0Bitmap->alpha) {
+ pipe->alpha0Ptr =
+ &alpha0Bitmap->alpha[(alpha0Y + y) * alpha0Bitmap->width +
+ (alpha0X + x)];
+ } else {
+ pipe->alpha0Ptr = NULL;
+ }
+}
+
+inline void Splash::pipeIncX(SplashPipe *pipe) {
+ ++pipe->x;
+ if (state->softMask) {
+ ++pipe->softMaskPtr;
+ }
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ if (!(pipe->destColorMask >>= 1)) {
+ pipe->destColorMask = 0x80;
+ ++pipe->destColorPtr;
+ }
+ break;
+ case splashModeMono8:
+ ++pipe->destColorPtr;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ pipe->destColorPtr += 3;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ pipe->destColorPtr += 4;
+ break;
+#endif
+ }
+ if (pipe->destAlphaPtr) {
+ ++pipe->destAlphaPtr;
+ }
+ if (pipe->alpha0Ptr) {
+ ++pipe->alpha0Ptr;
+ }
+}
+
+inline void Splash::drawPixel(SplashPipe *pipe, int x, int y, GBool noClip) {
+ if (noClip || state->clip->test(x, y)) {
+ pipeSetXY(pipe, x, y);
+ pipeRun(pipe);
+ updateModX(x);
+ updateModY(y);
+ }
+}
+
+inline void Splash::drawAAPixelInit() {
+ aaBufY = -1;
+}
+
+inline void Splash::drawAAPixel(SplashPipe *pipe, int x, int y) {
+#if splashAASize == 4
+ static int bitCount4[16] = { 0, 1, 1, 2, 1, 2, 2, 3,
+ 1, 2, 2, 3, 2, 3, 3, 4 };
+ int w;
+#else
+ int xx, yy;
+#endif
+ SplashColorPtr p;
+ int x0, x1, t;
+
+ if (x < 0 || x >= bitmap->width ||
+ y < state->clip->getYMinI() || y > state->clip->getYMaxI()) {
+ return;
+ }
+
+ // update aaBuf
+ if (y != aaBufY) {
+ memset(aaBuf->getDataPtr(), 0xff,
+ aaBuf->getRowSize() * aaBuf->getHeight());
+ x0 = 0;
+ x1 = bitmap->width - 1;
+ state->clip->clipAALine(aaBuf, &x0, &x1, y);
+ aaBufY = y;
+ }
+
+ // compute the shape value
+#if splashAASize == 4
+ p = aaBuf->getDataPtr() + (x >> 1);
+ w = aaBuf->getRowSize();
+ if (x & 1) {
+ t = bitCount4[*p & 0x0f] + bitCount4[p[w] & 0x0f] +
+ bitCount4[p[2*w] & 0x0f] + bitCount4[p[3*w] & 0x0f];
+ } else {
+ t = bitCount4[*p >> 4] + bitCount4[p[w] >> 4] +
+ bitCount4[p[2*w] >> 4] + bitCount4[p[3*w] >> 4];
+ }
+#else
+ t = 0;
+ for (yy = 0; yy < splashAASize; ++yy) {
+ for (xx = 0; xx < splashAASize; ++xx) {
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() +
+ ((x * splashAASize + xx) >> 3);
+ t += (*p >> (7 - ((x * splashAASize + xx) & 7))) & 1;
+ }
+ }
+#endif
+
+ // draw the pixel
+ if (t != 0) {
+ pipeSetXY(pipe, x, y);
+ pipe->shape *= aaGamma[t];
+ pipeRun(pipe);
+ updateModX(x);
+ updateModY(y);
+ }
+}
+
+inline void Splash::drawSpan(SplashPipe *pipe, int x0, int x1, int y,
+ GBool noClip) {
+ int x;
+
+ pipeSetXY(pipe, x0, y);
+ if (noClip) {
+ for (x = x0; x <= x1; ++x) {
+ pipeRun(pipe);
+ }
+ updateModX(x0);
+ updateModX(x1);
+ updateModY(y);
+ } else {
+ for (x = x0; x <= x1; ++x) {
+ if (state->clip->test(x, y)) {
+ pipeRun(pipe);
+ updateModX(x);
+ updateModY(y);
+ } else {
+ pipeIncX(pipe);
+ }
+ }
+ }
+}
+
+inline void Splash::drawAALine(SplashPipe *pipe, int x0, int x1, int y) {
+#if splashAASize == 4
+ static int bitCount4[16] = { 0, 1, 1, 2, 1, 2, 2, 3,
+ 1, 2, 2, 3, 2, 3, 3, 4 };
+ SplashColorPtr p0, p1, p2, p3;
+ int t;
+#else
+ SplashColorPtr p;
+ int xx, yy, t;
+#endif
+ int x;
+
+#if splashAASize == 4
+ p0 = aaBuf->getDataPtr() + (x0 >> 1);
+ p1 = p0 + aaBuf->getRowSize();
+ p2 = p1 + aaBuf->getRowSize();
+ p3 = p2 + aaBuf->getRowSize();
+#endif
+ pipeSetXY(pipe, x0, y);
+ for (x = x0; x <= x1; ++x) {
+
+ // compute the shape value
+#if splashAASize == 4
+ if (x & 1) {
+ t = bitCount4[*p0 & 0x0f] + bitCount4[*p1 & 0x0f] +
+ bitCount4[*p2 & 0x0f] + bitCount4[*p3 & 0x0f];
+ ++p0; ++p1; ++p2; ++p3;
+ } else {
+ t = bitCount4[*p0 >> 4] + bitCount4[*p1 >> 4] +
+ bitCount4[*p2 >> 4] + bitCount4[*p3 >> 4];
+ }
+#else
+ t = 0;
+ for (yy = 0; yy < splashAASize; ++yy) {
+ for (xx = 0; xx < splashAASize; ++xx) {
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() +
+ ((x * splashAASize + xx) >> 3);
+ t += (*p >> (7 - ((x * splashAASize + xx) & 7))) & 1;
+ }
+ }
+#endif
+
+ if (t != 0) {
+ pipe->shape = aaGamma[t];
+ pipeRun(pipe);
+ updateModX(x);
+ updateModY(y);
+ } else {
+ pipeIncX(pipe);
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+
+// Transform a point from user space to device space.
+inline void Splash::transform(SplashCoord *matrix,
+ SplashCoord xi, SplashCoord yi,
+ SplashCoord *xo, SplashCoord *yo) {
+ // [ m[0] m[1] 0 ]
+ // [xo yo 1] = [xi yi 1] * [ m[2] m[3] 0 ]
+ // [ m[4] m[5] 1 ]
+ *xo = xi * matrix[0] + yi * matrix[2] + matrix[4];
+ *yo = xi * matrix[1] + yi * matrix[3] + matrix[5];
+}
+
+//------------------------------------------------------------------------
+// Splash
+//------------------------------------------------------------------------
+
+Splash::Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA,
+ SplashScreenParams *screenParams) {
+ int i;
+
+ bitmap = bitmapA;
+ vectorAntialias = vectorAntialiasA;
+ state = new SplashState(bitmap->width, bitmap->height, vectorAntialias,
+ screenParams);
+ if (vectorAntialias) {
+ aaBuf = new SplashBitmap(splashAASize * bitmap->width, splashAASize,
+ 1, splashModeMono1, gFalse);
+ for (i = 0; i <= splashAASize * splashAASize; ++i) {
+ aaGamma[i] = splashPow((SplashCoord)i /
+ (SplashCoord)(splashAASize * splashAASize),
+ 1.5);
+ }
+ } else {
+ aaBuf = NULL;
+ }
+ clearModRegion();
+ debugMode = gFalse;
+}
+
+Splash::Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA,
+ SplashScreen *screenA) {
+ int i;
+
+ bitmap = bitmapA;
+ vectorAntialias = vectorAntialiasA;
+ state = new SplashState(bitmap->width, bitmap->height, vectorAntialias,
+ screenA);
+ if (vectorAntialias) {
+ aaBuf = new SplashBitmap(splashAASize * bitmap->width, splashAASize,
+ 1, splashModeMono1, gFalse);
+ for (i = 0; i <= splashAASize * splashAASize; ++i) {
+ aaGamma[i] = splashPow((SplashCoord)i /
+ (SplashCoord)(splashAASize * splashAASize),
+ 1.5);
+ }
+ } else {
+ aaBuf = NULL;
+ }
+ clearModRegion();
+ debugMode = gFalse;
+}
+
+Splash::~Splash() {
+ while (state->next) {
+ restoreState();
+ }
+ delete state;
+ if (vectorAntialias) {
+ delete aaBuf;
+ }
+}
+
+//------------------------------------------------------------------------
+// state read
+//------------------------------------------------------------------------
+
+SplashCoord *Splash::getMatrix() {
+ return state->matrix;
+}
+
+SplashPattern *Splash::getStrokePattern() {
+ return state->strokePattern;
+}
+
+SplashPattern *Splash::getFillPattern() {
+ return state->fillPattern;
+}
+
+SplashScreen *Splash::getScreen() {
+ return state->screen;
+}
+
+SplashBlendFunc Splash::getBlendFunc() {
+ return state->blendFunc;
+}
+
+SplashCoord Splash::getStrokeAlpha() {
+ return state->strokeAlpha;
+}
+
+SplashCoord Splash::getFillAlpha() {
+ return state->fillAlpha;
+}
+
+SplashCoord Splash::getLineWidth() {
+ return state->lineWidth;
+}
+
+int Splash::getLineCap() {
+ return state->lineCap;
+}
+
+int Splash::getLineJoin() {
+ return state->lineJoin;
+}
+
+SplashCoord Splash::getMiterLimit() {
+ return state->miterLimit;
+}
+
+SplashCoord Splash::getFlatness() {
+ return state->flatness;
+}
+
+SplashCoord *Splash::getLineDash() {
+ return state->lineDash;
+}
+
+int Splash::getLineDashLength() {
+ return state->lineDashLength;
+}
+
+SplashCoord Splash::getLineDashPhase() {
+ return state->lineDashPhase;
+}
+
+SplashClip *Splash::getClip() {
+ return state->clip;
+}
+
+SplashBitmap *Splash::getSoftMask() {
+ return state->softMask;
+}
+
+GBool Splash::getInNonIsolatedGroup() {
+ return state->inNonIsolatedGroup;
+}
+
+//------------------------------------------------------------------------
+// state write
+//------------------------------------------------------------------------
+
+void Splash::setMatrix(SplashCoord *matrix) {
+ memcpy(state->matrix, matrix, 6 * sizeof(SplashCoord));
+}
+
+void Splash::setStrokePattern(SplashPattern *strokePattern) {
+ state->setStrokePattern(strokePattern);
+}
+
+void Splash::setFillPattern(SplashPattern *fillPattern) {
+ state->setFillPattern(fillPattern);
+}
+
+void Splash::setScreen(SplashScreen *screen) {
+ state->setScreen(screen);
+}
+
+void Splash::setBlendFunc(SplashBlendFunc func) {
+ state->blendFunc = func;
+}
+
+void Splash::setStrokeAlpha(SplashCoord alpha) {
+ state->strokeAlpha = alpha;
+}
+
+void Splash::setFillAlpha(SplashCoord alpha) {
+ state->fillAlpha = alpha;
+}
+
+void Splash::setLineWidth(SplashCoord lineWidth) {
+ state->lineWidth = lineWidth;
+}
+
+void Splash::setLineCap(int lineCap) {
+ state->lineCap = lineCap;
+}
+
+void Splash::setLineJoin(int lineJoin) {
+ state->lineJoin = lineJoin;
+}
+
+void Splash::setMiterLimit(SplashCoord miterLimit) {
+ state->miterLimit = miterLimit;
+}
+
+void Splash::setFlatness(SplashCoord flatness) {
+ if (flatness < 1) {
+ state->flatness = 1;
+ } else {
+ state->flatness = flatness;
+ }
+}
+
+void Splash::setLineDash(SplashCoord *lineDash, int lineDashLength,
+ SplashCoord lineDashPhase) {
+ state->setLineDash(lineDash, lineDashLength, lineDashPhase);
+}
+
+void Splash::setStrokeAdjust(GBool strokeAdjust) {
+ state->strokeAdjust = strokeAdjust;
+}
+
+void Splash::clipResetToRect(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1) {
+ state->clip->resetToRect(x0, y0, x1, y1);
+}
+
+SplashError Splash::clipToRect(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1) {
+ return state->clip->clipToRect(x0, y0, x1, y1);
+}
+
+SplashError Splash::clipToPath(SplashPath *path, GBool eo) {
+ return state->clip->clipToPath(path, state->matrix, state->flatness, eo);
+}
+
+void Splash::setSoftMask(SplashBitmap *softMask) {
+ state->setSoftMask(softMask);
+}
+
+void Splash::setInNonIsolatedGroup(SplashBitmap *alpha0BitmapA,
+ int alpha0XA, int alpha0YA) {
+ alpha0Bitmap = alpha0BitmapA;
+ alpha0X = alpha0XA;
+ alpha0Y = alpha0YA;
+ state->inNonIsolatedGroup = gTrue;
+}
+
+//------------------------------------------------------------------------
+// state save/restore
+//------------------------------------------------------------------------
+
+void Splash::saveState() {
+ SplashState *newState;
+
+ newState = state->copy();
+ newState->next = state;
+ state = newState;
+}
+
+SplashError Splash::restoreState() {
+ SplashState *oldState;
+
+ if (!state->next) {
+ return splashErrNoSave;
+ }
+ oldState = state;
+ state = state->next;
+ delete oldState;
+ return splashOk;
+}
+
+//------------------------------------------------------------------------
+// drawing operations
+//------------------------------------------------------------------------
+
+void Splash::clear(SplashColorPtr color, Guchar alpha) {
+ SplashColorPtr row, p;
+ Guchar mono;
+ int x, y;
+
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ mono = (color[0] & 0x80) ? 0xff : 0x00;
+ if (bitmap->rowSize < 0) {
+ memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
+ mono, -bitmap->rowSize * bitmap->height);
+ } else {
+ memset(bitmap->data, mono, bitmap->rowSize * bitmap->height);
+ }
+ break;
+ case splashModeMono8:
+ if (bitmap->rowSize < 0) {
+ memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
+ color[0], -bitmap->rowSize * bitmap->height);
+ } else {
+ memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
+ }
+ break;
+ case splashModeRGB8:
+ if (color[0] == color[1] && color[1] == color[2]) {
+ if (bitmap->rowSize < 0) {
+ memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
+ color[0], -bitmap->rowSize * bitmap->height);
+ } else {
+ memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
+ }
+ } else {
+ row = bitmap->data;
+ for (y = 0; y < bitmap->height; ++y) {
+ p = row;
+ for (x = 0; x < bitmap->width; ++x) {
+ *p++ = color[2];
+ *p++ = color[1];
+ *p++ = color[0];
+ }
+ row += bitmap->rowSize;
+ }
+ }
+ break;
+ case splashModeBGR8:
+ if (color[0] == color[1] && color[1] == color[2]) {
+ if (bitmap->rowSize < 0) {
+ memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
+ color[0], -bitmap->rowSize * bitmap->height);
+ } else {
+ memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
+ }
+ } else {
+ row = bitmap->data;
+ for (y = 0; y < bitmap->height; ++y) {
+ p = row;
+ for (x = 0; x < bitmap->width; ++x) {
+ *p++ = color[0];
+ *p++ = color[1];
+ *p++ = color[2];
+ }
+ row += bitmap->rowSize;
+ }
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ if (color[0] == color[1] && color[1] == color[2] && color[2] == color[3]) {
+ if (bitmap->rowSize < 0) {
+ memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
+ color[0], -bitmap->rowSize * bitmap->height);
+ } else {
+ memset(bitmap->data, color[0], bitmap->rowSize * bitmap->height);
+ }
+ } else {
+ row = bitmap->data;
+ for (y = 0; y < bitmap->height; ++y) {
+ p = row;
+ for (x = 0; x < bitmap->width; ++x) {
+ *p++ = color[0];
+ *p++ = color[1];
+ *p++ = color[2];
+ *p++ = color[3];
+ }
+ row += bitmap->rowSize;
+ }
+ }
+ break;
+#endif
+ }
+
+ if (bitmap->alpha) {
+ memset(bitmap->alpha, alpha, bitmap->width * bitmap->height);
+ }
+
+ updateModX(0);
+ updateModY(0);
+ updateModX(bitmap->width - 1);
+ updateModY(bitmap->height - 1);
+}
+
+SplashError Splash::stroke(SplashPath *path) {
+ SplashPath *path2, *dPath;
+
+ if (debugMode) {
+ printf("stroke [dash:%d] [width:%.2f]:\n",
+ state->lineDashLength, (double)state->lineWidth);
+ dumpPath(path);
+ }
+ opClipRes = splashClipAllOutside;
+ if (path->length == 0) {
+ return splashErrEmptyPath;
+ }
+ path2 = flattenPath(path, state->matrix, state->flatness);
+ if (state->lineDashLength > 0) {
+ dPath = makeDashedPath(path2);
+ delete path2;
+ path2 = dPath;
+ }
+ if (state->lineWidth == 0) {
+ strokeNarrow(path2);
+ } else {
+ strokeWide(path2);
+ }
+ delete path2;
+ return splashOk;
+}
+
+void Splash::strokeNarrow(SplashPath *path) {
+ SplashPipe pipe;
+ SplashXPath *xPath;
+ SplashXPathSeg *seg;
+ int x0, x1, x2, x3, y0, y1, x, y, t;
+ SplashCoord dx, dy, dxdy;
+ SplashClipResult clipRes;
+ int nClipRes[3];
+ int i;
+
+ nClipRes[0] = nClipRes[1] = nClipRes[2] = 0;
+
+ xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse);
+
+ pipeInit(&pipe, 0, 0, state->strokePattern, NULL, state->strokeAlpha,
+ gFalse, gFalse);
+
+ for (i = 0, seg = xPath->segs; i < xPath->length; ++i, ++seg) {
+
+ x0 = splashFloor(seg->x0);
+ x1 = splashFloor(seg->x1);
+ y0 = splashFloor(seg->y0);
+ y1 = splashFloor(seg->y1);
+
+ // horizontal segment
+ if (y0 == y1) {
+ if (x0 > x1) {
+ t = x0; x0 = x1; x1 = t;
+ }
+ if ((clipRes = state->clip->testSpan(x0, x1, y0))
+ != splashClipAllOutside) {
+ drawSpan(&pipe, x0, x1, y0, clipRes == splashClipAllInside);
+ }
+
+ // segment with |dx| > |dy|
+ } else if (splashAbs(seg->dxdy) > 1) {
+ dx = seg->x1 - seg->x0;
+ dy = seg->y1 - seg->y0;
+ dxdy = seg->dxdy;
+ if (y0 > y1) {
+ t = y0; y0 = y1; y1 = t;
+ t = x0; x0 = x1; x1 = t;
+ dx = -dx;
+ dy = -dy;
+ }
+ if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0,
+ x0 <= x1 ? x1 : x0, y1))
+ != splashClipAllOutside) {
+ if (dx > 0) {
+ x2 = x0;
+ x3 = splashFloor(seg->x0 + ((SplashCoord)y0 + 1 - seg->y0) * dxdy);
+ drawSpan(&pipe, x2, (x2 <= x3 - 1) ? x3 - 1 : x2, y0,
+ clipRes == splashClipAllInside);
+ x2 = x3;
+ for (y = y0 + 1; y <= y1 - 1; ++y) {
+ x3 = splashFloor(seg->x0 + ((SplashCoord)y + 1 - seg->y0) * dxdy);
+ drawSpan(&pipe, x2, x3 - 1, y, clipRes == splashClipAllInside);
+ x2 = x3;
+ }
+ drawSpan(&pipe, x2, x2 <= x1 ? x1 : x2, y1,
+ clipRes == splashClipAllInside);
+ } else {
+ x2 = x0;
+ x3 = splashFloor(seg->x0 + ((SplashCoord)y0 + 1 - seg->y0) * dxdy);
+ drawSpan(&pipe, (x3 + 1 <= x2) ? x3 + 1 : x2, x2, y0,
+ clipRes == splashClipAllInside);
+ x2 = x3;
+ for (y = y0 + 1; y <= y1 - 1; ++y) {
+ x3 = splashFloor(seg->x0 + ((SplashCoord)y + 1 - seg->y0) * dxdy);
+ drawSpan(&pipe, x3 + 1, x2, y, clipRes == splashClipAllInside);
+ x2 = x3;
+ }
+ drawSpan(&pipe, x1, (x1 <= x2) ? x2 : x1, y1,
+ clipRes == splashClipAllInside);
+ }
+ }
+
+ // segment with |dy| > |dx|
+ } else {
+ dxdy = seg->dxdy;
+ if (y0 > y1) {
+ t = x0; x0 = x1; x1 = t;
+ t = y0; y0 = y1; y1 = t;
+ }
+ if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0,
+ x0 <= x1 ? x1 : x0, y1))
+ != splashClipAllOutside) {
+ drawPixel(&pipe, x0, y0, clipRes == splashClipAllInside);
+ for (y = y0 + 1; y <= y1 - 1; ++y) {
+ x = splashFloor(seg->x0 + ((SplashCoord)y - seg->y0) * dxdy);
+ drawPixel(&pipe, x, y, clipRes == splashClipAllInside);
+ }
+ drawPixel(&pipe, x1, y1, clipRes == splashClipAllInside);
+ }
+ }
+ ++nClipRes[clipRes];
+ }
+ if (nClipRes[splashClipPartial] ||
+ (nClipRes[splashClipAllInside] && nClipRes[splashClipAllOutside])) {
+ opClipRes = splashClipPartial;
+ } else if (nClipRes[splashClipAllInside]) {
+ opClipRes = splashClipAllInside;
+ } else {
+ opClipRes = splashClipAllOutside;
+ }
+
+ delete xPath;
+}
+
+void Splash::strokeWide(SplashPath *path) {
+ SplashPath *path2;
+
+ path2 = makeStrokePath(path, gFalse);
+ fillWithPattern(path2, gFalse, state->strokePattern, state->strokeAlpha);
+ delete path2;
+}
+
+SplashPath *Splash::flattenPath(SplashPath *path, SplashCoord *matrix,
+ SplashCoord flatness) {
+ SplashPath *fPath;
+ SplashCoord flatness2;
+ Guchar flag;
+ int i;
+
+ fPath = new SplashPath();
+ flatness2 = flatness * flatness;
+ i = 0;
+ while (i < path->length) {
+ flag = path->flags[i];
+ if (flag & splashPathFirst) {
+ fPath->moveTo(path->pts[i].x, path->pts[i].y);
+ ++i;
+ } else {
+ if (flag & splashPathCurve) {
+ flattenCurve(path->pts[i-1].x, path->pts[i-1].y,
+ path->pts[i ].x, path->pts[i ].y,
+ path->pts[i+1].x, path->pts[i+1].y,
+ path->pts[i+2].x, path->pts[i+2].y,
+ matrix, flatness2, fPath);
+ i += 3;
+ } else {
+ fPath->lineTo(path->pts[i].x, path->pts[i].y);
+ ++i;
+ }
+ if (path->flags[i-1] & splashPathClosed) {
+ fPath->close();
+ }
+ }
+ }
+ return fPath;
+}
+
+void Splash::flattenCurve(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1,
+ SplashCoord x2, SplashCoord y2,
+ SplashCoord x3, SplashCoord y3,
+ SplashCoord *matrix, SplashCoord flatness2,
+ SplashPath *fPath) {
+ SplashCoord cx[splashMaxCurveSplits + 1][3];
+ SplashCoord cy[splashMaxCurveSplits + 1][3];
+ int cNext[splashMaxCurveSplits + 1];
+ SplashCoord xl0, xl1, xl2, xr0, xr1, xr2, xr3, xx1, xx2, xh;
+ SplashCoord yl0, yl1, yl2, yr0, yr1, yr2, yr3, yy1, yy2, yh;
+ SplashCoord dx, dy, mx, my, tx, ty, d1, d2;
+ int p1, p2, p3;
+
+ // initial segment
+ p1 = 0;
+ p2 = splashMaxCurveSplits;
+ cx[p1][0] = x0; cy[p1][0] = y0;
+ cx[p1][1] = x1; cy[p1][1] = y1;
+ cx[p1][2] = x2; cy[p1][2] = y2;
+ cx[p2][0] = x3; cy[p2][0] = y3;
+ cNext[p1] = p2;
+
+ while (p1 < splashMaxCurveSplits) {
+
+ // get the next segment
+ xl0 = cx[p1][0]; yl0 = cy[p1][0];
+ xx1 = cx[p1][1]; yy1 = cy[p1][1];
+ xx2 = cx[p1][2]; yy2 = cy[p1][2];
+ p2 = cNext[p1];
+ xr3 = cx[p2][0]; yr3 = cy[p2][0];
+
+ // compute the distances (in device space) from the control points
+ // to the midpoint of the straight line (this is a bit of a hack,
+ // but it's much faster than computing the actual distances to the
+ // line)
+ transform(matrix, (xl0 + xr3) * 0.5, (yl0 + yr3) * 0.5, &mx, &my);
+ transform(matrix, xx1, yy1, &tx, &ty);
+ dx = tx - mx;
+ dy = ty - my;
+ d1 = dx*dx + dy*dy;
+ transform(matrix, xx2, yy2, &tx, &ty);
+ dx = tx - mx;
+ dy = ty - my;
+ d2 = dx*dx + dy*dy;
+
+ // if the curve is flat enough, or no more subdivisions are
+ // allowed, add the straight line segment
+ if (p2 - p1 == 1 || (d1 <= flatness2 && d2 <= flatness2)) {
+ fPath->lineTo(xr3, yr3);
+ p1 = p2;
+
+ // otherwise, subdivide the curve
+ } else {
+ xl1 = (xl0 + xx1) * 0.5;
+ yl1 = (yl0 + yy1) * 0.5;
+ xh = (xx1 + xx2) * 0.5;
+ yh = (yy1 + yy2) * 0.5;
+ xl2 = (xl1 + xh) * 0.5;
+ yl2 = (yl1 + yh) * 0.5;
+ xr2 = (xx2 + xr3) * 0.5;
+ yr2 = (yy2 + yr3) * 0.5;
+ xr1 = (xh + xr2) * 0.5;
+ yr1 = (yh + yr2) * 0.5;
+ xr0 = (xl2 + xr1) * 0.5;
+ yr0 = (yl2 + yr1) * 0.5;
+ // add the new subdivision points
+ p3 = (p1 + p2) / 2;
+ cx[p1][1] = xl1; cy[p1][1] = yl1;
+ cx[p1][2] = xl2; cy[p1][2] = yl2;
+ cNext[p1] = p3;
+ cx[p3][0] = xr0; cy[p3][0] = yr0;
+ cx[p3][1] = xr1; cy[p3][1] = yr1;
+ cx[p3][2] = xr2; cy[p3][2] = yr2;
+ cNext[p3] = p2;
+ }
+ }
+}
+
+SplashPath *Splash::makeDashedPath(SplashPath *path) {
+ SplashPath *dPath;
+ SplashCoord lineDashTotal;
+ SplashCoord lineDashStartPhase, lineDashDist, segLen;
+ SplashCoord x0, y0, x1, y1, xa, ya;
+ GBool lineDashStartOn, lineDashOn, newPath;
+ int lineDashStartIdx, lineDashIdx;
+ int i, j, k;
+
+ lineDashTotal = 0;
+ for (i = 0; i < state->lineDashLength; ++i) {
+ lineDashTotal += state->lineDash[i];
+ }
+ lineDashStartPhase = state->lineDashPhase;
+ i = splashFloor(lineDashStartPhase / lineDashTotal);
+ lineDashStartPhase -= (SplashCoord)i * lineDashTotal;
+ lineDashStartOn = gTrue;
+ lineDashStartIdx = 0;
+ while (lineDashStartPhase >= state->lineDash[lineDashStartIdx]) {
+ lineDashStartOn = !lineDashStartOn;
+ lineDashStartPhase -= state->lineDash[lineDashStartIdx];
+ ++lineDashStartIdx;
+ }
+
+ dPath = new SplashPath();
+
+ // process each subpath
+ i = 0;
+ while (i < path->length) {
+
+ // find the end of the subpath
+ for (j = i;
+ j < path->length - 1 && !(path->flags[j] & splashPathLast);
+ ++j) ;
+
+ // initialize the dash parameters
+ lineDashOn = lineDashStartOn;
+ lineDashIdx = lineDashStartIdx;
+ lineDashDist = state->lineDash[lineDashIdx] - lineDashStartPhase;
+
+ // process each segment of the subpath
+ newPath = gTrue;
+ for (k = i; k < j; ++k) {
+
+ // grab the segment
+ x0 = path->pts[k].x;
+ y0 = path->pts[k].y;
+ x1 = path->pts[k+1].x;
+ y1 = path->pts[k+1].y;
+ segLen = splashDist(x0, y0, x1, y1);
+
+ // process the segment
+ while (segLen > 0) {
+
+ if (lineDashDist >= segLen) {
+ if (lineDashOn) {
+ if (newPath) {
+ dPath->moveTo(x0, y0);
+ newPath = gFalse;
+ }
+ dPath->lineTo(x1, y1);
+ }
+ lineDashDist -= segLen;
+ segLen = 0;
+
+ } else {
+ xa = x0 + (lineDashDist / segLen) * (x1 - x0);
+ ya = y0 + (lineDashDist / segLen) * (y1 - y0);
+ if (lineDashOn) {
+ if (newPath) {
+ dPath->moveTo(x0, y0);
+ newPath = gFalse;
+ }
+ dPath->lineTo(xa, ya);
+ }
+ x0 = xa;
+ y0 = ya;
+ segLen -= lineDashDist;
+ lineDashDist = 0;
+ }
+
+ // get the next entry in the dash array
+ if (lineDashDist <= 0) {
+ lineDashOn = !lineDashOn;
+ if (++lineDashIdx == state->lineDashLength) {
+ lineDashIdx = 0;
+ }
+ lineDashDist = state->lineDash[lineDashIdx];
+ newPath = gTrue;
+ }
+ }
+ }
+ i = j + 1;
+ }
+
+ return dPath;
+}
+
+SplashError Splash::fill(SplashPath *path, GBool eo) {
+ if (debugMode) {
+ printf("fill [eo:%d]:\n", eo);
+ dumpPath(path);
+ }
+ return fillWithPattern(path, eo, state->fillPattern, state->fillAlpha);
+}
+
+SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
+ SplashPattern *pattern,
+ SplashCoord alpha) {
+ SplashPipe pipe;
+ SplashXPath *xPath;
+ SplashXPathScanner *scanner;
+ int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y;
+ SplashClipResult clipRes, clipRes2;
+
+ if (path->length == 0) {
+ return splashErrEmptyPath;
+ }
+ xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
+ if (vectorAntialias) {
+ xPath->aaScale();
+ }
+ xPath->sort();
+ if (!&xPath->segs[0])
+ {
+ delete xPath;
+ return splashErrEmptyPath;
+ }
+ scanner = new SplashXPathScanner(xPath, eo);
+
+ // get the min and max x and y values
+ if (vectorAntialias) {
+ scanner->getBBoxAA(&xMinI, &yMinI, &xMaxI, &yMaxI);
+ } else {
+ scanner->getBBox(&xMinI, &yMinI, &xMaxI, &yMaxI);
+ }
+
+ // check clipping
+ if ((clipRes = state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI))
+ != splashClipAllOutside) {
+
+ // limit the y range
+ if (yMinI < state->clip->getYMinI()) {
+ yMinI = state->clip->getYMinI();
+ }
+ if (yMaxI > state->clip->getYMaxI()) {
+ yMaxI = state->clip->getYMaxI();
+ }
+
+ pipeInit(&pipe, 0, yMinI, pattern, NULL, alpha, vectorAntialias, gFalse);
+
+ // draw the spans
+ if (vectorAntialias) {
+ for (y = yMinI; y <= yMaxI; ++y) {
+ scanner->renderAALine(aaBuf, &x0, &x1, y);
+ if (clipRes != splashClipAllInside) {
+ state->clip->clipAALine(aaBuf, &x0, &x1, y);
+ }
+ drawAALine(&pipe, x0, x1, y);
+ }
+ } else {
+ for (y = yMinI; y <= yMaxI; ++y) {
+ while (scanner->getNextSpan(y, &x0, &x1)) {
+ if (clipRes == splashClipAllInside) {
+ drawSpan(&pipe, x0, x1, y, gTrue);
+ } else {
+ // limit the x range
+ if (x0 < state->clip->getXMinI()) {
+ x0 = state->clip->getXMinI();
+ }
+ if (x1 > state->clip->getXMaxI()) {
+ x1 = state->clip->getXMaxI();
+ }
+ clipRes2 = state->clip->testSpan(x0, x1, y);
+ drawSpan(&pipe, x0, x1, y, clipRes2 == splashClipAllInside);
+ }
+ }
+ }
+ }
+ }
+ opClipRes = clipRes;
+
+ delete scanner;
+ delete xPath;
+ return splashOk;
+}
+
+SplashError Splash::xorFill(SplashPath *path, GBool eo) {
+ SplashPipe pipe;
+ SplashXPath *xPath;
+ SplashXPathScanner *scanner;
+ int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y;
+ SplashClipResult clipRes, clipRes2;
+ SplashBlendFunc origBlendFunc;
+
+ if (path->length == 0) {
+ return splashErrEmptyPath;
+ }
+ xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
+ xPath->sort();
+ scanner = new SplashXPathScanner(xPath, eo);
+
+ // get the min and max x and y values
+ scanner->getBBox(&xMinI, &yMinI, &xMaxI, &yMaxI);
+
+ // check clipping
+ if ((clipRes = state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI))
+ != splashClipAllOutside) {
+
+ // limit the y range
+ if (yMinI < state->clip->getYMinI()) {
+ yMinI = state->clip->getYMinI();
+ }
+ if (yMaxI > state->clip->getYMaxI()) {
+ yMaxI = state->clip->getYMaxI();
+ }
+
+ origBlendFunc = state->blendFunc;
+ state->blendFunc = &blendXor;
+ pipeInit(&pipe, 0, yMinI, state->fillPattern, NULL, 1, gFalse, gFalse);
+
+ // draw the spans
+ for (y = yMinI; y <= yMaxI; ++y) {
+ while (scanner->getNextSpan(y, &x0, &x1)) {
+ if (clipRes == splashClipAllInside) {
+ drawSpan(&pipe, x0, x1, y, gTrue);
+ } else {
+ // limit the x range
+ if (x0 < state->clip->getXMinI()) {
+ x0 = state->clip->getXMinI();
+ }
+ if (x1 > state->clip->getXMaxI()) {
+ x1 = state->clip->getXMaxI();
+ }
+ clipRes2 = state->clip->testSpan(x0, x1, y);
+ drawSpan(&pipe, x0, x1, y, clipRes2 == splashClipAllInside);
+ }
+ }
+ }
+ state->blendFunc = origBlendFunc;
+ }
+ opClipRes = clipRes;
+
+ delete scanner;
+ delete xPath;
+ return splashOk;
+}
+
+SplashError Splash::fillChar(SplashCoord x, SplashCoord y,
+ int c, SplashFont *font) {
+ SplashGlyphBitmap glyph;
+ SplashCoord xt, yt;
+ int x0, y0, xFrac, yFrac;
+ SplashClipResult clipRes;
+
+ if (debugMode) {
+ printf("fillChar: x=%.2f y=%.2f c=%3d=0x%02x='%c'\n",
+ (double)x, (double)y, c, c, c);
+ }
+ transform(state->matrix, x, y, &xt, &yt);
+ x0 = splashFloor(xt);
+ xFrac = splashFloor((xt - x0) * splashFontFraction);
+ y0 = splashFloor(yt);
+ yFrac = splashFloor((yt - y0) * splashFontFraction);
+ if (!font->getGlyph(c, xFrac, yFrac, &glyph, x0, y0, state->clip, &clipRes)) {
+ return splashErrNoGlyph;
+ }
+ if (clipRes != splashClipAllOutside) {
+ fillGlyph2(x0, y0, &glyph, clipRes == splashClipAllInside);
+ }
+ opClipRes = clipRes;
+ if (glyph.freeData) {
+ gfree(glyph.data);
+ }
+ return splashOk;
+}
+
+void Splash::fillGlyph(SplashCoord x, SplashCoord y,
+ SplashGlyphBitmap *glyph) {
+ SplashCoord xt, yt;
+ int x0, y0;
+
+ transform(state->matrix, x, y, &xt, &yt);
+ x0 = splashFloor(xt);
+ y0 = splashFloor(yt);
+ SplashClipResult clipRes = state->clip->testRect(x0 - glyph->x,
+ y0 - glyph->y,
+ x0 - glyph->x + glyph->w - 1,
+ y0 - glyph->y + glyph->h - 1);
+ if (clipRes != splashClipAllOutside) {
+ fillGlyph2(x0, y0, glyph, clipRes == splashClipAllInside);
+ }
+ opClipRes = clipRes;
+}
+
+void Splash::fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph, GBool noClip) {
+ SplashPipe pipe;
+ int alpha0, alpha;
+ Guchar *p;
+ int x1, y1, xx, xx1, yy;
+
+ p = glyph->data;
+ int xStart = x0 - glyph->x;
+ int yStart = y0 - glyph->y;
+ int xxLimit = glyph->w;
+ int yyLimit = glyph->h;
+
+ if (yStart < 0)
+ {
+ p += glyph->w * -yStart; // move p to the beginning of the first painted row
+ yyLimit += yStart;
+ yStart = 0;
+ }
+
+ if (xStart < 0)
+ {
+ p += -xStart; // move p to the first painted pixel
+ xxLimit += xStart;
+ xStart = 0;
+ }
+
+ if (xxLimit + xStart >= bitmap->width) xxLimit = bitmap->width - xStart;
+ if (yyLimit + yStart >= bitmap->height) yyLimit = bitmap->height - yStart;
+
+ if (noClip) {
+ if (glyph->aa) {
+ pipeInit(&pipe, xStart, yStart,
+ state->fillPattern, NULL, state->fillAlpha, gTrue, gFalse);
+ for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
+ pipeSetXY(&pipe, xStart, y1);
+ for (xx = 0, x1 = xStart; xx < xxLimit; ++xx, ++x1) {
+ alpha = p[xx];
+ if (alpha != 0) {
+ pipe.shape = (SplashCoord)(alpha / 255.0);
+ pipeRun(&pipe);
+ updateModX(x1);
+ updateModY(y1);
+ } else {
+ pipeIncX(&pipe);
+ }
+ }
+ p += glyph->w;
+ }
+ } else {
+ const int widthEight = (int)ceil(glyph->w / 8.0);
+
+ pipeInit(&pipe, xStart, yStart,
+ state->fillPattern, NULL, state->fillAlpha, gFalse, gFalse);
+ for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
+ pipeSetXY(&pipe, xStart, y1);
+ for (xx = 0, x1 = xStart; xx < xxLimit; xx += 8) {
+ alpha0 = p[xx / 8];
+ for (xx1 = 0; xx1 < 8 && xx + xx1 < xxLimit; ++xx1, ++x1) {
+ if (alpha0 & 0x80) {
+ pipeRun(&pipe);
+ updateModX(x1);
+ updateModY(y1);
+ } else {
+ pipeIncX(&pipe);
+ }
+ alpha0 <<= 1;
+ }
+ }
+ p += widthEight;
+ }
+ }
+ } else {
+ if (glyph->aa) {
+ pipeInit(&pipe, xStart, yStart,
+ state->fillPattern, NULL, state->fillAlpha, gTrue, gFalse);
+ for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
+ pipeSetXY(&pipe, xStart, y1);
+ for (xx = 0, x1 = xStart; xx < xxLimit; ++xx, ++x1) {
+ if (state->clip->test(x1, y1)) {
+ alpha = p[xx];
+ if (alpha != 0) {
+ pipe.shape = (SplashCoord)(alpha / 255.0);
+ pipeRun(&pipe);
+ updateModX(x1);
+ updateModY(y1);
+ } else {
+ pipeIncX(&pipe);
+ }
+ } else {
+ pipeIncX(&pipe);
+ }
+ }
+ p += glyph->w;
+ }
+ } else {
+ const int widthEight = (int)ceil(glyph->w / 8.0);
+
+ pipeInit(&pipe, xStart, yStart,
+ state->fillPattern, NULL, state->fillAlpha, gFalse, gFalse);
+ for (yy = 0, y1 = yStart; yy < yyLimit; ++yy, ++y1) {
+ pipeSetXY(&pipe, xStart, y1);
+ for (xx = 0, x1 = xStart; xx < xxLimit; xx += 8) {
+ alpha0 = p[xx / 8];
+ for (xx1 = 0; xx1 < 8 && xx + xx1 < xxLimit; ++xx1, ++x1) {
+ if (state->clip->test(x1, y1)) {
+ if (alpha0 & 0x80) {
+ pipeRun(&pipe);
+ updateModX(x1);
+ updateModY(y1);
+ } else {
+ pipeIncX(&pipe);
+ }
+ } else {
+ pipeIncX(&pipe);
+ }
+ alpha0 <<= 1;
+ }
+ }
+ p += widthEight;
+ }
+ }
+ }
+}
+
+SplashError Splash::fillImageMask(SplashImageMaskSource src, void *srcData,
+ int w, int h, SplashCoord *mat,
+ GBool glyphMode) {
+ SplashPipe pipe;
+ GBool rot;
+ SplashCoord xScale, yScale, xShear, yShear, yShear1;
+ int tx, tx2, ty, ty2, scaledWidth, scaledHeight, xSign, ySign;
+ int ulx, uly, llx, lly, urx, ury, lrx, lry;
+ int ulx1, uly1, llx1, lly1, urx1, ury1, lrx1, lry1;
+ int xMin, xMax, yMin, yMax;
+ SplashClipResult clipRes, clipRes2;
+ int yp, yq, yt, yStep, lastYStep;
+ int xp, xq, xt, xStep, xSrc;
+ int k1, spanXMin, spanXMax, spanY;
+ SplashColorPtr pixBuf, p;
+ int pixAcc;
+ int x, y, x1, x2, y2;
+ SplashCoord y1;
+ int n, m, i, j;
+
+ if (debugMode) {
+ printf("fillImageMask: w=%d h=%d mat=[%.2f %.2f %.2f %.2f %.2f %.2f]\n",
+ w, h, (double)mat[0], (double)mat[1], (double)mat[2],
+ (double)mat[3], (double)mat[4], (double)mat[5]);
+ }
+
+ if (w == 0 && h == 0) return splashErrZeroImage;
+
+ // check for singular matrix
+ if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.000001) {
+ return splashErrSingularMatrix;
+ }
+
+ // compute scale, shear, rotation, translation parameters
+ rot = splashAbs(mat[1]) > splashAbs(mat[0]);
+ if (rot) {
+ xScale = -mat[1];
+ yScale = mat[2] - (mat[0] * mat[3]) / mat[1];
+ xShear = -mat[3] / yScale;
+ yShear = -mat[0] / mat[1];
+ } else {
+ xScale = mat[0];
+ yScale = mat[3] - (mat[1] * mat[2]) / mat[0];
+ xShear = mat[2] / yScale;
+ yShear = mat[1] / mat[0];
+ }
+ // Note 1: The PDF spec says that all pixels whose *centers* lie
+ // within the region get painted -- but that doesn't seem to match
+ // up with what Acrobat actually does: it ends up leaving gaps
+ // between image stripes. So we use the same rule here as for
+ // fills: any pixel that overlaps the region gets painted.
+ // Note 2: The "glyphMode" flag is a kludge: it switches back to
+ // "correct" behavior (matching the spec), for use in rendering Type
+ // 3 fonts.
+ // Note 3: The +/-0.01 in these computations is to avoid floating
+ // point precision problems which can lead to gaps between image
+ // stripes (it can cause image stripes to overlap, but that's a much
+ // less visible problem).
+ if (glyphMode) {
+ if (xScale >= 0) {
+ tx = splashRound(mat[4]);
+ tx2 = splashRound(mat[4] + xScale) - 1;
+ } else {
+ tx = splashRound(mat[4]) - 1;
+ tx2 = splashRound(mat[4] + xScale);
+ }
+ } else {
+ if (xScale >= 0) {
+ tx = splashFloor(mat[4] - 0.01);
+ tx2 = splashFloor(mat[4] + xScale + 0.01);
+ } else {
+ tx = splashFloor(mat[4] + 0.01);
+ tx2 = splashFloor(mat[4] + xScale - 0.01);
+ }
+ }
+ scaledWidth = abs(tx2 - tx) + 1;
+ if (glyphMode) {
+ if (yScale >= 0) {
+ ty = splashRound(mat[5]);
+ ty2 = splashRound(mat[5] + yScale) - 1;
+ } else {
+ ty = splashRound(mat[5]) - 1;
+ ty2 = splashRound(mat[5] + yScale);
+ }
+ } else {
+ if (yScale >= 0) {
+ ty = splashFloor(mat[5] - 0.01);
+ ty2 = splashFloor(mat[5] + yScale + 0.01);
+ } else {
+ ty = splashFloor(mat[5] + 0.01);
+ ty2 = splashFloor(mat[5] + yScale - 0.01);
+ }
+ }
+ scaledHeight = abs(ty2 - ty) + 1;
+ xSign = (xScale < 0) ? -1 : 1;
+ ySign = (yScale < 0) ? -1 : 1;
+ yShear1 = (SplashCoord)xSign * yShear;
+
+ // clipping
+ ulx1 = 0;
+ uly1 = 0;
+ urx1 = xSign * (scaledWidth - 1);
+ ury1 = (int)(yShear * urx1);
+ llx1 = splashRound(xShear * ySign * (scaledHeight - 1));
+ lly1 = ySign * (scaledHeight - 1) + (int)(yShear * llx1);
+ lrx1 = xSign * (scaledWidth - 1) +
+ splashRound(xShear * ySign * (scaledHeight - 1));
+ lry1 = ySign * (scaledHeight - 1) + (int)(yShear * lrx1);
+ if (rot) {
+ ulx = tx + uly1; uly = ty - ulx1;
+ urx = tx + ury1; ury = ty - urx1;
+ llx = tx + lly1; lly = ty - llx1;
+ lrx = tx + lry1; lry = ty - lrx1;
+ } else {
+ ulx = tx + ulx1; uly = ty + uly1;
+ urx = tx + urx1; ury = ty + ury1;
+ llx = tx + llx1; lly = ty + lly1;
+ lrx = tx + lrx1; lry = ty + lry1;
+ }
+ xMin = (ulx < urx) ? (ulx < llx) ? (ulx < lrx) ? ulx : lrx
+ : (llx < lrx) ? llx : lrx
+ : (urx < llx) ? (urx < lrx) ? urx : lrx
+ : (llx < lrx) ? llx : lrx;
+ xMax = (ulx > urx) ? (ulx > llx) ? (ulx > lrx) ? ulx : lrx
+ : (llx > lrx) ? llx : lrx
+ : (urx > llx) ? (urx > lrx) ? urx : lrx
+ : (llx > lrx) ? llx : lrx;
+ yMin = (uly < ury) ? (uly < lly) ? (uly < lry) ? uly : lry
+ : (lly < lry) ? lly : lry
+ : (ury < lly) ? (ury < lry) ? ury : lry
+ : (lly < lry) ? lly : lry;
+ yMax = (uly > ury) ? (uly > lly) ? (uly > lry) ? uly : lry
+ : (lly > lry) ? lly : lry
+ : (ury > lly) ? (ury > lry) ? ury : lry
+ : (lly > lry) ? lly : lry;
+ clipRes = state->clip->testRect(xMin, yMin, xMax, yMax);
+ opClipRes = clipRes;
+
+ // compute Bresenham parameters for x and y scaling
+ yp = h / scaledHeight;
+ yq = h % scaledHeight;
+ xp = w / scaledWidth;
+ xq = w % scaledWidth;
+
+ // allocate pixel buffer
+ if (yp < 0 || yp > INT_MAX - 1) {
+ return splashErrBadArg;
+ }
+ pixBuf = (SplashColorPtr)gmallocn(yp + 1, w);
+
+ // initialize the pixel pipe
+ pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha,
+ gTrue, gFalse);
+ if (vectorAntialias) {
+ drawAAPixelInit();
+ }
+
+ // init y scale Bresenham
+ yt = 0;
+ lastYStep = 1;
+
+ for (y = 0; y < scaledHeight; ++y) {
+
+ // y scale Bresenham
+ yStep = yp;
+ yt += yq;
+ if (yt >= scaledHeight) {
+ yt -= scaledHeight;
+ ++yStep;
+ }
+
+ // read row(s) from image
+ n = (yp > 0) ? yStep : lastYStep;
+ if (n > 0) {
+ p = pixBuf;
+ for (i = 0; i < n; ++i) {
+ (*src)(srcData, p);
+ p += w;
+ }
+ }
+ lastYStep = yStep;
+
+ // loop-invariant constants
+ k1 = splashRound(xShear * ySign * y);
+
+ // clipping test
+ if (clipRes != splashClipAllInside &&
+ !rot &&
+ (int)(yShear * k1) ==
+ (int)(yShear * (xSign * (scaledWidth - 1) + k1))) {
+ if (xSign > 0) {
+ spanXMin = tx + k1;
+ spanXMax = spanXMin + (scaledWidth - 1);
+ } else {
+ spanXMax = tx + k1;
+ spanXMin = spanXMax - (scaledWidth - 1);
+ }
+ spanY = ty + ySign * y + (int)(yShear * k1);
+ clipRes2 = state->clip->testSpan(spanXMin, spanXMax, spanY);
+ if (clipRes2 == splashClipAllOutside) {
+ continue;
+ }
+ } else {
+ clipRes2 = clipRes;
+ }
+
+ // init x scale Bresenham
+ xt = 0;
+ xSrc = 0;
+
+ // x shear
+ x1 = k1;
+
+ // y shear
+ y1 = (SplashCoord)ySign * y + yShear * x1;
+ // this is a kludge: if yShear1 is negative, then (int)y1 would
+ // change immediately after the first pixel, which is not what we
+ // want
+ if (yShear1 < 0) {
+ y1 += 0.999;
+ }
+
+ // loop-invariant constants
+ n = yStep > 0 ? yStep : 1;
+
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the alpha value for (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ p = pixBuf + xSrc;
+ pixAcc = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc += *p++;
+ }
+ p += w - m;
+ }
+
+ // blend fill color with background
+ if (pixAcc != 0) {
+ pipe.shape = (pixAcc == n * m)
+ ? (SplashCoord)1
+ : (SplashCoord)pixAcc / (SplashCoord)(n * m);
+ if (vectorAntialias && clipRes2 != splashClipAllInside) {
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2, clipRes2 == splashClipAllInside);
+ }
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ }
+
+ // free memory
+ gfree(pixBuf);
+
+ return splashOk;
+}
+
+SplashError Splash::drawImage(SplashImageSource src, void *srcData,
+ SplashColorMode srcMode, GBool srcAlpha,
+ int w, int h, SplashCoord *mat) {
+ SplashPipe pipe;
+ GBool ok, rot;
+ SplashCoord xScale, yScale, xShear, yShear, yShear1;
+ int tx, tx2, ty, ty2, scaledWidth, scaledHeight, xSign, ySign;
+ int ulx, uly, llx, lly, urx, ury, lrx, lry;
+ int ulx1, uly1, llx1, lly1, urx1, ury1, lrx1, lry1;
+ int xMin, xMax, yMin, yMax;
+ SplashClipResult clipRes, clipRes2;
+ int yp, yq, yt, yStep, lastYStep;
+ int xp, xq, xt, xStep, xSrc;
+ int k1, spanXMin, spanXMax, spanY;
+ SplashColorPtr colorBuf, p;
+ SplashColor pix;
+ Guchar *alphaBuf, *q;
+#if SPLASH_CMYK
+ int pixAcc0, pixAcc1, pixAcc2, pixAcc3;
+#else
+ int pixAcc0, pixAcc1, pixAcc2;
+#endif
+ int alphaAcc;
+ SplashCoord pixMul, alphaMul, alpha;
+ int x, y, x1, x2, y2;
+ SplashCoord y1;
+ int nComps, n, m, i, j;
+
+ if (debugMode) {
+ printf("drawImage: srcMode=%d srcAlpha=%d w=%d h=%d mat=[%.2f %.2f %.2f %.2f %.2f %.2f]\n",
+ srcMode, srcAlpha, w, h, (double)mat[0], (double)mat[1], (double)mat[2],
+ (double)mat[3], (double)mat[4], (double)mat[5]);
+ }
+
+ // check color modes
+ ok = gFalse; // make gcc happy
+ nComps = 0; // make gcc happy
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ ok = srcMode == splashModeMono8;
+ nComps = 1;
+ break;
+ case splashModeRGB8:
+ ok = srcMode == splashModeRGB8;
+ nComps = 3;
+ break;
+ case splashModeBGR8:
+ ok = srcMode == splashModeBGR8;
+ nComps = 3;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ ok = srcMode == splashModeCMYK8;
+ nComps = 4;
+ break;
+#endif
+ }
+ if (!ok) {
+ return splashErrModeMismatch;
+ }
+
+ // check for singular matrix
+ if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.000001) {
+ return splashErrSingularMatrix;
+ }
+
+ // compute scale, shear, rotation, translation parameters
+ rot = splashAbs(mat[1]) > splashAbs(mat[0]);
+ if (rot) {
+ xScale = -mat[1];
+ yScale = mat[2] - (mat[0] * mat[3]) / mat[1];
+ xShear = -mat[3] / yScale;
+ yShear = -mat[0] / mat[1];
+ } else {
+ xScale = mat[0];
+ yScale = mat[3] - (mat[1] * mat[2]) / mat[0];
+ xShear = mat[2] / yScale;
+ yShear = mat[1] / mat[0];
+ }
+ // Note 1: The PDF spec says that all pixels whose *centers* lie
+ // within the region get painted -- but that doesn't seem to match
+ // up with what Acrobat actually does: it ends up leaving gaps
+ // between image stripes. So we use the same rule here as for
+ // fills: any pixel that overlaps the region gets painted.
+ // Note 2: The +/-0.01 in these computations is to avoid floating
+ // point precision problems which can lead to gaps between image
+ // stripes (it can cause image stripes to overlap, but that's a much
+ // less visible problem).
+ if (xScale >= 0) {
+ tx = splashFloor(mat[4] - 0.01);
+ tx2 = splashFloor(mat[4] + xScale + 0.01);
+ } else {
+ tx = splashFloor(mat[4] + 0.01);
+ tx2 = splashFloor(mat[4] + xScale - 0.01);
+ }
+ scaledWidth = abs(tx2 - tx) + 1;
+ if (yScale >= 0) {
+ ty = splashFloor(mat[5] - 0.01);
+ ty2 = splashFloor(mat[5] + yScale + 0.01);
+ } else {
+ ty = splashFloor(mat[5] + 0.01);
+ ty2 = splashFloor(mat[5] + yScale - 0.01);
+ }
+ scaledHeight = abs(ty2 - ty) + 1;
+ xSign = (xScale < 0) ? -1 : 1;
+ ySign = (yScale < 0) ? -1 : 1;
+ yShear1 = (SplashCoord)xSign * yShear;
+
+ // clipping
+ ulx1 = 0;
+ uly1 = 0;
+ urx1 = xSign * (scaledWidth - 1);
+ ury1 = (int)(yShear * urx1);
+ llx1 = splashRound(xShear * ySign * (scaledHeight - 1));
+ lly1 = ySign * (scaledHeight - 1) + (int)(yShear * llx1);
+ lrx1 = xSign * (scaledWidth - 1) +
+ splashRound(xShear * ySign * (scaledHeight - 1));
+ lry1 = ySign * (scaledHeight - 1) + (int)(yShear * lrx1);
+ if (rot) {
+ ulx = tx + uly1; uly = ty - ulx1;
+ urx = tx + ury1; ury = ty - urx1;
+ llx = tx + lly1; lly = ty - llx1;
+ lrx = tx + lry1; lry = ty - lrx1;
+ } else {
+ ulx = tx + ulx1; uly = ty + uly1;
+ urx = tx + urx1; ury = ty + ury1;
+ llx = tx + llx1; lly = ty + lly1;
+ lrx = tx + lrx1; lry = ty + lry1;
+ }
+ xMin = (ulx < urx) ? (ulx < llx) ? (ulx < lrx) ? ulx : lrx
+ : (llx < lrx) ? llx : lrx
+ : (urx < llx) ? (urx < lrx) ? urx : lrx
+ : (llx < lrx) ? llx : lrx;
+ xMax = (ulx > urx) ? (ulx > llx) ? (ulx > lrx) ? ulx : lrx
+ : (llx > lrx) ? llx : lrx
+ : (urx > llx) ? (urx > lrx) ? urx : lrx
+ : (llx > lrx) ? llx : lrx;
+ yMin = (uly < ury) ? (uly < lly) ? (uly < lry) ? uly : lry
+ : (lly < lry) ? lly : lry
+ : (ury < lly) ? (ury < lry) ? ury : lry
+ : (lly < lry) ? lly : lry;
+ yMax = (uly > ury) ? (uly > lly) ? (uly > lry) ? uly : lry
+ : (lly > lry) ? lly : lry
+ : (ury > lly) ? (ury > lry) ? ury : lry
+ : (lly > lry) ? lly : lry;
+ clipRes = state->clip->testRect(xMin, yMin, xMax, yMax);
+ opClipRes = clipRes;
+ if (clipRes == splashClipAllOutside) {
+ return splashOk;
+ }
+
+ // compute Bresenham parameters for x and y scaling
+ yp = h / scaledHeight;
+ yq = h % scaledHeight;
+ xp = w / scaledWidth;
+ xq = w % scaledWidth;
+
+ // allocate pixel buffers
+ if (yp < 0 || yp > INT_MAX - 1 || w > INT_MAX / nComps) {
+ return splashErrBadArg;
+ }
+ colorBuf = (SplashColorPtr)gmallocn(yp + 1, w * nComps);
+ if (srcAlpha) {
+ alphaBuf = (Guchar *)gmallocn(yp + 1, w);
+ } else {
+ alphaBuf = NULL;
+ }
+
+ pixAcc0 = pixAcc1 = pixAcc2 = 0; // make gcc happy
+#if SPLASH_CMYK
+ pixAcc3 = 0; // make gcc happy
+#endif
+
+ // initialize the pixel pipe
+ pipeInit(&pipe, 0, 0, NULL, pix, state->fillAlpha,
+ srcAlpha || (vectorAntialias && clipRes != splashClipAllInside),
+ gFalse);
+ if (vectorAntialias) {
+ drawAAPixelInit();
+ }
+
+ if (srcAlpha) {
+
+ // init y scale Bresenham
+ yt = 0;
+ lastYStep = 1;
+
+ for (y = 0; y < scaledHeight; ++y) {
+
+ // y scale Bresenham
+ yStep = yp;
+ yt += yq;
+ if (yt >= scaledHeight) {
+ yt -= scaledHeight;
+ ++yStep;
+ }
+
+ // read row(s) from image
+ n = (yp > 0) ? yStep : lastYStep;
+ if (n > 0) {
+ p = colorBuf;
+ q = alphaBuf;
+ for (i = 0; i < n; ++i) {
+ (*src)(srcData, p, q);
+ p += w * nComps;
+ q += w;
+ }
+ }
+ lastYStep = yStep;
+
+ // loop-invariant constants
+ k1 = splashRound(xShear * ySign * y);
+
+ // clipping test
+ if (clipRes != splashClipAllInside &&
+ !rot &&
+ (int)(yShear * k1) ==
+ (int)(yShear * (xSign * (scaledWidth - 1) + k1))) {
+ if (xSign > 0) {
+ spanXMin = tx + k1;
+ spanXMax = spanXMin + (scaledWidth - 1);
+ } else {
+ spanXMax = tx + k1;
+ spanXMin = spanXMax - (scaledWidth - 1);
+ }
+ spanY = ty + ySign * y + (int)(yShear * k1);
+ clipRes2 = state->clip->testSpan(spanXMin, spanXMax, spanY);
+ if (clipRes2 == splashClipAllOutside) {
+ continue;
+ }
+ } else {
+ clipRes2 = clipRes;
+ }
+
+ // init x scale Bresenham
+ xt = 0;
+ xSrc = 0;
+
+ // x shear
+ x1 = k1;
+
+ // y shear
+ y1 = (SplashCoord)ySign * y + yShear * x1;
+ // this is a kludge: if yShear1 is negative, then (int)y1 would
+ // change immediately after the first pixel, which is not what
+ // we want
+ if (yShear1 < 0) {
+ y1 += 0.999;
+ }
+
+ // loop-invariant constants
+ n = yStep > 0 ? yStep : 1;
+
+ switch (srcMode) {
+
+ case splashModeMono1:
+ case splashModeMono8:
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the filtered pixel at (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ alphaAcc = 0;
+ p = colorBuf + xSrc;
+ q = alphaBuf + xSrc;
+ pixAcc0 = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc0 += *p++;
+ alphaAcc += *q++;
+ }
+ p += w - m;
+ q += w - m;
+ }
+ pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
+ alphaMul = pixMul * (1.0 / 255.0);
+ alpha = (SplashCoord)alphaAcc * alphaMul;
+
+ if (alpha > 0) {
+ pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
+
+ // set pixel
+ pipe.shape = alpha;
+ if (vectorAntialias && clipRes != splashClipAllInside) {
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2,
+ clipRes2 == splashClipAllInside);
+ }
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ break;
+
+ case splashModeRGB8:
+ case splashModeBGR8:
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the filtered pixel at (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ alphaAcc = 0;
+ p = colorBuf + xSrc * 3;
+ q = alphaBuf + xSrc;
+ pixAcc0 = pixAcc1 = pixAcc2 = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc0 += *p++;
+ pixAcc1 += *p++;
+ pixAcc2 += *p++;
+ alphaAcc += *q++;
+ }
+ p += 3 * (w - m);
+ q += w - m;
+ }
+ pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
+ alphaMul = pixMul * (1.0 / 255.0);
+ alpha = (SplashCoord)alphaAcc * alphaMul;
+
+ if (alpha > 0) {
+ pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
+ pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
+ pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
+
+ // set pixel
+ pipe.shape = alpha;
+ if (vectorAntialias && clipRes != splashClipAllInside) {
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2,
+ clipRes2 == splashClipAllInside);
+ }
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ break;
+
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the filtered pixel at (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ alphaAcc = 0;
+ p = colorBuf + xSrc * 4;
+ q = alphaBuf + xSrc;
+ pixAcc0 = pixAcc1 = pixAcc2 = pixAcc3 = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc0 += *p++;
+ pixAcc1 += *p++;
+ pixAcc2 += *p++;
+ pixAcc3 += *p++;
+ alphaAcc += *q++;
+ }
+ p += 4 * (w - m);
+ q += w - m;
+ }
+ pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
+ alphaMul = pixMul * (1.0 / 255.0);
+ alpha = (SplashCoord)alphaAcc * alphaMul;
+
+ if (alpha > 0) {
+ pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
+ pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
+ pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
+ pix[3] = (int)((SplashCoord)pixAcc3 * pixMul);
+
+ // set pixel
+ pipe.shape = alpha;
+ if (vectorAntialias && clipRes != splashClipAllInside) {
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2,
+ clipRes2 == splashClipAllInside);
+ }
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ break;
+#endif // SPLASH_CMYK
+ }
+ }
+
+ } else {
+
+ // init y scale Bresenham
+ yt = 0;
+ lastYStep = 1;
+
+ for (y = 0; y < scaledHeight; ++y) {
+
+ // y scale Bresenham
+ yStep = yp;
+ yt += yq;
+ if (yt >= scaledHeight) {
+ yt -= scaledHeight;
+ ++yStep;
+ }
+
+ // read row(s) from image
+ n = (yp > 0) ? yStep : lastYStep;
+ if (n > 0) {
+ p = colorBuf;
+ for (i = 0; i < n; ++i) {
+ (*src)(srcData, p, NULL);
+ p += w * nComps;
+ }
+ }
+ lastYStep = yStep;
+
+ // loop-invariant constants
+ k1 = splashRound(xShear * ySign * y);
+
+ // clipping test
+ if (clipRes != splashClipAllInside &&
+ !rot &&
+ (int)(yShear * k1) ==
+ (int)(yShear * (xSign * (scaledWidth - 1) + k1))) {
+ if (xSign > 0) {
+ spanXMin = tx + k1;
+ spanXMax = spanXMin + (scaledWidth - 1);
+ } else {
+ spanXMax = tx + k1;
+ spanXMin = spanXMax - (scaledWidth - 1);
+ }
+ spanY = ty + ySign * y + (int)(yShear * k1);
+ clipRes2 = state->clip->testSpan(spanXMin, spanXMax, spanY);
+ if (clipRes2 == splashClipAllOutside) {
+ continue;
+ }
+ } else {
+ clipRes2 = clipRes;
+ }
+
+ // init x scale Bresenham
+ xt = 0;
+ xSrc = 0;
+
+ // x shear
+ x1 = k1;
+
+ // y shear
+ y1 = (SplashCoord)ySign * y + yShear * x1;
+ // this is a kludge: if yShear1 is negative, then (int)y1 would
+ // change immediately after the first pixel, which is not what
+ // we want
+ if (yShear1 < 0) {
+ y1 += 0.999;
+ }
+
+ // loop-invariant constants
+ n = yStep > 0 ? yStep : 1;
+
+ switch (srcMode) {
+
+ case splashModeMono1:
+ case splashModeMono8:
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the filtered pixel at (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ p = colorBuf + xSrc;
+ pixAcc0 = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc0 += *p++;
+ }
+ p += w - m;
+ }
+ pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
+
+ pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
+
+ // set pixel
+ if (vectorAntialias && clipRes != splashClipAllInside) {
+ pipe.shape = (SplashCoord)1;
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2,
+ clipRes2 == splashClipAllInside);
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ break;
+
+ case splashModeRGB8:
+ case splashModeBGR8:
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the filtered pixel at (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ p = colorBuf + xSrc * 3;
+ pixAcc0 = pixAcc1 = pixAcc2 = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc0 += *p++;
+ pixAcc1 += *p++;
+ pixAcc2 += *p++;
+ }
+ p += 3 * (w - m);
+ }
+ pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
+
+ pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
+ pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
+ pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
+
+ // set pixel
+ if (vectorAntialias && clipRes != splashClipAllInside) {
+ pipe.shape = (SplashCoord)1;
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2,
+ clipRes2 == splashClipAllInside);
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ break;
+
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ for (x = 0; x < scaledWidth; ++x) {
+
+ // x scale Bresenham
+ xStep = xp;
+ xt += xq;
+ if (xt >= scaledWidth) {
+ xt -= scaledWidth;
+ ++xStep;
+ }
+
+ // rotation
+ if (rot) {
+ x2 = (int)y1;
+ y2 = -x1;
+ } else {
+ x2 = x1;
+ y2 = (int)y1;
+ }
+
+ // compute the filtered pixel at (x,y) after the x and y scaling
+ // operations
+ m = xStep > 0 ? xStep : 1;
+ p = colorBuf + xSrc * 4;
+ pixAcc0 = pixAcc1 = pixAcc2 = pixAcc3 = 0;
+ for (i = 0; i < n; ++i) {
+ for (j = 0; j < m; ++j) {
+ pixAcc0 += *p++;
+ pixAcc1 += *p++;
+ pixAcc2 += *p++;
+ pixAcc3 += *p++;
+ }
+ p += 4 * (w - m);
+ }
+ pixMul = (SplashCoord)1 / (SplashCoord)(n * m);
+
+ pix[0] = (int)((SplashCoord)pixAcc0 * pixMul);
+ pix[1] = (int)((SplashCoord)pixAcc1 * pixMul);
+ pix[2] = (int)((SplashCoord)pixAcc2 * pixMul);
+ pix[3] = (int)((SplashCoord)pixAcc3 * pixMul);
+
+ // set pixel
+ if (vectorAntialias && clipRes != splashClipAllInside) {
+ pipe.shape = (SplashCoord)1;
+ drawAAPixel(&pipe, tx + x2, ty + y2);
+ } else {
+ drawPixel(&pipe, tx + x2, ty + y2,
+ clipRes2 == splashClipAllInside);
+ }
+
+ // x scale Bresenham
+ xSrc += xStep;
+
+ // x shear
+ x1 += xSign;
+
+ // y shear
+ y1 += yShear1;
+ }
+ break;
+#endif // SPLASH_CMYK
+ }
+ }
+
+ }
+
+ gfree(colorBuf);
+ gfree(alphaBuf);
+
+ return splashOk;
+}
+
+SplashError Splash::composite(SplashBitmap *src, int xSrc, int ySrc,
+ int xDest, int yDest, int w, int h,
+ GBool noClip, GBool nonIsolated) {
+ SplashPipe pipe;
+ SplashColor pixel;
+ Guchar alpha;
+ Guchar *ap;
+ int x, y;
+
+ if (src->mode != bitmap->mode) {
+ return splashErrModeMismatch;
+ }
+
+ if (src->alpha) {
+ pipeInit(&pipe, xDest, yDest, NULL, pixel, state->fillAlpha,
+ gTrue, nonIsolated);
+ for (y = 0; y < h; ++y) {
+ pipeSetXY(&pipe, xDest, yDest + y);
+ ap = src->getAlphaPtr() + (ySrc + y) * src->getWidth() + xSrc;
+ for (x = 0; x < w; ++x) {
+ src->getPixel(xSrc + x, ySrc + y, pixel);
+ alpha = *ap++;
+ if (noClip || state->clip->test(xDest + x, yDest + y)) {
+ // this uses shape instead of alpha, which isn't technically
+ // correct, but works out the same
+ pipe.shape = (SplashCoord)(alpha / 255.0);
+ pipeRun(&pipe);
+ updateModX(xDest + x);
+ updateModY(yDest + y);
+ } else {
+ pipeIncX(&pipe);
+ }
+ }
+ }
+ } else {
+ pipeInit(&pipe, xDest, yDest, NULL, pixel, state->fillAlpha,
+ gFalse, nonIsolated);
+ for (y = 0; y < h; ++y) {
+ pipeSetXY(&pipe, xDest, yDest + y);
+ for (x = 0; x < w; ++x) {
+ src->getPixel(xSrc + x, ySrc + y, pixel);
+ if (noClip || state->clip->test(xDest + x, yDest + y)) {
+ pipeRun(&pipe);
+ updateModX(xDest + x);
+ updateModY(yDest + y);
+ } else {
+ pipeIncX(&pipe);
+ }
+ }
+ }
+ }
+
+ return splashOk;
+}
+
+void Splash::compositeBackground(SplashColorPtr color) {
+ SplashColorPtr p;
+ Guchar *q;
+ Guchar alpha, alpha1, c, color0, color1, color2, color3;
+ int x, y, mask;
+
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ color0 = color[0];
+ for (y = 0; y < bitmap->height; ++y) {
+ p = &bitmap->data[y * bitmap->rowSize];
+ q = &bitmap->alpha[y * bitmap->width];
+ mask = 0x80;
+ for (x = 0; x < bitmap->width; ++x) {
+ alpha = *q++;
+ alpha1 = 255 - alpha;
+ c = (*p & mask) ? 0xff : 0x00;
+ c = div255(alpha1 * color0 + alpha * c);
+ if (c & 0x80) {
+ *p |= mask;
+ } else {
+ *p &= ~mask;
+ }
+ if (!(mask >>= 1)) {
+ mask = 0x80;
+ ++p;
+ }
+ }
+ }
+ break;
+ case splashModeMono8:
+ color0 = color[0];
+ for (y = 0; y < bitmap->height; ++y) {
+ p = &bitmap->data[y * bitmap->rowSize];
+ q = &bitmap->alpha[y * bitmap->width];
+ for (x = 0; x < bitmap->width; ++x) {
+ alpha = *q++;
+ alpha1 = 255 - alpha;
+ p[0] = div255(alpha1 * color0 + alpha * p[0]);
+ ++p;
+ }
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ color0 = color[0];
+ color1 = color[1];
+ color2 = color[2];
+ for (y = 0; y < bitmap->height; ++y) {
+ p = &bitmap->data[y * bitmap->rowSize];
+ q = &bitmap->alpha[y * bitmap->width];
+ for (x = 0; x < bitmap->width; ++x) {
+ alpha = *q++;
+ alpha1 = 255 - alpha;
+ p[0] = div255(alpha1 * color0 + alpha * p[0]);
+ p[1] = div255(alpha1 * color1 + alpha * p[1]);
+ p[2] = div255(alpha1 * color2 + alpha * p[2]);
+ p += 3;
+ }
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ color0 = color[0];
+ color1 = color[1];
+ color2 = color[2];
+ color3 = color[3];
+ for (y = 0; y < bitmap->height; ++y) {
+ p = &bitmap->data[y * bitmap->rowSize];
+ q = &bitmap->alpha[y * bitmap->width];
+ for (x = 0; x < bitmap->width; ++x) {
+ alpha = *q++;
+ alpha1 = 255 - alpha;
+ p[0] = div255(alpha1 * color0 + alpha * p[0]);
+ p[1] = div255(alpha1 * color1 + alpha * p[1]);
+ p[2] = div255(alpha1 * color2 + alpha * p[2]);
+ p[3] = div255(alpha1 * color3 + alpha * p[3]);
+ p += 4;
+ }
+ }
+ break;
+#endif
+ }
+ memset(bitmap->alpha, 255, bitmap->width * bitmap->height);
+}
+
+SplashError Splash::blitTransparent(SplashBitmap *src, int xSrc, int ySrc,
+ int xDest, int yDest, int w, int h) {
+ SplashColor pixel;
+ SplashColorPtr p;
+ Guchar *q;
+ int x, y, mask;
+
+ if (src->mode != bitmap->mode) {
+ return splashErrModeMismatch;
+ }
+
+ switch (bitmap->mode) {
+ case splashModeMono1:
+ for (y = 0; y < h; ++y) {
+ p = &bitmap->data[(yDest + y) * bitmap->rowSize + (xDest >> 3)];
+ mask = 0x80 >> (xDest & 7);
+ for (x = 0; x < w; ++x) {
+ src->getPixel(xSrc + x, ySrc + y, pixel);
+ if (pixel[0]) {
+ *p |= mask;
+ } else {
+ *p &= ~mask;
+ }
+ if (!(mask >>= 1)) {
+ mask = 0x80;
+ ++p;
+ }
+ }
+ }
+ break;
+ case splashModeMono8:
+ for (y = 0; y < h; ++y) {
+ p = &bitmap->data[(yDest + y) * bitmap->rowSize + xDest];
+ for (x = 0; x < w; ++x) {
+ src->getPixel(xSrc + x, ySrc + y, pixel);
+ *p++ = pixel[0];
+ }
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ for (y = 0; y < h; ++y) {
+ p = &bitmap->data[(yDest + y) * bitmap->rowSize + 3 * xDest];
+ for (x = 0; x < w; ++x) {
+ src->getPixel(xSrc + x, ySrc + y, pixel);
+ *p++ = pixel[0];
+ *p++ = pixel[1];
+ *p++ = pixel[2];
+ }
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ for (y = 0; y < h; ++y) {
+ p = &bitmap->data[(yDest + y) * bitmap->rowSize + 4 * xDest];
+ for (x = 0; x < w; ++x) {
+ src->getPixel(xSrc + x, ySrc + y, pixel);
+ *p++ = pixel[0];
+ *p++ = pixel[1];
+ *p++ = pixel[2];
+ *p++ = pixel[3];
+ }
+ }
+ break;
+#endif
+ }
+
+ if (bitmap->alpha) {
+ for (y = 0; y < h; ++y) {
+ q = &bitmap->alpha[(yDest + y) * bitmap->width + xDest];
+ for (x = 0; x < w; ++x) {
+ *q++ = 0x00;
+ }
+ }
+ }
+
+ return splashOk;
+}
+
+SplashPath *Splash::makeStrokePath(SplashPath *path, GBool flatten) {
+ SplashPath *pathIn, *pathOut;
+ SplashCoord w, d, dx, dy, wdx, wdy, dxNext, dyNext, wdxNext, wdyNext;
+ SplashCoord crossprod, dotprod, miter, m;
+ GBool first, last, closed;
+ int subpathStart, next, i;
+ int left0, left1, left2, right0, right1, right2, join0, join1, join2;
+ int leftFirst, rightFirst, firstPt;
+
+ if (flatten) {
+ pathIn = flattenPath(path, state->matrix, state->flatness);
+ if (state->lineDashLength > 0) {
+ pathOut = makeDashedPath(pathIn);
+ delete pathIn;
+ pathIn = pathOut;
+ }
+ } else {
+ pathIn = path;
+ }
+
+ subpathStart = 0; // make gcc happy
+ closed = gFalse; // make gcc happy
+ left0 = left1 = right0 = right1 = join0 = join1 = 0; // make gcc happy
+ leftFirst = rightFirst = firstPt = 0; // make gcc happy
+
+ pathOut = new SplashPath();
+ w = state->lineWidth;
+
+ for (i = 0; i < pathIn->length - 1; ++i) {
+ if (pathIn->flags[i] & splashPathLast) {
+ continue;
+ }
+ if ((first = pathIn->flags[i] & splashPathFirst)) {
+ subpathStart = i;
+ closed = pathIn->flags[i] & splashPathClosed;
+ }
+ last = pathIn->flags[i+1] & splashPathLast;
+
+ // compute the deltas for segment (i, i+1)
+ d = splashDist(pathIn->pts[i].x, pathIn->pts[i].y,
+ pathIn->pts[i+1].x, pathIn->pts[i+1].y);
+ if (d == 0) {
+ // we need to draw end caps on zero-length lines
+ //~ not clear what the behavior should be for splashLineCapButt
+ //~ with d==0
+ dx = 0;
+ dy = 1;
+ } else {
+ d = (SplashCoord)1 / d;
+ dx = d * (pathIn->pts[i+1].x - pathIn->pts[i].x);
+ dy = d * (pathIn->pts[i+1].y - pathIn->pts[i].y);
+ }
+ wdx = (SplashCoord)0.5 * w * dx;
+ wdy = (SplashCoord)0.5 * w * dy;
+
+ // compute the deltas for segment (i+1, next)
+ next = last ? subpathStart + 1 : i + 2;
+ d = splashDist(pathIn->pts[i+1].x, pathIn->pts[i+1].y,
+ pathIn->pts[next].x, pathIn->pts[next].y);
+ if (d == 0) {
+ // we need to draw end caps on zero-length lines
+ //~ not clear what the behavior should be for splashLineCapButt
+ //~ with d==0
+ dxNext = 0;
+ dyNext = 1;
+ } else {
+ d = (SplashCoord)1 / d;
+ dxNext = d * (pathIn->pts[next].x - pathIn->pts[i+1].x);
+ dyNext = d * (pathIn->pts[next].y - pathIn->pts[i+1].y);
+ }
+ wdxNext = (SplashCoord)0.5 * w * dxNext;
+ wdyNext = (SplashCoord)0.5 * w * dyNext;
+
+ // draw the start cap
+ pathOut->moveTo(pathIn->pts[i].x - wdy, pathIn->pts[i].y + wdx);
+ if (i == subpathStart) {
+ firstPt = pathOut->length - 1;
+ }
+ if (first && !closed) {
+ switch (state->lineCap) {
+ case splashLineCapButt:
+ pathOut->lineTo(pathIn->pts[i].x + wdy, pathIn->pts[i].y - wdx);
+ break;
+ case splashLineCapRound:
+ pathOut->curveTo(pathIn->pts[i].x - wdy - bezierCircle * wdx,
+ pathIn->pts[i].y + wdx - bezierCircle * wdy,
+ pathIn->pts[i].x - wdx - bezierCircle * wdy,
+ pathIn->pts[i].y - wdy + bezierCircle * wdx,
+ pathIn->pts[i].x - wdx,
+ pathIn->pts[i].y - wdy);
+ pathOut->curveTo(pathIn->pts[i].x - wdx + bezierCircle * wdy,
+ pathIn->pts[i].y - wdy - bezierCircle * wdx,
+ pathIn->pts[i].x + wdy - bezierCircle * wdx,
+ pathIn->pts[i].y - wdx - bezierCircle * wdy,
+ pathIn->pts[i].x + wdy,
+ pathIn->pts[i].y - wdx);
+ break;
+ case splashLineCapProjecting:
+ pathOut->lineTo(pathIn->pts[i].x - wdx - wdy,
+ pathIn->pts[i].y + wdx - wdy);
+ pathOut->lineTo(pathIn->pts[i].x - wdx + wdy,
+ pathIn->pts[i].y - wdx - wdy);
+ pathOut->lineTo(pathIn->pts[i].x + wdy,
+ pathIn->pts[i].y - wdx);
+ break;
+ }
+ } else {
+ pathOut->lineTo(pathIn->pts[i].x + wdy, pathIn->pts[i].y - wdx);
+ }
+
+ // draw the left side of the segment rectangle
+ left2 = pathOut->length - 1;
+ pathOut->lineTo(pathIn->pts[i+1].x + wdy, pathIn->pts[i+1].y - wdx);
+
+ // draw the end cap
+ if (last && !closed) {
+ switch (state->lineCap) {
+ case splashLineCapButt:
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy, pathIn->pts[i+1].y + wdx);
+ break;
+ case splashLineCapRound:
+ pathOut->curveTo(pathIn->pts[i+1].x + wdy + bezierCircle * wdx,
+ pathIn->pts[i+1].y - wdx + bezierCircle * wdy,
+ pathIn->pts[i+1].x + wdx + bezierCircle * wdy,
+ pathIn->pts[i+1].y + wdy - bezierCircle * wdx,
+ pathIn->pts[i+1].x + wdx,
+ pathIn->pts[i+1].y + wdy);
+ pathOut->curveTo(pathIn->pts[i+1].x + wdx - bezierCircle * wdy,
+ pathIn->pts[i+1].y + wdy + bezierCircle * wdx,
+ pathIn->pts[i+1].x - wdy + bezierCircle * wdx,
+ pathIn->pts[i+1].y + wdx + bezierCircle * wdy,
+ pathIn->pts[i+1].x - wdy,
+ pathIn->pts[i+1].y + wdx);
+ break;
+ case splashLineCapProjecting:
+ pathOut->lineTo(pathIn->pts[i+1].x + wdy + wdx,
+ pathIn->pts[i+1].y - wdx + wdy);
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy + wdx,
+ pathIn->pts[i+1].y + wdx + wdy);
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy,
+ pathIn->pts[i+1].y + wdx);
+ break;
+ }
+ } else {
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy, pathIn->pts[i+1].y + wdx);
+ }
+
+ // draw the right side of the segment rectangle
+ right2 = pathOut->length - 1;
+ pathOut->close();
+
+ // draw the join
+ join2 = pathOut->length;
+ if (!last || closed) {
+ crossprod = dx * dyNext - dy * dxNext;
+ dotprod = -(dx * dxNext + dy * dyNext);
+ if (dotprod > 0.99999) {
+ // avoid a divide-by-zero -- set miter to something arbitrary
+ // such that sqrt(miter) will exceed miterLimit (and m is never
+ // used in that situation)
+ miter = (state->miterLimit + 1) * (state->miterLimit + 1);
+ m = 0;
+ } else {
+ miter = (SplashCoord)2 / ((SplashCoord)1 - dotprod);
+ if (miter < 1) {
+ // this can happen because of floating point inaccuracies
+ miter = 1;
+ }
+ m = splashSqrt(miter - 1);
+ }
+
+ // round join
+ if (state->lineJoin == splashLineJoinRound) {
+ pathOut->moveTo(pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y);
+ pathOut->curveTo(pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y + bezierCircle2 * w,
+ pathIn->pts[i+1].x + bezierCircle2 * w,
+ pathIn->pts[i+1].y + (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].x,
+ pathIn->pts[i+1].y + (SplashCoord)0.5 * w);
+ pathOut->curveTo(pathIn->pts[i+1].x - bezierCircle2 * w,
+ pathIn->pts[i+1].y + (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].x - (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y + bezierCircle2 * w,
+ pathIn->pts[i+1].x - (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y);
+ pathOut->curveTo(pathIn->pts[i+1].x - (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y - bezierCircle2 * w,
+ pathIn->pts[i+1].x - bezierCircle2 * w,
+ pathIn->pts[i+1].y - (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].x,
+ pathIn->pts[i+1].y - (SplashCoord)0.5 * w);
+ pathOut->curveTo(pathIn->pts[i+1].x + bezierCircle2 * w,
+ pathIn->pts[i+1].y - (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y - bezierCircle2 * w,
+ pathIn->pts[i+1].x + (SplashCoord)0.5 * w,
+ pathIn->pts[i+1].y);
+
+ } else {
+ pathOut->moveTo(pathIn->pts[i+1].x, pathIn->pts[i+1].y);
+
+ // angle < 180
+ if (crossprod < 0) {
+ pathOut->lineTo(pathIn->pts[i+1].x - wdyNext,
+ pathIn->pts[i+1].y + wdxNext);
+ // miter join inside limit
+ if (state->lineJoin == splashLineJoinMiter &&
+ splashSqrt(miter) <= state->miterLimit) {
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy + wdx * m,
+ pathIn->pts[i+1].y + wdx + wdy * m);
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy,
+ pathIn->pts[i+1].y + wdx);
+ // bevel join or miter join outside limit
+ } else {
+ pathOut->lineTo(pathIn->pts[i+1].x - wdy, pathIn->pts[i+1].y + wdx);
+ }
+
+ // angle >= 180
+ } else {
+ pathOut->lineTo(pathIn->pts[i+1].x + wdy,
+ pathIn->pts[i+1].y - wdx);
+ // miter join inside limit
+ if (state->lineJoin == splashLineJoinMiter &&
+ splashSqrt(miter) <= state->miterLimit) {
+ pathOut->lineTo(pathIn->pts[i+1].x + wdy + wdx * m,
+ pathIn->pts[i+1].y - wdx + wdy * m);
+ pathOut->lineTo(pathIn->pts[i+1].x + wdyNext,
+ pathIn->pts[i+1].y - wdxNext);
+ // bevel join or miter join outside limit
+ } else {
+ pathOut->lineTo(pathIn->pts[i+1].x + wdyNext,
+ pathIn->pts[i+1].y - wdxNext);
+ }
+ }
+ }
+
+ pathOut->close();
+ }
+
+ // add stroke adjustment hints
+ if (state->strokeAdjust) {
+ if (i >= subpathStart + 1) {
+ if (i >= subpathStart + 2) {
+ pathOut->addStrokeAdjustHint(left1, right1, left0 + 1, right0);
+ pathOut->addStrokeAdjustHint(left1, right1, join0, left2);
+ } else {
+ pathOut->addStrokeAdjustHint(left1, right1, firstPt, left2);
+ }
+ pathOut->addStrokeAdjustHint(left1, right1, right2 + 1, right2 + 1);
+ }
+ left0 = left1;
+ left1 = left2;
+ right0 = right1;
+ right1 = right2;
+ join0 = join1;
+ join1 = join2;
+ if (i == subpathStart) {
+ leftFirst = left2;
+ rightFirst = right2;
+ }
+ if (last) {
+ if (i >= subpathStart + 2) {
+ pathOut->addStrokeAdjustHint(left1, right1, left0 + 1, right0);
+ pathOut->addStrokeAdjustHint(left1, right1,
+ join0, pathOut->length - 1);
+ } else {
+ pathOut->addStrokeAdjustHint(left1, right1,
+ firstPt, pathOut->length - 1);
+ }
+ if (closed) {
+ pathOut->addStrokeAdjustHint(left1, right1, firstPt, leftFirst);
+ pathOut->addStrokeAdjustHint(left1, right1,
+ rightFirst + 1, rightFirst + 1);
+ pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
+ left1 + 1, right1);
+ pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
+ join1, pathOut->length - 1);
+ }
+ }
+ }
+ }
+
+ if (pathIn != path) {
+ delete pathIn;
+ }
+
+ return pathOut;
+}
+
+void Splash::dumpPath(SplashPath *path) {
+ int i;
+
+ for (i = 0; i < path->length; ++i) {
+ printf(" %3d: x=%8.2f y=%8.2f%s%s%s%s\n",
+ i, (double)path->pts[i].x, (double)path->pts[i].y,
+ (path->flags[i] & splashPathFirst) ? " first" : "",
+ (path->flags[i] & splashPathLast) ? " last" : "",
+ (path->flags[i] & splashPathClosed) ? " closed" : "",
+ (path->flags[i] & splashPathCurve) ? " curve" : "");
+ }
+}
+
+void Splash::dumpXPath(SplashXPath *path) {
+ int i;
+
+ for (i = 0; i < path->length; ++i) {
+ printf(" %4d: x0=%8.2f y0=%8.2f x1=%8.2f y1=%8.2f %s%s%s%s%s%s%s\n",
+ i, (double)path->segs[i].x0, (double)path->segs[i].y0,
+ (double)path->segs[i].x1, (double)path->segs[i].y1,
+ (path->segs[i].flags & splashXPathFirst) ? "F" : " ",
+ (path->segs[i].flags & splashXPathLast) ? "L" : " ",
+ (path->segs[i].flags & splashXPathEnd0) ? "0" : " ",
+ (path->segs[i].flags & splashXPathEnd1) ? "1" : " ",
+ (path->segs[i].flags & splashXPathHoriz) ? "H" : " ",
+ (path->segs[i].flags & splashXPathVert) ? "V" : " ",
+ (path->segs[i].flags & splashXPathFlip) ? "P" : " ");
+ }
+}
diff --git a/kpdf/xpdf/splash/SplashBitmap.cc b/kpdf/xpdf/splash/SplashBitmap.cc
deleted file mode 100644
index 62bbd8e8..00000000
--- a/kpdf/xpdf/splash/SplashBitmap.cc
+++ /dev/null
@@ -1,207 +0,0 @@
-//========================================================================
-//
-// SplashBitmap.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <limits.h>
-#include "gmem.h"
-#include "SplashErrorCodes.h"
-#include "SplashBitmap.h"
-
-//------------------------------------------------------------------------
-// SplashBitmap
-//------------------------------------------------------------------------
-
-SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPad,
- SplashColorMode modeA, GBool alphaA,
- GBool topDown) {
- width = widthA;
- height = heightA;
- mode = modeA;
- switch (mode) {
- case splashModeMono1:
- if (width > 0) {
- rowSize = (width + 7) >> 3;
- } else {
- rowSize = -1;
- }
- break;
- case splashModeMono8:
- if (width > 0) {
- rowSize = width;
- } else {
- rowSize = -1;
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- if (width > 0 && width <= INT_MAX / 3) {
- rowSize = width * 3;
- } else {
- rowSize = -1;
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- if (width > 0 && width <= INT_MAX / 4) {
- rowSize = width * 4;
- } else {
- rowSize = -1;
- }
- break;
-#endif
- }
- if (rowSize > 0) {
- rowSize += rowPad - 1;
- rowSize -= rowSize % rowPad;
- }
- data = (SplashColorPtr)gmallocn(height, rowSize);
- if (!topDown) {
- data += (height - 1) * rowSize;
- rowSize = -rowSize;
- }
- if (alphaA) {
- alpha = (Guchar *)gmallocn(width, height);
- } else {
- alpha = NULL;
- }
-}
-
-
-SplashBitmap::~SplashBitmap() {
- if (rowSize < 0) {
- gfree(data + (height - 1) * rowSize);
- } else {
- gfree(data);
- }
- gfree(alpha);
-}
-
-SplashError SplashBitmap::writePNMFile(char *fileName) {
- FILE *f;
- SplashColorPtr row, p;
- int x, y;
-
- if (!(f = fopen(fileName, "wb"))) {
- return splashErrOpenFile;
- }
-
- switch (mode) {
-
- case splashModeMono1:
- fprintf(f, "P4\n%d %d\n", width, height);
- row = data;
- for (y = 0; y < height; ++y) {
- p = row;
- for (x = 0; x < width; x += 8) {
- fputc(*p ^ 0xff, f);
- ++p;
- }
- row += rowSize;
- }
- break;
-
- case splashModeMono8:
- fprintf(f, "P5\n%d %d\n255\n", width, height);
- row = data;
- for (y = 0; y < height; ++y) {
- p = row;
- for (x = 0; x < width; ++x) {
- fputc(*p, f);
- ++p;
- }
- row += rowSize;
- }
- break;
-
- case splashModeRGB8:
- fprintf(f, "P6\n%d %d\n255\n", width, height);
- row = data;
- for (y = 0; y < height; ++y) {
- p = row;
- for (x = 0; x < width; ++x) {
- fputc(splashRGB8R(p), f);
- fputc(splashRGB8G(p), f);
- fputc(splashRGB8B(p), f);
- p += 3;
- }
- row += rowSize;
- }
- break;
-
- case splashModeBGR8:
- fprintf(f, "P6\n%d %d\n255\n", width, height);
- row = data;
- for (y = 0; y < height; ++y) {
- p = row;
- for (x = 0; x < width; ++x) {
- fputc(splashBGR8R(p), f);
- fputc(splashBGR8G(p), f);
- fputc(splashBGR8B(p), f);
- p += 3;
- }
- row += rowSize;
- }
- break;
-
-#if SPLASH_CMYK
- case splashModeCMYK8:
- // PNM doesn't support CMYK
- break;
-#endif
- }
-
- fclose(f);
- return splashOk;
-}
-
-void SplashBitmap::getPixel(int x, int y, SplashColorPtr pixel) {
- SplashColorPtr p;
-
- if (y < 0 || y >= height || x < 0 || x >= width) {
- return;
- }
- switch (mode) {
- case splashModeMono1:
- p = &data[y * rowSize + (x >> 3)];
- pixel[0] = (p[0] & (0x80 >> (x & 7))) ? 0xff : 0x00;
- break;
- case splashModeMono8:
- p = &data[y * rowSize + x];
- pixel[0] = p[0];
- break;
- case splashModeRGB8:
- p = &data[y * rowSize + 3 * x];
- pixel[0] = p[0];
- pixel[1] = p[1];
- pixel[2] = p[2];
- break;
- case splashModeBGR8:
- p = &data[y * rowSize + 3 * x];
- pixel[0] = p[2];
- pixel[1] = p[1];
- pixel[2] = p[0];
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- p = &data[y * rowSize + 4 * x];
- pixel[0] = p[0];
- pixel[1] = p[1];
- pixel[2] = p[2];
- pixel[3] = p[3];
- break;
-#endif
- }
-}
-
-Guchar SplashBitmap::getAlpha(int x, int y) {
- return alpha[y * width + x];
-}
diff --git a/kpdf/xpdf/splash/SplashBitmap.cpp b/kpdf/xpdf/splash/SplashBitmap.cpp
new file mode 100644
index 00000000..5b5d28d1
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashBitmap.cpp
@@ -0,0 +1,207 @@
+//========================================================================
+//
+// SplashBitmap.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <limits.h>
+#include "gmem.h"
+#include "SplashErrorCodes.h"
+#include "SplashBitmap.h"
+
+//------------------------------------------------------------------------
+// SplashBitmap
+//------------------------------------------------------------------------
+
+SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPad,
+ SplashColorMode modeA, GBool alphaA,
+ GBool topDown) {
+ width = widthA;
+ height = heightA;
+ mode = modeA;
+ switch (mode) {
+ case splashModeMono1:
+ if (width > 0) {
+ rowSize = (width + 7) >> 3;
+ } else {
+ rowSize = -1;
+ }
+ break;
+ case splashModeMono8:
+ if (width > 0) {
+ rowSize = width;
+ } else {
+ rowSize = -1;
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ if (width > 0 && width <= INT_MAX / 3) {
+ rowSize = width * 3;
+ } else {
+ rowSize = -1;
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ if (width > 0 && width <= INT_MAX / 4) {
+ rowSize = width * 4;
+ } else {
+ rowSize = -1;
+ }
+ break;
+#endif
+ }
+ if (rowSize > 0) {
+ rowSize += rowPad - 1;
+ rowSize -= rowSize % rowPad;
+ }
+ data = (SplashColorPtr)gmallocn(height, rowSize);
+ if (!topDown) {
+ data += (height - 1) * rowSize;
+ rowSize = -rowSize;
+ }
+ if (alphaA) {
+ alpha = (Guchar *)gmallocn(width, height);
+ } else {
+ alpha = NULL;
+ }
+}
+
+
+SplashBitmap::~SplashBitmap() {
+ if (rowSize < 0) {
+ gfree(data + (height - 1) * rowSize);
+ } else {
+ gfree(data);
+ }
+ gfree(alpha);
+}
+
+SplashError SplashBitmap::writePNMFile(char *fileName) {
+ FILE *f;
+ SplashColorPtr row, p;
+ int x, y;
+
+ if (!(f = fopen(fileName, "wb"))) {
+ return splashErrOpenFile;
+ }
+
+ switch (mode) {
+
+ case splashModeMono1:
+ fprintf(f, "P4\n%d %d\n", width, height);
+ row = data;
+ for (y = 0; y < height; ++y) {
+ p = row;
+ for (x = 0; x < width; x += 8) {
+ fputc(*p ^ 0xff, f);
+ ++p;
+ }
+ row += rowSize;
+ }
+ break;
+
+ case splashModeMono8:
+ fprintf(f, "P5\n%d %d\n255\n", width, height);
+ row = data;
+ for (y = 0; y < height; ++y) {
+ p = row;
+ for (x = 0; x < width; ++x) {
+ fputc(*p, f);
+ ++p;
+ }
+ row += rowSize;
+ }
+ break;
+
+ case splashModeRGB8:
+ fprintf(f, "P6\n%d %d\n255\n", width, height);
+ row = data;
+ for (y = 0; y < height; ++y) {
+ p = row;
+ for (x = 0; x < width; ++x) {
+ fputc(splashRGB8R(p), f);
+ fputc(splashRGB8G(p), f);
+ fputc(splashRGB8B(p), f);
+ p += 3;
+ }
+ row += rowSize;
+ }
+ break;
+
+ case splashModeBGR8:
+ fprintf(f, "P6\n%d %d\n255\n", width, height);
+ row = data;
+ for (y = 0; y < height; ++y) {
+ p = row;
+ for (x = 0; x < width; ++x) {
+ fputc(splashBGR8R(p), f);
+ fputc(splashBGR8G(p), f);
+ fputc(splashBGR8B(p), f);
+ p += 3;
+ }
+ row += rowSize;
+ }
+ break;
+
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ // PNM doesn't support CMYK
+ break;
+#endif
+ }
+
+ fclose(f);
+ return splashOk;
+}
+
+void SplashBitmap::getPixel(int x, int y, SplashColorPtr pixel) {
+ SplashColorPtr p;
+
+ if (y < 0 || y >= height || x < 0 || x >= width) {
+ return;
+ }
+ switch (mode) {
+ case splashModeMono1:
+ p = &data[y * rowSize + (x >> 3)];
+ pixel[0] = (p[0] & (0x80 >> (x & 7))) ? 0xff : 0x00;
+ break;
+ case splashModeMono8:
+ p = &data[y * rowSize + x];
+ pixel[0] = p[0];
+ break;
+ case splashModeRGB8:
+ p = &data[y * rowSize + 3 * x];
+ pixel[0] = p[0];
+ pixel[1] = p[1];
+ pixel[2] = p[2];
+ break;
+ case splashModeBGR8:
+ p = &data[y * rowSize + 3 * x];
+ pixel[0] = p[2];
+ pixel[1] = p[1];
+ pixel[2] = p[0];
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ p = &data[y * rowSize + 4 * x];
+ pixel[0] = p[0];
+ pixel[1] = p[1];
+ pixel[2] = p[2];
+ pixel[3] = p[3];
+ break;
+#endif
+ }
+}
+
+Guchar SplashBitmap::getAlpha(int x, int y) {
+ return alpha[y * width + x];
+}
diff --git a/kpdf/xpdf/splash/SplashClip.cc b/kpdf/xpdf/splash/SplashClip.cc
deleted file mode 100644
index ef8acbab..00000000
--- a/kpdf/xpdf/splash/SplashClip.cc
+++ /dev/null
@@ -1,382 +0,0 @@
-//========================================================================
-//
-// SplashClip.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "SplashErrorCodes.h"
-#include "SplashPath.h"
-#include "SplashXPath.h"
-#include "SplashXPathScanner.h"
-#include "SplashBitmap.h"
-#include "SplashClip.h"
-
-//------------------------------------------------------------------------
-// SplashClip.flags
-//------------------------------------------------------------------------
-
-#define splashClipEO 0x01 // use even-odd rule
-
-//------------------------------------------------------------------------
-// SplashClip
-//------------------------------------------------------------------------
-
-SplashClip::SplashClip(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
- GBool antialiasA) {
- antialias = antialiasA;
- if (x0 < x1) {
- xMin = x0;
- xMax = x1;
- } else {
- xMin = x1;
- xMax = x0;
- }
- if (y0 < y1) {
- yMin = y0;
- yMax = y1;
- } else {
- yMin = y1;
- yMax = y0;
- }
- xMinI = splashFloor(xMin);
- yMinI = splashFloor(yMin);
- xMaxI = splashFloor(xMax);
- yMaxI = splashFloor(yMax);
- paths = NULL;
- flags = NULL;
- scanners = NULL;
- length = size = 0;
-}
-
-SplashClip::SplashClip(SplashClip *clip) {
- int i;
-
- antialias = clip->antialias;
- xMin = clip->xMin;
- yMin = clip->yMin;
- xMax = clip->xMax;
- yMax = clip->yMax;
- xMinI = clip->xMinI;
- yMinI = clip->yMinI;
- xMaxI = clip->xMaxI;
- yMaxI = clip->yMaxI;
- length = clip->length;
- size = clip->size;
- paths = (SplashXPath **)gmallocn(size, sizeof(SplashXPath *));
- flags = (Guchar *)gmallocn(size, sizeof(Guchar));
- scanners = (SplashXPathScanner **)
- gmallocn(size, sizeof(SplashXPathScanner *));
- for (i = 0; i < length; ++i) {
- paths[i] = clip->paths[i]->copy();
- flags[i] = clip->flags[i];
- scanners[i] = new SplashXPathScanner(paths[i], flags[i] & splashClipEO);
- }
-}
-
-SplashClip::~SplashClip() {
- int i;
-
- for (i = 0; i < length; ++i) {
- delete paths[i];
- delete scanners[i];
- }
- gfree(paths);
- gfree(flags);
- gfree(scanners);
-}
-
-void SplashClip::grow(int nPaths) {
- if (length + nPaths > size) {
- if (size == 0) {
- size = 32;
- }
- while (size < length + nPaths) {
- size *= 2;
- }
- paths = (SplashXPath **)greallocn(paths, size, sizeof(SplashXPath *));
- flags = (Guchar *)greallocn(flags, size, sizeof(Guchar));
- scanners = (SplashXPathScanner **)
- greallocn(scanners, size, sizeof(SplashXPathScanner *));
- }
-}
-
-void SplashClip::resetToRect(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1) {
- int i;
-
- for (i = 0; i < length; ++i) {
- delete paths[i];
- delete scanners[i];
- }
- gfree(paths);
- gfree(flags);
- gfree(scanners);
- paths = NULL;
- flags = NULL;
- scanners = NULL;
- length = size = 0;
-
- if (x0 < x1) {
- xMin = x0;
- xMax = x1;
- } else {
- xMin = x1;
- xMax = x0;
- }
- if (y0 < y1) {
- yMin = y0;
- yMax = y1;
- } else {
- yMin = y1;
- yMax = y0;
- }
- xMinI = splashFloor(xMin);
- yMinI = splashFloor(yMin);
- xMaxI = splashFloor(xMax);
- yMaxI = splashFloor(yMax);
-}
-
-SplashError SplashClip::clipToRect(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1) {
- if (x0 < x1) {
- if (x0 > xMin) {
- xMin = x0;
- xMinI = splashFloor(xMin);
- }
- if (x1 < xMax) {
- xMax = x1;
- xMaxI = splashFloor(xMax);
- }
- } else {
- if (x1 > xMin) {
- xMin = x1;
- xMinI = splashFloor(xMin);
- }
- if (x0 < xMax) {
- xMax = x0;
- xMaxI = splashFloor(xMax);
- }
- }
- if (y0 < y1) {
- if (y0 > yMin) {
- yMin = y0;
- yMinI = splashFloor(yMin);
- }
- if (y1 < yMax) {
- yMax = y1;
- yMaxI = splashFloor(yMax);
- }
- } else {
- if (y1 > yMin) {
- yMin = y1;
- yMinI = splashFloor(yMin);
- }
- if (y0 < yMax) {
- yMax = y0;
- yMaxI = splashFloor(yMax);
- }
- }
- return splashOk;
-}
-
-SplashError SplashClip::clipToPath(SplashPath *path, SplashCoord *matrix,
- SplashCoord flatness, GBool eo) {
- SplashXPath *xPath;
-
- xPath = new SplashXPath(path, matrix, flatness, gTrue);
-
- // check for an empty path
- if (xPath->length == 0) {
- xMax = xMin - 1;
- yMax = yMin - 1;
- xMaxI = splashFloor(xMax);
- yMaxI = splashFloor(yMax);
- delete xPath;
-
- // check for a rectangle
- } else if (xPath->length == 4 &&
- ((xPath->segs[0].x0 == xPath->segs[0].x1 &&
- xPath->segs[0].x0 == xPath->segs[1].x0 &&
- xPath->segs[0].x0 == xPath->segs[3].x1 &&
- xPath->segs[2].x0 == xPath->segs[2].x1 &&
- xPath->segs[2].x0 == xPath->segs[1].x1 &&
- xPath->segs[2].x0 == xPath->segs[3].x0 &&
- xPath->segs[1].y0 == xPath->segs[1].y1 &&
- xPath->segs[1].y0 == xPath->segs[0].y1 &&
- xPath->segs[1].y0 == xPath->segs[2].y0 &&
- xPath->segs[3].y0 == xPath->segs[3].y1 &&
- xPath->segs[3].y0 == xPath->segs[0].y0 &&
- xPath->segs[3].y0 == xPath->segs[2].y1) ||
- (xPath->segs[0].y0 == xPath->segs[0].y1 &&
- xPath->segs[0].y0 == xPath->segs[1].y0 &&
- xPath->segs[0].y0 == xPath->segs[3].y1 &&
- xPath->segs[2].y0 == xPath->segs[2].y1 &&
- xPath->segs[2].y0 == xPath->segs[1].y1 &&
- xPath->segs[2].y0 == xPath->segs[3].y0 &&
- xPath->segs[1].x0 == xPath->segs[1].x1 &&
- xPath->segs[1].x0 == xPath->segs[0].x1 &&
- xPath->segs[1].x0 == xPath->segs[2].x0 &&
- xPath->segs[3].x0 == xPath->segs[3].x1 &&
- xPath->segs[3].x0 == xPath->segs[0].x0 &&
- xPath->segs[3].x0 == xPath->segs[2].x1))) {
- clipToRect(xPath->segs[0].x0, xPath->segs[0].y0,
- xPath->segs[2].x0, xPath->segs[2].y0);
- delete xPath;
-
- } else {
- grow(1);
- if (antialias) {
- xPath->aaScale();
- }
- xPath->sort();
- paths[length] = xPath;
- flags[length] = eo ? splashClipEO : 0;
- scanners[length] = new SplashXPathScanner(xPath, eo);
- ++length;
- }
-
- return splashOk;
-}
-
-GBool SplashClip::test(int x, int y) {
- int i;
-
- // check the rectangle
- if (x < xMinI || x > xMaxI || y < yMinI || y > yMaxI) {
- return gFalse;
- }
-
- // check the paths
- if (antialias) {
- for (i = 0; i < length; ++i) {
- if (!scanners[i]->test(x * splashAASize, y * splashAASize)) {
- return gFalse;
- }
- }
- } else {
- for (i = 0; i < length; ++i) {
- if (!scanners[i]->test(x, y)) {
- return gFalse;
- }
- }
- }
-
- return gTrue;
-}
-
-SplashClipResult SplashClip::testRect(int rectXMin, int rectYMin,
- int rectXMax, int rectYMax) {
- // This tests the rectangle:
- // x = [rectXMin, rectXMax + 1) (note: rect coords are ints)
- // y = [rectYMin, rectYMax + 1)
- // against the clipping region:
- // x = [xMin, xMax] (note: clipping coords are fp)
- // y = [yMin, yMax]
- if ((SplashCoord)(rectXMax + 1) <= xMin || (SplashCoord)rectXMin > xMax ||
- (SplashCoord)(rectYMax + 1) <= yMin || (SplashCoord)rectYMin > yMax) {
- return splashClipAllOutside;
- }
- if ((SplashCoord)rectXMin >= xMin && (SplashCoord)(rectXMax + 1) <= xMax &&
- (SplashCoord)rectYMin >= yMin && (SplashCoord)(rectYMax + 1) <= yMax &&
- length == 0) {
- return splashClipAllInside;
- }
- return splashClipPartial;
-}
-
-SplashClipResult SplashClip::testSpan(int spanXMin, int spanXMax, int spanY) {
- int i;
-
- // This tests the rectangle:
- // x = [spanXMin, spanXMax + 1) (note: span coords are ints)
- // y = [spanY, spanY + 1)
- // against the clipping region:
- // x = [xMin, xMax] (note: clipping coords are fp)
- // y = [yMin, yMax]
- if ((SplashCoord)(spanXMax + 1) <= xMin || (SplashCoord)spanXMin > xMax ||
- (SplashCoord)(spanY + 1) <= yMin || (SplashCoord)spanY > yMax) {
- return splashClipAllOutside;
- }
- if (!((SplashCoord)spanXMin >= xMin && (SplashCoord)(spanXMax + 1) <= xMax &&
- (SplashCoord)spanY >= yMin && (SplashCoord)(spanY + 1) <= yMax)) {
- return splashClipPartial;
- }
- if (antialias) {
- for (i = 0; i < length; ++i) {
- if (!scanners[i]->testSpan(spanXMin * splashAASize,
- spanXMax * splashAASize + (splashAASize - 1),
- spanY * splashAASize)) {
- return splashClipPartial;
- }
- }
- } else {
- for (i = 0; i < length; ++i) {
- if (!scanners[i]->testSpan(spanXMin, spanXMax, spanY)) {
- return splashClipPartial;
- }
- }
- }
- return splashClipAllInside;
-}
-
-void SplashClip::clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y) {
- int xx0, xx1, xx, yy, i;
- SplashColorPtr p;
-
- // zero out pixels with x < xMin
- xx0 = *x0 * splashAASize;
- xx1 = splashFloor(xMin * splashAASize);
- if (xx1 > aaBuf->getWidth()) {
- xx1 = aaBuf->getWidth();
- }
- if (xx0 < xx1) {
- xx0 &= ~7;
- for (yy = 0; yy < splashAASize; ++yy) {
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx0 >> 3);
- for (xx = xx0; xx + 7 < xx1; xx += 8) {
- *p++ = 0;
- }
- if (xx < xx1) {
- *p &= 0xff >> (xx1 & 7);
- }
- }
- *x0 = splashFloor(xMin);
- }
-
- // zero out pixels with x > xMax
- xx0 = splashFloor(xMax * splashAASize) + 1;
- if (xx0 < 0) {
- xx0 = 0;
- }
- xx1 = (*x1 + 1) * splashAASize;
- if (xx0 < xx1) {
- for (yy = 0; yy < splashAASize; ++yy) {
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx0 >> 3);
- xx = xx0;
- if (xx & 7) {
- *p &= 0xff00 >> (xx & 7);
- xx = (xx & ~7) + 8;
- ++p;
- }
- for (; xx < xx1; xx += 8) {
- *p++ = 0;
- }
- }
- *x1 = splashFloor(xMax);
- }
-
- // check the paths
- for (i = 0; i < length; ++i) {
- scanners[i]->clipAALine(aaBuf, x0, x1, y);
- }
-}
diff --git a/kpdf/xpdf/splash/SplashClip.cpp b/kpdf/xpdf/splash/SplashClip.cpp
new file mode 100644
index 00000000..ba03b7a4
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashClip.cpp
@@ -0,0 +1,382 @@
+//========================================================================
+//
+// SplashClip.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "SplashErrorCodes.h"
+#include "SplashPath.h"
+#include "SplashXPath.h"
+#include "SplashXPathScanner.h"
+#include "SplashBitmap.h"
+#include "SplashClip.h"
+
+//------------------------------------------------------------------------
+// SplashClip.flags
+//------------------------------------------------------------------------
+
+#define splashClipEO 0x01 // use even-odd rule
+
+//------------------------------------------------------------------------
+// SplashClip
+//------------------------------------------------------------------------
+
+SplashClip::SplashClip(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1,
+ GBool antialiasA) {
+ antialias = antialiasA;
+ if (x0 < x1) {
+ xMin = x0;
+ xMax = x1;
+ } else {
+ xMin = x1;
+ xMax = x0;
+ }
+ if (y0 < y1) {
+ yMin = y0;
+ yMax = y1;
+ } else {
+ yMin = y1;
+ yMax = y0;
+ }
+ xMinI = splashFloor(xMin);
+ yMinI = splashFloor(yMin);
+ xMaxI = splashFloor(xMax);
+ yMaxI = splashFloor(yMax);
+ paths = NULL;
+ flags = NULL;
+ scanners = NULL;
+ length = size = 0;
+}
+
+SplashClip::SplashClip(SplashClip *clip) {
+ int i;
+
+ antialias = clip->antialias;
+ xMin = clip->xMin;
+ yMin = clip->yMin;
+ xMax = clip->xMax;
+ yMax = clip->yMax;
+ xMinI = clip->xMinI;
+ yMinI = clip->yMinI;
+ xMaxI = clip->xMaxI;
+ yMaxI = clip->yMaxI;
+ length = clip->length;
+ size = clip->size;
+ paths = (SplashXPath **)gmallocn(size, sizeof(SplashXPath *));
+ flags = (Guchar *)gmallocn(size, sizeof(Guchar));
+ scanners = (SplashXPathScanner **)
+ gmallocn(size, sizeof(SplashXPathScanner *));
+ for (i = 0; i < length; ++i) {
+ paths[i] = clip->paths[i]->copy();
+ flags[i] = clip->flags[i];
+ scanners[i] = new SplashXPathScanner(paths[i], flags[i] & splashClipEO);
+ }
+}
+
+SplashClip::~SplashClip() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ delete paths[i];
+ delete scanners[i];
+ }
+ gfree(paths);
+ gfree(flags);
+ gfree(scanners);
+}
+
+void SplashClip::grow(int nPaths) {
+ if (length + nPaths > size) {
+ if (size == 0) {
+ size = 32;
+ }
+ while (size < length + nPaths) {
+ size *= 2;
+ }
+ paths = (SplashXPath **)greallocn(paths, size, sizeof(SplashXPath *));
+ flags = (Guchar *)greallocn(flags, size, sizeof(Guchar));
+ scanners = (SplashXPathScanner **)
+ greallocn(scanners, size, sizeof(SplashXPathScanner *));
+ }
+}
+
+void SplashClip::resetToRect(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1) {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ delete paths[i];
+ delete scanners[i];
+ }
+ gfree(paths);
+ gfree(flags);
+ gfree(scanners);
+ paths = NULL;
+ flags = NULL;
+ scanners = NULL;
+ length = size = 0;
+
+ if (x0 < x1) {
+ xMin = x0;
+ xMax = x1;
+ } else {
+ xMin = x1;
+ xMax = x0;
+ }
+ if (y0 < y1) {
+ yMin = y0;
+ yMax = y1;
+ } else {
+ yMin = y1;
+ yMax = y0;
+ }
+ xMinI = splashFloor(xMin);
+ yMinI = splashFloor(yMin);
+ xMaxI = splashFloor(xMax);
+ yMaxI = splashFloor(yMax);
+}
+
+SplashError SplashClip::clipToRect(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1) {
+ if (x0 < x1) {
+ if (x0 > xMin) {
+ xMin = x0;
+ xMinI = splashFloor(xMin);
+ }
+ if (x1 < xMax) {
+ xMax = x1;
+ xMaxI = splashFloor(xMax);
+ }
+ } else {
+ if (x1 > xMin) {
+ xMin = x1;
+ xMinI = splashFloor(xMin);
+ }
+ if (x0 < xMax) {
+ xMax = x0;
+ xMaxI = splashFloor(xMax);
+ }
+ }
+ if (y0 < y1) {
+ if (y0 > yMin) {
+ yMin = y0;
+ yMinI = splashFloor(yMin);
+ }
+ if (y1 < yMax) {
+ yMax = y1;
+ yMaxI = splashFloor(yMax);
+ }
+ } else {
+ if (y1 > yMin) {
+ yMin = y1;
+ yMinI = splashFloor(yMin);
+ }
+ if (y0 < yMax) {
+ yMax = y0;
+ yMaxI = splashFloor(yMax);
+ }
+ }
+ return splashOk;
+}
+
+SplashError SplashClip::clipToPath(SplashPath *path, SplashCoord *matrix,
+ SplashCoord flatness, GBool eo) {
+ SplashXPath *xPath;
+
+ xPath = new SplashXPath(path, matrix, flatness, gTrue);
+
+ // check for an empty path
+ if (xPath->length == 0) {
+ xMax = xMin - 1;
+ yMax = yMin - 1;
+ xMaxI = splashFloor(xMax);
+ yMaxI = splashFloor(yMax);
+ delete xPath;
+
+ // check for a rectangle
+ } else if (xPath->length == 4 &&
+ ((xPath->segs[0].x0 == xPath->segs[0].x1 &&
+ xPath->segs[0].x0 == xPath->segs[1].x0 &&
+ xPath->segs[0].x0 == xPath->segs[3].x1 &&
+ xPath->segs[2].x0 == xPath->segs[2].x1 &&
+ xPath->segs[2].x0 == xPath->segs[1].x1 &&
+ xPath->segs[2].x0 == xPath->segs[3].x0 &&
+ xPath->segs[1].y0 == xPath->segs[1].y1 &&
+ xPath->segs[1].y0 == xPath->segs[0].y1 &&
+ xPath->segs[1].y0 == xPath->segs[2].y0 &&
+ xPath->segs[3].y0 == xPath->segs[3].y1 &&
+ xPath->segs[3].y0 == xPath->segs[0].y0 &&
+ xPath->segs[3].y0 == xPath->segs[2].y1) ||
+ (xPath->segs[0].y0 == xPath->segs[0].y1 &&
+ xPath->segs[0].y0 == xPath->segs[1].y0 &&
+ xPath->segs[0].y0 == xPath->segs[3].y1 &&
+ xPath->segs[2].y0 == xPath->segs[2].y1 &&
+ xPath->segs[2].y0 == xPath->segs[1].y1 &&
+ xPath->segs[2].y0 == xPath->segs[3].y0 &&
+ xPath->segs[1].x0 == xPath->segs[1].x1 &&
+ xPath->segs[1].x0 == xPath->segs[0].x1 &&
+ xPath->segs[1].x0 == xPath->segs[2].x0 &&
+ xPath->segs[3].x0 == xPath->segs[3].x1 &&
+ xPath->segs[3].x0 == xPath->segs[0].x0 &&
+ xPath->segs[3].x0 == xPath->segs[2].x1))) {
+ clipToRect(xPath->segs[0].x0, xPath->segs[0].y0,
+ xPath->segs[2].x0, xPath->segs[2].y0);
+ delete xPath;
+
+ } else {
+ grow(1);
+ if (antialias) {
+ xPath->aaScale();
+ }
+ xPath->sort();
+ paths[length] = xPath;
+ flags[length] = eo ? splashClipEO : 0;
+ scanners[length] = new SplashXPathScanner(xPath, eo);
+ ++length;
+ }
+
+ return splashOk;
+}
+
+GBool SplashClip::test(int x, int y) {
+ int i;
+
+ // check the rectangle
+ if (x < xMinI || x > xMaxI || y < yMinI || y > yMaxI) {
+ return gFalse;
+ }
+
+ // check the paths
+ if (antialias) {
+ for (i = 0; i < length; ++i) {
+ if (!scanners[i]->test(x * splashAASize, y * splashAASize)) {
+ return gFalse;
+ }
+ }
+ } else {
+ for (i = 0; i < length; ++i) {
+ if (!scanners[i]->test(x, y)) {
+ return gFalse;
+ }
+ }
+ }
+
+ return gTrue;
+}
+
+SplashClipResult SplashClip::testRect(int rectXMin, int rectYMin,
+ int rectXMax, int rectYMax) {
+ // This tests the rectangle:
+ // x = [rectXMin, rectXMax + 1) (note: rect coords are ints)
+ // y = [rectYMin, rectYMax + 1)
+ // against the clipping region:
+ // x = [xMin, xMax] (note: clipping coords are fp)
+ // y = [yMin, yMax]
+ if ((SplashCoord)(rectXMax + 1) <= xMin || (SplashCoord)rectXMin > xMax ||
+ (SplashCoord)(rectYMax + 1) <= yMin || (SplashCoord)rectYMin > yMax) {
+ return splashClipAllOutside;
+ }
+ if ((SplashCoord)rectXMin >= xMin && (SplashCoord)(rectXMax + 1) <= xMax &&
+ (SplashCoord)rectYMin >= yMin && (SplashCoord)(rectYMax + 1) <= yMax &&
+ length == 0) {
+ return splashClipAllInside;
+ }
+ return splashClipPartial;
+}
+
+SplashClipResult SplashClip::testSpan(int spanXMin, int spanXMax, int spanY) {
+ int i;
+
+ // This tests the rectangle:
+ // x = [spanXMin, spanXMax + 1) (note: span coords are ints)
+ // y = [spanY, spanY + 1)
+ // against the clipping region:
+ // x = [xMin, xMax] (note: clipping coords are fp)
+ // y = [yMin, yMax]
+ if ((SplashCoord)(spanXMax + 1) <= xMin || (SplashCoord)spanXMin > xMax ||
+ (SplashCoord)(spanY + 1) <= yMin || (SplashCoord)spanY > yMax) {
+ return splashClipAllOutside;
+ }
+ if (!((SplashCoord)spanXMin >= xMin && (SplashCoord)(spanXMax + 1) <= xMax &&
+ (SplashCoord)spanY >= yMin && (SplashCoord)(spanY + 1) <= yMax)) {
+ return splashClipPartial;
+ }
+ if (antialias) {
+ for (i = 0; i < length; ++i) {
+ if (!scanners[i]->testSpan(spanXMin * splashAASize,
+ spanXMax * splashAASize + (splashAASize - 1),
+ spanY * splashAASize)) {
+ return splashClipPartial;
+ }
+ }
+ } else {
+ for (i = 0; i < length; ++i) {
+ if (!scanners[i]->testSpan(spanXMin, spanXMax, spanY)) {
+ return splashClipPartial;
+ }
+ }
+ }
+ return splashClipAllInside;
+}
+
+void SplashClip::clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y) {
+ int xx0, xx1, xx, yy, i;
+ SplashColorPtr p;
+
+ // zero out pixels with x < xMin
+ xx0 = *x0 * splashAASize;
+ xx1 = splashFloor(xMin * splashAASize);
+ if (xx1 > aaBuf->getWidth()) {
+ xx1 = aaBuf->getWidth();
+ }
+ if (xx0 < xx1) {
+ xx0 &= ~7;
+ for (yy = 0; yy < splashAASize; ++yy) {
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx0 >> 3);
+ for (xx = xx0; xx + 7 < xx1; xx += 8) {
+ *p++ = 0;
+ }
+ if (xx < xx1) {
+ *p &= 0xff >> (xx1 & 7);
+ }
+ }
+ *x0 = splashFloor(xMin);
+ }
+
+ // zero out pixels with x > xMax
+ xx0 = splashFloor(xMax * splashAASize) + 1;
+ if (xx0 < 0) {
+ xx0 = 0;
+ }
+ xx1 = (*x1 + 1) * splashAASize;
+ if (xx0 < xx1) {
+ for (yy = 0; yy < splashAASize; ++yy) {
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx0 >> 3);
+ xx = xx0;
+ if (xx & 7) {
+ *p &= 0xff00 >> (xx & 7);
+ xx = (xx & ~7) + 8;
+ ++p;
+ }
+ for (; xx < xx1; xx += 8) {
+ *p++ = 0;
+ }
+ }
+ *x1 = splashFloor(xMax);
+ }
+
+ // check the paths
+ for (i = 0; i < length; ++i) {
+ scanners[i]->clipAALine(aaBuf, x0, x1, y);
+ }
+}
diff --git a/kpdf/xpdf/splash/SplashFTFont.cc b/kpdf/xpdf/splash/SplashFTFont.cc
deleted file mode 100644
index 42d92af4..00000000
--- a/kpdf/xpdf/splash/SplashFTFont.cc
+++ /dev/null
@@ -1,375 +0,0 @@
-//========================================================================
-//
-// SplashFTFont.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <ft2build.h>
-#include FT_OUTLINE_H
-#include FT_SIZES_H
-#include FT_GLYPH_H
-#include "gmem.h"
-#include "SplashMath.h"
-#include "SplashGlyphBitmap.h"
-#include "SplashPath.h"
-#include "SplashFTFontEngine.h"
-#include "SplashFTFontFile.h"
-#include "SplashFTFont.h"
-
-//------------------------------------------------------------------------
-
-static int glyphPathMoveTo(const FT_Vector *pt, void *path);
-static int glyphPathLineTo(const FT_Vector *pt, void *path);
-static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt,
- void *path);
-static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
- const FT_Vector *pt, void *path);
-
-//------------------------------------------------------------------------
-// SplashFTFont
-//------------------------------------------------------------------------
-
-SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
- SplashCoord *textMatA):
- SplashFont(fontFileA, matA, textMatA, fontFileA->engine->aa)
-{
- FT_Face face;
- SplashCoord size, div;
- int x, y;
-
- face = fontFileA->face;
- if (FT_New_Size(face, &sizeObj)) {
- return;
- }
- face->size = sizeObj;
- size = splashSqrt(mat[2]*mat[2] + mat[3]*mat[3]);
- if (FT_Set_Pixel_Sizes(face, 0, (int)size)) {
- return;
- }
- // if the textMat values are too small, FreeType's fixed point
- // arithmetic doesn't work so well
- textScale = splashSqrt(textMat[2]*textMat[2] + textMat[3]*textMat[3]) / size;
-
- div = face->bbox.xMax > 20000 ? 65536 : 1;
-
- // transform the four corners of the font bounding box -- the min
- // and max values form the bounding box of the transformed font
- x = (int)((mat[0] * face->bbox.xMin + mat[2] * face->bbox.yMin) /
- (div * face->units_per_EM));
- xMin = xMax = x;
- y = (int)((mat[1] * face->bbox.xMin + mat[3] * face->bbox.yMin) /
- (div * face->units_per_EM));
- yMin = yMax = y;
- x = (int)((mat[0] * face->bbox.xMin + mat[2] * face->bbox.yMax) /
- (div * face->units_per_EM));
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- y = (int)((mat[1] * face->bbox.xMin + mat[3] * face->bbox.yMax) /
- (div * face->units_per_EM));
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- x = (int)((mat[0] * face->bbox.xMax + mat[2] * face->bbox.yMin) /
- (div * face->units_per_EM));
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- y = (int)((mat[1] * face->bbox.xMax + mat[3] * face->bbox.yMin) /
- (div * face->units_per_EM));
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- x = (int)((mat[0] * face->bbox.xMax + mat[2] * face->bbox.yMax) /
- (div * face->units_per_EM));
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- y = (int)((mat[1] * face->bbox.xMax + mat[3] * face->bbox.yMax) /
- (div * face->units_per_EM));
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- // This is a kludge: some buggy PDF generators embed fonts with
- // zero bounding boxes.
- if (xMax == xMin) {
- xMin = 0;
- xMax = (int)size;
- }
- if (yMax == yMin) {
- yMin = 0;
- yMax = (int)((SplashCoord)1.2 * size);
- }
-
- // compute the transform matrix
-#if USE_FIXEDPOINT
- matrix.xx = (FT_Fixed)((mat[0] / size).getRaw());
- matrix.yx = (FT_Fixed)((mat[1] / size).getRaw());
- matrix.xy = (FT_Fixed)((mat[2] / size).getRaw());
- matrix.yy = (FT_Fixed)((mat[3] / size).getRaw());
- textMatrix.xx = (FT_Fixed)((textMat[0] / (size * textScale)).getRaw());
- textMatrix.yx = (FT_Fixed)((textMat[1] / (size * textScale)).getRaw());
- textMatrix.xy = (FT_Fixed)((textMat[2] / (size * textScale)).getRaw());
- textMatrix.yy = (FT_Fixed)((textMat[3] / (size * textScale)).getRaw());
-#else
- matrix.xx = (FT_Fixed)((mat[0] / size) * 65536);
- matrix.yx = (FT_Fixed)((mat[1] / size) * 65536);
- matrix.xy = (FT_Fixed)((mat[2] / size) * 65536);
- matrix.yy = (FT_Fixed)((mat[3] / size) * 65536);
- textMatrix.xx = (FT_Fixed)((textMat[0] / (size * textScale)) * 65536);
- textMatrix.yx = (FT_Fixed)((textMat[1] / (size * textScale)) * 65536);
- textMatrix.xy = (FT_Fixed)((textMat[2] / (size * textScale)) * 65536);
- textMatrix.yy = (FT_Fixed)((textMat[3] / (size * textScale)) * 65536);
-#endif
-}
-
-SplashFTFont::~SplashFTFont() {
-}
-
-GBool SplashFTFont::getGlyph(int c, int xFrac, int /*yFrac*/,
- SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
- return SplashFont::getGlyph(c, xFrac, 0, bitmap, x0, y0, clip, clipRes);
-}
-
-GBool SplashFTFont::makeGlyph(int c, int xFrac, int /*yFrac*/,
- SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
- SplashFTFontFile *ff;
- FT_Vector offset;
- FT_GlyphSlot slot;
- FT_UInt gid;
- int rowSize;
- Guchar *p, *q;
- int i;
-
- ff = (SplashFTFontFile *)fontFile;
-
- ff->face->size = sizeObj;
- offset.x = (FT_Pos)(int)((SplashCoord)xFrac * splashFontFractionMul * 64);
- offset.y = 0;
- FT_Set_Transform(ff->face, &matrix, &offset);
- slot = ff->face->glyph;
-
- if (ff->codeToGID && c < ff->codeToGIDLen) {
- gid = (FT_UInt)ff->codeToGID[c];
- } else {
- gid = (FT_UInt)c;
- }
- if (ff->trueType && gid == 0) {
- // skip the TrueType notdef glyph
- return gFalse;
- }
-
- // if we have the FT2 bytecode interpreter, autohinting won't be used
-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- if (FT_Load_Glyph(ff->face, gid,
- aa ? FT_LOAD_NO_BITMAP : FT_LOAD_DEFAULT)) {
- return gFalse;
- }
-#else
- // FT2's autohinting doesn't always work very well (especially with
- // font subsets), so turn it off if anti-aliasing is enabled; if
- // anti-aliasing is disabled, this seems to be a tossup - some fonts
- // look better with hinting, some without, so leave hinting on
- if (FT_Load_Glyph(ff->face, gid,
- aa ? FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP
- : FT_LOAD_DEFAULT)) {
- return gFalse;
- }
-#endif
-
- FT_Glyph_Metrics *glyphMetrics = &(ff->face->glyph->metrics);
- // prelimirary values from FT_Glyph_Metrics
- bitmap->x = splashRound(-glyphMetrics->horiBearingX / 64.0);
- bitmap->y = splashRound(glyphMetrics->horiBearingY / 64.0);
- bitmap->w = splashRound(glyphMetrics->width / 64.0);
- bitmap->h = splashRound(glyphMetrics->height / 64.0);
-
- *clipRes = clip->testRect(x0 - bitmap->x,
- y0 - bitmap->y,
- x0 - bitmap->x + bitmap->w - 1,
- y0 - bitmap->y + bitmap->h - 1);
- if (*clipRes == splashClipAllOutside)
- {
- bitmap->freeData = gFalse;
- return gTrue;
- }
-
- if (FT_Render_Glyph(slot, aa ? ft_render_mode_normal
- : ft_render_mode_mono)) {
- return gFalse;
- }
-
- bitmap->x = -slot->bitmap_left;
- bitmap->y = slot->bitmap_top;
- bitmap->w = slot->bitmap.width;
- bitmap->h = slot->bitmap.rows;
- bitmap->aa = aa;
- if (aa) {
- rowSize = bitmap->w;
- } else {
- rowSize = (bitmap->w + 7) >> 3;
- }
- bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h);
- bitmap->freeData = gTrue;
- for (i = 0, p = bitmap->data, q = slot->bitmap.buffer;
- i < bitmap->h;
- ++i, p += rowSize, q += slot->bitmap.pitch) {
- memcpy(p, q, rowSize);
- }
-
- return gTrue;
-}
-
-struct SplashFTFontPath {
- SplashPath *path;
- SplashCoord textScale;
- GBool needClose;
-};
-
-SplashPath *SplashFTFont::getGlyphPath(int c) {
- static FT_Outline_Funcs outlineFuncs = {
-#if FREETYPE_MINOR <= 1
- (int (*)(FT_Vector *, void *))&glyphPathMoveTo,
- (int (*)(FT_Vector *, void *))&glyphPathLineTo,
- (int (*)(FT_Vector *, FT_Vector *, void *))&glyphPathConicTo,
- (int (*)(FT_Vector *, FT_Vector *, FT_Vector *, void *))&glyphPathCubicTo,
-#else
- &glyphPathMoveTo,
- &glyphPathLineTo,
- &glyphPathConicTo,
- &glyphPathCubicTo,
-#endif
- 0, 0
- };
- SplashFTFontFile *ff;
- SplashFTFontPath path;
- FT_GlyphSlot slot;
- FT_UInt gid;
- FT_Glyph glyph;
-
- ff = (SplashFTFontFile *)fontFile;
- ff->face->size = sizeObj;
- FT_Set_Transform(ff->face, &textMatrix, NULL);
- slot = ff->face->glyph;
- if (ff->codeToGID && c < ff->codeToGIDLen) {
- gid = ff->codeToGID[c];
- } else {
- gid = (FT_UInt)c;
- }
- if (ff->trueType && gid == 0) {
- // skip the TrueType notdef glyph
- return NULL;
- }
- if (FT_Load_Glyph(ff->face, gid, FT_LOAD_NO_BITMAP)) {
- return NULL;
- }
- if (FT_Get_Glyph(slot, &glyph)) {
- return NULL;
- }
- path.path = new SplashPath();
- path.textScale = textScale;
- path.needClose = gFalse;
- FT_Outline_Decompose(&((FT_OutlineGlyph)glyph)->outline,
- &outlineFuncs, &path);
- if (path.needClose) {
- path.path->close();
- }
- FT_Done_Glyph(glyph);
- return path.path;
-}
-
-static int glyphPathMoveTo(const FT_Vector *pt, void *path) {
- SplashFTFontPath *p = (SplashFTFontPath *)path;
-
- if (p->needClose) {
- p->path->close();
- p->needClose = gFalse;
- }
- p->path->moveTo((SplashCoord)pt->x * p->textScale / 64.0,
- (SplashCoord)pt->y * p->textScale / 64.0);
- return 0;
-}
-
-static int glyphPathLineTo(const FT_Vector *pt, void *path) {
- SplashFTFontPath *p = (SplashFTFontPath *)path;
-
- p->path->lineTo((SplashCoord)pt->x * p->textScale / 64.0,
- (SplashCoord)pt->y * p->textScale / 64.0);
- p->needClose = gTrue;
- return 0;
-}
-
-static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt,
- void *path) {
- SplashFTFontPath *p = (SplashFTFontPath *)path;
- SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xc, yc;
-
- if (!p->path->getCurPt(&x0, &y0)) {
- return 0;
- }
- xc = (SplashCoord)ctrl->x * p->textScale / 64.0;
- yc = (SplashCoord)ctrl->y * p->textScale / 64.0;
- x3 = (SplashCoord)pt->x * p->textScale / 64.0;
- y3 = (SplashCoord)pt->y * p->textScale / 64.0;
-
- // A second-order Bezier curve is defined by two endpoints, p0 and
- // p3, and one control point, pc:
- //
- // p(t) = (1-t)^2*p0 + t*(1-t)*pc + t^2*p3
- //
- // A third-order Bezier curve is defined by the same two endpoints,
- // p0 and p3, and two control points, p1 and p2:
- //
- // p(t) = (1-t)^3*p0 + 3t*(1-t)^2*p1 + 3t^2*(1-t)*p2 + t^3*p3
- //
- // Applying some algebra, we can convert a second-order curve to a
- // third-order curve:
- //
- // p1 = (1/3) * (p0 + 2pc)
- // p2 = (1/3) * (2pc + p3)
-
- x1 = (SplashCoord)(1.0 / 3.0) * (x0 + (SplashCoord)2 * xc);
- y1 = (SplashCoord)(1.0 / 3.0) * (y0 + (SplashCoord)2 * yc);
- x2 = (SplashCoord)(1.0 / 3.0) * ((SplashCoord)2 * xc + x3);
- y2 = (SplashCoord)(1.0 / 3.0) * ((SplashCoord)2 * yc + y3);
-
- p->path->curveTo(x1, y1, x2, y2, x3, y3);
- p->needClose = gTrue;
- return 0;
-}
-
-static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
- const FT_Vector *pt, void *path) {
- SplashFTFontPath *p = (SplashFTFontPath *)path;
-
- p->path->curveTo((SplashCoord)ctrl1->x * p->textScale / 64.0,
- (SplashCoord)ctrl1->y * p->textScale / 64.0,
- (SplashCoord)ctrl2->x * p->textScale / 64.0,
- (SplashCoord)ctrl2->y * p->textScale / 64.0,
- (SplashCoord)pt->x * p->textScale / 64.0,
- (SplashCoord)pt->y * p->textScale / 64.0);
- p->needClose = gTrue;
- return 0;
-}
-
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
diff --git a/kpdf/xpdf/splash/SplashFTFont.cpp b/kpdf/xpdf/splash/SplashFTFont.cpp
new file mode 100644
index 00000000..4bc31210
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFTFont.cpp
@@ -0,0 +1,375 @@
+//========================================================================
+//
+// SplashFTFont.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <ft2build.h>
+#include FT_OUTLINE_H
+#include FT_SIZES_H
+#include FT_GLYPH_H
+#include "gmem.h"
+#include "SplashMath.h"
+#include "SplashGlyphBitmap.h"
+#include "SplashPath.h"
+#include "SplashFTFontEngine.h"
+#include "SplashFTFontFile.h"
+#include "SplashFTFont.h"
+
+//------------------------------------------------------------------------
+
+static int glyphPathMoveTo(const FT_Vector *pt, void *path);
+static int glyphPathLineTo(const FT_Vector *pt, void *path);
+static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt,
+ void *path);
+static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
+ const FT_Vector *pt, void *path);
+
+//------------------------------------------------------------------------
+// SplashFTFont
+//------------------------------------------------------------------------
+
+SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
+ SplashCoord *textMatA):
+ SplashFont(fontFileA, matA, textMatA, fontFileA->engine->aa)
+{
+ FT_Face face;
+ SplashCoord size, div;
+ int x, y;
+
+ face = fontFileA->face;
+ if (FT_New_Size(face, &sizeObj)) {
+ return;
+ }
+ face->size = sizeObj;
+ size = splashSqrt(mat[2]*mat[2] + mat[3]*mat[3]);
+ if (FT_Set_Pixel_Sizes(face, 0, (int)size)) {
+ return;
+ }
+ // if the textMat values are too small, FreeType's fixed point
+ // arithmetic doesn't work so well
+ textScale = splashSqrt(textMat[2]*textMat[2] + textMat[3]*textMat[3]) / size;
+
+ div = face->bbox.xMax > 20000 ? 65536 : 1;
+
+ // transform the four corners of the font bounding box -- the min
+ // and max values form the bounding box of the transformed font
+ x = (int)((mat[0] * face->bbox.xMin + mat[2] * face->bbox.yMin) /
+ (div * face->units_per_EM));
+ xMin = xMax = x;
+ y = (int)((mat[1] * face->bbox.xMin + mat[3] * face->bbox.yMin) /
+ (div * face->units_per_EM));
+ yMin = yMax = y;
+ x = (int)((mat[0] * face->bbox.xMin + mat[2] * face->bbox.yMax) /
+ (div * face->units_per_EM));
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ y = (int)((mat[1] * face->bbox.xMin + mat[3] * face->bbox.yMax) /
+ (div * face->units_per_EM));
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ x = (int)((mat[0] * face->bbox.xMax + mat[2] * face->bbox.yMin) /
+ (div * face->units_per_EM));
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ y = (int)((mat[1] * face->bbox.xMax + mat[3] * face->bbox.yMin) /
+ (div * face->units_per_EM));
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ x = (int)((mat[0] * face->bbox.xMax + mat[2] * face->bbox.yMax) /
+ (div * face->units_per_EM));
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ y = (int)((mat[1] * face->bbox.xMax + mat[3] * face->bbox.yMax) /
+ (div * face->units_per_EM));
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ // This is a kludge: some buggy PDF generators embed fonts with
+ // zero bounding boxes.
+ if (xMax == xMin) {
+ xMin = 0;
+ xMax = (int)size;
+ }
+ if (yMax == yMin) {
+ yMin = 0;
+ yMax = (int)((SplashCoord)1.2 * size);
+ }
+
+ // compute the transform matrix
+#if USE_FIXEDPOINT
+ matrix.xx = (FT_Fixed)((mat[0] / size).getRaw());
+ matrix.yx = (FT_Fixed)((mat[1] / size).getRaw());
+ matrix.xy = (FT_Fixed)((mat[2] / size).getRaw());
+ matrix.yy = (FT_Fixed)((mat[3] / size).getRaw());
+ textMatrix.xx = (FT_Fixed)((textMat[0] / (size * textScale)).getRaw());
+ textMatrix.yx = (FT_Fixed)((textMat[1] / (size * textScale)).getRaw());
+ textMatrix.xy = (FT_Fixed)((textMat[2] / (size * textScale)).getRaw());
+ textMatrix.yy = (FT_Fixed)((textMat[3] / (size * textScale)).getRaw());
+#else
+ matrix.xx = (FT_Fixed)((mat[0] / size) * 65536);
+ matrix.yx = (FT_Fixed)((mat[1] / size) * 65536);
+ matrix.xy = (FT_Fixed)((mat[2] / size) * 65536);
+ matrix.yy = (FT_Fixed)((mat[3] / size) * 65536);
+ textMatrix.xx = (FT_Fixed)((textMat[0] / (size * textScale)) * 65536);
+ textMatrix.yx = (FT_Fixed)((textMat[1] / (size * textScale)) * 65536);
+ textMatrix.xy = (FT_Fixed)((textMat[2] / (size * textScale)) * 65536);
+ textMatrix.yy = (FT_Fixed)((textMat[3] / (size * textScale)) * 65536);
+#endif
+}
+
+SplashFTFont::~SplashFTFont() {
+}
+
+GBool SplashFTFont::getGlyph(int c, int xFrac, int /*yFrac*/,
+ SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
+ return SplashFont::getGlyph(c, xFrac, 0, bitmap, x0, y0, clip, clipRes);
+}
+
+GBool SplashFTFont::makeGlyph(int c, int xFrac, int /*yFrac*/,
+ SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
+ SplashFTFontFile *ff;
+ FT_Vector offset;
+ FT_GlyphSlot slot;
+ FT_UInt gid;
+ int rowSize;
+ Guchar *p, *q;
+ int i;
+
+ ff = (SplashFTFontFile *)fontFile;
+
+ ff->face->size = sizeObj;
+ offset.x = (FT_Pos)(int)((SplashCoord)xFrac * splashFontFractionMul * 64);
+ offset.y = 0;
+ FT_Set_Transform(ff->face, &matrix, &offset);
+ slot = ff->face->glyph;
+
+ if (ff->codeToGID && c < ff->codeToGIDLen) {
+ gid = (FT_UInt)ff->codeToGID[c];
+ } else {
+ gid = (FT_UInt)c;
+ }
+ if (ff->trueType && gid == 0) {
+ // skip the TrueType notdef glyph
+ return gFalse;
+ }
+
+ // if we have the FT2 bytecode interpreter, autohinting won't be used
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+ if (FT_Load_Glyph(ff->face, gid,
+ aa ? FT_LOAD_NO_BITMAP : FT_LOAD_DEFAULT)) {
+ return gFalse;
+ }
+#else
+ // FT2's autohinting doesn't always work very well (especially with
+ // font subsets), so turn it off if anti-aliasing is enabled; if
+ // anti-aliasing is disabled, this seems to be a tossup - some fonts
+ // look better with hinting, some without, so leave hinting on
+ if (FT_Load_Glyph(ff->face, gid,
+ aa ? FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP
+ : FT_LOAD_DEFAULT)) {
+ return gFalse;
+ }
+#endif
+
+ FT_Glyph_Metrics *glyphMetrics = &(ff->face->glyph->metrics);
+ // prelimirary values from FT_Glyph_Metrics
+ bitmap->x = splashRound(-glyphMetrics->horiBearingX / 64.0);
+ bitmap->y = splashRound(glyphMetrics->horiBearingY / 64.0);
+ bitmap->w = splashRound(glyphMetrics->width / 64.0);
+ bitmap->h = splashRound(glyphMetrics->height / 64.0);
+
+ *clipRes = clip->testRect(x0 - bitmap->x,
+ y0 - bitmap->y,
+ x0 - bitmap->x + bitmap->w - 1,
+ y0 - bitmap->y + bitmap->h - 1);
+ if (*clipRes == splashClipAllOutside)
+ {
+ bitmap->freeData = gFalse;
+ return gTrue;
+ }
+
+ if (FT_Render_Glyph(slot, aa ? ft_render_mode_normal
+ : ft_render_mode_mono)) {
+ return gFalse;
+ }
+
+ bitmap->x = -slot->bitmap_left;
+ bitmap->y = slot->bitmap_top;
+ bitmap->w = slot->bitmap.width;
+ bitmap->h = slot->bitmap.rows;
+ bitmap->aa = aa;
+ if (aa) {
+ rowSize = bitmap->w;
+ } else {
+ rowSize = (bitmap->w + 7) >> 3;
+ }
+ bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h);
+ bitmap->freeData = gTrue;
+ for (i = 0, p = bitmap->data, q = slot->bitmap.buffer;
+ i < bitmap->h;
+ ++i, p += rowSize, q += slot->bitmap.pitch) {
+ memcpy(p, q, rowSize);
+ }
+
+ return gTrue;
+}
+
+struct SplashFTFontPath {
+ SplashPath *path;
+ SplashCoord textScale;
+ GBool needClose;
+};
+
+SplashPath *SplashFTFont::getGlyphPath(int c) {
+ static FT_Outline_Funcs outlineFuncs = {
+#if FREETYPE_MINOR <= 1
+ (int (*)(FT_Vector *, void *))&glyphPathMoveTo,
+ (int (*)(FT_Vector *, void *))&glyphPathLineTo,
+ (int (*)(FT_Vector *, FT_Vector *, void *))&glyphPathConicTo,
+ (int (*)(FT_Vector *, FT_Vector *, FT_Vector *, void *))&glyphPathCubicTo,
+#else
+ &glyphPathMoveTo,
+ &glyphPathLineTo,
+ &glyphPathConicTo,
+ &glyphPathCubicTo,
+#endif
+ 0, 0
+ };
+ SplashFTFontFile *ff;
+ SplashFTFontPath path;
+ FT_GlyphSlot slot;
+ FT_UInt gid;
+ FT_Glyph glyph;
+
+ ff = (SplashFTFontFile *)fontFile;
+ ff->face->size = sizeObj;
+ FT_Set_Transform(ff->face, &textMatrix, NULL);
+ slot = ff->face->glyph;
+ if (ff->codeToGID && c < ff->codeToGIDLen) {
+ gid = ff->codeToGID[c];
+ } else {
+ gid = (FT_UInt)c;
+ }
+ if (ff->trueType && gid == 0) {
+ // skip the TrueType notdef glyph
+ return NULL;
+ }
+ if (FT_Load_Glyph(ff->face, gid, FT_LOAD_NO_BITMAP)) {
+ return NULL;
+ }
+ if (FT_Get_Glyph(slot, &glyph)) {
+ return NULL;
+ }
+ path.path = new SplashPath();
+ path.textScale = textScale;
+ path.needClose = gFalse;
+ FT_Outline_Decompose(&((FT_OutlineGlyph)glyph)->outline,
+ &outlineFuncs, &path);
+ if (path.needClose) {
+ path.path->close();
+ }
+ FT_Done_Glyph(glyph);
+ return path.path;
+}
+
+static int glyphPathMoveTo(const FT_Vector *pt, void *path) {
+ SplashFTFontPath *p = (SplashFTFontPath *)path;
+
+ if (p->needClose) {
+ p->path->close();
+ p->needClose = gFalse;
+ }
+ p->path->moveTo((SplashCoord)pt->x * p->textScale / 64.0,
+ (SplashCoord)pt->y * p->textScale / 64.0);
+ return 0;
+}
+
+static int glyphPathLineTo(const FT_Vector *pt, void *path) {
+ SplashFTFontPath *p = (SplashFTFontPath *)path;
+
+ p->path->lineTo((SplashCoord)pt->x * p->textScale / 64.0,
+ (SplashCoord)pt->y * p->textScale / 64.0);
+ p->needClose = gTrue;
+ return 0;
+}
+
+static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt,
+ void *path) {
+ SplashFTFontPath *p = (SplashFTFontPath *)path;
+ SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xc, yc;
+
+ if (!p->path->getCurPt(&x0, &y0)) {
+ return 0;
+ }
+ xc = (SplashCoord)ctrl->x * p->textScale / 64.0;
+ yc = (SplashCoord)ctrl->y * p->textScale / 64.0;
+ x3 = (SplashCoord)pt->x * p->textScale / 64.0;
+ y3 = (SplashCoord)pt->y * p->textScale / 64.0;
+
+ // A second-order Bezier curve is defined by two endpoints, p0 and
+ // p3, and one control point, pc:
+ //
+ // p(t) = (1-t)^2*p0 + t*(1-t)*pc + t^2*p3
+ //
+ // A third-order Bezier curve is defined by the same two endpoints,
+ // p0 and p3, and two control points, p1 and p2:
+ //
+ // p(t) = (1-t)^3*p0 + 3t*(1-t)^2*p1 + 3t^2*(1-t)*p2 + t^3*p3
+ //
+ // Applying some algebra, we can convert a second-order curve to a
+ // third-order curve:
+ //
+ // p1 = (1/3) * (p0 + 2pc)
+ // p2 = (1/3) * (2pc + p3)
+
+ x1 = (SplashCoord)(1.0 / 3.0) * (x0 + (SplashCoord)2 * xc);
+ y1 = (SplashCoord)(1.0 / 3.0) * (y0 + (SplashCoord)2 * yc);
+ x2 = (SplashCoord)(1.0 / 3.0) * ((SplashCoord)2 * xc + x3);
+ y2 = (SplashCoord)(1.0 / 3.0) * ((SplashCoord)2 * yc + y3);
+
+ p->path->curveTo(x1, y1, x2, y2, x3, y3);
+ p->needClose = gTrue;
+ return 0;
+}
+
+static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
+ const FT_Vector *pt, void *path) {
+ SplashFTFontPath *p = (SplashFTFontPath *)path;
+
+ p->path->curveTo((SplashCoord)ctrl1->x * p->textScale / 64.0,
+ (SplashCoord)ctrl1->y * p->textScale / 64.0,
+ (SplashCoord)ctrl2->x * p->textScale / 64.0,
+ (SplashCoord)ctrl2->y * p->textScale / 64.0,
+ (SplashCoord)pt->x * p->textScale / 64.0,
+ (SplashCoord)pt->y * p->textScale / 64.0);
+ p->needClose = gTrue;
+ return 0;
+}
+
+#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
diff --git a/kpdf/xpdf/splash/SplashFTFontEngine.cc b/kpdf/xpdf/splash/SplashFTFontEngine.cc
deleted file mode 100644
index 02996de7..00000000
--- a/kpdf/xpdf/splash/SplashFTFontEngine.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-//========================================================================
-//
-// SplashFTFontEngine.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#ifndef WIN32
-# include <unistd.h>
-#endif
-#include "gmem.h"
-#include "GString.h"
-#include "gfile.h"
-#include "FoFiTrueType.h"
-#include "FoFiType1C.h"
-#include "SplashFTFontFile.h"
-#include "SplashFTFontEngine.h"
-
-#ifdef VMS
-#if (__VMS_VER < 70000000)
-extern "C" int unlink(char *filename);
-#endif
-#endif
-
-//------------------------------------------------------------------------
-/*
-static void fileWrite(void *stream, char *data, int len) {
- fwrite(data, 1, len, (FILE *)stream);
-}
-*/
-
-//------------------------------------------------------------------------
-// SplashFTFontEngine
-//------------------------------------------------------------------------
-
-SplashFTFontEngine::SplashFTFontEngine(GBool aaA, FT_Library libA) {
- FT_Int major, minor, patch;
-
- aa = aaA;
- lib = libA;
-
- // as of FT 2.1.8, CID fonts are indexed by CID instead of GID
- FT_Library_Version(lib, &major, &minor, &patch);
- useCIDs = major > 2 ||
- (major == 2 && (minor > 1 || (minor == 1 && patch > 7)));
-}
-
-SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA) {
- FT_Library libA;
-
- if (FT_Init_FreeType(&libA)) {
- return NULL;
- }
- return new SplashFTFontEngine(aaA, libA);
-}
-
-SplashFTFontEngine::~SplashFTFontEngine() {
- FT_Done_FreeType(lib);
-}
-
-SplashFontFile *SplashFTFontEngine::loadType1Font(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- return SplashFTFontFile::loadType1Font(this, idA, src, enc);
-}
-
-SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- return SplashFTFontFile::loadType1Font(this, idA, src, enc);
-}
-
-SplashFontFile *SplashFTFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- return SplashFTFontFile::loadType1Font(this, idA, src, enc);
-}
-
-SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA,
- SplashFontSrc *src) {
- FoFiType1C *ff;
- Gushort *cidToGIDMap;
- int nCIDs;
- SplashFontFile *ret;
-
- // check for a CFF font
- if (useCIDs) {
- cidToGIDMap = NULL;
- nCIDs = 0;
- } else {
- if (src->isFile) {
- ff = FoFiType1C::load(src->fileName->getCString());
- } else {
- ff = FoFiType1C::make(src->buf, src->bufLen);
- }
- if (ff) {
- cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
- delete ff;
- } else {
- cidToGIDMap = NULL;
- nCIDs = 0;
- }
- }
- ret = SplashFTFontFile::loadCIDFont(this, idA, src, cidToGIDMap, nCIDs);
- if (!ret) {
- gfree(cidToGIDMap);
- }
- return ret;
-}
-
-SplashFontFile *SplashFTFontEngine::loadOpenTypeCFFFont(SplashFontFileID *idA,
- SplashFontSrc *src) {
- FoFiTrueType *ff;
- GBool isCID;
- Gushort *cidToGIDMap;
- int nCIDs;
- SplashFontFile *ret;
-
- cidToGIDMap = NULL;
- nCIDs = 0;
- isCID = gFalse;
- if (!useCIDs) {
- if (src->isFile) {
- ff = FoFiTrueType::load(src->fileName->getCString());
- } else {
- ff = FoFiTrueType::make(src->buf, src->bufLen);
- }
- if (ff) {
- if (ff->isOpenTypeCFF()) {
- cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
- }
- delete ff;
- }
- }
- ret = SplashFTFontFile::loadCIDFont(this, idA, src,
- cidToGIDMap, nCIDs);
- if (!ret) {
- gfree(cidToGIDMap);
- }
- return ret;
-}
-
-SplashFontFile *SplashFTFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- Gushort *codeToGID,
- int codeToGIDLen,
- int faceIndex) {
-#if 0
- FoFiTrueType *ff;
- GString *tmpFileName;
- FILE *tmpFile;
- SplashFontFile *ret;
-
- if (!(ff = FoFiTrueType::load(fileName))) {
- return NULL;
- }
- tmpFileName = NULL;
- if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
- delete ff;
- return NULL;
- }
- ff->writeTTF(&fileWrite, tmpFile);
- delete ff;
- fclose(tmpFile);
- ret = SplashFTFontFile::loadTrueTypeFont(this, idA,
- tmpFileName->getCString(),
- gTrue, codeToGID, codeToGIDLen);
- if (ret) {
- if (deleteFile) {
- unlink(fileName);
- }
- } else {
- unlink(tmpFileName->getCString());
- }
- delete tmpFileName;
- return ret;
-#else
- SplashFontFile *ret;
- ret = SplashFTFontFile::loadTrueTypeFont(this, idA, src,
- codeToGID, codeToGIDLen,
- faceIndex);
- return ret;
-#endif
-}
-
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
diff --git a/kpdf/xpdf/splash/SplashFTFontEngine.cpp b/kpdf/xpdf/splash/SplashFTFontEngine.cpp
new file mode 100644
index 00000000..36cf32e6
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFTFontEngine.cpp
@@ -0,0 +1,194 @@
+//========================================================================
+//
+// SplashFTFontEngine.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#ifndef WIN32
+# include <unistd.h>
+#endif
+#include "gmem.h"
+#include "GString.h"
+#include "gfile.h"
+#include "FoFiTrueType.h"
+#include "FoFiType1C.h"
+#include "SplashFTFontFile.h"
+#include "SplashFTFontEngine.h"
+
+#ifdef VMS
+#if (__VMS_VER < 70000000)
+extern "C" int unlink(char *filename);
+#endif
+#endif
+
+//------------------------------------------------------------------------
+/*
+static void fileWrite(void *stream, char *data, int len) {
+ fwrite(data, 1, len, (FILE *)stream);
+}
+*/
+
+//------------------------------------------------------------------------
+// SplashFTFontEngine
+//------------------------------------------------------------------------
+
+SplashFTFontEngine::SplashFTFontEngine(GBool aaA, FT_Library libA) {
+ FT_Int major, minor, patch;
+
+ aa = aaA;
+ lib = libA;
+
+ // as of FT 2.1.8, CID fonts are indexed by CID instead of GID
+ FT_Library_Version(lib, &major, &minor, &patch);
+ useCIDs = major > 2 ||
+ (major == 2 && (minor > 1 || (minor == 1 && patch > 7)));
+}
+
+SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA) {
+ FT_Library libA;
+
+ if (FT_Init_FreeType(&libA)) {
+ return NULL;
+ }
+ return new SplashFTFontEngine(aaA, libA);
+}
+
+SplashFTFontEngine::~SplashFTFontEngine() {
+ FT_Done_FreeType(lib);
+}
+
+SplashFontFile *SplashFTFontEngine::loadType1Font(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ return SplashFTFontFile::loadType1Font(this, idA, src, enc);
+}
+
+SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ return SplashFTFontFile::loadType1Font(this, idA, src, enc);
+}
+
+SplashFontFile *SplashFTFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ return SplashFTFontFile::loadType1Font(this, idA, src, enc);
+}
+
+SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA,
+ SplashFontSrc *src) {
+ FoFiType1C *ff;
+ Gushort *cidToGIDMap;
+ int nCIDs;
+ SplashFontFile *ret;
+
+ // check for a CFF font
+ if (useCIDs) {
+ cidToGIDMap = NULL;
+ nCIDs = 0;
+ } else {
+ if (src->isFile) {
+ ff = FoFiType1C::load(src->fileName->getCString());
+ } else {
+ ff = FoFiType1C::make(src->buf, src->bufLen);
+ }
+ if (ff) {
+ cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
+ delete ff;
+ } else {
+ cidToGIDMap = NULL;
+ nCIDs = 0;
+ }
+ }
+ ret = SplashFTFontFile::loadCIDFont(this, idA, src, cidToGIDMap, nCIDs);
+ if (!ret) {
+ gfree(cidToGIDMap);
+ }
+ return ret;
+}
+
+SplashFontFile *SplashFTFontEngine::loadOpenTypeCFFFont(SplashFontFileID *idA,
+ SplashFontSrc *src) {
+ FoFiTrueType *ff;
+ GBool isCID;
+ Gushort *cidToGIDMap;
+ int nCIDs;
+ SplashFontFile *ret;
+
+ cidToGIDMap = NULL;
+ nCIDs = 0;
+ isCID = gFalse;
+ if (!useCIDs) {
+ if (src->isFile) {
+ ff = FoFiTrueType::load(src->fileName->getCString());
+ } else {
+ ff = FoFiTrueType::make(src->buf, src->bufLen);
+ }
+ if (ff) {
+ if (ff->isOpenTypeCFF()) {
+ cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
+ }
+ delete ff;
+ }
+ }
+ ret = SplashFTFontFile::loadCIDFont(this, idA, src,
+ cidToGIDMap, nCIDs);
+ if (!ret) {
+ gfree(cidToGIDMap);
+ }
+ return ret;
+}
+
+SplashFontFile *SplashFTFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ Gushort *codeToGID,
+ int codeToGIDLen,
+ int faceIndex) {
+#if 0
+ FoFiTrueType *ff;
+ GString *tmpFileName;
+ FILE *tmpFile;
+ SplashFontFile *ret;
+
+ if (!(ff = FoFiTrueType::load(fileName))) {
+ return NULL;
+ }
+ tmpFileName = NULL;
+ if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
+ delete ff;
+ return NULL;
+ }
+ ff->writeTTF(&fileWrite, tmpFile);
+ delete ff;
+ fclose(tmpFile);
+ ret = SplashFTFontFile::loadTrueTypeFont(this, idA,
+ tmpFileName->getCString(),
+ gTrue, codeToGID, codeToGIDLen);
+ if (ret) {
+ if (deleteFile) {
+ unlink(fileName);
+ }
+ } else {
+ unlink(tmpFileName->getCString());
+ }
+ delete tmpFileName;
+ return ret;
+#else
+ SplashFontFile *ret;
+ ret = SplashFTFontFile::loadTrueTypeFont(this, idA, src,
+ codeToGID, codeToGIDLen,
+ faceIndex);
+ return ret;
+#endif
+}
+
+#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
diff --git a/kpdf/xpdf/splash/SplashFTFontFile.cc b/kpdf/xpdf/splash/SplashFTFontFile.cc
deleted file mode 100644
index 12725497..00000000
--- a/kpdf/xpdf/splash/SplashFTFontFile.cc
+++ /dev/null
@@ -1,125 +0,0 @@
-//========================================================================
-//
-// SplashFTFontFile.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "gmem.h"
-#include "SplashFTFontEngine.h"
-#include "SplashFTFont.h"
-#include "SplashFTFontFile.h"
-#include "GString.h"
-
-//------------------------------------------------------------------------
-// SplashFTFontFile
-//------------------------------------------------------------------------
-
-SplashFontFile *SplashFTFontFile::loadType1Font(SplashFTFontEngine *engineA,
- SplashFontFileID *idA,
- SplashFontSrc *src,
- char **encA) {
- FT_Face faceA;
- Gushort *codeToGIDA;
- char *name;
- int i;
-
- if (src->isFile) {
- if (FT_New_Face(engineA->lib, src->fileName->getCString(), 0, &faceA))
- return NULL;
- } else {
- if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, 0, &faceA))
- return NULL;
- }
- codeToGIDA = (Gushort *)gmallocn(256, sizeof(int));
- for (i = 0; i < 256; ++i) {
- codeToGIDA[i] = 0;
- if ((name = encA[i])) {
- codeToGIDA[i] = (Gushort)FT_Get_Name_Index(faceA, name);
- }
- }
-
- return new SplashFTFontFile(engineA, idA, src,
- faceA, codeToGIDA, 256, gFalse);
-}
-
-SplashFontFile *SplashFTFontFile::loadCIDFont(SplashFTFontEngine *engineA,
- SplashFontFileID *idA,
- SplashFontSrc *src,
- Gushort *codeToGIDA,
- int codeToGIDLenA) {
- FT_Face faceA;
-
- if (src->isFile) {
- if (FT_New_Face(engineA->lib, src->fileName->getCString(), 0, &faceA))
- return NULL;
- } else {
- if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, 0, &faceA))
- return NULL;
- }
-
- return new SplashFTFontFile(engineA, idA, src,
- faceA, codeToGIDA, codeToGIDLenA, gFalse);
-}
-
-SplashFontFile *SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine *engineA,
- SplashFontFileID *idA,
- SplashFontSrc *src,
- Gushort *codeToGIDA,
- int codeToGIDLenA,
- int faceIndexA) {
- FT_Face faceA;
-
- if (src->isFile) {
- if (FT_New_Face(engineA->lib, src->fileName->getCString(), faceIndexA, &faceA))
- return NULL;
- } else {
- if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, faceIndexA, &faceA))
- return NULL;
- }
-
- return new SplashFTFontFile(engineA, idA, src,
- faceA, codeToGIDA, codeToGIDLenA, gTrue);
-}
-
-SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine *engineA,
- SplashFontFileID *idA,
- SplashFontSrc *src,
- FT_Face faceA,
- Gushort *codeToGIDA, int codeToGIDLenA,
- GBool trueTypeA):
- SplashFontFile(idA, src)
-{
- engine = engineA;
- face = faceA;
- codeToGID = codeToGIDA;
- codeToGIDLen = codeToGIDLenA;
- trueType = trueTypeA;
-}
-
-SplashFTFontFile::~SplashFTFontFile() {
- if (face) {
- FT_Done_Face(face);
- }
- if (codeToGID) {
- gfree(codeToGID);
- }
-}
-
-SplashFont *SplashFTFontFile::makeFont(SplashCoord *mat,
- SplashCoord *textMat) {
- SplashFont *font;
-
- font = new SplashFTFont(this, mat, textMat);
- font->initCache();
- return font;
-}
-
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
diff --git a/kpdf/xpdf/splash/SplashFTFontFile.cpp b/kpdf/xpdf/splash/SplashFTFontFile.cpp
new file mode 100644
index 00000000..697c3ed8
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFTFontFile.cpp
@@ -0,0 +1,125 @@
+//========================================================================
+//
+// SplashFTFontFile.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "gmem.h"
+#include "SplashFTFontEngine.h"
+#include "SplashFTFont.h"
+#include "SplashFTFontFile.h"
+#include "GString.h"
+
+//------------------------------------------------------------------------
+// SplashFTFontFile
+//------------------------------------------------------------------------
+
+SplashFontFile *SplashFTFontFile::loadType1Font(SplashFTFontEngine *engineA,
+ SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **encA) {
+ FT_Face faceA;
+ Gushort *codeToGIDA;
+ char *name;
+ int i;
+
+ if (src->isFile) {
+ if (FT_New_Face(engineA->lib, src->fileName->getCString(), 0, &faceA))
+ return NULL;
+ } else {
+ if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, 0, &faceA))
+ return NULL;
+ }
+ codeToGIDA = (Gushort *)gmallocn(256, sizeof(int));
+ for (i = 0; i < 256; ++i) {
+ codeToGIDA[i] = 0;
+ if ((name = encA[i])) {
+ codeToGIDA[i] = (Gushort)FT_Get_Name_Index(faceA, name);
+ }
+ }
+
+ return new SplashFTFontFile(engineA, idA, src,
+ faceA, codeToGIDA, 256, gFalse);
+}
+
+SplashFontFile *SplashFTFontFile::loadCIDFont(SplashFTFontEngine *engineA,
+ SplashFontFileID *idA,
+ SplashFontSrc *src,
+ Gushort *codeToGIDA,
+ int codeToGIDLenA) {
+ FT_Face faceA;
+
+ if (src->isFile) {
+ if (FT_New_Face(engineA->lib, src->fileName->getCString(), 0, &faceA))
+ return NULL;
+ } else {
+ if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, 0, &faceA))
+ return NULL;
+ }
+
+ return new SplashFTFontFile(engineA, idA, src,
+ faceA, codeToGIDA, codeToGIDLenA, gFalse);
+}
+
+SplashFontFile *SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine *engineA,
+ SplashFontFileID *idA,
+ SplashFontSrc *src,
+ Gushort *codeToGIDA,
+ int codeToGIDLenA,
+ int faceIndexA) {
+ FT_Face faceA;
+
+ if (src->isFile) {
+ if (FT_New_Face(engineA->lib, src->fileName->getCString(), faceIndexA, &faceA))
+ return NULL;
+ } else {
+ if (FT_New_Memory_Face(engineA->lib, (const FT_Byte *)src->buf, src->bufLen, faceIndexA, &faceA))
+ return NULL;
+ }
+
+ return new SplashFTFontFile(engineA, idA, src,
+ faceA, codeToGIDA, codeToGIDLenA, gTrue);
+}
+
+SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine *engineA,
+ SplashFontFileID *idA,
+ SplashFontSrc *src,
+ FT_Face faceA,
+ Gushort *codeToGIDA, int codeToGIDLenA,
+ GBool trueTypeA):
+ SplashFontFile(idA, src)
+{
+ engine = engineA;
+ face = faceA;
+ codeToGID = codeToGIDA;
+ codeToGIDLen = codeToGIDLenA;
+ trueType = trueTypeA;
+}
+
+SplashFTFontFile::~SplashFTFontFile() {
+ if (face) {
+ FT_Done_Face(face);
+ }
+ if (codeToGID) {
+ gfree(codeToGID);
+ }
+}
+
+SplashFont *SplashFTFontFile::makeFont(SplashCoord *mat,
+ SplashCoord *textMat) {
+ SplashFont *font;
+
+ font = new SplashFTFont(this, mat, textMat);
+ font->initCache();
+ return font;
+}
+
+#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
diff --git a/kpdf/xpdf/splash/SplashFont.cc b/kpdf/xpdf/splash/SplashFont.cc
deleted file mode 100644
index 4a91d5e8..00000000
--- a/kpdf/xpdf/splash/SplashFont.cc
+++ /dev/null
@@ -1,201 +0,0 @@
-//========================================================================
-//
-// SplashFont.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include "gmem.h"
-#include "SplashMath.h"
-#include "SplashGlyphBitmap.h"
-#include "SplashFontFile.h"
-#include "SplashFont.h"
-
-//------------------------------------------------------------------------
-
-struct SplashFontCacheTag {
- int c;
- short xFrac, yFrac; // x and y fractions
- int mru; // valid bit (0x80000000) and MRU index
- int x, y, w, h; // offset and size of glyph
-};
-
-//------------------------------------------------------------------------
-// SplashFont
-//------------------------------------------------------------------------
-
-SplashFont::SplashFont(SplashFontFile *fontFileA, SplashCoord *matA,
- SplashCoord *textMatA, GBool aaA) {
- fontFile = fontFileA;
- fontFile->incRefCnt();
- mat[0] = matA[0];
- mat[1] = matA[1];
- mat[2] = matA[2];
- mat[3] = matA[3];
- textMat[0] = textMatA[0];
- textMat[1] = textMatA[1];
- textMat[2] = textMatA[2];
- textMat[3] = textMatA[3];
- aa = aaA;
-
- cache = NULL;
- cacheTags = NULL;
-
- xMin = yMin = xMax = yMax = 0;
-}
-
-void SplashFont::initCache() {
- int i;
-
- // this should be (max - min + 1), but we add some padding to
- // deal with rounding errors
- glyphW = xMax - xMin + 3;
- glyphH = yMax - yMin + 3;
- if (aa) {
- glyphSize = glyphW * glyphH;
- } else {
- glyphSize = ((glyphW + 7) >> 3) * glyphH;
- }
-
- // set up the glyph pixmap cache
- cacheAssoc = 8;
- if (glyphSize <= 256) {
- cacheSets = 8;
- } else if (glyphSize <= 512) {
- cacheSets = 4;
- } else if (glyphSize <= 1024) {
- cacheSets = 2;
- } else {
- cacheSets = 1;
- }
- cache = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
- if (cache != NULL) {
- cacheTags = (SplashFontCacheTag *)gmallocn(cacheSets * cacheAssoc,
- sizeof(SplashFontCacheTag));
- for (i = 0; i < cacheSets * cacheAssoc; ++i) {
- cacheTags[i].mru = i & (cacheAssoc - 1);
- }
- } else {
- cacheAssoc = 0;
- }
-}
-
-SplashFont::~SplashFont() {
- fontFile->decRefCnt();
- if (cache) {
- gfree(cache);
- }
- if (cacheTags) {
- gfree(cacheTags);
- }
-}
-
-GBool SplashFont::getGlyph(int c, int xFrac, int yFrac,
- SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
- SplashGlyphBitmap bitmap2;
- int size;
- Guchar *p;
- int i, j, k;
-
- // no fractional coordinates for large glyphs or non-anti-aliased
- // glyphs
- if (!aa || glyphH > 50) {
- xFrac = yFrac = 0;
- }
-
- // check the cache
- i = (c & (cacheSets - 1)) * cacheAssoc;
- for (j = 0; j < cacheAssoc; ++j) {
- if ((cacheTags[i+j].mru & 0x80000000) &&
- cacheTags[i+j].c == c &&
- (int)cacheTags[i+j].xFrac == xFrac &&
- (int)cacheTags[i+j].yFrac == yFrac) {
- bitmap->x = cacheTags[i+j].x;
- bitmap->y = cacheTags[i+j].y;
- bitmap->w = cacheTags[i+j].w;
- bitmap->h = cacheTags[i+j].h;
- for (k = 0; k < cacheAssoc; ++k) {
- if (k != j &&
- (cacheTags[i+k].mru & 0x7fffffff) <
- (cacheTags[i+j].mru & 0x7fffffff)) {
- ++cacheTags[i+k].mru;
- }
- }
- cacheTags[i+j].mru = 0x80000000;
- bitmap->aa = aa;
- bitmap->data = cache + (i+j) * glyphSize;
- bitmap->freeData = gFalse;
-
- *clipRes = clip->testRect(x0 - bitmap->x,
- y0 - bitmap->y,
- x0 - bitmap->x + bitmap->w - 1,
- y0 - bitmap->y + bitmap->h - 1);
-
- return gTrue;
- }
- }
-
- // generate the glyph bitmap
- if (!makeGlyph(c, xFrac, yFrac, &bitmap2, x0, y0, clip, clipRes)) {
- return gFalse;
- }
-
- if (*clipRes == splashClipAllOutside)
- {
- bitmap->freeData = gFalse;
- if (bitmap2.freeData) gfree(bitmap2.data);
- return gTrue;
- }
-
- // if the glyph doesn't fit in the bounding box, return a temporary
- // uncached bitmap
- if (bitmap2.w > glyphW || bitmap2.h > glyphH) {
- *bitmap = bitmap2;
- return gTrue;
- }
-
- // insert glyph pixmap in cache
- if (aa) {
- size = bitmap2.w * bitmap2.h;
- } else {
- size = ((bitmap2.w + 7) >> 3) * bitmap2.h;
- }
- p = NULL; // make gcc happy
- if (cacheAssoc == 0)
- {
- // we had problems on the malloc of the cache, so ignore it
- *bitmap = bitmap2;
- }
- else
- {
- for (j = 0; j < cacheAssoc; ++j) {
- if ((cacheTags[i+j].mru & 0x7fffffff) == cacheAssoc - 1) {
- cacheTags[i+j].mru = 0x80000000;
- cacheTags[i+j].c = c;
- cacheTags[i+j].xFrac = (short)xFrac;
- cacheTags[i+j].yFrac = (short)yFrac;
- cacheTags[i+j].x = bitmap2.x;
- cacheTags[i+j].y = bitmap2.y;
- cacheTags[i+j].w = bitmap2.w;
- cacheTags[i+j].h = bitmap2.h;
- p = cache + (i+j) * glyphSize;
- memcpy(p, bitmap2.data, size);
- } else {
- ++cacheTags[i+j].mru;
- }
- }
- *bitmap = bitmap2;
- bitmap->data = p;
- bitmap->freeData = gFalse;
- if (bitmap2.freeData) {
- gfree(bitmap2.data);
- }
- }
- return gTrue;
-}
diff --git a/kpdf/xpdf/splash/SplashFont.cpp b/kpdf/xpdf/splash/SplashFont.cpp
new file mode 100644
index 00000000..42c9e999
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFont.cpp
@@ -0,0 +1,201 @@
+//========================================================================
+//
+// SplashFont.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include "gmem.h"
+#include "SplashMath.h"
+#include "SplashGlyphBitmap.h"
+#include "SplashFontFile.h"
+#include "SplashFont.h"
+
+//------------------------------------------------------------------------
+
+struct SplashFontCacheTag {
+ int c;
+ short xFrac, yFrac; // x and y fractions
+ int mru; // valid bit (0x80000000) and MRU index
+ int x, y, w, h; // offset and size of glyph
+};
+
+//------------------------------------------------------------------------
+// SplashFont
+//------------------------------------------------------------------------
+
+SplashFont::SplashFont(SplashFontFile *fontFileA, SplashCoord *matA,
+ SplashCoord *textMatA, GBool aaA) {
+ fontFile = fontFileA;
+ fontFile->incRefCnt();
+ mat[0] = matA[0];
+ mat[1] = matA[1];
+ mat[2] = matA[2];
+ mat[3] = matA[3];
+ textMat[0] = textMatA[0];
+ textMat[1] = textMatA[1];
+ textMat[2] = textMatA[2];
+ textMat[3] = textMatA[3];
+ aa = aaA;
+
+ cache = NULL;
+ cacheTags = NULL;
+
+ xMin = yMin = xMax = yMax = 0;
+}
+
+void SplashFont::initCache() {
+ int i;
+
+ // this should be (max - min + 1), but we add some padding to
+ // deal with rounding errors
+ glyphW = xMax - xMin + 3;
+ glyphH = yMax - yMin + 3;
+ if (aa) {
+ glyphSize = glyphW * glyphH;
+ } else {
+ glyphSize = ((glyphW + 7) >> 3) * glyphH;
+ }
+
+ // set up the glyph pixmap cache
+ cacheAssoc = 8;
+ if (glyphSize <= 256) {
+ cacheSets = 8;
+ } else if (glyphSize <= 512) {
+ cacheSets = 4;
+ } else if (glyphSize <= 1024) {
+ cacheSets = 2;
+ } else {
+ cacheSets = 1;
+ }
+ cache = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
+ if (cache != NULL) {
+ cacheTags = (SplashFontCacheTag *)gmallocn(cacheSets * cacheAssoc,
+ sizeof(SplashFontCacheTag));
+ for (i = 0; i < cacheSets * cacheAssoc; ++i) {
+ cacheTags[i].mru = i & (cacheAssoc - 1);
+ }
+ } else {
+ cacheAssoc = 0;
+ }
+}
+
+SplashFont::~SplashFont() {
+ fontFile->decRefCnt();
+ if (cache) {
+ gfree(cache);
+ }
+ if (cacheTags) {
+ gfree(cacheTags);
+ }
+}
+
+GBool SplashFont::getGlyph(int c, int xFrac, int yFrac,
+ SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
+ SplashGlyphBitmap bitmap2;
+ int size;
+ Guchar *p;
+ int i, j, k;
+
+ // no fractional coordinates for large glyphs or non-anti-aliased
+ // glyphs
+ if (!aa || glyphH > 50) {
+ xFrac = yFrac = 0;
+ }
+
+ // check the cache
+ i = (c & (cacheSets - 1)) * cacheAssoc;
+ for (j = 0; j < cacheAssoc; ++j) {
+ if ((cacheTags[i+j].mru & 0x80000000) &&
+ cacheTags[i+j].c == c &&
+ (int)cacheTags[i+j].xFrac == xFrac &&
+ (int)cacheTags[i+j].yFrac == yFrac) {
+ bitmap->x = cacheTags[i+j].x;
+ bitmap->y = cacheTags[i+j].y;
+ bitmap->w = cacheTags[i+j].w;
+ bitmap->h = cacheTags[i+j].h;
+ for (k = 0; k < cacheAssoc; ++k) {
+ if (k != j &&
+ (cacheTags[i+k].mru & 0x7fffffff) <
+ (cacheTags[i+j].mru & 0x7fffffff)) {
+ ++cacheTags[i+k].mru;
+ }
+ }
+ cacheTags[i+j].mru = 0x80000000;
+ bitmap->aa = aa;
+ bitmap->data = cache + (i+j) * glyphSize;
+ bitmap->freeData = gFalse;
+
+ *clipRes = clip->testRect(x0 - bitmap->x,
+ y0 - bitmap->y,
+ x0 - bitmap->x + bitmap->w - 1,
+ y0 - bitmap->y + bitmap->h - 1);
+
+ return gTrue;
+ }
+ }
+
+ // generate the glyph bitmap
+ if (!makeGlyph(c, xFrac, yFrac, &bitmap2, x0, y0, clip, clipRes)) {
+ return gFalse;
+ }
+
+ if (*clipRes == splashClipAllOutside)
+ {
+ bitmap->freeData = gFalse;
+ if (bitmap2.freeData) gfree(bitmap2.data);
+ return gTrue;
+ }
+
+ // if the glyph doesn't fit in the bounding box, return a temporary
+ // uncached bitmap
+ if (bitmap2.w > glyphW || bitmap2.h > glyphH) {
+ *bitmap = bitmap2;
+ return gTrue;
+ }
+
+ // insert glyph pixmap in cache
+ if (aa) {
+ size = bitmap2.w * bitmap2.h;
+ } else {
+ size = ((bitmap2.w + 7) >> 3) * bitmap2.h;
+ }
+ p = NULL; // make gcc happy
+ if (cacheAssoc == 0)
+ {
+ // we had problems on the malloc of the cache, so ignore it
+ *bitmap = bitmap2;
+ }
+ else
+ {
+ for (j = 0; j < cacheAssoc; ++j) {
+ if ((cacheTags[i+j].mru & 0x7fffffff) == cacheAssoc - 1) {
+ cacheTags[i+j].mru = 0x80000000;
+ cacheTags[i+j].c = c;
+ cacheTags[i+j].xFrac = (short)xFrac;
+ cacheTags[i+j].yFrac = (short)yFrac;
+ cacheTags[i+j].x = bitmap2.x;
+ cacheTags[i+j].y = bitmap2.y;
+ cacheTags[i+j].w = bitmap2.w;
+ cacheTags[i+j].h = bitmap2.h;
+ p = cache + (i+j) * glyphSize;
+ memcpy(p, bitmap2.data, size);
+ } else {
+ ++cacheTags[i+j].mru;
+ }
+ }
+ *bitmap = bitmap2;
+ bitmap->data = p;
+ bitmap->freeData = gFalse;
+ if (bitmap2.freeData) {
+ gfree(bitmap2.data);
+ }
+ }
+ return gTrue;
+}
diff --git a/kpdf/xpdf/splash/SplashFontEngine.cc b/kpdf/xpdf/splash/SplashFontEngine.cc
deleted file mode 100644
index 4dc1b35b..00000000
--- a/kpdf/xpdf/splash/SplashFontEngine.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-//========================================================================
-//
-// SplashFontEngine.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#if HAVE_T1LIB_H
-#include <t1lib.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef WIN32
-# include <unistd.h>
-#endif
-#include "gmem.h"
-#include "GString.h"
-#include "SplashMath.h"
-#include "SplashT1FontEngine.h"
-#include "SplashFTFontEngine.h"
-#include "SplashFontFile.h"
-#include "SplashFontFileID.h"
-#include "SplashFont.h"
-#include "SplashFontEngine.h"
-
-#ifdef VMS
-#if (__VMS_VER < 70000000)
-extern "C" int unlink(char *filename);
-#endif
-#endif
-
-//------------------------------------------------------------------------
-// SplashFontEngine
-//------------------------------------------------------------------------
-
-SplashFontEngine::SplashFontEngine(
-#if HAVE_T1LIB_H
- GBool enableT1lib,
-#endif
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- GBool enableFreeType,
-#endif
- GBool aa) {
- int i;
-
- for (i = 0; i < splashFontCacheSize; ++i) {
- fontCache[i] = NULL;
- }
-
-#if HAVE_T1LIB_H
- if (enableT1lib) {
- t1Engine = SplashT1FontEngine::init(aa);
- } else {
- t1Engine = NULL;
- }
-#endif
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (enableFreeType) {
- ftEngine = SplashFTFontEngine::init(aa);
- } else {
- ftEngine = NULL;
- }
-#endif
-}
-
-SplashFontEngine::~SplashFontEngine() {
- int i;
-
- for (i = 0; i < splashFontCacheSize; ++i) {
- if (fontCache[i]) {
- delete fontCache[i];
- }
- }
-
-#if HAVE_T1LIB_H
- if (t1Engine) {
- delete t1Engine;
- }
-#endif
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (ftEngine) {
- delete ftEngine;
- }
-#endif
-}
-
-SplashFontFile *SplashFontEngine::getFontFile(SplashFontFileID *id) {
- SplashFontFile *fontFile;
- int i;
-
- for (i = 0; i < splashFontCacheSize; ++i) {
- if (fontCache[i]) {
- fontFile = fontCache[i]->getFontFile();
- if (fontFile && fontFile->getID()->matches(id)) {
- return fontFile;
- }
- }
- }
- return NULL;
-}
-
-SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- SplashFontFile *fontFile;
-
- fontFile = NULL;
-#if HAVE_T1LIB_H
- if (!fontFile && t1Engine) {
- fontFile = t1Engine->loadType1Font(idA, src, enc);
- }
-#endif
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (!fontFile && ftEngine) {
- fontFile = ftEngine->loadType1Font(idA, src, enc);
- }
-#endif
-
- // delete the (temporary) font file -- with Unix hard link
- // semantics, this will remove the last link; otherwise it will
- // return an error, leaving the file to be deleted later (if
- // loadXYZFont failed, the file will always be deleted)
- if (src->isFile)
- src->unref();
-
- return fontFile;
-}
-
-SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- SplashFontFile *fontFile;
-
- fontFile = NULL;
-#if HAVE_T1LIB_H
- if (!fontFile && t1Engine) {
- fontFile = t1Engine->loadType1CFont(idA, sec, enc);
- }
-#endif
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (!fontFile && ftEngine) {
- fontFile = ftEngine->loadType1CFont(idA, src, enc);
- }
-#endif
-
- // delete the (temporary) font file -- with Unix hard link
- // semantics, this will remove the last link; otherwise it will
- // return an error, leaving the file to be deleted later (if
- // loadXYZFont failed, the file will always be deleted)
- if (src->isFile)
- src->unref();
-
- return fontFile;
-}
-
-SplashFontFile *SplashFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- SplashFontFile *fontFile;
-
- fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (!fontFile && ftEngine) {
- fontFile = ftEngine->loadOpenTypeT1CFont(idA, src, enc);
- }
-#endif
-
- // delete the (temporary) font file -- with Unix hard link
- // semantics, this will remove the last link; otherwise it will
- // return an error, leaving the file to be deleted later (if
- // loadXYZFont failed, the file will always be deleted)
- if (src->isFile)
- src->unref();
-
- return fontFile;
-}
-
-SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA,
- SplashFontSrc *src) {
- SplashFontFile *fontFile;
-
- fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (!fontFile && ftEngine) {
- fontFile = ftEngine->loadCIDFont(idA, src);
- }
-#endif
-
- // delete the (temporary) font file -- with Unix hard link
- // semantics, this will remove the last link; otherwise it will
- // return an error, leaving the file to be deleted later (if
- // loadXYZFont failed, the file will always be deleted)
- if (src->isFile)
- src->unref();
-
- return fontFile;
-}
-
-SplashFontFile *SplashFontEngine::loadOpenTypeCFFFont(SplashFontFileID *idA,
- SplashFontSrc *src) {
- SplashFontFile *fontFile;
-
- fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (!fontFile && ftEngine) {
- fontFile = ftEngine->loadOpenTypeCFFFont(idA, src);
- }
-#endif
-
- // delete the (temporary) font file -- with Unix hard link
- // semantics, this will remove the last link; otherwise it will
- // return an error, leaving the file to be deleted later (if
- // loadXYZFont failed, the file will always be deleted)
- if (src->isFile)
- src->unref();
-
- return fontFile;
-}
-
-SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- Gushort *codeToGID,
- int codeToGIDLen,
- int faceIndex) {
- SplashFontFile *fontFile;
-
- fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- if (!fontFile && ftEngine) {
- fontFile = ftEngine->loadTrueTypeFont(idA, src,
- codeToGID, codeToGIDLen, faceIndex);
- }
-#endif
-
- if (!fontFile) {
- gfree(codeToGID);
- }
-
- // delete the (temporary) font file -- with Unix hard link
- // semantics, this will remove the last link; otherwise it will
- // return an error, leaving the file to be deleted later (if
- // loadXYZFont failed, the file will always be deleted)
- if (src->isFile)
- src->unref();
-
- return fontFile;
-}
-
-SplashFont *SplashFontEngine::getFont(SplashFontFile *fontFile,
- SplashCoord *textMat,
- SplashCoord *ctm) {
- SplashCoord mat[4];
- SplashFont *font;
- int i, j;
-
- mat[0] = textMat[0] * ctm[0] + textMat[1] * ctm[2];
- mat[1] = -(textMat[0] * ctm[1] + textMat[1] * ctm[3]);
- mat[2] = textMat[2] * ctm[0] + textMat[3] * ctm[2];
- mat[3] = -(textMat[2] * ctm[1] + textMat[3] * ctm[3]);
- if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.01) {
- // avoid a singular (or close-to-singular) matrix
- mat[0] = 0.01; mat[1] = 0;
- mat[2] = 0; mat[3] = 0.01;
- }
-
- font = fontCache[0];
- if (font && font->matches(fontFile, mat, textMat)) {
- return font;
- }
- for (i = 1; i < splashFontCacheSize; ++i) {
- font = fontCache[i];
- if (font && font->matches(fontFile, mat, textMat)) {
- for (j = i; j > 0; --j) {
- fontCache[j] = fontCache[j-1];
- }
- fontCache[0] = font;
- return font;
- }
- }
- font = fontFile->makeFont(mat, textMat);
- if (fontCache[splashFontCacheSize - 1]) {
- delete fontCache[splashFontCacheSize - 1];
- }
- for (j = splashFontCacheSize - 1; j > 0; --j) {
- fontCache[j] = fontCache[j-1];
- }
- fontCache[0] = font;
- return font;
-}
diff --git a/kpdf/xpdf/splash/SplashFontEngine.cpp b/kpdf/xpdf/splash/SplashFontEngine.cpp
new file mode 100644
index 00000000..d79a48a0
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFontEngine.cpp
@@ -0,0 +1,295 @@
+//========================================================================
+//
+// SplashFontEngine.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#if HAVE_T1LIB_H
+#include <t1lib.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef WIN32
+# include <unistd.h>
+#endif
+#include "gmem.h"
+#include "GString.h"
+#include "SplashMath.h"
+#include "SplashT1FontEngine.h"
+#include "SplashFTFontEngine.h"
+#include "SplashFontFile.h"
+#include "SplashFontFileID.h"
+#include "SplashFont.h"
+#include "SplashFontEngine.h"
+
+#ifdef VMS
+#if (__VMS_VER < 70000000)
+extern "C" int unlink(char *filename);
+#endif
+#endif
+
+//------------------------------------------------------------------------
+// SplashFontEngine
+//------------------------------------------------------------------------
+
+SplashFontEngine::SplashFontEngine(
+#if HAVE_T1LIB_H
+ GBool enableT1lib,
+#endif
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ GBool enableFreeType,
+#endif
+ GBool aa) {
+ int i;
+
+ for (i = 0; i < splashFontCacheSize; ++i) {
+ fontCache[i] = NULL;
+ }
+
+#if HAVE_T1LIB_H
+ if (enableT1lib) {
+ t1Engine = SplashT1FontEngine::init(aa);
+ } else {
+ t1Engine = NULL;
+ }
+#endif
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (enableFreeType) {
+ ftEngine = SplashFTFontEngine::init(aa);
+ } else {
+ ftEngine = NULL;
+ }
+#endif
+}
+
+SplashFontEngine::~SplashFontEngine() {
+ int i;
+
+ for (i = 0; i < splashFontCacheSize; ++i) {
+ if (fontCache[i]) {
+ delete fontCache[i];
+ }
+ }
+
+#if HAVE_T1LIB_H
+ if (t1Engine) {
+ delete t1Engine;
+ }
+#endif
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (ftEngine) {
+ delete ftEngine;
+ }
+#endif
+}
+
+SplashFontFile *SplashFontEngine::getFontFile(SplashFontFileID *id) {
+ SplashFontFile *fontFile;
+ int i;
+
+ for (i = 0; i < splashFontCacheSize; ++i) {
+ if (fontCache[i]) {
+ fontFile = fontCache[i]->getFontFile();
+ if (fontFile && fontFile->getID()->matches(id)) {
+ return fontFile;
+ }
+ }
+ }
+ return NULL;
+}
+
+SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ SplashFontFile *fontFile;
+
+ fontFile = NULL;
+#if HAVE_T1LIB_H
+ if (!fontFile && t1Engine) {
+ fontFile = t1Engine->loadType1Font(idA, src, enc);
+ }
+#endif
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (!fontFile && ftEngine) {
+ fontFile = ftEngine->loadType1Font(idA, src, enc);
+ }
+#endif
+
+ // delete the (temporary) font file -- with Unix hard link
+ // semantics, this will remove the last link; otherwise it will
+ // return an error, leaving the file to be deleted later (if
+ // loadXYZFont failed, the file will always be deleted)
+ if (src->isFile)
+ src->unref();
+
+ return fontFile;
+}
+
+SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ SplashFontFile *fontFile;
+
+ fontFile = NULL;
+#if HAVE_T1LIB_H
+ if (!fontFile && t1Engine) {
+ fontFile = t1Engine->loadType1CFont(idA, sec, enc);
+ }
+#endif
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (!fontFile && ftEngine) {
+ fontFile = ftEngine->loadType1CFont(idA, src, enc);
+ }
+#endif
+
+ // delete the (temporary) font file -- with Unix hard link
+ // semantics, this will remove the last link; otherwise it will
+ // return an error, leaving the file to be deleted later (if
+ // loadXYZFont failed, the file will always be deleted)
+ if (src->isFile)
+ src->unref();
+
+ return fontFile;
+}
+
+SplashFontFile *SplashFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ SplashFontFile *fontFile;
+
+ fontFile = NULL;
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (!fontFile && ftEngine) {
+ fontFile = ftEngine->loadOpenTypeT1CFont(idA, src, enc);
+ }
+#endif
+
+ // delete the (temporary) font file -- with Unix hard link
+ // semantics, this will remove the last link; otherwise it will
+ // return an error, leaving the file to be deleted later (if
+ // loadXYZFont failed, the file will always be deleted)
+ if (src->isFile)
+ src->unref();
+
+ return fontFile;
+}
+
+SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA,
+ SplashFontSrc *src) {
+ SplashFontFile *fontFile;
+
+ fontFile = NULL;
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (!fontFile && ftEngine) {
+ fontFile = ftEngine->loadCIDFont(idA, src);
+ }
+#endif
+
+ // delete the (temporary) font file -- with Unix hard link
+ // semantics, this will remove the last link; otherwise it will
+ // return an error, leaving the file to be deleted later (if
+ // loadXYZFont failed, the file will always be deleted)
+ if (src->isFile)
+ src->unref();
+
+ return fontFile;
+}
+
+SplashFontFile *SplashFontEngine::loadOpenTypeCFFFont(SplashFontFileID *idA,
+ SplashFontSrc *src) {
+ SplashFontFile *fontFile;
+
+ fontFile = NULL;
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (!fontFile && ftEngine) {
+ fontFile = ftEngine->loadOpenTypeCFFFont(idA, src);
+ }
+#endif
+
+ // delete the (temporary) font file -- with Unix hard link
+ // semantics, this will remove the last link; otherwise it will
+ // return an error, leaving the file to be deleted later (if
+ // loadXYZFont failed, the file will always be deleted)
+ if (src->isFile)
+ src->unref();
+
+ return fontFile;
+}
+
+SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ Gushort *codeToGID,
+ int codeToGIDLen,
+ int faceIndex) {
+ SplashFontFile *fontFile;
+
+ fontFile = NULL;
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ if (!fontFile && ftEngine) {
+ fontFile = ftEngine->loadTrueTypeFont(idA, src,
+ codeToGID, codeToGIDLen, faceIndex);
+ }
+#endif
+
+ if (!fontFile) {
+ gfree(codeToGID);
+ }
+
+ // delete the (temporary) font file -- with Unix hard link
+ // semantics, this will remove the last link; otherwise it will
+ // return an error, leaving the file to be deleted later (if
+ // loadXYZFont failed, the file will always be deleted)
+ if (src->isFile)
+ src->unref();
+
+ return fontFile;
+}
+
+SplashFont *SplashFontEngine::getFont(SplashFontFile *fontFile,
+ SplashCoord *textMat,
+ SplashCoord *ctm) {
+ SplashCoord mat[4];
+ SplashFont *font;
+ int i, j;
+
+ mat[0] = textMat[0] * ctm[0] + textMat[1] * ctm[2];
+ mat[1] = -(textMat[0] * ctm[1] + textMat[1] * ctm[3]);
+ mat[2] = textMat[2] * ctm[0] + textMat[3] * ctm[2];
+ mat[3] = -(textMat[2] * ctm[1] + textMat[3] * ctm[3]);
+ if (splashAbs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.01) {
+ // avoid a singular (or close-to-singular) matrix
+ mat[0] = 0.01; mat[1] = 0;
+ mat[2] = 0; mat[3] = 0.01;
+ }
+
+ font = fontCache[0];
+ if (font && font->matches(fontFile, mat, textMat)) {
+ return font;
+ }
+ for (i = 1; i < splashFontCacheSize; ++i) {
+ font = fontCache[i];
+ if (font && font->matches(fontFile, mat, textMat)) {
+ for (j = i; j > 0; --j) {
+ fontCache[j] = fontCache[j-1];
+ }
+ fontCache[0] = font;
+ return font;
+ }
+ }
+ font = fontFile->makeFont(mat, textMat);
+ if (fontCache[splashFontCacheSize - 1]) {
+ delete fontCache[splashFontCacheSize - 1];
+ }
+ for (j = splashFontCacheSize - 1; j > 0; --j) {
+ fontCache[j] = fontCache[j-1];
+ }
+ fontCache[0] = font;
+ return font;
+}
diff --git a/kpdf/xpdf/splash/SplashFontFile.cc b/kpdf/xpdf/splash/SplashFontFile.cc
deleted file mode 100644
index ad58c22d..00000000
--- a/kpdf/xpdf/splash/SplashFontFile.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-//========================================================================
-//
-// SplashFontFile.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#ifndef WIN32
-# include <unistd.h>
-#endif
-#include "gmem.h"
-#include "GString.h"
-#include "SplashFontFile.h"
-#include "SplashFontFileID.h"
-
-#ifdef VMS
-#if (__VMS_VER < 70000000)
-extern "C" int unlink(char *filename);
-#endif
-#endif
-
-//------------------------------------------------------------------------
-// SplashFontFile
-//------------------------------------------------------------------------
-
-SplashFontFile::SplashFontFile(SplashFontFileID *idA, SplashFontSrc *srcA) {
- id = idA;
- src = srcA;
- src->ref();
- refCnt = 0;
-}
-
-SplashFontFile::~SplashFontFile() {
- src->unref();
- delete id;
-}
-
-void SplashFontFile::incRefCnt() {
- ++refCnt;
-}
-
-void SplashFontFile::decRefCnt() {
- if (!--refCnt) {
- delete this;
- }
-}
-
-//
-
-SplashFontSrc::SplashFontSrc() {
- isFile = gFalse;
- deleteSrc = gFalse;
- fileName = NULL;
- buf = NULL;
- refcnt = 1;
-}
-
-SplashFontSrc::~SplashFontSrc() {
- if (deleteSrc) {
- if (isFile) {
- if (fileName)
- unlink(fileName->getCString());
- } else {
- if (buf)
- gfree(buf);
- }
- }
-
- if (isFile && fileName)
- delete fileName;
-}
-
-void SplashFontSrc::ref() {
- refcnt++;
-}
-
-void SplashFontSrc::unref() {
- if (! --refcnt)
- delete this;
-}
-
-void SplashFontSrc::setFile(GString *file, GBool del)
-{
- isFile = gTrue;
- fileName = file->copy();
- deleteSrc = del;
-}
-
-void SplashFontSrc::setFile(const char *file, GBool del)
-{
- isFile = gTrue;
- fileName = new GString(file);
- deleteSrc = del;
-}
-
-void SplashFontSrc::setBuf(char *bufA, int bufLenA, GBool del)
-{
- isFile = gFalse;
- buf = bufA;
- bufLen = bufLenA;
- deleteSrc = del;
-}
diff --git a/kpdf/xpdf/splash/SplashFontFile.cpp b/kpdf/xpdf/splash/SplashFontFile.cpp
new file mode 100644
index 00000000..c66447bb
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFontFile.cpp
@@ -0,0 +1,108 @@
+//========================================================================
+//
+// SplashFontFile.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#ifndef WIN32
+# include <unistd.h>
+#endif
+#include "gmem.h"
+#include "GString.h"
+#include "SplashFontFile.h"
+#include "SplashFontFileID.h"
+
+#ifdef VMS
+#if (__VMS_VER < 70000000)
+extern "C" int unlink(char *filename);
+#endif
+#endif
+
+//------------------------------------------------------------------------
+// SplashFontFile
+//------------------------------------------------------------------------
+
+SplashFontFile::SplashFontFile(SplashFontFileID *idA, SplashFontSrc *srcA) {
+ id = idA;
+ src = srcA;
+ src->ref();
+ refCnt = 0;
+}
+
+SplashFontFile::~SplashFontFile() {
+ src->unref();
+ delete id;
+}
+
+void SplashFontFile::incRefCnt() {
+ ++refCnt;
+}
+
+void SplashFontFile::decRefCnt() {
+ if (!--refCnt) {
+ delete this;
+ }
+}
+
+//
+
+SplashFontSrc::SplashFontSrc() {
+ isFile = gFalse;
+ deleteSrc = gFalse;
+ fileName = NULL;
+ buf = NULL;
+ refcnt = 1;
+}
+
+SplashFontSrc::~SplashFontSrc() {
+ if (deleteSrc) {
+ if (isFile) {
+ if (fileName)
+ unlink(fileName->getCString());
+ } else {
+ if (buf)
+ gfree(buf);
+ }
+ }
+
+ if (isFile && fileName)
+ delete fileName;
+}
+
+void SplashFontSrc::ref() {
+ refcnt++;
+}
+
+void SplashFontSrc::unref() {
+ if (! --refcnt)
+ delete this;
+}
+
+void SplashFontSrc::setFile(GString *file, GBool del)
+{
+ isFile = gTrue;
+ fileName = file->copy();
+ deleteSrc = del;
+}
+
+void SplashFontSrc::setFile(const char *file, GBool del)
+{
+ isFile = gTrue;
+ fileName = new GString(file);
+ deleteSrc = del;
+}
+
+void SplashFontSrc::setBuf(char *bufA, int bufLenA, GBool del)
+{
+ isFile = gFalse;
+ buf = bufA;
+ bufLen = bufLenA;
+ deleteSrc = del;
+}
diff --git a/kpdf/xpdf/splash/SplashFontFileID.cc b/kpdf/xpdf/splash/SplashFontFileID.cc
deleted file mode 100644
index af37cb2f..00000000
--- a/kpdf/xpdf/splash/SplashFontFileID.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-//========================================================================
-//
-// SplashFontFileID.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "SplashFontFileID.h"
-
-//------------------------------------------------------------------------
-// SplashFontFileID
-//------------------------------------------------------------------------
-
-SplashFontFileID::SplashFontFileID() {
-}
-
-SplashFontFileID::~SplashFontFileID() {
-}
diff --git a/kpdf/xpdf/splash/SplashFontFileID.cpp b/kpdf/xpdf/splash/SplashFontFileID.cpp
new file mode 100644
index 00000000..9182d4d8
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashFontFileID.cpp
@@ -0,0 +1,23 @@
+//========================================================================
+//
+// SplashFontFileID.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "SplashFontFileID.h"
+
+//------------------------------------------------------------------------
+// SplashFontFileID
+//------------------------------------------------------------------------
+
+SplashFontFileID::SplashFontFileID() {
+}
+
+SplashFontFileID::~SplashFontFileID() {
+}
diff --git a/kpdf/xpdf/splash/SplashPath.cc b/kpdf/xpdf/splash/SplashPath.cc
deleted file mode 100644
index e3a89271..00000000
--- a/kpdf/xpdf/splash/SplashPath.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-//========================================================================
-//
-// SplashPath.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include "gmem.h"
-#include "SplashErrorCodes.h"
-#include "SplashPath.h"
-
-//------------------------------------------------------------------------
-// SplashPath
-//------------------------------------------------------------------------
-
-// A path can be in three possible states:
-//
-// 1. no current point -- zero or more finished subpaths
-// [curSubpath == length]
-//
-// 2. one point in subpath
-// [curSubpath == length - 1]
-//
-// 3. open subpath with two or more points
-// [curSubpath < length - 1]
-
-SplashPath::SplashPath() {
- pts = NULL;
- flags = NULL;
- length = size = 0;
- curSubpath = 0;
- hints = NULL;
- hintsLength = hintsSize = 0;
-}
-
-SplashPath::SplashPath(SplashPath *path) {
- length = path->length;
- size = path->size;
- pts = (SplashPathPoint *)gmallocn(size, sizeof(SplashPathPoint));
- flags = (Guchar *)gmallocn(size, sizeof(Guchar));
- memcpy(pts, path->pts, length * sizeof(SplashPathPoint));
- memcpy(flags, path->flags, length * sizeof(Guchar));
- curSubpath = path->curSubpath;
- if (path->hints) {
- hintsLength = hintsSize = path->hintsLength;
- hints = (SplashPathHint *)gmallocn(hintsSize, sizeof(SplashPathHint));
- memcpy(hints, path->hints, hintsLength * sizeof(SplashPathHint));
- } else {
- hints = NULL;
- }
-}
-
-SplashPath::~SplashPath() {
- gfree(pts);
- gfree(flags);
- gfree(hints);
-}
-
-// Add space for <nPts> more points.
-void SplashPath::grow(int nPts) {
- if (length + nPts > size) {
- if (size == 0) {
- size = 32;
- }
- while (size < length + nPts) {
- size *= 2;
- }
- pts = (SplashPathPoint *)greallocn(pts, size, sizeof(SplashPathPoint));
- flags = (Guchar *)greallocn(flags, size, sizeof(Guchar));
- }
-}
-
-void SplashPath::append(SplashPath *path) {
- int i;
-
- curSubpath = length + path->curSubpath;
- grow(path->length);
- for (i = 0; i < path->length; ++i) {
- pts[length] = path->pts[i];
- flags[length] = path->flags[i];
- ++length;
- }
-}
-
-SplashError SplashPath::moveTo(SplashCoord x, SplashCoord y) {
- if (onePointSubpath()) {
- return splashErrBogusPath;
- }
- grow(1);
- pts[length].x = x;
- pts[length].y = y;
- flags[length] = splashPathFirst | splashPathLast;
- curSubpath = length++;
- return splashOk;
-}
-
-SplashError SplashPath::lineTo(SplashCoord x, SplashCoord y) {
- if (noCurrentPoint()) {
- return splashErrNoCurPt;
- }
- flags[length-1] &= ~splashPathLast;
- grow(1);
- pts[length].x = x;
- pts[length].y = y;
- flags[length] = splashPathLast;
- ++length;
- return splashOk;
-}
-
-SplashError SplashPath::curveTo(SplashCoord x1, SplashCoord y1,
- SplashCoord x2, SplashCoord y2,
- SplashCoord x3, SplashCoord y3) {
- if (noCurrentPoint()) {
- return splashErrNoCurPt;
- }
- flags[length-1] &= ~splashPathLast;
- grow(3);
- pts[length].x = x1;
- pts[length].y = y1;
- flags[length] = splashPathCurve;
- ++length;
- pts[length].x = x2;
- pts[length].y = y2;
- flags[length] = splashPathCurve;
- ++length;
- pts[length].x = x3;
- pts[length].y = y3;
- flags[length] = splashPathLast;
- ++length;
- return splashOk;
-}
-
-SplashError SplashPath::close() {
- if (noCurrentPoint()) {
- return splashErrNoCurPt;
- }
- if (curSubpath == length - 1 ||
- pts[length - 1].x != pts[curSubpath].x ||
- pts[length - 1].y != pts[curSubpath].y) {
- lineTo(pts[curSubpath].x, pts[curSubpath].y);
- }
- flags[curSubpath] |= splashPathClosed;
- flags[length - 1] |= splashPathClosed;
- curSubpath = length;
- return splashOk;
-}
-
-void SplashPath::addStrokeAdjustHint(int ctrl0, int ctrl1,
- int firstPt, int lastPt) {
- if (hintsLength == hintsSize) {
- hintsSize = hintsLength ? 2 * hintsLength : 8;
- hints = (SplashPathHint *)greallocn(hints, hintsSize,
- sizeof(SplashPathHint));
- }
- hints[hintsLength].ctrl0 = ctrl0;
- hints[hintsLength].ctrl1 = ctrl1;
- hints[hintsLength].firstPt = firstPt;
- hints[hintsLength].lastPt = lastPt;
- ++hintsLength;
-}
-
-void SplashPath::offset(SplashCoord dx, SplashCoord dy) {
- int i;
-
- for (i = 0; i < length; ++i) {
- pts[i].x += dx;
- pts[i].y += dy;
- }
-}
-
-GBool SplashPath::getCurPt(SplashCoord *x, SplashCoord *y) {
- if (noCurrentPoint()) {
- return gFalse;
- }
- *x = pts[length - 1].x;
- *y = pts[length - 1].y;
- return gTrue;
-}
diff --git a/kpdf/xpdf/splash/SplashPath.cpp b/kpdf/xpdf/splash/SplashPath.cpp
new file mode 100644
index 00000000..4a3c334c
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashPath.cpp
@@ -0,0 +1,184 @@
+//========================================================================
+//
+// SplashPath.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include "gmem.h"
+#include "SplashErrorCodes.h"
+#include "SplashPath.h"
+
+//------------------------------------------------------------------------
+// SplashPath
+//------------------------------------------------------------------------
+
+// A path can be in three possible states:
+//
+// 1. no current point -- zero or more finished subpaths
+// [curSubpath == length]
+//
+// 2. one point in subpath
+// [curSubpath == length - 1]
+//
+// 3. open subpath with two or more points
+// [curSubpath < length - 1]
+
+SplashPath::SplashPath() {
+ pts = NULL;
+ flags = NULL;
+ length = size = 0;
+ curSubpath = 0;
+ hints = NULL;
+ hintsLength = hintsSize = 0;
+}
+
+SplashPath::SplashPath(SplashPath *path) {
+ length = path->length;
+ size = path->size;
+ pts = (SplashPathPoint *)gmallocn(size, sizeof(SplashPathPoint));
+ flags = (Guchar *)gmallocn(size, sizeof(Guchar));
+ memcpy(pts, path->pts, length * sizeof(SplashPathPoint));
+ memcpy(flags, path->flags, length * sizeof(Guchar));
+ curSubpath = path->curSubpath;
+ if (path->hints) {
+ hintsLength = hintsSize = path->hintsLength;
+ hints = (SplashPathHint *)gmallocn(hintsSize, sizeof(SplashPathHint));
+ memcpy(hints, path->hints, hintsLength * sizeof(SplashPathHint));
+ } else {
+ hints = NULL;
+ }
+}
+
+SplashPath::~SplashPath() {
+ gfree(pts);
+ gfree(flags);
+ gfree(hints);
+}
+
+// Add space for <nPts> more points.
+void SplashPath::grow(int nPts) {
+ if (length + nPts > size) {
+ if (size == 0) {
+ size = 32;
+ }
+ while (size < length + nPts) {
+ size *= 2;
+ }
+ pts = (SplashPathPoint *)greallocn(pts, size, sizeof(SplashPathPoint));
+ flags = (Guchar *)greallocn(flags, size, sizeof(Guchar));
+ }
+}
+
+void SplashPath::append(SplashPath *path) {
+ int i;
+
+ curSubpath = length + path->curSubpath;
+ grow(path->length);
+ for (i = 0; i < path->length; ++i) {
+ pts[length] = path->pts[i];
+ flags[length] = path->flags[i];
+ ++length;
+ }
+}
+
+SplashError SplashPath::moveTo(SplashCoord x, SplashCoord y) {
+ if (onePointSubpath()) {
+ return splashErrBogusPath;
+ }
+ grow(1);
+ pts[length].x = x;
+ pts[length].y = y;
+ flags[length] = splashPathFirst | splashPathLast;
+ curSubpath = length++;
+ return splashOk;
+}
+
+SplashError SplashPath::lineTo(SplashCoord x, SplashCoord y) {
+ if (noCurrentPoint()) {
+ return splashErrNoCurPt;
+ }
+ flags[length-1] &= ~splashPathLast;
+ grow(1);
+ pts[length].x = x;
+ pts[length].y = y;
+ flags[length] = splashPathLast;
+ ++length;
+ return splashOk;
+}
+
+SplashError SplashPath::curveTo(SplashCoord x1, SplashCoord y1,
+ SplashCoord x2, SplashCoord y2,
+ SplashCoord x3, SplashCoord y3) {
+ if (noCurrentPoint()) {
+ return splashErrNoCurPt;
+ }
+ flags[length-1] &= ~splashPathLast;
+ grow(3);
+ pts[length].x = x1;
+ pts[length].y = y1;
+ flags[length] = splashPathCurve;
+ ++length;
+ pts[length].x = x2;
+ pts[length].y = y2;
+ flags[length] = splashPathCurve;
+ ++length;
+ pts[length].x = x3;
+ pts[length].y = y3;
+ flags[length] = splashPathLast;
+ ++length;
+ return splashOk;
+}
+
+SplashError SplashPath::close() {
+ if (noCurrentPoint()) {
+ return splashErrNoCurPt;
+ }
+ if (curSubpath == length - 1 ||
+ pts[length - 1].x != pts[curSubpath].x ||
+ pts[length - 1].y != pts[curSubpath].y) {
+ lineTo(pts[curSubpath].x, pts[curSubpath].y);
+ }
+ flags[curSubpath] |= splashPathClosed;
+ flags[length - 1] |= splashPathClosed;
+ curSubpath = length;
+ return splashOk;
+}
+
+void SplashPath::addStrokeAdjustHint(int ctrl0, int ctrl1,
+ int firstPt, int lastPt) {
+ if (hintsLength == hintsSize) {
+ hintsSize = hintsLength ? 2 * hintsLength : 8;
+ hints = (SplashPathHint *)greallocn(hints, hintsSize,
+ sizeof(SplashPathHint));
+ }
+ hints[hintsLength].ctrl0 = ctrl0;
+ hints[hintsLength].ctrl1 = ctrl1;
+ hints[hintsLength].firstPt = firstPt;
+ hints[hintsLength].lastPt = lastPt;
+ ++hintsLength;
+}
+
+void SplashPath::offset(SplashCoord dx, SplashCoord dy) {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ pts[i].x += dx;
+ pts[i].y += dy;
+ }
+}
+
+GBool SplashPath::getCurPt(SplashCoord *x, SplashCoord *y) {
+ if (noCurrentPoint()) {
+ return gFalse;
+ }
+ *x = pts[length - 1].x;
+ *y = pts[length - 1].y;
+ return gTrue;
+}
diff --git a/kpdf/xpdf/splash/SplashPattern.cc b/kpdf/xpdf/splash/SplashPattern.cc
deleted file mode 100644
index e6a37852..00000000
--- a/kpdf/xpdf/splash/SplashPattern.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-//========================================================================
-//
-// SplashPattern.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "SplashMath.h"
-#include "SplashScreen.h"
-#include "SplashPattern.h"
-
-//------------------------------------------------------------------------
-// SplashPattern
-//------------------------------------------------------------------------
-
-SplashPattern::SplashPattern() {
-}
-
-SplashPattern::~SplashPattern() {
-}
-
-//------------------------------------------------------------------------
-// SplashSolidColor
-//------------------------------------------------------------------------
-
-SplashSolidColor::SplashSolidColor(SplashColorPtr colorA) {
- splashColorCopy(color, colorA);
-}
-
-SplashSolidColor::~SplashSolidColor() {
-}
-
-void SplashSolidColor::getColor(int /*x*/, int /*y*/, SplashColorPtr c) {
- splashColorCopy(c, color);
-}
diff --git a/kpdf/xpdf/splash/SplashPattern.cpp b/kpdf/xpdf/splash/SplashPattern.cpp
new file mode 100644
index 00000000..2aa4f70f
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashPattern.cpp
@@ -0,0 +1,40 @@
+//========================================================================
+//
+// SplashPattern.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "SplashMath.h"
+#include "SplashScreen.h"
+#include "SplashPattern.h"
+
+//------------------------------------------------------------------------
+// SplashPattern
+//------------------------------------------------------------------------
+
+SplashPattern::SplashPattern() {
+}
+
+SplashPattern::~SplashPattern() {
+}
+
+//------------------------------------------------------------------------
+// SplashSolidColor
+//------------------------------------------------------------------------
+
+SplashSolidColor::SplashSolidColor(SplashColorPtr colorA) {
+ splashColorCopy(color, colorA);
+}
+
+SplashSolidColor::~SplashSolidColor() {
+}
+
+void SplashSolidColor::getColor(int /*x*/, int /*y*/, SplashColorPtr c) {
+ splashColorCopy(c, color);
+}
diff --git a/kpdf/xpdf/splash/SplashScreen.cc b/kpdf/xpdf/splash/SplashScreen.cc
deleted file mode 100644
index 3e8d36ca..00000000
--- a/kpdf/xpdf/splash/SplashScreen.cc
+++ /dev/null
@@ -1,385 +0,0 @@
-//========================================================================
-//
-// SplashScreen.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "SplashMath.h"
-#include "SplashScreen.h"
-
-//------------------------------------------------------------------------
-
-static SplashScreenParams defaultParams = {
- splashScreenDispersed, // type
- 2, // size
- 2, // dotRadius
- 1.0, // gamma
- 0.0, // blackThreshold
- 1.0 // whiteThreshold
-};
-
-//------------------------------------------------------------------------
-
-struct SplashScreenPoint {
- int x, y;
- int dist;
-};
-
-static int cmpDistances(const void *p0, const void *p1) {
- return ((SplashScreenPoint *)p0)->dist - ((SplashScreenPoint *)p1)->dist;
-}
-
-//------------------------------------------------------------------------
-// SplashScreen
-//------------------------------------------------------------------------
-
-// If <clustered> is true, this generates a 45 degree screen using a
-// circular dot spot function. DPI = resolution / ((size / 2) *
-// sqrt(2)). If <clustered> is false, this generates an optimal
-// threshold matrix using recursive tesselation. Gamma correction
-// (gamma = 1 / 1.33) is also computed here.
-SplashScreen::SplashScreen(SplashScreenParams *params) {
- Guchar u, black, white;
- int i;
-
- if (!params) {
- params = &defaultParams;
- }
-
- switch (params->type) {
-
- case splashScreenDispersed:
- // size must be a power of 2
- for (size = 1; size < params->size; size <<= 1) ;
- mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
- buildDispersedMatrix(size/2, size/2, 1, size/2, 1);
- break;
-
- case splashScreenClustered:
- // size must be even
- size = (params->size >> 1) << 1;
- if (size < 2) {
- size = 2;
- }
- mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
- buildClusteredMatrix();
- break;
-
- case splashScreenStochasticClustered:
- // size must be at least 2*r
- if (params->size < 2 * params->dotRadius) {
- size = 2 * params->dotRadius;
- } else {
- size = params->size;
- }
- mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
- buildSCDMatrix(params->dotRadius);
- break;
- }
-
- // do gamma correction and compute minVal/maxVal
- minVal = 255;
- maxVal = 0;
- black = splashRound((SplashCoord)255.0 * params->blackThreshold);
- if (black < 1) {
- black = 1;
- }
- int whiteAux = splashRound((SplashCoord)255.0 * params->whiteThreshold);
- if (whiteAux > 255) {
- white = 255;
- } else {
- white = whiteAux;
- }
- for (i = 0; i < size * size; ++i) {
- u = splashRound((SplashCoord)255.0 *
- splashPow((SplashCoord)mat[i] / 255.0, params->gamma));
- if (u < black) {
- u = black;
- } else if (u >= white) {
- u = white;
- }
- mat[i] = u;
- if (u < minVal) {
- minVal = u;
- } else if (u > maxVal) {
- maxVal = u;
- }
- }
-}
-
-void SplashScreen::buildDispersedMatrix(int i, int j, int val,
- int delta, int offset) {
- if (delta == 0) {
- // map values in [1, size^2] --> [1, 255]
- mat[i * size + j] = 1 + (254 * (val - 1)) / (size * size - 1);
- } else {
- buildDispersedMatrix(i, j,
- val, delta / 2, 4*offset);
- buildDispersedMatrix((i + delta) % size, (j + delta) % size,
- val + offset, delta / 2, 4*offset);
- buildDispersedMatrix((i + delta) % size, j,
- val + 2*offset, delta / 2, 4*offset);
- buildDispersedMatrix((i + 2*delta) % size, (j + delta) % size,
- val + 3*offset, delta / 2, 4*offset);
- }
-}
-
-void SplashScreen::buildClusteredMatrix() {
- SplashCoord *dist;
- SplashCoord u, v, d;
- Guchar val;
- int size2, x, y, x1, y1, i;
-
- size2 = size >> 1;
-
- // initialize the threshold matrix
- for (y = 0; y < size; ++y) {
- for (x = 0; x < size; ++x) {
- mat[y * size + x] = 0;
- }
- }
-
- // build the distance matrix
- dist = (SplashCoord *)gmallocn(size * size2, sizeof(SplashCoord));
- for (y = 0; y < size2; ++y) {
- for (x = 0; x < size2; ++x) {
- if (x + y < size2 - 1) {
- u = (SplashCoord)x + 0.5 - 0;
- v = (SplashCoord)y + 0.5 - 0;
- } else {
- u = (SplashCoord)x + 0.5 - (SplashCoord)size2;
- v = (SplashCoord)y + 0.5 - (SplashCoord)size2;
- }
- dist[y * size2 + x] = u*u + v*v;
- }
- }
- for (y = 0; y < size2; ++y) {
- for (x = 0; x < size2; ++x) {
- if (x < y) {
- u = (SplashCoord)x + 0.5 - 0;
- v = (SplashCoord)y + 0.5 - (SplashCoord)size2;
- } else {
- u = (SplashCoord)x + 0.5 - (SplashCoord)size2;
- v = (SplashCoord)y + 0.5 - 0;
- }
- dist[(size2 + y) * size2 + x] = u*u + v*v;
- }
- }
-
- // build the threshold matrix
- minVal = 1;
- maxVal = 0;
- x1 = y1 = 0; // make gcc happy
- for (i = 0; i < size * size2; ++i) {
- d = -1;
- for (y = 0; y < size; ++y) {
- for (x = 0; x < size2; ++x) {
- if (mat[y * size + x] == 0 &&
- dist[y * size2 + x] > d) {
- x1 = x;
- y1 = y;
- d = dist[y1 * size2 + x1];
- }
- }
- }
- // map values in [0, 2*size*size2-1] --> [1, 255]
- val = 1 + (254 * (2*i)) / (2*size*size2 - 1);
- mat[y1 * size + x1] = val;
- val = 1 + (254 * (2*i+1)) / (2*size*size2 - 1);
- if (y1 < size2) {
- mat[(y1 + size2) * size + x1 + size2] = val;
- } else {
- mat[(y1 - size2) * size + x1 + size2] = val;
- }
- }
-
- gfree(dist);
-}
-
-// Compute the distance between two points on a toroid.
-int SplashScreen::distance(int x0, int y0, int x1, int y1) {
- int dx0, dx1, dx, dy0, dy1, dy;
-
- dx0 = abs(x0 - x1);
- dx1 = size - dx0;
- dx = dx0 < dx1 ? dx0 : dx1;
- dy0 = abs(y0 - y1);
- dy1 = size - dy0;
- dy = dy0 < dy1 ? dy0 : dy1;
- return dx * dx + dy * dy;
-}
-
-// Algorithm taken from:
-// Victor Ostromoukhov and Roger D. Hersch, "Stochastic Clustered-Dot
-// Dithering" in Color Imaging: Device-Independent Color, Color
-// Hardcopy, and Graphic Arts IV, SPIE Vol. 3648, pp. 496-505, 1999.
-void SplashScreen::buildSCDMatrix(int r) {
- SplashScreenPoint *dots, *pts;
- int dotsLen, dotsSize;
- char *tmpl;
- char *grid;
- int *region, *dist;
- int x, y, xx, yy, x0, x1, y0, y1, i, j, d, iMin, dMin, n;
-
- //~ this should probably happen somewhere else
- srand(123);
-
- // generate the random space-filling curve
- pts = (SplashScreenPoint *)gmallocn(size * size, sizeof(SplashScreenPoint));
- i = 0;
- for (y = 0; y < size; ++y) {
- for (x = 0; x < size; ++x) {
- pts[i].x = x;
- pts[i].y = y;
- ++i;
- }
- }
- for (i = 0; i < size * size; ++i) {
- j = i + (int)((double)(size * size - i) *
- (double)rand() / ((double)RAND_MAX + 1.0));
- x = pts[i].x;
- y = pts[i].y;
- pts[i].x = pts[j].x;
- pts[i].y = pts[j].y;
- pts[j].x = x;
- pts[j].y = y;
- }
-
- // construct the circle template
- tmpl = (char *)gmallocn((r+1)*(r+1), sizeof(char));
- for (y = 0; y <= r; ++y) {
- for (x = 0; x <= r; ++x) {
- tmpl[y*(r+1) + x] = (x * y <= r * r) ? 1 : 0;
- }
- }
-
- // mark all grid cells as free
- grid = (char *)gmallocn(size * size, sizeof(char));
- for (y = 0; y < size; ++y) {
- for (x = 0; x < size; ++x) {
- grid[y*size + x] = 0;
- }
- }
-
- // walk the space-filling curve, adding dots
- dotsLen = 0;
- dotsSize = 32;
- dots = (SplashScreenPoint *)gmallocn(dotsSize, sizeof(SplashScreenPoint));
- for (i = 0; i < size * size; ++i) {
- x = pts[i].x;
- y = pts[i].y;
- if (!grid[y*size + x]) {
- if (dotsLen == dotsSize) {
- dotsSize *= 2;
- dots = (SplashScreenPoint *)greallocn(dots, dotsSize,
- sizeof(SplashScreenPoint));
- }
- dots[dotsLen++] = pts[i];
- for (yy = 0; yy <= r; ++yy) {
- y0 = (y + yy) % size;
- y1 = (y - yy + size) % size;
- for (xx = 0; xx <= r; ++xx) {
- if (tmpl[yy*(r+1) + xx]) {
- x0 = (x + xx) % size;
- x1 = (x - xx + size) % size;
- grid[y0*size + x0] = 1;
- grid[y0*size + x1] = 1;
- grid[y1*size + x0] = 1;
- grid[y1*size + x1] = 1;
- }
- }
- }
- }
- }
-
- gfree(tmpl);
- gfree(grid);
-
- // assign each cell to a dot, compute distance to center of dot
- region = (int *)gmallocn(size * size, sizeof(int));
- dist = (int *)gmallocn(size * size, sizeof(int));
- for (y = 0; y < size; ++y) {
- for (x = 0; x < size; ++x) {
- iMin = 0;
- dMin = distance(dots[0].x, dots[0].y, x, y);
- for (i = 1; i < dotsLen; ++i) {
- d = distance(dots[i].x, dots[i].y, x, y);
- if (d < dMin) {
- iMin = i;
- dMin = d;
- }
- }
- region[y*size + x] = iMin;
- dist[y*size + x] = dMin;
- }
- }
-
- // compute threshold values
- for (i = 0; i < dotsLen; ++i) {
- n = 0;
- for (y = 0; y < size; ++y) {
- for (x = 0; x < size; ++x) {
- if (region[y*size + x] == i) {
- pts[n].x = x;
- pts[n].y = y;
- pts[n].dist = distance(dots[i].x, dots[i].y, x, y);
- ++n;
- }
- }
- }
- qsort(pts, n, sizeof(SplashScreenPoint), &cmpDistances);
- for (j = 0; j < n; ++j) {
- // map values in [0 .. n-1] --> [255 .. 1]
- mat[pts[j].y * size + pts[j].x] = 255 - (254 * j) / (n - 1);
- }
- }
-
- gfree(pts);
- gfree(region);
- gfree(dist);
-
- gfree(dots);
-}
-
-SplashScreen::SplashScreen(SplashScreen *screen) {
- size = screen->size;
- mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
- memcpy(mat, screen->mat, size * size * sizeof(Guchar));
- minVal = screen->minVal;
- maxVal = screen->maxVal;
-}
-
-SplashScreen::~SplashScreen() {
- gfree(mat);
-}
-
-int SplashScreen::test(int x, int y, Guchar value) {
- int xx, yy;
-
- if (value < minVal) {
- return 0;
- }
- if (value >= maxVal) {
- return 1;
- }
- if ((xx = x % size) < 0) {
- xx = -xx;
- }
- if ((yy = y % size) < 0) {
- yy = -yy;
- }
- return value < mat[yy * size + xx] ? 0 : 1;
-}
-
-GBool SplashScreen::isStatic(Guchar value) {
- return value < minVal || value >= maxVal;
-}
diff --git a/kpdf/xpdf/splash/SplashScreen.cpp b/kpdf/xpdf/splash/SplashScreen.cpp
new file mode 100644
index 00000000..a1f50c0a
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashScreen.cpp
@@ -0,0 +1,385 @@
+//========================================================================
+//
+// SplashScreen.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "SplashMath.h"
+#include "SplashScreen.h"
+
+//------------------------------------------------------------------------
+
+static SplashScreenParams defaultParams = {
+ splashScreenDispersed, // type
+ 2, // size
+ 2, // dotRadius
+ 1.0, // gamma
+ 0.0, // blackThreshold
+ 1.0 // whiteThreshold
+};
+
+//------------------------------------------------------------------------
+
+struct SplashScreenPoint {
+ int x, y;
+ int dist;
+};
+
+static int cmpDistances(const void *p0, const void *p1) {
+ return ((SplashScreenPoint *)p0)->dist - ((SplashScreenPoint *)p1)->dist;
+}
+
+//------------------------------------------------------------------------
+// SplashScreen
+//------------------------------------------------------------------------
+
+// If <clustered> is true, this generates a 45 degree screen using a
+// circular dot spot function. DPI = resolution / ((size / 2) *
+// sqrt(2)). If <clustered> is false, this generates an optimal
+// threshold matrix using recursive tesselation. Gamma correction
+// (gamma = 1 / 1.33) is also computed here.
+SplashScreen::SplashScreen(SplashScreenParams *params) {
+ Guchar u, black, white;
+ int i;
+
+ if (!params) {
+ params = &defaultParams;
+ }
+
+ switch (params->type) {
+
+ case splashScreenDispersed:
+ // size must be a power of 2
+ for (size = 1; size < params->size; size <<= 1) ;
+ mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
+ buildDispersedMatrix(size/2, size/2, 1, size/2, 1);
+ break;
+
+ case splashScreenClustered:
+ // size must be even
+ size = (params->size >> 1) << 1;
+ if (size < 2) {
+ size = 2;
+ }
+ mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
+ buildClusteredMatrix();
+ break;
+
+ case splashScreenStochasticClustered:
+ // size must be at least 2*r
+ if (params->size < 2 * params->dotRadius) {
+ size = 2 * params->dotRadius;
+ } else {
+ size = params->size;
+ }
+ mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
+ buildSCDMatrix(params->dotRadius);
+ break;
+ }
+
+ // do gamma correction and compute minVal/maxVal
+ minVal = 255;
+ maxVal = 0;
+ black = splashRound((SplashCoord)255.0 * params->blackThreshold);
+ if (black < 1) {
+ black = 1;
+ }
+ int whiteAux = splashRound((SplashCoord)255.0 * params->whiteThreshold);
+ if (whiteAux > 255) {
+ white = 255;
+ } else {
+ white = whiteAux;
+ }
+ for (i = 0; i < size * size; ++i) {
+ u = splashRound((SplashCoord)255.0 *
+ splashPow((SplashCoord)mat[i] / 255.0, params->gamma));
+ if (u < black) {
+ u = black;
+ } else if (u >= white) {
+ u = white;
+ }
+ mat[i] = u;
+ if (u < minVal) {
+ minVal = u;
+ } else if (u > maxVal) {
+ maxVal = u;
+ }
+ }
+}
+
+void SplashScreen::buildDispersedMatrix(int i, int j, int val,
+ int delta, int offset) {
+ if (delta == 0) {
+ // map values in [1, size^2] --> [1, 255]
+ mat[i * size + j] = 1 + (254 * (val - 1)) / (size * size - 1);
+ } else {
+ buildDispersedMatrix(i, j,
+ val, delta / 2, 4*offset);
+ buildDispersedMatrix((i + delta) % size, (j + delta) % size,
+ val + offset, delta / 2, 4*offset);
+ buildDispersedMatrix((i + delta) % size, j,
+ val + 2*offset, delta / 2, 4*offset);
+ buildDispersedMatrix((i + 2*delta) % size, (j + delta) % size,
+ val + 3*offset, delta / 2, 4*offset);
+ }
+}
+
+void SplashScreen::buildClusteredMatrix() {
+ SplashCoord *dist;
+ SplashCoord u, v, d;
+ Guchar val;
+ int size2, x, y, x1, y1, i;
+
+ size2 = size >> 1;
+
+ // initialize the threshold matrix
+ for (y = 0; y < size; ++y) {
+ for (x = 0; x < size; ++x) {
+ mat[y * size + x] = 0;
+ }
+ }
+
+ // build the distance matrix
+ dist = (SplashCoord *)gmallocn(size * size2, sizeof(SplashCoord));
+ for (y = 0; y < size2; ++y) {
+ for (x = 0; x < size2; ++x) {
+ if (x + y < size2 - 1) {
+ u = (SplashCoord)x + 0.5 - 0;
+ v = (SplashCoord)y + 0.5 - 0;
+ } else {
+ u = (SplashCoord)x + 0.5 - (SplashCoord)size2;
+ v = (SplashCoord)y + 0.5 - (SplashCoord)size2;
+ }
+ dist[y * size2 + x] = u*u + v*v;
+ }
+ }
+ for (y = 0; y < size2; ++y) {
+ for (x = 0; x < size2; ++x) {
+ if (x < y) {
+ u = (SplashCoord)x + 0.5 - 0;
+ v = (SplashCoord)y + 0.5 - (SplashCoord)size2;
+ } else {
+ u = (SplashCoord)x + 0.5 - (SplashCoord)size2;
+ v = (SplashCoord)y + 0.5 - 0;
+ }
+ dist[(size2 + y) * size2 + x] = u*u + v*v;
+ }
+ }
+
+ // build the threshold matrix
+ minVal = 1;
+ maxVal = 0;
+ x1 = y1 = 0; // make gcc happy
+ for (i = 0; i < size * size2; ++i) {
+ d = -1;
+ for (y = 0; y < size; ++y) {
+ for (x = 0; x < size2; ++x) {
+ if (mat[y * size + x] == 0 &&
+ dist[y * size2 + x] > d) {
+ x1 = x;
+ y1 = y;
+ d = dist[y1 * size2 + x1];
+ }
+ }
+ }
+ // map values in [0, 2*size*size2-1] --> [1, 255]
+ val = 1 + (254 * (2*i)) / (2*size*size2 - 1);
+ mat[y1 * size + x1] = val;
+ val = 1 + (254 * (2*i+1)) / (2*size*size2 - 1);
+ if (y1 < size2) {
+ mat[(y1 + size2) * size + x1 + size2] = val;
+ } else {
+ mat[(y1 - size2) * size + x1 + size2] = val;
+ }
+ }
+
+ gfree(dist);
+}
+
+// Compute the distance between two points on a toroid.
+int SplashScreen::distance(int x0, int y0, int x1, int y1) {
+ int dx0, dx1, dx, dy0, dy1, dy;
+
+ dx0 = abs(x0 - x1);
+ dx1 = size - dx0;
+ dx = dx0 < dx1 ? dx0 : dx1;
+ dy0 = abs(y0 - y1);
+ dy1 = size - dy0;
+ dy = dy0 < dy1 ? dy0 : dy1;
+ return dx * dx + dy * dy;
+}
+
+// Algorithm taken from:
+// Victor Ostromoukhov and Roger D. Hersch, "Stochastic Clustered-Dot
+// Dithering" in Color Imaging: Device-Independent Color, Color
+// Hardcopy, and Graphic Arts IV, SPIE Vol. 3648, pp. 496-505, 1999.
+void SplashScreen::buildSCDMatrix(int r) {
+ SplashScreenPoint *dots, *pts;
+ int dotsLen, dotsSize;
+ char *tmpl;
+ char *grid;
+ int *region, *dist;
+ int x, y, xx, yy, x0, x1, y0, y1, i, j, d, iMin, dMin, n;
+
+ //~ this should probably happen somewhere else
+ srand(123);
+
+ // generate the random space-filling curve
+ pts = (SplashScreenPoint *)gmallocn(size * size, sizeof(SplashScreenPoint));
+ i = 0;
+ for (y = 0; y < size; ++y) {
+ for (x = 0; x < size; ++x) {
+ pts[i].x = x;
+ pts[i].y = y;
+ ++i;
+ }
+ }
+ for (i = 0; i < size * size; ++i) {
+ j = i + (int)((double)(size * size - i) *
+ (double)rand() / ((double)RAND_MAX + 1.0));
+ x = pts[i].x;
+ y = pts[i].y;
+ pts[i].x = pts[j].x;
+ pts[i].y = pts[j].y;
+ pts[j].x = x;
+ pts[j].y = y;
+ }
+
+ // construct the circle template
+ tmpl = (char *)gmallocn((r+1)*(r+1), sizeof(char));
+ for (y = 0; y <= r; ++y) {
+ for (x = 0; x <= r; ++x) {
+ tmpl[y*(r+1) + x] = (x * y <= r * r) ? 1 : 0;
+ }
+ }
+
+ // mark all grid cells as free
+ grid = (char *)gmallocn(size * size, sizeof(char));
+ for (y = 0; y < size; ++y) {
+ for (x = 0; x < size; ++x) {
+ grid[y*size + x] = 0;
+ }
+ }
+
+ // walk the space-filling curve, adding dots
+ dotsLen = 0;
+ dotsSize = 32;
+ dots = (SplashScreenPoint *)gmallocn(dotsSize, sizeof(SplashScreenPoint));
+ for (i = 0; i < size * size; ++i) {
+ x = pts[i].x;
+ y = pts[i].y;
+ if (!grid[y*size + x]) {
+ if (dotsLen == dotsSize) {
+ dotsSize *= 2;
+ dots = (SplashScreenPoint *)greallocn(dots, dotsSize,
+ sizeof(SplashScreenPoint));
+ }
+ dots[dotsLen++] = pts[i];
+ for (yy = 0; yy <= r; ++yy) {
+ y0 = (y + yy) % size;
+ y1 = (y - yy + size) % size;
+ for (xx = 0; xx <= r; ++xx) {
+ if (tmpl[yy*(r+1) + xx]) {
+ x0 = (x + xx) % size;
+ x1 = (x - xx + size) % size;
+ grid[y0*size + x0] = 1;
+ grid[y0*size + x1] = 1;
+ grid[y1*size + x0] = 1;
+ grid[y1*size + x1] = 1;
+ }
+ }
+ }
+ }
+ }
+
+ gfree(tmpl);
+ gfree(grid);
+
+ // assign each cell to a dot, compute distance to center of dot
+ region = (int *)gmallocn(size * size, sizeof(int));
+ dist = (int *)gmallocn(size * size, sizeof(int));
+ for (y = 0; y < size; ++y) {
+ for (x = 0; x < size; ++x) {
+ iMin = 0;
+ dMin = distance(dots[0].x, dots[0].y, x, y);
+ for (i = 1; i < dotsLen; ++i) {
+ d = distance(dots[i].x, dots[i].y, x, y);
+ if (d < dMin) {
+ iMin = i;
+ dMin = d;
+ }
+ }
+ region[y*size + x] = iMin;
+ dist[y*size + x] = dMin;
+ }
+ }
+
+ // compute threshold values
+ for (i = 0; i < dotsLen; ++i) {
+ n = 0;
+ for (y = 0; y < size; ++y) {
+ for (x = 0; x < size; ++x) {
+ if (region[y*size + x] == i) {
+ pts[n].x = x;
+ pts[n].y = y;
+ pts[n].dist = distance(dots[i].x, dots[i].y, x, y);
+ ++n;
+ }
+ }
+ }
+ qsort(pts, n, sizeof(SplashScreenPoint), &cmpDistances);
+ for (j = 0; j < n; ++j) {
+ // map values in [0 .. n-1] --> [255 .. 1]
+ mat[pts[j].y * size + pts[j].x] = 255 - (254 * j) / (n - 1);
+ }
+ }
+
+ gfree(pts);
+ gfree(region);
+ gfree(dist);
+
+ gfree(dots);
+}
+
+SplashScreen::SplashScreen(SplashScreen *screen) {
+ size = screen->size;
+ mat = (Guchar *)gmallocn(size * size, sizeof(Guchar));
+ memcpy(mat, screen->mat, size * size * sizeof(Guchar));
+ minVal = screen->minVal;
+ maxVal = screen->maxVal;
+}
+
+SplashScreen::~SplashScreen() {
+ gfree(mat);
+}
+
+int SplashScreen::test(int x, int y, Guchar value) {
+ int xx, yy;
+
+ if (value < minVal) {
+ return 0;
+ }
+ if (value >= maxVal) {
+ return 1;
+ }
+ if ((xx = x % size) < 0) {
+ xx = -xx;
+ }
+ if ((yy = y % size) < 0) {
+ yy = -yy;
+ }
+ return value < mat[yy * size + xx] ? 0 : 1;
+}
+
+GBool SplashScreen::isStatic(Guchar value) {
+ return value < minVal || value >= maxVal;
+}
diff --git a/kpdf/xpdf/splash/SplashState.cc b/kpdf/xpdf/splash/SplashState.cc
deleted file mode 100644
index e2c34c44..00000000
--- a/kpdf/xpdf/splash/SplashState.cc
+++ /dev/null
@@ -1,165 +0,0 @@
-//========================================================================
-//
-// SplashState.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include "gmem.h"
-#include "SplashPattern.h"
-#include "SplashScreen.h"
-#include "SplashClip.h"
-#include "SplashBitmap.h"
-#include "SplashState.h"
-
-//------------------------------------------------------------------------
-// SplashState
-//------------------------------------------------------------------------
-
-// number of components in each color mode
-int splashColorModeNComps[] = {
- 1, 1, 3, 3, 4
-};
-
-SplashState::SplashState(int width, int height, GBool vectorAntialias,
- SplashScreenParams *screenParams) {
- SplashColor color;
-
- matrix[0] = 1; matrix[1] = 0;
- matrix[2] = 0; matrix[3] = 1;
- matrix[4] = 0; matrix[5] = 0;
- memset(&color, 0, sizeof(SplashColor));
- strokePattern = new SplashSolidColor(color);
- fillPattern = new SplashSolidColor(color);
- screen = new SplashScreen(screenParams);
- blendFunc = NULL;
- strokeAlpha = 1;
- fillAlpha = 1;
- lineWidth = 0;
- lineCap = splashLineCapButt;
- lineJoin = splashLineJoinMiter;
- miterLimit = 10;
- flatness = 1;
- lineDash = NULL;
- lineDashLength = 0;
- lineDashPhase = 0;
- strokeAdjust = gFalse;
- clip = new SplashClip(0, 0, width - 0.001, height - 0.001, vectorAntialias);
- softMask = NULL;
- deleteSoftMask = gFalse;
- inNonIsolatedGroup = gFalse;
- next = NULL;
-}
-
-SplashState::SplashState(int width, int height, GBool vectorAntialias,
- SplashScreen *screenA) {
- SplashColor color;
-
- matrix[0] = 1; matrix[1] = 0;
- matrix[2] = 0; matrix[3] = 1;
- matrix[4] = 0; matrix[5] = 0;
- memset(&color, 0, sizeof(SplashColor));
- strokePattern = new SplashSolidColor(color);
- fillPattern = new SplashSolidColor(color);
- screen = screenA->copy();
- blendFunc = NULL;
- strokeAlpha = 1;
- fillAlpha = 1;
- lineWidth = 0;
- lineCap = splashLineCapButt;
- lineJoin = splashLineJoinMiter;
- miterLimit = 10;
- flatness = 1;
- lineDash = NULL;
- lineDashLength = 0;
- lineDashPhase = 0;
- strokeAdjust = gFalse;
- clip = new SplashClip(0, 0, width - 0.001, height - 0.001, vectorAntialias);
- softMask = NULL;
- deleteSoftMask = gFalse;
- inNonIsolatedGroup = gFalse;
- next = NULL;
-}
-
-SplashState::SplashState(SplashState *state) {
- memcpy(matrix, state->matrix, 6 * sizeof(SplashCoord));
- strokePattern = state->strokePattern->copy();
- fillPattern = state->fillPattern->copy();
- screen = state->screen->copy();
- blendFunc = state->blendFunc;
- strokeAlpha = state->strokeAlpha;
- fillAlpha = state->fillAlpha;
- lineWidth = state->lineWidth;
- lineCap = state->lineCap;
- lineJoin = state->lineJoin;
- miterLimit = state->miterLimit;
- flatness = state->flatness;
- if (state->lineDash) {
- lineDashLength = state->lineDashLength;
- lineDash = (SplashCoord *)gmallocn(lineDashLength, sizeof(SplashCoord));
- memcpy(lineDash, state->lineDash, lineDashLength * sizeof(SplashCoord));
- } else {
- lineDash = NULL;
- lineDashLength = 0;
- }
- lineDashPhase = state->lineDashPhase;
- strokeAdjust = state->strokeAdjust;
- clip = state->clip->copy();
- softMask = state->softMask;
- deleteSoftMask = gFalse;
- inNonIsolatedGroup = state->inNonIsolatedGroup;
- next = NULL;
-}
-
-SplashState::~SplashState() {
- delete strokePattern;
- delete fillPattern;
- delete screen;
- gfree(lineDash);
- delete clip;
- if (deleteSoftMask && softMask) {
- delete softMask;
- }
-}
-
-void SplashState::setStrokePattern(SplashPattern *strokePatternA) {
- delete strokePattern;
- strokePattern = strokePatternA;
-}
-
-void SplashState::setFillPattern(SplashPattern *fillPatternA) {
- delete fillPattern;
- fillPattern = fillPatternA;
-}
-
-void SplashState::setScreen(SplashScreen *screenA) {
- delete screen;
- screen = screenA;
-}
-
-void SplashState::setLineDash(SplashCoord *lineDashA, int lineDashLengthA,
- SplashCoord lineDashPhaseA) {
- gfree(lineDash);
- lineDashLength = lineDashLengthA;
- if (lineDashLength > 0) {
- lineDash = (SplashCoord *)gmallocn(lineDashLength, sizeof(SplashCoord));
- memcpy(lineDash, lineDashA, lineDashLength * sizeof(SplashCoord));
- } else {
- lineDash = NULL;
- }
- lineDashPhase = lineDashPhaseA;
-}
-
-void SplashState::setSoftMask(SplashBitmap *softMaskA) {
- if (deleteSoftMask) {
- delete softMask;
- }
- softMask = softMaskA;
- deleteSoftMask = gTrue;
-}
diff --git a/kpdf/xpdf/splash/SplashState.cpp b/kpdf/xpdf/splash/SplashState.cpp
new file mode 100644
index 00000000..17445ad7
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashState.cpp
@@ -0,0 +1,165 @@
+//========================================================================
+//
+// SplashState.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include "gmem.h"
+#include "SplashPattern.h"
+#include "SplashScreen.h"
+#include "SplashClip.h"
+#include "SplashBitmap.h"
+#include "SplashState.h"
+
+//------------------------------------------------------------------------
+// SplashState
+//------------------------------------------------------------------------
+
+// number of components in each color mode
+int splashColorModeNComps[] = {
+ 1, 1, 3, 3, 4
+};
+
+SplashState::SplashState(int width, int height, GBool vectorAntialias,
+ SplashScreenParams *screenParams) {
+ SplashColor color;
+
+ matrix[0] = 1; matrix[1] = 0;
+ matrix[2] = 0; matrix[3] = 1;
+ matrix[4] = 0; matrix[5] = 0;
+ memset(&color, 0, sizeof(SplashColor));
+ strokePattern = new SplashSolidColor(color);
+ fillPattern = new SplashSolidColor(color);
+ screen = new SplashScreen(screenParams);
+ blendFunc = NULL;
+ strokeAlpha = 1;
+ fillAlpha = 1;
+ lineWidth = 0;
+ lineCap = splashLineCapButt;
+ lineJoin = splashLineJoinMiter;
+ miterLimit = 10;
+ flatness = 1;
+ lineDash = NULL;
+ lineDashLength = 0;
+ lineDashPhase = 0;
+ strokeAdjust = gFalse;
+ clip = new SplashClip(0, 0, width - 0.001, height - 0.001, vectorAntialias);
+ softMask = NULL;
+ deleteSoftMask = gFalse;
+ inNonIsolatedGroup = gFalse;
+ next = NULL;
+}
+
+SplashState::SplashState(int width, int height, GBool vectorAntialias,
+ SplashScreen *screenA) {
+ SplashColor color;
+
+ matrix[0] = 1; matrix[1] = 0;
+ matrix[2] = 0; matrix[3] = 1;
+ matrix[4] = 0; matrix[5] = 0;
+ memset(&color, 0, sizeof(SplashColor));
+ strokePattern = new SplashSolidColor(color);
+ fillPattern = new SplashSolidColor(color);
+ screen = screenA->copy();
+ blendFunc = NULL;
+ strokeAlpha = 1;
+ fillAlpha = 1;
+ lineWidth = 0;
+ lineCap = splashLineCapButt;
+ lineJoin = splashLineJoinMiter;
+ miterLimit = 10;
+ flatness = 1;
+ lineDash = NULL;
+ lineDashLength = 0;
+ lineDashPhase = 0;
+ strokeAdjust = gFalse;
+ clip = new SplashClip(0, 0, width - 0.001, height - 0.001, vectorAntialias);
+ softMask = NULL;
+ deleteSoftMask = gFalse;
+ inNonIsolatedGroup = gFalse;
+ next = NULL;
+}
+
+SplashState::SplashState(SplashState *state) {
+ memcpy(matrix, state->matrix, 6 * sizeof(SplashCoord));
+ strokePattern = state->strokePattern->copy();
+ fillPattern = state->fillPattern->copy();
+ screen = state->screen->copy();
+ blendFunc = state->blendFunc;
+ strokeAlpha = state->strokeAlpha;
+ fillAlpha = state->fillAlpha;
+ lineWidth = state->lineWidth;
+ lineCap = state->lineCap;
+ lineJoin = state->lineJoin;
+ miterLimit = state->miterLimit;
+ flatness = state->flatness;
+ if (state->lineDash) {
+ lineDashLength = state->lineDashLength;
+ lineDash = (SplashCoord *)gmallocn(lineDashLength, sizeof(SplashCoord));
+ memcpy(lineDash, state->lineDash, lineDashLength * sizeof(SplashCoord));
+ } else {
+ lineDash = NULL;
+ lineDashLength = 0;
+ }
+ lineDashPhase = state->lineDashPhase;
+ strokeAdjust = state->strokeAdjust;
+ clip = state->clip->copy();
+ softMask = state->softMask;
+ deleteSoftMask = gFalse;
+ inNonIsolatedGroup = state->inNonIsolatedGroup;
+ next = NULL;
+}
+
+SplashState::~SplashState() {
+ delete strokePattern;
+ delete fillPattern;
+ delete screen;
+ gfree(lineDash);
+ delete clip;
+ if (deleteSoftMask && softMask) {
+ delete softMask;
+ }
+}
+
+void SplashState::setStrokePattern(SplashPattern *strokePatternA) {
+ delete strokePattern;
+ strokePattern = strokePatternA;
+}
+
+void SplashState::setFillPattern(SplashPattern *fillPatternA) {
+ delete fillPattern;
+ fillPattern = fillPatternA;
+}
+
+void SplashState::setScreen(SplashScreen *screenA) {
+ delete screen;
+ screen = screenA;
+}
+
+void SplashState::setLineDash(SplashCoord *lineDashA, int lineDashLengthA,
+ SplashCoord lineDashPhaseA) {
+ gfree(lineDash);
+ lineDashLength = lineDashLengthA;
+ if (lineDashLength > 0) {
+ lineDash = (SplashCoord *)gmallocn(lineDashLength, sizeof(SplashCoord));
+ memcpy(lineDash, lineDashA, lineDashLength * sizeof(SplashCoord));
+ } else {
+ lineDash = NULL;
+ }
+ lineDashPhase = lineDashPhaseA;
+}
+
+void SplashState::setSoftMask(SplashBitmap *softMaskA) {
+ if (deleteSoftMask) {
+ delete softMask;
+ }
+ softMask = softMaskA;
+ deleteSoftMask = gTrue;
+}
diff --git a/kpdf/xpdf/splash/SplashT1Font.cc b/kpdf/xpdf/splash/SplashT1Font.cc
deleted file mode 100644
index 19237e1d..00000000
--- a/kpdf/xpdf/splash/SplashT1Font.cc
+++ /dev/null
@@ -1,292 +0,0 @@
-//========================================================================
-//
-// SplashT1Font.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#if HAVE_T1LIB_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <t1lib.h>
-#include "gmem.h"
-#include "SplashMath.h"
-#include "SplashGlyphBitmap.h"
-#include "SplashPath.h"
-#include "SplashT1FontEngine.h"
-#include "SplashT1FontFile.h"
-#include "SplashT1Font.h"
-
-//------------------------------------------------------------------------
-
-static Guchar bitReverse[256] = {
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
- 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
- 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
- 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
- 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
- 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
- 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
- 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
- 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
- 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
- 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
- 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
- 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
- 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
- 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
- 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
- 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
- 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
- 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
- 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
- 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
- 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
- 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
- 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
- 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
- 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
- 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
- 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
- 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
- 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
- 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-//------------------------------------------------------------------------
-// SplashT1Font
-//------------------------------------------------------------------------
-
-SplashT1Font::SplashT1Font(SplashT1FontFile *fontFileA, SplashCoord *matA,
- SplashCoord *textMatA):
- SplashFont(fontFileA, matA, textMatA, fontFileA->engine->aa)
-{
- T1_TMATRIX matrix;
- BBox bbox;
- SplashCoord bbx0, bby0, bbx1, bby1;
- int x, y;
-
- t1libID = T1_CopyFont(fontFileA->t1libID);
- outlineID = -1;
-
- // compute font size
- size = (float)splashSqrt(mat[2]*mat[2] + mat[3]*mat[3]);
-
- // transform the four corners of the font bounding box -- the min
- // and max values form the bounding box of the transformed font
- bbox = T1_GetFontBBox(t1libID);
- bbx0 = 0.001 * bbox.llx;
- bby0 = 0.001 * bbox.lly;
- bbx1 = 0.001 * bbox.urx;
- bby1 = 0.001 * bbox.ury;
- // some fonts are completely broken, so we fake it (with values
- // large enough that most glyphs should fit)
- if (bbx0 == 0 && bby0 == 0 && bbx1 == 0 && bby1 == 0) {
- bbx0 = bby0 = -0.5;
- bbx1 = bby1 = 1.5;
- }
- x = (int)(mat[0] * bbx0 + mat[2] * bby0);
- xMin = xMax = x;
- y = (int)(mat[1] * bbx0 + mat[3] * bby0);
- yMin = yMax = y;
- x = (int)(mat[0] * bbx0 + mat[2] * bby1);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- y = (int)(mat[1] * bbx0 + mat[3] * bby1);
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- x = (int)(mat[0] * bbx1 + mat[2] * bby0);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- y = (int)(mat[1] * bbx1 + mat[3] * bby0);
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- x = (int)(mat[0] * bbx1 + mat[2] * bby1);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- y = (int)(mat[1] * bbx1 + mat[3] * bby1);
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- // This is a kludge: some buggy PDF generators embed fonts with
- // zero bounding boxes.
- if (xMax == xMin) {
- xMin = 0;
- xMax = (int)size;
- }
- if (yMax == yMin) {
- yMin = 0;
- yMax = (int)(1.2 * size);
- }
- // Another kludge: an unusually large xMin or yMin coordinate is
- // probably wrong.
- if (xMin > 0) {
- xMin = 0;
- }
- if (yMin > 0) {
- yMin = 0;
- }
- // Another kludge: t1lib doesn't correctly handle fonts with
- // real (non-integer) bounding box coordinates.
- if (xMax - xMin > 5000) {
- xMin = 0;
- xMax = (int)size;
- }
- if (yMax - yMin > 5000) {
- yMin = 0;
- yMax = (int)(1.2 * size);
- }
-
- // transform the font
- matrix.cxx = (double)mat[0] / size;
- matrix.cxy = (double)mat[1] / size;
- matrix.cyx = (double)mat[2] / size;
- matrix.cyy = (double)mat[3] / size;
- T1_TransformFont(t1libID, &matrix);
-}
-
-SplashT1Font::~SplashT1Font() {
- T1_DeleteFont(t1libID);
- if (outlineID >= 0) {
- T1_DeleteFont(outlineID);
- }
-}
-
-GBool SplashT1Font::getGlyph(int c, int xFrac, int yFrac,
- SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
- return SplashFont::getGlyph(c, 0, 0, bitmap, x0, y0, clip, clipRes);
-}
-
-GBool SplashT1Font::makeGlyph(int c, int xFrac, int yFrac,
- SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
- GLYPH *glyph;
- int n, i;
-
- if (aa) {
- glyph = T1_AASetChar(t1libID, c, size, NULL);
- } else {
- glyph = T1_SetChar(t1libID, c, size, NULL);
- }
- if (!glyph) {
- return gFalse;
- }
-
- bitmap->x = -glyph->metrics.leftSideBearing;
- bitmap->y = glyph->metrics.ascent;
- bitmap->w = glyph->metrics.rightSideBearing - glyph->metrics.leftSideBearing;
- bitmap->h = glyph->metrics.ascent - glyph->metrics.descent;
- bitmap->aa = aa;
- if (aa) {
- bitmap->data = (Guchar *)glyph->bits;
- bitmap->freeData = gFalse;
- } else {
- n = bitmap->h * ((bitmap->w + 7) >> 3);
- bitmap->data = (Guchar *)gmalloc(n);
- for (i = 0; i < n; ++i) {
- bitmap->data[i] = bitReverse[glyph->bits[i] & 0xff];
- }
- bitmap->freeData = gTrue;
- }
-
- *clipRes = clip->testRect(x0 - bitmap->x,
- y0 - bitmap->y,
- x0 - bitmap->x + bitmap->w - 1,
- y0 - bitmap->y + bitmap->h - 1);
-
- return gTrue;
-}
-
-SplashPath *SplashT1Font::getGlyphPath(int c) {
- T1_TMATRIX matrix;
- SplashPath *path;
- T1_OUTLINE *outline;
- T1_PATHSEGMENT *seg;
- T1_BEZIERSEGMENT *bez;
- SplashCoord x, y, x1, y1;
- GBool needClose;
-
- if (outlineID < 0) {
- outlineID = T1_CopyFont(((SplashT1FontFile *)fontFile)->t1libID);
- outlineSize = (float)splashSqrt(textMat[2]*textMat[2] +
- textMat[3]*textMat[3]);
- matrix.cxx = (double)textMat[0] / outlineSize;
- matrix.cxy = (double)textMat[1] / outlineSize;
- matrix.cyx = (double)textMat[2] / outlineSize;
- matrix.cyy = (double)textMat[3] / outlineSize;
- // t1lib doesn't seem to handle small sizes correctly here, so set
- // the size to 1000, and scale the resulting coordinates later
- outlineMul = (float)(outlineSize / 65536000.0);
- outlineSize = 1000;
- T1_TransformFont(outlineID, &matrix);
- }
-
- path = new SplashPath();
- if ((outline = T1_GetCharOutline(outlineID, c, outlineSize, NULL))) {
- x = 0;
- y = 0;
- needClose = gFalse;
- for (seg = outline; seg; seg = seg->link) {
- switch (seg->type) {
- case T1_PATHTYPE_MOVE:
- if (needClose) {
- path->close();
- needClose = gFalse;
- }
- x += seg->dest.x * outlineMul;
- y += seg->dest.y * outlineMul;
- path->moveTo(x, -y);
- break;
- case T1_PATHTYPE_LINE:
- x += seg->dest.x * outlineMul;
- y += seg->dest.y * outlineMul;
- path->lineTo(x, -y);
- needClose = gTrue;
- break;
- case T1_PATHTYPE_BEZIER:
- bez = (T1_BEZIERSEGMENT *)seg;
- x1 = x + (SplashCoord)(bez->dest.x * outlineMul);
- y1 = y + (SplashCoord)(bez->dest.y * outlineMul);
- path->curveTo(x + (SplashCoord)(bez->B.x * outlineMul),
- -(y + (SplashCoord)(bez->B.y * outlineMul)),
- x + (SplashCoord)(bez->C.x * outlineMul),
- -(y + (SplashCoord)(bez->C.y * outlineMul)),
- x1, -y1);
- x = x1;
- y = y1;
- needClose = gTrue;
- break;
- }
- }
- if (needClose) {
- path->close();
- }
- T1_FreeOutline(outline);
- }
-
- return path;
-}
-
-#endif // HAVE_T1LIB_H
diff --git a/kpdf/xpdf/splash/SplashT1Font.cpp b/kpdf/xpdf/splash/SplashT1Font.cpp
new file mode 100644
index 00000000..17dfcd78
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashT1Font.cpp
@@ -0,0 +1,292 @@
+//========================================================================
+//
+// SplashT1Font.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#if HAVE_T1LIB_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <t1lib.h>
+#include "gmem.h"
+#include "SplashMath.h"
+#include "SplashGlyphBitmap.h"
+#include "SplashPath.h"
+#include "SplashT1FontEngine.h"
+#include "SplashT1FontFile.h"
+#include "SplashT1Font.h"
+
+//------------------------------------------------------------------------
+
+static Guchar bitReverse[256] = {
+ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
+ 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
+ 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
+ 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
+ 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
+ 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
+ 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
+ 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
+ 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
+ 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
+ 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
+ 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
+ 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
+ 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
+ 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
+ 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
+ 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
+ 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
+ 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
+ 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
+ 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
+ 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
+ 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
+ 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
+ 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
+ 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
+ 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
+ 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
+ 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
+ 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
+ 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
+};
+
+//------------------------------------------------------------------------
+// SplashT1Font
+//------------------------------------------------------------------------
+
+SplashT1Font::SplashT1Font(SplashT1FontFile *fontFileA, SplashCoord *matA,
+ SplashCoord *textMatA):
+ SplashFont(fontFileA, matA, textMatA, fontFileA->engine->aa)
+{
+ T1_TMATRIX matrix;
+ BBox bbox;
+ SplashCoord bbx0, bby0, bbx1, bby1;
+ int x, y;
+
+ t1libID = T1_CopyFont(fontFileA->t1libID);
+ outlineID = -1;
+
+ // compute font size
+ size = (float)splashSqrt(mat[2]*mat[2] + mat[3]*mat[3]);
+
+ // transform the four corners of the font bounding box -- the min
+ // and max values form the bounding box of the transformed font
+ bbox = T1_GetFontBBox(t1libID);
+ bbx0 = 0.001 * bbox.llx;
+ bby0 = 0.001 * bbox.lly;
+ bbx1 = 0.001 * bbox.urx;
+ bby1 = 0.001 * bbox.ury;
+ // some fonts are completely broken, so we fake it (with values
+ // large enough that most glyphs should fit)
+ if (bbx0 == 0 && bby0 == 0 && bbx1 == 0 && bby1 == 0) {
+ bbx0 = bby0 = -0.5;
+ bbx1 = bby1 = 1.5;
+ }
+ x = (int)(mat[0] * bbx0 + mat[2] * bby0);
+ xMin = xMax = x;
+ y = (int)(mat[1] * bbx0 + mat[3] * bby0);
+ yMin = yMax = y;
+ x = (int)(mat[0] * bbx0 + mat[2] * bby1);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ y = (int)(mat[1] * bbx0 + mat[3] * bby1);
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ x = (int)(mat[0] * bbx1 + mat[2] * bby0);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ y = (int)(mat[1] * bbx1 + mat[3] * bby0);
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ x = (int)(mat[0] * bbx1 + mat[2] * bby1);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ y = (int)(mat[1] * bbx1 + mat[3] * bby1);
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ // This is a kludge: some buggy PDF generators embed fonts with
+ // zero bounding boxes.
+ if (xMax == xMin) {
+ xMin = 0;
+ xMax = (int)size;
+ }
+ if (yMax == yMin) {
+ yMin = 0;
+ yMax = (int)(1.2 * size);
+ }
+ // Another kludge: an unusually large xMin or yMin coordinate is
+ // probably wrong.
+ if (xMin > 0) {
+ xMin = 0;
+ }
+ if (yMin > 0) {
+ yMin = 0;
+ }
+ // Another kludge: t1lib doesn't correctly handle fonts with
+ // real (non-integer) bounding box coordinates.
+ if (xMax - xMin > 5000) {
+ xMin = 0;
+ xMax = (int)size;
+ }
+ if (yMax - yMin > 5000) {
+ yMin = 0;
+ yMax = (int)(1.2 * size);
+ }
+
+ // transform the font
+ matrix.cxx = (double)mat[0] / size;
+ matrix.cxy = (double)mat[1] / size;
+ matrix.cyx = (double)mat[2] / size;
+ matrix.cyy = (double)mat[3] / size;
+ T1_TransformFont(t1libID, &matrix);
+}
+
+SplashT1Font::~SplashT1Font() {
+ T1_DeleteFont(t1libID);
+ if (outlineID >= 0) {
+ T1_DeleteFont(outlineID);
+ }
+}
+
+GBool SplashT1Font::getGlyph(int c, int xFrac, int yFrac,
+ SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
+ return SplashFont::getGlyph(c, 0, 0, bitmap, x0, y0, clip, clipRes);
+}
+
+GBool SplashT1Font::makeGlyph(int c, int xFrac, int yFrac,
+ SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) {
+ GLYPH *glyph;
+ int n, i;
+
+ if (aa) {
+ glyph = T1_AASetChar(t1libID, c, size, NULL);
+ } else {
+ glyph = T1_SetChar(t1libID, c, size, NULL);
+ }
+ if (!glyph) {
+ return gFalse;
+ }
+
+ bitmap->x = -glyph->metrics.leftSideBearing;
+ bitmap->y = glyph->metrics.ascent;
+ bitmap->w = glyph->metrics.rightSideBearing - glyph->metrics.leftSideBearing;
+ bitmap->h = glyph->metrics.ascent - glyph->metrics.descent;
+ bitmap->aa = aa;
+ if (aa) {
+ bitmap->data = (Guchar *)glyph->bits;
+ bitmap->freeData = gFalse;
+ } else {
+ n = bitmap->h * ((bitmap->w + 7) >> 3);
+ bitmap->data = (Guchar *)gmalloc(n);
+ for (i = 0; i < n; ++i) {
+ bitmap->data[i] = bitReverse[glyph->bits[i] & 0xff];
+ }
+ bitmap->freeData = gTrue;
+ }
+
+ *clipRes = clip->testRect(x0 - bitmap->x,
+ y0 - bitmap->y,
+ x0 - bitmap->x + bitmap->w - 1,
+ y0 - bitmap->y + bitmap->h - 1);
+
+ return gTrue;
+}
+
+SplashPath *SplashT1Font::getGlyphPath(int c) {
+ T1_TMATRIX matrix;
+ SplashPath *path;
+ T1_OUTLINE *outline;
+ T1_PATHSEGMENT *seg;
+ T1_BEZIERSEGMENT *bez;
+ SplashCoord x, y, x1, y1;
+ GBool needClose;
+
+ if (outlineID < 0) {
+ outlineID = T1_CopyFont(((SplashT1FontFile *)fontFile)->t1libID);
+ outlineSize = (float)splashSqrt(textMat[2]*textMat[2] +
+ textMat[3]*textMat[3]);
+ matrix.cxx = (double)textMat[0] / outlineSize;
+ matrix.cxy = (double)textMat[1] / outlineSize;
+ matrix.cyx = (double)textMat[2] / outlineSize;
+ matrix.cyy = (double)textMat[3] / outlineSize;
+ // t1lib doesn't seem to handle small sizes correctly here, so set
+ // the size to 1000, and scale the resulting coordinates later
+ outlineMul = (float)(outlineSize / 65536000.0);
+ outlineSize = 1000;
+ T1_TransformFont(outlineID, &matrix);
+ }
+
+ path = new SplashPath();
+ if ((outline = T1_GetCharOutline(outlineID, c, outlineSize, NULL))) {
+ x = 0;
+ y = 0;
+ needClose = gFalse;
+ for (seg = outline; seg; seg = seg->link) {
+ switch (seg->type) {
+ case T1_PATHTYPE_MOVE:
+ if (needClose) {
+ path->close();
+ needClose = gFalse;
+ }
+ x += seg->dest.x * outlineMul;
+ y += seg->dest.y * outlineMul;
+ path->moveTo(x, -y);
+ break;
+ case T1_PATHTYPE_LINE:
+ x += seg->dest.x * outlineMul;
+ y += seg->dest.y * outlineMul;
+ path->lineTo(x, -y);
+ needClose = gTrue;
+ break;
+ case T1_PATHTYPE_BEZIER:
+ bez = (T1_BEZIERSEGMENT *)seg;
+ x1 = x + (SplashCoord)(bez->dest.x * outlineMul);
+ y1 = y + (SplashCoord)(bez->dest.y * outlineMul);
+ path->curveTo(x + (SplashCoord)(bez->B.x * outlineMul),
+ -(y + (SplashCoord)(bez->B.y * outlineMul)),
+ x + (SplashCoord)(bez->C.x * outlineMul),
+ -(y + (SplashCoord)(bez->C.y * outlineMul)),
+ x1, -y1);
+ x = x1;
+ y = y1;
+ needClose = gTrue;
+ break;
+ }
+ }
+ if (needClose) {
+ path->close();
+ }
+ T1_FreeOutline(outline);
+ }
+
+ return path;
+}
+
+#endif // HAVE_T1LIB_H
diff --git a/kpdf/xpdf/splash/SplashT1FontEngine.cc b/kpdf/xpdf/splash/SplashT1FontEngine.cc
deleted file mode 100644
index 68530e88..00000000
--- a/kpdf/xpdf/splash/SplashT1FontEngine.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-//========================================================================
-//
-// SplashT1FontEngine.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#if HAVE_T1LIB_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef WIN32
-# include <unistd.h>
-#endif
-#include <t1lib.h>
-#include "GString.h"
-#include "gfile.h"
-#include "FoFiType1C.h"
-#include "SplashT1FontFile.h"
-#include "SplashT1FontEngine.h"
-
-#ifdef VMS
-#if (__VMS_VER < 70000000)
-extern "C" int unlink(char *filename);
-#endif
-#endif
-
-//------------------------------------------------------------------------
-
-int SplashT1FontEngine::t1libInitCount = 0;
-
-//------------------------------------------------------------------------
-
-static void fileWrite(void *stream, char *data, int len) {
- fwrite(data, 1, len, (FILE *)stream);
-}
-
-//------------------------------------------------------------------------
-// SplashT1FontEngine
-//------------------------------------------------------------------------
-
-SplashT1FontEngine::SplashT1FontEngine(GBool aaA) {
- aa = aaA;
-}
-
-SplashT1FontEngine *SplashT1FontEngine::init(GBool aaA) {
- // grayVals[i] = round(i * 255 / 16)
- static unsigned long grayVals[17] = {
- 0, 16, 32, 48, 64, 80, 96, 112, 128, 143, 159, 175, 191, 207, 223, 239, 255
- };
-
- //~ for multithreading: need a mutex here
- if (t1libInitCount == 0) {
- T1_SetBitmapPad(8);
- if (!T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE |
- T1_NO_AFM)) {
- return NULL;
- }
- if (aaA) {
- T1_AASetBitsPerPixel(8);
- T1_AASetLevel(T1_AA_HIGH);
- T1_AAHSetGrayValues(grayVals);
- } else {
- T1_AANSetGrayValues(0, 1);
- }
- }
- ++t1libInitCount;
-
- return new SplashT1FontEngine(aaA);
-}
-
-SplashT1FontEngine::~SplashT1FontEngine() {
- //~ for multithreading: need a mutex here
- if (--t1libInitCount == 0) {
- T1_CloseLib();
- }
-}
-
-SplashFontFile *SplashT1FontEngine::loadType1Font(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- return SplashT1FontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
-}
-
-SplashFontFile *SplashT1FontEngine::loadType1CFont(SplashFontFileID *idA,
- SplashFontSrc *src,
- char **enc) {
- FoFiType1C *ff;
- GString *tmpFileName;
- FILE *tmpFile;
- SplashFontFile *ret;
- SplashFontSrc *newsrc;
-
- if (src->isFile)
- ff = FoFiType1C::load(src->fileName);
- else
- ff = new FoFiType1C(src->buf, src->bufLen, gFalse);
- if (! ff)
- return NULL;
- }
- tmpFileName = NULL;
- if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
- delete ff;
- return NULL;
- }
- ff->convertToType1(NULL, NULL, gTrue, &fileWrite, tmpFile);
- delete ff;
- fclose(tmpFile);
- newsrc = new SplashFontSrc;
- newsrc->setFile(tmpFileName, gTrue);
- delete tmpFileName;
- ret = SplashT1FontFile::loadType1Font(this, idA, newsrc, enc);
- newsrc->unref();
- return ret;
-}
-
-#endif // HAVE_T1LIB_H
diff --git a/kpdf/xpdf/splash/SplashT1FontEngine.cpp b/kpdf/xpdf/splash/SplashT1FontEngine.cpp
new file mode 100644
index 00000000..d17dc47c
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashT1FontEngine.cpp
@@ -0,0 +1,122 @@
+//========================================================================
+//
+// SplashT1FontEngine.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#if HAVE_T1LIB_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef WIN32
+# include <unistd.h>
+#endif
+#include <t1lib.h>
+#include "GString.h"
+#include "gfile.h"
+#include "FoFiType1C.h"
+#include "SplashT1FontFile.h"
+#include "SplashT1FontEngine.h"
+
+#ifdef VMS
+#if (__VMS_VER < 70000000)
+extern "C" int unlink(char *filename);
+#endif
+#endif
+
+//------------------------------------------------------------------------
+
+int SplashT1FontEngine::t1libInitCount = 0;
+
+//------------------------------------------------------------------------
+
+static void fileWrite(void *stream, char *data, int len) {
+ fwrite(data, 1, len, (FILE *)stream);
+}
+
+//------------------------------------------------------------------------
+// SplashT1FontEngine
+//------------------------------------------------------------------------
+
+SplashT1FontEngine::SplashT1FontEngine(GBool aaA) {
+ aa = aaA;
+}
+
+SplashT1FontEngine *SplashT1FontEngine::init(GBool aaA) {
+ // grayVals[i] = round(i * 255 / 16)
+ static unsigned long grayVals[17] = {
+ 0, 16, 32, 48, 64, 80, 96, 112, 128, 143, 159, 175, 191, 207, 223, 239, 255
+ };
+
+ //~ for multithreading: need a mutex here
+ if (t1libInitCount == 0) {
+ T1_SetBitmapPad(8);
+ if (!T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE |
+ T1_NO_AFM)) {
+ return NULL;
+ }
+ if (aaA) {
+ T1_AASetBitsPerPixel(8);
+ T1_AASetLevel(T1_AA_HIGH);
+ T1_AAHSetGrayValues(grayVals);
+ } else {
+ T1_AANSetGrayValues(0, 1);
+ }
+ }
+ ++t1libInitCount;
+
+ return new SplashT1FontEngine(aaA);
+}
+
+SplashT1FontEngine::~SplashT1FontEngine() {
+ //~ for multithreading: need a mutex here
+ if (--t1libInitCount == 0) {
+ T1_CloseLib();
+ }
+}
+
+SplashFontFile *SplashT1FontEngine::loadType1Font(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ return SplashT1FontFile::loadType1Font(this, idA, fileName, deleteFile, enc);
+}
+
+SplashFontFile *SplashT1FontEngine::loadType1CFont(SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **enc) {
+ FoFiType1C *ff;
+ GString *tmpFileName;
+ FILE *tmpFile;
+ SplashFontFile *ret;
+ SplashFontSrc *newsrc;
+
+ if (src->isFile)
+ ff = FoFiType1C::load(src->fileName);
+ else
+ ff = new FoFiType1C(src->buf, src->bufLen, gFalse);
+ if (! ff)
+ return NULL;
+ }
+ tmpFileName = NULL;
+ if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
+ delete ff;
+ return NULL;
+ }
+ ff->convertToType1(NULL, NULL, gTrue, &fileWrite, tmpFile);
+ delete ff;
+ fclose(tmpFile);
+ newsrc = new SplashFontSrc;
+ newsrc->setFile(tmpFileName, gTrue);
+ delete tmpFileName;
+ ret = SplashT1FontFile::loadType1Font(this, idA, newsrc, enc);
+ newsrc->unref();
+ return ret;
+}
+
+#endif // HAVE_T1LIB_H
diff --git a/kpdf/xpdf/splash/SplashT1FontFile.cc b/kpdf/xpdf/splash/SplashT1FontFile.cc
deleted file mode 100644
index 54312055..00000000
--- a/kpdf/xpdf/splash/SplashT1FontFile.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-//========================================================================
-//
-// SplashT1FontFile.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#if HAVE_T1LIB_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include <t1lib.h>
-#include "gmem.h"
-#include "SplashT1FontEngine.h"
-#include "SplashT1Font.h"
-#include "SplashT1FontFile.h"
-
-//------------------------------------------------------------------------
-// SplashT1FontFile
-//------------------------------------------------------------------------
-
-SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
- SplashFontFileID *idA,
- SplashFontSrc *src,
- char **encA) {
- int t1libIDA;
- char **encTmp;
- char *encStrTmp;
- int encStrSize;
- char *encPtr;
- int i;
-
- GString *fileNameA;
- SplashFontSrc *newsrc = NULL;
- SplashFontFile *ff;
-
- if (! src->isFile) {
- GString *tmpFileName;
- FILE *tmpFile;
- if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL))
- return NULL;
- fwrite(src->buf, 1, src->bufLen, tmpFile);
- fclose(tmpFile);
- newsrc = new SplashFontSrc;
- newsrc->setFile(tmpFileName, gTrue);
- src = newsrc;
- delete tmpFileName;
- }
- fileNameA = src->fileName;
- // load the font file
- if ((t1libIDA = T1_AddFont(fileNameA)) < 0) {
- delete newsrc;
- return NULL;
- }
- T1_LoadFont(t1libIDA);
-
- // reencode it
- encStrSize = 0;
- for (i = 0; i < 256; ++i) {
- if (encA[i]) {
- encStrSize += strlen(encA[i]) + 1;
- }
- }
- encTmp = (char **)gmallocn(257, sizeof(char *));
- encStrTmp = (char *)gmallocn(encStrSize, sizeof(char));
- encPtr = encStrTmp;
- for (i = 0; i < 256; ++i) {
- if (encA[i]) {
- strcpy(encPtr, encA[i]);
- encTmp[i] = encPtr;
- encPtr += strlen(encPtr) + 1;
- } else {
- encTmp[i] = ".notdef";
- }
- }
- encTmp[256] = "custom";
- T1_ReencodeFont(t1libIDA, encTmp);
-
- ff = new SplashT1FontFile(engineA, idA, src,
- t1libIDA, encTmp, encStrTmp);
- if (newsrc)
- newsrc->unref();
- return ff;
-}
-
-SplashT1FontFile::SplashT1FontFile(SplashT1FontEngine *engineA,
- SplashFontFileID *idA,
- SplashFontSrc *srcA,
- int t1libIDA, char **encA, char *encStrA):
- SplashFontFile(idA, srcA)
-{
- engine = engineA;
- t1libID = t1libIDA;
- enc = encA;
- encStr = encStrA;
-}
-
-SplashT1FontFile::~SplashT1FontFile() {
- gfree(encStr);
- gfree(enc);
- T1_DeleteFont(t1libID);
-}
-
-SplashFont *SplashT1FontFile::makeFont(SplashCoord *mat,
- SplashCoord *textMat) {
- SplashFont *font;
-
- font = new SplashT1Font(this, mat, textMat);
- font->initCache();
- return font;
-}
-
-#endif // HAVE_T1LIB_H
diff --git a/kpdf/xpdf/splash/SplashT1FontFile.cpp b/kpdf/xpdf/splash/SplashT1FontFile.cpp
new file mode 100644
index 00000000..b9f3ed3c
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashT1FontFile.cpp
@@ -0,0 +1,117 @@
+//========================================================================
+//
+// SplashT1FontFile.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#if HAVE_T1LIB_H
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include <t1lib.h>
+#include "gmem.h"
+#include "SplashT1FontEngine.h"
+#include "SplashT1Font.h"
+#include "SplashT1FontFile.h"
+
+//------------------------------------------------------------------------
+// SplashT1FontFile
+//------------------------------------------------------------------------
+
+SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
+ SplashFontFileID *idA,
+ SplashFontSrc *src,
+ char **encA) {
+ int t1libIDA;
+ char **encTmp;
+ char *encStrTmp;
+ int encStrSize;
+ char *encPtr;
+ int i;
+
+ GString *fileNameA;
+ SplashFontSrc *newsrc = NULL;
+ SplashFontFile *ff;
+
+ if (! src->isFile) {
+ GString *tmpFileName;
+ FILE *tmpFile;
+ if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL))
+ return NULL;
+ fwrite(src->buf, 1, src->bufLen, tmpFile);
+ fclose(tmpFile);
+ newsrc = new SplashFontSrc;
+ newsrc->setFile(tmpFileName, gTrue);
+ src = newsrc;
+ delete tmpFileName;
+ }
+ fileNameA = src->fileName;
+ // load the font file
+ if ((t1libIDA = T1_AddFont(fileNameA)) < 0) {
+ delete newsrc;
+ return NULL;
+ }
+ T1_LoadFont(t1libIDA);
+
+ // reencode it
+ encStrSize = 0;
+ for (i = 0; i < 256; ++i) {
+ if (encA[i]) {
+ encStrSize += strlen(encA[i]) + 1;
+ }
+ }
+ encTmp = (char **)gmallocn(257, sizeof(char *));
+ encStrTmp = (char *)gmallocn(encStrSize, sizeof(char));
+ encPtr = encStrTmp;
+ for (i = 0; i < 256; ++i) {
+ if (encA[i]) {
+ strcpy(encPtr, encA[i]);
+ encTmp[i] = encPtr;
+ encPtr += strlen(encPtr) + 1;
+ } else {
+ encTmp[i] = ".notdef";
+ }
+ }
+ encTmp[256] = "custom";
+ T1_ReencodeFont(t1libIDA, encTmp);
+
+ ff = new SplashT1FontFile(engineA, idA, src,
+ t1libIDA, encTmp, encStrTmp);
+ if (newsrc)
+ newsrc->unref();
+ return ff;
+}
+
+SplashT1FontFile::SplashT1FontFile(SplashT1FontEngine *engineA,
+ SplashFontFileID *idA,
+ SplashFontSrc *srcA,
+ int t1libIDA, char **encA, char *encStrA):
+ SplashFontFile(idA, srcA)
+{
+ engine = engineA;
+ t1libID = t1libIDA;
+ enc = encA;
+ encStr = encStrA;
+}
+
+SplashT1FontFile::~SplashT1FontFile() {
+ gfree(encStr);
+ gfree(enc);
+ T1_DeleteFont(t1libID);
+}
+
+SplashFont *SplashT1FontFile::makeFont(SplashCoord *mat,
+ SplashCoord *textMat) {
+ SplashFont *font;
+
+ font = new SplashT1Font(this, mat, textMat);
+ font->initCache();
+ return font;
+}
+
+#endif // HAVE_T1LIB_H
diff --git a/kpdf/xpdf/splash/SplashTypes.h b/kpdf/xpdf/splash/SplashTypes.h
index 35551b90..aa431b78 100644
--- a/kpdf/xpdf/splash/SplashTypes.h
+++ b/kpdf/xpdf/splash/SplashTypes.h
@@ -48,7 +48,7 @@ enum SplashColorMode {
};
// number of components in each color mode
-// (defined in SplashState.cc)
+// (defined in SplashState.cpp)
extern int splashColorModeNComps[];
// max number of components in any SplashColor
diff --git a/kpdf/xpdf/splash/SplashXPath.cc b/kpdf/xpdf/splash/SplashXPath.cc
deleted file mode 100644
index 71481eff..00000000
--- a/kpdf/xpdf/splash/SplashXPath.cc
+++ /dev/null
@@ -1,443 +0,0 @@
-//========================================================================
-//
-// SplashXPath.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "SplashMath.h"
-#include "SplashPath.h"
-#include "SplashXPath.h"
-
-//------------------------------------------------------------------------
-
-struct SplashXPathPoint {
- SplashCoord x, y;
-};
-
-struct SplashXPathAdjust {
- int firstPt, lastPt; // range of points
- GBool vert; // vertical or horizontal hint
- SplashCoord x0a, x0b, // hint boundaries
- xma, xmb,
- x1a, x1b;
- SplashCoord x0, x1, xm; // adjusted coordinates
-};
-
-//------------------------------------------------------------------------
-
-// Transform a point from user space to device space.
-inline void SplashXPath::transform(SplashCoord *matrix,
- SplashCoord xi, SplashCoord yi,
- SplashCoord *xo, SplashCoord *yo) {
- // [ m[0] m[1] 0 ]
- // [xo yo 1] = [xi yi 1] * [ m[2] m[3] 0 ]
- // [ m[4] m[5] 1 ]
- *xo = xi * matrix[0] + yi * matrix[2] + matrix[4];
- *yo = xi * matrix[1] + yi * matrix[3] + matrix[5];
-}
-
-//------------------------------------------------------------------------
-// SplashXPath
-//------------------------------------------------------------------------
-
-SplashXPath::SplashXPath() {
- segs = NULL;
- length = size = 0;
-}
-
-SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
- SplashCoord flatness, GBool closeSubpaths) {
- SplashPathHint *hint;
- SplashXPathPoint *pts;
- SplashXPathAdjust *adjusts, *adjust;
- SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xsp, ysp;
- SplashCoord adj0, adj1, w;
- int ww;
- int curSubpath, curSubpathX, i, j;
-
- // transform the points
- pts = (SplashXPathPoint *)gmallocn(path->length, sizeof(SplashXPathPoint));
- for (i = 0; i < path->length; ++i) {
- transform(matrix, path->pts[i].x, path->pts[i].y, &pts[i].x, &pts[i].y);
- }
-
- // set up the stroke adjustment hints
- if (path->hints) {
- adjusts = (SplashXPathAdjust *)gmallocn(path->hintsLength,
- sizeof(SplashXPathAdjust));
- for (i = 0; i < path->hintsLength; ++i) {
- hint = &path->hints[i];
- if (hint->ctrl0 + 1 >= path->length || hint->ctrl1 + 1 >= path->length) {
- gfree(adjusts);
- adjusts = NULL;
- break;
- }
- x0 = pts[hint->ctrl0 ].x; y0 = pts[hint->ctrl0 ].y;
- x1 = pts[hint->ctrl0 + 1].x; y1 = pts[hint->ctrl0 + 1].y;
- x2 = pts[hint->ctrl1 ].x; y2 = pts[hint->ctrl1 ].y;
- x3 = pts[hint->ctrl1 + 1].x; y3 = pts[hint->ctrl1 + 1].y;
- if (x0 == x1 && x2 == x3) {
- adjusts[i].vert = gTrue;
- adj0 = x0;
- adj1 = x2;
- } else if (y0 == y1 && y2 == y3) {
- adjusts[i].vert = gFalse;
- adj0 = y0;
- adj1 = y2;
- } else {
- gfree(adjusts);
- adjusts = NULL;
- break;
- }
- if (adj0 > adj1) {
- x0 = adj0;
- adj0 = adj1;
- adj1 = x0;
- }
- w = adj1 - adj0;
- ww = splashRound(w);
- if (ww == 0) {
- ww = 1;
- }
- adjusts[i].x0a = adj0 - 0.01;
- adjusts[i].x0b = adj0 + 0.01;
- adjusts[i].xma = (SplashCoord)0.5 * (adj0 + adj1) - 0.01;
- adjusts[i].xmb = (SplashCoord)0.5 * (adj0 + adj1) + 0.01;
- adjusts[i].x1a = adj1 - 0.01;
- adjusts[i].x1b = adj1 + 0.01;
- adjusts[i].x0 = (SplashCoord)splashRound(adj0);
- adjusts[i].x1 = adjusts[i].x0 + ww - 0.01;
- adjusts[i].xm = (SplashCoord)0.5 * (adjusts[i].x0 + adjusts[i].x1);
- adjusts[i].firstPt = hint->firstPt;
- adjusts[i].lastPt = hint->lastPt;
- }
-
- } else {
- adjusts = NULL;
- }
-
- // perform stroke adjustment
- if (adjusts) {
- for (i = 0, adjust = adjusts; i < path->hintsLength; ++i, ++adjust) {
- for (j = adjust->firstPt; j <= adjust->lastPt; ++j) {
- strokeAdjust(adjust, &pts[j].x, &pts[j].y);
- }
- }
- gfree(adjusts);
- }
-
- segs = NULL;
- length = size = 0;
-
- x0 = y0 = xsp = ysp = 0; // make gcc happy
- adj0 = adj1 = 0; // make gcc happy
- curSubpath = 0;
- curSubpathX = 0;
- i = 0;
- while (i < path->length) {
-
- // first point in subpath - skip it
- if (path->flags[i] & splashPathFirst) {
- x0 = pts[i].x;
- y0 = pts[i].y;
- xsp = x0;
- ysp = y0;
- curSubpath = i;
- curSubpathX = length;
- ++i;
-
- } else {
-
- // curve segment
- if (path->flags[i] & splashPathCurve) {
- x1 = pts[i].x;
- y1 = pts[i].y;
- x2 = pts[i+1].x;
- y2 = pts[i+1].y;
- x3 = pts[i+2].x;
- y3 = pts[i+2].y;
- addCurve(x0, y0, x1, y1, x2, y2, x3, y3,
- flatness,
- (path->flags[i-1] & splashPathFirst),
- (path->flags[i+2] & splashPathLast),
- !closeSubpaths &&
- (path->flags[i-1] & splashPathFirst) &&
- !(path->flags[i-1] & splashPathClosed),
- !closeSubpaths &&
- (path->flags[i+2] & splashPathLast) &&
- !(path->flags[i+2] & splashPathClosed));
- x0 = x3;
- y0 = y3;
- i += 3;
-
- // line segment
- } else {
- x1 = pts[i].x;
- y1 = pts[i].y;
- addSegment(x0, y0, x1, y1,
- path->flags[i-1] & splashPathFirst,
- path->flags[i] & splashPathLast,
- !closeSubpaths &&
- (path->flags[i-1] & splashPathFirst) &&
- !(path->flags[i-1] & splashPathClosed),
- !closeSubpaths &&
- (path->flags[i] & splashPathLast) &&
- !(path->flags[i] & splashPathClosed));
- x0 = x1;
- y0 = y1;
- ++i;
- }
-
- // close a subpath
- if (closeSubpaths &&
- (path->flags[i-1] & splashPathLast) &&
- (pts[i-1].x != pts[curSubpath].x ||
- pts[i-1].y != pts[curSubpath].y)) {
- addSegment(x0, y0, xsp, ysp,
- gFalse, gTrue, gFalse, gFalse);
- }
- }
- }
-
- gfree(pts);
-}
-
-// Apply the stroke adjust hints to point <pt>: (*<xp>, *<yp>).
-void SplashXPath::strokeAdjust(SplashXPathAdjust *adjust,
- SplashCoord *xp, SplashCoord *yp) {
- SplashCoord x, y;
-
- if (adjust->vert) {
- x = *xp;
- if (x > adjust->x0a && x < adjust->x0b) {
- *xp = adjust->x0;
- } else if (x > adjust->xma && x < adjust->xmb) {
- *xp = adjust->xm;
- } else if (x > adjust->x1a && x < adjust->x1b) {
- *xp = adjust->x1;
- }
- } else {
- y = *yp;
- if (y > adjust->x0a && y < adjust->x0b) {
- *yp = adjust->x0;
- } else if (y > adjust->xma && y < adjust->xmb) {
- *yp = adjust->xm;
- } else if (y > adjust->x1a && y < adjust->x1b) {
- *yp = adjust->x1;
- }
- }
-}
-
-SplashXPath::SplashXPath(SplashXPath *xPath) {
- length = xPath->length;
- size = xPath->size;
- segs = (SplashXPathSeg *)gmallocn(size, sizeof(SplashXPathSeg));
- memcpy(segs, xPath->segs, length * sizeof(SplashXPathSeg));
-}
-
-SplashXPath::~SplashXPath() {
- gfree(segs);
-}
-
-// Add space for <nSegs> more segments
-void SplashXPath::grow(int nSegs) {
- if (length + nSegs > size) {
- if (size == 0) {
- size = 32;
- }
- while (size < length + nSegs) {
- size *= 2;
- }
- segs = (SplashXPathSeg *)greallocn(segs, size, sizeof(SplashXPathSeg));
- }
-}
-
-void SplashXPath::addCurve(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
- SplashCoord x2, SplashCoord y2,
- SplashCoord x3, SplashCoord y3,
- SplashCoord flatness,
- GBool first, GBool last, GBool end0, GBool end1) {
- SplashCoord cx[splashMaxCurveSplits + 1][3];
- SplashCoord cy[splashMaxCurveSplits + 1][3];
- int cNext[splashMaxCurveSplits + 1];
- SplashCoord xl0, xl1, xl2, xr0, xr1, xr2, xr3, xx1, xx2, xh;
- SplashCoord yl0, yl1, yl2, yr0, yr1, yr2, yr3, yy1, yy2, yh;
- SplashCoord dx, dy, mx, my, d1, d2, flatness2;
- int p1, p2, p3;
-
- flatness2 = flatness * flatness;
-
- // initial segment
- p1 = 0;
- p2 = splashMaxCurveSplits;
- cx[p1][0] = x0; cy[p1][0] = y0;
- cx[p1][1] = x1; cy[p1][1] = y1;
- cx[p1][2] = x2; cy[p1][2] = y2;
- cx[p2][0] = x3; cy[p2][0] = y3;
- cNext[p1] = p2;
-
- while (p1 < splashMaxCurveSplits) {
-
- // get the next segment
- xl0 = cx[p1][0]; yl0 = cy[p1][0];
- xx1 = cx[p1][1]; yy1 = cy[p1][1];
- xx2 = cx[p1][2]; yy2 = cy[p1][2];
- p2 = cNext[p1];
- xr3 = cx[p2][0]; yr3 = cy[p2][0];
-
- // compute the distances from the control points to the
- // midpoint of the straight line (this is a bit of a hack, but
- // it's much faster than computing the actual distances to the
- // line)
- mx = (xl0 + xr3) * 0.5;
- my = (yl0 + yr3) * 0.5;
- dx = xx1 - mx;
- dy = yy1 - my;
- d1 = dx*dx + dy*dy;
- dx = xx2 - mx;
- dy = yy2 - my;
- d2 = dx*dx + dy*dy;
-
- // if the curve is flat enough, or no more subdivisions are
- // allowed, add the straight line segment
- if (p2 - p1 == 1 || (d1 <= flatness2 && d2 <= flatness2)) {
- addSegment(xl0, yl0, xr3, yr3,
- p1 == 0 && first,
- p2 == splashMaxCurveSplits && last,
- p1 == 0 && end0,
- p2 == splashMaxCurveSplits && end1);
- p1 = p2;
-
- // otherwise, subdivide the curve
- } else {
- xl1 = (xl0 + xx1) * 0.5;
- yl1 = (yl0 + yy1) * 0.5;
- xh = (xx1 + xx2) * 0.5;
- yh = (yy1 + yy2) * 0.5;
- xl2 = (xl1 + xh) * 0.5;
- yl2 = (yl1 + yh) * 0.5;
- xr2 = (xx2 + xr3) * 0.5;
- yr2 = (yy2 + yr3) * 0.5;
- xr1 = (xh + xr2) * 0.5;
- yr1 = (yh + yr2) * 0.5;
- xr0 = (xl2 + xr1) * 0.5;
- yr0 = (yl2 + yr1) * 0.5;
- // add the new subdivision points
- p3 = (p1 + p2) / 2;
- cx[p1][1] = xl1; cy[p1][1] = yl1;
- cx[p1][2] = xl2; cy[p1][2] = yl2;
- cNext[p1] = p3;
- cx[p3][0] = xr0; cy[p3][0] = yr0;
- cx[p3][1] = xr1; cy[p3][1] = yr1;
- cx[p3][2] = xr2; cy[p3][2] = yr2;
- cNext[p3] = p2;
- }
- }
-}
-
-void SplashXPath::addSegment(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
- GBool first, GBool last, GBool end0, GBool end1) {
- grow(1);
- segs[length].x0 = x0;
- segs[length].y0 = y0;
- segs[length].x1 = x1;
- segs[length].y1 = y1;
- segs[length].flags = 0;
- if (first) {
- segs[length].flags |= splashXPathFirst;
- }
- if (last) {
- segs[length].flags |= splashXPathLast;
- }
- if (end0) {
- segs[length].flags |= splashXPathEnd0;
- }
- if (end1) {
- segs[length].flags |= splashXPathEnd1;
- }
- if (y1 == y0) {
- segs[length].dxdy = segs[length].dydx = 0;
- segs[length].flags |= splashXPathHoriz;
- if (x1 == x0) {
- segs[length].flags |= splashXPathVert;
- }
- } else if (x1 == x0) {
- segs[length].dxdy = segs[length].dydx = 0;
- segs[length].flags |= splashXPathVert;
- } else {
-#if USE_FIXEDPOINT
- if (FixedPoint::divCheck(x1 - x0, y1 - y0, &segs[length].dxdy)) {
- segs[length].dydx = (SplashCoord)1 / segs[length].dxdy;
- } else {
- segs[length].dxdy = segs[length].dydx = 0;
- if (splashAbs(x1 - x0) > splashAbs(y1 - y0)) {
- segs[length].flags |= splashXPathHoriz;
- } else {
- segs[length].flags |= splashXPathVert;
- }
- }
-#else
- segs[length].dxdy = (x1 - x0) / (y1 - y0);
- segs[length].dydx = (SplashCoord)1 / segs[length].dxdy;
-#endif
- }
- if (y0 > y1) {
- segs[length].flags |= splashXPathFlip;
- }
- ++length;
-}
-
-static int cmpXPathSegs(const void *arg0, const void *arg1) {
- SplashXPathSeg *seg0 = (SplashXPathSeg *)arg0;
- SplashXPathSeg *seg1 = (SplashXPathSeg *)arg1;
- SplashCoord x0, y0, x1, y1;
-
- if (seg0->flags & splashXPathFlip) {
- x0 = seg0->x1;
- y0 = seg0->y1;
- } else {
- x0 = seg0->x0;
- y0 = seg0->y0;
- }
- if (seg1->flags & splashXPathFlip) {
- x1 = seg1->x1;
- y1 = seg1->y1;
- } else {
- x1 = seg1->x0;
- y1 = seg1->y0;
- }
- if (y0 != y1) {
- return (y0 > y1) ? 1 : -1;
- }
- if (x0 != x1) {
- return (x0 > x1) ? 1 : -1;
- }
- return 0;
-}
-
-void SplashXPath::aaScale() {
- SplashXPathSeg *seg;
- int i;
-
- for (i = 0, seg = segs; i < length; ++i, ++seg) {
- seg->x0 *= splashAASize;
- seg->y0 *= splashAASize;
- seg->x1 *= splashAASize;
- seg->y1 *= splashAASize;
- }
-}
-
-void SplashXPath::sort() {
- qsort(segs, length, sizeof(SplashXPathSeg), &cmpXPathSegs);
-}
diff --git a/kpdf/xpdf/splash/SplashXPath.cpp b/kpdf/xpdf/splash/SplashXPath.cpp
new file mode 100644
index 00000000..267643bb
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashXPath.cpp
@@ -0,0 +1,443 @@
+//========================================================================
+//
+// SplashXPath.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "SplashMath.h"
+#include "SplashPath.h"
+#include "SplashXPath.h"
+
+//------------------------------------------------------------------------
+
+struct SplashXPathPoint {
+ SplashCoord x, y;
+};
+
+struct SplashXPathAdjust {
+ int firstPt, lastPt; // range of points
+ GBool vert; // vertical or horizontal hint
+ SplashCoord x0a, x0b, // hint boundaries
+ xma, xmb,
+ x1a, x1b;
+ SplashCoord x0, x1, xm; // adjusted coordinates
+};
+
+//------------------------------------------------------------------------
+
+// Transform a point from user space to device space.
+inline void SplashXPath::transform(SplashCoord *matrix,
+ SplashCoord xi, SplashCoord yi,
+ SplashCoord *xo, SplashCoord *yo) {
+ // [ m[0] m[1] 0 ]
+ // [xo yo 1] = [xi yi 1] * [ m[2] m[3] 0 ]
+ // [ m[4] m[5] 1 ]
+ *xo = xi * matrix[0] + yi * matrix[2] + matrix[4];
+ *yo = xi * matrix[1] + yi * matrix[3] + matrix[5];
+}
+
+//------------------------------------------------------------------------
+// SplashXPath
+//------------------------------------------------------------------------
+
+SplashXPath::SplashXPath() {
+ segs = NULL;
+ length = size = 0;
+}
+
+SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
+ SplashCoord flatness, GBool closeSubpaths) {
+ SplashPathHint *hint;
+ SplashXPathPoint *pts;
+ SplashXPathAdjust *adjusts, *adjust;
+ SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xsp, ysp;
+ SplashCoord adj0, adj1, w;
+ int ww;
+ int curSubpath, curSubpathX, i, j;
+
+ // transform the points
+ pts = (SplashXPathPoint *)gmallocn(path->length, sizeof(SplashXPathPoint));
+ for (i = 0; i < path->length; ++i) {
+ transform(matrix, path->pts[i].x, path->pts[i].y, &pts[i].x, &pts[i].y);
+ }
+
+ // set up the stroke adjustment hints
+ if (path->hints) {
+ adjusts = (SplashXPathAdjust *)gmallocn(path->hintsLength,
+ sizeof(SplashXPathAdjust));
+ for (i = 0; i < path->hintsLength; ++i) {
+ hint = &path->hints[i];
+ if (hint->ctrl0 + 1 >= path->length || hint->ctrl1 + 1 >= path->length) {
+ gfree(adjusts);
+ adjusts = NULL;
+ break;
+ }
+ x0 = pts[hint->ctrl0 ].x; y0 = pts[hint->ctrl0 ].y;
+ x1 = pts[hint->ctrl0 + 1].x; y1 = pts[hint->ctrl0 + 1].y;
+ x2 = pts[hint->ctrl1 ].x; y2 = pts[hint->ctrl1 ].y;
+ x3 = pts[hint->ctrl1 + 1].x; y3 = pts[hint->ctrl1 + 1].y;
+ if (x0 == x1 && x2 == x3) {
+ adjusts[i].vert = gTrue;
+ adj0 = x0;
+ adj1 = x2;
+ } else if (y0 == y1 && y2 == y3) {
+ adjusts[i].vert = gFalse;
+ adj0 = y0;
+ adj1 = y2;
+ } else {
+ gfree(adjusts);
+ adjusts = NULL;
+ break;
+ }
+ if (adj0 > adj1) {
+ x0 = adj0;
+ adj0 = adj1;
+ adj1 = x0;
+ }
+ w = adj1 - adj0;
+ ww = splashRound(w);
+ if (ww == 0) {
+ ww = 1;
+ }
+ adjusts[i].x0a = adj0 - 0.01;
+ adjusts[i].x0b = adj0 + 0.01;
+ adjusts[i].xma = (SplashCoord)0.5 * (adj0 + adj1) - 0.01;
+ adjusts[i].xmb = (SplashCoord)0.5 * (adj0 + adj1) + 0.01;
+ adjusts[i].x1a = adj1 - 0.01;
+ adjusts[i].x1b = adj1 + 0.01;
+ adjusts[i].x0 = (SplashCoord)splashRound(adj0);
+ adjusts[i].x1 = adjusts[i].x0 + ww - 0.01;
+ adjusts[i].xm = (SplashCoord)0.5 * (adjusts[i].x0 + adjusts[i].x1);
+ adjusts[i].firstPt = hint->firstPt;
+ adjusts[i].lastPt = hint->lastPt;
+ }
+
+ } else {
+ adjusts = NULL;
+ }
+
+ // perform stroke adjustment
+ if (adjusts) {
+ for (i = 0, adjust = adjusts; i < path->hintsLength; ++i, ++adjust) {
+ for (j = adjust->firstPt; j <= adjust->lastPt; ++j) {
+ strokeAdjust(adjust, &pts[j].x, &pts[j].y);
+ }
+ }
+ gfree(adjusts);
+ }
+
+ segs = NULL;
+ length = size = 0;
+
+ x0 = y0 = xsp = ysp = 0; // make gcc happy
+ adj0 = adj1 = 0; // make gcc happy
+ curSubpath = 0;
+ curSubpathX = 0;
+ i = 0;
+ while (i < path->length) {
+
+ // first point in subpath - skip it
+ if (path->flags[i] & splashPathFirst) {
+ x0 = pts[i].x;
+ y0 = pts[i].y;
+ xsp = x0;
+ ysp = y0;
+ curSubpath = i;
+ curSubpathX = length;
+ ++i;
+
+ } else {
+
+ // curve segment
+ if (path->flags[i] & splashPathCurve) {
+ x1 = pts[i].x;
+ y1 = pts[i].y;
+ x2 = pts[i+1].x;
+ y2 = pts[i+1].y;
+ x3 = pts[i+2].x;
+ y3 = pts[i+2].y;
+ addCurve(x0, y0, x1, y1, x2, y2, x3, y3,
+ flatness,
+ (path->flags[i-1] & splashPathFirst),
+ (path->flags[i+2] & splashPathLast),
+ !closeSubpaths &&
+ (path->flags[i-1] & splashPathFirst) &&
+ !(path->flags[i-1] & splashPathClosed),
+ !closeSubpaths &&
+ (path->flags[i+2] & splashPathLast) &&
+ !(path->flags[i+2] & splashPathClosed));
+ x0 = x3;
+ y0 = y3;
+ i += 3;
+
+ // line segment
+ } else {
+ x1 = pts[i].x;
+ y1 = pts[i].y;
+ addSegment(x0, y0, x1, y1,
+ path->flags[i-1] & splashPathFirst,
+ path->flags[i] & splashPathLast,
+ !closeSubpaths &&
+ (path->flags[i-1] & splashPathFirst) &&
+ !(path->flags[i-1] & splashPathClosed),
+ !closeSubpaths &&
+ (path->flags[i] & splashPathLast) &&
+ !(path->flags[i] & splashPathClosed));
+ x0 = x1;
+ y0 = y1;
+ ++i;
+ }
+
+ // close a subpath
+ if (closeSubpaths &&
+ (path->flags[i-1] & splashPathLast) &&
+ (pts[i-1].x != pts[curSubpath].x ||
+ pts[i-1].y != pts[curSubpath].y)) {
+ addSegment(x0, y0, xsp, ysp,
+ gFalse, gTrue, gFalse, gFalse);
+ }
+ }
+ }
+
+ gfree(pts);
+}
+
+// Apply the stroke adjust hints to point <pt>: (*<xp>, *<yp>).
+void SplashXPath::strokeAdjust(SplashXPathAdjust *adjust,
+ SplashCoord *xp, SplashCoord *yp) {
+ SplashCoord x, y;
+
+ if (adjust->vert) {
+ x = *xp;
+ if (x > adjust->x0a && x < adjust->x0b) {
+ *xp = adjust->x0;
+ } else if (x > adjust->xma && x < adjust->xmb) {
+ *xp = adjust->xm;
+ } else if (x > adjust->x1a && x < adjust->x1b) {
+ *xp = adjust->x1;
+ }
+ } else {
+ y = *yp;
+ if (y > adjust->x0a && y < adjust->x0b) {
+ *yp = adjust->x0;
+ } else if (y > adjust->xma && y < adjust->xmb) {
+ *yp = adjust->xm;
+ } else if (y > adjust->x1a && y < adjust->x1b) {
+ *yp = adjust->x1;
+ }
+ }
+}
+
+SplashXPath::SplashXPath(SplashXPath *xPath) {
+ length = xPath->length;
+ size = xPath->size;
+ segs = (SplashXPathSeg *)gmallocn(size, sizeof(SplashXPathSeg));
+ memcpy(segs, xPath->segs, length * sizeof(SplashXPathSeg));
+}
+
+SplashXPath::~SplashXPath() {
+ gfree(segs);
+}
+
+// Add space for <nSegs> more segments
+void SplashXPath::grow(int nSegs) {
+ if (length + nSegs > size) {
+ if (size == 0) {
+ size = 32;
+ }
+ while (size < length + nSegs) {
+ size *= 2;
+ }
+ segs = (SplashXPathSeg *)greallocn(segs, size, sizeof(SplashXPathSeg));
+ }
+}
+
+void SplashXPath::addCurve(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1,
+ SplashCoord x2, SplashCoord y2,
+ SplashCoord x3, SplashCoord y3,
+ SplashCoord flatness,
+ GBool first, GBool last, GBool end0, GBool end1) {
+ SplashCoord cx[splashMaxCurveSplits + 1][3];
+ SplashCoord cy[splashMaxCurveSplits + 1][3];
+ int cNext[splashMaxCurveSplits + 1];
+ SplashCoord xl0, xl1, xl2, xr0, xr1, xr2, xr3, xx1, xx2, xh;
+ SplashCoord yl0, yl1, yl2, yr0, yr1, yr2, yr3, yy1, yy2, yh;
+ SplashCoord dx, dy, mx, my, d1, d2, flatness2;
+ int p1, p2, p3;
+
+ flatness2 = flatness * flatness;
+
+ // initial segment
+ p1 = 0;
+ p2 = splashMaxCurveSplits;
+ cx[p1][0] = x0; cy[p1][0] = y0;
+ cx[p1][1] = x1; cy[p1][1] = y1;
+ cx[p1][2] = x2; cy[p1][2] = y2;
+ cx[p2][0] = x3; cy[p2][0] = y3;
+ cNext[p1] = p2;
+
+ while (p1 < splashMaxCurveSplits) {
+
+ // get the next segment
+ xl0 = cx[p1][0]; yl0 = cy[p1][0];
+ xx1 = cx[p1][1]; yy1 = cy[p1][1];
+ xx2 = cx[p1][2]; yy2 = cy[p1][2];
+ p2 = cNext[p1];
+ xr3 = cx[p2][0]; yr3 = cy[p2][0];
+
+ // compute the distances from the control points to the
+ // midpoint of the straight line (this is a bit of a hack, but
+ // it's much faster than computing the actual distances to the
+ // line)
+ mx = (xl0 + xr3) * 0.5;
+ my = (yl0 + yr3) * 0.5;
+ dx = xx1 - mx;
+ dy = yy1 - my;
+ d1 = dx*dx + dy*dy;
+ dx = xx2 - mx;
+ dy = yy2 - my;
+ d2 = dx*dx + dy*dy;
+
+ // if the curve is flat enough, or no more subdivisions are
+ // allowed, add the straight line segment
+ if (p2 - p1 == 1 || (d1 <= flatness2 && d2 <= flatness2)) {
+ addSegment(xl0, yl0, xr3, yr3,
+ p1 == 0 && first,
+ p2 == splashMaxCurveSplits && last,
+ p1 == 0 && end0,
+ p2 == splashMaxCurveSplits && end1);
+ p1 = p2;
+
+ // otherwise, subdivide the curve
+ } else {
+ xl1 = (xl0 + xx1) * 0.5;
+ yl1 = (yl0 + yy1) * 0.5;
+ xh = (xx1 + xx2) * 0.5;
+ yh = (yy1 + yy2) * 0.5;
+ xl2 = (xl1 + xh) * 0.5;
+ yl2 = (yl1 + yh) * 0.5;
+ xr2 = (xx2 + xr3) * 0.5;
+ yr2 = (yy2 + yr3) * 0.5;
+ xr1 = (xh + xr2) * 0.5;
+ yr1 = (yh + yr2) * 0.5;
+ xr0 = (xl2 + xr1) * 0.5;
+ yr0 = (yl2 + yr1) * 0.5;
+ // add the new subdivision points
+ p3 = (p1 + p2) / 2;
+ cx[p1][1] = xl1; cy[p1][1] = yl1;
+ cx[p1][2] = xl2; cy[p1][2] = yl2;
+ cNext[p1] = p3;
+ cx[p3][0] = xr0; cy[p3][0] = yr0;
+ cx[p3][1] = xr1; cy[p3][1] = yr1;
+ cx[p3][2] = xr2; cy[p3][2] = yr2;
+ cNext[p3] = p2;
+ }
+ }
+}
+
+void SplashXPath::addSegment(SplashCoord x0, SplashCoord y0,
+ SplashCoord x1, SplashCoord y1,
+ GBool first, GBool last, GBool end0, GBool end1) {
+ grow(1);
+ segs[length].x0 = x0;
+ segs[length].y0 = y0;
+ segs[length].x1 = x1;
+ segs[length].y1 = y1;
+ segs[length].flags = 0;
+ if (first) {
+ segs[length].flags |= splashXPathFirst;
+ }
+ if (last) {
+ segs[length].flags |= splashXPathLast;
+ }
+ if (end0) {
+ segs[length].flags |= splashXPathEnd0;
+ }
+ if (end1) {
+ segs[length].flags |= splashXPathEnd1;
+ }
+ if (y1 == y0) {
+ segs[length].dxdy = segs[length].dydx = 0;
+ segs[length].flags |= splashXPathHoriz;
+ if (x1 == x0) {
+ segs[length].flags |= splashXPathVert;
+ }
+ } else if (x1 == x0) {
+ segs[length].dxdy = segs[length].dydx = 0;
+ segs[length].flags |= splashXPathVert;
+ } else {
+#if USE_FIXEDPOINT
+ if (FixedPoint::divCheck(x1 - x0, y1 - y0, &segs[length].dxdy)) {
+ segs[length].dydx = (SplashCoord)1 / segs[length].dxdy;
+ } else {
+ segs[length].dxdy = segs[length].dydx = 0;
+ if (splashAbs(x1 - x0) > splashAbs(y1 - y0)) {
+ segs[length].flags |= splashXPathHoriz;
+ } else {
+ segs[length].flags |= splashXPathVert;
+ }
+ }
+#else
+ segs[length].dxdy = (x1 - x0) / (y1 - y0);
+ segs[length].dydx = (SplashCoord)1 / segs[length].dxdy;
+#endif
+ }
+ if (y0 > y1) {
+ segs[length].flags |= splashXPathFlip;
+ }
+ ++length;
+}
+
+static int cmpXPathSegs(const void *arg0, const void *arg1) {
+ SplashXPathSeg *seg0 = (SplashXPathSeg *)arg0;
+ SplashXPathSeg *seg1 = (SplashXPathSeg *)arg1;
+ SplashCoord x0, y0, x1, y1;
+
+ if (seg0->flags & splashXPathFlip) {
+ x0 = seg0->x1;
+ y0 = seg0->y1;
+ } else {
+ x0 = seg0->x0;
+ y0 = seg0->y0;
+ }
+ if (seg1->flags & splashXPathFlip) {
+ x1 = seg1->x1;
+ y1 = seg1->y1;
+ } else {
+ x1 = seg1->x0;
+ y1 = seg1->y0;
+ }
+ if (y0 != y1) {
+ return (y0 > y1) ? 1 : -1;
+ }
+ if (x0 != x1) {
+ return (x0 > x1) ? 1 : -1;
+ }
+ return 0;
+}
+
+void SplashXPath::aaScale() {
+ SplashXPathSeg *seg;
+ int i;
+
+ for (i = 0, seg = segs; i < length; ++i, ++seg) {
+ seg->x0 *= splashAASize;
+ seg->y0 *= splashAASize;
+ seg->x1 *= splashAASize;
+ seg->y1 *= splashAASize;
+ }
+}
+
+void SplashXPath::sort() {
+ qsort(segs, length, sizeof(SplashXPathSeg), &cmpXPathSegs);
+}
diff --git a/kpdf/xpdf/splash/SplashXPathScanner.cc b/kpdf/xpdf/splash/SplashXPathScanner.cc
deleted file mode 100644
index 97e5a9bc..00000000
--- a/kpdf/xpdf/splash/SplashXPathScanner.cc
+++ /dev/null
@@ -1,429 +0,0 @@
-//========================================================================
-//
-// SplashXPathScanner.cc
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "SplashMath.h"
-#include "SplashXPath.h"
-#include "SplashBitmap.h"
-#include "SplashXPathScanner.h"
-
-//------------------------------------------------------------------------
-
-struct SplashIntersect {
- int x0, x1; // intersection of segment with [y, y+1)
- int count; // EO/NZWN counter increment
-};
-
-static int cmpIntersect(const void *p0, const void *p1) {
- return ((SplashIntersect *)p0)->x0 - ((SplashIntersect *)p1)->x0;
-}
-
-//------------------------------------------------------------------------
-// SplashXPathScanner
-//------------------------------------------------------------------------
-
-SplashXPathScanner::SplashXPathScanner(SplashXPath *xPathA, GBool eoA) {
- SplashXPathSeg *seg;
- SplashCoord xMinFP, yMinFP, xMaxFP, yMaxFP;
- int i;
-
- xPath = xPathA;
- eo = eoA;
-
- // compute the bbox
- if (xPath->length == 0) {
- xMin = yMin = 1;
- xMax = yMax = 0;
- } else {
- seg = &xPath->segs[0];
- if (seg->x0 <= seg->x1) {
- xMinFP = seg->x0;
- xMaxFP = seg->x1;
- } else {
- xMinFP = seg->x1;
- xMaxFP = seg->x0;
- }
- if (seg->flags & splashXPathFlip) {
- yMinFP = seg->y1;
- yMaxFP = seg->y0;
- } else {
- yMinFP = seg->y0;
- yMaxFP = seg->y1;
- }
- for (i = 1; i < xPath->length; ++i) {
- seg = &xPath->segs[i];
- if (seg->x0 < xMinFP) {
- xMinFP = seg->x0;
- } else if (seg->x0 > xMaxFP) {
- xMaxFP = seg->x0;
- }
- if (seg->x1 < xMinFP) {
- xMinFP = seg->x1;
- } else if (seg->x1 > xMaxFP) {
- xMaxFP = seg->x1;
- }
- if (seg->flags & splashXPathFlip) {
- if (seg->y0 > yMaxFP) {
- yMaxFP = seg->y0;
- }
- } else {
- if (seg->y1 > yMaxFP) {
- yMaxFP = seg->y1;
- }
- }
- }
- xMin = splashFloor(xMinFP);
- xMax = splashFloor(xMaxFP);
- yMin = splashFloor(yMinFP);
- yMax = splashFloor(yMaxFP);
- }
-
- interY = yMin - 1;
- xPathIdx = 0;
- inter = NULL;
- interLen = interSize = 0;
-}
-
-SplashXPathScanner::~SplashXPathScanner() {
- gfree(inter);
-}
-
-void SplashXPathScanner::getBBoxAA(int *xMinA, int *yMinA,
- int *xMaxA, int *yMaxA) {
- *xMinA = xMin / splashAASize;
- *yMinA = yMin / splashAASize;
- *xMaxA = xMax / splashAASize;
- *yMaxA = yMax / splashAASize;
-}
-
-void SplashXPathScanner::getSpanBounds(int y, int *spanXMin, int *spanXMax) {
- if (interY != y) {
- computeIntersections(y);
- }
- if (interLen > 0) {
- *spanXMin = inter[0].x0;
- *spanXMax = inter[interLen - 1].x1;
- } else {
- *spanXMin = xMax + 1;
- *spanXMax = xMax;
- }
-}
-
-GBool SplashXPathScanner::test(int x, int y) {
- int count, i;
-
- if (interY != y) {
- computeIntersections(y);
- }
- count = 0;
- for (i = 0; i < interLen && inter[i].x0 <= x; ++i) {
- if (x <= inter[i].x1) {
- return gTrue;
- }
- count += inter[i].count;
- }
- return eo ? (count & 1) : (count != 0);
-}
-
-GBool SplashXPathScanner::testSpan(int x0, int x1, int y) {
- int count, xx1, i;
-
- if (interY != y) {
- computeIntersections(y);
- }
-
- count = 0;
- for (i = 0; i < interLen && inter[i].x1 < x0; ++i) {
- count += inter[i].count;
- }
-
- // invariant: the subspan [x0,xx1] is inside the path
- xx1 = x0 - 1;
- while (xx1 < x1) {
- if (i >= interLen) {
- return gFalse;
- }
- if (inter[i].x0 > xx1 + 1 &&
- !(eo ? (count & 1) : (count != 0))) {
- return gFalse;
- }
- if (inter[i].x1 > xx1) {
- xx1 = inter[i].x1;
- }
- count += inter[i].count;
- ++i;
- }
-
- return gTrue;
-}
-
-GBool SplashXPathScanner::getNextSpan(int y, int *x0, int *x1) {
- int xx0, xx1;
-
- if (interY != y) {
- computeIntersections(y);
- }
- if (interIdx >= interLen) {
- return gFalse;
- }
- xx0 = inter[interIdx].x0;
- xx1 = inter[interIdx].x1;
- interCount += inter[interIdx].count;
- ++interIdx;
- while (interIdx < interLen &&
- (inter[interIdx].x0 <= xx1 ||
- (eo ? (interCount & 1) : (interCount != 0)))) {
- if (inter[interIdx].x1 > xx1) {
- xx1 = inter[interIdx].x1;
- }
- interCount += inter[interIdx].count;
- ++interIdx;
- }
- *x0 = xx0;
- *x1 = xx1;
- return gTrue;
-}
-
-void SplashXPathScanner::computeIntersections(int y) {
- SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
- SplashXPathSeg *seg;
- int i, j;
-
- // find the first segment that intersects [y, y+1)
- i = (y >= interY) ? xPathIdx : 0;
- while (i < xPath->length &&
- xPath->segs[i].y0 < y && xPath->segs[i].y1 < y) {
- ++i;
- }
- xPathIdx = i;
-
- // find all of the segments that intersect [y, y+1) and create an
- // Intersect element for each one
- interLen = 0;
- for (j = i; j < xPath->length; ++j) {
- seg = &xPath->segs[j];
- if (seg->flags & splashXPathFlip) {
- ySegMin = seg->y1;
- ySegMax = seg->y0;
- } else {
- ySegMin = seg->y0;
- ySegMax = seg->y1;
- }
-
- // ensure that: ySegMin < y+1
- // y <= ySegMax
- if (ySegMin >= y + 1) {
- break;
- }
- if (ySegMax < y) {
- continue;
- }
-
- if (interLen == interSize) {
- if (interSize == 0) {
- interSize = 16;
- } else {
- interSize *= 2;
- }
- inter = (SplashIntersect *)greallocn(inter, interSize,
- sizeof(SplashIntersect));
- }
-
- if (seg->flags & splashXPathHoriz) {
- xx0 = seg->x0;
- xx1 = seg->x1;
- } else if (seg->flags & splashXPathVert) {
- xx0 = xx1 = seg->x0;
- } else {
- if (seg->x0 < seg->x1) {
- xSegMin = seg->x0;
- xSegMax = seg->x1;
- } else {
- xSegMin = seg->x1;
- xSegMax = seg->x0;
- }
- // intersection with top edge
- xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
- // intersection with bottom edge
- xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
- // the segment may not actually extend to the top and/or bottom edges
- if (xx0 < xSegMin) {
- xx0 = xSegMin;
- } else if (xx0 > xSegMax) {
- xx0 = xSegMax;
- }
- if (xx1 < xSegMin) {
- xx1 = xSegMin;
- } else if (xx1 > xSegMax) {
- xx1 = xSegMax;
- }
- }
- if (xx0 < xx1) {
- inter[interLen].x0 = splashFloor(xx0);
- inter[interLen].x1 = splashFloor(xx1);
- } else {
- inter[interLen].x0 = splashFloor(xx1);
- inter[interLen].x1 = splashFloor(xx0);
- }
- if (ySegMin <= y &&
- (SplashCoord)y < ySegMax &&
- !(seg->flags & splashXPathHoriz)) {
- inter[interLen].count = eo ? 1
- : (seg->flags & splashXPathFlip) ? 1 : -1;
- } else {
- inter[interLen].count = 0;
- }
- ++interLen;
- }
-
- qsort(inter, interLen, sizeof(SplashIntersect), &cmpIntersect);
-
- interY = y;
- interIdx = 0;
- interCount = 0;
-}
-
-void SplashXPathScanner::renderAALine(SplashBitmap *aaBuf,
- int *x0, int *x1, int y) {
- int xx0, xx1, xx, xxMin, xxMax, yy;
- Guchar mask;
- SplashColorPtr p;
-
- memset(aaBuf->getDataPtr(), 0, aaBuf->getRowSize() * aaBuf->getHeight());
- xxMin = aaBuf->getWidth();
- xxMax = -1;
- for (yy = 0; yy < splashAASize; ++yy) {
- computeIntersections(splashAASize * y + yy);
- while (interIdx < interLen) {
- xx0 = inter[interIdx].x0;
- xx1 = inter[interIdx].x1;
- interCount += inter[interIdx].count;
- ++interIdx;
- while (interIdx < interLen &&
- (inter[interIdx].x0 <= xx1 ||
- (eo ? (interCount & 1) : (interCount != 0)))) {
- if (inter[interIdx].x1 > xx1) {
- xx1 = inter[interIdx].x1;
- }
- interCount += inter[interIdx].count;
- ++interIdx;
- }
- if (xx0 < 0) {
- xx0 = 0;
- }
- ++xx1;
- if (xx1 > aaBuf->getWidth()) {
- xx1 = aaBuf->getWidth();
- }
- // set [xx0, xx1) to 1
- if (xx0 < xx1) {
- xx = xx0;
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
- if (xx & 7) {
- mask = 0xff >> (xx & 7);
- if ((xx & ~7) == (xx1 & ~7)) {
- mask &= (Guchar)(0xff00 >> (xx1 & 7));
- }
- *p++ |= mask;
- xx = (xx & ~7) + 8;
- }
- for (; xx + 7 < xx1; xx += 8) {
- *p++ |= 0xff;
- }
- if (xx < xx1) {
- *p |= (Guchar)(0xff00 >> (xx1 & 7));
- }
- }
- if (xx0 < xxMin) {
- xxMin = xx0;
- }
- if (xx1 > xxMax) {
- xxMax = xx1;
- }
- }
- }
- *x0 = xxMin / splashAASize;
- *x1 = (xxMax - 1) / splashAASize;
-}
-
-void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf,
- int *x0, int *x1, int y) {
- int xx0, xx1, xx, yy;
- Guchar mask;
- SplashColorPtr p;
-
- for (yy = 0; yy < splashAASize; ++yy) {
- xx = *x0 * splashAASize;
- computeIntersections(splashAASize * y + yy);
- while (interIdx < interLen && xx < (*x1 + 1) * splashAASize) {
- xx0 = inter[interIdx].x0;
- xx1 = inter[interIdx].x1;
- interCount += inter[interIdx].count;
- ++interIdx;
- while (interIdx < interLen &&
- (inter[interIdx].x0 <= xx1 ||
- (eo ? (interCount & 1) : (interCount != 0)))) {
- if (inter[interIdx].x1 > xx1) {
- xx1 = inter[interIdx].x1;
- }
- interCount += inter[interIdx].count;
- ++interIdx;
- }
- if (xx0 > aaBuf->getWidth()) {
- xx0 = aaBuf->getWidth();
- }
- // set [xx, xx0) to 0
- if (xx < xx0) {
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
- if (xx & 7) {
- mask = (Guchar)(0xff00 >> (xx & 7));
- if ((xx & ~7) == (xx0 & ~7)) {
- mask |= 0xff >> (xx0 & 7);
- }
- *p++ &= mask;
- xx = (xx & ~7) + 8;
- }
- for (; xx + 7 <= xx0; xx += 8) {
- *p++ = 0x00;
- }
- if (xx < xx0) {
- *p &= 0xff >> (xx0 & 7);
- }
- }
- if (xx1 >= xx) {
- xx = xx1 + 1;
- }
- }
- xx0 = (*x1 + 1) * splashAASize;
- if (xx0 > aaBuf->getWidth()) xx0 = aaBuf->getWidth();
- // set [xx, xx0) to 0
- if (xx < xx0) {
- p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
- if (xx & 7) {
- mask = (Guchar)(0xff00 >> (xx & 7));
- if ((xx & ~7) == (xx0 & ~7)) {
- mask &= 0xff >> (xx0 & 7);
- }
- *p++ &= mask;
- xx = (xx & ~7) + 8;
- }
- for (; xx + 7 <= xx0; xx += 8) {
- *p++ = 0x00;
- }
- if (xx < xx0) {
- *p &= 0xff >> (xx0 & 7);
- }
- }
- }
-}
diff --git a/kpdf/xpdf/splash/SplashXPathScanner.cpp b/kpdf/xpdf/splash/SplashXPathScanner.cpp
new file mode 100644
index 00000000..8c7d505a
--- /dev/null
+++ b/kpdf/xpdf/splash/SplashXPathScanner.cpp
@@ -0,0 +1,429 @@
+//========================================================================
+//
+// SplashXPathScanner.cpp
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "SplashMath.h"
+#include "SplashXPath.h"
+#include "SplashBitmap.h"
+#include "SplashXPathScanner.h"
+
+//------------------------------------------------------------------------
+
+struct SplashIntersect {
+ int x0, x1; // intersection of segment with [y, y+1)
+ int count; // EO/NZWN counter increment
+};
+
+static int cmpIntersect(const void *p0, const void *p1) {
+ return ((SplashIntersect *)p0)->x0 - ((SplashIntersect *)p1)->x0;
+}
+
+//------------------------------------------------------------------------
+// SplashXPathScanner
+//------------------------------------------------------------------------
+
+SplashXPathScanner::SplashXPathScanner(SplashXPath *xPathA, GBool eoA) {
+ SplashXPathSeg *seg;
+ SplashCoord xMinFP, yMinFP, xMaxFP, yMaxFP;
+ int i;
+
+ xPath = xPathA;
+ eo = eoA;
+
+ // compute the bbox
+ if (xPath->length == 0) {
+ xMin = yMin = 1;
+ xMax = yMax = 0;
+ } else {
+ seg = &xPath->segs[0];
+ if (seg->x0 <= seg->x1) {
+ xMinFP = seg->x0;
+ xMaxFP = seg->x1;
+ } else {
+ xMinFP = seg->x1;
+ xMaxFP = seg->x0;
+ }
+ if (seg->flags & splashXPathFlip) {
+ yMinFP = seg->y1;
+ yMaxFP = seg->y0;
+ } else {
+ yMinFP = seg->y0;
+ yMaxFP = seg->y1;
+ }
+ for (i = 1; i < xPath->length; ++i) {
+ seg = &xPath->segs[i];
+ if (seg->x0 < xMinFP) {
+ xMinFP = seg->x0;
+ } else if (seg->x0 > xMaxFP) {
+ xMaxFP = seg->x0;
+ }
+ if (seg->x1 < xMinFP) {
+ xMinFP = seg->x1;
+ } else if (seg->x1 > xMaxFP) {
+ xMaxFP = seg->x1;
+ }
+ if (seg->flags & splashXPathFlip) {
+ if (seg->y0 > yMaxFP) {
+ yMaxFP = seg->y0;
+ }
+ } else {
+ if (seg->y1 > yMaxFP) {
+ yMaxFP = seg->y1;
+ }
+ }
+ }
+ xMin = splashFloor(xMinFP);
+ xMax = splashFloor(xMaxFP);
+ yMin = splashFloor(yMinFP);
+ yMax = splashFloor(yMaxFP);
+ }
+
+ interY = yMin - 1;
+ xPathIdx = 0;
+ inter = NULL;
+ interLen = interSize = 0;
+}
+
+SplashXPathScanner::~SplashXPathScanner() {
+ gfree(inter);
+}
+
+void SplashXPathScanner::getBBoxAA(int *xMinA, int *yMinA,
+ int *xMaxA, int *yMaxA) {
+ *xMinA = xMin / splashAASize;
+ *yMinA = yMin / splashAASize;
+ *xMaxA = xMax / splashAASize;
+ *yMaxA = yMax / splashAASize;
+}
+
+void SplashXPathScanner::getSpanBounds(int y, int *spanXMin, int *spanXMax) {
+ if (interY != y) {
+ computeIntersections(y);
+ }
+ if (interLen > 0) {
+ *spanXMin = inter[0].x0;
+ *spanXMax = inter[interLen - 1].x1;
+ } else {
+ *spanXMin = xMax + 1;
+ *spanXMax = xMax;
+ }
+}
+
+GBool SplashXPathScanner::test(int x, int y) {
+ int count, i;
+
+ if (interY != y) {
+ computeIntersections(y);
+ }
+ count = 0;
+ for (i = 0; i < interLen && inter[i].x0 <= x; ++i) {
+ if (x <= inter[i].x1) {
+ return gTrue;
+ }
+ count += inter[i].count;
+ }
+ return eo ? (count & 1) : (count != 0);
+}
+
+GBool SplashXPathScanner::testSpan(int x0, int x1, int y) {
+ int count, xx1, i;
+
+ if (interY != y) {
+ computeIntersections(y);
+ }
+
+ count = 0;
+ for (i = 0; i < interLen && inter[i].x1 < x0; ++i) {
+ count += inter[i].count;
+ }
+
+ // invariant: the subspan [x0,xx1] is inside the path
+ xx1 = x0 - 1;
+ while (xx1 < x1) {
+ if (i >= interLen) {
+ return gFalse;
+ }
+ if (inter[i].x0 > xx1 + 1 &&
+ !(eo ? (count & 1) : (count != 0))) {
+ return gFalse;
+ }
+ if (inter[i].x1 > xx1) {
+ xx1 = inter[i].x1;
+ }
+ count += inter[i].count;
+ ++i;
+ }
+
+ return gTrue;
+}
+
+GBool SplashXPathScanner::getNextSpan(int y, int *x0, int *x1) {
+ int xx0, xx1;
+
+ if (interY != y) {
+ computeIntersections(y);
+ }
+ if (interIdx >= interLen) {
+ return gFalse;
+ }
+ xx0 = inter[interIdx].x0;
+ xx1 = inter[interIdx].x1;
+ interCount += inter[interIdx].count;
+ ++interIdx;
+ while (interIdx < interLen &&
+ (inter[interIdx].x0 <= xx1 ||
+ (eo ? (interCount & 1) : (interCount != 0)))) {
+ if (inter[interIdx].x1 > xx1) {
+ xx1 = inter[interIdx].x1;
+ }
+ interCount += inter[interIdx].count;
+ ++interIdx;
+ }
+ *x0 = xx0;
+ *x1 = xx1;
+ return gTrue;
+}
+
+void SplashXPathScanner::computeIntersections(int y) {
+ SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
+ SplashXPathSeg *seg;
+ int i, j;
+
+ // find the first segment that intersects [y, y+1)
+ i = (y >= interY) ? xPathIdx : 0;
+ while (i < xPath->length &&
+ xPath->segs[i].y0 < y && xPath->segs[i].y1 < y) {
+ ++i;
+ }
+ xPathIdx = i;
+
+ // find all of the segments that intersect [y, y+1) and create an
+ // Intersect element for each one
+ interLen = 0;
+ for (j = i; j < xPath->length; ++j) {
+ seg = &xPath->segs[j];
+ if (seg->flags & splashXPathFlip) {
+ ySegMin = seg->y1;
+ ySegMax = seg->y0;
+ } else {
+ ySegMin = seg->y0;
+ ySegMax = seg->y1;
+ }
+
+ // ensure that: ySegMin < y+1
+ // y <= ySegMax
+ if (ySegMin >= y + 1) {
+ break;
+ }
+ if (ySegMax < y) {
+ continue;
+ }
+
+ if (interLen == interSize) {
+ if (interSize == 0) {
+ interSize = 16;
+ } else {
+ interSize *= 2;
+ }
+ inter = (SplashIntersect *)greallocn(inter, interSize,
+ sizeof(SplashIntersect));
+ }
+
+ if (seg->flags & splashXPathHoriz) {
+ xx0 = seg->x0;
+ xx1 = seg->x1;
+ } else if (seg->flags & splashXPathVert) {
+ xx0 = xx1 = seg->x0;
+ } else {
+ if (seg->x0 < seg->x1) {
+ xSegMin = seg->x0;
+ xSegMax = seg->x1;
+ } else {
+ xSegMin = seg->x1;
+ xSegMax = seg->x0;
+ }
+ // intersection with top edge
+ xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
+ // intersection with bottom edge
+ xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
+ // the segment may not actually extend to the top and/or bottom edges
+ if (xx0 < xSegMin) {
+ xx0 = xSegMin;
+ } else if (xx0 > xSegMax) {
+ xx0 = xSegMax;
+ }
+ if (xx1 < xSegMin) {
+ xx1 = xSegMin;
+ } else if (xx1 > xSegMax) {
+ xx1 = xSegMax;
+ }
+ }
+ if (xx0 < xx1) {
+ inter[interLen].x0 = splashFloor(xx0);
+ inter[interLen].x1 = splashFloor(xx1);
+ } else {
+ inter[interLen].x0 = splashFloor(xx1);
+ inter[interLen].x1 = splashFloor(xx0);
+ }
+ if (ySegMin <= y &&
+ (SplashCoord)y < ySegMax &&
+ !(seg->flags & splashXPathHoriz)) {
+ inter[interLen].count = eo ? 1
+ : (seg->flags & splashXPathFlip) ? 1 : -1;
+ } else {
+ inter[interLen].count = 0;
+ }
+ ++interLen;
+ }
+
+ qsort(inter, interLen, sizeof(SplashIntersect), &cmpIntersect);
+
+ interY = y;
+ interIdx = 0;
+ interCount = 0;
+}
+
+void SplashXPathScanner::renderAALine(SplashBitmap *aaBuf,
+ int *x0, int *x1, int y) {
+ int xx0, xx1, xx, xxMin, xxMax, yy;
+ Guchar mask;
+ SplashColorPtr p;
+
+ memset(aaBuf->getDataPtr(), 0, aaBuf->getRowSize() * aaBuf->getHeight());
+ xxMin = aaBuf->getWidth();
+ xxMax = -1;
+ for (yy = 0; yy < splashAASize; ++yy) {
+ computeIntersections(splashAASize * y + yy);
+ while (interIdx < interLen) {
+ xx0 = inter[interIdx].x0;
+ xx1 = inter[interIdx].x1;
+ interCount += inter[interIdx].count;
+ ++interIdx;
+ while (interIdx < interLen &&
+ (inter[interIdx].x0 <= xx1 ||
+ (eo ? (interCount & 1) : (interCount != 0)))) {
+ if (inter[interIdx].x1 > xx1) {
+ xx1 = inter[interIdx].x1;
+ }
+ interCount += inter[interIdx].count;
+ ++interIdx;
+ }
+ if (xx0 < 0) {
+ xx0 = 0;
+ }
+ ++xx1;
+ if (xx1 > aaBuf->getWidth()) {
+ xx1 = aaBuf->getWidth();
+ }
+ // set [xx0, xx1) to 1
+ if (xx0 < xx1) {
+ xx = xx0;
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
+ if (xx & 7) {
+ mask = 0xff >> (xx & 7);
+ if ((xx & ~7) == (xx1 & ~7)) {
+ mask &= (Guchar)(0xff00 >> (xx1 & 7));
+ }
+ *p++ |= mask;
+ xx = (xx & ~7) + 8;
+ }
+ for (; xx + 7 < xx1; xx += 8) {
+ *p++ |= 0xff;
+ }
+ if (xx < xx1) {
+ *p |= (Guchar)(0xff00 >> (xx1 & 7));
+ }
+ }
+ if (xx0 < xxMin) {
+ xxMin = xx0;
+ }
+ if (xx1 > xxMax) {
+ xxMax = xx1;
+ }
+ }
+ }
+ *x0 = xxMin / splashAASize;
+ *x1 = (xxMax - 1) / splashAASize;
+}
+
+void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf,
+ int *x0, int *x1, int y) {
+ int xx0, xx1, xx, yy;
+ Guchar mask;
+ SplashColorPtr p;
+
+ for (yy = 0; yy < splashAASize; ++yy) {
+ xx = *x0 * splashAASize;
+ computeIntersections(splashAASize * y + yy);
+ while (interIdx < interLen && xx < (*x1 + 1) * splashAASize) {
+ xx0 = inter[interIdx].x0;
+ xx1 = inter[interIdx].x1;
+ interCount += inter[interIdx].count;
+ ++interIdx;
+ while (interIdx < interLen &&
+ (inter[interIdx].x0 <= xx1 ||
+ (eo ? (interCount & 1) : (interCount != 0)))) {
+ if (inter[interIdx].x1 > xx1) {
+ xx1 = inter[interIdx].x1;
+ }
+ interCount += inter[interIdx].count;
+ ++interIdx;
+ }
+ if (xx0 > aaBuf->getWidth()) {
+ xx0 = aaBuf->getWidth();
+ }
+ // set [xx, xx0) to 0
+ if (xx < xx0) {
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
+ if (xx & 7) {
+ mask = (Guchar)(0xff00 >> (xx & 7));
+ if ((xx & ~7) == (xx0 & ~7)) {
+ mask |= 0xff >> (xx0 & 7);
+ }
+ *p++ &= mask;
+ xx = (xx & ~7) + 8;
+ }
+ for (; xx + 7 <= xx0; xx += 8) {
+ *p++ = 0x00;
+ }
+ if (xx < xx0) {
+ *p &= 0xff >> (xx0 & 7);
+ }
+ }
+ if (xx1 >= xx) {
+ xx = xx1 + 1;
+ }
+ }
+ xx0 = (*x1 + 1) * splashAASize;
+ if (xx0 > aaBuf->getWidth()) xx0 = aaBuf->getWidth();
+ // set [xx, xx0) to 0
+ if (xx < xx0) {
+ p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
+ if (xx & 7) {
+ mask = (Guchar)(0xff00 >> (xx & 7));
+ if ((xx & ~7) == (xx0 & ~7)) {
+ mask &= 0xff >> (xx0 & 7);
+ }
+ *p++ &= mask;
+ xx = (xx & ~7) + 8;
+ }
+ for (; xx + 7 <= xx0; xx += 8) {
+ *p++ = 0x00;
+ }
+ if (xx < xx0) {
+ *p &= 0xff >> (xx0 & 7);
+ }
+ }
+ }
+}
diff --git a/kpdf/xpdf/xpdf/Annot.cc b/kpdf/xpdf/xpdf/Annot.cc
deleted file mode 100644
index 23df25df..00000000
--- a/kpdf/xpdf/xpdf/Annot.cc
+++ /dev/null
@@ -1,1556 +0,0 @@
-//========================================================================
-//
-// Annot.cc
-//
-// Copyright 2000-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <math.h>
-#include "gmem.h"
-#include "GList.h"
-#include "Error.h"
-#include "Object.h"
-#include "Catalog.h"
-#include "Gfx.h"
-#include "GfxFont.h"
-#include "Lexer.h"
-#include "Annot.h"
-
-//------------------------------------------------------------------------
-
-#define annotFlagHidden 0x0002
-#define annotFlagPrint 0x0004
-#define annotFlagNoView 0x0020
-
-#define fieldFlagReadOnly 0x00000001
-#define fieldFlagRequired 0x00000002
-#define fieldFlagNoExport 0x00000004
-#define fieldFlagMultiline 0x00001000
-#define fieldFlagPassword 0x00002000
-#define fieldFlagNoToggleToOff 0x00004000
-#define fieldFlagRadio 0x00008000
-#define fieldFlagPushbutton 0x00010000
-#define fieldFlagCombo 0x00020000
-#define fieldFlagEdit 0x00040000
-#define fieldFlagSort 0x00080000
-#define fieldFlagFileSelect 0x00100000
-#define fieldFlagMultiSelect 0x00200000
-#define fieldFlagDoNotSpellCheck 0x00400000
-#define fieldFlagDoNotScroll 0x00800000
-#define fieldFlagComb 0x01000000
-#define fieldFlagRichText 0x02000000
-#define fieldFlagRadiosInUnison 0x02000000
-#define fieldFlagCommitOnSelChange 0x04000000
-
-#define fieldQuadLeft 0
-#define fieldQuadCenter 1
-#define fieldQuadRight 2
-
-// distance of Bezier control point from center for circle approximation
-// = (4 * (sqrt(2) - 1) / 3) * r
-#define bezierCircle 0.55228475
-
-//------------------------------------------------------------------------
-// AnnotBorderStyle
-//------------------------------------------------------------------------
-
-AnnotBorderStyle::AnnotBorderStyle(AnnotBorderType typeA, double widthA,
- double *dashA, int dashLengthA,
- double rA, double gA, double bA) {
- type = typeA;
- width = widthA;
- dash = dashA;
- dashLength = dashLengthA;
- r = rA;
- g = gA;
- b = bA;
-}
-
-AnnotBorderStyle::~AnnotBorderStyle() {
- if (dash) {
- gfree(dash);
- }
-}
-
-//------------------------------------------------------------------------
-// Annot
-//------------------------------------------------------------------------
-
-Annot::Annot(XRef *xrefA, Dict * /*acroForm*/, Dict *dict, Ref *refA) {
- Object apObj, asObj, obj1, obj2, obj3;
- AnnotBorderType borderType;
- double borderWidth;
- double *borderDash;
- int borderDashLength;
- double borderR, borderG, borderB;
- double t;
- int i;
-
- ok = gTrue;
- xref = xrefA;
- ref = *refA;
- type = NULL;
- appearBuf = NULL;
- borderStyle = NULL;
-
- //----- parse the type
-
- if (dict->lookup("Subtype", &obj1)->isName()) {
- type = new GString(obj1.getName());
- }
- obj1.free();
-
- //----- parse the rectangle
-
- if (dict->lookup("Rect", &obj1)->isArray() &&
- obj1.arrayGetLength() == 4) {
- xMin = yMin = xMax = yMax = 0;
- if (obj1.arrayGet(0, &obj2)->isNum()) {
- xMin = obj2.getNum();
- }
- obj2.free();
- if (obj1.arrayGet(1, &obj2)->isNum()) {
- yMin = obj2.getNum();
- }
- obj2.free();
- if (obj1.arrayGet(2, &obj2)->isNum()) {
- xMax = obj2.getNum();
- }
- obj2.free();
- if (obj1.arrayGet(3, &obj2)->isNum()) {
- yMax = obj2.getNum();
- }
- obj2.free();
- if (xMin > xMax) {
- t = xMin; xMin = xMax; xMax = t;
- }
- if (yMin > yMax) {
- t = yMin; yMin = yMax; yMax = t;
- }
- } else {
- error(-1, "Bad bounding box for annotation");
- ok = gFalse;
- }
- obj1.free();
-
- //----- parse the flags
-
- if (dict->lookup("F", &obj1)->isInt()) {
- flags = obj1.getInt();
- } else {
- flags = 0;
- }
- obj1.free();
-
- //----- parse the border style
-
- borderType = annotBorderSolid;
- borderWidth = 1;
- borderDash = NULL;
- borderDashLength = 0;
- borderR = 0;
- borderG = 0;
- borderB = 1;
- if (dict->lookup("BS", &obj1)->isDict()) {
- if (obj1.dictLookup("S", &obj2)->isName()) {
- if (obj2.isName("S")) {
- borderType = annotBorderSolid;
- } else if (obj2.isName("D")) {
- borderType = annotBorderDashed;
- } else if (obj2.isName("B")) {
- borderType = annotBorderBeveled;
- } else if (obj2.isName("I")) {
- borderType = annotBorderInset;
- } else if (obj2.isName("U")) {
- borderType = annotBorderUnderlined;
- }
- }
- obj2.free();
- if (obj1.dictLookup("W", &obj2)->isNum()) {
- borderWidth = obj2.getNum();
- }
- obj2.free();
- if (obj1.dictLookup("D", &obj2)->isArray()) {
- borderDashLength = obj2.arrayGetLength();
- borderDash = (double *)gmallocn(borderDashLength, sizeof(double));
- for (i = 0; i < borderDashLength; ++i) {
- if (obj2.arrayGet(i, &obj3)->isNum()) {
- borderDash[i] = obj3.getNum();
- } else {
- borderDash[i] = 1;
- }
- obj3.free();
- }
- }
- obj2.free();
- } else {
- obj1.free();
- if (dict->lookup("Border", &obj1)->isArray()) {
- if (obj1.arrayGetLength() >= 3) {
- if (obj1.arrayGet(2, &obj2)->isNum()) {
- borderWidth = obj2.getNum();
- }
- obj2.free();
- if (obj1.arrayGetLength() >= 4) {
- if (obj1.arrayGet(3, &obj2)->isArray()) {
- borderType = annotBorderDashed;
- borderDashLength = obj2.arrayGetLength();
- borderDash = (double *)gmallocn(borderDashLength, sizeof(double));
- for (i = 0; i < borderDashLength; ++i) {
- if (obj2.arrayGet(i, &obj3)->isNum()) {
- borderDash[i] = obj3.getNum();
- } else {
- borderDash[i] = 1;
- }
- obj3.free();
- }
- } else {
- // Adobe draws no border at all if the last element is of
- // the wrong type.
- borderWidth = 0;
- }
- obj2.free();
- }
- }
- }
- }
- obj1.free();
- if (dict->lookup("C", &obj1)->isArray() && obj1.arrayGetLength() == 3) {
- if (obj1.arrayGet(0, &obj2)->isNum()) {
- borderR = obj2.getNum();
- }
- obj1.free();
- if (obj1.arrayGet(1, &obj2)->isNum()) {
- borderG = obj2.getNum();
- }
- obj1.free();
- if (obj1.arrayGet(2, &obj2)->isNum()) {
- borderB = obj2.getNum();
- }
- obj1.free();
- }
- obj1.free();
- borderStyle = new AnnotBorderStyle(borderType, borderWidth,
- borderDash, borderDashLength,
- borderR, borderG, borderB);
-
- //----- get the annotation appearance
-
- if (dict->lookup("AP", &apObj)->isDict()) {
- if (dict->lookup("AS", &asObj)->isName()) {
- if (apObj.dictLookup("N", &obj1)->isDict()) {
- if (obj1.dictLookupNF(asObj.getName(), &obj2)->isRef()) {
- obj2.copy(&appearance);
- ok = gTrue;
- } else {
- obj2.free();
- if (obj1.dictLookupNF("Off", &obj2)->isRef()) {
- obj2.copy(&appearance);
- }
- }
- obj2.free();
- }
- obj1.free();
- } else {
- if (apObj.dictLookupNF("N", &obj1)->isRef()) {
- obj1.copy(&appearance);
- }
- obj1.free();
- }
- asObj.free();
- }
- apObj.free();
-}
-
-Annot::~Annot() {
- if (type) {
- delete type;
- }
- appearance.free();
- if (appearBuf) {
- delete appearBuf;
- }
- if (borderStyle) {
- delete borderStyle;
- }
-}
-
-void Annot::generateFieldAppearance(Dict *field, Dict *annot, Dict *acroForm) {
- Object mkObj, ftObj, appearDict, drObj, obj1, obj2, obj3;
- Dict *mkDict;
- MemStream *appearStream;
- GfxFontDict *fontDict;
- GBool hasCaption;
- double w, dx, dy, r;
- double *dash;
- GString *caption, *da;
- GString **text;
- GBool *selection;
- int dashLength, ff, quadding, comb, nOptions, topIdx, i, j;
-
- // must be a Widget annotation
- if (type->cmp("Widget")) {
- return;
- }
-
- appearBuf = new GString();
-
- // get the appearance characteristics (MK) dictionary
- if (annot->lookup("MK", &mkObj)->isDict()) {
- mkDict = mkObj.getDict();
- } else {
- mkDict = NULL;
- }
-
- // draw the background
- if (mkDict) {
- if (mkDict->lookup("BG", &obj1)->isArray() &&
- obj1.arrayGetLength() > 0) {
- setColor(obj1.getArray(), gTrue, 0);
- appearBuf->appendf("0 0 {0:.2f} {1:.2f} re f\n",
- xMax - xMin, yMax - yMin);
- }
- obj1.free();
- }
-
- // get the field type
- fieldLookup(field, "FT", &ftObj);
-
- // get the field flags (Ff) value
- if (fieldLookup(field, "Ff", &obj1)->isInt()) {
- ff = obj1.getInt();
- } else {
- ff = 0;
- }
- obj1.free();
-
- // draw the border
- if (mkDict) {
- w = borderStyle->getWidth();
- if (w > 0) {
- mkDict->lookup("BC", &obj1);
- if (!(obj1.isArray() && obj1.arrayGetLength() > 0)) {
- mkDict->lookup("BG", &obj1);
- }
- if (obj1.isArray() && obj1.arrayGetLength() > 0) {
- dx = xMax - xMin;
- dy = yMax - yMin;
-
- // radio buttons with no caption have a round border
- hasCaption = mkDict->lookup("CA", &obj2)->isString();
- obj2.free();
- if (ftObj.isName("Btn") && (ff & fieldFlagRadio) && !hasCaption) {
- r = 0.5 * (dx < dy ? dx : dy);
- switch (borderStyle->getType()) {
- case annotBorderDashed:
- appearBuf->append("[");
- borderStyle->getDash(&dash, &dashLength);
- for (i = 0; i < dashLength; ++i) {
- appearBuf->appendf(" {0:.2f}", dash[i]);
- }
- appearBuf->append("] 0 d\n");
- // fall through to the solid case
- case annotBorderSolid:
- case annotBorderUnderlined:
- appearBuf->appendf("{0:.2f} w\n", w);
- setColor(obj1.getArray(), gFalse, 0);
- drawCircle(0.5 * dx, 0.5 * dy, r - 0.5 * w, gFalse);
- break;
- case annotBorderBeveled:
- case annotBorderInset:
- appearBuf->appendf("{0:.2f} w\n", 0.5 * w);
- setColor(obj1.getArray(), gFalse, 0);
- drawCircle(0.5 * dx, 0.5 * dy, r - 0.25 * w, gFalse);
- setColor(obj1.getArray(), gFalse,
- borderStyle->getType() == annotBorderBeveled ? 1 : -1);
- drawCircleTopLeft(0.5 * dx, 0.5 * dy, r - 0.75 * w);
- setColor(obj1.getArray(), gFalse,
- borderStyle->getType() == annotBorderBeveled ? -1 : 1);
- drawCircleBottomRight(0.5 * dx, 0.5 * dy, r - 0.75 * w);
- break;
- }
-
- } else {
- switch (borderStyle->getType()) {
- case annotBorderDashed:
- appearBuf->append("[");
- borderStyle->getDash(&dash, &dashLength);
- for (i = 0; i < dashLength; ++i) {
- appearBuf->appendf(" {0:.2f}", dash[i]);
- }
- appearBuf->append("] 0 d\n");
- // fall through to the solid case
- case annotBorderSolid:
- appearBuf->appendf("{0:.2f} w\n", w);
- setColor(obj1.getArray(), gFalse, 0);
- appearBuf->appendf("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re s\n",
- 0.5 * w, dx - w, dy - w);
- break;
- case annotBorderBeveled:
- case annotBorderInset:
- setColor(obj1.getArray(), gTrue,
- borderStyle->getType() == annotBorderBeveled ? 1 : -1);
- appearBuf->append("0 0 m\n");
- appearBuf->appendf("0 {0:.2f} l\n", dy);
- appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx, dy);
- appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx - w, dy - w);
- appearBuf->appendf("{0:.2f} {1:.2f} l\n", w, dy - w);
- appearBuf->appendf("{0:.2f} {0:.2f} l\n", w);
- appearBuf->append("f\n");
- setColor(obj1.getArray(), gTrue,
- borderStyle->getType() == annotBorderBeveled ? -1 : 1);
- appearBuf->append("0 0 m\n");
- appearBuf->appendf("{0:.2f} 0 l\n", dx);
- appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx, dy);
- appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx - w, dy - w);
- appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx - w, w);
- appearBuf->appendf("{0:.2f} {0:.2f} l\n", w);
- appearBuf->append("f\n");
- break;
- case annotBorderUnderlined:
- appearBuf->appendf("{0:.2f} w\n", w);
- setColor(obj1.getArray(), gFalse, 0);
- appearBuf->appendf("0 0 m {0:.2f} 0 l s\n", dx);
- break;
- }
-
- // clip to the inside of the border
- appearBuf->appendf("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re W n\n",
- w, dx - 2 * w, dy - 2 * w);
- }
- }
- obj1.free();
- }
- }
-
- // get the resource dictionary
- acroForm->lookup("DR", &drObj);
-
- // build the font dictionary
- if (drObj.isDict() && drObj.dictLookup("Font", &obj1)->isDict()) {
- fontDict = new GfxFontDict(xref, NULL, obj1.getDict());
- } else {
- fontDict = NULL;
- }
- obj1.free();
-
- // get the default appearance string
- if (fieldLookup(field, "DA", &obj1)->isNull()) {
- obj1.free();
- acroForm->lookup("DA", &obj1);
- }
- if (obj1.isString()) {
- da = obj1.getString()->copy();
- } else {
- da = NULL;
- }
- obj1.free();
-
- // draw the field contents
- if (ftObj.isName("Btn")) {
- caption = NULL;
- if (mkDict) {
- if (mkDict->lookup("CA", &obj1)->isString()) {
- caption = obj1.getString()->copy();
- }
- obj1.free();
- }
- // radio button
- if (ff & fieldFlagRadio) {
- //~ Acrobat doesn't draw a caption if there is no AP dict (?)
- if (fieldLookup(field, "V", &obj1)->isName()) {
- if (annot->lookup("AS", &obj2)->isName(obj1.getName())) {
- if (caption) {
- drawText(caption, da, fontDict, gFalse, 0, fieldQuadCenter,
- gFalse, gTrue);
- } else {
- if (mkDict) {
- if (mkDict->lookup("BC", &obj3)->isArray() &&
- obj3.arrayGetLength() > 0) {
- dx = xMax - xMin;
- dy = yMax - yMin;
- setColor(obj3.getArray(), gTrue, 0);
- drawCircle(0.5 * dx, 0.5 * dy, 0.2 * (dx < dy ? dx : dy),
- gTrue);
- }
- obj3.free();
- }
- }
- }
- obj2.free();
- }
- obj1.free();
- // pushbutton
- } else if (ff & fieldFlagPushbutton) {
- if (caption) {
- drawText(caption, da, fontDict, gFalse, 0, fieldQuadCenter,
- gFalse, gFalse);
- }
- // checkbox
- } else {
- // According to the PDF spec the off state must be named "Off",
- // and the on state can be named anything, but Acrobat apparently
- // looks for "Yes" and treats anything else as off.
- if (fieldLookup(field, "V", &obj1)->isName("Yes")) {
- if (!caption) {
- caption = new GString("3"); // ZapfDingbats checkmark
- }
- drawText(caption, da, fontDict, gFalse, 0, fieldQuadCenter,
- gFalse, gTrue);
- }
- obj1.free();
- }
- if (caption) {
- delete caption;
- }
- } else if (ftObj.isName("Tx")) {
- //~ value strings can be Unicode
- if (fieldLookup(field, "V", &obj1)->isString()) {
- if (fieldLookup(field, "Q", &obj2)->isInt()) {
- quadding = obj2.getInt();
- } else {
- quadding = fieldQuadLeft;
- }
- obj2.free();
- comb = 0;
- if (ff & fieldFlagComb) {
- if (fieldLookup(field, "MaxLen", &obj2)->isInt()) {
- comb = obj2.getInt();
- }
- obj2.free();
- }
- drawText(obj1.getString(), da, fontDict,
- ff & fieldFlagMultiline, comb, quadding, gTrue, gFalse);
- }
- obj1.free();
- } else if (ftObj.isName("Ch")) {
- //~ value/option strings can be Unicode
- if (fieldLookup(field, "Q", &obj1)->isInt()) {
- quadding = obj1.getInt();
- } else {
- quadding = fieldQuadLeft;
- }
- obj1.free();
- // combo box
- if (ff & fieldFlagCombo) {
- if (fieldLookup(field, "V", &obj1)->isString()) {
- drawText(obj1.getString(), da, fontDict,
- gFalse, 0, quadding, gTrue, gFalse);
- //~ Acrobat draws a popup icon on the right side
- }
- obj1.free();
- // list box
- } else {
- if (field->lookup("Opt", &obj1)->isArray()) {
- nOptions = obj1.arrayGetLength();
- // get the option text
- text = (GString **)gmallocn(nOptions, sizeof(GString *));
- for (i = 0; i < nOptions; ++i) {
- text[i] = NULL;
- obj1.arrayGet(i, &obj2);
- if (obj2.isString()) {
- text[i] = obj2.getString()->copy();
- } else if (obj2.isArray() && obj2.arrayGetLength() == 2) {
- if (obj2.arrayGet(1, &obj3)->isString()) {
- text[i] = obj3.getString()->copy();
- }
- obj3.free();
- }
- obj2.free();
- if (!text[i]) {
- text[i] = new GString();
- }
- }
- // get the selected option(s)
- selection = (GBool *)gmallocn(nOptions, sizeof(GBool));
- //~ need to use the I field in addition to the V field
- fieldLookup(field, "V", &obj2);
- for (i = 0; i < nOptions; ++i) {
- selection[i] = gFalse;
- if (obj2.isString()) {
- if (!obj2.getString()->cmp(text[i])) {
- selection[i] = gTrue;
- }
- } else if (obj2.isArray()) {
- for (j = 0; j < obj2.arrayGetLength(); ++j) {
- if (obj2.arrayGet(j, &obj3)->isString() &&
- !obj3.getString()->cmp(text[i])) {
- selection[i] = gTrue;
- }
- obj3.free();
- }
- }
- }
- obj2.free();
- // get the top index
- if (field->lookup("TI", &obj2)->isInt()) {
- topIdx = obj2.getInt();
- } else {
- topIdx = 0;
- }
- obj2.free();
- // draw the text
- drawListBox(text, selection, nOptions, topIdx, da, fontDict, quadding);
- for (i = 0; i < nOptions; ++i) {
- delete text[i];
- }
- gfree(text);
- gfree(selection);
- }
- obj1.free();
- }
- } else if (ftObj.isName("Sig")) {
- //~unimp
- } else {
- error(-1, "Unknown field type");
- }
-
- if (da) {
- delete da;
- }
-
- // build the appearance stream dictionary
- appearDict.initDict(xref);
- appearDict.dictAdd(copyString("Length"),
- obj1.initInt(appearBuf->getLength()));
- appearDict.dictAdd(copyString("Subtype"), obj1.initName("Form"));
- obj1.initArray(xref);
- obj1.arrayAdd(obj2.initReal(0));
- obj1.arrayAdd(obj2.initReal(0));
- obj1.arrayAdd(obj2.initReal(xMax - xMin));
- obj1.arrayAdd(obj2.initReal(yMax - yMin));
- appearDict.dictAdd(copyString("BBox"), &obj1);
-
- // set the resource dictionary
- if (drObj.isDict()) {
- appearDict.dictAdd(copyString("Resources"), drObj.copy(&obj1));
- }
- drObj.free();
-
- // build the appearance stream
- appearStream = new MemStream(appearBuf->getCString(), 0,
- appearBuf->getLength(), &appearDict);
- appearance.free();
- appearance.initStream(appearStream);
-
- if (fontDict) {
- delete fontDict;
- }
- ftObj.free();
- mkObj.free();
-}
-
-// Set the current fill or stroke color, based on <a> (which should
-// have 1, 3, or 4 elements). If <adjust> is +1, color is brightened;
-// if <adjust> is -1, color is darkened; otherwise color is not
-// modified.
-void Annot::setColor(Array *a, GBool fill, int adjust) {
- Object obj1;
- double color[4];
- int nComps, i;
-
- nComps = a->getLength();
- if (nComps > 4) {
- nComps = 4;
- }
- for (i = 0; i < nComps && i < 4; ++i) {
- if (a->get(i, &obj1)->isNum()) {
- color[i] = obj1.getNum();
- } else {
- color[i] = 0;
- }
- obj1.free();
- }
- if (nComps == 4) {
- adjust = -adjust;
- }
- if (adjust > 0) {
- for (i = 0; i < nComps; ++i) {
- color[i] = 0.5 * color[i] + 0.5;
- }
- } else if (adjust < 0) {
- for (i = 0; i < nComps; ++i) {
- color[i] = 0.5 * color[i];
- }
- }
- if (nComps == 4) {
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:c}\n",
- color[0], color[1], color[2], color[3],
- fill ? 'k' : 'K');
- } else if (nComps == 3) {
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:s}\n",
- color[0], color[1], color[2],
- fill ? "rg" : "RG");
- } else {
- appearBuf->appendf("{0:.2f} {1:c}\n",
- color[0],
- fill ? 'g' : 'G');
- }
-}
-
-// Draw the variable text or caption for a field.
-void Annot::drawText(GString *text, GString *da, GfxFontDict *fontDict,
- GBool multiline, int comb, int quadding,
- GBool txField, GBool forceZapfDingbats) {
- GList *daToks;
- GString *tok;
- GfxFont *font;
- double fontSize, fontSize2, border, x, xPrev, y, w, w2, wMax;
- int tfPos, tmPos, i, j, k, c;
-
- //~ if there is no MK entry, this should use the existing content stream,
- //~ and only replace the marked content portion of it
- //~ (this is only relevant for Tx fields)
-
- // parse the default appearance string
- tfPos = tmPos = -1;
- if (da) {
- daToks = new GList();
- i = 0;
- while (i < da->getLength()) {
- while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
- ++i;
- }
- if (i < da->getLength()) {
- for (j = i + 1;
- j < da->getLength() && !Lexer::isSpace(da->getChar(j));
- ++j) ;
- daToks->append(new GString(da, i, j - i));
- i = j;
- }
- }
- for (i = 2; i < daToks->getLength(); ++i) {
- if (i >= 2 && !((GString *)daToks->get(i))->cmp("Tf")) {
- tfPos = i - 2;
- } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
- tmPos = i - 6;
- }
- }
- } else {
- daToks = NULL;
- }
-
- // force ZapfDingbats
- //~ this should create the font if needed (?)
- if (forceZapfDingbats) {
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos);
- if (tok->cmp("/ZaDb")) {
- tok->clear();
- tok->append("/ZaDb");
- }
- }
- }
-
- // get the font and font size
- font = NULL;
- fontSize = 0;
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos);
- if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
- if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
- error(-1, "Unknown font in field's DA string");
- }
- } else {
- error(-1, "Invalid font name in 'Tf' operator in field's DA string");
- }
- tok = (GString *)daToks->get(tfPos + 1);
- fontSize = atof(tok->getCString());
- } else {
- error(-1, "Missing 'Tf' operator in field's DA string");
- }
-
- // get the border width
- border = borderStyle->getWidth();
-
- // setup
- if (txField) {
- appearBuf->append("/Tx BMC\n");
- }
- appearBuf->append("q\n");
- appearBuf->append("BT\n");
-
- // multi-line text
- if (multiline) {
- // note: the comb flag is ignored in multiline mode
-
- wMax = xMax - xMin - 2 * border - 4;
-
- // compute font autosize
- if (fontSize == 0) {
- for (fontSize = 20; fontSize > 1; --fontSize) {
- y = yMax - yMin;
- w2 = 0;
- i = 0;
- while (i < text->getLength()) {
- getNextLine(text, i, font, fontSize, wMax, &j, &w, &k);
- if (w > w2) {
- w2 = w;
- }
- i = k;
- y -= fontSize;
- }
- // approximate the descender for the last line
- if (y >= 0.33 * fontSize) {
- break;
- }
- }
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos + 1);
- tok->clear();
- tok->appendf("{0:.2f}", fontSize);
- }
- }
-
- // starting y coordinate
- // (note: each line of text starts with a Td operator that moves
- // down a line)
- y = yMax - yMin;
-
- // set the font matrix
- if (tmPos >= 0) {
- tok = (GString *)daToks->get(tmPos + 4);
- tok->clear();
- tok->append('0');
- tok = (GString *)daToks->get(tmPos + 5);
- tok->clear();
- tok->appendf("{0:.2f}", y);
- }
-
- // write the DA string
- if (daToks) {
- for (i = 0; i < daToks->getLength(); ++i) {
- appearBuf->append((GString *)daToks->get(i))->append(' ');
- }
- }
-
- // write the font matrix (if not part of the DA string)
- if (tmPos < 0) {
- appearBuf->appendf("1 0 0 1 0 {0:.2f} Tm\n", y);
- }
-
- // write a series of lines of text
- i = 0;
- xPrev = 0;
- while (i < text->getLength()) {
-
- getNextLine(text, i, font, fontSize, wMax, &j, &w, &k);
-
- // compute text start position
- switch (quadding) {
- case fieldQuadLeft:
- default:
- x = border + 2;
- break;
- case fieldQuadCenter:
- x = (xMax - xMin - w) / 2;
- break;
- case fieldQuadRight:
- x = xMax - xMin - border - 2 - w;
- break;
- }
-
- // draw the line
- appearBuf->appendf("{0:.2f} {1:.2f} Td\n", x - xPrev, -fontSize);
- appearBuf->append('(');
- for (; i < j; ++i) {
- c = text->getChar(i) & 0xff;
- if (c == '(' || c == ')' || c == '\\') {
- appearBuf->append('\\');
- appearBuf->append(c);
- } else if (c < 0x20 || c >= 0x80) {
- appearBuf->appendf("\\{0:03o}", c);
- } else {
- appearBuf->append(c);
- }
- }
- appearBuf->append(") Tj\n");
-
- // next line
- i = k;
- xPrev = x;
- }
-
- // single-line text
- } else {
- //~ replace newlines with spaces? - what does Acrobat do?
-
- // comb formatting
- if (comb > 0) {
-
- // compute comb spacing
- w = (xMax - xMin - 2 * border) / comb;
-
- // compute font autosize
- if (fontSize == 0) {
- fontSize = yMax - yMin - 2 * border;
- if (w < fontSize) {
- fontSize = w;
- }
- fontSize = floor(fontSize);
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos + 1);
- tok->clear();
- tok->appendf("{0:.2f}", fontSize);
- }
- }
-
- // compute text start position
- switch (quadding) {
- case fieldQuadLeft:
- default:
- x = border + 2;
- break;
- case fieldQuadCenter:
- x = border + 2 + 0.5 * (comb - text->getLength()) * w;
- break;
- case fieldQuadRight:
- x = border + 2 + (comb - text->getLength()) * w;
- break;
- }
- y = 0.5 * (yMax - yMin) - 0.4 * fontSize;
-
- // set the font matrix
- if (tmPos >= 0) {
- tok = (GString *)daToks->get(tmPos + 4);
- tok->clear();
- tok->appendf("{0:.2f}", x);
- tok = (GString *)daToks->get(tmPos + 5);
- tok->clear();
- tok->appendf("{0:.2f}", y);
- }
-
- // write the DA string
- if (daToks) {
- for (i = 0; i < daToks->getLength(); ++i) {
- appearBuf->append((GString *)daToks->get(i))->append(' ');
- }
- }
-
- // write the font matrix (if not part of the DA string)
- if (tmPos < 0) {
- appearBuf->appendf("1 0 0 1 {0:.2f} {1:.2f} Tm\n", x, y);
- }
-
- // write the text string
- //~ this should center (instead of left-justify) each character within
- //~ its comb cell
- for (i = 0; i < text->getLength(); ++i) {
- if (i > 0) {
- appearBuf->appendf("{0:.2f} 0 Td\n", w);
- }
- appearBuf->append('(');
- c = text->getChar(i) & 0xff;
- if (c == '(' || c == ')' || c == '\\') {
- appearBuf->append('\\');
- appearBuf->append(c);
- } else if (c < 0x20 || c >= 0x80) {
- appearBuf->appendf("{0:.2f} 0 Td\n", w);
- } else {
- appearBuf->append(c);
- }
- appearBuf->append(") Tj\n");
- }
-
- // regular (non-comb) formatting
- } else {
-
- // compute string width
- if (font && !font->isCIDFont()) {
- w = 0;
- for (i = 0; i < text->getLength(); ++i) {
- w += ((Gfx8BitFont *)font)->getWidth(text->getChar(i));
- }
- } else {
- // otherwise, make a crude estimate
- w = text->getLength() * 0.5;
- }
-
- // compute font autosize
- if (fontSize == 0) {
- fontSize = yMax - yMin - 2 * border;
- fontSize2 = (xMax - xMin - 4 - 2 * border) / w;
- if (fontSize2 < fontSize) {
- fontSize = fontSize2;
- }
- fontSize = floor(fontSize);
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos + 1);
- tok->clear();
- tok->appendf("{0:.2f}", fontSize);
- }
- }
-
- // compute text start position
- w *= fontSize;
- switch (quadding) {
- case fieldQuadLeft:
- default:
- x = border + 2;
- break;
- case fieldQuadCenter:
- x = (xMax - xMin - w) / 2;
- break;
- case fieldQuadRight:
- x = xMax - xMin - border - 2 - w;
- break;
- }
- y = 0.5 * (yMax - yMin) - 0.4 * fontSize;
-
- // set the font matrix
- if (tmPos >= 0) {
- tok = (GString *)daToks->get(tmPos + 4);
- tok->clear();
- tok->appendf("{0:.2f}", x);
- tok = (GString *)daToks->get(tmPos + 5);
- tok->clear();
- tok->appendf("{0:.2f}", y);
- }
-
- // write the DA string
- if (daToks) {
- for (i = 0; i < daToks->getLength(); ++i) {
- appearBuf->append((GString *)daToks->get(i))->append(' ');
- }
- }
-
- // write the font matrix (if not part of the DA string)
- if (tmPos < 0) {
- appearBuf->appendf("1 0 0 1 {0:.2f} {1:.2f} Tm\n", x, y);
- }
-
- // write the text string
- appearBuf->append('(');
- for (i = 0; i < text->getLength(); ++i) {
- c = text->getChar(i) & 0xff;
- if (c == '(' || c == ')' || c == '\\') {
- appearBuf->append('\\');
- appearBuf->append(c);
- } else if (c < 0x20 || c >= 0x80) {
- appearBuf->appendf("\\{0:03o}", c);
- } else {
- appearBuf->append(c);
- }
- }
- appearBuf->append(") Tj\n");
- }
- }
-
- // cleanup
- appearBuf->append("ET\n");
- appearBuf->append("Q\n");
- if (txField) {
- appearBuf->append("EMC\n");
- }
-
- if (daToks) {
- deleteGList(daToks, GString);
- }
-}
-
-// Draw the variable text or caption for a field.
-void Annot::drawListBox(GString **text, GBool *selection,
- int nOptions, int topIdx,
- GString *da, GfxFontDict *fontDict, GBool quadding) {
- GList *daToks;
- GString *tok;
- GfxFont *font;
- double fontSize, fontSize2, border, x, y, w, wMax;
- int tfPos, tmPos, i, j, c;
-
- //~ if there is no MK entry, this should use the existing content stream,
- //~ and only replace the marked content portion of it
- //~ (this is only relevant for Tx fields)
-
- // parse the default appearance string
- tfPos = tmPos = -1;
- if (da) {
- daToks = new GList();
- i = 0;
- while (i < da->getLength()) {
- while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
- ++i;
- }
- if (i < da->getLength()) {
- for (j = i + 1;
- j < da->getLength() && !Lexer::isSpace(da->getChar(j));
- ++j) ;
- daToks->append(new GString(da, i, j - i));
- i = j;
- }
- }
- for (i = 2; i < daToks->getLength(); ++i) {
- if (i >= 2 && !((GString *)daToks->get(i))->cmp("Tf")) {
- tfPos = i - 2;
- } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
- tmPos = i - 6;
- }
- }
- } else {
- daToks = NULL;
- }
-
- // get the font and font size
- font = NULL;
- fontSize = 0;
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos);
- if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
- if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
- error(-1, "Unknown font in field's DA string");
- }
- } else {
- error(-1, "Invalid font name in 'Tf' operator in field's DA string");
- }
- tok = (GString *)daToks->get(tfPos + 1);
- fontSize = atof(tok->getCString());
- } else {
- error(-1, "Missing 'Tf' operator in field's DA string");
- }
-
- // get the border width
- border = borderStyle->getWidth();
-
- // compute font autosize
- if (fontSize == 0) {
- wMax = 0;
- for (i = 0; i < nOptions; ++i) {
- if (font && !font->isCIDFont()) {
- w = 0;
- for (j = 0; j < text[i]->getLength(); ++j) {
- w += ((Gfx8BitFont *)font)->getWidth(text[i]->getChar(j));
- }
- } else {
- // otherwise, make a crude estimate
- w = text[i]->getLength() * 0.5;
- }
- if (w > wMax) {
- wMax = w;
- }
- }
- fontSize = yMax - yMin - 2 * border;
- fontSize2 = (xMax - xMin - 4 - 2 * border) / wMax;
- if (fontSize2 < fontSize) {
- fontSize = fontSize2;
- }
- fontSize = floor(fontSize);
- if (tfPos >= 0) {
- tok = (GString *)daToks->get(tfPos + 1);
- tok->clear();
- tok->appendf("{0:.2f}", fontSize);
- }
- }
-
- // draw the text
- y = yMax - yMin - 1.1 * fontSize;
- for (i = topIdx; i < nOptions; ++i) {
-
- // setup
- appearBuf->append("q\n");
-
- // draw the background if selected
- if (selection[i]) {
- appearBuf->append("0 g f\n");
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} re f\n",
- border,
- y - 0.2 * fontSize,
- xMax - xMin - 2 * border,
- 1.1 * fontSize);
- }
-
- // setup
- appearBuf->append("BT\n");
-
- // compute string width
- if (font && !font->isCIDFont()) {
- w = 0;
- for (j = 0; j < text[i]->getLength(); ++j) {
- w += ((Gfx8BitFont *)font)->getWidth(text[i]->getChar(j));
- }
- } else {
- // otherwise, make a crude estimate
- w = text[i]->getLength() * 0.5;
- }
-
- // compute text start position
- w *= fontSize;
- switch (quadding) {
- case fieldQuadLeft:
- default:
- x = border + 2;
- break;
- case fieldQuadCenter:
- x = (xMax - xMin - w) / 2;
- break;
- case fieldQuadRight:
- x = xMax - xMin - border - 2 - w;
- break;
- }
-
- // set the font matrix
- if (tmPos >= 0) {
- tok = (GString *)daToks->get(tmPos + 4);
- tok->clear();
- tok->appendf("{0:.2f}", x);
- tok = (GString *)daToks->get(tmPos + 5);
- tok->clear();
- tok->appendf("{0:.2f}", y);
- }
-
- // write the DA string
- if (daToks) {
- for (j = 0; j < daToks->getLength(); ++j) {
- appearBuf->append((GString *)daToks->get(j))->append(' ');
- }
- }
-
- // write the font matrix (if not part of the DA string)
- if (tmPos < 0) {
- appearBuf->appendf("1 0 0 1 {0:.2f} {1:.2f} Tm\n", x, y);
- }
-
- // change the text color if selected
- if (selection[i]) {
- appearBuf->append("1 g\n");
- }
-
- // write the text string
- appearBuf->append('(');
- for (j = 0; j < text[i]->getLength(); ++j) {
- c = text[i]->getChar(j) & 0xff;
- if (c == '(' || c == ')' || c == '\\') {
- appearBuf->append('\\');
- appearBuf->append(c);
- } else if (c < 0x20 || c >= 0x80) {
- appearBuf->appendf("\\{0:03o}", c);
- } else {
- appearBuf->append(c);
- }
- }
- appearBuf->append(") Tj\n");
-
- // cleanup
- appearBuf->append("ET\n");
- appearBuf->append("Q\n");
-
- // next line
- y -= 1.1 * fontSize;
- }
-
- if (daToks) {
- deleteGList(daToks, GString);
- }
-}
-
-// Figure out how much text will fit on the next line. Returns:
-// *end = one past the last character to be included
-// *width = width of the characters start .. end-1
-// *next = index of first character on the following line
-void Annot::getNextLine(GString *text, int start,
- GfxFont *font, double fontSize, double wMax,
- int *end, double *width, int *next) {
- double w, dw;
- int j, k, c;
-
- // figure out how much text will fit on the line
- //~ what does Adobe do with tabs?
- w = 0;
- for (j = start; j < text->getLength() && w <= wMax; ++j) {
- c = text->getChar(j) & 0xff;
- if (c == 0x0a || c == 0x0d) {
- break;
- }
- if (font && !font->isCIDFont()) {
- dw = ((Gfx8BitFont *)font)->getWidth(c) * fontSize;
- } else {
- // otherwise, make a crude estimate
- dw = 0.5 * fontSize;
- }
- w += dw;
- }
- if (w > wMax) {
- for (k = j; k > start && text->getChar(k-1) != ' '; --k) ;
- for (; k > start && text->getChar(k-1) == ' '; --k) ;
- if (k > start) {
- j = k;
- }
- if (j == start) {
- // handle the pathological case where the first character is
- // too wide to fit on the line all by itself
- j = start + 1;
- }
- }
- *end = j;
-
- // compute the width
- w = 0;
- for (k = start; k < j; ++k) {
- if (font && !font->isCIDFont()) {
- dw = ((Gfx8BitFont *)font)->getWidth(text->getChar(k)) * fontSize;
- } else {
- // otherwise, make a crude estimate
- dw = 0.5 * fontSize;
- }
- w += dw;
- }
- *width = w;
-
- // next line
- while (j < text->getLength() && text->getChar(j) == ' ') {
- ++j;
- }
- if (j < text->getLength() && text->getChar(j) == 0x0d) {
- ++j;
- }
- if (j < text->getLength() && text->getChar(j) == 0x0a) {
- ++j;
- }
- *next = j;
-}
-
-// Draw an (approximate) circle of radius <r> centered at (<cx>, <cy>).
-// If <fill> is true, the circle is filled; otherwise it is stroked.
-void Annot::drawCircle(double cx, double cy, double r, GBool fill) {
- appearBuf->appendf("{0:.2f} {1:.2f} m\n",
- cx + r, cy);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx + r, cy + bezierCircle * r,
- cx + bezierCircle * r, cy + r,
- cx, cy + r);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx - bezierCircle * r, cy + r,
- cx - r, cy + bezierCircle * r,
- cx - r, cy);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx - r, cy - bezierCircle * r,
- cx - bezierCircle * r, cy - r,
- cx, cy - r);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx + bezierCircle * r, cy - r,
- cx + r, cy - bezierCircle * r,
- cx + r, cy);
- appearBuf->append(fill ? "f\n" : "s\n");
-}
-
-// Draw the top-left half of an (approximate) circle of radius <r>
-// centered at (<cx>, <cy>).
-void Annot::drawCircleTopLeft(double cx, double cy, double r) {
- double r2;
-
- r2 = r / sqrt(2.0);
- appearBuf->appendf("{0:.2f} {1:.2f} m\n",
- cx + r2, cy + r2);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx + (1 - bezierCircle) * r2,
- cy + (1 + bezierCircle) * r2,
- cx - (1 - bezierCircle) * r2,
- cy + (1 + bezierCircle) * r2,
- cx - r2,
- cy + r2);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx - (1 + bezierCircle) * r2,
- cy + (1 - bezierCircle) * r2,
- cx - (1 + bezierCircle) * r2,
- cy - (1 - bezierCircle) * r2,
- cx - r2,
- cy - r2);
- appearBuf->append("S\n");
-}
-
-// Draw the bottom-right half of an (approximate) circle of radius <r>
-// centered at (<cx>, <cy>).
-void Annot::drawCircleBottomRight(double cx, double cy, double r) {
- double r2;
-
- r2 = r / sqrt(2.0);
- appearBuf->appendf("{0:.2f} {1:.2f} m\n",
- cx - r2, cy - r2);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx - (1 - bezierCircle) * r2,
- cy - (1 + bezierCircle) * r2,
- cx + (1 - bezierCircle) * r2,
- cy - (1 + bezierCircle) * r2,
- cx + r2,
- cy - r2);
- appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
- cx + (1 + bezierCircle) * r2,
- cy - (1 - bezierCircle) * r2,
- cx + (1 + bezierCircle) * r2,
- cy + (1 - bezierCircle) * r2,
- cx + r2,
- cy + r2);
- appearBuf->append("S\n");
-}
-
-// Look up an inheritable field dictionary entry.
-Object *Annot::fieldLookup(Dict *field, char *key, Object *obj) {
- Dict *dict;
- Object parent;
-
- dict = field;
- if (!dict->lookup(key, obj)->isNull()) {
- return obj;
- }
- obj->free();
- if (dict->lookup("Parent", &parent)->isDict()) {
- fieldLookup(parent.getDict(), key, obj);
- } else {
- obj->initNull();
- }
- parent.free();
- return obj;
-}
-
-void Annot::draw(Gfx *gfx, GBool printing) {
- Object obj;
- GBool isLink;
-
- // check the flags
- if ((flags & annotFlagHidden) ||
- (printing && !(flags & annotFlagPrint)) ||
- (!printing && (flags & annotFlagNoView))) {
- return;
- }
-
- // draw the appearance stream
- isLink = type && !type->cmp("Link");
- appearance.fetch(xref, &obj);
- gfx->drawAnnot(&obj, isLink ? borderStyle : (AnnotBorderStyle *)NULL,
- xMin, yMin, xMax, yMax);
- obj.free();
-}
-
-//------------------------------------------------------------------------
-// Annots
-//------------------------------------------------------------------------
-
-Annots::Annots(XRef *xref, Catalog *catalog, Object *annotsObj) {
- Dict *acroForm;
- Annot *annot;
- Object obj1;
- Ref ref;
- int size;
- int i;
-
- annots = NULL;
- size = 0;
- nAnnots = 0;
-
- acroForm = catalog->getAcroForm()->isDict() ?
- catalog->getAcroForm()->getDict() : NULL;
- if (annotsObj->isArray()) {
- for (i = 0; i < annotsObj->arrayGetLength(); ++i) {
- if (annotsObj->arrayGetNF(i, &obj1)->isRef()) {
- ref = obj1.getRef();
- obj1.free();
- annotsObj->arrayGet(i, &obj1);
- } else {
- ref.num = ref.gen = -1;
- }
- if (obj1.isDict()) {
- annot = new Annot(xref, acroForm, obj1.getDict(), &ref);
- if (annot->isOk()) {
- if (nAnnots >= size) {
- size += 16;
- annots = (Annot **)greallocn(annots, size, sizeof(Annot *));
- }
- annots[nAnnots++] = annot;
- } else {
- delete annot;
- }
- }
- obj1.free();
- }
- }
-}
-
-Annots::~Annots() {
- int i;
-
- for (i = 0; i < nAnnots; ++i) {
- delete annots[i];
- }
- gfree(annots);
-}
-
-void Annots::generateAppearances(Dict *acroForm) {
- Object obj1, obj2;
- Ref ref;
- int i;
-
- if (acroForm->lookup("Fields", &obj1)->isArray()) {
- for (i = 0; i < obj1.arrayGetLength(); ++i) {
- if (obj1.arrayGetNF(i, &obj2)->isRef()) {
- ref = obj2.getRef();
- obj2.free();
- obj1.arrayGet(i, &obj2);
- } else {
- ref.num = ref.gen = -1;
- }
- if (obj2.isDict()) {
- scanFieldAppearances(obj2.getDict(), &ref, NULL, acroForm);
- }
- obj2.free();
- }
- }
- obj1.free();
-}
-
-void Annots::scanFieldAppearances(Dict *node, Ref *ref, Dict *parent,
- Dict *acroForm) {
- Annot *annot;
- Object obj1, obj2;
- Ref ref2;
- int i;
-
- // non-terminal node: scan the children
- if (node->lookup("Kids", &obj1)->isArray()) {
- for (i = 0; i < obj1.arrayGetLength(); ++i) {
- if (obj1.arrayGetNF(i, &obj2)->isRef()) {
- ref2 = obj2.getRef();
- obj2.free();
- obj1.arrayGet(i, &obj2);
- } else {
- ref2.num = ref2.gen = -1;
- }
- if (obj2.isDict()) {
- scanFieldAppearances(obj2.getDict(), &ref2, node, acroForm);
- }
- obj2.free();
- }
- obj1.free();
- return;
- }
- obj1.free();
-
- // terminal node: this is either a combined annot/field dict, or an
- // annot dict whose parent is a field
- if ((annot = findAnnot(ref))) {
- node->lookupNF("Parent", &obj1);
- if (!parent || !obj1.isNull()) {
- annot->generateFieldAppearance(node, node, acroForm);
- } else {
- annot->generateFieldAppearance(parent, node, acroForm);
- }
- obj1.free();
- }
-}
-
-Annot *Annots::findAnnot(Ref *ref) {
- int i;
-
- for (i = 0; i < nAnnots; ++i) {
- if (annots[i]->match(ref)) {
- return annots[i];
- }
- }
- return NULL;
-}
diff --git a/kpdf/xpdf/xpdf/Annot.cpp b/kpdf/xpdf/xpdf/Annot.cpp
new file mode 100644
index 00000000..10d3ce73
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Annot.cpp
@@ -0,0 +1,1556 @@
+//========================================================================
+//
+// Annot.cpp
+//
+// Copyright 2000-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <math.h>
+#include "gmem.h"
+#include "GList.h"
+#include "Error.h"
+#include "Object.h"
+#include "Catalog.h"
+#include "Gfx.h"
+#include "GfxFont.h"
+#include "Lexer.h"
+#include "Annot.h"
+
+//------------------------------------------------------------------------
+
+#define annotFlagHidden 0x0002
+#define annotFlagPrint 0x0004
+#define annotFlagNoView 0x0020
+
+#define fieldFlagReadOnly 0x00000001
+#define fieldFlagRequired 0x00000002
+#define fieldFlagNoExport 0x00000004
+#define fieldFlagMultiline 0x00001000
+#define fieldFlagPassword 0x00002000
+#define fieldFlagNoToggleToOff 0x00004000
+#define fieldFlagRadio 0x00008000
+#define fieldFlagPushbutton 0x00010000
+#define fieldFlagCombo 0x00020000
+#define fieldFlagEdit 0x00040000
+#define fieldFlagSort 0x00080000
+#define fieldFlagFileSelect 0x00100000
+#define fieldFlagMultiSelect 0x00200000
+#define fieldFlagDoNotSpellCheck 0x00400000
+#define fieldFlagDoNotScroll 0x00800000
+#define fieldFlagComb 0x01000000
+#define fieldFlagRichText 0x02000000
+#define fieldFlagRadiosInUnison 0x02000000
+#define fieldFlagCommitOnSelChange 0x04000000
+
+#define fieldQuadLeft 0
+#define fieldQuadCenter 1
+#define fieldQuadRight 2
+
+// distance of Bezier control point from center for circle approximation
+// = (4 * (sqrt(2) - 1) / 3) * r
+#define bezierCircle 0.55228475
+
+//------------------------------------------------------------------------
+// AnnotBorderStyle
+//------------------------------------------------------------------------
+
+AnnotBorderStyle::AnnotBorderStyle(AnnotBorderType typeA, double widthA,
+ double *dashA, int dashLengthA,
+ double rA, double gA, double bA) {
+ type = typeA;
+ width = widthA;
+ dash = dashA;
+ dashLength = dashLengthA;
+ r = rA;
+ g = gA;
+ b = bA;
+}
+
+AnnotBorderStyle::~AnnotBorderStyle() {
+ if (dash) {
+ gfree(dash);
+ }
+}
+
+//------------------------------------------------------------------------
+// Annot
+//------------------------------------------------------------------------
+
+Annot::Annot(XRef *xrefA, Dict * /*acroForm*/, Dict *dict, Ref *refA) {
+ Object apObj, asObj, obj1, obj2, obj3;
+ AnnotBorderType borderType;
+ double borderWidth;
+ double *borderDash;
+ int borderDashLength;
+ double borderR, borderG, borderB;
+ double t;
+ int i;
+
+ ok = gTrue;
+ xref = xrefA;
+ ref = *refA;
+ type = NULL;
+ appearBuf = NULL;
+ borderStyle = NULL;
+
+ //----- parse the type
+
+ if (dict->lookup("Subtype", &obj1)->isName()) {
+ type = new GString(obj1.getName());
+ }
+ obj1.free();
+
+ //----- parse the rectangle
+
+ if (dict->lookup("Rect", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 4) {
+ xMin = yMin = xMax = yMax = 0;
+ if (obj1.arrayGet(0, &obj2)->isNum()) {
+ xMin = obj2.getNum();
+ }
+ obj2.free();
+ if (obj1.arrayGet(1, &obj2)->isNum()) {
+ yMin = obj2.getNum();
+ }
+ obj2.free();
+ if (obj1.arrayGet(2, &obj2)->isNum()) {
+ xMax = obj2.getNum();
+ }
+ obj2.free();
+ if (obj1.arrayGet(3, &obj2)->isNum()) {
+ yMax = obj2.getNum();
+ }
+ obj2.free();
+ if (xMin > xMax) {
+ t = xMin; xMin = xMax; xMax = t;
+ }
+ if (yMin > yMax) {
+ t = yMin; yMin = yMax; yMax = t;
+ }
+ } else {
+ error(-1, "Bad bounding box for annotation");
+ ok = gFalse;
+ }
+ obj1.free();
+
+ //----- parse the flags
+
+ if (dict->lookup("F", &obj1)->isInt()) {
+ flags = obj1.getInt();
+ } else {
+ flags = 0;
+ }
+ obj1.free();
+
+ //----- parse the border style
+
+ borderType = annotBorderSolid;
+ borderWidth = 1;
+ borderDash = NULL;
+ borderDashLength = 0;
+ borderR = 0;
+ borderG = 0;
+ borderB = 1;
+ if (dict->lookup("BS", &obj1)->isDict()) {
+ if (obj1.dictLookup("S", &obj2)->isName()) {
+ if (obj2.isName("S")) {
+ borderType = annotBorderSolid;
+ } else if (obj2.isName("D")) {
+ borderType = annotBorderDashed;
+ } else if (obj2.isName("B")) {
+ borderType = annotBorderBeveled;
+ } else if (obj2.isName("I")) {
+ borderType = annotBorderInset;
+ } else if (obj2.isName("U")) {
+ borderType = annotBorderUnderlined;
+ }
+ }
+ obj2.free();
+ if (obj1.dictLookup("W", &obj2)->isNum()) {
+ borderWidth = obj2.getNum();
+ }
+ obj2.free();
+ if (obj1.dictLookup("D", &obj2)->isArray()) {
+ borderDashLength = obj2.arrayGetLength();
+ borderDash = (double *)gmallocn(borderDashLength, sizeof(double));
+ for (i = 0; i < borderDashLength; ++i) {
+ if (obj2.arrayGet(i, &obj3)->isNum()) {
+ borderDash[i] = obj3.getNum();
+ } else {
+ borderDash[i] = 1;
+ }
+ obj3.free();
+ }
+ }
+ obj2.free();
+ } else {
+ obj1.free();
+ if (dict->lookup("Border", &obj1)->isArray()) {
+ if (obj1.arrayGetLength() >= 3) {
+ if (obj1.arrayGet(2, &obj2)->isNum()) {
+ borderWidth = obj2.getNum();
+ }
+ obj2.free();
+ if (obj1.arrayGetLength() >= 4) {
+ if (obj1.arrayGet(3, &obj2)->isArray()) {
+ borderType = annotBorderDashed;
+ borderDashLength = obj2.arrayGetLength();
+ borderDash = (double *)gmallocn(borderDashLength, sizeof(double));
+ for (i = 0; i < borderDashLength; ++i) {
+ if (obj2.arrayGet(i, &obj3)->isNum()) {
+ borderDash[i] = obj3.getNum();
+ } else {
+ borderDash[i] = 1;
+ }
+ obj3.free();
+ }
+ } else {
+ // Adobe draws no border at all if the last element is of
+ // the wrong type.
+ borderWidth = 0;
+ }
+ obj2.free();
+ }
+ }
+ }
+ }
+ obj1.free();
+ if (dict->lookup("C", &obj1)->isArray() && obj1.arrayGetLength() == 3) {
+ if (obj1.arrayGet(0, &obj2)->isNum()) {
+ borderR = obj2.getNum();
+ }
+ obj1.free();
+ if (obj1.arrayGet(1, &obj2)->isNum()) {
+ borderG = obj2.getNum();
+ }
+ obj1.free();
+ if (obj1.arrayGet(2, &obj2)->isNum()) {
+ borderB = obj2.getNum();
+ }
+ obj1.free();
+ }
+ obj1.free();
+ borderStyle = new AnnotBorderStyle(borderType, borderWidth,
+ borderDash, borderDashLength,
+ borderR, borderG, borderB);
+
+ //----- get the annotation appearance
+
+ if (dict->lookup("AP", &apObj)->isDict()) {
+ if (dict->lookup("AS", &asObj)->isName()) {
+ if (apObj.dictLookup("N", &obj1)->isDict()) {
+ if (obj1.dictLookupNF(asObj.getName(), &obj2)->isRef()) {
+ obj2.copy(&appearance);
+ ok = gTrue;
+ } else {
+ obj2.free();
+ if (obj1.dictLookupNF("Off", &obj2)->isRef()) {
+ obj2.copy(&appearance);
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+ } else {
+ if (apObj.dictLookupNF("N", &obj1)->isRef()) {
+ obj1.copy(&appearance);
+ }
+ obj1.free();
+ }
+ asObj.free();
+ }
+ apObj.free();
+}
+
+Annot::~Annot() {
+ if (type) {
+ delete type;
+ }
+ appearance.free();
+ if (appearBuf) {
+ delete appearBuf;
+ }
+ if (borderStyle) {
+ delete borderStyle;
+ }
+}
+
+void Annot::generateFieldAppearance(Dict *field, Dict *annot, Dict *acroForm) {
+ Object mkObj, ftObj, appearDict, drObj, obj1, obj2, obj3;
+ Dict *mkDict;
+ MemStream *appearStream;
+ GfxFontDict *fontDict;
+ GBool hasCaption;
+ double w, dx, dy, r;
+ double *dash;
+ GString *caption, *da;
+ GString **text;
+ GBool *selection;
+ int dashLength, ff, quadding, comb, nOptions, topIdx, i, j;
+
+ // must be a Widget annotation
+ if (type->cmp("Widget")) {
+ return;
+ }
+
+ appearBuf = new GString();
+
+ // get the appearance characteristics (MK) dictionary
+ if (annot->lookup("MK", &mkObj)->isDict()) {
+ mkDict = mkObj.getDict();
+ } else {
+ mkDict = NULL;
+ }
+
+ // draw the background
+ if (mkDict) {
+ if (mkDict->lookup("BG", &obj1)->isArray() &&
+ obj1.arrayGetLength() > 0) {
+ setColor(obj1.getArray(), gTrue, 0);
+ appearBuf->appendf("0 0 {0:.2f} {1:.2f} re f\n",
+ xMax - xMin, yMax - yMin);
+ }
+ obj1.free();
+ }
+
+ // get the field type
+ fieldLookup(field, "FT", &ftObj);
+
+ // get the field flags (Ff) value
+ if (fieldLookup(field, "Ff", &obj1)->isInt()) {
+ ff = obj1.getInt();
+ } else {
+ ff = 0;
+ }
+ obj1.free();
+
+ // draw the border
+ if (mkDict) {
+ w = borderStyle->getWidth();
+ if (w > 0) {
+ mkDict->lookup("BC", &obj1);
+ if (!(obj1.isArray() && obj1.arrayGetLength() > 0)) {
+ mkDict->lookup("BG", &obj1);
+ }
+ if (obj1.isArray() && obj1.arrayGetLength() > 0) {
+ dx = xMax - xMin;
+ dy = yMax - yMin;
+
+ // radio buttons with no caption have a round border
+ hasCaption = mkDict->lookup("CA", &obj2)->isString();
+ obj2.free();
+ if (ftObj.isName("Btn") && (ff & fieldFlagRadio) && !hasCaption) {
+ r = 0.5 * (dx < dy ? dx : dy);
+ switch (borderStyle->getType()) {
+ case annotBorderDashed:
+ appearBuf->append("[");
+ borderStyle->getDash(&dash, &dashLength);
+ for (i = 0; i < dashLength; ++i) {
+ appearBuf->appendf(" {0:.2f}", dash[i]);
+ }
+ appearBuf->append("] 0 d\n");
+ // fall through to the solid case
+ case annotBorderSolid:
+ case annotBorderUnderlined:
+ appearBuf->appendf("{0:.2f} w\n", w);
+ setColor(obj1.getArray(), gFalse, 0);
+ drawCircle(0.5 * dx, 0.5 * dy, r - 0.5 * w, gFalse);
+ break;
+ case annotBorderBeveled:
+ case annotBorderInset:
+ appearBuf->appendf("{0:.2f} w\n", 0.5 * w);
+ setColor(obj1.getArray(), gFalse, 0);
+ drawCircle(0.5 * dx, 0.5 * dy, r - 0.25 * w, gFalse);
+ setColor(obj1.getArray(), gFalse,
+ borderStyle->getType() == annotBorderBeveled ? 1 : -1);
+ drawCircleTopLeft(0.5 * dx, 0.5 * dy, r - 0.75 * w);
+ setColor(obj1.getArray(), gFalse,
+ borderStyle->getType() == annotBorderBeveled ? -1 : 1);
+ drawCircleBottomRight(0.5 * dx, 0.5 * dy, r - 0.75 * w);
+ break;
+ }
+
+ } else {
+ switch (borderStyle->getType()) {
+ case annotBorderDashed:
+ appearBuf->append("[");
+ borderStyle->getDash(&dash, &dashLength);
+ for (i = 0; i < dashLength; ++i) {
+ appearBuf->appendf(" {0:.2f}", dash[i]);
+ }
+ appearBuf->append("] 0 d\n");
+ // fall through to the solid case
+ case annotBorderSolid:
+ appearBuf->appendf("{0:.2f} w\n", w);
+ setColor(obj1.getArray(), gFalse, 0);
+ appearBuf->appendf("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re s\n",
+ 0.5 * w, dx - w, dy - w);
+ break;
+ case annotBorderBeveled:
+ case annotBorderInset:
+ setColor(obj1.getArray(), gTrue,
+ borderStyle->getType() == annotBorderBeveled ? 1 : -1);
+ appearBuf->append("0 0 m\n");
+ appearBuf->appendf("0 {0:.2f} l\n", dy);
+ appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx, dy);
+ appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx - w, dy - w);
+ appearBuf->appendf("{0:.2f} {1:.2f} l\n", w, dy - w);
+ appearBuf->appendf("{0:.2f} {0:.2f} l\n", w);
+ appearBuf->append("f\n");
+ setColor(obj1.getArray(), gTrue,
+ borderStyle->getType() == annotBorderBeveled ? -1 : 1);
+ appearBuf->append("0 0 m\n");
+ appearBuf->appendf("{0:.2f} 0 l\n", dx);
+ appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx, dy);
+ appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx - w, dy - w);
+ appearBuf->appendf("{0:.2f} {1:.2f} l\n", dx - w, w);
+ appearBuf->appendf("{0:.2f} {0:.2f} l\n", w);
+ appearBuf->append("f\n");
+ break;
+ case annotBorderUnderlined:
+ appearBuf->appendf("{0:.2f} w\n", w);
+ setColor(obj1.getArray(), gFalse, 0);
+ appearBuf->appendf("0 0 m {0:.2f} 0 l s\n", dx);
+ break;
+ }
+
+ // clip to the inside of the border
+ appearBuf->appendf("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re W n\n",
+ w, dx - 2 * w, dy - 2 * w);
+ }
+ }
+ obj1.free();
+ }
+ }
+
+ // get the resource dictionary
+ acroForm->lookup("DR", &drObj);
+
+ // build the font dictionary
+ if (drObj.isDict() && drObj.dictLookup("Font", &obj1)->isDict()) {
+ fontDict = new GfxFontDict(xref, NULL, obj1.getDict());
+ } else {
+ fontDict = NULL;
+ }
+ obj1.free();
+
+ // get the default appearance string
+ if (fieldLookup(field, "DA", &obj1)->isNull()) {
+ obj1.free();
+ acroForm->lookup("DA", &obj1);
+ }
+ if (obj1.isString()) {
+ da = obj1.getString()->copy();
+ } else {
+ da = NULL;
+ }
+ obj1.free();
+
+ // draw the field contents
+ if (ftObj.isName("Btn")) {
+ caption = NULL;
+ if (mkDict) {
+ if (mkDict->lookup("CA", &obj1)->isString()) {
+ caption = obj1.getString()->copy();
+ }
+ obj1.free();
+ }
+ // radio button
+ if (ff & fieldFlagRadio) {
+ //~ Acrobat doesn't draw a caption if there is no AP dict (?)
+ if (fieldLookup(field, "V", &obj1)->isName()) {
+ if (annot->lookup("AS", &obj2)->isName(obj1.getName())) {
+ if (caption) {
+ drawText(caption, da, fontDict, gFalse, 0, fieldQuadCenter,
+ gFalse, gTrue);
+ } else {
+ if (mkDict) {
+ if (mkDict->lookup("BC", &obj3)->isArray() &&
+ obj3.arrayGetLength() > 0) {
+ dx = xMax - xMin;
+ dy = yMax - yMin;
+ setColor(obj3.getArray(), gTrue, 0);
+ drawCircle(0.5 * dx, 0.5 * dy, 0.2 * (dx < dy ? dx : dy),
+ gTrue);
+ }
+ obj3.free();
+ }
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+ // pushbutton
+ } else if (ff & fieldFlagPushbutton) {
+ if (caption) {
+ drawText(caption, da, fontDict, gFalse, 0, fieldQuadCenter,
+ gFalse, gFalse);
+ }
+ // checkbox
+ } else {
+ // According to the PDF spec the off state must be named "Off",
+ // and the on state can be named anything, but Acrobat apparently
+ // looks for "Yes" and treats anything else as off.
+ if (fieldLookup(field, "V", &obj1)->isName("Yes")) {
+ if (!caption) {
+ caption = new GString("3"); // ZapfDingbats checkmark
+ }
+ drawText(caption, da, fontDict, gFalse, 0, fieldQuadCenter,
+ gFalse, gTrue);
+ }
+ obj1.free();
+ }
+ if (caption) {
+ delete caption;
+ }
+ } else if (ftObj.isName("Tx")) {
+ //~ value strings can be Unicode
+ if (fieldLookup(field, "V", &obj1)->isString()) {
+ if (fieldLookup(field, "Q", &obj2)->isInt()) {
+ quadding = obj2.getInt();
+ } else {
+ quadding = fieldQuadLeft;
+ }
+ obj2.free();
+ comb = 0;
+ if (ff & fieldFlagComb) {
+ if (fieldLookup(field, "MaxLen", &obj2)->isInt()) {
+ comb = obj2.getInt();
+ }
+ obj2.free();
+ }
+ drawText(obj1.getString(), da, fontDict,
+ ff & fieldFlagMultiline, comb, quadding, gTrue, gFalse);
+ }
+ obj1.free();
+ } else if (ftObj.isName("Ch")) {
+ //~ value/option strings can be Unicode
+ if (fieldLookup(field, "Q", &obj1)->isInt()) {
+ quadding = obj1.getInt();
+ } else {
+ quadding = fieldQuadLeft;
+ }
+ obj1.free();
+ // combo box
+ if (ff & fieldFlagCombo) {
+ if (fieldLookup(field, "V", &obj1)->isString()) {
+ drawText(obj1.getString(), da, fontDict,
+ gFalse, 0, quadding, gTrue, gFalse);
+ //~ Acrobat draws a popup icon on the right side
+ }
+ obj1.free();
+ // list box
+ } else {
+ if (field->lookup("Opt", &obj1)->isArray()) {
+ nOptions = obj1.arrayGetLength();
+ // get the option text
+ text = (GString **)gmallocn(nOptions, sizeof(GString *));
+ for (i = 0; i < nOptions; ++i) {
+ text[i] = NULL;
+ obj1.arrayGet(i, &obj2);
+ if (obj2.isString()) {
+ text[i] = obj2.getString()->copy();
+ } else if (obj2.isArray() && obj2.arrayGetLength() == 2) {
+ if (obj2.arrayGet(1, &obj3)->isString()) {
+ text[i] = obj3.getString()->copy();
+ }
+ obj3.free();
+ }
+ obj2.free();
+ if (!text[i]) {
+ text[i] = new GString();
+ }
+ }
+ // get the selected option(s)
+ selection = (GBool *)gmallocn(nOptions, sizeof(GBool));
+ //~ need to use the I field in addition to the V field
+ fieldLookup(field, "V", &obj2);
+ for (i = 0; i < nOptions; ++i) {
+ selection[i] = gFalse;
+ if (obj2.isString()) {
+ if (!obj2.getString()->cmp(text[i])) {
+ selection[i] = gTrue;
+ }
+ } else if (obj2.isArray()) {
+ for (j = 0; j < obj2.arrayGetLength(); ++j) {
+ if (obj2.arrayGet(j, &obj3)->isString() &&
+ !obj3.getString()->cmp(text[i])) {
+ selection[i] = gTrue;
+ }
+ obj3.free();
+ }
+ }
+ }
+ obj2.free();
+ // get the top index
+ if (field->lookup("TI", &obj2)->isInt()) {
+ topIdx = obj2.getInt();
+ } else {
+ topIdx = 0;
+ }
+ obj2.free();
+ // draw the text
+ drawListBox(text, selection, nOptions, topIdx, da, fontDict, quadding);
+ for (i = 0; i < nOptions; ++i) {
+ delete text[i];
+ }
+ gfree(text);
+ gfree(selection);
+ }
+ obj1.free();
+ }
+ } else if (ftObj.isName("Sig")) {
+ //~unimp
+ } else {
+ error(-1, "Unknown field type");
+ }
+
+ if (da) {
+ delete da;
+ }
+
+ // build the appearance stream dictionary
+ appearDict.initDict(xref);
+ appearDict.dictAdd(copyString("Length"),
+ obj1.initInt(appearBuf->getLength()));
+ appearDict.dictAdd(copyString("Subtype"), obj1.initName("Form"));
+ obj1.initArray(xref);
+ obj1.arrayAdd(obj2.initReal(0));
+ obj1.arrayAdd(obj2.initReal(0));
+ obj1.arrayAdd(obj2.initReal(xMax - xMin));
+ obj1.arrayAdd(obj2.initReal(yMax - yMin));
+ appearDict.dictAdd(copyString("BBox"), &obj1);
+
+ // set the resource dictionary
+ if (drObj.isDict()) {
+ appearDict.dictAdd(copyString("Resources"), drObj.copy(&obj1));
+ }
+ drObj.free();
+
+ // build the appearance stream
+ appearStream = new MemStream(appearBuf->getCString(), 0,
+ appearBuf->getLength(), &appearDict);
+ appearance.free();
+ appearance.initStream(appearStream);
+
+ if (fontDict) {
+ delete fontDict;
+ }
+ ftObj.free();
+ mkObj.free();
+}
+
+// Set the current fill or stroke color, based on <a> (which should
+// have 1, 3, or 4 elements). If <adjust> is +1, color is brightened;
+// if <adjust> is -1, color is darkened; otherwise color is not
+// modified.
+void Annot::setColor(Array *a, GBool fill, int adjust) {
+ Object obj1;
+ double color[4];
+ int nComps, i;
+
+ nComps = a->getLength();
+ if (nComps > 4) {
+ nComps = 4;
+ }
+ for (i = 0; i < nComps && i < 4; ++i) {
+ if (a->get(i, &obj1)->isNum()) {
+ color[i] = obj1.getNum();
+ } else {
+ color[i] = 0;
+ }
+ obj1.free();
+ }
+ if (nComps == 4) {
+ adjust = -adjust;
+ }
+ if (adjust > 0) {
+ for (i = 0; i < nComps; ++i) {
+ color[i] = 0.5 * color[i] + 0.5;
+ }
+ } else if (adjust < 0) {
+ for (i = 0; i < nComps; ++i) {
+ color[i] = 0.5 * color[i];
+ }
+ }
+ if (nComps == 4) {
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:c}\n",
+ color[0], color[1], color[2], color[3],
+ fill ? 'k' : 'K');
+ } else if (nComps == 3) {
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:s}\n",
+ color[0], color[1], color[2],
+ fill ? "rg" : "RG");
+ } else {
+ appearBuf->appendf("{0:.2f} {1:c}\n",
+ color[0],
+ fill ? 'g' : 'G');
+ }
+}
+
+// Draw the variable text or caption for a field.
+void Annot::drawText(GString *text, GString *da, GfxFontDict *fontDict,
+ GBool multiline, int comb, int quadding,
+ GBool txField, GBool forceZapfDingbats) {
+ GList *daToks;
+ GString *tok;
+ GfxFont *font;
+ double fontSize, fontSize2, border, x, xPrev, y, w, w2, wMax;
+ int tfPos, tmPos, i, j, k, c;
+
+ //~ if there is no MK entry, this should use the existing content stream,
+ //~ and only replace the marked content portion of it
+ //~ (this is only relevant for Tx fields)
+
+ // parse the default appearance string
+ tfPos = tmPos = -1;
+ if (da) {
+ daToks = new GList();
+ i = 0;
+ while (i < da->getLength()) {
+ while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
+ ++i;
+ }
+ if (i < da->getLength()) {
+ for (j = i + 1;
+ j < da->getLength() && !Lexer::isSpace(da->getChar(j));
+ ++j) ;
+ daToks->append(new GString(da, i, j - i));
+ i = j;
+ }
+ }
+ for (i = 2; i < daToks->getLength(); ++i) {
+ if (i >= 2 && !((GString *)daToks->get(i))->cmp("Tf")) {
+ tfPos = i - 2;
+ } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
+ tmPos = i - 6;
+ }
+ }
+ } else {
+ daToks = NULL;
+ }
+
+ // force ZapfDingbats
+ //~ this should create the font if needed (?)
+ if (forceZapfDingbats) {
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos);
+ if (tok->cmp("/ZaDb")) {
+ tok->clear();
+ tok->append("/ZaDb");
+ }
+ }
+ }
+
+ // get the font and font size
+ font = NULL;
+ fontSize = 0;
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos);
+ if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
+ if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
+ error(-1, "Unknown font in field's DA string");
+ }
+ } else {
+ error(-1, "Invalid font name in 'Tf' operator in field's DA string");
+ }
+ tok = (GString *)daToks->get(tfPos + 1);
+ fontSize = atof(tok->getCString());
+ } else {
+ error(-1, "Missing 'Tf' operator in field's DA string");
+ }
+
+ // get the border width
+ border = borderStyle->getWidth();
+
+ // setup
+ if (txField) {
+ appearBuf->append("/Tx BMC\n");
+ }
+ appearBuf->append("q\n");
+ appearBuf->append("BT\n");
+
+ // multi-line text
+ if (multiline) {
+ // note: the comb flag is ignored in multiline mode
+
+ wMax = xMax - xMin - 2 * border - 4;
+
+ // compute font autosize
+ if (fontSize == 0) {
+ for (fontSize = 20; fontSize > 1; --fontSize) {
+ y = yMax - yMin;
+ w2 = 0;
+ i = 0;
+ while (i < text->getLength()) {
+ getNextLine(text, i, font, fontSize, wMax, &j, &w, &k);
+ if (w > w2) {
+ w2 = w;
+ }
+ i = k;
+ y -= fontSize;
+ }
+ // approximate the descender for the last line
+ if (y >= 0.33 * fontSize) {
+ break;
+ }
+ }
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos + 1);
+ tok->clear();
+ tok->appendf("{0:.2f}", fontSize);
+ }
+ }
+
+ // starting y coordinate
+ // (note: each line of text starts with a Td operator that moves
+ // down a line)
+ y = yMax - yMin;
+
+ // set the font matrix
+ if (tmPos >= 0) {
+ tok = (GString *)daToks->get(tmPos + 4);
+ tok->clear();
+ tok->append('0');
+ tok = (GString *)daToks->get(tmPos + 5);
+ tok->clear();
+ tok->appendf("{0:.2f}", y);
+ }
+
+ // write the DA string
+ if (daToks) {
+ for (i = 0; i < daToks->getLength(); ++i) {
+ appearBuf->append((GString *)daToks->get(i))->append(' ');
+ }
+ }
+
+ // write the font matrix (if not part of the DA string)
+ if (tmPos < 0) {
+ appearBuf->appendf("1 0 0 1 0 {0:.2f} Tm\n", y);
+ }
+
+ // write a series of lines of text
+ i = 0;
+ xPrev = 0;
+ while (i < text->getLength()) {
+
+ getNextLine(text, i, font, fontSize, wMax, &j, &w, &k);
+
+ // compute text start position
+ switch (quadding) {
+ case fieldQuadLeft:
+ default:
+ x = border + 2;
+ break;
+ case fieldQuadCenter:
+ x = (xMax - xMin - w) / 2;
+ break;
+ case fieldQuadRight:
+ x = xMax - xMin - border - 2 - w;
+ break;
+ }
+
+ // draw the line
+ appearBuf->appendf("{0:.2f} {1:.2f} Td\n", x - xPrev, -fontSize);
+ appearBuf->append('(');
+ for (; i < j; ++i) {
+ c = text->getChar(i) & 0xff;
+ if (c == '(' || c == ')' || c == '\\') {
+ appearBuf->append('\\');
+ appearBuf->append(c);
+ } else if (c < 0x20 || c >= 0x80) {
+ appearBuf->appendf("\\{0:03o}", c);
+ } else {
+ appearBuf->append(c);
+ }
+ }
+ appearBuf->append(") Tj\n");
+
+ // next line
+ i = k;
+ xPrev = x;
+ }
+
+ // single-line text
+ } else {
+ //~ replace newlines with spaces? - what does Acrobat do?
+
+ // comb formatting
+ if (comb > 0) {
+
+ // compute comb spacing
+ w = (xMax - xMin - 2 * border) / comb;
+
+ // compute font autosize
+ if (fontSize == 0) {
+ fontSize = yMax - yMin - 2 * border;
+ if (w < fontSize) {
+ fontSize = w;
+ }
+ fontSize = floor(fontSize);
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos + 1);
+ tok->clear();
+ tok->appendf("{0:.2f}", fontSize);
+ }
+ }
+
+ // compute text start position
+ switch (quadding) {
+ case fieldQuadLeft:
+ default:
+ x = border + 2;
+ break;
+ case fieldQuadCenter:
+ x = border + 2 + 0.5 * (comb - text->getLength()) * w;
+ break;
+ case fieldQuadRight:
+ x = border + 2 + (comb - text->getLength()) * w;
+ break;
+ }
+ y = 0.5 * (yMax - yMin) - 0.4 * fontSize;
+
+ // set the font matrix
+ if (tmPos >= 0) {
+ tok = (GString *)daToks->get(tmPos + 4);
+ tok->clear();
+ tok->appendf("{0:.2f}", x);
+ tok = (GString *)daToks->get(tmPos + 5);
+ tok->clear();
+ tok->appendf("{0:.2f}", y);
+ }
+
+ // write the DA string
+ if (daToks) {
+ for (i = 0; i < daToks->getLength(); ++i) {
+ appearBuf->append((GString *)daToks->get(i))->append(' ');
+ }
+ }
+
+ // write the font matrix (if not part of the DA string)
+ if (tmPos < 0) {
+ appearBuf->appendf("1 0 0 1 {0:.2f} {1:.2f} Tm\n", x, y);
+ }
+
+ // write the text string
+ //~ this should center (instead of left-justify) each character within
+ //~ its comb cell
+ for (i = 0; i < text->getLength(); ++i) {
+ if (i > 0) {
+ appearBuf->appendf("{0:.2f} 0 Td\n", w);
+ }
+ appearBuf->append('(');
+ c = text->getChar(i) & 0xff;
+ if (c == '(' || c == ')' || c == '\\') {
+ appearBuf->append('\\');
+ appearBuf->append(c);
+ } else if (c < 0x20 || c >= 0x80) {
+ appearBuf->appendf("{0:.2f} 0 Td\n", w);
+ } else {
+ appearBuf->append(c);
+ }
+ appearBuf->append(") Tj\n");
+ }
+
+ // regular (non-comb) formatting
+ } else {
+
+ // compute string width
+ if (font && !font->isCIDFont()) {
+ w = 0;
+ for (i = 0; i < text->getLength(); ++i) {
+ w += ((Gfx8BitFont *)font)->getWidth(text->getChar(i));
+ }
+ } else {
+ // otherwise, make a crude estimate
+ w = text->getLength() * 0.5;
+ }
+
+ // compute font autosize
+ if (fontSize == 0) {
+ fontSize = yMax - yMin - 2 * border;
+ fontSize2 = (xMax - xMin - 4 - 2 * border) / w;
+ if (fontSize2 < fontSize) {
+ fontSize = fontSize2;
+ }
+ fontSize = floor(fontSize);
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos + 1);
+ tok->clear();
+ tok->appendf("{0:.2f}", fontSize);
+ }
+ }
+
+ // compute text start position
+ w *= fontSize;
+ switch (quadding) {
+ case fieldQuadLeft:
+ default:
+ x = border + 2;
+ break;
+ case fieldQuadCenter:
+ x = (xMax - xMin - w) / 2;
+ break;
+ case fieldQuadRight:
+ x = xMax - xMin - border - 2 - w;
+ break;
+ }
+ y = 0.5 * (yMax - yMin) - 0.4 * fontSize;
+
+ // set the font matrix
+ if (tmPos >= 0) {
+ tok = (GString *)daToks->get(tmPos + 4);
+ tok->clear();
+ tok->appendf("{0:.2f}", x);
+ tok = (GString *)daToks->get(tmPos + 5);
+ tok->clear();
+ tok->appendf("{0:.2f}", y);
+ }
+
+ // write the DA string
+ if (daToks) {
+ for (i = 0; i < daToks->getLength(); ++i) {
+ appearBuf->append((GString *)daToks->get(i))->append(' ');
+ }
+ }
+
+ // write the font matrix (if not part of the DA string)
+ if (tmPos < 0) {
+ appearBuf->appendf("1 0 0 1 {0:.2f} {1:.2f} Tm\n", x, y);
+ }
+
+ // write the text string
+ appearBuf->append('(');
+ for (i = 0; i < text->getLength(); ++i) {
+ c = text->getChar(i) & 0xff;
+ if (c == '(' || c == ')' || c == '\\') {
+ appearBuf->append('\\');
+ appearBuf->append(c);
+ } else if (c < 0x20 || c >= 0x80) {
+ appearBuf->appendf("\\{0:03o}", c);
+ } else {
+ appearBuf->append(c);
+ }
+ }
+ appearBuf->append(") Tj\n");
+ }
+ }
+
+ // cleanup
+ appearBuf->append("ET\n");
+ appearBuf->append("Q\n");
+ if (txField) {
+ appearBuf->append("EMC\n");
+ }
+
+ if (daToks) {
+ deleteGList(daToks, GString);
+ }
+}
+
+// Draw the variable text or caption for a field.
+void Annot::drawListBox(GString **text, GBool *selection,
+ int nOptions, int topIdx,
+ GString *da, GfxFontDict *fontDict, GBool quadding) {
+ GList *daToks;
+ GString *tok;
+ GfxFont *font;
+ double fontSize, fontSize2, border, x, y, w, wMax;
+ int tfPos, tmPos, i, j, c;
+
+ //~ if there is no MK entry, this should use the existing content stream,
+ //~ and only replace the marked content portion of it
+ //~ (this is only relevant for Tx fields)
+
+ // parse the default appearance string
+ tfPos = tmPos = -1;
+ if (da) {
+ daToks = new GList();
+ i = 0;
+ while (i < da->getLength()) {
+ while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
+ ++i;
+ }
+ if (i < da->getLength()) {
+ for (j = i + 1;
+ j < da->getLength() && !Lexer::isSpace(da->getChar(j));
+ ++j) ;
+ daToks->append(new GString(da, i, j - i));
+ i = j;
+ }
+ }
+ for (i = 2; i < daToks->getLength(); ++i) {
+ if (i >= 2 && !((GString *)daToks->get(i))->cmp("Tf")) {
+ tfPos = i - 2;
+ } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
+ tmPos = i - 6;
+ }
+ }
+ } else {
+ daToks = NULL;
+ }
+
+ // get the font and font size
+ font = NULL;
+ fontSize = 0;
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos);
+ if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
+ if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
+ error(-1, "Unknown font in field's DA string");
+ }
+ } else {
+ error(-1, "Invalid font name in 'Tf' operator in field's DA string");
+ }
+ tok = (GString *)daToks->get(tfPos + 1);
+ fontSize = atof(tok->getCString());
+ } else {
+ error(-1, "Missing 'Tf' operator in field's DA string");
+ }
+
+ // get the border width
+ border = borderStyle->getWidth();
+
+ // compute font autosize
+ if (fontSize == 0) {
+ wMax = 0;
+ for (i = 0; i < nOptions; ++i) {
+ if (font && !font->isCIDFont()) {
+ w = 0;
+ for (j = 0; j < text[i]->getLength(); ++j) {
+ w += ((Gfx8BitFont *)font)->getWidth(text[i]->getChar(j));
+ }
+ } else {
+ // otherwise, make a crude estimate
+ w = text[i]->getLength() * 0.5;
+ }
+ if (w > wMax) {
+ wMax = w;
+ }
+ }
+ fontSize = yMax - yMin - 2 * border;
+ fontSize2 = (xMax - xMin - 4 - 2 * border) / wMax;
+ if (fontSize2 < fontSize) {
+ fontSize = fontSize2;
+ }
+ fontSize = floor(fontSize);
+ if (tfPos >= 0) {
+ tok = (GString *)daToks->get(tfPos + 1);
+ tok->clear();
+ tok->appendf("{0:.2f}", fontSize);
+ }
+ }
+
+ // draw the text
+ y = yMax - yMin - 1.1 * fontSize;
+ for (i = topIdx; i < nOptions; ++i) {
+
+ // setup
+ appearBuf->append("q\n");
+
+ // draw the background if selected
+ if (selection[i]) {
+ appearBuf->append("0 g f\n");
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} re f\n",
+ border,
+ y - 0.2 * fontSize,
+ xMax - xMin - 2 * border,
+ 1.1 * fontSize);
+ }
+
+ // setup
+ appearBuf->append("BT\n");
+
+ // compute string width
+ if (font && !font->isCIDFont()) {
+ w = 0;
+ for (j = 0; j < text[i]->getLength(); ++j) {
+ w += ((Gfx8BitFont *)font)->getWidth(text[i]->getChar(j));
+ }
+ } else {
+ // otherwise, make a crude estimate
+ w = text[i]->getLength() * 0.5;
+ }
+
+ // compute text start position
+ w *= fontSize;
+ switch (quadding) {
+ case fieldQuadLeft:
+ default:
+ x = border + 2;
+ break;
+ case fieldQuadCenter:
+ x = (xMax - xMin - w) / 2;
+ break;
+ case fieldQuadRight:
+ x = xMax - xMin - border - 2 - w;
+ break;
+ }
+
+ // set the font matrix
+ if (tmPos >= 0) {
+ tok = (GString *)daToks->get(tmPos + 4);
+ tok->clear();
+ tok->appendf("{0:.2f}", x);
+ tok = (GString *)daToks->get(tmPos + 5);
+ tok->clear();
+ tok->appendf("{0:.2f}", y);
+ }
+
+ // write the DA string
+ if (daToks) {
+ for (j = 0; j < daToks->getLength(); ++j) {
+ appearBuf->append((GString *)daToks->get(j))->append(' ');
+ }
+ }
+
+ // write the font matrix (if not part of the DA string)
+ if (tmPos < 0) {
+ appearBuf->appendf("1 0 0 1 {0:.2f} {1:.2f} Tm\n", x, y);
+ }
+
+ // change the text color if selected
+ if (selection[i]) {
+ appearBuf->append("1 g\n");
+ }
+
+ // write the text string
+ appearBuf->append('(');
+ for (j = 0; j < text[i]->getLength(); ++j) {
+ c = text[i]->getChar(j) & 0xff;
+ if (c == '(' || c == ')' || c == '\\') {
+ appearBuf->append('\\');
+ appearBuf->append(c);
+ } else if (c < 0x20 || c >= 0x80) {
+ appearBuf->appendf("\\{0:03o}", c);
+ } else {
+ appearBuf->append(c);
+ }
+ }
+ appearBuf->append(") Tj\n");
+
+ // cleanup
+ appearBuf->append("ET\n");
+ appearBuf->append("Q\n");
+
+ // next line
+ y -= 1.1 * fontSize;
+ }
+
+ if (daToks) {
+ deleteGList(daToks, GString);
+ }
+}
+
+// Figure out how much text will fit on the next line. Returns:
+// *end = one past the last character to be included
+// *width = width of the characters start .. end-1
+// *next = index of first character on the following line
+void Annot::getNextLine(GString *text, int start,
+ GfxFont *font, double fontSize, double wMax,
+ int *end, double *width, int *next) {
+ double w, dw;
+ int j, k, c;
+
+ // figure out how much text will fit on the line
+ //~ what does Adobe do with tabs?
+ w = 0;
+ for (j = start; j < text->getLength() && w <= wMax; ++j) {
+ c = text->getChar(j) & 0xff;
+ if (c == 0x0a || c == 0x0d) {
+ break;
+ }
+ if (font && !font->isCIDFont()) {
+ dw = ((Gfx8BitFont *)font)->getWidth(c) * fontSize;
+ } else {
+ // otherwise, make a crude estimate
+ dw = 0.5 * fontSize;
+ }
+ w += dw;
+ }
+ if (w > wMax) {
+ for (k = j; k > start && text->getChar(k-1) != ' '; --k) ;
+ for (; k > start && text->getChar(k-1) == ' '; --k) ;
+ if (k > start) {
+ j = k;
+ }
+ if (j == start) {
+ // handle the pathological case where the first character is
+ // too wide to fit on the line all by itself
+ j = start + 1;
+ }
+ }
+ *end = j;
+
+ // compute the width
+ w = 0;
+ for (k = start; k < j; ++k) {
+ if (font && !font->isCIDFont()) {
+ dw = ((Gfx8BitFont *)font)->getWidth(text->getChar(k)) * fontSize;
+ } else {
+ // otherwise, make a crude estimate
+ dw = 0.5 * fontSize;
+ }
+ w += dw;
+ }
+ *width = w;
+
+ // next line
+ while (j < text->getLength() && text->getChar(j) == ' ') {
+ ++j;
+ }
+ if (j < text->getLength() && text->getChar(j) == 0x0d) {
+ ++j;
+ }
+ if (j < text->getLength() && text->getChar(j) == 0x0a) {
+ ++j;
+ }
+ *next = j;
+}
+
+// Draw an (approximate) circle of radius <r> centered at (<cx>, <cy>).
+// If <fill> is true, the circle is filled; otherwise it is stroked.
+void Annot::drawCircle(double cx, double cy, double r, GBool fill) {
+ appearBuf->appendf("{0:.2f} {1:.2f} m\n",
+ cx + r, cy);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx + r, cy + bezierCircle * r,
+ cx + bezierCircle * r, cy + r,
+ cx, cy + r);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx - bezierCircle * r, cy + r,
+ cx - r, cy + bezierCircle * r,
+ cx - r, cy);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx - r, cy - bezierCircle * r,
+ cx - bezierCircle * r, cy - r,
+ cx, cy - r);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx + bezierCircle * r, cy - r,
+ cx + r, cy - bezierCircle * r,
+ cx + r, cy);
+ appearBuf->append(fill ? "f\n" : "s\n");
+}
+
+// Draw the top-left half of an (approximate) circle of radius <r>
+// centered at (<cx>, <cy>).
+void Annot::drawCircleTopLeft(double cx, double cy, double r) {
+ double r2;
+
+ r2 = r / sqrt(2.0);
+ appearBuf->appendf("{0:.2f} {1:.2f} m\n",
+ cx + r2, cy + r2);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx + (1 - bezierCircle) * r2,
+ cy + (1 + bezierCircle) * r2,
+ cx - (1 - bezierCircle) * r2,
+ cy + (1 + bezierCircle) * r2,
+ cx - r2,
+ cy + r2);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx - (1 + bezierCircle) * r2,
+ cy + (1 - bezierCircle) * r2,
+ cx - (1 + bezierCircle) * r2,
+ cy - (1 - bezierCircle) * r2,
+ cx - r2,
+ cy - r2);
+ appearBuf->append("S\n");
+}
+
+// Draw the bottom-right half of an (approximate) circle of radius <r>
+// centered at (<cx>, <cy>).
+void Annot::drawCircleBottomRight(double cx, double cy, double r) {
+ double r2;
+
+ r2 = r / sqrt(2.0);
+ appearBuf->appendf("{0:.2f} {1:.2f} m\n",
+ cx - r2, cy - r2);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx - (1 - bezierCircle) * r2,
+ cy - (1 + bezierCircle) * r2,
+ cx + (1 - bezierCircle) * r2,
+ cy - (1 + bezierCircle) * r2,
+ cx + r2,
+ cy - r2);
+ appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:.2f} {5:.2f} c\n",
+ cx + (1 + bezierCircle) * r2,
+ cy - (1 - bezierCircle) * r2,
+ cx + (1 + bezierCircle) * r2,
+ cy + (1 - bezierCircle) * r2,
+ cx + r2,
+ cy + r2);
+ appearBuf->append("S\n");
+}
+
+// Look up an inheritable field dictionary entry.
+Object *Annot::fieldLookup(Dict *field, char *key, Object *obj) {
+ Dict *dict;
+ Object parent;
+
+ dict = field;
+ if (!dict->lookup(key, obj)->isNull()) {
+ return obj;
+ }
+ obj->free();
+ if (dict->lookup("Parent", &parent)->isDict()) {
+ fieldLookup(parent.getDict(), key, obj);
+ } else {
+ obj->initNull();
+ }
+ parent.free();
+ return obj;
+}
+
+void Annot::draw(Gfx *gfx, GBool printing) {
+ Object obj;
+ GBool isLink;
+
+ // check the flags
+ if ((flags & annotFlagHidden) ||
+ (printing && !(flags & annotFlagPrint)) ||
+ (!printing && (flags & annotFlagNoView))) {
+ return;
+ }
+
+ // draw the appearance stream
+ isLink = type && !type->cmp("Link");
+ appearance.fetch(xref, &obj);
+ gfx->drawAnnot(&obj, isLink ? borderStyle : (AnnotBorderStyle *)NULL,
+ xMin, yMin, xMax, yMax);
+ obj.free();
+}
+
+//------------------------------------------------------------------------
+// Annots
+//------------------------------------------------------------------------
+
+Annots::Annots(XRef *xref, Catalog *catalog, Object *annotsObj) {
+ Dict *acroForm;
+ Annot *annot;
+ Object obj1;
+ Ref ref;
+ int size;
+ int i;
+
+ annots = NULL;
+ size = 0;
+ nAnnots = 0;
+
+ acroForm = catalog->getAcroForm()->isDict() ?
+ catalog->getAcroForm()->getDict() : NULL;
+ if (annotsObj->isArray()) {
+ for (i = 0; i < annotsObj->arrayGetLength(); ++i) {
+ if (annotsObj->arrayGetNF(i, &obj1)->isRef()) {
+ ref = obj1.getRef();
+ obj1.free();
+ annotsObj->arrayGet(i, &obj1);
+ } else {
+ ref.num = ref.gen = -1;
+ }
+ if (obj1.isDict()) {
+ annot = new Annot(xref, acroForm, obj1.getDict(), &ref);
+ if (annot->isOk()) {
+ if (nAnnots >= size) {
+ size += 16;
+ annots = (Annot **)greallocn(annots, size, sizeof(Annot *));
+ }
+ annots[nAnnots++] = annot;
+ } else {
+ delete annot;
+ }
+ }
+ obj1.free();
+ }
+ }
+}
+
+Annots::~Annots() {
+ int i;
+
+ for (i = 0; i < nAnnots; ++i) {
+ delete annots[i];
+ }
+ gfree(annots);
+}
+
+void Annots::generateAppearances(Dict *acroForm) {
+ Object obj1, obj2;
+ Ref ref;
+ int i;
+
+ if (acroForm->lookup("Fields", &obj1)->isArray()) {
+ for (i = 0; i < obj1.arrayGetLength(); ++i) {
+ if (obj1.arrayGetNF(i, &obj2)->isRef()) {
+ ref = obj2.getRef();
+ obj2.free();
+ obj1.arrayGet(i, &obj2);
+ } else {
+ ref.num = ref.gen = -1;
+ }
+ if (obj2.isDict()) {
+ scanFieldAppearances(obj2.getDict(), &ref, NULL, acroForm);
+ }
+ obj2.free();
+ }
+ }
+ obj1.free();
+}
+
+void Annots::scanFieldAppearances(Dict *node, Ref *ref, Dict *parent,
+ Dict *acroForm) {
+ Annot *annot;
+ Object obj1, obj2;
+ Ref ref2;
+ int i;
+
+ // non-terminal node: scan the children
+ if (node->lookup("Kids", &obj1)->isArray()) {
+ for (i = 0; i < obj1.arrayGetLength(); ++i) {
+ if (obj1.arrayGetNF(i, &obj2)->isRef()) {
+ ref2 = obj2.getRef();
+ obj2.free();
+ obj1.arrayGet(i, &obj2);
+ } else {
+ ref2.num = ref2.gen = -1;
+ }
+ if (obj2.isDict()) {
+ scanFieldAppearances(obj2.getDict(), &ref2, node, acroForm);
+ }
+ obj2.free();
+ }
+ obj1.free();
+ return;
+ }
+ obj1.free();
+
+ // terminal node: this is either a combined annot/field dict, or an
+ // annot dict whose parent is a field
+ if ((annot = findAnnot(ref))) {
+ node->lookupNF("Parent", &obj1);
+ if (!parent || !obj1.isNull()) {
+ annot->generateFieldAppearance(node, node, acroForm);
+ } else {
+ annot->generateFieldAppearance(parent, node, acroForm);
+ }
+ obj1.free();
+ }
+}
+
+Annot *Annots::findAnnot(Ref *ref) {
+ int i;
+
+ for (i = 0; i < nAnnots; ++i) {
+ if (annots[i]->match(ref)) {
+ return annots[i];
+ }
+ }
+ return NULL;
+}
diff --git a/kpdf/xpdf/xpdf/Array.cc b/kpdf/xpdf/xpdf/Array.cc
deleted file mode 100644
index 8232037b..00000000
--- a/kpdf/xpdf/xpdf/Array.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-//========================================================================
-//
-// Array.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <stddef.h>
-#include "gmem.h"
-#include "Object.h"
-#include "Array.h"
-
-//------------------------------------------------------------------------
-// Array
-//------------------------------------------------------------------------
-
-Array::Array(XRef *xrefA) {
- xref = xrefA;
- elems = NULL;
- size = length = 0;
- ref = 1;
-}
-
-Array::~Array() {
- int i;
-
- for (i = 0; i < length; ++i)
- elems[i].free();
- gfree(elems);
-}
-
-void Array::add(Object *elem) {
- if (length == size) {
- if (length == 0) {
- size = 8;
- } else {
- size *= 2;
- }
- elems = (Object *)greallocn(elems, size, sizeof(Object));
- }
- elems[length] = *elem;
- ++length;
-}
-
-Object *Array::get(int i, Object *obj) {
- if (i < 0 || i >= length) {
-#ifdef DEBUG_MEM
- abort();
-#else
- return obj->initNull();
-#endif
- }
- return elems[i].fetch(xref, obj);
-}
-
-Object *Array::getNF(int i, Object *obj) {
- if (i < 0 || i >= length) {
-#ifdef DEBUG_MEM
- abort();
-#else
- return obj->initNull();
-#endif
- }
- return elems[i].copy(obj);
-}
-
-GBool Array::getString(int i, GString *string)
-{
- Object obj;
-
- if (getNF(i, &obj)->isString()) {
- string->clear();
- string->append(obj.getString());
- obj.free();
- return gTrue;
- } else {
- obj.free();
- return gFalse;
- }
-}
diff --git a/kpdf/xpdf/xpdf/Array.cpp b/kpdf/xpdf/xpdf/Array.cpp
new file mode 100644
index 00000000..7c54605a
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Array.cpp
@@ -0,0 +1,88 @@
+//========================================================================
+//
+// Array.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Array.h"
+
+//------------------------------------------------------------------------
+// Array
+//------------------------------------------------------------------------
+
+Array::Array(XRef *xrefA) {
+ xref = xrefA;
+ elems = NULL;
+ size = length = 0;
+ ref = 1;
+}
+
+Array::~Array() {
+ int i;
+
+ for (i = 0; i < length; ++i)
+ elems[i].free();
+ gfree(elems);
+}
+
+void Array::add(Object *elem) {
+ if (length == size) {
+ if (length == 0) {
+ size = 8;
+ } else {
+ size *= 2;
+ }
+ elems = (Object *)greallocn(elems, size, sizeof(Object));
+ }
+ elems[length] = *elem;
+ ++length;
+}
+
+Object *Array::get(int i, Object *obj) {
+ if (i < 0 || i >= length) {
+#ifdef DEBUG_MEM
+ abort();
+#else
+ return obj->initNull();
+#endif
+ }
+ return elems[i].fetch(xref, obj);
+}
+
+Object *Array::getNF(int i, Object *obj) {
+ if (i < 0 || i >= length) {
+#ifdef DEBUG_MEM
+ abort();
+#else
+ return obj->initNull();
+#endif
+ }
+ return elems[i].copy(obj);
+}
+
+GBool Array::getString(int i, GString *string)
+{
+ Object obj;
+
+ if (getNF(i, &obj)->isString()) {
+ string->clear();
+ string->append(obj.getString());
+ obj.free();
+ return gTrue;
+ } else {
+ obj.free();
+ return gFalse;
+ }
+}
diff --git a/kpdf/xpdf/xpdf/BuiltinFont.cc b/kpdf/xpdf/xpdf/BuiltinFont.cc
deleted file mode 100644
index ce989571..00000000
--- a/kpdf/xpdf/xpdf/BuiltinFont.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-//========================================================================
-//
-// BuiltinFont.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "gmem.h"
-#include "FontEncodingTables.h"
-#include "BuiltinFont.h"
-
-//------------------------------------------------------------------------
-
-BuiltinFontWidths::BuiltinFontWidths(BuiltinFontWidth *widths, int sizeA) {
- int i, h;
-
- size = sizeA;
- tab = (BuiltinFontWidth **)gmallocn(size, sizeof(BuiltinFontWidth *));
- for (i = 0; i < size; ++i) {
- tab[i] = NULL;
- }
- for (i = 0; i < sizeA; ++i) {
- h = hash(widths[i].name);
- widths[i].next = tab[h];
- tab[h] = &widths[i];
- }
-}
-
-BuiltinFontWidths::~BuiltinFontWidths() {
- gfree(tab);
-}
-
-GBool BuiltinFontWidths::getWidth(char *name, Gushort *width) {
- int h;
- BuiltinFontWidth *p;
-
- h = hash(name);
- for (p = tab[h]; p; p = p->next) {
- if (!strcmp(p->name, name)) {
- *width = p->width;
- return gTrue;
- }
- }
- return gFalse;
-}
-
-int BuiltinFontWidths::hash(char *name) {
- char *p;
- unsigned int h;
-
- h = 0;
- for (p = name; *p; ++p) {
- h = 17 * h + (int)(*p & 0xff);
- }
- return (int)(h % size);
-}
diff --git a/kpdf/xpdf/xpdf/BuiltinFont.cpp b/kpdf/xpdf/xpdf/BuiltinFont.cpp
new file mode 100644
index 00000000..6e9d2375
--- /dev/null
+++ b/kpdf/xpdf/xpdf/BuiltinFont.cpp
@@ -0,0 +1,65 @@
+//========================================================================
+//
+// BuiltinFont.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include "gmem.h"
+#include "FontEncodingTables.h"
+#include "BuiltinFont.h"
+
+//------------------------------------------------------------------------
+
+BuiltinFontWidths::BuiltinFontWidths(BuiltinFontWidth *widths, int sizeA) {
+ int i, h;
+
+ size = sizeA;
+ tab = (BuiltinFontWidth **)gmallocn(size, sizeof(BuiltinFontWidth *));
+ for (i = 0; i < size; ++i) {
+ tab[i] = NULL;
+ }
+ for (i = 0; i < sizeA; ++i) {
+ h = hash(widths[i].name);
+ widths[i].next = tab[h];
+ tab[h] = &widths[i];
+ }
+}
+
+BuiltinFontWidths::~BuiltinFontWidths() {
+ gfree(tab);
+}
+
+GBool BuiltinFontWidths::getWidth(char *name, Gushort *width) {
+ int h;
+ BuiltinFontWidth *p;
+
+ h = hash(name);
+ for (p = tab[h]; p; p = p->next) {
+ if (!strcmp(p->name, name)) {
+ *width = p->width;
+ return gTrue;
+ }
+ }
+ return gFalse;
+}
+
+int BuiltinFontWidths::hash(char *name) {
+ char *p;
+ unsigned int h;
+
+ h = 0;
+ for (p = name; *p; ++p) {
+ h = 17 * h + (int)(*p & 0xff);
+ }
+ return (int)(h % size);
+}
diff --git a/kpdf/xpdf/xpdf/BuiltinFontTables.cc b/kpdf/xpdf/xpdf/BuiltinFontTables.cc
deleted file mode 100644
index 9c362389..00000000
--- a/kpdf/xpdf/xpdf/BuiltinFontTables.cc
+++ /dev/null
@@ -1,4284 +0,0 @@
-//========================================================================
-//
-// BuiltinFontTables.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-#include <stdlib.h>
-#include "FontEncodingTables.h"
-#include "BuiltinFontTables.h"
-
-static BuiltinFontWidth courierWidthsTab[] = {
- { "Ntilde", 600, NULL },
- { "rcaron", 600, NULL },
- { "kcommaaccent", 600, NULL },
- { "Ncommaaccent", 600, NULL },
- { "Zacute", 600, NULL },
- { "comma", 600, NULL },
- { "cedilla", 600, NULL },
- { "plusminus", 600, NULL },
- { "circumflex", 600, NULL },
- { "dotaccent", 600, NULL },
- { "edotaccent", 600, NULL },
- { "asciitilde", 600, NULL },
- { "colon", 600, NULL },
- { "onehalf", 600, NULL },
- { "dollar", 600, NULL },
- { "Lcaron", 600, NULL },
- { "ntilde", 600, NULL },
- { "Aogonek", 600, NULL },
- { "ncommaaccent", 600, NULL },
- { "minus", 600, NULL },
- { "Iogonek", 600, NULL },
- { "zacute", 600, NULL },
- { "yen", 600, NULL },
- { "space", 600, NULL },
- { "Omacron", 600, NULL },
- { "questiondown", 600, NULL },
- { "emdash", 600, NULL },
- { "Agrave", 600, NULL },
- { "three", 600, NULL },
- { "numbersign", 600, NULL },
- { "lcaron", 600, NULL },
- { "A", 600, NULL },
- { "B", 600, NULL },
- { "C", 600, NULL },
- { "aogonek", 600, NULL },
- { "D", 600, NULL },
- { "E", 600, NULL },
- { "onequarter", 600, NULL },
- { "F", 600, NULL },
- { "G", 600, NULL },
- { "H", 600, NULL },
- { "I", 600, NULL },
- { "J", 600, NULL },
- { "K", 600, NULL },
- { "iogonek", 600, NULL },
- { "L", 600, NULL },
- { "backslash", 600, NULL },
- { "periodcentered", 600, NULL },
- { "M", 600, NULL },
- { "N", 600, NULL },
- { "omacron", 600, NULL },
- { "Tcommaaccent", 600, NULL },
- { "O", 600, NULL },
- { "P", 600, NULL },
- { "Q", 600, NULL },
- { "Uhungarumlaut", 600, NULL },
- { "R", 600, NULL },
- { "Aacute", 600, NULL },
- { "caron", 600, NULL },
- { "S", 600, NULL },
- { "T", 600, NULL },
- { "U", 600, NULL },
- { "agrave", 600, NULL },
- { "V", 600, NULL },
- { "W", 600, NULL },
- { "equal", 600, NULL },
- { "question", 600, NULL },
- { "X", 600, NULL },
- { "Y", 600, NULL },
- { "Z", 600, NULL },
- { "four", 600, NULL },
- { "a", 600, NULL },
- { "Gcommaaccent", 600, NULL },
- { "b", 600, NULL },
- { "c", 600, NULL },
- { "d", 600, NULL },
- { "e", 600, NULL },
- { "f", 600, NULL },
- { "g", 600, NULL },
- { "bullet", 600, NULL },
- { "h", 600, NULL },
- { "i", 600, NULL },
- { "Oslash", 600, NULL },
- { "dagger", 600, NULL },
- { "j", 600, NULL },
- { "k", 600, NULL },
- { "l", 600, NULL },
- { "m", 600, NULL },
- { "n", 600, NULL },
- { "tcommaaccent", 600, NULL },
- { "o", 600, NULL },
- { "ordfeminine", 600, NULL },
- { "ring", 600, NULL },
- { "p", 600, NULL },
- { "q", 600, NULL },
- { "uhungarumlaut", 600, NULL },
- { "r", 600, NULL },
- { "twosuperior", 600, NULL },
- { "aacute", 600, NULL },
- { "s", 600, NULL },
- { "OE", 600, NULL },
- { "t", 600, NULL },
- { "divide", 600, NULL },
- { "u", 600, NULL },
- { "Ccaron", 600, NULL },
- { "v", 600, NULL },
- { "w", 600, NULL },
- { "x", 600, NULL },
- { "y", 600, NULL },
- { "z", 600, NULL },
- { "Gbreve", 600, NULL },
- { "commaaccent", 600, NULL },
- { "hungarumlaut", 600, NULL },
- { "Idotaccent", 600, NULL },
- { "Nacute", 600, NULL },
- { "quotedbl", 600, NULL },
- { "gcommaaccent", 600, NULL },
- { "mu", 600, NULL },
- { "greaterequal", 600, NULL },
- { "Scaron", 600, NULL },
- { "Lslash", 600, NULL },
- { "semicolon", 600, NULL },
- { "oslash", 600, NULL },
- { "lessequal", 600, NULL },
- { "lozenge", 600, NULL },
- { "parenright", 600, NULL },
- { "ccaron", 600, NULL },
- { "Ecircumflex", 600, NULL },
- { "gbreve", 600, NULL },
- { "trademark", 600, NULL },
- { "daggerdbl", 600, NULL },
- { "nacute", 600, NULL },
- { "macron", 600, NULL },
- { "Otilde", 600, NULL },
- { "Emacron", 600, NULL },
- { "ellipsis", 600, NULL },
- { "scaron", 600, NULL },
- { "AE", 600, NULL },
- { "Ucircumflex", 600, NULL },
- { "lslash", 600, NULL },
- { "quotedblleft", 600, NULL },
- { "hyphen", 600, NULL },
- { "guilsinglright", 600, NULL },
- { "quotesingle", 600, NULL },
- { "eight", 600, NULL },
- { "exclamdown", 600, NULL },
- { "endash", 600, NULL },
- { "oe", 600, NULL },
- { "Abreve", 600, NULL },
- { "Umacron", 600, NULL },
- { "ecircumflex", 600, NULL },
- { "Adieresis", 600, NULL },
- { "copyright", 600, NULL },
- { "Egrave", 600, NULL },
- { "slash", 600, NULL },
- { "Edieresis", 600, NULL },
- { "otilde", 600, NULL },
- { "Idieresis", 600, NULL },
- { "parenleft", 600, NULL },
- { "one", 600, NULL },
- { "emacron", 600, NULL },
- { "Odieresis", 600, NULL },
- { "ucircumflex", 600, NULL },
- { "bracketleft", 600, NULL },
- { "Ugrave", 600, NULL },
- { "quoteright", 600, NULL },
- { "Udieresis", 600, NULL },
- { "perthousand", 600, NULL },
- { "Ydieresis", 600, NULL },
- { "umacron", 600, NULL },
- { "abreve", 600, NULL },
- { "Eacute", 600, NULL },
- { "adieresis", 600, NULL },
- { "egrave", 600, NULL },
- { "edieresis", 600, NULL },
- { "idieresis", 600, NULL },
- { "Eth", 600, NULL },
- { "ae", 600, NULL },
- { "asterisk", 600, NULL },
- { "odieresis", 600, NULL },
- { "Uacute", 600, NULL },
- { "ugrave", 600, NULL },
- { "five", 600, NULL },
- { "nine", 600, NULL },
- { "udieresis", 600, NULL },
- { "Zcaron", 600, NULL },
- { "Scommaaccent", 600, NULL },
- { "threequarters", 600, NULL },
- { "guillemotright", 600, NULL },
- { "Ccedilla", 600, NULL },
- { "ydieresis", 600, NULL },
- { "tilde", 600, NULL },
- { "at", 600, NULL },
- { "eacute", 600, NULL },
- { "underscore", 600, NULL },
- { "Euro", 600, NULL },
- { "Dcroat", 600, NULL },
- { "zero", 600, NULL },
- { "multiply", 600, NULL },
- { "eth", 600, NULL },
- { "Scedilla", 600, NULL },
- { "Racute", 600, NULL },
- { "Ograve", 600, NULL },
- { "partialdiff", 600, NULL },
- { "uacute", 600, NULL },
- { "braceleft", 600, NULL },
- { "Thorn", 600, NULL },
- { "zcaron", 600, NULL },
- { "scommaaccent", 600, NULL },
- { "ccedilla", 600, NULL },
- { "Dcaron", 600, NULL },
- { "dcroat", 600, NULL },
- { "scedilla", 600, NULL },
- { "Oacute", 600, NULL },
- { "Ocircumflex", 600, NULL },
- { "ogonek", 600, NULL },
- { "ograve", 600, NULL },
- { "racute", 600, NULL },
- { "Tcaron", 600, NULL },
- { "Eogonek", 600, NULL },
- { "thorn", 600, NULL },
- { "degree", 600, NULL },
- { "registered", 600, NULL },
- { "radical", 600, NULL },
- { "Aring", 600, NULL },
- { "percent", 600, NULL },
- { "six", 600, NULL },
- { "paragraph", 600, NULL },
- { "dcaron", 600, NULL },
- { "Uogonek", 600, NULL },
- { "two", 600, NULL },
- { "summation", 600, NULL },
- { "Igrave", 600, NULL },
- { "Lacute", 600, NULL },
- { "ocircumflex", 600, NULL },
- { "oacute", 600, NULL },
- { "Uring", 600, NULL },
- { "Lcommaaccent", 600, NULL },
- { "tcaron", 600, NULL },
- { "eogonek", 600, NULL },
- { "Delta", 600, NULL },
- { "Ohungarumlaut", 600, NULL },
- { "asciicircum", 600, NULL },
- { "aring", 600, NULL },
- { "grave", 600, NULL },
- { "uogonek", 600, NULL },
- { "bracketright", 600, NULL },
- { "ampersand", 600, NULL },
- { "Iacute", 600, NULL },
- { "lacute", 600, NULL },
- { "igrave", 600, NULL },
- { "Ncaron", 600, NULL },
- { "plus", 600, NULL },
- { "uring", 600, NULL },
- { "quotesinglbase", 600, NULL },
- { "lcommaaccent", 600, NULL },
- { "Yacute", 600, NULL },
- { "ohungarumlaut", 600, NULL },
- { "threesuperior", 600, NULL },
- { "acute", 600, NULL },
- { "section", 600, NULL },
- { "dieresis", 600, NULL },
- { "quotedblbase", 600, NULL },
- { "iacute", 600, NULL },
- { "ncaron", 600, NULL },
- { "florin", 600, NULL },
- { "yacute", 600, NULL },
- { "Rcommaaccent", 600, NULL },
- { "fi", 600, NULL },
- { "fl", 600, NULL },
- { "Acircumflex", 600, NULL },
- { "Cacute", 600, NULL },
- { "Icircumflex", 600, NULL },
- { "guillemotleft", 600, NULL },
- { "germandbls", 600, NULL },
- { "seven", 600, NULL },
- { "Amacron", 600, NULL },
- { "Sacute", 600, NULL },
- { "ordmasculine", 600, NULL },
- { "dotlessi", 600, NULL },
- { "sterling", 600, NULL },
- { "notequal", 600, NULL },
- { "Imacron", 600, NULL },
- { "rcommaaccent", 600, NULL },
- { "Zdotaccent", 600, NULL },
- { "acircumflex", 600, NULL },
- { "cacute", 600, NULL },
- { "Ecaron", 600, NULL },
- { "braceright", 600, NULL },
- { "icircumflex", 600, NULL },
- { "quotedblright", 600, NULL },
- { "amacron", 600, NULL },
- { "sacute", 600, NULL },
- { "imacron", 600, NULL },
- { "cent", 600, NULL },
- { "currency", 600, NULL },
- { "logicalnot", 600, NULL },
- { "zdotaccent", 600, NULL },
- { "Atilde", 600, NULL },
- { "breve", 600, NULL },
- { "bar", 600, NULL },
- { "fraction", 600, NULL },
- { "less", 600, NULL },
- { "ecaron", 600, NULL },
- { "guilsinglleft", 600, NULL },
- { "exclam", 600, NULL },
- { "period", 600, NULL },
- { "Rcaron", 600, NULL },
- { "Kcommaaccent", 600, NULL },
- { "greater", 600, NULL },
- { "atilde", 600, NULL },
- { "brokenbar", 600, NULL },
- { "quoteleft", 600, NULL },
- { "Edotaccent", 600, NULL },
- { "onesuperior", 600, NULL }
-};
-
-static BuiltinFontWidth courierBoldWidthsTab[] = {
- { "Ntilde", 600, NULL },
- { "rcaron", 600, NULL },
- { "kcommaaccent", 600, NULL },
- { "Ncommaaccent", 600, NULL },
- { "Zacute", 600, NULL },
- { "comma", 600, NULL },
- { "cedilla", 600, NULL },
- { "plusminus", 600, NULL },
- { "circumflex", 600, NULL },
- { "dotaccent", 600, NULL },
- { "edotaccent", 600, NULL },
- { "asciitilde", 600, NULL },
- { "colon", 600, NULL },
- { "onehalf", 600, NULL },
- { "dollar", 600, NULL },
- { "Lcaron", 600, NULL },
- { "ntilde", 600, NULL },
- { "Aogonek", 600, NULL },
- { "ncommaaccent", 600, NULL },
- { "minus", 600, NULL },
- { "Iogonek", 600, NULL },
- { "zacute", 600, NULL },
- { "yen", 600, NULL },
- { "space", 600, NULL },
- { "Omacron", 600, NULL },
- { "questiondown", 600, NULL },
- { "emdash", 600, NULL },
- { "Agrave", 600, NULL },
- { "three", 600, NULL },
- { "numbersign", 600, NULL },
- { "lcaron", 600, NULL },
- { "A", 600, NULL },
- { "B", 600, NULL },
- { "C", 600, NULL },
- { "aogonek", 600, NULL },
- { "D", 600, NULL },
- { "E", 600, NULL },
- { "onequarter", 600, NULL },
- { "F", 600, NULL },
- { "G", 600, NULL },
- { "H", 600, NULL },
- { "I", 600, NULL },
- { "J", 600, NULL },
- { "K", 600, NULL },
- { "iogonek", 600, NULL },
- { "backslash", 600, NULL },
- { "L", 600, NULL },
- { "periodcentered", 600, NULL },
- { "M", 600, NULL },
- { "N", 600, NULL },
- { "omacron", 600, NULL },
- { "Tcommaaccent", 600, NULL },
- { "O", 600, NULL },
- { "P", 600, NULL },
- { "Q", 600, NULL },
- { "Uhungarumlaut", 600, NULL },
- { "R", 600, NULL },
- { "Aacute", 600, NULL },
- { "caron", 600, NULL },
- { "S", 600, NULL },
- { "T", 600, NULL },
- { "U", 600, NULL },
- { "agrave", 600, NULL },
- { "V", 600, NULL },
- { "W", 600, NULL },
- { "X", 600, NULL },
- { "question", 600, NULL },
- { "equal", 600, NULL },
- { "Y", 600, NULL },
- { "Z", 600, NULL },
- { "four", 600, NULL },
- { "a", 600, NULL },
- { "Gcommaaccent", 600, NULL },
- { "b", 600, NULL },
- { "c", 600, NULL },
- { "d", 600, NULL },
- { "e", 600, NULL },
- { "f", 600, NULL },
- { "g", 600, NULL },
- { "bullet", 600, NULL },
- { "h", 600, NULL },
- { "i", 600, NULL },
- { "Oslash", 600, NULL },
- { "dagger", 600, NULL },
- { "j", 600, NULL },
- { "k", 600, NULL },
- { "l", 600, NULL },
- { "m", 600, NULL },
- { "n", 600, NULL },
- { "tcommaaccent", 600, NULL },
- { "o", 600, NULL },
- { "ordfeminine", 600, NULL },
- { "ring", 600, NULL },
- { "p", 600, NULL },
- { "q", 600, NULL },
- { "uhungarumlaut", 600, NULL },
- { "r", 600, NULL },
- { "twosuperior", 600, NULL },
- { "aacute", 600, NULL },
- { "s", 600, NULL },
- { "OE", 600, NULL },
- { "t", 600, NULL },
- { "divide", 600, NULL },
- { "u", 600, NULL },
- { "Ccaron", 600, NULL },
- { "v", 600, NULL },
- { "w", 600, NULL },
- { "x", 600, NULL },
- { "y", 600, NULL },
- { "z", 600, NULL },
- { "Gbreve", 600, NULL },
- { "commaaccent", 600, NULL },
- { "hungarumlaut", 600, NULL },
- { "Idotaccent", 600, NULL },
- { "Nacute", 600, NULL },
- { "quotedbl", 600, NULL },
- { "gcommaaccent", 600, NULL },
- { "mu", 600, NULL },
- { "greaterequal", 600, NULL },
- { "Scaron", 600, NULL },
- { "Lslash", 600, NULL },
- { "semicolon", 600, NULL },
- { "oslash", 600, NULL },
- { "lessequal", 600, NULL },
- { "lozenge", 600, NULL },
- { "parenright", 600, NULL },
- { "ccaron", 600, NULL },
- { "Ecircumflex", 600, NULL },
- { "gbreve", 600, NULL },
- { "trademark", 600, NULL },
- { "daggerdbl", 600, NULL },
- { "nacute", 600, NULL },
- { "macron", 600, NULL },
- { "Otilde", 600, NULL },
- { "Emacron", 600, NULL },
- { "ellipsis", 600, NULL },
- { "scaron", 600, NULL },
- { "AE", 600, NULL },
- { "Ucircumflex", 600, NULL },
- { "lslash", 600, NULL },
- { "quotedblleft", 600, NULL },
- { "guilsinglright", 600, NULL },
- { "hyphen", 600, NULL },
- { "quotesingle", 600, NULL },
- { "eight", 600, NULL },
- { "exclamdown", 600, NULL },
- { "endash", 600, NULL },
- { "oe", 600, NULL },
- { "Abreve", 600, NULL },
- { "Umacron", 600, NULL },
- { "ecircumflex", 600, NULL },
- { "Adieresis", 600, NULL },
- { "copyright", 600, NULL },
- { "Egrave", 600, NULL },
- { "slash", 600, NULL },
- { "Edieresis", 600, NULL },
- { "otilde", 600, NULL },
- { "Idieresis", 600, NULL },
- { "parenleft", 600, NULL },
- { "one", 600, NULL },
- { "emacron", 600, NULL },
- { "Odieresis", 600, NULL },
- { "ucircumflex", 600, NULL },
- { "bracketleft", 600, NULL },
- { "Ugrave", 600, NULL },
- { "quoteright", 600, NULL },
- { "Udieresis", 600, NULL },
- { "perthousand", 600, NULL },
- { "Ydieresis", 600, NULL },
- { "umacron", 600, NULL },
- { "abreve", 600, NULL },
- { "Eacute", 600, NULL },
- { "adieresis", 600, NULL },
- { "egrave", 600, NULL },
- { "edieresis", 600, NULL },
- { "idieresis", 600, NULL },
- { "Eth", 600, NULL },
- { "ae", 600, NULL },
- { "asterisk", 600, NULL },
- { "odieresis", 600, NULL },
- { "Uacute", 600, NULL },
- { "ugrave", 600, NULL },
- { "nine", 600, NULL },
- { "five", 600, NULL },
- { "udieresis", 600, NULL },
- { "Zcaron", 600, NULL },
- { "Scommaaccent", 600, NULL },
- { "threequarters", 600, NULL },
- { "guillemotright", 600, NULL },
- { "Ccedilla", 600, NULL },
- { "ydieresis", 600, NULL },
- { "tilde", 600, NULL },
- { "at", 600, NULL },
- { "eacute", 600, NULL },
- { "underscore", 600, NULL },
- { "Euro", 600, NULL },
- { "Dcroat", 600, NULL },
- { "multiply", 600, NULL },
- { "zero", 600, NULL },
- { "eth", 600, NULL },
- { "Scedilla", 600, NULL },
- { "Ograve", 600, NULL },
- { "Racute", 600, NULL },
- { "partialdiff", 600, NULL },
- { "uacute", 600, NULL },
- { "braceleft", 600, NULL },
- { "Thorn", 600, NULL },
- { "zcaron", 600, NULL },
- { "scommaaccent", 600, NULL },
- { "ccedilla", 600, NULL },
- { "Dcaron", 600, NULL },
- { "dcroat", 600, NULL },
- { "Ocircumflex", 600, NULL },
- { "Oacute", 600, NULL },
- { "scedilla", 600, NULL },
- { "ogonek", 600, NULL },
- { "ograve", 600, NULL },
- { "racute", 600, NULL },
- { "Tcaron", 600, NULL },
- { "Eogonek", 600, NULL },
- { "thorn", 600, NULL },
- { "degree", 600, NULL },
- { "registered", 600, NULL },
- { "radical", 600, NULL },
- { "Aring", 600, NULL },
- { "percent", 600, NULL },
- { "six", 600, NULL },
- { "paragraph", 600, NULL },
- { "dcaron", 600, NULL },
- { "Uogonek", 600, NULL },
- { "two", 600, NULL },
- { "summation", 600, NULL },
- { "Igrave", 600, NULL },
- { "Lacute", 600, NULL },
- { "ocircumflex", 600, NULL },
- { "oacute", 600, NULL },
- { "Uring", 600, NULL },
- { "Lcommaaccent", 600, NULL },
- { "tcaron", 600, NULL },
- { "eogonek", 600, NULL },
- { "Delta", 600, NULL },
- { "Ohungarumlaut", 600, NULL },
- { "asciicircum", 600, NULL },
- { "aring", 600, NULL },
- { "grave", 600, NULL },
- { "uogonek", 600, NULL },
- { "bracketright", 600, NULL },
- { "Iacute", 600, NULL },
- { "ampersand", 600, NULL },
- { "igrave", 600, NULL },
- { "lacute", 600, NULL },
- { "Ncaron", 600, NULL },
- { "plus", 600, NULL },
- { "uring", 600, NULL },
- { "quotesinglbase", 600, NULL },
- { "lcommaaccent", 600, NULL },
- { "Yacute", 600, NULL },
- { "ohungarumlaut", 600, NULL },
- { "threesuperior", 600, NULL },
- { "acute", 600, NULL },
- { "section", 600, NULL },
- { "dieresis", 600, NULL },
- { "iacute", 600, NULL },
- { "quotedblbase", 600, NULL },
- { "ncaron", 600, NULL },
- { "florin", 600, NULL },
- { "yacute", 600, NULL },
- { "Rcommaaccent", 600, NULL },
- { "fi", 600, NULL },
- { "fl", 600, NULL },
- { "Acircumflex", 600, NULL },
- { "Cacute", 600, NULL },
- { "Icircumflex", 600, NULL },
- { "guillemotleft", 600, NULL },
- { "germandbls", 600, NULL },
- { "Amacron", 600, NULL },
- { "seven", 600, NULL },
- { "Sacute", 600, NULL },
- { "ordmasculine", 600, NULL },
- { "dotlessi", 600, NULL },
- { "sterling", 600, NULL },
- { "notequal", 600, NULL },
- { "Imacron", 600, NULL },
- { "rcommaaccent", 600, NULL },
- { "Zdotaccent", 600, NULL },
- { "acircumflex", 600, NULL },
- { "cacute", 600, NULL },
- { "Ecaron", 600, NULL },
- { "icircumflex", 600, NULL },
- { "braceright", 600, NULL },
- { "quotedblright", 600, NULL },
- { "amacron", 600, NULL },
- { "sacute", 600, NULL },
- { "imacron", 600, NULL },
- { "cent", 600, NULL },
- { "currency", 600, NULL },
- { "logicalnot", 600, NULL },
- { "zdotaccent", 600, NULL },
- { "Atilde", 600, NULL },
- { "breve", 600, NULL },
- { "bar", 600, NULL },
- { "fraction", 600, NULL },
- { "less", 600, NULL },
- { "ecaron", 600, NULL },
- { "guilsinglleft", 600, NULL },
- { "exclam", 600, NULL },
- { "period", 600, NULL },
- { "Rcaron", 600, NULL },
- { "Kcommaaccent", 600, NULL },
- { "greater", 600, NULL },
- { "atilde", 600, NULL },
- { "brokenbar", 600, NULL },
- { "quoteleft", 600, NULL },
- { "Edotaccent", 600, NULL },
- { "onesuperior", 600, NULL }
-};
-
-static BuiltinFontWidth courierBoldObliqueWidthsTab[] = {
- { "Ntilde", 600, NULL },
- { "rcaron", 600, NULL },
- { "kcommaaccent", 600, NULL },
- { "Ncommaaccent", 600, NULL },
- { "Zacute", 600, NULL },
- { "comma", 600, NULL },
- { "cedilla", 600, NULL },
- { "plusminus", 600, NULL },
- { "circumflex", 600, NULL },
- { "dotaccent", 600, NULL },
- { "edotaccent", 600, NULL },
- { "asciitilde", 600, NULL },
- { "colon", 600, NULL },
- { "onehalf", 600, NULL },
- { "dollar", 600, NULL },
- { "Lcaron", 600, NULL },
- { "ntilde", 600, NULL },
- { "Aogonek", 600, NULL },
- { "ncommaaccent", 600, NULL },
- { "minus", 600, NULL },
- { "Iogonek", 600, NULL },
- { "zacute", 600, NULL },
- { "yen", 600, NULL },
- { "space", 600, NULL },
- { "Omacron", 600, NULL },
- { "questiondown", 600, NULL },
- { "emdash", 600, NULL },
- { "Agrave", 600, NULL },
- { "three", 600, NULL },
- { "numbersign", 600, NULL },
- { "lcaron", 600, NULL },
- { "A", 600, NULL },
- { "B", 600, NULL },
- { "C", 600, NULL },
- { "aogonek", 600, NULL },
- { "D", 600, NULL },
- { "E", 600, NULL },
- { "onequarter", 600, NULL },
- { "F", 600, NULL },
- { "G", 600, NULL },
- { "H", 600, NULL },
- { "I", 600, NULL },
- { "J", 600, NULL },
- { "K", 600, NULL },
- { "iogonek", 600, NULL },
- { "backslash", 600, NULL },
- { "L", 600, NULL },
- { "periodcentered", 600, NULL },
- { "M", 600, NULL },
- { "N", 600, NULL },
- { "omacron", 600, NULL },
- { "Tcommaaccent", 600, NULL },
- { "O", 600, NULL },
- { "P", 600, NULL },
- { "Q", 600, NULL },
- { "Uhungarumlaut", 600, NULL },
- { "R", 600, NULL },
- { "Aacute", 600, NULL },
- { "caron", 600, NULL },
- { "S", 600, NULL },
- { "T", 600, NULL },
- { "U", 600, NULL },
- { "agrave", 600, NULL },
- { "V", 600, NULL },
- { "W", 600, NULL },
- { "X", 600, NULL },
- { "question", 600, NULL },
- { "equal", 600, NULL },
- { "Y", 600, NULL },
- { "Z", 600, NULL },
- { "four", 600, NULL },
- { "a", 600, NULL },
- { "Gcommaaccent", 600, NULL },
- { "b", 600, NULL },
- { "c", 600, NULL },
- { "d", 600, NULL },
- { "e", 600, NULL },
- { "f", 600, NULL },
- { "g", 600, NULL },
- { "bullet", 600, NULL },
- { "h", 600, NULL },
- { "i", 600, NULL },
- { "Oslash", 600, NULL },
- { "dagger", 600, NULL },
- { "j", 600, NULL },
- { "k", 600, NULL },
- { "l", 600, NULL },
- { "m", 600, NULL },
- { "n", 600, NULL },
- { "tcommaaccent", 600, NULL },
- { "o", 600, NULL },
- { "ordfeminine", 600, NULL },
- { "ring", 600, NULL },
- { "p", 600, NULL },
- { "q", 600, NULL },
- { "uhungarumlaut", 600, NULL },
- { "r", 600, NULL },
- { "twosuperior", 600, NULL },
- { "aacute", 600, NULL },
- { "s", 600, NULL },
- { "OE", 600, NULL },
- { "t", 600, NULL },
- { "divide", 600, NULL },
- { "u", 600, NULL },
- { "Ccaron", 600, NULL },
- { "v", 600, NULL },
- { "w", 600, NULL },
- { "x", 600, NULL },
- { "y", 600, NULL },
- { "z", 600, NULL },
- { "Gbreve", 600, NULL },
- { "commaaccent", 600, NULL },
- { "hungarumlaut", 600, NULL },
- { "Idotaccent", 600, NULL },
- { "Nacute", 600, NULL },
- { "quotedbl", 600, NULL },
- { "gcommaaccent", 600, NULL },
- { "mu", 600, NULL },
- { "greaterequal", 600, NULL },
- { "Scaron", 600, NULL },
- { "Lslash", 600, NULL },
- { "semicolon", 600, NULL },
- { "oslash", 600, NULL },
- { "lessequal", 600, NULL },
- { "lozenge", 600, NULL },
- { "parenright", 600, NULL },
- { "ccaron", 600, NULL },
- { "Ecircumflex", 600, NULL },
- { "gbreve", 600, NULL },
- { "trademark", 600, NULL },
- { "daggerdbl", 600, NULL },
- { "nacute", 600, NULL },
- { "macron", 600, NULL },
- { "Otilde", 600, NULL },
- { "Emacron", 600, NULL },
- { "ellipsis", 600, NULL },
- { "scaron", 600, NULL },
- { "AE", 600, NULL },
- { "Ucircumflex", 600, NULL },
- { "lslash", 600, NULL },
- { "quotedblleft", 600, NULL },
- { "guilsinglright", 600, NULL },
- { "hyphen", 600, NULL },
- { "quotesingle", 600, NULL },
- { "eight", 600, NULL },
- { "exclamdown", 600, NULL },
- { "endash", 600, NULL },
- { "oe", 600, NULL },
- { "Abreve", 600, NULL },
- { "Umacron", 600, NULL },
- { "ecircumflex", 600, NULL },
- { "Adieresis", 600, NULL },
- { "copyright", 600, NULL },
- { "Egrave", 600, NULL },
- { "slash", 600, NULL },
- { "Edieresis", 600, NULL },
- { "otilde", 600, NULL },
- { "Idieresis", 600, NULL },
- { "parenleft", 600, NULL },
- { "one", 600, NULL },
- { "emacron", 600, NULL },
- { "Odieresis", 600, NULL },
- { "ucircumflex", 600, NULL },
- { "bracketleft", 600, NULL },
- { "Ugrave", 600, NULL },
- { "quoteright", 600, NULL },
- { "Udieresis", 600, NULL },
- { "perthousand", 600, NULL },
- { "Ydieresis", 600, NULL },
- { "umacron", 600, NULL },
- { "abreve", 600, NULL },
- { "Eacute", 600, NULL },
- { "adieresis", 600, NULL },
- { "egrave", 600, NULL },
- { "edieresis", 600, NULL },
- { "idieresis", 600, NULL },
- { "Eth", 600, NULL },
- { "ae", 600, NULL },
- { "asterisk", 600, NULL },
- { "odieresis", 600, NULL },
- { "Uacute", 600, NULL },
- { "ugrave", 600, NULL },
- { "nine", 600, NULL },
- { "five", 600, NULL },
- { "udieresis", 600, NULL },
- { "Zcaron", 600, NULL },
- { "Scommaaccent", 600, NULL },
- { "threequarters", 600, NULL },
- { "guillemotright", 600, NULL },
- { "Ccedilla", 600, NULL },
- { "ydieresis", 600, NULL },
- { "tilde", 600, NULL },
- { "at", 600, NULL },
- { "eacute", 600, NULL },
- { "underscore", 600, NULL },
- { "Euro", 600, NULL },
- { "Dcroat", 600, NULL },
- { "multiply", 600, NULL },
- { "zero", 600, NULL },
- { "eth", 600, NULL },
- { "Scedilla", 600, NULL },
- { "Ograve", 600, NULL },
- { "Racute", 600, NULL },
- { "partialdiff", 600, NULL },
- { "uacute", 600, NULL },
- { "braceleft", 600, NULL },
- { "Thorn", 600, NULL },
- { "zcaron", 600, NULL },
- { "scommaaccent", 600, NULL },
- { "ccedilla", 600, NULL },
- { "Dcaron", 600, NULL },
- { "dcroat", 600, NULL },
- { "Ocircumflex", 600, NULL },
- { "Oacute", 600, NULL },
- { "scedilla", 600, NULL },
- { "ogonek", 600, NULL },
- { "ograve", 600, NULL },
- { "racute", 600, NULL },
- { "Tcaron", 600, NULL },
- { "Eogonek", 600, NULL },
- { "thorn", 600, NULL },
- { "degree", 600, NULL },
- { "registered", 600, NULL },
- { "radical", 600, NULL },
- { "Aring", 600, NULL },
- { "percent", 600, NULL },
- { "six", 600, NULL },
- { "paragraph", 600, NULL },
- { "dcaron", 600, NULL },
- { "Uogonek", 600, NULL },
- { "two", 600, NULL },
- { "summation", 600, NULL },
- { "Igrave", 600, NULL },
- { "Lacute", 600, NULL },
- { "ocircumflex", 600, NULL },
- { "oacute", 600, NULL },
- { "Uring", 600, NULL },
- { "Lcommaaccent", 600, NULL },
- { "tcaron", 600, NULL },
- { "eogonek", 600, NULL },
- { "Delta", 600, NULL },
- { "Ohungarumlaut", 600, NULL },
- { "asciicircum", 600, NULL },
- { "aring", 600, NULL },
- { "grave", 600, NULL },
- { "uogonek", 600, NULL },
- { "bracketright", 600, NULL },
- { "Iacute", 600, NULL },
- { "ampersand", 600, NULL },
- { "igrave", 600, NULL },
- { "lacute", 600, NULL },
- { "Ncaron", 600, NULL },
- { "plus", 600, NULL },
- { "uring", 600, NULL },
- { "quotesinglbase", 600, NULL },
- { "lcommaaccent", 600, NULL },
- { "Yacute", 600, NULL },
- { "ohungarumlaut", 600, NULL },
- { "threesuperior", 600, NULL },
- { "acute", 600, NULL },
- { "section", 600, NULL },
- { "dieresis", 600, NULL },
- { "iacute", 600, NULL },
- { "quotedblbase", 600, NULL },
- { "ncaron", 600, NULL },
- { "florin", 600, NULL },
- { "yacute", 600, NULL },
- { "Rcommaaccent", 600, NULL },
- { "fi", 600, NULL },
- { "fl", 600, NULL },
- { "Acircumflex", 600, NULL },
- { "Cacute", 600, NULL },
- { "Icircumflex", 600, NULL },
- { "guillemotleft", 600, NULL },
- { "germandbls", 600, NULL },
- { "Amacron", 600, NULL },
- { "seven", 600, NULL },
- { "Sacute", 600, NULL },
- { "ordmasculine", 600, NULL },
- { "dotlessi", 600, NULL },
- { "sterling", 600, NULL },
- { "notequal", 600, NULL },
- { "Imacron", 600, NULL },
- { "rcommaaccent", 600, NULL },
- { "Zdotaccent", 600, NULL },
- { "acircumflex", 600, NULL },
- { "cacute", 600, NULL },
- { "Ecaron", 600, NULL },
- { "icircumflex", 600, NULL },
- { "braceright", 600, NULL },
- { "quotedblright", 600, NULL },
- { "amacron", 600, NULL },
- { "sacute", 600, NULL },
- { "imacron", 600, NULL },
- { "cent", 600, NULL },
- { "currency", 600, NULL },
- { "logicalnot", 600, NULL },
- { "zdotaccent", 600, NULL },
- { "Atilde", 600, NULL },
- { "breve", 600, NULL },
- { "bar", 600, NULL },
- { "fraction", 600, NULL },
- { "less", 600, NULL },
- { "ecaron", 600, NULL },
- { "guilsinglleft", 600, NULL },
- { "exclam", 600, NULL },
- { "period", 600, NULL },
- { "Rcaron", 600, NULL },
- { "Kcommaaccent", 600, NULL },
- { "greater", 600, NULL },
- { "atilde", 600, NULL },
- { "brokenbar", 600, NULL },
- { "quoteleft", 600, NULL },
- { "Edotaccent", 600, NULL },
- { "onesuperior", 600, NULL }
-};
-
-static BuiltinFontWidth courierObliqueWidthsTab[] = {
- { "Ntilde", 600, NULL },
- { "rcaron", 600, NULL },
- { "kcommaaccent", 600, NULL },
- { "Ncommaaccent", 600, NULL },
- { "Zacute", 600, NULL },
- { "comma", 600, NULL },
- { "cedilla", 600, NULL },
- { "plusminus", 600, NULL },
- { "circumflex", 600, NULL },
- { "dotaccent", 600, NULL },
- { "edotaccent", 600, NULL },
- { "asciitilde", 600, NULL },
- { "colon", 600, NULL },
- { "onehalf", 600, NULL },
- { "dollar", 600, NULL },
- { "Lcaron", 600, NULL },
- { "ntilde", 600, NULL },
- { "Aogonek", 600, NULL },
- { "ncommaaccent", 600, NULL },
- { "minus", 600, NULL },
- { "Iogonek", 600, NULL },
- { "zacute", 600, NULL },
- { "yen", 600, NULL },
- { "space", 600, NULL },
- { "Omacron", 600, NULL },
- { "questiondown", 600, NULL },
- { "emdash", 600, NULL },
- { "Agrave", 600, NULL },
- { "three", 600, NULL },
- { "numbersign", 600, NULL },
- { "lcaron", 600, NULL },
- { "A", 600, NULL },
- { "B", 600, NULL },
- { "C", 600, NULL },
- { "aogonek", 600, NULL },
- { "D", 600, NULL },
- { "E", 600, NULL },
- { "onequarter", 600, NULL },
- { "F", 600, NULL },
- { "G", 600, NULL },
- { "H", 600, NULL },
- { "I", 600, NULL },
- { "J", 600, NULL },
- { "K", 600, NULL },
- { "iogonek", 600, NULL },
- { "backslash", 600, NULL },
- { "L", 600, NULL },
- { "periodcentered", 600, NULL },
- { "M", 600, NULL },
- { "N", 600, NULL },
- { "omacron", 600, NULL },
- { "Tcommaaccent", 600, NULL },
- { "O", 600, NULL },
- { "P", 600, NULL },
- { "Q", 600, NULL },
- { "Uhungarumlaut", 600, NULL },
- { "R", 600, NULL },
- { "Aacute", 600, NULL },
- { "caron", 600, NULL },
- { "S", 600, NULL },
- { "T", 600, NULL },
- { "U", 600, NULL },
- { "agrave", 600, NULL },
- { "V", 600, NULL },
- { "W", 600, NULL },
- { "X", 600, NULL },
- { "question", 600, NULL },
- { "equal", 600, NULL },
- { "Y", 600, NULL },
- { "Z", 600, NULL },
- { "four", 600, NULL },
- { "a", 600, NULL },
- { "Gcommaaccent", 600, NULL },
- { "b", 600, NULL },
- { "c", 600, NULL },
- { "d", 600, NULL },
- { "e", 600, NULL },
- { "f", 600, NULL },
- { "g", 600, NULL },
- { "bullet", 600, NULL },
- { "h", 600, NULL },
- { "i", 600, NULL },
- { "Oslash", 600, NULL },
- { "dagger", 600, NULL },
- { "j", 600, NULL },
- { "k", 600, NULL },
- { "l", 600, NULL },
- { "m", 600, NULL },
- { "n", 600, NULL },
- { "tcommaaccent", 600, NULL },
- { "o", 600, NULL },
- { "ordfeminine", 600, NULL },
- { "ring", 600, NULL },
- { "p", 600, NULL },
- { "q", 600, NULL },
- { "uhungarumlaut", 600, NULL },
- { "r", 600, NULL },
- { "twosuperior", 600, NULL },
- { "aacute", 600, NULL },
- { "s", 600, NULL },
- { "OE", 600, NULL },
- { "t", 600, NULL },
- { "divide", 600, NULL },
- { "u", 600, NULL },
- { "Ccaron", 600, NULL },
- { "v", 600, NULL },
- { "w", 600, NULL },
- { "x", 600, NULL },
- { "y", 600, NULL },
- { "z", 600, NULL },
- { "Gbreve", 600, NULL },
- { "commaaccent", 600, NULL },
- { "hungarumlaut", 600, NULL },
- { "Idotaccent", 600, NULL },
- { "Nacute", 600, NULL },
- { "quotedbl", 600, NULL },
- { "gcommaaccent", 600, NULL },
- { "mu", 600, NULL },
- { "greaterequal", 600, NULL },
- { "Scaron", 600, NULL },
- { "Lslash", 600, NULL },
- { "semicolon", 600, NULL },
- { "oslash", 600, NULL },
- { "lessequal", 600, NULL },
- { "lozenge", 600, NULL },
- { "parenright", 600, NULL },
- { "ccaron", 600, NULL },
- { "Ecircumflex", 600, NULL },
- { "gbreve", 600, NULL },
- { "trademark", 600, NULL },
- { "daggerdbl", 600, NULL },
- { "nacute", 600, NULL },
- { "macron", 600, NULL },
- { "Otilde", 600, NULL },
- { "Emacron", 600, NULL },
- { "ellipsis", 600, NULL },
- { "scaron", 600, NULL },
- { "AE", 600, NULL },
- { "Ucircumflex", 600, NULL },
- { "lslash", 600, NULL },
- { "quotedblleft", 600, NULL },
- { "guilsinglright", 600, NULL },
- { "hyphen", 600, NULL },
- { "quotesingle", 600, NULL },
- { "eight", 600, NULL },
- { "exclamdown", 600, NULL },
- { "endash", 600, NULL },
- { "oe", 600, NULL },
- { "Abreve", 600, NULL },
- { "Umacron", 600, NULL },
- { "ecircumflex", 600, NULL },
- { "Adieresis", 600, NULL },
- { "copyright", 600, NULL },
- { "Egrave", 600, NULL },
- { "slash", 600, NULL },
- { "Edieresis", 600, NULL },
- { "otilde", 600, NULL },
- { "Idieresis", 600, NULL },
- { "parenleft", 600, NULL },
- { "one", 600, NULL },
- { "emacron", 600, NULL },
- { "Odieresis", 600, NULL },
- { "ucircumflex", 600, NULL },
- { "bracketleft", 600, NULL },
- { "Ugrave", 600, NULL },
- { "quoteright", 600, NULL },
- { "Udieresis", 600, NULL },
- { "perthousand", 600, NULL },
- { "Ydieresis", 600, NULL },
- { "umacron", 600, NULL },
- { "abreve", 600, NULL },
- { "Eacute", 600, NULL },
- { "adieresis", 600, NULL },
- { "egrave", 600, NULL },
- { "edieresis", 600, NULL },
- { "idieresis", 600, NULL },
- { "Eth", 600, NULL },
- { "ae", 600, NULL },
- { "asterisk", 600, NULL },
- { "odieresis", 600, NULL },
- { "Uacute", 600, NULL },
- { "ugrave", 600, NULL },
- { "nine", 600, NULL },
- { "five", 600, NULL },
- { "udieresis", 600, NULL },
- { "Zcaron", 600, NULL },
- { "Scommaaccent", 600, NULL },
- { "threequarters", 600, NULL },
- { "guillemotright", 600, NULL },
- { "Ccedilla", 600, NULL },
- { "ydieresis", 600, NULL },
- { "tilde", 600, NULL },
- { "at", 600, NULL },
- { "eacute", 600, NULL },
- { "underscore", 600, NULL },
- { "Euro", 600, NULL },
- { "Dcroat", 600, NULL },
- { "multiply", 600, NULL },
- { "zero", 600, NULL },
- { "eth", 600, NULL },
- { "Scedilla", 600, NULL },
- { "Ograve", 600, NULL },
- { "Racute", 600, NULL },
- { "partialdiff", 600, NULL },
- { "uacute", 600, NULL },
- { "braceleft", 600, NULL },
- { "Thorn", 600, NULL },
- { "zcaron", 600, NULL },
- { "scommaaccent", 600, NULL },
- { "ccedilla", 600, NULL },
- { "Dcaron", 600, NULL },
- { "dcroat", 600, NULL },
- { "Ocircumflex", 600, NULL },
- { "Oacute", 600, NULL },
- { "scedilla", 600, NULL },
- { "ogonek", 600, NULL },
- { "ograve", 600, NULL },
- { "racute", 600, NULL },
- { "Tcaron", 600, NULL },
- { "Eogonek", 600, NULL },
- { "thorn", 600, NULL },
- { "degree", 600, NULL },
- { "registered", 600, NULL },
- { "radical", 600, NULL },
- { "Aring", 600, NULL },
- { "percent", 600, NULL },
- { "six", 600, NULL },
- { "paragraph", 600, NULL },
- { "dcaron", 600, NULL },
- { "Uogonek", 600, NULL },
- { "two", 600, NULL },
- { "summation", 600, NULL },
- { "Igrave", 600, NULL },
- { "Lacute", 600, NULL },
- { "ocircumflex", 600, NULL },
- { "oacute", 600, NULL },
- { "Uring", 600, NULL },
- { "Lcommaaccent", 600, NULL },
- { "tcaron", 600, NULL },
- { "eogonek", 600, NULL },
- { "Delta", 600, NULL },
- { "Ohungarumlaut", 600, NULL },
- { "asciicircum", 600, NULL },
- { "aring", 600, NULL },
- { "grave", 600, NULL },
- { "uogonek", 600, NULL },
- { "bracketright", 600, NULL },
- { "Iacute", 600, NULL },
- { "ampersand", 600, NULL },
- { "igrave", 600, NULL },
- { "lacute", 600, NULL },
- { "Ncaron", 600, NULL },
- { "plus", 600, NULL },
- { "uring", 600, NULL },
- { "quotesinglbase", 600, NULL },
- { "lcommaaccent", 600, NULL },
- { "Yacute", 600, NULL },
- { "ohungarumlaut", 600, NULL },
- { "threesuperior", 600, NULL },
- { "acute", 600, NULL },
- { "section", 600, NULL },
- { "dieresis", 600, NULL },
- { "iacute", 600, NULL },
- { "quotedblbase", 600, NULL },
- { "ncaron", 600, NULL },
- { "florin", 600, NULL },
- { "yacute", 600, NULL },
- { "Rcommaaccent", 600, NULL },
- { "fi", 600, NULL },
- { "fl", 600, NULL },
- { "Acircumflex", 600, NULL },
- { "Cacute", 600, NULL },
- { "Icircumflex", 600, NULL },
- { "guillemotleft", 600, NULL },
- { "germandbls", 600, NULL },
- { "Amacron", 600, NULL },
- { "seven", 600, NULL },
- { "Sacute", 600, NULL },
- { "ordmasculine", 600, NULL },
- { "dotlessi", 600, NULL },
- { "sterling", 600, NULL },
- { "notequal", 600, NULL },
- { "Imacron", 600, NULL },
- { "rcommaaccent", 600, NULL },
- { "Zdotaccent", 600, NULL },
- { "acircumflex", 600, NULL },
- { "cacute", 600, NULL },
- { "Ecaron", 600, NULL },
- { "icircumflex", 600, NULL },
- { "braceright", 600, NULL },
- { "quotedblright", 600, NULL },
- { "amacron", 600, NULL },
- { "sacute", 600, NULL },
- { "imacron", 600, NULL },
- { "cent", 600, NULL },
- { "currency", 600, NULL },
- { "logicalnot", 600, NULL },
- { "zdotaccent", 600, NULL },
- { "Atilde", 600, NULL },
- { "breve", 600, NULL },
- { "bar", 600, NULL },
- { "fraction", 600, NULL },
- { "less", 600, NULL },
- { "ecaron", 600, NULL },
- { "guilsinglleft", 600, NULL },
- { "exclam", 600, NULL },
- { "period", 600, NULL },
- { "Rcaron", 600, NULL },
- { "Kcommaaccent", 600, NULL },
- { "greater", 600, NULL },
- { "atilde", 600, NULL },
- { "brokenbar", 600, NULL },
- { "quoteleft", 600, NULL },
- { "Edotaccent", 600, NULL },
- { "onesuperior", 600, NULL }
-};
-
-static BuiltinFontWidth helveticaWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 333, NULL },
- { "kcommaaccent", 500, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 611, NULL },
- { "comma", 278, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 584, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 556, NULL },
- { "asciitilde", 584, NULL },
- { "colon", 278, NULL },
- { "onehalf", 834, NULL },
- { "dollar", 556, NULL },
- { "Lcaron", 556, NULL },
- { "ntilde", 556, NULL },
- { "Aogonek", 667, NULL },
- { "ncommaaccent", 556, NULL },
- { "minus", 584, NULL },
- { "Iogonek", 278, NULL },
- { "zacute", 500, NULL },
- { "yen", 556, NULL },
- { "space", 278, NULL },
- { "Omacron", 778, NULL },
- { "questiondown", 611, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 667, NULL },
- { "three", 556, NULL },
- { "numbersign", 556, NULL },
- { "lcaron", 299, NULL },
- { "A", 667, NULL },
- { "B", 667, NULL },
- { "C", 722, NULL },
- { "aogonek", 556, NULL },
- { "D", 722, NULL },
- { "E", 667, NULL },
- { "onequarter", 834, NULL },
- { "F", 611, NULL },
- { "G", 778, NULL },
- { "H", 722, NULL },
- { "I", 278, NULL },
- { "J", 500, NULL },
- { "K", 667, NULL },
- { "iogonek", 222, NULL },
- { "backslash", 278, NULL },
- { "L", 556, NULL },
- { "periodcentered", 278, NULL },
- { "M", 833, NULL },
- { "N", 722, NULL },
- { "omacron", 556, NULL },
- { "Tcommaaccent", 611, NULL },
- { "O", 778, NULL },
- { "P", 667, NULL },
- { "Q", 778, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 722, NULL },
- { "Aacute", 667, NULL },
- { "caron", 333, NULL },
- { "S", 667, NULL },
- { "T", 611, NULL },
- { "U", 722, NULL },
- { "agrave", 556, NULL },
- { "V", 667, NULL },
- { "W", 944, NULL },
- { "X", 667, NULL },
- { "question", 556, NULL },
- { "equal", 584, NULL },
- { "Y", 667, NULL },
- { "Z", 611, NULL },
- { "four", 556, NULL },
- { "a", 556, NULL },
- { "Gcommaaccent", 778, NULL },
- { "b", 556, NULL },
- { "c", 500, NULL },
- { "d", 556, NULL },
- { "e", 556, NULL },
- { "f", 278, NULL },
- { "g", 556, NULL },
- { "bullet", 350, NULL },
- { "h", 556, NULL },
- { "i", 222, NULL },
- { "Oslash", 778, NULL },
- { "dagger", 556, NULL },
- { "j", 222, NULL },
- { "k", 500, NULL },
- { "l", 222, NULL },
- { "m", 833, NULL },
- { "n", 556, NULL },
- { "tcommaaccent", 278, NULL },
- { "o", 556, NULL },
- { "ordfeminine", 370, NULL },
- { "ring", 333, NULL },
- { "p", 556, NULL },
- { "q", 556, NULL },
- { "uhungarumlaut", 556, NULL },
- { "r", 333, NULL },
- { "twosuperior", 333, NULL },
- { "aacute", 556, NULL },
- { "s", 500, NULL },
- { "OE", 1000, NULL },
- { "t", 278, NULL },
- { "divide", 584, NULL },
- { "u", 556, NULL },
- { "Ccaron", 722, NULL },
- { "v", 500, NULL },
- { "w", 722, NULL },
- { "x", 500, NULL },
- { "y", 500, NULL },
- { "z", 500, NULL },
- { "Gbreve", 778, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 278, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 355, NULL },
- { "gcommaaccent", 556, NULL },
- { "mu", 556, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 667, NULL },
- { "Lslash", 556, NULL },
- { "semicolon", 278, NULL },
- { "oslash", 611, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 471, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 500, NULL },
- { "Ecircumflex", 667, NULL },
- { "gbreve", 556, NULL },
- { "trademark", 1000, NULL },
- { "daggerdbl", 556, NULL },
- { "nacute", 556, NULL },
- { "macron", 333, NULL },
- { "Otilde", 778, NULL },
- { "Emacron", 667, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 500, NULL },
- { "AE", 1000, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 222, NULL },
- { "quotedblleft", 333, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 191, NULL },
- { "eight", 556, NULL },
- { "exclamdown", 333, NULL },
- { "endash", 556, NULL },
- { "oe", 944, NULL },
- { "Abreve", 667, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 556, NULL },
- { "Adieresis", 667, NULL },
- { "copyright", 737, NULL },
- { "Egrave", 667, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 667, NULL },
- { "otilde", 556, NULL },
- { "Idieresis", 278, NULL },
- { "parenleft", 333, NULL },
- { "one", 556, NULL },
- { "emacron", 556, NULL },
- { "Odieresis", 778, NULL },
- { "ucircumflex", 556, NULL },
- { "bracketleft", 278, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 222, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 667, NULL },
- { "umacron", 556, NULL },
- { "abreve", 556, NULL },
- { "Eacute", 667, NULL },
- { "adieresis", 556, NULL },
- { "egrave", 556, NULL },
- { "edieresis", 556, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 889, NULL },
- { "asterisk", 389, NULL },
- { "odieresis", 556, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 556, NULL },
- { "nine", 556, NULL },
- { "five", 556, NULL },
- { "udieresis", 556, NULL },
- { "Zcaron", 611, NULL },
- { "Scommaaccent", 667, NULL },
- { "threequarters", 834, NULL },
- { "guillemotright", 556, NULL },
- { "Ccedilla", 722, NULL },
- { "ydieresis", 500, NULL },
- { "tilde", 333, NULL },
- { "at", 1015, NULL },
- { "eacute", 556, NULL },
- { "underscore", 556, NULL },
- { "Euro", 556, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 584, NULL },
- { "zero", 556, NULL },
- { "eth", 556, NULL },
- { "Scedilla", 667, NULL },
- { "Ograve", 778, NULL },
- { "Racute", 722, NULL },
- { "partialdiff", 476, NULL },
- { "uacute", 556, NULL },
- { "braceleft", 334, NULL },
- { "Thorn", 667, NULL },
- { "zcaron", 500, NULL },
- { "scommaaccent", 500, NULL },
- { "ccedilla", 500, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 556, NULL },
- { "Ocircumflex", 778, NULL },
- { "Oacute", 778, NULL },
- { "scedilla", 500, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 556, NULL },
- { "racute", 333, NULL },
- { "Tcaron", 611, NULL },
- { "Eogonek", 667, NULL },
- { "thorn", 556, NULL },
- { "degree", 400, NULL },
- { "registered", 737, NULL },
- { "radical", 453, NULL },
- { "Aring", 667, NULL },
- { "percent", 889, NULL },
- { "six", 556, NULL },
- { "paragraph", 537, NULL },
- { "dcaron", 643, NULL },
- { "Uogonek", 722, NULL },
- { "two", 556, NULL },
- { "summation", 600, NULL },
- { "Igrave", 278, NULL },
- { "Lacute", 556, NULL },
- { "ocircumflex", 556, NULL },
- { "oacute", 556, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 556, NULL },
- { "tcaron", 317, NULL },
- { "eogonek", 556, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 778, NULL },
- { "asciicircum", 469, NULL },
- { "aring", 556, NULL },
- { "grave", 333, NULL },
- { "uogonek", 556, NULL },
- { "bracketright", 278, NULL },
- { "Iacute", 278, NULL },
- { "ampersand", 667, NULL },
- { "igrave", 278, NULL },
- { "lacute", 222, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 584, NULL },
- { "uring", 556, NULL },
- { "quotesinglbase", 222, NULL },
- { "lcommaaccent", 222, NULL },
- { "Yacute", 667, NULL },
- { "ohungarumlaut", 556, NULL },
- { "threesuperior", 333, NULL },
- { "acute", 333, NULL },
- { "section", 556, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 333, NULL },
- { "ncaron", 556, NULL },
- { "florin", 556, NULL },
- { "yacute", 500, NULL },
- { "Rcommaaccent", 722, NULL },
- { "fi", 500, NULL },
- { "fl", 500, NULL },
- { "Acircumflex", 667, NULL },
- { "Cacute", 722, NULL },
- { "Icircumflex", 278, NULL },
- { "guillemotleft", 556, NULL },
- { "germandbls", 611, NULL },
- { "Amacron", 667, NULL },
- { "seven", 556, NULL },
- { "Sacute", 667, NULL },
- { "ordmasculine", 365, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 556, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 278, NULL },
- { "rcommaaccent", 333, NULL },
- { "Zdotaccent", 611, NULL },
- { "acircumflex", 556, NULL },
- { "cacute", 500, NULL },
- { "Ecaron", 667, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 334, NULL },
- { "quotedblright", 333, NULL },
- { "amacron", 556, NULL },
- { "sacute", 500, NULL },
- { "imacron", 278, NULL },
- { "cent", 556, NULL },
- { "currency", 556, NULL },
- { "logicalnot", 584, NULL },
- { "zdotaccent", 500, NULL },
- { "Atilde", 667, NULL },
- { "breve", 333, NULL },
- { "bar", 260, NULL },
- { "fraction", 167, NULL },
- { "less", 584, NULL },
- { "ecaron", 556, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 278, NULL },
- { "period", 278, NULL },
- { "Rcaron", 722, NULL },
- { "Kcommaaccent", 667, NULL },
- { "greater", 584, NULL },
- { "atilde", 556, NULL },
- { "brokenbar", 260, NULL },
- { "quoteleft", 222, NULL },
- { "Edotaccent", 667, NULL },
- { "onesuperior", 333, NULL }
-};
-
-static BuiltinFontWidth helveticaBoldWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 389, NULL },
- { "kcommaaccent", 556, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 611, NULL },
- { "comma", 278, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 584, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 556, NULL },
- { "asciitilde", 584, NULL },
- { "colon", 333, NULL },
- { "onehalf", 834, NULL },
- { "dollar", 556, NULL },
- { "Lcaron", 611, NULL },
- { "ntilde", 611, NULL },
- { "Aogonek", 722, NULL },
- { "ncommaaccent", 611, NULL },
- { "minus", 584, NULL },
- { "Iogonek", 278, NULL },
- { "zacute", 500, NULL },
- { "yen", 556, NULL },
- { "space", 278, NULL },
- { "Omacron", 778, NULL },
- { "questiondown", 611, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 722, NULL },
- { "three", 556, NULL },
- { "numbersign", 556, NULL },
- { "lcaron", 400, NULL },
- { "A", 722, NULL },
- { "B", 722, NULL },
- { "C", 722, NULL },
- { "aogonek", 556, NULL },
- { "D", 722, NULL },
- { "E", 667, NULL },
- { "onequarter", 834, NULL },
- { "F", 611, NULL },
- { "G", 778, NULL },
- { "H", 722, NULL },
- { "I", 278, NULL },
- { "J", 556, NULL },
- { "K", 722, NULL },
- { "iogonek", 278, NULL },
- { "backslash", 278, NULL },
- { "L", 611, NULL },
- { "periodcentered", 278, NULL },
- { "M", 833, NULL },
- { "N", 722, NULL },
- { "omacron", 611, NULL },
- { "Tcommaaccent", 611, NULL },
- { "O", 778, NULL },
- { "P", 667, NULL },
- { "Q", 778, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 722, NULL },
- { "Aacute", 722, NULL },
- { "caron", 333, NULL },
- { "S", 667, NULL },
- { "T", 611, NULL },
- { "U", 722, NULL },
- { "agrave", 556, NULL },
- { "V", 667, NULL },
- { "W", 944, NULL },
- { "X", 667, NULL },
- { "question", 611, NULL },
- { "equal", 584, NULL },
- { "Y", 667, NULL },
- { "Z", 611, NULL },
- { "four", 556, NULL },
- { "a", 556, NULL },
- { "Gcommaaccent", 778, NULL },
- { "b", 611, NULL },
- { "c", 556, NULL },
- { "d", 611, NULL },
- { "e", 556, NULL },
- { "f", 333, NULL },
- { "g", 611, NULL },
- { "bullet", 350, NULL },
- { "h", 611, NULL },
- { "i", 278, NULL },
- { "Oslash", 778, NULL },
- { "dagger", 556, NULL },
- { "j", 278, NULL },
- { "k", 556, NULL },
- { "l", 278, NULL },
- { "m", 889, NULL },
- { "n", 611, NULL },
- { "tcommaaccent", 333, NULL },
- { "o", 611, NULL },
- { "ordfeminine", 370, NULL },
- { "ring", 333, NULL },
- { "p", 611, NULL },
- { "q", 611, NULL },
- { "uhungarumlaut", 611, NULL },
- { "r", 389, NULL },
- { "twosuperior", 333, NULL },
- { "aacute", 556, NULL },
- { "s", 556, NULL },
- { "OE", 1000, NULL },
- { "t", 333, NULL },
- { "divide", 584, NULL },
- { "u", 611, NULL },
- { "Ccaron", 722, NULL },
- { "v", 556, NULL },
- { "w", 778, NULL },
- { "x", 556, NULL },
- { "y", 556, NULL },
- { "z", 500, NULL },
- { "Gbreve", 778, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 278, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 474, NULL },
- { "gcommaaccent", 611, NULL },
- { "mu", 611, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 667, NULL },
- { "Lslash", 611, NULL },
- { "semicolon", 333, NULL },
- { "oslash", 611, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 494, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 556, NULL },
- { "Ecircumflex", 667, NULL },
- { "gbreve", 611, NULL },
- { "trademark", 1000, NULL },
- { "daggerdbl", 556, NULL },
- { "nacute", 611, NULL },
- { "macron", 333, NULL },
- { "Otilde", 778, NULL },
- { "Emacron", 667, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 556, NULL },
- { "AE", 1000, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 278, NULL },
- { "quotedblleft", 500, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 238, NULL },
- { "eight", 556, NULL },
- { "exclamdown", 333, NULL },
- { "endash", 556, NULL },
- { "oe", 944, NULL },
- { "Abreve", 722, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 556, NULL },
- { "Adieresis", 722, NULL },
- { "copyright", 737, NULL },
- { "Egrave", 667, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 667, NULL },
- { "otilde", 611, NULL },
- { "Idieresis", 278, NULL },
- { "parenleft", 333, NULL },
- { "one", 556, NULL },
- { "emacron", 556, NULL },
- { "Odieresis", 778, NULL },
- { "ucircumflex", 611, NULL },
- { "bracketleft", 333, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 278, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 667, NULL },
- { "umacron", 611, NULL },
- { "abreve", 556, NULL },
- { "Eacute", 667, NULL },
- { "adieresis", 556, NULL },
- { "egrave", 556, NULL },
- { "edieresis", 556, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 889, NULL },
- { "asterisk", 389, NULL },
- { "odieresis", 611, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 611, NULL },
- { "nine", 556, NULL },
- { "five", 556, NULL },
- { "udieresis", 611, NULL },
- { "Zcaron", 611, NULL },
- { "Scommaaccent", 667, NULL },
- { "threequarters", 834, NULL },
- { "guillemotright", 556, NULL },
- { "Ccedilla", 722, NULL },
- { "ydieresis", 556, NULL },
- { "tilde", 333, NULL },
- { "dbldaggerumlaut", 556, NULL },
- { "at", 975, NULL },
- { "eacute", 556, NULL },
- { "underscore", 556, NULL },
- { "Euro", 556, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 584, NULL },
- { "zero", 556, NULL },
- { "eth", 611, NULL },
- { "Scedilla", 667, NULL },
- { "Ograve", 778, NULL },
- { "Racute", 722, NULL },
- { "partialdiff", 494, NULL },
- { "uacute", 611, NULL },
- { "braceleft", 389, NULL },
- { "Thorn", 667, NULL },
- { "zcaron", 500, NULL },
- { "scommaaccent", 556, NULL },
- { "ccedilla", 556, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 611, NULL },
- { "Ocircumflex", 778, NULL },
- { "Oacute", 778, NULL },
- { "scedilla", 556, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 611, NULL },
- { "racute", 389, NULL },
- { "Tcaron", 611, NULL },
- { "Eogonek", 667, NULL },
- { "thorn", 611, NULL },
- { "degree", 400, NULL },
- { "registered", 737, NULL },
- { "radical", 549, NULL },
- { "Aring", 722, NULL },
- { "percent", 889, NULL },
- { "six", 556, NULL },
- { "paragraph", 556, NULL },
- { "dcaron", 743, NULL },
- { "Uogonek", 722, NULL },
- { "two", 556, NULL },
- { "summation", 600, NULL },
- { "Igrave", 278, NULL },
- { "Lacute", 611, NULL },
- { "ocircumflex", 611, NULL },
- { "oacute", 611, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 611, NULL },
- { "tcaron", 389, NULL },
- { "eogonek", 556, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 778, NULL },
- { "asciicircum", 584, NULL },
- { "aring", 556, NULL },
- { "grave", 333, NULL },
- { "uogonek", 611, NULL },
- { "bracketright", 333, NULL },
- { "Iacute", 278, NULL },
- { "ampersand", 722, NULL },
- { "igrave", 278, NULL },
- { "lacute", 278, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 584, NULL },
- { "uring", 611, NULL },
- { "quotesinglbase", 278, NULL },
- { "lcommaaccent", 278, NULL },
- { "Yacute", 667, NULL },
- { "ohungarumlaut", 611, NULL },
- { "threesuperior", 333, NULL },
- { "acute", 333, NULL },
- { "section", 556, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 500, NULL },
- { "ncaron", 611, NULL },
- { "florin", 556, NULL },
- { "yacute", 556, NULL },
- { "Rcommaaccent", 722, NULL },
- { "fi", 611, NULL },
- { "fl", 611, NULL },
- { "Acircumflex", 722, NULL },
- { "Cacute", 722, NULL },
- { "Icircumflex", 278, NULL },
- { "guillemotleft", 556, NULL },
- { "germandbls", 611, NULL },
- { "Amacron", 722, NULL },
- { "seven", 556, NULL },
- { "Sacute", 667, NULL },
- { "ordmasculine", 365, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 556, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 278, NULL },
- { "rcommaaccent", 389, NULL },
- { "Zdotaccent", 611, NULL },
- { "acircumflex", 556, NULL },
- { "cacute", 556, NULL },
- { "Ecaron", 667, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 389, NULL },
- { "quotedblright", 500, NULL },
- { "amacron", 556, NULL },
- { "sacute", 556, NULL },
- { "imacron", 278, NULL },
- { "cent", 556, NULL },
- { "currency", 556, NULL },
- { "logicalnot", 584, NULL },
- { "zdotaccent", 500, NULL },
- { "Atilde", 722, NULL },
- { "breve", 333, NULL },
- { "bar", 280, NULL },
- { "fraction", 167, NULL },
- { "less", 584, NULL },
- { "ecaron", 556, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 333, NULL },
- { "period", 278, NULL },
- { "Rcaron", 722, NULL },
- { "Kcommaaccent", 722, NULL },
- { "greater", 584, NULL },
- { "atilde", 556, NULL },
- { "brokenbar", 280, NULL },
- { "quoteleft", 278, NULL },
- { "Edotaccent", 667, NULL },
- { "onesuperior", 333, NULL }
-};
-
-static BuiltinFontWidth helveticaBoldObliqueWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 389, NULL },
- { "kcommaaccent", 556, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 611, NULL },
- { "comma", 278, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 584, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 556, NULL },
- { "asciitilde", 584, NULL },
- { "colon", 333, NULL },
- { "onehalf", 834, NULL },
- { "dollar", 556, NULL },
- { "Lcaron", 611, NULL },
- { "ntilde", 611, NULL },
- { "Aogonek", 722, NULL },
- { "ncommaaccent", 611, NULL },
- { "minus", 584, NULL },
- { "Iogonek", 278, NULL },
- { "zacute", 500, NULL },
- { "yen", 556, NULL },
- { "space", 278, NULL },
- { "Omacron", 778, NULL },
- { "questiondown", 611, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 722, NULL },
- { "three", 556, NULL },
- { "numbersign", 556, NULL },
- { "lcaron", 400, NULL },
- { "A", 722, NULL },
- { "B", 722, NULL },
- { "C", 722, NULL },
- { "aogonek", 556, NULL },
- { "D", 722, NULL },
- { "E", 667, NULL },
- { "onequarter", 834, NULL },
- { "F", 611, NULL },
- { "G", 778, NULL },
- { "H", 722, NULL },
- { "I", 278, NULL },
- { "J", 556, NULL },
- { "K", 722, NULL },
- { "iogonek", 278, NULL },
- { "backslash", 278, NULL },
- { "L", 611, NULL },
- { "periodcentered", 278, NULL },
- { "M", 833, NULL },
- { "N", 722, NULL },
- { "omacron", 611, NULL },
- { "Tcommaaccent", 611, NULL },
- { "O", 778, NULL },
- { "P", 667, NULL },
- { "Q", 778, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 722, NULL },
- { "Aacute", 722, NULL },
- { "caron", 333, NULL },
- { "S", 667, NULL },
- { "T", 611, NULL },
- { "U", 722, NULL },
- { "agrave", 556, NULL },
- { "V", 667, NULL },
- { "W", 944, NULL },
- { "X", 667, NULL },
- { "question", 611, NULL },
- { "equal", 584, NULL },
- { "Y", 667, NULL },
- { "Z", 611, NULL },
- { "four", 556, NULL },
- { "a", 556, NULL },
- { "Gcommaaccent", 778, NULL },
- { "b", 611, NULL },
- { "c", 556, NULL },
- { "d", 611, NULL },
- { "e", 556, NULL },
- { "f", 333, NULL },
- { "g", 611, NULL },
- { "bullet", 350, NULL },
- { "h", 611, NULL },
- { "i", 278, NULL },
- { "Oslash", 778, NULL },
- { "dagger", 556, NULL },
- { "j", 278, NULL },
- { "k", 556, NULL },
- { "l", 278, NULL },
- { "m", 889, NULL },
- { "n", 611, NULL },
- { "tcommaaccent", 333, NULL },
- { "o", 611, NULL },
- { "ordfeminine", 370, NULL },
- { "ring", 333, NULL },
- { "p", 611, NULL },
- { "q", 611, NULL },
- { "uhungarumlaut", 611, NULL },
- { "r", 389, NULL },
- { "twosuperior", 333, NULL },
- { "aacute", 556, NULL },
- { "s", 556, NULL },
- { "OE", 1000, NULL },
- { "t", 333, NULL },
- { "divide", 584, NULL },
- { "u", 611, NULL },
- { "Ccaron", 722, NULL },
- { "v", 556, NULL },
- { "w", 778, NULL },
- { "x", 556, NULL },
- { "y", 556, NULL },
- { "z", 500, NULL },
- { "Gbreve", 778, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 278, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 474, NULL },
- { "gcommaaccent", 611, NULL },
- { "mu", 611, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 667, NULL },
- { "Lslash", 611, NULL },
- { "semicolon", 333, NULL },
- { "oslash", 611, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 494, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 556, NULL },
- { "Ecircumflex", 667, NULL },
- { "gbreve", 611, NULL },
- { "trademark", 1000, NULL },
- { "daggerdbl", 556, NULL },
- { "nacute", 611, NULL },
- { "macron", 333, NULL },
- { "Otilde", 778, NULL },
- { "Emacron", 667, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 556, NULL },
- { "AE", 1000, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 278, NULL },
- { "quotedblleft", 500, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 238, NULL },
- { "eight", 556, NULL },
- { "exclamdown", 333, NULL },
- { "endash", 556, NULL },
- { "oe", 944, NULL },
- { "Abreve", 722, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 556, NULL },
- { "Adieresis", 722, NULL },
- { "copyright", 737, NULL },
- { "Egrave", 667, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 667, NULL },
- { "otilde", 611, NULL },
- { "Idieresis", 278, NULL },
- { "parenleft", 333, NULL },
- { "one", 556, NULL },
- { "emacron", 556, NULL },
- { "Odieresis", 778, NULL },
- { "ucircumflex", 611, NULL },
- { "bracketleft", 333, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 278, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 667, NULL },
- { "umacron", 611, NULL },
- { "abreve", 556, NULL },
- { "Eacute", 667, NULL },
- { "adieresis", 556, NULL },
- { "egrave", 556, NULL },
- { "edieresis", 556, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 889, NULL },
- { "asterisk", 389, NULL },
- { "odieresis", 611, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 611, NULL },
- { "nine", 556, NULL },
- { "five", 556, NULL },
- { "udieresis", 611, NULL },
- { "Zcaron", 611, NULL },
- { "Scommaaccent", 667, NULL },
- { "threequarters", 834, NULL },
- { "guillemotright", 556, NULL },
- { "Ccedilla", 722, NULL },
- { "ydieresis", 556, NULL },
- { "tilde", 333, NULL },
- { "at", 975, NULL },
- { "eacute", 556, NULL },
- { "underscore", 556, NULL },
- { "Euro", 556, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 584, NULL },
- { "zero", 556, NULL },
- { "eth", 611, NULL },
- { "Scedilla", 667, NULL },
- { "Ograve", 778, NULL },
- { "Racute", 722, NULL },
- { "partialdiff", 494, NULL },
- { "uacute", 611, NULL },
- { "braceleft", 389, NULL },
- { "Thorn", 667, NULL },
- { "zcaron", 500, NULL },
- { "scommaaccent", 556, NULL },
- { "ccedilla", 556, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 611, NULL },
- { "Ocircumflex", 778, NULL },
- { "Oacute", 778, NULL },
- { "scedilla", 556, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 611, NULL },
- { "racute", 389, NULL },
- { "Tcaron", 611, NULL },
- { "Eogonek", 667, NULL },
- { "thorn", 611, NULL },
- { "degree", 400, NULL },
- { "registered", 737, NULL },
- { "radical", 549, NULL },
- { "Aring", 722, NULL },
- { "percent", 889, NULL },
- { "six", 556, NULL },
- { "paragraph", 556, NULL },
- { "dcaron", 743, NULL },
- { "Uogonek", 722, NULL },
- { "two", 556, NULL },
- { "summation", 600, NULL },
- { "Igrave", 278, NULL },
- { "Lacute", 611, NULL },
- { "ocircumflex", 611, NULL },
- { "oacute", 611, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 611, NULL },
- { "tcaron", 389, NULL },
- { "eogonek", 556, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 778, NULL },
- { "asciicircum", 584, NULL },
- { "aring", 556, NULL },
- { "grave", 333, NULL },
- { "uogonek", 611, NULL },
- { "bracketright", 333, NULL },
- { "Iacute", 278, NULL },
- { "ampersand", 722, NULL },
- { "igrave", 278, NULL },
- { "lacute", 278, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 584, NULL },
- { "uring", 611, NULL },
- { "quotesinglbase", 278, NULL },
- { "lcommaaccent", 278, NULL },
- { "Yacute", 667, NULL },
- { "ohungarumlaut", 611, NULL },
- { "threesuperior", 333, NULL },
- { "acute", 333, NULL },
- { "section", 556, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 500, NULL },
- { "ncaron", 611, NULL },
- { "florin", 556, NULL },
- { "yacute", 556, NULL },
- { "Rcommaaccent", 722, NULL },
- { "fi", 611, NULL },
- { "fl", 611, NULL },
- { "Acircumflex", 722, NULL },
- { "Cacute", 722, NULL },
- { "Icircumflex", 278, NULL },
- { "guillemotleft", 556, NULL },
- { "germandbls", 611, NULL },
- { "Amacron", 722, NULL },
- { "seven", 556, NULL },
- { "Sacute", 667, NULL },
- { "ordmasculine", 365, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 556, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 278, NULL },
- { "rcommaaccent", 389, NULL },
- { "Zdotaccent", 611, NULL },
- { "acircumflex", 556, NULL },
- { "cacute", 556, NULL },
- { "Ecaron", 667, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 389, NULL },
- { "quotedblright", 500, NULL },
- { "amacron", 556, NULL },
- { "sacute", 556, NULL },
- { "imacron", 278, NULL },
- { "cent", 556, NULL },
- { "currency", 556, NULL },
- { "logicalnot", 584, NULL },
- { "zdotaccent", 500, NULL },
- { "Atilde", 722, NULL },
- { "breve", 333, NULL },
- { "bar", 280, NULL },
- { "fraction", 167, NULL },
- { "less", 584, NULL },
- { "ecaron", 556, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 333, NULL },
- { "period", 278, NULL },
- { "Rcaron", 722, NULL },
- { "Kcommaaccent", 722, NULL },
- { "greater", 584, NULL },
- { "atilde", 556, NULL },
- { "brokenbar", 280, NULL },
- { "quoteleft", 278, NULL },
- { "Edotaccent", 667, NULL },
- { "onesuperior", 333, NULL }
-};
-
-static BuiltinFontWidth helveticaObliqueWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 333, NULL },
- { "kcommaaccent", 500, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 611, NULL },
- { "comma", 278, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 584, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 556, NULL },
- { "asciitilde", 584, NULL },
- { "colon", 278, NULL },
- { "onehalf", 834, NULL },
- { "dollar", 556, NULL },
- { "Lcaron", 556, NULL },
- { "ntilde", 556, NULL },
- { "Aogonek", 667, NULL },
- { "ncommaaccent", 556, NULL },
- { "minus", 584, NULL },
- { "Iogonek", 278, NULL },
- { "zacute", 500, NULL },
- { "yen", 556, NULL },
- { "space", 278, NULL },
- { "Omacron", 778, NULL },
- { "questiondown", 611, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 667, NULL },
- { "three", 556, NULL },
- { "numbersign", 556, NULL },
- { "lcaron", 299, NULL },
- { "A", 667, NULL },
- { "B", 667, NULL },
- { "C", 722, NULL },
- { "aogonek", 556, NULL },
- { "D", 722, NULL },
- { "E", 667, NULL },
- { "onequarter", 834, NULL },
- { "F", 611, NULL },
- { "G", 778, NULL },
- { "H", 722, NULL },
- { "I", 278, NULL },
- { "J", 500, NULL },
- { "K", 667, NULL },
- { "iogonek", 222, NULL },
- { "backslash", 278, NULL },
- { "L", 556, NULL },
- { "periodcentered", 278, NULL },
- { "M", 833, NULL },
- { "N", 722, NULL },
- { "omacron", 556, NULL },
- { "Tcommaaccent", 611, NULL },
- { "O", 778, NULL },
- { "P", 667, NULL },
- { "Q", 778, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 722, NULL },
- { "Aacute", 667, NULL },
- { "caron", 333, NULL },
- { "S", 667, NULL },
- { "T", 611, NULL },
- { "U", 722, NULL },
- { "agrave", 556, NULL },
- { "V", 667, NULL },
- { "W", 944, NULL },
- { "X", 667, NULL },
- { "question", 556, NULL },
- { "equal", 584, NULL },
- { "Y", 667, NULL },
- { "Z", 611, NULL },
- { "four", 556, NULL },
- { "a", 556, NULL },
- { "Gcommaaccent", 778, NULL },
- { "b", 556, NULL },
- { "c", 500, NULL },
- { "d", 556, NULL },
- { "e", 556, NULL },
- { "f", 278, NULL },
- { "g", 556, NULL },
- { "bullet", 350, NULL },
- { "h", 556, NULL },
- { "i", 222, NULL },
- { "Oslash", 778, NULL },
- { "dagger", 556, NULL },
- { "j", 222, NULL },
- { "k", 500, NULL },
- { "l", 222, NULL },
- { "m", 833, NULL },
- { "n", 556, NULL },
- { "tcommaaccent", 278, NULL },
- { "o", 556, NULL },
- { "ordfeminine", 370, NULL },
- { "ring", 333, NULL },
- { "p", 556, NULL },
- { "q", 556, NULL },
- { "uhungarumlaut", 556, NULL },
- { "r", 333, NULL },
- { "twosuperior", 333, NULL },
- { "aacute", 556, NULL },
- { "s", 500, NULL },
- { "OE", 1000, NULL },
- { "t", 278, NULL },
- { "divide", 584, NULL },
- { "u", 556, NULL },
- { "Ccaron", 722, NULL },
- { "v", 500, NULL },
- { "w", 722, NULL },
- { "x", 500, NULL },
- { "y", 500, NULL },
- { "z", 500, NULL },
- { "Gbreve", 778, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 278, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 355, NULL },
- { "gcommaaccent", 556, NULL },
- { "mu", 556, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 667, NULL },
- { "Lslash", 556, NULL },
- { "semicolon", 278, NULL },
- { "oslash", 611, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 471, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 500, NULL },
- { "Ecircumflex", 667, NULL },
- { "gbreve", 556, NULL },
- { "trademark", 1000, NULL },
- { "daggerdbl", 556, NULL },
- { "nacute", 556, NULL },
- { "macron", 333, NULL },
- { "Otilde", 778, NULL },
- { "Emacron", 667, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 500, NULL },
- { "AE", 1000, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 222, NULL },
- { "quotedblleft", 333, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 191, NULL },
- { "eight", 556, NULL },
- { "exclamdown", 333, NULL },
- { "endash", 556, NULL },
- { "oe", 944, NULL },
- { "Abreve", 667, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 556, NULL },
- { "Adieresis", 667, NULL },
- { "copyright", 737, NULL },
- { "Egrave", 667, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 667, NULL },
- { "otilde", 556, NULL },
- { "Idieresis", 278, NULL },
- { "parenleft", 333, NULL },
- { "one", 556, NULL },
- { "emacron", 556, NULL },
- { "Odieresis", 778, NULL },
- { "ucircumflex", 556, NULL },
- { "bracketleft", 278, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 222, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 667, NULL },
- { "umacron", 556, NULL },
- { "abreve", 556, NULL },
- { "Eacute", 667, NULL },
- { "adieresis", 556, NULL },
- { "egrave", 556, NULL },
- { "edieresis", 556, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 889, NULL },
- { "asterisk", 389, NULL },
- { "odieresis", 556, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 556, NULL },
- { "nine", 556, NULL },
- { "five", 556, NULL },
- { "udieresis", 556, NULL },
- { "Zcaron", 611, NULL },
- { "Scommaaccent", 667, NULL },
- { "threequarters", 834, NULL },
- { "guillemotright", 556, NULL },
- { "Ccedilla", 722, NULL },
- { "ydieresis", 500, NULL },
- { "tilde", 333, NULL },
- { "at", 1015, NULL },
- { "eacute", 556, NULL },
- { "underscore", 556, NULL },
- { "Euro", 556, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 584, NULL },
- { "zero", 556, NULL },
- { "eth", 556, NULL },
- { "Scedilla", 667, NULL },
- { "Ograve", 778, NULL },
- { "Racute", 722, NULL },
- { "partialdiff", 476, NULL },
- { "uacute", 556, NULL },
- { "braceleft", 334, NULL },
- { "Thorn", 667, NULL },
- { "zcaron", 500, NULL },
- { "scommaaccent", 500, NULL },
- { "ccedilla", 500, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 556, NULL },
- { "Ocircumflex", 778, NULL },
- { "Oacute", 778, NULL },
- { "scedilla", 500, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 556, NULL },
- { "racute", 333, NULL },
- { "Tcaron", 611, NULL },
- { "Eogonek", 667, NULL },
- { "thorn", 556, NULL },
- { "degree", 400, NULL },
- { "registered", 737, NULL },
- { "radical", 453, NULL },
- { "Aring", 667, NULL },
- { "percent", 889, NULL },
- { "six", 556, NULL },
- { "paragraph", 537, NULL },
- { "dcaron", 643, NULL },
- { "Uogonek", 722, NULL },
- { "two", 556, NULL },
- { "summation", 600, NULL },
- { "Igrave", 278, NULL },
- { "Lacute", 556, NULL },
- { "ocircumflex", 556, NULL },
- { "oacute", 556, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 556, NULL },
- { "tcaron", 317, NULL },
- { "eogonek", 556, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 778, NULL },
- { "asciicircum", 469, NULL },
- { "aring", 556, NULL },
- { "grave", 333, NULL },
- { "uogonek", 556, NULL },
- { "bracketright", 278, NULL },
- { "Iacute", 278, NULL },
- { "ampersand", 667, NULL },
- { "igrave", 278, NULL },
- { "lacute", 222, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 584, NULL },
- { "uring", 556, NULL },
- { "quotesinglbase", 222, NULL },
- { "lcommaaccent", 222, NULL },
- { "Yacute", 667, NULL },
- { "ohungarumlaut", 556, NULL },
- { "threesuperior", 333, NULL },
- { "acute", 333, NULL },
- { "section", 556, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 333, NULL },
- { "ncaron", 556, NULL },
- { "florin", 556, NULL },
- { "yacute", 500, NULL },
- { "Rcommaaccent", 722, NULL },
- { "fi", 500, NULL },
- { "fl", 500, NULL },
- { "Acircumflex", 667, NULL },
- { "Cacute", 722, NULL },
- { "Icircumflex", 278, NULL },
- { "guillemotleft", 556, NULL },
- { "germandbls", 611, NULL },
- { "Amacron", 667, NULL },
- { "seven", 556, NULL },
- { "Sacute", 667, NULL },
- { "ordmasculine", 365, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 556, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 278, NULL },
- { "rcommaaccent", 333, NULL },
- { "Zdotaccent", 611, NULL },
- { "acircumflex", 556, NULL },
- { "cacute", 500, NULL },
- { "Ecaron", 667, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 334, NULL },
- { "quotedblright", 333, NULL },
- { "amacron", 556, NULL },
- { "sacute", 500, NULL },
- { "imacron", 278, NULL },
- { "cent", 556, NULL },
- { "currency", 556, NULL },
- { "logicalnot", 584, NULL },
- { "zdotaccent", 500, NULL },
- { "Atilde", 667, NULL },
- { "breve", 333, NULL },
- { "bar", 260, NULL },
- { "fraction", 167, NULL },
- { "less", 584, NULL },
- { "ecaron", 556, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 278, NULL },
- { "period", 278, NULL },
- { "Rcaron", 722, NULL },
- { "Kcommaaccent", 667, NULL },
- { "greater", 584, NULL },
- { "atilde", 556, NULL },
- { "brokenbar", 260, NULL },
- { "quoteleft", 222, NULL },
- { "Edotaccent", 667, NULL },
- { "onesuperior", 333, NULL }
-};
-
-static BuiltinFontWidth symbolWidthsTab[] = {
- { "bracketleftex", 384, NULL },
- { "alpha", 631, NULL },
- { "union", 768, NULL },
- { "infinity", 713, NULL },
- { "comma", 250, NULL },
- { "copyrightsans", 790, NULL },
- { "plusminus", 549, NULL },
- { "arrowup", 603, NULL },
- { "apple", 790, NULL },
- { "parenleftbt", 384, NULL },
- { "notelement", 713, NULL },
- { "colon", 278, NULL },
- { "beta", 549, NULL },
- { "braceleftbt", 494, NULL },
- { "Lambda", 686, NULL },
- { "Phi", 763, NULL },
- { "minus", 549, NULL },
- { "space", 250, NULL },
- { "Sigma", 592, NULL },
- { "approxequal", 549, NULL },
- { "minute", 247, NULL },
- { "circleplus", 768, NULL },
- { "Omicron", 722, NULL },
- { "three", 500, NULL },
- { "numbersign", 500, NULL },
- { "lambda", 549, NULL },
- { "phi", 521, NULL },
- { "aleph", 823, NULL },
- { "Tau", 611, NULL },
- { "spade", 753, NULL },
- { "logicaland", 603, NULL },
- { "sigma", 603, NULL },
- { "propersuperset", 713, NULL },
- { "omicron", 549, NULL },
- { "question", 444, NULL },
- { "equal", 549, NULL },
- { "Epsilon", 611, NULL },
- { "emptyset", 823, NULL },
- { "diamond", 753, NULL },
- { "four", 500, NULL },
- { "Mu", 889, NULL },
- { "parenlefttp", 384, NULL },
- { "club", 753, NULL },
- { "bullet", 460, NULL },
- { "Omega", 768, NULL },
- { "tau", 439, NULL },
- { "Upsilon", 690, NULL },
- { "bracelefttp", 494, NULL },
- { "heart", 753, NULL },
- { "divide", 549, NULL },
- { "epsilon", 439, NULL },
- { "logicalor", 603, NULL },
- { "parenleftex", 384, NULL },
- { "greaterequal", 549, NULL },
- { "mu", 576, NULL },
- { "Nu", 722, NULL },
- { "therefore", 863, NULL },
- { "notsubset", 713, NULL },
- { "omega", 686, NULL },
- { "semicolon", 278, NULL },
- { "element", 713, NULL },
- { "upsilon", 576, NULL },
- { "existential", 549, NULL },
- { "integralbt", 686, NULL },
- { "lessequal", 549, NULL },
- { "phi1", 603, NULL },
- { "lozenge", 494, NULL },
- { "trademarkserif", 890, NULL },
- { "parenright", 333, NULL },
- { "reflexsuperset", 713, NULL },
- { "sigma1", 439, NULL },
- { "nu", 521, NULL },
- { "Gamma", 603, NULL },
- { "angleright", 329, NULL },
- { "ellipsis", 1000, NULL },
- { "Rho", 556, NULL },
- { "parenrightbt", 384, NULL },
- { "radicalex", 500, NULL },
- { "eight", 500, NULL },
- { "angleleft", 329, NULL },
- { "arrowdbldown", 603, NULL },
- { "congruent", 549, NULL },
- { "Theta", 741, NULL },
- { "intersection", 768, NULL },
- { "Pi", 768, NULL },
- { "slash", 278, NULL },
- { "registerserif", 790, NULL },
- { "parenleft", 333, NULL },
- { "one", 500, NULL },
- { "gamma", 411, NULL },
- { "bracketleft", 333, NULL },
- { "rho", 549, NULL },
- { "circlemultiply", 768, NULL },
- { "Chi", 722, NULL },
- { "theta", 521, NULL },
- { "pi", 549, NULL },
- { "integraltp", 686, NULL },
- { "Eta", 722, NULL },
- { "product", 823, NULL },
- { "nine", 500, NULL },
- { "five", 500, NULL },
- { "propersubset", 713, NULL },
- { "bracketrightbt", 384, NULL },
- { "trademarksans", 786, NULL },
- { "dotmath", 250, NULL },
- { "integralex", 686, NULL },
- { "chi", 549, NULL },
- { "parenrighttp", 384, NULL },
- { "eta", 603, NULL },
- { "underscore", 500, NULL },
- { "Euro", 750, NULL },
- { "multiply", 549, NULL },
- { "zero", 500, NULL },
- { "partialdiff", 494, NULL },
- { "angle", 768, NULL },
- { "arrowdblleft", 987, NULL },
- { "braceleft", 480, NULL },
- { "parenrightex", 384, NULL },
- { "Rfraktur", 795, NULL },
- { "Zeta", 611, NULL },
- { "braceex", 494, NULL },
- { "arrowdblup", 603, NULL },
- { "arrowdown", 603, NULL },
- { "Ifraktur", 686, NULL },
- { "degree", 400, NULL },
- { "Iota", 333, NULL },
- { "perpendicular", 658, NULL },
- { "radical", 549, NULL },
- { "asteriskmath", 500, NULL },
- { "percent", 833, NULL },
- { "zeta", 494, NULL },
- { "six", 500, NULL },
- { "two", 500, NULL },
- { "weierstrass", 987, NULL },
- { "summation", 713, NULL },
- { "bracketrighttp", 384, NULL },
- { "carriagereturn", 658, NULL },
- { "suchthat", 439, NULL },
- { "arrowvertex", 603, NULL },
- { "Delta", 612, NULL },
- { "iota", 329, NULL },
- { "arrowhorizex", 1000, NULL },
- { "bracketrightex", 384, NULL },
- { "bracketright", 333, NULL },
- { "ampersand", 778, NULL },
- { "plus", 549, NULL },
- { "proportional", 713, NULL },
- { "delta", 494, NULL },
- { "copyrightserif", 790, NULL },
- { "bracerightmid", 494, NULL },
- { "arrowleft", 987, NULL },
- { "second", 411, NULL },
- { "arrowdblboth", 1042, NULL },
- { "florin", 500, NULL },
- { "Psi", 795, NULL },
- { "bracerightbt", 494, NULL },
- { "bracketleftbt", 384, NULL },
- { "seven", 500, NULL },
- { "braceleftmid", 494, NULL },
- { "notequal", 549, NULL },
- { "psi", 686, NULL },
- { "equivalence", 549, NULL },
- { "universal", 713, NULL },
- { "arrowdblright", 987, NULL },
- { "braceright", 480, NULL },
- { "reflexsubset", 713, NULL },
- { "Xi", 645, NULL },
- { "theta1", 631, NULL },
- { "logicalnot", 713, NULL },
- { "Kappa", 722, NULL },
- { "similar", 549, NULL },
- { "bar", 200, NULL },
- { "fraction", 167, NULL },
- { "less", 549, NULL },
- { "registersans", 790, NULL },
- { "omega1", 713, NULL },
- { "exclam", 333, NULL },
- { "Upsilon1", 620, NULL },
- { "bracerighttp", 494, NULL },
- { "xi", 493, NULL },
- { "period", 250, NULL },
- { "Alpha", 722, NULL },
- { "arrowright", 987, NULL },
- { "greater", 549, NULL },
- { "bracketlefttp", 384, NULL },
- { "kappa", 549, NULL },
- { "gradient", 713, NULL },
- { "integral", 274, NULL },
- { "arrowboth", 1042, NULL },
- { "Beta", 667, NULL }
-};
-
-static BuiltinFontWidth timesBoldWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 444, NULL },
- { "kcommaaccent", 556, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 667, NULL },
- { "comma", 250, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 570, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 444, NULL },
- { "asciitilde", 520, NULL },
- { "colon", 333, NULL },
- { "onehalf", 750, NULL },
- { "dollar", 500, NULL },
- { "Lcaron", 667, NULL },
- { "ntilde", 556, NULL },
- { "Aogonek", 722, NULL },
- { "ncommaaccent", 556, NULL },
- { "minus", 570, NULL },
- { "Iogonek", 389, NULL },
- { "zacute", 444, NULL },
- { "yen", 500, NULL },
- { "space", 250, NULL },
- { "Omacron", 778, NULL },
- { "questiondown", 500, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 722, NULL },
- { "three", 500, NULL },
- { "numbersign", 500, NULL },
- { "lcaron", 394, NULL },
- { "A", 722, NULL },
- { "B", 667, NULL },
- { "C", 722, NULL },
- { "aogonek", 500, NULL },
- { "D", 722, NULL },
- { "E", 667, NULL },
- { "onequarter", 750, NULL },
- { "F", 611, NULL },
- { "G", 778, NULL },
- { "H", 778, NULL },
- { "I", 389, NULL },
- { "J", 500, NULL },
- { "K", 778, NULL },
- { "iogonek", 278, NULL },
- { "backslash", 278, NULL },
- { "L", 667, NULL },
- { "periodcentered", 250, NULL },
- { "M", 944, NULL },
- { "N", 722, NULL },
- { "omacron", 500, NULL },
- { "Tcommaaccent", 667, NULL },
- { "O", 778, NULL },
- { "P", 611, NULL },
- { "Q", 778, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 722, NULL },
- { "Aacute", 722, NULL },
- { "caron", 333, NULL },
- { "S", 556, NULL },
- { "T", 667, NULL },
- { "U", 722, NULL },
- { "agrave", 500, NULL },
- { "V", 722, NULL },
- { "W", 1000, NULL },
- { "X", 722, NULL },
- { "question", 500, NULL },
- { "equal", 570, NULL },
- { "Y", 722, NULL },
- { "Z", 667, NULL },
- { "four", 500, NULL },
- { "a", 500, NULL },
- { "Gcommaaccent", 778, NULL },
- { "b", 556, NULL },
- { "c", 444, NULL },
- { "d", 556, NULL },
- { "e", 444, NULL },
- { "f", 333, NULL },
- { "g", 500, NULL },
- { "bullet", 350, NULL },
- { "h", 556, NULL },
- { "i", 278, NULL },
- { "Oslash", 778, NULL },
- { "dagger", 500, NULL },
- { "j", 333, NULL },
- { "k", 556, NULL },
- { "l", 278, NULL },
- { "m", 833, NULL },
- { "n", 556, NULL },
- { "tcommaaccent", 333, NULL },
- { "o", 500, NULL },
- { "ordfeminine", 300, NULL },
- { "ring", 333, NULL },
- { "p", 556, NULL },
- { "q", 556, NULL },
- { "uhungarumlaut", 556, NULL },
- { "r", 444, NULL },
- { "twosuperior", 300, NULL },
- { "aacute", 500, NULL },
- { "s", 389, NULL },
- { "OE", 1000, NULL },
- { "t", 333, NULL },
- { "divide", 570, NULL },
- { "u", 556, NULL },
- { "Ccaron", 722, NULL },
- { "v", 500, NULL },
- { "w", 722, NULL },
- { "x", 500, NULL },
- { "y", 500, NULL },
- { "z", 444, NULL },
- { "Gbreve", 778, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 389, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 555, NULL },
- { "gcommaaccent", 500, NULL },
- { "mu", 556, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 556, NULL },
- { "Lslash", 667, NULL },
- { "semicolon", 333, NULL },
- { "oslash", 500, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 494, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 444, NULL },
- { "Ecircumflex", 667, NULL },
- { "gbreve", 500, NULL },
- { "trademark", 1000, NULL },
- { "daggerdbl", 500, NULL },
- { "nacute", 556, NULL },
- { "macron", 333, NULL },
- { "Otilde", 778, NULL },
- { "Emacron", 667, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 389, NULL },
- { "AE", 1000, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 278, NULL },
- { "quotedblleft", 500, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 278, NULL },
- { "eight", 500, NULL },
- { "exclamdown", 333, NULL },
- { "endash", 500, NULL },
- { "oe", 722, NULL },
- { "Abreve", 722, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 444, NULL },
- { "Adieresis", 722, NULL },
- { "copyright", 747, NULL },
- { "Egrave", 667, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 667, NULL },
- { "otilde", 500, NULL },
- { "Idieresis", 389, NULL },
- { "parenleft", 333, NULL },
- { "one", 500, NULL },
- { "emacron", 444, NULL },
- { "Odieresis", 778, NULL },
- { "ucircumflex", 556, NULL },
- { "bracketleft", 333, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 333, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 722, NULL },
- { "umacron", 556, NULL },
- { "abreve", 500, NULL },
- { "Eacute", 667, NULL },
- { "adieresis", 500, NULL },
- { "egrave", 444, NULL },
- { "edieresis", 444, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 722, NULL },
- { "asterisk", 500, NULL },
- { "odieresis", 500, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 556, NULL },
- { "nine", 500, NULL },
- { "five", 500, NULL },
- { "udieresis", 556, NULL },
- { "Zcaron", 667, NULL },
- { "Scommaaccent", 556, NULL },
- { "threequarters", 750, NULL },
- { "guillemotright", 500, NULL },
- { "Ccedilla", 722, NULL },
- { "ydieresis", 500, NULL },
- { "tilde", 333, NULL },
- { "at", 930, NULL },
- { "eacute", 444, NULL },
- { "underscore", 500, NULL },
- { "Euro", 500, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 570, NULL },
- { "zero", 500, NULL },
- { "eth", 500, NULL },
- { "Scedilla", 556, NULL },
- { "Ograve", 778, NULL },
- { "Racute", 722, NULL },
- { "partialdiff", 494, NULL },
- { "uacute", 556, NULL },
- { "braceleft", 394, NULL },
- { "Thorn", 611, NULL },
- { "zcaron", 444, NULL },
- { "scommaaccent", 389, NULL },
- { "ccedilla", 444, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 556, NULL },
- { "Ocircumflex", 778, NULL },
- { "Oacute", 778, NULL },
- { "scedilla", 389, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 500, NULL },
- { "racute", 444, NULL },
- { "Tcaron", 667, NULL },
- { "Eogonek", 667, NULL },
- { "thorn", 556, NULL },
- { "degree", 400, NULL },
- { "registered", 747, NULL },
- { "radical", 549, NULL },
- { "Aring", 722, NULL },
- { "percent", 1000, NULL },
- { "six", 500, NULL },
- { "paragraph", 540, NULL },
- { "dcaron", 672, NULL },
- { "Uogonek", 722, NULL },
- { "two", 500, NULL },
- { "summation", 600, NULL },
- { "Igrave", 389, NULL },
- { "Lacute", 667, NULL },
- { "ocircumflex", 500, NULL },
- { "oacute", 500, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 667, NULL },
- { "tcaron", 416, NULL },
- { "eogonek", 444, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 778, NULL },
- { "asciicircum", 581, NULL },
- { "aring", 500, NULL },
- { "grave", 333, NULL },
- { "uogonek", 556, NULL },
- { "bracketright", 333, NULL },
- { "Iacute", 389, NULL },
- { "ampersand", 833, NULL },
- { "igrave", 278, NULL },
- { "lacute", 278, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 570, NULL },
- { "uring", 556, NULL },
- { "quotesinglbase", 333, NULL },
- { "lcommaaccent", 278, NULL },
- { "Yacute", 722, NULL },
- { "ohungarumlaut", 500, NULL },
- { "threesuperior", 300, NULL },
- { "acute", 333, NULL },
- { "section", 500, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 500, NULL },
- { "ncaron", 556, NULL },
- { "florin", 500, NULL },
- { "yacute", 500, NULL },
- { "Rcommaaccent", 722, NULL },
- { "fi", 556, NULL },
- { "fl", 556, NULL },
- { "Acircumflex", 722, NULL },
- { "Cacute", 722, NULL },
- { "Icircumflex", 389, NULL },
- { "guillemotleft", 500, NULL },
- { "germandbls", 556, NULL },
- { "Amacron", 722, NULL },
- { "seven", 500, NULL },
- { "Sacute", 556, NULL },
- { "ordmasculine", 330, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 500, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 389, NULL },
- { "rcommaaccent", 444, NULL },
- { "Zdotaccent", 667, NULL },
- { "acircumflex", 500, NULL },
- { "cacute", 444, NULL },
- { "Ecaron", 667, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 394, NULL },
- { "quotedblright", 500, NULL },
- { "amacron", 500, NULL },
- { "sacute", 389, NULL },
- { "imacron", 278, NULL },
- { "cent", 500, NULL },
- { "currency", 500, NULL },
- { "logicalnot", 570, NULL },
- { "zdotaccent", 444, NULL },
- { "Atilde", 722, NULL },
- { "breve", 333, NULL },
- { "bar", 220, NULL },
- { "fraction", 167, NULL },
- { "less", 570, NULL },
- { "ecaron", 444, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 333, NULL },
- { "period", 250, NULL },
- { "Rcaron", 722, NULL },
- { "Kcommaaccent", 778, NULL },
- { "greater", 570, NULL },
- { "atilde", 500, NULL },
- { "brokenbar", 220, NULL },
- { "quoteleft", 333, NULL },
- { "Edotaccent", 667, NULL },
- { "onesuperior", 300, NULL }
-};
-
-static BuiltinFontWidth timesBoldItalicWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 389, NULL },
- { "kcommaaccent", 500, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 611, NULL },
- { "comma", 250, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 570, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 444, NULL },
- { "asciitilde", 570, NULL },
- { "colon", 333, NULL },
- { "onehalf", 750, NULL },
- { "dollar", 500, NULL },
- { "Lcaron", 611, NULL },
- { "ntilde", 556, NULL },
- { "Aogonek", 667, NULL },
- { "ncommaaccent", 556, NULL },
- { "minus", 606, NULL },
- { "Iogonek", 389, NULL },
- { "zacute", 389, NULL },
- { "yen", 500, NULL },
- { "space", 250, NULL },
- { "Omacron", 722, NULL },
- { "questiondown", 500, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 667, NULL },
- { "three", 500, NULL },
- { "numbersign", 500, NULL },
- { "lcaron", 382, NULL },
- { "A", 667, NULL },
- { "B", 667, NULL },
- { "C", 667, NULL },
- { "aogonek", 500, NULL },
- { "D", 722, NULL },
- { "E", 667, NULL },
- { "onequarter", 750, NULL },
- { "F", 667, NULL },
- { "G", 722, NULL },
- { "H", 778, NULL },
- { "I", 389, NULL },
- { "J", 500, NULL },
- { "K", 667, NULL },
- { "iogonek", 278, NULL },
- { "backslash", 278, NULL },
- { "L", 611, NULL },
- { "periodcentered", 250, NULL },
- { "M", 889, NULL },
- { "N", 722, NULL },
- { "omacron", 500, NULL },
- { "Tcommaaccent", 611, NULL },
- { "O", 722, NULL },
- { "P", 611, NULL },
- { "Q", 722, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 667, NULL },
- { "Aacute", 667, NULL },
- { "caron", 333, NULL },
- { "S", 556, NULL },
- { "T", 611, NULL },
- { "U", 722, NULL },
- { "agrave", 500, NULL },
- { "V", 667, NULL },
- { "W", 889, NULL },
- { "X", 667, NULL },
- { "question", 500, NULL },
- { "equal", 570, NULL },
- { "Y", 611, NULL },
- { "Z", 611, NULL },
- { "four", 500, NULL },
- { "a", 500, NULL },
- { "Gcommaaccent", 722, NULL },
- { "b", 500, NULL },
- { "c", 444, NULL },
- { "d", 500, NULL },
- { "e", 444, NULL },
- { "f", 333, NULL },
- { "g", 500, NULL },
- { "bullet", 350, NULL },
- { "h", 556, NULL },
- { "i", 278, NULL },
- { "Oslash", 722, NULL },
- { "dagger", 500, NULL },
- { "j", 278, NULL },
- { "k", 500, NULL },
- { "l", 278, NULL },
- { "m", 778, NULL },
- { "n", 556, NULL },
- { "tcommaaccent", 278, NULL },
- { "o", 500, NULL },
- { "ordfeminine", 266, NULL },
- { "ring", 333, NULL },
- { "p", 500, NULL },
- { "q", 500, NULL },
- { "uhungarumlaut", 556, NULL },
- { "r", 389, NULL },
- { "twosuperior", 300, NULL },
- { "aacute", 500, NULL },
- { "s", 389, NULL },
- { "OE", 944, NULL },
- { "t", 278, NULL },
- { "divide", 570, NULL },
- { "u", 556, NULL },
- { "Ccaron", 667, NULL },
- { "v", 444, NULL },
- { "w", 667, NULL },
- { "x", 500, NULL },
- { "y", 444, NULL },
- { "z", 389, NULL },
- { "Gbreve", 722, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 389, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 555, NULL },
- { "gcommaaccent", 500, NULL },
- { "mu", 576, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 556, NULL },
- { "Lslash", 611, NULL },
- { "semicolon", 333, NULL },
- { "oslash", 500, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 494, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 444, NULL },
- { "Ecircumflex", 667, NULL },
- { "gbreve", 500, NULL },
- { "trademark", 1000, NULL },
- { "daggerdbl", 500, NULL },
- { "nacute", 556, NULL },
- { "macron", 333, NULL },
- { "Otilde", 722, NULL },
- { "Emacron", 667, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 389, NULL },
- { "AE", 944, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 278, NULL },
- { "quotedblleft", 500, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 278, NULL },
- { "eight", 500, NULL },
- { "exclamdown", 389, NULL },
- { "endash", 500, NULL },
- { "oe", 722, NULL },
- { "Abreve", 667, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 444, NULL },
- { "Adieresis", 667, NULL },
- { "copyright", 747, NULL },
- { "Egrave", 667, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 667, NULL },
- { "otilde", 500, NULL },
- { "Idieresis", 389, NULL },
- { "parenleft", 333, NULL },
- { "one", 500, NULL },
- { "emacron", 444, NULL },
- { "Odieresis", 722, NULL },
- { "ucircumflex", 556, NULL },
- { "bracketleft", 333, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 333, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 611, NULL },
- { "umacron", 556, NULL },
- { "abreve", 500, NULL },
- { "Eacute", 667, NULL },
- { "adieresis", 500, NULL },
- { "egrave", 444, NULL },
- { "edieresis", 444, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 722, NULL },
- { "asterisk", 500, NULL },
- { "odieresis", 500, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 556, NULL },
- { "nine", 500, NULL },
- { "five", 500, NULL },
- { "udieresis", 556, NULL },
- { "Zcaron", 611, NULL },
- { "Scommaaccent", 556, NULL },
- { "threequarters", 750, NULL },
- { "guillemotright", 500, NULL },
- { "Ccedilla", 667, NULL },
- { "ydieresis", 444, NULL },
- { "tilde", 333, NULL },
- { "at", 832, NULL },
- { "eacute", 444, NULL },
- { "underscore", 500, NULL },
- { "Euro", 500, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 570, NULL },
- { "zero", 500, NULL },
- { "eth", 500, NULL },
- { "Scedilla", 556, NULL },
- { "Ograve", 722, NULL },
- { "Racute", 667, NULL },
- { "partialdiff", 494, NULL },
- { "uacute", 556, NULL },
- { "braceleft", 348, NULL },
- { "Thorn", 611, NULL },
- { "zcaron", 389, NULL },
- { "scommaaccent", 389, NULL },
- { "ccedilla", 444, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 500, NULL },
- { "Ocircumflex", 722, NULL },
- { "Oacute", 722, NULL },
- { "scedilla", 389, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 500, NULL },
- { "racute", 389, NULL },
- { "Tcaron", 611, NULL },
- { "Eogonek", 667, NULL },
- { "thorn", 500, NULL },
- { "degree", 400, NULL },
- { "registered", 747, NULL },
- { "radical", 549, NULL },
- { "Aring", 667, NULL },
- { "percent", 833, NULL },
- { "six", 500, NULL },
- { "paragraph", 500, NULL },
- { "dcaron", 608, NULL },
- { "Uogonek", 722, NULL },
- { "two", 500, NULL },
- { "summation", 600, NULL },
- { "Igrave", 389, NULL },
- { "Lacute", 611, NULL },
- { "ocircumflex", 500, NULL },
- { "oacute", 500, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 611, NULL },
- { "tcaron", 366, NULL },
- { "eogonek", 444, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 722, NULL },
- { "asciicircum", 570, NULL },
- { "aring", 500, NULL },
- { "grave", 333, NULL },
- { "uogonek", 556, NULL },
- { "bracketright", 333, NULL },
- { "Iacute", 389, NULL },
- { "ampersand", 778, NULL },
- { "igrave", 278, NULL },
- { "lacute", 278, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 570, NULL },
- { "uring", 556, NULL },
- { "quotesinglbase", 333, NULL },
- { "lcommaaccent", 278, NULL },
- { "Yacute", 611, NULL },
- { "ohungarumlaut", 500, NULL },
- { "threesuperior", 300, NULL },
- { "acute", 333, NULL },
- { "section", 500, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 500, NULL },
- { "ncaron", 556, NULL },
- { "florin", 500, NULL },
- { "yacute", 444, NULL },
- { "Rcommaaccent", 667, NULL },
- { "fi", 556, NULL },
- { "fl", 556, NULL },
- { "Acircumflex", 667, NULL },
- { "Cacute", 667, NULL },
- { "Icircumflex", 389, NULL },
- { "guillemotleft", 500, NULL },
- { "germandbls", 500, NULL },
- { "Amacron", 667, NULL },
- { "seven", 500, NULL },
- { "Sacute", 556, NULL },
- { "ordmasculine", 300, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 500, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 389, NULL },
- { "rcommaaccent", 389, NULL },
- { "Zdotaccent", 611, NULL },
- { "acircumflex", 500, NULL },
- { "cacute", 444, NULL },
- { "Ecaron", 667, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 348, NULL },
- { "quotedblright", 500, NULL },
- { "amacron", 500, NULL },
- { "sacute", 389, NULL },
- { "imacron", 278, NULL },
- { "cent", 500, NULL },
- { "currency", 500, NULL },
- { "logicalnot", 606, NULL },
- { "zdotaccent", 389, NULL },
- { "Atilde", 667, NULL },
- { "breve", 333, NULL },
- { "bar", 220, NULL },
- { "fraction", 167, NULL },
- { "less", 570, NULL },
- { "ecaron", 444, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 389, NULL },
- { "period", 250, NULL },
- { "Rcaron", 667, NULL },
- { "Kcommaaccent", 667, NULL },
- { "greater", 570, NULL },
- { "atilde", 500, NULL },
- { "brokenbar", 220, NULL },
- { "quoteleft", 333, NULL },
- { "Edotaccent", 667, NULL },
- { "onesuperior", 300, NULL }
-};
-
-static BuiltinFontWidth timesItalicWidthsTab[] = {
- { "Ntilde", 667, NULL },
- { "rcaron", 389, NULL },
- { "kcommaaccent", 444, NULL },
- { "Ncommaaccent", 667, NULL },
- { "Zacute", 556, NULL },
- { "comma", 250, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 675, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 444, NULL },
- { "asciitilde", 541, NULL },
- { "colon", 333, NULL },
- { "onehalf", 750, NULL },
- { "dollar", 500, NULL },
- { "Lcaron", 611, NULL },
- { "ntilde", 500, NULL },
- { "Aogonek", 611, NULL },
- { "ncommaaccent", 500, NULL },
- { "minus", 675, NULL },
- { "Iogonek", 333, NULL },
- { "zacute", 389, NULL },
- { "yen", 500, NULL },
- { "space", 250, NULL },
- { "Omacron", 722, NULL },
- { "questiondown", 500, NULL },
- { "emdash", 889, NULL },
- { "Agrave", 611, NULL },
- { "three", 500, NULL },
- { "numbersign", 500, NULL },
- { "lcaron", 300, NULL },
- { "A", 611, NULL },
- { "B", 611, NULL },
- { "C", 667, NULL },
- { "aogonek", 500, NULL },
- { "D", 722, NULL },
- { "E", 611, NULL },
- { "onequarter", 750, NULL },
- { "F", 611, NULL },
- { "G", 722, NULL },
- { "H", 722, NULL },
- { "I", 333, NULL },
- { "J", 444, NULL },
- { "K", 667, NULL },
- { "iogonek", 278, NULL },
- { "backslash", 278, NULL },
- { "L", 556, NULL },
- { "periodcentered", 250, NULL },
- { "M", 833, NULL },
- { "N", 667, NULL },
- { "omacron", 500, NULL },
- { "Tcommaaccent", 556, NULL },
- { "O", 722, NULL },
- { "P", 611, NULL },
- { "Q", 722, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 611, NULL },
- { "Aacute", 611, NULL },
- { "caron", 333, NULL },
- { "S", 500, NULL },
- { "T", 556, NULL },
- { "U", 722, NULL },
- { "agrave", 500, NULL },
- { "V", 611, NULL },
- { "W", 833, NULL },
- { "X", 611, NULL },
- { "question", 500, NULL },
- { "equal", 675, NULL },
- { "Y", 556, NULL },
- { "Z", 556, NULL },
- { "four", 500, NULL },
- { "a", 500, NULL },
- { "Gcommaaccent", 722, NULL },
- { "b", 500, NULL },
- { "c", 444, NULL },
- { "d", 500, NULL },
- { "e", 444, NULL },
- { "f", 278, NULL },
- { "g", 500, NULL },
- { "bullet", 350, NULL },
- { "h", 500, NULL },
- { "i", 278, NULL },
- { "Oslash", 722, NULL },
- { "dagger", 500, NULL },
- { "j", 278, NULL },
- { "k", 444, NULL },
- { "l", 278, NULL },
- { "m", 722, NULL },
- { "n", 500, NULL },
- { "tcommaaccent", 278, NULL },
- { "o", 500, NULL },
- { "ordfeminine", 276, NULL },
- { "ring", 333, NULL },
- { "p", 500, NULL },
- { "q", 500, NULL },
- { "uhungarumlaut", 500, NULL },
- { "r", 389, NULL },
- { "twosuperior", 300, NULL },
- { "aacute", 500, NULL },
- { "s", 389, NULL },
- { "OE", 944, NULL },
- { "t", 278, NULL },
- { "divide", 675, NULL },
- { "u", 500, NULL },
- { "Ccaron", 667, NULL },
- { "v", 444, NULL },
- { "w", 667, NULL },
- { "x", 444, NULL },
- { "y", 444, NULL },
- { "z", 389, NULL },
- { "Gbreve", 722, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 333, NULL },
- { "Nacute", 667, NULL },
- { "quotedbl", 420, NULL },
- { "gcommaaccent", 500, NULL },
- { "mu", 500, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 500, NULL },
- { "Lslash", 556, NULL },
- { "semicolon", 333, NULL },
- { "oslash", 500, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 471, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 444, NULL },
- { "Ecircumflex", 611, NULL },
- { "gbreve", 500, NULL },
- { "trademark", 980, NULL },
- { "daggerdbl", 500, NULL },
- { "nacute", 500, NULL },
- { "macron", 333, NULL },
- { "Otilde", 722, NULL },
- { "Emacron", 611, NULL },
- { "ellipsis", 889, NULL },
- { "scaron", 389, NULL },
- { "AE", 889, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 278, NULL },
- { "quotedblleft", 556, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 214, NULL },
- { "eight", 500, NULL },
- { "exclamdown", 389, NULL },
- { "endash", 500, NULL },
- { "oe", 667, NULL },
- { "Abreve", 611, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 444, NULL },
- { "Adieresis", 611, NULL },
- { "copyright", 760, NULL },
- { "Egrave", 611, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 611, NULL },
- { "otilde", 500, NULL },
- { "Idieresis", 333, NULL },
- { "parenleft", 333, NULL },
- { "one", 500, NULL },
- { "emacron", 444, NULL },
- { "Odieresis", 722, NULL },
- { "ucircumflex", 500, NULL },
- { "bracketleft", 389, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 333, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 556, NULL },
- { "umacron", 500, NULL },
- { "abreve", 500, NULL },
- { "Eacute", 611, NULL },
- { "adieresis", 500, NULL },
- { "egrave", 444, NULL },
- { "edieresis", 444, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 667, NULL },
- { "asterisk", 500, NULL },
- { "odieresis", 500, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 500, NULL },
- { "nine", 500, NULL },
- { "five", 500, NULL },
- { "udieresis", 500, NULL },
- { "Zcaron", 556, NULL },
- { "Scommaaccent", 500, NULL },
- { "threequarters", 750, NULL },
- { "guillemotright", 500, NULL },
- { "Ccedilla", 667, NULL },
- { "ydieresis", 444, NULL },
- { "tilde", 333, NULL },
- { "at", 920, NULL },
- { "eacute", 444, NULL },
- { "underscore", 500, NULL },
- { "Euro", 500, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 675, NULL },
- { "zero", 500, NULL },
- { "eth", 500, NULL },
- { "Scedilla", 500, NULL },
- { "Ograve", 722, NULL },
- { "Racute", 611, NULL },
- { "partialdiff", 476, NULL },
- { "uacute", 500, NULL },
- { "braceleft", 400, NULL },
- { "Thorn", 611, NULL },
- { "zcaron", 389, NULL },
- { "scommaaccent", 389, NULL },
- { "ccedilla", 444, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 500, NULL },
- { "Ocircumflex", 722, NULL },
- { "Oacute", 722, NULL },
- { "scedilla", 389, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 500, NULL },
- { "racute", 389, NULL },
- { "Tcaron", 556, NULL },
- { "Eogonek", 611, NULL },
- { "thorn", 500, NULL },
- { "degree", 400, NULL },
- { "registered", 760, NULL },
- { "radical", 453, NULL },
- { "Aring", 611, NULL },
- { "percent", 833, NULL },
- { "six", 500, NULL },
- { "paragraph", 523, NULL },
- { "dcaron", 544, NULL },
- { "Uogonek", 722, NULL },
- { "two", 500, NULL },
- { "summation", 600, NULL },
- { "Igrave", 333, NULL },
- { "Lacute", 556, NULL },
- { "ocircumflex", 500, NULL },
- { "oacute", 500, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 556, NULL },
- { "tcaron", 300, NULL },
- { "eogonek", 444, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 722, NULL },
- { "asciicircum", 422, NULL },
- { "aring", 500, NULL },
- { "grave", 333, NULL },
- { "uogonek", 500, NULL },
- { "bracketright", 389, NULL },
- { "Iacute", 333, NULL },
- { "ampersand", 778, NULL },
- { "igrave", 278, NULL },
- { "lacute", 278, NULL },
- { "Ncaron", 667, NULL },
- { "plus", 675, NULL },
- { "uring", 500, NULL },
- { "quotesinglbase", 333, NULL },
- { "lcommaaccent", 278, NULL },
- { "Yacute", 556, NULL },
- { "ohungarumlaut", 500, NULL },
- { "threesuperior", 300, NULL },
- { "acute", 333, NULL },
- { "section", 500, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 556, NULL },
- { "ncaron", 500, NULL },
- { "florin", 500, NULL },
- { "yacute", 444, NULL },
- { "Rcommaaccent", 611, NULL },
- { "fi", 500, NULL },
- { "fl", 500, NULL },
- { "Acircumflex", 611, NULL },
- { "Cacute", 667, NULL },
- { "Icircumflex", 333, NULL },
- { "guillemotleft", 500, NULL },
- { "germandbls", 500, NULL },
- { "Amacron", 611, NULL },
- { "seven", 500, NULL },
- { "Sacute", 500, NULL },
- { "ordmasculine", 310, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 500, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 333, NULL },
- { "rcommaaccent", 389, NULL },
- { "Zdotaccent", 556, NULL },
- { "acircumflex", 500, NULL },
- { "cacute", 444, NULL },
- { "Ecaron", 611, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 400, NULL },
- { "quotedblright", 556, NULL },
- { "amacron", 500, NULL },
- { "sacute", 389, NULL },
- { "imacron", 278, NULL },
- { "cent", 500, NULL },
- { "currency", 500, NULL },
- { "logicalnot", 675, NULL },
- { "zdotaccent", 389, NULL },
- { "Atilde", 611, NULL },
- { "breve", 333, NULL },
- { "bar", 275, NULL },
- { "fraction", 167, NULL },
- { "less", 675, NULL },
- { "ecaron", 444, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 333, NULL },
- { "period", 250, NULL },
- { "Rcaron", 611, NULL },
- { "Kcommaaccent", 667, NULL },
- { "greater", 675, NULL },
- { "atilde", 500, NULL },
- { "brokenbar", 275, NULL },
- { "quoteleft", 333, NULL },
- { "Edotaccent", 611, NULL },
- { "onesuperior", 300, NULL }
-};
-
-static BuiltinFontWidth timesRomanWidthsTab[] = {
- { "Ntilde", 722, NULL },
- { "rcaron", 333, NULL },
- { "kcommaaccent", 500, NULL },
- { "Ncommaaccent", 722, NULL },
- { "Zacute", 611, NULL },
- { "comma", 250, NULL },
- { "cedilla", 333, NULL },
- { "plusminus", 564, NULL },
- { "circumflex", 333, NULL },
- { "dotaccent", 333, NULL },
- { "edotaccent", 444, NULL },
- { "asciitilde", 541, NULL },
- { "colon", 278, NULL },
- { "onehalf", 750, NULL },
- { "dollar", 500, NULL },
- { "Lcaron", 611, NULL },
- { "ntilde", 500, NULL },
- { "Aogonek", 722, NULL },
- { "ncommaaccent", 500, NULL },
- { "minus", 564, NULL },
- { "Iogonek", 333, NULL },
- { "zacute", 444, NULL },
- { "yen", 500, NULL },
- { "space", 250, NULL },
- { "Omacron", 722, NULL },
- { "questiondown", 444, NULL },
- { "emdash", 1000, NULL },
- { "Agrave", 722, NULL },
- { "three", 500, NULL },
- { "numbersign", 500, NULL },
- { "lcaron", 344, NULL },
- { "A", 722, NULL },
- { "B", 667, NULL },
- { "C", 667, NULL },
- { "aogonek", 444, NULL },
- { "D", 722, NULL },
- { "E", 611, NULL },
- { "onequarter", 750, NULL },
- { "F", 556, NULL },
- { "G", 722, NULL },
- { "H", 722, NULL },
- { "I", 333, NULL },
- { "J", 389, NULL },
- { "K", 722, NULL },
- { "iogonek", 278, NULL },
- { "backslash", 278, NULL },
- { "L", 611, NULL },
- { "periodcentered", 250, NULL },
- { "M", 889, NULL },
- { "N", 722, NULL },
- { "omacron", 500, NULL },
- { "Tcommaaccent", 611, NULL },
- { "O", 722, NULL },
- { "P", 556, NULL },
- { "Q", 722, NULL },
- { "Uhungarumlaut", 722, NULL },
- { "R", 667, NULL },
- { "Aacute", 722, NULL },
- { "caron", 333, NULL },
- { "S", 556, NULL },
- { "T", 611, NULL },
- { "U", 722, NULL },
- { "agrave", 444, NULL },
- { "V", 722, NULL },
- { "W", 944, NULL },
- { "X", 722, NULL },
- { "question", 444, NULL },
- { "equal", 564, NULL },
- { "Y", 722, NULL },
- { "Z", 611, NULL },
- { "four", 500, NULL },
- { "a", 444, NULL },
- { "Gcommaaccent", 722, NULL },
- { "b", 500, NULL },
- { "c", 444, NULL },
- { "d", 500, NULL },
- { "e", 444, NULL },
- { "f", 333, NULL },
- { "g", 500, NULL },
- { "bullet", 350, NULL },
- { "h", 500, NULL },
- { "i", 278, NULL },
- { "Oslash", 722, NULL },
- { "dagger", 500, NULL },
- { "j", 278, NULL },
- { "k", 500, NULL },
- { "l", 278, NULL },
- { "m", 778, NULL },
- { "n", 500, NULL },
- { "tcommaaccent", 278, NULL },
- { "o", 500, NULL },
- { "ordfeminine", 276, NULL },
- { "ring", 333, NULL },
- { "p", 500, NULL },
- { "q", 500, NULL },
- { "uhungarumlaut", 500, NULL },
- { "r", 333, NULL },
- { "twosuperior", 300, NULL },
- { "aacute", 444, NULL },
- { "s", 389, NULL },
- { "OE", 889, NULL },
- { "t", 278, NULL },
- { "divide", 564, NULL },
- { "u", 500, NULL },
- { "Ccaron", 667, NULL },
- { "v", 500, NULL },
- { "w", 722, NULL },
- { "x", 500, NULL },
- { "y", 500, NULL },
- { "z", 444, NULL },
- { "Gbreve", 722, NULL },
- { "commaaccent", 250, NULL },
- { "hungarumlaut", 333, NULL },
- { "Idotaccent", 333, NULL },
- { "Nacute", 722, NULL },
- { "quotedbl", 408, NULL },
- { "gcommaaccent", 500, NULL },
- { "mu", 500, NULL },
- { "greaterequal", 549, NULL },
- { "Scaron", 556, NULL },
- { "Lslash", 611, NULL },
- { "semicolon", 278, NULL },
- { "oslash", 500, NULL },
- { "lessequal", 549, NULL },
- { "lozenge", 471, NULL },
- { "parenright", 333, NULL },
- { "ccaron", 444, NULL },
- { "Ecircumflex", 611, NULL },
- { "gbreve", 500, NULL },
- { "trademark", 980, NULL },
- { "daggerdbl", 500, NULL },
- { "nacute", 500, NULL },
- { "macron", 333, NULL },
- { "Otilde", 722, NULL },
- { "Emacron", 611, NULL },
- { "ellipsis", 1000, NULL },
- { "scaron", 389, NULL },
- { "AE", 889, NULL },
- { "Ucircumflex", 722, NULL },
- { "lslash", 278, NULL },
- { "quotedblleft", 444, NULL },
- { "guilsinglright", 333, NULL },
- { "hyphen", 333, NULL },
- { "quotesingle", 180, NULL },
- { "eight", 500, NULL },
- { "exclamdown", 333, NULL },
- { "endash", 500, NULL },
- { "oe", 722, NULL },
- { "Abreve", 722, NULL },
- { "Umacron", 722, NULL },
- { "ecircumflex", 444, NULL },
- { "Adieresis", 722, NULL },
- { "copyright", 760, NULL },
- { "Egrave", 611, NULL },
- { "slash", 278, NULL },
- { "Edieresis", 611, NULL },
- { "otilde", 500, NULL },
- { "Idieresis", 333, NULL },
- { "parenleft", 333, NULL },
- { "one", 500, NULL },
- { "emacron", 444, NULL },
- { "Odieresis", 722, NULL },
- { "ucircumflex", 500, NULL },
- { "bracketleft", 333, NULL },
- { "Ugrave", 722, NULL },
- { "quoteright", 333, NULL },
- { "Udieresis", 722, NULL },
- { "perthousand", 1000, NULL },
- { "Ydieresis", 722, NULL },
- { "umacron", 500, NULL },
- { "abreve", 444, NULL },
- { "Eacute", 611, NULL },
- { "adieresis", 444, NULL },
- { "egrave", 444, NULL },
- { "edieresis", 444, NULL },
- { "idieresis", 278, NULL },
- { "Eth", 722, NULL },
- { "ae", 667, NULL },
- { "asterisk", 500, NULL },
- { "odieresis", 500, NULL },
- { "Uacute", 722, NULL },
- { "ugrave", 500, NULL },
- { "nine", 500, NULL },
- { "five", 500, NULL },
- { "udieresis", 500, NULL },
- { "Zcaron", 611, NULL },
- { "Scommaaccent", 556, NULL },
- { "threequarters", 750, NULL },
- { "guillemotright", 500, NULL },
- { "Ccedilla", 667, NULL },
- { "ydieresis", 500, NULL },
- { "tilde", 333, NULL },
- { "at", 921, NULL },
- { "eacute", 444, NULL },
- { "underscore", 500, NULL },
- { "Euro", 500, NULL },
- { "Dcroat", 722, NULL },
- { "multiply", 564, NULL },
- { "zero", 500, NULL },
- { "eth", 500, NULL },
- { "Scedilla", 556, NULL },
- { "Ograve", 722, NULL },
- { "Racute", 667, NULL },
- { "partialdiff", 476, NULL },
- { "uacute", 500, NULL },
- { "braceleft", 480, NULL },
- { "Thorn", 556, NULL },
- { "zcaron", 444, NULL },
- { "scommaaccent", 389, NULL },
- { "ccedilla", 444, NULL },
- { "Dcaron", 722, NULL },
- { "dcroat", 500, NULL },
- { "Ocircumflex", 722, NULL },
- { "Oacute", 722, NULL },
- { "scedilla", 389, NULL },
- { "ogonek", 333, NULL },
- { "ograve", 500, NULL },
- { "racute", 333, NULL },
- { "Tcaron", 611, NULL },
- { "Eogonek", 611, NULL },
- { "thorn", 500, NULL },
- { "degree", 400, NULL },
- { "registered", 760, NULL },
- { "radical", 453, NULL },
- { "Aring", 722, NULL },
- { "percent", 833, NULL },
- { "six", 500, NULL },
- { "paragraph", 453, NULL },
- { "dcaron", 588, NULL },
- { "Uogonek", 722, NULL },
- { "two", 500, NULL },
- { "summation", 600, NULL },
- { "Igrave", 333, NULL },
- { "Lacute", 611, NULL },
- { "ocircumflex", 500, NULL },
- { "oacute", 500, NULL },
- { "Uring", 722, NULL },
- { "Lcommaaccent", 611, NULL },
- { "tcaron", 326, NULL },
- { "eogonek", 444, NULL },
- { "Delta", 612, NULL },
- { "Ohungarumlaut", 722, NULL },
- { "asciicircum", 469, NULL },
- { "aring", 444, NULL },
- { "grave", 333, NULL },
- { "uogonek", 500, NULL },
- { "bracketright", 333, NULL },
- { "Iacute", 333, NULL },
- { "ampersand", 778, NULL },
- { "igrave", 278, NULL },
- { "lacute", 278, NULL },
- { "Ncaron", 722, NULL },
- { "plus", 564, NULL },
- { "uring", 500, NULL },
- { "quotesinglbase", 333, NULL },
- { "lcommaaccent", 278, NULL },
- { "Yacute", 722, NULL },
- { "ohungarumlaut", 500, NULL },
- { "threesuperior", 300, NULL },
- { "acute", 333, NULL },
- { "section", 500, NULL },
- { "dieresis", 333, NULL },
- { "iacute", 278, NULL },
- { "quotedblbase", 444, NULL },
- { "ncaron", 500, NULL },
- { "florin", 500, NULL },
- { "yacute", 500, NULL },
- { "Rcommaaccent", 667, NULL },
- { "fi", 556, NULL },
- { "fl", 556, NULL },
- { "Acircumflex", 722, NULL },
- { "Cacute", 667, NULL },
- { "Icircumflex", 333, NULL },
- { "guillemotleft", 500, NULL },
- { "germandbls", 500, NULL },
- { "Amacron", 722, NULL },
- { "seven", 500, NULL },
- { "Sacute", 556, NULL },
- { "ordmasculine", 310, NULL },
- { "dotlessi", 278, NULL },
- { "sterling", 500, NULL },
- { "notequal", 549, NULL },
- { "Imacron", 333, NULL },
- { "rcommaaccent", 333, NULL },
- { "Zdotaccent", 611, NULL },
- { "acircumflex", 444, NULL },
- { "cacute", 444, NULL },
- { "Ecaron", 611, NULL },
- { "icircumflex", 278, NULL },
- { "braceright", 480, NULL },
- { "quotedblright", 444, NULL },
- { "amacron", 444, NULL },
- { "sacute", 389, NULL },
- { "imacron", 278, NULL },
- { "cent", 500, NULL },
- { "currency", 500, NULL },
- { "logicalnot", 564, NULL },
- { "zdotaccent", 444, NULL },
- { "Atilde", 722, NULL },
- { "breve", 333, NULL },
- { "bar", 200, NULL },
- { "fraction", 167, NULL },
- { "less", 564, NULL },
- { "ecaron", 444, NULL },
- { "guilsinglleft", 333, NULL },
- { "exclam", 333, NULL },
- { "period", 250, NULL },
- { "Rcaron", 667, NULL },
- { "Kcommaaccent", 722, NULL },
- { "greater", 564, NULL },
- { "atilde", 444, NULL },
- { "brokenbar", 200, NULL },
- { "quoteleft", 333, NULL },
- { "Edotaccent", 611, NULL },
- { "onesuperior", 300, NULL }
-};
-
-static BuiltinFontWidth zapfDingbatsWidthsTab[] = {
- { "a81", 438, NULL },
- { "a82", 138, NULL },
- { "a83", 277, NULL },
- { "a84", 415, NULL },
- { "a85", 509, NULL },
- { "a86", 410, NULL },
- { "a87", 234, NULL },
- { "a88", 234, NULL },
- { "a89", 390, NULL },
- { "a140", 788, NULL },
- { "a141", 788, NULL },
- { "a142", 788, NULL },
- { "a143", 788, NULL },
- { "a144", 788, NULL },
- { "a145", 788, NULL },
- { "a146", 788, NULL },
- { "a147", 788, NULL },
- { "a148", 788, NULL },
- { "a149", 788, NULL },
- { "a90", 390, NULL },
- { "a91", 276, NULL },
- { "a92", 276, NULL },
- { "space", 278, NULL },
- { "a93", 317, NULL },
- { "a94", 317, NULL },
- { "a95", 334, NULL },
- { "a96", 334, NULL },
- { "a97", 392, NULL },
- { "a98", 392, NULL },
- { "a99", 668, NULL },
- { "a150", 788, NULL },
- { "a151", 788, NULL },
- { "a152", 788, NULL },
- { "a153", 788, NULL },
- { "a154", 788, NULL },
- { "a155", 788, NULL },
- { "a156", 788, NULL },
- { "a157", 788, NULL },
- { "a158", 788, NULL },
- { "a159", 788, NULL },
- { "a160", 894, NULL },
- { "a161", 838, NULL },
- { "a162", 924, NULL },
- { "a163", 1016, NULL },
- { "a164", 458, NULL },
- { "a165", 924, NULL },
- { "a166", 918, NULL },
- { "a167", 927, NULL },
- { "a168", 928, NULL },
- { "a169", 928, NULL },
- { "a170", 834, NULL },
- { "a171", 873, NULL },
- { "a172", 828, NULL },
- { "a173", 924, NULL },
- { "a174", 917, NULL },
- { "a175", 930, NULL },
- { "a176", 931, NULL },
- { "a177", 463, NULL },
- { "a178", 883, NULL },
- { "a179", 836, NULL },
- { "a180", 867, NULL },
- { "a181", 696, NULL },
- { "a182", 874, NULL },
- { "a183", 760, NULL },
- { "a184", 946, NULL },
- { "a185", 865, NULL },
- { "a186", 967, NULL },
- { "a187", 831, NULL },
- { "a188", 873, NULL },
- { "a189", 927, NULL },
- { "a1", 974, NULL },
- { "a2", 961, NULL },
- { "a3", 980, NULL },
- { "a4", 719, NULL },
- { "a5", 789, NULL },
- { "a6", 494, NULL },
- { "a7", 552, NULL },
- { "a8", 537, NULL },
- { "a9", 577, NULL },
- { "a190", 970, NULL },
- { "a191", 918, NULL },
- { "a192", 748, NULL },
- { "a193", 836, NULL },
- { "a194", 771, NULL },
- { "a195", 888, NULL },
- { "a196", 748, NULL },
- { "a197", 771, NULL },
- { "a198", 888, NULL },
- { "a199", 867, NULL },
- { "a10", 692, NULL },
- { "a11", 960, NULL },
- { "a12", 939, NULL },
- { "a13", 549, NULL },
- { "a14", 855, NULL },
- { "a15", 911, NULL },
- { "a16", 933, NULL },
- { "a17", 945, NULL },
- { "a18", 974, NULL },
- { "a19", 755, NULL },
- { "a20", 846, NULL },
- { "a21", 762, NULL },
- { "a22", 761, NULL },
- { "a23", 571, NULL },
- { "a24", 677, NULL },
- { "a25", 763, NULL },
- { "a26", 760, NULL },
- { "a27", 759, NULL },
- { "a28", 754, NULL },
- { "a29", 786, NULL },
- { "a30", 788, NULL },
- { "a31", 788, NULL },
- { "a32", 790, NULL },
- { "a33", 793, NULL },
- { "a34", 794, NULL },
- { "a35", 816, NULL },
- { "a36", 823, NULL },
- { "a37", 789, NULL },
- { "a38", 841, NULL },
- { "a39", 823, NULL },
- { "a40", 833, NULL },
- { "a41", 816, NULL },
- { "a42", 831, NULL },
- { "a43", 923, NULL },
- { "a44", 744, NULL },
- { "a45", 723, NULL },
- { "a46", 749, NULL },
- { "a47", 790, NULL },
- { "a48", 792, NULL },
- { "a49", 695, NULL },
- { "a100", 668, NULL },
- { "a101", 732, NULL },
- { "a102", 544, NULL },
- { "a103", 544, NULL },
- { "a104", 910, NULL },
- { "a105", 911, NULL },
- { "a106", 667, NULL },
- { "a107", 760, NULL },
- { "a108", 760, NULL },
- { "a109", 626, NULL },
- { "a50", 776, NULL },
- { "a51", 768, NULL },
- { "a52", 792, NULL },
- { "a53", 759, NULL },
- { "a54", 707, NULL },
- { "a55", 708, NULL },
- { "a56", 682, NULL },
- { "a57", 701, NULL },
- { "a58", 826, NULL },
- { "a59", 815, NULL },
- { "a110", 694, NULL },
- { "a111", 595, NULL },
- { "a112", 776, NULL },
- { "a117", 690, NULL },
- { "a118", 791, NULL },
- { "a119", 790, NULL },
- { "a60", 789, NULL },
- { "a61", 789, NULL },
- { "a62", 707, NULL },
- { "a63", 687, NULL },
- { "a64", 696, NULL },
- { "a65", 689, NULL },
- { "a66", 786, NULL },
- { "a67", 787, NULL },
- { "a68", 713, NULL },
- { "a69", 791, NULL },
- { "a200", 696, NULL },
- { "a201", 874, NULL },
- { "a120", 788, NULL },
- { "a121", 788, NULL },
- { "a202", 974, NULL },
- { "a122", 788, NULL },
- { "a203", 762, NULL },
- { "a123", 788, NULL },
- { "a204", 759, NULL },
- { "a124", 788, NULL },
- { "a205", 509, NULL },
- { "a125", 788, NULL },
- { "a206", 410, NULL },
- { "a126", 788, NULL },
- { "a127", 788, NULL },
- { "a128", 788, NULL },
- { "a129", 788, NULL },
- { "a70", 785, NULL },
- { "a71", 791, NULL },
- { "a72", 873, NULL },
- { "a73", 761, NULL },
- { "a74", 762, NULL },
- { "a75", 759, NULL },
- { "a76", 892, NULL },
- { "a77", 892, NULL },
- { "a78", 788, NULL },
- { "a79", 784, NULL },
- { "a130", 788, NULL },
- { "a131", 788, NULL },
- { "a132", 788, NULL },
- { "a133", 788, NULL },
- { "a134", 788, NULL },
- { "a135", 788, NULL },
- { "a136", 788, NULL },
- { "a137", 788, NULL },
- { "a138", 788, NULL },
- { "a139", 788, NULL }
-};
-
-BuiltinFont builtinFonts[] = {
- { "Courier", standardEncoding, 629, -157, { -23, -250, 715, 805}, NULL },
- { "Courier-Bold", standardEncoding, 629, -157, {-113, -250, 749, 801}, NULL },
- { "Courier-BoldOblique", standardEncoding, 629, -157, { -57, -250, 869, 801}, NULL },
- { "Courier-Oblique", standardEncoding, 629, -157, { -27, -250, 849, 805}, NULL },
- { "Helvetica", standardEncoding, 718, -207, {-166, -225, 1000, 931}, NULL },
- { "Helvetica-Bold", standardEncoding, 718, -207, {-170, -228, 1003, 962}, NULL },
- { "Helvetica-BoldOblique", standardEncoding, 718, -207, {-174, -228, 1114, 962}, NULL },
- { "Helvetica-Oblique", standardEncoding, 718, -207, {-170, -225, 1116, 931}, NULL },
- { "Symbol", symbolEncoding, 1010, -293, {-180, -293, 1090, 1010}, NULL },
- { "Times-Bold", standardEncoding, 683, -217, {-168, -218, 1000, 935}, NULL },
- { "Times-BoldItalic", standardEncoding, 683, -217, {-200, -218, 996, 921}, NULL },
- { "Times-Italic", standardEncoding, 683, -217, {-169, -217, 1010, 883}, NULL },
- { "Times-Roman", standardEncoding, 683, -217, {-168, -218, 1000, 898}, NULL },
- { "ZapfDingbats", zapfDingbatsEncoding, 820, -143, { -1, -143, 981, 820}, NULL }
-};
-
-BuiltinFont *builtinFontSubst[] = {
- &builtinFonts[0],
- &builtinFonts[3],
- &builtinFonts[1],
- &builtinFonts[2],
- &builtinFonts[4],
- &builtinFonts[7],
- &builtinFonts[5],
- &builtinFonts[6],
- &builtinFonts[12],
- &builtinFonts[11],
- &builtinFonts[9],
- &builtinFonts[10]
-};
-
-void initBuiltinFontTables() {
- builtinFonts[0].widths = new BuiltinFontWidths(courierWidthsTab, 315);
- builtinFonts[1].widths = new BuiltinFontWidths(courierBoldWidthsTab, 315);
- builtinFonts[2].widths = new BuiltinFontWidths(courierBoldObliqueWidthsTab, 315);
- builtinFonts[3].widths = new BuiltinFontWidths(courierObliqueWidthsTab, 315);
- builtinFonts[4].widths = new BuiltinFontWidths(helveticaWidthsTab, 315);
- builtinFonts[5].widths = new BuiltinFontWidths(helveticaBoldWidthsTab, 316);
- builtinFonts[6].widths = new BuiltinFontWidths(helveticaBoldObliqueWidthsTab, 315);
- builtinFonts[7].widths = new BuiltinFontWidths(helveticaObliqueWidthsTab, 315);
- builtinFonts[8].widths = new BuiltinFontWidths(symbolWidthsTab, 190);
- builtinFonts[9].widths = new BuiltinFontWidths(timesBoldWidthsTab, 315);
- builtinFonts[10].widths = new BuiltinFontWidths(timesBoldItalicWidthsTab, 315);
- builtinFonts[11].widths = new BuiltinFontWidths(timesItalicWidthsTab, 315);
- builtinFonts[12].widths = new BuiltinFontWidths(timesRomanWidthsTab, 315);
- builtinFonts[13].widths = new BuiltinFontWidths(zapfDingbatsWidthsTab, 202);
-}
-
-void freeBuiltinFontTables() {
- int i;
-
- for (i = 0; i < 14; ++i) {
- delete builtinFonts[i].widths;
- }
-}
diff --git a/kpdf/xpdf/xpdf/BuiltinFontTables.cpp b/kpdf/xpdf/xpdf/BuiltinFontTables.cpp
new file mode 100644
index 00000000..9779946f
--- /dev/null
+++ b/kpdf/xpdf/xpdf/BuiltinFontTables.cpp
@@ -0,0 +1,4284 @@
+//========================================================================
+//
+// BuiltinFontTables.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+#include <stdlib.h>
+#include "FontEncodingTables.h"
+#include "BuiltinFontTables.h"
+
+static BuiltinFontWidth courierWidthsTab[] = {
+ { "Ntilde", 600, NULL },
+ { "rcaron", 600, NULL },
+ { "kcommaaccent", 600, NULL },
+ { "Ncommaaccent", 600, NULL },
+ { "Zacute", 600, NULL },
+ { "comma", 600, NULL },
+ { "cedilla", 600, NULL },
+ { "plusminus", 600, NULL },
+ { "circumflex", 600, NULL },
+ { "dotaccent", 600, NULL },
+ { "edotaccent", 600, NULL },
+ { "asciitilde", 600, NULL },
+ { "colon", 600, NULL },
+ { "onehalf", 600, NULL },
+ { "dollar", 600, NULL },
+ { "Lcaron", 600, NULL },
+ { "ntilde", 600, NULL },
+ { "Aogonek", 600, NULL },
+ { "ncommaaccent", 600, NULL },
+ { "minus", 600, NULL },
+ { "Iogonek", 600, NULL },
+ { "zacute", 600, NULL },
+ { "yen", 600, NULL },
+ { "space", 600, NULL },
+ { "Omacron", 600, NULL },
+ { "questiondown", 600, NULL },
+ { "emdash", 600, NULL },
+ { "Agrave", 600, NULL },
+ { "three", 600, NULL },
+ { "numbersign", 600, NULL },
+ { "lcaron", 600, NULL },
+ { "A", 600, NULL },
+ { "B", 600, NULL },
+ { "C", 600, NULL },
+ { "aogonek", 600, NULL },
+ { "D", 600, NULL },
+ { "E", 600, NULL },
+ { "onequarter", 600, NULL },
+ { "F", 600, NULL },
+ { "G", 600, NULL },
+ { "H", 600, NULL },
+ { "I", 600, NULL },
+ { "J", 600, NULL },
+ { "K", 600, NULL },
+ { "iogonek", 600, NULL },
+ { "L", 600, NULL },
+ { "backslash", 600, NULL },
+ { "periodcentered", 600, NULL },
+ { "M", 600, NULL },
+ { "N", 600, NULL },
+ { "omacron", 600, NULL },
+ { "Tcommaaccent", 600, NULL },
+ { "O", 600, NULL },
+ { "P", 600, NULL },
+ { "Q", 600, NULL },
+ { "Uhungarumlaut", 600, NULL },
+ { "R", 600, NULL },
+ { "Aacute", 600, NULL },
+ { "caron", 600, NULL },
+ { "S", 600, NULL },
+ { "T", 600, NULL },
+ { "U", 600, NULL },
+ { "agrave", 600, NULL },
+ { "V", 600, NULL },
+ { "W", 600, NULL },
+ { "equal", 600, NULL },
+ { "question", 600, NULL },
+ { "X", 600, NULL },
+ { "Y", 600, NULL },
+ { "Z", 600, NULL },
+ { "four", 600, NULL },
+ { "a", 600, NULL },
+ { "Gcommaaccent", 600, NULL },
+ { "b", 600, NULL },
+ { "c", 600, NULL },
+ { "d", 600, NULL },
+ { "e", 600, NULL },
+ { "f", 600, NULL },
+ { "g", 600, NULL },
+ { "bullet", 600, NULL },
+ { "h", 600, NULL },
+ { "i", 600, NULL },
+ { "Oslash", 600, NULL },
+ { "dagger", 600, NULL },
+ { "j", 600, NULL },
+ { "k", 600, NULL },
+ { "l", 600, NULL },
+ { "m", 600, NULL },
+ { "n", 600, NULL },
+ { "tcommaaccent", 600, NULL },
+ { "o", 600, NULL },
+ { "ordfeminine", 600, NULL },
+ { "ring", 600, NULL },
+ { "p", 600, NULL },
+ { "q", 600, NULL },
+ { "uhungarumlaut", 600, NULL },
+ { "r", 600, NULL },
+ { "twosuperior", 600, NULL },
+ { "aacute", 600, NULL },
+ { "s", 600, NULL },
+ { "OE", 600, NULL },
+ { "t", 600, NULL },
+ { "divide", 600, NULL },
+ { "u", 600, NULL },
+ { "Ccaron", 600, NULL },
+ { "v", 600, NULL },
+ { "w", 600, NULL },
+ { "x", 600, NULL },
+ { "y", 600, NULL },
+ { "z", 600, NULL },
+ { "Gbreve", 600, NULL },
+ { "commaaccent", 600, NULL },
+ { "hungarumlaut", 600, NULL },
+ { "Idotaccent", 600, NULL },
+ { "Nacute", 600, NULL },
+ { "quotedbl", 600, NULL },
+ { "gcommaaccent", 600, NULL },
+ { "mu", 600, NULL },
+ { "greaterequal", 600, NULL },
+ { "Scaron", 600, NULL },
+ { "Lslash", 600, NULL },
+ { "semicolon", 600, NULL },
+ { "oslash", 600, NULL },
+ { "lessequal", 600, NULL },
+ { "lozenge", 600, NULL },
+ { "parenright", 600, NULL },
+ { "ccaron", 600, NULL },
+ { "Ecircumflex", 600, NULL },
+ { "gbreve", 600, NULL },
+ { "trademark", 600, NULL },
+ { "daggerdbl", 600, NULL },
+ { "nacute", 600, NULL },
+ { "macron", 600, NULL },
+ { "Otilde", 600, NULL },
+ { "Emacron", 600, NULL },
+ { "ellipsis", 600, NULL },
+ { "scaron", 600, NULL },
+ { "AE", 600, NULL },
+ { "Ucircumflex", 600, NULL },
+ { "lslash", 600, NULL },
+ { "quotedblleft", 600, NULL },
+ { "hyphen", 600, NULL },
+ { "guilsinglright", 600, NULL },
+ { "quotesingle", 600, NULL },
+ { "eight", 600, NULL },
+ { "exclamdown", 600, NULL },
+ { "endash", 600, NULL },
+ { "oe", 600, NULL },
+ { "Abreve", 600, NULL },
+ { "Umacron", 600, NULL },
+ { "ecircumflex", 600, NULL },
+ { "Adieresis", 600, NULL },
+ { "copyright", 600, NULL },
+ { "Egrave", 600, NULL },
+ { "slash", 600, NULL },
+ { "Edieresis", 600, NULL },
+ { "otilde", 600, NULL },
+ { "Idieresis", 600, NULL },
+ { "parenleft", 600, NULL },
+ { "one", 600, NULL },
+ { "emacron", 600, NULL },
+ { "Odieresis", 600, NULL },
+ { "ucircumflex", 600, NULL },
+ { "bracketleft", 600, NULL },
+ { "Ugrave", 600, NULL },
+ { "quoteright", 600, NULL },
+ { "Udieresis", 600, NULL },
+ { "perthousand", 600, NULL },
+ { "Ydieresis", 600, NULL },
+ { "umacron", 600, NULL },
+ { "abreve", 600, NULL },
+ { "Eacute", 600, NULL },
+ { "adieresis", 600, NULL },
+ { "egrave", 600, NULL },
+ { "edieresis", 600, NULL },
+ { "idieresis", 600, NULL },
+ { "Eth", 600, NULL },
+ { "ae", 600, NULL },
+ { "asterisk", 600, NULL },
+ { "odieresis", 600, NULL },
+ { "Uacute", 600, NULL },
+ { "ugrave", 600, NULL },
+ { "five", 600, NULL },
+ { "nine", 600, NULL },
+ { "udieresis", 600, NULL },
+ { "Zcaron", 600, NULL },
+ { "Scommaaccent", 600, NULL },
+ { "threequarters", 600, NULL },
+ { "guillemotright", 600, NULL },
+ { "Ccedilla", 600, NULL },
+ { "ydieresis", 600, NULL },
+ { "tilde", 600, NULL },
+ { "at", 600, NULL },
+ { "eacute", 600, NULL },
+ { "underscore", 600, NULL },
+ { "Euro", 600, NULL },
+ { "Dcroat", 600, NULL },
+ { "zero", 600, NULL },
+ { "multiply", 600, NULL },
+ { "eth", 600, NULL },
+ { "Scedilla", 600, NULL },
+ { "Racute", 600, NULL },
+ { "Ograve", 600, NULL },
+ { "partialdiff", 600, NULL },
+ { "uacute", 600, NULL },
+ { "braceleft", 600, NULL },
+ { "Thorn", 600, NULL },
+ { "zcaron", 600, NULL },
+ { "scommaaccent", 600, NULL },
+ { "ccedilla", 600, NULL },
+ { "Dcaron", 600, NULL },
+ { "dcroat", 600, NULL },
+ { "scedilla", 600, NULL },
+ { "Oacute", 600, NULL },
+ { "Ocircumflex", 600, NULL },
+ { "ogonek", 600, NULL },
+ { "ograve", 600, NULL },
+ { "racute", 600, NULL },
+ { "Tcaron", 600, NULL },
+ { "Eogonek", 600, NULL },
+ { "thorn", 600, NULL },
+ { "degree", 600, NULL },
+ { "registered", 600, NULL },
+ { "radical", 600, NULL },
+ { "Aring", 600, NULL },
+ { "percent", 600, NULL },
+ { "six", 600, NULL },
+ { "paragraph", 600, NULL },
+ { "dcaron", 600, NULL },
+ { "Uogonek", 600, NULL },
+ { "two", 600, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 600, NULL },
+ { "Lacute", 600, NULL },
+ { "ocircumflex", 600, NULL },
+ { "oacute", 600, NULL },
+ { "Uring", 600, NULL },
+ { "Lcommaaccent", 600, NULL },
+ { "tcaron", 600, NULL },
+ { "eogonek", 600, NULL },
+ { "Delta", 600, NULL },
+ { "Ohungarumlaut", 600, NULL },
+ { "asciicircum", 600, NULL },
+ { "aring", 600, NULL },
+ { "grave", 600, NULL },
+ { "uogonek", 600, NULL },
+ { "bracketright", 600, NULL },
+ { "ampersand", 600, NULL },
+ { "Iacute", 600, NULL },
+ { "lacute", 600, NULL },
+ { "igrave", 600, NULL },
+ { "Ncaron", 600, NULL },
+ { "plus", 600, NULL },
+ { "uring", 600, NULL },
+ { "quotesinglbase", 600, NULL },
+ { "lcommaaccent", 600, NULL },
+ { "Yacute", 600, NULL },
+ { "ohungarumlaut", 600, NULL },
+ { "threesuperior", 600, NULL },
+ { "acute", 600, NULL },
+ { "section", 600, NULL },
+ { "dieresis", 600, NULL },
+ { "quotedblbase", 600, NULL },
+ { "iacute", 600, NULL },
+ { "ncaron", 600, NULL },
+ { "florin", 600, NULL },
+ { "yacute", 600, NULL },
+ { "Rcommaaccent", 600, NULL },
+ { "fi", 600, NULL },
+ { "fl", 600, NULL },
+ { "Acircumflex", 600, NULL },
+ { "Cacute", 600, NULL },
+ { "Icircumflex", 600, NULL },
+ { "guillemotleft", 600, NULL },
+ { "germandbls", 600, NULL },
+ { "seven", 600, NULL },
+ { "Amacron", 600, NULL },
+ { "Sacute", 600, NULL },
+ { "ordmasculine", 600, NULL },
+ { "dotlessi", 600, NULL },
+ { "sterling", 600, NULL },
+ { "notequal", 600, NULL },
+ { "Imacron", 600, NULL },
+ { "rcommaaccent", 600, NULL },
+ { "Zdotaccent", 600, NULL },
+ { "acircumflex", 600, NULL },
+ { "cacute", 600, NULL },
+ { "Ecaron", 600, NULL },
+ { "braceright", 600, NULL },
+ { "icircumflex", 600, NULL },
+ { "quotedblright", 600, NULL },
+ { "amacron", 600, NULL },
+ { "sacute", 600, NULL },
+ { "imacron", 600, NULL },
+ { "cent", 600, NULL },
+ { "currency", 600, NULL },
+ { "logicalnot", 600, NULL },
+ { "zdotaccent", 600, NULL },
+ { "Atilde", 600, NULL },
+ { "breve", 600, NULL },
+ { "bar", 600, NULL },
+ { "fraction", 600, NULL },
+ { "less", 600, NULL },
+ { "ecaron", 600, NULL },
+ { "guilsinglleft", 600, NULL },
+ { "exclam", 600, NULL },
+ { "period", 600, NULL },
+ { "Rcaron", 600, NULL },
+ { "Kcommaaccent", 600, NULL },
+ { "greater", 600, NULL },
+ { "atilde", 600, NULL },
+ { "brokenbar", 600, NULL },
+ { "quoteleft", 600, NULL },
+ { "Edotaccent", 600, NULL },
+ { "onesuperior", 600, NULL }
+};
+
+static BuiltinFontWidth courierBoldWidthsTab[] = {
+ { "Ntilde", 600, NULL },
+ { "rcaron", 600, NULL },
+ { "kcommaaccent", 600, NULL },
+ { "Ncommaaccent", 600, NULL },
+ { "Zacute", 600, NULL },
+ { "comma", 600, NULL },
+ { "cedilla", 600, NULL },
+ { "plusminus", 600, NULL },
+ { "circumflex", 600, NULL },
+ { "dotaccent", 600, NULL },
+ { "edotaccent", 600, NULL },
+ { "asciitilde", 600, NULL },
+ { "colon", 600, NULL },
+ { "onehalf", 600, NULL },
+ { "dollar", 600, NULL },
+ { "Lcaron", 600, NULL },
+ { "ntilde", 600, NULL },
+ { "Aogonek", 600, NULL },
+ { "ncommaaccent", 600, NULL },
+ { "minus", 600, NULL },
+ { "Iogonek", 600, NULL },
+ { "zacute", 600, NULL },
+ { "yen", 600, NULL },
+ { "space", 600, NULL },
+ { "Omacron", 600, NULL },
+ { "questiondown", 600, NULL },
+ { "emdash", 600, NULL },
+ { "Agrave", 600, NULL },
+ { "three", 600, NULL },
+ { "numbersign", 600, NULL },
+ { "lcaron", 600, NULL },
+ { "A", 600, NULL },
+ { "B", 600, NULL },
+ { "C", 600, NULL },
+ { "aogonek", 600, NULL },
+ { "D", 600, NULL },
+ { "E", 600, NULL },
+ { "onequarter", 600, NULL },
+ { "F", 600, NULL },
+ { "G", 600, NULL },
+ { "H", 600, NULL },
+ { "I", 600, NULL },
+ { "J", 600, NULL },
+ { "K", 600, NULL },
+ { "iogonek", 600, NULL },
+ { "backslash", 600, NULL },
+ { "L", 600, NULL },
+ { "periodcentered", 600, NULL },
+ { "M", 600, NULL },
+ { "N", 600, NULL },
+ { "omacron", 600, NULL },
+ { "Tcommaaccent", 600, NULL },
+ { "O", 600, NULL },
+ { "P", 600, NULL },
+ { "Q", 600, NULL },
+ { "Uhungarumlaut", 600, NULL },
+ { "R", 600, NULL },
+ { "Aacute", 600, NULL },
+ { "caron", 600, NULL },
+ { "S", 600, NULL },
+ { "T", 600, NULL },
+ { "U", 600, NULL },
+ { "agrave", 600, NULL },
+ { "V", 600, NULL },
+ { "W", 600, NULL },
+ { "X", 600, NULL },
+ { "question", 600, NULL },
+ { "equal", 600, NULL },
+ { "Y", 600, NULL },
+ { "Z", 600, NULL },
+ { "four", 600, NULL },
+ { "a", 600, NULL },
+ { "Gcommaaccent", 600, NULL },
+ { "b", 600, NULL },
+ { "c", 600, NULL },
+ { "d", 600, NULL },
+ { "e", 600, NULL },
+ { "f", 600, NULL },
+ { "g", 600, NULL },
+ { "bullet", 600, NULL },
+ { "h", 600, NULL },
+ { "i", 600, NULL },
+ { "Oslash", 600, NULL },
+ { "dagger", 600, NULL },
+ { "j", 600, NULL },
+ { "k", 600, NULL },
+ { "l", 600, NULL },
+ { "m", 600, NULL },
+ { "n", 600, NULL },
+ { "tcommaaccent", 600, NULL },
+ { "o", 600, NULL },
+ { "ordfeminine", 600, NULL },
+ { "ring", 600, NULL },
+ { "p", 600, NULL },
+ { "q", 600, NULL },
+ { "uhungarumlaut", 600, NULL },
+ { "r", 600, NULL },
+ { "twosuperior", 600, NULL },
+ { "aacute", 600, NULL },
+ { "s", 600, NULL },
+ { "OE", 600, NULL },
+ { "t", 600, NULL },
+ { "divide", 600, NULL },
+ { "u", 600, NULL },
+ { "Ccaron", 600, NULL },
+ { "v", 600, NULL },
+ { "w", 600, NULL },
+ { "x", 600, NULL },
+ { "y", 600, NULL },
+ { "z", 600, NULL },
+ { "Gbreve", 600, NULL },
+ { "commaaccent", 600, NULL },
+ { "hungarumlaut", 600, NULL },
+ { "Idotaccent", 600, NULL },
+ { "Nacute", 600, NULL },
+ { "quotedbl", 600, NULL },
+ { "gcommaaccent", 600, NULL },
+ { "mu", 600, NULL },
+ { "greaterequal", 600, NULL },
+ { "Scaron", 600, NULL },
+ { "Lslash", 600, NULL },
+ { "semicolon", 600, NULL },
+ { "oslash", 600, NULL },
+ { "lessequal", 600, NULL },
+ { "lozenge", 600, NULL },
+ { "parenright", 600, NULL },
+ { "ccaron", 600, NULL },
+ { "Ecircumflex", 600, NULL },
+ { "gbreve", 600, NULL },
+ { "trademark", 600, NULL },
+ { "daggerdbl", 600, NULL },
+ { "nacute", 600, NULL },
+ { "macron", 600, NULL },
+ { "Otilde", 600, NULL },
+ { "Emacron", 600, NULL },
+ { "ellipsis", 600, NULL },
+ { "scaron", 600, NULL },
+ { "AE", 600, NULL },
+ { "Ucircumflex", 600, NULL },
+ { "lslash", 600, NULL },
+ { "quotedblleft", 600, NULL },
+ { "guilsinglright", 600, NULL },
+ { "hyphen", 600, NULL },
+ { "quotesingle", 600, NULL },
+ { "eight", 600, NULL },
+ { "exclamdown", 600, NULL },
+ { "endash", 600, NULL },
+ { "oe", 600, NULL },
+ { "Abreve", 600, NULL },
+ { "Umacron", 600, NULL },
+ { "ecircumflex", 600, NULL },
+ { "Adieresis", 600, NULL },
+ { "copyright", 600, NULL },
+ { "Egrave", 600, NULL },
+ { "slash", 600, NULL },
+ { "Edieresis", 600, NULL },
+ { "otilde", 600, NULL },
+ { "Idieresis", 600, NULL },
+ { "parenleft", 600, NULL },
+ { "one", 600, NULL },
+ { "emacron", 600, NULL },
+ { "Odieresis", 600, NULL },
+ { "ucircumflex", 600, NULL },
+ { "bracketleft", 600, NULL },
+ { "Ugrave", 600, NULL },
+ { "quoteright", 600, NULL },
+ { "Udieresis", 600, NULL },
+ { "perthousand", 600, NULL },
+ { "Ydieresis", 600, NULL },
+ { "umacron", 600, NULL },
+ { "abreve", 600, NULL },
+ { "Eacute", 600, NULL },
+ { "adieresis", 600, NULL },
+ { "egrave", 600, NULL },
+ { "edieresis", 600, NULL },
+ { "idieresis", 600, NULL },
+ { "Eth", 600, NULL },
+ { "ae", 600, NULL },
+ { "asterisk", 600, NULL },
+ { "odieresis", 600, NULL },
+ { "Uacute", 600, NULL },
+ { "ugrave", 600, NULL },
+ { "nine", 600, NULL },
+ { "five", 600, NULL },
+ { "udieresis", 600, NULL },
+ { "Zcaron", 600, NULL },
+ { "Scommaaccent", 600, NULL },
+ { "threequarters", 600, NULL },
+ { "guillemotright", 600, NULL },
+ { "Ccedilla", 600, NULL },
+ { "ydieresis", 600, NULL },
+ { "tilde", 600, NULL },
+ { "at", 600, NULL },
+ { "eacute", 600, NULL },
+ { "underscore", 600, NULL },
+ { "Euro", 600, NULL },
+ { "Dcroat", 600, NULL },
+ { "multiply", 600, NULL },
+ { "zero", 600, NULL },
+ { "eth", 600, NULL },
+ { "Scedilla", 600, NULL },
+ { "Ograve", 600, NULL },
+ { "Racute", 600, NULL },
+ { "partialdiff", 600, NULL },
+ { "uacute", 600, NULL },
+ { "braceleft", 600, NULL },
+ { "Thorn", 600, NULL },
+ { "zcaron", 600, NULL },
+ { "scommaaccent", 600, NULL },
+ { "ccedilla", 600, NULL },
+ { "Dcaron", 600, NULL },
+ { "dcroat", 600, NULL },
+ { "Ocircumflex", 600, NULL },
+ { "Oacute", 600, NULL },
+ { "scedilla", 600, NULL },
+ { "ogonek", 600, NULL },
+ { "ograve", 600, NULL },
+ { "racute", 600, NULL },
+ { "Tcaron", 600, NULL },
+ { "Eogonek", 600, NULL },
+ { "thorn", 600, NULL },
+ { "degree", 600, NULL },
+ { "registered", 600, NULL },
+ { "radical", 600, NULL },
+ { "Aring", 600, NULL },
+ { "percent", 600, NULL },
+ { "six", 600, NULL },
+ { "paragraph", 600, NULL },
+ { "dcaron", 600, NULL },
+ { "Uogonek", 600, NULL },
+ { "two", 600, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 600, NULL },
+ { "Lacute", 600, NULL },
+ { "ocircumflex", 600, NULL },
+ { "oacute", 600, NULL },
+ { "Uring", 600, NULL },
+ { "Lcommaaccent", 600, NULL },
+ { "tcaron", 600, NULL },
+ { "eogonek", 600, NULL },
+ { "Delta", 600, NULL },
+ { "Ohungarumlaut", 600, NULL },
+ { "asciicircum", 600, NULL },
+ { "aring", 600, NULL },
+ { "grave", 600, NULL },
+ { "uogonek", 600, NULL },
+ { "bracketright", 600, NULL },
+ { "Iacute", 600, NULL },
+ { "ampersand", 600, NULL },
+ { "igrave", 600, NULL },
+ { "lacute", 600, NULL },
+ { "Ncaron", 600, NULL },
+ { "plus", 600, NULL },
+ { "uring", 600, NULL },
+ { "quotesinglbase", 600, NULL },
+ { "lcommaaccent", 600, NULL },
+ { "Yacute", 600, NULL },
+ { "ohungarumlaut", 600, NULL },
+ { "threesuperior", 600, NULL },
+ { "acute", 600, NULL },
+ { "section", 600, NULL },
+ { "dieresis", 600, NULL },
+ { "iacute", 600, NULL },
+ { "quotedblbase", 600, NULL },
+ { "ncaron", 600, NULL },
+ { "florin", 600, NULL },
+ { "yacute", 600, NULL },
+ { "Rcommaaccent", 600, NULL },
+ { "fi", 600, NULL },
+ { "fl", 600, NULL },
+ { "Acircumflex", 600, NULL },
+ { "Cacute", 600, NULL },
+ { "Icircumflex", 600, NULL },
+ { "guillemotleft", 600, NULL },
+ { "germandbls", 600, NULL },
+ { "Amacron", 600, NULL },
+ { "seven", 600, NULL },
+ { "Sacute", 600, NULL },
+ { "ordmasculine", 600, NULL },
+ { "dotlessi", 600, NULL },
+ { "sterling", 600, NULL },
+ { "notequal", 600, NULL },
+ { "Imacron", 600, NULL },
+ { "rcommaaccent", 600, NULL },
+ { "Zdotaccent", 600, NULL },
+ { "acircumflex", 600, NULL },
+ { "cacute", 600, NULL },
+ { "Ecaron", 600, NULL },
+ { "icircumflex", 600, NULL },
+ { "braceright", 600, NULL },
+ { "quotedblright", 600, NULL },
+ { "amacron", 600, NULL },
+ { "sacute", 600, NULL },
+ { "imacron", 600, NULL },
+ { "cent", 600, NULL },
+ { "currency", 600, NULL },
+ { "logicalnot", 600, NULL },
+ { "zdotaccent", 600, NULL },
+ { "Atilde", 600, NULL },
+ { "breve", 600, NULL },
+ { "bar", 600, NULL },
+ { "fraction", 600, NULL },
+ { "less", 600, NULL },
+ { "ecaron", 600, NULL },
+ { "guilsinglleft", 600, NULL },
+ { "exclam", 600, NULL },
+ { "period", 600, NULL },
+ { "Rcaron", 600, NULL },
+ { "Kcommaaccent", 600, NULL },
+ { "greater", 600, NULL },
+ { "atilde", 600, NULL },
+ { "brokenbar", 600, NULL },
+ { "quoteleft", 600, NULL },
+ { "Edotaccent", 600, NULL },
+ { "onesuperior", 600, NULL }
+};
+
+static BuiltinFontWidth courierBoldObliqueWidthsTab[] = {
+ { "Ntilde", 600, NULL },
+ { "rcaron", 600, NULL },
+ { "kcommaaccent", 600, NULL },
+ { "Ncommaaccent", 600, NULL },
+ { "Zacute", 600, NULL },
+ { "comma", 600, NULL },
+ { "cedilla", 600, NULL },
+ { "plusminus", 600, NULL },
+ { "circumflex", 600, NULL },
+ { "dotaccent", 600, NULL },
+ { "edotaccent", 600, NULL },
+ { "asciitilde", 600, NULL },
+ { "colon", 600, NULL },
+ { "onehalf", 600, NULL },
+ { "dollar", 600, NULL },
+ { "Lcaron", 600, NULL },
+ { "ntilde", 600, NULL },
+ { "Aogonek", 600, NULL },
+ { "ncommaaccent", 600, NULL },
+ { "minus", 600, NULL },
+ { "Iogonek", 600, NULL },
+ { "zacute", 600, NULL },
+ { "yen", 600, NULL },
+ { "space", 600, NULL },
+ { "Omacron", 600, NULL },
+ { "questiondown", 600, NULL },
+ { "emdash", 600, NULL },
+ { "Agrave", 600, NULL },
+ { "three", 600, NULL },
+ { "numbersign", 600, NULL },
+ { "lcaron", 600, NULL },
+ { "A", 600, NULL },
+ { "B", 600, NULL },
+ { "C", 600, NULL },
+ { "aogonek", 600, NULL },
+ { "D", 600, NULL },
+ { "E", 600, NULL },
+ { "onequarter", 600, NULL },
+ { "F", 600, NULL },
+ { "G", 600, NULL },
+ { "H", 600, NULL },
+ { "I", 600, NULL },
+ { "J", 600, NULL },
+ { "K", 600, NULL },
+ { "iogonek", 600, NULL },
+ { "backslash", 600, NULL },
+ { "L", 600, NULL },
+ { "periodcentered", 600, NULL },
+ { "M", 600, NULL },
+ { "N", 600, NULL },
+ { "omacron", 600, NULL },
+ { "Tcommaaccent", 600, NULL },
+ { "O", 600, NULL },
+ { "P", 600, NULL },
+ { "Q", 600, NULL },
+ { "Uhungarumlaut", 600, NULL },
+ { "R", 600, NULL },
+ { "Aacute", 600, NULL },
+ { "caron", 600, NULL },
+ { "S", 600, NULL },
+ { "T", 600, NULL },
+ { "U", 600, NULL },
+ { "agrave", 600, NULL },
+ { "V", 600, NULL },
+ { "W", 600, NULL },
+ { "X", 600, NULL },
+ { "question", 600, NULL },
+ { "equal", 600, NULL },
+ { "Y", 600, NULL },
+ { "Z", 600, NULL },
+ { "four", 600, NULL },
+ { "a", 600, NULL },
+ { "Gcommaaccent", 600, NULL },
+ { "b", 600, NULL },
+ { "c", 600, NULL },
+ { "d", 600, NULL },
+ { "e", 600, NULL },
+ { "f", 600, NULL },
+ { "g", 600, NULL },
+ { "bullet", 600, NULL },
+ { "h", 600, NULL },
+ { "i", 600, NULL },
+ { "Oslash", 600, NULL },
+ { "dagger", 600, NULL },
+ { "j", 600, NULL },
+ { "k", 600, NULL },
+ { "l", 600, NULL },
+ { "m", 600, NULL },
+ { "n", 600, NULL },
+ { "tcommaaccent", 600, NULL },
+ { "o", 600, NULL },
+ { "ordfeminine", 600, NULL },
+ { "ring", 600, NULL },
+ { "p", 600, NULL },
+ { "q", 600, NULL },
+ { "uhungarumlaut", 600, NULL },
+ { "r", 600, NULL },
+ { "twosuperior", 600, NULL },
+ { "aacute", 600, NULL },
+ { "s", 600, NULL },
+ { "OE", 600, NULL },
+ { "t", 600, NULL },
+ { "divide", 600, NULL },
+ { "u", 600, NULL },
+ { "Ccaron", 600, NULL },
+ { "v", 600, NULL },
+ { "w", 600, NULL },
+ { "x", 600, NULL },
+ { "y", 600, NULL },
+ { "z", 600, NULL },
+ { "Gbreve", 600, NULL },
+ { "commaaccent", 600, NULL },
+ { "hungarumlaut", 600, NULL },
+ { "Idotaccent", 600, NULL },
+ { "Nacute", 600, NULL },
+ { "quotedbl", 600, NULL },
+ { "gcommaaccent", 600, NULL },
+ { "mu", 600, NULL },
+ { "greaterequal", 600, NULL },
+ { "Scaron", 600, NULL },
+ { "Lslash", 600, NULL },
+ { "semicolon", 600, NULL },
+ { "oslash", 600, NULL },
+ { "lessequal", 600, NULL },
+ { "lozenge", 600, NULL },
+ { "parenright", 600, NULL },
+ { "ccaron", 600, NULL },
+ { "Ecircumflex", 600, NULL },
+ { "gbreve", 600, NULL },
+ { "trademark", 600, NULL },
+ { "daggerdbl", 600, NULL },
+ { "nacute", 600, NULL },
+ { "macron", 600, NULL },
+ { "Otilde", 600, NULL },
+ { "Emacron", 600, NULL },
+ { "ellipsis", 600, NULL },
+ { "scaron", 600, NULL },
+ { "AE", 600, NULL },
+ { "Ucircumflex", 600, NULL },
+ { "lslash", 600, NULL },
+ { "quotedblleft", 600, NULL },
+ { "guilsinglright", 600, NULL },
+ { "hyphen", 600, NULL },
+ { "quotesingle", 600, NULL },
+ { "eight", 600, NULL },
+ { "exclamdown", 600, NULL },
+ { "endash", 600, NULL },
+ { "oe", 600, NULL },
+ { "Abreve", 600, NULL },
+ { "Umacron", 600, NULL },
+ { "ecircumflex", 600, NULL },
+ { "Adieresis", 600, NULL },
+ { "copyright", 600, NULL },
+ { "Egrave", 600, NULL },
+ { "slash", 600, NULL },
+ { "Edieresis", 600, NULL },
+ { "otilde", 600, NULL },
+ { "Idieresis", 600, NULL },
+ { "parenleft", 600, NULL },
+ { "one", 600, NULL },
+ { "emacron", 600, NULL },
+ { "Odieresis", 600, NULL },
+ { "ucircumflex", 600, NULL },
+ { "bracketleft", 600, NULL },
+ { "Ugrave", 600, NULL },
+ { "quoteright", 600, NULL },
+ { "Udieresis", 600, NULL },
+ { "perthousand", 600, NULL },
+ { "Ydieresis", 600, NULL },
+ { "umacron", 600, NULL },
+ { "abreve", 600, NULL },
+ { "Eacute", 600, NULL },
+ { "adieresis", 600, NULL },
+ { "egrave", 600, NULL },
+ { "edieresis", 600, NULL },
+ { "idieresis", 600, NULL },
+ { "Eth", 600, NULL },
+ { "ae", 600, NULL },
+ { "asterisk", 600, NULL },
+ { "odieresis", 600, NULL },
+ { "Uacute", 600, NULL },
+ { "ugrave", 600, NULL },
+ { "nine", 600, NULL },
+ { "five", 600, NULL },
+ { "udieresis", 600, NULL },
+ { "Zcaron", 600, NULL },
+ { "Scommaaccent", 600, NULL },
+ { "threequarters", 600, NULL },
+ { "guillemotright", 600, NULL },
+ { "Ccedilla", 600, NULL },
+ { "ydieresis", 600, NULL },
+ { "tilde", 600, NULL },
+ { "at", 600, NULL },
+ { "eacute", 600, NULL },
+ { "underscore", 600, NULL },
+ { "Euro", 600, NULL },
+ { "Dcroat", 600, NULL },
+ { "multiply", 600, NULL },
+ { "zero", 600, NULL },
+ { "eth", 600, NULL },
+ { "Scedilla", 600, NULL },
+ { "Ograve", 600, NULL },
+ { "Racute", 600, NULL },
+ { "partialdiff", 600, NULL },
+ { "uacute", 600, NULL },
+ { "braceleft", 600, NULL },
+ { "Thorn", 600, NULL },
+ { "zcaron", 600, NULL },
+ { "scommaaccent", 600, NULL },
+ { "ccedilla", 600, NULL },
+ { "Dcaron", 600, NULL },
+ { "dcroat", 600, NULL },
+ { "Ocircumflex", 600, NULL },
+ { "Oacute", 600, NULL },
+ { "scedilla", 600, NULL },
+ { "ogonek", 600, NULL },
+ { "ograve", 600, NULL },
+ { "racute", 600, NULL },
+ { "Tcaron", 600, NULL },
+ { "Eogonek", 600, NULL },
+ { "thorn", 600, NULL },
+ { "degree", 600, NULL },
+ { "registered", 600, NULL },
+ { "radical", 600, NULL },
+ { "Aring", 600, NULL },
+ { "percent", 600, NULL },
+ { "six", 600, NULL },
+ { "paragraph", 600, NULL },
+ { "dcaron", 600, NULL },
+ { "Uogonek", 600, NULL },
+ { "two", 600, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 600, NULL },
+ { "Lacute", 600, NULL },
+ { "ocircumflex", 600, NULL },
+ { "oacute", 600, NULL },
+ { "Uring", 600, NULL },
+ { "Lcommaaccent", 600, NULL },
+ { "tcaron", 600, NULL },
+ { "eogonek", 600, NULL },
+ { "Delta", 600, NULL },
+ { "Ohungarumlaut", 600, NULL },
+ { "asciicircum", 600, NULL },
+ { "aring", 600, NULL },
+ { "grave", 600, NULL },
+ { "uogonek", 600, NULL },
+ { "bracketright", 600, NULL },
+ { "Iacute", 600, NULL },
+ { "ampersand", 600, NULL },
+ { "igrave", 600, NULL },
+ { "lacute", 600, NULL },
+ { "Ncaron", 600, NULL },
+ { "plus", 600, NULL },
+ { "uring", 600, NULL },
+ { "quotesinglbase", 600, NULL },
+ { "lcommaaccent", 600, NULL },
+ { "Yacute", 600, NULL },
+ { "ohungarumlaut", 600, NULL },
+ { "threesuperior", 600, NULL },
+ { "acute", 600, NULL },
+ { "section", 600, NULL },
+ { "dieresis", 600, NULL },
+ { "iacute", 600, NULL },
+ { "quotedblbase", 600, NULL },
+ { "ncaron", 600, NULL },
+ { "florin", 600, NULL },
+ { "yacute", 600, NULL },
+ { "Rcommaaccent", 600, NULL },
+ { "fi", 600, NULL },
+ { "fl", 600, NULL },
+ { "Acircumflex", 600, NULL },
+ { "Cacute", 600, NULL },
+ { "Icircumflex", 600, NULL },
+ { "guillemotleft", 600, NULL },
+ { "germandbls", 600, NULL },
+ { "Amacron", 600, NULL },
+ { "seven", 600, NULL },
+ { "Sacute", 600, NULL },
+ { "ordmasculine", 600, NULL },
+ { "dotlessi", 600, NULL },
+ { "sterling", 600, NULL },
+ { "notequal", 600, NULL },
+ { "Imacron", 600, NULL },
+ { "rcommaaccent", 600, NULL },
+ { "Zdotaccent", 600, NULL },
+ { "acircumflex", 600, NULL },
+ { "cacute", 600, NULL },
+ { "Ecaron", 600, NULL },
+ { "icircumflex", 600, NULL },
+ { "braceright", 600, NULL },
+ { "quotedblright", 600, NULL },
+ { "amacron", 600, NULL },
+ { "sacute", 600, NULL },
+ { "imacron", 600, NULL },
+ { "cent", 600, NULL },
+ { "currency", 600, NULL },
+ { "logicalnot", 600, NULL },
+ { "zdotaccent", 600, NULL },
+ { "Atilde", 600, NULL },
+ { "breve", 600, NULL },
+ { "bar", 600, NULL },
+ { "fraction", 600, NULL },
+ { "less", 600, NULL },
+ { "ecaron", 600, NULL },
+ { "guilsinglleft", 600, NULL },
+ { "exclam", 600, NULL },
+ { "period", 600, NULL },
+ { "Rcaron", 600, NULL },
+ { "Kcommaaccent", 600, NULL },
+ { "greater", 600, NULL },
+ { "atilde", 600, NULL },
+ { "brokenbar", 600, NULL },
+ { "quoteleft", 600, NULL },
+ { "Edotaccent", 600, NULL },
+ { "onesuperior", 600, NULL }
+};
+
+static BuiltinFontWidth courierObliqueWidthsTab[] = {
+ { "Ntilde", 600, NULL },
+ { "rcaron", 600, NULL },
+ { "kcommaaccent", 600, NULL },
+ { "Ncommaaccent", 600, NULL },
+ { "Zacute", 600, NULL },
+ { "comma", 600, NULL },
+ { "cedilla", 600, NULL },
+ { "plusminus", 600, NULL },
+ { "circumflex", 600, NULL },
+ { "dotaccent", 600, NULL },
+ { "edotaccent", 600, NULL },
+ { "asciitilde", 600, NULL },
+ { "colon", 600, NULL },
+ { "onehalf", 600, NULL },
+ { "dollar", 600, NULL },
+ { "Lcaron", 600, NULL },
+ { "ntilde", 600, NULL },
+ { "Aogonek", 600, NULL },
+ { "ncommaaccent", 600, NULL },
+ { "minus", 600, NULL },
+ { "Iogonek", 600, NULL },
+ { "zacute", 600, NULL },
+ { "yen", 600, NULL },
+ { "space", 600, NULL },
+ { "Omacron", 600, NULL },
+ { "questiondown", 600, NULL },
+ { "emdash", 600, NULL },
+ { "Agrave", 600, NULL },
+ { "three", 600, NULL },
+ { "numbersign", 600, NULL },
+ { "lcaron", 600, NULL },
+ { "A", 600, NULL },
+ { "B", 600, NULL },
+ { "C", 600, NULL },
+ { "aogonek", 600, NULL },
+ { "D", 600, NULL },
+ { "E", 600, NULL },
+ { "onequarter", 600, NULL },
+ { "F", 600, NULL },
+ { "G", 600, NULL },
+ { "H", 600, NULL },
+ { "I", 600, NULL },
+ { "J", 600, NULL },
+ { "K", 600, NULL },
+ { "iogonek", 600, NULL },
+ { "backslash", 600, NULL },
+ { "L", 600, NULL },
+ { "periodcentered", 600, NULL },
+ { "M", 600, NULL },
+ { "N", 600, NULL },
+ { "omacron", 600, NULL },
+ { "Tcommaaccent", 600, NULL },
+ { "O", 600, NULL },
+ { "P", 600, NULL },
+ { "Q", 600, NULL },
+ { "Uhungarumlaut", 600, NULL },
+ { "R", 600, NULL },
+ { "Aacute", 600, NULL },
+ { "caron", 600, NULL },
+ { "S", 600, NULL },
+ { "T", 600, NULL },
+ { "U", 600, NULL },
+ { "agrave", 600, NULL },
+ { "V", 600, NULL },
+ { "W", 600, NULL },
+ { "X", 600, NULL },
+ { "question", 600, NULL },
+ { "equal", 600, NULL },
+ { "Y", 600, NULL },
+ { "Z", 600, NULL },
+ { "four", 600, NULL },
+ { "a", 600, NULL },
+ { "Gcommaaccent", 600, NULL },
+ { "b", 600, NULL },
+ { "c", 600, NULL },
+ { "d", 600, NULL },
+ { "e", 600, NULL },
+ { "f", 600, NULL },
+ { "g", 600, NULL },
+ { "bullet", 600, NULL },
+ { "h", 600, NULL },
+ { "i", 600, NULL },
+ { "Oslash", 600, NULL },
+ { "dagger", 600, NULL },
+ { "j", 600, NULL },
+ { "k", 600, NULL },
+ { "l", 600, NULL },
+ { "m", 600, NULL },
+ { "n", 600, NULL },
+ { "tcommaaccent", 600, NULL },
+ { "o", 600, NULL },
+ { "ordfeminine", 600, NULL },
+ { "ring", 600, NULL },
+ { "p", 600, NULL },
+ { "q", 600, NULL },
+ { "uhungarumlaut", 600, NULL },
+ { "r", 600, NULL },
+ { "twosuperior", 600, NULL },
+ { "aacute", 600, NULL },
+ { "s", 600, NULL },
+ { "OE", 600, NULL },
+ { "t", 600, NULL },
+ { "divide", 600, NULL },
+ { "u", 600, NULL },
+ { "Ccaron", 600, NULL },
+ { "v", 600, NULL },
+ { "w", 600, NULL },
+ { "x", 600, NULL },
+ { "y", 600, NULL },
+ { "z", 600, NULL },
+ { "Gbreve", 600, NULL },
+ { "commaaccent", 600, NULL },
+ { "hungarumlaut", 600, NULL },
+ { "Idotaccent", 600, NULL },
+ { "Nacute", 600, NULL },
+ { "quotedbl", 600, NULL },
+ { "gcommaaccent", 600, NULL },
+ { "mu", 600, NULL },
+ { "greaterequal", 600, NULL },
+ { "Scaron", 600, NULL },
+ { "Lslash", 600, NULL },
+ { "semicolon", 600, NULL },
+ { "oslash", 600, NULL },
+ { "lessequal", 600, NULL },
+ { "lozenge", 600, NULL },
+ { "parenright", 600, NULL },
+ { "ccaron", 600, NULL },
+ { "Ecircumflex", 600, NULL },
+ { "gbreve", 600, NULL },
+ { "trademark", 600, NULL },
+ { "daggerdbl", 600, NULL },
+ { "nacute", 600, NULL },
+ { "macron", 600, NULL },
+ { "Otilde", 600, NULL },
+ { "Emacron", 600, NULL },
+ { "ellipsis", 600, NULL },
+ { "scaron", 600, NULL },
+ { "AE", 600, NULL },
+ { "Ucircumflex", 600, NULL },
+ { "lslash", 600, NULL },
+ { "quotedblleft", 600, NULL },
+ { "guilsinglright", 600, NULL },
+ { "hyphen", 600, NULL },
+ { "quotesingle", 600, NULL },
+ { "eight", 600, NULL },
+ { "exclamdown", 600, NULL },
+ { "endash", 600, NULL },
+ { "oe", 600, NULL },
+ { "Abreve", 600, NULL },
+ { "Umacron", 600, NULL },
+ { "ecircumflex", 600, NULL },
+ { "Adieresis", 600, NULL },
+ { "copyright", 600, NULL },
+ { "Egrave", 600, NULL },
+ { "slash", 600, NULL },
+ { "Edieresis", 600, NULL },
+ { "otilde", 600, NULL },
+ { "Idieresis", 600, NULL },
+ { "parenleft", 600, NULL },
+ { "one", 600, NULL },
+ { "emacron", 600, NULL },
+ { "Odieresis", 600, NULL },
+ { "ucircumflex", 600, NULL },
+ { "bracketleft", 600, NULL },
+ { "Ugrave", 600, NULL },
+ { "quoteright", 600, NULL },
+ { "Udieresis", 600, NULL },
+ { "perthousand", 600, NULL },
+ { "Ydieresis", 600, NULL },
+ { "umacron", 600, NULL },
+ { "abreve", 600, NULL },
+ { "Eacute", 600, NULL },
+ { "adieresis", 600, NULL },
+ { "egrave", 600, NULL },
+ { "edieresis", 600, NULL },
+ { "idieresis", 600, NULL },
+ { "Eth", 600, NULL },
+ { "ae", 600, NULL },
+ { "asterisk", 600, NULL },
+ { "odieresis", 600, NULL },
+ { "Uacute", 600, NULL },
+ { "ugrave", 600, NULL },
+ { "nine", 600, NULL },
+ { "five", 600, NULL },
+ { "udieresis", 600, NULL },
+ { "Zcaron", 600, NULL },
+ { "Scommaaccent", 600, NULL },
+ { "threequarters", 600, NULL },
+ { "guillemotright", 600, NULL },
+ { "Ccedilla", 600, NULL },
+ { "ydieresis", 600, NULL },
+ { "tilde", 600, NULL },
+ { "at", 600, NULL },
+ { "eacute", 600, NULL },
+ { "underscore", 600, NULL },
+ { "Euro", 600, NULL },
+ { "Dcroat", 600, NULL },
+ { "multiply", 600, NULL },
+ { "zero", 600, NULL },
+ { "eth", 600, NULL },
+ { "Scedilla", 600, NULL },
+ { "Ograve", 600, NULL },
+ { "Racute", 600, NULL },
+ { "partialdiff", 600, NULL },
+ { "uacute", 600, NULL },
+ { "braceleft", 600, NULL },
+ { "Thorn", 600, NULL },
+ { "zcaron", 600, NULL },
+ { "scommaaccent", 600, NULL },
+ { "ccedilla", 600, NULL },
+ { "Dcaron", 600, NULL },
+ { "dcroat", 600, NULL },
+ { "Ocircumflex", 600, NULL },
+ { "Oacute", 600, NULL },
+ { "scedilla", 600, NULL },
+ { "ogonek", 600, NULL },
+ { "ograve", 600, NULL },
+ { "racute", 600, NULL },
+ { "Tcaron", 600, NULL },
+ { "Eogonek", 600, NULL },
+ { "thorn", 600, NULL },
+ { "degree", 600, NULL },
+ { "registered", 600, NULL },
+ { "radical", 600, NULL },
+ { "Aring", 600, NULL },
+ { "percent", 600, NULL },
+ { "six", 600, NULL },
+ { "paragraph", 600, NULL },
+ { "dcaron", 600, NULL },
+ { "Uogonek", 600, NULL },
+ { "two", 600, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 600, NULL },
+ { "Lacute", 600, NULL },
+ { "ocircumflex", 600, NULL },
+ { "oacute", 600, NULL },
+ { "Uring", 600, NULL },
+ { "Lcommaaccent", 600, NULL },
+ { "tcaron", 600, NULL },
+ { "eogonek", 600, NULL },
+ { "Delta", 600, NULL },
+ { "Ohungarumlaut", 600, NULL },
+ { "asciicircum", 600, NULL },
+ { "aring", 600, NULL },
+ { "grave", 600, NULL },
+ { "uogonek", 600, NULL },
+ { "bracketright", 600, NULL },
+ { "Iacute", 600, NULL },
+ { "ampersand", 600, NULL },
+ { "igrave", 600, NULL },
+ { "lacute", 600, NULL },
+ { "Ncaron", 600, NULL },
+ { "plus", 600, NULL },
+ { "uring", 600, NULL },
+ { "quotesinglbase", 600, NULL },
+ { "lcommaaccent", 600, NULL },
+ { "Yacute", 600, NULL },
+ { "ohungarumlaut", 600, NULL },
+ { "threesuperior", 600, NULL },
+ { "acute", 600, NULL },
+ { "section", 600, NULL },
+ { "dieresis", 600, NULL },
+ { "iacute", 600, NULL },
+ { "quotedblbase", 600, NULL },
+ { "ncaron", 600, NULL },
+ { "florin", 600, NULL },
+ { "yacute", 600, NULL },
+ { "Rcommaaccent", 600, NULL },
+ { "fi", 600, NULL },
+ { "fl", 600, NULL },
+ { "Acircumflex", 600, NULL },
+ { "Cacute", 600, NULL },
+ { "Icircumflex", 600, NULL },
+ { "guillemotleft", 600, NULL },
+ { "germandbls", 600, NULL },
+ { "Amacron", 600, NULL },
+ { "seven", 600, NULL },
+ { "Sacute", 600, NULL },
+ { "ordmasculine", 600, NULL },
+ { "dotlessi", 600, NULL },
+ { "sterling", 600, NULL },
+ { "notequal", 600, NULL },
+ { "Imacron", 600, NULL },
+ { "rcommaaccent", 600, NULL },
+ { "Zdotaccent", 600, NULL },
+ { "acircumflex", 600, NULL },
+ { "cacute", 600, NULL },
+ { "Ecaron", 600, NULL },
+ { "icircumflex", 600, NULL },
+ { "braceright", 600, NULL },
+ { "quotedblright", 600, NULL },
+ { "amacron", 600, NULL },
+ { "sacute", 600, NULL },
+ { "imacron", 600, NULL },
+ { "cent", 600, NULL },
+ { "currency", 600, NULL },
+ { "logicalnot", 600, NULL },
+ { "zdotaccent", 600, NULL },
+ { "Atilde", 600, NULL },
+ { "breve", 600, NULL },
+ { "bar", 600, NULL },
+ { "fraction", 600, NULL },
+ { "less", 600, NULL },
+ { "ecaron", 600, NULL },
+ { "guilsinglleft", 600, NULL },
+ { "exclam", 600, NULL },
+ { "period", 600, NULL },
+ { "Rcaron", 600, NULL },
+ { "Kcommaaccent", 600, NULL },
+ { "greater", 600, NULL },
+ { "atilde", 600, NULL },
+ { "brokenbar", 600, NULL },
+ { "quoteleft", 600, NULL },
+ { "Edotaccent", 600, NULL },
+ { "onesuperior", 600, NULL }
+};
+
+static BuiltinFontWidth helveticaWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 333, NULL },
+ { "kcommaaccent", 500, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 611, NULL },
+ { "comma", 278, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 584, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 556, NULL },
+ { "asciitilde", 584, NULL },
+ { "colon", 278, NULL },
+ { "onehalf", 834, NULL },
+ { "dollar", 556, NULL },
+ { "Lcaron", 556, NULL },
+ { "ntilde", 556, NULL },
+ { "Aogonek", 667, NULL },
+ { "ncommaaccent", 556, NULL },
+ { "minus", 584, NULL },
+ { "Iogonek", 278, NULL },
+ { "zacute", 500, NULL },
+ { "yen", 556, NULL },
+ { "space", 278, NULL },
+ { "Omacron", 778, NULL },
+ { "questiondown", 611, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 667, NULL },
+ { "three", 556, NULL },
+ { "numbersign", 556, NULL },
+ { "lcaron", 299, NULL },
+ { "A", 667, NULL },
+ { "B", 667, NULL },
+ { "C", 722, NULL },
+ { "aogonek", 556, NULL },
+ { "D", 722, NULL },
+ { "E", 667, NULL },
+ { "onequarter", 834, NULL },
+ { "F", 611, NULL },
+ { "G", 778, NULL },
+ { "H", 722, NULL },
+ { "I", 278, NULL },
+ { "J", 500, NULL },
+ { "K", 667, NULL },
+ { "iogonek", 222, NULL },
+ { "backslash", 278, NULL },
+ { "L", 556, NULL },
+ { "periodcentered", 278, NULL },
+ { "M", 833, NULL },
+ { "N", 722, NULL },
+ { "omacron", 556, NULL },
+ { "Tcommaaccent", 611, NULL },
+ { "O", 778, NULL },
+ { "P", 667, NULL },
+ { "Q", 778, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 722, NULL },
+ { "Aacute", 667, NULL },
+ { "caron", 333, NULL },
+ { "S", 667, NULL },
+ { "T", 611, NULL },
+ { "U", 722, NULL },
+ { "agrave", 556, NULL },
+ { "V", 667, NULL },
+ { "W", 944, NULL },
+ { "X", 667, NULL },
+ { "question", 556, NULL },
+ { "equal", 584, NULL },
+ { "Y", 667, NULL },
+ { "Z", 611, NULL },
+ { "four", 556, NULL },
+ { "a", 556, NULL },
+ { "Gcommaaccent", 778, NULL },
+ { "b", 556, NULL },
+ { "c", 500, NULL },
+ { "d", 556, NULL },
+ { "e", 556, NULL },
+ { "f", 278, NULL },
+ { "g", 556, NULL },
+ { "bullet", 350, NULL },
+ { "h", 556, NULL },
+ { "i", 222, NULL },
+ { "Oslash", 778, NULL },
+ { "dagger", 556, NULL },
+ { "j", 222, NULL },
+ { "k", 500, NULL },
+ { "l", 222, NULL },
+ { "m", 833, NULL },
+ { "n", 556, NULL },
+ { "tcommaaccent", 278, NULL },
+ { "o", 556, NULL },
+ { "ordfeminine", 370, NULL },
+ { "ring", 333, NULL },
+ { "p", 556, NULL },
+ { "q", 556, NULL },
+ { "uhungarumlaut", 556, NULL },
+ { "r", 333, NULL },
+ { "twosuperior", 333, NULL },
+ { "aacute", 556, NULL },
+ { "s", 500, NULL },
+ { "OE", 1000, NULL },
+ { "t", 278, NULL },
+ { "divide", 584, NULL },
+ { "u", 556, NULL },
+ { "Ccaron", 722, NULL },
+ { "v", 500, NULL },
+ { "w", 722, NULL },
+ { "x", 500, NULL },
+ { "y", 500, NULL },
+ { "z", 500, NULL },
+ { "Gbreve", 778, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 278, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 355, NULL },
+ { "gcommaaccent", 556, NULL },
+ { "mu", 556, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 667, NULL },
+ { "Lslash", 556, NULL },
+ { "semicolon", 278, NULL },
+ { "oslash", 611, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 471, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 500, NULL },
+ { "Ecircumflex", 667, NULL },
+ { "gbreve", 556, NULL },
+ { "trademark", 1000, NULL },
+ { "daggerdbl", 556, NULL },
+ { "nacute", 556, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 778, NULL },
+ { "Emacron", 667, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 500, NULL },
+ { "AE", 1000, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 222, NULL },
+ { "quotedblleft", 333, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 191, NULL },
+ { "eight", 556, NULL },
+ { "exclamdown", 333, NULL },
+ { "endash", 556, NULL },
+ { "oe", 944, NULL },
+ { "Abreve", 667, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 556, NULL },
+ { "Adieresis", 667, NULL },
+ { "copyright", 737, NULL },
+ { "Egrave", 667, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 667, NULL },
+ { "otilde", 556, NULL },
+ { "Idieresis", 278, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 556, NULL },
+ { "emacron", 556, NULL },
+ { "Odieresis", 778, NULL },
+ { "ucircumflex", 556, NULL },
+ { "bracketleft", 278, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 222, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 667, NULL },
+ { "umacron", 556, NULL },
+ { "abreve", 556, NULL },
+ { "Eacute", 667, NULL },
+ { "adieresis", 556, NULL },
+ { "egrave", 556, NULL },
+ { "edieresis", 556, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 889, NULL },
+ { "asterisk", 389, NULL },
+ { "odieresis", 556, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 556, NULL },
+ { "nine", 556, NULL },
+ { "five", 556, NULL },
+ { "udieresis", 556, NULL },
+ { "Zcaron", 611, NULL },
+ { "Scommaaccent", 667, NULL },
+ { "threequarters", 834, NULL },
+ { "guillemotright", 556, NULL },
+ { "Ccedilla", 722, NULL },
+ { "ydieresis", 500, NULL },
+ { "tilde", 333, NULL },
+ { "at", 1015, NULL },
+ { "eacute", 556, NULL },
+ { "underscore", 556, NULL },
+ { "Euro", 556, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 584, NULL },
+ { "zero", 556, NULL },
+ { "eth", 556, NULL },
+ { "Scedilla", 667, NULL },
+ { "Ograve", 778, NULL },
+ { "Racute", 722, NULL },
+ { "partialdiff", 476, NULL },
+ { "uacute", 556, NULL },
+ { "braceleft", 334, NULL },
+ { "Thorn", 667, NULL },
+ { "zcaron", 500, NULL },
+ { "scommaaccent", 500, NULL },
+ { "ccedilla", 500, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 556, NULL },
+ { "Ocircumflex", 778, NULL },
+ { "Oacute", 778, NULL },
+ { "scedilla", 500, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 556, NULL },
+ { "racute", 333, NULL },
+ { "Tcaron", 611, NULL },
+ { "Eogonek", 667, NULL },
+ { "thorn", 556, NULL },
+ { "degree", 400, NULL },
+ { "registered", 737, NULL },
+ { "radical", 453, NULL },
+ { "Aring", 667, NULL },
+ { "percent", 889, NULL },
+ { "six", 556, NULL },
+ { "paragraph", 537, NULL },
+ { "dcaron", 643, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 556, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 278, NULL },
+ { "Lacute", 556, NULL },
+ { "ocircumflex", 556, NULL },
+ { "oacute", 556, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 556, NULL },
+ { "tcaron", 317, NULL },
+ { "eogonek", 556, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 778, NULL },
+ { "asciicircum", 469, NULL },
+ { "aring", 556, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 556, NULL },
+ { "bracketright", 278, NULL },
+ { "Iacute", 278, NULL },
+ { "ampersand", 667, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 222, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 584, NULL },
+ { "uring", 556, NULL },
+ { "quotesinglbase", 222, NULL },
+ { "lcommaaccent", 222, NULL },
+ { "Yacute", 667, NULL },
+ { "ohungarumlaut", 556, NULL },
+ { "threesuperior", 333, NULL },
+ { "acute", 333, NULL },
+ { "section", 556, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 333, NULL },
+ { "ncaron", 556, NULL },
+ { "florin", 556, NULL },
+ { "yacute", 500, NULL },
+ { "Rcommaaccent", 722, NULL },
+ { "fi", 500, NULL },
+ { "fl", 500, NULL },
+ { "Acircumflex", 667, NULL },
+ { "Cacute", 722, NULL },
+ { "Icircumflex", 278, NULL },
+ { "guillemotleft", 556, NULL },
+ { "germandbls", 611, NULL },
+ { "Amacron", 667, NULL },
+ { "seven", 556, NULL },
+ { "Sacute", 667, NULL },
+ { "ordmasculine", 365, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 556, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 278, NULL },
+ { "rcommaaccent", 333, NULL },
+ { "Zdotaccent", 611, NULL },
+ { "acircumflex", 556, NULL },
+ { "cacute", 500, NULL },
+ { "Ecaron", 667, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 334, NULL },
+ { "quotedblright", 333, NULL },
+ { "amacron", 556, NULL },
+ { "sacute", 500, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 556, NULL },
+ { "currency", 556, NULL },
+ { "logicalnot", 584, NULL },
+ { "zdotaccent", 500, NULL },
+ { "Atilde", 667, NULL },
+ { "breve", 333, NULL },
+ { "bar", 260, NULL },
+ { "fraction", 167, NULL },
+ { "less", 584, NULL },
+ { "ecaron", 556, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 278, NULL },
+ { "period", 278, NULL },
+ { "Rcaron", 722, NULL },
+ { "Kcommaaccent", 667, NULL },
+ { "greater", 584, NULL },
+ { "atilde", 556, NULL },
+ { "brokenbar", 260, NULL },
+ { "quoteleft", 222, NULL },
+ { "Edotaccent", 667, NULL },
+ { "onesuperior", 333, NULL }
+};
+
+static BuiltinFontWidth helveticaBoldWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 389, NULL },
+ { "kcommaaccent", 556, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 611, NULL },
+ { "comma", 278, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 584, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 556, NULL },
+ { "asciitilde", 584, NULL },
+ { "colon", 333, NULL },
+ { "onehalf", 834, NULL },
+ { "dollar", 556, NULL },
+ { "Lcaron", 611, NULL },
+ { "ntilde", 611, NULL },
+ { "Aogonek", 722, NULL },
+ { "ncommaaccent", 611, NULL },
+ { "minus", 584, NULL },
+ { "Iogonek", 278, NULL },
+ { "zacute", 500, NULL },
+ { "yen", 556, NULL },
+ { "space", 278, NULL },
+ { "Omacron", 778, NULL },
+ { "questiondown", 611, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 722, NULL },
+ { "three", 556, NULL },
+ { "numbersign", 556, NULL },
+ { "lcaron", 400, NULL },
+ { "A", 722, NULL },
+ { "B", 722, NULL },
+ { "C", 722, NULL },
+ { "aogonek", 556, NULL },
+ { "D", 722, NULL },
+ { "E", 667, NULL },
+ { "onequarter", 834, NULL },
+ { "F", 611, NULL },
+ { "G", 778, NULL },
+ { "H", 722, NULL },
+ { "I", 278, NULL },
+ { "J", 556, NULL },
+ { "K", 722, NULL },
+ { "iogonek", 278, NULL },
+ { "backslash", 278, NULL },
+ { "L", 611, NULL },
+ { "periodcentered", 278, NULL },
+ { "M", 833, NULL },
+ { "N", 722, NULL },
+ { "omacron", 611, NULL },
+ { "Tcommaaccent", 611, NULL },
+ { "O", 778, NULL },
+ { "P", 667, NULL },
+ { "Q", 778, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 722, NULL },
+ { "Aacute", 722, NULL },
+ { "caron", 333, NULL },
+ { "S", 667, NULL },
+ { "T", 611, NULL },
+ { "U", 722, NULL },
+ { "agrave", 556, NULL },
+ { "V", 667, NULL },
+ { "W", 944, NULL },
+ { "X", 667, NULL },
+ { "question", 611, NULL },
+ { "equal", 584, NULL },
+ { "Y", 667, NULL },
+ { "Z", 611, NULL },
+ { "four", 556, NULL },
+ { "a", 556, NULL },
+ { "Gcommaaccent", 778, NULL },
+ { "b", 611, NULL },
+ { "c", 556, NULL },
+ { "d", 611, NULL },
+ { "e", 556, NULL },
+ { "f", 333, NULL },
+ { "g", 611, NULL },
+ { "bullet", 350, NULL },
+ { "h", 611, NULL },
+ { "i", 278, NULL },
+ { "Oslash", 778, NULL },
+ { "dagger", 556, NULL },
+ { "j", 278, NULL },
+ { "k", 556, NULL },
+ { "l", 278, NULL },
+ { "m", 889, NULL },
+ { "n", 611, NULL },
+ { "tcommaaccent", 333, NULL },
+ { "o", 611, NULL },
+ { "ordfeminine", 370, NULL },
+ { "ring", 333, NULL },
+ { "p", 611, NULL },
+ { "q", 611, NULL },
+ { "uhungarumlaut", 611, NULL },
+ { "r", 389, NULL },
+ { "twosuperior", 333, NULL },
+ { "aacute", 556, NULL },
+ { "s", 556, NULL },
+ { "OE", 1000, NULL },
+ { "t", 333, NULL },
+ { "divide", 584, NULL },
+ { "u", 611, NULL },
+ { "Ccaron", 722, NULL },
+ { "v", 556, NULL },
+ { "w", 778, NULL },
+ { "x", 556, NULL },
+ { "y", 556, NULL },
+ { "z", 500, NULL },
+ { "Gbreve", 778, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 278, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 474, NULL },
+ { "gcommaaccent", 611, NULL },
+ { "mu", 611, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 667, NULL },
+ { "Lslash", 611, NULL },
+ { "semicolon", 333, NULL },
+ { "oslash", 611, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 494, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 556, NULL },
+ { "Ecircumflex", 667, NULL },
+ { "gbreve", 611, NULL },
+ { "trademark", 1000, NULL },
+ { "daggerdbl", 556, NULL },
+ { "nacute", 611, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 778, NULL },
+ { "Emacron", 667, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 556, NULL },
+ { "AE", 1000, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 278, NULL },
+ { "quotedblleft", 500, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 238, NULL },
+ { "eight", 556, NULL },
+ { "exclamdown", 333, NULL },
+ { "endash", 556, NULL },
+ { "oe", 944, NULL },
+ { "Abreve", 722, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 556, NULL },
+ { "Adieresis", 722, NULL },
+ { "copyright", 737, NULL },
+ { "Egrave", 667, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 667, NULL },
+ { "otilde", 611, NULL },
+ { "Idieresis", 278, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 556, NULL },
+ { "emacron", 556, NULL },
+ { "Odieresis", 778, NULL },
+ { "ucircumflex", 611, NULL },
+ { "bracketleft", 333, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 278, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 667, NULL },
+ { "umacron", 611, NULL },
+ { "abreve", 556, NULL },
+ { "Eacute", 667, NULL },
+ { "adieresis", 556, NULL },
+ { "egrave", 556, NULL },
+ { "edieresis", 556, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 889, NULL },
+ { "asterisk", 389, NULL },
+ { "odieresis", 611, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 611, NULL },
+ { "nine", 556, NULL },
+ { "five", 556, NULL },
+ { "udieresis", 611, NULL },
+ { "Zcaron", 611, NULL },
+ { "Scommaaccent", 667, NULL },
+ { "threequarters", 834, NULL },
+ { "guillemotright", 556, NULL },
+ { "Ccedilla", 722, NULL },
+ { "ydieresis", 556, NULL },
+ { "tilde", 333, NULL },
+ { "dbldaggerumlaut", 556, NULL },
+ { "at", 975, NULL },
+ { "eacute", 556, NULL },
+ { "underscore", 556, NULL },
+ { "Euro", 556, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 584, NULL },
+ { "zero", 556, NULL },
+ { "eth", 611, NULL },
+ { "Scedilla", 667, NULL },
+ { "Ograve", 778, NULL },
+ { "Racute", 722, NULL },
+ { "partialdiff", 494, NULL },
+ { "uacute", 611, NULL },
+ { "braceleft", 389, NULL },
+ { "Thorn", 667, NULL },
+ { "zcaron", 500, NULL },
+ { "scommaaccent", 556, NULL },
+ { "ccedilla", 556, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 611, NULL },
+ { "Ocircumflex", 778, NULL },
+ { "Oacute", 778, NULL },
+ { "scedilla", 556, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 611, NULL },
+ { "racute", 389, NULL },
+ { "Tcaron", 611, NULL },
+ { "Eogonek", 667, NULL },
+ { "thorn", 611, NULL },
+ { "degree", 400, NULL },
+ { "registered", 737, NULL },
+ { "radical", 549, NULL },
+ { "Aring", 722, NULL },
+ { "percent", 889, NULL },
+ { "six", 556, NULL },
+ { "paragraph", 556, NULL },
+ { "dcaron", 743, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 556, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 278, NULL },
+ { "Lacute", 611, NULL },
+ { "ocircumflex", 611, NULL },
+ { "oacute", 611, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 611, NULL },
+ { "tcaron", 389, NULL },
+ { "eogonek", 556, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 778, NULL },
+ { "asciicircum", 584, NULL },
+ { "aring", 556, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 611, NULL },
+ { "bracketright", 333, NULL },
+ { "Iacute", 278, NULL },
+ { "ampersand", 722, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 278, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 584, NULL },
+ { "uring", 611, NULL },
+ { "quotesinglbase", 278, NULL },
+ { "lcommaaccent", 278, NULL },
+ { "Yacute", 667, NULL },
+ { "ohungarumlaut", 611, NULL },
+ { "threesuperior", 333, NULL },
+ { "acute", 333, NULL },
+ { "section", 556, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 500, NULL },
+ { "ncaron", 611, NULL },
+ { "florin", 556, NULL },
+ { "yacute", 556, NULL },
+ { "Rcommaaccent", 722, NULL },
+ { "fi", 611, NULL },
+ { "fl", 611, NULL },
+ { "Acircumflex", 722, NULL },
+ { "Cacute", 722, NULL },
+ { "Icircumflex", 278, NULL },
+ { "guillemotleft", 556, NULL },
+ { "germandbls", 611, NULL },
+ { "Amacron", 722, NULL },
+ { "seven", 556, NULL },
+ { "Sacute", 667, NULL },
+ { "ordmasculine", 365, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 556, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 278, NULL },
+ { "rcommaaccent", 389, NULL },
+ { "Zdotaccent", 611, NULL },
+ { "acircumflex", 556, NULL },
+ { "cacute", 556, NULL },
+ { "Ecaron", 667, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 389, NULL },
+ { "quotedblright", 500, NULL },
+ { "amacron", 556, NULL },
+ { "sacute", 556, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 556, NULL },
+ { "currency", 556, NULL },
+ { "logicalnot", 584, NULL },
+ { "zdotaccent", 500, NULL },
+ { "Atilde", 722, NULL },
+ { "breve", 333, NULL },
+ { "bar", 280, NULL },
+ { "fraction", 167, NULL },
+ { "less", 584, NULL },
+ { "ecaron", 556, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 333, NULL },
+ { "period", 278, NULL },
+ { "Rcaron", 722, NULL },
+ { "Kcommaaccent", 722, NULL },
+ { "greater", 584, NULL },
+ { "atilde", 556, NULL },
+ { "brokenbar", 280, NULL },
+ { "quoteleft", 278, NULL },
+ { "Edotaccent", 667, NULL },
+ { "onesuperior", 333, NULL }
+};
+
+static BuiltinFontWidth helveticaBoldObliqueWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 389, NULL },
+ { "kcommaaccent", 556, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 611, NULL },
+ { "comma", 278, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 584, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 556, NULL },
+ { "asciitilde", 584, NULL },
+ { "colon", 333, NULL },
+ { "onehalf", 834, NULL },
+ { "dollar", 556, NULL },
+ { "Lcaron", 611, NULL },
+ { "ntilde", 611, NULL },
+ { "Aogonek", 722, NULL },
+ { "ncommaaccent", 611, NULL },
+ { "minus", 584, NULL },
+ { "Iogonek", 278, NULL },
+ { "zacute", 500, NULL },
+ { "yen", 556, NULL },
+ { "space", 278, NULL },
+ { "Omacron", 778, NULL },
+ { "questiondown", 611, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 722, NULL },
+ { "three", 556, NULL },
+ { "numbersign", 556, NULL },
+ { "lcaron", 400, NULL },
+ { "A", 722, NULL },
+ { "B", 722, NULL },
+ { "C", 722, NULL },
+ { "aogonek", 556, NULL },
+ { "D", 722, NULL },
+ { "E", 667, NULL },
+ { "onequarter", 834, NULL },
+ { "F", 611, NULL },
+ { "G", 778, NULL },
+ { "H", 722, NULL },
+ { "I", 278, NULL },
+ { "J", 556, NULL },
+ { "K", 722, NULL },
+ { "iogonek", 278, NULL },
+ { "backslash", 278, NULL },
+ { "L", 611, NULL },
+ { "periodcentered", 278, NULL },
+ { "M", 833, NULL },
+ { "N", 722, NULL },
+ { "omacron", 611, NULL },
+ { "Tcommaaccent", 611, NULL },
+ { "O", 778, NULL },
+ { "P", 667, NULL },
+ { "Q", 778, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 722, NULL },
+ { "Aacute", 722, NULL },
+ { "caron", 333, NULL },
+ { "S", 667, NULL },
+ { "T", 611, NULL },
+ { "U", 722, NULL },
+ { "agrave", 556, NULL },
+ { "V", 667, NULL },
+ { "W", 944, NULL },
+ { "X", 667, NULL },
+ { "question", 611, NULL },
+ { "equal", 584, NULL },
+ { "Y", 667, NULL },
+ { "Z", 611, NULL },
+ { "four", 556, NULL },
+ { "a", 556, NULL },
+ { "Gcommaaccent", 778, NULL },
+ { "b", 611, NULL },
+ { "c", 556, NULL },
+ { "d", 611, NULL },
+ { "e", 556, NULL },
+ { "f", 333, NULL },
+ { "g", 611, NULL },
+ { "bullet", 350, NULL },
+ { "h", 611, NULL },
+ { "i", 278, NULL },
+ { "Oslash", 778, NULL },
+ { "dagger", 556, NULL },
+ { "j", 278, NULL },
+ { "k", 556, NULL },
+ { "l", 278, NULL },
+ { "m", 889, NULL },
+ { "n", 611, NULL },
+ { "tcommaaccent", 333, NULL },
+ { "o", 611, NULL },
+ { "ordfeminine", 370, NULL },
+ { "ring", 333, NULL },
+ { "p", 611, NULL },
+ { "q", 611, NULL },
+ { "uhungarumlaut", 611, NULL },
+ { "r", 389, NULL },
+ { "twosuperior", 333, NULL },
+ { "aacute", 556, NULL },
+ { "s", 556, NULL },
+ { "OE", 1000, NULL },
+ { "t", 333, NULL },
+ { "divide", 584, NULL },
+ { "u", 611, NULL },
+ { "Ccaron", 722, NULL },
+ { "v", 556, NULL },
+ { "w", 778, NULL },
+ { "x", 556, NULL },
+ { "y", 556, NULL },
+ { "z", 500, NULL },
+ { "Gbreve", 778, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 278, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 474, NULL },
+ { "gcommaaccent", 611, NULL },
+ { "mu", 611, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 667, NULL },
+ { "Lslash", 611, NULL },
+ { "semicolon", 333, NULL },
+ { "oslash", 611, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 494, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 556, NULL },
+ { "Ecircumflex", 667, NULL },
+ { "gbreve", 611, NULL },
+ { "trademark", 1000, NULL },
+ { "daggerdbl", 556, NULL },
+ { "nacute", 611, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 778, NULL },
+ { "Emacron", 667, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 556, NULL },
+ { "AE", 1000, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 278, NULL },
+ { "quotedblleft", 500, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 238, NULL },
+ { "eight", 556, NULL },
+ { "exclamdown", 333, NULL },
+ { "endash", 556, NULL },
+ { "oe", 944, NULL },
+ { "Abreve", 722, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 556, NULL },
+ { "Adieresis", 722, NULL },
+ { "copyright", 737, NULL },
+ { "Egrave", 667, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 667, NULL },
+ { "otilde", 611, NULL },
+ { "Idieresis", 278, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 556, NULL },
+ { "emacron", 556, NULL },
+ { "Odieresis", 778, NULL },
+ { "ucircumflex", 611, NULL },
+ { "bracketleft", 333, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 278, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 667, NULL },
+ { "umacron", 611, NULL },
+ { "abreve", 556, NULL },
+ { "Eacute", 667, NULL },
+ { "adieresis", 556, NULL },
+ { "egrave", 556, NULL },
+ { "edieresis", 556, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 889, NULL },
+ { "asterisk", 389, NULL },
+ { "odieresis", 611, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 611, NULL },
+ { "nine", 556, NULL },
+ { "five", 556, NULL },
+ { "udieresis", 611, NULL },
+ { "Zcaron", 611, NULL },
+ { "Scommaaccent", 667, NULL },
+ { "threequarters", 834, NULL },
+ { "guillemotright", 556, NULL },
+ { "Ccedilla", 722, NULL },
+ { "ydieresis", 556, NULL },
+ { "tilde", 333, NULL },
+ { "at", 975, NULL },
+ { "eacute", 556, NULL },
+ { "underscore", 556, NULL },
+ { "Euro", 556, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 584, NULL },
+ { "zero", 556, NULL },
+ { "eth", 611, NULL },
+ { "Scedilla", 667, NULL },
+ { "Ograve", 778, NULL },
+ { "Racute", 722, NULL },
+ { "partialdiff", 494, NULL },
+ { "uacute", 611, NULL },
+ { "braceleft", 389, NULL },
+ { "Thorn", 667, NULL },
+ { "zcaron", 500, NULL },
+ { "scommaaccent", 556, NULL },
+ { "ccedilla", 556, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 611, NULL },
+ { "Ocircumflex", 778, NULL },
+ { "Oacute", 778, NULL },
+ { "scedilla", 556, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 611, NULL },
+ { "racute", 389, NULL },
+ { "Tcaron", 611, NULL },
+ { "Eogonek", 667, NULL },
+ { "thorn", 611, NULL },
+ { "degree", 400, NULL },
+ { "registered", 737, NULL },
+ { "radical", 549, NULL },
+ { "Aring", 722, NULL },
+ { "percent", 889, NULL },
+ { "six", 556, NULL },
+ { "paragraph", 556, NULL },
+ { "dcaron", 743, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 556, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 278, NULL },
+ { "Lacute", 611, NULL },
+ { "ocircumflex", 611, NULL },
+ { "oacute", 611, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 611, NULL },
+ { "tcaron", 389, NULL },
+ { "eogonek", 556, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 778, NULL },
+ { "asciicircum", 584, NULL },
+ { "aring", 556, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 611, NULL },
+ { "bracketright", 333, NULL },
+ { "Iacute", 278, NULL },
+ { "ampersand", 722, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 278, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 584, NULL },
+ { "uring", 611, NULL },
+ { "quotesinglbase", 278, NULL },
+ { "lcommaaccent", 278, NULL },
+ { "Yacute", 667, NULL },
+ { "ohungarumlaut", 611, NULL },
+ { "threesuperior", 333, NULL },
+ { "acute", 333, NULL },
+ { "section", 556, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 500, NULL },
+ { "ncaron", 611, NULL },
+ { "florin", 556, NULL },
+ { "yacute", 556, NULL },
+ { "Rcommaaccent", 722, NULL },
+ { "fi", 611, NULL },
+ { "fl", 611, NULL },
+ { "Acircumflex", 722, NULL },
+ { "Cacute", 722, NULL },
+ { "Icircumflex", 278, NULL },
+ { "guillemotleft", 556, NULL },
+ { "germandbls", 611, NULL },
+ { "Amacron", 722, NULL },
+ { "seven", 556, NULL },
+ { "Sacute", 667, NULL },
+ { "ordmasculine", 365, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 556, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 278, NULL },
+ { "rcommaaccent", 389, NULL },
+ { "Zdotaccent", 611, NULL },
+ { "acircumflex", 556, NULL },
+ { "cacute", 556, NULL },
+ { "Ecaron", 667, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 389, NULL },
+ { "quotedblright", 500, NULL },
+ { "amacron", 556, NULL },
+ { "sacute", 556, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 556, NULL },
+ { "currency", 556, NULL },
+ { "logicalnot", 584, NULL },
+ { "zdotaccent", 500, NULL },
+ { "Atilde", 722, NULL },
+ { "breve", 333, NULL },
+ { "bar", 280, NULL },
+ { "fraction", 167, NULL },
+ { "less", 584, NULL },
+ { "ecaron", 556, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 333, NULL },
+ { "period", 278, NULL },
+ { "Rcaron", 722, NULL },
+ { "Kcommaaccent", 722, NULL },
+ { "greater", 584, NULL },
+ { "atilde", 556, NULL },
+ { "brokenbar", 280, NULL },
+ { "quoteleft", 278, NULL },
+ { "Edotaccent", 667, NULL },
+ { "onesuperior", 333, NULL }
+};
+
+static BuiltinFontWidth helveticaObliqueWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 333, NULL },
+ { "kcommaaccent", 500, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 611, NULL },
+ { "comma", 278, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 584, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 556, NULL },
+ { "asciitilde", 584, NULL },
+ { "colon", 278, NULL },
+ { "onehalf", 834, NULL },
+ { "dollar", 556, NULL },
+ { "Lcaron", 556, NULL },
+ { "ntilde", 556, NULL },
+ { "Aogonek", 667, NULL },
+ { "ncommaaccent", 556, NULL },
+ { "minus", 584, NULL },
+ { "Iogonek", 278, NULL },
+ { "zacute", 500, NULL },
+ { "yen", 556, NULL },
+ { "space", 278, NULL },
+ { "Omacron", 778, NULL },
+ { "questiondown", 611, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 667, NULL },
+ { "three", 556, NULL },
+ { "numbersign", 556, NULL },
+ { "lcaron", 299, NULL },
+ { "A", 667, NULL },
+ { "B", 667, NULL },
+ { "C", 722, NULL },
+ { "aogonek", 556, NULL },
+ { "D", 722, NULL },
+ { "E", 667, NULL },
+ { "onequarter", 834, NULL },
+ { "F", 611, NULL },
+ { "G", 778, NULL },
+ { "H", 722, NULL },
+ { "I", 278, NULL },
+ { "J", 500, NULL },
+ { "K", 667, NULL },
+ { "iogonek", 222, NULL },
+ { "backslash", 278, NULL },
+ { "L", 556, NULL },
+ { "periodcentered", 278, NULL },
+ { "M", 833, NULL },
+ { "N", 722, NULL },
+ { "omacron", 556, NULL },
+ { "Tcommaaccent", 611, NULL },
+ { "O", 778, NULL },
+ { "P", 667, NULL },
+ { "Q", 778, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 722, NULL },
+ { "Aacute", 667, NULL },
+ { "caron", 333, NULL },
+ { "S", 667, NULL },
+ { "T", 611, NULL },
+ { "U", 722, NULL },
+ { "agrave", 556, NULL },
+ { "V", 667, NULL },
+ { "W", 944, NULL },
+ { "X", 667, NULL },
+ { "question", 556, NULL },
+ { "equal", 584, NULL },
+ { "Y", 667, NULL },
+ { "Z", 611, NULL },
+ { "four", 556, NULL },
+ { "a", 556, NULL },
+ { "Gcommaaccent", 778, NULL },
+ { "b", 556, NULL },
+ { "c", 500, NULL },
+ { "d", 556, NULL },
+ { "e", 556, NULL },
+ { "f", 278, NULL },
+ { "g", 556, NULL },
+ { "bullet", 350, NULL },
+ { "h", 556, NULL },
+ { "i", 222, NULL },
+ { "Oslash", 778, NULL },
+ { "dagger", 556, NULL },
+ { "j", 222, NULL },
+ { "k", 500, NULL },
+ { "l", 222, NULL },
+ { "m", 833, NULL },
+ { "n", 556, NULL },
+ { "tcommaaccent", 278, NULL },
+ { "o", 556, NULL },
+ { "ordfeminine", 370, NULL },
+ { "ring", 333, NULL },
+ { "p", 556, NULL },
+ { "q", 556, NULL },
+ { "uhungarumlaut", 556, NULL },
+ { "r", 333, NULL },
+ { "twosuperior", 333, NULL },
+ { "aacute", 556, NULL },
+ { "s", 500, NULL },
+ { "OE", 1000, NULL },
+ { "t", 278, NULL },
+ { "divide", 584, NULL },
+ { "u", 556, NULL },
+ { "Ccaron", 722, NULL },
+ { "v", 500, NULL },
+ { "w", 722, NULL },
+ { "x", 500, NULL },
+ { "y", 500, NULL },
+ { "z", 500, NULL },
+ { "Gbreve", 778, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 278, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 355, NULL },
+ { "gcommaaccent", 556, NULL },
+ { "mu", 556, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 667, NULL },
+ { "Lslash", 556, NULL },
+ { "semicolon", 278, NULL },
+ { "oslash", 611, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 471, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 500, NULL },
+ { "Ecircumflex", 667, NULL },
+ { "gbreve", 556, NULL },
+ { "trademark", 1000, NULL },
+ { "daggerdbl", 556, NULL },
+ { "nacute", 556, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 778, NULL },
+ { "Emacron", 667, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 500, NULL },
+ { "AE", 1000, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 222, NULL },
+ { "quotedblleft", 333, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 191, NULL },
+ { "eight", 556, NULL },
+ { "exclamdown", 333, NULL },
+ { "endash", 556, NULL },
+ { "oe", 944, NULL },
+ { "Abreve", 667, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 556, NULL },
+ { "Adieresis", 667, NULL },
+ { "copyright", 737, NULL },
+ { "Egrave", 667, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 667, NULL },
+ { "otilde", 556, NULL },
+ { "Idieresis", 278, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 556, NULL },
+ { "emacron", 556, NULL },
+ { "Odieresis", 778, NULL },
+ { "ucircumflex", 556, NULL },
+ { "bracketleft", 278, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 222, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 667, NULL },
+ { "umacron", 556, NULL },
+ { "abreve", 556, NULL },
+ { "Eacute", 667, NULL },
+ { "adieresis", 556, NULL },
+ { "egrave", 556, NULL },
+ { "edieresis", 556, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 889, NULL },
+ { "asterisk", 389, NULL },
+ { "odieresis", 556, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 556, NULL },
+ { "nine", 556, NULL },
+ { "five", 556, NULL },
+ { "udieresis", 556, NULL },
+ { "Zcaron", 611, NULL },
+ { "Scommaaccent", 667, NULL },
+ { "threequarters", 834, NULL },
+ { "guillemotright", 556, NULL },
+ { "Ccedilla", 722, NULL },
+ { "ydieresis", 500, NULL },
+ { "tilde", 333, NULL },
+ { "at", 1015, NULL },
+ { "eacute", 556, NULL },
+ { "underscore", 556, NULL },
+ { "Euro", 556, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 584, NULL },
+ { "zero", 556, NULL },
+ { "eth", 556, NULL },
+ { "Scedilla", 667, NULL },
+ { "Ograve", 778, NULL },
+ { "Racute", 722, NULL },
+ { "partialdiff", 476, NULL },
+ { "uacute", 556, NULL },
+ { "braceleft", 334, NULL },
+ { "Thorn", 667, NULL },
+ { "zcaron", 500, NULL },
+ { "scommaaccent", 500, NULL },
+ { "ccedilla", 500, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 556, NULL },
+ { "Ocircumflex", 778, NULL },
+ { "Oacute", 778, NULL },
+ { "scedilla", 500, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 556, NULL },
+ { "racute", 333, NULL },
+ { "Tcaron", 611, NULL },
+ { "Eogonek", 667, NULL },
+ { "thorn", 556, NULL },
+ { "degree", 400, NULL },
+ { "registered", 737, NULL },
+ { "radical", 453, NULL },
+ { "Aring", 667, NULL },
+ { "percent", 889, NULL },
+ { "six", 556, NULL },
+ { "paragraph", 537, NULL },
+ { "dcaron", 643, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 556, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 278, NULL },
+ { "Lacute", 556, NULL },
+ { "ocircumflex", 556, NULL },
+ { "oacute", 556, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 556, NULL },
+ { "tcaron", 317, NULL },
+ { "eogonek", 556, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 778, NULL },
+ { "asciicircum", 469, NULL },
+ { "aring", 556, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 556, NULL },
+ { "bracketright", 278, NULL },
+ { "Iacute", 278, NULL },
+ { "ampersand", 667, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 222, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 584, NULL },
+ { "uring", 556, NULL },
+ { "quotesinglbase", 222, NULL },
+ { "lcommaaccent", 222, NULL },
+ { "Yacute", 667, NULL },
+ { "ohungarumlaut", 556, NULL },
+ { "threesuperior", 333, NULL },
+ { "acute", 333, NULL },
+ { "section", 556, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 333, NULL },
+ { "ncaron", 556, NULL },
+ { "florin", 556, NULL },
+ { "yacute", 500, NULL },
+ { "Rcommaaccent", 722, NULL },
+ { "fi", 500, NULL },
+ { "fl", 500, NULL },
+ { "Acircumflex", 667, NULL },
+ { "Cacute", 722, NULL },
+ { "Icircumflex", 278, NULL },
+ { "guillemotleft", 556, NULL },
+ { "germandbls", 611, NULL },
+ { "Amacron", 667, NULL },
+ { "seven", 556, NULL },
+ { "Sacute", 667, NULL },
+ { "ordmasculine", 365, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 556, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 278, NULL },
+ { "rcommaaccent", 333, NULL },
+ { "Zdotaccent", 611, NULL },
+ { "acircumflex", 556, NULL },
+ { "cacute", 500, NULL },
+ { "Ecaron", 667, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 334, NULL },
+ { "quotedblright", 333, NULL },
+ { "amacron", 556, NULL },
+ { "sacute", 500, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 556, NULL },
+ { "currency", 556, NULL },
+ { "logicalnot", 584, NULL },
+ { "zdotaccent", 500, NULL },
+ { "Atilde", 667, NULL },
+ { "breve", 333, NULL },
+ { "bar", 260, NULL },
+ { "fraction", 167, NULL },
+ { "less", 584, NULL },
+ { "ecaron", 556, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 278, NULL },
+ { "period", 278, NULL },
+ { "Rcaron", 722, NULL },
+ { "Kcommaaccent", 667, NULL },
+ { "greater", 584, NULL },
+ { "atilde", 556, NULL },
+ { "brokenbar", 260, NULL },
+ { "quoteleft", 222, NULL },
+ { "Edotaccent", 667, NULL },
+ { "onesuperior", 333, NULL }
+};
+
+static BuiltinFontWidth symbolWidthsTab[] = {
+ { "bracketleftex", 384, NULL },
+ { "alpha", 631, NULL },
+ { "union", 768, NULL },
+ { "infinity", 713, NULL },
+ { "comma", 250, NULL },
+ { "copyrightsans", 790, NULL },
+ { "plusminus", 549, NULL },
+ { "arrowup", 603, NULL },
+ { "apple", 790, NULL },
+ { "parenleftbt", 384, NULL },
+ { "notelement", 713, NULL },
+ { "colon", 278, NULL },
+ { "beta", 549, NULL },
+ { "braceleftbt", 494, NULL },
+ { "Lambda", 686, NULL },
+ { "Phi", 763, NULL },
+ { "minus", 549, NULL },
+ { "space", 250, NULL },
+ { "Sigma", 592, NULL },
+ { "approxequal", 549, NULL },
+ { "minute", 247, NULL },
+ { "circleplus", 768, NULL },
+ { "Omicron", 722, NULL },
+ { "three", 500, NULL },
+ { "numbersign", 500, NULL },
+ { "lambda", 549, NULL },
+ { "phi", 521, NULL },
+ { "aleph", 823, NULL },
+ { "Tau", 611, NULL },
+ { "spade", 753, NULL },
+ { "logicaland", 603, NULL },
+ { "sigma", 603, NULL },
+ { "propersuperset", 713, NULL },
+ { "omicron", 549, NULL },
+ { "question", 444, NULL },
+ { "equal", 549, NULL },
+ { "Epsilon", 611, NULL },
+ { "emptyset", 823, NULL },
+ { "diamond", 753, NULL },
+ { "four", 500, NULL },
+ { "Mu", 889, NULL },
+ { "parenlefttp", 384, NULL },
+ { "club", 753, NULL },
+ { "bullet", 460, NULL },
+ { "Omega", 768, NULL },
+ { "tau", 439, NULL },
+ { "Upsilon", 690, NULL },
+ { "bracelefttp", 494, NULL },
+ { "heart", 753, NULL },
+ { "divide", 549, NULL },
+ { "epsilon", 439, NULL },
+ { "logicalor", 603, NULL },
+ { "parenleftex", 384, NULL },
+ { "greaterequal", 549, NULL },
+ { "mu", 576, NULL },
+ { "Nu", 722, NULL },
+ { "therefore", 863, NULL },
+ { "notsubset", 713, NULL },
+ { "omega", 686, NULL },
+ { "semicolon", 278, NULL },
+ { "element", 713, NULL },
+ { "upsilon", 576, NULL },
+ { "existential", 549, NULL },
+ { "integralbt", 686, NULL },
+ { "lessequal", 549, NULL },
+ { "phi1", 603, NULL },
+ { "lozenge", 494, NULL },
+ { "trademarkserif", 890, NULL },
+ { "parenright", 333, NULL },
+ { "reflexsuperset", 713, NULL },
+ { "sigma1", 439, NULL },
+ { "nu", 521, NULL },
+ { "Gamma", 603, NULL },
+ { "angleright", 329, NULL },
+ { "ellipsis", 1000, NULL },
+ { "Rho", 556, NULL },
+ { "parenrightbt", 384, NULL },
+ { "radicalex", 500, NULL },
+ { "eight", 500, NULL },
+ { "angleleft", 329, NULL },
+ { "arrowdbldown", 603, NULL },
+ { "congruent", 549, NULL },
+ { "Theta", 741, NULL },
+ { "intersection", 768, NULL },
+ { "Pi", 768, NULL },
+ { "slash", 278, NULL },
+ { "registerserif", 790, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 500, NULL },
+ { "gamma", 411, NULL },
+ { "bracketleft", 333, NULL },
+ { "rho", 549, NULL },
+ { "circlemultiply", 768, NULL },
+ { "Chi", 722, NULL },
+ { "theta", 521, NULL },
+ { "pi", 549, NULL },
+ { "integraltp", 686, NULL },
+ { "Eta", 722, NULL },
+ { "product", 823, NULL },
+ { "nine", 500, NULL },
+ { "five", 500, NULL },
+ { "propersubset", 713, NULL },
+ { "bracketrightbt", 384, NULL },
+ { "trademarksans", 786, NULL },
+ { "dotmath", 250, NULL },
+ { "integralex", 686, NULL },
+ { "chi", 549, NULL },
+ { "parenrighttp", 384, NULL },
+ { "eta", 603, NULL },
+ { "underscore", 500, NULL },
+ { "Euro", 750, NULL },
+ { "multiply", 549, NULL },
+ { "zero", 500, NULL },
+ { "partialdiff", 494, NULL },
+ { "angle", 768, NULL },
+ { "arrowdblleft", 987, NULL },
+ { "braceleft", 480, NULL },
+ { "parenrightex", 384, NULL },
+ { "Rfraktur", 795, NULL },
+ { "Zeta", 611, NULL },
+ { "braceex", 494, NULL },
+ { "arrowdblup", 603, NULL },
+ { "arrowdown", 603, NULL },
+ { "Ifraktur", 686, NULL },
+ { "degree", 400, NULL },
+ { "Iota", 333, NULL },
+ { "perpendicular", 658, NULL },
+ { "radical", 549, NULL },
+ { "asteriskmath", 500, NULL },
+ { "percent", 833, NULL },
+ { "zeta", 494, NULL },
+ { "six", 500, NULL },
+ { "two", 500, NULL },
+ { "weierstrass", 987, NULL },
+ { "summation", 713, NULL },
+ { "bracketrighttp", 384, NULL },
+ { "carriagereturn", 658, NULL },
+ { "suchthat", 439, NULL },
+ { "arrowvertex", 603, NULL },
+ { "Delta", 612, NULL },
+ { "iota", 329, NULL },
+ { "arrowhorizex", 1000, NULL },
+ { "bracketrightex", 384, NULL },
+ { "bracketright", 333, NULL },
+ { "ampersand", 778, NULL },
+ { "plus", 549, NULL },
+ { "proportional", 713, NULL },
+ { "delta", 494, NULL },
+ { "copyrightserif", 790, NULL },
+ { "bracerightmid", 494, NULL },
+ { "arrowleft", 987, NULL },
+ { "second", 411, NULL },
+ { "arrowdblboth", 1042, NULL },
+ { "florin", 500, NULL },
+ { "Psi", 795, NULL },
+ { "bracerightbt", 494, NULL },
+ { "bracketleftbt", 384, NULL },
+ { "seven", 500, NULL },
+ { "braceleftmid", 494, NULL },
+ { "notequal", 549, NULL },
+ { "psi", 686, NULL },
+ { "equivalence", 549, NULL },
+ { "universal", 713, NULL },
+ { "arrowdblright", 987, NULL },
+ { "braceright", 480, NULL },
+ { "reflexsubset", 713, NULL },
+ { "Xi", 645, NULL },
+ { "theta1", 631, NULL },
+ { "logicalnot", 713, NULL },
+ { "Kappa", 722, NULL },
+ { "similar", 549, NULL },
+ { "bar", 200, NULL },
+ { "fraction", 167, NULL },
+ { "less", 549, NULL },
+ { "registersans", 790, NULL },
+ { "omega1", 713, NULL },
+ { "exclam", 333, NULL },
+ { "Upsilon1", 620, NULL },
+ { "bracerighttp", 494, NULL },
+ { "xi", 493, NULL },
+ { "period", 250, NULL },
+ { "Alpha", 722, NULL },
+ { "arrowright", 987, NULL },
+ { "greater", 549, NULL },
+ { "bracketlefttp", 384, NULL },
+ { "kappa", 549, NULL },
+ { "gradient", 713, NULL },
+ { "integral", 274, NULL },
+ { "arrowboth", 1042, NULL },
+ { "Beta", 667, NULL }
+};
+
+static BuiltinFontWidth timesBoldWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 444, NULL },
+ { "kcommaaccent", 556, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 667, NULL },
+ { "comma", 250, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 570, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 444, NULL },
+ { "asciitilde", 520, NULL },
+ { "colon", 333, NULL },
+ { "onehalf", 750, NULL },
+ { "dollar", 500, NULL },
+ { "Lcaron", 667, NULL },
+ { "ntilde", 556, NULL },
+ { "Aogonek", 722, NULL },
+ { "ncommaaccent", 556, NULL },
+ { "minus", 570, NULL },
+ { "Iogonek", 389, NULL },
+ { "zacute", 444, NULL },
+ { "yen", 500, NULL },
+ { "space", 250, NULL },
+ { "Omacron", 778, NULL },
+ { "questiondown", 500, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 722, NULL },
+ { "three", 500, NULL },
+ { "numbersign", 500, NULL },
+ { "lcaron", 394, NULL },
+ { "A", 722, NULL },
+ { "B", 667, NULL },
+ { "C", 722, NULL },
+ { "aogonek", 500, NULL },
+ { "D", 722, NULL },
+ { "E", 667, NULL },
+ { "onequarter", 750, NULL },
+ { "F", 611, NULL },
+ { "G", 778, NULL },
+ { "H", 778, NULL },
+ { "I", 389, NULL },
+ { "J", 500, NULL },
+ { "K", 778, NULL },
+ { "iogonek", 278, NULL },
+ { "backslash", 278, NULL },
+ { "L", 667, NULL },
+ { "periodcentered", 250, NULL },
+ { "M", 944, NULL },
+ { "N", 722, NULL },
+ { "omacron", 500, NULL },
+ { "Tcommaaccent", 667, NULL },
+ { "O", 778, NULL },
+ { "P", 611, NULL },
+ { "Q", 778, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 722, NULL },
+ { "Aacute", 722, NULL },
+ { "caron", 333, NULL },
+ { "S", 556, NULL },
+ { "T", 667, NULL },
+ { "U", 722, NULL },
+ { "agrave", 500, NULL },
+ { "V", 722, NULL },
+ { "W", 1000, NULL },
+ { "X", 722, NULL },
+ { "question", 500, NULL },
+ { "equal", 570, NULL },
+ { "Y", 722, NULL },
+ { "Z", 667, NULL },
+ { "four", 500, NULL },
+ { "a", 500, NULL },
+ { "Gcommaaccent", 778, NULL },
+ { "b", 556, NULL },
+ { "c", 444, NULL },
+ { "d", 556, NULL },
+ { "e", 444, NULL },
+ { "f", 333, NULL },
+ { "g", 500, NULL },
+ { "bullet", 350, NULL },
+ { "h", 556, NULL },
+ { "i", 278, NULL },
+ { "Oslash", 778, NULL },
+ { "dagger", 500, NULL },
+ { "j", 333, NULL },
+ { "k", 556, NULL },
+ { "l", 278, NULL },
+ { "m", 833, NULL },
+ { "n", 556, NULL },
+ { "tcommaaccent", 333, NULL },
+ { "o", 500, NULL },
+ { "ordfeminine", 300, NULL },
+ { "ring", 333, NULL },
+ { "p", 556, NULL },
+ { "q", 556, NULL },
+ { "uhungarumlaut", 556, NULL },
+ { "r", 444, NULL },
+ { "twosuperior", 300, NULL },
+ { "aacute", 500, NULL },
+ { "s", 389, NULL },
+ { "OE", 1000, NULL },
+ { "t", 333, NULL },
+ { "divide", 570, NULL },
+ { "u", 556, NULL },
+ { "Ccaron", 722, NULL },
+ { "v", 500, NULL },
+ { "w", 722, NULL },
+ { "x", 500, NULL },
+ { "y", 500, NULL },
+ { "z", 444, NULL },
+ { "Gbreve", 778, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 389, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 555, NULL },
+ { "gcommaaccent", 500, NULL },
+ { "mu", 556, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 556, NULL },
+ { "Lslash", 667, NULL },
+ { "semicolon", 333, NULL },
+ { "oslash", 500, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 494, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 444, NULL },
+ { "Ecircumflex", 667, NULL },
+ { "gbreve", 500, NULL },
+ { "trademark", 1000, NULL },
+ { "daggerdbl", 500, NULL },
+ { "nacute", 556, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 778, NULL },
+ { "Emacron", 667, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 389, NULL },
+ { "AE", 1000, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 278, NULL },
+ { "quotedblleft", 500, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 278, NULL },
+ { "eight", 500, NULL },
+ { "exclamdown", 333, NULL },
+ { "endash", 500, NULL },
+ { "oe", 722, NULL },
+ { "Abreve", 722, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 444, NULL },
+ { "Adieresis", 722, NULL },
+ { "copyright", 747, NULL },
+ { "Egrave", 667, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 667, NULL },
+ { "otilde", 500, NULL },
+ { "Idieresis", 389, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 500, NULL },
+ { "emacron", 444, NULL },
+ { "Odieresis", 778, NULL },
+ { "ucircumflex", 556, NULL },
+ { "bracketleft", 333, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 333, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 722, NULL },
+ { "umacron", 556, NULL },
+ { "abreve", 500, NULL },
+ { "Eacute", 667, NULL },
+ { "adieresis", 500, NULL },
+ { "egrave", 444, NULL },
+ { "edieresis", 444, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 722, NULL },
+ { "asterisk", 500, NULL },
+ { "odieresis", 500, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 556, NULL },
+ { "nine", 500, NULL },
+ { "five", 500, NULL },
+ { "udieresis", 556, NULL },
+ { "Zcaron", 667, NULL },
+ { "Scommaaccent", 556, NULL },
+ { "threequarters", 750, NULL },
+ { "guillemotright", 500, NULL },
+ { "Ccedilla", 722, NULL },
+ { "ydieresis", 500, NULL },
+ { "tilde", 333, NULL },
+ { "at", 930, NULL },
+ { "eacute", 444, NULL },
+ { "underscore", 500, NULL },
+ { "Euro", 500, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 570, NULL },
+ { "zero", 500, NULL },
+ { "eth", 500, NULL },
+ { "Scedilla", 556, NULL },
+ { "Ograve", 778, NULL },
+ { "Racute", 722, NULL },
+ { "partialdiff", 494, NULL },
+ { "uacute", 556, NULL },
+ { "braceleft", 394, NULL },
+ { "Thorn", 611, NULL },
+ { "zcaron", 444, NULL },
+ { "scommaaccent", 389, NULL },
+ { "ccedilla", 444, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 556, NULL },
+ { "Ocircumflex", 778, NULL },
+ { "Oacute", 778, NULL },
+ { "scedilla", 389, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 500, NULL },
+ { "racute", 444, NULL },
+ { "Tcaron", 667, NULL },
+ { "Eogonek", 667, NULL },
+ { "thorn", 556, NULL },
+ { "degree", 400, NULL },
+ { "registered", 747, NULL },
+ { "radical", 549, NULL },
+ { "Aring", 722, NULL },
+ { "percent", 1000, NULL },
+ { "six", 500, NULL },
+ { "paragraph", 540, NULL },
+ { "dcaron", 672, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 500, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 389, NULL },
+ { "Lacute", 667, NULL },
+ { "ocircumflex", 500, NULL },
+ { "oacute", 500, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 667, NULL },
+ { "tcaron", 416, NULL },
+ { "eogonek", 444, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 778, NULL },
+ { "asciicircum", 581, NULL },
+ { "aring", 500, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 556, NULL },
+ { "bracketright", 333, NULL },
+ { "Iacute", 389, NULL },
+ { "ampersand", 833, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 278, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 570, NULL },
+ { "uring", 556, NULL },
+ { "quotesinglbase", 333, NULL },
+ { "lcommaaccent", 278, NULL },
+ { "Yacute", 722, NULL },
+ { "ohungarumlaut", 500, NULL },
+ { "threesuperior", 300, NULL },
+ { "acute", 333, NULL },
+ { "section", 500, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 500, NULL },
+ { "ncaron", 556, NULL },
+ { "florin", 500, NULL },
+ { "yacute", 500, NULL },
+ { "Rcommaaccent", 722, NULL },
+ { "fi", 556, NULL },
+ { "fl", 556, NULL },
+ { "Acircumflex", 722, NULL },
+ { "Cacute", 722, NULL },
+ { "Icircumflex", 389, NULL },
+ { "guillemotleft", 500, NULL },
+ { "germandbls", 556, NULL },
+ { "Amacron", 722, NULL },
+ { "seven", 500, NULL },
+ { "Sacute", 556, NULL },
+ { "ordmasculine", 330, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 500, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 389, NULL },
+ { "rcommaaccent", 444, NULL },
+ { "Zdotaccent", 667, NULL },
+ { "acircumflex", 500, NULL },
+ { "cacute", 444, NULL },
+ { "Ecaron", 667, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 394, NULL },
+ { "quotedblright", 500, NULL },
+ { "amacron", 500, NULL },
+ { "sacute", 389, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 500, NULL },
+ { "currency", 500, NULL },
+ { "logicalnot", 570, NULL },
+ { "zdotaccent", 444, NULL },
+ { "Atilde", 722, NULL },
+ { "breve", 333, NULL },
+ { "bar", 220, NULL },
+ { "fraction", 167, NULL },
+ { "less", 570, NULL },
+ { "ecaron", 444, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 333, NULL },
+ { "period", 250, NULL },
+ { "Rcaron", 722, NULL },
+ { "Kcommaaccent", 778, NULL },
+ { "greater", 570, NULL },
+ { "atilde", 500, NULL },
+ { "brokenbar", 220, NULL },
+ { "quoteleft", 333, NULL },
+ { "Edotaccent", 667, NULL },
+ { "onesuperior", 300, NULL }
+};
+
+static BuiltinFontWidth timesBoldItalicWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 389, NULL },
+ { "kcommaaccent", 500, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 611, NULL },
+ { "comma", 250, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 570, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 444, NULL },
+ { "asciitilde", 570, NULL },
+ { "colon", 333, NULL },
+ { "onehalf", 750, NULL },
+ { "dollar", 500, NULL },
+ { "Lcaron", 611, NULL },
+ { "ntilde", 556, NULL },
+ { "Aogonek", 667, NULL },
+ { "ncommaaccent", 556, NULL },
+ { "minus", 606, NULL },
+ { "Iogonek", 389, NULL },
+ { "zacute", 389, NULL },
+ { "yen", 500, NULL },
+ { "space", 250, NULL },
+ { "Omacron", 722, NULL },
+ { "questiondown", 500, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 667, NULL },
+ { "three", 500, NULL },
+ { "numbersign", 500, NULL },
+ { "lcaron", 382, NULL },
+ { "A", 667, NULL },
+ { "B", 667, NULL },
+ { "C", 667, NULL },
+ { "aogonek", 500, NULL },
+ { "D", 722, NULL },
+ { "E", 667, NULL },
+ { "onequarter", 750, NULL },
+ { "F", 667, NULL },
+ { "G", 722, NULL },
+ { "H", 778, NULL },
+ { "I", 389, NULL },
+ { "J", 500, NULL },
+ { "K", 667, NULL },
+ { "iogonek", 278, NULL },
+ { "backslash", 278, NULL },
+ { "L", 611, NULL },
+ { "periodcentered", 250, NULL },
+ { "M", 889, NULL },
+ { "N", 722, NULL },
+ { "omacron", 500, NULL },
+ { "Tcommaaccent", 611, NULL },
+ { "O", 722, NULL },
+ { "P", 611, NULL },
+ { "Q", 722, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 667, NULL },
+ { "Aacute", 667, NULL },
+ { "caron", 333, NULL },
+ { "S", 556, NULL },
+ { "T", 611, NULL },
+ { "U", 722, NULL },
+ { "agrave", 500, NULL },
+ { "V", 667, NULL },
+ { "W", 889, NULL },
+ { "X", 667, NULL },
+ { "question", 500, NULL },
+ { "equal", 570, NULL },
+ { "Y", 611, NULL },
+ { "Z", 611, NULL },
+ { "four", 500, NULL },
+ { "a", 500, NULL },
+ { "Gcommaaccent", 722, NULL },
+ { "b", 500, NULL },
+ { "c", 444, NULL },
+ { "d", 500, NULL },
+ { "e", 444, NULL },
+ { "f", 333, NULL },
+ { "g", 500, NULL },
+ { "bullet", 350, NULL },
+ { "h", 556, NULL },
+ { "i", 278, NULL },
+ { "Oslash", 722, NULL },
+ { "dagger", 500, NULL },
+ { "j", 278, NULL },
+ { "k", 500, NULL },
+ { "l", 278, NULL },
+ { "m", 778, NULL },
+ { "n", 556, NULL },
+ { "tcommaaccent", 278, NULL },
+ { "o", 500, NULL },
+ { "ordfeminine", 266, NULL },
+ { "ring", 333, NULL },
+ { "p", 500, NULL },
+ { "q", 500, NULL },
+ { "uhungarumlaut", 556, NULL },
+ { "r", 389, NULL },
+ { "twosuperior", 300, NULL },
+ { "aacute", 500, NULL },
+ { "s", 389, NULL },
+ { "OE", 944, NULL },
+ { "t", 278, NULL },
+ { "divide", 570, NULL },
+ { "u", 556, NULL },
+ { "Ccaron", 667, NULL },
+ { "v", 444, NULL },
+ { "w", 667, NULL },
+ { "x", 500, NULL },
+ { "y", 444, NULL },
+ { "z", 389, NULL },
+ { "Gbreve", 722, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 389, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 555, NULL },
+ { "gcommaaccent", 500, NULL },
+ { "mu", 576, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 556, NULL },
+ { "Lslash", 611, NULL },
+ { "semicolon", 333, NULL },
+ { "oslash", 500, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 494, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 444, NULL },
+ { "Ecircumflex", 667, NULL },
+ { "gbreve", 500, NULL },
+ { "trademark", 1000, NULL },
+ { "daggerdbl", 500, NULL },
+ { "nacute", 556, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 722, NULL },
+ { "Emacron", 667, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 389, NULL },
+ { "AE", 944, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 278, NULL },
+ { "quotedblleft", 500, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 278, NULL },
+ { "eight", 500, NULL },
+ { "exclamdown", 389, NULL },
+ { "endash", 500, NULL },
+ { "oe", 722, NULL },
+ { "Abreve", 667, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 444, NULL },
+ { "Adieresis", 667, NULL },
+ { "copyright", 747, NULL },
+ { "Egrave", 667, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 667, NULL },
+ { "otilde", 500, NULL },
+ { "Idieresis", 389, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 500, NULL },
+ { "emacron", 444, NULL },
+ { "Odieresis", 722, NULL },
+ { "ucircumflex", 556, NULL },
+ { "bracketleft", 333, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 333, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 611, NULL },
+ { "umacron", 556, NULL },
+ { "abreve", 500, NULL },
+ { "Eacute", 667, NULL },
+ { "adieresis", 500, NULL },
+ { "egrave", 444, NULL },
+ { "edieresis", 444, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 722, NULL },
+ { "asterisk", 500, NULL },
+ { "odieresis", 500, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 556, NULL },
+ { "nine", 500, NULL },
+ { "five", 500, NULL },
+ { "udieresis", 556, NULL },
+ { "Zcaron", 611, NULL },
+ { "Scommaaccent", 556, NULL },
+ { "threequarters", 750, NULL },
+ { "guillemotright", 500, NULL },
+ { "Ccedilla", 667, NULL },
+ { "ydieresis", 444, NULL },
+ { "tilde", 333, NULL },
+ { "at", 832, NULL },
+ { "eacute", 444, NULL },
+ { "underscore", 500, NULL },
+ { "Euro", 500, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 570, NULL },
+ { "zero", 500, NULL },
+ { "eth", 500, NULL },
+ { "Scedilla", 556, NULL },
+ { "Ograve", 722, NULL },
+ { "Racute", 667, NULL },
+ { "partialdiff", 494, NULL },
+ { "uacute", 556, NULL },
+ { "braceleft", 348, NULL },
+ { "Thorn", 611, NULL },
+ { "zcaron", 389, NULL },
+ { "scommaaccent", 389, NULL },
+ { "ccedilla", 444, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 500, NULL },
+ { "Ocircumflex", 722, NULL },
+ { "Oacute", 722, NULL },
+ { "scedilla", 389, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 500, NULL },
+ { "racute", 389, NULL },
+ { "Tcaron", 611, NULL },
+ { "Eogonek", 667, NULL },
+ { "thorn", 500, NULL },
+ { "degree", 400, NULL },
+ { "registered", 747, NULL },
+ { "radical", 549, NULL },
+ { "Aring", 667, NULL },
+ { "percent", 833, NULL },
+ { "six", 500, NULL },
+ { "paragraph", 500, NULL },
+ { "dcaron", 608, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 500, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 389, NULL },
+ { "Lacute", 611, NULL },
+ { "ocircumflex", 500, NULL },
+ { "oacute", 500, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 611, NULL },
+ { "tcaron", 366, NULL },
+ { "eogonek", 444, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 722, NULL },
+ { "asciicircum", 570, NULL },
+ { "aring", 500, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 556, NULL },
+ { "bracketright", 333, NULL },
+ { "Iacute", 389, NULL },
+ { "ampersand", 778, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 278, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 570, NULL },
+ { "uring", 556, NULL },
+ { "quotesinglbase", 333, NULL },
+ { "lcommaaccent", 278, NULL },
+ { "Yacute", 611, NULL },
+ { "ohungarumlaut", 500, NULL },
+ { "threesuperior", 300, NULL },
+ { "acute", 333, NULL },
+ { "section", 500, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 500, NULL },
+ { "ncaron", 556, NULL },
+ { "florin", 500, NULL },
+ { "yacute", 444, NULL },
+ { "Rcommaaccent", 667, NULL },
+ { "fi", 556, NULL },
+ { "fl", 556, NULL },
+ { "Acircumflex", 667, NULL },
+ { "Cacute", 667, NULL },
+ { "Icircumflex", 389, NULL },
+ { "guillemotleft", 500, NULL },
+ { "germandbls", 500, NULL },
+ { "Amacron", 667, NULL },
+ { "seven", 500, NULL },
+ { "Sacute", 556, NULL },
+ { "ordmasculine", 300, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 500, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 389, NULL },
+ { "rcommaaccent", 389, NULL },
+ { "Zdotaccent", 611, NULL },
+ { "acircumflex", 500, NULL },
+ { "cacute", 444, NULL },
+ { "Ecaron", 667, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 348, NULL },
+ { "quotedblright", 500, NULL },
+ { "amacron", 500, NULL },
+ { "sacute", 389, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 500, NULL },
+ { "currency", 500, NULL },
+ { "logicalnot", 606, NULL },
+ { "zdotaccent", 389, NULL },
+ { "Atilde", 667, NULL },
+ { "breve", 333, NULL },
+ { "bar", 220, NULL },
+ { "fraction", 167, NULL },
+ { "less", 570, NULL },
+ { "ecaron", 444, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 389, NULL },
+ { "period", 250, NULL },
+ { "Rcaron", 667, NULL },
+ { "Kcommaaccent", 667, NULL },
+ { "greater", 570, NULL },
+ { "atilde", 500, NULL },
+ { "brokenbar", 220, NULL },
+ { "quoteleft", 333, NULL },
+ { "Edotaccent", 667, NULL },
+ { "onesuperior", 300, NULL }
+};
+
+static BuiltinFontWidth timesItalicWidthsTab[] = {
+ { "Ntilde", 667, NULL },
+ { "rcaron", 389, NULL },
+ { "kcommaaccent", 444, NULL },
+ { "Ncommaaccent", 667, NULL },
+ { "Zacute", 556, NULL },
+ { "comma", 250, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 675, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 444, NULL },
+ { "asciitilde", 541, NULL },
+ { "colon", 333, NULL },
+ { "onehalf", 750, NULL },
+ { "dollar", 500, NULL },
+ { "Lcaron", 611, NULL },
+ { "ntilde", 500, NULL },
+ { "Aogonek", 611, NULL },
+ { "ncommaaccent", 500, NULL },
+ { "minus", 675, NULL },
+ { "Iogonek", 333, NULL },
+ { "zacute", 389, NULL },
+ { "yen", 500, NULL },
+ { "space", 250, NULL },
+ { "Omacron", 722, NULL },
+ { "questiondown", 500, NULL },
+ { "emdash", 889, NULL },
+ { "Agrave", 611, NULL },
+ { "three", 500, NULL },
+ { "numbersign", 500, NULL },
+ { "lcaron", 300, NULL },
+ { "A", 611, NULL },
+ { "B", 611, NULL },
+ { "C", 667, NULL },
+ { "aogonek", 500, NULL },
+ { "D", 722, NULL },
+ { "E", 611, NULL },
+ { "onequarter", 750, NULL },
+ { "F", 611, NULL },
+ { "G", 722, NULL },
+ { "H", 722, NULL },
+ { "I", 333, NULL },
+ { "J", 444, NULL },
+ { "K", 667, NULL },
+ { "iogonek", 278, NULL },
+ { "backslash", 278, NULL },
+ { "L", 556, NULL },
+ { "periodcentered", 250, NULL },
+ { "M", 833, NULL },
+ { "N", 667, NULL },
+ { "omacron", 500, NULL },
+ { "Tcommaaccent", 556, NULL },
+ { "O", 722, NULL },
+ { "P", 611, NULL },
+ { "Q", 722, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 611, NULL },
+ { "Aacute", 611, NULL },
+ { "caron", 333, NULL },
+ { "S", 500, NULL },
+ { "T", 556, NULL },
+ { "U", 722, NULL },
+ { "agrave", 500, NULL },
+ { "V", 611, NULL },
+ { "W", 833, NULL },
+ { "X", 611, NULL },
+ { "question", 500, NULL },
+ { "equal", 675, NULL },
+ { "Y", 556, NULL },
+ { "Z", 556, NULL },
+ { "four", 500, NULL },
+ { "a", 500, NULL },
+ { "Gcommaaccent", 722, NULL },
+ { "b", 500, NULL },
+ { "c", 444, NULL },
+ { "d", 500, NULL },
+ { "e", 444, NULL },
+ { "f", 278, NULL },
+ { "g", 500, NULL },
+ { "bullet", 350, NULL },
+ { "h", 500, NULL },
+ { "i", 278, NULL },
+ { "Oslash", 722, NULL },
+ { "dagger", 500, NULL },
+ { "j", 278, NULL },
+ { "k", 444, NULL },
+ { "l", 278, NULL },
+ { "m", 722, NULL },
+ { "n", 500, NULL },
+ { "tcommaaccent", 278, NULL },
+ { "o", 500, NULL },
+ { "ordfeminine", 276, NULL },
+ { "ring", 333, NULL },
+ { "p", 500, NULL },
+ { "q", 500, NULL },
+ { "uhungarumlaut", 500, NULL },
+ { "r", 389, NULL },
+ { "twosuperior", 300, NULL },
+ { "aacute", 500, NULL },
+ { "s", 389, NULL },
+ { "OE", 944, NULL },
+ { "t", 278, NULL },
+ { "divide", 675, NULL },
+ { "u", 500, NULL },
+ { "Ccaron", 667, NULL },
+ { "v", 444, NULL },
+ { "w", 667, NULL },
+ { "x", 444, NULL },
+ { "y", 444, NULL },
+ { "z", 389, NULL },
+ { "Gbreve", 722, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 333, NULL },
+ { "Nacute", 667, NULL },
+ { "quotedbl", 420, NULL },
+ { "gcommaaccent", 500, NULL },
+ { "mu", 500, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 500, NULL },
+ { "Lslash", 556, NULL },
+ { "semicolon", 333, NULL },
+ { "oslash", 500, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 471, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 444, NULL },
+ { "Ecircumflex", 611, NULL },
+ { "gbreve", 500, NULL },
+ { "trademark", 980, NULL },
+ { "daggerdbl", 500, NULL },
+ { "nacute", 500, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 722, NULL },
+ { "Emacron", 611, NULL },
+ { "ellipsis", 889, NULL },
+ { "scaron", 389, NULL },
+ { "AE", 889, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 278, NULL },
+ { "quotedblleft", 556, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 214, NULL },
+ { "eight", 500, NULL },
+ { "exclamdown", 389, NULL },
+ { "endash", 500, NULL },
+ { "oe", 667, NULL },
+ { "Abreve", 611, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 444, NULL },
+ { "Adieresis", 611, NULL },
+ { "copyright", 760, NULL },
+ { "Egrave", 611, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 611, NULL },
+ { "otilde", 500, NULL },
+ { "Idieresis", 333, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 500, NULL },
+ { "emacron", 444, NULL },
+ { "Odieresis", 722, NULL },
+ { "ucircumflex", 500, NULL },
+ { "bracketleft", 389, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 333, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 556, NULL },
+ { "umacron", 500, NULL },
+ { "abreve", 500, NULL },
+ { "Eacute", 611, NULL },
+ { "adieresis", 500, NULL },
+ { "egrave", 444, NULL },
+ { "edieresis", 444, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 667, NULL },
+ { "asterisk", 500, NULL },
+ { "odieresis", 500, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 500, NULL },
+ { "nine", 500, NULL },
+ { "five", 500, NULL },
+ { "udieresis", 500, NULL },
+ { "Zcaron", 556, NULL },
+ { "Scommaaccent", 500, NULL },
+ { "threequarters", 750, NULL },
+ { "guillemotright", 500, NULL },
+ { "Ccedilla", 667, NULL },
+ { "ydieresis", 444, NULL },
+ { "tilde", 333, NULL },
+ { "at", 920, NULL },
+ { "eacute", 444, NULL },
+ { "underscore", 500, NULL },
+ { "Euro", 500, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 675, NULL },
+ { "zero", 500, NULL },
+ { "eth", 500, NULL },
+ { "Scedilla", 500, NULL },
+ { "Ograve", 722, NULL },
+ { "Racute", 611, NULL },
+ { "partialdiff", 476, NULL },
+ { "uacute", 500, NULL },
+ { "braceleft", 400, NULL },
+ { "Thorn", 611, NULL },
+ { "zcaron", 389, NULL },
+ { "scommaaccent", 389, NULL },
+ { "ccedilla", 444, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 500, NULL },
+ { "Ocircumflex", 722, NULL },
+ { "Oacute", 722, NULL },
+ { "scedilla", 389, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 500, NULL },
+ { "racute", 389, NULL },
+ { "Tcaron", 556, NULL },
+ { "Eogonek", 611, NULL },
+ { "thorn", 500, NULL },
+ { "degree", 400, NULL },
+ { "registered", 760, NULL },
+ { "radical", 453, NULL },
+ { "Aring", 611, NULL },
+ { "percent", 833, NULL },
+ { "six", 500, NULL },
+ { "paragraph", 523, NULL },
+ { "dcaron", 544, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 500, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 333, NULL },
+ { "Lacute", 556, NULL },
+ { "ocircumflex", 500, NULL },
+ { "oacute", 500, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 556, NULL },
+ { "tcaron", 300, NULL },
+ { "eogonek", 444, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 722, NULL },
+ { "asciicircum", 422, NULL },
+ { "aring", 500, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 500, NULL },
+ { "bracketright", 389, NULL },
+ { "Iacute", 333, NULL },
+ { "ampersand", 778, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 278, NULL },
+ { "Ncaron", 667, NULL },
+ { "plus", 675, NULL },
+ { "uring", 500, NULL },
+ { "quotesinglbase", 333, NULL },
+ { "lcommaaccent", 278, NULL },
+ { "Yacute", 556, NULL },
+ { "ohungarumlaut", 500, NULL },
+ { "threesuperior", 300, NULL },
+ { "acute", 333, NULL },
+ { "section", 500, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 556, NULL },
+ { "ncaron", 500, NULL },
+ { "florin", 500, NULL },
+ { "yacute", 444, NULL },
+ { "Rcommaaccent", 611, NULL },
+ { "fi", 500, NULL },
+ { "fl", 500, NULL },
+ { "Acircumflex", 611, NULL },
+ { "Cacute", 667, NULL },
+ { "Icircumflex", 333, NULL },
+ { "guillemotleft", 500, NULL },
+ { "germandbls", 500, NULL },
+ { "Amacron", 611, NULL },
+ { "seven", 500, NULL },
+ { "Sacute", 500, NULL },
+ { "ordmasculine", 310, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 500, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 333, NULL },
+ { "rcommaaccent", 389, NULL },
+ { "Zdotaccent", 556, NULL },
+ { "acircumflex", 500, NULL },
+ { "cacute", 444, NULL },
+ { "Ecaron", 611, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 400, NULL },
+ { "quotedblright", 556, NULL },
+ { "amacron", 500, NULL },
+ { "sacute", 389, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 500, NULL },
+ { "currency", 500, NULL },
+ { "logicalnot", 675, NULL },
+ { "zdotaccent", 389, NULL },
+ { "Atilde", 611, NULL },
+ { "breve", 333, NULL },
+ { "bar", 275, NULL },
+ { "fraction", 167, NULL },
+ { "less", 675, NULL },
+ { "ecaron", 444, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 333, NULL },
+ { "period", 250, NULL },
+ { "Rcaron", 611, NULL },
+ { "Kcommaaccent", 667, NULL },
+ { "greater", 675, NULL },
+ { "atilde", 500, NULL },
+ { "brokenbar", 275, NULL },
+ { "quoteleft", 333, NULL },
+ { "Edotaccent", 611, NULL },
+ { "onesuperior", 300, NULL }
+};
+
+static BuiltinFontWidth timesRomanWidthsTab[] = {
+ { "Ntilde", 722, NULL },
+ { "rcaron", 333, NULL },
+ { "kcommaaccent", 500, NULL },
+ { "Ncommaaccent", 722, NULL },
+ { "Zacute", 611, NULL },
+ { "comma", 250, NULL },
+ { "cedilla", 333, NULL },
+ { "plusminus", 564, NULL },
+ { "circumflex", 333, NULL },
+ { "dotaccent", 333, NULL },
+ { "edotaccent", 444, NULL },
+ { "asciitilde", 541, NULL },
+ { "colon", 278, NULL },
+ { "onehalf", 750, NULL },
+ { "dollar", 500, NULL },
+ { "Lcaron", 611, NULL },
+ { "ntilde", 500, NULL },
+ { "Aogonek", 722, NULL },
+ { "ncommaaccent", 500, NULL },
+ { "minus", 564, NULL },
+ { "Iogonek", 333, NULL },
+ { "zacute", 444, NULL },
+ { "yen", 500, NULL },
+ { "space", 250, NULL },
+ { "Omacron", 722, NULL },
+ { "questiondown", 444, NULL },
+ { "emdash", 1000, NULL },
+ { "Agrave", 722, NULL },
+ { "three", 500, NULL },
+ { "numbersign", 500, NULL },
+ { "lcaron", 344, NULL },
+ { "A", 722, NULL },
+ { "B", 667, NULL },
+ { "C", 667, NULL },
+ { "aogonek", 444, NULL },
+ { "D", 722, NULL },
+ { "E", 611, NULL },
+ { "onequarter", 750, NULL },
+ { "F", 556, NULL },
+ { "G", 722, NULL },
+ { "H", 722, NULL },
+ { "I", 333, NULL },
+ { "J", 389, NULL },
+ { "K", 722, NULL },
+ { "iogonek", 278, NULL },
+ { "backslash", 278, NULL },
+ { "L", 611, NULL },
+ { "periodcentered", 250, NULL },
+ { "M", 889, NULL },
+ { "N", 722, NULL },
+ { "omacron", 500, NULL },
+ { "Tcommaaccent", 611, NULL },
+ { "O", 722, NULL },
+ { "P", 556, NULL },
+ { "Q", 722, NULL },
+ { "Uhungarumlaut", 722, NULL },
+ { "R", 667, NULL },
+ { "Aacute", 722, NULL },
+ { "caron", 333, NULL },
+ { "S", 556, NULL },
+ { "T", 611, NULL },
+ { "U", 722, NULL },
+ { "agrave", 444, NULL },
+ { "V", 722, NULL },
+ { "W", 944, NULL },
+ { "X", 722, NULL },
+ { "question", 444, NULL },
+ { "equal", 564, NULL },
+ { "Y", 722, NULL },
+ { "Z", 611, NULL },
+ { "four", 500, NULL },
+ { "a", 444, NULL },
+ { "Gcommaaccent", 722, NULL },
+ { "b", 500, NULL },
+ { "c", 444, NULL },
+ { "d", 500, NULL },
+ { "e", 444, NULL },
+ { "f", 333, NULL },
+ { "g", 500, NULL },
+ { "bullet", 350, NULL },
+ { "h", 500, NULL },
+ { "i", 278, NULL },
+ { "Oslash", 722, NULL },
+ { "dagger", 500, NULL },
+ { "j", 278, NULL },
+ { "k", 500, NULL },
+ { "l", 278, NULL },
+ { "m", 778, NULL },
+ { "n", 500, NULL },
+ { "tcommaaccent", 278, NULL },
+ { "o", 500, NULL },
+ { "ordfeminine", 276, NULL },
+ { "ring", 333, NULL },
+ { "p", 500, NULL },
+ { "q", 500, NULL },
+ { "uhungarumlaut", 500, NULL },
+ { "r", 333, NULL },
+ { "twosuperior", 300, NULL },
+ { "aacute", 444, NULL },
+ { "s", 389, NULL },
+ { "OE", 889, NULL },
+ { "t", 278, NULL },
+ { "divide", 564, NULL },
+ { "u", 500, NULL },
+ { "Ccaron", 667, NULL },
+ { "v", 500, NULL },
+ { "w", 722, NULL },
+ { "x", 500, NULL },
+ { "y", 500, NULL },
+ { "z", 444, NULL },
+ { "Gbreve", 722, NULL },
+ { "commaaccent", 250, NULL },
+ { "hungarumlaut", 333, NULL },
+ { "Idotaccent", 333, NULL },
+ { "Nacute", 722, NULL },
+ { "quotedbl", 408, NULL },
+ { "gcommaaccent", 500, NULL },
+ { "mu", 500, NULL },
+ { "greaterequal", 549, NULL },
+ { "Scaron", 556, NULL },
+ { "Lslash", 611, NULL },
+ { "semicolon", 278, NULL },
+ { "oslash", 500, NULL },
+ { "lessequal", 549, NULL },
+ { "lozenge", 471, NULL },
+ { "parenright", 333, NULL },
+ { "ccaron", 444, NULL },
+ { "Ecircumflex", 611, NULL },
+ { "gbreve", 500, NULL },
+ { "trademark", 980, NULL },
+ { "daggerdbl", 500, NULL },
+ { "nacute", 500, NULL },
+ { "macron", 333, NULL },
+ { "Otilde", 722, NULL },
+ { "Emacron", 611, NULL },
+ { "ellipsis", 1000, NULL },
+ { "scaron", 389, NULL },
+ { "AE", 889, NULL },
+ { "Ucircumflex", 722, NULL },
+ { "lslash", 278, NULL },
+ { "quotedblleft", 444, NULL },
+ { "guilsinglright", 333, NULL },
+ { "hyphen", 333, NULL },
+ { "quotesingle", 180, NULL },
+ { "eight", 500, NULL },
+ { "exclamdown", 333, NULL },
+ { "endash", 500, NULL },
+ { "oe", 722, NULL },
+ { "Abreve", 722, NULL },
+ { "Umacron", 722, NULL },
+ { "ecircumflex", 444, NULL },
+ { "Adieresis", 722, NULL },
+ { "copyright", 760, NULL },
+ { "Egrave", 611, NULL },
+ { "slash", 278, NULL },
+ { "Edieresis", 611, NULL },
+ { "otilde", 500, NULL },
+ { "Idieresis", 333, NULL },
+ { "parenleft", 333, NULL },
+ { "one", 500, NULL },
+ { "emacron", 444, NULL },
+ { "Odieresis", 722, NULL },
+ { "ucircumflex", 500, NULL },
+ { "bracketleft", 333, NULL },
+ { "Ugrave", 722, NULL },
+ { "quoteright", 333, NULL },
+ { "Udieresis", 722, NULL },
+ { "perthousand", 1000, NULL },
+ { "Ydieresis", 722, NULL },
+ { "umacron", 500, NULL },
+ { "abreve", 444, NULL },
+ { "Eacute", 611, NULL },
+ { "adieresis", 444, NULL },
+ { "egrave", 444, NULL },
+ { "edieresis", 444, NULL },
+ { "idieresis", 278, NULL },
+ { "Eth", 722, NULL },
+ { "ae", 667, NULL },
+ { "asterisk", 500, NULL },
+ { "odieresis", 500, NULL },
+ { "Uacute", 722, NULL },
+ { "ugrave", 500, NULL },
+ { "nine", 500, NULL },
+ { "five", 500, NULL },
+ { "udieresis", 500, NULL },
+ { "Zcaron", 611, NULL },
+ { "Scommaaccent", 556, NULL },
+ { "threequarters", 750, NULL },
+ { "guillemotright", 500, NULL },
+ { "Ccedilla", 667, NULL },
+ { "ydieresis", 500, NULL },
+ { "tilde", 333, NULL },
+ { "at", 921, NULL },
+ { "eacute", 444, NULL },
+ { "underscore", 500, NULL },
+ { "Euro", 500, NULL },
+ { "Dcroat", 722, NULL },
+ { "multiply", 564, NULL },
+ { "zero", 500, NULL },
+ { "eth", 500, NULL },
+ { "Scedilla", 556, NULL },
+ { "Ograve", 722, NULL },
+ { "Racute", 667, NULL },
+ { "partialdiff", 476, NULL },
+ { "uacute", 500, NULL },
+ { "braceleft", 480, NULL },
+ { "Thorn", 556, NULL },
+ { "zcaron", 444, NULL },
+ { "scommaaccent", 389, NULL },
+ { "ccedilla", 444, NULL },
+ { "Dcaron", 722, NULL },
+ { "dcroat", 500, NULL },
+ { "Ocircumflex", 722, NULL },
+ { "Oacute", 722, NULL },
+ { "scedilla", 389, NULL },
+ { "ogonek", 333, NULL },
+ { "ograve", 500, NULL },
+ { "racute", 333, NULL },
+ { "Tcaron", 611, NULL },
+ { "Eogonek", 611, NULL },
+ { "thorn", 500, NULL },
+ { "degree", 400, NULL },
+ { "registered", 760, NULL },
+ { "radical", 453, NULL },
+ { "Aring", 722, NULL },
+ { "percent", 833, NULL },
+ { "six", 500, NULL },
+ { "paragraph", 453, NULL },
+ { "dcaron", 588, NULL },
+ { "Uogonek", 722, NULL },
+ { "two", 500, NULL },
+ { "summation", 600, NULL },
+ { "Igrave", 333, NULL },
+ { "Lacute", 611, NULL },
+ { "ocircumflex", 500, NULL },
+ { "oacute", 500, NULL },
+ { "Uring", 722, NULL },
+ { "Lcommaaccent", 611, NULL },
+ { "tcaron", 326, NULL },
+ { "eogonek", 444, NULL },
+ { "Delta", 612, NULL },
+ { "Ohungarumlaut", 722, NULL },
+ { "asciicircum", 469, NULL },
+ { "aring", 444, NULL },
+ { "grave", 333, NULL },
+ { "uogonek", 500, NULL },
+ { "bracketright", 333, NULL },
+ { "Iacute", 333, NULL },
+ { "ampersand", 778, NULL },
+ { "igrave", 278, NULL },
+ { "lacute", 278, NULL },
+ { "Ncaron", 722, NULL },
+ { "plus", 564, NULL },
+ { "uring", 500, NULL },
+ { "quotesinglbase", 333, NULL },
+ { "lcommaaccent", 278, NULL },
+ { "Yacute", 722, NULL },
+ { "ohungarumlaut", 500, NULL },
+ { "threesuperior", 300, NULL },
+ { "acute", 333, NULL },
+ { "section", 500, NULL },
+ { "dieresis", 333, NULL },
+ { "iacute", 278, NULL },
+ { "quotedblbase", 444, NULL },
+ { "ncaron", 500, NULL },
+ { "florin", 500, NULL },
+ { "yacute", 500, NULL },
+ { "Rcommaaccent", 667, NULL },
+ { "fi", 556, NULL },
+ { "fl", 556, NULL },
+ { "Acircumflex", 722, NULL },
+ { "Cacute", 667, NULL },
+ { "Icircumflex", 333, NULL },
+ { "guillemotleft", 500, NULL },
+ { "germandbls", 500, NULL },
+ { "Amacron", 722, NULL },
+ { "seven", 500, NULL },
+ { "Sacute", 556, NULL },
+ { "ordmasculine", 310, NULL },
+ { "dotlessi", 278, NULL },
+ { "sterling", 500, NULL },
+ { "notequal", 549, NULL },
+ { "Imacron", 333, NULL },
+ { "rcommaaccent", 333, NULL },
+ { "Zdotaccent", 611, NULL },
+ { "acircumflex", 444, NULL },
+ { "cacute", 444, NULL },
+ { "Ecaron", 611, NULL },
+ { "icircumflex", 278, NULL },
+ { "braceright", 480, NULL },
+ { "quotedblright", 444, NULL },
+ { "amacron", 444, NULL },
+ { "sacute", 389, NULL },
+ { "imacron", 278, NULL },
+ { "cent", 500, NULL },
+ { "currency", 500, NULL },
+ { "logicalnot", 564, NULL },
+ { "zdotaccent", 444, NULL },
+ { "Atilde", 722, NULL },
+ { "breve", 333, NULL },
+ { "bar", 200, NULL },
+ { "fraction", 167, NULL },
+ { "less", 564, NULL },
+ { "ecaron", 444, NULL },
+ { "guilsinglleft", 333, NULL },
+ { "exclam", 333, NULL },
+ { "period", 250, NULL },
+ { "Rcaron", 667, NULL },
+ { "Kcommaaccent", 722, NULL },
+ { "greater", 564, NULL },
+ { "atilde", 444, NULL },
+ { "brokenbar", 200, NULL },
+ { "quoteleft", 333, NULL },
+ { "Edotaccent", 611, NULL },
+ { "onesuperior", 300, NULL }
+};
+
+static BuiltinFontWidth zapfDingbatsWidthsTab[] = {
+ { "a81", 438, NULL },
+ { "a82", 138, NULL },
+ { "a83", 277, NULL },
+ { "a84", 415, NULL },
+ { "a85", 509, NULL },
+ { "a86", 410, NULL },
+ { "a87", 234, NULL },
+ { "a88", 234, NULL },
+ { "a89", 390, NULL },
+ { "a140", 788, NULL },
+ { "a141", 788, NULL },
+ { "a142", 788, NULL },
+ { "a143", 788, NULL },
+ { "a144", 788, NULL },
+ { "a145", 788, NULL },
+ { "a146", 788, NULL },
+ { "a147", 788, NULL },
+ { "a148", 788, NULL },
+ { "a149", 788, NULL },
+ { "a90", 390, NULL },
+ { "a91", 276, NULL },
+ { "a92", 276, NULL },
+ { "space", 278, NULL },
+ { "a93", 317, NULL },
+ { "a94", 317, NULL },
+ { "a95", 334, NULL },
+ { "a96", 334, NULL },
+ { "a97", 392, NULL },
+ { "a98", 392, NULL },
+ { "a99", 668, NULL },
+ { "a150", 788, NULL },
+ { "a151", 788, NULL },
+ { "a152", 788, NULL },
+ { "a153", 788, NULL },
+ { "a154", 788, NULL },
+ { "a155", 788, NULL },
+ { "a156", 788, NULL },
+ { "a157", 788, NULL },
+ { "a158", 788, NULL },
+ { "a159", 788, NULL },
+ { "a160", 894, NULL },
+ { "a161", 838, NULL },
+ { "a162", 924, NULL },
+ { "a163", 1016, NULL },
+ { "a164", 458, NULL },
+ { "a165", 924, NULL },
+ { "a166", 918, NULL },
+ { "a167", 927, NULL },
+ { "a168", 928, NULL },
+ { "a169", 928, NULL },
+ { "a170", 834, NULL },
+ { "a171", 873, NULL },
+ { "a172", 828, NULL },
+ { "a173", 924, NULL },
+ { "a174", 917, NULL },
+ { "a175", 930, NULL },
+ { "a176", 931, NULL },
+ { "a177", 463, NULL },
+ { "a178", 883, NULL },
+ { "a179", 836, NULL },
+ { "a180", 867, NULL },
+ { "a181", 696, NULL },
+ { "a182", 874, NULL },
+ { "a183", 760, NULL },
+ { "a184", 946, NULL },
+ { "a185", 865, NULL },
+ { "a186", 967, NULL },
+ { "a187", 831, NULL },
+ { "a188", 873, NULL },
+ { "a189", 927, NULL },
+ { "a1", 974, NULL },
+ { "a2", 961, NULL },
+ { "a3", 980, NULL },
+ { "a4", 719, NULL },
+ { "a5", 789, NULL },
+ { "a6", 494, NULL },
+ { "a7", 552, NULL },
+ { "a8", 537, NULL },
+ { "a9", 577, NULL },
+ { "a190", 970, NULL },
+ { "a191", 918, NULL },
+ { "a192", 748, NULL },
+ { "a193", 836, NULL },
+ { "a194", 771, NULL },
+ { "a195", 888, NULL },
+ { "a196", 748, NULL },
+ { "a197", 771, NULL },
+ { "a198", 888, NULL },
+ { "a199", 867, NULL },
+ { "a10", 692, NULL },
+ { "a11", 960, NULL },
+ { "a12", 939, NULL },
+ { "a13", 549, NULL },
+ { "a14", 855, NULL },
+ { "a15", 911, NULL },
+ { "a16", 933, NULL },
+ { "a17", 945, NULL },
+ { "a18", 974, NULL },
+ { "a19", 755, NULL },
+ { "a20", 846, NULL },
+ { "a21", 762, NULL },
+ { "a22", 761, NULL },
+ { "a23", 571, NULL },
+ { "a24", 677, NULL },
+ { "a25", 763, NULL },
+ { "a26", 760, NULL },
+ { "a27", 759, NULL },
+ { "a28", 754, NULL },
+ { "a29", 786, NULL },
+ { "a30", 788, NULL },
+ { "a31", 788, NULL },
+ { "a32", 790, NULL },
+ { "a33", 793, NULL },
+ { "a34", 794, NULL },
+ { "a35", 816, NULL },
+ { "a36", 823, NULL },
+ { "a37", 789, NULL },
+ { "a38", 841, NULL },
+ { "a39", 823, NULL },
+ { "a40", 833, NULL },
+ { "a41", 816, NULL },
+ { "a42", 831, NULL },
+ { "a43", 923, NULL },
+ { "a44", 744, NULL },
+ { "a45", 723, NULL },
+ { "a46", 749, NULL },
+ { "a47", 790, NULL },
+ { "a48", 792, NULL },
+ { "a49", 695, NULL },
+ { "a100", 668, NULL },
+ { "a101", 732, NULL },
+ { "a102", 544, NULL },
+ { "a103", 544, NULL },
+ { "a104", 910, NULL },
+ { "a105", 911, NULL },
+ { "a106", 667, NULL },
+ { "a107", 760, NULL },
+ { "a108", 760, NULL },
+ { "a109", 626, NULL },
+ { "a50", 776, NULL },
+ { "a51", 768, NULL },
+ { "a52", 792, NULL },
+ { "a53", 759, NULL },
+ { "a54", 707, NULL },
+ { "a55", 708, NULL },
+ { "a56", 682, NULL },
+ { "a57", 701, NULL },
+ { "a58", 826, NULL },
+ { "a59", 815, NULL },
+ { "a110", 694, NULL },
+ { "a111", 595, NULL },
+ { "a112", 776, NULL },
+ { "a117", 690, NULL },
+ { "a118", 791, NULL },
+ { "a119", 790, NULL },
+ { "a60", 789, NULL },
+ { "a61", 789, NULL },
+ { "a62", 707, NULL },
+ { "a63", 687, NULL },
+ { "a64", 696, NULL },
+ { "a65", 689, NULL },
+ { "a66", 786, NULL },
+ { "a67", 787, NULL },
+ { "a68", 713, NULL },
+ { "a69", 791, NULL },
+ { "a200", 696, NULL },
+ { "a201", 874, NULL },
+ { "a120", 788, NULL },
+ { "a121", 788, NULL },
+ { "a202", 974, NULL },
+ { "a122", 788, NULL },
+ { "a203", 762, NULL },
+ { "a123", 788, NULL },
+ { "a204", 759, NULL },
+ { "a124", 788, NULL },
+ { "a205", 509, NULL },
+ { "a125", 788, NULL },
+ { "a206", 410, NULL },
+ { "a126", 788, NULL },
+ { "a127", 788, NULL },
+ { "a128", 788, NULL },
+ { "a129", 788, NULL },
+ { "a70", 785, NULL },
+ { "a71", 791, NULL },
+ { "a72", 873, NULL },
+ { "a73", 761, NULL },
+ { "a74", 762, NULL },
+ { "a75", 759, NULL },
+ { "a76", 892, NULL },
+ { "a77", 892, NULL },
+ { "a78", 788, NULL },
+ { "a79", 784, NULL },
+ { "a130", 788, NULL },
+ { "a131", 788, NULL },
+ { "a132", 788, NULL },
+ { "a133", 788, NULL },
+ { "a134", 788, NULL },
+ { "a135", 788, NULL },
+ { "a136", 788, NULL },
+ { "a137", 788, NULL },
+ { "a138", 788, NULL },
+ { "a139", 788, NULL }
+};
+
+BuiltinFont builtinFonts[] = {
+ { "Courier", standardEncoding, 629, -157, { -23, -250, 715, 805}, NULL },
+ { "Courier-Bold", standardEncoding, 629, -157, {-113, -250, 749, 801}, NULL },
+ { "Courier-BoldOblique", standardEncoding, 629, -157, { -57, -250, 869, 801}, NULL },
+ { "Courier-Oblique", standardEncoding, 629, -157, { -27, -250, 849, 805}, NULL },
+ { "Helvetica", standardEncoding, 718, -207, {-166, -225, 1000, 931}, NULL },
+ { "Helvetica-Bold", standardEncoding, 718, -207, {-170, -228, 1003, 962}, NULL },
+ { "Helvetica-BoldOblique", standardEncoding, 718, -207, {-174, -228, 1114, 962}, NULL },
+ { "Helvetica-Oblique", standardEncoding, 718, -207, {-170, -225, 1116, 931}, NULL },
+ { "Symbol", symbolEncoding, 1010, -293, {-180, -293, 1090, 1010}, NULL },
+ { "Times-Bold", standardEncoding, 683, -217, {-168, -218, 1000, 935}, NULL },
+ { "Times-BoldItalic", standardEncoding, 683, -217, {-200, -218, 996, 921}, NULL },
+ { "Times-Italic", standardEncoding, 683, -217, {-169, -217, 1010, 883}, NULL },
+ { "Times-Roman", standardEncoding, 683, -217, {-168, -218, 1000, 898}, NULL },
+ { "ZapfDingbats", zapfDingbatsEncoding, 820, -143, { -1, -143, 981, 820}, NULL }
+};
+
+BuiltinFont *builtinFontSubst[] = {
+ &builtinFonts[0],
+ &builtinFonts[3],
+ &builtinFonts[1],
+ &builtinFonts[2],
+ &builtinFonts[4],
+ &builtinFonts[7],
+ &builtinFonts[5],
+ &builtinFonts[6],
+ &builtinFonts[12],
+ &builtinFonts[11],
+ &builtinFonts[9],
+ &builtinFonts[10]
+};
+
+void initBuiltinFontTables() {
+ builtinFonts[0].widths = new BuiltinFontWidths(courierWidthsTab, 315);
+ builtinFonts[1].widths = new BuiltinFontWidths(courierBoldWidthsTab, 315);
+ builtinFonts[2].widths = new BuiltinFontWidths(courierBoldObliqueWidthsTab, 315);
+ builtinFonts[3].widths = new BuiltinFontWidths(courierObliqueWidthsTab, 315);
+ builtinFonts[4].widths = new BuiltinFontWidths(helveticaWidthsTab, 315);
+ builtinFonts[5].widths = new BuiltinFontWidths(helveticaBoldWidthsTab, 316);
+ builtinFonts[6].widths = new BuiltinFontWidths(helveticaBoldObliqueWidthsTab, 315);
+ builtinFonts[7].widths = new BuiltinFontWidths(helveticaObliqueWidthsTab, 315);
+ builtinFonts[8].widths = new BuiltinFontWidths(symbolWidthsTab, 190);
+ builtinFonts[9].widths = new BuiltinFontWidths(timesBoldWidthsTab, 315);
+ builtinFonts[10].widths = new BuiltinFontWidths(timesBoldItalicWidthsTab, 315);
+ builtinFonts[11].widths = new BuiltinFontWidths(timesItalicWidthsTab, 315);
+ builtinFonts[12].widths = new BuiltinFontWidths(timesRomanWidthsTab, 315);
+ builtinFonts[13].widths = new BuiltinFontWidths(zapfDingbatsWidthsTab, 202);
+}
+
+void freeBuiltinFontTables() {
+ int i;
+
+ for (i = 0; i < 14; ++i) {
+ delete builtinFonts[i].widths;
+ }
+}
diff --git a/kpdf/xpdf/xpdf/CMakeLists.txt b/kpdf/xpdf/xpdf/CMakeLists.txt
index eb5e1762..bf9f329c 100644
--- a/kpdf/xpdf/xpdf/CMakeLists.txt
+++ b/kpdf/xpdf/xpdf/CMakeLists.txt
@@ -24,13 +24,14 @@ include_directories(
tde_add_library( xpdf STATIC_PIC
SOURCES
- Annot.cc Array.cc BuiltinFont.cc BuiltinFontTables.cc
- Catalog.cc CharCodeToUnicode.cc CMap.cc Decrypt.cc Dict.cc
- FontEncodingTables.cc Function.cc Gfx.cc GfxFont.cc GfxState.cc
- GlobalParams.cc JArithmeticDecoder.cc JBIG2Stream.cc Lexer.cc Link.cc
- NameToCharCode.cc Object.cc Outline.cc OutputDev.cc PDFDoc.cc
- PDFDocEncoding.cc PreScanOutputDev.cc PSTokenizer.cc Page.cc
- Parser.cc PSOutputDev.cc SecurityHandler.cc SplashOutputDev.cc
- Stream.cc JPXStream.cc TextOutputDev.cc UnicodeMap.cc
- UnicodeTypeTable.cc XRef.cc
+ Annot.cpp Array.cpp BuiltinFont.cpp BuiltinFontTables.cpp
+ Catalog.cpp CharCodeToUnicode.cpp CMap.cpp Decrypt.cpp Dict.cpp
+ FontEncodingTables.cpp Function.cpp Gfx.cpp GfxFont.cpp GfxState.cpp
+ GlobalParams.cpp JArithmeticDecoder.cpp JBIG2Stream.cpp Lexer.cpp Link.cpp
+ NameToCharCode.cpp Object.cpp Outline.cpp OutputDev.cpp PDFDoc.cpp
+ PDFDocEncoding.cpp PreScanOutputDev.cpp PSTokenizer.cpp Page.cpp
+ Parser.cpp PSOutputDev.cpp SecurityHandler.cpp SplashOutputDev.cpp
+ Stream.cpp JPXStream.cpp TextOutputDev.cpp UnicodeMap.cpp
+ UnicodeTypeTable.cpp XRef.cpp
+ LINK ${FONTCONFIG_LIBRARIES}
)
diff --git a/kpdf/xpdf/xpdf/CMap.cc b/kpdf/xpdf/xpdf/CMap.cc
deleted file mode 100644
index 89905a8c..00000000
--- a/kpdf/xpdf/xpdf/CMap.cc
+++ /dev/null
@@ -1,408 +0,0 @@
-//========================================================================
-//
-// CMap.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "gmem.h"
-#include "gfile.h"
-#include "GString.h"
-#include "Error.h"
-#include "GlobalParams.h"
-#include "PSTokenizer.h"
-#include "CMap.h"
-
-//------------------------------------------------------------------------
-
-struct CMapVectorEntry {
- GBool isVector;
- union {
- CMapVectorEntry *vector;
- CID cid;
- };
-};
-
-//------------------------------------------------------------------------
-
-static int CMap_getCharFromFile(void *data) {
- return fgetc((FILE *)data);
-}
-
-//------------------------------------------------------------------------
-
-CMap *CMap::parse(CMapCache *cache, GString *collectionA,
- GString *cMapNameA) {
- FILE *f;
- CMap *cmap;
- PSTokenizer *pst;
- char tok1[256], tok2[256], tok3[256];
- int n1, n2, n3;
- Guint start, end, code;
-
- if (!(f = globalParams->findCMapFile(collectionA, cMapNameA))) {
-
- // Check for an identity CMap.
- if (!cMapNameA->cmp("Identity") || !cMapNameA->cmp("Identity-H")) {
- return new CMap(collectionA->copy(), cMapNameA->copy(), 0);
- }
- if (!cMapNameA->cmp("Identity-V")) {
- return new CMap(collectionA->copy(), cMapNameA->copy(), 1);
- }
-
- error(-1, "Couldn't find '%s' CMap file for '%s' collection",
- cMapNameA->getCString(), collectionA->getCString());
- return NULL;
- }
-
- cmap = new CMap(collectionA->copy(), cMapNameA->copy());
-
- pst = new PSTokenizer(&CMap_getCharFromFile, f);
- pst->getToken(tok1, sizeof(tok1), &n1);
- while (pst->getToken(tok2, sizeof(tok2), &n2)) {
- if (!strcmp(tok2, "usecmap")) {
- if (tok1[0] == '/') {
- cmap->useCMap(cache, tok1 + 1);
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else if (!strcmp(tok1, "/WMode")) {
- cmap->wMode = atoi(tok2);
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else if (!strcmp(tok2, "begincodespacerange")) {
- while (pst->getToken(tok1, sizeof(tok1), &n1)) {
- if (!strcmp(tok1, "endcodespacerange")) {
- break;
- }
- if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
- !strcmp(tok2, "endcodespacerange")) {
- error(-1, "Illegal entry in codespacerange block in CMap");
- break;
- }
- if (tok1[0] == '<' && tok2[0] == '<' &&
- n1 == n2 && n1 >= 4 && (n1 & 1) == 0) {
- tok1[n1 - 1] = tok2[n1 - 1] = '\0';
- sscanf(tok1 + 1, "%x", &start);
- sscanf(tok2 + 1, "%x", &end);
- n1 = (n1 - 2) / 2;
- cmap->addCodeSpace(cmap->vector, start, end, n1);
- }
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else if (!strcmp(tok2, "begincidchar")) {
- while (pst->getToken(tok1, sizeof(tok1), &n1)) {
- if (!strcmp(tok1, "endcidchar")) {
- break;
- }
- if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
- !strcmp(tok2, "endcidchar")) {
- error(-1, "Illegal entry in cidchar block in CMap");
- break;
- }
- if (!(tok1[0] == '<' && tok1[n1 - 1] == '>' &&
- n1 >= 4 && (n1 & 1) == 0)) {
- error(-1, "Illegal entry in cidchar block in CMap");
- continue;
- }
- tok1[n1 - 1] = '\0';
- if (sscanf(tok1 + 1, "%x", &code) != 1) {
- error(-1, "Illegal entry in cidchar block in CMap");
- continue;
- }
- n1 = (n1 - 2) / 2;
- cmap->addCIDs(code, code, n1, (CID)atoi(tok2));
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else if (!strcmp(tok2, "begincidrange")) {
- while (pst->getToken(tok1, sizeof(tok1), &n1)) {
- if (!strcmp(tok1, "endcidrange")) {
- break;
- }
- if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
- !strcmp(tok2, "endcidrange") ||
- !pst->getToken(tok3, sizeof(tok3), &n3) ||
- !strcmp(tok3, "endcidrange")) {
- error(-1, "Illegal entry in cidrange block in CMap");
- break;
- }
- if (tok1[0] == '<' && tok2[0] == '<' &&
- n1 == n2 && n1 >= 4 && (n1 & 1) == 0) {
- tok1[n1 - 1] = tok2[n1 - 1] = '\0';
- sscanf(tok1 + 1, "%x", &start);
- sscanf(tok2 + 1, "%x", &end);
- n1 = (n1 - 2) / 2;
- cmap->addCIDs(start, end, n1, (CID)atoi(tok3));
- }
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else {
- strcpy(tok1, tok2);
- }
- }
- delete pst;
-
- fclose(f);
-
- return cmap;
-}
-
-CMap::CMap(GString *collectionA, GString *cMapNameA) {
- int i;
-
- collection = collectionA;
- cMapName = cMapNameA;
- wMode = 0;
- vector = (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
- for (i = 0; i < 256; ++i) {
- vector[i].isVector = gFalse;
- vector[i].cid = 0;
- }
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-CMap::CMap(GString *collectionA, GString *cMapNameA, int wModeA) {
- collection = collectionA;
- cMapName = cMapNameA;
- wMode = wModeA;
- vector = NULL;
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-void CMap::useCMap(CMapCache *cache, char *useName) {
- GString *useNameStr;
- CMap *subCMap;
-
- useNameStr = new GString(useName);
- subCMap = cache->getCMap(collection, useNameStr);
- delete useNameStr;
- if (!subCMap) {
- return;
- }
- copyVector(vector, subCMap->vector);
- subCMap->decRefCnt();
-}
-
-void CMap::copyVector(CMapVectorEntry *dest, CMapVectorEntry *src) {
- int i, j;
-
- for (i = 0; i < 256; ++i) {
- if (src[i].isVector) {
- if (!dest[i].isVector) {
- dest[i].isVector = gTrue;
- dest[i].vector =
- (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
- for (j = 0; j < 256; ++j) {
- dest[i].vector[j].isVector = gFalse;
- dest[i].vector[j].cid = 0;
- }
- }
- copyVector(dest[i].vector, src[i].vector);
- } else {
- if (dest[i].isVector) {
- error(-1, "Collision in usecmap");
- } else {
- dest[i].cid = src[i].cid;
- }
- }
- }
-}
-
-void CMap::addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
- Guint nBytes) {
- Guint start2, end2;
- int startByte, endByte, i, j;
-
- if (nBytes > 1) {
- startByte = (start >> (8 * (nBytes - 1))) & 0xff;
- endByte = (end >> (8 * (nBytes - 1))) & 0xff;
- start2 = start & ((1 << (8 * (nBytes - 1))) - 1);
- end2 = end & ((1 << (8 * (nBytes - 1))) - 1);
- for (i = startByte; i <= endByte; ++i) {
- if (!vec[i].isVector) {
- vec[i].isVector = gTrue;
- vec[i].vector =
- (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
- for (j = 0; j < 256; ++j) {
- vec[i].vector[j].isVector = gFalse;
- vec[i].vector[j].cid = 0;
- }
- }
- addCodeSpace(vec[i].vector, start2, end2, nBytes - 1);
- }
- }
-}
-
-void CMap::addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID) {
- CMapVectorEntry *vec;
- CID cid;
- int byte;
- Guint i;
-
- vec = vector;
- for (i = nBytes - 1; i >= 1; --i) {
- byte = (start >> (8 * i)) & 0xff;
- if (!vec[byte].isVector) {
- error(-1, "Invalid CID (%0*x - %0*x) in CMap",
- 2*nBytes, start, 2*nBytes, end);
- return;
- }
- vec = vec[byte].vector;
- }
- cid = firstCID;
- for (byte = (int)(start & 0xff); byte <= (int)(end & 0xff); ++byte) {
- if (vec[byte].isVector) {
- error(-1, "Invalid CID (%0*x - %0*x) in CMap",
- 2*nBytes, start, 2*nBytes, end);
- } else {
- vec[byte].cid = cid;
- }
- ++cid;
- }
-}
-
-CMap::~CMap() {
- delete collection;
- delete cMapName;
- if (vector) {
- freeCMapVector(vector);
- }
-#if MULTITHREADED
- gDestroyMutex(&mutex);
-#endif
-}
-
-void CMap::freeCMapVector(CMapVectorEntry *vec) {
- int i;
-
- for (i = 0; i < 256; ++i) {
- if (vec[i].isVector) {
- freeCMapVector(vec[i].vector);
- }
- }
- gfree(vec);
-}
-
-void CMap::incRefCnt() {
-#if MULTITHREADED
- gLockMutex(&mutex);
-#endif
- ++refCnt;
-#if MULTITHREADED
- gUnlockMutex(&mutex);
-#endif
-}
-
-void CMap::decRefCnt() {
- GBool done;
-
-#if MULTITHREADED
- gLockMutex(&mutex);
-#endif
- done = --refCnt == 0;
-#if MULTITHREADED
- gUnlockMutex(&mutex);
-#endif
- if (done) {
- delete this;
- }
-}
-
-GBool CMap::match(GString *collectionA, GString *cMapNameA) {
- return !collection->cmp(collectionA) && !cMapName->cmp(cMapNameA);
-}
-
-CID CMap::getCID(char *s, int len, int *nUsed) {
- CMapVectorEntry *vec;
- int n, i;
-
- if (!(vec = vector)) {
- // identity CMap
- *nUsed = 2;
- if (len < 2) {
- return 0;
- }
- return ((s[0] & 0xff) << 8) + (s[1] & 0xff);
- }
- n = 0;
- while (1) {
- if (n >= len) {
- *nUsed = n;
- return 0;
- }
- i = s[n++] & 0xff;
- if (!vec[i].isVector) {
- *nUsed = n;
- return vec[i].cid;
- }
- vec = vec[i].vector;
- }
-}
-
-//------------------------------------------------------------------------
-
-CMapCache::CMapCache() {
- int i;
-
- for (i = 0; i < cMapCacheSize; ++i) {
- cache[i] = NULL;
- }
-}
-
-CMapCache::~CMapCache() {
- int i;
-
- for (i = 0; i < cMapCacheSize; ++i) {
- if (cache[i]) {
- cache[i]->decRefCnt();
- }
- }
-}
-
-CMap *CMapCache::getCMap(GString *collection, GString *cMapName) {
- CMap *cmap;
- int i, j;
-
- if (cache[0] && cache[0]->match(collection, cMapName)) {
- cache[0]->incRefCnt();
- return cache[0];
- }
- for (i = 1; i < cMapCacheSize; ++i) {
- if (cache[i] && cache[i]->match(collection, cMapName)) {
- cmap = cache[i];
- for (j = i; j >= 1; --j) {
- cache[j] = cache[j - 1];
- }
- cache[0] = cmap;
- cmap->incRefCnt();
- return cmap;
- }
- }
- if ((cmap = CMap::parse(this, collection, cMapName))) {
- if (cache[cMapCacheSize - 1]) {
- cache[cMapCacheSize - 1]->decRefCnt();
- }
- for (j = cMapCacheSize - 1; j >= 1; --j) {
- cache[j] = cache[j - 1];
- }
- cache[0] = cmap;
- cmap->incRefCnt();
- return cmap;
- }
- return NULL;
-}
diff --git a/kpdf/xpdf/xpdf/CMap.cpp b/kpdf/xpdf/xpdf/CMap.cpp
new file mode 100644
index 00000000..dfad915f
--- /dev/null
+++ b/kpdf/xpdf/xpdf/CMap.cpp
@@ -0,0 +1,408 @@
+//========================================================================
+//
+// CMap.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "gfile.h"
+#include "GString.h"
+#include "Error.h"
+#include "GlobalParams.h"
+#include "PSTokenizer.h"
+#include "CMap.h"
+
+//------------------------------------------------------------------------
+
+struct CMapVectorEntry {
+ GBool isVector;
+ union {
+ CMapVectorEntry *vector;
+ CID cid;
+ };
+};
+
+//------------------------------------------------------------------------
+
+static int CMap_getCharFromFile(void *data) {
+ return fgetc((FILE *)data);
+}
+
+//------------------------------------------------------------------------
+
+CMap *CMap::parse(CMapCache *cache, GString *collectionA,
+ GString *cMapNameA) {
+ FILE *f;
+ CMap *cmap;
+ PSTokenizer *pst;
+ char tok1[256], tok2[256], tok3[256];
+ int n1, n2, n3;
+ Guint start, end, code;
+
+ if (!(f = globalParams->findCMapFile(collectionA, cMapNameA))) {
+
+ // Check for an identity CMap.
+ if (!cMapNameA->cmp("Identity") || !cMapNameA->cmp("Identity-H")) {
+ return new CMap(collectionA->copy(), cMapNameA->copy(), 0);
+ }
+ if (!cMapNameA->cmp("Identity-V")) {
+ return new CMap(collectionA->copy(), cMapNameA->copy(), 1);
+ }
+
+ error(-1, "Couldn't find '%s' CMap file for '%s' collection",
+ cMapNameA->getCString(), collectionA->getCString());
+ return NULL;
+ }
+
+ cmap = new CMap(collectionA->copy(), cMapNameA->copy());
+
+ pst = new PSTokenizer(&CMap_getCharFromFile, f);
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ while (pst->getToken(tok2, sizeof(tok2), &n2)) {
+ if (!strcmp(tok2, "usecmap")) {
+ if (tok1[0] == '/') {
+ cmap->useCMap(cache, tok1 + 1);
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else if (!strcmp(tok1, "/WMode")) {
+ cmap->wMode = atoi(tok2);
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else if (!strcmp(tok2, "begincodespacerange")) {
+ while (pst->getToken(tok1, sizeof(tok1), &n1)) {
+ if (!strcmp(tok1, "endcodespacerange")) {
+ break;
+ }
+ if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
+ !strcmp(tok2, "endcodespacerange")) {
+ error(-1, "Illegal entry in codespacerange block in CMap");
+ break;
+ }
+ if (tok1[0] == '<' && tok2[0] == '<' &&
+ n1 == n2 && n1 >= 4 && (n1 & 1) == 0) {
+ tok1[n1 - 1] = tok2[n1 - 1] = '\0';
+ sscanf(tok1 + 1, "%x", &start);
+ sscanf(tok2 + 1, "%x", &end);
+ n1 = (n1 - 2) / 2;
+ cmap->addCodeSpace(cmap->vector, start, end, n1);
+ }
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else if (!strcmp(tok2, "begincidchar")) {
+ while (pst->getToken(tok1, sizeof(tok1), &n1)) {
+ if (!strcmp(tok1, "endcidchar")) {
+ break;
+ }
+ if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
+ !strcmp(tok2, "endcidchar")) {
+ error(-1, "Illegal entry in cidchar block in CMap");
+ break;
+ }
+ if (!(tok1[0] == '<' && tok1[n1 - 1] == '>' &&
+ n1 >= 4 && (n1 & 1) == 0)) {
+ error(-1, "Illegal entry in cidchar block in CMap");
+ continue;
+ }
+ tok1[n1 - 1] = '\0';
+ if (sscanf(tok1 + 1, "%x", &code) != 1) {
+ error(-1, "Illegal entry in cidchar block in CMap");
+ continue;
+ }
+ n1 = (n1 - 2) / 2;
+ cmap->addCIDs(code, code, n1, (CID)atoi(tok2));
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else if (!strcmp(tok2, "begincidrange")) {
+ while (pst->getToken(tok1, sizeof(tok1), &n1)) {
+ if (!strcmp(tok1, "endcidrange")) {
+ break;
+ }
+ if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
+ !strcmp(tok2, "endcidrange") ||
+ !pst->getToken(tok3, sizeof(tok3), &n3) ||
+ !strcmp(tok3, "endcidrange")) {
+ error(-1, "Illegal entry in cidrange block in CMap");
+ break;
+ }
+ if (tok1[0] == '<' && tok2[0] == '<' &&
+ n1 == n2 && n1 >= 4 && (n1 & 1) == 0) {
+ tok1[n1 - 1] = tok2[n1 - 1] = '\0';
+ sscanf(tok1 + 1, "%x", &start);
+ sscanf(tok2 + 1, "%x", &end);
+ n1 = (n1 - 2) / 2;
+ cmap->addCIDs(start, end, n1, (CID)atoi(tok3));
+ }
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else {
+ strcpy(tok1, tok2);
+ }
+ }
+ delete pst;
+
+ fclose(f);
+
+ return cmap;
+}
+
+CMap::CMap(GString *collectionA, GString *cMapNameA) {
+ int i;
+
+ collection = collectionA;
+ cMapName = cMapNameA;
+ wMode = 0;
+ vector = (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
+ for (i = 0; i < 256; ++i) {
+ vector[i].isVector = gFalse;
+ vector[i].cid = 0;
+ }
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+CMap::CMap(GString *collectionA, GString *cMapNameA, int wModeA) {
+ collection = collectionA;
+ cMapName = cMapNameA;
+ wMode = wModeA;
+ vector = NULL;
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+void CMap::useCMap(CMapCache *cache, char *useName) {
+ GString *useNameStr;
+ CMap *subCMap;
+
+ useNameStr = new GString(useName);
+ subCMap = cache->getCMap(collection, useNameStr);
+ delete useNameStr;
+ if (!subCMap) {
+ return;
+ }
+ copyVector(vector, subCMap->vector);
+ subCMap->decRefCnt();
+}
+
+void CMap::copyVector(CMapVectorEntry *dest, CMapVectorEntry *src) {
+ int i, j;
+
+ for (i = 0; i < 256; ++i) {
+ if (src[i].isVector) {
+ if (!dest[i].isVector) {
+ dest[i].isVector = gTrue;
+ dest[i].vector =
+ (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
+ for (j = 0; j < 256; ++j) {
+ dest[i].vector[j].isVector = gFalse;
+ dest[i].vector[j].cid = 0;
+ }
+ }
+ copyVector(dest[i].vector, src[i].vector);
+ } else {
+ if (dest[i].isVector) {
+ error(-1, "Collision in usecmap");
+ } else {
+ dest[i].cid = src[i].cid;
+ }
+ }
+ }
+}
+
+void CMap::addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
+ Guint nBytes) {
+ Guint start2, end2;
+ int startByte, endByte, i, j;
+
+ if (nBytes > 1) {
+ startByte = (start >> (8 * (nBytes - 1))) & 0xff;
+ endByte = (end >> (8 * (nBytes - 1))) & 0xff;
+ start2 = start & ((1 << (8 * (nBytes - 1))) - 1);
+ end2 = end & ((1 << (8 * (nBytes - 1))) - 1);
+ for (i = startByte; i <= endByte; ++i) {
+ if (!vec[i].isVector) {
+ vec[i].isVector = gTrue;
+ vec[i].vector =
+ (CMapVectorEntry *)gmallocn(256, sizeof(CMapVectorEntry));
+ for (j = 0; j < 256; ++j) {
+ vec[i].vector[j].isVector = gFalse;
+ vec[i].vector[j].cid = 0;
+ }
+ }
+ addCodeSpace(vec[i].vector, start2, end2, nBytes - 1);
+ }
+ }
+}
+
+void CMap::addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID) {
+ CMapVectorEntry *vec;
+ CID cid;
+ int byte;
+ Guint i;
+
+ vec = vector;
+ for (i = nBytes - 1; i >= 1; --i) {
+ byte = (start >> (8 * i)) & 0xff;
+ if (!vec[byte].isVector) {
+ error(-1, "Invalid CID (%0*x - %0*x) in CMap",
+ 2*nBytes, start, 2*nBytes, end);
+ return;
+ }
+ vec = vec[byte].vector;
+ }
+ cid = firstCID;
+ for (byte = (int)(start & 0xff); byte <= (int)(end & 0xff); ++byte) {
+ if (vec[byte].isVector) {
+ error(-1, "Invalid CID (%0*x - %0*x) in CMap",
+ 2*nBytes, start, 2*nBytes, end);
+ } else {
+ vec[byte].cid = cid;
+ }
+ ++cid;
+ }
+}
+
+CMap::~CMap() {
+ delete collection;
+ delete cMapName;
+ if (vector) {
+ freeCMapVector(vector);
+ }
+#if MULTITHREADED
+ gDestroyMutex(&mutex);
+#endif
+}
+
+void CMap::freeCMapVector(CMapVectorEntry *vec) {
+ int i;
+
+ for (i = 0; i < 256; ++i) {
+ if (vec[i].isVector) {
+ freeCMapVector(vec[i].vector);
+ }
+ }
+ gfree(vec);
+}
+
+void CMap::incRefCnt() {
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ ++refCnt;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+}
+
+void CMap::decRefCnt() {
+ GBool done;
+
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ done = --refCnt == 0;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+ if (done) {
+ delete this;
+ }
+}
+
+GBool CMap::match(GString *collectionA, GString *cMapNameA) {
+ return !collection->cmp(collectionA) && !cMapName->cmp(cMapNameA);
+}
+
+CID CMap::getCID(char *s, int len, int *nUsed) {
+ CMapVectorEntry *vec;
+ int n, i;
+
+ if (!(vec = vector)) {
+ // identity CMap
+ *nUsed = 2;
+ if (len < 2) {
+ return 0;
+ }
+ return ((s[0] & 0xff) << 8) + (s[1] & 0xff);
+ }
+ n = 0;
+ while (1) {
+ if (n >= len) {
+ *nUsed = n;
+ return 0;
+ }
+ i = s[n++] & 0xff;
+ if (!vec[i].isVector) {
+ *nUsed = n;
+ return vec[i].cid;
+ }
+ vec = vec[i].vector;
+ }
+}
+
+//------------------------------------------------------------------------
+
+CMapCache::CMapCache() {
+ int i;
+
+ for (i = 0; i < cMapCacheSize; ++i) {
+ cache[i] = NULL;
+ }
+}
+
+CMapCache::~CMapCache() {
+ int i;
+
+ for (i = 0; i < cMapCacheSize; ++i) {
+ if (cache[i]) {
+ cache[i]->decRefCnt();
+ }
+ }
+}
+
+CMap *CMapCache::getCMap(GString *collection, GString *cMapName) {
+ CMap *cmap;
+ int i, j;
+
+ if (cache[0] && cache[0]->match(collection, cMapName)) {
+ cache[0]->incRefCnt();
+ return cache[0];
+ }
+ for (i = 1; i < cMapCacheSize; ++i) {
+ if (cache[i] && cache[i]->match(collection, cMapName)) {
+ cmap = cache[i];
+ for (j = i; j >= 1; --j) {
+ cache[j] = cache[j - 1];
+ }
+ cache[0] = cmap;
+ cmap->incRefCnt();
+ return cmap;
+ }
+ }
+ if ((cmap = CMap::parse(this, collection, cMapName))) {
+ if (cache[cMapCacheSize - 1]) {
+ cache[cMapCacheSize - 1]->decRefCnt();
+ }
+ for (j = cMapCacheSize - 1; j >= 1; --j) {
+ cache[j] = cache[j - 1];
+ }
+ cache[0] = cmap;
+ cmap->incRefCnt();
+ return cmap;
+ }
+ return NULL;
+}
diff --git a/kpdf/xpdf/xpdf/Catalog.cc b/kpdf/xpdf/xpdf/Catalog.cc
deleted file mode 100644
index 198703a4..00000000
--- a/kpdf/xpdf/xpdf/Catalog.cc
+++ /dev/null
@@ -1,443 +0,0 @@
-//========================================================================
-//
-// Catalog.cc
-//
-// Copyright 1996-2007 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include <stdlib.h>
-#include "gmem.h"
-#include "Object.h"
-#include "XRef.h"
-#include "Array.h"
-#include "Dict.h"
-#include "Page.h"
-#include "Error.h"
-#include "Link.h"
-#include "Catalog.h"
-
-//------------------------------------------------------------------------
-// Catalog
-//------------------------------------------------------------------------
-
-Catalog::Catalog(XRef *xrefA) {
- Object catDict, pagesDict, pagesDictRef;
- Object obj, obj2;
- char *alreadyRead;
- int numPages0;
- int i;
-
- ok = gTrue;
- xref = xrefA;
- pages = NULL;
- pageRefs = NULL;
- numPages = pagesSize = 0;
- baseURI = NULL;
-
- xref->getCatalog(&catDict);
- if (!catDict.isDict()) {
- error(-1, "Catalog object is wrong type (%s)", catDict.getTypeName());
- goto err1;
- }
-
- // read page tree
- catDict.dictLookup("Pages", &pagesDict);
- // This should really be isDict("Pages"), but I've seen at least one
- // PDF file where the /Type entry is missing.
- if (!pagesDict.isDict()) {
- error(-1, "Top-level pages object is wrong type (%s)",
- pagesDict.getTypeName());
- goto err2;
- }
- pagesDict.dictLookup("Count", &obj);
- // some PDF files actually use real numbers here ("/Count 9.0")
- if (!obj.isNum()) {
- error(-1, "Page count in top-level pages object is wrong type (%s)",
- obj.getTypeName());
- goto err3;
- }
- pagesSize = numPages0 = (int)obj.getNum();
- obj.free();
- pages = (Page **)gmallocn(pagesSize, sizeof(Page *));
- pageRefs = (Ref *)gmallocn(pagesSize, sizeof(Ref));
- for (i = 0; i < pagesSize; ++i) {
- pages[i] = NULL;
- pageRefs[i].num = -1;
- pageRefs[i].gen = -1;
- }
- alreadyRead = (char *)gmalloc(xref->getNumObjects());
- memset(alreadyRead, 0, xref->getNumObjects());
- if (catDict.dictLookupNF("Pages", &pagesDictRef)->isRef() &&
- pagesDictRef.getRefNum() >= 0 &&
- pagesDictRef.getRefNum() < xref->getNumObjects()) {
- alreadyRead[pagesDictRef.getRefNum()] = 1;
- }
- pagesDictRef.free();
- numPages = readPageTree(pagesDict.getDict(), NULL, 0, alreadyRead);
- gfree(alreadyRead);
- if (numPages != numPages0) {
- error(-1, "Page count in top-level pages object is incorrect");
- }
- pagesDict.free();
-
- // read named destination dictionary
- catDict.dictLookup("Dests", &dests);
-
- // read root of named destination tree
- if (catDict.dictLookup("Names", &obj)->isDict()) {
- obj.dictLookup("Dests", &obj2);
- destNameTree.init(xref, &obj2);
- obj2.free();
- }
- obj.free();
-
- // read base URI
- if (catDict.dictLookup("URI", &obj)->isDict()) {
- if (obj.dictLookup("Base", &obj2)->isString()) {
- baseURI = obj2.getString()->copy();
- }
- obj2.free();
- }
- obj.free();
-
- // read page mode
- if (catDict.dictLookup("PageMode", &obj)->isName()) {
- if (strcmp(obj.getName(), "UseNone") == 0)
- pageMode = UseNone;
- else if (strcmp(obj.getName(), "UseOutlines") == 0)
- pageMode = UseOutlines;
- else if (strcmp(obj.getName(), "UseThumbs") == 0)
- pageMode = UseThumbs;
- else if (strcmp(obj.getName(), "FullScreen") == 0)
- pageMode = FullScreen;
- else if (strcmp(obj.getName(), "UseOC") == 0)
- pageMode = UseOC;
- else
- pageMode = UseNone;
- } else {
- pageMode = UseNone;
- }
- obj.free();
-
- // get the metadata stream
- catDict.dictLookup("Metadata", &metadata);
-
- // get the structure tree root
- catDict.dictLookup("StructTreeRoot", &structTreeRoot);
-
- // get the outline dictionary
- catDict.dictLookup("Outlines", &outline);
-
- // get the AcroForm dictionary
- catDict.dictLookup("AcroForm", &acroForm);
-
- catDict.free();
- return;
-
- err3:
- obj.free();
- err2:
- pagesDict.free();
- err1:
- catDict.free();
- dests.initNull();
- ok = gFalse;
-}
-
-Catalog::~Catalog() {
- int i;
-
- if (pages) {
- for (i = 0; i < pagesSize; ++i) {
- if (pages[i]) {
- delete pages[i];
- }
- }
- gfree(pages);
- gfree(pageRefs);
- }
- dests.free();
- destNameTree.free();
- if (baseURI) {
- delete baseURI;
- }
- metadata.free();
- structTreeRoot.free();
- outline.free();
- acroForm.free();
-}
-
-GString *Catalog::readMetadata() {
- GString *s;
- Dict *dict;
- Object obj;
- int c;
-
- if (!metadata.isStream()) {
- return NULL;
- }
- dict = metadata.streamGetDict();
- if (!dict->lookup("Subtype", &obj)->isName("XML")) {
- error(-1, "Unknown Metadata type: '%s'",
- obj.isName() ? obj.getName() : "???");
- }
- obj.free();
- s = new GString();
- metadata.streamReset();
- while ((c = metadata.streamGetChar()) != EOF) {
- s->append(c);
- }
- metadata.streamClose();
- return s;
-}
-
-int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start,
- char *alreadyRead) {
- Object kids;
- Object kid;
- Object kidRef;
- PageAttrs *attrs1, *attrs2;
- Page *page;
- int i, j;
-
- attrs1 = new PageAttrs(attrs, pagesDict);
- pagesDict->lookup("Kids", &kids);
- if (!kids.isArray()) {
- error(-1, "Kids object (page %d) is wrong type (%s)",
- start+1, kids.getTypeName());
- goto err1;
- }
- for (i = 0; i < kids.arrayGetLength(); ++i) {
- kids.arrayGetNF(i, &kidRef);
- if (kidRef.isRef() &&
- kidRef.getRefNum() >= 0 &&
- kidRef.getRefNum() < xref->getNumObjects()) {
- if (alreadyRead[kidRef.getRefNum()]) {
- error(-1, "Loop in Pages tree");
- kidRef.free();
- continue;
- }
- alreadyRead[kidRef.getRefNum()] = 1;
- }
- kids.arrayGet(i, &kid);
- if (kid.isDict("Page")) {
- attrs2 = new PageAttrs(attrs1, kid.getDict());
- page = new Page(xref, start+1, kid.getDict(), attrs2);
- if (!page->isOk()) {
- ++start;
- goto err3;
- }
- if (start >= pagesSize) {
- pagesSize += 32;
- pages = (Page **)greallocn(pages, pagesSize, sizeof(Page *));
- pageRefs = (Ref *)greallocn(pageRefs, pagesSize, sizeof(Ref));
- for (j = pagesSize - 32; j < pagesSize; ++j) {
- pages[j] = NULL;
- pageRefs[j].num = -1;
- pageRefs[j].gen = -1;
- }
- }
- pages[start] = page;
- if (kidRef.isRef()) {
- pageRefs[start].num = kidRef.getRefNum();
- pageRefs[start].gen = kidRef.getRefGen();
- }
- ++start;
- // This should really be isDict("Pages"), but I've seen at least one
- // PDF file where the /Type entry is missing.
- } else if (kid.isDict()) {
- if ((start = readPageTree(kid.getDict(), attrs1, start, alreadyRead))
- < 0)
- goto err2;
- } else {
- error(-1, "Kid object (page %d) is wrong type (%s)",
- start+1, kid.getTypeName());
- }
- kid.free();
- kidRef.free();
- }
- delete attrs1;
- kids.free();
- return start;
-
- err3:
- delete page;
- err2:
- kid.free();
- err1:
- kids.free();
- delete attrs1;
- ok = gFalse;
- return -1;
-}
-
-int Catalog::findPage(int num, int gen) {
- int i;
-
- for (i = 0; i < numPages; ++i) {
- if (pageRefs[i].num == num && pageRefs[i].gen == gen)
- return i + 1;
- }
- return 0;
-}
-
-LinkDest *Catalog::findDest(GString *name) {
- LinkDest *dest;
- Object obj1, obj2;
- GBool found;
-
- // try named destination dictionary then name tree
- found = gFalse;
- if (dests.isDict()) {
- if (!dests.dictLookup(name->getCString(), &obj1)->isNull())
- found = gTrue;
- else
- obj1.free();
- }
- if (!found) {
- if (destNameTree.lookup(name, &obj1))
- found = gTrue;
- else
- obj1.free();
- }
- if (!found)
- return NULL;
-
- // construct LinkDest
- dest = NULL;
- if (obj1.isArray()) {
- dest = new LinkDest(obj1.getArray());
- } else if (obj1.isDict()) {
- if (obj1.dictLookup("D", &obj2)->isArray())
- dest = new LinkDest(obj2.getArray());
- else
- error(-1, "Bad named destination value");
- obj2.free();
- } else {
- error(-1, "Bad named destination value");
- }
- obj1.free();
- if (dest && !dest->isOk()) {
- delete dest;
- dest = NULL;
- }
-
- return dest;
-}
-
-NameTree::NameTree()
-{
- size = 0;
- length = 0;
- entries = NULL;
-}
-
-NameTree::Entry::Entry(Array *array, int index) {
- if (!array->getString(index, &name) || !array->getNF(index + 1, &value))
- error(-1, "Invalid page tree");
-}
-
-NameTree::Entry::~Entry() {
- value.free();
-}
-
-void NameTree::addEntry(Entry *entry)
-{
- if (length == size) {
- if (length == 0) {
- size = 8;
- } else {
- size *= 2;
- }
- entries = (Entry **) grealloc (entries, sizeof (Entry *) * size);
- }
-
- entries[length] = entry;
- ++length;
-}
-
-void NameTree::init(XRef *xrefA, Object *tree) {
- xref = xrefA;
- parse(tree);
-}
-
-void NameTree::parse(Object *tree) {
- Object names;
- Object kids, kid;
- int i;
-
- if (!tree->isDict())
- return;
-
- // leaf node
- if (tree->dictLookup("Names", &names)->isArray()) {
- for (i = 0; i < names.arrayGetLength(); i += 2) {
- NameTree::Entry *entry;
-
- entry = new Entry(names.getArray(), i);
- addEntry(entry);
- }
- }
- names.free();
-
- // root or intermediate node
- if (tree->dictLookup("Kids", &kids)->isArray()) {
- for (i = 0; i < kids.arrayGetLength(); ++i) {
- if (kids.arrayGet(i, &kid)->isDict())
- parse(&kid);
- kid.free();
- }
- }
- kids.free();
-}
-
-int NameTree::Entry::cmp(const void *voidKey, const void *voidEntry)
-{
- GString *key = (GString *) voidKey;
- Entry *entry = *(NameTree::Entry **) voidEntry;
-
- return key->cmp(&entry->name);
-}
-
-GBool NameTree::lookup(GString *name, Object *obj)
-{
- Entry *entry;
-
- Entry **e = (Entry **) bsearch(name, entries,
- length, sizeof(Entry *), Entry::cmp);
- if (e) entry = *e;
- else
- {
- error(-1, "failed to look up %s\n", name->getCString());
- obj->initNull();
- return gFalse;
- }
- if (entry != NULL) {
- entry->value.fetch(xref, obj);
- return gTrue;
- } else {
- error(-1, "failed to look up %s\n", name->getCString());
-
- obj->initNull();
-
- return gFalse;
- }
-}
-
-void NameTree::free()
-{
- int i;
-
- for (i = 0; i < length; i++)
- delete entries[i];
-
- gfree(entries);
-}
diff --git a/kpdf/xpdf/xpdf/Catalog.cpp b/kpdf/xpdf/xpdf/Catalog.cpp
new file mode 100644
index 00000000..ce64af09
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Catalog.cpp
@@ -0,0 +1,443 @@
+//========================================================================
+//
+// Catalog.cpp
+//
+// Copyright 1996-2007 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include "gmem.h"
+#include "Object.h"
+#include "XRef.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Page.h"
+#include "Error.h"
+#include "Link.h"
+#include "Catalog.h"
+
+//------------------------------------------------------------------------
+// Catalog
+//------------------------------------------------------------------------
+
+Catalog::Catalog(XRef *xrefA) {
+ Object catDict, pagesDict, pagesDictRef;
+ Object obj, obj2;
+ char *alreadyRead;
+ int numPages0;
+ int i;
+
+ ok = gTrue;
+ xref = xrefA;
+ pages = NULL;
+ pageRefs = NULL;
+ numPages = pagesSize = 0;
+ baseURI = NULL;
+
+ xref->getCatalog(&catDict);
+ if (!catDict.isDict()) {
+ error(-1, "Catalog object is wrong type (%s)", catDict.getTypeName());
+ goto err1;
+ }
+
+ // read page tree
+ catDict.dictLookup("Pages", &pagesDict);
+ // This should really be isDict("Pages"), but I've seen at least one
+ // PDF file where the /Type entry is missing.
+ if (!pagesDict.isDict()) {
+ error(-1, "Top-level pages object is wrong type (%s)",
+ pagesDict.getTypeName());
+ goto err2;
+ }
+ pagesDict.dictLookup("Count", &obj);
+ // some PDF files actually use real numbers here ("/Count 9.0")
+ if (!obj.isNum()) {
+ error(-1, "Page count in top-level pages object is wrong type (%s)",
+ obj.getTypeName());
+ goto err3;
+ }
+ pagesSize = numPages0 = (int)obj.getNum();
+ obj.free();
+ pages = (Page **)gmallocn(pagesSize, sizeof(Page *));
+ pageRefs = (Ref *)gmallocn(pagesSize, sizeof(Ref));
+ for (i = 0; i < pagesSize; ++i) {
+ pages[i] = NULL;
+ pageRefs[i].num = -1;
+ pageRefs[i].gen = -1;
+ }
+ alreadyRead = (char *)gmalloc(xref->getNumObjects());
+ memset(alreadyRead, 0, xref->getNumObjects());
+ if (catDict.dictLookupNF("Pages", &pagesDictRef)->isRef() &&
+ pagesDictRef.getRefNum() >= 0 &&
+ pagesDictRef.getRefNum() < xref->getNumObjects()) {
+ alreadyRead[pagesDictRef.getRefNum()] = 1;
+ }
+ pagesDictRef.free();
+ numPages = readPageTree(pagesDict.getDict(), NULL, 0, alreadyRead);
+ gfree(alreadyRead);
+ if (numPages != numPages0) {
+ error(-1, "Page count in top-level pages object is incorrect");
+ }
+ pagesDict.free();
+
+ // read named destination dictionary
+ catDict.dictLookup("Dests", &dests);
+
+ // read root of named destination tree
+ if (catDict.dictLookup("Names", &obj)->isDict()) {
+ obj.dictLookup("Dests", &obj2);
+ destNameTree.init(xref, &obj2);
+ obj2.free();
+ }
+ obj.free();
+
+ // read base URI
+ if (catDict.dictLookup("URI", &obj)->isDict()) {
+ if (obj.dictLookup("Base", &obj2)->isString()) {
+ baseURI = obj2.getString()->copy();
+ }
+ obj2.free();
+ }
+ obj.free();
+
+ // read page mode
+ if (catDict.dictLookup("PageMode", &obj)->isName()) {
+ if (strcmp(obj.getName(), "UseNone") == 0)
+ pageMode = UseNone;
+ else if (strcmp(obj.getName(), "UseOutlines") == 0)
+ pageMode = UseOutlines;
+ else if (strcmp(obj.getName(), "UseThumbs") == 0)
+ pageMode = UseThumbs;
+ else if (strcmp(obj.getName(), "FullScreen") == 0)
+ pageMode = FullScreen;
+ else if (strcmp(obj.getName(), "UseOC") == 0)
+ pageMode = UseOC;
+ else
+ pageMode = UseNone;
+ } else {
+ pageMode = UseNone;
+ }
+ obj.free();
+
+ // get the metadata stream
+ catDict.dictLookup("Metadata", &metadata);
+
+ // get the structure tree root
+ catDict.dictLookup("StructTreeRoot", &structTreeRoot);
+
+ // get the outline dictionary
+ catDict.dictLookup("Outlines", &outline);
+
+ // get the AcroForm dictionary
+ catDict.dictLookup("AcroForm", &acroForm);
+
+ catDict.free();
+ return;
+
+ err3:
+ obj.free();
+ err2:
+ pagesDict.free();
+ err1:
+ catDict.free();
+ dests.initNull();
+ ok = gFalse;
+}
+
+Catalog::~Catalog() {
+ int i;
+
+ if (pages) {
+ for (i = 0; i < pagesSize; ++i) {
+ if (pages[i]) {
+ delete pages[i];
+ }
+ }
+ gfree(pages);
+ gfree(pageRefs);
+ }
+ dests.free();
+ destNameTree.free();
+ if (baseURI) {
+ delete baseURI;
+ }
+ metadata.free();
+ structTreeRoot.free();
+ outline.free();
+ acroForm.free();
+}
+
+GString *Catalog::readMetadata() {
+ GString *s;
+ Dict *dict;
+ Object obj;
+ int c;
+
+ if (!metadata.isStream()) {
+ return NULL;
+ }
+ dict = metadata.streamGetDict();
+ if (!dict->lookup("Subtype", &obj)->isName("XML")) {
+ error(-1, "Unknown Metadata type: '%s'",
+ obj.isName() ? obj.getName() : "???");
+ }
+ obj.free();
+ s = new GString();
+ metadata.streamReset();
+ while ((c = metadata.streamGetChar()) != EOF) {
+ s->append(c);
+ }
+ metadata.streamClose();
+ return s;
+}
+
+int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start,
+ char *alreadyRead) {
+ Object kids;
+ Object kid;
+ Object kidRef;
+ PageAttrs *attrs1, *attrs2;
+ Page *page;
+ int i, j;
+
+ attrs1 = new PageAttrs(attrs, pagesDict);
+ pagesDict->lookup("Kids", &kids);
+ if (!kids.isArray()) {
+ error(-1, "Kids object (page %d) is wrong type (%s)",
+ start+1, kids.getTypeName());
+ goto err1;
+ }
+ for (i = 0; i < kids.arrayGetLength(); ++i) {
+ kids.arrayGetNF(i, &kidRef);
+ if (kidRef.isRef() &&
+ kidRef.getRefNum() >= 0 &&
+ kidRef.getRefNum() < xref->getNumObjects()) {
+ if (alreadyRead[kidRef.getRefNum()]) {
+ error(-1, "Loop in Pages tree");
+ kidRef.free();
+ continue;
+ }
+ alreadyRead[kidRef.getRefNum()] = 1;
+ }
+ kids.arrayGet(i, &kid);
+ if (kid.isDict("Page")) {
+ attrs2 = new PageAttrs(attrs1, kid.getDict());
+ page = new Page(xref, start+1, kid.getDict(), attrs2);
+ if (!page->isOk()) {
+ ++start;
+ goto err3;
+ }
+ if (start >= pagesSize) {
+ pagesSize += 32;
+ pages = (Page **)greallocn(pages, pagesSize, sizeof(Page *));
+ pageRefs = (Ref *)greallocn(pageRefs, pagesSize, sizeof(Ref));
+ for (j = pagesSize - 32; j < pagesSize; ++j) {
+ pages[j] = NULL;
+ pageRefs[j].num = -1;
+ pageRefs[j].gen = -1;
+ }
+ }
+ pages[start] = page;
+ if (kidRef.isRef()) {
+ pageRefs[start].num = kidRef.getRefNum();
+ pageRefs[start].gen = kidRef.getRefGen();
+ }
+ ++start;
+ // This should really be isDict("Pages"), but I've seen at least one
+ // PDF file where the /Type entry is missing.
+ } else if (kid.isDict()) {
+ if ((start = readPageTree(kid.getDict(), attrs1, start, alreadyRead))
+ < 0)
+ goto err2;
+ } else {
+ error(-1, "Kid object (page %d) is wrong type (%s)",
+ start+1, kid.getTypeName());
+ }
+ kid.free();
+ kidRef.free();
+ }
+ delete attrs1;
+ kids.free();
+ return start;
+
+ err3:
+ delete page;
+ err2:
+ kid.free();
+ err1:
+ kids.free();
+ delete attrs1;
+ ok = gFalse;
+ return -1;
+}
+
+int Catalog::findPage(int num, int gen) {
+ int i;
+
+ for (i = 0; i < numPages; ++i) {
+ if (pageRefs[i].num == num && pageRefs[i].gen == gen)
+ return i + 1;
+ }
+ return 0;
+}
+
+LinkDest *Catalog::findDest(GString *name) {
+ LinkDest *dest;
+ Object obj1, obj2;
+ GBool found;
+
+ // try named destination dictionary then name tree
+ found = gFalse;
+ if (dests.isDict()) {
+ if (!dests.dictLookup(name->getCString(), &obj1)->isNull())
+ found = gTrue;
+ else
+ obj1.free();
+ }
+ if (!found) {
+ if (destNameTree.lookup(name, &obj1))
+ found = gTrue;
+ else
+ obj1.free();
+ }
+ if (!found)
+ return NULL;
+
+ // construct LinkDest
+ dest = NULL;
+ if (obj1.isArray()) {
+ dest = new LinkDest(obj1.getArray());
+ } else if (obj1.isDict()) {
+ if (obj1.dictLookup("D", &obj2)->isArray())
+ dest = new LinkDest(obj2.getArray());
+ else
+ error(-1, "Bad named destination value");
+ obj2.free();
+ } else {
+ error(-1, "Bad named destination value");
+ }
+ obj1.free();
+ if (dest && !dest->isOk()) {
+ delete dest;
+ dest = NULL;
+ }
+
+ return dest;
+}
+
+NameTree::NameTree()
+{
+ size = 0;
+ length = 0;
+ entries = NULL;
+}
+
+NameTree::Entry::Entry(Array *array, int index) {
+ if (!array->getString(index, &name) || !array->getNF(index + 1, &value))
+ error(-1, "Invalid page tree");
+}
+
+NameTree::Entry::~Entry() {
+ value.free();
+}
+
+void NameTree::addEntry(Entry *entry)
+{
+ if (length == size) {
+ if (length == 0) {
+ size = 8;
+ } else {
+ size *= 2;
+ }
+ entries = (Entry **) grealloc (entries, sizeof (Entry *) * size);
+ }
+
+ entries[length] = entry;
+ ++length;
+}
+
+void NameTree::init(XRef *xrefA, Object *tree) {
+ xref = xrefA;
+ parse(tree);
+}
+
+void NameTree::parse(Object *tree) {
+ Object names;
+ Object kids, kid;
+ int i;
+
+ if (!tree->isDict())
+ return;
+
+ // leaf node
+ if (tree->dictLookup("Names", &names)->isArray()) {
+ for (i = 0; i < names.arrayGetLength(); i += 2) {
+ NameTree::Entry *entry;
+
+ entry = new Entry(names.getArray(), i);
+ addEntry(entry);
+ }
+ }
+ names.free();
+
+ // root or intermediate node
+ if (tree->dictLookup("Kids", &kids)->isArray()) {
+ for (i = 0; i < kids.arrayGetLength(); ++i) {
+ if (kids.arrayGet(i, &kid)->isDict())
+ parse(&kid);
+ kid.free();
+ }
+ }
+ kids.free();
+}
+
+int NameTree::Entry::cmp(const void *voidKey, const void *voidEntry)
+{
+ GString *key = (GString *) voidKey;
+ Entry *entry = *(NameTree::Entry **) voidEntry;
+
+ return key->cmp(&entry->name);
+}
+
+GBool NameTree::lookup(GString *name, Object *obj)
+{
+ Entry *entry;
+
+ Entry **e = (Entry **) bsearch(name, entries,
+ length, sizeof(Entry *), Entry::cmp);
+ if (e) entry = *e;
+ else
+ {
+ error(-1, "failed to look up %s\n", name->getCString());
+ obj->initNull();
+ return gFalse;
+ }
+ if (entry != NULL) {
+ entry->value.fetch(xref, obj);
+ return gTrue;
+ } else {
+ error(-1, "failed to look up %s\n", name->getCString());
+
+ obj->initNull();
+
+ return gFalse;
+ }
+}
+
+void NameTree::free()
+{
+ int i;
+
+ for (i = 0; i < length; i++)
+ delete entries[i];
+
+ gfree(entries);
+}
diff --git a/kpdf/xpdf/xpdf/CharCodeToUnicode.cc b/kpdf/xpdf/xpdf/CharCodeToUnicode.cc
deleted file mode 100644
index 3702a16d..00000000
--- a/kpdf/xpdf/xpdf/CharCodeToUnicode.cc
+++ /dev/null
@@ -1,540 +0,0 @@
-//========================================================================
-//
-// CharCodeToUnicode.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include "gmem.h"
-#include "gfile.h"
-#include "GString.h"
-#include "Error.h"
-#include "GlobalParams.h"
-#include "PSTokenizer.h"
-#include "CharCodeToUnicode.h"
-
-//------------------------------------------------------------------------
-
-#define maxUnicodeString 8
-
-struct CharCodeToUnicodeString {
- CharCode c;
- Unicode u[maxUnicodeString];
- int len;
-};
-
-//------------------------------------------------------------------------
-
-static int getCharFromString(void *data) {
- char *p;
- int c;
-
- p = *(char **)data;
- if (*p) {
- c = *p++;
- *(char **)data = p;
- } else {
- c = EOF;
- }
- return c;
-}
-
-static int getCharFromFile(void *data) {
- return fgetc((FILE *)data);
-}
-
-//------------------------------------------------------------------------
-
-CharCodeToUnicode *CharCodeToUnicode::parseCIDToUnicode(GString *fileName,
- GString *collection) {
- FILE *f;
- Unicode *mapA;
- CharCode size, mapLenA;
- char buf[64];
- Unicode u;
- CharCodeToUnicode *ctu;
-
- if (!(f = fopen(fileName->getCString(), "r"))) {
- error(-1, "Couldn't open cidToUnicode file '%s'",
- fileName->getCString());
- return NULL;
- }
-
- size = 32768;
- mapA = (Unicode *)gmallocn(size, sizeof(Unicode));
- mapLenA = 0;
-
- while (getLine(buf, sizeof(buf), f)) {
- if (mapLenA == size) {
- size *= 2;
- mapA = (Unicode *)greallocn(mapA, size, sizeof(Unicode));
- }
- if (sscanf(buf, "%x", &u) == 1) {
- mapA[mapLenA] = u;
- } else {
- error(-1, "Bad line (%d) in cidToUnicode file '%s'",
- (int)(mapLenA + 1), fileName->getCString());
- mapA[mapLenA] = 0;
- }
- ++mapLenA;
- }
- fclose(f);
-
- ctu = new CharCodeToUnicode(collection->copy(), mapA, mapLenA, gTrue,
- NULL, 0, 0);
- gfree(mapA);
- return ctu;
-}
-
-CharCodeToUnicode *CharCodeToUnicode::parseUnicodeToUnicode(
- GString *fileName) {
- FILE *f;
- Unicode *mapA;
- CharCodeToUnicodeString *sMapA;
- CharCode size, oldSize, len, sMapSizeA, sMapLenA;
- char buf[256];
- char *tok;
- Unicode u0;
- Unicode uBuf[maxUnicodeString];
- CharCodeToUnicode *ctu;
- int line, n, i;
-
- if (!(f = fopen(fileName->getCString(), "r"))) {
- error(-1, "Couldn't open unicodeToUnicode file '%s'",
- fileName->getCString());
- return NULL;
- }
-
- size = 4096;
- mapA = (Unicode *)gmallocn(size, sizeof(Unicode));
- memset(mapA, 0, size * sizeof(Unicode));
- len = 0;
- sMapA = NULL;
- sMapSizeA = sMapLenA = 0;
-
- line = 0;
- while (getLine(buf, sizeof(buf), f)) {
- ++line;
- if (!(tok = strtok(buf, " \t\r\n")) ||
- sscanf(tok, "%x", &u0) != 1) {
- error(-1, "Bad line (%d) in unicodeToUnicode file '%s'",
- line, fileName->getCString());
- continue;
- }
- n = 0;
- while (n < maxUnicodeString) {
- if (!(tok = strtok(NULL, " \t\r\n"))) {
- break;
- }
- if (sscanf(tok, "%x", &uBuf[n]) != 1) {
- error(-1, "Bad line (%d) in unicodeToUnicode file '%s'",
- line, fileName->getCString());
- break;
- }
- ++n;
- }
- if (n < 1) {
- error(-1, "Bad line (%d) in unicodeToUnicode file '%s'",
- line, fileName->getCString());
- continue;
- }
- if (u0 >= size) {
- oldSize = size;
- while (u0 >= size) {
- size *= 2;
- }
- mapA = (Unicode *)greallocn(mapA, size, sizeof(Unicode));
- memset(mapA + oldSize, 0, (size - oldSize) * sizeof(Unicode));
- }
- if (n == 1) {
- mapA[u0] = uBuf[0];
- } else {
- mapA[u0] = 0;
- if (sMapLenA == sMapSizeA) {
- sMapSizeA += 16;
- sMapA = (CharCodeToUnicodeString *)
- greallocn(sMapA, sMapSizeA, sizeof(CharCodeToUnicodeString));
- }
- sMapA[sMapLenA].c = u0;
- for (i = 0; i < n; ++i) {
- sMapA[sMapLenA].u[i] = uBuf[i];
- }
- sMapA[sMapLenA].len = n;
- ++sMapLenA;
- }
- if (u0 >= len) {
- len = u0 + 1;
- }
- }
- fclose(f);
-
- ctu = new CharCodeToUnicode(fileName->copy(), mapA, len, gTrue,
- sMapA, sMapLenA, sMapSizeA);
- gfree(mapA);
- return ctu;
-}
-
-CharCodeToUnicode *CharCodeToUnicode::make8BitToUnicode(Unicode *toUnicode) {
- return new CharCodeToUnicode(NULL, toUnicode, 256, gTrue, NULL, 0, 0);
-}
-
-CharCodeToUnicode *CharCodeToUnicode::parseCMap(GString *buf, int nBits) {
- CharCodeToUnicode *ctu;
- char *p;
-
- ctu = new CharCodeToUnicode(NULL);
- p = buf->getCString();
- ctu->parseCMap1(&getCharFromString, &p, nBits);
- return ctu;
-}
-
-void CharCodeToUnicode::mergeCMap(GString *buf, int nBits) {
- char *p;
-
- p = buf->getCString();
- parseCMap1(&getCharFromString, &p, nBits);
-}
-
-void CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data,
- int nBits) {
- PSTokenizer *pst;
- char tok1[256], tok2[256], tok3[256];
- int nDigits, n1, n2, n3;
- CharCode i;
- CharCode code1, code2;
- GString *name;
- FILE *f;
-
- nDigits = nBits / 4;
- pst = new PSTokenizer(getCharFunc, data);
- pst->getToken(tok1, sizeof(tok1), &n1);
- while (pst->getToken(tok2, sizeof(tok2), &n2)) {
- if (!strcmp(tok2, "usecmap")) {
- if (tok1[0] == '/') {
- name = new GString(tok1 + 1);
- if ((f = globalParams->findToUnicodeFile(name))) {
- parseCMap1(&getCharFromFile, f, nBits);
- fclose(f);
- } else {
- error(-1, "Couldn't find ToUnicode CMap file for '%s'",
- name->getCString());
- }
- delete name;
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else if (!strcmp(tok2, "beginbfchar")) {
- while (pst->getToken(tok1, sizeof(tok1), &n1)) {
- if (!strcmp(tok1, "endbfchar")) {
- break;
- }
- if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
- !strcmp(tok2, "endbfchar")) {
- error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
- break;
- }
- if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
- tok2[0] == '<' && tok2[n2 - 1] == '>')) {
- error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
- continue;
- }
- tok1[n1 - 1] = tok2[n2 - 1] = '\0';
- if (sscanf(tok1 + 1, "%x", &code1) != 1) {
- error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
- continue;
- }
- addMapping(code1, tok2 + 1, n2 - 2, 0);
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else if (!strcmp(tok2, "beginbfrange")) {
- while (pst->getToken(tok1, sizeof(tok1), &n1)) {
- if (!strcmp(tok1, "endbfrange")) {
- break;
- }
- if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
- !strcmp(tok2, "endbfrange") ||
- !pst->getToken(tok3, sizeof(tok3), &n3) ||
- !strcmp(tok3, "endbfrange")) {
- error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
- break;
- }
- if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
- n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
- error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
- continue;
- }
- tok1[n1 - 1] = tok2[n2 - 1] = '\0';
- if (sscanf(tok1 + 1, "%x", &code1) != 1 ||
- sscanf(tok2 + 1, "%x", &code2) != 1) {
- error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
- continue;
- }
- if (!strcmp(tok3, "[")) {
- i = 0;
- while (pst->getToken(tok1, sizeof(tok1), &n1) &&
- code1 + i <= code2) {
- if (!strcmp(tok1, "]")) {
- break;
- }
- if (tok1[0] == '<' && tok1[n1 - 1] == '>') {
- tok1[n1 - 1] = '\0';
- addMapping(code1 + i, tok1 + 1, n1 - 2, 0);
- } else {
- error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
- }
- ++i;
- }
- } else if (tok3[0] == '<' && tok3[n3 - 1] == '>') {
- tok3[n3 - 1] = '\0';
- for (i = 0; code1 <= code2; ++code1, ++i) {
- addMapping(code1, tok3 + 1, n3 - 2, i);
- }
-
- } else {
- error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
- }
- }
- pst->getToken(tok1, sizeof(tok1), &n1);
- } else {
- strcpy(tok1, tok2);
- }
- }
- delete pst;
-}
-
-void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n,
- int offset) {
- CharCode oldLen, i;
- Unicode u;
- char uHex[5];
- int j;
-
- if (code >= mapLen) {
- oldLen = mapLen;
- mapLen = (code + 256) & ~255;
- map = (Unicode *)greallocn(map, mapLen, sizeof(Unicode));
- for (i = oldLen; i < mapLen; ++i) {
- map[i] = 0;
- }
- }
- if (n <= 4) {
- if (sscanf(uStr, "%x", &u) != 1) {
- error(-1, "Illegal entry in ToUnicode CMap");
- return;
- }
- map[code] = u + offset;
- } else {
- if (sMapLen >= sMapSize) {
- sMapSize = sMapSize + 16;
- sMap = (CharCodeToUnicodeString *)
- greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString));
- }
- map[code] = 0;
- sMap[sMapLen].c = code;
- sMap[sMapLen].len = n / 4;
- for (j = 0; j < sMap[sMapLen].len && j < maxUnicodeString; ++j) {
- strncpy(uHex, uStr + j*4, 4);
- uHex[4] = '\0';
- if (sscanf(uHex, "%x", &sMap[sMapLen].u[j]) != 1) {
- error(-1, "Illegal entry in ToUnicode CMap");
- }
- }
- sMap[sMapLen].u[sMap[sMapLen].len - 1] += offset;
- ++sMapLen;
- }
-}
-
-CharCodeToUnicode::CharCodeToUnicode(GString *tagA) {
- CharCode i;
-
- tag = tagA;
- mapLen = 256;
- map = (Unicode *)gmallocn(mapLen, sizeof(Unicode));
- for (i = 0; i < mapLen; ++i) {
- map[i] = 0;
- }
- sMap = NULL;
- sMapLen = sMapSize = 0;
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-CharCodeToUnicode::CharCodeToUnicode(GString *tagA, Unicode *mapA,
- CharCode mapLenA, GBool copyMap,
- CharCodeToUnicodeString *sMapA,
- int sMapLenA, int sMapSizeA) {
- tag = tagA;
- mapLen = mapLenA;
- if (copyMap) {
- map = (Unicode *)gmallocn(mapLen, sizeof(Unicode));
- memcpy(map, mapA, mapLen * sizeof(Unicode));
- } else {
- map = mapA;
- }
- sMap = sMapA;
- sMapLen = sMapLenA;
- sMapSize = sMapSizeA;
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-CharCodeToUnicode::~CharCodeToUnicode() {
- if (tag) {
- delete tag;
- }
- gfree(map);
- if (sMap) {
- gfree(sMap);
- }
-#if MULTITHREADED
- gDestroyMutex(&mutex);
-#endif
-}
-
-void CharCodeToUnicode::incRefCnt() {
-#if MULTITHREADED
- gLockMutex(&mutex);
-#endif
- ++refCnt;
-#if MULTITHREADED
- gUnlockMutex(&mutex);
-#endif
-}
-
-void CharCodeToUnicode::decRefCnt() {
- GBool done;
-
-#if MULTITHREADED
- gLockMutex(&mutex);
-#endif
- done = --refCnt == 0;
-#if MULTITHREADED
- gUnlockMutex(&mutex);
-#endif
- if (done) {
- delete this;
- }
-}
-
-GBool CharCodeToUnicode::match(GString *tagA) {
- return tag && !tag->cmp(tagA);
-}
-
-void CharCodeToUnicode::setMapping(CharCode c, Unicode *u, int len) {
- int i, j;
-
- if (len == 1) {
- map[c] = u[0];
- } else {
- for (i = 0; i < sMapLen; ++i) {
- if (sMap[i].c == c) {
- break;
- }
- }
- if (i == sMapLen) {
- if (sMapLen == sMapSize) {
- sMapSize += 8;
- sMap = (CharCodeToUnicodeString *)
- greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString));
- }
- ++sMapLen;
- }
- map[c] = 0;
- sMap[i].c = c;
- sMap[i].len = len;
- for (j = 0; j < len && j < maxUnicodeString; ++j) {
- sMap[i].u[j] = u[j];
- }
- }
-}
-
-int CharCodeToUnicode::mapToUnicode(CharCode c, Unicode *u, int size) {
- int i, j;
-
- if (c >= mapLen) {
- return 0;
- }
- if (map[c]) {
- u[0] = map[c];
- return 1;
- }
- for (i = 0; i < sMapLen; ++i) {
- if (sMap[i].c == c) {
- for (j = 0; j < sMap[i].len && j < size; ++j) {
- u[j] = sMap[i].u[j];
- }
- return j;
- }
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-CharCodeToUnicodeCache::CharCodeToUnicodeCache(int sizeA) {
- int i;
-
- size = sizeA;
- cache = (CharCodeToUnicode **)gmallocn(size, sizeof(CharCodeToUnicode *));
- for (i = 0; i < size; ++i) {
- cache[i] = NULL;
- }
-}
-
-CharCodeToUnicodeCache::~CharCodeToUnicodeCache() {
- int i;
-
- for (i = 0; i < size; ++i) {
- if (cache[i]) {
- cache[i]->decRefCnt();
- }
- }
- gfree(cache);
-}
-
-CharCodeToUnicode *CharCodeToUnicodeCache::getCharCodeToUnicode(GString *tag) {
- CharCodeToUnicode *ctu;
- int i, j;
-
- if (cache[0] && cache[0]->match(tag)) {
- cache[0]->incRefCnt();
- return cache[0];
- }
- for (i = 1; i < size; ++i) {
- if (cache[i] && cache[i]->match(tag)) {
- ctu = cache[i];
- for (j = i; j >= 1; --j) {
- cache[j] = cache[j - 1];
- }
- cache[0] = ctu;
- ctu->incRefCnt();
- return ctu;
- }
- }
- return NULL;
-}
-
-void CharCodeToUnicodeCache::add(CharCodeToUnicode *ctu) {
- int i;
-
- if (cache[size - 1]) {
- cache[size - 1]->decRefCnt();
- }
- for (i = size - 1; i >= 1; --i) {
- cache[i] = cache[i - 1];
- }
- cache[0] = ctu;
- ctu->incRefCnt();
-}
diff --git a/kpdf/xpdf/xpdf/CharCodeToUnicode.cpp b/kpdf/xpdf/xpdf/CharCodeToUnicode.cpp
new file mode 100644
index 00000000..1144caec
--- /dev/null
+++ b/kpdf/xpdf/xpdf/CharCodeToUnicode.cpp
@@ -0,0 +1,540 @@
+//========================================================================
+//
+// CharCodeToUnicode.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "gmem.h"
+#include "gfile.h"
+#include "GString.h"
+#include "Error.h"
+#include "GlobalParams.h"
+#include "PSTokenizer.h"
+#include "CharCodeToUnicode.h"
+
+//------------------------------------------------------------------------
+
+#define maxUnicodeString 8
+
+struct CharCodeToUnicodeString {
+ CharCode c;
+ Unicode u[maxUnicodeString];
+ int len;
+};
+
+//------------------------------------------------------------------------
+
+static int getCharFromString(void *data) {
+ char *p;
+ int c;
+
+ p = *(char **)data;
+ if (*p) {
+ c = *p++;
+ *(char **)data = p;
+ } else {
+ c = EOF;
+ }
+ return c;
+}
+
+static int getCharFromFile(void *data) {
+ return fgetc((FILE *)data);
+}
+
+//------------------------------------------------------------------------
+
+CharCodeToUnicode *CharCodeToUnicode::parseCIDToUnicode(GString *fileName,
+ GString *collection) {
+ FILE *f;
+ Unicode *mapA;
+ CharCode size, mapLenA;
+ char buf[64];
+ Unicode u;
+ CharCodeToUnicode *ctu;
+
+ if (!(f = fopen(fileName->getCString(), "r"))) {
+ error(-1, "Couldn't open cidToUnicode file '%s'",
+ fileName->getCString());
+ return NULL;
+ }
+
+ size = 32768;
+ mapA = (Unicode *)gmallocn(size, sizeof(Unicode));
+ mapLenA = 0;
+
+ while (getLine(buf, sizeof(buf), f)) {
+ if (mapLenA == size) {
+ size *= 2;
+ mapA = (Unicode *)greallocn(mapA, size, sizeof(Unicode));
+ }
+ if (sscanf(buf, "%x", &u) == 1) {
+ mapA[mapLenA] = u;
+ } else {
+ error(-1, "Bad line (%d) in cidToUnicode file '%s'",
+ (int)(mapLenA + 1), fileName->getCString());
+ mapA[mapLenA] = 0;
+ }
+ ++mapLenA;
+ }
+ fclose(f);
+
+ ctu = new CharCodeToUnicode(collection->copy(), mapA, mapLenA, gTrue,
+ NULL, 0, 0);
+ gfree(mapA);
+ return ctu;
+}
+
+CharCodeToUnicode *CharCodeToUnicode::parseUnicodeToUnicode(
+ GString *fileName) {
+ FILE *f;
+ Unicode *mapA;
+ CharCodeToUnicodeString *sMapA;
+ CharCode size, oldSize, len, sMapSizeA, sMapLenA;
+ char buf[256];
+ char *tok;
+ Unicode u0;
+ Unicode uBuf[maxUnicodeString];
+ CharCodeToUnicode *ctu;
+ int line, n, i;
+
+ if (!(f = fopen(fileName->getCString(), "r"))) {
+ error(-1, "Couldn't open unicodeToUnicode file '%s'",
+ fileName->getCString());
+ return NULL;
+ }
+
+ size = 4096;
+ mapA = (Unicode *)gmallocn(size, sizeof(Unicode));
+ memset(mapA, 0, size * sizeof(Unicode));
+ len = 0;
+ sMapA = NULL;
+ sMapSizeA = sMapLenA = 0;
+
+ line = 0;
+ while (getLine(buf, sizeof(buf), f)) {
+ ++line;
+ if (!(tok = strtok(buf, " \t\r\n")) ||
+ sscanf(tok, "%x", &u0) != 1) {
+ error(-1, "Bad line (%d) in unicodeToUnicode file '%s'",
+ line, fileName->getCString());
+ continue;
+ }
+ n = 0;
+ while (n < maxUnicodeString) {
+ if (!(tok = strtok(NULL, " \t\r\n"))) {
+ break;
+ }
+ if (sscanf(tok, "%x", &uBuf[n]) != 1) {
+ error(-1, "Bad line (%d) in unicodeToUnicode file '%s'",
+ line, fileName->getCString());
+ break;
+ }
+ ++n;
+ }
+ if (n < 1) {
+ error(-1, "Bad line (%d) in unicodeToUnicode file '%s'",
+ line, fileName->getCString());
+ continue;
+ }
+ if (u0 >= size) {
+ oldSize = size;
+ while (u0 >= size) {
+ size *= 2;
+ }
+ mapA = (Unicode *)greallocn(mapA, size, sizeof(Unicode));
+ memset(mapA + oldSize, 0, (size - oldSize) * sizeof(Unicode));
+ }
+ if (n == 1) {
+ mapA[u0] = uBuf[0];
+ } else {
+ mapA[u0] = 0;
+ if (sMapLenA == sMapSizeA) {
+ sMapSizeA += 16;
+ sMapA = (CharCodeToUnicodeString *)
+ greallocn(sMapA, sMapSizeA, sizeof(CharCodeToUnicodeString));
+ }
+ sMapA[sMapLenA].c = u0;
+ for (i = 0; i < n; ++i) {
+ sMapA[sMapLenA].u[i] = uBuf[i];
+ }
+ sMapA[sMapLenA].len = n;
+ ++sMapLenA;
+ }
+ if (u0 >= len) {
+ len = u0 + 1;
+ }
+ }
+ fclose(f);
+
+ ctu = new CharCodeToUnicode(fileName->copy(), mapA, len, gTrue,
+ sMapA, sMapLenA, sMapSizeA);
+ gfree(mapA);
+ return ctu;
+}
+
+CharCodeToUnicode *CharCodeToUnicode::make8BitToUnicode(Unicode *toUnicode) {
+ return new CharCodeToUnicode(NULL, toUnicode, 256, gTrue, NULL, 0, 0);
+}
+
+CharCodeToUnicode *CharCodeToUnicode::parseCMap(GString *buf, int nBits) {
+ CharCodeToUnicode *ctu;
+ char *p;
+
+ ctu = new CharCodeToUnicode(NULL);
+ p = buf->getCString();
+ ctu->parseCMap1(&getCharFromString, &p, nBits);
+ return ctu;
+}
+
+void CharCodeToUnicode::mergeCMap(GString *buf, int nBits) {
+ char *p;
+
+ p = buf->getCString();
+ parseCMap1(&getCharFromString, &p, nBits);
+}
+
+void CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data,
+ int nBits) {
+ PSTokenizer *pst;
+ char tok1[256], tok2[256], tok3[256];
+ int nDigits, n1, n2, n3;
+ CharCode i;
+ CharCode code1, code2;
+ GString *name;
+ FILE *f;
+
+ nDigits = nBits / 4;
+ pst = new PSTokenizer(getCharFunc, data);
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ while (pst->getToken(tok2, sizeof(tok2), &n2)) {
+ if (!strcmp(tok2, "usecmap")) {
+ if (tok1[0] == '/') {
+ name = new GString(tok1 + 1);
+ if ((f = globalParams->findToUnicodeFile(name))) {
+ parseCMap1(&getCharFromFile, f, nBits);
+ fclose(f);
+ } else {
+ error(-1, "Couldn't find ToUnicode CMap file for '%s'",
+ name->getCString());
+ }
+ delete name;
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else if (!strcmp(tok2, "beginbfchar")) {
+ while (pst->getToken(tok1, sizeof(tok1), &n1)) {
+ if (!strcmp(tok1, "endbfchar")) {
+ break;
+ }
+ if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
+ !strcmp(tok2, "endbfchar")) {
+ error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
+ break;
+ }
+ if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
+ tok2[0] == '<' && tok2[n2 - 1] == '>')) {
+ error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
+ continue;
+ }
+ tok1[n1 - 1] = tok2[n2 - 1] = '\0';
+ if (sscanf(tok1 + 1, "%x", &code1) != 1) {
+ error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
+ continue;
+ }
+ addMapping(code1, tok2 + 1, n2 - 2, 0);
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else if (!strcmp(tok2, "beginbfrange")) {
+ while (pst->getToken(tok1, sizeof(tok1), &n1)) {
+ if (!strcmp(tok1, "endbfrange")) {
+ break;
+ }
+ if (!pst->getToken(tok2, sizeof(tok2), &n2) ||
+ !strcmp(tok2, "endbfrange") ||
+ !pst->getToken(tok3, sizeof(tok3), &n3) ||
+ !strcmp(tok3, "endbfrange")) {
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ break;
+ }
+ if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
+ n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ continue;
+ }
+ tok1[n1 - 1] = tok2[n2 - 1] = '\0';
+ if (sscanf(tok1 + 1, "%x", &code1) != 1 ||
+ sscanf(tok2 + 1, "%x", &code2) != 1) {
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ continue;
+ }
+ if (!strcmp(tok3, "[")) {
+ i = 0;
+ while (pst->getToken(tok1, sizeof(tok1), &n1) &&
+ code1 + i <= code2) {
+ if (!strcmp(tok1, "]")) {
+ break;
+ }
+ if (tok1[0] == '<' && tok1[n1 - 1] == '>') {
+ tok1[n1 - 1] = '\0';
+ addMapping(code1 + i, tok1 + 1, n1 - 2, 0);
+ } else {
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ }
+ ++i;
+ }
+ } else if (tok3[0] == '<' && tok3[n3 - 1] == '>') {
+ tok3[n3 - 1] = '\0';
+ for (i = 0; code1 <= code2; ++code1, ++i) {
+ addMapping(code1, tok3 + 1, n3 - 2, i);
+ }
+
+ } else {
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ }
+ }
+ pst->getToken(tok1, sizeof(tok1), &n1);
+ } else {
+ strcpy(tok1, tok2);
+ }
+ }
+ delete pst;
+}
+
+void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n,
+ int offset) {
+ CharCode oldLen, i;
+ Unicode u;
+ char uHex[5];
+ int j;
+
+ if (code >= mapLen) {
+ oldLen = mapLen;
+ mapLen = (code + 256) & ~255;
+ map = (Unicode *)greallocn(map, mapLen, sizeof(Unicode));
+ for (i = oldLen; i < mapLen; ++i) {
+ map[i] = 0;
+ }
+ }
+ if (n <= 4) {
+ if (sscanf(uStr, "%x", &u) != 1) {
+ error(-1, "Illegal entry in ToUnicode CMap");
+ return;
+ }
+ map[code] = u + offset;
+ } else {
+ if (sMapLen >= sMapSize) {
+ sMapSize = sMapSize + 16;
+ sMap = (CharCodeToUnicodeString *)
+ greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString));
+ }
+ map[code] = 0;
+ sMap[sMapLen].c = code;
+ sMap[sMapLen].len = n / 4;
+ for (j = 0; j < sMap[sMapLen].len && j < maxUnicodeString; ++j) {
+ strncpy(uHex, uStr + j*4, 4);
+ uHex[4] = '\0';
+ if (sscanf(uHex, "%x", &sMap[sMapLen].u[j]) != 1) {
+ error(-1, "Illegal entry in ToUnicode CMap");
+ }
+ }
+ sMap[sMapLen].u[sMap[sMapLen].len - 1] += offset;
+ ++sMapLen;
+ }
+}
+
+CharCodeToUnicode::CharCodeToUnicode(GString *tagA) {
+ CharCode i;
+
+ tag = tagA;
+ mapLen = 256;
+ map = (Unicode *)gmallocn(mapLen, sizeof(Unicode));
+ for (i = 0; i < mapLen; ++i) {
+ map[i] = 0;
+ }
+ sMap = NULL;
+ sMapLen = sMapSize = 0;
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+CharCodeToUnicode::CharCodeToUnicode(GString *tagA, Unicode *mapA,
+ CharCode mapLenA, GBool copyMap,
+ CharCodeToUnicodeString *sMapA,
+ int sMapLenA, int sMapSizeA) {
+ tag = tagA;
+ mapLen = mapLenA;
+ if (copyMap) {
+ map = (Unicode *)gmallocn(mapLen, sizeof(Unicode));
+ memcpy(map, mapA, mapLen * sizeof(Unicode));
+ } else {
+ map = mapA;
+ }
+ sMap = sMapA;
+ sMapLen = sMapLenA;
+ sMapSize = sMapSizeA;
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+CharCodeToUnicode::~CharCodeToUnicode() {
+ if (tag) {
+ delete tag;
+ }
+ gfree(map);
+ if (sMap) {
+ gfree(sMap);
+ }
+#if MULTITHREADED
+ gDestroyMutex(&mutex);
+#endif
+}
+
+void CharCodeToUnicode::incRefCnt() {
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ ++refCnt;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+}
+
+void CharCodeToUnicode::decRefCnt() {
+ GBool done;
+
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ done = --refCnt == 0;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+ if (done) {
+ delete this;
+ }
+}
+
+GBool CharCodeToUnicode::match(GString *tagA) {
+ return tag && !tag->cmp(tagA);
+}
+
+void CharCodeToUnicode::setMapping(CharCode c, Unicode *u, int len) {
+ int i, j;
+
+ if (len == 1) {
+ map[c] = u[0];
+ } else {
+ for (i = 0; i < sMapLen; ++i) {
+ if (sMap[i].c == c) {
+ break;
+ }
+ }
+ if (i == sMapLen) {
+ if (sMapLen == sMapSize) {
+ sMapSize += 8;
+ sMap = (CharCodeToUnicodeString *)
+ greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString));
+ }
+ ++sMapLen;
+ }
+ map[c] = 0;
+ sMap[i].c = c;
+ sMap[i].len = len;
+ for (j = 0; j < len && j < maxUnicodeString; ++j) {
+ sMap[i].u[j] = u[j];
+ }
+ }
+}
+
+int CharCodeToUnicode::mapToUnicode(CharCode c, Unicode *u, int size) {
+ int i, j;
+
+ if (c >= mapLen) {
+ return 0;
+ }
+ if (map[c]) {
+ u[0] = map[c];
+ return 1;
+ }
+ for (i = 0; i < sMapLen; ++i) {
+ if (sMap[i].c == c) {
+ for (j = 0; j < sMap[i].len && j < size; ++j) {
+ u[j] = sMap[i].u[j];
+ }
+ return j;
+ }
+ }
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+CharCodeToUnicodeCache::CharCodeToUnicodeCache(int sizeA) {
+ int i;
+
+ size = sizeA;
+ cache = (CharCodeToUnicode **)gmallocn(size, sizeof(CharCodeToUnicode *));
+ for (i = 0; i < size; ++i) {
+ cache[i] = NULL;
+ }
+}
+
+CharCodeToUnicodeCache::~CharCodeToUnicodeCache() {
+ int i;
+
+ for (i = 0; i < size; ++i) {
+ if (cache[i]) {
+ cache[i]->decRefCnt();
+ }
+ }
+ gfree(cache);
+}
+
+CharCodeToUnicode *CharCodeToUnicodeCache::getCharCodeToUnicode(GString *tag) {
+ CharCodeToUnicode *ctu;
+ int i, j;
+
+ if (cache[0] && cache[0]->match(tag)) {
+ cache[0]->incRefCnt();
+ return cache[0];
+ }
+ for (i = 1; i < size; ++i) {
+ if (cache[i] && cache[i]->match(tag)) {
+ ctu = cache[i];
+ for (j = i; j >= 1; --j) {
+ cache[j] = cache[j - 1];
+ }
+ cache[0] = ctu;
+ ctu->incRefCnt();
+ return ctu;
+ }
+ }
+ return NULL;
+}
+
+void CharCodeToUnicodeCache::add(CharCodeToUnicode *ctu) {
+ int i;
+
+ if (cache[size - 1]) {
+ cache[size - 1]->decRefCnt();
+ }
+ for (i = size - 1; i >= 1; --i) {
+ cache[i] = cache[i - 1];
+ }
+ cache[0] = ctu;
+ ctu->incRefCnt();
+}
diff --git a/kpdf/xpdf/xpdf/Decrypt.cc b/kpdf/xpdf/xpdf/Decrypt.cc
deleted file mode 100644
index 51e56fb1..00000000
--- a/kpdf/xpdf/xpdf/Decrypt.cc
+++ /dev/null
@@ -1,776 +0,0 @@
-//========================================================================
-//
-// Decrypt.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include "gmem.h"
-#include "Decrypt.h"
-
-static void rc4InitKey(Guchar *key, int keyLen, Guchar *state);
-static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c);
-static void aesKeyExpansion(DecryptAESState *s,
- Guchar *objKey, int objKeyLen);
-static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last);
-static void md5(Guchar *msg, int msgLen, Guchar *digest);
-
-static Guchar passwordPad[32] = {
- 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
- 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
- 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,
- 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a
-};
-
-//------------------------------------------------------------------------
-// Decrypt
-//------------------------------------------------------------------------
-
-GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
- GString *ownerKey, GString *userKey,
- int permissions, GString *fileID,
- GString *ownerPassword, GString *userPassword,
- Guchar *fileKey, GBool encryptMetadata,
- GBool *ownerPasswordOk) {
- Guchar test[32], test2[32];
- GString *userPassword2;
- Guchar fState[256];
- Guchar tmpKey[16];
- Guchar fx, fy;
- int len, i, j;
-
- // try using the supplied owner password to generate the user password
- *ownerPasswordOk = gFalse;
- if (ownerPassword) {
- len = ownerPassword->getLength();
- if (len < 32) {
- memcpy(test, ownerPassword->getCString(), len);
- memcpy(test + len, passwordPad, 32 - len);
- } else {
- memcpy(test, ownerPassword->getCString(), 32);
- }
- md5(test, 32, test);
- if (encRevision == 3) {
- for (i = 0; i < 50; ++i) {
- md5(test, 16, test);
- }
- }
- if (encRevision == 2) {
- rc4InitKey(test, keyLength, fState);
- fx = fy = 0;
- for (i = 0; i < 32; ++i) {
- test2[i] = rc4DecryptByte(fState, &fx, &fy, ownerKey->getChar(i));
- }
- } else {
- memcpy(test2, ownerKey->getCString(), 32);
- for (i = 19; i >= 0; --i) {
- for (j = 0; j < keyLength; ++j) {
- tmpKey[j] = test[j] ^ i;
- }
- rc4InitKey(tmpKey, keyLength, fState);
- fx = fy = 0;
- for (j = 0; j < 32; ++j) {
- test2[j] = rc4DecryptByte(fState, &fx, &fy, test2[j]);
- }
- }
- }
- userPassword2 = new GString((char *)test2, 32);
- if (makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
- permissions, fileID, userPassword2, fileKey,
- encryptMetadata)) {
- *ownerPasswordOk = gTrue;
- delete userPassword2;
- return gTrue;
- }
- delete userPassword2;
- }
-
- // try using the supplied user password
- return makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
- permissions, fileID, userPassword, fileKey,
- encryptMetadata);
-}
-
-GBool Decrypt::makeFileKey2(int /*encVersion*/, int encRevision, int keyLength,
- GString *ownerKey, GString *userKey,
- int permissions, GString *fileID,
- GString *userPassword, Guchar *fileKey,
- GBool encryptMetadata) {
- Guchar *buf;
- Guchar test[32];
- Guchar fState[256];
- Guchar tmpKey[16];
- Guchar fx, fy;
- int len, i, j;
- GBool ok;
-
- // generate file key
- buf = (Guchar *)gmalloc(72 + fileID->getLength());
- if (userPassword) {
- len = userPassword->getLength();
- if (len < 32) {
- memcpy(buf, userPassword->getCString(), len);
- memcpy(buf + len, passwordPad, 32 - len);
- } else {
- memcpy(buf, userPassword->getCString(), 32);
- }
- } else {
- memcpy(buf, passwordPad, 32);
- }
- memcpy(buf + 32, ownerKey->getCString(), 32);
- buf[64] = permissions & 0xff;
- buf[65] = (permissions >> 8) & 0xff;
- buf[66] = (permissions >> 16) & 0xff;
- buf[67] = (permissions >> 24) & 0xff;
- memcpy(buf + 68, fileID->getCString(), fileID->getLength());
- len = 68 + fileID->getLength();
- if (!encryptMetadata) {
- buf[len++] = 0xff;
- buf[len++] = 0xff;
- buf[len++] = 0xff;
- buf[len++] = 0xff;
- }
- md5(buf, len, fileKey);
- if (encRevision == 3) {
- for (i = 0; i < 50; ++i) {
- md5(fileKey, keyLength, fileKey);
- }
- }
-
- // test user password
- if (encRevision == 2) {
- rc4InitKey(fileKey, keyLength, fState);
- fx = fy = 0;
- for (i = 0; i < 32; ++i) {
- test[i] = rc4DecryptByte(fState, &fx, &fy, userKey->getChar(i));
- }
- ok = memcmp(test, passwordPad, 32) == 0;
- } else if (encRevision == 3) {
- memcpy(test, userKey->getCString(), 32);
- for (i = 19; i >= 0; --i) {
- for (j = 0; j < keyLength; ++j) {
- tmpKey[j] = fileKey[j] ^ i;
- }
- rc4InitKey(tmpKey, keyLength, fState);
- fx = fy = 0;
- for (j = 0; j < 32; ++j) {
- test[j] = rc4DecryptByte(fState, &fx, &fy, test[j]);
- }
- }
- memcpy(buf, passwordPad, 32);
- memcpy(buf + 32, fileID->getCString(), fileID->getLength());
- md5(buf, 32 + fileID->getLength(), buf);
- ok = memcmp(test, buf, 16) == 0;
- } else {
- ok = gFalse;
- }
-
- gfree(buf);
- return ok;
-}
-
-//------------------------------------------------------------------------
-// DecryptStream
-//------------------------------------------------------------------------
-
-DecryptStream::DecryptStream(Stream *strA, Guchar *fileKey,
- CryptAlgorithm algoA, int keyLength,
- int objNum, int objGen):
- FilterStream(strA)
-{
- int n, i;
-
- algo = algoA;
-
- // construct object key
- for (i = 0; i < keyLength; ++i) {
- objKey[i] = fileKey[i];
- }
- objKey[keyLength] = objNum & 0xff;
- objKey[keyLength + 1] = (objNum >> 8) & 0xff;
- objKey[keyLength + 2] = (objNum >> 16) & 0xff;
- objKey[keyLength + 3] = objGen & 0xff;
- objKey[keyLength + 4] = (objGen >> 8) & 0xff;
- if (algo == cryptAES) {
- objKey[keyLength + 5] = 0x73; // 's'
- objKey[keyLength + 6] = 0x41; // 'A'
- objKey[keyLength + 7] = 0x6c; // 'l'
- objKey[keyLength + 8] = 0x54; // 'T'
- n = keyLength + 9;
- } else {
- n = keyLength + 5;
- }
- md5(objKey, n, objKey);
- if ((objKeyLength = keyLength + 5) > 16) {
- objKeyLength = 16;
- }
-}
-
-DecryptStream::~DecryptStream() {
- delete str;
-}
-
-void DecryptStream::reset() {
- int i;
-
- str->reset();
- switch (algo) {
- case cryptRC4:
- state.rc4.x = state.rc4.y = 0;
- rc4InitKey(objKey, objKeyLength, state.rc4.state);
- state.rc4.buf = EOF;
- break;
- case cryptAES:
- aesKeyExpansion(&state.aes, objKey, objKeyLength);
- for (i = 0; i < 16; ++i) {
- state.aes.cbc[i] = str->getChar();
- }
- state.aes.bufIdx = 16;
- break;
- }
-}
-
-int DecryptStream::getChar() {
- Guchar in[16];
- int c, i;
-
- c = EOF; // make gcc happy
- switch (algo) {
- case cryptRC4:
- if (state.rc4.buf == EOF) {
- c = str->getChar();
- if (c != EOF) {
- state.rc4.buf = rc4DecryptByte(state.rc4.state, &state.rc4.x,
- &state.rc4.y, (Guchar)c);
- }
- }
- c = state.rc4.buf;
- state.rc4.buf = EOF;
- break;
- case cryptAES:
- if (state.aes.bufIdx == 16) {
- for (i = 0; i < 16; ++i) {
- if ((c = str->getChar()) == EOF) {
- return EOF;
- }
- in[i] = (Guchar)c;
- }
- aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
- }
- if (state.aes.bufIdx == 16) {
- c = EOF;
- } else {
- c = state.aes.buf[state.aes.bufIdx++];
- }
- break;
- }
- return c;
-}
-
-int DecryptStream::lookChar() {
- Guchar in[16];
- int c, i;
-
- c = EOF; // make gcc happy
- switch (algo) {
- case cryptRC4:
- if (state.rc4.buf == EOF) {
- c = str->getChar();
- if (c != EOF) {
- state.rc4.buf = rc4DecryptByte(state.rc4.state, &state.rc4.x,
- &state.rc4.y, (Guchar)c);
- }
- }
- c = state.rc4.buf;
- break;
- case cryptAES:
- if (state.aes.bufIdx == 16) {
- for (i = 0; i < 16; ++i) {
- if ((c = str->getChar()) == EOF) {
- return EOF;
- }
- in[i] = c;
- }
- aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
- }
- if (state.aes.bufIdx == 16) {
- c = EOF;
- } else {
- c = state.aes.buf[state.aes.bufIdx];
- }
- break;
- }
- return c;
-}
-
-GBool DecryptStream::isBinary(GBool last) {
- return str->isBinary(last);
-}
-
-//------------------------------------------------------------------------
-// RC4-compatible decryption
-//------------------------------------------------------------------------
-
-static void rc4InitKey(Guchar *key, int keyLen, Guchar *state) {
- Guchar index1, index2;
- Guchar t;
- int i;
-
- for (i = 0; i < 256; ++i)
- state[i] = i;
- index1 = index2 = 0;
- for (i = 0; i < 256; ++i) {
- index2 = (key[index1] + state[i] + index2) % 256;
- t = state[i];
- state[i] = state[index2];
- state[index2] = t;
- index1 = (index1 + 1) % keyLen;
- }
-}
-
-static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
- Guchar x1, y1, tx, ty;
-
- x1 = *x = (*x + 1) % 256;
- y1 = *y = (state[*x] + *y) % 256;
- tx = state[x1];
- ty = state[y1];
- state[x1] = ty;
- state[y1] = tx;
- return c ^ state[(tx + ty) % 256];
-}
-
-//------------------------------------------------------------------------
-// AES decryption
-//------------------------------------------------------------------------
-
-static Guchar sbox[256] = {
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
-};
-
-static Guchar invSbox[256] = {
- 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
- 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
- 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
- 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
- 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
- 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
- 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
- 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
- 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
- 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
- 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
- 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
- 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
- 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
- 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
- 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
-};
-
-static Guint rcon[11] = {
- 0x00000000, // unused
- 0x01000000,
- 0x02000000,
- 0x04000000,
- 0x08000000,
- 0x10000000,
- 0x20000000,
- 0x40000000,
- 0x80000000,
- 0x1b000000,
- 0x36000000
-};
-
-static inline Guint subWord(Guint x) {
- return (sbox[x >> 24] << 24)
- | (sbox[(x >> 16) & 0xff] << 16)
- | (sbox[(x >> 8) & 0xff] << 8)
- | sbox[x & 0xff];
-}
-
-static inline Guint rotWord(Guint x) {
- return ((x << 8) & 0xffffffff) | (x >> 24);
-}
-
-static inline void invSubBytes(Guchar *state) {
- int i;
-
- for (i = 0; i < 16; ++i) {
- state[i] = invSbox[state[i]];
- }
-}
-
-static inline void invShiftRows(Guchar *state) {
- Guchar t;
-
- t = state[7];
- state[7] = state[6];
- state[6] = state[5];
- state[5] = state[4];
- state[4] = t;
-
- t = state[8];
- state[8] = state[10];
- state[10] = t;
- t = state[9];
- state[9] = state[11];
- state[11] = t;
-
- t = state[12];
- state[12] = state[13];
- state[13] = state[14];
- state[14] = state[15];
- state[15] = t;
-}
-
-// {09} \cdot s
-static inline Guchar mul09(Guchar s) {
- Guchar s2, s4, s8;
-
- s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
- s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
- s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
- return s ^ s8;
-}
-
-// {0b} \cdot s
-static inline Guchar mul0b(Guchar s) {
- Guchar s2, s4, s8;
-
- s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
- s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
- s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
- return s ^ s2 ^ s8;
-}
-
-// {0d} \cdot s
-static inline Guchar mul0d(Guchar s) {
- Guchar s2, s4, s8;
-
- s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
- s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
- s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
- return s ^ s4 ^ s8;
-}
-
-// {0e} \cdot s
-static inline Guchar mul0e(Guchar s) {
- Guchar s2, s4, s8;
-
- s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
- s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
- s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
- return s2 ^ s4 ^ s8;
-}
-
-static inline void invMixColumns(Guchar *state) {
- int c;
- Guchar s0, s1, s2, s3;
-
- for (c = 0; c < 4; ++c) {
- s0 = state[c];
- s1 = state[4+c];
- s2 = state[8+c];
- s3 = state[12+c];
- state[c] = mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3);
- state[4+c] = mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3);
- state[8+c] = mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3);
- state[12+c] = mul0b(s0) ^ mul0d(s1) ^ mul09(s2) ^ mul0e(s3);
- }
-}
-
-static inline void invMixColumnsW(Guint *w) {
- int c;
- Guchar s0, s1, s2, s3;
-
- for (c = 0; c < 4; ++c) {
- s0 = w[c] >> 24;
- s1 = w[c] >> 16;
- s2 = w[c] >> 8;
- s3 = w[c];
- w[c] = ((mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3)) << 24)
- | ((mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3)) << 16)
- | ((mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3)) << 8)
- | (mul0b(s0) ^ mul0d(s1) ^ mul09(s2) ^ mul0e(s3));
- }
-}
-
-static inline void addRoundKey(Guchar *state, Guint *w) {
- int c;
-
- for (c = 0; c < 4; ++c) {
- state[c] ^= w[c] >> 24;
- state[4+c] ^= w[c] >> 16;
- state[8+c] ^= w[c] >> 8;
- state[12+c] ^= w[c];
- }
-}
-
-static void aesKeyExpansion(DecryptAESState *s,
- Guchar *objKey, int /*objKeyLen*/) {
- Guint temp;
- int i, round;
-
- //~ this assumes objKeyLen == 16
-
- for (i = 0; i < 4; ++i) {
- s->w[i] = (objKey[4*i] << 24) + (objKey[4*i+1] << 16) +
- (objKey[4*i+2] << 8) + objKey[4*i+3];
- }
- for (i = 4; i < 44; ++i) {
- temp = s->w[i-1];
- if (!(i & 3)) {
- temp = subWord(rotWord(temp)) ^ rcon[i/4];
- }
- s->w[i] = s->w[i-4] ^ temp;
- }
- for (round = 1; round <= 9; ++round) {
- invMixColumnsW(&s->w[round * 4]);
- }
-}
-
-static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last) {
- int c, round, n, i;
-
- // initial state
- for (c = 0; c < 4; ++c) {
- s->state[c] = in[4*c];
- s->state[4+c] = in[4*c+1];
- s->state[8+c] = in[4*c+2];
- s->state[12+c] = in[4*c+3];
- }
-
- // round 0
- addRoundKey(s->state, &s->w[10 * 4]);
-
- // rounds 1-9
- for (round = 9; round >= 1; --round) {
- invSubBytes(s->state);
- invShiftRows(s->state);
- invMixColumns(s->state);
- addRoundKey(s->state, &s->w[round * 4]);
- }
-
- // round 10
- invSubBytes(s->state);
- invShiftRows(s->state);
- addRoundKey(s->state, &s->w[0]);
-
- // CBC
- for (c = 0; c < 4; ++c) {
- s->buf[4*c] = s->state[c] ^ s->cbc[4*c];
- s->buf[4*c+1] = s->state[4+c] ^ s->cbc[4*c+1];
- s->buf[4*c+2] = s->state[8+c] ^ s->cbc[4*c+2];
- s->buf[4*c+3] = s->state[12+c] ^ s->cbc[4*c+3];
- }
-
- // save the input block for the next CBC
- for (i = 0; i < 16; ++i) {
- s->cbc[i] = in[i];
- }
-
- // remove padding
- s->bufIdx = 0;
- if (last) {
- n = s->buf[15];
- for (i = 15; i >= n; --i) {
- s->buf[i] = s->buf[i-n];
- }
- s->bufIdx = n;
- }
-}
-
-//------------------------------------------------------------------------
-// MD5 message digest
-//------------------------------------------------------------------------
-
-// this works around a bug in older Sun compilers
-static inline Gulong rotateLeft(Gulong x, int r) {
- x &= 0xffffffff;
- return ((x << r) | (x >> (32 - r))) & 0xffffffff;
-}
-
-static inline Gulong md5Round1(Gulong a, Gulong b, Gulong c, Gulong d,
- Gulong Xk, Gulong s, Gulong Ti) {
- return b + rotateLeft((a + ((b & c) | (~b & d)) + Xk + Ti), s);
-}
-
-static inline Gulong md5Round2(Gulong a, Gulong b, Gulong c, Gulong d,
- Gulong Xk, Gulong s, Gulong Ti) {
- return b + rotateLeft((a + ((b & d) | (c & ~d)) + Xk + Ti), s);
-}
-
-static inline Gulong md5Round3(Gulong a, Gulong b, Gulong c, Gulong d,
- Gulong Xk, Gulong s, Gulong Ti) {
- return b + rotateLeft((a + (b ^ c ^ d) + Xk + Ti), s);
-}
-
-static inline Gulong md5Round4(Gulong a, Gulong b, Gulong c, Gulong d,
- Gulong Xk, Gulong s, Gulong Ti) {
- return b + rotateLeft((a + (c ^ (b | ~d)) + Xk + Ti), s);
-}
-
-static void md5(Guchar *msg, int msgLen, Guchar *digest) {
- Gulong x[16];
- Gulong a, b, c, d, aa, bb, cc, dd;
- int n64;
- int i, j, k;
-
- // compute number of 64-byte blocks
- // (length + pad byte (0x80) + 8 bytes for length)
- n64 = (msgLen + 1 + 8 + 63) / 64;
-
- // initialize a, b, c, d
- a = 0x67452301;
- b = 0xefcdab89;
- c = 0x98badcfe;
- d = 0x10325476;
-
- // loop through blocks
- k = 0;
- for (i = 0; i < n64; ++i) {
-
- // grab a 64-byte block
- for (j = 0; j < 16 && k < msgLen - 3; ++j, k += 4)
- x[j] = (((((msg[k+3] << 8) + msg[k+2]) << 8) + msg[k+1]) << 8) + msg[k];
- if (i == n64 - 1) {
- if (k == msgLen - 3)
- x[j] = 0x80000000 + (((msg[k+2] << 8) + msg[k+1]) << 8) + msg[k];
- else if (k == msgLen - 2)
- x[j] = 0x800000 + (msg[k+1] << 8) + msg[k];
- else if (k == msgLen - 1)
- x[j] = 0x8000 + msg[k];
- else
- x[j] = 0x80;
- ++j;
- while (j < 16)
- x[j++] = 0;
- x[14] = msgLen << 3;
- }
-
- // save a, b, c, d
- aa = a;
- bb = b;
- cc = c;
- dd = d;
-
- // round 1
- a = md5Round1(a, b, c, d, x[0], 7, 0xd76aa478);
- d = md5Round1(d, a, b, c, x[1], 12, 0xe8c7b756);
- c = md5Round1(c, d, a, b, x[2], 17, 0x242070db);
- b = md5Round1(b, c, d, a, x[3], 22, 0xc1bdceee);
- a = md5Round1(a, b, c, d, x[4], 7, 0xf57c0faf);
- d = md5Round1(d, a, b, c, x[5], 12, 0x4787c62a);
- c = md5Round1(c, d, a, b, x[6], 17, 0xa8304613);
- b = md5Round1(b, c, d, a, x[7], 22, 0xfd469501);
- a = md5Round1(a, b, c, d, x[8], 7, 0x698098d8);
- d = md5Round1(d, a, b, c, x[9], 12, 0x8b44f7af);
- c = md5Round1(c, d, a, b, x[10], 17, 0xffff5bb1);
- b = md5Round1(b, c, d, a, x[11], 22, 0x895cd7be);
- a = md5Round1(a, b, c, d, x[12], 7, 0x6b901122);
- d = md5Round1(d, a, b, c, x[13], 12, 0xfd987193);
- c = md5Round1(c, d, a, b, x[14], 17, 0xa679438e);
- b = md5Round1(b, c, d, a, x[15], 22, 0x49b40821);
-
- // round 2
- a = md5Round2(a, b, c, d, x[1], 5, 0xf61e2562);
- d = md5Round2(d, a, b, c, x[6], 9, 0xc040b340);
- c = md5Round2(c, d, a, b, x[11], 14, 0x265e5a51);
- b = md5Round2(b, c, d, a, x[0], 20, 0xe9b6c7aa);
- a = md5Round2(a, b, c, d, x[5], 5, 0xd62f105d);
- d = md5Round2(d, a, b, c, x[10], 9, 0x02441453);
- c = md5Round2(c, d, a, b, x[15], 14, 0xd8a1e681);
- b = md5Round2(b, c, d, a, x[4], 20, 0xe7d3fbc8);
- a = md5Round2(a, b, c, d, x[9], 5, 0x21e1cde6);
- d = md5Round2(d, a, b, c, x[14], 9, 0xc33707d6);
- c = md5Round2(c, d, a, b, x[3], 14, 0xf4d50d87);
- b = md5Round2(b, c, d, a, x[8], 20, 0x455a14ed);
- a = md5Round2(a, b, c, d, x[13], 5, 0xa9e3e905);
- d = md5Round2(d, a, b, c, x[2], 9, 0xfcefa3f8);
- c = md5Round2(c, d, a, b, x[7], 14, 0x676f02d9);
- b = md5Round2(b, c, d, a, x[12], 20, 0x8d2a4c8a);
-
- // round 3
- a = md5Round3(a, b, c, d, x[5], 4, 0xfffa3942);
- d = md5Round3(d, a, b, c, x[8], 11, 0x8771f681);
- c = md5Round3(c, d, a, b, x[11], 16, 0x6d9d6122);
- b = md5Round3(b, c, d, a, x[14], 23, 0xfde5380c);
- a = md5Round3(a, b, c, d, x[1], 4, 0xa4beea44);
- d = md5Round3(d, a, b, c, x[4], 11, 0x4bdecfa9);
- c = md5Round3(c, d, a, b, x[7], 16, 0xf6bb4b60);
- b = md5Round3(b, c, d, a, x[10], 23, 0xbebfbc70);
- a = md5Round3(a, b, c, d, x[13], 4, 0x289b7ec6);
- d = md5Round3(d, a, b, c, x[0], 11, 0xeaa127fa);
- c = md5Round3(c, d, a, b, x[3], 16, 0xd4ef3085);
- b = md5Round3(b, c, d, a, x[6], 23, 0x04881d05);
- a = md5Round3(a, b, c, d, x[9], 4, 0xd9d4d039);
- d = md5Round3(d, a, b, c, x[12], 11, 0xe6db99e5);
- c = md5Round3(c, d, a, b, x[15], 16, 0x1fa27cf8);
- b = md5Round3(b, c, d, a, x[2], 23, 0xc4ac5665);
-
- // round 4
- a = md5Round4(a, b, c, d, x[0], 6, 0xf4292244);
- d = md5Round4(d, a, b, c, x[7], 10, 0x432aff97);
- c = md5Round4(c, d, a, b, x[14], 15, 0xab9423a7);
- b = md5Round4(b, c, d, a, x[5], 21, 0xfc93a039);
- a = md5Round4(a, b, c, d, x[12], 6, 0x655b59c3);
- d = md5Round4(d, a, b, c, x[3], 10, 0x8f0ccc92);
- c = md5Round4(c, d, a, b, x[10], 15, 0xffeff47d);
- b = md5Round4(b, c, d, a, x[1], 21, 0x85845dd1);
- a = md5Round4(a, b, c, d, x[8], 6, 0x6fa87e4f);
- d = md5Round4(d, a, b, c, x[15], 10, 0xfe2ce6e0);
- c = md5Round4(c, d, a, b, x[6], 15, 0xa3014314);
- b = md5Round4(b, c, d, a, x[13], 21, 0x4e0811a1);
- a = md5Round4(a, b, c, d, x[4], 6, 0xf7537e82);
- d = md5Round4(d, a, b, c, x[11], 10, 0xbd3af235);
- c = md5Round4(c, d, a, b, x[2], 15, 0x2ad7d2bb);
- b = md5Round4(b, c, d, a, x[9], 21, 0xeb86d391);
-
- // increment a, b, c, d
- a += aa;
- b += bb;
- c += cc;
- d += dd;
- }
-
- // break digest into bytes
- digest[0] = (Guchar)(a & 0xff);
- digest[1] = (Guchar)((a >>= 8) & 0xff);
- digest[2] = (Guchar)((a >>= 8) & 0xff);
- digest[3] = (Guchar)((a >>= 8) & 0xff);
- digest[4] = (Guchar)(b & 0xff);
- digest[5] = (Guchar)((b >>= 8) & 0xff);
- digest[6] = (Guchar)((b >>= 8) & 0xff);
- digest[7] = (Guchar)((b >>= 8) & 0xff);
- digest[8] = (Guchar)(c & 0xff);
- digest[9] = (Guchar)((c >>= 8) & 0xff);
- digest[10] = (Guchar)((c >>= 8) & 0xff);
- digest[11] = (Guchar)((c >>= 8) & 0xff);
- digest[12] = (Guchar)(d & 0xff);
- digest[13] = (Guchar)((d >>= 8) & 0xff);
- digest[14] = (Guchar)((d >>= 8) & 0xff);
- digest[15] = (Guchar)((d >>= 8) & 0xff);
-}
diff --git a/kpdf/xpdf/xpdf/Decrypt.cpp b/kpdf/xpdf/xpdf/Decrypt.cpp
new file mode 100644
index 00000000..97fa0bd6
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Decrypt.cpp
@@ -0,0 +1,776 @@
+//========================================================================
+//
+// Decrypt.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include "gmem.h"
+#include "Decrypt.h"
+
+static void rc4InitKey(Guchar *key, int keyLen, Guchar *state);
+static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c);
+static void aesKeyExpansion(DecryptAESState *s,
+ Guchar *objKey, int objKeyLen);
+static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last);
+static void md5(Guchar *msg, int msgLen, Guchar *digest);
+
+static Guchar passwordPad[32] = {
+ 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
+ 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
+ 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,
+ 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a
+};
+
+//------------------------------------------------------------------------
+// Decrypt
+//------------------------------------------------------------------------
+
+GBool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength,
+ GString *ownerKey, GString *userKey,
+ int permissions, GString *fileID,
+ GString *ownerPassword, GString *userPassword,
+ Guchar *fileKey, GBool encryptMetadata,
+ GBool *ownerPasswordOk) {
+ Guchar test[32], test2[32];
+ GString *userPassword2;
+ Guchar fState[256];
+ Guchar tmpKey[16];
+ Guchar fx, fy;
+ int len, i, j;
+
+ // try using the supplied owner password to generate the user password
+ *ownerPasswordOk = gFalse;
+ if (ownerPassword) {
+ len = ownerPassword->getLength();
+ if (len < 32) {
+ memcpy(test, ownerPassword->getCString(), len);
+ memcpy(test + len, passwordPad, 32 - len);
+ } else {
+ memcpy(test, ownerPassword->getCString(), 32);
+ }
+ md5(test, 32, test);
+ if (encRevision == 3) {
+ for (i = 0; i < 50; ++i) {
+ md5(test, 16, test);
+ }
+ }
+ if (encRevision == 2) {
+ rc4InitKey(test, keyLength, fState);
+ fx = fy = 0;
+ for (i = 0; i < 32; ++i) {
+ test2[i] = rc4DecryptByte(fState, &fx, &fy, ownerKey->getChar(i));
+ }
+ } else {
+ memcpy(test2, ownerKey->getCString(), 32);
+ for (i = 19; i >= 0; --i) {
+ for (j = 0; j < keyLength; ++j) {
+ tmpKey[j] = test[j] ^ i;
+ }
+ rc4InitKey(tmpKey, keyLength, fState);
+ fx = fy = 0;
+ for (j = 0; j < 32; ++j) {
+ test2[j] = rc4DecryptByte(fState, &fx, &fy, test2[j]);
+ }
+ }
+ }
+ userPassword2 = new GString((char *)test2, 32);
+ if (makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
+ permissions, fileID, userPassword2, fileKey,
+ encryptMetadata)) {
+ *ownerPasswordOk = gTrue;
+ delete userPassword2;
+ return gTrue;
+ }
+ delete userPassword2;
+ }
+
+ // try using the supplied user password
+ return makeFileKey2(encVersion, encRevision, keyLength, ownerKey, userKey,
+ permissions, fileID, userPassword, fileKey,
+ encryptMetadata);
+}
+
+GBool Decrypt::makeFileKey2(int /*encVersion*/, int encRevision, int keyLength,
+ GString *ownerKey, GString *userKey,
+ int permissions, GString *fileID,
+ GString *userPassword, Guchar *fileKey,
+ GBool encryptMetadata) {
+ Guchar *buf;
+ Guchar test[32];
+ Guchar fState[256];
+ Guchar tmpKey[16];
+ Guchar fx, fy;
+ int len, i, j;
+ GBool ok;
+
+ // generate file key
+ buf = (Guchar *)gmalloc(72 + fileID->getLength());
+ if (userPassword) {
+ len = userPassword->getLength();
+ if (len < 32) {
+ memcpy(buf, userPassword->getCString(), len);
+ memcpy(buf + len, passwordPad, 32 - len);
+ } else {
+ memcpy(buf, userPassword->getCString(), 32);
+ }
+ } else {
+ memcpy(buf, passwordPad, 32);
+ }
+ memcpy(buf + 32, ownerKey->getCString(), 32);
+ buf[64] = permissions & 0xff;
+ buf[65] = (permissions >> 8) & 0xff;
+ buf[66] = (permissions >> 16) & 0xff;
+ buf[67] = (permissions >> 24) & 0xff;
+ memcpy(buf + 68, fileID->getCString(), fileID->getLength());
+ len = 68 + fileID->getLength();
+ if (!encryptMetadata) {
+ buf[len++] = 0xff;
+ buf[len++] = 0xff;
+ buf[len++] = 0xff;
+ buf[len++] = 0xff;
+ }
+ md5(buf, len, fileKey);
+ if (encRevision == 3) {
+ for (i = 0; i < 50; ++i) {
+ md5(fileKey, keyLength, fileKey);
+ }
+ }
+
+ // test user password
+ if (encRevision == 2) {
+ rc4InitKey(fileKey, keyLength, fState);
+ fx = fy = 0;
+ for (i = 0; i < 32; ++i) {
+ test[i] = rc4DecryptByte(fState, &fx, &fy, userKey->getChar(i));
+ }
+ ok = memcmp(test, passwordPad, 32) == 0;
+ } else if (encRevision == 3) {
+ memcpy(test, userKey->getCString(), 32);
+ for (i = 19; i >= 0; --i) {
+ for (j = 0; j < keyLength; ++j) {
+ tmpKey[j] = fileKey[j] ^ i;
+ }
+ rc4InitKey(tmpKey, keyLength, fState);
+ fx = fy = 0;
+ for (j = 0; j < 32; ++j) {
+ test[j] = rc4DecryptByte(fState, &fx, &fy, test[j]);
+ }
+ }
+ memcpy(buf, passwordPad, 32);
+ memcpy(buf + 32, fileID->getCString(), fileID->getLength());
+ md5(buf, 32 + fileID->getLength(), buf);
+ ok = memcmp(test, buf, 16) == 0;
+ } else {
+ ok = gFalse;
+ }
+
+ gfree(buf);
+ return ok;
+}
+
+//------------------------------------------------------------------------
+// DecryptStream
+//------------------------------------------------------------------------
+
+DecryptStream::DecryptStream(Stream *strA, Guchar *fileKey,
+ CryptAlgorithm algoA, int keyLength,
+ int objNum, int objGen):
+ FilterStream(strA)
+{
+ int n, i;
+
+ algo = algoA;
+
+ // construct object key
+ for (i = 0; i < keyLength; ++i) {
+ objKey[i] = fileKey[i];
+ }
+ objKey[keyLength] = objNum & 0xff;
+ objKey[keyLength + 1] = (objNum >> 8) & 0xff;
+ objKey[keyLength + 2] = (objNum >> 16) & 0xff;
+ objKey[keyLength + 3] = objGen & 0xff;
+ objKey[keyLength + 4] = (objGen >> 8) & 0xff;
+ if (algo == cryptAES) {
+ objKey[keyLength + 5] = 0x73; // 's'
+ objKey[keyLength + 6] = 0x41; // 'A'
+ objKey[keyLength + 7] = 0x6c; // 'l'
+ objKey[keyLength + 8] = 0x54; // 'T'
+ n = keyLength + 9;
+ } else {
+ n = keyLength + 5;
+ }
+ md5(objKey, n, objKey);
+ if ((objKeyLength = keyLength + 5) > 16) {
+ objKeyLength = 16;
+ }
+}
+
+DecryptStream::~DecryptStream() {
+ delete str;
+}
+
+void DecryptStream::reset() {
+ int i;
+
+ str->reset();
+ switch (algo) {
+ case cryptRC4:
+ state.rc4.x = state.rc4.y = 0;
+ rc4InitKey(objKey, objKeyLength, state.rc4.state);
+ state.rc4.buf = EOF;
+ break;
+ case cryptAES:
+ aesKeyExpansion(&state.aes, objKey, objKeyLength);
+ for (i = 0; i < 16; ++i) {
+ state.aes.cbc[i] = str->getChar();
+ }
+ state.aes.bufIdx = 16;
+ break;
+ }
+}
+
+int DecryptStream::getChar() {
+ Guchar in[16];
+ int c, i;
+
+ c = EOF; // make gcc happy
+ switch (algo) {
+ case cryptRC4:
+ if (state.rc4.buf == EOF) {
+ c = str->getChar();
+ if (c != EOF) {
+ state.rc4.buf = rc4DecryptByte(state.rc4.state, &state.rc4.x,
+ &state.rc4.y, (Guchar)c);
+ }
+ }
+ c = state.rc4.buf;
+ state.rc4.buf = EOF;
+ break;
+ case cryptAES:
+ if (state.aes.bufIdx == 16) {
+ for (i = 0; i < 16; ++i) {
+ if ((c = str->getChar()) == EOF) {
+ return EOF;
+ }
+ in[i] = (Guchar)c;
+ }
+ aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
+ }
+ if (state.aes.bufIdx == 16) {
+ c = EOF;
+ } else {
+ c = state.aes.buf[state.aes.bufIdx++];
+ }
+ break;
+ }
+ return c;
+}
+
+int DecryptStream::lookChar() {
+ Guchar in[16];
+ int c, i;
+
+ c = EOF; // make gcc happy
+ switch (algo) {
+ case cryptRC4:
+ if (state.rc4.buf == EOF) {
+ c = str->getChar();
+ if (c != EOF) {
+ state.rc4.buf = rc4DecryptByte(state.rc4.state, &state.rc4.x,
+ &state.rc4.y, (Guchar)c);
+ }
+ }
+ c = state.rc4.buf;
+ break;
+ case cryptAES:
+ if (state.aes.bufIdx == 16) {
+ for (i = 0; i < 16; ++i) {
+ if ((c = str->getChar()) == EOF) {
+ return EOF;
+ }
+ in[i] = c;
+ }
+ aesDecryptBlock(&state.aes, in, str->lookChar() == EOF);
+ }
+ if (state.aes.bufIdx == 16) {
+ c = EOF;
+ } else {
+ c = state.aes.buf[state.aes.bufIdx];
+ }
+ break;
+ }
+ return c;
+}
+
+GBool DecryptStream::isBinary(GBool last) {
+ return str->isBinary(last);
+}
+
+//------------------------------------------------------------------------
+// RC4-compatible decryption
+//------------------------------------------------------------------------
+
+static void rc4InitKey(Guchar *key, int keyLen, Guchar *state) {
+ Guchar index1, index2;
+ Guchar t;
+ int i;
+
+ for (i = 0; i < 256; ++i)
+ state[i] = i;
+ index1 = index2 = 0;
+ for (i = 0; i < 256; ++i) {
+ index2 = (key[index1] + state[i] + index2) % 256;
+ t = state[i];
+ state[i] = state[index2];
+ state[index2] = t;
+ index1 = (index1 + 1) % keyLen;
+ }
+}
+
+static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
+ Guchar x1, y1, tx, ty;
+
+ x1 = *x = (*x + 1) % 256;
+ y1 = *y = (state[*x] + *y) % 256;
+ tx = state[x1];
+ ty = state[y1];
+ state[x1] = ty;
+ state[y1] = tx;
+ return c ^ state[(tx + ty) % 256];
+}
+
+//------------------------------------------------------------------------
+// AES decryption
+//------------------------------------------------------------------------
+
+static Guchar sbox[256] = {
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
+ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
+ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
+ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
+ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
+ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
+ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
+ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
+ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
+ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
+ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
+ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
+ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
+ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
+ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
+};
+
+static Guchar invSbox[256] = {
+ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
+ 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
+ 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
+ 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
+ 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
+ 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
+ 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
+ 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
+ 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
+ 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
+ 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
+ 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
+ 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
+ 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
+ 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
+ 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
+};
+
+static Guint rcon[11] = {
+ 0x00000000, // unused
+ 0x01000000,
+ 0x02000000,
+ 0x04000000,
+ 0x08000000,
+ 0x10000000,
+ 0x20000000,
+ 0x40000000,
+ 0x80000000,
+ 0x1b000000,
+ 0x36000000
+};
+
+static inline Guint subWord(Guint x) {
+ return (sbox[x >> 24] << 24)
+ | (sbox[(x >> 16) & 0xff] << 16)
+ | (sbox[(x >> 8) & 0xff] << 8)
+ | sbox[x & 0xff];
+}
+
+static inline Guint rotWord(Guint x) {
+ return ((x << 8) & 0xffffffff) | (x >> 24);
+}
+
+static inline void invSubBytes(Guchar *state) {
+ int i;
+
+ for (i = 0; i < 16; ++i) {
+ state[i] = invSbox[state[i]];
+ }
+}
+
+static inline void invShiftRows(Guchar *state) {
+ Guchar t;
+
+ t = state[7];
+ state[7] = state[6];
+ state[6] = state[5];
+ state[5] = state[4];
+ state[4] = t;
+
+ t = state[8];
+ state[8] = state[10];
+ state[10] = t;
+ t = state[9];
+ state[9] = state[11];
+ state[11] = t;
+
+ t = state[12];
+ state[12] = state[13];
+ state[13] = state[14];
+ state[14] = state[15];
+ state[15] = t;
+}
+
+// {09} \cdot s
+static inline Guchar mul09(Guchar s) {
+ Guchar s2, s4, s8;
+
+ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+ return s ^ s8;
+}
+
+// {0b} \cdot s
+static inline Guchar mul0b(Guchar s) {
+ Guchar s2, s4, s8;
+
+ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+ return s ^ s2 ^ s8;
+}
+
+// {0d} \cdot s
+static inline Guchar mul0d(Guchar s) {
+ Guchar s2, s4, s8;
+
+ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+ return s ^ s4 ^ s8;
+}
+
+// {0e} \cdot s
+static inline Guchar mul0e(Guchar s) {
+ Guchar s2, s4, s8;
+
+ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+ return s2 ^ s4 ^ s8;
+}
+
+static inline void invMixColumns(Guchar *state) {
+ int c;
+ Guchar s0, s1, s2, s3;
+
+ for (c = 0; c < 4; ++c) {
+ s0 = state[c];
+ s1 = state[4+c];
+ s2 = state[8+c];
+ s3 = state[12+c];
+ state[c] = mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3);
+ state[4+c] = mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3);
+ state[8+c] = mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3);
+ state[12+c] = mul0b(s0) ^ mul0d(s1) ^ mul09(s2) ^ mul0e(s3);
+ }
+}
+
+static inline void invMixColumnsW(Guint *w) {
+ int c;
+ Guchar s0, s1, s2, s3;
+
+ for (c = 0; c < 4; ++c) {
+ s0 = w[c] >> 24;
+ s1 = w[c] >> 16;
+ s2 = w[c] >> 8;
+ s3 = w[c];
+ w[c] = ((mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3)) << 24)
+ | ((mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3)) << 16)
+ | ((mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3)) << 8)
+ | (mul0b(s0) ^ mul0d(s1) ^ mul09(s2) ^ mul0e(s3));
+ }
+}
+
+static inline void addRoundKey(Guchar *state, Guint *w) {
+ int c;
+
+ for (c = 0; c < 4; ++c) {
+ state[c] ^= w[c] >> 24;
+ state[4+c] ^= w[c] >> 16;
+ state[8+c] ^= w[c] >> 8;
+ state[12+c] ^= w[c];
+ }
+}
+
+static void aesKeyExpansion(DecryptAESState *s,
+ Guchar *objKey, int /*objKeyLen*/) {
+ Guint temp;
+ int i, round;
+
+ //~ this assumes objKeyLen == 16
+
+ for (i = 0; i < 4; ++i) {
+ s->w[i] = (objKey[4*i] << 24) + (objKey[4*i+1] << 16) +
+ (objKey[4*i+2] << 8) + objKey[4*i+3];
+ }
+ for (i = 4; i < 44; ++i) {
+ temp = s->w[i-1];
+ if (!(i & 3)) {
+ temp = subWord(rotWord(temp)) ^ rcon[i/4];
+ }
+ s->w[i] = s->w[i-4] ^ temp;
+ }
+ for (round = 1; round <= 9; ++round) {
+ invMixColumnsW(&s->w[round * 4]);
+ }
+}
+
+static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last) {
+ int c, round, n, i;
+
+ // initial state
+ for (c = 0; c < 4; ++c) {
+ s->state[c] = in[4*c];
+ s->state[4+c] = in[4*c+1];
+ s->state[8+c] = in[4*c+2];
+ s->state[12+c] = in[4*c+3];
+ }
+
+ // round 0
+ addRoundKey(s->state, &s->w[10 * 4]);
+
+ // rounds 1-9
+ for (round = 9; round >= 1; --round) {
+ invSubBytes(s->state);
+ invShiftRows(s->state);
+ invMixColumns(s->state);
+ addRoundKey(s->state, &s->w[round * 4]);
+ }
+
+ // round 10
+ invSubBytes(s->state);
+ invShiftRows(s->state);
+ addRoundKey(s->state, &s->w[0]);
+
+ // CBC
+ for (c = 0; c < 4; ++c) {
+ s->buf[4*c] = s->state[c] ^ s->cbc[4*c];
+ s->buf[4*c+1] = s->state[4+c] ^ s->cbc[4*c+1];
+ s->buf[4*c+2] = s->state[8+c] ^ s->cbc[4*c+2];
+ s->buf[4*c+3] = s->state[12+c] ^ s->cbc[4*c+3];
+ }
+
+ // save the input block for the next CBC
+ for (i = 0; i < 16; ++i) {
+ s->cbc[i] = in[i];
+ }
+
+ // remove padding
+ s->bufIdx = 0;
+ if (last) {
+ n = s->buf[15];
+ for (i = 15; i >= n; --i) {
+ s->buf[i] = s->buf[i-n];
+ }
+ s->bufIdx = n;
+ }
+}
+
+//------------------------------------------------------------------------
+// MD5 message digest
+//------------------------------------------------------------------------
+
+// this works around a bug in older Sun compilers
+static inline Gulong rotateLeft(Gulong x, int r) {
+ x &= 0xffffffff;
+ return ((x << r) | (x >> (32 - r))) & 0xffffffff;
+}
+
+static inline Gulong md5Round1(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + ((b & c) | (~b & d)) + Xk + Ti), s);
+}
+
+static inline Gulong md5Round2(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + ((b & d) | (c & ~d)) + Xk + Ti), s);
+}
+
+static inline Gulong md5Round3(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + (b ^ c ^ d) + Xk + Ti), s);
+}
+
+static inline Gulong md5Round4(Gulong a, Gulong b, Gulong c, Gulong d,
+ Gulong Xk, Gulong s, Gulong Ti) {
+ return b + rotateLeft((a + (c ^ (b | ~d)) + Xk + Ti), s);
+}
+
+static void md5(Guchar *msg, int msgLen, Guchar *digest) {
+ Gulong x[16];
+ Gulong a, b, c, d, aa, bb, cc, dd;
+ int n64;
+ int i, j, k;
+
+ // compute number of 64-byte blocks
+ // (length + pad byte (0x80) + 8 bytes for length)
+ n64 = (msgLen + 1 + 8 + 63) / 64;
+
+ // initialize a, b, c, d
+ a = 0x67452301;
+ b = 0xefcdab89;
+ c = 0x98badcfe;
+ d = 0x10325476;
+
+ // loop through blocks
+ k = 0;
+ for (i = 0; i < n64; ++i) {
+
+ // grab a 64-byte block
+ for (j = 0; j < 16 && k < msgLen - 3; ++j, k += 4)
+ x[j] = (((((msg[k+3] << 8) + msg[k+2]) << 8) + msg[k+1]) << 8) + msg[k];
+ if (i == n64 - 1) {
+ if (k == msgLen - 3)
+ x[j] = 0x80000000 + (((msg[k+2] << 8) + msg[k+1]) << 8) + msg[k];
+ else if (k == msgLen - 2)
+ x[j] = 0x800000 + (msg[k+1] << 8) + msg[k];
+ else if (k == msgLen - 1)
+ x[j] = 0x8000 + msg[k];
+ else
+ x[j] = 0x80;
+ ++j;
+ while (j < 16)
+ x[j++] = 0;
+ x[14] = msgLen << 3;
+ }
+
+ // save a, b, c, d
+ aa = a;
+ bb = b;
+ cc = c;
+ dd = d;
+
+ // round 1
+ a = md5Round1(a, b, c, d, x[0], 7, 0xd76aa478);
+ d = md5Round1(d, a, b, c, x[1], 12, 0xe8c7b756);
+ c = md5Round1(c, d, a, b, x[2], 17, 0x242070db);
+ b = md5Round1(b, c, d, a, x[3], 22, 0xc1bdceee);
+ a = md5Round1(a, b, c, d, x[4], 7, 0xf57c0faf);
+ d = md5Round1(d, a, b, c, x[5], 12, 0x4787c62a);
+ c = md5Round1(c, d, a, b, x[6], 17, 0xa8304613);
+ b = md5Round1(b, c, d, a, x[7], 22, 0xfd469501);
+ a = md5Round1(a, b, c, d, x[8], 7, 0x698098d8);
+ d = md5Round1(d, a, b, c, x[9], 12, 0x8b44f7af);
+ c = md5Round1(c, d, a, b, x[10], 17, 0xffff5bb1);
+ b = md5Round1(b, c, d, a, x[11], 22, 0x895cd7be);
+ a = md5Round1(a, b, c, d, x[12], 7, 0x6b901122);
+ d = md5Round1(d, a, b, c, x[13], 12, 0xfd987193);
+ c = md5Round1(c, d, a, b, x[14], 17, 0xa679438e);
+ b = md5Round1(b, c, d, a, x[15], 22, 0x49b40821);
+
+ // round 2
+ a = md5Round2(a, b, c, d, x[1], 5, 0xf61e2562);
+ d = md5Round2(d, a, b, c, x[6], 9, 0xc040b340);
+ c = md5Round2(c, d, a, b, x[11], 14, 0x265e5a51);
+ b = md5Round2(b, c, d, a, x[0], 20, 0xe9b6c7aa);
+ a = md5Round2(a, b, c, d, x[5], 5, 0xd62f105d);
+ d = md5Round2(d, a, b, c, x[10], 9, 0x02441453);
+ c = md5Round2(c, d, a, b, x[15], 14, 0xd8a1e681);
+ b = md5Round2(b, c, d, a, x[4], 20, 0xe7d3fbc8);
+ a = md5Round2(a, b, c, d, x[9], 5, 0x21e1cde6);
+ d = md5Round2(d, a, b, c, x[14], 9, 0xc33707d6);
+ c = md5Round2(c, d, a, b, x[3], 14, 0xf4d50d87);
+ b = md5Round2(b, c, d, a, x[8], 20, 0x455a14ed);
+ a = md5Round2(a, b, c, d, x[13], 5, 0xa9e3e905);
+ d = md5Round2(d, a, b, c, x[2], 9, 0xfcefa3f8);
+ c = md5Round2(c, d, a, b, x[7], 14, 0x676f02d9);
+ b = md5Round2(b, c, d, a, x[12], 20, 0x8d2a4c8a);
+
+ // round 3
+ a = md5Round3(a, b, c, d, x[5], 4, 0xfffa3942);
+ d = md5Round3(d, a, b, c, x[8], 11, 0x8771f681);
+ c = md5Round3(c, d, a, b, x[11], 16, 0x6d9d6122);
+ b = md5Round3(b, c, d, a, x[14], 23, 0xfde5380c);
+ a = md5Round3(a, b, c, d, x[1], 4, 0xa4beea44);
+ d = md5Round3(d, a, b, c, x[4], 11, 0x4bdecfa9);
+ c = md5Round3(c, d, a, b, x[7], 16, 0xf6bb4b60);
+ b = md5Round3(b, c, d, a, x[10], 23, 0xbebfbc70);
+ a = md5Round3(a, b, c, d, x[13], 4, 0x289b7ec6);
+ d = md5Round3(d, a, b, c, x[0], 11, 0xeaa127fa);
+ c = md5Round3(c, d, a, b, x[3], 16, 0xd4ef3085);
+ b = md5Round3(b, c, d, a, x[6], 23, 0x04881d05);
+ a = md5Round3(a, b, c, d, x[9], 4, 0xd9d4d039);
+ d = md5Round3(d, a, b, c, x[12], 11, 0xe6db99e5);
+ c = md5Round3(c, d, a, b, x[15], 16, 0x1fa27cf8);
+ b = md5Round3(b, c, d, a, x[2], 23, 0xc4ac5665);
+
+ // round 4
+ a = md5Round4(a, b, c, d, x[0], 6, 0xf4292244);
+ d = md5Round4(d, a, b, c, x[7], 10, 0x432aff97);
+ c = md5Round4(c, d, a, b, x[14], 15, 0xab9423a7);
+ b = md5Round4(b, c, d, a, x[5], 21, 0xfc93a039);
+ a = md5Round4(a, b, c, d, x[12], 6, 0x655b59c3);
+ d = md5Round4(d, a, b, c, x[3], 10, 0x8f0ccc92);
+ c = md5Round4(c, d, a, b, x[10], 15, 0xffeff47d);
+ b = md5Round4(b, c, d, a, x[1], 21, 0x85845dd1);
+ a = md5Round4(a, b, c, d, x[8], 6, 0x6fa87e4f);
+ d = md5Round4(d, a, b, c, x[15], 10, 0xfe2ce6e0);
+ c = md5Round4(c, d, a, b, x[6], 15, 0xa3014314);
+ b = md5Round4(b, c, d, a, x[13], 21, 0x4e0811a1);
+ a = md5Round4(a, b, c, d, x[4], 6, 0xf7537e82);
+ d = md5Round4(d, a, b, c, x[11], 10, 0xbd3af235);
+ c = md5Round4(c, d, a, b, x[2], 15, 0x2ad7d2bb);
+ b = md5Round4(b, c, d, a, x[9], 21, 0xeb86d391);
+
+ // increment a, b, c, d
+ a += aa;
+ b += bb;
+ c += cc;
+ d += dd;
+ }
+
+ // break digest into bytes
+ digest[0] = (Guchar)(a & 0xff);
+ digest[1] = (Guchar)((a >>= 8) & 0xff);
+ digest[2] = (Guchar)((a >>= 8) & 0xff);
+ digest[3] = (Guchar)((a >>= 8) & 0xff);
+ digest[4] = (Guchar)(b & 0xff);
+ digest[5] = (Guchar)((b >>= 8) & 0xff);
+ digest[6] = (Guchar)((b >>= 8) & 0xff);
+ digest[7] = (Guchar)((b >>= 8) & 0xff);
+ digest[8] = (Guchar)(c & 0xff);
+ digest[9] = (Guchar)((c >>= 8) & 0xff);
+ digest[10] = (Guchar)((c >>= 8) & 0xff);
+ digest[11] = (Guchar)((c >>= 8) & 0xff);
+ digest[12] = (Guchar)(d & 0xff);
+ digest[13] = (Guchar)((d >>= 8) & 0xff);
+ digest[14] = (Guchar)((d >>= 8) & 0xff);
+ digest[15] = (Guchar)((d >>= 8) & 0xff);
+}
diff --git a/kpdf/xpdf/xpdf/Dict.cc b/kpdf/xpdf/xpdf/Dict.cc
deleted file mode 100644
index dd1517f0..00000000
--- a/kpdf/xpdf/xpdf/Dict.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-//========================================================================
-//
-// Dict.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include <string.h>
-#include "gmem.h"
-#include "Object.h"
-#include "XRef.h"
-#include "Dict.h"
-
-//------------------------------------------------------------------------
-// Dict
-//------------------------------------------------------------------------
-
-Dict::Dict(XRef *xrefA) {
- xref = xrefA;
- entries = NULL;
- size = length = 0;
- ref = 1;
-}
-
-Dict::~Dict() {
- int i;
-
- for (i = 0; i < length; ++i) {
- gfree(entries[i].key);
- entries[i].val.free();
- }
- gfree(entries);
-}
-
-void Dict::add(char *key, Object *val) {
- if (length == size) {
- if (length == 0) {
- size = 8;
- } else {
- size *= 2;
- }
- entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
- }
- entries[length].key = key;
- entries[length].val = *val;
- ++length;
-}
-
-inline DictEntry *Dict::find(char *key) {
- int i;
-
- for (i = 0; i < length; ++i) {
- if (!strcmp(key, entries[i].key))
- return &entries[i];
- }
- return NULL;
-}
-
-GBool Dict::is(char *type) {
- DictEntry *e;
-
- return (e = find("Type")) && e->val.isName(type);
-}
-
-Object *Dict::lookup(char *key, Object *obj) {
- DictEntry *e;
-
- return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull();
-}
-
-Object *Dict::lookupNF(char *key, Object *obj) {
- DictEntry *e;
-
- return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
-}
-
-char *Dict::getKey(int i) {
- return entries[i].key;
-}
-
-Object *Dict::getVal(int i, Object *obj) {
- return entries[i].val.fetch(xref, obj);
-}
-
-Object *Dict::getValNF(int i, Object *obj) {
- return entries[i].val.copy(obj);
-}
diff --git a/kpdf/xpdf/xpdf/Dict.cpp b/kpdf/xpdf/xpdf/Dict.cpp
new file mode 100644
index 00000000..593e9a11
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Dict.cpp
@@ -0,0 +1,95 @@
+//========================================================================
+//
+// Dict.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include "gmem.h"
+#include "Object.h"
+#include "XRef.h"
+#include "Dict.h"
+
+//------------------------------------------------------------------------
+// Dict
+//------------------------------------------------------------------------
+
+Dict::Dict(XRef *xrefA) {
+ xref = xrefA;
+ entries = NULL;
+ size = length = 0;
+ ref = 1;
+}
+
+Dict::~Dict() {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ gfree(entries[i].key);
+ entries[i].val.free();
+ }
+ gfree(entries);
+}
+
+void Dict::add(char *key, Object *val) {
+ if (length == size) {
+ if (length == 0) {
+ size = 8;
+ } else {
+ size *= 2;
+ }
+ entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry));
+ }
+ entries[length].key = key;
+ entries[length].val = *val;
+ ++length;
+}
+
+inline DictEntry *Dict::find(char *key) {
+ int i;
+
+ for (i = 0; i < length; ++i) {
+ if (!strcmp(key, entries[i].key))
+ return &entries[i];
+ }
+ return NULL;
+}
+
+GBool Dict::is(char *type) {
+ DictEntry *e;
+
+ return (e = find("Type")) && e->val.isName(type);
+}
+
+Object *Dict::lookup(char *key, Object *obj) {
+ DictEntry *e;
+
+ return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull();
+}
+
+Object *Dict::lookupNF(char *key, Object *obj) {
+ DictEntry *e;
+
+ return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
+}
+
+char *Dict::getKey(int i) {
+ return entries[i].key;
+}
+
+Object *Dict::getVal(int i, Object *obj) {
+ return entries[i].val.fetch(xref, obj);
+}
+
+Object *Dict::getValNF(int i, Object *obj) {
+ return entries[i].val.copy(obj);
+}
diff --git a/kpdf/xpdf/xpdf/FontEncodingTables.cc b/kpdf/xpdf/xpdf/FontEncodingTables.cc
deleted file mode 100644
index f3b9280a..00000000
--- a/kpdf/xpdf/xpdf/FontEncodingTables.cc
+++ /dev/null
@@ -1,1824 +0,0 @@
-//========================================================================
-//
-// FontEncodingTables.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-#include <stdlib.h>
-#include "FontEncodingTables.h"
-
-char *macRomanEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quotesingle",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
- "bracketright",
- "asciicircum",
- "underscore",
- "grave",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
- "braceright",
- "asciitilde",
- NULL,
- "Adieresis",
- "Aring",
- "Ccedilla",
- "Eacute",
- "Ntilde",
- "Odieresis",
- "Udieresis",
- "aacute",
- "agrave",
- "acircumflex",
- "adieresis",
- "atilde",
- "aring",
- "ccedilla",
- "eacute",
- "egrave",
- "ecircumflex",
- "edieresis",
- "iacute",
- "igrave",
- "icircumflex",
- "idieresis",
- "ntilde",
- "oacute",
- "ograve",
- "ocircumflex",
- "odieresis",
- "otilde",
- "uacute",
- "ugrave",
- "ucircumflex",
- "udieresis",
- "dagger",
- "degree",
- "cent",
- "sterling",
- "section",
- "bullet",
- "paragraph",
- "germandbls",
- "registered",
- "copyright",
- "trademark",
- "acute",
- "dieresis",
- "notequal",
- "AE",
- "Oslash",
- "infinity",
- "plusminus",
- "lessequal",
- "greaterequal",
- "yen",
- "mu",
- "partialdiff",
- "summation",
- "product",
- "pi",
- "integral",
- "ordfeminine",
- "ordmasculine",
- "Omega",
- "ae",
- "oslash",
- "questiondown",
- "exclamdown",
- "logicalnot",
- "radical",
- "florin",
- "approxequal",
- "Delta",
- "guillemotleft",
- "guillemotright",
- "ellipsis",
- "space",
- "Agrave",
- "Atilde",
- "Otilde",
- "OE",
- "oe",
- "endash",
- "emdash",
- "quotedblleft",
- "quotedblright",
- "quoteleft",
- "quoteright",
- "divide",
- "lozenge",
- "ydieresis",
- "Ydieresis",
- "fraction",
- "currency",
- "guilsinglleft",
- "guilsinglright",
- "fi",
- "fl",
- "daggerdbl",
- "periodcentered",
- "quotesinglbase",
- "quotedblbase",
- "perthousand",
- "Acircumflex",
- "Ecircumflex",
- "Aacute",
- "Edieresis",
- "Egrave",
- "Iacute",
- "Icircumflex",
- "Idieresis",
- "Igrave",
- "Oacute",
- "Ocircumflex",
- "apple",
- "Ograve",
- "Uacute",
- "Ucircumflex",
- "Ugrave",
- "dotlessi",
- "circumflex",
- "tilde",
- "macron",
- "breve",
- "dotaccent",
- "ring",
- "cedilla",
- "hungarumlaut",
- "ogonek",
- "caron"
-};
-
-char *macExpertEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclamsmall",
- "Hungarumlautsmall",
- "centoldstyle",
- "dollaroldstyle",
- "dollarsuperior",
- "ampersandsmall",
- "Acutesmall",
- "parenleftsuperior",
- "parenrightsuperior",
- "twodotenleader",
- "onedotenleader",
- "comma",
- "hyphen",
- "period",
- "fraction",
- "zerooldstyle",
- "oneoldstyle",
- "twooldstyle",
- "threeoldstyle",
- "fouroldstyle",
- "fiveoldstyle",
- "sixoldstyle",
- "sevenoldstyle",
- "eightoldstyle",
- "nineoldstyle",
- "colon",
- "semicolon",
- NULL,
- "threequartersemdash",
- NULL,
- "questionsmall",
- NULL,
- NULL,
- NULL,
- NULL,
- "Ethsmall",
- NULL,
- NULL,
- "onequarter",
- "onehalf",
- "threequarters",
- "oneeighth",
- "threeeighths",
- "fiveeighths",
- "seveneighths",
- "onethird",
- "twothirds",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "ff",
- "fi",
- "fl",
- "ffi",
- "ffl",
- "parenleftinferior",
- NULL,
- "parenrightinferior",
- "Circumflexsmall",
- "hypheninferior",
- "Gravesmall",
- "Asmall",
- "Bsmall",
- "Csmall",
- "Dsmall",
- "Esmall",
- "Fsmall",
- "Gsmall",
- "Hsmall",
- "Ismall",
- "Jsmall",
- "Ksmall",
- "Lsmall",
- "Msmall",
- "Nsmall",
- "Osmall",
- "Psmall",
- "Qsmall",
- "Rsmall",
- "Ssmall",
- "Tsmall",
- "Usmall",
- "Vsmall",
- "Wsmall",
- "Xsmall",
- "Ysmall",
- "Zsmall",
- "colonmonetary",
- "onefitted",
- "rupiah",
- "Tildesmall",
- NULL,
- NULL,
- "asuperior",
- "centsuperior",
- NULL,
- NULL,
- NULL,
- NULL,
- "Aacutesmall",
- "Agravesmall",
- "Acircumflexsmall",
- "Adieresissmall",
- "Atildesmall",
- "Aringsmall",
- "Ccedillasmall",
- "Eacutesmall",
- "Egravesmall",
- "Ecircumflexsmall",
- "Edieresissmall",
- "Iacutesmall",
- "Igravesmall",
- "Icircumflexsmall",
- "Idieresissmall",
- "Ntildesmall",
- "Oacutesmall",
- "Ogravesmall",
- "Ocircumflexsmall",
- "Odieresissmall",
- "Otildesmall",
- "Uacutesmall",
- "Ugravesmall",
- "Ucircumflexsmall",
- "Udieresissmall",
- NULL,
- "eightsuperior",
- "fourinferior",
- "threeinferior",
- "sixinferior",
- "eightinferior",
- "seveninferior",
- "Scaronsmall",
- NULL,
- "centinferior",
- "twoinferior",
- NULL,
- "Dieresissmall",
- NULL,
- "Caronsmall",
- "osuperior",
- "fiveinferior",
- NULL,
- "commainferior",
- "periodinferior",
- "Yacutesmall",
- NULL,
- "dollarinferior",
- NULL,
- NULL,
- "Thornsmall",
- NULL,
- "nineinferior",
- "zeroinferior",
- "Zcaronsmall",
- "AEsmall",
- "Oslashsmall",
- "questiondownsmall",
- "oneinferior",
- "Lslashsmall",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Cedillasmall",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "OEsmall",
- "figuredash",
- "hyphensuperior",
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdownsmall",
- NULL,
- "Ydieresissmall",
- NULL,
- "onesuperior",
- "twosuperior",
- "threesuperior",
- "foursuperior",
- "fivesuperior",
- "sixsuperior",
- "sevensuperior",
- "ninesuperior",
- "zerosuperior",
- NULL,
- "esuperior",
- "rsuperior",
- "tsuperior",
- NULL,
- NULL,
- "isuperior",
- "ssuperior",
- "dsuperior",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "lsuperior",
- "Ogoneksmall",
- "Brevesmall",
- "Macronsmall",
- "bsuperior",
- "nsuperior",
- "msuperior",
- "commasuperior",
- "periodsuperior",
- "Dotaccentsmall",
- "Ringsmall",
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-char *winAnsiEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quotesingle",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
- "bracketright",
- "asciicircum",
- "underscore",
- "grave",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
- "braceright",
- "asciitilde",
- "bullet",
- "Euro",
- "bullet",
- "quotesinglbase",
- "florin",
- "quotedblbase",
- "ellipsis",
- "dagger",
- "daggerdbl",
- "circumflex",
- "perthousand",
- "Scaron",
- "guilsinglleft",
- "OE",
- "bullet",
- "Zcaron",
- "bullet",
- "bullet",
- "quoteleft",
- "quoteright",
- "quotedblleft",
- "quotedblright",
- "bullet",
- "endash",
- "emdash",
- "tilde",
- "trademark",
- "scaron",
- "guilsinglright",
- "oe",
- "bullet",
- "zcaron",
- "Ydieresis",
- "space",
- "exclamdown",
- "cent",
- "sterling",
- "currency",
- "yen",
- "brokenbar",
- "section",
- "dieresis",
- "copyright",
- "ordfeminine",
- "guillemotleft",
- "logicalnot",
- "hyphen",
- "registered",
- "macron",
- "degree",
- "plusminus",
- "twosuperior",
- "threesuperior",
- "acute",
- "mu",
- "paragraph",
- "periodcentered",
- "cedilla",
- "onesuperior",
- "ordmasculine",
- "guillemotright",
- "onequarter",
- "onehalf",
- "threequarters",
- "questiondown",
- "Agrave",
- "Aacute",
- "Acircumflex",
- "Atilde",
- "Adieresis",
- "Aring",
- "AE",
- "Ccedilla",
- "Egrave",
- "Eacute",
- "Ecircumflex",
- "Edieresis",
- "Igrave",
- "Iacute",
- "Icircumflex",
- "Idieresis",
- "Eth",
- "Ntilde",
- "Ograve",
- "Oacute",
- "Ocircumflex",
- "Otilde",
- "Odieresis",
- "multiply",
- "Oslash",
- "Ugrave",
- "Uacute",
- "Ucircumflex",
- "Udieresis",
- "Yacute",
- "Thorn",
- "germandbls",
- "agrave",
- "aacute",
- "acircumflex",
- "atilde",
- "adieresis",
- "aring",
- "ae",
- "ccedilla",
- "egrave",
- "eacute",
- "ecircumflex",
- "edieresis",
- "igrave",
- "iacute",
- "icircumflex",
- "idieresis",
- "eth",
- "ntilde",
- "ograve",
- "oacute",
- "ocircumflex",
- "otilde",
- "odieresis",
- "divide",
- "oslash",
- "ugrave",
- "uacute",
- "ucircumflex",
- "udieresis",
- "yacute",
- "thorn",
- "ydieresis"
-};
-
-char *standardEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quoteright",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
- "bracketright",
- "asciicircum",
- "underscore",
- "quoteleft",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
- "braceright",
- "asciitilde",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdown",
- "cent",
- "sterling",
- "fraction",
- "yen",
- "florin",
- "section",
- "currency",
- "quotesingle",
- "quotedblleft",
- "guillemotleft",
- "guilsinglleft",
- "guilsinglright",
- "fi",
- "fl",
- NULL,
- "endash",
- "dagger",
- "daggerdbl",
- "periodcentered",
- NULL,
- "paragraph",
- "bullet",
- "quotesinglbase",
- "quotedblbase",
- "quotedblright",
- "guillemotright",
- "ellipsis",
- "perthousand",
- NULL,
- "questiondown",
- NULL,
- "grave",
- "acute",
- "circumflex",
- "tilde",
- "macron",
- "breve",
- "dotaccent",
- "dieresis",
- NULL,
- "ring",
- "cedilla",
- NULL,
- "hungarumlaut",
- "ogonek",
- "caron",
- "emdash",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "AE",
- NULL,
- "ordfeminine",
- NULL,
- NULL,
- NULL,
- NULL,
- "Lslash",
- "Oslash",
- "OE",
- "ordmasculine",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "ae",
- NULL,
- NULL,
- NULL,
- "dotlessi",
- NULL,
- NULL,
- "lslash",
- "oslash",
- "oe",
- "germandbls",
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-char *expertEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclamsmall",
- "Hungarumlautsmall",
- NULL,
- "dollaroldstyle",
- "dollarsuperior",
- "ampersandsmall",
- "Acutesmall",
- "parenleftsuperior",
- "parenrightsuperior",
- "twodotenleader",
- "onedotenleader",
- "comma",
- "hyphen",
- "period",
- "fraction",
- "zerooldstyle",
- "oneoldstyle",
- "twooldstyle",
- "threeoldstyle",
- "fouroldstyle",
- "fiveoldstyle",
- "sixoldstyle",
- "sevenoldstyle",
- "eightoldstyle",
- "nineoldstyle",
- "colon",
- "semicolon",
- "commasuperior",
- "threequartersemdash",
- "periodsuperior",
- "questionsmall",
- NULL,
- "asuperior",
- "bsuperior",
- "centsuperior",
- "dsuperior",
- "esuperior",
- NULL,
- NULL,
- NULL,
- "isuperior",
- NULL,
- NULL,
- "lsuperior",
- "msuperior",
- "nsuperior",
- "osuperior",
- NULL,
- NULL,
- "rsuperior",
- "ssuperior",
- "tsuperior",
- NULL,
- "ff",
- "fi",
- "fl",
- "ffi",
- "ffl",
- "parenleftinferior",
- NULL,
- "parenrightinferior",
- "Circumflexsmall",
- "hyphensuperior",
- "Gravesmall",
- "Asmall",
- "Bsmall",
- "Csmall",
- "Dsmall",
- "Esmall",
- "Fsmall",
- "Gsmall",
- "Hsmall",
- "Ismall",
- "Jsmall",
- "Ksmall",
- "Lsmall",
- "Msmall",
- "Nsmall",
- "Osmall",
- "Psmall",
- "Qsmall",
- "Rsmall",
- "Ssmall",
- "Tsmall",
- "Usmall",
- "Vsmall",
- "Wsmall",
- "Xsmall",
- "Ysmall",
- "Zsmall",
- "colonmonetary",
- "onefitted",
- "rupiah",
- "Tildesmall",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdownsmall",
- "centoldstyle",
- "Lslashsmall",
- NULL,
- NULL,
- "Scaronsmall",
- "Zcaronsmall",
- "Dieresissmall",
- "Brevesmall",
- "Caronsmall",
- NULL,
- "Dotaccentsmall",
- NULL,
- NULL,
- "Macronsmall",
- NULL,
- NULL,
- "figuredash",
- "hypheninferior",
- NULL,
- NULL,
- "Ogoneksmall",
- "Ringsmall",
- "Cedillasmall",
- NULL,
- NULL,
- NULL,
- "onequarter",
- "onehalf",
- "threequarters",
- "questiondownsmall",
- "oneeighth",
- "threeeighths",
- "fiveeighths",
- "seveneighths",
- "onethird",
- "twothirds",
- NULL,
- NULL,
- "zerosuperior",
- "onesuperior",
- "twosuperior",
- "threesuperior",
- "foursuperior",
- "fivesuperior",
- "sixsuperior",
- "sevensuperior",
- "eightsuperior",
- "ninesuperior",
- "zeroinferior",
- "oneinferior",
- "twoinferior",
- "threeinferior",
- "fourinferior",
- "fiveinferior",
- "sixinferior",
- "seveninferior",
- "eightinferior",
- "nineinferior",
- "centinferior",
- "dollarinferior",
- "periodinferior",
- "commainferior",
- "Agravesmall",
- "Aacutesmall",
- "Acircumflexsmall",
- "Atildesmall",
- "Adieresissmall",
- "Aringsmall",
- "AEsmall",
- "Ccedillasmall",
- "Egravesmall",
- "Eacutesmall",
- "Ecircumflexsmall",
- "Edieresissmall",
- "Igravesmall",
- "Iacutesmall",
- "Icircumflexsmall",
- "Idieresissmall",
- "Ethsmall",
- "Ntildesmall",
- "Ogravesmall",
- "Oacutesmall",
- "Ocircumflexsmall",
- "Otildesmall",
- "Odieresissmall",
- "OEsmall",
- "Oslashsmall",
- "Ugravesmall",
- "Uacutesmall",
- "Ucircumflexsmall",
- "Udieresissmall",
- "Yacutesmall",
- "Thornsmall",
- "Ydieresissmall"
-};
-
-char *symbolEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclam",
- "universal",
- "numbersign",
- "existential",
- "percent",
- "ampersand",
- "suchthat",
- "parenleft",
- "parenright",
- "asteriskmath",
- "plus",
- "comma",
- "minus",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "congruent",
- "Alpha",
- "Beta",
- "Chi",
- "Delta",
- "Epsilon",
- "Phi",
- "Gamma",
- "Eta",
- "Iota",
- "theta1",
- "Kappa",
- "Lambda",
- "Mu",
- "Nu",
- "Omicron",
- "Pi",
- "Theta",
- "Rho",
- "Sigma",
- "Tau",
- "Upsilon",
- "sigma1",
- "Omega",
- "Xi",
- "Psi",
- "Zeta",
- "bracketleft",
- "therefore",
- "bracketright",
- "perpendicular",
- "underscore",
- "radicalex",
- "alpha",
- "beta",
- "chi",
- "delta",
- "epsilon",
- "phi",
- "gamma",
- "eta",
- "iota",
- "phi1",
- "kappa",
- "lambda",
- "mu",
- "nu",
- "omicron",
- "pi",
- "theta",
- "rho",
- "sigma",
- "tau",
- "upsilon",
- "omega1",
- "omega",
- "xi",
- "psi",
- "zeta",
- "braceleft",
- "bar",
- "braceright",
- "similar",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Upsilon1",
- "minute",
- "lessequal",
- "fraction",
- "infinity",
- "florin",
- "club",
- "diamond",
- "heart",
- "spade",
- "arrowboth",
- "arrowleft",
- "arrowup",
- "arrowright",
- "arrowdown",
- "degree",
- "plusminus",
- "second",
- "greaterequal",
- "multiply",
- "proportional",
- "partialdiff",
- "bullet",
- "divide",
- "notequal",
- "equivalence",
- "approxequal",
- "ellipsis",
- "arrowvertex",
- "arrowhorizex",
- "carriagereturn",
- "aleph",
- "Ifraktur",
- "Rfraktur",
- "weierstrass",
- "circlemultiply",
- "circleplus",
- "emptyset",
- "intersection",
- "union",
- "propersuperset",
- "reflexsuperset",
- "notsubset",
- "propersubset",
- "reflexsubset",
- "element",
- "notelement",
- "angle",
- "gradient",
- "registerserif",
- "copyrightserif",
- "trademarkserif",
- "product",
- "radical",
- "dotmath",
- "logicalnot",
- "logicaland",
- "logicalor",
- "arrowdblboth",
- "arrowdblleft",
- "arrowdblup",
- "arrowdblright",
- "arrowdbldown",
- "lozenge",
- "angleleft",
- "registersans",
- "copyrightsans",
- "trademarksans",
- "summation",
- "parenlefttp",
- "parenleftex",
- "parenleftbt",
- "bracketlefttp",
- "bracketleftex",
- "bracketleftbt",
- "bracelefttp",
- "braceleftmid",
- "braceleftbt",
- "braceex",
- NULL,
- "angleright",
- "integral",
- "integraltp",
- "integralex",
- "integralbt",
- "parenrighttp",
- "parenrightex",
- "parenrightbt",
- "bracketrighttp",
- "bracketrightex",
- "bracketrightbt",
- "bracerighttp",
- "bracerightmid",
- "bracerightbt",
- NULL
-};
-
-char *zapfDingbatsEncoding[256] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "a1",
- "a2",
- "a202",
- "a3",
- "a4",
- "a5",
- "a119",
- "a118",
- "a117",
- "a11",
- "a12",
- "a13",
- "a14",
- "a15",
- "a16",
- "a105",
- "a17",
- "a18",
- "a19",
- "a20",
- "a21",
- "a22",
- "a23",
- "a24",
- "a25",
- "a26",
- "a27",
- "a28",
- "a6",
- "a7",
- "a8",
- "a9",
- "a10",
- "a29",
- "a30",
- "a31",
- "a32",
- "a33",
- "a34",
- "a35",
- "a36",
- "a37",
- "a38",
- "a39",
- "a40",
- "a41",
- "a42",
- "a43",
- "a44",
- "a45",
- "a46",
- "a47",
- "a48",
- "a49",
- "a50",
- "a51",
- "a52",
- "a53",
- "a54",
- "a55",
- "a56",
- "a57",
- "a58",
- "a59",
- "a60",
- "a61",
- "a62",
- "a63",
- "a64",
- "a65",
- "a66",
- "a67",
- "a68",
- "a69",
- "a70",
- "a71",
- "a72",
- "a73",
- "a74",
- "a203",
- "a75",
- "a204",
- "a76",
- "a77",
- "a78",
- "a79",
- "a81",
- "a82",
- "a83",
- "a84",
- "a97",
- "a98",
- "a99",
- "a100",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "a101",
- "a102",
- "a103",
- "a104",
- "a106",
- "a107",
- "a108",
- "a112",
- "a111",
- "a110",
- "a109",
- "a120",
- "a121",
- "a122",
- "a123",
- "a124",
- "a125",
- "a126",
- "a127",
- "a128",
- "a129",
- "a130",
- "a131",
- "a132",
- "a133",
- "a134",
- "a135",
- "a136",
- "a137",
- "a138",
- "a139",
- "a140",
- "a141",
- "a142",
- "a143",
- "a144",
- "a145",
- "a146",
- "a147",
- "a148",
- "a149",
- "a150",
- "a151",
- "a152",
- "a153",
- "a154",
- "a155",
- "a156",
- "a157",
- "a158",
- "a159",
- "a160",
- "a161",
- "a163",
- "a164",
- "a196",
- "a165",
- "a192",
- "a166",
- "a167",
- "a168",
- "a169",
- "a170",
- "a171",
- "a172",
- "a173",
- "a162",
- "a174",
- "a175",
- "a176",
- "a177",
- "a178",
- "a179",
- "a193",
- "a180",
- "a199",
- "a181",
- "a200",
- "a182",
- NULL,
- "a201",
- "a183",
- "a184",
- "a197",
- "a185",
- "a194",
- "a198",
- "a186",
- "a195",
- "a187",
- "a188",
- "a189",
- "a190",
- "a191",
- NULL
-};
diff --git a/kpdf/xpdf/xpdf/FontEncodingTables.cpp b/kpdf/xpdf/xpdf/FontEncodingTables.cpp
new file mode 100644
index 00000000..4cd1affe
--- /dev/null
+++ b/kpdf/xpdf/xpdf/FontEncodingTables.cpp
@@ -0,0 +1,1824 @@
+//========================================================================
+//
+// FontEncodingTables.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+#include <stdlib.h>
+#include "FontEncodingTables.h"
+
+char *macRomanEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quotesingle",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "grave",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ "Adieresis",
+ "Aring",
+ "Ccedilla",
+ "Eacute",
+ "Ntilde",
+ "Odieresis",
+ "Udieresis",
+ "aacute",
+ "agrave",
+ "acircumflex",
+ "adieresis",
+ "atilde",
+ "aring",
+ "ccedilla",
+ "eacute",
+ "egrave",
+ "ecircumflex",
+ "edieresis",
+ "iacute",
+ "igrave",
+ "icircumflex",
+ "idieresis",
+ "ntilde",
+ "oacute",
+ "ograve",
+ "ocircumflex",
+ "odieresis",
+ "otilde",
+ "uacute",
+ "ugrave",
+ "ucircumflex",
+ "udieresis",
+ "dagger",
+ "degree",
+ "cent",
+ "sterling",
+ "section",
+ "bullet",
+ "paragraph",
+ "germandbls",
+ "registered",
+ "copyright",
+ "trademark",
+ "acute",
+ "dieresis",
+ "notequal",
+ "AE",
+ "Oslash",
+ "infinity",
+ "plusminus",
+ "lessequal",
+ "greaterequal",
+ "yen",
+ "mu",
+ "partialdiff",
+ "summation",
+ "product",
+ "pi",
+ "integral",
+ "ordfeminine",
+ "ordmasculine",
+ "Omega",
+ "ae",
+ "oslash",
+ "questiondown",
+ "exclamdown",
+ "logicalnot",
+ "radical",
+ "florin",
+ "approxequal",
+ "Delta",
+ "guillemotleft",
+ "guillemotright",
+ "ellipsis",
+ "space",
+ "Agrave",
+ "Atilde",
+ "Otilde",
+ "OE",
+ "oe",
+ "endash",
+ "emdash",
+ "quotedblleft",
+ "quotedblright",
+ "quoteleft",
+ "quoteright",
+ "divide",
+ "lozenge",
+ "ydieresis",
+ "Ydieresis",
+ "fraction",
+ "currency",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ "daggerdbl",
+ "periodcentered",
+ "quotesinglbase",
+ "quotedblbase",
+ "perthousand",
+ "Acircumflex",
+ "Ecircumflex",
+ "Aacute",
+ "Edieresis",
+ "Egrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Igrave",
+ "Oacute",
+ "Ocircumflex",
+ "apple",
+ "Ograve",
+ "Uacute",
+ "Ucircumflex",
+ "Ugrave",
+ "dotlessi",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "ring",
+ "cedilla",
+ "hungarumlaut",
+ "ogonek",
+ "caron"
+};
+
+char *macExpertEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclamsmall",
+ "Hungarumlautsmall",
+ "centoldstyle",
+ "dollaroldstyle",
+ "dollarsuperior",
+ "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior",
+ "parenrightsuperior",
+ "twodotenleader",
+ "onedotenleader",
+ "comma",
+ "hyphen",
+ "period",
+ "fraction",
+ "zerooldstyle",
+ "oneoldstyle",
+ "twooldstyle",
+ "threeoldstyle",
+ "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle",
+ "sevenoldstyle",
+ "eightoldstyle",
+ "nineoldstyle",
+ "colon",
+ "semicolon",
+ NULL,
+ "threequartersemdash",
+ NULL,
+ "questionsmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Ethsmall",
+ NULL,
+ NULL,
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ "onethird",
+ "twothirds",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ff",
+ "fi",
+ "fl",
+ "ffi",
+ "ffl",
+ "parenleftinferior",
+ NULL,
+ "parenrightinferior",
+ "Circumflexsmall",
+ "hypheninferior",
+ "Gravesmall",
+ "Asmall",
+ "Bsmall",
+ "Csmall",
+ "Dsmall",
+ "Esmall",
+ "Fsmall",
+ "Gsmall",
+ "Hsmall",
+ "Ismall",
+ "Jsmall",
+ "Ksmall",
+ "Lsmall",
+ "Msmall",
+ "Nsmall",
+ "Osmall",
+ "Psmall",
+ "Qsmall",
+ "Rsmall",
+ "Ssmall",
+ "Tsmall",
+ "Usmall",
+ "Vsmall",
+ "Wsmall",
+ "Xsmall",
+ "Ysmall",
+ "Zsmall",
+ "colonmonetary",
+ "onefitted",
+ "rupiah",
+ "Tildesmall",
+ NULL,
+ NULL,
+ "asuperior",
+ "centsuperior",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Aacutesmall",
+ "Agravesmall",
+ "Acircumflexsmall",
+ "Adieresissmall",
+ "Atildesmall",
+ "Aringsmall",
+ "Ccedillasmall",
+ "Eacutesmall",
+ "Egravesmall",
+ "Ecircumflexsmall",
+ "Edieresissmall",
+ "Iacutesmall",
+ "Igravesmall",
+ "Icircumflexsmall",
+ "Idieresissmall",
+ "Ntildesmall",
+ "Oacutesmall",
+ "Ogravesmall",
+ "Ocircumflexsmall",
+ "Odieresissmall",
+ "Otildesmall",
+ "Uacutesmall",
+ "Ugravesmall",
+ "Ucircumflexsmall",
+ "Udieresissmall",
+ NULL,
+ "eightsuperior",
+ "fourinferior",
+ "threeinferior",
+ "sixinferior",
+ "eightinferior",
+ "seveninferior",
+ "Scaronsmall",
+ NULL,
+ "centinferior",
+ "twoinferior",
+ NULL,
+ "Dieresissmall",
+ NULL,
+ "Caronsmall",
+ "osuperior",
+ "fiveinferior",
+ NULL,
+ "commainferior",
+ "periodinferior",
+ "Yacutesmall",
+ NULL,
+ "dollarinferior",
+ NULL,
+ NULL,
+ "Thornsmall",
+ NULL,
+ "nineinferior",
+ "zeroinferior",
+ "Zcaronsmall",
+ "AEsmall",
+ "Oslashsmall",
+ "questiondownsmall",
+ "oneinferior",
+ "Lslashsmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Cedillasmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "OEsmall",
+ "figuredash",
+ "hyphensuperior",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdownsmall",
+ NULL,
+ "Ydieresissmall",
+ NULL,
+ "onesuperior",
+ "twosuperior",
+ "threesuperior",
+ "foursuperior",
+ "fivesuperior",
+ "sixsuperior",
+ "sevensuperior",
+ "ninesuperior",
+ "zerosuperior",
+ NULL,
+ "esuperior",
+ "rsuperior",
+ "tsuperior",
+ NULL,
+ NULL,
+ "isuperior",
+ "ssuperior",
+ "dsuperior",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "lsuperior",
+ "Ogoneksmall",
+ "Brevesmall",
+ "Macronsmall",
+ "bsuperior",
+ "nsuperior",
+ "msuperior",
+ "commasuperior",
+ "periodsuperior",
+ "Dotaccentsmall",
+ "Ringsmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+char *winAnsiEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quotesingle",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "grave",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ "bullet",
+ "Euro",
+ "bullet",
+ "quotesinglbase",
+ "florin",
+ "quotedblbase",
+ "ellipsis",
+ "dagger",
+ "daggerdbl",
+ "circumflex",
+ "perthousand",
+ "Scaron",
+ "guilsinglleft",
+ "OE",
+ "bullet",
+ "Zcaron",
+ "bullet",
+ "bullet",
+ "quoteleft",
+ "quoteright",
+ "quotedblleft",
+ "quotedblright",
+ "bullet",
+ "endash",
+ "emdash",
+ "tilde",
+ "trademark",
+ "scaron",
+ "guilsinglright",
+ "oe",
+ "bullet",
+ "zcaron",
+ "Ydieresis",
+ "space",
+ "exclamdown",
+ "cent",
+ "sterling",
+ "currency",
+ "yen",
+ "brokenbar",
+ "section",
+ "dieresis",
+ "copyright",
+ "ordfeminine",
+ "guillemotleft",
+ "logicalnot",
+ "hyphen",
+ "registered",
+ "macron",
+ "degree",
+ "plusminus",
+ "twosuperior",
+ "threesuperior",
+ "acute",
+ "mu",
+ "paragraph",
+ "periodcentered",
+ "cedilla",
+ "onesuperior",
+ "ordmasculine",
+ "guillemotright",
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "questiondown",
+ "Agrave",
+ "Aacute",
+ "Acircumflex",
+ "Atilde",
+ "Adieresis",
+ "Aring",
+ "AE",
+ "Ccedilla",
+ "Egrave",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Igrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Eth",
+ "Ntilde",
+ "Ograve",
+ "Oacute",
+ "Ocircumflex",
+ "Otilde",
+ "Odieresis",
+ "multiply",
+ "Oslash",
+ "Ugrave",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Yacute",
+ "Thorn",
+ "germandbls",
+ "agrave",
+ "aacute",
+ "acircumflex",
+ "atilde",
+ "adieresis",
+ "aring",
+ "ae",
+ "ccedilla",
+ "egrave",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "igrave",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "eth",
+ "ntilde",
+ "ograve",
+ "oacute",
+ "ocircumflex",
+ "otilde",
+ "odieresis",
+ "divide",
+ "oslash",
+ "ugrave",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "yacute",
+ "thorn",
+ "ydieresis"
+};
+
+char *standardEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quoteright",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "quoteleft",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdown",
+ "cent",
+ "sterling",
+ "fraction",
+ "yen",
+ "florin",
+ "section",
+ "currency",
+ "quotesingle",
+ "quotedblleft",
+ "guillemotleft",
+ "guilsinglleft",
+ "guilsinglright",
+ "fi",
+ "fl",
+ NULL,
+ "endash",
+ "dagger",
+ "daggerdbl",
+ "periodcentered",
+ NULL,
+ "paragraph",
+ "bullet",
+ "quotesinglbase",
+ "quotedblbase",
+ "quotedblright",
+ "guillemotright",
+ "ellipsis",
+ "perthousand",
+ NULL,
+ "questiondown",
+ NULL,
+ "grave",
+ "acute",
+ "circumflex",
+ "tilde",
+ "macron",
+ "breve",
+ "dotaccent",
+ "dieresis",
+ NULL,
+ "ring",
+ "cedilla",
+ NULL,
+ "hungarumlaut",
+ "ogonek",
+ "caron",
+ "emdash",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "AE",
+ NULL,
+ "ordfeminine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Lslash",
+ "Oslash",
+ "OE",
+ "ordmasculine",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ae",
+ NULL,
+ NULL,
+ NULL,
+ "dotlessi",
+ NULL,
+ NULL,
+ "lslash",
+ "oslash",
+ "oe",
+ "germandbls",
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+char *expertEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclamsmall",
+ "Hungarumlautsmall",
+ NULL,
+ "dollaroldstyle",
+ "dollarsuperior",
+ "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior",
+ "parenrightsuperior",
+ "twodotenleader",
+ "onedotenleader",
+ "comma",
+ "hyphen",
+ "period",
+ "fraction",
+ "zerooldstyle",
+ "oneoldstyle",
+ "twooldstyle",
+ "threeoldstyle",
+ "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle",
+ "sevenoldstyle",
+ "eightoldstyle",
+ "nineoldstyle",
+ "colon",
+ "semicolon",
+ "commasuperior",
+ "threequartersemdash",
+ "periodsuperior",
+ "questionsmall",
+ NULL,
+ "asuperior",
+ "bsuperior",
+ "centsuperior",
+ "dsuperior",
+ "esuperior",
+ NULL,
+ NULL,
+ NULL,
+ "isuperior",
+ NULL,
+ NULL,
+ "lsuperior",
+ "msuperior",
+ "nsuperior",
+ "osuperior",
+ NULL,
+ NULL,
+ "rsuperior",
+ "ssuperior",
+ "tsuperior",
+ NULL,
+ "ff",
+ "fi",
+ "fl",
+ "ffi",
+ "ffl",
+ "parenleftinferior",
+ NULL,
+ "parenrightinferior",
+ "Circumflexsmall",
+ "hyphensuperior",
+ "Gravesmall",
+ "Asmall",
+ "Bsmall",
+ "Csmall",
+ "Dsmall",
+ "Esmall",
+ "Fsmall",
+ "Gsmall",
+ "Hsmall",
+ "Ismall",
+ "Jsmall",
+ "Ksmall",
+ "Lsmall",
+ "Msmall",
+ "Nsmall",
+ "Osmall",
+ "Psmall",
+ "Qsmall",
+ "Rsmall",
+ "Ssmall",
+ "Tsmall",
+ "Usmall",
+ "Vsmall",
+ "Wsmall",
+ "Xsmall",
+ "Ysmall",
+ "Zsmall",
+ "colonmonetary",
+ "onefitted",
+ "rupiah",
+ "Tildesmall",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdownsmall",
+ "centoldstyle",
+ "Lslashsmall",
+ NULL,
+ NULL,
+ "Scaronsmall",
+ "Zcaronsmall",
+ "Dieresissmall",
+ "Brevesmall",
+ "Caronsmall",
+ NULL,
+ "Dotaccentsmall",
+ NULL,
+ NULL,
+ "Macronsmall",
+ NULL,
+ NULL,
+ "figuredash",
+ "hypheninferior",
+ NULL,
+ NULL,
+ "Ogoneksmall",
+ "Ringsmall",
+ "Cedillasmall",
+ NULL,
+ NULL,
+ NULL,
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "questiondownsmall",
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ "onethird",
+ "twothirds",
+ NULL,
+ NULL,
+ "zerosuperior",
+ "onesuperior",
+ "twosuperior",
+ "threesuperior",
+ "foursuperior",
+ "fivesuperior",
+ "sixsuperior",
+ "sevensuperior",
+ "eightsuperior",
+ "ninesuperior",
+ "zeroinferior",
+ "oneinferior",
+ "twoinferior",
+ "threeinferior",
+ "fourinferior",
+ "fiveinferior",
+ "sixinferior",
+ "seveninferior",
+ "eightinferior",
+ "nineinferior",
+ "centinferior",
+ "dollarinferior",
+ "periodinferior",
+ "commainferior",
+ "Agravesmall",
+ "Aacutesmall",
+ "Acircumflexsmall",
+ "Atildesmall",
+ "Adieresissmall",
+ "Aringsmall",
+ "AEsmall",
+ "Ccedillasmall",
+ "Egravesmall",
+ "Eacutesmall",
+ "Ecircumflexsmall",
+ "Edieresissmall",
+ "Igravesmall",
+ "Iacutesmall",
+ "Icircumflexsmall",
+ "Idieresissmall",
+ "Ethsmall",
+ "Ntildesmall",
+ "Ogravesmall",
+ "Oacutesmall",
+ "Ocircumflexsmall",
+ "Otildesmall",
+ "Odieresissmall",
+ "OEsmall",
+ "Oslashsmall",
+ "Ugravesmall",
+ "Uacutesmall",
+ "Ucircumflexsmall",
+ "Udieresissmall",
+ "Yacutesmall",
+ "Thornsmall",
+ "Ydieresissmall"
+};
+
+char *symbolEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "universal",
+ "numbersign",
+ "existential",
+ "percent",
+ "ampersand",
+ "suchthat",
+ "parenleft",
+ "parenright",
+ "asteriskmath",
+ "plus",
+ "comma",
+ "minus",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "congruent",
+ "Alpha",
+ "Beta",
+ "Chi",
+ "Delta",
+ "Epsilon",
+ "Phi",
+ "Gamma",
+ "Eta",
+ "Iota",
+ "theta1",
+ "Kappa",
+ "Lambda",
+ "Mu",
+ "Nu",
+ "Omicron",
+ "Pi",
+ "Theta",
+ "Rho",
+ "Sigma",
+ "Tau",
+ "Upsilon",
+ "sigma1",
+ "Omega",
+ "Xi",
+ "Psi",
+ "Zeta",
+ "bracketleft",
+ "therefore",
+ "bracketright",
+ "perpendicular",
+ "underscore",
+ "radicalex",
+ "alpha",
+ "beta",
+ "chi",
+ "delta",
+ "epsilon",
+ "phi",
+ "gamma",
+ "eta",
+ "iota",
+ "phi1",
+ "kappa",
+ "lambda",
+ "mu",
+ "nu",
+ "omicron",
+ "pi",
+ "theta",
+ "rho",
+ "sigma",
+ "tau",
+ "upsilon",
+ "omega1",
+ "omega",
+ "xi",
+ "psi",
+ "zeta",
+ "braceleft",
+ "bar",
+ "braceright",
+ "similar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Upsilon1",
+ "minute",
+ "lessequal",
+ "fraction",
+ "infinity",
+ "florin",
+ "club",
+ "diamond",
+ "heart",
+ "spade",
+ "arrowboth",
+ "arrowleft",
+ "arrowup",
+ "arrowright",
+ "arrowdown",
+ "degree",
+ "plusminus",
+ "second",
+ "greaterequal",
+ "multiply",
+ "proportional",
+ "partialdiff",
+ "bullet",
+ "divide",
+ "notequal",
+ "equivalence",
+ "approxequal",
+ "ellipsis",
+ "arrowvertex",
+ "arrowhorizex",
+ "carriagereturn",
+ "aleph",
+ "Ifraktur",
+ "Rfraktur",
+ "weierstrass",
+ "circlemultiply",
+ "circleplus",
+ "emptyset",
+ "intersection",
+ "union",
+ "propersuperset",
+ "reflexsuperset",
+ "notsubset",
+ "propersubset",
+ "reflexsubset",
+ "element",
+ "notelement",
+ "angle",
+ "gradient",
+ "registerserif",
+ "copyrightserif",
+ "trademarkserif",
+ "product",
+ "radical",
+ "dotmath",
+ "logicalnot",
+ "logicaland",
+ "logicalor",
+ "arrowdblboth",
+ "arrowdblleft",
+ "arrowdblup",
+ "arrowdblright",
+ "arrowdbldown",
+ "lozenge",
+ "angleleft",
+ "registersans",
+ "copyrightsans",
+ "trademarksans",
+ "summation",
+ "parenlefttp",
+ "parenleftex",
+ "parenleftbt",
+ "bracketlefttp",
+ "bracketleftex",
+ "bracketleftbt",
+ "bracelefttp",
+ "braceleftmid",
+ "braceleftbt",
+ "braceex",
+ NULL,
+ "angleright",
+ "integral",
+ "integraltp",
+ "integralex",
+ "integralbt",
+ "parenrighttp",
+ "parenrightex",
+ "parenrightbt",
+ "bracketrighttp",
+ "bracketrightex",
+ "bracketrightbt",
+ "bracerighttp",
+ "bracerightmid",
+ "bracerightbt",
+ NULL
+};
+
+char *zapfDingbatsEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "a1",
+ "a2",
+ "a202",
+ "a3",
+ "a4",
+ "a5",
+ "a119",
+ "a118",
+ "a117",
+ "a11",
+ "a12",
+ "a13",
+ "a14",
+ "a15",
+ "a16",
+ "a105",
+ "a17",
+ "a18",
+ "a19",
+ "a20",
+ "a21",
+ "a22",
+ "a23",
+ "a24",
+ "a25",
+ "a26",
+ "a27",
+ "a28",
+ "a6",
+ "a7",
+ "a8",
+ "a9",
+ "a10",
+ "a29",
+ "a30",
+ "a31",
+ "a32",
+ "a33",
+ "a34",
+ "a35",
+ "a36",
+ "a37",
+ "a38",
+ "a39",
+ "a40",
+ "a41",
+ "a42",
+ "a43",
+ "a44",
+ "a45",
+ "a46",
+ "a47",
+ "a48",
+ "a49",
+ "a50",
+ "a51",
+ "a52",
+ "a53",
+ "a54",
+ "a55",
+ "a56",
+ "a57",
+ "a58",
+ "a59",
+ "a60",
+ "a61",
+ "a62",
+ "a63",
+ "a64",
+ "a65",
+ "a66",
+ "a67",
+ "a68",
+ "a69",
+ "a70",
+ "a71",
+ "a72",
+ "a73",
+ "a74",
+ "a203",
+ "a75",
+ "a204",
+ "a76",
+ "a77",
+ "a78",
+ "a79",
+ "a81",
+ "a82",
+ "a83",
+ "a84",
+ "a97",
+ "a98",
+ "a99",
+ "a100",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "a101",
+ "a102",
+ "a103",
+ "a104",
+ "a106",
+ "a107",
+ "a108",
+ "a112",
+ "a111",
+ "a110",
+ "a109",
+ "a120",
+ "a121",
+ "a122",
+ "a123",
+ "a124",
+ "a125",
+ "a126",
+ "a127",
+ "a128",
+ "a129",
+ "a130",
+ "a131",
+ "a132",
+ "a133",
+ "a134",
+ "a135",
+ "a136",
+ "a137",
+ "a138",
+ "a139",
+ "a140",
+ "a141",
+ "a142",
+ "a143",
+ "a144",
+ "a145",
+ "a146",
+ "a147",
+ "a148",
+ "a149",
+ "a150",
+ "a151",
+ "a152",
+ "a153",
+ "a154",
+ "a155",
+ "a156",
+ "a157",
+ "a158",
+ "a159",
+ "a160",
+ "a161",
+ "a163",
+ "a164",
+ "a196",
+ "a165",
+ "a192",
+ "a166",
+ "a167",
+ "a168",
+ "a169",
+ "a170",
+ "a171",
+ "a172",
+ "a173",
+ "a162",
+ "a174",
+ "a175",
+ "a176",
+ "a177",
+ "a178",
+ "a179",
+ "a193",
+ "a180",
+ "a199",
+ "a181",
+ "a200",
+ "a182",
+ NULL,
+ "a201",
+ "a183",
+ "a184",
+ "a197",
+ "a185",
+ "a194",
+ "a198",
+ "a186",
+ "a195",
+ "a187",
+ "a188",
+ "a189",
+ "a190",
+ "a191",
+ NULL
+};
diff --git a/kpdf/xpdf/xpdf/Function.cc b/kpdf/xpdf/xpdf/Function.cc
deleted file mode 100644
index eaf8e974..00000000
--- a/kpdf/xpdf/xpdf/Function.cc
+++ /dev/null
@@ -1,1575 +0,0 @@
-//========================================================================
-//
-// Function.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-#include "gmem.h"
-#include "Object.h"
-#include "Dict.h"
-#include "Stream.h"
-#include "Error.h"
-#include "Function.h"
-
-//------------------------------------------------------------------------
-// Function
-//------------------------------------------------------------------------
-
-Function::Function() {
-}
-
-Function::~Function() {
-}
-
-Function *Function::parse(Object *funcObj) {
- Function *func;
- Dict *dict;
- int funcType;
- Object obj1;
-
- if (funcObj->isStream()) {
- dict = funcObj->streamGetDict();
- } else if (funcObj->isDict()) {
- dict = funcObj->getDict();
- } else if (funcObj->isName("Identity")) {
- return new IdentityFunction();
- } else {
- error(-1, "Expected function dictionary or stream");
- return NULL;
- }
-
- if (!dict->lookup("FunctionType", &obj1)->isInt()) {
- error(-1, "Function type is missing or wrong type");
- obj1.free();
- return NULL;
- }
- funcType = obj1.getInt();
- obj1.free();
-
- if (funcType == 0) {
- func = new SampledFunction(funcObj, dict);
- } else if (funcType == 2) {
- func = new ExponentialFunction(funcObj, dict);
- } else if (funcType == 3) {
- func = new StitchingFunction(funcObj, dict);
- } else if (funcType == 4) {
- func = new PostScriptFunction(funcObj, dict);
- } else {
- error(-1, "Unimplemented function type (%d)", funcType);
- return NULL;
- }
- if (!func->isOk()) {
- delete func;
- return NULL;
- }
-
- return func;
-}
-
-GBool Function::init(Dict *dict) {
- Object obj1, obj2;
- int i;
-
- //----- Domain
- if (!dict->lookup("Domain", &obj1)->isArray()) {
- error(-1, "Function is missing domain");
- goto err2;
- }
- m = obj1.arrayGetLength() / 2;
- if (m > funcMaxInputs) {
- error(-1, "Functions with more than %d inputs are unsupported",
- funcMaxInputs);
- goto err2;
- }
- for (i = 0; i < m; ++i) {
- obj1.arrayGet(2*i, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function domain array");
- goto err1;
- }
- domain[i][0] = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2*i+1, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function domain array");
- goto err1;
- }
- domain[i][1] = obj2.getNum();
- obj2.free();
- }
- obj1.free();
-
- //----- Range
- hasRange = gFalse;
- n = 0;
- if (dict->lookup("Range", &obj1)->isArray()) {
- hasRange = gTrue;
- n = obj1.arrayGetLength() / 2;
- if (n > funcMaxOutputs) {
- error(-1, "Functions with more than %d outputs are unsupported",
- funcMaxOutputs);
- goto err2;
- }
- for (i = 0; i < n; ++i) {
- obj1.arrayGet(2*i, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function range array");
- goto err1;
- }
- range[i][0] = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2*i+1, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function range array");
- goto err1;
- }
- range[i][1] = obj2.getNum();
- obj2.free();
- }
- }
- obj1.free();
-
- return gTrue;
-
- err1:
- obj2.free();
- err2:
- obj1.free();
- return gFalse;
-}
-
-//------------------------------------------------------------------------
-// IdentityFunction
-//------------------------------------------------------------------------
-
-IdentityFunction::IdentityFunction() {
- int i;
-
- // fill these in with arbitrary values just in case they get used
- // somewhere
- m = funcMaxInputs;
- n = funcMaxOutputs;
- for (i = 0; i < funcMaxInputs; ++i) {
- domain[i][0] = 0;
- domain[i][1] = 1;
- }
- hasRange = gFalse;
-}
-
-IdentityFunction::~IdentityFunction() {
-}
-
-void IdentityFunction::transform(double *in, double *out) {
- int i;
-
- for (i = 0; i < funcMaxOutputs; ++i) {
- out[i] = in[i];
- }
-}
-
-//------------------------------------------------------------------------
-// SampledFunction
-//------------------------------------------------------------------------
-
-SampledFunction::SampledFunction(Object *funcObj, Dict *dict) {
- Stream *str;
- int sampleBits;
- double sampleMul;
- Object obj1, obj2;
- Guint buf, bitMask;
- int bits;
- Guint s;
- int i;
-
- samples = NULL;
- sBuf = NULL;
- ok = gFalse;
-
- //----- initialize the generic stuff
- if (!init(dict)) {
- goto err1;
- }
- if (!hasRange) {
- error(-1, "Type 0 function is missing range");
- goto err1;
- }
- if (m > sampledFuncMaxInputs) {
- error(-1, "Sampled functions with more than %d inputs are unsupported",
- sampledFuncMaxInputs);
- goto err1;
- }
-
- //----- buffer
- sBuf = (double *)gmallocn(1 << m, sizeof(double));
-
- //----- get the stream
- if (!funcObj->isStream()) {
- error(-1, "Type 0 function isn't a stream");
- goto err1;
- }
- str = funcObj->getStream();
-
- //----- Size
- if (!dict->lookup("Size", &obj1)->isArray() ||
- obj1.arrayGetLength() != m) {
- error(-1, "Function has missing or invalid size array");
- goto err2;
- }
- for (i = 0; i < m; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!obj2.isInt()) {
- error(-1, "Illegal value in function size array");
- goto err3;
- }
- sampleSize[i] = obj2.getInt();
- obj2.free();
- }
- obj1.free();
- idxMul[0] = n;
- for (i = 1; i < m; ++i) {
- idxMul[i] = idxMul[i-1] * sampleSize[i-1];
- }
-
- //----- BitsPerSample
- if (!dict->lookup("BitsPerSample", &obj1)->isInt()) {
- error(-1, "Function has missing or invalid BitsPerSample");
- goto err2;
- }
- sampleBits = obj1.getInt();
- sampleMul = 1.0 / (pow(2.0, (double)sampleBits) - 1);
- obj1.free();
-
- //----- Encode
- if (dict->lookup("Encode", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2*m) {
- for (i = 0; i < m; ++i) {
- obj1.arrayGet(2*i, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function encode array");
- goto err3;
- }
- encode[i][0] = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2*i+1, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function encode array");
- goto err3;
- }
- encode[i][1] = obj2.getNum();
- obj2.free();
- }
- } else {
- for (i = 0; i < m; ++i) {
- encode[i][0] = 0;
- encode[i][1] = sampleSize[i] - 1;
- }
- }
- obj1.free();
- for (i = 0; i < m; ++i) {
- inputMul[i] = (encode[i][1] - encode[i][0]) /
- (domain[i][1] - domain[i][0]);
- }
-
- //----- Decode
- if (dict->lookup("Decode", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2*n) {
- for (i = 0; i < n; ++i) {
- obj1.arrayGet(2*i, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function decode array");
- goto err3;
- }
- decode[i][0] = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2*i+1, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function decode array");
- goto err3;
- }
- decode[i][1] = obj2.getNum();
- obj2.free();
- }
- } else {
- for (i = 0; i < n; ++i) {
- decode[i][0] = range[i][0];
- decode[i][1] = range[i][1];
- }
- }
- obj1.free();
-
- //----- samples
- nSamples = n;
- for (i = 0; i < m; ++i)
- nSamples *= sampleSize[i];
- samples = (double *)gmallocn(nSamples, sizeof(double));
- buf = 0;
- bits = 0;
- bitMask = (1 << sampleBits) - 1;
- str->reset();
- for (i = 0; i < nSamples; ++i) {
- if (sampleBits == 8) {
- s = str->getChar();
- } else if (sampleBits == 16) {
- s = str->getChar();
- s = (s << 8) + str->getChar();
- } else if (sampleBits == 32) {
- s = str->getChar();
- s = (s << 8) + str->getChar();
- s = (s << 8) + str->getChar();
- s = (s << 8) + str->getChar();
- } else {
- while (bits < sampleBits) {
- buf = (buf << 8) | (str->getChar() & 0xff);
- bits += 8;
- }
- s = (buf >> (bits - sampleBits)) & bitMask;
- bits -= sampleBits;
- }
- samples[i] = (double)s * sampleMul;
- }
- str->close();
-
- ok = gTrue;
- return;
-
- err3:
- obj2.free();
- err2:
- obj1.free();
- err1:
- return;
-}
-
-SampledFunction::~SampledFunction() {
- if (samples) {
- gfree(samples);
- }
- if (sBuf) {
- gfree(sBuf);
- }
-}
-
-SampledFunction::SampledFunction(SampledFunction *func) {
- memcpy(this, func, sizeof(SampledFunction));
- samples = (double *)gmallocn(nSamples, sizeof(double));
- memcpy(samples, func->samples, nSamples * sizeof(double));
- sBuf = (double *)gmallocn(1 << m, sizeof(double));
-}
-
-void SampledFunction::transform(double *in, double *out) {
- double x;
- int e[funcMaxInputs][2];
- double efrac0[funcMaxInputs];
- double efrac1[funcMaxInputs];
- int i, j, k, idx, t;
-
- // map input values into sample array
- for (i = 0; i < m; ++i) {
- x = (in[i] - domain[i][0]) * inputMul[i] + encode[i][0];
- if (x < 0) {
- x = 0;
- } else if (x > sampleSize[i] - 1) {
- x = sampleSize[i] - 1;
- }
- e[i][0] = (int)x;
- if ((e[i][1] = e[i][0] + 1) >= sampleSize[i]) {
- // this happens if in[i] = domain[i][1]
- e[i][1] = e[i][0];
- }
- efrac1[i] = x - e[i][0];
- efrac0[i] = 1 - efrac1[i];
- }
-
- // for each output, do m-linear interpolation
- for (i = 0; i < n; ++i) {
-
- // pull 2^m values out of the sample array
- for (j = 0; j < (1<<m); ++j) {
- idx = i;
- for (k = 0, t = j; k < m; ++k, t >>= 1) {
- idx += idxMul[k] * (e[k][t & 1]);
- }
- sBuf[j] = samples[idx];
- }
-
- // do m sets of interpolations
- for (j = 0, t = (1<<m); j < m; ++j, t >>= 1) {
- for (k = 0; k < t; k += 2) {
- sBuf[k >> 1] = efrac0[j] * sBuf[k] + efrac1[j] * sBuf[k+1];
- }
- }
-
- // map output value to range
- out[i] = sBuf[0] * (decode[i][1] - decode[i][0]) + decode[i][0];
- if (out[i] < range[i][0]) {
- out[i] = range[i][0];
- } else if (out[i] > range[i][1]) {
- out[i] = range[i][1];
- }
- }
-}
-
-//------------------------------------------------------------------------
-// ExponentialFunction
-//------------------------------------------------------------------------
-
-ExponentialFunction::ExponentialFunction(Object * /*funcObj*/, Dict *dict) {
- Object obj1, obj2;
- int i;
-
- ok = gFalse;
-
- //----- initialize the generic stuff
- if (!init(dict)) {
- goto err1;
- }
- if (m != 1) {
- error(-1, "Exponential function with more than one input");
- goto err1;
- }
-
- //----- C0
- if (dict->lookup("C0", &obj1)->isArray()) {
- if (hasRange && obj1.arrayGetLength() != n) {
- error(-1, "Function's C0 array is wrong length");
- goto err2;
- }
- n = obj1.arrayGetLength();
- for (i = 0; i < n; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function C0 array");
- goto err3;
- }
- c0[i] = obj2.getNum();
- obj2.free();
- }
- } else {
- if (hasRange && n != 1) {
- error(-1, "Function's C0 array is wrong length");
- goto err2;
- }
- n = 1;
- c0[0] = 0;
- }
- obj1.free();
-
- //----- C1
- if (dict->lookup("C1", &obj1)->isArray()) {
- if (obj1.arrayGetLength() != n) {
- error(-1, "Function's C1 array is wrong length");
- goto err2;
- }
- for (i = 0; i < n; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!obj2.isNum()) {
- error(-1, "Illegal value in function C1 array");
- goto err3;
- }
- c1[i] = obj2.getNum();
- obj2.free();
- }
- } else {
- if (n != 1) {
- error(-1, "Function's C1 array is wrong length");
- goto err2;
- }
- c1[0] = 1;
- }
- obj1.free();
-
- //----- N (exponent)
- if (!dict->lookup("N", &obj1)->isNum()) {
- error(-1, "Function has missing or invalid N");
- goto err2;
- }
- e = obj1.getNum();
- obj1.free();
-
- ok = gTrue;
- return;
-
- err3:
- obj2.free();
- err2:
- obj1.free();
- err1:
- return;
-}
-
-ExponentialFunction::~ExponentialFunction() {
-}
-
-ExponentialFunction::ExponentialFunction(ExponentialFunction *func) {
- memcpy(this, func, sizeof(ExponentialFunction));
-}
-
-void ExponentialFunction::transform(double *in, double *out) {
- double x;
- int i;
-
- if (in[0] < domain[0][0]) {
- x = domain[0][0];
- } else if (in[0] > domain[0][1]) {
- x = domain[0][1];
- } else {
- x = in[0];
- }
- for (i = 0; i < n; ++i) {
- out[i] = c0[i] + pow(x, e) * (c1[i] - c0[i]);
- if (hasRange) {
- if (out[i] < range[i][0]) {
- out[i] = range[i][0];
- } else if (out[i] > range[i][1]) {
- out[i] = range[i][1];
- }
- }
- }
- return;
-}
-
-//------------------------------------------------------------------------
-// StitchingFunction
-//------------------------------------------------------------------------
-
-StitchingFunction::StitchingFunction(Object * /*funcObj*/, Dict *dict) {
- Object obj1, obj2;
- int i;
-
- ok = gFalse;
- funcs = NULL;
- bounds = NULL;
- encode = NULL;
- scale = NULL;
-
- //----- initialize the generic stuff
- if (!init(dict)) {
- goto err1;
- }
- if (m != 1) {
- error(-1, "Stitching function with more than one input");
- goto err1;
- }
-
- //----- Functions
- if (!dict->lookup("Functions", &obj1)->isArray()) {
- error(-1, "Missing 'Functions' entry in stitching function");
- goto err1;
- }
- k = obj1.arrayGetLength();
- funcs = (Function **)gmallocn(k, sizeof(Function *));
- bounds = (double *)gmallocn(k + 1, sizeof(double));
- encode = (double *)gmallocn(2 * k, sizeof(double));
- scale = (double *)gmallocn(k, sizeof(double));
- for (i = 0; i < k; ++i) {
- funcs[i] = NULL;
- }
- for (i = 0; i < k; ++i) {
- if (!(funcs[i] = Function::parse(obj1.arrayGet(i, &obj2)))) {
- goto err2;
- }
- if (i > 0 && (funcs[i]->getInputSize() != 1 ||
- funcs[i]->getOutputSize() != funcs[0]->getOutputSize())) {
- error(-1, "Incompatible subfunctions in stitching function");
- goto err2;
- }
- obj2.free();
- }
- obj1.free();
-
- //----- Bounds
- if (!dict->lookup("Bounds", &obj1)->isArray() ||
- obj1.arrayGetLength() != k - 1) {
- error(-1, "Missing or invalid 'Bounds' entry in stitching function");
- goto err1;
- }
- bounds[0] = domain[0][0];
- for (i = 1; i < k; ++i) {
- if (!obj1.arrayGet(i - 1, &obj2)->isNum()) {
- error(-1, "Invalid type in 'Bounds' array in stitching function");
- goto err2;
- }
- bounds[i] = obj2.getNum();
- obj2.free();
- }
- bounds[k] = domain[0][1];
- obj1.free();
-
- //----- Encode
- if (!dict->lookup("Encode", &obj1)->isArray() ||
- obj1.arrayGetLength() != 2 * k) {
- error(-1, "Missing or invalid 'Encode' entry in stitching function");
- goto err1;
- }
- for (i = 0; i < 2 * k; ++i) {
- if (!obj1.arrayGet(i, &obj2)->isNum()) {
- error(-1, "Invalid type in 'Encode' array in stitching function");
- goto err2;
- }
- encode[i] = obj2.getNum();
- obj2.free();
- }
- obj1.free();
-
- //----- pre-compute the scale factors
- for (i = 0; i < k; ++i) {
- if (bounds[i] == bounds[i+1]) {
- // avoid a divide-by-zero -- in this situation, function i will
- // never be used anyway
- scale[i] = 0;
- } else {
- scale[i] = (encode[2*i+1] - encode[2*i]) / (bounds[i+1] - bounds[i]);
- }
- }
-
- ok = gTrue;
- return;
-
- err2:
- obj2.free();
- err1:
- obj1.free();
-}
-
-StitchingFunction::StitchingFunction(StitchingFunction *func) {
- int i;
-
- k = func->k;
- funcs = (Function **)gmallocn(k, sizeof(Function *));
- for (i = 0; i < k; ++i) {
- funcs[i] = func->funcs[i]->copy();
- }
- bounds = (double *)gmallocn(k + 1, sizeof(double));
- memcpy(bounds, func->bounds, (k + 1) * sizeof(double));
- encode = (double *)gmallocn(2 * k, sizeof(double));
- memcpy(encode, func->encode, 2 * k * sizeof(double));
- scale = (double *)gmallocn(k, sizeof(double));
- memcpy(scale, func->scale, k * sizeof(double));
- ok = gTrue;
-}
-
-StitchingFunction::~StitchingFunction() {
- int i;
-
- if (funcs) {
- for (i = 0; i < k; ++i) {
- if (funcs[i]) {
- delete funcs[i];
- }
- }
- }
- gfree(funcs);
- gfree(bounds);
- gfree(encode);
- gfree(scale);
-}
-
-void StitchingFunction::transform(double *in, double *out) {
- double x;
- int i;
-
- if (in[0] < domain[0][0]) {
- x = domain[0][0];
- } else if (in[0] > domain[0][1]) {
- x = domain[0][1];
- } else {
- x = in[0];
- }
- for (i = 0; i < k - 1; ++i) {
- if (x < bounds[i+1]) {
- break;
- }
- }
- x = encode[2*i] + (x - bounds[i]) * scale[i];
- funcs[i]->transform(&x, out);
-}
-
-//------------------------------------------------------------------------
-// PostScriptFunction
-//------------------------------------------------------------------------
-
-enum PSOp {
- psOpAbs,
- psOpAdd,
- psOpAnd,
- psOpAtan,
- psOpBitshift,
- psOpCeiling,
- psOpCopy,
- psOpCos,
- psOpCvi,
- psOpCvr,
- psOpDiv,
- psOpDup,
- psOpEq,
- psOpExch,
- psOpExp,
- psOpFalse,
- psOpFloor,
- psOpGe,
- psOpGt,
- psOpIdiv,
- psOpIndex,
- psOpLe,
- psOpLn,
- psOpLog,
- psOpLt,
- psOpMod,
- psOpMul,
- psOpNe,
- psOpNeg,
- psOpNot,
- psOpOr,
- psOpPop,
- psOpRoll,
- psOpRound,
- psOpSin,
- psOpSqrt,
- psOpSub,
- psOpTrue,
- psOpTruncate,
- psOpXor,
- psOpIf,
- psOpIfelse,
- psOpReturn
-};
-
-// Note: 'if' and 'ifelse' are parsed separately.
-// The rest are listed here in alphabetical order.
-// The index in this table is equivalent to the entry in PSOp.
-char *psOpNames[] = {
- "abs",
- "add",
- "and",
- "atan",
- "bitshift",
- "ceiling",
- "copy",
- "cos",
- "cvi",
- "cvr",
- "div",
- "dup",
- "eq",
- "exch",
- "exp",
- "false",
- "floor",
- "ge",
- "gt",
- "idiv",
- "index",
- "le",
- "ln",
- "log",
- "lt",
- "mod",
- "mul",
- "ne",
- "neg",
- "not",
- "or",
- "pop",
- "roll",
- "round",
- "sin",
- "sqrt",
- "sub",
- "true",
- "truncate",
- "xor"
-};
-
-#define nPSOps (sizeof(psOpNames) / sizeof(char *))
-
-enum PSObjectType {
- psBool,
- psInt,
- psReal,
- psOperator,
- psBlock
-};
-
-// In the code array, 'if'/'ifelse' operators take up three slots
-// plus space for the code in the subclause(s).
-//
-// +---------------------------------+
-// | psOperator: psOpIf / psOpIfelse |
-// +---------------------------------+
-// | psBlock: ptr=<A> |
-// +---------------------------------+
-// | psBlock: ptr=<B> |
-// +---------------------------------+
-// | if clause |
-// | ... |
-// | psOperator: psOpReturn |
-// +---------------------------------+
-// <A> | else clause |
-// | ... |
-// | psOperator: psOpReturn |
-// +---------------------------------+
-// <B> | ... |
-//
-// For 'if', pointer <A> is present in the code stream but unused.
-
-struct PSObject {
- PSObjectType type;
- union {
- GBool booln; // boolean (stack only)
- int intg; // integer (stack and code)
- double real; // real (stack and code)
- PSOp op; // operator (code only)
- int blk; // if/ifelse block pointer (code only)
- };
-};
-
-#define psStackSize 100
-
-class PSStack {
-public:
-
- PSStack() { sp = psStackSize; }
- void pushBool(GBool booln);
- void pushInt(int intg);
- void pushReal(double real);
- GBool popBool();
- int popInt();
- double popNum();
- GBool empty() { return sp == psStackSize; }
- GBool topIsInt() { return sp < psStackSize && stack[sp].type == psInt; }
- GBool topTwoAreInts()
- { return sp < psStackSize - 1 &&
- stack[sp].type == psInt &&
- stack[sp+1].type == psInt; }
- GBool topIsReal() { return sp < psStackSize && stack[sp].type == psReal; }
- GBool topTwoAreNums()
- { return sp < psStackSize - 1 &&
- (stack[sp].type == psInt || stack[sp].type == psReal) &&
- (stack[sp+1].type == psInt || stack[sp+1].type == psReal); }
- void copy(int n);
- void roll(int n, int j);
- void index(int i);
- void pop();
-
-private:
-
- GBool checkOverflow(int n = 1);
- GBool checkUnderflow();
- GBool checkType(PSObjectType t1, PSObjectType t2);
-
- PSObject stack[psStackSize];
- int sp;
-};
-
-GBool PSStack::checkOverflow(int n) {
- if (sp - n < 0) {
- error(-1, "Stack overflow in PostScript function");
- return gFalse;
- }
- return gTrue;
-}
-
-GBool PSStack::checkUnderflow() {
- if (sp == psStackSize) {
- error(-1, "Stack underflow in PostScript function");
- return gFalse;
- }
- return gTrue;
-}
-
-GBool PSStack::checkType(PSObjectType t1, PSObjectType t2) {
- if (stack[sp].type != t1 && stack[sp].type != t2) {
- error(-1, "Type mismatch in PostScript function");
- return gFalse;
- }
- return gTrue;
-}
-
-void PSStack::pushBool(GBool booln) {
- if (checkOverflow()) {
- stack[--sp].type = psBool;
- stack[sp].booln = booln;
- }
-}
-
-void PSStack::pushInt(int intg) {
- if (checkOverflow()) {
- stack[--sp].type = psInt;
- stack[sp].intg = intg;
- }
-}
-
-void PSStack::pushReal(double real) {
- if (checkOverflow()) {
- stack[--sp].type = psReal;
- stack[sp].real = real;
- }
-}
-
-GBool PSStack::popBool() {
- if (checkUnderflow() && checkType(psBool, psBool)) {
- return stack[sp++].booln;
- }
- return gFalse;
-}
-
-int PSStack::popInt() {
- if (checkUnderflow() && checkType(psInt, psInt)) {
- return stack[sp++].intg;
- }
- return 0;
-}
-
-double PSStack::popNum() {
- double ret;
-
- if (checkUnderflow() && checkType(psInt, psReal)) {
- ret = (stack[sp].type == psInt) ? (double)stack[sp].intg : stack[sp].real;
- ++sp;
- return ret;
- }
- return 0;
-}
-
-void PSStack::copy(int n) {
- int i;
-
- if (sp + n > psStackSize) {
- error(-1, "Stack underflow in PostScript function");
- return;
- }
- if (!checkOverflow(n)) {
- return;
- }
- for (i = sp + n - 1; i >= sp; --i) {
- stack[i - n] = stack[i];
- }
- sp -= n;
-}
-
-void PSStack::roll(int n, int j) {
- PSObject obj;
- int i, k;
-
- if (j >= 0) {
- j %= n;
- } else {
- j = -j % n;
- if (j != 0) {
- j = n - j;
- }
- }
- if (n <= 0 || j == 0) {
- return;
- }
- for (i = 0; i < j; ++i) {
- obj = stack[sp];
- for (k = sp; k < sp + n - 1; ++k) {
- stack[k] = stack[k+1];
- }
- stack[sp + n - 1] = obj;
- }
-}
-
-void PSStack::index(int i) {
- if (!checkOverflow()) {
- return;
- }
- --sp;
- stack[sp] = stack[sp + 1 + i];
-}
-
-void PSStack::pop() {
- if (!checkUnderflow()) {
- return;
- }
- ++sp;
-}
-
-PostScriptFunction::PostScriptFunction(Object *funcObj, Dict *dict) {
- Stream *str;
- int codePtr;
- GString *tok;
-
- code = NULL;
- codeSize = 0;
- ok = gFalse;
-
- //----- initialize the generic stuff
- if (!init(dict)) {
- goto err1;
- }
- if (!hasRange) {
- error(-1, "Type 4 function is missing range");
- goto err1;
- }
-
- //----- get the stream
- if (!funcObj->isStream()) {
- error(-1, "Type 4 function isn't a stream");
- goto err1;
- }
- str = funcObj->getStream();
-
- //----- parse the function
- codeString = new GString();
- str->reset();
- if (!(tok = getToken(str)) || tok->cmp("{")) {
- error(-1, "Expected '{' at start of PostScript function");
- if (tok) {
- delete tok;
- }
- goto err1;
- }
- delete tok;
- codePtr = 0;
- if (!parseCode(str, &codePtr)) {
- goto err2;
- }
- str->close();
-
- ok = gTrue;
-
- err2:
- str->close();
- err1:
- return;
-}
-
-PostScriptFunction::PostScriptFunction(PostScriptFunction *func) {
- memcpy(this, func, sizeof(PostScriptFunction));
- code = (PSObject *)gmallocn(codeSize, sizeof(PSObject));
- memcpy(code, func->code, codeSize * sizeof(PSObject));
- codeString = func->codeString->copy();
-}
-
-PostScriptFunction::~PostScriptFunction() {
- gfree(code);
- delete codeString;
-}
-
-void PostScriptFunction::transform(double *in, double *out) {
- PSStack *stack;
- int i;
-
- stack = new PSStack();
- for (i = 0; i < m; ++i) {
- //~ may need to check for integers here
- stack->pushReal(in[i]);
- }
- exec(stack, 0);
- for (i = n - 1; i >= 0; --i) {
- out[i] = stack->popNum();
- if (out[i] < range[i][0]) {
- out[i] = range[i][0];
- } else if (out[i] > range[i][1]) {
- out[i] = range[i][1];
- }
- }
- // if (!stack->empty()) {
- // error(-1, "Extra values on stack at end of PostScript function");
- // }
- delete stack;
-}
-
-GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
- GString *tok;
- char *p;
- GBool isReal;
- int opPtr, elsePtr;
- int a, b, mid, cmp;
-
- while (1) {
- if (!(tok = getToken(str))) {
- error(-1, "Unexpected end of PostScript function stream");
- return gFalse;
- }
- p = tok->getCString();
- if (isdigit(*p) || *p == '.' || *p == '-') {
- isReal = gFalse;
- for (++p; *p; ++p) {
- if (*p == '.') {
- isReal = gTrue;
- break;
- }
- }
- resizeCode(*codePtr);
- if (isReal) {
- code[*codePtr].type = psReal;
- code[*codePtr].real = atof(tok->getCString());
- } else {
- code[*codePtr].type = psInt;
- code[*codePtr].intg = atoi(tok->getCString());
- }
- ++*codePtr;
- delete tok;
- } else if (!tok->cmp("{")) {
- delete tok;
- opPtr = *codePtr;
- *codePtr += 3;
- resizeCode(opPtr + 2);
- if (!parseCode(str, codePtr)) {
- return gFalse;
- }
- if (!(tok = getToken(str))) {
- error(-1, "Unexpected end of PostScript function stream");
- return gFalse;
- }
- if (!tok->cmp("{")) {
- elsePtr = *codePtr;
- if (!parseCode(str, codePtr)) {
- return gFalse;
- }
- delete tok;
- if (!(tok = getToken(str))) {
- error(-1, "Unexpected end of PostScript function stream");
- return gFalse;
- }
- } else {
- elsePtr = -1;
- }
- if (!tok->cmp("if")) {
- if (elsePtr >= 0) {
- error(-1, "Got 'if' operator with two blocks in PostScript function");
- return gFalse;
- }
- code[opPtr].type = psOperator;
- code[opPtr].op = psOpIf;
- code[opPtr+2].type = psBlock;
- code[opPtr+2].blk = *codePtr;
- } else if (!tok->cmp("ifelse")) {
- if (elsePtr < 0) {
- error(-1, "Got 'ifelse' operator with one blocks in PostScript function");
- return gFalse;
- }
- code[opPtr].type = psOperator;
- code[opPtr].op = psOpIfelse;
- code[opPtr+1].type = psBlock;
- code[opPtr+1].blk = elsePtr;
- code[opPtr+2].type = psBlock;
- code[opPtr+2].blk = *codePtr;
- } else {
- error(-1, "Expected if/ifelse operator in PostScript function");
- delete tok;
- return gFalse;
- }
- delete tok;
- } else if (!tok->cmp("}")) {
- delete tok;
- resizeCode(*codePtr);
- code[*codePtr].type = psOperator;
- code[*codePtr].op = psOpReturn;
- ++*codePtr;
- break;
- } else {
- a = -1;
- b = nPSOps;
- // invariant: psOpNames[a] < tok < psOpNames[b]
- while (b - a > 1) {
- mid = (a + b) / 2;
- cmp = tok->cmp(psOpNames[mid]);
- if (cmp > 0) {
- a = mid;
- } else if (cmp < 0) {
- b = mid;
- } else {
- a = b = mid;
- }
- }
- if (cmp != 0) {
- error(-1, "Unknown operator '%s' in PostScript function",
- tok->getCString());
- delete tok;
- return gFalse;
- }
- delete tok;
- resizeCode(*codePtr);
- code[*codePtr].type = psOperator;
- code[*codePtr].op = (PSOp)a;
- ++*codePtr;
- }
- }
- return gTrue;
-}
-
-GString *PostScriptFunction::getToken(Stream *str) {
- GString *s;
- int c;
- GBool comment;
-
- s = new GString();
- comment = gFalse;
- while (1) {
- if ((c = str->getChar()) == EOF) {
- break;
- }
- codeString->append(c);
- if (comment) {
- if (c == '\x0a' || c == '\x0d') {
- comment = gFalse;
- }
- } else if (c == '%') {
- comment = gTrue;
- } else if (!isspace(c)) {
- break;
- }
- }
- if (c == '{' || c == '}') {
- s->append((char)c);
- } else if (isdigit(c) || c == '.' || c == '-') {
- while (1) {
- s->append((char)c);
- c = str->lookChar();
- if (c == EOF || !(isdigit(c) || c == '.' || c == '-')) {
- break;
- }
- str->getChar();
- codeString->append(c);
- }
- } else {
- while (1) {
- s->append((char)c);
- c = str->lookChar();
- if (c == EOF || !isalnum(c)) {
- break;
- }
- str->getChar();
- codeString->append(c);
- }
- }
- return s;
-}
-
-void PostScriptFunction::resizeCode(int newSize) {
- if (newSize >= codeSize) {
- codeSize += 64;
- code = (PSObject *)greallocn(code, codeSize, sizeof(PSObject));
- }
-}
-
-void PostScriptFunction::exec(PSStack *stack, int codePtr) {
- int i1, i2;
- double r1, r2, result;
- GBool b1, b2;
-
- while (1) {
- switch (code[codePtr].type) {
- case psInt:
- stack->pushInt(code[codePtr++].intg);
- break;
- case psReal:
- stack->pushReal(code[codePtr++].real);
- break;
- case psOperator:
- switch (code[codePtr++].op) {
- case psOpAbs:
- if (stack->topIsInt()) {
- stack->pushInt(abs(stack->popInt()));
- } else {
- stack->pushReal(fabs(stack->popNum()));
- }
- break;
- case psOpAdd:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 + i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushReal(r1 + r2);
- }
- break;
- case psOpAnd:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 & i2);
- } else {
- b2 = stack->popBool();
- b1 = stack->popBool();
- stack->pushBool(b1 && b2);
- }
- break;
- case psOpAtan:
- r2 = stack->popNum();
- r1 = stack->popNum();
- result = atan2(r1, r2) * 180.0 / M_PI;
- if (result < 0) result += 360.0;
- stack->pushReal(result);
- break;
- case psOpBitshift:
- i2 = stack->popInt();
- i1 = stack->popInt();
- if (i2 > 0) {
- stack->pushInt(i1 << i2);
- } else if (i2 < 0) {
- stack->pushInt((int)((Guint)i1 >> i2));
- } else {
- stack->pushInt(i1);
- }
- break;
- case psOpCeiling:
- if (!stack->topIsInt()) {
- stack->pushReal(ceil(stack->popNum()));
- }
- break;
- case psOpCopy:
- stack->copy(stack->popInt());
- break;
- case psOpCos:
- stack->pushReal(cos(stack->popNum() * M_PI / 180.0));
- break;
- case psOpCvi:
- if (!stack->topIsInt()) {
- stack->pushInt((int)stack->popNum());
- }
- break;
- case psOpCvr:
- if (!stack->topIsReal()) {
- stack->pushReal(stack->popNum());
- }
- break;
- case psOpDiv:
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushReal(r1 / r2);
- break;
- case psOpDup:
- stack->copy(1);
- break;
- case psOpEq:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushBool(i1 == i2);
- } else if (stack->topTwoAreNums()) {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushBool(r1 == r2);
- } else {
- b2 = stack->popBool();
- b1 = stack->popBool();
- stack->pushBool(b1 == b2);
- }
- break;
- case psOpExch:
- stack->roll(2, 1);
- break;
- case psOpExp:
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushReal(pow(r1, r2));
- break;
- case psOpFalse:
- stack->pushBool(gFalse);
- break;
- case psOpFloor:
- if (!stack->topIsInt()) {
- stack->pushReal(floor(stack->popNum()));
- }
- break;
- case psOpGe:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushBool(i1 >= i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushBool(r1 >= r2);
- }
- break;
- case psOpGt:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushBool(i1 > i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushBool(r1 > r2);
- }
- break;
- case psOpIdiv:
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 / i2);
- break;
- case psOpIndex:
- stack->index(stack->popInt());
- break;
- case psOpLe:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushBool(i1 <= i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushBool(r1 <= r2);
- }
- break;
- case psOpLn:
- stack->pushReal(log(stack->popNum()));
- break;
- case psOpLog:
- stack->pushReal(log10(stack->popNum()));
- break;
- case psOpLt:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushBool(i1 < i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushBool(r1 < r2);
- }
- break;
- case psOpMod:
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 % i2);
- break;
- case psOpMul:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- //~ should check for out-of-range, and push a real instead
- stack->pushInt(i1 * i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushReal(r1 * r2);
- }
- break;
- case psOpNe:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushBool(i1 != i2);
- } else if (stack->topTwoAreNums()) {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushBool(r1 != r2);
- } else {
- b2 = stack->popBool();
- b1 = stack->popBool();
- stack->pushBool(b1 != b2);
- }
- break;
- case psOpNeg:
- if (stack->topIsInt()) {
- stack->pushInt(-stack->popInt());
- } else {
- stack->pushReal(-stack->popNum());
- }
- break;
- case psOpNot:
- if (stack->topIsInt()) {
- stack->pushInt(~stack->popInt());
- } else {
- stack->pushBool(!stack->popBool());
- }
- break;
- case psOpOr:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 | i2);
- } else {
- b2 = stack->popBool();
- b1 = stack->popBool();
- stack->pushBool(b1 || b2);
- }
- break;
- case psOpPop:
- stack->pop();
- break;
- case psOpRoll:
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->roll(i1, i2);
- break;
- case psOpRound:
- if (!stack->topIsInt()) {
- r1 = stack->popNum();
- stack->pushReal((r1 >= 0) ? floor(r1 + 0.5) : ceil(r1 - 0.5));
- }
- break;
- case psOpSin:
- stack->pushReal(sin(stack->popNum() * M_PI / 180.0));
- break;
- case psOpSqrt:
- stack->pushReal(sqrt(stack->popNum()));
- break;
- case psOpSub:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 - i2);
- } else {
- r2 = stack->popNum();
- r1 = stack->popNum();
- stack->pushReal(r1 - r2);
- }
- break;
- case psOpTrue:
- stack->pushBool(gTrue);
- break;
- case psOpTruncate:
- if (!stack->topIsInt()) {
- r1 = stack->popNum();
- stack->pushReal((r1 >= 0) ? floor(r1) : ceil(r1));
- }
- break;
- case psOpXor:
- if (stack->topTwoAreInts()) {
- i2 = stack->popInt();
- i1 = stack->popInt();
- stack->pushInt(i1 ^ i2);
- } else {
- b2 = stack->popBool();
- b1 = stack->popBool();
- stack->pushBool(b1 ^ b2);
- }
- break;
- case psOpIf:
- b1 = stack->popBool();
- if (b1) {
- exec(stack, codePtr + 2);
- }
- codePtr = code[codePtr + 1].blk;
- break;
- case psOpIfelse:
- b1 = stack->popBool();
- if (b1) {
- exec(stack, codePtr + 2);
- } else {
- exec(stack, code[codePtr].blk);
- }
- codePtr = code[codePtr + 1].blk;
- break;
- case psOpReturn:
- return;
- }
- break;
- default:
- error(-1, "Internal: bad object in PostScript function code");
- break;
- }
- }
-}
diff --git a/kpdf/xpdf/xpdf/Function.cpp b/kpdf/xpdf/xpdf/Function.cpp
new file mode 100644
index 00000000..f36c8f6c
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Function.cpp
@@ -0,0 +1,1575 @@
+//========================================================================
+//
+// Function.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Dict.h"
+#include "Stream.h"
+#include "Error.h"
+#include "Function.h"
+
+//------------------------------------------------------------------------
+// Function
+//------------------------------------------------------------------------
+
+Function::Function() {
+}
+
+Function::~Function() {
+}
+
+Function *Function::parse(Object *funcObj) {
+ Function *func;
+ Dict *dict;
+ int funcType;
+ Object obj1;
+
+ if (funcObj->isStream()) {
+ dict = funcObj->streamGetDict();
+ } else if (funcObj->isDict()) {
+ dict = funcObj->getDict();
+ } else if (funcObj->isName("Identity")) {
+ return new IdentityFunction();
+ } else {
+ error(-1, "Expected function dictionary or stream");
+ return NULL;
+ }
+
+ if (!dict->lookup("FunctionType", &obj1)->isInt()) {
+ error(-1, "Function type is missing or wrong type");
+ obj1.free();
+ return NULL;
+ }
+ funcType = obj1.getInt();
+ obj1.free();
+
+ if (funcType == 0) {
+ func = new SampledFunction(funcObj, dict);
+ } else if (funcType == 2) {
+ func = new ExponentialFunction(funcObj, dict);
+ } else if (funcType == 3) {
+ func = new StitchingFunction(funcObj, dict);
+ } else if (funcType == 4) {
+ func = new PostScriptFunction(funcObj, dict);
+ } else {
+ error(-1, "Unimplemented function type (%d)", funcType);
+ return NULL;
+ }
+ if (!func->isOk()) {
+ delete func;
+ return NULL;
+ }
+
+ return func;
+}
+
+GBool Function::init(Dict *dict) {
+ Object obj1, obj2;
+ int i;
+
+ //----- Domain
+ if (!dict->lookup("Domain", &obj1)->isArray()) {
+ error(-1, "Function is missing domain");
+ goto err2;
+ }
+ m = obj1.arrayGetLength() / 2;
+ if (m > funcMaxInputs) {
+ error(-1, "Functions with more than %d inputs are unsupported",
+ funcMaxInputs);
+ goto err2;
+ }
+ for (i = 0; i < m; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function domain array");
+ goto err1;
+ }
+ domain[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function domain array");
+ goto err1;
+ }
+ domain[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ //----- Range
+ hasRange = gFalse;
+ n = 0;
+ if (dict->lookup("Range", &obj1)->isArray()) {
+ hasRange = gTrue;
+ n = obj1.arrayGetLength() / 2;
+ if (n > funcMaxOutputs) {
+ error(-1, "Functions with more than %d outputs are unsupported",
+ funcMaxOutputs);
+ goto err2;
+ }
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function range array");
+ goto err1;
+ }
+ range[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function range array");
+ goto err1;
+ }
+ range[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ }
+ obj1.free();
+
+ return gTrue;
+
+ err1:
+ obj2.free();
+ err2:
+ obj1.free();
+ return gFalse;
+}
+
+//------------------------------------------------------------------------
+// IdentityFunction
+//------------------------------------------------------------------------
+
+IdentityFunction::IdentityFunction() {
+ int i;
+
+ // fill these in with arbitrary values just in case they get used
+ // somewhere
+ m = funcMaxInputs;
+ n = funcMaxOutputs;
+ for (i = 0; i < funcMaxInputs; ++i) {
+ domain[i][0] = 0;
+ domain[i][1] = 1;
+ }
+ hasRange = gFalse;
+}
+
+IdentityFunction::~IdentityFunction() {
+}
+
+void IdentityFunction::transform(double *in, double *out) {
+ int i;
+
+ for (i = 0; i < funcMaxOutputs; ++i) {
+ out[i] = in[i];
+ }
+}
+
+//------------------------------------------------------------------------
+// SampledFunction
+//------------------------------------------------------------------------
+
+SampledFunction::SampledFunction(Object *funcObj, Dict *dict) {
+ Stream *str;
+ int sampleBits;
+ double sampleMul;
+ Object obj1, obj2;
+ Guint buf, bitMask;
+ int bits;
+ Guint s;
+ int i;
+
+ samples = NULL;
+ sBuf = NULL;
+ ok = gFalse;
+
+ //----- initialize the generic stuff
+ if (!init(dict)) {
+ goto err1;
+ }
+ if (!hasRange) {
+ error(-1, "Type 0 function is missing range");
+ goto err1;
+ }
+ if (m > sampledFuncMaxInputs) {
+ error(-1, "Sampled functions with more than %d inputs are unsupported",
+ sampledFuncMaxInputs);
+ goto err1;
+ }
+
+ //----- buffer
+ sBuf = (double *)gmallocn(1 << m, sizeof(double));
+
+ //----- get the stream
+ if (!funcObj->isStream()) {
+ error(-1, "Type 0 function isn't a stream");
+ goto err1;
+ }
+ str = funcObj->getStream();
+
+ //----- Size
+ if (!dict->lookup("Size", &obj1)->isArray() ||
+ obj1.arrayGetLength() != m) {
+ error(-1, "Function has missing or invalid size array");
+ goto err2;
+ }
+ for (i = 0; i < m; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!obj2.isInt()) {
+ error(-1, "Illegal value in function size array");
+ goto err3;
+ }
+ sampleSize[i] = obj2.getInt();
+ obj2.free();
+ }
+ obj1.free();
+ idxMul[0] = n;
+ for (i = 1; i < m; ++i) {
+ idxMul[i] = idxMul[i-1] * sampleSize[i-1];
+ }
+
+ //----- BitsPerSample
+ if (!dict->lookup("BitsPerSample", &obj1)->isInt()) {
+ error(-1, "Function has missing or invalid BitsPerSample");
+ goto err2;
+ }
+ sampleBits = obj1.getInt();
+ sampleMul = 1.0 / (pow(2.0, (double)sampleBits) - 1);
+ obj1.free();
+
+ //----- Encode
+ if (dict->lookup("Encode", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2*m) {
+ for (i = 0; i < m; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function encode array");
+ goto err3;
+ }
+ encode[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function encode array");
+ goto err3;
+ }
+ encode[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ for (i = 0; i < m; ++i) {
+ encode[i][0] = 0;
+ encode[i][1] = sampleSize[i] - 1;
+ }
+ }
+ obj1.free();
+ for (i = 0; i < m; ++i) {
+ inputMul[i] = (encode[i][1] - encode[i][0]) /
+ (domain[i][1] - domain[i][0]);
+ }
+
+ //----- Decode
+ if (dict->lookup("Decode", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2*n) {
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(2*i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function decode array");
+ goto err3;
+ }
+ decode[i][0] = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2*i+1, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function decode array");
+ goto err3;
+ }
+ decode[i][1] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ for (i = 0; i < n; ++i) {
+ decode[i][0] = range[i][0];
+ decode[i][1] = range[i][1];
+ }
+ }
+ obj1.free();
+
+ //----- samples
+ nSamples = n;
+ for (i = 0; i < m; ++i)
+ nSamples *= sampleSize[i];
+ samples = (double *)gmallocn(nSamples, sizeof(double));
+ buf = 0;
+ bits = 0;
+ bitMask = (1 << sampleBits) - 1;
+ str->reset();
+ for (i = 0; i < nSamples; ++i) {
+ if (sampleBits == 8) {
+ s = str->getChar();
+ } else if (sampleBits == 16) {
+ s = str->getChar();
+ s = (s << 8) + str->getChar();
+ } else if (sampleBits == 32) {
+ s = str->getChar();
+ s = (s << 8) + str->getChar();
+ s = (s << 8) + str->getChar();
+ s = (s << 8) + str->getChar();
+ } else {
+ while (bits < sampleBits) {
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bits += 8;
+ }
+ s = (buf >> (bits - sampleBits)) & bitMask;
+ bits -= sampleBits;
+ }
+ samples[i] = (double)s * sampleMul;
+ }
+ str->close();
+
+ ok = gTrue;
+ return;
+
+ err3:
+ obj2.free();
+ err2:
+ obj1.free();
+ err1:
+ return;
+}
+
+SampledFunction::~SampledFunction() {
+ if (samples) {
+ gfree(samples);
+ }
+ if (sBuf) {
+ gfree(sBuf);
+ }
+}
+
+SampledFunction::SampledFunction(SampledFunction *func) {
+ memcpy(this, func, sizeof(SampledFunction));
+ samples = (double *)gmallocn(nSamples, sizeof(double));
+ memcpy(samples, func->samples, nSamples * sizeof(double));
+ sBuf = (double *)gmallocn(1 << m, sizeof(double));
+}
+
+void SampledFunction::transform(double *in, double *out) {
+ double x;
+ int e[funcMaxInputs][2];
+ double efrac0[funcMaxInputs];
+ double efrac1[funcMaxInputs];
+ int i, j, k, idx, t;
+
+ // map input values into sample array
+ for (i = 0; i < m; ++i) {
+ x = (in[i] - domain[i][0]) * inputMul[i] + encode[i][0];
+ if (x < 0) {
+ x = 0;
+ } else if (x > sampleSize[i] - 1) {
+ x = sampleSize[i] - 1;
+ }
+ e[i][0] = (int)x;
+ if ((e[i][1] = e[i][0] + 1) >= sampleSize[i]) {
+ // this happens if in[i] = domain[i][1]
+ e[i][1] = e[i][0];
+ }
+ efrac1[i] = x - e[i][0];
+ efrac0[i] = 1 - efrac1[i];
+ }
+
+ // for each output, do m-linear interpolation
+ for (i = 0; i < n; ++i) {
+
+ // pull 2^m values out of the sample array
+ for (j = 0; j < (1<<m); ++j) {
+ idx = i;
+ for (k = 0, t = j; k < m; ++k, t >>= 1) {
+ idx += idxMul[k] * (e[k][t & 1]);
+ }
+ sBuf[j] = samples[idx];
+ }
+
+ // do m sets of interpolations
+ for (j = 0, t = (1<<m); j < m; ++j, t >>= 1) {
+ for (k = 0; k < t; k += 2) {
+ sBuf[k >> 1] = efrac0[j] * sBuf[k] + efrac1[j] * sBuf[k+1];
+ }
+ }
+
+ // map output value to range
+ out[i] = sBuf[0] * (decode[i][1] - decode[i][0]) + decode[i][0];
+ if (out[i] < range[i][0]) {
+ out[i] = range[i][0];
+ } else if (out[i] > range[i][1]) {
+ out[i] = range[i][1];
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// ExponentialFunction
+//------------------------------------------------------------------------
+
+ExponentialFunction::ExponentialFunction(Object * /*funcObj*/, Dict *dict) {
+ Object obj1, obj2;
+ int i;
+
+ ok = gFalse;
+
+ //----- initialize the generic stuff
+ if (!init(dict)) {
+ goto err1;
+ }
+ if (m != 1) {
+ error(-1, "Exponential function with more than one input");
+ goto err1;
+ }
+
+ //----- C0
+ if (dict->lookup("C0", &obj1)->isArray()) {
+ if (hasRange && obj1.arrayGetLength() != n) {
+ error(-1, "Function's C0 array is wrong length");
+ goto err2;
+ }
+ n = obj1.arrayGetLength();
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function C0 array");
+ goto err3;
+ }
+ c0[i] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ if (hasRange && n != 1) {
+ error(-1, "Function's C0 array is wrong length");
+ goto err2;
+ }
+ n = 1;
+ c0[0] = 0;
+ }
+ obj1.free();
+
+ //----- C1
+ if (dict->lookup("C1", &obj1)->isArray()) {
+ if (obj1.arrayGetLength() != n) {
+ error(-1, "Function's C1 array is wrong length");
+ goto err2;
+ }
+ for (i = 0; i < n; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!obj2.isNum()) {
+ error(-1, "Illegal value in function C1 array");
+ goto err3;
+ }
+ c1[i] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ if (n != 1) {
+ error(-1, "Function's C1 array is wrong length");
+ goto err2;
+ }
+ c1[0] = 1;
+ }
+ obj1.free();
+
+ //----- N (exponent)
+ if (!dict->lookup("N", &obj1)->isNum()) {
+ error(-1, "Function has missing or invalid N");
+ goto err2;
+ }
+ e = obj1.getNum();
+ obj1.free();
+
+ ok = gTrue;
+ return;
+
+ err3:
+ obj2.free();
+ err2:
+ obj1.free();
+ err1:
+ return;
+}
+
+ExponentialFunction::~ExponentialFunction() {
+}
+
+ExponentialFunction::ExponentialFunction(ExponentialFunction *func) {
+ memcpy(this, func, sizeof(ExponentialFunction));
+}
+
+void ExponentialFunction::transform(double *in, double *out) {
+ double x;
+ int i;
+
+ if (in[0] < domain[0][0]) {
+ x = domain[0][0];
+ } else if (in[0] > domain[0][1]) {
+ x = domain[0][1];
+ } else {
+ x = in[0];
+ }
+ for (i = 0; i < n; ++i) {
+ out[i] = c0[i] + pow(x, e) * (c1[i] - c0[i]);
+ if (hasRange) {
+ if (out[i] < range[i][0]) {
+ out[i] = range[i][0];
+ } else if (out[i] > range[i][1]) {
+ out[i] = range[i][1];
+ }
+ }
+ }
+ return;
+}
+
+//------------------------------------------------------------------------
+// StitchingFunction
+//------------------------------------------------------------------------
+
+StitchingFunction::StitchingFunction(Object * /*funcObj*/, Dict *dict) {
+ Object obj1, obj2;
+ int i;
+
+ ok = gFalse;
+ funcs = NULL;
+ bounds = NULL;
+ encode = NULL;
+ scale = NULL;
+
+ //----- initialize the generic stuff
+ if (!init(dict)) {
+ goto err1;
+ }
+ if (m != 1) {
+ error(-1, "Stitching function with more than one input");
+ goto err1;
+ }
+
+ //----- Functions
+ if (!dict->lookup("Functions", &obj1)->isArray()) {
+ error(-1, "Missing 'Functions' entry in stitching function");
+ goto err1;
+ }
+ k = obj1.arrayGetLength();
+ funcs = (Function **)gmallocn(k, sizeof(Function *));
+ bounds = (double *)gmallocn(k + 1, sizeof(double));
+ encode = (double *)gmallocn(2 * k, sizeof(double));
+ scale = (double *)gmallocn(k, sizeof(double));
+ for (i = 0; i < k; ++i) {
+ funcs[i] = NULL;
+ }
+ for (i = 0; i < k; ++i) {
+ if (!(funcs[i] = Function::parse(obj1.arrayGet(i, &obj2)))) {
+ goto err2;
+ }
+ if (i > 0 && (funcs[i]->getInputSize() != 1 ||
+ funcs[i]->getOutputSize() != funcs[0]->getOutputSize())) {
+ error(-1, "Incompatible subfunctions in stitching function");
+ goto err2;
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ //----- Bounds
+ if (!dict->lookup("Bounds", &obj1)->isArray() ||
+ obj1.arrayGetLength() != k - 1) {
+ error(-1, "Missing or invalid 'Bounds' entry in stitching function");
+ goto err1;
+ }
+ bounds[0] = domain[0][0];
+ for (i = 1; i < k; ++i) {
+ if (!obj1.arrayGet(i - 1, &obj2)->isNum()) {
+ error(-1, "Invalid type in 'Bounds' array in stitching function");
+ goto err2;
+ }
+ bounds[i] = obj2.getNum();
+ obj2.free();
+ }
+ bounds[k] = domain[0][1];
+ obj1.free();
+
+ //----- Encode
+ if (!dict->lookup("Encode", &obj1)->isArray() ||
+ obj1.arrayGetLength() != 2 * k) {
+ error(-1, "Missing or invalid 'Encode' entry in stitching function");
+ goto err1;
+ }
+ for (i = 0; i < 2 * k; ++i) {
+ if (!obj1.arrayGet(i, &obj2)->isNum()) {
+ error(-1, "Invalid type in 'Encode' array in stitching function");
+ goto err2;
+ }
+ encode[i] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ //----- pre-compute the scale factors
+ for (i = 0; i < k; ++i) {
+ if (bounds[i] == bounds[i+1]) {
+ // avoid a divide-by-zero -- in this situation, function i will
+ // never be used anyway
+ scale[i] = 0;
+ } else {
+ scale[i] = (encode[2*i+1] - encode[2*i]) / (bounds[i+1] - bounds[i]);
+ }
+ }
+
+ ok = gTrue;
+ return;
+
+ err2:
+ obj2.free();
+ err1:
+ obj1.free();
+}
+
+StitchingFunction::StitchingFunction(StitchingFunction *func) {
+ int i;
+
+ k = func->k;
+ funcs = (Function **)gmallocn(k, sizeof(Function *));
+ for (i = 0; i < k; ++i) {
+ funcs[i] = func->funcs[i]->copy();
+ }
+ bounds = (double *)gmallocn(k + 1, sizeof(double));
+ memcpy(bounds, func->bounds, (k + 1) * sizeof(double));
+ encode = (double *)gmallocn(2 * k, sizeof(double));
+ memcpy(encode, func->encode, 2 * k * sizeof(double));
+ scale = (double *)gmallocn(k, sizeof(double));
+ memcpy(scale, func->scale, k * sizeof(double));
+ ok = gTrue;
+}
+
+StitchingFunction::~StitchingFunction() {
+ int i;
+
+ if (funcs) {
+ for (i = 0; i < k; ++i) {
+ if (funcs[i]) {
+ delete funcs[i];
+ }
+ }
+ }
+ gfree(funcs);
+ gfree(bounds);
+ gfree(encode);
+ gfree(scale);
+}
+
+void StitchingFunction::transform(double *in, double *out) {
+ double x;
+ int i;
+
+ if (in[0] < domain[0][0]) {
+ x = domain[0][0];
+ } else if (in[0] > domain[0][1]) {
+ x = domain[0][1];
+ } else {
+ x = in[0];
+ }
+ for (i = 0; i < k - 1; ++i) {
+ if (x < bounds[i+1]) {
+ break;
+ }
+ }
+ x = encode[2*i] + (x - bounds[i]) * scale[i];
+ funcs[i]->transform(&x, out);
+}
+
+//------------------------------------------------------------------------
+// PostScriptFunction
+//------------------------------------------------------------------------
+
+enum PSOp {
+ psOpAbs,
+ psOpAdd,
+ psOpAnd,
+ psOpAtan,
+ psOpBitshift,
+ psOpCeiling,
+ psOpCopy,
+ psOpCos,
+ psOpCvi,
+ psOpCvr,
+ psOpDiv,
+ psOpDup,
+ psOpEq,
+ psOpExch,
+ psOpExp,
+ psOpFalse,
+ psOpFloor,
+ psOpGe,
+ psOpGt,
+ psOpIdiv,
+ psOpIndex,
+ psOpLe,
+ psOpLn,
+ psOpLog,
+ psOpLt,
+ psOpMod,
+ psOpMul,
+ psOpNe,
+ psOpNeg,
+ psOpNot,
+ psOpOr,
+ psOpPop,
+ psOpRoll,
+ psOpRound,
+ psOpSin,
+ psOpSqrt,
+ psOpSub,
+ psOpTrue,
+ psOpTruncate,
+ psOpXor,
+ psOpIf,
+ psOpIfelse,
+ psOpReturn
+};
+
+// Note: 'if' and 'ifelse' are parsed separately.
+// The rest are listed here in alphabetical order.
+// The index in this table is equivalent to the entry in PSOp.
+char *psOpNames[] = {
+ "abs",
+ "add",
+ "and",
+ "atan",
+ "bitshift",
+ "ceiling",
+ "copy",
+ "cos",
+ "cvi",
+ "cvr",
+ "div",
+ "dup",
+ "eq",
+ "exch",
+ "exp",
+ "false",
+ "floor",
+ "ge",
+ "gt",
+ "idiv",
+ "index",
+ "le",
+ "ln",
+ "log",
+ "lt",
+ "mod",
+ "mul",
+ "ne",
+ "neg",
+ "not",
+ "or",
+ "pop",
+ "roll",
+ "round",
+ "sin",
+ "sqrt",
+ "sub",
+ "true",
+ "truncate",
+ "xor"
+};
+
+#define nPSOps (sizeof(psOpNames) / sizeof(char *))
+
+enum PSObjectType {
+ psBool,
+ psInt,
+ psReal,
+ psOperator,
+ psBlock
+};
+
+// In the code array, 'if'/'ifelse' operators take up three slots
+// plus space for the code in the subclause(s).
+//
+// +---------------------------------+
+// | psOperator: psOpIf / psOpIfelse |
+// +---------------------------------+
+// | psBlock: ptr=<A> |
+// +---------------------------------+
+// | psBlock: ptr=<B> |
+// +---------------------------------+
+// | if clause |
+// | ... |
+// | psOperator: psOpReturn |
+// +---------------------------------+
+// <A> | else clause |
+// | ... |
+// | psOperator: psOpReturn |
+// +---------------------------------+
+// <B> | ... |
+//
+// For 'if', pointer <A> is present in the code stream but unused.
+
+struct PSObject {
+ PSObjectType type;
+ union {
+ GBool booln; // boolean (stack only)
+ int intg; // integer (stack and code)
+ double real; // real (stack and code)
+ PSOp op; // operator (code only)
+ int blk; // if/ifelse block pointer (code only)
+ };
+};
+
+#define psStackSize 100
+
+class PSStack {
+public:
+
+ PSStack() { sp = psStackSize; }
+ void pushBool(GBool booln);
+ void pushInt(int intg);
+ void pushReal(double real);
+ GBool popBool();
+ int popInt();
+ double popNum();
+ GBool empty() { return sp == psStackSize; }
+ GBool topIsInt() { return sp < psStackSize && stack[sp].type == psInt; }
+ GBool topTwoAreInts()
+ { return sp < psStackSize - 1 &&
+ stack[sp].type == psInt &&
+ stack[sp+1].type == psInt; }
+ GBool topIsReal() { return sp < psStackSize && stack[sp].type == psReal; }
+ GBool topTwoAreNums()
+ { return sp < psStackSize - 1 &&
+ (stack[sp].type == psInt || stack[sp].type == psReal) &&
+ (stack[sp+1].type == psInt || stack[sp+1].type == psReal); }
+ void copy(int n);
+ void roll(int n, int j);
+ void index(int i);
+ void pop();
+
+private:
+
+ GBool checkOverflow(int n = 1);
+ GBool checkUnderflow();
+ GBool checkType(PSObjectType t1, PSObjectType t2);
+
+ PSObject stack[psStackSize];
+ int sp;
+};
+
+GBool PSStack::checkOverflow(int n) {
+ if (sp - n < 0) {
+ error(-1, "Stack overflow in PostScript function");
+ return gFalse;
+ }
+ return gTrue;
+}
+
+GBool PSStack::checkUnderflow() {
+ if (sp == psStackSize) {
+ error(-1, "Stack underflow in PostScript function");
+ return gFalse;
+ }
+ return gTrue;
+}
+
+GBool PSStack::checkType(PSObjectType t1, PSObjectType t2) {
+ if (stack[sp].type != t1 && stack[sp].type != t2) {
+ error(-1, "Type mismatch in PostScript function");
+ return gFalse;
+ }
+ return gTrue;
+}
+
+void PSStack::pushBool(GBool booln) {
+ if (checkOverflow()) {
+ stack[--sp].type = psBool;
+ stack[sp].booln = booln;
+ }
+}
+
+void PSStack::pushInt(int intg) {
+ if (checkOverflow()) {
+ stack[--sp].type = psInt;
+ stack[sp].intg = intg;
+ }
+}
+
+void PSStack::pushReal(double real) {
+ if (checkOverflow()) {
+ stack[--sp].type = psReal;
+ stack[sp].real = real;
+ }
+}
+
+GBool PSStack::popBool() {
+ if (checkUnderflow() && checkType(psBool, psBool)) {
+ return stack[sp++].booln;
+ }
+ return gFalse;
+}
+
+int PSStack::popInt() {
+ if (checkUnderflow() && checkType(psInt, psInt)) {
+ return stack[sp++].intg;
+ }
+ return 0;
+}
+
+double PSStack::popNum() {
+ double ret;
+
+ if (checkUnderflow() && checkType(psInt, psReal)) {
+ ret = (stack[sp].type == psInt) ? (double)stack[sp].intg : stack[sp].real;
+ ++sp;
+ return ret;
+ }
+ return 0;
+}
+
+void PSStack::copy(int n) {
+ int i;
+
+ if (sp + n > psStackSize) {
+ error(-1, "Stack underflow in PostScript function");
+ return;
+ }
+ if (!checkOverflow(n)) {
+ return;
+ }
+ for (i = sp + n - 1; i >= sp; --i) {
+ stack[i - n] = stack[i];
+ }
+ sp -= n;
+}
+
+void PSStack::roll(int n, int j) {
+ PSObject obj;
+ int i, k;
+
+ if (j >= 0) {
+ j %= n;
+ } else {
+ j = -j % n;
+ if (j != 0) {
+ j = n - j;
+ }
+ }
+ if (n <= 0 || j == 0) {
+ return;
+ }
+ for (i = 0; i < j; ++i) {
+ obj = stack[sp];
+ for (k = sp; k < sp + n - 1; ++k) {
+ stack[k] = stack[k+1];
+ }
+ stack[sp + n - 1] = obj;
+ }
+}
+
+void PSStack::index(int i) {
+ if (!checkOverflow()) {
+ return;
+ }
+ --sp;
+ stack[sp] = stack[sp + 1 + i];
+}
+
+void PSStack::pop() {
+ if (!checkUnderflow()) {
+ return;
+ }
+ ++sp;
+}
+
+PostScriptFunction::PostScriptFunction(Object *funcObj, Dict *dict) {
+ Stream *str;
+ int codePtr;
+ GString *tok;
+
+ code = NULL;
+ codeSize = 0;
+ ok = gFalse;
+
+ //----- initialize the generic stuff
+ if (!init(dict)) {
+ goto err1;
+ }
+ if (!hasRange) {
+ error(-1, "Type 4 function is missing range");
+ goto err1;
+ }
+
+ //----- get the stream
+ if (!funcObj->isStream()) {
+ error(-1, "Type 4 function isn't a stream");
+ goto err1;
+ }
+ str = funcObj->getStream();
+
+ //----- parse the function
+ codeString = new GString();
+ str->reset();
+ if (!(tok = getToken(str)) || tok->cmp("{")) {
+ error(-1, "Expected '{' at start of PostScript function");
+ if (tok) {
+ delete tok;
+ }
+ goto err1;
+ }
+ delete tok;
+ codePtr = 0;
+ if (!parseCode(str, &codePtr)) {
+ goto err2;
+ }
+ str->close();
+
+ ok = gTrue;
+
+ err2:
+ str->close();
+ err1:
+ return;
+}
+
+PostScriptFunction::PostScriptFunction(PostScriptFunction *func) {
+ memcpy(this, func, sizeof(PostScriptFunction));
+ code = (PSObject *)gmallocn(codeSize, sizeof(PSObject));
+ memcpy(code, func->code, codeSize * sizeof(PSObject));
+ codeString = func->codeString->copy();
+}
+
+PostScriptFunction::~PostScriptFunction() {
+ gfree(code);
+ delete codeString;
+}
+
+void PostScriptFunction::transform(double *in, double *out) {
+ PSStack *stack;
+ int i;
+
+ stack = new PSStack();
+ for (i = 0; i < m; ++i) {
+ //~ may need to check for integers here
+ stack->pushReal(in[i]);
+ }
+ exec(stack, 0);
+ for (i = n - 1; i >= 0; --i) {
+ out[i] = stack->popNum();
+ if (out[i] < range[i][0]) {
+ out[i] = range[i][0];
+ } else if (out[i] > range[i][1]) {
+ out[i] = range[i][1];
+ }
+ }
+ // if (!stack->empty()) {
+ // error(-1, "Extra values on stack at end of PostScript function");
+ // }
+ delete stack;
+}
+
+GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) {
+ GString *tok;
+ char *p;
+ GBool isReal;
+ int opPtr, elsePtr;
+ int a, b, mid, cmp;
+
+ while (1) {
+ if (!(tok = getToken(str))) {
+ error(-1, "Unexpected end of PostScript function stream");
+ return gFalse;
+ }
+ p = tok->getCString();
+ if (isdigit(*p) || *p == '.' || *p == '-') {
+ isReal = gFalse;
+ for (++p; *p; ++p) {
+ if (*p == '.') {
+ isReal = gTrue;
+ break;
+ }
+ }
+ resizeCode(*codePtr);
+ if (isReal) {
+ code[*codePtr].type = psReal;
+ code[*codePtr].real = atof(tok->getCString());
+ } else {
+ code[*codePtr].type = psInt;
+ code[*codePtr].intg = atoi(tok->getCString());
+ }
+ ++*codePtr;
+ delete tok;
+ } else if (!tok->cmp("{")) {
+ delete tok;
+ opPtr = *codePtr;
+ *codePtr += 3;
+ resizeCode(opPtr + 2);
+ if (!parseCode(str, codePtr)) {
+ return gFalse;
+ }
+ if (!(tok = getToken(str))) {
+ error(-1, "Unexpected end of PostScript function stream");
+ return gFalse;
+ }
+ if (!tok->cmp("{")) {
+ elsePtr = *codePtr;
+ if (!parseCode(str, codePtr)) {
+ return gFalse;
+ }
+ delete tok;
+ if (!(tok = getToken(str))) {
+ error(-1, "Unexpected end of PostScript function stream");
+ return gFalse;
+ }
+ } else {
+ elsePtr = -1;
+ }
+ if (!tok->cmp("if")) {
+ if (elsePtr >= 0) {
+ error(-1, "Got 'if' operator with two blocks in PostScript function");
+ return gFalse;
+ }
+ code[opPtr].type = psOperator;
+ code[opPtr].op = psOpIf;
+ code[opPtr+2].type = psBlock;
+ code[opPtr+2].blk = *codePtr;
+ } else if (!tok->cmp("ifelse")) {
+ if (elsePtr < 0) {
+ error(-1, "Got 'ifelse' operator with one blocks in PostScript function");
+ return gFalse;
+ }
+ code[opPtr].type = psOperator;
+ code[opPtr].op = psOpIfelse;
+ code[opPtr+1].type = psBlock;
+ code[opPtr+1].blk = elsePtr;
+ code[opPtr+2].type = psBlock;
+ code[opPtr+2].blk = *codePtr;
+ } else {
+ error(-1, "Expected if/ifelse operator in PostScript function");
+ delete tok;
+ return gFalse;
+ }
+ delete tok;
+ } else if (!tok->cmp("}")) {
+ delete tok;
+ resizeCode(*codePtr);
+ code[*codePtr].type = psOperator;
+ code[*codePtr].op = psOpReturn;
+ ++*codePtr;
+ break;
+ } else {
+ a = -1;
+ b = nPSOps;
+ // invariant: psOpNames[a] < tok < psOpNames[b]
+ while (b - a > 1) {
+ mid = (a + b) / 2;
+ cmp = tok->cmp(psOpNames[mid]);
+ if (cmp > 0) {
+ a = mid;
+ } else if (cmp < 0) {
+ b = mid;
+ } else {
+ a = b = mid;
+ }
+ }
+ if (cmp != 0) {
+ error(-1, "Unknown operator '%s' in PostScript function",
+ tok->getCString());
+ delete tok;
+ return gFalse;
+ }
+ delete tok;
+ resizeCode(*codePtr);
+ code[*codePtr].type = psOperator;
+ code[*codePtr].op = (PSOp)a;
+ ++*codePtr;
+ }
+ }
+ return gTrue;
+}
+
+GString *PostScriptFunction::getToken(Stream *str) {
+ GString *s;
+ int c;
+ GBool comment;
+
+ s = new GString();
+ comment = gFalse;
+ while (1) {
+ if ((c = str->getChar()) == EOF) {
+ break;
+ }
+ codeString->append(c);
+ if (comment) {
+ if (c == '\x0a' || c == '\x0d') {
+ comment = gFalse;
+ }
+ } else if (c == '%') {
+ comment = gTrue;
+ } else if (!isspace(c)) {
+ break;
+ }
+ }
+ if (c == '{' || c == '}') {
+ s->append((char)c);
+ } else if (isdigit(c) || c == '.' || c == '-') {
+ while (1) {
+ s->append((char)c);
+ c = str->lookChar();
+ if (c == EOF || !(isdigit(c) || c == '.' || c == '-')) {
+ break;
+ }
+ str->getChar();
+ codeString->append(c);
+ }
+ } else {
+ while (1) {
+ s->append((char)c);
+ c = str->lookChar();
+ if (c == EOF || !isalnum(c)) {
+ break;
+ }
+ str->getChar();
+ codeString->append(c);
+ }
+ }
+ return s;
+}
+
+void PostScriptFunction::resizeCode(int newSize) {
+ if (newSize >= codeSize) {
+ codeSize += 64;
+ code = (PSObject *)greallocn(code, codeSize, sizeof(PSObject));
+ }
+}
+
+void PostScriptFunction::exec(PSStack *stack, int codePtr) {
+ int i1, i2;
+ double r1, r2, result;
+ GBool b1, b2;
+
+ while (1) {
+ switch (code[codePtr].type) {
+ case psInt:
+ stack->pushInt(code[codePtr++].intg);
+ break;
+ case psReal:
+ stack->pushReal(code[codePtr++].real);
+ break;
+ case psOperator:
+ switch (code[codePtr++].op) {
+ case psOpAbs:
+ if (stack->topIsInt()) {
+ stack->pushInt(abs(stack->popInt()));
+ } else {
+ stack->pushReal(fabs(stack->popNum()));
+ }
+ break;
+ case psOpAdd:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 + i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushReal(r1 + r2);
+ }
+ break;
+ case psOpAnd:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 & i2);
+ } else {
+ b2 = stack->popBool();
+ b1 = stack->popBool();
+ stack->pushBool(b1 && b2);
+ }
+ break;
+ case psOpAtan:
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ result = atan2(r1, r2) * 180.0 / M_PI;
+ if (result < 0) result += 360.0;
+ stack->pushReal(result);
+ break;
+ case psOpBitshift:
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ if (i2 > 0) {
+ stack->pushInt(i1 << i2);
+ } else if (i2 < 0) {
+ stack->pushInt((int)((Guint)i1 >> i2));
+ } else {
+ stack->pushInt(i1);
+ }
+ break;
+ case psOpCeiling:
+ if (!stack->topIsInt()) {
+ stack->pushReal(ceil(stack->popNum()));
+ }
+ break;
+ case psOpCopy:
+ stack->copy(stack->popInt());
+ break;
+ case psOpCos:
+ stack->pushReal(cos(stack->popNum() * M_PI / 180.0));
+ break;
+ case psOpCvi:
+ if (!stack->topIsInt()) {
+ stack->pushInt((int)stack->popNum());
+ }
+ break;
+ case psOpCvr:
+ if (!stack->topIsReal()) {
+ stack->pushReal(stack->popNum());
+ }
+ break;
+ case psOpDiv:
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushReal(r1 / r2);
+ break;
+ case psOpDup:
+ stack->copy(1);
+ break;
+ case psOpEq:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushBool(i1 == i2);
+ } else if (stack->topTwoAreNums()) {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushBool(r1 == r2);
+ } else {
+ b2 = stack->popBool();
+ b1 = stack->popBool();
+ stack->pushBool(b1 == b2);
+ }
+ break;
+ case psOpExch:
+ stack->roll(2, 1);
+ break;
+ case psOpExp:
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushReal(pow(r1, r2));
+ break;
+ case psOpFalse:
+ stack->pushBool(gFalse);
+ break;
+ case psOpFloor:
+ if (!stack->topIsInt()) {
+ stack->pushReal(floor(stack->popNum()));
+ }
+ break;
+ case psOpGe:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushBool(i1 >= i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushBool(r1 >= r2);
+ }
+ break;
+ case psOpGt:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushBool(i1 > i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushBool(r1 > r2);
+ }
+ break;
+ case psOpIdiv:
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 / i2);
+ break;
+ case psOpIndex:
+ stack->index(stack->popInt());
+ break;
+ case psOpLe:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushBool(i1 <= i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushBool(r1 <= r2);
+ }
+ break;
+ case psOpLn:
+ stack->pushReal(log(stack->popNum()));
+ break;
+ case psOpLog:
+ stack->pushReal(log10(stack->popNum()));
+ break;
+ case psOpLt:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushBool(i1 < i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushBool(r1 < r2);
+ }
+ break;
+ case psOpMod:
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 % i2);
+ break;
+ case psOpMul:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ //~ should check for out-of-range, and push a real instead
+ stack->pushInt(i1 * i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushReal(r1 * r2);
+ }
+ break;
+ case psOpNe:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushBool(i1 != i2);
+ } else if (stack->topTwoAreNums()) {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushBool(r1 != r2);
+ } else {
+ b2 = stack->popBool();
+ b1 = stack->popBool();
+ stack->pushBool(b1 != b2);
+ }
+ break;
+ case psOpNeg:
+ if (stack->topIsInt()) {
+ stack->pushInt(-stack->popInt());
+ } else {
+ stack->pushReal(-stack->popNum());
+ }
+ break;
+ case psOpNot:
+ if (stack->topIsInt()) {
+ stack->pushInt(~stack->popInt());
+ } else {
+ stack->pushBool(!stack->popBool());
+ }
+ break;
+ case psOpOr:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 | i2);
+ } else {
+ b2 = stack->popBool();
+ b1 = stack->popBool();
+ stack->pushBool(b1 || b2);
+ }
+ break;
+ case psOpPop:
+ stack->pop();
+ break;
+ case psOpRoll:
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->roll(i1, i2);
+ break;
+ case psOpRound:
+ if (!stack->topIsInt()) {
+ r1 = stack->popNum();
+ stack->pushReal((r1 >= 0) ? floor(r1 + 0.5) : ceil(r1 - 0.5));
+ }
+ break;
+ case psOpSin:
+ stack->pushReal(sin(stack->popNum() * M_PI / 180.0));
+ break;
+ case psOpSqrt:
+ stack->pushReal(sqrt(stack->popNum()));
+ break;
+ case psOpSub:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 - i2);
+ } else {
+ r2 = stack->popNum();
+ r1 = stack->popNum();
+ stack->pushReal(r1 - r2);
+ }
+ break;
+ case psOpTrue:
+ stack->pushBool(gTrue);
+ break;
+ case psOpTruncate:
+ if (!stack->topIsInt()) {
+ r1 = stack->popNum();
+ stack->pushReal((r1 >= 0) ? floor(r1) : ceil(r1));
+ }
+ break;
+ case psOpXor:
+ if (stack->topTwoAreInts()) {
+ i2 = stack->popInt();
+ i1 = stack->popInt();
+ stack->pushInt(i1 ^ i2);
+ } else {
+ b2 = stack->popBool();
+ b1 = stack->popBool();
+ stack->pushBool(b1 ^ b2);
+ }
+ break;
+ case psOpIf:
+ b1 = stack->popBool();
+ if (b1) {
+ exec(stack, codePtr + 2);
+ }
+ codePtr = code[codePtr + 1].blk;
+ break;
+ case psOpIfelse:
+ b1 = stack->popBool();
+ if (b1) {
+ exec(stack, codePtr + 2);
+ } else {
+ exec(stack, code[codePtr].blk);
+ }
+ codePtr = code[codePtr + 1].blk;
+ break;
+ case psOpReturn:
+ return;
+ }
+ break;
+ default:
+ error(-1, "Internal: bad object in PostScript function code");
+ break;
+ }
+ }
+}
diff --git a/kpdf/xpdf/xpdf/Gfx.cc b/kpdf/xpdf/xpdf/Gfx.cc
deleted file mode 100644
index e3df8384..00000000
--- a/kpdf/xpdf/xpdf/Gfx.cc
+++ /dev/null
@@ -1,4189 +0,0 @@
-//========================================================================
-//
-// Gfx.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-#include <math.h>
-#include "gmem.h"
-#include "GlobalParams.h"
-#include "CharTypes.h"
-#include "Object.h"
-#include "Array.h"
-#include "Dict.h"
-#include "Stream.h"
-#include "Lexer.h"
-#include "Parser.h"
-#include "GfxFont.h"
-#include "GfxState.h"
-#include "OutputDev.h"
-#include "Page.h"
-#include "Annot.h"
-#include "Error.h"
-#include "Gfx.h"
-
-// the MSVC math.h doesn't define this
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-//------------------------------------------------------------------------
-// constants
-//------------------------------------------------------------------------
-
-// Max recursive depth for a function shading fill.
-#define functionMaxDepth 6
-
-// Max delta allowed in any color component for a function shading fill.
-#define functionColorDelta (dblToCol(1 / 256.0))
-
-// Max number of splits along the t axis for an axial shading fill.
-#define axialMaxSplits 256
-
-// Max delta allowed in any color component for an axial shading fill.
-#define axialColorDelta (dblToCol(1 / 256.0))
-
-// Max number of splits along the t axis for a radial shading fill.
-#define radialMaxSplits 256
-
-// Max delta allowed in any color component for a radial shading fill.
-#define radialColorDelta (dblToCol(1 / 256.0))
-
-// Max recursive depth for a Gouraud triangle shading fill.
-#define gouraudMaxDepth 6
-
-// Max delta allowed in any color component for a Gouraud triangle
-// shading fill.
-#define gouraudColorDelta (dblToCol(1 / 256.0))
-
-// Max recursive depth for a patch mesh shading fill.
-#define patchMaxDepth 6
-
-// Max delta allowed in any color component for a patch mesh shading
-// fill.
-#define patchColorDelta (dblToCol(1 / 256.0))
-
-//------------------------------------------------------------------------
-// Operator table
-//------------------------------------------------------------------------
-
-#ifdef WIN32 // this works around a bug in the VC7 compiler
-# pragma optimize("",off)
-#endif
-
-Operator Gfx::opTab[] = {
- {"\"", 3, {tchkNum, tchkNum, tchkString},
- &Gfx::opMoveSetShowText},
- {"'", 1, {tchkString},
- &Gfx::opMoveShowText},
- {"B", 0, {tchkNone},
- &Gfx::opFillStroke},
- {"B*", 0, {tchkNone},
- &Gfx::opEOFillStroke},
- {"BDC", 2, {tchkName, tchkProps},
- &Gfx::opBeginMarkedContent},
- {"BI", 0, {tchkNone},
- &Gfx::opBeginImage},
- {"BMC", 1, {tchkName},
- &Gfx::opBeginMarkedContent},
- {"BT", 0, {tchkNone},
- &Gfx::opBeginText},
- {"BX", 0, {tchkNone},
- &Gfx::opBeginIgnoreUndef},
- {"CS", 1, {tchkName},
- &Gfx::opSetStrokeColorSpace},
- {"DP", 2, {tchkName, tchkProps},
- &Gfx::opMarkPoint},
- {"Do", 1, {tchkName},
- &Gfx::opXObject},
- {"EI", 0, {tchkNone},
- &Gfx::opEndImage},
- {"EMC", 0, {tchkNone},
- &Gfx::opEndMarkedContent},
- {"ET", 0, {tchkNone},
- &Gfx::opEndText},
- {"EX", 0, {tchkNone},
- &Gfx::opEndIgnoreUndef},
- {"F", 0, {tchkNone},
- &Gfx::opFill},
- {"G", 1, {tchkNum},
- &Gfx::opSetStrokeGray},
- {"ID", 0, {tchkNone},
- &Gfx::opImageData},
- {"J", 1, {tchkInt},
- &Gfx::opSetLineCap},
- {"K", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opSetStrokeCMYKColor},
- {"M", 1, {tchkNum},
- &Gfx::opSetMiterLimit},
- {"MP", 1, {tchkName},
- &Gfx::opMarkPoint},
- {"Q", 0, {tchkNone},
- &Gfx::opRestore},
- {"RG", 3, {tchkNum, tchkNum, tchkNum},
- &Gfx::opSetStrokeRGBColor},
- {"S", 0, {tchkNone},
- &Gfx::opStroke},
- {"SC", -4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opSetStrokeColor},
- {"SCN", -33, {tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN},
- &Gfx::opSetStrokeColorN},
- {"T*", 0, {tchkNone},
- &Gfx::opTextNextLine},
- {"TD", 2, {tchkNum, tchkNum},
- &Gfx::opTextMoveSet},
- {"TJ", 1, {tchkArray},
- &Gfx::opShowSpaceText},
- {"TL", 1, {tchkNum},
- &Gfx::opSetTextLeading},
- {"Tc", 1, {tchkNum},
- &Gfx::opSetCharSpacing},
- {"Td", 2, {tchkNum, tchkNum},
- &Gfx::opTextMove},
- {"Tf", 2, {tchkName, tchkNum},
- &Gfx::opSetFont},
- {"Tj", 1, {tchkString},
- &Gfx::opShowText},
- {"Tm", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
- tchkNum, tchkNum},
- &Gfx::opSetTextMatrix},
- {"Tr", 1, {tchkInt},
- &Gfx::opSetTextRender},
- {"Ts", 1, {tchkNum},
- &Gfx::opSetTextRise},
- {"Tw", 1, {tchkNum},
- &Gfx::opSetWordSpacing},
- {"Tz", 1, {tchkNum},
- &Gfx::opSetHorizScaling},
- {"W", 0, {tchkNone},
- &Gfx::opClip},
- {"W*", 0, {tchkNone},
- &Gfx::opEOClip},
- {"b", 0, {tchkNone},
- &Gfx::opCloseFillStroke},
- {"b*", 0, {tchkNone},
- &Gfx::opCloseEOFillStroke},
- {"c", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
- tchkNum, tchkNum},
- &Gfx::opCurveTo},
- {"cm", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
- tchkNum, tchkNum},
- &Gfx::opConcat},
- {"cs", 1, {tchkName},
- &Gfx::opSetFillColorSpace},
- {"d", 2, {tchkArray, tchkNum},
- &Gfx::opSetDash},
- {"d0", 2, {tchkNum, tchkNum},
- &Gfx::opSetCharWidth},
- {"d1", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
- tchkNum, tchkNum},
- &Gfx::opSetCacheDevice},
- {"f", 0, {tchkNone},
- &Gfx::opFill},
- {"f*", 0, {tchkNone},
- &Gfx::opEOFill},
- {"g", 1, {tchkNum},
- &Gfx::opSetFillGray},
- {"gs", 1, {tchkName},
- &Gfx::opSetExtGState},
- {"h", 0, {tchkNone},
- &Gfx::opClosePath},
- {"i", 1, {tchkNum},
- &Gfx::opSetFlat},
- {"j", 1, {tchkInt},
- &Gfx::opSetLineJoin},
- {"k", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opSetFillCMYKColor},
- {"l", 2, {tchkNum, tchkNum},
- &Gfx::opLineTo},
- {"m", 2, {tchkNum, tchkNum},
- &Gfx::opMoveTo},
- {"n", 0, {tchkNone},
- &Gfx::opEndPath},
- {"q", 0, {tchkNone},
- &Gfx::opSave},
- {"re", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opRectangle},
- {"rg", 3, {tchkNum, tchkNum, tchkNum},
- &Gfx::opSetFillRGBColor},
- {"ri", 1, {tchkName},
- &Gfx::opSetRenderingIntent},
- {"s", 0, {tchkNone},
- &Gfx::opCloseStroke},
- {"sc", -4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opSetFillColor},
- {"scn", -33, {tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN, tchkSCN, tchkSCN, tchkSCN,
- tchkSCN},
- &Gfx::opSetFillColorN},
- {"sh", 1, {tchkName},
- &Gfx::opShFill},
- {"v", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opCurveTo1},
- {"w", 1, {tchkNum},
- &Gfx::opSetLineWidth},
- {"y", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
- &Gfx::opCurveTo2},
-};
-
-#ifdef WIN32 // this works around a bug in the VC7 compiler
-# pragma optimize("",on)
-#endif
-
-#define numOps (sizeof(opTab) / sizeof(Operator))
-
-//------------------------------------------------------------------------
-// GfxResources
-//------------------------------------------------------------------------
-
-GfxResources::GfxResources(XRef *xref, Dict *resDict, GfxResources *nextA) {
- Object obj1, obj2;
- Ref r;
-
- if (resDict) {
-
- // build font dictionary
- fonts = NULL;
- resDict->lookupNF("Font", &obj1);
- if (obj1.isRef()) {
- obj1.fetch(xref, &obj2);
- if (obj2.isDict()) {
- r = obj1.getRef();
- fonts = new GfxFontDict(xref, &r, obj2.getDict());
- }
- obj2.free();
- } else if (obj1.isDict()) {
- fonts = new GfxFontDict(xref, NULL, obj1.getDict());
- }
- obj1.free();
-
- // get XObject dictionary
- resDict->lookup("XObject", &xObjDict);
-
- // get color space dictionary
- resDict->lookup("ColorSpace", &colorSpaceDict);
-
- // get pattern dictionary
- resDict->lookup("Pattern", &patternDict);
-
- // get shading dictionary
- resDict->lookup("Shading", &shadingDict);
-
- // get graphics state parameter dictionary
- resDict->lookup("ExtGState", &gStateDict);
-
- } else {
- fonts = NULL;
- xObjDict.initNull();
- colorSpaceDict.initNull();
- patternDict.initNull();
- shadingDict.initNull();
- gStateDict.initNull();
- }
-
- next = nextA;
-}
-
-GfxResources::~GfxResources() {
- if (fonts) {
- delete fonts;
- }
- xObjDict.free();
- colorSpaceDict.free();
- patternDict.free();
- shadingDict.free();
- gStateDict.free();
-}
-
-GfxFont *GfxResources::lookupFont(char *name) {
- GfxFont *font;
- GfxResources *resPtr;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->fonts) {
- if ((font = resPtr->fonts->lookup(name)))
- return font;
- }
- }
- error(-1, "Unknown font tag '%s'", name);
- return NULL;
-}
-
-GBool GfxResources::lookupXObject(char *name, Object *obj) {
- GfxResources *resPtr;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->xObjDict.isDict()) {
- if (!resPtr->xObjDict.dictLookup(name, obj)->isNull())
- return gTrue;
- obj->free();
- }
- }
- error(-1, "XObject '%s' is unknown", name);
- return gFalse;
-}
-
-GBool GfxResources::lookupXObjectNF(char *name, Object *obj) {
- GfxResources *resPtr;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->xObjDict.isDict()) {
- if (!resPtr->xObjDict.dictLookupNF(name, obj)->isNull())
- return gTrue;
- obj->free();
- }
- }
- error(-1, "XObject '%s' is unknown", name);
- return gFalse;
-}
-
-void GfxResources::lookupColorSpace(char *name, Object *obj) {
- GfxResources *resPtr;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->colorSpaceDict.isDict()) {
- if (!resPtr->colorSpaceDict.dictLookup(name, obj)->isNull()) {
- return;
- }
- obj->free();
- }
- }
- obj->initNull();
-}
-
-GfxPattern *GfxResources::lookupPattern(char *name) {
- GfxResources *resPtr;
- GfxPattern *pattern;
- Object obj;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->patternDict.isDict()) {
- if (!resPtr->patternDict.dictLookup(name, &obj)->isNull()) {
- pattern = GfxPattern::parse(&obj);
- obj.free();
- return pattern;
- }
- obj.free();
- }
- }
- error(-1, "Unknown pattern '%s'", name);
- return NULL;
-}
-
-GfxShading *GfxResources::lookupShading(char *name) {
- GfxResources *resPtr;
- GfxShading *shading;
- Object obj;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->shadingDict.isDict()) {
- if (!resPtr->shadingDict.dictLookup(name, &obj)->isNull()) {
- shading = GfxShading::parse(&obj);
- obj.free();
- return shading;
- }
- obj.free();
- }
- }
- error(-1, "Unknown shading '%s'", name);
- return NULL;
-}
-
-GBool GfxResources::lookupGState(char *name, Object *obj) {
- GfxResources *resPtr;
-
- for (resPtr = this; resPtr; resPtr = resPtr->next) {
- if (resPtr->gStateDict.isDict()) {
- if (!resPtr->gStateDict.dictLookup(name, obj)->isNull()) {
- return gTrue;
- }
- obj->free();
- }
- }
- error(-1, "ExtGState '%s' is unknown", name);
- return gFalse;
-}
-
-//------------------------------------------------------------------------
-// Gfx
-//------------------------------------------------------------------------
-
-Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict,
- double hDPI, double vDPI, PDFRectangle *box,
- PDFRectangle *cropBox, int rotate,
- GBool (*abortCheckCbkA)(void *data),
- void *abortCheckCbkDataA) {
- int i;
-
- xref = xrefA;
- subPage = gFalse;
- printCommands = globalParams->getPrintCommands();
-
- // start the resource stack
- res = new GfxResources(xref, resDict, NULL);
-
- // initialize
- out = outA;
- state = new GfxState(hDPI, vDPI, box, rotate, out->upsideDown());
- fontChanged = gFalse;
- clip = clipNone;
- ignoreUndef = 0;
- out->startPage(pageNum, state);
- out->setDefaultCTM(state->getCTM());
- out->updateAll(state);
- for (i = 0; i < 6; ++i) {
- baseMatrix[i] = state->getCTM()[i];
- }
- formDepth = 0;
- parser = NULL;
- abortCheckCbk = abortCheckCbkA;
- abortCheckCbkData = abortCheckCbkDataA;
-
- // set crop box
- if (cropBox) {
- state->moveTo(cropBox->x1, cropBox->y1);
- state->lineTo(cropBox->x2, cropBox->y1);
- state->lineTo(cropBox->x2, cropBox->y2);
- state->lineTo(cropBox->x1, cropBox->y2);
- state->closePath();
- state->clip();
- out->clip(state);
- state->clearPath();
- }
-}
-
-Gfx::Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict,
- PDFRectangle *box, PDFRectangle *cropBox,
- GBool (*abortCheckCbkA)(void *data),
- void *abortCheckCbkDataA) {
- int i;
-
- xref = xrefA;
- subPage = gTrue;
- printCommands = globalParams->getPrintCommands();
-
- // start the resource stack
- res = new GfxResources(xref, resDict, NULL);
-
- // initialize
- out = outA;
- state = new GfxState(72, 72, box, 0, gFalse);
- fontChanged = gFalse;
- clip = clipNone;
- ignoreUndef = 0;
- for (i = 0; i < 6; ++i) {
- baseMatrix[i] = state->getCTM()[i];
- }
- formDepth = 0;
- parser = NULL;
- abortCheckCbk = abortCheckCbkA;
- abortCheckCbkData = abortCheckCbkDataA;
-
- // set crop box
- if (cropBox) {
- state->moveTo(cropBox->x1, cropBox->y1);
- state->lineTo(cropBox->x2, cropBox->y1);
- state->lineTo(cropBox->x2, cropBox->y2);
- state->lineTo(cropBox->x1, cropBox->y2);
- state->closePath();
- state->clip();
- out->clip(state);
- state->clearPath();
- }
-}
-
-Gfx::~Gfx() {
- while (state->hasSaves()) {
- restoreState();
- }
- if (!subPage) {
- out->endPage();
- }
- while (res) {
- popResources();
- }
- if (state) {
- delete state;
- }
-}
-
-void Gfx::display(Object *obj, GBool topLevel) {
- Object obj2;
- int i;
-
- if (obj->isArray()) {
- for (i = 0; i < obj->arrayGetLength(); ++i) {
- obj->arrayGet(i, &obj2);
- if (!obj2.isStream()) {
- error(-1, "Weird page contents");
- obj2.free();
- return;
- }
- obj2.free();
- }
- } else if (!obj->isStream()) {
- error(-1, "Weird page contents");
- return;
- }
- parser = new Parser(xref, new Lexer(xref, obj), gFalse);
- go(topLevel);
- delete parser;
- parser = NULL;
-}
-
-void Gfx::go(GBool topLevel) {
- Object obj;
- Object args[maxArgs];
- int numArgs, i;
- int lastAbortCheck;
-
- // scan a sequence of objects
- updateLevel = lastAbortCheck = 0;
- numArgs = 0;
- parser->getObj(&obj);
- while (!obj.isEOF()) {
-
- // got a command - execute it
- if (obj.isCmd()) {
- if (printCommands) {
- obj.print(stdout);
- for (i = 0; i < numArgs; ++i) {
- printf(" ");
- args[i].print(stdout);
- }
- printf("\n");
- fflush(stdout);
- }
- execOp(&obj, args, numArgs);
- obj.free();
- for (i = 0; i < numArgs; ++i)
- args[i].free();
- numArgs = 0;
-
- // periodically update display
- if (++updateLevel >= 20000) {
- out->dump();
- updateLevel = 0;
- }
-
- // check for an abort
- if (abortCheckCbk) {
- if (updateLevel - lastAbortCheck > 10) {
- if ((*abortCheckCbk)(abortCheckCbkData)) {
- break;
- }
- lastAbortCheck = updateLevel;
- }
- }
-
- // got an argument - save it
- } else if (numArgs < maxArgs) {
- args[numArgs++] = obj;
-
- // too many arguments - something is wrong
- } else {
- error(getPos(), "Too many args in content stream");
- if (printCommands) {
- printf("throwing away arg: ");
- obj.print(stdout);
- printf("\n");
- fflush(stdout);
- }
- obj.free();
- }
-
- // grab the next object
- parser->getObj(&obj);
- }
- obj.free();
-
- // args at end with no command
- if (numArgs > 0) {
- error(getPos(), "Leftover args in content stream");
- if (printCommands) {
- printf("%d leftovers:", numArgs);
- for (i = 0; i < numArgs; ++i) {
- printf(" ");
- args[i].print(stdout);
- }
- printf("\n");
- fflush(stdout);
- }
- for (i = 0; i < numArgs; ++i)
- args[i].free();
- }
-
- // update display
- if (topLevel && updateLevel > 0) {
- out->dump();
- }
-}
-
-void Gfx::execOp(Object *cmd, Object args[], int numArgs) {
- Operator *op;
- char *name;
- Object *argPtr;
- int i;
-
- // find operator
- name = cmd->getCmd();
- if (!(op = findOp(name))) {
- if (ignoreUndef == 0)
- error(getPos(), "Unknown operator '%s'", name);
- return;
- }
-
- // type check args
- argPtr = args;
- if (op->numArgs >= 0) {
- if (numArgs < op->numArgs) {
- error(getPos(), "Too few (%d) args to '%s' operator", numArgs, name);
- return;
- }
- if (numArgs > op->numArgs) {
-#if 0
- error(getPos(), "Too many (%d) args to '%s' operator", numArgs, name);
-#endif
- argPtr += numArgs - op->numArgs;
- numArgs = op->numArgs;
- }
- } else {
- if (numArgs > -op->numArgs) {
- error(getPos(), "Too many (%d) args to '%s' operator",
- numArgs, name);
- return;
- }
- }
- for (i = 0; i < numArgs; ++i) {
- if (!checkArg(&argPtr[i], op->tchk[i])) {
- error(getPos(), "Arg #%d to '%s' operator is wrong type (%s)",
- i, name, argPtr[i].getTypeName());
- return;
- }
- }
-
- // do it
- (this->*op->func)(argPtr, numArgs);
-}
-
-Operator *Gfx::findOp(char *name) {
- int a, b, m, cmp;
-
- a = -1;
- b = numOps;
- // invariant: opTab[a] < name < opTab[b]
- while (b - a > 1) {
- m = (a + b) / 2;
- cmp = strcmp(opTab[m].name, name);
- if (cmp < 0)
- a = m;
- else if (cmp > 0)
- b = m;
- else
- a = b = m;
- }
- if (cmp != 0)
- return NULL;
- return &opTab[a];
-}
-
-GBool Gfx::checkArg(Object *arg, TchkType type) {
- switch (type) {
- case tchkBool: return arg->isBool();
- case tchkInt: return arg->isInt();
- case tchkNum: return arg->isNum();
- case tchkString: return arg->isString();
- case tchkName: return arg->isName();
- case tchkArray: return arg->isArray();
- case tchkProps: return arg->isDict() || arg->isName();
- case tchkSCN: return arg->isNum() || arg->isName();
- case tchkNone: return gFalse;
- }
- return gFalse;
-}
-
-int Gfx::getPos() {
- return parser ? parser->getPos() : -1;
-}
-
-//------------------------------------------------------------------------
-// graphics state operators
-//------------------------------------------------------------------------
-
-void Gfx::opSave(Object * /*args[]*/, int /*numArgs*/) {
- saveState();
-}
-
-void Gfx::opRestore(Object * /*args[]*/, int /*numArgs*/) {
- restoreState();
-}
-
-void Gfx::opConcat(Object args[], int /*numArgs*/) {
- state->concatCTM(args[0].getNum(), args[1].getNum(),
- args[2].getNum(), args[3].getNum(),
- args[4].getNum(), args[5].getNum());
- out->updateCTM(state, args[0].getNum(), args[1].getNum(),
- args[2].getNum(), args[3].getNum(),
- args[4].getNum(), args[5].getNum());
- fontChanged = gTrue;
-}
-
-void Gfx::opSetDash(Object args[], int /*numArgs*/) {
- Array *a;
- int length;
- Object obj;
- double *dash;
- int i;
-
- a = args[0].getArray();
- length = a->getLength();
- if (length == 0) {
- dash = NULL;
- } else {
- dash = (double *)gmallocn(length, sizeof(double));
- for (i = 0; i < length; ++i) {
- dash[i] = a->get(i, &obj)->getNum();
- obj.free();
- }
- }
- state->setLineDash(dash, length, args[1].getNum());
- out->updateLineDash(state);
-}
-
-void Gfx::opSetFlat(Object args[], int /*numArgs*/) {
- state->setFlatness((int)args[0].getNum());
- out->updateFlatness(state);
-}
-
-void Gfx::opSetLineJoin(Object args[], int /*numArgs*/) {
- state->setLineJoin(args[0].getInt());
- out->updateLineJoin(state);
-}
-
-void Gfx::opSetLineCap(Object args[], int /*numArgs*/) {
- state->setLineCap(args[0].getInt());
- out->updateLineCap(state);
-}
-
-void Gfx::opSetMiterLimit(Object args[], int /*numArgs*/) {
- state->setMiterLimit(args[0].getNum());
- out->updateMiterLimit(state);
-}
-
-void Gfx::opSetLineWidth(Object args[], int /*numArgs*/) {
- state->setLineWidth(args[0].getNum());
- out->updateLineWidth(state);
-}
-
-void Gfx::opSetExtGState(Object args[], int /*numArgs*/) {
- Object obj1, obj2, obj3, obj4, obj5;
- GfxBlendMode mode;
- GBool haveFillOP;
- Function *funcs[4];
- GfxColor backdropColor;
- GBool haveBackdropColor;
- GfxColorSpace *blendingColorSpace;
- GBool alpha, isolated, knockout;
- int i;
-
- if (!res->lookupGState(args[0].getName(), &obj1)) {
- return;
- }
- if (!obj1.isDict()) {
- error(getPos(), "ExtGState '%s' is wrong type", args[0].getName());
- obj1.free();
- return;
- }
- if (printCommands) {
- printf(" gfx state dict: ");
- obj1.print();
- printf("\n");
- }
-
- // transparency support: blend mode, fill/stroke opacity
- if (!obj1.dictLookup("BM", &obj2)->isNull()) {
- if (state->parseBlendMode(&obj2, &mode)) {
- state->setBlendMode(mode);
- out->updateBlendMode(state);
- } else {
- error(getPos(), "Invalid blend mode in ExtGState");
- }
- }
- obj2.free();
- if (obj1.dictLookup("ca", &obj2)->isNum()) {
- state->setFillOpacity(obj2.getNum());
- out->updateFillOpacity(state);
- }
- obj2.free();
- if (obj1.dictLookup("CA", &obj2)->isNum()) {
- state->setStrokeOpacity(obj2.getNum());
- out->updateStrokeOpacity(state);
- }
- obj2.free();
-
- // fill/stroke overprint
- if ((haveFillOP = (obj1.dictLookup("op", &obj2)->isBool()))) {
- state->setFillOverprint(obj2.getBool());
- out->updateFillOverprint(state);
- }
- obj2.free();
- if (obj1.dictLookup("OP", &obj2)->isBool()) {
- state->setStrokeOverprint(obj2.getBool());
- out->updateStrokeOverprint(state);
- if (!haveFillOP) {
- state->setFillOverprint(obj2.getBool());
- out->updateFillOverprint(state);
- }
- }
- obj2.free();
-
- // stroke adjust
- if (obj1.dictLookup("SA", &obj2)->isBool()) {
- state->setStrokeAdjust(obj2.getBool());
- out->updateStrokeAdjust(state);
- }
- obj2.free();
-
- // transfer function
- if (obj1.dictLookup("TR2", &obj2)->isNull()) {
- obj2.free();
- obj1.dictLookup("TR", &obj2);
- }
- if (obj2.isName("Default") ||
- obj2.isName("Identity")) {
- funcs[0] = funcs[1] = funcs[2] = funcs[3] = NULL;
- state->setTransfer(funcs);
- out->updateTransfer(state);
- } else if (obj2.isArray() && obj2.arrayGetLength() == 4) {
- for (i = 0; i < 4; ++i) {
- obj2.arrayGet(i, &obj3);
- funcs[i] = Function::parse(&obj3);
- obj3.free();
- if (!funcs[i]) {
- break;
- }
- }
- if (i == 4) {
- state->setTransfer(funcs);
- out->updateTransfer(state);
- }
- } else if (obj2.isName() || obj2.isDict() || obj2.isStream()) {
- if ((funcs[0] = Function::parse(&obj2))) {
- funcs[1] = funcs[2] = funcs[3] = NULL;
- state->setTransfer(funcs);
- out->updateTransfer(state);
- }
- } else if (!obj2.isNull()) {
- error(getPos(), "Invalid transfer function in ExtGState");
- }
- obj2.free();
-
- // soft mask
- if (!obj1.dictLookup("SMask", &obj2)->isNull()) {
- if (obj2.isName("None")) {
- out->clearSoftMask(state);
- } else if (obj2.isDict()) {
- if (obj2.dictLookup("S", &obj3)->isName("Alpha")) {
- alpha = gTrue;
- } else { // "Luminosity"
- alpha = gFalse;
- }
- obj3.free();
- funcs[0] = NULL;
- if (!obj2.dictLookup("TR", &obj3)->isNull()) {
- funcs[0] = Function::parse(&obj3);
- if (funcs[0]->getInputSize() != 1 ||
- funcs[0]->getOutputSize() != 1) {
- error(getPos(),
- "Invalid transfer function in soft mask in ExtGState");
- delete funcs[0];
- funcs[0] = NULL;
- }
- }
- obj3.free();
- if ((haveBackdropColor = obj2.dictLookup("BC", &obj3)->isArray())) {
- for (i = 0; i < gfxColorMaxComps; ++i) {
- backdropColor.c[i] = 0;
- }
- for (i = 0; i < obj3.arrayGetLength() && i < gfxColorMaxComps; ++i) {
- obj3.arrayGet(i, &obj4);
- if (obj4.isNum()) {
- backdropColor.c[i] = dblToCol(obj4.getNum());
- }
- obj4.free();
- }
- }
- obj3.free();
- if (obj2.dictLookup("G", &obj3)->isStream()) {
- if (obj3.streamGetDict()->lookup("Group", &obj4)->isDict()) {
- blendingColorSpace = NULL;
- isolated = knockout = gFalse;
- if (!obj4.dictLookup("CS", &obj5)->isNull()) {
- blendingColorSpace = GfxColorSpace::parse(&obj5);
- }
- obj5.free();
- if (obj4.dictLookup("I", &obj5)->isBool()) {
- isolated = obj5.getBool();
- }
- obj5.free();
- if (obj4.dictLookup("K", &obj5)->isBool()) {
- knockout = obj5.getBool();
- }
- obj5.free();
- if (!haveBackdropColor) {
- if (blendingColorSpace) {
- blendingColorSpace->getDefaultColor(&backdropColor);
- } else {
- //~ need to get the parent or default color space (?)
- for (i = 0; i < gfxColorMaxComps; ++i) {
- backdropColor.c[i] = 0;
- }
- }
- }
- doSoftMask(&obj3, alpha, blendingColorSpace,
- isolated, knockout, funcs[0], &backdropColor);
- if (funcs[0]) {
- delete funcs[0];
- }
- } else {
- error(getPos(), "Invalid soft mask in ExtGState - missing group");
- }
- obj4.free();
- } else {
- error(getPos(), "Invalid soft mask in ExtGState - missing group");
- }
- obj3.free();
- } else if (!obj2.isNull()) {
- error(getPos(), "Invalid soft mask in ExtGState");
- }
- }
- obj2.free();
-
- obj1.free();
-}
-
-void Gfx::doSoftMask(Object *str, GBool alpha,
- GfxColorSpace *blendingColorSpace,
- GBool isolated, GBool knockout,
- Function *transferFunc, GfxColor *backdropColor) {
- Dict *dict, *resDict;
- double m[6], bbox[4];
- Object obj1, obj2;
- int i;
-
- // check for excessive recursion
- if (formDepth > 20) {
- return;
- }
-
- // get stream dict
- dict = str->streamGetDict();
-
- // check form type
- dict->lookup("FormType", &obj1);
- if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
- error(getPos(), "Unknown form type");
- }
- obj1.free();
-
- // get bounding box
- dict->lookup("BBox", &obj1);
- if (!obj1.isArray()) {
- obj1.free();
- error(getPos(), "Bad form bounding box");
- return;
- }
- for (i = 0; i < 4; ++i) {
- obj1.arrayGet(i, &obj2);
- bbox[i] = obj2.getNum();
- obj2.free();
- }
- obj1.free();
-
- // get matrix
- dict->lookup("Matrix", &obj1);
- if (obj1.isArray()) {
- for (i = 0; i < 6; ++i) {
- obj1.arrayGet(i, &obj2);
- m[i] = obj2.getNum();
- obj2.free();
- }
- } else {
- m[0] = 1; m[1] = 0;
- m[2] = 0; m[3] = 1;
- m[4] = 0; m[5] = 0;
- }
- obj1.free();
-
- // get resources
- dict->lookup("Resources", &obj1);
- resDict = obj1.isDict() ? obj1.getDict() : (Dict *)NULL;
-
- // draw it
- ++formDepth;
- doForm1(str, resDict, m, bbox, gTrue, gTrue,
- blendingColorSpace, isolated, knockout,
- alpha, transferFunc, backdropColor);
- --formDepth;
-
- if (blendingColorSpace) {
- delete blendingColorSpace;
- }
- obj1.free();
-}
-
-void Gfx::opSetRenderingIntent(Object * /*args[]*/, int /*numArgs*/) {
-}
-
-//------------------------------------------------------------------------
-// color operators
-//------------------------------------------------------------------------
-
-void Gfx::opSetFillGray(Object args[], int /*numArgs*/) {
- GfxColor color;
-
- state->setFillPattern(NULL);
- state->setFillColorSpace(new GfxDeviceGrayColorSpace());
- out->updateFillColorSpace(state);
- color.c[0] = dblToCol(args[0].getNum());
- state->setFillColor(&color);
- out->updateFillColor(state);
-}
-
-void Gfx::opSetStrokeGray(Object args[], int /*numArgs*/) {
- GfxColor color;
-
- state->setStrokePattern(NULL);
- state->setStrokeColorSpace(new GfxDeviceGrayColorSpace());
- out->updateStrokeColorSpace(state);
- color.c[0] = dblToCol(args[0].getNum());
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
-}
-
-void Gfx::opSetFillCMYKColor(Object args[], int /*numArgs*/) {
- GfxColor color;
- int i;
-
- state->setFillPattern(NULL);
- state->setFillColorSpace(new GfxDeviceCMYKColorSpace());
- out->updateFillColorSpace(state);
- for (i = 0; i < 4; ++i) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- state->setFillColor(&color);
- out->updateFillColor(state);
-}
-
-void Gfx::opSetStrokeCMYKColor(Object args[], int /*numArgs*/) {
- GfxColor color;
- int i;
-
- state->setStrokePattern(NULL);
- state->setStrokeColorSpace(new GfxDeviceCMYKColorSpace());
- out->updateStrokeColorSpace(state);
- for (i = 0; i < 4; ++i) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
-}
-
-void Gfx::opSetFillRGBColor(Object args[], int /*numArgs*/) {
- GfxColor color;
- int i;
-
- state->setFillPattern(NULL);
- state->setFillColorSpace(new GfxDeviceRGBColorSpace());
- out->updateFillColorSpace(state);
- for (i = 0; i < 3; ++i) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- state->setFillColor(&color);
- out->updateFillColor(state);
-}
-
-void Gfx::opSetStrokeRGBColor(Object args[], int /*numArgs*/) {
- GfxColor color;
- int i;
-
- state->setStrokePattern(NULL);
- state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
- out->updateStrokeColorSpace(state);
- for (i = 0; i < 3; ++i) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
-}
-
-void Gfx::opSetFillColorSpace(Object args[], int /*numArgs*/) {
- Object obj;
- GfxColorSpace *colorSpace;
- GfxColor color;
-
- state->setFillPattern(NULL);
- res->lookupColorSpace(args[0].getName(), &obj);
- if (obj.isNull()) {
- colorSpace = GfxColorSpace::parse(&args[0]);
- } else {
- colorSpace = GfxColorSpace::parse(&obj);
- }
- obj.free();
- if (colorSpace) {
- state->setFillColorSpace(colorSpace);
- out->updateFillColorSpace(state);
- colorSpace->getDefaultColor(&color);
- state->setFillColor(&color);
- out->updateFillColor(state);
- } else {
- error(getPos(), "Bad color space (fill)");
- }
-}
-
-void Gfx::opSetStrokeColorSpace(Object args[], int /*numArgs*/) {
- Object obj;
- GfxColorSpace *colorSpace;
- GfxColor color;
-
- state->setStrokePattern(NULL);
- res->lookupColorSpace(args[0].getName(), &obj);
- if (obj.isNull()) {
- colorSpace = GfxColorSpace::parse(&args[0]);
- } else {
- colorSpace = GfxColorSpace::parse(&obj);
- }
- obj.free();
- if (colorSpace) {
- state->setStrokeColorSpace(colorSpace);
- out->updateStrokeColorSpace(state);
- colorSpace->getDefaultColor(&color);
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
- } else {
- error(getPos(), "Bad color space (stroke)");
- }
-}
-
-void Gfx::opSetFillColor(Object args[], int numArgs) {
- GfxColor color;
- int i;
-
- if (numArgs != state->getFillColorSpace()->getNComps()) {
- error(getPos(), "Incorrect number of arguments in 'sc' command");
- return;
- }
- state->setFillPattern(NULL);
- for (i = 0; i < numArgs; ++i) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- state->setFillColor(&color);
- out->updateFillColor(state);
-}
-
-void Gfx::opSetStrokeColor(Object args[], int numArgs) {
- GfxColor color;
- int i;
-
- if (numArgs != state->getStrokeColorSpace()->getNComps()) {
- error(getPos(), "Incorrect number of arguments in 'SC' command");
- return;
- }
- state->setStrokePattern(NULL);
- for (i = 0; i < numArgs; ++i) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
-}
-
-void Gfx::opSetFillColorN(Object args[], int numArgs) {
- GfxColor color;
- GfxPattern *pattern;
- int i;
-
- if (state->getFillColorSpace()->getMode() == csPattern) {
- if (numArgs > 1) {
- if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() ||
- numArgs - 1 != ((GfxPatternColorSpace *)state->getFillColorSpace())
- ->getUnder()->getNComps()) {
- error(getPos(), "Incorrect number of arguments in 'scn' command");
- return;
- }
- for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
- if (args[i].isNum()) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- }
- state->setFillColor(&color);
- out->updateFillColor(state);
- }
- if (args[numArgs-1].isName() &&
- (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
- state->setFillPattern(pattern);
- }
-
- } else {
- if (numArgs != state->getFillColorSpace()->getNComps()) {
- error(getPos(), "Incorrect number of arguments in 'scn' command");
- return;
- }
- state->setFillPattern(NULL);
- for (i = 0; i < numArgs && i < gfxColorMaxComps; ++i) {
- if (args[i].isNum()) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- }
- state->setFillColor(&color);
- out->updateFillColor(state);
- }
-}
-
-void Gfx::opSetStrokeColorN(Object args[], int numArgs) {
- GfxColor color;
- GfxPattern *pattern;
- int i;
-
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- if (numArgs > 1) {
- if (!((GfxPatternColorSpace *)state->getStrokeColorSpace())
- ->getUnder() ||
- numArgs - 1 != ((GfxPatternColorSpace *)state->getStrokeColorSpace())
- ->getUnder()->getNComps()) {
- error(getPos(), "Incorrect number of arguments in 'SCN' command");
- return;
- }
- for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
- if (args[i].isNum()) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- }
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
- }
- if (args[numArgs-1].isName() &&
- (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
- state->setStrokePattern(pattern);
- }
-
- } else {
- if (numArgs != state->getStrokeColorSpace()->getNComps()) {
- error(getPos(), "Incorrect number of arguments in 'SCN' command");
- return;
- }
- state->setStrokePattern(NULL);
- for (i = 0; i < numArgs && i < gfxColorMaxComps; ++i) {
- if (args[i].isNum()) {
- color.c[i] = dblToCol(args[i].getNum());
- }
- }
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
- }
-}
-
-//------------------------------------------------------------------------
-// path segment operators
-//------------------------------------------------------------------------
-
-void Gfx::opMoveTo(Object args[], int /*numArgs*/) {
- state->moveTo(args[0].getNum(), args[1].getNum());
-}
-
-void Gfx::opLineTo(Object args[], int /*numArgs*/) {
- if (!state->isCurPt()) {
- error(getPos(), "No current point in lineto");
- return;
- }
- state->lineTo(args[0].getNum(), args[1].getNum());
-}
-
-void Gfx::opCurveTo(Object args[], int /*numArgs*/) {
- double x1, y1, x2, y2, x3, y3;
-
- if (!state->isCurPt()) {
- error(getPos(), "No current point in curveto");
- return;
- }
- x1 = args[0].getNum();
- y1 = args[1].getNum();
- x2 = args[2].getNum();
- y2 = args[3].getNum();
- x3 = args[4].getNum();
- y3 = args[5].getNum();
- state->curveTo(x1, y1, x2, y2, x3, y3);
-}
-
-void Gfx::opCurveTo1(Object args[], int /*numArgs*/) {
- double x1, y1, x2, y2, x3, y3;
-
- if (!state->isCurPt()) {
- error(getPos(), "No current point in curveto1");
- return;
- }
- x1 = state->getCurX();
- y1 = state->getCurY();
- x2 = args[0].getNum();
- y2 = args[1].getNum();
- x3 = args[2].getNum();
- y3 = args[3].getNum();
- state->curveTo(x1, y1, x2, y2, x3, y3);
-}
-
-void Gfx::opCurveTo2(Object args[], int /*numArgs*/) {
- double x1, y1, x2, y2, x3, y3;
-
- if (!state->isCurPt()) {
- error(getPos(), "No current point in curveto2");
- return;
- }
- x1 = args[0].getNum();
- y1 = args[1].getNum();
- x2 = args[2].getNum();
- y2 = args[3].getNum();
- x3 = x2;
- y3 = y2;
- state->curveTo(x1, y1, x2, y2, x3, y3);
-}
-
-void Gfx::opRectangle(Object args[], int /*numArgs*/) {
- double x, y, w, h;
-
- x = args[0].getNum();
- y = args[1].getNum();
- w = args[2].getNum();
- h = args[3].getNum();
- state->moveTo(x, y);
- state->lineTo(x + w, y);
- state->lineTo(x + w, y + h);
- state->lineTo(x, y + h);
- state->closePath();
-}
-
-void Gfx::opClosePath(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- error(getPos(), "No current point in closepath");
- return;
- }
- state->closePath();
-}
-
-//------------------------------------------------------------------------
-// path painting operators
-//------------------------------------------------------------------------
-
-void Gfx::opEndPath(Object * /*args[]*/, int /*numArgs*/) {
- doEndPath();
-}
-
-void Gfx::opStroke(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in stroke");
- return;
- }
- if (state->isPath()) {
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- doPatternStroke();
- } else {
- out->stroke(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opCloseStroke(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in closepath/stroke");
- return;
- }
- if (state->isPath()) {
- state->closePath();
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- doPatternStroke();
- } else {
- out->stroke(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opFill(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in fill");
- return;
- }
- if (state->isPath()) {
- if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gFalse);
- } else {
- out->fill(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opEOFill(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in eofill");
- return;
- }
- if (state->isPath()) {
- if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gTrue);
- } else {
- out->eoFill(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opFillStroke(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in fill/stroke");
- return;
- }
- if (state->isPath()) {
- if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gFalse);
- } else {
- out->fill(state);
- }
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- doPatternStroke();
- } else {
- out->stroke(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opCloseFillStroke(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in closepath/fill/stroke");
- return;
- }
- if (state->isPath()) {
- state->closePath();
- if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gFalse);
- } else {
- out->fill(state);
- }
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- doPatternStroke();
- } else {
- out->stroke(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opEOFillStroke(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in eofill/stroke");
- return;
- }
- if (state->isPath()) {
- if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gTrue);
- } else {
- out->eoFill(state);
- }
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- doPatternStroke();
- } else {
- out->stroke(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::opCloseEOFillStroke(Object * /*args[]*/, int /*numArgs*/) {
- if (!state->isCurPt()) {
- //error(getPos(), "No path in closepath/eofill/stroke");
- return;
- }
- if (state->isPath()) {
- state->closePath();
- if (state->getFillColorSpace()->getMode() == csPattern) {
- doPatternFill(gTrue);
- } else {
- out->eoFill(state);
- }
- if (state->getStrokeColorSpace()->getMode() == csPattern) {
- doPatternStroke();
- } else {
- out->stroke(state);
- }
- }
- doEndPath();
-}
-
-void Gfx::doPatternFill(GBool eoFill) {
- GfxPattern *pattern;
-
- // this is a bit of a kludge -- patterns can be really slow, so we
- // skip them if we're only doing text extraction, since they almost
- // certainly don't contain any text
- if (!out->needNonText()) {
- return;
- }
-
- if (!(pattern = state->getFillPattern())) {
- return;
- }
- switch (pattern->getType()) {
- case 1:
- doTilingPatternFill((GfxTilingPattern *)pattern, gFalse, eoFill);
- break;
- case 2:
- doShadingPatternFill((GfxShadingPattern *)pattern, gFalse, eoFill);
- break;
- default:
- error(getPos(), "Unimplemented pattern type (%d) in fill",
- pattern->getType());
- break;
- }
-}
-
-void Gfx::doPatternStroke() {
- GfxPattern *pattern;
-
- // this is a bit of a kludge -- patterns can be really slow, so we
- // skip them if we're only doing text extraction, since they almost
- // certainly don't contain any text
- if (!out->needNonText()) {
- return;
- }
-
- if (!(pattern = state->getStrokePattern())) {
- return;
- }
- switch (pattern->getType()) {
- case 1:
- doTilingPatternFill((GfxTilingPattern *)pattern, gTrue, gFalse);
- break;
- case 2:
- doShadingPatternFill((GfxShadingPattern *)pattern, gTrue, gFalse);
- break;
- default:
- error(getPos(), "Unimplemented pattern type (%d) in stroke",
- pattern->getType());
- break;
- }
-}
-
-void Gfx::doTilingPatternFill(GfxTilingPattern *tPat,
- GBool stroke, GBool eoFill) {
- GfxPatternColorSpace *patCS;
- GfxColorSpace *cs;
- GfxPath *savedPath;
- double xMin, yMin, xMax, yMax, x, y, x1, y1;
- double cxMin, cyMin, cxMax, cyMax;
- int xi0, yi0, xi1, yi1, xi, yi;
- double *ctm, *btm, *ptm;
- double m[6], ictm[6], m1[6], imb[6];
- double det;
- double xstep, ystep;
- int i;
-
- // get color space
- patCS = (GfxPatternColorSpace *)(stroke ? state->getStrokeColorSpace()
- : state->getFillColorSpace());
-
- // construct a (pattern space) -> (current space) transform matrix
- ctm = state->getCTM();
- btm = baseMatrix;
- ptm = tPat->getMatrix();
- // iCTM = invert CTM
- det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
- ictm[0] = ctm[3] * det;
- ictm[1] = -ctm[1] * det;
- ictm[2] = -ctm[2] * det;
- ictm[3] = ctm[0] * det;
- ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
- ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
- // m1 = PTM * BTM = PTM * base transform matrix
- m1[0] = ptm[0] * btm[0] + ptm[1] * btm[2];
- m1[1] = ptm[0] * btm[1] + ptm[1] * btm[3];
- m1[2] = ptm[2] * btm[0] + ptm[3] * btm[2];
- m1[3] = ptm[2] * btm[1] + ptm[3] * btm[3];
- m1[4] = ptm[4] * btm[0] + ptm[5] * btm[2] + btm[4];
- m1[5] = ptm[4] * btm[1] + ptm[5] * btm[3] + btm[5];
- // m = m1 * iCTM = (PTM * BTM) * (iCTM)
- m[0] = m1[0] * ictm[0] + m1[1] * ictm[2];
- m[1] = m1[0] * ictm[1] + m1[1] * ictm[3];
- m[2] = m1[2] * ictm[0] + m1[3] * ictm[2];
- m[3] = m1[2] * ictm[1] + m1[3] * ictm[3];
- m[4] = m1[4] * ictm[0] + m1[5] * ictm[2] + ictm[4];
- m[5] = m1[4] * ictm[1] + m1[5] * ictm[3] + ictm[5];
-
- // construct a (device space) -> (pattern space) transform matrix
- det = 1 / (m1[0] * m1[3] - m1[1] * m1[2]);
- imb[0] = m1[3] * det;
- imb[1] = -m1[1] * det;
- imb[2] = -m1[2] * det;
- imb[3] = m1[0] * det;
- imb[4] = (m1[2] * m1[5] - m1[3] * m1[4]) * det;
- imb[5] = (m1[1] * m1[4] - m1[0] * m1[5]) * det;
-
- // save current graphics state
- savedPath = state->getPath()->copy();
- saveState();
-
- // set underlying color space (for uncolored tiling patterns); set
- // various other parameters (stroke color, line width) to match
- // Adobe's behavior
- if (tPat->getPaintType() == 2 && (cs = patCS->getUnder())) {
- state->setFillColorSpace(cs->copy());
- out->updateFillColorSpace(state);
- state->setStrokeColorSpace(cs->copy());
- out->updateStrokeColorSpace(state);
- state->setStrokeColor(state->getFillColor());
- } else {
- state->setFillColorSpace(new GfxDeviceGrayColorSpace());
- out->updateFillColorSpace(state);
- state->setStrokeColorSpace(new GfxDeviceGrayColorSpace());
- out->updateStrokeColorSpace(state);
- }
- state->setFillPattern(NULL);
- out->updateFillColor(state);
- state->setStrokePattern(NULL);
- out->updateStrokeColor(state);
- if (!stroke) {
- state->setLineWidth(0);
- out->updateLineWidth(state);
- }
-
- // clip to current path
- if (stroke) {
- state->clipToStrokePath();
- out->clipToStrokePath(state);
- } else {
- state->clip();
- if (eoFill) {
- out->eoClip(state);
- } else {
- out->clip(state);
- }
- }
- state->clearPath();
-
- // get the clip region, check for empty
- state->getClipBBox(&cxMin, &cyMin, &cxMax, &cyMax);
- if (cxMin > cxMax || cyMin > cyMax) {
- goto err;
- }
-
- // transform clip region bbox to pattern space
- xMin = xMax = cxMin * imb[0] + cyMin * imb[2] + imb[4];
- yMin = yMax = cxMin * imb[1] + cyMin * imb[3] + imb[5];
- x1 = cxMin * imb[0] + cyMax * imb[2] + imb[4];
- y1 = cxMin * imb[1] + cyMax * imb[3] + imb[5];
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- x1 = cxMax * imb[0] + cyMin * imb[2] + imb[4];
- y1 = cxMax * imb[1] + cyMin * imb[3] + imb[5];
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- x1 = cxMax * imb[0] + cyMax * imb[2] + imb[4];
- y1 = cxMax * imb[1] + cyMax * imb[3] + imb[5];
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
-
- // draw the pattern
- //~ this should treat negative steps differently -- start at right/top
- //~ edge instead of left/bottom (?)
- xstep = fabs(tPat->getXStep());
- ystep = fabs(tPat->getYStep());
- xi0 = (int)ceil((xMin - tPat->getBBox()[2]) / xstep);
- xi1 = (int)floor((xMax - tPat->getBBox()[0]) / xstep) + 1;
- yi0 = (int)ceil((yMin - tPat->getBBox()[3]) / ystep);
- yi1 = (int)floor((yMax - tPat->getBBox()[1]) / ystep) + 1;
- for (i = 0; i < 4; ++i) {
- m1[i] = m[i];
- }
- if (out->useTilingPatternFill()) {
- m1[4] = m[4];
- m1[5] = m[5];
- out->tilingPatternFill(state, tPat->getContentStream(),
- tPat->getPaintType(), tPat->getResDict(),
- m1, tPat->getBBox(),
- xi0, yi0, xi1, yi1, xstep, ystep);
- } else {
- for (yi = yi0; yi < yi1; ++yi) {
- for (xi = xi0; xi < xi1; ++xi) {
- x = xi * xstep;
- y = yi * ystep;
- m1[4] = x * m[0] + y * m[2] + m[4];
- m1[5] = x * m[1] + y * m[3] + m[5];
- doForm1(tPat->getContentStream(), tPat->getResDict(),
- m1, tPat->getBBox());
- }
- }
- }
-
- // restore graphics state
- err:
- restoreState();
- state->setPath(savedPath);
-}
-
-void Gfx::doShadingPatternFill(GfxShadingPattern *sPat,
- GBool stroke, GBool eoFill) {
- GfxShading *shading;
- GfxPath *savedPath;
- double *ctm, *btm, *ptm;
- double m[6], ictm[6], m1[6];
- double xMin, yMin, xMax, yMax;
- double det;
-
- shading = sPat->getShading();
-
- // save current graphics state
- savedPath = state->getPath()->copy();
- saveState();
-
- // clip to bbox
- if (shading->getHasBBox()) {
- shading->getBBox(&xMin, &yMin, &xMax, &yMax);
- state->moveTo(xMin, yMin);
- state->lineTo(xMax, yMin);
- state->lineTo(xMax, yMax);
- state->lineTo(xMin, yMax);
- state->closePath();
- state->clip();
- out->clip(state);
- state->setPath(savedPath->copy());
- }
-
- // clip to current path
- if (stroke) {
- state->clipToStrokePath();
- out->clipToStrokePath(state);
- } else {
- state->clip();
- if (eoFill) {
- out->eoClip(state);
- } else {
- out->clip(state);
- }
- }
-
- // set the color space
- state->setFillColorSpace(shading->getColorSpace()->copy());
- out->updateFillColorSpace(state);
-
- // background color fill
- if (shading->getHasBackground()) {
- state->setFillColor(shading->getBackground());
- out->updateFillColor(state);
- out->fill(state);
- }
- state->clearPath();
-
- // construct a (pattern space) -> (current space) transform matrix
- ctm = state->getCTM();
- btm = baseMatrix;
- ptm = sPat->getMatrix();
- // iCTM = invert CTM
- det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
- ictm[0] = ctm[3] * det;
- ictm[1] = -ctm[1] * det;
- ictm[2] = -ctm[2] * det;
- ictm[3] = ctm[0] * det;
- ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
- ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
- // m1 = PTM * BTM = PTM * base transform matrix
- m1[0] = ptm[0] * btm[0] + ptm[1] * btm[2];
- m1[1] = ptm[0] * btm[1] + ptm[1] * btm[3];
- m1[2] = ptm[2] * btm[0] + ptm[3] * btm[2];
- m1[3] = ptm[2] * btm[1] + ptm[3] * btm[3];
- m1[4] = ptm[4] * btm[0] + ptm[5] * btm[2] + btm[4];
- m1[5] = ptm[4] * btm[1] + ptm[5] * btm[3] + btm[5];
- // m = m1 * iCTM = (PTM * BTM) * (iCTM)
- m[0] = m1[0] * ictm[0] + m1[1] * ictm[2];
- m[1] = m1[0] * ictm[1] + m1[1] * ictm[3];
- m[2] = m1[2] * ictm[0] + m1[3] * ictm[2];
- m[3] = m1[2] * ictm[1] + m1[3] * ictm[3];
- m[4] = m1[4] * ictm[0] + m1[5] * ictm[2] + ictm[4];
- m[5] = m1[4] * ictm[1] + m1[5] * ictm[3] + ictm[5];
-
- // set the new matrix
- state->concatCTM(m[0], m[1], m[2], m[3], m[4], m[5]);
- out->updateCTM(state, m[0], m[1], m[2], m[3], m[4], m[5]);
-
-#if 1 //~tmp: turn off anti-aliasing temporarily
- GBool vaa = out->getVectorAntialias();
- if (vaa) {
- out->setVectorAntialias(gFalse);
- }
-#endif
-
- // do shading type-specific operations
- switch (shading->getType()) {
- case 1:
- doFunctionShFill((GfxFunctionShading *)shading);
- break;
- case 2:
- doAxialShFill((GfxAxialShading *)shading);
- break;
- case 3:
- doRadialShFill((GfxRadialShading *)shading);
- break;
- case 4:
- case 5:
- doGouraudTriangleShFill((GfxGouraudTriangleShading *)shading);
- break;
- case 6:
- case 7:
- doPatchMeshShFill((GfxPatchMeshShading *)shading);
- break;
- }
-
-#if 1 //~tmp: turn off anti-aliasing temporarily
- if (vaa) {
- out->setVectorAntialias(gTrue);
- }
-#endif
-
- // restore graphics state
- restoreState();
- state->setPath(savedPath);
-}
-
-void Gfx::opShFill(Object args[], int /*numArgs*/) {
- GfxShading *shading;
- GfxPath *savedPath;
- double xMin, yMin, xMax, yMax;
-
- if (!(shading = res->lookupShading(args[0].getName()))) {
- return;
- }
-
- // save current graphics state
- savedPath = state->getPath()->copy();
- saveState();
-
- // clip to bbox
- if (shading->getHasBBox()) {
- shading->getBBox(&xMin, &yMin, &xMax, &yMax);
- state->moveTo(xMin, yMin);
- state->lineTo(xMax, yMin);
- state->lineTo(xMax, yMax);
- state->lineTo(xMin, yMax);
- state->closePath();
- state->clip();
- out->clip(state);
- state->clearPath();
- }
-
- // set the color space
- state->setFillColorSpace(shading->getColorSpace()->copy());
- out->updateFillColorSpace(state);
-
-#if 1 //~tmp: turn off anti-aliasing temporarily
- GBool vaa = out->getVectorAntialias();
- if (vaa) {
- out->setVectorAntialias(gFalse);
- }
-#endif
-
- // do shading type-specific operations
- switch (shading->getType()) {
- case 1:
- doFunctionShFill((GfxFunctionShading *)shading);
- break;
- case 2:
- doAxialShFill((GfxAxialShading *)shading);
- break;
- case 3:
- doRadialShFill((GfxRadialShading *)shading);
- break;
- case 4:
- case 5:
- doGouraudTriangleShFill((GfxGouraudTriangleShading *)shading);
- break;
- case 6:
- case 7:
- doPatchMeshShFill((GfxPatchMeshShading *)shading);
- break;
- }
-
-#if 1 //~tmp: turn off anti-aliasing temporarily
- if (vaa) {
- out->setVectorAntialias(gTrue);
- }
-#endif
-
- // restore graphics state
- restoreState();
- state->setPath(savedPath);
-
- delete shading;
-}
-
-void Gfx::doFunctionShFill(GfxFunctionShading *shading) {
- double x0, y0, x1, y1;
- GfxColor colors[4];
-
- if (out->useShadedFills() &&
- out->functionShadedFill(state, shading)) {
- return;
- }
-
- shading->getDomain(&x0, &y0, &x1, &y1);
- shading->getColor(x0, y0, &colors[0]);
- shading->getColor(x0, y1, &colors[1]);
- shading->getColor(x1, y0, &colors[2]);
- shading->getColor(x1, y1, &colors[3]);
- doFunctionShFill1(shading, x0, y0, x1, y1, colors, 0);
-}
-
-void Gfx::doFunctionShFill1(GfxFunctionShading *shading,
- double x0, double y0,
- double x1, double y1,
- GfxColor *colors, int depth) {
- GfxColor fillColor;
- GfxColor color0M, color1M, colorM0, colorM1, colorMM;
- GfxColor colors2[4];
- double *matrix;
- double xM, yM;
- int nComps, i, j;
-
- nComps = shading->getColorSpace()->getNComps();
- matrix = shading->getMatrix();
-
- // compare the four corner colors
- for (i = 0; i < 4; ++i) {
- for (j = 0; j < nComps; ++j) {
- if (abs(colors[i].c[j] - colors[(i+1)&3].c[j]) > functionColorDelta) {
- break;
- }
- }
- if (j < nComps) {
- break;
- }
- }
-
- // center of the rectangle
- xM = 0.5 * (x0 + x1);
- yM = 0.5 * (y0 + y1);
-
- // the four corner colors are close (or we hit the recursive limit)
- // -- fill the rectangle; but require at least one subdivision
- // (depth==0) to avoid problems when the four outer corners of the
- // shaded region are the same color
- if ((i == 4 && depth > 0) || depth == functionMaxDepth) {
-
- // use the center color
- shading->getColor(xM, yM, &fillColor);
- state->setFillColor(&fillColor);
- out->updateFillColor(state);
-
- // fill the rectangle
- state->moveTo(x0 * matrix[0] + y0 * matrix[2] + matrix[4],
- x0 * matrix[1] + y0 * matrix[3] + matrix[5]);
- state->lineTo(x1 * matrix[0] + y0 * matrix[2] + matrix[4],
- x1 * matrix[1] + y0 * matrix[3] + matrix[5]);
- state->lineTo(x1 * matrix[0] + y1 * matrix[2] + matrix[4],
- x1 * matrix[1] + y1 * matrix[3] + matrix[5]);
- state->lineTo(x0 * matrix[0] + y1 * matrix[2] + matrix[4],
- x0 * matrix[1] + y1 * matrix[3] + matrix[5]);
- state->closePath();
- out->fill(state);
- state->clearPath();
-
- // the four corner colors are not close enough -- subdivide the
- // rectangle
- } else {
-
- // colors[0] colorM0 colors[2]
- // (x0,y0) (xM,y0) (x1,y0)
- // +----------+----------+
- // | | |
- // | UL | UR |
- // color0M | colorMM | color1M
- // (x0,yM) +----------+----------+ (x1,yM)
- // | (xM,yM) |
- // | LL | LR |
- // | | |
- // +----------+----------+
- // colors[1] colorM1 colors[3]
- // (x0,y1) (xM,y1) (x1,y1)
-
- shading->getColor(x0, yM, &color0M);
- shading->getColor(x1, yM, &color1M);
- shading->getColor(xM, y0, &colorM0);
- shading->getColor(xM, y1, &colorM1);
- shading->getColor(xM, yM, &colorMM);
-
- // upper-left sub-rectangle
- colors2[0] = colors[0];
- colors2[1] = color0M;
- colors2[2] = colorM0;
- colors2[3] = colorMM;
- doFunctionShFill1(shading, x0, y0, xM, yM, colors2, depth + 1);
-
- // lower-left sub-rectangle
- colors2[0] = color0M;
- colors2[1] = colors[1];
- colors2[2] = colorMM;
- colors2[3] = colorM1;
- doFunctionShFill1(shading, x0, yM, xM, y1, colors2, depth + 1);
-
- // upper-right sub-rectangle
- colors2[0] = colorM0;
- colors2[1] = colorMM;
- colors2[2] = colors[2];
- colors2[3] = color1M;
- doFunctionShFill1(shading, xM, y0, x1, yM, colors2, depth + 1);
-
- // lower-right sub-rectangle
- colors2[0] = colorMM;
- colors2[1] = colorM1;
- colors2[2] = color1M;
- colors2[3] = colors[3];
- doFunctionShFill1(shading, xM, yM, x1, y1, colors2, depth + 1);
- }
-}
-
-void Gfx::doAxialShFill(GfxAxialShading *shading) {
- double xMin, yMin, xMax, yMax;
- double x0, y0, x1, y1;
- double dx, dy, mul;
- GBool dxZero, dyZero;
- double tMin, tMax, t, tx, ty;
- double s[4], sMin, sMax, tmp;
- double ux0, uy0, ux1, uy1, vx0, vy0, vx1, vy1;
- double t0, t1, tt;
- double ta[axialMaxSplits + 1];
- int next[axialMaxSplits + 1];
- GfxColor color0, color1;
- int nComps;
- int i, j, k, kk;
-
- if (out->useShadedFills() &&
- out->axialShadedFill(state, shading)) {
- return;
- }
-
- // get the clip region bbox
- state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
-
- // compute min and max t values, based on the four corners of the
- // clip region bbox
- shading->getCoords(&x0, &y0, &x1, &y1);
- dx = x1 - x0;
- dy = y1 - y0;
- dxZero = fabs(dx) < 0.01;
- dyZero = fabs(dy) < 0.01;
- if (dxZero && dyZero) {
- tMin = tMax = 0;
- } else {
- mul = 1 / (dx * dx + dy * dy);
- tMin = tMax = ((xMin - x0) * dx + (yMin - y0) * dy) * mul;
- t = ((xMin - x0) * dx + (yMax - y0) * dy) * mul;
- if (t < tMin) {
- tMin = t;
- } else if (t > tMax) {
- tMax = t;
- }
- t = ((xMax - x0) * dx + (yMin - y0) * dy) * mul;
- if (t < tMin) {
- tMin = t;
- } else if (t > tMax) {
- tMax = t;
- }
- t = ((xMax - x0) * dx + (yMax - y0) * dy) * mul;
- if (t < tMin) {
- tMin = t;
- } else if (t > tMax) {
- tMax = t;
- }
- if (tMin < 0 && !shading->getExtend0()) {
- tMin = 0;
- }
- if (tMax > 1 && !shading->getExtend1()) {
- tMax = 1;
- }
- }
-
- // get the function domain
- t0 = shading->getDomain0();
- t1 = shading->getDomain1();
-
- // Traverse the t axis and do the shading.
- //
- // For each point (tx, ty) on the t axis, consider a line through
- // that point perpendicular to the t axis:
- //
- // x(s) = tx + s * -dy --> s = (x - tx) / -dy
- // y(s) = ty + s * dx --> s = (y - ty) / dx
- //
- // Then look at the intersection of this line with the bounding box
- // (xMin, yMin, xMax, yMax). In the general case, there are four
- // intersection points:
- //
- // s0 = (xMin - tx) / -dy
- // s1 = (xMax - tx) / -dy
- // s2 = (yMin - ty) / dx
- // s3 = (yMax - ty) / dx
- //
- // and we want the middle two s values.
- //
- // In the case where dx = 0, take s0 and s1; in the case where dy =
- // 0, take s2 and s3.
- //
- // Each filled polygon is bounded by two of these line segments
- // perpdendicular to the t axis.
- //
- // The t axis is bisected into smaller regions until the color
- // difference across a region is small enough, and then the region
- // is painted with a single color.
-
- // set up: require at least one split to avoid problems when the two
- // ends of the t axis have the same color
- nComps = shading->getColorSpace()->getNComps();
- ta[0] = tMin;
- next[0] = axialMaxSplits / 2;
- ta[axialMaxSplits / 2] = 0.5 * (tMin + tMax);
- next[axialMaxSplits / 2] = axialMaxSplits;
- ta[axialMaxSplits] = tMax;
-
- // compute the color at t = tMin
- if (tMin < 0) {
- tt = t0;
- } else if (tMin > 1) {
- tt = t1;
- } else {
- tt = t0 + (t1 - t0) * tMin;
- }
- shading->getColor(tt, &color0);
-
- // compute the coordinates of the point on the t axis at t = tMin;
- // then compute the intersection of the perpendicular line with the
- // bounding box
- tx = x0 + tMin * dx;
- ty = y0 + tMin * dy;
- if (dxZero && dyZero) {
- sMin = sMax = 0;
- } else if (dxZero) {
- sMin = (xMin - tx) / -dy;
- sMax = (xMax - tx) / -dy;
- if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
- } else if (dyZero) {
- sMin = (yMin - ty) / dx;
- sMax = (yMax - ty) / dx;
- if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
- } else {
- s[0] = (yMin - ty) / dx;
- s[1] = (yMax - ty) / dx;
- s[2] = (xMin - tx) / -dy;
- s[3] = (xMax - tx) / -dy;
- for (j = 0; j < 3; ++j) {
- kk = j;
- for (k = j + 1; k < 4; ++k) {
- if (s[k] < s[kk]) {
- kk = k;
- }
- }
- tmp = s[j]; s[j] = s[kk]; s[kk] = tmp;
- }
- sMin = s[1];
- sMax = s[2];
- }
- ux0 = tx - sMin * dy;
- uy0 = ty + sMin * dx;
- vx0 = tx - sMax * dy;
- vy0 = ty + sMax * dx;
-
- i = 0;
- while (i < axialMaxSplits) {
-
- // bisect until color difference is small enough or we hit the
- // bisection limit
- j = next[i];
- while (j > i + 1) {
- if (ta[j] < 0) {
- tt = t0;
- } else if (ta[j] > 1) {
- tt = t1;
- } else {
- tt = t0 + (t1 - t0) * ta[j];
- }
- shading->getColor(tt, &color1);
- for (k = 0; k < nComps; ++k) {
- if (abs(color1.c[k] - color0.c[k]) > axialColorDelta) {
- break;
- }
- }
- if (k == nComps) {
- break;
- }
- k = (i + j) / 2;
- ta[k] = 0.5 * (ta[i] + ta[j]);
- next[i] = k;
- next[k] = j;
- j = k;
- }
-
- // use the average of the colors of the two sides of the region
- for (k = 0; k < nComps; ++k) {
- color0.c[k] = (color0.c[k] + color1.c[k]) / 2;
- }
-
- // compute the coordinates of the point on the t axis; then
- // compute the intersection of the perpendicular line with the
- // bounding box
- tx = x0 + ta[j] * dx;
- ty = y0 + ta[j] * dy;
- if (dxZero && dyZero) {
- sMin = sMax = 0;
- } else if (dxZero) {
- sMin = (xMin - tx) / -dy;
- sMax = (xMax - tx) / -dy;
- if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
- } else if (dyZero) {
- sMin = (yMin - ty) / dx;
- sMax = (yMax - ty) / dx;
- if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
- } else {
- s[0] = (yMin - ty) / dx;
- s[1] = (yMax - ty) / dx;
- s[2] = (xMin - tx) / -dy;
- s[3] = (xMax - tx) / -dy;
- for (j = 0; j < 3; ++j) {
- kk = j;
- for (k = j + 1; k < 4; ++k) {
- if (s[k] < s[kk]) {
- kk = k;
- }
- }
- tmp = s[j]; s[j] = s[kk]; s[kk] = tmp;
- }
- sMin = s[1];
- sMax = s[2];
- }
- ux1 = tx - sMin * dy;
- uy1 = ty + sMin * dx;
- vx1 = tx - sMax * dy;
- vy1 = ty + sMax * dx;
-
- // set the color
- state->setFillColor(&color0);
- out->updateFillColor(state);
-
- // fill the region
- state->moveTo(ux0, uy0);
- state->lineTo(vx0, vy0);
- state->lineTo(vx1, vy1);
- state->lineTo(ux1, uy1);
- state->closePath();
- out->fill(state);
- state->clearPath();
-
- // set up for next region
- ux0 = ux1;
- uy0 = uy1;
- vx0 = vx1;
- vy0 = vy1;
- color0 = color1;
- i = next[i];
- }
-}
-
-void Gfx::doRadialShFill(GfxRadialShading *shading) {
- double xMin, yMin, xMax, yMax;
- double x0, y0, r0, x1, y1, r1, t0, t1;
- int nComps;
- GfxColor colorA, colorB;
- double xa, ya, xb, yb, ra, rb;
- double ta, tb, sa, sb;
- double sz, xz, yz, sMin, sMax;
- GBool enclosed;
- int ia, ib, k, n;
- double *ctm;
- double theta, alpha, angle, t;
-
- if (out->useShadedFills() &&
- out->radialShadedFill(state, shading)) {
- return;
- }
-
- // get the shading info
- shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
- t0 = shading->getDomain0();
- t1 = shading->getDomain1();
- nComps = shading->getColorSpace()->getNComps();
-
- // Compute the point at which r(s) = 0; check for the enclosed
- // circles case; and compute the angles for the tangent lines.
- if (x0 == x1 && y0 == y1) {
- enclosed = gTrue;
- theta = 0; // make gcc happy
- sz = 0; // make gcc happy
- } else if (r0 == r1) {
- enclosed = gFalse;
- theta = 0;
- sz = 0; // make gcc happy
- } else {
- sz = -r0 / (r1 - r0);
- xz = x0 + sz * (x1 - x0);
- yz = y0 + sz * (y1 - y0);
- enclosed = (xz - x0) * (xz - x0) + (yz - y0) * (yz - y0) <= r0 * r0;
- theta = asin(r0 / sqrt((x0 - xz) * (x0 - xz) + (y0 - yz) * (y0 - yz)));
- if (r0 > r1) {
- theta = -theta;
- }
- }
- if (enclosed) {
- alpha = 0;
- } else {
- alpha = atan2(y1 - y0, x1 - x0);
- }
-
- // compute the (possibly extended) s range
- state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
- if (enclosed) {
- sMin = 0;
- sMax = 1;
- } else {
- sMin = 1;
- sMax = 0;
- // solve for x(s) + r(s) = xMin
- if ((x1 + r1) - (x0 + r0) != 0) {
- sa = (xMin - (x0 + r0)) / ((x1 + r1) - (x0 + r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // solve for x(s) - r(s) = xMax
- if ((x1 - r1) - (x0 - r0) != 0) {
- sa = (xMax - (x0 - r0)) / ((x1 - r1) - (x0 - r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // solve for y(s) + r(s) = yMin
- if ((y1 + r1) - (y0 + r0) != 0) {
- sa = (yMin - (y0 + r0)) / ((y1 + r1) - (y0 + r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // solve for y(s) - r(s) = yMax
- if ((y1 - r1) - (y0 - r0) != 0) {
- sa = (yMax - (y0 - r0)) / ((y1 - r1) - (y0 - r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // check against sz
- if (r0 < r1) {
- if (sMin < sz) {
- sMin = sz;
- }
- } else if (r0 > r1) {
- if (sMax > sz) {
- sMax = sz;
- }
- }
- // check the 'extend' flags
- if (!shading->getExtend0() && sMin < 0) {
- sMin = 0;
- }
- if (!shading->getExtend1() && sMax > 1) {
- sMax = 1;
- }
- }
-
- // compute the number of steps into which circles must be divided to
- // achieve a curve flatness of 0.1 pixel in device space for the
- // largest circle (note that "device space" is 72 dpi when generating
- // PostScript, hence the relatively small 0.1 pixel accuracy)
- ctm = state->getCTM();
- t = fabs(ctm[0]);
- if (fabs(ctm[1]) > t) {
- t = fabs(ctm[1]);
- }
- if (fabs(ctm[2]) > t) {
- t = fabs(ctm[2]);
- }
- if (fabs(ctm[3]) > t) {
- t = fabs(ctm[3]);
- }
- if (r0 > r1) {
- t *= r0;
- } else {
- t *= r1;
- }
- if (t < 1) {
- n = 3;
- } else {
- n = (int)(M_PI / acos(1 - 0.1 / t));
- if (n < 3) {
- n = 3;
- } else if (n > 200) {
- n = 200;
- }
- }
-
- // setup for the start circle
- ia = 0;
- sa = sMin;
- ta = t0 + sa * (t1 - t0);
- xa = x0 + sa * (x1 - x0);
- ya = y0 + sa * (y1 - y0);
- ra = r0 + sa * (r1 - r0);
- if (ta < t0) {
- shading->getColor(t0, &colorA);
- } else if (ta > t1) {
- shading->getColor(t1, &colorA);
- } else {
- shading->getColor(ta, &colorA);
- }
-
- // fill the circles
- while (ia < radialMaxSplits) {
-
- // go as far along the t axis (toward t1) as we can, such that the
- // color difference is within the tolerance (radialColorDelta) --
- // this uses bisection (between the current value, t, and t1),
- // limited to radialMaxSplits points along the t axis; require at
- // least one split to avoid problems when the innermost and
- // outermost colors are the same
- ib = radialMaxSplits;
- sb = sMax;
- tb = t0 + sb * (t1 - t0);
- if (tb < t0) {
- shading->getColor(t0, &colorB);
- } else if (tb > t1) {
- shading->getColor(t1, &colorB);
- } else {
- shading->getColor(tb, &colorB);
- }
- while (ib - ia > 1) {
- for (k = 0; k < nComps; ++k) {
- if (abs(colorB.c[k] - colorA.c[k]) > radialColorDelta) {
- break;
- }
- }
- if (k == nComps && ib < radialMaxSplits) {
- break;
- }
- ib = (ia + ib) / 2;
- sb = sMin + ((double)ib / (double)radialMaxSplits) * (sMax - sMin);
- tb = t0 + sb * (t1 - t0);
- if (tb < t0) {
- shading->getColor(t0, &colorB);
- } else if (tb > t1) {
- shading->getColor(t1, &colorB);
- } else {
- shading->getColor(tb, &colorB);
- }
- }
-
- // compute center and radius of the circle
- xb = x0 + sb * (x1 - x0);
- yb = y0 + sb * (y1 - y0);
- rb = r0 + sb * (r1 - r0);
-
- // use the average of the colors at the two circles
- for (k = 0; k < nComps; ++k) {
- colorA.c[k] = (colorA.c[k] + colorB.c[k]) / 2;
- }
- state->setFillColor(&colorA);
- out->updateFillColor(state);
-
- if (enclosed) {
-
- // construct path for first circle (counterclockwise)
- state->moveTo(xa + ra, ya);
- for (k = 1; k < n; ++k) {
- angle = ((double)k / (double)n) * 2 * M_PI;
- state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
- }
- state->closePath();
-
- // construct and append path for second circle (clockwise)
- state->moveTo(xb + rb, yb);
- for (k = 1; k < n; ++k) {
- angle = -((double)k / (double)n) * 2 * M_PI;
- state->lineTo(xb + rb * cos(angle), yb + rb * sin(angle));
- }
- state->closePath();
-
- } else {
-
- // construct the first subpath (clockwise)
- state->moveTo(xa + ra * cos(alpha + theta + 0.5 * M_PI),
- ya + ra * sin(alpha + theta + 0.5 * M_PI));
- for (k = 0; k < n; ++k) {
- angle = alpha + theta + 0.5 * M_PI
- - ((double)k / (double)n) * (2 * theta + M_PI);
- state->lineTo(xb + rb * cos(angle), yb + rb * sin(angle));
- }
- for (k = 0; k < n; ++k) {
- angle = alpha - theta - 0.5 * M_PI
- + ((double)k / (double)n) * (2 * theta - M_PI);
- state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
- }
- state->closePath();
-
- // construct the second subpath (counterclockwise)
- state->moveTo(xa + ra * cos(alpha + theta + 0.5 * M_PI),
- ya + ra * sin(alpha + theta + 0.5 * M_PI));
- for (k = 0; k < n; ++k) {
- angle = alpha + theta + 0.5 * M_PI
- + ((double)k / (double)n) * (-2 * theta + M_PI);
- state->lineTo(xb + rb * cos(angle), yb + rb * sin(angle));
- }
- for (k = 0; k < n; ++k) {
- angle = alpha - theta - 0.5 * M_PI
- + ((double)k / (double)n) * (2 * theta + M_PI);
- state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
- }
- state->closePath();
- }
-
- // fill the path
- out->fill(state);
- state->clearPath();
-
- // step to the next value of t
- ia = ib;
- sa = sb;
- ta = tb;
- xa = xb;
- ya = yb;
- ra = rb;
- colorA = colorB;
- }
-
- if (enclosed) {
- // extend the smaller circle
- if ((shading->getExtend0() && r0 <= r1) ||
- (shading->getExtend1() && r1 < r0)) {
- if (r0 <= r1) {
- ta = t0;
- ra = r0;
- xa = x0;
- ya = y0;
- } else {
- ta = t1;
- ra = r1;
- xa = x1;
- ya = y1;
- }
- shading->getColor(ta, &colorA);
- state->setFillColor(&colorA);
- out->updateFillColor(state);
- state->moveTo(xa + ra, ya);
- for (k = 1; k < n; ++k) {
- angle = ((double)k / (double)n) * 2 * M_PI;
- state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
- }
- state->closePath();
- out->fill(state);
- state->clearPath();
- }
-
- // extend the larger circle
- if ((shading->getExtend0() && r0 > r1) ||
- (shading->getExtend1() && r1 >= r0)) {
- if (r0 > r1) {
- ta = t0;
- ra = r0;
- xa = x0;
- ya = y0;
- } else {
- ta = t1;
- ra = r1;
- xa = x1;
- ya = y1;
- }
- shading->getColor(ta, &colorA);
- state->setFillColor(&colorA);
- out->updateFillColor(state);
- state->moveTo(xMin, yMin);
- state->lineTo(xMin, yMax);
- state->lineTo(xMax, yMax);
- state->lineTo(xMax, yMin);
- state->closePath();
- state->moveTo(xa + ra, ya);
- for (k = 1; k < n; ++k) {
- angle = ((double)k / (double)n) * 2 * M_PI;
- state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
- }
- state->closePath();
- out->fill(state);
- state->clearPath();
- }
- }
-}
-
-void Gfx::doGouraudTriangleShFill(GfxGouraudTriangleShading *shading) {
- double x0, y0, x1, y1, x2, y2;
- GfxColor color0, color1, color2;
- int i;
-
- for (i = 0; i < shading->getNTriangles(); ++i) {
- shading->getTriangle(i, &x0, &y0, &color0,
- &x1, &y1, &color1,
- &x2, &y2, &color2);
- gouraudFillTriangle(x0, y0, &color0, x1, y1, &color1, x2, y2, &color2,
- shading->getColorSpace()->getNComps(), 0);
- }
-}
-
-void Gfx::gouraudFillTriangle(double x0, double y0, GfxColor *color0,
- double x1, double y1, GfxColor *color1,
- double x2, double y2, GfxColor *color2,
- int nComps, int depth) {
- double x01, y01, x12, y12, x20, y20;
- GfxColor color01, color12, color20;
- int i;
-
- for (i = 0; i < nComps; ++i) {
- if (abs(color0->c[i] - color1->c[i]) > gouraudColorDelta ||
- abs(color1->c[i] - color2->c[i]) > gouraudColorDelta) {
- break;
- }
- }
- if (i == nComps || depth == gouraudMaxDepth) {
- state->setFillColor(color0);
- out->updateFillColor(state);
- state->moveTo(x0, y0);
- state->lineTo(x1, y1);
- state->lineTo(x2, y2);
- state->closePath();
- out->fill(state);
- state->clearPath();
- } else {
- x01 = 0.5 * (x0 + x1);
- y01 = 0.5 * (y0 + y1);
- x12 = 0.5 * (x1 + x2);
- y12 = 0.5 * (y1 + y2);
- x20 = 0.5 * (x2 + x0);
- y20 = 0.5 * (y2 + y0);
- //~ if the shading has a Function, this should interpolate on the
- //~ function parameter, not on the color components
- for (i = 0; i < nComps; ++i) {
- color01.c[i] = (color0->c[i] + color1->c[i]) / 2;
- color12.c[i] = (color1->c[i] + color2->c[i]) / 2;
- color20.c[i] = (color2->c[i] + color0->c[i]) / 2;
- }
- gouraudFillTriangle(x0, y0, color0, x01, y01, &color01,
- x20, y20, &color20, nComps, depth + 1);
- gouraudFillTriangle(x01, y01, &color01, x1, y1, color1,
- x12, y12, &color12, nComps, depth + 1);
- gouraudFillTriangle(x01, y01, &color01, x12, y12, &color12,
- x20, y20, &color20, nComps, depth + 1);
- gouraudFillTriangle(x20, y20, &color20, x12, y12, &color12,
- x2, y2, color2, nComps, depth + 1);
- }
-}
-
-void Gfx::doPatchMeshShFill(GfxPatchMeshShading *shading) {
- int start, i;
-
- if (shading->getNPatches() > 128) {
- start = 3;
- } else if (shading->getNPatches() > 64) {
- start = 2;
- } else if (shading->getNPatches() > 16) {
- start = 1;
- } else {
- start = 0;
- }
- for (i = 0; i < shading->getNPatches(); ++i) {
- fillPatch(shading->getPatch(i), shading->getColorSpace()->getNComps(),
- start);
- }
-}
-
-void Gfx::fillPatch(GfxPatch *patch, int nComps, int depth) {
- GfxPatch patch00, patch01, patch10, patch11;
- double xx[4][8], yy[4][8];
- double xxm, yym;
- int i;
-
- for (i = 0; i < nComps; ++i) {
- if (abs(patch->color[0][0].c[i] - patch->color[0][1].c[i])
- > patchColorDelta ||
- abs(patch->color[0][1].c[i] - patch->color[1][1].c[i])
- > patchColorDelta ||
- abs(patch->color[1][1].c[i] - patch->color[1][0].c[i])
- > patchColorDelta ||
- abs(patch->color[1][0].c[i] - patch->color[0][0].c[i])
- > patchColorDelta) {
- break;
- }
- }
- if (i == nComps || depth == patchMaxDepth) {
- state->setFillColor(&patch->color[0][0]);
- out->updateFillColor(state);
- state->moveTo(patch->x[0][0], patch->y[0][0]);
- state->curveTo(patch->x[0][1], patch->y[0][1],
- patch->x[0][2], patch->y[0][2],
- patch->x[0][3], patch->y[0][3]);
- state->curveTo(patch->x[1][3], patch->y[1][3],
- patch->x[2][3], patch->y[2][3],
- patch->x[3][3], patch->y[3][3]);
- state->curveTo(patch->x[3][2], patch->y[3][2],
- patch->x[3][1], patch->y[3][1],
- patch->x[3][0], patch->y[3][0]);
- state->curveTo(patch->x[2][0], patch->y[2][0],
- patch->x[1][0], patch->y[1][0],
- patch->x[0][0], patch->y[0][0]);
- state->closePath();
- out->fill(state);
- state->clearPath();
- } else {
- for (i = 0; i < 4; ++i) {
- xx[i][0] = patch->x[i][0];
- yy[i][0] = patch->y[i][0];
- xx[i][1] = 0.5 * (patch->x[i][0] + patch->x[i][1]);
- yy[i][1] = 0.5 * (patch->y[i][0] + patch->y[i][1]);
- xxm = 0.5 * (patch->x[i][1] + patch->x[i][2]);
- yym = 0.5 * (patch->y[i][1] + patch->y[i][2]);
- xx[i][6] = 0.5 * (patch->x[i][2] + patch->x[i][3]);
- yy[i][6] = 0.5 * (patch->y[i][2] + patch->y[i][3]);
- xx[i][2] = 0.5 * (xx[i][1] + xxm);
- yy[i][2] = 0.5 * (yy[i][1] + yym);
- xx[i][5] = 0.5 * (xxm + xx[i][6]);
- yy[i][5] = 0.5 * (yym + yy[i][6]);
- xx[i][3] = xx[i][4] = 0.5 * (xx[i][2] + xx[i][5]);
- yy[i][3] = yy[i][4] = 0.5 * (yy[i][2] + yy[i][5]);
- xx[i][7] = patch->x[i][3];
- yy[i][7] = patch->y[i][3];
- }
- for (i = 0; i < 4; ++i) {
- patch00.x[0][i] = xx[0][i];
- patch00.y[0][i] = yy[0][i];
- patch00.x[1][i] = 0.5 * (xx[0][i] + xx[1][i]);
- patch00.y[1][i] = 0.5 * (yy[0][i] + yy[1][i]);
- xxm = 0.5 * (xx[1][i] + xx[2][i]);
- yym = 0.5 * (yy[1][i] + yy[2][i]);
- patch10.x[2][i] = 0.5 * (xx[2][i] + xx[3][i]);
- patch10.y[2][i] = 0.5 * (yy[2][i] + yy[3][i]);
- patch00.x[2][i] = 0.5 * (patch00.x[1][i] + xxm);
- patch00.y[2][i] = 0.5 * (patch00.y[1][i] + yym);
- patch10.x[1][i] = 0.5 * (xxm + patch10.x[2][i]);
- patch10.y[1][i] = 0.5 * (yym + patch10.y[2][i]);
- patch00.x[3][i] = 0.5 * (patch00.x[2][i] + patch10.x[1][i]);
- patch00.y[3][i] = 0.5 * (patch00.y[2][i] + patch10.y[1][i]);
- patch10.x[0][i] = patch00.x[3][i];
- patch10.y[0][i] = patch00.y[3][i];
- patch10.x[3][i] = xx[3][i];
- patch10.y[3][i] = yy[3][i];
- }
- for (i = 4; i < 8; ++i) {
- patch01.x[0][i-4] = xx[0][i];
- patch01.y[0][i-4] = yy[0][i];
- patch01.x[1][i-4] = 0.5 * (xx[0][i] + xx[1][i]);
- patch01.y[1][i-4] = 0.5 * (yy[0][i] + yy[1][i]);
- xxm = 0.5 * (xx[1][i] + xx[2][i]);
- yym = 0.5 * (yy[1][i] + yy[2][i]);
- patch11.x[2][i-4] = 0.5 * (xx[2][i] + xx[3][i]);
- patch11.y[2][i-4] = 0.5 * (yy[2][i] + yy[3][i]);
- patch01.x[2][i-4] = 0.5 * (patch01.x[1][i-4] + xxm);
- patch01.y[2][i-4] = 0.5 * (patch01.y[1][i-4] + yym);
- patch11.x[1][i-4] = 0.5 * (xxm + patch11.x[2][i-4]);
- patch11.y[1][i-4] = 0.5 * (yym + patch11.y[2][i-4]);
- patch01.x[3][i-4] = 0.5 * (patch01.x[2][i-4] + patch11.x[1][i-4]);
- patch01.y[3][i-4] = 0.5 * (patch01.y[2][i-4] + patch11.y[1][i-4]);
- patch11.x[0][i-4] = patch01.x[3][i-4];
- patch11.y[0][i-4] = patch01.y[3][i-4];
- patch11.x[3][i-4] = xx[3][i];
- patch11.y[3][i-4] = yy[3][i];
- }
- //~ if the shading has a Function, this should interpolate on the
- //~ function parameter, not on the color components
- for (i = 0; i < nComps; ++i) {
- patch00.color[0][0].c[i] = patch->color[0][0].c[i];
- patch00.color[0][1].c[i] = (patch->color[0][0].c[i] +
- patch->color[0][1].c[i]) / 2;
- patch01.color[0][0].c[i] = patch00.color[0][1].c[i];
- patch01.color[0][1].c[i] = patch->color[0][1].c[i];
- patch01.color[1][1].c[i] = (patch->color[0][1].c[i] +
- patch->color[1][1].c[i]) / 2;
- patch11.color[0][1].c[i] = patch01.color[1][1].c[i];
- patch11.color[1][1].c[i] = patch->color[1][1].c[i];
- patch11.color[1][0].c[i] = (patch->color[1][1].c[i] +
- patch->color[1][0].c[i]) / 2;
- patch10.color[1][1].c[i] = patch11.color[1][0].c[i];
- patch10.color[1][0].c[i] = patch->color[1][0].c[i];
- patch10.color[0][0].c[i] = (patch->color[1][0].c[i] +
- patch->color[0][0].c[i]) / 2;
- patch00.color[1][0].c[i] = patch10.color[0][0].c[i];
- patch00.color[1][1].c[i] = (patch00.color[1][0].c[i] +
- patch01.color[1][1].c[i]) / 2;
- patch01.color[1][0].c[i] = patch00.color[1][1].c[i];
- patch11.color[0][0].c[i] = patch00.color[1][1].c[i];
- patch10.color[0][1].c[i] = patch00.color[1][1].c[i];
- }
- fillPatch(&patch00, nComps, depth + 1);
- fillPatch(&patch10, nComps, depth + 1);
- fillPatch(&patch01, nComps, depth + 1);
- fillPatch(&patch11, nComps, depth + 1);
- }
-}
-
-void Gfx::doEndPath() {
- if (state->isCurPt() && clip != clipNone) {
- state->clip();
- if (clip == clipNormal) {
- out->clip(state);
- } else {
- out->eoClip(state);
- }
- }
- clip = clipNone;
- state->clearPath();
-}
-
-//------------------------------------------------------------------------
-// path clipping operators
-//------------------------------------------------------------------------
-
-void Gfx::opClip(Object * /*args[]*/, int /*numArgs*/) {
- clip = clipNormal;
-}
-
-void Gfx::opEOClip(Object * /*args[]*/, int /*numArgs*/) {
- clip = clipEO;
-}
-
-//------------------------------------------------------------------------
-// text object operators
-//------------------------------------------------------------------------
-
-void Gfx::opBeginText(Object * /*args[]*/, int /*numArgs*/) {
- state->setTextMat(1, 0, 0, 1, 0, 0);
- state->textMoveTo(0, 0);
- out->updateTextMat(state);
- out->updateTextPos(state);
- fontChanged = gTrue;
-}
-
-void Gfx::opEndText(Object * /*args[]*/, int /*numArgs*/) {
- out->endTextObject(state);
-}
-
-//------------------------------------------------------------------------
-// text state operators
-//------------------------------------------------------------------------
-
-void Gfx::opSetCharSpacing(Object args[], int /*numArgs*/) {
- state->setCharSpace(args[0].getNum());
- out->updateCharSpace(state);
-}
-
-void Gfx::opSetFont(Object args[], int /*numArgs*/) {
- GfxFont *font;
-
- if (!(font = res->lookupFont(args[0].getName()))) {
- return;
- }
- if (printCommands) {
- printf(" font: tag=%s name='%s' %g\n",
- font->getTag()->getCString(),
- font->getName() ? font->getName()->getCString() : "???",
- args[1].getNum());
- fflush(stdout);
- }
- state->setFont(font, args[1].getNum());
- fontChanged = gTrue;
-}
-
-void Gfx::opSetTextLeading(Object args[], int /*numArgs*/) {
- state->setLeading(args[0].getNum());
-}
-
-void Gfx::opSetTextRender(Object args[], int /*numArgs*/) {
- state->setRender(args[0].getInt());
- out->updateRender(state);
-}
-
-void Gfx::opSetTextRise(Object args[], int /*numArgs*/) {
- state->setRise(args[0].getNum());
- out->updateRise(state);
-}
-
-void Gfx::opSetWordSpacing(Object args[], int /*numArgs*/) {
- state->setWordSpace(args[0].getNum());
- out->updateWordSpace(state);
-}
-
-void Gfx::opSetHorizScaling(Object args[], int /*numArgs*/) {
- state->setHorizScaling(args[0].getNum());
- out->updateHorizScaling(state);
- fontChanged = gTrue;
-}
-
-//------------------------------------------------------------------------
-// text positioning operators
-//------------------------------------------------------------------------
-
-void Gfx::opTextMove(Object args[], int /*numArgs*/) {
- double tx, ty;
-
- tx = state->getLineX() + args[0].getNum();
- ty = state->getLineY() + args[1].getNum();
- state->textMoveTo(tx, ty);
- out->updateTextPos(state);
-}
-
-void Gfx::opTextMoveSet(Object args[], int /*numArgs*/) {
- double tx, ty;
-
- tx = state->getLineX() + args[0].getNum();
- ty = args[1].getNum();
- state->setLeading(-ty);
- ty += state->getLineY();
- state->textMoveTo(tx, ty);
- out->updateTextPos(state);
-}
-
-void Gfx::opSetTextMatrix(Object args[], int /*numArgs*/) {
- state->setTextMat(args[0].getNum(), args[1].getNum(),
- args[2].getNum(), args[3].getNum(),
- args[4].getNum(), args[5].getNum());
- state->textMoveTo(0, 0);
- out->updateTextMat(state);
- out->updateTextPos(state);
- fontChanged = gTrue;
-}
-
-void Gfx::opTextNextLine(Object * /*args[]*/, int /*numArgs*/) {
- double tx, ty;
-
- tx = state->getLineX();
- ty = state->getLineY() - state->getLeading();
- state->textMoveTo(tx, ty);
- out->updateTextPos(state);
-}
-
-//------------------------------------------------------------------------
-// text string operators
-//------------------------------------------------------------------------
-
-void Gfx::opShowText(Object args[], int /*numArgs*/) {
- if (!state->getFont()) {
- error(getPos(), "No font in show");
- return;
- }
- if (fontChanged) {
- out->updateFont(state);
- fontChanged = gFalse;
- }
- out->beginStringOp(state);
- doShowText(args[0].getString());
- out->endStringOp(state);
-}
-
-void Gfx::opMoveShowText(Object args[], int /*numArgs*/) {
- double tx, ty;
-
- if (!state->getFont()) {
- error(getPos(), "No font in move/show");
- return;
- }
- if (fontChanged) {
- out->updateFont(state);
- fontChanged = gFalse;
- }
- tx = state->getLineX();
- ty = state->getLineY() - state->getLeading();
- state->textMoveTo(tx, ty);
- out->updateTextPos(state);
- out->beginStringOp(state);
- doShowText(args[0].getString());
- out->endStringOp(state);
-}
-
-void Gfx::opMoveSetShowText(Object args[], int /*numArgs*/) {
- double tx, ty;
-
- if (!state->getFont()) {
- error(getPos(), "No font in move/set/show");
- return;
- }
- if (fontChanged) {
- out->updateFont(state);
- fontChanged = gFalse;
- }
- state->setWordSpace(args[0].getNum());
- state->setCharSpace(args[1].getNum());
- tx = state->getLineX();
- ty = state->getLineY() - state->getLeading();
- state->textMoveTo(tx, ty);
- out->updateWordSpace(state);
- out->updateCharSpace(state);
- out->updateTextPos(state);
- out->beginStringOp(state);
- doShowText(args[2].getString());
- out->endStringOp(state);
-}
-
-void Gfx::opShowSpaceText(Object args[], int /*numArgs*/) {
- Array *a;
- Object obj;
- int wMode;
- int i;
-
- if (!state->getFont()) {
- error(getPos(), "No font in show/space");
- return;
- }
- if (fontChanged) {
- out->updateFont(state);
- fontChanged = gFalse;
- }
- out->beginStringOp(state);
- wMode = state->getFont()->getWMode();
- a = args[0].getArray();
- for (i = 0; i < a->getLength(); ++i) {
- a->get(i, &obj);
- if (obj.isNum()) {
- // this uses the absolute value of the font size to match
- // Acrobat's behavior
- if (wMode) {
- state->textShift(0, -obj.getNum() * 0.001 *
- fabs(state->getFontSize()));
- } else {
- state->textShift(-obj.getNum() * 0.001 *
- fabs(state->getFontSize()), 0);
- }
- out->updateTextShift(state, obj.getNum());
- } else if (obj.isString()) {
- doShowText(obj.getString());
- } else {
- error(getPos(), "Element of show/space array must be number or string");
- }
- obj.free();
- }
- out->endStringOp(state);
-}
-
-void Gfx::doShowText(GString *s) {
- GfxFont *font;
- int wMode;
- double riseX, riseY;
- CharCode code;
- Unicode u[8];
- double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, lineX, lineY;
- double originX, originY, tOriginX, tOriginY;
- double oldCTM[6], newCTM[6];
- double *mat;
- Object charProc;
- Dict *resDict;
- Parser *oldParser;
- char *p;
- int len, n, uLen, nChars, nSpaces, i;
-
- font = state->getFont();
- wMode = font->getWMode();
-
- if (out->useDrawChar()) {
- out->beginString(state, s);
- }
-
- // handle a Type 3 char
- if (font->getType() == fontType3 && out->interpretType3Chars()) {
- mat = state->getCTM();
- for (i = 0; i < 6; ++i) {
- oldCTM[i] = mat[i];
- }
- mat = state->getTextMat();
- newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2];
- newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3];
- newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2];
- newCTM[3] = mat[2] * oldCTM[1] + mat[3] * oldCTM[3];
- mat = font->getFontMatrix();
- newCTM[0] = mat[0] * newCTM[0] + mat[1] * newCTM[2];
- newCTM[1] = mat[0] * newCTM[1] + mat[1] * newCTM[3];
- newCTM[2] = mat[2] * newCTM[0] + mat[3] * newCTM[2];
- newCTM[3] = mat[2] * newCTM[1] + mat[3] * newCTM[3];
- newCTM[0] *= state->getFontSize();
- newCTM[1] *= state->getFontSize();
- newCTM[2] *= state->getFontSize();
- newCTM[3] *= state->getFontSize();
- newCTM[0] *= state->getHorizScaling();
- newCTM[2] *= state->getHorizScaling();
- state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
- curX = state->getCurX();
- curY = state->getCurY();
- lineX = state->getLineX();
- lineY = state->getLineY();
- oldParser = parser;
- p = s->getCString();
- len = s->getLength();
- while (len > 0) {
- n = font->getNextChar(p, len, &code,
- u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
- &dx, &dy, &originX, &originY);
- dx = dx * state->getFontSize() + state->getCharSpace();
- if (n == 1 && *p == ' ') {
- dx += state->getWordSpace();
- }
- dx *= state->getHorizScaling();
- dy *= state->getFontSize();
- state->textTransformDelta(dx, dy, &tdx, &tdy);
- state->transform(curX + riseX, curY + riseY, &x, &y);
- saveState();
- state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y);
- //~ the CTM concat values here are wrong (but never used)
- out->updateCTM(state, 1, 0, 0, 1, 0, 0);
- if (!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
- code, u, uLen)) {
- ((Gfx8BitFont *)font)->getCharProc(code, &charProc);
- if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
- pushResources(resDict);
- }
- if (charProc.isStream()) {
- display(&charProc, gFalse);
- } else {
- error(getPos(), "Missing or bad Type3 CharProc entry");
- }
- out->endType3Char(state);
- if (resDict) {
- popResources();
- }
- charProc.free();
- }
- restoreState();
- // GfxState::restore() does *not* restore the current position,
- // so we deal with it here using (curX, curY) and (lineX, lineY)
- curX += tdx;
- curY += tdy;
- state->moveTo(curX, curY);
- state->textSetPos(lineX, lineY);
- p += n;
- len -= n;
- }
- parser = oldParser;
-
- } else if (out->useDrawChar()) {
- state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
- p = s->getCString();
- len = s->getLength();
- while (len > 0) {
- n = font->getNextChar(p, len, &code,
- u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
- &dx, &dy, &originX, &originY);
- if (wMode) {
- dx *= state->getFontSize();
- dy = dy * state->getFontSize() + state->getCharSpace();
- if (n == 1 && *p == ' ') {
- dy += state->getWordSpace();
- }
- } else {
- dx = dx * state->getFontSize() + state->getCharSpace();
- if (n == 1 && *p == ' ') {
- dx += state->getWordSpace();
- }
- dx *= state->getHorizScaling();
- dy *= state->getFontSize();
- }
- state->textTransformDelta(dx, dy, &tdx, &tdy);
- originX *= state->getFontSize();
- originY *= state->getFontSize();
- state->textTransformDelta(originX, originY, &tOriginX, &tOriginY);
- out->drawChar(state, state->getCurX() + riseX, state->getCurY() + riseY,
- tdx, tdy, tOriginX, tOriginY, code, n, u, uLen);
- state->shift(tdx, tdy);
- p += n;
- len -= n;
- }
-
- } else {
- dx = dy = 0;
- p = s->getCString();
- len = s->getLength();
- nChars = nSpaces = 0;
- while (len > 0) {
- n = font->getNextChar(p, len, &code,
- u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
- &dx2, &dy2, &originX, &originY);
- dx += dx2;
- dy += dy2;
- if (n == 1 && *p == ' ') {
- ++nSpaces;
- }
- ++nChars;
- p += n;
- len -= n;
- }
- if (wMode) {
- dx *= state->getFontSize();
- dy = dy * state->getFontSize()
- + nChars * state->getCharSpace()
- + nSpaces * state->getWordSpace();
- } else {
- dx = dx * state->getFontSize()
- + nChars * state->getCharSpace()
- + nSpaces * state->getWordSpace();
- dx *= state->getHorizScaling();
- dy *= state->getFontSize();
- }
- state->textTransformDelta(dx, dy, &tdx, &tdy);
- out->drawString(state, s);
- state->shift(tdx, tdy);
- }
-
- if (out->useDrawChar()) {
- out->endString(state);
- }
-
- updateLevel += 10 * s->getLength();
-}
-
-//------------------------------------------------------------------------
-// XObject operators
-//------------------------------------------------------------------------
-
-void Gfx::opXObject(Object args[], int /*numArgs*/) {
- char *name;
- Object obj1, obj2, obj3, refObj;
-#if OPI_SUPPORT
- Object opiDict;
-#endif
-
- name = args[0].getName();
- if (!res->lookupXObject(name, &obj1)) {
- return;
- }
- if (!obj1.isStream()) {
- error(getPos(), "XObject '%s' is wrong type", name);
- obj1.free();
- return;
- }
-#if OPI_SUPPORT
- obj1.streamGetDict()->lookup("OPI", &opiDict);
- if (opiDict.isDict()) {
- out->opiBegin(state, opiDict.getDict());
- }
-#endif
- obj1.streamGetDict()->lookup("Subtype", &obj2);
- if (obj2.isName("Image")) {
- if (out->needNonText()) {
- res->lookupXObjectNF(name, &refObj);
- doImage(&refObj, obj1.getStream(), gFalse);
- refObj.free();
- }
- } else if (obj2.isName("Form")) {
- res->lookupXObjectNF(name, &refObj);
- if (out->useDrawForm() && refObj.isRef()) {
- out->drawForm(refObj.getRef());
- } else {
- doForm(&obj1);
- }
- refObj.free();
- } else if (obj2.isName("PS")) {
- obj1.streamGetDict()->lookup("Level1", &obj3);
- out->psXObject(obj1.getStream(),
- obj3.isStream() ? obj3.getStream() : (Stream *)NULL);
- } else if (obj2.isName()) {
- error(getPos(), "Unknown XObject subtype '%s'", obj2.getName());
- } else {
- error(getPos(), "XObject subtype is missing or wrong type");
- }
- obj2.free();
-#if OPI_SUPPORT
- if (opiDict.isDict()) {
- out->opiEnd(state, opiDict.getDict());
- }
- opiDict.free();
-#endif
- obj1.free();
-}
-
-void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
- Dict *dict, *maskDict;
- int width, height;
- int bits, maskBits;
- StreamColorSpaceMode csMode;
- GBool mask;
- GBool invert;
- GfxColorSpace *colorSpace, *maskColorSpace;
- GfxImageColorMap *colorMap, *maskColorMap;
- Object maskObj, smaskObj;
- GBool haveColorKeyMask, haveExplicitMask, haveSoftMask;
- int maskColors[2*gfxColorMaxComps];
- int maskWidth, maskHeight;
- GBool maskInvert;
- Stream *maskStr;
- Object obj1, obj2;
- int i;
-
- // get info from the stream
- bits = 0;
- csMode = streamCSNone;
- str->getImageParams(&bits, &csMode);
-
- // get stream dict
- dict = str->getDict();
-
- // get size
- dict->lookup("Width", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("W", &obj1);
- }
- if (obj1.isInt())
- width = obj1.getInt();
- else if (obj1.isReal())
- width = (int)obj1.getReal();
- else
- goto err2;
- obj1.free();
- dict->lookup("Height", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("H", &obj1);
- }
- if (obj1.isInt())
- height = obj1.getInt();
- else if (obj1.isReal())
- height = (int)obj1.getReal();
- else
- goto err2;
- obj1.free();
-
- // image or mask?
- dict->lookup("ImageMask", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("IM", &obj1);
- }
- mask = gFalse;
- if (obj1.isBool())
- mask = obj1.getBool();
- else if (!obj1.isNull())
- goto err2;
- obj1.free();
-
- // bit depth
- if (bits == 0) {
- dict->lookup("BitsPerComponent", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("BPC", &obj1);
- }
- if (obj1.isInt()) {
- bits = obj1.getInt();
- } else if (mask) {
- bits = 1;
- } else {
- goto err2;
- }
- obj1.free();
- }
-
- // display a mask
- if (mask) {
-
- // check for inverted mask
- if (bits != 1)
- goto err1;
- invert = gFalse;
- dict->lookup("Decode", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("D", &obj1);
- }
- if (obj1.isArray()) {
- obj1.arrayGet(0, &obj2);
- if (obj2.isInt() && obj2.getInt() == 1)
- invert = gTrue;
- obj2.free();
- } else if (!obj1.isNull()) {
- goto err2;
- }
- obj1.free();
-
- // draw it
- out->drawImageMask(state, ref, str, width, height, invert, inlineImg);
-
- } else {
-
- // get color space and color map
- dict->lookup("ColorSpace", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("CS", &obj1);
- }
- if (obj1.isName()) {
- res->lookupColorSpace(obj1.getName(), &obj2);
- if (!obj2.isNull()) {
- obj1.free();
- obj1 = obj2;
- } else {
- obj2.free();
- }
- }
- if (!obj1.isNull()) {
- colorSpace = GfxColorSpace::parse(&obj1);
- } else if (csMode == streamCSDeviceGray) {
- colorSpace = new GfxDeviceGrayColorSpace();
- } else if (csMode == streamCSDeviceRGB) {
- colorSpace = new GfxDeviceRGBColorSpace();
- } else if (csMode == streamCSDeviceCMYK) {
- colorSpace = new GfxDeviceCMYKColorSpace();
- } else {
- colorSpace = NULL;
- }
- obj1.free();
- if (!colorSpace) {
- goto err1;
- }
- dict->lookup("Decode", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- dict->lookup("D", &obj1);
- }
- colorMap = new GfxImageColorMap(bits, &obj1, colorSpace);
- obj1.free();
- if (!colorMap->isOk()) {
- delete colorMap;
- goto err1;
- }
-
- // get the mask
- haveColorKeyMask = haveExplicitMask = haveSoftMask = gFalse;
- maskStr = NULL; // make gcc happy
- maskWidth = maskHeight = 0; // make gcc happy
- maskInvert = gFalse; // make gcc happy
- maskColorMap = NULL; // make gcc happy
- dict->lookup("Mask", &maskObj);
- dict->lookup("SMask", &smaskObj);
- if (smaskObj.isStream()) {
- // soft mask
- if (inlineImg) {
- goto err1;
- }
- maskStr = smaskObj.getStream();
- maskDict = smaskObj.streamGetDict();
- maskDict->lookup("Width", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("W", &obj1);
- }
- if (!obj1.isInt()) {
- goto err2;
- }
- maskWidth = obj1.getInt();
- obj1.free();
- maskDict->lookup("Height", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("H", &obj1);
- }
- if (!obj1.isInt()) {
- goto err2;
- }
- maskHeight = obj1.getInt();
- obj1.free();
- maskDict->lookup("BitsPerComponent", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("BPC", &obj1);
- }
- if (!obj1.isInt()) {
- goto err2;
- }
- maskBits = obj1.getInt();
- obj1.free();
- maskDict->lookup("ColorSpace", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("CS", &obj1);
- }
- if (obj1.isName()) {
- res->lookupColorSpace(obj1.getName(), &obj2);
- if (!obj2.isNull()) {
- obj1.free();
- obj1 = obj2;
- } else {
- obj2.free();
- }
- }
- maskColorSpace = GfxColorSpace::parse(&obj1);
- obj1.free();
- if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
- goto err1;
- }
- maskDict->lookup("Decode", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("D", &obj1);
- }
- maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace);
- obj1.free();
- if (!maskColorMap->isOk()) {
- delete maskColorMap;
- goto err1;
- }
- //~ handle the Matte entry
- haveSoftMask = gTrue;
- } else if (maskObj.isArray()) {
- // color key mask
- for (i = 0;
- i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps;
- ++i) {
- maskObj.arrayGet(i, &obj1);
- maskColors[i] = obj1.getInt();
- obj1.free();
- }
- haveColorKeyMask = gTrue;
- } else if (maskObj.isStream()) {
- // explicit mask
- if (inlineImg) {
- goto err1;
- }
- maskStr = maskObj.getStream();
- maskDict = maskObj.streamGetDict();
- maskDict->lookup("Width", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("W", &obj1);
- }
- if (!obj1.isInt()) {
- goto err2;
- }
- maskWidth = obj1.getInt();
- obj1.free();
- maskDict->lookup("Height", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("H", &obj1);
- }
- if (!obj1.isInt()) {
- goto err2;
- }
- maskHeight = obj1.getInt();
- obj1.free();
- maskDict->lookup("ImageMask", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("IM", &obj1);
- }
- if (!obj1.isBool() || !obj1.getBool()) {
- goto err2;
- }
- obj1.free();
- maskInvert = gFalse;
- maskDict->lookup("Decode", &obj1);
- if (obj1.isNull()) {
- obj1.free();
- maskDict->lookup("D", &obj1);
- }
- if (obj1.isArray()) {
- obj1.arrayGet(0, &obj2);
- if (obj2.isInt() && obj2.getInt() == 1) {
- maskInvert = gTrue;
- }
- obj2.free();
- } else if (!obj1.isNull()) {
- goto err2;
- }
- obj1.free();
- haveExplicitMask = gTrue;
- }
-
- // draw it
- if (haveSoftMask) {
- out->drawSoftMaskedImage(state, ref, str, width, height, colorMap,
- maskStr, maskWidth, maskHeight, maskColorMap);
- delete maskColorMap;
- } else if (haveExplicitMask) {
- out->drawMaskedImage(state, ref, str, width, height, colorMap,
- maskStr, maskWidth, maskHeight, maskInvert);
- } else {
- out->drawImage(state, ref, str, width, height, colorMap,
- haveColorKeyMask ? maskColors : (int *)NULL, inlineImg);
- }
- delete colorMap;
-
- maskObj.free();
- smaskObj.free();
- }
-
- if ((i = width * height) > 1000) {
- i = 1000;
- }
- updateLevel += i;
-
- return;
-
- err2:
- obj1.free();
- err1:
- error(getPos(), "Bad image parameters");
-}
-
-void Gfx::doForm(Object *str) {
- Dict *dict;
- GBool transpGroup, isolated, knockout;
- GfxColorSpace *blendingColorSpace;
- Object matrixObj, bboxObj;
- double m[6], bbox[4];
- Object resObj;
- Dict *resDict;
- Object obj1, obj2, obj3;
- int i;
-
- // check for excessive recursion
- if (formDepth > 20) {
- return;
- }
-
- // get stream dict
- dict = str->streamGetDict();
-
- // check form type
- dict->lookup("FormType", &obj1);
- if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
- error(getPos(), "Unknown form type");
- }
- obj1.free();
-
- // get bounding box
- dict->lookup("BBox", &bboxObj);
- if (!bboxObj.isArray()) {
- bboxObj.free();
- error(getPos(), "Bad form bounding box");
- return;
- }
- for (i = 0; i < 4; ++i) {
- bboxObj.arrayGet(i, &obj1);
- bbox[i] = obj1.getNum();
- obj1.free();
- }
- bboxObj.free();
-
- // get matrix
- dict->lookup("Matrix", &matrixObj);
- if (matrixObj.isArray()) {
- for (i = 0; i < 6; ++i) {
- matrixObj.arrayGet(i, &obj1);
- m[i] = obj1.getNum();
- obj1.free();
- }
- } else {
- m[0] = 1; m[1] = 0;
- m[2] = 0; m[3] = 1;
- m[4] = 0; m[5] = 0;
- }
- matrixObj.free();
-
- // get resources
- dict->lookup("Resources", &resObj);
- resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
-
- // check for a transparency group
- transpGroup = isolated = knockout = gFalse;
- blendingColorSpace = NULL;
- if (dict->lookup("Group", &obj1)->isDict()) {
- if (obj1.dictLookup("S", &obj2)->isName("Transparency")) {
- transpGroup = gTrue;
- if (!obj1.dictLookup("CS", &obj3)->isNull()) {
- blendingColorSpace = GfxColorSpace::parse(&obj3);
- }
- obj3.free();
- if (obj1.dictLookup("I", &obj3)->isBool()) {
- isolated = obj3.getBool();
- }
- obj3.free();
- if (obj1.dictLookup("K", &obj3)->isBool()) {
- knockout = obj3.getBool();
- }
- obj3.free();
- }
- obj2.free();
- }
- obj1.free();
-
- // draw it
- ++formDepth;
- doForm1(str, resDict, m, bbox,
- transpGroup, gFalse, blendingColorSpace, isolated, knockout);
- --formDepth;
-
- if (blendingColorSpace) {
- delete blendingColorSpace;
- }
- resObj.free();
-}
-
-void Gfx::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox,
- GBool transpGroup, GBool softMask,
- GfxColorSpace *blendingColorSpace,
- GBool isolated, GBool knockout,
- GBool alpha, Function *transferFunc,
- GfxColor *backdropColor) {
- Parser *oldParser;
- double oldBaseMatrix[6];
- int i;
-
- // push new resources on stack
- pushResources(resDict);
-
- // save current graphics state
- saveState();
-
- // kill any pre-existing path
- state->clearPath();
-
- // save current parser
- oldParser = parser;
-
- // set form transformation matrix
- state->concatCTM(matrix[0], matrix[1], matrix[2],
- matrix[3], matrix[4], matrix[5]);
- out->updateCTM(state, matrix[0], matrix[1], matrix[2],
- matrix[3], matrix[4], matrix[5]);
-
- // set form bounding box
- state->moveTo(bbox[0], bbox[1]);
- state->lineTo(bbox[2], bbox[1]);
- state->lineTo(bbox[2], bbox[3]);
- state->lineTo(bbox[0], bbox[3]);
- state->closePath();
- state->clip();
- out->clip(state);
- state->clearPath();
-
- if (softMask || transpGroup) {
- if (state->getBlendMode() != gfxBlendNormal) {
- state->setBlendMode(gfxBlendNormal);
- out->updateBlendMode(state);
- }
- if (state->getFillOpacity() != 1) {
- state->setFillOpacity(1);
- out->updateFillOpacity(state);
- }
- if (state->getStrokeOpacity() != 1) {
- state->setStrokeOpacity(1);
- out->updateStrokeOpacity(state);
- }
- out->clearSoftMask(state);
- out->beginTransparencyGroup(state, bbox, blendingColorSpace,
- isolated, knockout, softMask);
- }
-
- // set new base matrix
- for (i = 0; i < 6; ++i) {
- oldBaseMatrix[i] = baseMatrix[i];
- baseMatrix[i] = state->getCTM()[i];
- }
-
- // draw the form
- display(str, gFalse);
-
- if (softMask || transpGroup) {
- out->endTransparencyGroup(state);
- }
-
- // restore base matrix
- for (i = 0; i < 6; ++i) {
- baseMatrix[i] = oldBaseMatrix[i];
- }
-
- // restore parser
- parser = oldParser;
-
- // restore graphics state
- restoreState();
-
- // pop resource stack
- popResources();
-
- if (softMask) {
- out->setSoftMask(state, bbox, alpha, transferFunc, backdropColor);
- } else if (transpGroup) {
- out->paintTransparencyGroup(state, bbox);
- }
-
- return;
-}
-
-//------------------------------------------------------------------------
-// in-line image operators
-//------------------------------------------------------------------------
-
-void Gfx::opBeginImage(Object * /*args[]*/, int /*numArgs*/) {
- Stream *str;
- int c1, c2;
-
- // build dict/stream
- str = buildImageStream();
-
- // display the image
- if (str) {
- doImage(NULL, str, gTrue);
-
- // skip 'EI' tag
- c1 = str->getUndecodedStream()->getChar();
- c2 = str->getUndecodedStream()->getChar();
- while (!(c1 == 'E' && c2 == 'I') && c2 != EOF) {
- c1 = c2;
- c2 = str->getUndecodedStream()->getChar();
- }
- delete str;
- }
-}
-
-Stream *Gfx::buildImageStream() {
- Object dict;
- Object obj;
- char *key;
- Stream *str;
-
- // build dictionary
- dict.initDict(xref);
- parser->getObj(&obj);
- while (!obj.isCmd("ID") && !obj.isEOF()) {
- if (!obj.isName()) {
- error(getPos(), "Inline image dictionary key must be a name object");
- obj.free();
- } else {
- key = copyString(obj.getName());
- obj.free();
- parser->getObj(&obj);
- if (obj.isEOF() || obj.isError()) {
- gfree(key);
- break;
- }
- dict.dictAdd(key, &obj);
- }
- parser->getObj(&obj);
- }
- if (obj.isEOF()) {
- error(getPos(), "End of file in inline image");
- obj.free();
- dict.free();
- return NULL;
- }
- obj.free();
-
- // make stream
- str = new EmbedStream(parser->getStream(), &dict, gFalse, 0);
- str = str->addFilters(&dict);
-
- return str;
-}
-
-void Gfx::opImageData(Object * /*args[]*/, int /*numArgs*/) {
- error(getPos(), "Internal: got 'ID' operator");
-}
-
-void Gfx::opEndImage(Object * /*args[]*/, int /*numArgs*/) {
- error(getPos(), "Internal: got 'EI' operator");
-}
-
-//------------------------------------------------------------------------
-// type 3 font operators
-//------------------------------------------------------------------------
-
-void Gfx::opSetCharWidth(Object args[], int /*numArgs*/) {
- out->type3D0(state, args[0].getNum(), args[1].getNum());
-}
-
-void Gfx::opSetCacheDevice(Object args[], int /*numArgs*/) {
- out->type3D1(state, args[0].getNum(), args[1].getNum(),
- args[2].getNum(), args[3].getNum(),
- args[4].getNum(), args[5].getNum());
-}
-
-//------------------------------------------------------------------------
-// compatibility operators
-//------------------------------------------------------------------------
-
-void Gfx::opBeginIgnoreUndef(Object * /*args[]*/, int /*numArgs*/) {
- ++ignoreUndef;
-}
-
-void Gfx::opEndIgnoreUndef(Object * /*args[]*/, int /*numArgs*/) {
- if (ignoreUndef > 0)
- --ignoreUndef;
-}
-
-//------------------------------------------------------------------------
-// marked content operators
-//------------------------------------------------------------------------
-
-void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
- if (printCommands) {
- printf(" marked content: %s ", args[0].getName());
- if (numArgs == 2)
- args[2].print(stdout);
- printf("\n");
- fflush(stdout);
- }
-}
-
-void Gfx::opEndMarkedContent(Object * /*args[]*/, int /*numArgs*/) {
-}
-
-void Gfx::opMarkPoint(Object args[], int numArgs) {
- if (printCommands) {
- printf(" mark point: %s ", args[0].getName());
- if (numArgs == 2)
- args[2].print(stdout);
- printf("\n");
- fflush(stdout);
- }
-}
-
-//------------------------------------------------------------------------
-// misc
-//------------------------------------------------------------------------
-
-void Gfx::drawAnnot(Object *str, AnnotBorderStyle *borderStyle,
- double xMin, double yMin, double xMax, double yMax) {
- Dict *dict, *resDict;
- Object matrixObj, bboxObj, resObj;
- Object obj1;
- double m[6], bbox[4], ictm[6];
- double *ctm;
- double formX0, formY0, formX1, formY1;
- double annotX0, annotY0, annotX1, annotY1;
- double det, x, y, sx, sy;
- double r, g, b;
- GfxColor color;
- double *dash, *dash2;
- int dashLength;
- int i;
-
- //~ can we assume that we're in default user space?
- //~ (i.e., baseMatrix = ctm)
-
- // transform the annotation bbox from default user space to user
- // space: (bbox * baseMatrix) * iCTM
- ctm = state->getCTM();
- det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
- ictm[0] = ctm[3] * det;
- ictm[1] = -ctm[1] * det;
- ictm[2] = -ctm[2] * det;
- ictm[3] = ctm[0] * det;
- ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
- ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
- x = baseMatrix[0] * xMin + baseMatrix[2] * yMin + baseMatrix[4];
- y = baseMatrix[1] * xMin + baseMatrix[3] * yMin + baseMatrix[5];
- annotX0 = ictm[0] * x + ictm[2] * y + ictm[4];
- annotY0 = ictm[1] * x + ictm[3] * y + ictm[5];
- x = baseMatrix[0] * xMax + baseMatrix[2] * yMax + baseMatrix[4];
- y = baseMatrix[1] * xMax + baseMatrix[3] * yMax + baseMatrix[5];
- annotX1 = ictm[0] * x + ictm[2] * y + ictm[4];
- annotY1 = ictm[1] * x + ictm[3] * y + ictm[5];
- if (annotX0 > annotX1) {
- x = annotX0; annotX0 = annotX1; annotX1 = x;
- }
- if (annotY0 > annotY1) {
- y = annotY0; annotY0 = annotY1; annotY1 = y;
- }
-
- // draw the appearance stream (if there is one)
- if (str->isStream()) {
-
- // get stream dict
- dict = str->streamGetDict();
-
- // get the form bounding box
- dict->lookup("BBox", &bboxObj);
- if (!bboxObj.isArray()) {
- bboxObj.free();
- error(getPos(), "Bad form bounding box");
- return;
- }
- for (i = 0; i < 4; ++i) {
- bboxObj.arrayGet(i, &obj1);
- bbox[i] = obj1.getNum();
- obj1.free();
- }
- bboxObj.free();
-
- // get the form matrix
- dict->lookup("Matrix", &matrixObj);
- if (matrixObj.isArray()) {
- for (i = 0; i < 6; ++i) {
- matrixObj.arrayGet(i, &obj1);
- m[i] = obj1.getNum();
- obj1.free();
- }
- } else {
- m[0] = 1; m[1] = 0;
- m[2] = 0; m[3] = 1;
- m[4] = 0; m[5] = 0;
- }
- matrixObj.free();
-
- // transform the form bbox from form space to user space
- formX0 = bbox[0] * m[0] + bbox[1] * m[2] + m[4];
- formY0 = bbox[0] * m[1] + bbox[1] * m[3] + m[5];
- formX1 = bbox[2] * m[0] + bbox[3] * m[2] + m[4];
- formY1 = bbox[2] * m[1] + bbox[3] * m[3] + m[5];
- if (formX0 > formX1) {
- x = formX0; formX0 = formX1; formX1 = x;
- }
- if (formY0 > formY1) {
- y = formY0; formY0 = formY1; formY1 = y;
- }
-
- // scale the form to fit the annotation bbox
- if (formX1 == formX0) {
- // this shouldn't happen
- sx = 1;
- } else {
- sx = (annotX1 - annotX0) / (formX1 - formX0);
- }
- if (formY1 == formY0) {
- // this shouldn't happen
- sy = 1;
- } else {
- sy = (annotY1 - annotY0) / (formY1 - formY0);
- }
- m[0] *= sx;
- m[2] *= sx;
- m[4] = (m[4] - formX0) * sx + annotX0;
- m[1] *= sy;
- m[3] *= sy;
- m[5] = (m[5] - formY0) * sy + annotY0;
-
- // get resources
- dict->lookup("Resources", &resObj);
- resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
-
- // draw it
- doForm1(str, resDict, m, bbox);
-
- resObj.free();
- }
-
- // draw the border
- if (borderStyle && borderStyle->getWidth() > 0) {
- if (state->getStrokeColorSpace()->getMode() != csDeviceRGB) {
- state->setStrokePattern(NULL);
- state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
- out->updateStrokeColorSpace(state);
- }
- borderStyle->getColor(&r, &g, &b);
- color.c[0] = dblToCol(r);
- color.c[1] = dblToCol(g);
- color.c[2] = dblToCol(b);
- state->setStrokeColor(&color);
- out->updateStrokeColor(state);
- // compute the width scale factor when going from default user
- // space to user space
- x = (baseMatrix[0] + baseMatrix[2]) * ictm[0] +
- (baseMatrix[1] + baseMatrix[3]) * ictm[2];
- y = (baseMatrix[0] + baseMatrix[2]) * ictm[1] +
- (baseMatrix[1] + baseMatrix[3]) * ictm[3];
- x = sqrt(0.5 * (x * x + y * y));
- state->setLineWidth(x * borderStyle->getWidth());
- out->updateLineWidth(state);
- borderStyle->getDash(&dash, &dashLength);
- if (borderStyle->getType() == annotBorderDashed && dashLength > 0) {
- dash2 = (double *)gmallocn(dashLength, sizeof(double));
- for (i = 0; i < dashLength; ++i) {
- dash2[i] = x * dash[i];
- }
- state->setLineDash(dash2, dashLength, 0);
- out->updateLineDash(state);
- }
- //~ this doesn't currently handle the beveled and engraved styles
- state->clearPath();
- state->moveTo(annotX0, out->upsideDown() ? annotY0 : annotY1);
- state->lineTo(annotX1, out->upsideDown() ? annotY0 : annotY1);
- if (borderStyle->getType() != annotBorderUnderlined) {
- state->lineTo(annotX1, out->upsideDown() ? annotY1 : annotY0);
- state->lineTo(annotX0, out->upsideDown() ? annotY1 : annotY0);
- state->closePath();
- }
- out->stroke(state);
- }
-}
-
-void Gfx::saveState() {
- out->saveState(state);
- state = state->save();
-}
-
-void Gfx::restoreState() {
- state = state->restore();
- out->restoreState(state);
-}
-
-void Gfx::pushResources(Dict *resDict) {
- res = new GfxResources(xref, resDict, res);
-}
-
-void Gfx::popResources() {
- GfxResources *resPtr;
-
- resPtr = res->getNext();
- delete res;
- res = resPtr;
-}
diff --git a/kpdf/xpdf/xpdf/Gfx.cpp b/kpdf/xpdf/xpdf/Gfx.cpp
new file mode 100644
index 00000000..2a4fdb6e
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Gfx.cpp
@@ -0,0 +1,4189 @@
+//========================================================================
+//
+// Gfx.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+#include <math.h>
+#include "gmem.h"
+#include "GlobalParams.h"
+#include "CharTypes.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Stream.h"
+#include "Lexer.h"
+#include "Parser.h"
+#include "GfxFont.h"
+#include "GfxState.h"
+#include "OutputDev.h"
+#include "Page.h"
+#include "Annot.h"
+#include "Error.h"
+#include "Gfx.h"
+
+// the MSVC math.h doesn't define this
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+//------------------------------------------------------------------------
+// constants
+//------------------------------------------------------------------------
+
+// Max recursive depth for a function shading fill.
+#define functionMaxDepth 6
+
+// Max delta allowed in any color component for a function shading fill.
+#define functionColorDelta (dblToCol(1 / 256.0))
+
+// Max number of splits along the t axis for an axial shading fill.
+#define axialMaxSplits 256
+
+// Max delta allowed in any color component for an axial shading fill.
+#define axialColorDelta (dblToCol(1 / 256.0))
+
+// Max number of splits along the t axis for a radial shading fill.
+#define radialMaxSplits 256
+
+// Max delta allowed in any color component for a radial shading fill.
+#define radialColorDelta (dblToCol(1 / 256.0))
+
+// Max recursive depth for a Gouraud triangle shading fill.
+#define gouraudMaxDepth 6
+
+// Max delta allowed in any color component for a Gouraud triangle
+// shading fill.
+#define gouraudColorDelta (dblToCol(1 / 256.0))
+
+// Max recursive depth for a patch mesh shading fill.
+#define patchMaxDepth 6
+
+// Max delta allowed in any color component for a patch mesh shading
+// fill.
+#define patchColorDelta (dblToCol(1 / 256.0))
+
+//------------------------------------------------------------------------
+// Operator table
+//------------------------------------------------------------------------
+
+#ifdef WIN32 // this works around a bug in the VC7 compiler
+# pragma optimize("",off)
+#endif
+
+Operator Gfx::opTab[] = {
+ {"\"", 3, {tchkNum, tchkNum, tchkString},
+ &Gfx::opMoveSetShowText},
+ {"'", 1, {tchkString},
+ &Gfx::opMoveShowText},
+ {"B", 0, {tchkNone},
+ &Gfx::opFillStroke},
+ {"B*", 0, {tchkNone},
+ &Gfx::opEOFillStroke},
+ {"BDC", 2, {tchkName, tchkProps},
+ &Gfx::opBeginMarkedContent},
+ {"BI", 0, {tchkNone},
+ &Gfx::opBeginImage},
+ {"BMC", 1, {tchkName},
+ &Gfx::opBeginMarkedContent},
+ {"BT", 0, {tchkNone},
+ &Gfx::opBeginText},
+ {"BX", 0, {tchkNone},
+ &Gfx::opBeginIgnoreUndef},
+ {"CS", 1, {tchkName},
+ &Gfx::opSetStrokeColorSpace},
+ {"DP", 2, {tchkName, tchkProps},
+ &Gfx::opMarkPoint},
+ {"Do", 1, {tchkName},
+ &Gfx::opXObject},
+ {"EI", 0, {tchkNone},
+ &Gfx::opEndImage},
+ {"EMC", 0, {tchkNone},
+ &Gfx::opEndMarkedContent},
+ {"ET", 0, {tchkNone},
+ &Gfx::opEndText},
+ {"EX", 0, {tchkNone},
+ &Gfx::opEndIgnoreUndef},
+ {"F", 0, {tchkNone},
+ &Gfx::opFill},
+ {"G", 1, {tchkNum},
+ &Gfx::opSetStrokeGray},
+ {"ID", 0, {tchkNone},
+ &Gfx::opImageData},
+ {"J", 1, {tchkInt},
+ &Gfx::opSetLineCap},
+ {"K", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetStrokeCMYKColor},
+ {"M", 1, {tchkNum},
+ &Gfx::opSetMiterLimit},
+ {"MP", 1, {tchkName},
+ &Gfx::opMarkPoint},
+ {"Q", 0, {tchkNone},
+ &Gfx::opRestore},
+ {"RG", 3, {tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetStrokeRGBColor},
+ {"S", 0, {tchkNone},
+ &Gfx::opStroke},
+ {"SC", -4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetStrokeColor},
+ {"SCN", -33, {tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN},
+ &Gfx::opSetStrokeColorN},
+ {"T*", 0, {tchkNone},
+ &Gfx::opTextNextLine},
+ {"TD", 2, {tchkNum, tchkNum},
+ &Gfx::opTextMoveSet},
+ {"TJ", 1, {tchkArray},
+ &Gfx::opShowSpaceText},
+ {"TL", 1, {tchkNum},
+ &Gfx::opSetTextLeading},
+ {"Tc", 1, {tchkNum},
+ &Gfx::opSetCharSpacing},
+ {"Td", 2, {tchkNum, tchkNum},
+ &Gfx::opTextMove},
+ {"Tf", 2, {tchkName, tchkNum},
+ &Gfx::opSetFont},
+ {"Tj", 1, {tchkString},
+ &Gfx::opShowText},
+ {"Tm", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opSetTextMatrix},
+ {"Tr", 1, {tchkInt},
+ &Gfx::opSetTextRender},
+ {"Ts", 1, {tchkNum},
+ &Gfx::opSetTextRise},
+ {"Tw", 1, {tchkNum},
+ &Gfx::opSetWordSpacing},
+ {"Tz", 1, {tchkNum},
+ &Gfx::opSetHorizScaling},
+ {"W", 0, {tchkNone},
+ &Gfx::opClip},
+ {"W*", 0, {tchkNone},
+ &Gfx::opEOClip},
+ {"b", 0, {tchkNone},
+ &Gfx::opCloseFillStroke},
+ {"b*", 0, {tchkNone},
+ &Gfx::opCloseEOFillStroke},
+ {"c", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opCurveTo},
+ {"cm", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opConcat},
+ {"cs", 1, {tchkName},
+ &Gfx::opSetFillColorSpace},
+ {"d", 2, {tchkArray, tchkNum},
+ &Gfx::opSetDash},
+ {"d0", 2, {tchkNum, tchkNum},
+ &Gfx::opSetCharWidth},
+ {"d1", 6, {tchkNum, tchkNum, tchkNum, tchkNum,
+ tchkNum, tchkNum},
+ &Gfx::opSetCacheDevice},
+ {"f", 0, {tchkNone},
+ &Gfx::opFill},
+ {"f*", 0, {tchkNone},
+ &Gfx::opEOFill},
+ {"g", 1, {tchkNum},
+ &Gfx::opSetFillGray},
+ {"gs", 1, {tchkName},
+ &Gfx::opSetExtGState},
+ {"h", 0, {tchkNone},
+ &Gfx::opClosePath},
+ {"i", 1, {tchkNum},
+ &Gfx::opSetFlat},
+ {"j", 1, {tchkInt},
+ &Gfx::opSetLineJoin},
+ {"k", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetFillCMYKColor},
+ {"l", 2, {tchkNum, tchkNum},
+ &Gfx::opLineTo},
+ {"m", 2, {tchkNum, tchkNum},
+ &Gfx::opMoveTo},
+ {"n", 0, {tchkNone},
+ &Gfx::opEndPath},
+ {"q", 0, {tchkNone},
+ &Gfx::opSave},
+ {"re", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opRectangle},
+ {"rg", 3, {tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetFillRGBColor},
+ {"ri", 1, {tchkName},
+ &Gfx::opSetRenderingIntent},
+ {"s", 0, {tchkNone},
+ &Gfx::opCloseStroke},
+ {"sc", -4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opSetFillColor},
+ {"scn", -33, {tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN, tchkSCN, tchkSCN, tchkSCN,
+ tchkSCN},
+ &Gfx::opSetFillColorN},
+ {"sh", 1, {tchkName},
+ &Gfx::opShFill},
+ {"v", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opCurveTo1},
+ {"w", 1, {tchkNum},
+ &Gfx::opSetLineWidth},
+ {"y", 4, {tchkNum, tchkNum, tchkNum, tchkNum},
+ &Gfx::opCurveTo2},
+};
+
+#ifdef WIN32 // this works around a bug in the VC7 compiler
+# pragma optimize("",on)
+#endif
+
+#define numOps (sizeof(opTab) / sizeof(Operator))
+
+//------------------------------------------------------------------------
+// GfxResources
+//------------------------------------------------------------------------
+
+GfxResources::GfxResources(XRef *xref, Dict *resDict, GfxResources *nextA) {
+ Object obj1, obj2;
+ Ref r;
+
+ if (resDict) {
+
+ // build font dictionary
+ fonts = NULL;
+ resDict->lookupNF("Font", &obj1);
+ if (obj1.isRef()) {
+ obj1.fetch(xref, &obj2);
+ if (obj2.isDict()) {
+ r = obj1.getRef();
+ fonts = new GfxFontDict(xref, &r, obj2.getDict());
+ }
+ obj2.free();
+ } else if (obj1.isDict()) {
+ fonts = new GfxFontDict(xref, NULL, obj1.getDict());
+ }
+ obj1.free();
+
+ // get XObject dictionary
+ resDict->lookup("XObject", &xObjDict);
+
+ // get color space dictionary
+ resDict->lookup("ColorSpace", &colorSpaceDict);
+
+ // get pattern dictionary
+ resDict->lookup("Pattern", &patternDict);
+
+ // get shading dictionary
+ resDict->lookup("Shading", &shadingDict);
+
+ // get graphics state parameter dictionary
+ resDict->lookup("ExtGState", &gStateDict);
+
+ } else {
+ fonts = NULL;
+ xObjDict.initNull();
+ colorSpaceDict.initNull();
+ patternDict.initNull();
+ shadingDict.initNull();
+ gStateDict.initNull();
+ }
+
+ next = nextA;
+}
+
+GfxResources::~GfxResources() {
+ if (fonts) {
+ delete fonts;
+ }
+ xObjDict.free();
+ colorSpaceDict.free();
+ patternDict.free();
+ shadingDict.free();
+ gStateDict.free();
+}
+
+GfxFont *GfxResources::lookupFont(char *name) {
+ GfxFont *font;
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->fonts) {
+ if ((font = resPtr->fonts->lookup(name)))
+ return font;
+ }
+ }
+ error(-1, "Unknown font tag '%s'", name);
+ return NULL;
+}
+
+GBool GfxResources::lookupXObject(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->xObjDict.isDict()) {
+ if (!resPtr->xObjDict.dictLookup(name, obj)->isNull())
+ return gTrue;
+ obj->free();
+ }
+ }
+ error(-1, "XObject '%s' is unknown", name);
+ return gFalse;
+}
+
+GBool GfxResources::lookupXObjectNF(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->xObjDict.isDict()) {
+ if (!resPtr->xObjDict.dictLookupNF(name, obj)->isNull())
+ return gTrue;
+ obj->free();
+ }
+ }
+ error(-1, "XObject '%s' is unknown", name);
+ return gFalse;
+}
+
+void GfxResources::lookupColorSpace(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->colorSpaceDict.isDict()) {
+ if (!resPtr->colorSpaceDict.dictLookup(name, obj)->isNull()) {
+ return;
+ }
+ obj->free();
+ }
+ }
+ obj->initNull();
+}
+
+GfxPattern *GfxResources::lookupPattern(char *name) {
+ GfxResources *resPtr;
+ GfxPattern *pattern;
+ Object obj;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->patternDict.isDict()) {
+ if (!resPtr->patternDict.dictLookup(name, &obj)->isNull()) {
+ pattern = GfxPattern::parse(&obj);
+ obj.free();
+ return pattern;
+ }
+ obj.free();
+ }
+ }
+ error(-1, "Unknown pattern '%s'", name);
+ return NULL;
+}
+
+GfxShading *GfxResources::lookupShading(char *name) {
+ GfxResources *resPtr;
+ GfxShading *shading;
+ Object obj;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->shadingDict.isDict()) {
+ if (!resPtr->shadingDict.dictLookup(name, &obj)->isNull()) {
+ shading = GfxShading::parse(&obj);
+ obj.free();
+ return shading;
+ }
+ obj.free();
+ }
+ }
+ error(-1, "Unknown shading '%s'", name);
+ return NULL;
+}
+
+GBool GfxResources::lookupGState(char *name, Object *obj) {
+ GfxResources *resPtr;
+
+ for (resPtr = this; resPtr; resPtr = resPtr->next) {
+ if (resPtr->gStateDict.isDict()) {
+ if (!resPtr->gStateDict.dictLookup(name, obj)->isNull()) {
+ return gTrue;
+ }
+ obj->free();
+ }
+ }
+ error(-1, "ExtGState '%s' is unknown", name);
+ return gFalse;
+}
+
+//------------------------------------------------------------------------
+// Gfx
+//------------------------------------------------------------------------
+
+Gfx::Gfx(XRef *xrefA, OutputDev *outA, int pageNum, Dict *resDict,
+ double hDPI, double vDPI, PDFRectangle *box,
+ PDFRectangle *cropBox, int rotate,
+ GBool (*abortCheckCbkA)(void *data),
+ void *abortCheckCbkDataA) {
+ int i;
+
+ xref = xrefA;
+ subPage = gFalse;
+ printCommands = globalParams->getPrintCommands();
+
+ // start the resource stack
+ res = new GfxResources(xref, resDict, NULL);
+
+ // initialize
+ out = outA;
+ state = new GfxState(hDPI, vDPI, box, rotate, out->upsideDown());
+ fontChanged = gFalse;
+ clip = clipNone;
+ ignoreUndef = 0;
+ out->startPage(pageNum, state);
+ out->setDefaultCTM(state->getCTM());
+ out->updateAll(state);
+ for (i = 0; i < 6; ++i) {
+ baseMatrix[i] = state->getCTM()[i];
+ }
+ formDepth = 0;
+ parser = NULL;
+ abortCheckCbk = abortCheckCbkA;
+ abortCheckCbkData = abortCheckCbkDataA;
+
+ // set crop box
+ if (cropBox) {
+ state->moveTo(cropBox->x1, cropBox->y1);
+ state->lineTo(cropBox->x2, cropBox->y1);
+ state->lineTo(cropBox->x2, cropBox->y2);
+ state->lineTo(cropBox->x1, cropBox->y2);
+ state->closePath();
+ state->clip();
+ out->clip(state);
+ state->clearPath();
+ }
+}
+
+Gfx::Gfx(XRef *xrefA, OutputDev *outA, Dict *resDict,
+ PDFRectangle *box, PDFRectangle *cropBox,
+ GBool (*abortCheckCbkA)(void *data),
+ void *abortCheckCbkDataA) {
+ int i;
+
+ xref = xrefA;
+ subPage = gTrue;
+ printCommands = globalParams->getPrintCommands();
+
+ // start the resource stack
+ res = new GfxResources(xref, resDict, NULL);
+
+ // initialize
+ out = outA;
+ state = new GfxState(72, 72, box, 0, gFalse);
+ fontChanged = gFalse;
+ clip = clipNone;
+ ignoreUndef = 0;
+ for (i = 0; i < 6; ++i) {
+ baseMatrix[i] = state->getCTM()[i];
+ }
+ formDepth = 0;
+ parser = NULL;
+ abortCheckCbk = abortCheckCbkA;
+ abortCheckCbkData = abortCheckCbkDataA;
+
+ // set crop box
+ if (cropBox) {
+ state->moveTo(cropBox->x1, cropBox->y1);
+ state->lineTo(cropBox->x2, cropBox->y1);
+ state->lineTo(cropBox->x2, cropBox->y2);
+ state->lineTo(cropBox->x1, cropBox->y2);
+ state->closePath();
+ state->clip();
+ out->clip(state);
+ state->clearPath();
+ }
+}
+
+Gfx::~Gfx() {
+ while (state->hasSaves()) {
+ restoreState();
+ }
+ if (!subPage) {
+ out->endPage();
+ }
+ while (res) {
+ popResources();
+ }
+ if (state) {
+ delete state;
+ }
+}
+
+void Gfx::display(Object *obj, GBool topLevel) {
+ Object obj2;
+ int i;
+
+ if (obj->isArray()) {
+ for (i = 0; i < obj->arrayGetLength(); ++i) {
+ obj->arrayGet(i, &obj2);
+ if (!obj2.isStream()) {
+ error(-1, "Weird page contents");
+ obj2.free();
+ return;
+ }
+ obj2.free();
+ }
+ } else if (!obj->isStream()) {
+ error(-1, "Weird page contents");
+ return;
+ }
+ parser = new Parser(xref, new Lexer(xref, obj), gFalse);
+ go(topLevel);
+ delete parser;
+ parser = NULL;
+}
+
+void Gfx::go(GBool topLevel) {
+ Object obj;
+ Object args[maxArgs];
+ int numArgs, i;
+ int lastAbortCheck;
+
+ // scan a sequence of objects
+ updateLevel = lastAbortCheck = 0;
+ numArgs = 0;
+ parser->getObj(&obj);
+ while (!obj.isEOF()) {
+
+ // got a command - execute it
+ if (obj.isCmd()) {
+ if (printCommands) {
+ obj.print(stdout);
+ for (i = 0; i < numArgs; ++i) {
+ printf(" ");
+ args[i].print(stdout);
+ }
+ printf("\n");
+ fflush(stdout);
+ }
+ execOp(&obj, args, numArgs);
+ obj.free();
+ for (i = 0; i < numArgs; ++i)
+ args[i].free();
+ numArgs = 0;
+
+ // periodically update display
+ if (++updateLevel >= 20000) {
+ out->dump();
+ updateLevel = 0;
+ }
+
+ // check for an abort
+ if (abortCheckCbk) {
+ if (updateLevel - lastAbortCheck > 10) {
+ if ((*abortCheckCbk)(abortCheckCbkData)) {
+ break;
+ }
+ lastAbortCheck = updateLevel;
+ }
+ }
+
+ // got an argument - save it
+ } else if (numArgs < maxArgs) {
+ args[numArgs++] = obj;
+
+ // too many arguments - something is wrong
+ } else {
+ error(getPos(), "Too many args in content stream");
+ if (printCommands) {
+ printf("throwing away arg: ");
+ obj.print(stdout);
+ printf("\n");
+ fflush(stdout);
+ }
+ obj.free();
+ }
+
+ // grab the next object
+ parser->getObj(&obj);
+ }
+ obj.free();
+
+ // args at end with no command
+ if (numArgs > 0) {
+ error(getPos(), "Leftover args in content stream");
+ if (printCommands) {
+ printf("%d leftovers:", numArgs);
+ for (i = 0; i < numArgs; ++i) {
+ printf(" ");
+ args[i].print(stdout);
+ }
+ printf("\n");
+ fflush(stdout);
+ }
+ for (i = 0; i < numArgs; ++i)
+ args[i].free();
+ }
+
+ // update display
+ if (topLevel && updateLevel > 0) {
+ out->dump();
+ }
+}
+
+void Gfx::execOp(Object *cmd, Object args[], int numArgs) {
+ Operator *op;
+ char *name;
+ Object *argPtr;
+ int i;
+
+ // find operator
+ name = cmd->getCmd();
+ if (!(op = findOp(name))) {
+ if (ignoreUndef == 0)
+ error(getPos(), "Unknown operator '%s'", name);
+ return;
+ }
+
+ // type check args
+ argPtr = args;
+ if (op->numArgs >= 0) {
+ if (numArgs < op->numArgs) {
+ error(getPos(), "Too few (%d) args to '%s' operator", numArgs, name);
+ return;
+ }
+ if (numArgs > op->numArgs) {
+#if 0
+ error(getPos(), "Too many (%d) args to '%s' operator", numArgs, name);
+#endif
+ argPtr += numArgs - op->numArgs;
+ numArgs = op->numArgs;
+ }
+ } else {
+ if (numArgs > -op->numArgs) {
+ error(getPos(), "Too many (%d) args to '%s' operator",
+ numArgs, name);
+ return;
+ }
+ }
+ for (i = 0; i < numArgs; ++i) {
+ if (!checkArg(&argPtr[i], op->tchk[i])) {
+ error(getPos(), "Arg #%d to '%s' operator is wrong type (%s)",
+ i, name, argPtr[i].getTypeName());
+ return;
+ }
+ }
+
+ // do it
+ (this->*op->func)(argPtr, numArgs);
+}
+
+Operator *Gfx::findOp(char *name) {
+ int a, b, m, cmp;
+
+ a = -1;
+ b = numOps;
+ // invariant: opTab[a] < name < opTab[b]
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ cmp = strcmp(opTab[m].name, name);
+ if (cmp < 0)
+ a = m;
+ else if (cmp > 0)
+ b = m;
+ else
+ a = b = m;
+ }
+ if (cmp != 0)
+ return NULL;
+ return &opTab[a];
+}
+
+GBool Gfx::checkArg(Object *arg, TchkType type) {
+ switch (type) {
+ case tchkBool: return arg->isBool();
+ case tchkInt: return arg->isInt();
+ case tchkNum: return arg->isNum();
+ case tchkString: return arg->isString();
+ case tchkName: return arg->isName();
+ case tchkArray: return arg->isArray();
+ case tchkProps: return arg->isDict() || arg->isName();
+ case tchkSCN: return arg->isNum() || arg->isName();
+ case tchkNone: return gFalse;
+ }
+ return gFalse;
+}
+
+int Gfx::getPos() {
+ return parser ? parser->getPos() : -1;
+}
+
+//------------------------------------------------------------------------
+// graphics state operators
+//------------------------------------------------------------------------
+
+void Gfx::opSave(Object * /*args[]*/, int /*numArgs*/) {
+ saveState();
+}
+
+void Gfx::opRestore(Object * /*args[]*/, int /*numArgs*/) {
+ restoreState();
+}
+
+void Gfx::opConcat(Object args[], int /*numArgs*/) {
+ state->concatCTM(args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+ out->updateCTM(state, args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+ fontChanged = gTrue;
+}
+
+void Gfx::opSetDash(Object args[], int /*numArgs*/) {
+ Array *a;
+ int length;
+ Object obj;
+ double *dash;
+ int i;
+
+ a = args[0].getArray();
+ length = a->getLength();
+ if (length == 0) {
+ dash = NULL;
+ } else {
+ dash = (double *)gmallocn(length, sizeof(double));
+ for (i = 0; i < length; ++i) {
+ dash[i] = a->get(i, &obj)->getNum();
+ obj.free();
+ }
+ }
+ state->setLineDash(dash, length, args[1].getNum());
+ out->updateLineDash(state);
+}
+
+void Gfx::opSetFlat(Object args[], int /*numArgs*/) {
+ state->setFlatness((int)args[0].getNum());
+ out->updateFlatness(state);
+}
+
+void Gfx::opSetLineJoin(Object args[], int /*numArgs*/) {
+ state->setLineJoin(args[0].getInt());
+ out->updateLineJoin(state);
+}
+
+void Gfx::opSetLineCap(Object args[], int /*numArgs*/) {
+ state->setLineCap(args[0].getInt());
+ out->updateLineCap(state);
+}
+
+void Gfx::opSetMiterLimit(Object args[], int /*numArgs*/) {
+ state->setMiterLimit(args[0].getNum());
+ out->updateMiterLimit(state);
+}
+
+void Gfx::opSetLineWidth(Object args[], int /*numArgs*/) {
+ state->setLineWidth(args[0].getNum());
+ out->updateLineWidth(state);
+}
+
+void Gfx::opSetExtGState(Object args[], int /*numArgs*/) {
+ Object obj1, obj2, obj3, obj4, obj5;
+ GfxBlendMode mode;
+ GBool haveFillOP;
+ Function *funcs[4];
+ GfxColor backdropColor;
+ GBool haveBackdropColor;
+ GfxColorSpace *blendingColorSpace;
+ GBool alpha, isolated, knockout;
+ int i;
+
+ if (!res->lookupGState(args[0].getName(), &obj1)) {
+ return;
+ }
+ if (!obj1.isDict()) {
+ error(getPos(), "ExtGState '%s' is wrong type", args[0].getName());
+ obj1.free();
+ return;
+ }
+ if (printCommands) {
+ printf(" gfx state dict: ");
+ obj1.print();
+ printf("\n");
+ }
+
+ // transparency support: blend mode, fill/stroke opacity
+ if (!obj1.dictLookup("BM", &obj2)->isNull()) {
+ if (state->parseBlendMode(&obj2, &mode)) {
+ state->setBlendMode(mode);
+ out->updateBlendMode(state);
+ } else {
+ error(getPos(), "Invalid blend mode in ExtGState");
+ }
+ }
+ obj2.free();
+ if (obj1.dictLookup("ca", &obj2)->isNum()) {
+ state->setFillOpacity(obj2.getNum());
+ out->updateFillOpacity(state);
+ }
+ obj2.free();
+ if (obj1.dictLookup("CA", &obj2)->isNum()) {
+ state->setStrokeOpacity(obj2.getNum());
+ out->updateStrokeOpacity(state);
+ }
+ obj2.free();
+
+ // fill/stroke overprint
+ if ((haveFillOP = (obj1.dictLookup("op", &obj2)->isBool()))) {
+ state->setFillOverprint(obj2.getBool());
+ out->updateFillOverprint(state);
+ }
+ obj2.free();
+ if (obj1.dictLookup("OP", &obj2)->isBool()) {
+ state->setStrokeOverprint(obj2.getBool());
+ out->updateStrokeOverprint(state);
+ if (!haveFillOP) {
+ state->setFillOverprint(obj2.getBool());
+ out->updateFillOverprint(state);
+ }
+ }
+ obj2.free();
+
+ // stroke adjust
+ if (obj1.dictLookup("SA", &obj2)->isBool()) {
+ state->setStrokeAdjust(obj2.getBool());
+ out->updateStrokeAdjust(state);
+ }
+ obj2.free();
+
+ // transfer function
+ if (obj1.dictLookup("TR2", &obj2)->isNull()) {
+ obj2.free();
+ obj1.dictLookup("TR", &obj2);
+ }
+ if (obj2.isName("Default") ||
+ obj2.isName("Identity")) {
+ funcs[0] = funcs[1] = funcs[2] = funcs[3] = NULL;
+ state->setTransfer(funcs);
+ out->updateTransfer(state);
+ } else if (obj2.isArray() && obj2.arrayGetLength() == 4) {
+ for (i = 0; i < 4; ++i) {
+ obj2.arrayGet(i, &obj3);
+ funcs[i] = Function::parse(&obj3);
+ obj3.free();
+ if (!funcs[i]) {
+ break;
+ }
+ }
+ if (i == 4) {
+ state->setTransfer(funcs);
+ out->updateTransfer(state);
+ }
+ } else if (obj2.isName() || obj2.isDict() || obj2.isStream()) {
+ if ((funcs[0] = Function::parse(&obj2))) {
+ funcs[1] = funcs[2] = funcs[3] = NULL;
+ state->setTransfer(funcs);
+ out->updateTransfer(state);
+ }
+ } else if (!obj2.isNull()) {
+ error(getPos(), "Invalid transfer function in ExtGState");
+ }
+ obj2.free();
+
+ // soft mask
+ if (!obj1.dictLookup("SMask", &obj2)->isNull()) {
+ if (obj2.isName("None")) {
+ out->clearSoftMask(state);
+ } else if (obj2.isDict()) {
+ if (obj2.dictLookup("S", &obj3)->isName("Alpha")) {
+ alpha = gTrue;
+ } else { // "Luminosity"
+ alpha = gFalse;
+ }
+ obj3.free();
+ funcs[0] = NULL;
+ if (!obj2.dictLookup("TR", &obj3)->isNull()) {
+ funcs[0] = Function::parse(&obj3);
+ if (funcs[0]->getInputSize() != 1 ||
+ funcs[0]->getOutputSize() != 1) {
+ error(getPos(),
+ "Invalid transfer function in soft mask in ExtGState");
+ delete funcs[0];
+ funcs[0] = NULL;
+ }
+ }
+ obj3.free();
+ if ((haveBackdropColor = obj2.dictLookup("BC", &obj3)->isArray())) {
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ backdropColor.c[i] = 0;
+ }
+ for (i = 0; i < obj3.arrayGetLength() && i < gfxColorMaxComps; ++i) {
+ obj3.arrayGet(i, &obj4);
+ if (obj4.isNum()) {
+ backdropColor.c[i] = dblToCol(obj4.getNum());
+ }
+ obj4.free();
+ }
+ }
+ obj3.free();
+ if (obj2.dictLookup("G", &obj3)->isStream()) {
+ if (obj3.streamGetDict()->lookup("Group", &obj4)->isDict()) {
+ blendingColorSpace = NULL;
+ isolated = knockout = gFalse;
+ if (!obj4.dictLookup("CS", &obj5)->isNull()) {
+ blendingColorSpace = GfxColorSpace::parse(&obj5);
+ }
+ obj5.free();
+ if (obj4.dictLookup("I", &obj5)->isBool()) {
+ isolated = obj5.getBool();
+ }
+ obj5.free();
+ if (obj4.dictLookup("K", &obj5)->isBool()) {
+ knockout = obj5.getBool();
+ }
+ obj5.free();
+ if (!haveBackdropColor) {
+ if (blendingColorSpace) {
+ blendingColorSpace->getDefaultColor(&backdropColor);
+ } else {
+ //~ need to get the parent or default color space (?)
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ backdropColor.c[i] = 0;
+ }
+ }
+ }
+ doSoftMask(&obj3, alpha, blendingColorSpace,
+ isolated, knockout, funcs[0], &backdropColor);
+ if (funcs[0]) {
+ delete funcs[0];
+ }
+ } else {
+ error(getPos(), "Invalid soft mask in ExtGState - missing group");
+ }
+ obj4.free();
+ } else {
+ error(getPos(), "Invalid soft mask in ExtGState - missing group");
+ }
+ obj3.free();
+ } else if (!obj2.isNull()) {
+ error(getPos(), "Invalid soft mask in ExtGState");
+ }
+ }
+ obj2.free();
+
+ obj1.free();
+}
+
+void Gfx::doSoftMask(Object *str, GBool alpha,
+ GfxColorSpace *blendingColorSpace,
+ GBool isolated, GBool knockout,
+ Function *transferFunc, GfxColor *backdropColor) {
+ Dict *dict, *resDict;
+ double m[6], bbox[4];
+ Object obj1, obj2;
+ int i;
+
+ // check for excessive recursion
+ if (formDepth > 20) {
+ return;
+ }
+
+ // get stream dict
+ dict = str->streamGetDict();
+
+ // check form type
+ dict->lookup("FormType", &obj1);
+ if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
+ error(getPos(), "Unknown form type");
+ }
+ obj1.free();
+
+ // get bounding box
+ dict->lookup("BBox", &obj1);
+ if (!obj1.isArray()) {
+ obj1.free();
+ error(getPos(), "Bad form bounding box");
+ return;
+ }
+ for (i = 0; i < 4; ++i) {
+ obj1.arrayGet(i, &obj2);
+ bbox[i] = obj2.getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ // get matrix
+ dict->lookup("Matrix", &obj1);
+ if (obj1.isArray()) {
+ for (i = 0; i < 6; ++i) {
+ obj1.arrayGet(i, &obj2);
+ m[i] = obj2.getNum();
+ obj2.free();
+ }
+ } else {
+ m[0] = 1; m[1] = 0;
+ m[2] = 0; m[3] = 1;
+ m[4] = 0; m[5] = 0;
+ }
+ obj1.free();
+
+ // get resources
+ dict->lookup("Resources", &obj1);
+ resDict = obj1.isDict() ? obj1.getDict() : (Dict *)NULL;
+
+ // draw it
+ ++formDepth;
+ doForm1(str, resDict, m, bbox, gTrue, gTrue,
+ blendingColorSpace, isolated, knockout,
+ alpha, transferFunc, backdropColor);
+ --formDepth;
+
+ if (blendingColorSpace) {
+ delete blendingColorSpace;
+ }
+ obj1.free();
+}
+
+void Gfx::opSetRenderingIntent(Object * /*args[]*/, int /*numArgs*/) {
+}
+
+//------------------------------------------------------------------------
+// color operators
+//------------------------------------------------------------------------
+
+void Gfx::opSetFillGray(Object args[], int /*numArgs*/) {
+ GfxColor color;
+
+ state->setFillPattern(NULL);
+ state->setFillColorSpace(new GfxDeviceGrayColorSpace());
+ out->updateFillColorSpace(state);
+ color.c[0] = dblToCol(args[0].getNum());
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeGray(Object args[], int /*numArgs*/) {
+ GfxColor color;
+
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceGrayColorSpace());
+ out->updateStrokeColorSpace(state);
+ color.c[0] = dblToCol(args[0].getNum());
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillCMYKColor(Object args[], int /*numArgs*/) {
+ GfxColor color;
+ int i;
+
+ state->setFillPattern(NULL);
+ state->setFillColorSpace(new GfxDeviceCMYKColorSpace());
+ out->updateFillColorSpace(state);
+ for (i = 0; i < 4; ++i) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeCMYKColor(Object args[], int /*numArgs*/) {
+ GfxColor color;
+ int i;
+
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceCMYKColorSpace());
+ out->updateStrokeColorSpace(state);
+ for (i = 0; i < 4; ++i) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillRGBColor(Object args[], int /*numArgs*/) {
+ GfxColor color;
+ int i;
+
+ state->setFillPattern(NULL);
+ state->setFillColorSpace(new GfxDeviceRGBColorSpace());
+ out->updateFillColorSpace(state);
+ for (i = 0; i < 3; ++i) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeRGBColor(Object args[], int /*numArgs*/) {
+ GfxColor color;
+ int i;
+
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
+ out->updateStrokeColorSpace(state);
+ for (i = 0; i < 3; ++i) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillColorSpace(Object args[], int /*numArgs*/) {
+ Object obj;
+ GfxColorSpace *colorSpace;
+ GfxColor color;
+
+ state->setFillPattern(NULL);
+ res->lookupColorSpace(args[0].getName(), &obj);
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(&args[0]);
+ } else {
+ colorSpace = GfxColorSpace::parse(&obj);
+ }
+ obj.free();
+ if (colorSpace) {
+ state->setFillColorSpace(colorSpace);
+ out->updateFillColorSpace(state);
+ colorSpace->getDefaultColor(&color);
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+ } else {
+ error(getPos(), "Bad color space (fill)");
+ }
+}
+
+void Gfx::opSetStrokeColorSpace(Object args[], int /*numArgs*/) {
+ Object obj;
+ GfxColorSpace *colorSpace;
+ GfxColor color;
+
+ state->setStrokePattern(NULL);
+ res->lookupColorSpace(args[0].getName(), &obj);
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(&args[0]);
+ } else {
+ colorSpace = GfxColorSpace::parse(&obj);
+ }
+ obj.free();
+ if (colorSpace) {
+ state->setStrokeColorSpace(colorSpace);
+ out->updateStrokeColorSpace(state);
+ colorSpace->getDefaultColor(&color);
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+ } else {
+ error(getPos(), "Bad color space (stroke)");
+ }
+}
+
+void Gfx::opSetFillColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ if (numArgs != state->getFillColorSpace()->getNComps()) {
+ error(getPos(), "Incorrect number of arguments in 'sc' command");
+ return;
+ }
+ state->setFillPattern(NULL);
+ for (i = 0; i < numArgs; ++i) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+}
+
+void Gfx::opSetStrokeColor(Object args[], int numArgs) {
+ GfxColor color;
+ int i;
+
+ if (numArgs != state->getStrokeColorSpace()->getNComps()) {
+ error(getPos(), "Incorrect number of arguments in 'SC' command");
+ return;
+ }
+ state->setStrokePattern(NULL);
+ for (i = 0; i < numArgs; ++i) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+}
+
+void Gfx::opSetFillColorN(Object args[], int numArgs) {
+ GfxColor color;
+ GfxPattern *pattern;
+ int i;
+
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ if (numArgs > 1) {
+ if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() ||
+ numArgs - 1 != ((GfxPatternColorSpace *)state->getFillColorSpace())
+ ->getUnder()->getNComps()) {
+ error(getPos(), "Incorrect number of arguments in 'scn' command");
+ return;
+ }
+ for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+ }
+ if (args[numArgs-1].isName() &&
+ (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
+ state->setFillPattern(pattern);
+ }
+
+ } else {
+ if (numArgs != state->getFillColorSpace()->getNComps()) {
+ error(getPos(), "Incorrect number of arguments in 'scn' command");
+ return;
+ }
+ state->setFillPattern(NULL);
+ for (i = 0; i < numArgs && i < gfxColorMaxComps; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ }
+ state->setFillColor(&color);
+ out->updateFillColor(state);
+ }
+}
+
+void Gfx::opSetStrokeColorN(Object args[], int numArgs) {
+ GfxColor color;
+ GfxPattern *pattern;
+ int i;
+
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ if (numArgs > 1) {
+ if (!((GfxPatternColorSpace *)state->getStrokeColorSpace())
+ ->getUnder() ||
+ numArgs - 1 != ((GfxPatternColorSpace *)state->getStrokeColorSpace())
+ ->getUnder()->getNComps()) {
+ error(getPos(), "Incorrect number of arguments in 'SCN' command");
+ return;
+ }
+ for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+ }
+ if (args[numArgs-1].isName() &&
+ (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
+ state->setStrokePattern(pattern);
+ }
+
+ } else {
+ if (numArgs != state->getStrokeColorSpace()->getNComps()) {
+ error(getPos(), "Incorrect number of arguments in 'SCN' command");
+ return;
+ }
+ state->setStrokePattern(NULL);
+ for (i = 0; i < numArgs && i < gfxColorMaxComps; ++i) {
+ if (args[i].isNum()) {
+ color.c[i] = dblToCol(args[i].getNum());
+ }
+ }
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+ }
+}
+
+//------------------------------------------------------------------------
+// path segment operators
+//------------------------------------------------------------------------
+
+void Gfx::opMoveTo(Object args[], int /*numArgs*/) {
+ state->moveTo(args[0].getNum(), args[1].getNum());
+}
+
+void Gfx::opLineTo(Object args[], int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in lineto");
+ return;
+ }
+ state->lineTo(args[0].getNum(), args[1].getNum());
+}
+
+void Gfx::opCurveTo(Object args[], int /*numArgs*/) {
+ double x1, y1, x2, y2, x3, y3;
+
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in curveto");
+ return;
+ }
+ x1 = args[0].getNum();
+ y1 = args[1].getNum();
+ x2 = args[2].getNum();
+ y2 = args[3].getNum();
+ x3 = args[4].getNum();
+ y3 = args[5].getNum();
+ state->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void Gfx::opCurveTo1(Object args[], int /*numArgs*/) {
+ double x1, y1, x2, y2, x3, y3;
+
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in curveto1");
+ return;
+ }
+ x1 = state->getCurX();
+ y1 = state->getCurY();
+ x2 = args[0].getNum();
+ y2 = args[1].getNum();
+ x3 = args[2].getNum();
+ y3 = args[3].getNum();
+ state->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void Gfx::opCurveTo2(Object args[], int /*numArgs*/) {
+ double x1, y1, x2, y2, x3, y3;
+
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in curveto2");
+ return;
+ }
+ x1 = args[0].getNum();
+ y1 = args[1].getNum();
+ x2 = args[2].getNum();
+ y2 = args[3].getNum();
+ x3 = x2;
+ y3 = y2;
+ state->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void Gfx::opRectangle(Object args[], int /*numArgs*/) {
+ double x, y, w, h;
+
+ x = args[0].getNum();
+ y = args[1].getNum();
+ w = args[2].getNum();
+ h = args[3].getNum();
+ state->moveTo(x, y);
+ state->lineTo(x + w, y);
+ state->lineTo(x + w, y + h);
+ state->lineTo(x, y + h);
+ state->closePath();
+}
+
+void Gfx::opClosePath(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ error(getPos(), "No current point in closepath");
+ return;
+ }
+ state->closePath();
+}
+
+//------------------------------------------------------------------------
+// path painting operators
+//------------------------------------------------------------------------
+
+void Gfx::opEndPath(Object * /*args[]*/, int /*numArgs*/) {
+ doEndPath();
+}
+
+void Gfx::opStroke(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in stroke");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ doPatternStroke();
+ } else {
+ out->stroke(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opCloseStroke(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in closepath/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ state->closePath();
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ doPatternStroke();
+ } else {
+ out->stroke(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opFill(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in fill");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gFalse);
+ } else {
+ out->fill(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opEOFill(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in eofill");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gTrue);
+ } else {
+ out->eoFill(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opFillStroke(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in fill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gFalse);
+ } else {
+ out->fill(state);
+ }
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ doPatternStroke();
+ } else {
+ out->stroke(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opCloseFillStroke(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in closepath/fill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ state->closePath();
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gFalse);
+ } else {
+ out->fill(state);
+ }
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ doPatternStroke();
+ } else {
+ out->stroke(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opEOFillStroke(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in eofill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gTrue);
+ } else {
+ out->eoFill(state);
+ }
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ doPatternStroke();
+ } else {
+ out->stroke(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::opCloseEOFillStroke(Object * /*args[]*/, int /*numArgs*/) {
+ if (!state->isCurPt()) {
+ //error(getPos(), "No path in closepath/eofill/stroke");
+ return;
+ }
+ if (state->isPath()) {
+ state->closePath();
+ if (state->getFillColorSpace()->getMode() == csPattern) {
+ doPatternFill(gTrue);
+ } else {
+ out->eoFill(state);
+ }
+ if (state->getStrokeColorSpace()->getMode() == csPattern) {
+ doPatternStroke();
+ } else {
+ out->stroke(state);
+ }
+ }
+ doEndPath();
+}
+
+void Gfx::doPatternFill(GBool eoFill) {
+ GfxPattern *pattern;
+
+ // this is a bit of a kludge -- patterns can be really slow, so we
+ // skip them if we're only doing text extraction, since they almost
+ // certainly don't contain any text
+ if (!out->needNonText()) {
+ return;
+ }
+
+ if (!(pattern = state->getFillPattern())) {
+ return;
+ }
+ switch (pattern->getType()) {
+ case 1:
+ doTilingPatternFill((GfxTilingPattern *)pattern, gFalse, eoFill);
+ break;
+ case 2:
+ doShadingPatternFill((GfxShadingPattern *)pattern, gFalse, eoFill);
+ break;
+ default:
+ error(getPos(), "Unimplemented pattern type (%d) in fill",
+ pattern->getType());
+ break;
+ }
+}
+
+void Gfx::doPatternStroke() {
+ GfxPattern *pattern;
+
+ // this is a bit of a kludge -- patterns can be really slow, so we
+ // skip them if we're only doing text extraction, since they almost
+ // certainly don't contain any text
+ if (!out->needNonText()) {
+ return;
+ }
+
+ if (!(pattern = state->getStrokePattern())) {
+ return;
+ }
+ switch (pattern->getType()) {
+ case 1:
+ doTilingPatternFill((GfxTilingPattern *)pattern, gTrue, gFalse);
+ break;
+ case 2:
+ doShadingPatternFill((GfxShadingPattern *)pattern, gTrue, gFalse);
+ break;
+ default:
+ error(getPos(), "Unimplemented pattern type (%d) in stroke",
+ pattern->getType());
+ break;
+ }
+}
+
+void Gfx::doTilingPatternFill(GfxTilingPattern *tPat,
+ GBool stroke, GBool eoFill) {
+ GfxPatternColorSpace *patCS;
+ GfxColorSpace *cs;
+ GfxPath *savedPath;
+ double xMin, yMin, xMax, yMax, x, y, x1, y1;
+ double cxMin, cyMin, cxMax, cyMax;
+ int xi0, yi0, xi1, yi1, xi, yi;
+ double *ctm, *btm, *ptm;
+ double m[6], ictm[6], m1[6], imb[6];
+ double det;
+ double xstep, ystep;
+ int i;
+
+ // get color space
+ patCS = (GfxPatternColorSpace *)(stroke ? state->getStrokeColorSpace()
+ : state->getFillColorSpace());
+
+ // construct a (pattern space) -> (current space) transform matrix
+ ctm = state->getCTM();
+ btm = baseMatrix;
+ ptm = tPat->getMatrix();
+ // iCTM = invert CTM
+ det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+ ictm[0] = ctm[3] * det;
+ ictm[1] = -ctm[1] * det;
+ ictm[2] = -ctm[2] * det;
+ ictm[3] = ctm[0] * det;
+ ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
+ ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
+ // m1 = PTM * BTM = PTM * base transform matrix
+ m1[0] = ptm[0] * btm[0] + ptm[1] * btm[2];
+ m1[1] = ptm[0] * btm[1] + ptm[1] * btm[3];
+ m1[2] = ptm[2] * btm[0] + ptm[3] * btm[2];
+ m1[3] = ptm[2] * btm[1] + ptm[3] * btm[3];
+ m1[4] = ptm[4] * btm[0] + ptm[5] * btm[2] + btm[4];
+ m1[5] = ptm[4] * btm[1] + ptm[5] * btm[3] + btm[5];
+ // m = m1 * iCTM = (PTM * BTM) * (iCTM)
+ m[0] = m1[0] * ictm[0] + m1[1] * ictm[2];
+ m[1] = m1[0] * ictm[1] + m1[1] * ictm[3];
+ m[2] = m1[2] * ictm[0] + m1[3] * ictm[2];
+ m[3] = m1[2] * ictm[1] + m1[3] * ictm[3];
+ m[4] = m1[4] * ictm[0] + m1[5] * ictm[2] + ictm[4];
+ m[5] = m1[4] * ictm[1] + m1[5] * ictm[3] + ictm[5];
+
+ // construct a (device space) -> (pattern space) transform matrix
+ det = 1 / (m1[0] * m1[3] - m1[1] * m1[2]);
+ imb[0] = m1[3] * det;
+ imb[1] = -m1[1] * det;
+ imb[2] = -m1[2] * det;
+ imb[3] = m1[0] * det;
+ imb[4] = (m1[2] * m1[5] - m1[3] * m1[4]) * det;
+ imb[5] = (m1[1] * m1[4] - m1[0] * m1[5]) * det;
+
+ // save current graphics state
+ savedPath = state->getPath()->copy();
+ saveState();
+
+ // set underlying color space (for uncolored tiling patterns); set
+ // various other parameters (stroke color, line width) to match
+ // Adobe's behavior
+ if (tPat->getPaintType() == 2 && (cs = patCS->getUnder())) {
+ state->setFillColorSpace(cs->copy());
+ out->updateFillColorSpace(state);
+ state->setStrokeColorSpace(cs->copy());
+ out->updateStrokeColorSpace(state);
+ state->setStrokeColor(state->getFillColor());
+ } else {
+ state->setFillColorSpace(new GfxDeviceGrayColorSpace());
+ out->updateFillColorSpace(state);
+ state->setStrokeColorSpace(new GfxDeviceGrayColorSpace());
+ out->updateStrokeColorSpace(state);
+ }
+ state->setFillPattern(NULL);
+ out->updateFillColor(state);
+ state->setStrokePattern(NULL);
+ out->updateStrokeColor(state);
+ if (!stroke) {
+ state->setLineWidth(0);
+ out->updateLineWidth(state);
+ }
+
+ // clip to current path
+ if (stroke) {
+ state->clipToStrokePath();
+ out->clipToStrokePath(state);
+ } else {
+ state->clip();
+ if (eoFill) {
+ out->eoClip(state);
+ } else {
+ out->clip(state);
+ }
+ }
+ state->clearPath();
+
+ // get the clip region, check for empty
+ state->getClipBBox(&cxMin, &cyMin, &cxMax, &cyMax);
+ if (cxMin > cxMax || cyMin > cyMax) {
+ goto err;
+ }
+
+ // transform clip region bbox to pattern space
+ xMin = xMax = cxMin * imb[0] + cyMin * imb[2] + imb[4];
+ yMin = yMax = cxMin * imb[1] + cyMin * imb[3] + imb[5];
+ x1 = cxMin * imb[0] + cyMax * imb[2] + imb[4];
+ y1 = cxMin * imb[1] + cyMax * imb[3] + imb[5];
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ x1 = cxMax * imb[0] + cyMin * imb[2] + imb[4];
+ y1 = cxMax * imb[1] + cyMin * imb[3] + imb[5];
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ x1 = cxMax * imb[0] + cyMax * imb[2] + imb[4];
+ y1 = cxMax * imb[1] + cyMax * imb[3] + imb[5];
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+
+ // draw the pattern
+ //~ this should treat negative steps differently -- start at right/top
+ //~ edge instead of left/bottom (?)
+ xstep = fabs(tPat->getXStep());
+ ystep = fabs(tPat->getYStep());
+ xi0 = (int)ceil((xMin - tPat->getBBox()[2]) / xstep);
+ xi1 = (int)floor((xMax - tPat->getBBox()[0]) / xstep) + 1;
+ yi0 = (int)ceil((yMin - tPat->getBBox()[3]) / ystep);
+ yi1 = (int)floor((yMax - tPat->getBBox()[1]) / ystep) + 1;
+ for (i = 0; i < 4; ++i) {
+ m1[i] = m[i];
+ }
+ if (out->useTilingPatternFill()) {
+ m1[4] = m[4];
+ m1[5] = m[5];
+ out->tilingPatternFill(state, tPat->getContentStream(),
+ tPat->getPaintType(), tPat->getResDict(),
+ m1, tPat->getBBox(),
+ xi0, yi0, xi1, yi1, xstep, ystep);
+ } else {
+ for (yi = yi0; yi < yi1; ++yi) {
+ for (xi = xi0; xi < xi1; ++xi) {
+ x = xi * xstep;
+ y = yi * ystep;
+ m1[4] = x * m[0] + y * m[2] + m[4];
+ m1[5] = x * m[1] + y * m[3] + m[5];
+ doForm1(tPat->getContentStream(), tPat->getResDict(),
+ m1, tPat->getBBox());
+ }
+ }
+ }
+
+ // restore graphics state
+ err:
+ restoreState();
+ state->setPath(savedPath);
+}
+
+void Gfx::doShadingPatternFill(GfxShadingPattern *sPat,
+ GBool stroke, GBool eoFill) {
+ GfxShading *shading;
+ GfxPath *savedPath;
+ double *ctm, *btm, *ptm;
+ double m[6], ictm[6], m1[6];
+ double xMin, yMin, xMax, yMax;
+ double det;
+
+ shading = sPat->getShading();
+
+ // save current graphics state
+ savedPath = state->getPath()->copy();
+ saveState();
+
+ // clip to bbox
+ if (shading->getHasBBox()) {
+ shading->getBBox(&xMin, &yMin, &xMax, &yMax);
+ state->moveTo(xMin, yMin);
+ state->lineTo(xMax, yMin);
+ state->lineTo(xMax, yMax);
+ state->lineTo(xMin, yMax);
+ state->closePath();
+ state->clip();
+ out->clip(state);
+ state->setPath(savedPath->copy());
+ }
+
+ // clip to current path
+ if (stroke) {
+ state->clipToStrokePath();
+ out->clipToStrokePath(state);
+ } else {
+ state->clip();
+ if (eoFill) {
+ out->eoClip(state);
+ } else {
+ out->clip(state);
+ }
+ }
+
+ // set the color space
+ state->setFillColorSpace(shading->getColorSpace()->copy());
+ out->updateFillColorSpace(state);
+
+ // background color fill
+ if (shading->getHasBackground()) {
+ state->setFillColor(shading->getBackground());
+ out->updateFillColor(state);
+ out->fill(state);
+ }
+ state->clearPath();
+
+ // construct a (pattern space) -> (current space) transform matrix
+ ctm = state->getCTM();
+ btm = baseMatrix;
+ ptm = sPat->getMatrix();
+ // iCTM = invert CTM
+ det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+ ictm[0] = ctm[3] * det;
+ ictm[1] = -ctm[1] * det;
+ ictm[2] = -ctm[2] * det;
+ ictm[3] = ctm[0] * det;
+ ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
+ ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
+ // m1 = PTM * BTM = PTM * base transform matrix
+ m1[0] = ptm[0] * btm[0] + ptm[1] * btm[2];
+ m1[1] = ptm[0] * btm[1] + ptm[1] * btm[3];
+ m1[2] = ptm[2] * btm[0] + ptm[3] * btm[2];
+ m1[3] = ptm[2] * btm[1] + ptm[3] * btm[3];
+ m1[4] = ptm[4] * btm[0] + ptm[5] * btm[2] + btm[4];
+ m1[5] = ptm[4] * btm[1] + ptm[5] * btm[3] + btm[5];
+ // m = m1 * iCTM = (PTM * BTM) * (iCTM)
+ m[0] = m1[0] * ictm[0] + m1[1] * ictm[2];
+ m[1] = m1[0] * ictm[1] + m1[1] * ictm[3];
+ m[2] = m1[2] * ictm[0] + m1[3] * ictm[2];
+ m[3] = m1[2] * ictm[1] + m1[3] * ictm[3];
+ m[4] = m1[4] * ictm[0] + m1[5] * ictm[2] + ictm[4];
+ m[5] = m1[4] * ictm[1] + m1[5] * ictm[3] + ictm[5];
+
+ // set the new matrix
+ state->concatCTM(m[0], m[1], m[2], m[3], m[4], m[5]);
+ out->updateCTM(state, m[0], m[1], m[2], m[3], m[4], m[5]);
+
+#if 1 //~tmp: turn off anti-aliasing temporarily
+ GBool vaa = out->getVectorAntialias();
+ if (vaa) {
+ out->setVectorAntialias(gFalse);
+ }
+#endif
+
+ // do shading type-specific operations
+ switch (shading->getType()) {
+ case 1:
+ doFunctionShFill((GfxFunctionShading *)shading);
+ break;
+ case 2:
+ doAxialShFill((GfxAxialShading *)shading);
+ break;
+ case 3:
+ doRadialShFill((GfxRadialShading *)shading);
+ break;
+ case 4:
+ case 5:
+ doGouraudTriangleShFill((GfxGouraudTriangleShading *)shading);
+ break;
+ case 6:
+ case 7:
+ doPatchMeshShFill((GfxPatchMeshShading *)shading);
+ break;
+ }
+
+#if 1 //~tmp: turn off anti-aliasing temporarily
+ if (vaa) {
+ out->setVectorAntialias(gTrue);
+ }
+#endif
+
+ // restore graphics state
+ restoreState();
+ state->setPath(savedPath);
+}
+
+void Gfx::opShFill(Object args[], int /*numArgs*/) {
+ GfxShading *shading;
+ GfxPath *savedPath;
+ double xMin, yMin, xMax, yMax;
+
+ if (!(shading = res->lookupShading(args[0].getName()))) {
+ return;
+ }
+
+ // save current graphics state
+ savedPath = state->getPath()->copy();
+ saveState();
+
+ // clip to bbox
+ if (shading->getHasBBox()) {
+ shading->getBBox(&xMin, &yMin, &xMax, &yMax);
+ state->moveTo(xMin, yMin);
+ state->lineTo(xMax, yMin);
+ state->lineTo(xMax, yMax);
+ state->lineTo(xMin, yMax);
+ state->closePath();
+ state->clip();
+ out->clip(state);
+ state->clearPath();
+ }
+
+ // set the color space
+ state->setFillColorSpace(shading->getColorSpace()->copy());
+ out->updateFillColorSpace(state);
+
+#if 1 //~tmp: turn off anti-aliasing temporarily
+ GBool vaa = out->getVectorAntialias();
+ if (vaa) {
+ out->setVectorAntialias(gFalse);
+ }
+#endif
+
+ // do shading type-specific operations
+ switch (shading->getType()) {
+ case 1:
+ doFunctionShFill((GfxFunctionShading *)shading);
+ break;
+ case 2:
+ doAxialShFill((GfxAxialShading *)shading);
+ break;
+ case 3:
+ doRadialShFill((GfxRadialShading *)shading);
+ break;
+ case 4:
+ case 5:
+ doGouraudTriangleShFill((GfxGouraudTriangleShading *)shading);
+ break;
+ case 6:
+ case 7:
+ doPatchMeshShFill((GfxPatchMeshShading *)shading);
+ break;
+ }
+
+#if 1 //~tmp: turn off anti-aliasing temporarily
+ if (vaa) {
+ out->setVectorAntialias(gTrue);
+ }
+#endif
+
+ // restore graphics state
+ restoreState();
+ state->setPath(savedPath);
+
+ delete shading;
+}
+
+void Gfx::doFunctionShFill(GfxFunctionShading *shading) {
+ double x0, y0, x1, y1;
+ GfxColor colors[4];
+
+ if (out->useShadedFills() &&
+ out->functionShadedFill(state, shading)) {
+ return;
+ }
+
+ shading->getDomain(&x0, &y0, &x1, &y1);
+ shading->getColor(x0, y0, &colors[0]);
+ shading->getColor(x0, y1, &colors[1]);
+ shading->getColor(x1, y0, &colors[2]);
+ shading->getColor(x1, y1, &colors[3]);
+ doFunctionShFill1(shading, x0, y0, x1, y1, colors, 0);
+}
+
+void Gfx::doFunctionShFill1(GfxFunctionShading *shading,
+ double x0, double y0,
+ double x1, double y1,
+ GfxColor *colors, int depth) {
+ GfxColor fillColor;
+ GfxColor color0M, color1M, colorM0, colorM1, colorMM;
+ GfxColor colors2[4];
+ double *matrix;
+ double xM, yM;
+ int nComps, i, j;
+
+ nComps = shading->getColorSpace()->getNComps();
+ matrix = shading->getMatrix();
+
+ // compare the four corner colors
+ for (i = 0; i < 4; ++i) {
+ for (j = 0; j < nComps; ++j) {
+ if (abs(colors[i].c[j] - colors[(i+1)&3].c[j]) > functionColorDelta) {
+ break;
+ }
+ }
+ if (j < nComps) {
+ break;
+ }
+ }
+
+ // center of the rectangle
+ xM = 0.5 * (x0 + x1);
+ yM = 0.5 * (y0 + y1);
+
+ // the four corner colors are close (or we hit the recursive limit)
+ // -- fill the rectangle; but require at least one subdivision
+ // (depth==0) to avoid problems when the four outer corners of the
+ // shaded region are the same color
+ if ((i == 4 && depth > 0) || depth == functionMaxDepth) {
+
+ // use the center color
+ shading->getColor(xM, yM, &fillColor);
+ state->setFillColor(&fillColor);
+ out->updateFillColor(state);
+
+ // fill the rectangle
+ state->moveTo(x0 * matrix[0] + y0 * matrix[2] + matrix[4],
+ x0 * matrix[1] + y0 * matrix[3] + matrix[5]);
+ state->lineTo(x1 * matrix[0] + y0 * matrix[2] + matrix[4],
+ x1 * matrix[1] + y0 * matrix[3] + matrix[5]);
+ state->lineTo(x1 * matrix[0] + y1 * matrix[2] + matrix[4],
+ x1 * matrix[1] + y1 * matrix[3] + matrix[5]);
+ state->lineTo(x0 * matrix[0] + y1 * matrix[2] + matrix[4],
+ x0 * matrix[1] + y1 * matrix[3] + matrix[5]);
+ state->closePath();
+ out->fill(state);
+ state->clearPath();
+
+ // the four corner colors are not close enough -- subdivide the
+ // rectangle
+ } else {
+
+ // colors[0] colorM0 colors[2]
+ // (x0,y0) (xM,y0) (x1,y0)
+ // +----------+----------+
+ // | | |
+ // | UL | UR |
+ // color0M | colorMM | color1M
+ // (x0,yM) +----------+----------+ (x1,yM)
+ // | (xM,yM) |
+ // | LL | LR |
+ // | | |
+ // +----------+----------+
+ // colors[1] colorM1 colors[3]
+ // (x0,y1) (xM,y1) (x1,y1)
+
+ shading->getColor(x0, yM, &color0M);
+ shading->getColor(x1, yM, &color1M);
+ shading->getColor(xM, y0, &colorM0);
+ shading->getColor(xM, y1, &colorM1);
+ shading->getColor(xM, yM, &colorMM);
+
+ // upper-left sub-rectangle
+ colors2[0] = colors[0];
+ colors2[1] = color0M;
+ colors2[2] = colorM0;
+ colors2[3] = colorMM;
+ doFunctionShFill1(shading, x0, y0, xM, yM, colors2, depth + 1);
+
+ // lower-left sub-rectangle
+ colors2[0] = color0M;
+ colors2[1] = colors[1];
+ colors2[2] = colorMM;
+ colors2[3] = colorM1;
+ doFunctionShFill1(shading, x0, yM, xM, y1, colors2, depth + 1);
+
+ // upper-right sub-rectangle
+ colors2[0] = colorM0;
+ colors2[1] = colorMM;
+ colors2[2] = colors[2];
+ colors2[3] = color1M;
+ doFunctionShFill1(shading, xM, y0, x1, yM, colors2, depth + 1);
+
+ // lower-right sub-rectangle
+ colors2[0] = colorMM;
+ colors2[1] = colorM1;
+ colors2[2] = color1M;
+ colors2[3] = colors[3];
+ doFunctionShFill1(shading, xM, yM, x1, y1, colors2, depth + 1);
+ }
+}
+
+void Gfx::doAxialShFill(GfxAxialShading *shading) {
+ double xMin, yMin, xMax, yMax;
+ double x0, y0, x1, y1;
+ double dx, dy, mul;
+ GBool dxZero, dyZero;
+ double tMin, tMax, t, tx, ty;
+ double s[4], sMin, sMax, tmp;
+ double ux0, uy0, ux1, uy1, vx0, vy0, vx1, vy1;
+ double t0, t1, tt;
+ double ta[axialMaxSplits + 1];
+ int next[axialMaxSplits + 1];
+ GfxColor color0, color1;
+ int nComps;
+ int i, j, k, kk;
+
+ if (out->useShadedFills() &&
+ out->axialShadedFill(state, shading)) {
+ return;
+ }
+
+ // get the clip region bbox
+ state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
+
+ // compute min and max t values, based on the four corners of the
+ // clip region bbox
+ shading->getCoords(&x0, &y0, &x1, &y1);
+ dx = x1 - x0;
+ dy = y1 - y0;
+ dxZero = fabs(dx) < 0.01;
+ dyZero = fabs(dy) < 0.01;
+ if (dxZero && dyZero) {
+ tMin = tMax = 0;
+ } else {
+ mul = 1 / (dx * dx + dy * dy);
+ tMin = tMax = ((xMin - x0) * dx + (yMin - y0) * dy) * mul;
+ t = ((xMin - x0) * dx + (yMax - y0) * dy) * mul;
+ if (t < tMin) {
+ tMin = t;
+ } else if (t > tMax) {
+ tMax = t;
+ }
+ t = ((xMax - x0) * dx + (yMin - y0) * dy) * mul;
+ if (t < tMin) {
+ tMin = t;
+ } else if (t > tMax) {
+ tMax = t;
+ }
+ t = ((xMax - x0) * dx + (yMax - y0) * dy) * mul;
+ if (t < tMin) {
+ tMin = t;
+ } else if (t > tMax) {
+ tMax = t;
+ }
+ if (tMin < 0 && !shading->getExtend0()) {
+ tMin = 0;
+ }
+ if (tMax > 1 && !shading->getExtend1()) {
+ tMax = 1;
+ }
+ }
+
+ // get the function domain
+ t0 = shading->getDomain0();
+ t1 = shading->getDomain1();
+
+ // Traverse the t axis and do the shading.
+ //
+ // For each point (tx, ty) on the t axis, consider a line through
+ // that point perpendicular to the t axis:
+ //
+ // x(s) = tx + s * -dy --> s = (x - tx) / -dy
+ // y(s) = ty + s * dx --> s = (y - ty) / dx
+ //
+ // Then look at the intersection of this line with the bounding box
+ // (xMin, yMin, xMax, yMax). In the general case, there are four
+ // intersection points:
+ //
+ // s0 = (xMin - tx) / -dy
+ // s1 = (xMax - tx) / -dy
+ // s2 = (yMin - ty) / dx
+ // s3 = (yMax - ty) / dx
+ //
+ // and we want the middle two s values.
+ //
+ // In the case where dx = 0, take s0 and s1; in the case where dy =
+ // 0, take s2 and s3.
+ //
+ // Each filled polygon is bounded by two of these line segments
+ // perpdendicular to the t axis.
+ //
+ // The t axis is bisected into smaller regions until the color
+ // difference across a region is small enough, and then the region
+ // is painted with a single color.
+
+ // set up: require at least one split to avoid problems when the two
+ // ends of the t axis have the same color
+ nComps = shading->getColorSpace()->getNComps();
+ ta[0] = tMin;
+ next[0] = axialMaxSplits / 2;
+ ta[axialMaxSplits / 2] = 0.5 * (tMin + tMax);
+ next[axialMaxSplits / 2] = axialMaxSplits;
+ ta[axialMaxSplits] = tMax;
+
+ // compute the color at t = tMin
+ if (tMin < 0) {
+ tt = t0;
+ } else if (tMin > 1) {
+ tt = t1;
+ } else {
+ tt = t0 + (t1 - t0) * tMin;
+ }
+ shading->getColor(tt, &color0);
+
+ // compute the coordinates of the point on the t axis at t = tMin;
+ // then compute the intersection of the perpendicular line with the
+ // bounding box
+ tx = x0 + tMin * dx;
+ ty = y0 + tMin * dy;
+ if (dxZero && dyZero) {
+ sMin = sMax = 0;
+ } else if (dxZero) {
+ sMin = (xMin - tx) / -dy;
+ sMax = (xMax - tx) / -dy;
+ if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
+ } else if (dyZero) {
+ sMin = (yMin - ty) / dx;
+ sMax = (yMax - ty) / dx;
+ if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
+ } else {
+ s[0] = (yMin - ty) / dx;
+ s[1] = (yMax - ty) / dx;
+ s[2] = (xMin - tx) / -dy;
+ s[3] = (xMax - tx) / -dy;
+ for (j = 0; j < 3; ++j) {
+ kk = j;
+ for (k = j + 1; k < 4; ++k) {
+ if (s[k] < s[kk]) {
+ kk = k;
+ }
+ }
+ tmp = s[j]; s[j] = s[kk]; s[kk] = tmp;
+ }
+ sMin = s[1];
+ sMax = s[2];
+ }
+ ux0 = tx - sMin * dy;
+ uy0 = ty + sMin * dx;
+ vx0 = tx - sMax * dy;
+ vy0 = ty + sMax * dx;
+
+ i = 0;
+ while (i < axialMaxSplits) {
+
+ // bisect until color difference is small enough or we hit the
+ // bisection limit
+ j = next[i];
+ while (j > i + 1) {
+ if (ta[j] < 0) {
+ tt = t0;
+ } else if (ta[j] > 1) {
+ tt = t1;
+ } else {
+ tt = t0 + (t1 - t0) * ta[j];
+ }
+ shading->getColor(tt, &color1);
+ for (k = 0; k < nComps; ++k) {
+ if (abs(color1.c[k] - color0.c[k]) > axialColorDelta) {
+ break;
+ }
+ }
+ if (k == nComps) {
+ break;
+ }
+ k = (i + j) / 2;
+ ta[k] = 0.5 * (ta[i] + ta[j]);
+ next[i] = k;
+ next[k] = j;
+ j = k;
+ }
+
+ // use the average of the colors of the two sides of the region
+ for (k = 0; k < nComps; ++k) {
+ color0.c[k] = (color0.c[k] + color1.c[k]) / 2;
+ }
+
+ // compute the coordinates of the point on the t axis; then
+ // compute the intersection of the perpendicular line with the
+ // bounding box
+ tx = x0 + ta[j] * dx;
+ ty = y0 + ta[j] * dy;
+ if (dxZero && dyZero) {
+ sMin = sMax = 0;
+ } else if (dxZero) {
+ sMin = (xMin - tx) / -dy;
+ sMax = (xMax - tx) / -dy;
+ if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
+ } else if (dyZero) {
+ sMin = (yMin - ty) / dx;
+ sMax = (yMax - ty) / dx;
+ if (sMin > sMax) { tmp = sMin; sMin = sMax; sMax = tmp; }
+ } else {
+ s[0] = (yMin - ty) / dx;
+ s[1] = (yMax - ty) / dx;
+ s[2] = (xMin - tx) / -dy;
+ s[3] = (xMax - tx) / -dy;
+ for (j = 0; j < 3; ++j) {
+ kk = j;
+ for (k = j + 1; k < 4; ++k) {
+ if (s[k] < s[kk]) {
+ kk = k;
+ }
+ }
+ tmp = s[j]; s[j] = s[kk]; s[kk] = tmp;
+ }
+ sMin = s[1];
+ sMax = s[2];
+ }
+ ux1 = tx - sMin * dy;
+ uy1 = ty + sMin * dx;
+ vx1 = tx - sMax * dy;
+ vy1 = ty + sMax * dx;
+
+ // set the color
+ state->setFillColor(&color0);
+ out->updateFillColor(state);
+
+ // fill the region
+ state->moveTo(ux0, uy0);
+ state->lineTo(vx0, vy0);
+ state->lineTo(vx1, vy1);
+ state->lineTo(ux1, uy1);
+ state->closePath();
+ out->fill(state);
+ state->clearPath();
+
+ // set up for next region
+ ux0 = ux1;
+ uy0 = uy1;
+ vx0 = vx1;
+ vy0 = vy1;
+ color0 = color1;
+ i = next[i];
+ }
+}
+
+void Gfx::doRadialShFill(GfxRadialShading *shading) {
+ double xMin, yMin, xMax, yMax;
+ double x0, y0, r0, x1, y1, r1, t0, t1;
+ int nComps;
+ GfxColor colorA, colorB;
+ double xa, ya, xb, yb, ra, rb;
+ double ta, tb, sa, sb;
+ double sz, xz, yz, sMin, sMax;
+ GBool enclosed;
+ int ia, ib, k, n;
+ double *ctm;
+ double theta, alpha, angle, t;
+
+ if (out->useShadedFills() &&
+ out->radialShadedFill(state, shading)) {
+ return;
+ }
+
+ // get the shading info
+ shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
+ t0 = shading->getDomain0();
+ t1 = shading->getDomain1();
+ nComps = shading->getColorSpace()->getNComps();
+
+ // Compute the point at which r(s) = 0; check for the enclosed
+ // circles case; and compute the angles for the tangent lines.
+ if (x0 == x1 && y0 == y1) {
+ enclosed = gTrue;
+ theta = 0; // make gcc happy
+ sz = 0; // make gcc happy
+ } else if (r0 == r1) {
+ enclosed = gFalse;
+ theta = 0;
+ sz = 0; // make gcc happy
+ } else {
+ sz = -r0 / (r1 - r0);
+ xz = x0 + sz * (x1 - x0);
+ yz = y0 + sz * (y1 - y0);
+ enclosed = (xz - x0) * (xz - x0) + (yz - y0) * (yz - y0) <= r0 * r0;
+ theta = asin(r0 / sqrt((x0 - xz) * (x0 - xz) + (y0 - yz) * (y0 - yz)));
+ if (r0 > r1) {
+ theta = -theta;
+ }
+ }
+ if (enclosed) {
+ alpha = 0;
+ } else {
+ alpha = atan2(y1 - y0, x1 - x0);
+ }
+
+ // compute the (possibly extended) s range
+ state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
+ if (enclosed) {
+ sMin = 0;
+ sMax = 1;
+ } else {
+ sMin = 1;
+ sMax = 0;
+ // solve for x(s) + r(s) = xMin
+ if ((x1 + r1) - (x0 + r0) != 0) {
+ sa = (xMin - (x0 + r0)) / ((x1 + r1) - (x0 + r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // solve for x(s) - r(s) = xMax
+ if ((x1 - r1) - (x0 - r0) != 0) {
+ sa = (xMax - (x0 - r0)) / ((x1 - r1) - (x0 - r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // solve for y(s) + r(s) = yMin
+ if ((y1 + r1) - (y0 + r0) != 0) {
+ sa = (yMin - (y0 + r0)) / ((y1 + r1) - (y0 + r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // solve for y(s) - r(s) = yMax
+ if ((y1 - r1) - (y0 - r0) != 0) {
+ sa = (yMax - (y0 - r0)) / ((y1 - r1) - (y0 - r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // check against sz
+ if (r0 < r1) {
+ if (sMin < sz) {
+ sMin = sz;
+ }
+ } else if (r0 > r1) {
+ if (sMax > sz) {
+ sMax = sz;
+ }
+ }
+ // check the 'extend' flags
+ if (!shading->getExtend0() && sMin < 0) {
+ sMin = 0;
+ }
+ if (!shading->getExtend1() && sMax > 1) {
+ sMax = 1;
+ }
+ }
+
+ // compute the number of steps into which circles must be divided to
+ // achieve a curve flatness of 0.1 pixel in device space for the
+ // largest circle (note that "device space" is 72 dpi when generating
+ // PostScript, hence the relatively small 0.1 pixel accuracy)
+ ctm = state->getCTM();
+ t = fabs(ctm[0]);
+ if (fabs(ctm[1]) > t) {
+ t = fabs(ctm[1]);
+ }
+ if (fabs(ctm[2]) > t) {
+ t = fabs(ctm[2]);
+ }
+ if (fabs(ctm[3]) > t) {
+ t = fabs(ctm[3]);
+ }
+ if (r0 > r1) {
+ t *= r0;
+ } else {
+ t *= r1;
+ }
+ if (t < 1) {
+ n = 3;
+ } else {
+ n = (int)(M_PI / acos(1 - 0.1 / t));
+ if (n < 3) {
+ n = 3;
+ } else if (n > 200) {
+ n = 200;
+ }
+ }
+
+ // setup for the start circle
+ ia = 0;
+ sa = sMin;
+ ta = t0 + sa * (t1 - t0);
+ xa = x0 + sa * (x1 - x0);
+ ya = y0 + sa * (y1 - y0);
+ ra = r0 + sa * (r1 - r0);
+ if (ta < t0) {
+ shading->getColor(t0, &colorA);
+ } else if (ta > t1) {
+ shading->getColor(t1, &colorA);
+ } else {
+ shading->getColor(ta, &colorA);
+ }
+
+ // fill the circles
+ while (ia < radialMaxSplits) {
+
+ // go as far along the t axis (toward t1) as we can, such that the
+ // color difference is within the tolerance (radialColorDelta) --
+ // this uses bisection (between the current value, t, and t1),
+ // limited to radialMaxSplits points along the t axis; require at
+ // least one split to avoid problems when the innermost and
+ // outermost colors are the same
+ ib = radialMaxSplits;
+ sb = sMax;
+ tb = t0 + sb * (t1 - t0);
+ if (tb < t0) {
+ shading->getColor(t0, &colorB);
+ } else if (tb > t1) {
+ shading->getColor(t1, &colorB);
+ } else {
+ shading->getColor(tb, &colorB);
+ }
+ while (ib - ia > 1) {
+ for (k = 0; k < nComps; ++k) {
+ if (abs(colorB.c[k] - colorA.c[k]) > radialColorDelta) {
+ break;
+ }
+ }
+ if (k == nComps && ib < radialMaxSplits) {
+ break;
+ }
+ ib = (ia + ib) / 2;
+ sb = sMin + ((double)ib / (double)radialMaxSplits) * (sMax - sMin);
+ tb = t0 + sb * (t1 - t0);
+ if (tb < t0) {
+ shading->getColor(t0, &colorB);
+ } else if (tb > t1) {
+ shading->getColor(t1, &colorB);
+ } else {
+ shading->getColor(tb, &colorB);
+ }
+ }
+
+ // compute center and radius of the circle
+ xb = x0 + sb * (x1 - x0);
+ yb = y0 + sb * (y1 - y0);
+ rb = r0 + sb * (r1 - r0);
+
+ // use the average of the colors at the two circles
+ for (k = 0; k < nComps; ++k) {
+ colorA.c[k] = (colorA.c[k] + colorB.c[k]) / 2;
+ }
+ state->setFillColor(&colorA);
+ out->updateFillColor(state);
+
+ if (enclosed) {
+
+ // construct path for first circle (counterclockwise)
+ state->moveTo(xa + ra, ya);
+ for (k = 1; k < n; ++k) {
+ angle = ((double)k / (double)n) * 2 * M_PI;
+ state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
+ }
+ state->closePath();
+
+ // construct and append path for second circle (clockwise)
+ state->moveTo(xb + rb, yb);
+ for (k = 1; k < n; ++k) {
+ angle = -((double)k / (double)n) * 2 * M_PI;
+ state->lineTo(xb + rb * cos(angle), yb + rb * sin(angle));
+ }
+ state->closePath();
+
+ } else {
+
+ // construct the first subpath (clockwise)
+ state->moveTo(xa + ra * cos(alpha + theta + 0.5 * M_PI),
+ ya + ra * sin(alpha + theta + 0.5 * M_PI));
+ for (k = 0; k < n; ++k) {
+ angle = alpha + theta + 0.5 * M_PI
+ - ((double)k / (double)n) * (2 * theta + M_PI);
+ state->lineTo(xb + rb * cos(angle), yb + rb * sin(angle));
+ }
+ for (k = 0; k < n; ++k) {
+ angle = alpha - theta - 0.5 * M_PI
+ + ((double)k / (double)n) * (2 * theta - M_PI);
+ state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
+ }
+ state->closePath();
+
+ // construct the second subpath (counterclockwise)
+ state->moveTo(xa + ra * cos(alpha + theta + 0.5 * M_PI),
+ ya + ra * sin(alpha + theta + 0.5 * M_PI));
+ for (k = 0; k < n; ++k) {
+ angle = alpha + theta + 0.5 * M_PI
+ + ((double)k / (double)n) * (-2 * theta + M_PI);
+ state->lineTo(xb + rb * cos(angle), yb + rb * sin(angle));
+ }
+ for (k = 0; k < n; ++k) {
+ angle = alpha - theta - 0.5 * M_PI
+ + ((double)k / (double)n) * (2 * theta + M_PI);
+ state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
+ }
+ state->closePath();
+ }
+
+ // fill the path
+ out->fill(state);
+ state->clearPath();
+
+ // step to the next value of t
+ ia = ib;
+ sa = sb;
+ ta = tb;
+ xa = xb;
+ ya = yb;
+ ra = rb;
+ colorA = colorB;
+ }
+
+ if (enclosed) {
+ // extend the smaller circle
+ if ((shading->getExtend0() && r0 <= r1) ||
+ (shading->getExtend1() && r1 < r0)) {
+ if (r0 <= r1) {
+ ta = t0;
+ ra = r0;
+ xa = x0;
+ ya = y0;
+ } else {
+ ta = t1;
+ ra = r1;
+ xa = x1;
+ ya = y1;
+ }
+ shading->getColor(ta, &colorA);
+ state->setFillColor(&colorA);
+ out->updateFillColor(state);
+ state->moveTo(xa + ra, ya);
+ for (k = 1; k < n; ++k) {
+ angle = ((double)k / (double)n) * 2 * M_PI;
+ state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
+ }
+ state->closePath();
+ out->fill(state);
+ state->clearPath();
+ }
+
+ // extend the larger circle
+ if ((shading->getExtend0() && r0 > r1) ||
+ (shading->getExtend1() && r1 >= r0)) {
+ if (r0 > r1) {
+ ta = t0;
+ ra = r0;
+ xa = x0;
+ ya = y0;
+ } else {
+ ta = t1;
+ ra = r1;
+ xa = x1;
+ ya = y1;
+ }
+ shading->getColor(ta, &colorA);
+ state->setFillColor(&colorA);
+ out->updateFillColor(state);
+ state->moveTo(xMin, yMin);
+ state->lineTo(xMin, yMax);
+ state->lineTo(xMax, yMax);
+ state->lineTo(xMax, yMin);
+ state->closePath();
+ state->moveTo(xa + ra, ya);
+ for (k = 1; k < n; ++k) {
+ angle = ((double)k / (double)n) * 2 * M_PI;
+ state->lineTo(xa + ra * cos(angle), ya + ra * sin(angle));
+ }
+ state->closePath();
+ out->fill(state);
+ state->clearPath();
+ }
+ }
+}
+
+void Gfx::doGouraudTriangleShFill(GfxGouraudTriangleShading *shading) {
+ double x0, y0, x1, y1, x2, y2;
+ GfxColor color0, color1, color2;
+ int i;
+
+ for (i = 0; i < shading->getNTriangles(); ++i) {
+ shading->getTriangle(i, &x0, &y0, &color0,
+ &x1, &y1, &color1,
+ &x2, &y2, &color2);
+ gouraudFillTriangle(x0, y0, &color0, x1, y1, &color1, x2, y2, &color2,
+ shading->getColorSpace()->getNComps(), 0);
+ }
+}
+
+void Gfx::gouraudFillTriangle(double x0, double y0, GfxColor *color0,
+ double x1, double y1, GfxColor *color1,
+ double x2, double y2, GfxColor *color2,
+ int nComps, int depth) {
+ double x01, y01, x12, y12, x20, y20;
+ GfxColor color01, color12, color20;
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ if (abs(color0->c[i] - color1->c[i]) > gouraudColorDelta ||
+ abs(color1->c[i] - color2->c[i]) > gouraudColorDelta) {
+ break;
+ }
+ }
+ if (i == nComps || depth == gouraudMaxDepth) {
+ state->setFillColor(color0);
+ out->updateFillColor(state);
+ state->moveTo(x0, y0);
+ state->lineTo(x1, y1);
+ state->lineTo(x2, y2);
+ state->closePath();
+ out->fill(state);
+ state->clearPath();
+ } else {
+ x01 = 0.5 * (x0 + x1);
+ y01 = 0.5 * (y0 + y1);
+ x12 = 0.5 * (x1 + x2);
+ y12 = 0.5 * (y1 + y2);
+ x20 = 0.5 * (x2 + x0);
+ y20 = 0.5 * (y2 + y0);
+ //~ if the shading has a Function, this should interpolate on the
+ //~ function parameter, not on the color components
+ for (i = 0; i < nComps; ++i) {
+ color01.c[i] = (color0->c[i] + color1->c[i]) / 2;
+ color12.c[i] = (color1->c[i] + color2->c[i]) / 2;
+ color20.c[i] = (color2->c[i] + color0->c[i]) / 2;
+ }
+ gouraudFillTriangle(x0, y0, color0, x01, y01, &color01,
+ x20, y20, &color20, nComps, depth + 1);
+ gouraudFillTriangle(x01, y01, &color01, x1, y1, color1,
+ x12, y12, &color12, nComps, depth + 1);
+ gouraudFillTriangle(x01, y01, &color01, x12, y12, &color12,
+ x20, y20, &color20, nComps, depth + 1);
+ gouraudFillTriangle(x20, y20, &color20, x12, y12, &color12,
+ x2, y2, color2, nComps, depth + 1);
+ }
+}
+
+void Gfx::doPatchMeshShFill(GfxPatchMeshShading *shading) {
+ int start, i;
+
+ if (shading->getNPatches() > 128) {
+ start = 3;
+ } else if (shading->getNPatches() > 64) {
+ start = 2;
+ } else if (shading->getNPatches() > 16) {
+ start = 1;
+ } else {
+ start = 0;
+ }
+ for (i = 0; i < shading->getNPatches(); ++i) {
+ fillPatch(shading->getPatch(i), shading->getColorSpace()->getNComps(),
+ start);
+ }
+}
+
+void Gfx::fillPatch(GfxPatch *patch, int nComps, int depth) {
+ GfxPatch patch00, patch01, patch10, patch11;
+ double xx[4][8], yy[4][8];
+ double xxm, yym;
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ if (abs(patch->color[0][0].c[i] - patch->color[0][1].c[i])
+ > patchColorDelta ||
+ abs(patch->color[0][1].c[i] - patch->color[1][1].c[i])
+ > patchColorDelta ||
+ abs(patch->color[1][1].c[i] - patch->color[1][0].c[i])
+ > patchColorDelta ||
+ abs(patch->color[1][0].c[i] - patch->color[0][0].c[i])
+ > patchColorDelta) {
+ break;
+ }
+ }
+ if (i == nComps || depth == patchMaxDepth) {
+ state->setFillColor(&patch->color[0][0]);
+ out->updateFillColor(state);
+ state->moveTo(patch->x[0][0], patch->y[0][0]);
+ state->curveTo(patch->x[0][1], patch->y[0][1],
+ patch->x[0][2], patch->y[0][2],
+ patch->x[0][3], patch->y[0][3]);
+ state->curveTo(patch->x[1][3], patch->y[1][3],
+ patch->x[2][3], patch->y[2][3],
+ patch->x[3][3], patch->y[3][3]);
+ state->curveTo(patch->x[3][2], patch->y[3][2],
+ patch->x[3][1], patch->y[3][1],
+ patch->x[3][0], patch->y[3][0]);
+ state->curveTo(patch->x[2][0], patch->y[2][0],
+ patch->x[1][0], patch->y[1][0],
+ patch->x[0][0], patch->y[0][0]);
+ state->closePath();
+ out->fill(state);
+ state->clearPath();
+ } else {
+ for (i = 0; i < 4; ++i) {
+ xx[i][0] = patch->x[i][0];
+ yy[i][0] = patch->y[i][0];
+ xx[i][1] = 0.5 * (patch->x[i][0] + patch->x[i][1]);
+ yy[i][1] = 0.5 * (patch->y[i][0] + patch->y[i][1]);
+ xxm = 0.5 * (patch->x[i][1] + patch->x[i][2]);
+ yym = 0.5 * (patch->y[i][1] + patch->y[i][2]);
+ xx[i][6] = 0.5 * (patch->x[i][2] + patch->x[i][3]);
+ yy[i][6] = 0.5 * (patch->y[i][2] + patch->y[i][3]);
+ xx[i][2] = 0.5 * (xx[i][1] + xxm);
+ yy[i][2] = 0.5 * (yy[i][1] + yym);
+ xx[i][5] = 0.5 * (xxm + xx[i][6]);
+ yy[i][5] = 0.5 * (yym + yy[i][6]);
+ xx[i][3] = xx[i][4] = 0.5 * (xx[i][2] + xx[i][5]);
+ yy[i][3] = yy[i][4] = 0.5 * (yy[i][2] + yy[i][5]);
+ xx[i][7] = patch->x[i][3];
+ yy[i][7] = patch->y[i][3];
+ }
+ for (i = 0; i < 4; ++i) {
+ patch00.x[0][i] = xx[0][i];
+ patch00.y[0][i] = yy[0][i];
+ patch00.x[1][i] = 0.5 * (xx[0][i] + xx[1][i]);
+ patch00.y[1][i] = 0.5 * (yy[0][i] + yy[1][i]);
+ xxm = 0.5 * (xx[1][i] + xx[2][i]);
+ yym = 0.5 * (yy[1][i] + yy[2][i]);
+ patch10.x[2][i] = 0.5 * (xx[2][i] + xx[3][i]);
+ patch10.y[2][i] = 0.5 * (yy[2][i] + yy[3][i]);
+ patch00.x[2][i] = 0.5 * (patch00.x[1][i] + xxm);
+ patch00.y[2][i] = 0.5 * (patch00.y[1][i] + yym);
+ patch10.x[1][i] = 0.5 * (xxm + patch10.x[2][i]);
+ patch10.y[1][i] = 0.5 * (yym + patch10.y[2][i]);
+ patch00.x[3][i] = 0.5 * (patch00.x[2][i] + patch10.x[1][i]);
+ patch00.y[3][i] = 0.5 * (patch00.y[2][i] + patch10.y[1][i]);
+ patch10.x[0][i] = patch00.x[3][i];
+ patch10.y[0][i] = patch00.y[3][i];
+ patch10.x[3][i] = xx[3][i];
+ patch10.y[3][i] = yy[3][i];
+ }
+ for (i = 4; i < 8; ++i) {
+ patch01.x[0][i-4] = xx[0][i];
+ patch01.y[0][i-4] = yy[0][i];
+ patch01.x[1][i-4] = 0.5 * (xx[0][i] + xx[1][i]);
+ patch01.y[1][i-4] = 0.5 * (yy[0][i] + yy[1][i]);
+ xxm = 0.5 * (xx[1][i] + xx[2][i]);
+ yym = 0.5 * (yy[1][i] + yy[2][i]);
+ patch11.x[2][i-4] = 0.5 * (xx[2][i] + xx[3][i]);
+ patch11.y[2][i-4] = 0.5 * (yy[2][i] + yy[3][i]);
+ patch01.x[2][i-4] = 0.5 * (patch01.x[1][i-4] + xxm);
+ patch01.y[2][i-4] = 0.5 * (patch01.y[1][i-4] + yym);
+ patch11.x[1][i-4] = 0.5 * (xxm + patch11.x[2][i-4]);
+ patch11.y[1][i-4] = 0.5 * (yym + patch11.y[2][i-4]);
+ patch01.x[3][i-4] = 0.5 * (patch01.x[2][i-4] + patch11.x[1][i-4]);
+ patch01.y[3][i-4] = 0.5 * (patch01.y[2][i-4] + patch11.y[1][i-4]);
+ patch11.x[0][i-4] = patch01.x[3][i-4];
+ patch11.y[0][i-4] = patch01.y[3][i-4];
+ patch11.x[3][i-4] = xx[3][i];
+ patch11.y[3][i-4] = yy[3][i];
+ }
+ //~ if the shading has a Function, this should interpolate on the
+ //~ function parameter, not on the color components
+ for (i = 0; i < nComps; ++i) {
+ patch00.color[0][0].c[i] = patch->color[0][0].c[i];
+ patch00.color[0][1].c[i] = (patch->color[0][0].c[i] +
+ patch->color[0][1].c[i]) / 2;
+ patch01.color[0][0].c[i] = patch00.color[0][1].c[i];
+ patch01.color[0][1].c[i] = patch->color[0][1].c[i];
+ patch01.color[1][1].c[i] = (patch->color[0][1].c[i] +
+ patch->color[1][1].c[i]) / 2;
+ patch11.color[0][1].c[i] = patch01.color[1][1].c[i];
+ patch11.color[1][1].c[i] = patch->color[1][1].c[i];
+ patch11.color[1][0].c[i] = (patch->color[1][1].c[i] +
+ patch->color[1][0].c[i]) / 2;
+ patch10.color[1][1].c[i] = patch11.color[1][0].c[i];
+ patch10.color[1][0].c[i] = patch->color[1][0].c[i];
+ patch10.color[0][0].c[i] = (patch->color[1][0].c[i] +
+ patch->color[0][0].c[i]) / 2;
+ patch00.color[1][0].c[i] = patch10.color[0][0].c[i];
+ patch00.color[1][1].c[i] = (patch00.color[1][0].c[i] +
+ patch01.color[1][1].c[i]) / 2;
+ patch01.color[1][0].c[i] = patch00.color[1][1].c[i];
+ patch11.color[0][0].c[i] = patch00.color[1][1].c[i];
+ patch10.color[0][1].c[i] = patch00.color[1][1].c[i];
+ }
+ fillPatch(&patch00, nComps, depth + 1);
+ fillPatch(&patch10, nComps, depth + 1);
+ fillPatch(&patch01, nComps, depth + 1);
+ fillPatch(&patch11, nComps, depth + 1);
+ }
+}
+
+void Gfx::doEndPath() {
+ if (state->isCurPt() && clip != clipNone) {
+ state->clip();
+ if (clip == clipNormal) {
+ out->clip(state);
+ } else {
+ out->eoClip(state);
+ }
+ }
+ clip = clipNone;
+ state->clearPath();
+}
+
+//------------------------------------------------------------------------
+// path clipping operators
+//------------------------------------------------------------------------
+
+void Gfx::opClip(Object * /*args[]*/, int /*numArgs*/) {
+ clip = clipNormal;
+}
+
+void Gfx::opEOClip(Object * /*args[]*/, int /*numArgs*/) {
+ clip = clipEO;
+}
+
+//------------------------------------------------------------------------
+// text object operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginText(Object * /*args[]*/, int /*numArgs*/) {
+ state->setTextMat(1, 0, 0, 1, 0, 0);
+ state->textMoveTo(0, 0);
+ out->updateTextMat(state);
+ out->updateTextPos(state);
+ fontChanged = gTrue;
+}
+
+void Gfx::opEndText(Object * /*args[]*/, int /*numArgs*/) {
+ out->endTextObject(state);
+}
+
+//------------------------------------------------------------------------
+// text state operators
+//------------------------------------------------------------------------
+
+void Gfx::opSetCharSpacing(Object args[], int /*numArgs*/) {
+ state->setCharSpace(args[0].getNum());
+ out->updateCharSpace(state);
+}
+
+void Gfx::opSetFont(Object args[], int /*numArgs*/) {
+ GfxFont *font;
+
+ if (!(font = res->lookupFont(args[0].getName()))) {
+ return;
+ }
+ if (printCommands) {
+ printf(" font: tag=%s name='%s' %g\n",
+ font->getTag()->getCString(),
+ font->getName() ? font->getName()->getCString() : "???",
+ args[1].getNum());
+ fflush(stdout);
+ }
+ state->setFont(font, args[1].getNum());
+ fontChanged = gTrue;
+}
+
+void Gfx::opSetTextLeading(Object args[], int /*numArgs*/) {
+ state->setLeading(args[0].getNum());
+}
+
+void Gfx::opSetTextRender(Object args[], int /*numArgs*/) {
+ state->setRender(args[0].getInt());
+ out->updateRender(state);
+}
+
+void Gfx::opSetTextRise(Object args[], int /*numArgs*/) {
+ state->setRise(args[0].getNum());
+ out->updateRise(state);
+}
+
+void Gfx::opSetWordSpacing(Object args[], int /*numArgs*/) {
+ state->setWordSpace(args[0].getNum());
+ out->updateWordSpace(state);
+}
+
+void Gfx::opSetHorizScaling(Object args[], int /*numArgs*/) {
+ state->setHorizScaling(args[0].getNum());
+ out->updateHorizScaling(state);
+ fontChanged = gTrue;
+}
+
+//------------------------------------------------------------------------
+// text positioning operators
+//------------------------------------------------------------------------
+
+void Gfx::opTextMove(Object args[], int /*numArgs*/) {
+ double tx, ty;
+
+ tx = state->getLineX() + args[0].getNum();
+ ty = state->getLineY() + args[1].getNum();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+}
+
+void Gfx::opTextMoveSet(Object args[], int /*numArgs*/) {
+ double tx, ty;
+
+ tx = state->getLineX() + args[0].getNum();
+ ty = args[1].getNum();
+ state->setLeading(-ty);
+ ty += state->getLineY();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+}
+
+void Gfx::opSetTextMatrix(Object args[], int /*numArgs*/) {
+ state->setTextMat(args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+ state->textMoveTo(0, 0);
+ out->updateTextMat(state);
+ out->updateTextPos(state);
+ fontChanged = gTrue;
+}
+
+void Gfx::opTextNextLine(Object * /*args[]*/, int /*numArgs*/) {
+ double tx, ty;
+
+ tx = state->getLineX();
+ ty = state->getLineY() - state->getLeading();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+}
+
+//------------------------------------------------------------------------
+// text string operators
+//------------------------------------------------------------------------
+
+void Gfx::opShowText(Object args[], int /*numArgs*/) {
+ if (!state->getFont()) {
+ error(getPos(), "No font in show");
+ return;
+ }
+ if (fontChanged) {
+ out->updateFont(state);
+ fontChanged = gFalse;
+ }
+ out->beginStringOp(state);
+ doShowText(args[0].getString());
+ out->endStringOp(state);
+}
+
+void Gfx::opMoveShowText(Object args[], int /*numArgs*/) {
+ double tx, ty;
+
+ if (!state->getFont()) {
+ error(getPos(), "No font in move/show");
+ return;
+ }
+ if (fontChanged) {
+ out->updateFont(state);
+ fontChanged = gFalse;
+ }
+ tx = state->getLineX();
+ ty = state->getLineY() - state->getLeading();
+ state->textMoveTo(tx, ty);
+ out->updateTextPos(state);
+ out->beginStringOp(state);
+ doShowText(args[0].getString());
+ out->endStringOp(state);
+}
+
+void Gfx::opMoveSetShowText(Object args[], int /*numArgs*/) {
+ double tx, ty;
+
+ if (!state->getFont()) {
+ error(getPos(), "No font in move/set/show");
+ return;
+ }
+ if (fontChanged) {
+ out->updateFont(state);
+ fontChanged = gFalse;
+ }
+ state->setWordSpace(args[0].getNum());
+ state->setCharSpace(args[1].getNum());
+ tx = state->getLineX();
+ ty = state->getLineY() - state->getLeading();
+ state->textMoveTo(tx, ty);
+ out->updateWordSpace(state);
+ out->updateCharSpace(state);
+ out->updateTextPos(state);
+ out->beginStringOp(state);
+ doShowText(args[2].getString());
+ out->endStringOp(state);
+}
+
+void Gfx::opShowSpaceText(Object args[], int /*numArgs*/) {
+ Array *a;
+ Object obj;
+ int wMode;
+ int i;
+
+ if (!state->getFont()) {
+ error(getPos(), "No font in show/space");
+ return;
+ }
+ if (fontChanged) {
+ out->updateFont(state);
+ fontChanged = gFalse;
+ }
+ out->beginStringOp(state);
+ wMode = state->getFont()->getWMode();
+ a = args[0].getArray();
+ for (i = 0; i < a->getLength(); ++i) {
+ a->get(i, &obj);
+ if (obj.isNum()) {
+ // this uses the absolute value of the font size to match
+ // Acrobat's behavior
+ if (wMode) {
+ state->textShift(0, -obj.getNum() * 0.001 *
+ fabs(state->getFontSize()));
+ } else {
+ state->textShift(-obj.getNum() * 0.001 *
+ fabs(state->getFontSize()), 0);
+ }
+ out->updateTextShift(state, obj.getNum());
+ } else if (obj.isString()) {
+ doShowText(obj.getString());
+ } else {
+ error(getPos(), "Element of show/space array must be number or string");
+ }
+ obj.free();
+ }
+ out->endStringOp(state);
+}
+
+void Gfx::doShowText(GString *s) {
+ GfxFont *font;
+ int wMode;
+ double riseX, riseY;
+ CharCode code;
+ Unicode u[8];
+ double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, lineX, lineY;
+ double originX, originY, tOriginX, tOriginY;
+ double oldCTM[6], newCTM[6];
+ double *mat;
+ Object charProc;
+ Dict *resDict;
+ Parser *oldParser;
+ char *p;
+ int len, n, uLen, nChars, nSpaces, i;
+
+ font = state->getFont();
+ wMode = font->getWMode();
+
+ if (out->useDrawChar()) {
+ out->beginString(state, s);
+ }
+
+ // handle a Type 3 char
+ if (font->getType() == fontType3 && out->interpretType3Chars()) {
+ mat = state->getCTM();
+ for (i = 0; i < 6; ++i) {
+ oldCTM[i] = mat[i];
+ }
+ mat = state->getTextMat();
+ newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2];
+ newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3];
+ newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2];
+ newCTM[3] = mat[2] * oldCTM[1] + mat[3] * oldCTM[3];
+ mat = font->getFontMatrix();
+ newCTM[0] = mat[0] * newCTM[0] + mat[1] * newCTM[2];
+ newCTM[1] = mat[0] * newCTM[1] + mat[1] * newCTM[3];
+ newCTM[2] = mat[2] * newCTM[0] + mat[3] * newCTM[2];
+ newCTM[3] = mat[2] * newCTM[1] + mat[3] * newCTM[3];
+ newCTM[0] *= state->getFontSize();
+ newCTM[1] *= state->getFontSize();
+ newCTM[2] *= state->getFontSize();
+ newCTM[3] *= state->getFontSize();
+ newCTM[0] *= state->getHorizScaling();
+ newCTM[2] *= state->getHorizScaling();
+ state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
+ curX = state->getCurX();
+ curY = state->getCurY();
+ lineX = state->getLineX();
+ lineY = state->getLineY();
+ oldParser = parser;
+ p = s->getCString();
+ len = s->getLength();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+ u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
+ &dx, &dy, &originX, &originY);
+ dx = dx * state->getFontSize() + state->getCharSpace();
+ if (n == 1 && *p == ' ') {
+ dx += state->getWordSpace();
+ }
+ dx *= state->getHorizScaling();
+ dy *= state->getFontSize();
+ state->textTransformDelta(dx, dy, &tdx, &tdy);
+ state->transform(curX + riseX, curY + riseY, &x, &y);
+ saveState();
+ state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y);
+ //~ the CTM concat values here are wrong (but never used)
+ out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+ if (!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ code, u, uLen)) {
+ ((Gfx8BitFont *)font)->getCharProc(code, &charProc);
+ if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
+ pushResources(resDict);
+ }
+ if (charProc.isStream()) {
+ display(&charProc, gFalse);
+ } else {
+ error(getPos(), "Missing or bad Type3 CharProc entry");
+ }
+ out->endType3Char(state);
+ if (resDict) {
+ popResources();
+ }
+ charProc.free();
+ }
+ restoreState();
+ // GfxState::restore() does *not* restore the current position,
+ // so we deal with it here using (curX, curY) and (lineX, lineY)
+ curX += tdx;
+ curY += tdy;
+ state->moveTo(curX, curY);
+ state->textSetPos(lineX, lineY);
+ p += n;
+ len -= n;
+ }
+ parser = oldParser;
+
+ } else if (out->useDrawChar()) {
+ state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
+ p = s->getCString();
+ len = s->getLength();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+ u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
+ &dx, &dy, &originX, &originY);
+ if (wMode) {
+ dx *= state->getFontSize();
+ dy = dy * state->getFontSize() + state->getCharSpace();
+ if (n == 1 && *p == ' ') {
+ dy += state->getWordSpace();
+ }
+ } else {
+ dx = dx * state->getFontSize() + state->getCharSpace();
+ if (n == 1 && *p == ' ') {
+ dx += state->getWordSpace();
+ }
+ dx *= state->getHorizScaling();
+ dy *= state->getFontSize();
+ }
+ state->textTransformDelta(dx, dy, &tdx, &tdy);
+ originX *= state->getFontSize();
+ originY *= state->getFontSize();
+ state->textTransformDelta(originX, originY, &tOriginX, &tOriginY);
+ out->drawChar(state, state->getCurX() + riseX, state->getCurY() + riseY,
+ tdx, tdy, tOriginX, tOriginY, code, n, u, uLen);
+ state->shift(tdx, tdy);
+ p += n;
+ len -= n;
+ }
+
+ } else {
+ dx = dy = 0;
+ p = s->getCString();
+ len = s->getLength();
+ nChars = nSpaces = 0;
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+ u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
+ &dx2, &dy2, &originX, &originY);
+ dx += dx2;
+ dy += dy2;
+ if (n == 1 && *p == ' ') {
+ ++nSpaces;
+ }
+ ++nChars;
+ p += n;
+ len -= n;
+ }
+ if (wMode) {
+ dx *= state->getFontSize();
+ dy = dy * state->getFontSize()
+ + nChars * state->getCharSpace()
+ + nSpaces * state->getWordSpace();
+ } else {
+ dx = dx * state->getFontSize()
+ + nChars * state->getCharSpace()
+ + nSpaces * state->getWordSpace();
+ dx *= state->getHorizScaling();
+ dy *= state->getFontSize();
+ }
+ state->textTransformDelta(dx, dy, &tdx, &tdy);
+ out->drawString(state, s);
+ state->shift(tdx, tdy);
+ }
+
+ if (out->useDrawChar()) {
+ out->endString(state);
+ }
+
+ updateLevel += 10 * s->getLength();
+}
+
+//------------------------------------------------------------------------
+// XObject operators
+//------------------------------------------------------------------------
+
+void Gfx::opXObject(Object args[], int /*numArgs*/) {
+ char *name;
+ Object obj1, obj2, obj3, refObj;
+#if OPI_SUPPORT
+ Object opiDict;
+#endif
+
+ name = args[0].getName();
+ if (!res->lookupXObject(name, &obj1)) {
+ return;
+ }
+ if (!obj1.isStream()) {
+ error(getPos(), "XObject '%s' is wrong type", name);
+ obj1.free();
+ return;
+ }
+#if OPI_SUPPORT
+ obj1.streamGetDict()->lookup("OPI", &opiDict);
+ if (opiDict.isDict()) {
+ out->opiBegin(state, opiDict.getDict());
+ }
+#endif
+ obj1.streamGetDict()->lookup("Subtype", &obj2);
+ if (obj2.isName("Image")) {
+ if (out->needNonText()) {
+ res->lookupXObjectNF(name, &refObj);
+ doImage(&refObj, obj1.getStream(), gFalse);
+ refObj.free();
+ }
+ } else if (obj2.isName("Form")) {
+ res->lookupXObjectNF(name, &refObj);
+ if (out->useDrawForm() && refObj.isRef()) {
+ out->drawForm(refObj.getRef());
+ } else {
+ doForm(&obj1);
+ }
+ refObj.free();
+ } else if (obj2.isName("PS")) {
+ obj1.streamGetDict()->lookup("Level1", &obj3);
+ out->psXObject(obj1.getStream(),
+ obj3.isStream() ? obj3.getStream() : (Stream *)NULL);
+ } else if (obj2.isName()) {
+ error(getPos(), "Unknown XObject subtype '%s'", obj2.getName());
+ } else {
+ error(getPos(), "XObject subtype is missing or wrong type");
+ }
+ obj2.free();
+#if OPI_SUPPORT
+ if (opiDict.isDict()) {
+ out->opiEnd(state, opiDict.getDict());
+ }
+ opiDict.free();
+#endif
+ obj1.free();
+}
+
+void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
+ Dict *dict, *maskDict;
+ int width, height;
+ int bits, maskBits;
+ StreamColorSpaceMode csMode;
+ GBool mask;
+ GBool invert;
+ GfxColorSpace *colorSpace, *maskColorSpace;
+ GfxImageColorMap *colorMap, *maskColorMap;
+ Object maskObj, smaskObj;
+ GBool haveColorKeyMask, haveExplicitMask, haveSoftMask;
+ int maskColors[2*gfxColorMaxComps];
+ int maskWidth, maskHeight;
+ GBool maskInvert;
+ Stream *maskStr;
+ Object obj1, obj2;
+ int i;
+
+ // get info from the stream
+ bits = 0;
+ csMode = streamCSNone;
+ str->getImageParams(&bits, &csMode);
+
+ // get stream dict
+ dict = str->getDict();
+
+ // get size
+ dict->lookup("Width", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("W", &obj1);
+ }
+ if (obj1.isInt())
+ width = obj1.getInt();
+ else if (obj1.isReal())
+ width = (int)obj1.getReal();
+ else
+ goto err2;
+ obj1.free();
+ dict->lookup("Height", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("H", &obj1);
+ }
+ if (obj1.isInt())
+ height = obj1.getInt();
+ else if (obj1.isReal())
+ height = (int)obj1.getReal();
+ else
+ goto err2;
+ obj1.free();
+
+ // image or mask?
+ dict->lookup("ImageMask", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("IM", &obj1);
+ }
+ mask = gFalse;
+ if (obj1.isBool())
+ mask = obj1.getBool();
+ else if (!obj1.isNull())
+ goto err2;
+ obj1.free();
+
+ // bit depth
+ if (bits == 0) {
+ dict->lookup("BitsPerComponent", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("BPC", &obj1);
+ }
+ if (obj1.isInt()) {
+ bits = obj1.getInt();
+ } else if (mask) {
+ bits = 1;
+ } else {
+ goto err2;
+ }
+ obj1.free();
+ }
+
+ // display a mask
+ if (mask) {
+
+ // check for inverted mask
+ if (bits != 1)
+ goto err1;
+ invert = gFalse;
+ dict->lookup("Decode", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("D", &obj1);
+ }
+ if (obj1.isArray()) {
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isInt() && obj2.getInt() == 1)
+ invert = gTrue;
+ obj2.free();
+ } else if (!obj1.isNull()) {
+ goto err2;
+ }
+ obj1.free();
+
+ // draw it
+ out->drawImageMask(state, ref, str, width, height, invert, inlineImg);
+
+ } else {
+
+ // get color space and color map
+ dict->lookup("ColorSpace", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("CS", &obj1);
+ }
+ if (obj1.isName()) {
+ res->lookupColorSpace(obj1.getName(), &obj2);
+ if (!obj2.isNull()) {
+ obj1.free();
+ obj1 = obj2;
+ } else {
+ obj2.free();
+ }
+ }
+ if (!obj1.isNull()) {
+ colorSpace = GfxColorSpace::parse(&obj1);
+ } else if (csMode == streamCSDeviceGray) {
+ colorSpace = new GfxDeviceGrayColorSpace();
+ } else if (csMode == streamCSDeviceRGB) {
+ colorSpace = new GfxDeviceRGBColorSpace();
+ } else if (csMode == streamCSDeviceCMYK) {
+ colorSpace = new GfxDeviceCMYKColorSpace();
+ } else {
+ colorSpace = NULL;
+ }
+ obj1.free();
+ if (!colorSpace) {
+ goto err1;
+ }
+ dict->lookup("Decode", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ dict->lookup("D", &obj1);
+ }
+ colorMap = new GfxImageColorMap(bits, &obj1, colorSpace);
+ obj1.free();
+ if (!colorMap->isOk()) {
+ delete colorMap;
+ goto err1;
+ }
+
+ // get the mask
+ haveColorKeyMask = haveExplicitMask = haveSoftMask = gFalse;
+ maskStr = NULL; // make gcc happy
+ maskWidth = maskHeight = 0; // make gcc happy
+ maskInvert = gFalse; // make gcc happy
+ maskColorMap = NULL; // make gcc happy
+ dict->lookup("Mask", &maskObj);
+ dict->lookup("SMask", &smaskObj);
+ if (smaskObj.isStream()) {
+ // soft mask
+ if (inlineImg) {
+ goto err1;
+ }
+ maskStr = smaskObj.getStream();
+ maskDict = smaskObj.streamGetDict();
+ maskDict->lookup("Width", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("W", &obj1);
+ }
+ if (!obj1.isInt()) {
+ goto err2;
+ }
+ maskWidth = obj1.getInt();
+ obj1.free();
+ maskDict->lookup("Height", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("H", &obj1);
+ }
+ if (!obj1.isInt()) {
+ goto err2;
+ }
+ maskHeight = obj1.getInt();
+ obj1.free();
+ maskDict->lookup("BitsPerComponent", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("BPC", &obj1);
+ }
+ if (!obj1.isInt()) {
+ goto err2;
+ }
+ maskBits = obj1.getInt();
+ obj1.free();
+ maskDict->lookup("ColorSpace", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("CS", &obj1);
+ }
+ if (obj1.isName()) {
+ res->lookupColorSpace(obj1.getName(), &obj2);
+ if (!obj2.isNull()) {
+ obj1.free();
+ obj1 = obj2;
+ } else {
+ obj2.free();
+ }
+ }
+ maskColorSpace = GfxColorSpace::parse(&obj1);
+ obj1.free();
+ if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
+ goto err1;
+ }
+ maskDict->lookup("Decode", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("D", &obj1);
+ }
+ maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace);
+ obj1.free();
+ if (!maskColorMap->isOk()) {
+ delete maskColorMap;
+ goto err1;
+ }
+ //~ handle the Matte entry
+ haveSoftMask = gTrue;
+ } else if (maskObj.isArray()) {
+ // color key mask
+ for (i = 0;
+ i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps;
+ ++i) {
+ maskObj.arrayGet(i, &obj1);
+ maskColors[i] = obj1.getInt();
+ obj1.free();
+ }
+ haveColorKeyMask = gTrue;
+ } else if (maskObj.isStream()) {
+ // explicit mask
+ if (inlineImg) {
+ goto err1;
+ }
+ maskStr = maskObj.getStream();
+ maskDict = maskObj.streamGetDict();
+ maskDict->lookup("Width", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("W", &obj1);
+ }
+ if (!obj1.isInt()) {
+ goto err2;
+ }
+ maskWidth = obj1.getInt();
+ obj1.free();
+ maskDict->lookup("Height", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("H", &obj1);
+ }
+ if (!obj1.isInt()) {
+ goto err2;
+ }
+ maskHeight = obj1.getInt();
+ obj1.free();
+ maskDict->lookup("ImageMask", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("IM", &obj1);
+ }
+ if (!obj1.isBool() || !obj1.getBool()) {
+ goto err2;
+ }
+ obj1.free();
+ maskInvert = gFalse;
+ maskDict->lookup("Decode", &obj1);
+ if (obj1.isNull()) {
+ obj1.free();
+ maskDict->lookup("D", &obj1);
+ }
+ if (obj1.isArray()) {
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isInt() && obj2.getInt() == 1) {
+ maskInvert = gTrue;
+ }
+ obj2.free();
+ } else if (!obj1.isNull()) {
+ goto err2;
+ }
+ obj1.free();
+ haveExplicitMask = gTrue;
+ }
+
+ // draw it
+ if (haveSoftMask) {
+ out->drawSoftMaskedImage(state, ref, str, width, height, colorMap,
+ maskStr, maskWidth, maskHeight, maskColorMap);
+ delete maskColorMap;
+ } else if (haveExplicitMask) {
+ out->drawMaskedImage(state, ref, str, width, height, colorMap,
+ maskStr, maskWidth, maskHeight, maskInvert);
+ } else {
+ out->drawImage(state, ref, str, width, height, colorMap,
+ haveColorKeyMask ? maskColors : (int *)NULL, inlineImg);
+ }
+ delete colorMap;
+
+ maskObj.free();
+ smaskObj.free();
+ }
+
+ if ((i = width * height) > 1000) {
+ i = 1000;
+ }
+ updateLevel += i;
+
+ return;
+
+ err2:
+ obj1.free();
+ err1:
+ error(getPos(), "Bad image parameters");
+}
+
+void Gfx::doForm(Object *str) {
+ Dict *dict;
+ GBool transpGroup, isolated, knockout;
+ GfxColorSpace *blendingColorSpace;
+ Object matrixObj, bboxObj;
+ double m[6], bbox[4];
+ Object resObj;
+ Dict *resDict;
+ Object obj1, obj2, obj3;
+ int i;
+
+ // check for excessive recursion
+ if (formDepth > 20) {
+ return;
+ }
+
+ // get stream dict
+ dict = str->streamGetDict();
+
+ // check form type
+ dict->lookup("FormType", &obj1);
+ if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
+ error(getPos(), "Unknown form type");
+ }
+ obj1.free();
+
+ // get bounding box
+ dict->lookup("BBox", &bboxObj);
+ if (!bboxObj.isArray()) {
+ bboxObj.free();
+ error(getPos(), "Bad form bounding box");
+ return;
+ }
+ for (i = 0; i < 4; ++i) {
+ bboxObj.arrayGet(i, &obj1);
+ bbox[i] = obj1.getNum();
+ obj1.free();
+ }
+ bboxObj.free();
+
+ // get matrix
+ dict->lookup("Matrix", &matrixObj);
+ if (matrixObj.isArray()) {
+ for (i = 0; i < 6; ++i) {
+ matrixObj.arrayGet(i, &obj1);
+ m[i] = obj1.getNum();
+ obj1.free();
+ }
+ } else {
+ m[0] = 1; m[1] = 0;
+ m[2] = 0; m[3] = 1;
+ m[4] = 0; m[5] = 0;
+ }
+ matrixObj.free();
+
+ // get resources
+ dict->lookup("Resources", &resObj);
+ resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
+
+ // check for a transparency group
+ transpGroup = isolated = knockout = gFalse;
+ blendingColorSpace = NULL;
+ if (dict->lookup("Group", &obj1)->isDict()) {
+ if (obj1.dictLookup("S", &obj2)->isName("Transparency")) {
+ transpGroup = gTrue;
+ if (!obj1.dictLookup("CS", &obj3)->isNull()) {
+ blendingColorSpace = GfxColorSpace::parse(&obj3);
+ }
+ obj3.free();
+ if (obj1.dictLookup("I", &obj3)->isBool()) {
+ isolated = obj3.getBool();
+ }
+ obj3.free();
+ if (obj1.dictLookup("K", &obj3)->isBool()) {
+ knockout = obj3.getBool();
+ }
+ obj3.free();
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ // draw it
+ ++formDepth;
+ doForm1(str, resDict, m, bbox,
+ transpGroup, gFalse, blendingColorSpace, isolated, knockout);
+ --formDepth;
+
+ if (blendingColorSpace) {
+ delete blendingColorSpace;
+ }
+ resObj.free();
+}
+
+void Gfx::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox,
+ GBool transpGroup, GBool softMask,
+ GfxColorSpace *blendingColorSpace,
+ GBool isolated, GBool knockout,
+ GBool alpha, Function *transferFunc,
+ GfxColor *backdropColor) {
+ Parser *oldParser;
+ double oldBaseMatrix[6];
+ int i;
+
+ // push new resources on stack
+ pushResources(resDict);
+
+ // save current graphics state
+ saveState();
+
+ // kill any pre-existing path
+ state->clearPath();
+
+ // save current parser
+ oldParser = parser;
+
+ // set form transformation matrix
+ state->concatCTM(matrix[0], matrix[1], matrix[2],
+ matrix[3], matrix[4], matrix[5]);
+ out->updateCTM(state, matrix[0], matrix[1], matrix[2],
+ matrix[3], matrix[4], matrix[5]);
+
+ // set form bounding box
+ state->moveTo(bbox[0], bbox[1]);
+ state->lineTo(bbox[2], bbox[1]);
+ state->lineTo(bbox[2], bbox[3]);
+ state->lineTo(bbox[0], bbox[3]);
+ state->closePath();
+ state->clip();
+ out->clip(state);
+ state->clearPath();
+
+ if (softMask || transpGroup) {
+ if (state->getBlendMode() != gfxBlendNormal) {
+ state->setBlendMode(gfxBlendNormal);
+ out->updateBlendMode(state);
+ }
+ if (state->getFillOpacity() != 1) {
+ state->setFillOpacity(1);
+ out->updateFillOpacity(state);
+ }
+ if (state->getStrokeOpacity() != 1) {
+ state->setStrokeOpacity(1);
+ out->updateStrokeOpacity(state);
+ }
+ out->clearSoftMask(state);
+ out->beginTransparencyGroup(state, bbox, blendingColorSpace,
+ isolated, knockout, softMask);
+ }
+
+ // set new base matrix
+ for (i = 0; i < 6; ++i) {
+ oldBaseMatrix[i] = baseMatrix[i];
+ baseMatrix[i] = state->getCTM()[i];
+ }
+
+ // draw the form
+ display(str, gFalse);
+
+ if (softMask || transpGroup) {
+ out->endTransparencyGroup(state);
+ }
+
+ // restore base matrix
+ for (i = 0; i < 6; ++i) {
+ baseMatrix[i] = oldBaseMatrix[i];
+ }
+
+ // restore parser
+ parser = oldParser;
+
+ // restore graphics state
+ restoreState();
+
+ // pop resource stack
+ popResources();
+
+ if (softMask) {
+ out->setSoftMask(state, bbox, alpha, transferFunc, backdropColor);
+ } else if (transpGroup) {
+ out->paintTransparencyGroup(state, bbox);
+ }
+
+ return;
+}
+
+//------------------------------------------------------------------------
+// in-line image operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginImage(Object * /*args[]*/, int /*numArgs*/) {
+ Stream *str;
+ int c1, c2;
+
+ // build dict/stream
+ str = buildImageStream();
+
+ // display the image
+ if (str) {
+ doImage(NULL, str, gTrue);
+
+ // skip 'EI' tag
+ c1 = str->getUndecodedStream()->getChar();
+ c2 = str->getUndecodedStream()->getChar();
+ while (!(c1 == 'E' && c2 == 'I') && c2 != EOF) {
+ c1 = c2;
+ c2 = str->getUndecodedStream()->getChar();
+ }
+ delete str;
+ }
+}
+
+Stream *Gfx::buildImageStream() {
+ Object dict;
+ Object obj;
+ char *key;
+ Stream *str;
+
+ // build dictionary
+ dict.initDict(xref);
+ parser->getObj(&obj);
+ while (!obj.isCmd("ID") && !obj.isEOF()) {
+ if (!obj.isName()) {
+ error(getPos(), "Inline image dictionary key must be a name object");
+ obj.free();
+ } else {
+ key = copyString(obj.getName());
+ obj.free();
+ parser->getObj(&obj);
+ if (obj.isEOF() || obj.isError()) {
+ gfree(key);
+ break;
+ }
+ dict.dictAdd(key, &obj);
+ }
+ parser->getObj(&obj);
+ }
+ if (obj.isEOF()) {
+ error(getPos(), "End of file in inline image");
+ obj.free();
+ dict.free();
+ return NULL;
+ }
+ obj.free();
+
+ // make stream
+ str = new EmbedStream(parser->getStream(), &dict, gFalse, 0);
+ str = str->addFilters(&dict);
+
+ return str;
+}
+
+void Gfx::opImageData(Object * /*args[]*/, int /*numArgs*/) {
+ error(getPos(), "Internal: got 'ID' operator");
+}
+
+void Gfx::opEndImage(Object * /*args[]*/, int /*numArgs*/) {
+ error(getPos(), "Internal: got 'EI' operator");
+}
+
+//------------------------------------------------------------------------
+// type 3 font operators
+//------------------------------------------------------------------------
+
+void Gfx::opSetCharWidth(Object args[], int /*numArgs*/) {
+ out->type3D0(state, args[0].getNum(), args[1].getNum());
+}
+
+void Gfx::opSetCacheDevice(Object args[], int /*numArgs*/) {
+ out->type3D1(state, args[0].getNum(), args[1].getNum(),
+ args[2].getNum(), args[3].getNum(),
+ args[4].getNum(), args[5].getNum());
+}
+
+//------------------------------------------------------------------------
+// compatibility operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginIgnoreUndef(Object * /*args[]*/, int /*numArgs*/) {
+ ++ignoreUndef;
+}
+
+void Gfx::opEndIgnoreUndef(Object * /*args[]*/, int /*numArgs*/) {
+ if (ignoreUndef > 0)
+ --ignoreUndef;
+}
+
+//------------------------------------------------------------------------
+// marked content operators
+//------------------------------------------------------------------------
+
+void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
+ if (printCommands) {
+ printf(" marked content: %s ", args[0].getName());
+ if (numArgs == 2)
+ args[2].print(stdout);
+ printf("\n");
+ fflush(stdout);
+ }
+}
+
+void Gfx::opEndMarkedContent(Object * /*args[]*/, int /*numArgs*/) {
+}
+
+void Gfx::opMarkPoint(Object args[], int numArgs) {
+ if (printCommands) {
+ printf(" mark point: %s ", args[0].getName());
+ if (numArgs == 2)
+ args[2].print(stdout);
+ printf("\n");
+ fflush(stdout);
+ }
+}
+
+//------------------------------------------------------------------------
+// misc
+//------------------------------------------------------------------------
+
+void Gfx::drawAnnot(Object *str, AnnotBorderStyle *borderStyle,
+ double xMin, double yMin, double xMax, double yMax) {
+ Dict *dict, *resDict;
+ Object matrixObj, bboxObj, resObj;
+ Object obj1;
+ double m[6], bbox[4], ictm[6];
+ double *ctm;
+ double formX0, formY0, formX1, formY1;
+ double annotX0, annotY0, annotX1, annotY1;
+ double det, x, y, sx, sy;
+ double r, g, b;
+ GfxColor color;
+ double *dash, *dash2;
+ int dashLength;
+ int i;
+
+ //~ can we assume that we're in default user space?
+ //~ (i.e., baseMatrix = ctm)
+
+ // transform the annotation bbox from default user space to user
+ // space: (bbox * baseMatrix) * iCTM
+ ctm = state->getCTM();
+ det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+ ictm[0] = ctm[3] * det;
+ ictm[1] = -ctm[1] * det;
+ ictm[2] = -ctm[2] * det;
+ ictm[3] = ctm[0] * det;
+ ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
+ ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
+ x = baseMatrix[0] * xMin + baseMatrix[2] * yMin + baseMatrix[4];
+ y = baseMatrix[1] * xMin + baseMatrix[3] * yMin + baseMatrix[5];
+ annotX0 = ictm[0] * x + ictm[2] * y + ictm[4];
+ annotY0 = ictm[1] * x + ictm[3] * y + ictm[5];
+ x = baseMatrix[0] * xMax + baseMatrix[2] * yMax + baseMatrix[4];
+ y = baseMatrix[1] * xMax + baseMatrix[3] * yMax + baseMatrix[5];
+ annotX1 = ictm[0] * x + ictm[2] * y + ictm[4];
+ annotY1 = ictm[1] * x + ictm[3] * y + ictm[5];
+ if (annotX0 > annotX1) {
+ x = annotX0; annotX0 = annotX1; annotX1 = x;
+ }
+ if (annotY0 > annotY1) {
+ y = annotY0; annotY0 = annotY1; annotY1 = y;
+ }
+
+ // draw the appearance stream (if there is one)
+ if (str->isStream()) {
+
+ // get stream dict
+ dict = str->streamGetDict();
+
+ // get the form bounding box
+ dict->lookup("BBox", &bboxObj);
+ if (!bboxObj.isArray()) {
+ bboxObj.free();
+ error(getPos(), "Bad form bounding box");
+ return;
+ }
+ for (i = 0; i < 4; ++i) {
+ bboxObj.arrayGet(i, &obj1);
+ bbox[i] = obj1.getNum();
+ obj1.free();
+ }
+ bboxObj.free();
+
+ // get the form matrix
+ dict->lookup("Matrix", &matrixObj);
+ if (matrixObj.isArray()) {
+ for (i = 0; i < 6; ++i) {
+ matrixObj.arrayGet(i, &obj1);
+ m[i] = obj1.getNum();
+ obj1.free();
+ }
+ } else {
+ m[0] = 1; m[1] = 0;
+ m[2] = 0; m[3] = 1;
+ m[4] = 0; m[5] = 0;
+ }
+ matrixObj.free();
+
+ // transform the form bbox from form space to user space
+ formX0 = bbox[0] * m[0] + bbox[1] * m[2] + m[4];
+ formY0 = bbox[0] * m[1] + bbox[1] * m[3] + m[5];
+ formX1 = bbox[2] * m[0] + bbox[3] * m[2] + m[4];
+ formY1 = bbox[2] * m[1] + bbox[3] * m[3] + m[5];
+ if (formX0 > formX1) {
+ x = formX0; formX0 = formX1; formX1 = x;
+ }
+ if (formY0 > formY1) {
+ y = formY0; formY0 = formY1; formY1 = y;
+ }
+
+ // scale the form to fit the annotation bbox
+ if (formX1 == formX0) {
+ // this shouldn't happen
+ sx = 1;
+ } else {
+ sx = (annotX1 - annotX0) / (formX1 - formX0);
+ }
+ if (formY1 == formY0) {
+ // this shouldn't happen
+ sy = 1;
+ } else {
+ sy = (annotY1 - annotY0) / (formY1 - formY0);
+ }
+ m[0] *= sx;
+ m[2] *= sx;
+ m[4] = (m[4] - formX0) * sx + annotX0;
+ m[1] *= sy;
+ m[3] *= sy;
+ m[5] = (m[5] - formY0) * sy + annotY0;
+
+ // get resources
+ dict->lookup("Resources", &resObj);
+ resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
+
+ // draw it
+ doForm1(str, resDict, m, bbox);
+
+ resObj.free();
+ }
+
+ // draw the border
+ if (borderStyle && borderStyle->getWidth() > 0) {
+ if (state->getStrokeColorSpace()->getMode() != csDeviceRGB) {
+ state->setStrokePattern(NULL);
+ state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
+ out->updateStrokeColorSpace(state);
+ }
+ borderStyle->getColor(&r, &g, &b);
+ color.c[0] = dblToCol(r);
+ color.c[1] = dblToCol(g);
+ color.c[2] = dblToCol(b);
+ state->setStrokeColor(&color);
+ out->updateStrokeColor(state);
+ // compute the width scale factor when going from default user
+ // space to user space
+ x = (baseMatrix[0] + baseMatrix[2]) * ictm[0] +
+ (baseMatrix[1] + baseMatrix[3]) * ictm[2];
+ y = (baseMatrix[0] + baseMatrix[2]) * ictm[1] +
+ (baseMatrix[1] + baseMatrix[3]) * ictm[3];
+ x = sqrt(0.5 * (x * x + y * y));
+ state->setLineWidth(x * borderStyle->getWidth());
+ out->updateLineWidth(state);
+ borderStyle->getDash(&dash, &dashLength);
+ if (borderStyle->getType() == annotBorderDashed && dashLength > 0) {
+ dash2 = (double *)gmallocn(dashLength, sizeof(double));
+ for (i = 0; i < dashLength; ++i) {
+ dash2[i] = x * dash[i];
+ }
+ state->setLineDash(dash2, dashLength, 0);
+ out->updateLineDash(state);
+ }
+ //~ this doesn't currently handle the beveled and engraved styles
+ state->clearPath();
+ state->moveTo(annotX0, out->upsideDown() ? annotY0 : annotY1);
+ state->lineTo(annotX1, out->upsideDown() ? annotY0 : annotY1);
+ if (borderStyle->getType() != annotBorderUnderlined) {
+ state->lineTo(annotX1, out->upsideDown() ? annotY1 : annotY0);
+ state->lineTo(annotX0, out->upsideDown() ? annotY1 : annotY0);
+ state->closePath();
+ }
+ out->stroke(state);
+ }
+}
+
+void Gfx::saveState() {
+ out->saveState(state);
+ state = state->save();
+}
+
+void Gfx::restoreState() {
+ state = state->restore();
+ out->restoreState(state);
+}
+
+void Gfx::pushResources(Dict *resDict) {
+ res = new GfxResources(xref, resDict, res);
+}
+
+void Gfx::popResources() {
+ GfxResources *resPtr;
+
+ resPtr = res->getNext();
+ delete res;
+ res = resPtr;
+}
diff --git a/kpdf/xpdf/xpdf/GfxFont.cc b/kpdf/xpdf/xpdf/GfxFont.cc
deleted file mode 100644
index 8694be47..00000000
--- a/kpdf/xpdf/xpdf/GfxFont.cc
+++ /dev/null
@@ -1,1616 +0,0 @@
-//========================================================================
-//
-// GfxFont.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "gmem.h"
-#include "Error.h"
-#include "Object.h"
-#include "Dict.h"
-#include "GlobalParams.h"
-#include "CMap.h"
-#include "CharCodeToUnicode.h"
-#include "FontEncodingTables.h"
-#include "BuiltinFontTables.h"
-#include "FoFiType1.h"
-#include "FoFiType1C.h"
-#include "FoFiTrueType.h"
-#include "GfxFont.h"
-
-//------------------------------------------------------------------------
-
-struct StdFontMapEntry {
- char *altName;
- char *properName;
-};
-
-// Acrobat 4.0 and earlier substituted Base14-compatible fonts without
-// providing Widths and a FontDescriptor, so we munge the names into
-// the proper Base14 names. This table is from implementation note 44
-// in the PDF 1.4 spec, with some additions based on empirical
-// evidence.
-static StdFontMapEntry stdFontMap[] = {
- { "Arial", "Helvetica" },
- { "Arial,Bold", "Helvetica-Bold" },
- { "Arial,BoldItalic", "Helvetica-BoldOblique" },
- { "Arial,Italic", "Helvetica-Oblique" },
- { "Arial-Bold", "Helvetica-Bold" },
- { "Arial-BoldItalic", "Helvetica-BoldOblique" },
- { "Arial-BoldItalicMT", "Helvetica-BoldOblique" },
- { "Arial-BoldMT", "Helvetica-Bold" },
- { "Arial-Italic", "Helvetica-Oblique" },
- { "Arial-ItalicMT", "Helvetica-Oblique" },
- { "ArialMT", "Helvetica" },
- { "Courier,Bold", "Courier-Bold" },
- { "Courier,BoldItalic", "Courier-BoldOblique" },
- { "Courier,Italic", "Courier-Oblique" },
- { "CourierNew", "Courier" },
- { "CourierNew,Bold", "Courier-Bold" },
- { "CourierNew,BoldItalic", "Courier-BoldOblique" },
- { "CourierNew,Italic", "Courier-Oblique" },
- { "CourierNew-Bold", "Courier-Bold" },
- { "CourierNew-BoldItalic", "Courier-BoldOblique" },
- { "CourierNew-Italic", "Courier-Oblique" },
- { "CourierNewPS-BoldItalicMT", "Courier-BoldOblique" },
- { "CourierNewPS-BoldMT", "Courier-Bold" },
- { "CourierNewPS-ItalicMT", "Courier-Oblique" },
- { "CourierNewPSMT", "Courier" },
- { "Helvetica,Bold", "Helvetica-Bold" },
- { "Helvetica,BoldItalic", "Helvetica-BoldOblique" },
- { "Helvetica,Italic", "Helvetica-Oblique" },
- { "Helvetica-BoldItalic", "Helvetica-BoldOblique" },
- { "Helvetica-Italic", "Helvetica-Oblique" },
- { "Symbol,Bold", "Symbol" },
- { "Symbol,BoldItalic", "Symbol" },
- { "Symbol,Italic", "Symbol" },
- { "TimesNewRoman", "Times-Roman" },
- { "TimesNewRoman,Bold", "Times-Bold" },
- { "TimesNewRoman,BoldItalic", "Times-BoldItalic" },
- { "TimesNewRoman,Italic", "Times-Italic" },
- { "TimesNewRoman-Bold", "Times-Bold" },
- { "TimesNewRoman-BoldItalic", "Times-BoldItalic" },
- { "TimesNewRoman-Italic", "Times-Italic" },
- { "TimesNewRomanPS", "Times-Roman" },
- { "TimesNewRomanPS-Bold", "Times-Bold" },
- { "TimesNewRomanPS-BoldItalic", "Times-BoldItalic" },
- { "TimesNewRomanPS-BoldItalicMT", "Times-BoldItalic" },
- { "TimesNewRomanPS-BoldMT", "Times-Bold" },
- { "TimesNewRomanPS-Italic", "Times-Italic" },
- { "TimesNewRomanPS-ItalicMT", "Times-Italic" },
- { "TimesNewRomanPSMT", "Times-Roman" },
- { "TimesNewRomanPSMT,Bold", "Times-Bold" },
- { "TimesNewRomanPSMT,BoldItalic", "Times-BoldItalic" },
- { "TimesNewRomanPSMT,Italic", "Times-Italic" }
-};
-
-//------------------------------------------------------------------------
-// GfxFont
-//------------------------------------------------------------------------
-
-GfxFont *GfxFont::makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict) {
- GString *nameA;
- GfxFont *font;
- Object obj1;
-
- // get base font name
- nameA = NULL;
- fontDict->lookup("BaseFont", &obj1);
- if (obj1.isName()) {
- nameA = new GString(obj1.getName());
- }
- obj1.free();
-
- // get font type
- font = NULL;
- fontDict->lookup("Subtype", &obj1);
- if (obj1.isName("Type1") || obj1.isName("MMType1")) {
- font = new Gfx8BitFont(xref, tagA, idA, nameA, fontType1, fontDict);
- } else if (obj1.isName("Type1C")) {
- font = new Gfx8BitFont(xref, tagA, idA, nameA, fontType1C, fontDict);
- } else if (obj1.isName("Type3")) {
- font = new Gfx8BitFont(xref, tagA, idA, nameA, fontType3, fontDict);
- } else if (obj1.isName("TrueType")) {
- font = new Gfx8BitFont(xref, tagA, idA, nameA, fontTrueType, fontDict);
- } else if (obj1.isName("Type0")) {
- font = new GfxCIDFont(xref, tagA, idA, nameA, fontDict);
- } else {
- error(-1, "Unknown font type: '%s'",
- obj1.isName() ? obj1.getName() : "???");
- font = new Gfx8BitFont(xref, tagA, idA, nameA, fontUnknownType, fontDict);
- }
- obj1.free();
-
- return font;
-}
-
-GfxFont::GfxFont(char *tagA, Ref idA, GString *nameA) {
- ok = gFalse;
- tag = new GString(tagA);
- id = idA;
- name = nameA;
- origName = nameA;
- embFontName = NULL;
- extFontFile = NULL;
-}
-
-GfxFont::~GfxFont() {
- delete tag;
- if (origName && origName != name) {
- delete origName;
- }
- if (name) {
- delete name;
- }
- if (embFontName) {
- delete embFontName;
- }
- if (extFontFile) {
- delete extFontFile;
- }
-}
-
-void GfxFont::readFontDescriptor(XRef *xref, Dict *fontDict) {
- Object obj1, obj2, obj3, obj4;
- double t;
- int i;
-
- // assume Times-Roman by default (for substitution purposes)
- flags = fontSerif;
-
- embFontID.num = -1;
- embFontID.gen = -1;
- missingWidth = 0;
-
- if (fontDict->lookup("FontDescriptor", &obj1)->isDict()) {
-
- // get flags
- if (obj1.dictLookup("Flags", &obj2)->isInt()) {
- flags = obj2.getInt();
- }
- obj2.free();
-
- // get name
- obj1.dictLookup("FontName", &obj2);
- if (obj2.isName()) {
- embFontName = new GString(obj2.getName());
- }
- obj2.free();
-
- // look for embedded font file
- if (obj1.dictLookupNF("FontFile", &obj2)->isRef()) {
- embFontID = obj2.getRef();
- if (type != fontType1) {
- error(-1, "Mismatch between font type and embedded font file");
- type = fontType1;
- }
- }
- obj2.free();
- if (embFontID.num == -1 &&
- obj1.dictLookupNF("FontFile2", &obj2)->isRef()) {
- embFontID = obj2.getRef();
- if (type != fontTrueType && type != fontCIDType2) {
- error(-1, "Mismatch between font type and embedded font file");
- type = type == fontCIDType0 ? fontCIDType2 : fontTrueType;
- }
- }
- obj2.free();
- if (embFontID.num == -1 &&
- obj1.dictLookupNF("FontFile3", &obj2)->isRef()) {
- if (obj2.fetch(xref, &obj3)->isStream()) {
- obj3.streamGetDict()->lookup("Subtype", &obj4);
- if (obj4.isName("Type1")) {
- embFontID = obj2.getRef();
- if (type != fontType1) {
- error(-1, "Mismatch between font type and embedded font file");
- type = fontType1;
- }
- } else if (obj4.isName("Type1C")) {
- embFontID = obj2.getRef();
- if (type != fontType1 && type != fontType1C) {
- error(-1, "Mismatch between font type and embedded font file");
- }
- type = fontType1C;
- } else if (obj4.isName("TrueType")) {
- embFontID = obj2.getRef();
- if (type != fontTrueType) {
- error(-1, "Mismatch between font type and embedded font file");
- type = fontTrueType;
- }
- } else if (obj4.isName("CIDFontType0C")) {
- embFontID = obj2.getRef();
- if (type != fontCIDType0) {
- error(-1, "Mismatch between font type and embedded font file");
- }
- type = fontCIDType0C;
- } else if (obj4.isName("OpenType")) {
- embFontID = obj2.getRef();
- if (type == fontTrueType) {
- type = fontTrueTypeOT;
- } else if (type == fontType1) {
- type = fontType1COT;
- } else if (type == fontCIDType0) {
- type = fontCIDType0COT;
- } else if (type == fontCIDType2) {
- type = fontCIDType2OT;
- } else {
- error(-1, "Mismatch between font type and embedded font file");
- }
- } else {
- error(-1, "Unknown embedded font type '%s'",
- obj4.isName() ? obj4.getName() : "???");
- }
- obj4.free();
- }
- obj3.free();
- }
- obj2.free();
-
- // look for MissingWidth
- obj1.dictLookup("MissingWidth", &obj2);
- if (obj2.isNum()) {
- missingWidth = obj2.getNum();
- }
- obj2.free();
-
- // get Ascent and Descent
- obj1.dictLookup("Ascent", &obj2);
- if (obj2.isNum()) {
- t = 0.001 * obj2.getNum();
- // some broken font descriptors set ascent and descent to 0
- if (t != 0) {
- ascent = t;
- }
- }
- obj2.free();
- obj1.dictLookup("Descent", &obj2);
- if (obj2.isNum()) {
- t = 0.001 * obj2.getNum();
- // some broken font descriptors set ascent and descent to 0
- if (t != 0) {
- descent = t;
- }
- // some broken font descriptors specify a positive descent
- if (descent > 0) {
- descent = -descent;
- }
- }
- obj2.free();
-
- // font FontBBox
- if (obj1.dictLookup("FontBBox", &obj2)->isArray()) {
- for (i = 0; i < 4 && i < obj2.arrayGetLength(); ++i) {
- if (obj2.arrayGet(i, &obj3)->isNum()) {
- fontBBox[i] = 0.001 * obj3.getNum();
- }
- obj3.free();
- }
- }
- obj2.free();
-
- }
- obj1.free();
-}
-
-CharCodeToUnicode *GfxFont::readToUnicodeCMap(Dict *fontDict, int nBits,
- CharCodeToUnicode *ctu) {
- GString *buf;
- Object obj1;
- int c;
-
- if (!fontDict->lookup("ToUnicode", &obj1)->isStream()) {
- obj1.free();
- return NULL;
- }
- buf = new GString();
- obj1.streamReset();
- while ((c = obj1.streamGetChar()) != EOF) {
- buf->append(c);
- }
- obj1.streamClose();
- obj1.free();
- if (ctu) {
- ctu->mergeCMap(buf, nBits);
- } else {
- ctu = CharCodeToUnicode::parseCMap(buf, nBits);
- }
- delete buf;
- return ctu;
-}
-
-void GfxFont::findExtFontFile() {
- static char *type1Exts[] = { ".pfa", ".pfb", ".ps", "", NULL };
- static char *ttExts[] = { ".ttf", ".ttc", NULL };
-
- if (name) {
- if (type == fontType1) {
- extFontFile = globalParams->findFontFile(name, type1Exts);
- } else if (type == fontTrueType) {
- extFontFile = globalParams->findFontFile(name, ttExts);
- }
- }
-}
-
-char *GfxFont::readExtFontFile(int *len) {
- FILE *f;
- char *buf;
-
- if (!(f = fopen(extFontFile->getCString(), "rb"))) {
- error(-1, "External font file '%s' vanished", extFontFile->getCString());
- return NULL;
- }
- fseek(f, 0, SEEK_END);
- *len = (int)ftell(f);
- fseek(f, 0, SEEK_SET);
- buf = (char *)gmalloc(*len);
- if ((int)fread(buf, 1, *len, f) != *len) {
- error(-1, "Error reading external font file '%s'",
- extFontFile->getCString());
- }
- fclose(f);
- return buf;
-}
-
-char *GfxFont::readEmbFontFile(XRef *xref, int *len) {
- char *buf;
- Object obj1, obj2;
- Stream *str;
- int c;
- int size, i;
-
- obj1.initRef(embFontID.num, embFontID.gen);
- obj1.fetch(xref, &obj2);
- if (!obj2.isStream()) {
- error(-1, "Embedded font file is not a stream");
- obj2.free();
- obj1.free();
- embFontID.num = -1;
- return NULL;
- }
- str = obj2.getStream();
-
- buf = NULL;
- i = size = 0;
- str->reset();
- while ((c = str->getChar()) != EOF) {
- if (i == size) {
- size += 4096;
- buf = (char *)grealloc(buf, size);
- }
- buf[i++] = c;
- }
- *len = i;
- str->close();
-
- obj2.free();
- obj1.free();
-
- return buf;
-}
-
-//------------------------------------------------------------------------
-// Gfx8BitFont
-//------------------------------------------------------------------------
-
-Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
- GfxFontType typeA, Dict *fontDict):
- GfxFont(tagA, idA, nameA)
-{
- GString *name2;
- BuiltinFont *builtinFont;
- char **baseEnc;
- GBool baseEncFromFontFile;
- char *buf;
- int len;
- FoFiType1 *ffT1;
- FoFiType1C *ffT1C;
- int code, code2;
- char *charName;
- GBool missing, hex;
- Unicode toUnicode[256];
- CharCodeToUnicode *utu, *ctu2;
- Unicode uBuf[8];
- double mul;
- int firstChar, lastChar;
- Gushort w;
- Object obj1, obj2, obj3;
- int n, i, a, b, m;
-
- type = typeA;
- ctu = NULL;
-
- // do font name substitution for various aliases of the Base 14 font
- // names
- if (name) {
- name2 = name->copy();
- i = 0;
- while (i < name2->getLength()) {
- if (name2->getChar(i) == ' ') {
- name2->del(i);
- } else {
- ++i;
- }
- }
- a = 0;
- b = sizeof(stdFontMap) / sizeof(StdFontMapEntry);
- // invariant: stdFontMap[a].altName <= name2 < stdFontMap[b].altName
- while (b - a > 1) {
- m = (a + b) / 2;
- if (name2->cmp(stdFontMap[m].altName) >= 0) {
- a = m;
- } else {
- b = m;
- }
- }
- if (!name2->cmp(stdFontMap[a].altName)) {
- name = new GString(stdFontMap[a].properName);
- }
- delete name2;
- }
-
- // is it a built-in font?
- builtinFont = NULL;
- if (name) {
- for (i = 0; i < nBuiltinFonts; ++i) {
- if (!name->cmp(builtinFonts[i].name)) {
- builtinFont = &builtinFonts[i];
- break;
- }
- }
- }
-
- // default ascent/descent values
- if (builtinFont) {
- ascent = 0.001 * builtinFont->ascent;
- descent = 0.001 * builtinFont->descent;
- fontBBox[0] = 0.001 * builtinFont->bbox[0];
- fontBBox[1] = 0.001 * builtinFont->bbox[1];
- fontBBox[2] = 0.001 * builtinFont->bbox[2];
- fontBBox[3] = 0.001 * builtinFont->bbox[3];
- } else {
- ascent = 0.95;
- descent = -0.35;
- fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0;
- }
-
- // get info from font descriptor
- readFontDescriptor(xref, fontDict);
-
- // for non-embedded fonts, don't trust the ascent/descent/bbox
- // values from the font descriptor
- if (builtinFont && embFontID.num < 0) {
- ascent = 0.001 * builtinFont->ascent;
- descent = 0.001 * builtinFont->descent;
- fontBBox[0] = 0.001 * builtinFont->bbox[0];
- fontBBox[1] = 0.001 * builtinFont->bbox[1];
- fontBBox[2] = 0.001 * builtinFont->bbox[2];
- fontBBox[3] = 0.001 * builtinFont->bbox[3];
- }
-
- // look for an external font file
- findExtFontFile();
-
- // get font matrix
- fontMat[0] = fontMat[3] = 1;
- fontMat[1] = fontMat[2] = fontMat[4] = fontMat[5] = 0;
- if (fontDict->lookup("FontMatrix", &obj1)->isArray()) {
- for (i = 0; i < 6 && i < obj1.arrayGetLength(); ++i) {
- if (obj1.arrayGet(i, &obj2)->isNum()) {
- fontMat[i] = obj2.getNum();
- }
- obj2.free();
- }
- }
- obj1.free();
-
- // get Type 3 bounding box, font definition, and resources
- if (type == fontType3) {
- if (fontDict->lookup("FontBBox", &obj1)->isArray()) {
- for (i = 0; i < 4 && i < obj1.arrayGetLength(); ++i) {
- if (obj1.arrayGet(i, &obj2)->isNum()) {
- fontBBox[i] = obj2.getNum();
- }
- obj2.free();
- }
- }
- obj1.free();
- if (!fontDict->lookup("CharProcs", &charProcs)->isDict()) {
- error(-1, "Missing or invalid CharProcs dictionary in Type 3 font");
- charProcs.free();
- }
- if (!fontDict->lookup("Resources", &resources)->isDict()) {
- resources.free();
- }
- }
-
- //----- build the font encoding -----
-
- // Encodings start with a base encoding, which can come from
- // (in order of priority):
- // 1. FontDict.Encoding or FontDict.Encoding.BaseEncoding
- // - MacRoman / MacExpert / WinAnsi / Standard
- // 2. embedded or external font file
- // 3. default:
- // - builtin --> builtin encoding
- // - TrueType --> WinAnsiEncoding
- // - others --> StandardEncoding
- // and then add a list of differences (if any) from
- // FontDict.Encoding.Differences.
-
- // check FontDict for base encoding
- hasEncoding = gFalse;
- usesMacRomanEnc = gFalse;
- baseEnc = NULL;
- baseEncFromFontFile = gFalse;
- fontDict->lookup("Encoding", &obj1);
- if (obj1.isDict()) {
- obj1.dictLookup("BaseEncoding", &obj2);
- if (obj2.isName("MacRomanEncoding")) {
- hasEncoding = gTrue;
- usesMacRomanEnc = gTrue;
- baseEnc = macRomanEncoding;
- } else if (obj2.isName("MacExpertEncoding")) {
- hasEncoding = gTrue;
- baseEnc = macExpertEncoding;
- } else if (obj2.isName("WinAnsiEncoding")) {
- hasEncoding = gTrue;
- baseEnc = winAnsiEncoding;
- }
- obj2.free();
- } else if (obj1.isName("MacRomanEncoding")) {
- hasEncoding = gTrue;
- usesMacRomanEnc = gTrue;
- baseEnc = macRomanEncoding;
- } else if (obj1.isName("MacExpertEncoding")) {
- hasEncoding = gTrue;
- baseEnc = macExpertEncoding;
- } else if (obj1.isName("WinAnsiEncoding")) {
- hasEncoding = gTrue;
- baseEnc = winAnsiEncoding;
- }
-
- // check embedded or external font file for base encoding
- // (only for Type 1 fonts - trying to get an encoding out of a
- // TrueType font is a losing proposition)
- ffT1 = NULL;
- ffT1C = NULL;
- buf = NULL;
- if (type == fontType1 && (extFontFile || embFontID.num >= 0)) {
- if (extFontFile) {
- ffT1 = FoFiType1::load(extFontFile->getCString());
- } else {
- buf = readEmbFontFile(xref, &len);
- ffT1 = FoFiType1::make(buf, len);
- }
- if (ffT1) {
- if (ffT1->getName()) {
- if (embFontName) {
- delete embFontName;
- }
- embFontName = new GString(ffT1->getName());
- }
- if (!baseEnc) {
- baseEnc = ffT1->getEncoding();
- baseEncFromFontFile = gTrue;
- }
- }
- } else if (type == fontType1C && (extFontFile || embFontID.num >= 0)) {
- if (extFontFile) {
- ffT1C = FoFiType1C::load(extFontFile->getCString());
- } else {
- buf = readEmbFontFile(xref, &len);
- ffT1C = FoFiType1C::make(buf, len);
- }
- if (ffT1C) {
- if (ffT1C->getName()) {
- if (embFontName) {
- delete embFontName;
- }
- embFontName = new GString(ffT1C->getName());
- }
- if (!baseEnc) {
- baseEnc = ffT1C->getEncoding();
- baseEncFromFontFile = gTrue;
- }
- }
- }
- if (buf) {
- gfree(buf);
- }
-
- // get default base encoding
- if (!baseEnc) {
- if (builtinFont && embFontID.num < 0) {
- baseEnc = builtinFont->defaultBaseEnc;
- hasEncoding = gTrue;
- } else if (type == fontTrueType) {
- baseEnc = winAnsiEncoding;
- } else {
- baseEnc = standardEncoding;
- }
- }
-
- // copy the base encoding
- for (i = 0; i < 256; ++i) {
- enc[i] = baseEnc[i];
- if ((encFree[i] = baseEncFromFontFile) && enc[i]) {
- enc[i] = copyString(baseEnc[i]);
- }
- }
-
- // some Type 1C font files have empty encodings, which can break the
- // T1C->T1 conversion (since the 'seac' operator depends on having
- // the accents in the encoding), so we fill in any gaps from
- // StandardEncoding
- if (type == fontType1C && (extFontFile || embFontID.num >= 0) &&
- baseEncFromFontFile) {
- for (i = 0; i < 256; ++i) {
- if (!enc[i] && standardEncoding[i]) {
- enc[i] = standardEncoding[i];
- encFree[i] = gFalse;
- }
- }
- }
-
- // merge differences into encoding
- if (obj1.isDict()) {
- obj1.dictLookup("Differences", &obj2);
- if (obj2.isArray()) {
- hasEncoding = gTrue;
- code = 0;
- for (i = 0; i < obj2.arrayGetLength(); ++i) {
- obj2.arrayGet(i, &obj3);
- if (obj3.isInt()) {
- code = obj3.getInt();
- } else if (obj3.isName()) {
- if (code >= 0 && code < 256) {
- if (encFree[code]) {
- gfree(enc[code]);
- }
- enc[code] = copyString(obj3.getName());
- encFree[code] = gTrue;
- }
- ++code;
- } else {
- error(-1, "Wrong type in font encoding resource differences (%s)",
- obj3.getTypeName());
- }
- obj3.free();
- }
- }
- obj2.free();
- }
- obj1.free();
- if (ffT1) {
- delete ffT1;
- }
- if (ffT1C) {
- delete ffT1C;
- }
-
- //----- build the mapping to Unicode -----
-
- // pass 1: use the name-to-Unicode mapping table
- missing = hex = gFalse;
- for (code = 0; code < 256; ++code) {
- if ((charName = enc[code])) {
- if (!(toUnicode[code] = globalParams->mapNameToUnicode(charName)) &&
- strcmp(charName, ".notdef")) {
- // if it wasn't in the name-to-Unicode table, check for a
- // name that looks like 'Axx' or 'xx', where 'A' is any letter
- // and 'xx' is two hex digits
- if ((strlen(charName) == 3 &&
- isalpha(charName[0]) &&
- isxdigit(charName[1]) && isxdigit(charName[2]) &&
- ((charName[1] >= 'a' && charName[1] <= 'f') ||
- (charName[1] >= 'A' && charName[1] <= 'F') ||
- (charName[2] >= 'a' && charName[2] <= 'f') ||
- (charName[2] >= 'A' && charName[2] <= 'F'))) ||
- (strlen(charName) == 2 &&
- isxdigit(charName[0]) && isxdigit(charName[1]) &&
- ((charName[0] >= 'a' && charName[0] <= 'f') ||
- (charName[0] >= 'A' && charName[0] <= 'F') ||
- (charName[1] >= 'a' && charName[1] <= 'f') ||
- (charName[1] >= 'A' && charName[1] <= 'F')))) {
- hex = gTrue;
- }
- missing = gTrue;
- }
- } else {
- toUnicode[code] = 0;
- }
- }
-
- // pass 2: try to fill in the missing chars, looking for names of
- // the form 'Axx', 'xx', 'Ann', 'ABnn', or 'nn', where 'A' and 'B'
- // are any letters, 'xx' is two hex digits, and 'nn' is 2-4
- // decimal digits
- if (missing && globalParams->getMapNumericCharNames()) {
- for (code = 0; code < 256; ++code) {
- if ((charName = enc[code]) && !toUnicode[code] &&
- strcmp(charName, ".notdef")) {
- n = strlen(charName);
- code2 = -1;
- if (hex && n == 3 && isalpha(charName[0]) &&
- isxdigit(charName[1]) && isxdigit(charName[2])) {
- sscanf(charName+1, "%x", &code2);
- } else if (hex && n == 2 &&
- isxdigit(charName[0]) && isxdigit(charName[1])) {
- sscanf(charName, "%x", &code2);
- } else if (!hex && n >= 2 && n <= 4 &&
- isdigit(charName[0]) && isdigit(charName[1])) {
- code2 = atoi(charName);
- } else if (n >= 3 && n <= 5 &&
- isdigit(charName[1]) && isdigit(charName[2])) {
- code2 = atoi(charName+1);
- } else if (n >= 4 && n <= 6 &&
- isdigit(charName[2]) && isdigit(charName[3])) {
- code2 = atoi(charName+2);
- }
- if (code2 >= 0 && code2 <= 0xff) {
- toUnicode[code] = (Unicode)code2;
- }
- }
- }
-
- // if the 'mapUnknownCharNames' flag is set, do a simple pass-through
- // mapping for unknown character names
- } else if (missing && globalParams->getMapUnknownCharNames()) {
- for (code = 0; code < 256; ++code) {
- if (!toUnicode[code]) {
- toUnicode[code] = code;
- }
- }
- }
-
- // construct the char code -> Unicode mapping object
- ctu = CharCodeToUnicode::make8BitToUnicode(toUnicode);
-
- // merge in a ToUnicode CMap, if there is one -- this overwrites
- // existing entries in ctu, i.e., the ToUnicode CMap takes
- // precedence, but the other encoding info is allowed to fill in any
- // holes
- readToUnicodeCMap(fontDict, 8, ctu);
-
- // look for a Unicode-to-Unicode mapping
- if (name && (utu = globalParams->getUnicodeToUnicode(name))) {
- for (i = 0; i < 256; ++i) {
- toUnicode[i] = 0;
- }
- ctu2 = CharCodeToUnicode::make8BitToUnicode(toUnicode);
- for (i = 0; i < 256; ++i) {
- n = ctu->mapToUnicode((CharCode)i, uBuf, 8);
- if (n >= 1) {
- n = utu->mapToUnicode((CharCode)uBuf[0], uBuf, 8);
- if (n >= 1) {
- ctu2->setMapping((CharCode)i, uBuf, n);
- }
- }
- }
- utu->decRefCnt();
- delete ctu;
- ctu = ctu2;
- }
-
- //----- get the character widths -----
-
- // initialize all widths
- for (code = 0; code < 256; ++code) {
- widths[code] = missingWidth * 0.001;
- }
-
- // use widths from font dict, if present
- fontDict->lookup("FirstChar", &obj1);
- firstChar = obj1.isInt() ? obj1.getInt() : 0;
- obj1.free();
- if (firstChar < 0 || firstChar > 255) {
- firstChar = 0;
- }
- fontDict->lookup("LastChar", &obj1);
- lastChar = obj1.isInt() ? obj1.getInt() : 255;
- obj1.free();
- if (lastChar < 0 || lastChar > 255) {
- lastChar = 255;
- }
- mul = (type == fontType3) ? fontMat[0] : 0.001;
- fontDict->lookup("Widths", &obj1);
- if (obj1.isArray()) {
- flags |= fontFixedWidth;
- if (obj1.arrayGetLength() < lastChar - firstChar + 1) {
- lastChar = firstChar + obj1.arrayGetLength() - 1;
- }
- for (code = firstChar; code <= lastChar; ++code) {
- obj1.arrayGet(code - firstChar, &obj2);
- if (obj2.isNum()) {
- widths[code] = obj2.getNum() * mul;
- if (widths[code] != widths[firstChar]) {
- flags &= ~fontFixedWidth;
- }
- }
- obj2.free();
- }
-
- // use widths from built-in font
- } else if (builtinFont) {
- // this is a kludge for broken PDF files that encode char 32
- // as .notdef
- if (builtinFont->widths->getWidth("space", &w)) {
- widths[32] = 0.001 * w;
- }
- for (code = 0; code < 256; ++code) {
- if (enc[code] && builtinFont->widths->getWidth(enc[code], &w)) {
- widths[code] = 0.001 * w;
- }
- }
-
- // couldn't find widths -- use defaults
- } else {
- // this is technically an error -- the Widths entry is required
- // for all but the Base-14 fonts -- but certain PDF generators
- // apparently don't include widths for Arial and TimesNewRoman
- if (isFixedWidth()) {
- i = 0;
- } else if (isSerif()) {
- i = 8;
- } else {
- i = 4;
- }
- if (isBold()) {
- i += 2;
- }
- if (isItalic()) {
- i += 1;
- }
- builtinFont = builtinFontSubst[i];
- // this is a kludge for broken PDF files that encode char 32
- // as .notdef
- if (builtinFont->widths->getWidth("space", &w)) {
- widths[32] = 0.001 * w;
- }
- for (code = 0; code < 256; ++code) {
- if (enc[code] && builtinFont->widths->getWidth(enc[code], &w)) {
- widths[code] = 0.001 * w;
- }
- }
- }
- obj1.free();
-
- ok = gTrue;
-}
-
-Gfx8BitFont::~Gfx8BitFont() {
- int i;
-
- for (i = 0; i < 256; ++i) {
- if (encFree[i] && enc[i]) {
- gfree(enc[i]);
- }
- }
- ctu->decRefCnt();
- if (charProcs.isDict()) {
- charProcs.free();
- }
- if (resources.isDict()) {
- resources.free();
- }
-}
-
-int Gfx8BitFont::getNextChar(char *s, int /*len*/, CharCode *code,
- Unicode *u, int uSize, int *uLen,
- double *dx, double *dy, double *ox, double *oy) {
- CharCode c;
-
- *code = c = (CharCode)(*s & 0xff);
- *uLen = ctu->mapToUnicode(c, u, uSize);
- *dx = widths[c];
- *dy = *ox = *oy = 0;
- return 1;
-}
-
-CharCodeToUnicode *Gfx8BitFont::getToUnicode() {
- ctu->incRefCnt();
- return ctu;
-}
-
-Gushort *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) {
- Gushort *map;
- int cmapPlatform, cmapEncoding;
- int unicodeCmap, macRomanCmap, msSymbolCmap, cmap;
- GBool useMacRoman, useUnicode;
- char *charName;
- Unicode u;
- int code, i, n;
-
- map = (Gushort *)gmallocn(256, sizeof(Gushort));
- for (i = 0; i < 256; ++i) {
- map[i] = 0;
- }
-
- // To match up with the Adobe-defined behaviour, we choose a cmap
- // like this:
- // 1. If the PDF font has an encoding:
- // 1a. If the PDF font specified MacRomanEncoding and the
- // TrueType font has a Macintosh Roman cmap, use it, and
- // reverse map the char names through MacRomanEncoding to
- // get char codes.
- // 1b. If the TrueType font has a Microsoft Unicode cmap or a
- // non-Microsoft Unicode cmap, use it, and use the Unicode
- // indexes, not the char codes.
- // 1c. If the PDF font is symbolic and the TrueType font has a
- // Microsoft Symbol cmap, use it, and use char codes
- // directly (possibly with an offset of 0xf000).
- // 1d. If the TrueType font has a Macintosh Roman cmap, use it,
- // as in case 1a.
- // 2. If the PDF font does not have an encoding or the PDF font is
- // symbolic:
- // 2a. If the TrueType font has a Macintosh Roman cmap, use it,
- // and use char codes directly (possibly with an offset of
- // 0xf000).
- // 2b. If the TrueType font has a Microsoft Symbol cmap, use it,
- // and use char codes directly (possible with an offset of
- // 0xf000).
- // 3. If none of these rules apply, use the first cmap and hope for
- // the best (this shouldn't happen).
- unicodeCmap = macRomanCmap = msSymbolCmap = -1;
- for (i = 0; i < ff->getNumCmaps(); ++i) {
- cmapPlatform = ff->getCmapPlatform(i);
- cmapEncoding = ff->getCmapEncoding(i);
- if ((cmapPlatform == 3 && cmapEncoding == 1) ||
- cmapPlatform == 0) {
- unicodeCmap = i;
- } else if (cmapPlatform == 1 && cmapEncoding == 0) {
- macRomanCmap = i;
- } else if (cmapPlatform == 3 && cmapEncoding == 0) {
- msSymbolCmap = i;
- }
- }
- cmap = 0;
- useMacRoman = gFalse;
- useUnicode = gFalse;
- if (hasEncoding) {
- if (usesMacRomanEnc && macRomanCmap >= 0) {
- cmap = macRomanCmap;
- useMacRoman = gTrue;
- } else if (unicodeCmap >= 0) {
- cmap = unicodeCmap;
- useUnicode = gTrue;
- } else if ((flags & fontSymbolic) && msSymbolCmap >= 0) {
- cmap = msSymbolCmap;
- } else if ((flags & fontSymbolic) && macRomanCmap >= 0) {
- cmap = macRomanCmap;
- } else if (macRomanCmap >= 0) {
- cmap = macRomanCmap;
- useMacRoman = gTrue;
- }
- } else {
- if (msSymbolCmap >= 0) {
- cmap = msSymbolCmap;
- } else if (macRomanCmap >= 0) {
- cmap = macRomanCmap;
- }
- }
-
- // reverse map the char names through MacRomanEncoding, then map the
- // char codes through the cmap
- if (useMacRoman) {
- for (i = 0; i < 256; ++i) {
- if ((charName = enc[i])) {
- if ((code = globalParams->getMacRomanCharCode(charName))) {
- map[i] = ff->mapCodeToGID(cmap, code);
- }
- }
- }
-
- // map Unicode through the cmap
- } else if (useUnicode) {
- for (i = 0; i < 256; ++i) {
- if (((charName = enc[i]) &&
- (u = globalParams->mapNameToUnicode(charName))) ||
- (n = ctu->mapToUnicode((CharCode)i, &u, 1))) {
- map[i] = ff->mapCodeToGID(cmap, u);
- }
- }
-
- // map the char codes through the cmap, possibly with an offset of
- // 0xf000
- } else {
- for (i = 0; i < 256; ++i) {
- if (!(map[i] = ff->mapCodeToGID(cmap, i))) {
- map[i] = ff->mapCodeToGID(cmap, 0xf000 + i);
- }
- }
- }
-
- // try the TrueType 'post' table to handle any unmapped characters
- for (i = 0; i < 256; ++i) {
- if (!map[i] && (charName = enc[i])) {
- map[i] = (Gushort)(int)ff->mapNameToGID(charName);
- }
- }
-
- return map;
-}
-
-Dict *Gfx8BitFont::getCharProcs() {
- return charProcs.isDict() ? charProcs.getDict() : (Dict *)NULL;
-}
-
-Object *Gfx8BitFont::getCharProc(int code, Object *proc) {
- if (enc[code] && charProcs.isDict()) {
- charProcs.dictLookup(enc[code], proc);
- } else {
- proc->initNull();
- }
- return proc;
-}
-
-Dict *Gfx8BitFont::getResources() {
- return resources.isDict() ? resources.getDict() : (Dict *)NULL;
-}
-
-//------------------------------------------------------------------------
-// GfxCIDFont
-//------------------------------------------------------------------------
-
-static int CDECL cmpWidthExcep(const void *w1, const void *w2) {
- return ((GfxFontCIDWidthExcep *)w1)->first -
- ((GfxFontCIDWidthExcep *)w2)->first;
-}
-
-static int CDECL cmpWidthExcepV(const void *w1, const void *w2) {
- return ((GfxFontCIDWidthExcepV *)w1)->first -
- ((GfxFontCIDWidthExcepV *)w2)->first;
-}
-
-GfxCIDFont::GfxCIDFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
- Dict *fontDict):
- GfxFont(tagA, idA, nameA)
-{
- Dict *desFontDict;
- GString *collection, *cMapName;
- Object desFontDictObj;
- Object obj1, obj2, obj3, obj4, obj5, obj6;
- CharCodeToUnicode *utu;
- CharCode c;
- Unicode uBuf[8];
- int c1, c2;
- int excepsSize, i, j, k, n;
-
- ascent = 0.95;
- descent = -0.35;
- fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0;
- cMap = NULL;
- ctu = NULL;
- widths.defWidth = 1.0;
- widths.defHeight = -1.0;
- widths.defVY = 0.880;
- widths.exceps = NULL;
- widths.nExceps = 0;
- widths.excepsV = NULL;
- widths.nExcepsV = 0;
- cidToGID = NULL;
- cidToGIDLen = 0;
-
- // get the descendant font
- if (!fontDict->lookup("DescendantFonts", &obj1)->isArray()) {
- error(-1, "Missing DescendantFonts entry in Type 0 font");
- obj1.free();
- goto err1;
- }
- if (!obj1.arrayGet(0, &desFontDictObj)->isDict()) {
- error(-1, "Bad descendant font in Type 0 font");
- goto err3;
- }
- obj1.free();
- desFontDict = desFontDictObj.getDict();
-
- // font type
- if (!desFontDict->lookup("Subtype", &obj1)) {
- error(-1, "Missing Subtype entry in Type 0 descendant font");
- goto err3;
- }
- if (obj1.isName("CIDFontType0")) {
- type = fontCIDType0;
- } else if (obj1.isName("CIDFontType2")) {
- type = fontCIDType2;
- } else {
- error(-1, "Unknown Type 0 descendant font type '%s'",
- obj1.isName() ? obj1.getName() : "???");
- goto err3;
- }
- obj1.free();
-
- // get info from font descriptor
- readFontDescriptor(xref, desFontDict);
-
- // look for an external font file
- findExtFontFile();
-
- //----- encoding info -----
-
- // char collection
- if (!desFontDict->lookup("CIDSystemInfo", &obj1)->isDict()) {
- error(-1, "Missing CIDSystemInfo dictionary in Type 0 descendant font");
- goto err3;
- }
- obj1.dictLookup("Registry", &obj2);
- obj1.dictLookup("Ordering", &obj3);
- if (!obj2.isString() || !obj3.isString()) {
- error(-1, "Invalid CIDSystemInfo dictionary in Type 0 descendant font");
- goto err4;
- }
- collection = obj2.getString()->copy()->append('-')->append(obj3.getString());
- obj3.free();
- obj2.free();
- obj1.free();
-
- // look for a ToUnicode CMap
- if (!(ctu = readToUnicodeCMap(fontDict, 16, NULL))) {
-
- // the "Adobe-Identity" and "Adobe-UCS" collections don't have
- // cidToUnicode files
- if (collection->cmp("Adobe-Identity") &&
- collection->cmp("Adobe-UCS")) {
-
- // look for a user-supplied .cidToUnicode file
- if (!(ctu = globalParams->getCIDToUnicode(collection))) {
- error(-1, "Unknown character collection '%s'",
- collection->getCString());
- // fall-through, assuming the Identity mapping -- this appears
- // to match Adobe's behavior
- }
- }
- }
-
- // look for a Unicode-to-Unicode mapping
- if (name && (utu = globalParams->getUnicodeToUnicode(name))) {
- if (ctu) {
- for (c = 0; c < ctu->getLength(); ++c) {
- n = ctu->mapToUnicode(c, uBuf, 8);
- if (n >= 1) {
- n = utu->mapToUnicode((CharCode)uBuf[0], uBuf, 8);
- if (n >= 1) {
- ctu->setMapping(c, uBuf, n);
- }
- }
- }
- utu->decRefCnt();
- } else {
- ctu = utu;
- }
- }
-
- // encoding (i.e., CMap)
- //~ need to handle a CMap stream here
- //~ also need to deal with the UseCMap entry in the stream dict
- if (!fontDict->lookup("Encoding", &obj1)->isName()) {
- error(-1, "Missing or invalid Encoding entry in Type 0 font");
- delete collection;
- goto err3;
- }
- cMapName = new GString(obj1.getName());
- obj1.free();
- if (!(cMap = globalParams->getCMap(collection, cMapName))) {
- error(-1, "Unknown CMap '%s' for character collection '%s'",
- cMapName->getCString(), collection->getCString());
- delete collection;
- delete cMapName;
- goto err2;
- }
- delete collection;
- delete cMapName;
-
- // CIDToGIDMap (for embedded TrueType fonts)
- if (type == fontCIDType2) {
- desFontDict->lookup("CIDToGIDMap", &obj1);
- if (obj1.isStream()) {
- cidToGIDLen = 0;
- i = 64;
- cidToGID = (Gushort *)gmallocn(i, sizeof(Gushort));
- obj1.streamReset();
- while ((c1 = obj1.streamGetChar()) != EOF &&
- (c2 = obj1.streamGetChar()) != EOF) {
- if (cidToGIDLen == i) {
- i *= 2;
- cidToGID = (Gushort *)greallocn(cidToGID, i, sizeof(Gushort));
- }
- cidToGID[cidToGIDLen++] = (Gushort)((c1 << 8) + c2);
- }
- } else if (!obj1.isName("Identity") && !obj1.isNull()) {
- error(-1, "Invalid CIDToGIDMap entry in CID font");
- }
- obj1.free();
- }
-
- //----- character metrics -----
-
- // default char width
- if (desFontDict->lookup("DW", &obj1)->isInt()) {
- widths.defWidth = obj1.getInt() * 0.001;
- }
- obj1.free();
-
- // char width exceptions
- if (desFontDict->lookup("W", &obj1)->isArray()) {
- excepsSize = 0;
- i = 0;
- while (i + 1 < obj1.arrayGetLength()) {
- obj1.arrayGet(i, &obj2);
- obj1.arrayGet(i + 1, &obj3);
- if (obj2.isInt() && obj3.isInt() && i + 2 < obj1.arrayGetLength()) {
- if (obj1.arrayGet(i + 2, &obj4)->isNum()) {
- if (widths.nExceps == excepsSize) {
- excepsSize += 16;
- widths.exceps = (GfxFontCIDWidthExcep *)
- greallocn(widths.exceps,
- excepsSize, sizeof(GfxFontCIDWidthExcep));
- }
- widths.exceps[widths.nExceps].first = obj2.getInt();
- widths.exceps[widths.nExceps].last = obj3.getInt();
- widths.exceps[widths.nExceps].width = obj4.getNum() * 0.001;
- ++widths.nExceps;
- } else {
- error(-1, "Bad widths array in Type 0 font");
- }
- obj4.free();
- i += 3;
- } else if (obj2.isInt() && obj3.isArray()) {
- if (widths.nExceps + obj3.arrayGetLength() > excepsSize) {
- excepsSize = (widths.nExceps + obj3.arrayGetLength() + 15) & ~15;
- widths.exceps = (GfxFontCIDWidthExcep *)
- greallocn(widths.exceps,
- excepsSize, sizeof(GfxFontCIDWidthExcep));
- }
- j = obj2.getInt();
- for (k = 0; k < obj3.arrayGetLength(); ++k) {
- if (obj3.arrayGet(k, &obj4)->isNum()) {
- widths.exceps[widths.nExceps].first = j;
- widths.exceps[widths.nExceps].last = j;
- widths.exceps[widths.nExceps].width = obj4.getNum() * 0.001;
- ++j;
- ++widths.nExceps;
- } else {
- error(-1, "Bad widths array in Type 0 font");
- }
- obj4.free();
- }
- i += 2;
- } else {
- error(-1, "Bad widths array in Type 0 font");
- ++i;
- }
- obj3.free();
- obj2.free();
- }
- qsort(widths.exceps, widths.nExceps, sizeof(GfxFontCIDWidthExcep),
- &cmpWidthExcep);
- }
- obj1.free();
-
- // default metrics for vertical font
- if (desFontDict->lookup("DW2", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2) {
- if (obj1.arrayGet(0, &obj2)->isNum()) {
- widths.defVY = obj2.getNum() * 0.001;
- }
- obj2.free();
- if (obj1.arrayGet(1, &obj2)->isNum()) {
- widths.defHeight = obj2.getNum() * 0.001;
- }
- obj2.free();
- }
- obj1.free();
-
- // char metric exceptions for vertical font
- if (desFontDict->lookup("W2", &obj1)->isArray()) {
- excepsSize = 0;
- i = 0;
- while (i + 1 < obj1.arrayGetLength()) {
- obj1.arrayGet(i, &obj2);
- obj1.arrayGet(i+ 1, &obj3);
- if (obj2.isInt() && obj3.isInt() && i + 4 < obj1.arrayGetLength()) {
- if (obj1.arrayGet(i + 2, &obj4)->isNum() &&
- obj1.arrayGet(i + 3, &obj5)->isNum() &&
- obj1.arrayGet(i + 4, &obj6)->isNum()) {
- if (widths.nExcepsV == excepsSize) {
- excepsSize += 16;
- widths.excepsV = (GfxFontCIDWidthExcepV *)
- greallocn(widths.excepsV,
- excepsSize, sizeof(GfxFontCIDWidthExcepV));
- }
- widths.excepsV[widths.nExcepsV].first = obj2.getInt();
- widths.excepsV[widths.nExcepsV].last = obj3.getInt();
- widths.excepsV[widths.nExcepsV].height = obj4.getNum() * 0.001;
- widths.excepsV[widths.nExcepsV].vx = obj5.getNum() * 0.001;
- widths.excepsV[widths.nExcepsV].vy = obj6.getNum() * 0.001;
- ++widths.nExcepsV;
- } else {
- error(-1, "Bad widths (W2) array in Type 0 font");
- }
- obj6.free();
- obj5.free();
- obj4.free();
- i += 5;
- } else if (obj2.isInt() && obj3.isArray()) {
- if (widths.nExcepsV + obj3.arrayGetLength() / 3 > excepsSize) {
- excepsSize =
- (widths.nExcepsV + obj3.arrayGetLength() / 3 + 15) & ~15;
- widths.excepsV = (GfxFontCIDWidthExcepV *)
- greallocn(widths.excepsV,
- excepsSize, sizeof(GfxFontCIDWidthExcepV));
- }
- j = obj2.getInt();
- for (k = 0; k < obj3.arrayGetLength(); k += 3) {
- if (obj3.arrayGet(k, &obj4)->isNum() &&
- obj3.arrayGet(k+1, &obj5)->isNum() &&
- obj3.arrayGet(k+2, &obj6)->isNum()) {
- widths.excepsV[widths.nExceps].first = j;
- widths.excepsV[widths.nExceps].last = j;
- widths.excepsV[widths.nExceps].height = obj4.getNum() * 0.001;
- widths.excepsV[widths.nExceps].vx = obj5.getNum() * 0.001;
- widths.excepsV[widths.nExceps].vy = obj6.getNum() * 0.001;
- ++j;
- ++widths.nExcepsV;
- } else {
- error(-1, "Bad widths (W2) array in Type 0 font");
- }
- obj6.free();
- obj5.free();
- obj4.free();
- }
- i += 2;
- } else {
- error(-1, "Bad widths (W2) array in Type 0 font");
- ++i;
- }
- obj3.free();
- obj2.free();
- }
- qsort(widths.excepsV, widths.nExcepsV, sizeof(GfxFontCIDWidthExcepV),
- &cmpWidthExcepV);
- }
- obj1.free();
-
- desFontDictObj.free();
- ok = gTrue;
- return;
-
- err4:
- obj3.free();
- obj2.free();
- err3:
- obj1.free();
- err2:
- desFontDictObj.free();
- err1:;
-}
-
-GfxCIDFont::~GfxCIDFont() {
- if (cMap) {
- cMap->decRefCnt();
- }
- if (ctu) {
- ctu->decRefCnt();
- }
- gfree(widths.exceps);
- gfree(widths.excepsV);
- if (cidToGID) {
- gfree(cidToGID);
- }
-}
-
-int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
- Unicode *u, int uSize, int *uLen,
- double *dx, double *dy, double *ox, double *oy) {
- CID cid;
- double w, h, vx, vy;
- int n, a, b, m;
-
- if (!cMap) {
- *code = 0;
- *uLen = 0;
- *dx = *dy = 0;
- return 1;
- }
-
- *code = (CharCode)(cid = cMap->getCID(s, len, &n));
- if (ctu) {
- *uLen = ctu->mapToUnicode(cid, u, uSize);
- } else {
- *uLen = 0;
- }
-
- // horizontal
- if (cMap->getWMode() == 0) {
- w = widths.defWidth;
- h = vx = vy = 0;
- if (widths.nExceps > 0 && cid >= widths.exceps[0].first) {
- a = 0;
- b = widths.nExceps;
- // invariant: widths.exceps[a].first <= cid < widths.exceps[b].first
- while (b - a > 1) {
- m = (a + b) / 2;
- if (widths.exceps[m].first <= cid) {
- a = m;
- } else {
- b = m;
- }
- }
- if (cid <= widths.exceps[a].last) {
- w = widths.exceps[a].width;
- }
- }
-
- // vertical
- } else {
- w = 0;
- h = widths.defHeight;
- vx = widths.defWidth / 2;
- vy = widths.defVY;
- if (widths.nExcepsV > 0 && cid >= widths.excepsV[0].first) {
- a = 0;
- b = widths.nExcepsV;
- // invariant: widths.excepsV[a].first <= cid < widths.excepsV[b].first
- while (b - a > 1) {
- m = (a + b) / 2;
- if (widths.excepsV[m].last <= cid) {
- a = m;
- } else {
- b = m;
- }
- }
- if (cid <= widths.excepsV[a].last) {
- h = widths.excepsV[a].height;
- vx = widths.excepsV[a].vx;
- vy = widths.excepsV[a].vy;
- }
- }
- }
-
- *dx = w;
- *dy = h;
- *ox = vx;
- *oy = vy;
-
- return n;
-}
-
-int GfxCIDFont::getWMode() {
- return cMap ? cMap->getWMode() : 0;
-}
-
-CharCodeToUnicode *GfxCIDFont::getToUnicode() {
- if (ctu) {
- ctu->incRefCnt();
- }
- return ctu;
-}
-
-GString *GfxCIDFont::getCollection() {
- return cMap ? cMap->getCollection() : (GString *)NULL;
-}
-
-Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
- Gushort *map;
- int cmapPlatform, cmapEncoding;
- int /*unicodeCmap, macRomanCmap, msSymbolCmap, */cmap;
-// GBool useMacRoman, useUnicode;
-// char *charName;
- Unicode u;
- int /*code, */i;
- int mapsize;
- int cidlen;
-
- *mapsizep = 0;
- if (!ctu) return NULL;
-
- /* we use only unicode cmap */
- cmap = -1;
- for (i = 0; i < ff->getNumCmaps(); ++i) {
- cmapPlatform = ff->getCmapPlatform(i);
- cmapEncoding = ff->getCmapEncoding(i);
- if ((cmapPlatform == 3 && cmapEncoding == 1) || cmapPlatform == 0)
- cmap = i;
- }
- if (cmap < 0)
- return NULL;
-
- cidlen = 0;
- mapsize = 64;
- map = (Gushort *)gmalloc(mapsize * sizeof(Gushort));
-
- while (cidlen < ctu->getLength()) {
- int n;
- if ((n = ctu->mapToUnicode((CharCode)cidlen, &u, 1)) == 0) {
- cidlen++;
- continue;
- }
- if (cidlen >= mapsize) {
- while (cidlen >= mapsize)
- mapsize *= 2;
- map = (Gushort *)grealloc(map, mapsize * sizeof(Gushort));
- }
- map[cidlen] = ff->mapCodeToGID(cmap, u);
- cidlen++;
- }
-
- *mapsizep = cidlen;
- return map;
-}
-
-//------------------------------------------------------------------------
-// GfxFontDict
-//------------------------------------------------------------------------
-
-GfxFontDict::GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict) {
- int i;
- Object obj1, obj2;
- Ref r;
-
- numFonts = fontDict->getLength();
- fonts = (GfxFont **)gmallocn(numFonts, sizeof(GfxFont *));
- for (i = 0; i < numFonts; ++i) {
- fontDict->getValNF(i, &obj1);
- obj1.fetch(xref, &obj2);
- if (obj2.isDict()) {
- if (obj1.isRef()) {
- r = obj1.getRef();
- } else {
- // no indirect reference for this font, so invent a unique one
- // (legal generation numbers are five digits, so any 6-digit
- // number would be safe)
- r.num = i;
- if (fontDictRef) {
- r.gen = 100000 + fontDictRef->num;
- } else {
- r.gen = 999999;
- }
- }
- fonts[i] = GfxFont::makeFont(xref, fontDict->getKey(i),
- r, obj2.getDict());
- if (fonts[i] && !fonts[i]->isOk()) {
- delete fonts[i];
- fonts[i] = NULL;
- }
- } else {
- error(-1, "font resource is not a dictionary");
- fonts[i] = NULL;
- }
- obj1.free();
- obj2.free();
- }
-}
-
-GfxFontDict::~GfxFontDict() {
- int i;
-
- for (i = 0; i < numFonts; ++i) {
- if (fonts[i]) {
- delete fonts[i];
- }
- }
- gfree(fonts);
-}
-
-GfxFont *GfxFontDict::lookup(char *tag) {
- int i;
-
- for (i = 0; i < numFonts; ++i) {
- if (fonts[i] && fonts[i]->matches(tag)) {
- return fonts[i];
- }
- }
- return NULL;
-}
diff --git a/kpdf/xpdf/xpdf/GfxFont.cpp b/kpdf/xpdf/xpdf/GfxFont.cpp
new file mode 100644
index 00000000..4298b41c
--- /dev/null
+++ b/kpdf/xpdf/xpdf/GfxFont.cpp
@@ -0,0 +1,1616 @@
+//========================================================================
+//
+// GfxFont.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "Error.h"
+#include "Object.h"
+#include "Dict.h"
+#include "GlobalParams.h"
+#include "CMap.h"
+#include "CharCodeToUnicode.h"
+#include "FontEncodingTables.h"
+#include "BuiltinFontTables.h"
+#include "FoFiType1.h"
+#include "FoFiType1C.h"
+#include "FoFiTrueType.h"
+#include "GfxFont.h"
+
+//------------------------------------------------------------------------
+
+struct StdFontMapEntry {
+ char *altName;
+ char *properName;
+};
+
+// Acrobat 4.0 and earlier substituted Base14-compatible fonts without
+// providing Widths and a FontDescriptor, so we munge the names into
+// the proper Base14 names. This table is from implementation note 44
+// in the PDF 1.4 spec, with some additions based on empirical
+// evidence.
+static StdFontMapEntry stdFontMap[] = {
+ { "Arial", "Helvetica" },
+ { "Arial,Bold", "Helvetica-Bold" },
+ { "Arial,BoldItalic", "Helvetica-BoldOblique" },
+ { "Arial,Italic", "Helvetica-Oblique" },
+ { "Arial-Bold", "Helvetica-Bold" },
+ { "Arial-BoldItalic", "Helvetica-BoldOblique" },
+ { "Arial-BoldItalicMT", "Helvetica-BoldOblique" },
+ { "Arial-BoldMT", "Helvetica-Bold" },
+ { "Arial-Italic", "Helvetica-Oblique" },
+ { "Arial-ItalicMT", "Helvetica-Oblique" },
+ { "ArialMT", "Helvetica" },
+ { "Courier,Bold", "Courier-Bold" },
+ { "Courier,BoldItalic", "Courier-BoldOblique" },
+ { "Courier,Italic", "Courier-Oblique" },
+ { "CourierNew", "Courier" },
+ { "CourierNew,Bold", "Courier-Bold" },
+ { "CourierNew,BoldItalic", "Courier-BoldOblique" },
+ { "CourierNew,Italic", "Courier-Oblique" },
+ { "CourierNew-Bold", "Courier-Bold" },
+ { "CourierNew-BoldItalic", "Courier-BoldOblique" },
+ { "CourierNew-Italic", "Courier-Oblique" },
+ { "CourierNewPS-BoldItalicMT", "Courier-BoldOblique" },
+ { "CourierNewPS-BoldMT", "Courier-Bold" },
+ { "CourierNewPS-ItalicMT", "Courier-Oblique" },
+ { "CourierNewPSMT", "Courier" },
+ { "Helvetica,Bold", "Helvetica-Bold" },
+ { "Helvetica,BoldItalic", "Helvetica-BoldOblique" },
+ { "Helvetica,Italic", "Helvetica-Oblique" },
+ { "Helvetica-BoldItalic", "Helvetica-BoldOblique" },
+ { "Helvetica-Italic", "Helvetica-Oblique" },
+ { "Symbol,Bold", "Symbol" },
+ { "Symbol,BoldItalic", "Symbol" },
+ { "Symbol,Italic", "Symbol" },
+ { "TimesNewRoman", "Times-Roman" },
+ { "TimesNewRoman,Bold", "Times-Bold" },
+ { "TimesNewRoman,BoldItalic", "Times-BoldItalic" },
+ { "TimesNewRoman,Italic", "Times-Italic" },
+ { "TimesNewRoman-Bold", "Times-Bold" },
+ { "TimesNewRoman-BoldItalic", "Times-BoldItalic" },
+ { "TimesNewRoman-Italic", "Times-Italic" },
+ { "TimesNewRomanPS", "Times-Roman" },
+ { "TimesNewRomanPS-Bold", "Times-Bold" },
+ { "TimesNewRomanPS-BoldItalic", "Times-BoldItalic" },
+ { "TimesNewRomanPS-BoldItalicMT", "Times-BoldItalic" },
+ { "TimesNewRomanPS-BoldMT", "Times-Bold" },
+ { "TimesNewRomanPS-Italic", "Times-Italic" },
+ { "TimesNewRomanPS-ItalicMT", "Times-Italic" },
+ { "TimesNewRomanPSMT", "Times-Roman" },
+ { "TimesNewRomanPSMT,Bold", "Times-Bold" },
+ { "TimesNewRomanPSMT,BoldItalic", "Times-BoldItalic" },
+ { "TimesNewRomanPSMT,Italic", "Times-Italic" }
+};
+
+//------------------------------------------------------------------------
+// GfxFont
+//------------------------------------------------------------------------
+
+GfxFont *GfxFont::makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict) {
+ GString *nameA;
+ GfxFont *font;
+ Object obj1;
+
+ // get base font name
+ nameA = NULL;
+ fontDict->lookup("BaseFont", &obj1);
+ if (obj1.isName()) {
+ nameA = new GString(obj1.getName());
+ }
+ obj1.free();
+
+ // get font type
+ font = NULL;
+ fontDict->lookup("Subtype", &obj1);
+ if (obj1.isName("Type1") || obj1.isName("MMType1")) {
+ font = new Gfx8BitFont(xref, tagA, idA, nameA, fontType1, fontDict);
+ } else if (obj1.isName("Type1C")) {
+ font = new Gfx8BitFont(xref, tagA, idA, nameA, fontType1C, fontDict);
+ } else if (obj1.isName("Type3")) {
+ font = new Gfx8BitFont(xref, tagA, idA, nameA, fontType3, fontDict);
+ } else if (obj1.isName("TrueType")) {
+ font = new Gfx8BitFont(xref, tagA, idA, nameA, fontTrueType, fontDict);
+ } else if (obj1.isName("Type0")) {
+ font = new GfxCIDFont(xref, tagA, idA, nameA, fontDict);
+ } else {
+ error(-1, "Unknown font type: '%s'",
+ obj1.isName() ? obj1.getName() : "???");
+ font = new Gfx8BitFont(xref, tagA, idA, nameA, fontUnknownType, fontDict);
+ }
+ obj1.free();
+
+ return font;
+}
+
+GfxFont::GfxFont(char *tagA, Ref idA, GString *nameA) {
+ ok = gFalse;
+ tag = new GString(tagA);
+ id = idA;
+ name = nameA;
+ origName = nameA;
+ embFontName = NULL;
+ extFontFile = NULL;
+}
+
+GfxFont::~GfxFont() {
+ delete tag;
+ if (origName && origName != name) {
+ delete origName;
+ }
+ if (name) {
+ delete name;
+ }
+ if (embFontName) {
+ delete embFontName;
+ }
+ if (extFontFile) {
+ delete extFontFile;
+ }
+}
+
+void GfxFont::readFontDescriptor(XRef *xref, Dict *fontDict) {
+ Object obj1, obj2, obj3, obj4;
+ double t;
+ int i;
+
+ // assume Times-Roman by default (for substitution purposes)
+ flags = fontSerif;
+
+ embFontID.num = -1;
+ embFontID.gen = -1;
+ missingWidth = 0;
+
+ if (fontDict->lookup("FontDescriptor", &obj1)->isDict()) {
+
+ // get flags
+ if (obj1.dictLookup("Flags", &obj2)->isInt()) {
+ flags = obj2.getInt();
+ }
+ obj2.free();
+
+ // get name
+ obj1.dictLookup("FontName", &obj2);
+ if (obj2.isName()) {
+ embFontName = new GString(obj2.getName());
+ }
+ obj2.free();
+
+ // look for embedded font file
+ if (obj1.dictLookupNF("FontFile", &obj2)->isRef()) {
+ embFontID = obj2.getRef();
+ if (type != fontType1) {
+ error(-1, "Mismatch between font type and embedded font file");
+ type = fontType1;
+ }
+ }
+ obj2.free();
+ if (embFontID.num == -1 &&
+ obj1.dictLookupNF("FontFile2", &obj2)->isRef()) {
+ embFontID = obj2.getRef();
+ if (type != fontTrueType && type != fontCIDType2) {
+ error(-1, "Mismatch between font type and embedded font file");
+ type = type == fontCIDType0 ? fontCIDType2 : fontTrueType;
+ }
+ }
+ obj2.free();
+ if (embFontID.num == -1 &&
+ obj1.dictLookupNF("FontFile3", &obj2)->isRef()) {
+ if (obj2.fetch(xref, &obj3)->isStream()) {
+ obj3.streamGetDict()->lookup("Subtype", &obj4);
+ if (obj4.isName("Type1")) {
+ embFontID = obj2.getRef();
+ if (type != fontType1) {
+ error(-1, "Mismatch between font type and embedded font file");
+ type = fontType1;
+ }
+ } else if (obj4.isName("Type1C")) {
+ embFontID = obj2.getRef();
+ if (type != fontType1 && type != fontType1C) {
+ error(-1, "Mismatch between font type and embedded font file");
+ }
+ type = fontType1C;
+ } else if (obj4.isName("TrueType")) {
+ embFontID = obj2.getRef();
+ if (type != fontTrueType) {
+ error(-1, "Mismatch between font type and embedded font file");
+ type = fontTrueType;
+ }
+ } else if (obj4.isName("CIDFontType0C")) {
+ embFontID = obj2.getRef();
+ if (type != fontCIDType0) {
+ error(-1, "Mismatch between font type and embedded font file");
+ }
+ type = fontCIDType0C;
+ } else if (obj4.isName("OpenType")) {
+ embFontID = obj2.getRef();
+ if (type == fontTrueType) {
+ type = fontTrueTypeOT;
+ } else if (type == fontType1) {
+ type = fontType1COT;
+ } else if (type == fontCIDType0) {
+ type = fontCIDType0COT;
+ } else if (type == fontCIDType2) {
+ type = fontCIDType2OT;
+ } else {
+ error(-1, "Mismatch between font type and embedded font file");
+ }
+ } else {
+ error(-1, "Unknown embedded font type '%s'",
+ obj4.isName() ? obj4.getName() : "???");
+ }
+ obj4.free();
+ }
+ obj3.free();
+ }
+ obj2.free();
+
+ // look for MissingWidth
+ obj1.dictLookup("MissingWidth", &obj2);
+ if (obj2.isNum()) {
+ missingWidth = obj2.getNum();
+ }
+ obj2.free();
+
+ // get Ascent and Descent
+ obj1.dictLookup("Ascent", &obj2);
+ if (obj2.isNum()) {
+ t = 0.001 * obj2.getNum();
+ // some broken font descriptors set ascent and descent to 0
+ if (t != 0) {
+ ascent = t;
+ }
+ }
+ obj2.free();
+ obj1.dictLookup("Descent", &obj2);
+ if (obj2.isNum()) {
+ t = 0.001 * obj2.getNum();
+ // some broken font descriptors set ascent and descent to 0
+ if (t != 0) {
+ descent = t;
+ }
+ // some broken font descriptors specify a positive descent
+ if (descent > 0) {
+ descent = -descent;
+ }
+ }
+ obj2.free();
+
+ // font FontBBox
+ if (obj1.dictLookup("FontBBox", &obj2)->isArray()) {
+ for (i = 0; i < 4 && i < obj2.arrayGetLength(); ++i) {
+ if (obj2.arrayGet(i, &obj3)->isNum()) {
+ fontBBox[i] = 0.001 * obj3.getNum();
+ }
+ obj3.free();
+ }
+ }
+ obj2.free();
+
+ }
+ obj1.free();
+}
+
+CharCodeToUnicode *GfxFont::readToUnicodeCMap(Dict *fontDict, int nBits,
+ CharCodeToUnicode *ctu) {
+ GString *buf;
+ Object obj1;
+ int c;
+
+ if (!fontDict->lookup("ToUnicode", &obj1)->isStream()) {
+ obj1.free();
+ return NULL;
+ }
+ buf = new GString();
+ obj1.streamReset();
+ while ((c = obj1.streamGetChar()) != EOF) {
+ buf->append(c);
+ }
+ obj1.streamClose();
+ obj1.free();
+ if (ctu) {
+ ctu->mergeCMap(buf, nBits);
+ } else {
+ ctu = CharCodeToUnicode::parseCMap(buf, nBits);
+ }
+ delete buf;
+ return ctu;
+}
+
+void GfxFont::findExtFontFile() {
+ static char *type1Exts[] = { ".pfa", ".pfb", ".ps", "", NULL };
+ static char *ttExts[] = { ".ttf", ".ttc", NULL };
+
+ if (name) {
+ if (type == fontType1) {
+ extFontFile = globalParams->findFontFile(name, type1Exts);
+ } else if (type == fontTrueType) {
+ extFontFile = globalParams->findFontFile(name, ttExts);
+ }
+ }
+}
+
+char *GfxFont::readExtFontFile(int *len) {
+ FILE *f;
+ char *buf;
+
+ if (!(f = fopen(extFontFile->getCString(), "rb"))) {
+ error(-1, "External font file '%s' vanished", extFontFile->getCString());
+ return NULL;
+ }
+ fseek(f, 0, SEEK_END);
+ *len = (int)ftell(f);
+ fseek(f, 0, SEEK_SET);
+ buf = (char *)gmalloc(*len);
+ if ((int)fread(buf, 1, *len, f) != *len) {
+ error(-1, "Error reading external font file '%s'",
+ extFontFile->getCString());
+ }
+ fclose(f);
+ return buf;
+}
+
+char *GfxFont::readEmbFontFile(XRef *xref, int *len) {
+ char *buf;
+ Object obj1, obj2;
+ Stream *str;
+ int c;
+ int size, i;
+
+ obj1.initRef(embFontID.num, embFontID.gen);
+ obj1.fetch(xref, &obj2);
+ if (!obj2.isStream()) {
+ error(-1, "Embedded font file is not a stream");
+ obj2.free();
+ obj1.free();
+ embFontID.num = -1;
+ return NULL;
+ }
+ str = obj2.getStream();
+
+ buf = NULL;
+ i = size = 0;
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ if (i == size) {
+ size += 4096;
+ buf = (char *)grealloc(buf, size);
+ }
+ buf[i++] = c;
+ }
+ *len = i;
+ str->close();
+
+ obj2.free();
+ obj1.free();
+
+ return buf;
+}
+
+//------------------------------------------------------------------------
+// Gfx8BitFont
+//------------------------------------------------------------------------
+
+Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
+ GfxFontType typeA, Dict *fontDict):
+ GfxFont(tagA, idA, nameA)
+{
+ GString *name2;
+ BuiltinFont *builtinFont;
+ char **baseEnc;
+ GBool baseEncFromFontFile;
+ char *buf;
+ int len;
+ FoFiType1 *ffT1;
+ FoFiType1C *ffT1C;
+ int code, code2;
+ char *charName;
+ GBool missing, hex;
+ Unicode toUnicode[256];
+ CharCodeToUnicode *utu, *ctu2;
+ Unicode uBuf[8];
+ double mul;
+ int firstChar, lastChar;
+ Gushort w;
+ Object obj1, obj2, obj3;
+ int n, i, a, b, m;
+
+ type = typeA;
+ ctu = NULL;
+
+ // do font name substitution for various aliases of the Base 14 font
+ // names
+ if (name) {
+ name2 = name->copy();
+ i = 0;
+ while (i < name2->getLength()) {
+ if (name2->getChar(i) == ' ') {
+ name2->del(i);
+ } else {
+ ++i;
+ }
+ }
+ a = 0;
+ b = sizeof(stdFontMap) / sizeof(StdFontMapEntry);
+ // invariant: stdFontMap[a].altName <= name2 < stdFontMap[b].altName
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (name2->cmp(stdFontMap[m].altName) >= 0) {
+ a = m;
+ } else {
+ b = m;
+ }
+ }
+ if (!name2->cmp(stdFontMap[a].altName)) {
+ name = new GString(stdFontMap[a].properName);
+ }
+ delete name2;
+ }
+
+ // is it a built-in font?
+ builtinFont = NULL;
+ if (name) {
+ for (i = 0; i < nBuiltinFonts; ++i) {
+ if (!name->cmp(builtinFonts[i].name)) {
+ builtinFont = &builtinFonts[i];
+ break;
+ }
+ }
+ }
+
+ // default ascent/descent values
+ if (builtinFont) {
+ ascent = 0.001 * builtinFont->ascent;
+ descent = 0.001 * builtinFont->descent;
+ fontBBox[0] = 0.001 * builtinFont->bbox[0];
+ fontBBox[1] = 0.001 * builtinFont->bbox[1];
+ fontBBox[2] = 0.001 * builtinFont->bbox[2];
+ fontBBox[3] = 0.001 * builtinFont->bbox[3];
+ } else {
+ ascent = 0.95;
+ descent = -0.35;
+ fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0;
+ }
+
+ // get info from font descriptor
+ readFontDescriptor(xref, fontDict);
+
+ // for non-embedded fonts, don't trust the ascent/descent/bbox
+ // values from the font descriptor
+ if (builtinFont && embFontID.num < 0) {
+ ascent = 0.001 * builtinFont->ascent;
+ descent = 0.001 * builtinFont->descent;
+ fontBBox[0] = 0.001 * builtinFont->bbox[0];
+ fontBBox[1] = 0.001 * builtinFont->bbox[1];
+ fontBBox[2] = 0.001 * builtinFont->bbox[2];
+ fontBBox[3] = 0.001 * builtinFont->bbox[3];
+ }
+
+ // look for an external font file
+ findExtFontFile();
+
+ // get font matrix
+ fontMat[0] = fontMat[3] = 1;
+ fontMat[1] = fontMat[2] = fontMat[4] = fontMat[5] = 0;
+ if (fontDict->lookup("FontMatrix", &obj1)->isArray()) {
+ for (i = 0; i < 6 && i < obj1.arrayGetLength(); ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ fontMat[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ }
+ obj1.free();
+
+ // get Type 3 bounding box, font definition, and resources
+ if (type == fontType3) {
+ if (fontDict->lookup("FontBBox", &obj1)->isArray()) {
+ for (i = 0; i < 4 && i < obj1.arrayGetLength(); ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ fontBBox[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ }
+ obj1.free();
+ if (!fontDict->lookup("CharProcs", &charProcs)->isDict()) {
+ error(-1, "Missing or invalid CharProcs dictionary in Type 3 font");
+ charProcs.free();
+ }
+ if (!fontDict->lookup("Resources", &resources)->isDict()) {
+ resources.free();
+ }
+ }
+
+ //----- build the font encoding -----
+
+ // Encodings start with a base encoding, which can come from
+ // (in order of priority):
+ // 1. FontDict.Encoding or FontDict.Encoding.BaseEncoding
+ // - MacRoman / MacExpert / WinAnsi / Standard
+ // 2. embedded or external font file
+ // 3. default:
+ // - builtin --> builtin encoding
+ // - TrueType --> WinAnsiEncoding
+ // - others --> StandardEncoding
+ // and then add a list of differences (if any) from
+ // FontDict.Encoding.Differences.
+
+ // check FontDict for base encoding
+ hasEncoding = gFalse;
+ usesMacRomanEnc = gFalse;
+ baseEnc = NULL;
+ baseEncFromFontFile = gFalse;
+ fontDict->lookup("Encoding", &obj1);
+ if (obj1.isDict()) {
+ obj1.dictLookup("BaseEncoding", &obj2);
+ if (obj2.isName("MacRomanEncoding")) {
+ hasEncoding = gTrue;
+ usesMacRomanEnc = gTrue;
+ baseEnc = macRomanEncoding;
+ } else if (obj2.isName("MacExpertEncoding")) {
+ hasEncoding = gTrue;
+ baseEnc = macExpertEncoding;
+ } else if (obj2.isName("WinAnsiEncoding")) {
+ hasEncoding = gTrue;
+ baseEnc = winAnsiEncoding;
+ }
+ obj2.free();
+ } else if (obj1.isName("MacRomanEncoding")) {
+ hasEncoding = gTrue;
+ usesMacRomanEnc = gTrue;
+ baseEnc = macRomanEncoding;
+ } else if (obj1.isName("MacExpertEncoding")) {
+ hasEncoding = gTrue;
+ baseEnc = macExpertEncoding;
+ } else if (obj1.isName("WinAnsiEncoding")) {
+ hasEncoding = gTrue;
+ baseEnc = winAnsiEncoding;
+ }
+
+ // check embedded or external font file for base encoding
+ // (only for Type 1 fonts - trying to get an encoding out of a
+ // TrueType font is a losing proposition)
+ ffT1 = NULL;
+ ffT1C = NULL;
+ buf = NULL;
+ if (type == fontType1 && (extFontFile || embFontID.num >= 0)) {
+ if (extFontFile) {
+ ffT1 = FoFiType1::load(extFontFile->getCString());
+ } else {
+ buf = readEmbFontFile(xref, &len);
+ ffT1 = FoFiType1::make(buf, len);
+ }
+ if (ffT1) {
+ if (ffT1->getName()) {
+ if (embFontName) {
+ delete embFontName;
+ }
+ embFontName = new GString(ffT1->getName());
+ }
+ if (!baseEnc) {
+ baseEnc = ffT1->getEncoding();
+ baseEncFromFontFile = gTrue;
+ }
+ }
+ } else if (type == fontType1C && (extFontFile || embFontID.num >= 0)) {
+ if (extFontFile) {
+ ffT1C = FoFiType1C::load(extFontFile->getCString());
+ } else {
+ buf = readEmbFontFile(xref, &len);
+ ffT1C = FoFiType1C::make(buf, len);
+ }
+ if (ffT1C) {
+ if (ffT1C->getName()) {
+ if (embFontName) {
+ delete embFontName;
+ }
+ embFontName = new GString(ffT1C->getName());
+ }
+ if (!baseEnc) {
+ baseEnc = ffT1C->getEncoding();
+ baseEncFromFontFile = gTrue;
+ }
+ }
+ }
+ if (buf) {
+ gfree(buf);
+ }
+
+ // get default base encoding
+ if (!baseEnc) {
+ if (builtinFont && embFontID.num < 0) {
+ baseEnc = builtinFont->defaultBaseEnc;
+ hasEncoding = gTrue;
+ } else if (type == fontTrueType) {
+ baseEnc = winAnsiEncoding;
+ } else {
+ baseEnc = standardEncoding;
+ }
+ }
+
+ // copy the base encoding
+ for (i = 0; i < 256; ++i) {
+ enc[i] = baseEnc[i];
+ if ((encFree[i] = baseEncFromFontFile) && enc[i]) {
+ enc[i] = copyString(baseEnc[i]);
+ }
+ }
+
+ // some Type 1C font files have empty encodings, which can break the
+ // T1C->T1 conversion (since the 'seac' operator depends on having
+ // the accents in the encoding), so we fill in any gaps from
+ // StandardEncoding
+ if (type == fontType1C && (extFontFile || embFontID.num >= 0) &&
+ baseEncFromFontFile) {
+ for (i = 0; i < 256; ++i) {
+ if (!enc[i] && standardEncoding[i]) {
+ enc[i] = standardEncoding[i];
+ encFree[i] = gFalse;
+ }
+ }
+ }
+
+ // merge differences into encoding
+ if (obj1.isDict()) {
+ obj1.dictLookup("Differences", &obj2);
+ if (obj2.isArray()) {
+ hasEncoding = gTrue;
+ code = 0;
+ for (i = 0; i < obj2.arrayGetLength(); ++i) {
+ obj2.arrayGet(i, &obj3);
+ if (obj3.isInt()) {
+ code = obj3.getInt();
+ } else if (obj3.isName()) {
+ if (code >= 0 && code < 256) {
+ if (encFree[code]) {
+ gfree(enc[code]);
+ }
+ enc[code] = copyString(obj3.getName());
+ encFree[code] = gTrue;
+ }
+ ++code;
+ } else {
+ error(-1, "Wrong type in font encoding resource differences (%s)",
+ obj3.getTypeName());
+ }
+ obj3.free();
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+ if (ffT1) {
+ delete ffT1;
+ }
+ if (ffT1C) {
+ delete ffT1C;
+ }
+
+ //----- build the mapping to Unicode -----
+
+ // pass 1: use the name-to-Unicode mapping table
+ missing = hex = gFalse;
+ for (code = 0; code < 256; ++code) {
+ if ((charName = enc[code])) {
+ if (!(toUnicode[code] = globalParams->mapNameToUnicode(charName)) &&
+ strcmp(charName, ".notdef")) {
+ // if it wasn't in the name-to-Unicode table, check for a
+ // name that looks like 'Axx' or 'xx', where 'A' is any letter
+ // and 'xx' is two hex digits
+ if ((strlen(charName) == 3 &&
+ isalpha(charName[0]) &&
+ isxdigit(charName[1]) && isxdigit(charName[2]) &&
+ ((charName[1] >= 'a' && charName[1] <= 'f') ||
+ (charName[1] >= 'A' && charName[1] <= 'F') ||
+ (charName[2] >= 'a' && charName[2] <= 'f') ||
+ (charName[2] >= 'A' && charName[2] <= 'F'))) ||
+ (strlen(charName) == 2 &&
+ isxdigit(charName[0]) && isxdigit(charName[1]) &&
+ ((charName[0] >= 'a' && charName[0] <= 'f') ||
+ (charName[0] >= 'A' && charName[0] <= 'F') ||
+ (charName[1] >= 'a' && charName[1] <= 'f') ||
+ (charName[1] >= 'A' && charName[1] <= 'F')))) {
+ hex = gTrue;
+ }
+ missing = gTrue;
+ }
+ } else {
+ toUnicode[code] = 0;
+ }
+ }
+
+ // pass 2: try to fill in the missing chars, looking for names of
+ // the form 'Axx', 'xx', 'Ann', 'ABnn', or 'nn', where 'A' and 'B'
+ // are any letters, 'xx' is two hex digits, and 'nn' is 2-4
+ // decimal digits
+ if (missing && globalParams->getMapNumericCharNames()) {
+ for (code = 0; code < 256; ++code) {
+ if ((charName = enc[code]) && !toUnicode[code] &&
+ strcmp(charName, ".notdef")) {
+ n = strlen(charName);
+ code2 = -1;
+ if (hex && n == 3 && isalpha(charName[0]) &&
+ isxdigit(charName[1]) && isxdigit(charName[2])) {
+ sscanf(charName+1, "%x", &code2);
+ } else if (hex && n == 2 &&
+ isxdigit(charName[0]) && isxdigit(charName[1])) {
+ sscanf(charName, "%x", &code2);
+ } else if (!hex && n >= 2 && n <= 4 &&
+ isdigit(charName[0]) && isdigit(charName[1])) {
+ code2 = atoi(charName);
+ } else if (n >= 3 && n <= 5 &&
+ isdigit(charName[1]) && isdigit(charName[2])) {
+ code2 = atoi(charName+1);
+ } else if (n >= 4 && n <= 6 &&
+ isdigit(charName[2]) && isdigit(charName[3])) {
+ code2 = atoi(charName+2);
+ }
+ if (code2 >= 0 && code2 <= 0xff) {
+ toUnicode[code] = (Unicode)code2;
+ }
+ }
+ }
+
+ // if the 'mapUnknownCharNames' flag is set, do a simple pass-through
+ // mapping for unknown character names
+ } else if (missing && globalParams->getMapUnknownCharNames()) {
+ for (code = 0; code < 256; ++code) {
+ if (!toUnicode[code]) {
+ toUnicode[code] = code;
+ }
+ }
+ }
+
+ // construct the char code -> Unicode mapping object
+ ctu = CharCodeToUnicode::make8BitToUnicode(toUnicode);
+
+ // merge in a ToUnicode CMap, if there is one -- this overwrites
+ // existing entries in ctu, i.e., the ToUnicode CMap takes
+ // precedence, but the other encoding info is allowed to fill in any
+ // holes
+ readToUnicodeCMap(fontDict, 8, ctu);
+
+ // look for a Unicode-to-Unicode mapping
+ if (name && (utu = globalParams->getUnicodeToUnicode(name))) {
+ for (i = 0; i < 256; ++i) {
+ toUnicode[i] = 0;
+ }
+ ctu2 = CharCodeToUnicode::make8BitToUnicode(toUnicode);
+ for (i = 0; i < 256; ++i) {
+ n = ctu->mapToUnicode((CharCode)i, uBuf, 8);
+ if (n >= 1) {
+ n = utu->mapToUnicode((CharCode)uBuf[0], uBuf, 8);
+ if (n >= 1) {
+ ctu2->setMapping((CharCode)i, uBuf, n);
+ }
+ }
+ }
+ utu->decRefCnt();
+ delete ctu;
+ ctu = ctu2;
+ }
+
+ //----- get the character widths -----
+
+ // initialize all widths
+ for (code = 0; code < 256; ++code) {
+ widths[code] = missingWidth * 0.001;
+ }
+
+ // use widths from font dict, if present
+ fontDict->lookup("FirstChar", &obj1);
+ firstChar = obj1.isInt() ? obj1.getInt() : 0;
+ obj1.free();
+ if (firstChar < 0 || firstChar > 255) {
+ firstChar = 0;
+ }
+ fontDict->lookup("LastChar", &obj1);
+ lastChar = obj1.isInt() ? obj1.getInt() : 255;
+ obj1.free();
+ if (lastChar < 0 || lastChar > 255) {
+ lastChar = 255;
+ }
+ mul = (type == fontType3) ? fontMat[0] : 0.001;
+ fontDict->lookup("Widths", &obj1);
+ if (obj1.isArray()) {
+ flags |= fontFixedWidth;
+ if (obj1.arrayGetLength() < lastChar - firstChar + 1) {
+ lastChar = firstChar + obj1.arrayGetLength() - 1;
+ }
+ for (code = firstChar; code <= lastChar; ++code) {
+ obj1.arrayGet(code - firstChar, &obj2);
+ if (obj2.isNum()) {
+ widths[code] = obj2.getNum() * mul;
+ if (widths[code] != widths[firstChar]) {
+ flags &= ~fontFixedWidth;
+ }
+ }
+ obj2.free();
+ }
+
+ // use widths from built-in font
+ } else if (builtinFont) {
+ // this is a kludge for broken PDF files that encode char 32
+ // as .notdef
+ if (builtinFont->widths->getWidth("space", &w)) {
+ widths[32] = 0.001 * w;
+ }
+ for (code = 0; code < 256; ++code) {
+ if (enc[code] && builtinFont->widths->getWidth(enc[code], &w)) {
+ widths[code] = 0.001 * w;
+ }
+ }
+
+ // couldn't find widths -- use defaults
+ } else {
+ // this is technically an error -- the Widths entry is required
+ // for all but the Base-14 fonts -- but certain PDF generators
+ // apparently don't include widths for Arial and TimesNewRoman
+ if (isFixedWidth()) {
+ i = 0;
+ } else if (isSerif()) {
+ i = 8;
+ } else {
+ i = 4;
+ }
+ if (isBold()) {
+ i += 2;
+ }
+ if (isItalic()) {
+ i += 1;
+ }
+ builtinFont = builtinFontSubst[i];
+ // this is a kludge for broken PDF files that encode char 32
+ // as .notdef
+ if (builtinFont->widths->getWidth("space", &w)) {
+ widths[32] = 0.001 * w;
+ }
+ for (code = 0; code < 256; ++code) {
+ if (enc[code] && builtinFont->widths->getWidth(enc[code], &w)) {
+ widths[code] = 0.001 * w;
+ }
+ }
+ }
+ obj1.free();
+
+ ok = gTrue;
+}
+
+Gfx8BitFont::~Gfx8BitFont() {
+ int i;
+
+ for (i = 0; i < 256; ++i) {
+ if (encFree[i] && enc[i]) {
+ gfree(enc[i]);
+ }
+ }
+ ctu->decRefCnt();
+ if (charProcs.isDict()) {
+ charProcs.free();
+ }
+ if (resources.isDict()) {
+ resources.free();
+ }
+}
+
+int Gfx8BitFont::getNextChar(char *s, int /*len*/, CharCode *code,
+ Unicode *u, int uSize, int *uLen,
+ double *dx, double *dy, double *ox, double *oy) {
+ CharCode c;
+
+ *code = c = (CharCode)(*s & 0xff);
+ *uLen = ctu->mapToUnicode(c, u, uSize);
+ *dx = widths[c];
+ *dy = *ox = *oy = 0;
+ return 1;
+}
+
+CharCodeToUnicode *Gfx8BitFont::getToUnicode() {
+ ctu->incRefCnt();
+ return ctu;
+}
+
+Gushort *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) {
+ Gushort *map;
+ int cmapPlatform, cmapEncoding;
+ int unicodeCmap, macRomanCmap, msSymbolCmap, cmap;
+ GBool useMacRoman, useUnicode;
+ char *charName;
+ Unicode u;
+ int code, i, n;
+
+ map = (Gushort *)gmallocn(256, sizeof(Gushort));
+ for (i = 0; i < 256; ++i) {
+ map[i] = 0;
+ }
+
+ // To match up with the Adobe-defined behaviour, we choose a cmap
+ // like this:
+ // 1. If the PDF font has an encoding:
+ // 1a. If the PDF font specified MacRomanEncoding and the
+ // TrueType font has a Macintosh Roman cmap, use it, and
+ // reverse map the char names through MacRomanEncoding to
+ // get char codes.
+ // 1b. If the TrueType font has a Microsoft Unicode cmap or a
+ // non-Microsoft Unicode cmap, use it, and use the Unicode
+ // indexes, not the char codes.
+ // 1c. If the PDF font is symbolic and the TrueType font has a
+ // Microsoft Symbol cmap, use it, and use char codes
+ // directly (possibly with an offset of 0xf000).
+ // 1d. If the TrueType font has a Macintosh Roman cmap, use it,
+ // as in case 1a.
+ // 2. If the PDF font does not have an encoding or the PDF font is
+ // symbolic:
+ // 2a. If the TrueType font has a Macintosh Roman cmap, use it,
+ // and use char codes directly (possibly with an offset of
+ // 0xf000).
+ // 2b. If the TrueType font has a Microsoft Symbol cmap, use it,
+ // and use char codes directly (possible with an offset of
+ // 0xf000).
+ // 3. If none of these rules apply, use the first cmap and hope for
+ // the best (this shouldn't happen).
+ unicodeCmap = macRomanCmap = msSymbolCmap = -1;
+ for (i = 0; i < ff->getNumCmaps(); ++i) {
+ cmapPlatform = ff->getCmapPlatform(i);
+ cmapEncoding = ff->getCmapEncoding(i);
+ if ((cmapPlatform == 3 && cmapEncoding == 1) ||
+ cmapPlatform == 0) {
+ unicodeCmap = i;
+ } else if (cmapPlatform == 1 && cmapEncoding == 0) {
+ macRomanCmap = i;
+ } else if (cmapPlatform == 3 && cmapEncoding == 0) {
+ msSymbolCmap = i;
+ }
+ }
+ cmap = 0;
+ useMacRoman = gFalse;
+ useUnicode = gFalse;
+ if (hasEncoding) {
+ if (usesMacRomanEnc && macRomanCmap >= 0) {
+ cmap = macRomanCmap;
+ useMacRoman = gTrue;
+ } else if (unicodeCmap >= 0) {
+ cmap = unicodeCmap;
+ useUnicode = gTrue;
+ } else if ((flags & fontSymbolic) && msSymbolCmap >= 0) {
+ cmap = msSymbolCmap;
+ } else if ((flags & fontSymbolic) && macRomanCmap >= 0) {
+ cmap = macRomanCmap;
+ } else if (macRomanCmap >= 0) {
+ cmap = macRomanCmap;
+ useMacRoman = gTrue;
+ }
+ } else {
+ if (msSymbolCmap >= 0) {
+ cmap = msSymbolCmap;
+ } else if (macRomanCmap >= 0) {
+ cmap = macRomanCmap;
+ }
+ }
+
+ // reverse map the char names through MacRomanEncoding, then map the
+ // char codes through the cmap
+ if (useMacRoman) {
+ for (i = 0; i < 256; ++i) {
+ if ((charName = enc[i])) {
+ if ((code = globalParams->getMacRomanCharCode(charName))) {
+ map[i] = ff->mapCodeToGID(cmap, code);
+ }
+ }
+ }
+
+ // map Unicode through the cmap
+ } else if (useUnicode) {
+ for (i = 0; i < 256; ++i) {
+ if (((charName = enc[i]) &&
+ (u = globalParams->mapNameToUnicode(charName))) ||
+ (n = ctu->mapToUnicode((CharCode)i, &u, 1))) {
+ map[i] = ff->mapCodeToGID(cmap, u);
+ }
+ }
+
+ // map the char codes through the cmap, possibly with an offset of
+ // 0xf000
+ } else {
+ for (i = 0; i < 256; ++i) {
+ if (!(map[i] = ff->mapCodeToGID(cmap, i))) {
+ map[i] = ff->mapCodeToGID(cmap, 0xf000 + i);
+ }
+ }
+ }
+
+ // try the TrueType 'post' table to handle any unmapped characters
+ for (i = 0; i < 256; ++i) {
+ if (!map[i] && (charName = enc[i])) {
+ map[i] = (Gushort)(int)ff->mapNameToGID(charName);
+ }
+ }
+
+ return map;
+}
+
+Dict *Gfx8BitFont::getCharProcs() {
+ return charProcs.isDict() ? charProcs.getDict() : (Dict *)NULL;
+}
+
+Object *Gfx8BitFont::getCharProc(int code, Object *proc) {
+ if (enc[code] && charProcs.isDict()) {
+ charProcs.dictLookup(enc[code], proc);
+ } else {
+ proc->initNull();
+ }
+ return proc;
+}
+
+Dict *Gfx8BitFont::getResources() {
+ return resources.isDict() ? resources.getDict() : (Dict *)NULL;
+}
+
+//------------------------------------------------------------------------
+// GfxCIDFont
+//------------------------------------------------------------------------
+
+static int CDECL cmpWidthExcep(const void *w1, const void *w2) {
+ return ((GfxFontCIDWidthExcep *)w1)->first -
+ ((GfxFontCIDWidthExcep *)w2)->first;
+}
+
+static int CDECL cmpWidthExcepV(const void *w1, const void *w2) {
+ return ((GfxFontCIDWidthExcepV *)w1)->first -
+ ((GfxFontCIDWidthExcepV *)w2)->first;
+}
+
+GfxCIDFont::GfxCIDFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
+ Dict *fontDict):
+ GfxFont(tagA, idA, nameA)
+{
+ Dict *desFontDict;
+ GString *collection, *cMapName;
+ Object desFontDictObj;
+ Object obj1, obj2, obj3, obj4, obj5, obj6;
+ CharCodeToUnicode *utu;
+ CharCode c;
+ Unicode uBuf[8];
+ int c1, c2;
+ int excepsSize, i, j, k, n;
+
+ ascent = 0.95;
+ descent = -0.35;
+ fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0;
+ cMap = NULL;
+ ctu = NULL;
+ widths.defWidth = 1.0;
+ widths.defHeight = -1.0;
+ widths.defVY = 0.880;
+ widths.exceps = NULL;
+ widths.nExceps = 0;
+ widths.excepsV = NULL;
+ widths.nExcepsV = 0;
+ cidToGID = NULL;
+ cidToGIDLen = 0;
+
+ // get the descendant font
+ if (!fontDict->lookup("DescendantFonts", &obj1)->isArray()) {
+ error(-1, "Missing DescendantFonts entry in Type 0 font");
+ obj1.free();
+ goto err1;
+ }
+ if (!obj1.arrayGet(0, &desFontDictObj)->isDict()) {
+ error(-1, "Bad descendant font in Type 0 font");
+ goto err3;
+ }
+ obj1.free();
+ desFontDict = desFontDictObj.getDict();
+
+ // font type
+ if (!desFontDict->lookup("Subtype", &obj1)) {
+ error(-1, "Missing Subtype entry in Type 0 descendant font");
+ goto err3;
+ }
+ if (obj1.isName("CIDFontType0")) {
+ type = fontCIDType0;
+ } else if (obj1.isName("CIDFontType2")) {
+ type = fontCIDType2;
+ } else {
+ error(-1, "Unknown Type 0 descendant font type '%s'",
+ obj1.isName() ? obj1.getName() : "???");
+ goto err3;
+ }
+ obj1.free();
+
+ // get info from font descriptor
+ readFontDescriptor(xref, desFontDict);
+
+ // look for an external font file
+ findExtFontFile();
+
+ //----- encoding info -----
+
+ // char collection
+ if (!desFontDict->lookup("CIDSystemInfo", &obj1)->isDict()) {
+ error(-1, "Missing CIDSystemInfo dictionary in Type 0 descendant font");
+ goto err3;
+ }
+ obj1.dictLookup("Registry", &obj2);
+ obj1.dictLookup("Ordering", &obj3);
+ if (!obj2.isString() || !obj3.isString()) {
+ error(-1, "Invalid CIDSystemInfo dictionary in Type 0 descendant font");
+ goto err4;
+ }
+ collection = obj2.getString()->copy()->append('-')->append(obj3.getString());
+ obj3.free();
+ obj2.free();
+ obj1.free();
+
+ // look for a ToUnicode CMap
+ if (!(ctu = readToUnicodeCMap(fontDict, 16, NULL))) {
+
+ // the "Adobe-Identity" and "Adobe-UCS" collections don't have
+ // cidToUnicode files
+ if (collection->cmp("Adobe-Identity") &&
+ collection->cmp("Adobe-UCS")) {
+
+ // look for a user-supplied .cidToUnicode file
+ if (!(ctu = globalParams->getCIDToUnicode(collection))) {
+ error(-1, "Unknown character collection '%s'",
+ collection->getCString());
+ // fall-through, assuming the Identity mapping -- this appears
+ // to match Adobe's behavior
+ }
+ }
+ }
+
+ // look for a Unicode-to-Unicode mapping
+ if (name && (utu = globalParams->getUnicodeToUnicode(name))) {
+ if (ctu) {
+ for (c = 0; c < ctu->getLength(); ++c) {
+ n = ctu->mapToUnicode(c, uBuf, 8);
+ if (n >= 1) {
+ n = utu->mapToUnicode((CharCode)uBuf[0], uBuf, 8);
+ if (n >= 1) {
+ ctu->setMapping(c, uBuf, n);
+ }
+ }
+ }
+ utu->decRefCnt();
+ } else {
+ ctu = utu;
+ }
+ }
+
+ // encoding (i.e., CMap)
+ //~ need to handle a CMap stream here
+ //~ also need to deal with the UseCMap entry in the stream dict
+ if (!fontDict->lookup("Encoding", &obj1)->isName()) {
+ error(-1, "Missing or invalid Encoding entry in Type 0 font");
+ delete collection;
+ goto err3;
+ }
+ cMapName = new GString(obj1.getName());
+ obj1.free();
+ if (!(cMap = globalParams->getCMap(collection, cMapName))) {
+ error(-1, "Unknown CMap '%s' for character collection '%s'",
+ cMapName->getCString(), collection->getCString());
+ delete collection;
+ delete cMapName;
+ goto err2;
+ }
+ delete collection;
+ delete cMapName;
+
+ // CIDToGIDMap (for embedded TrueType fonts)
+ if (type == fontCIDType2) {
+ desFontDict->lookup("CIDToGIDMap", &obj1);
+ if (obj1.isStream()) {
+ cidToGIDLen = 0;
+ i = 64;
+ cidToGID = (Gushort *)gmallocn(i, sizeof(Gushort));
+ obj1.streamReset();
+ while ((c1 = obj1.streamGetChar()) != EOF &&
+ (c2 = obj1.streamGetChar()) != EOF) {
+ if (cidToGIDLen == i) {
+ i *= 2;
+ cidToGID = (Gushort *)greallocn(cidToGID, i, sizeof(Gushort));
+ }
+ cidToGID[cidToGIDLen++] = (Gushort)((c1 << 8) + c2);
+ }
+ } else if (!obj1.isName("Identity") && !obj1.isNull()) {
+ error(-1, "Invalid CIDToGIDMap entry in CID font");
+ }
+ obj1.free();
+ }
+
+ //----- character metrics -----
+
+ // default char width
+ if (desFontDict->lookup("DW", &obj1)->isInt()) {
+ widths.defWidth = obj1.getInt() * 0.001;
+ }
+ obj1.free();
+
+ // char width exceptions
+ if (desFontDict->lookup("W", &obj1)->isArray()) {
+ excepsSize = 0;
+ i = 0;
+ while (i + 1 < obj1.arrayGetLength()) {
+ obj1.arrayGet(i, &obj2);
+ obj1.arrayGet(i + 1, &obj3);
+ if (obj2.isInt() && obj3.isInt() && i + 2 < obj1.arrayGetLength()) {
+ if (obj1.arrayGet(i + 2, &obj4)->isNum()) {
+ if (widths.nExceps == excepsSize) {
+ excepsSize += 16;
+ widths.exceps = (GfxFontCIDWidthExcep *)
+ greallocn(widths.exceps,
+ excepsSize, sizeof(GfxFontCIDWidthExcep));
+ }
+ widths.exceps[widths.nExceps].first = obj2.getInt();
+ widths.exceps[widths.nExceps].last = obj3.getInt();
+ widths.exceps[widths.nExceps].width = obj4.getNum() * 0.001;
+ ++widths.nExceps;
+ } else {
+ error(-1, "Bad widths array in Type 0 font");
+ }
+ obj4.free();
+ i += 3;
+ } else if (obj2.isInt() && obj3.isArray()) {
+ if (widths.nExceps + obj3.arrayGetLength() > excepsSize) {
+ excepsSize = (widths.nExceps + obj3.arrayGetLength() + 15) & ~15;
+ widths.exceps = (GfxFontCIDWidthExcep *)
+ greallocn(widths.exceps,
+ excepsSize, sizeof(GfxFontCIDWidthExcep));
+ }
+ j = obj2.getInt();
+ for (k = 0; k < obj3.arrayGetLength(); ++k) {
+ if (obj3.arrayGet(k, &obj4)->isNum()) {
+ widths.exceps[widths.nExceps].first = j;
+ widths.exceps[widths.nExceps].last = j;
+ widths.exceps[widths.nExceps].width = obj4.getNum() * 0.001;
+ ++j;
+ ++widths.nExceps;
+ } else {
+ error(-1, "Bad widths array in Type 0 font");
+ }
+ obj4.free();
+ }
+ i += 2;
+ } else {
+ error(-1, "Bad widths array in Type 0 font");
+ ++i;
+ }
+ obj3.free();
+ obj2.free();
+ }
+ qsort(widths.exceps, widths.nExceps, sizeof(GfxFontCIDWidthExcep),
+ &cmpWidthExcep);
+ }
+ obj1.free();
+
+ // default metrics for vertical font
+ if (desFontDict->lookup("DW2", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2) {
+ if (obj1.arrayGet(0, &obj2)->isNum()) {
+ widths.defVY = obj2.getNum() * 0.001;
+ }
+ obj2.free();
+ if (obj1.arrayGet(1, &obj2)->isNum()) {
+ widths.defHeight = obj2.getNum() * 0.001;
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ // char metric exceptions for vertical font
+ if (desFontDict->lookup("W2", &obj1)->isArray()) {
+ excepsSize = 0;
+ i = 0;
+ while (i + 1 < obj1.arrayGetLength()) {
+ obj1.arrayGet(i, &obj2);
+ obj1.arrayGet(i+ 1, &obj3);
+ if (obj2.isInt() && obj3.isInt() && i + 4 < obj1.arrayGetLength()) {
+ if (obj1.arrayGet(i + 2, &obj4)->isNum() &&
+ obj1.arrayGet(i + 3, &obj5)->isNum() &&
+ obj1.arrayGet(i + 4, &obj6)->isNum()) {
+ if (widths.nExcepsV == excepsSize) {
+ excepsSize += 16;
+ widths.excepsV = (GfxFontCIDWidthExcepV *)
+ greallocn(widths.excepsV,
+ excepsSize, sizeof(GfxFontCIDWidthExcepV));
+ }
+ widths.excepsV[widths.nExcepsV].first = obj2.getInt();
+ widths.excepsV[widths.nExcepsV].last = obj3.getInt();
+ widths.excepsV[widths.nExcepsV].height = obj4.getNum() * 0.001;
+ widths.excepsV[widths.nExcepsV].vx = obj5.getNum() * 0.001;
+ widths.excepsV[widths.nExcepsV].vy = obj6.getNum() * 0.001;
+ ++widths.nExcepsV;
+ } else {
+ error(-1, "Bad widths (W2) array in Type 0 font");
+ }
+ obj6.free();
+ obj5.free();
+ obj4.free();
+ i += 5;
+ } else if (obj2.isInt() && obj3.isArray()) {
+ if (widths.nExcepsV + obj3.arrayGetLength() / 3 > excepsSize) {
+ excepsSize =
+ (widths.nExcepsV + obj3.arrayGetLength() / 3 + 15) & ~15;
+ widths.excepsV = (GfxFontCIDWidthExcepV *)
+ greallocn(widths.excepsV,
+ excepsSize, sizeof(GfxFontCIDWidthExcepV));
+ }
+ j = obj2.getInt();
+ for (k = 0; k < obj3.arrayGetLength(); k += 3) {
+ if (obj3.arrayGet(k, &obj4)->isNum() &&
+ obj3.arrayGet(k+1, &obj5)->isNum() &&
+ obj3.arrayGet(k+2, &obj6)->isNum()) {
+ widths.excepsV[widths.nExceps].first = j;
+ widths.excepsV[widths.nExceps].last = j;
+ widths.excepsV[widths.nExceps].height = obj4.getNum() * 0.001;
+ widths.excepsV[widths.nExceps].vx = obj5.getNum() * 0.001;
+ widths.excepsV[widths.nExceps].vy = obj6.getNum() * 0.001;
+ ++j;
+ ++widths.nExcepsV;
+ } else {
+ error(-1, "Bad widths (W2) array in Type 0 font");
+ }
+ obj6.free();
+ obj5.free();
+ obj4.free();
+ }
+ i += 2;
+ } else {
+ error(-1, "Bad widths (W2) array in Type 0 font");
+ ++i;
+ }
+ obj3.free();
+ obj2.free();
+ }
+ qsort(widths.excepsV, widths.nExcepsV, sizeof(GfxFontCIDWidthExcepV),
+ &cmpWidthExcepV);
+ }
+ obj1.free();
+
+ desFontDictObj.free();
+ ok = gTrue;
+ return;
+
+ err4:
+ obj3.free();
+ obj2.free();
+ err3:
+ obj1.free();
+ err2:
+ desFontDictObj.free();
+ err1:;
+}
+
+GfxCIDFont::~GfxCIDFont() {
+ if (cMap) {
+ cMap->decRefCnt();
+ }
+ if (ctu) {
+ ctu->decRefCnt();
+ }
+ gfree(widths.exceps);
+ gfree(widths.excepsV);
+ if (cidToGID) {
+ gfree(cidToGID);
+ }
+}
+
+int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
+ Unicode *u, int uSize, int *uLen,
+ double *dx, double *dy, double *ox, double *oy) {
+ CID cid;
+ double w, h, vx, vy;
+ int n, a, b, m;
+
+ if (!cMap) {
+ *code = 0;
+ *uLen = 0;
+ *dx = *dy = 0;
+ return 1;
+ }
+
+ *code = (CharCode)(cid = cMap->getCID(s, len, &n));
+ if (ctu) {
+ *uLen = ctu->mapToUnicode(cid, u, uSize);
+ } else {
+ *uLen = 0;
+ }
+
+ // horizontal
+ if (cMap->getWMode() == 0) {
+ w = widths.defWidth;
+ h = vx = vy = 0;
+ if (widths.nExceps > 0 && cid >= widths.exceps[0].first) {
+ a = 0;
+ b = widths.nExceps;
+ // invariant: widths.exceps[a].first <= cid < widths.exceps[b].first
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (widths.exceps[m].first <= cid) {
+ a = m;
+ } else {
+ b = m;
+ }
+ }
+ if (cid <= widths.exceps[a].last) {
+ w = widths.exceps[a].width;
+ }
+ }
+
+ // vertical
+ } else {
+ w = 0;
+ h = widths.defHeight;
+ vx = widths.defWidth / 2;
+ vy = widths.defVY;
+ if (widths.nExcepsV > 0 && cid >= widths.excepsV[0].first) {
+ a = 0;
+ b = widths.nExcepsV;
+ // invariant: widths.excepsV[a].first <= cid < widths.excepsV[b].first
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (widths.excepsV[m].last <= cid) {
+ a = m;
+ } else {
+ b = m;
+ }
+ }
+ if (cid <= widths.excepsV[a].last) {
+ h = widths.excepsV[a].height;
+ vx = widths.excepsV[a].vx;
+ vy = widths.excepsV[a].vy;
+ }
+ }
+ }
+
+ *dx = w;
+ *dy = h;
+ *ox = vx;
+ *oy = vy;
+
+ return n;
+}
+
+int GfxCIDFont::getWMode() {
+ return cMap ? cMap->getWMode() : 0;
+}
+
+CharCodeToUnicode *GfxCIDFont::getToUnicode() {
+ if (ctu) {
+ ctu->incRefCnt();
+ }
+ return ctu;
+}
+
+GString *GfxCIDFont::getCollection() {
+ return cMap ? cMap->getCollection() : (GString *)NULL;
+}
+
+Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
+ Gushort *map;
+ int cmapPlatform, cmapEncoding;
+ int /*unicodeCmap, macRomanCmap, msSymbolCmap, */cmap;
+// GBool useMacRoman, useUnicode;
+// char *charName;
+ Unicode u;
+ int /*code, */i;
+ int mapsize;
+ int cidlen;
+
+ *mapsizep = 0;
+ if (!ctu) return NULL;
+
+ /* we use only unicode cmap */
+ cmap = -1;
+ for (i = 0; i < ff->getNumCmaps(); ++i) {
+ cmapPlatform = ff->getCmapPlatform(i);
+ cmapEncoding = ff->getCmapEncoding(i);
+ if ((cmapPlatform == 3 && cmapEncoding == 1) || cmapPlatform == 0)
+ cmap = i;
+ }
+ if (cmap < 0)
+ return NULL;
+
+ cidlen = 0;
+ mapsize = 64;
+ map = (Gushort *)gmalloc(mapsize * sizeof(Gushort));
+
+ while (cidlen < ctu->getLength()) {
+ int n;
+ if ((n = ctu->mapToUnicode((CharCode)cidlen, &u, 1)) == 0) {
+ cidlen++;
+ continue;
+ }
+ if (cidlen >= mapsize) {
+ while (cidlen >= mapsize)
+ mapsize *= 2;
+ map = (Gushort *)grealloc(map, mapsize * sizeof(Gushort));
+ }
+ map[cidlen] = ff->mapCodeToGID(cmap, u);
+ cidlen++;
+ }
+
+ *mapsizep = cidlen;
+ return map;
+}
+
+//------------------------------------------------------------------------
+// GfxFontDict
+//------------------------------------------------------------------------
+
+GfxFontDict::GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict) {
+ int i;
+ Object obj1, obj2;
+ Ref r;
+
+ numFonts = fontDict->getLength();
+ fonts = (GfxFont **)gmallocn(numFonts, sizeof(GfxFont *));
+ for (i = 0; i < numFonts; ++i) {
+ fontDict->getValNF(i, &obj1);
+ obj1.fetch(xref, &obj2);
+ if (obj2.isDict()) {
+ if (obj1.isRef()) {
+ r = obj1.getRef();
+ } else {
+ // no indirect reference for this font, so invent a unique one
+ // (legal generation numbers are five digits, so any 6-digit
+ // number would be safe)
+ r.num = i;
+ if (fontDictRef) {
+ r.gen = 100000 + fontDictRef->num;
+ } else {
+ r.gen = 999999;
+ }
+ }
+ fonts[i] = GfxFont::makeFont(xref, fontDict->getKey(i),
+ r, obj2.getDict());
+ if (fonts[i] && !fonts[i]->isOk()) {
+ delete fonts[i];
+ fonts[i] = NULL;
+ }
+ } else {
+ error(-1, "font resource is not a dictionary");
+ fonts[i] = NULL;
+ }
+ obj1.free();
+ obj2.free();
+ }
+}
+
+GfxFontDict::~GfxFontDict() {
+ int i;
+
+ for (i = 0; i < numFonts; ++i) {
+ if (fonts[i]) {
+ delete fonts[i];
+ }
+ }
+ gfree(fonts);
+}
+
+GfxFont *GfxFontDict::lookup(char *tag) {
+ int i;
+
+ for (i = 0; i < numFonts; ++i) {
+ if (fonts[i] && fonts[i]->matches(tag)) {
+ return fonts[i];
+ }
+ }
+ return NULL;
+}
diff --git a/kpdf/xpdf/xpdf/GfxState.cc b/kpdf/xpdf/xpdf/GfxState.cc
deleted file mode 100644
index a00dabe1..00000000
--- a/kpdf/xpdf/xpdf/GfxState.cc
+++ /dev/null
@@ -1,4137 +0,0 @@
-//========================================================================
-//
-// GfxState.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include <math.h>
-#include <string.h>
-#include "gmem.h"
-#include "Error.h"
-#include "Object.h"
-#include "Array.h"
-#include "Page.h"
-#include "GfxState.h"
-
-//------------------------------------------------------------------------
-
-static inline GfxColorComp clip01(GfxColorComp x) {
- return (x < 0) ? 0 : (x > gfxColorComp1) ? gfxColorComp1 : x;
-}
-
-static inline double clip01(double x) {
- return (x < 0) ? 0 : (x > 1) ? 1 : x;
-}
-
-//------------------------------------------------------------------------
-
-struct GfxBlendModeInfo {
- char *name;
- GfxBlendMode mode;
-};
-
-static GfxBlendModeInfo gfxBlendModeNames[] = {
- { "Normal", gfxBlendNormal },
- { "Compatible", gfxBlendNormal },
- { "Multiply", gfxBlendMultiply },
- { "Screen", gfxBlendScreen },
- { "Overlay", gfxBlendOverlay },
- { "Darken", gfxBlendDarken },
- { "Lighten", gfxBlendLighten },
- { "ColorDodge", gfxBlendColorDodge },
- { "ColorBurn", gfxBlendColorBurn },
- { "HardLight", gfxBlendHardLight },
- { "SoftLight", gfxBlendSoftLight },
- { "Difference", gfxBlendDifference },
- { "Exclusion", gfxBlendExclusion },
- { "Hue", gfxBlendHue },
- { "Saturation", gfxBlendSaturation },
- { "Color", gfxBlendColor },
- { "Luminosity", gfxBlendLuminosity }
-};
-
-#define nGfxBlendModeNames \
- ((int)((sizeof(gfxBlendModeNames) / sizeof(GfxBlendModeInfo))))
-
-//------------------------------------------------------------------------
-
-// NB: This must match the GfxColorSpaceMode enum defined in
-// GfxState.h
-static char *gfxColorSpaceModeNames[] = {
- "DeviceGray",
- "CalGray",
- "DeviceRGB",
- "CalRGB",
- "DeviceCMYK",
- "Lab",
- "ICCBased",
- "Indexed",
- "Separation",
- "DeviceN",
- "Pattern"
-};
-
-#define nGfxColorSpaceModes ((sizeof(gfxColorSpaceModeNames) / sizeof(char *)))
-
-//------------------------------------------------------------------------
-// GfxColorSpace
-//------------------------------------------------------------------------
-
-GfxColorSpace::GfxColorSpace() {
-}
-
-GfxColorSpace::~GfxColorSpace() {
-}
-
-GfxColorSpace *GfxColorSpace::parse(Object *csObj) {
- GfxColorSpace *cs;
- Object obj1;
-
- cs = NULL;
- if (csObj->isName()) {
- if (csObj->isName("DeviceGray") || csObj->isName("G")) {
- cs = new GfxDeviceGrayColorSpace();
- } else if (csObj->isName("DeviceRGB") || csObj->isName("RGB")) {
- cs = new GfxDeviceRGBColorSpace();
- } else if (csObj->isName("DeviceCMYK") || csObj->isName("CMYK")) {
- cs = new GfxDeviceCMYKColorSpace();
- } else if (csObj->isName("Pattern")) {
- cs = new GfxPatternColorSpace(NULL);
- } else {
- error(-1, "Bad color space '%s'", csObj->getName());
- }
- } else if (csObj->isArray()) {
- csObj->arrayGet(0, &obj1);
- if (obj1.isName("DeviceGray") || obj1.isName("G")) {
- cs = new GfxDeviceGrayColorSpace();
- } else if (obj1.isName("DeviceRGB") || obj1.isName("RGB")) {
- cs = new GfxDeviceRGBColorSpace();
- } else if (obj1.isName("DeviceCMYK") || obj1.isName("CMYK")) {
- cs = new GfxDeviceCMYKColorSpace();
- } else if (obj1.isName("CalGray")) {
- cs = GfxCalGrayColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("CalRGB")) {
- cs = GfxCalRGBColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("Lab")) {
- cs = GfxLabColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("ICCBased")) {
- cs = GfxICCBasedColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("Indexed") || obj1.isName("I")) {
- cs = GfxIndexedColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("Separation")) {
- cs = GfxSeparationColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("DeviceN")) {
- cs = GfxDeviceNColorSpace::parse(csObj->getArray());
- } else if (obj1.isName("Pattern")) {
- cs = GfxPatternColorSpace::parse(csObj->getArray());
- } else {
- error(-1, "Bad color space");
- }
- obj1.free();
- } else {
- error(-1, "Bad color space - expected name or array");
- }
- return cs;
-}
-
-void GfxColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
- int /*maxImgPixel*/) {
- int i;
-
- for (i = 0; i < getNComps(); ++i) {
- decodeLow[i] = 0;
- decodeRange[i] = 1;
- }
-}
-
-int GfxColorSpace::getNumColorSpaceModes() {
- return nGfxColorSpaceModes;
-}
-
-char *GfxColorSpace::getColorSpaceModeName(int idx) {
- return gfxColorSpaceModeNames[idx];
-}
-
-//------------------------------------------------------------------------
-// GfxDeviceGrayColorSpace
-//------------------------------------------------------------------------
-
-GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() {
-}
-
-GfxDeviceGrayColorSpace::~GfxDeviceGrayColorSpace() {
-}
-
-GfxColorSpace *GfxDeviceGrayColorSpace::copy() {
- return new GfxDeviceGrayColorSpace();
-}
-
-void GfxDeviceGrayColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- *gray = clip01(color->c[0]);
-}
-
-void GfxDeviceGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
-}
-
-void GfxDeviceGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- cmyk->c = cmyk->m = cmyk->y = 0;
- cmyk->k = clip01(gfxColorComp1 - color->c[0]);
-}
-
-void GfxDeviceGrayColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
-}
-
-//------------------------------------------------------------------------
-// GfxCalGrayColorSpace
-//------------------------------------------------------------------------
-
-GfxCalGrayColorSpace::GfxCalGrayColorSpace() {
- whiteX = whiteY = whiteZ = 1;
- blackX = blackY = blackZ = 0;
- gamma = 1;
-}
-
-GfxCalGrayColorSpace::~GfxCalGrayColorSpace() {
-}
-
-GfxColorSpace *GfxCalGrayColorSpace::copy() {
- GfxCalGrayColorSpace *cs;
-
- cs = new GfxCalGrayColorSpace();
- cs->whiteX = whiteX;
- cs->whiteY = whiteY;
- cs->whiteZ = whiteZ;
- cs->blackX = blackX;
- cs->blackY = blackY;
- cs->blackZ = blackZ;
- cs->gamma = gamma;
- return cs;
-}
-
-GfxColorSpace *GfxCalGrayColorSpace::parse(Array *arr) {
- GfxCalGrayColorSpace *cs;
- Object obj1, obj2, obj3;
-
- arr->get(1, &obj1);
- if (!obj1.isDict()) {
- error(-1, "Bad CalGray color space");
- obj1.free();
- return NULL;
- }
- cs = new GfxCalGrayColorSpace();
- if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->whiteX = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->whiteY = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->whiteZ = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->blackX = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->blackY = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->blackZ = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("Gamma", &obj2)->isNum()) {
- cs->gamma = obj2.getNum();
- }
- obj2.free();
- obj1.free();
- return cs;
-}
-
-void GfxCalGrayColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- *gray = clip01(color->c[0]);
-}
-
-void GfxCalGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
-}
-
-void GfxCalGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- cmyk->c = cmyk->m = cmyk->y = 0;
- cmyk->k = clip01(gfxColorComp1 - color->c[0]);
-}
-
-void GfxCalGrayColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
-}
-
-//------------------------------------------------------------------------
-// GfxDeviceRGBColorSpace
-//------------------------------------------------------------------------
-
-GfxDeviceRGBColorSpace::GfxDeviceRGBColorSpace() {
-}
-
-GfxDeviceRGBColorSpace::~GfxDeviceRGBColorSpace() {
-}
-
-GfxColorSpace *GfxDeviceRGBColorSpace::copy() {
- return new GfxDeviceRGBColorSpace();
-}
-
-void GfxDeviceRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- *gray = clip01((GfxColorComp)(0.3 * color->c[0] +
- 0.59 * color->c[1] +
- 0.11 * color->c[2] + 0.5));
-}
-
-void GfxDeviceRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- rgb->r = clip01(color->c[0]);
- rgb->g = clip01(color->c[1]);
- rgb->b = clip01(color->c[2]);
-}
-
-void GfxDeviceRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- GfxColorComp c, m, y, k;
-
- c = clip01(gfxColorComp1 - color->c[0]);
- m = clip01(gfxColorComp1 - color->c[1]);
- y = clip01(gfxColorComp1 - color->c[2]);
- k = c;
- if (m < k) {
- k = m;
- }
- if (y < k) {
- k = y;
- }
- cmyk->c = c - k;
- cmyk->m = m - k;
- cmyk->y = y - k;
- cmyk->k = k;
-}
-
-void GfxDeviceRGBColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
- color->c[1] = 0;
- color->c[2] = 0;
-}
-
-//------------------------------------------------------------------------
-// GfxCalRGBColorSpace
-//------------------------------------------------------------------------
-
-GfxCalRGBColorSpace::GfxCalRGBColorSpace() {
- whiteX = whiteY = whiteZ = 1;
- blackX = blackY = blackZ = 0;
- gammaR = gammaG = gammaB = 1;
- mat[0] = 1; mat[1] = 0; mat[2] = 0;
- mat[3] = 0; mat[4] = 1; mat[5] = 0;
- mat[6] = 0; mat[7] = 0; mat[8] = 1;
-}
-
-GfxCalRGBColorSpace::~GfxCalRGBColorSpace() {
-}
-
-GfxColorSpace *GfxCalRGBColorSpace::copy() {
- GfxCalRGBColorSpace *cs;
- int i;
-
- cs = new GfxCalRGBColorSpace();
- cs->whiteX = whiteX;
- cs->whiteY = whiteY;
- cs->whiteZ = whiteZ;
- cs->blackX = blackX;
- cs->blackY = blackY;
- cs->blackZ = blackZ;
- cs->gammaR = gammaR;
- cs->gammaG = gammaG;
- cs->gammaB = gammaB;
- for (i = 0; i < 9; ++i) {
- cs->mat[i] = mat[i];
- }
- return cs;
-}
-
-GfxColorSpace *GfxCalRGBColorSpace::parse(Array *arr) {
- GfxCalRGBColorSpace *cs;
- Object obj1, obj2, obj3;
- int i;
-
- arr->get(1, &obj1);
- if (!obj1.isDict()) {
- error(-1, "Bad CalRGB color space");
- obj1.free();
- return NULL;
- }
- cs = new GfxCalRGBColorSpace();
- if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->whiteX = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->whiteY = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->whiteZ = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->blackX = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->blackY = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->blackZ = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("Gamma", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->gammaR = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->gammaG = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->gammaB = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("Matrix", &obj2)->isArray() &&
- obj2.arrayGetLength() == 9) {
- for (i = 0; i < 9; ++i) {
- obj2.arrayGet(i, &obj3);
- cs->mat[i] = obj3.getNum();
- obj3.free();
- }
- }
- obj2.free();
- obj1.free();
- return cs;
-}
-
-void GfxCalRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- *gray = clip01((GfxColorComp)(0.299 * color->c[0] +
- 0.587 * color->c[1] +
- 0.114 * color->c[2] + 0.5));
-}
-
-void GfxCalRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- rgb->r = clip01(color->c[0]);
- rgb->g = clip01(color->c[1]);
- rgb->b = clip01(color->c[2]);
-}
-
-void GfxCalRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- GfxColorComp c, m, y, k;
-
- c = clip01(gfxColorComp1 - color->c[0]);
- m = clip01(gfxColorComp1 - color->c[1]);
- y = clip01(gfxColorComp1 - color->c[2]);
- k = c;
- if (m < k) {
- k = m;
- }
- if (y < k) {
- k = y;
- }
- cmyk->c = c - k;
- cmyk->m = m - k;
- cmyk->y = y - k;
- cmyk->k = k;
-}
-
-void GfxCalRGBColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
- color->c[1] = 0;
- color->c[2] = 0;
-}
-
-//------------------------------------------------------------------------
-// GfxDeviceCMYKColorSpace
-//------------------------------------------------------------------------
-
-GfxDeviceCMYKColorSpace::GfxDeviceCMYKColorSpace() {
-}
-
-GfxDeviceCMYKColorSpace::~GfxDeviceCMYKColorSpace() {
-}
-
-GfxColorSpace *GfxDeviceCMYKColorSpace::copy() {
- return new GfxDeviceCMYKColorSpace();
-}
-
-void GfxDeviceCMYKColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- *gray = clip01((GfxColorComp)(gfxColorComp1 - color->c[3]
- - 0.3 * color->c[0]
- - 0.59 * color->c[1]
- - 0.11 * color->c[2] + 0.5));
-}
-
-void GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- double c, m, y, k, c1, m1, y1, k1, r, g, b, x;
-
- c = colToDbl(color->c[0]);
- m = colToDbl(color->c[1]);
- y = colToDbl(color->c[2]);
- k = colToDbl(color->c[3]);
- c1 = 1 - c;
- m1 = 1 - m;
- y1 = 1 - y;
- k1 = 1 - k;
- // this is a matrix multiplication, unrolled for performance
- // C M Y K
- x = c1 * m1 * y1 * k1; // 0 0 0 0
- r = g = b = x;
- x = c1 * m1 * y1 * k; // 0 0 0 1
- r += 0.1373 * x;
- g += 0.1216 * x;
- b += 0.1255 * x;
- x = c1 * m1 * y * k1; // 0 0 1 0
- r += x;
- g += 0.9490 * x;
- x = c1 * m1 * y * k; // 0 0 1 1
- r += 0.1098 * x;
- g += 0.1020 * x;
- x = c1 * m * y1 * k1; // 0 1 0 0
- r += 0.9255 * x;
- b += 0.5490 * x;
- x = c1 * m * y1 * k; // 0 1 0 1
- r += 0.1412 * x;
- x = c1 * m * y * k1; // 0 1 1 0
- r += 0.9294 * x;
- g += 0.1098 * x;
- b += 0.1412 * x;
- x = c1 * m * y * k; // 0 1 1 1
- r += 0.1333 * x;
- x = c * m1 * y1 * k1; // 1 0 0 0
- g += 0.6784 * x;
- b += 0.9373 * x;
- x = c * m1 * y1 * k; // 1 0 0 1
- g += 0.0588 * x;
- b += 0.1412 * x;
- x = c * m1 * y * k1; // 1 0 1 0
- g += 0.6510 * x;
- b += 0.3137 * x;
- x = c * m1 * y * k; // 1 0 1 1
- g += 0.0745 * x;
- x = c * m * y1 * k1; // 1 1 0 0
- r += 0.1804 * x;
- g += 0.1922 * x;
- b += 0.5725 * x;
- x = c * m * y1 * k; // 1 1 0 1
- b += 0.0078 * x;
- x = c * m * y * k1; // 1 1 1 0
- r += 0.2118 * x;
- g += 0.2119 * x;
- b += 0.2235 * x;
- rgb->r = clip01(dblToCol(r));
- rgb->g = clip01(dblToCol(g));
- rgb->b = clip01(dblToCol(b));
-}
-
-void GfxDeviceCMYKColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- cmyk->c = clip01(color->c[0]);
- cmyk->m = clip01(color->c[1]);
- cmyk->y = clip01(color->c[2]);
- cmyk->k = clip01(color->c[3]);
-}
-
-void GfxDeviceCMYKColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
- color->c[1] = 0;
- color->c[2] = 0;
- color->c[3] = gfxColorComp1;
-}
-
-//------------------------------------------------------------------------
-// GfxLabColorSpace
-//------------------------------------------------------------------------
-
-// This is the inverse of MatrixLMN in Example 4.10 from the PostScript
-// Language Reference, Third Edition.
-static double xyzrgb[3][3] = {
- { 3.240449, -1.537136, -0.498531 },
- { -0.969265, 1.876011, 0.041556 },
- { 0.055643, -0.204026, 1.057229 }
-};
-
-GfxLabColorSpace::GfxLabColorSpace() {
- whiteX = whiteY = whiteZ = 1;
- blackX = blackY = blackZ = 0;
- aMin = bMin = -100;
- aMax = bMax = 100;
-}
-
-GfxLabColorSpace::~GfxLabColorSpace() {
-}
-
-GfxColorSpace *GfxLabColorSpace::copy() {
- GfxLabColorSpace *cs;
-
- cs = new GfxLabColorSpace();
- cs->whiteX = whiteX;
- cs->whiteY = whiteY;
- cs->whiteZ = whiteZ;
- cs->blackX = blackX;
- cs->blackY = blackY;
- cs->blackZ = blackZ;
- cs->aMin = aMin;
- cs->aMax = aMax;
- cs->bMin = bMin;
- cs->bMax = bMax;
- cs->kr = kr;
- cs->kg = kg;
- cs->kb = kb;
- return cs;
-}
-
-GfxColorSpace *GfxLabColorSpace::parse(Array *arr) {
- GfxLabColorSpace *cs;
- Object obj1, obj2, obj3;
-
- arr->get(1, &obj1);
- if (!obj1.isDict()) {
- error(-1, "Bad Lab color space");
- obj1.free();
- return NULL;
- }
- cs = new GfxLabColorSpace();
- if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->whiteX = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->whiteY = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->whiteZ = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
- obj2.arrayGetLength() == 3) {
- obj2.arrayGet(0, &obj3);
- cs->blackX = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->blackY = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->blackZ = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- if (obj1.dictLookup("Range", &obj2)->isArray() &&
- obj2.arrayGetLength() == 4) {
- obj2.arrayGet(0, &obj3);
- cs->aMin = obj3.getNum();
- obj3.free();
- obj2.arrayGet(1, &obj3);
- cs->aMax = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2, &obj3);
- cs->bMin = obj3.getNum();
- obj3.free();
- obj2.arrayGet(3, &obj3);
- cs->bMax = obj3.getNum();
- obj3.free();
- }
- obj2.free();
- obj1.free();
-
- cs->kr = 1 / (xyzrgb[0][0] * cs->whiteX +
- xyzrgb[0][1] * cs->whiteY +
- xyzrgb[0][2] * cs->whiteZ);
- cs->kg = 1 / (xyzrgb[1][0] * cs->whiteX +
- xyzrgb[1][1] * cs->whiteY +
- xyzrgb[1][2] * cs->whiteZ);
- cs->kb = 1 / (xyzrgb[2][0] * cs->whiteX +
- xyzrgb[2][1] * cs->whiteY +
- xyzrgb[2][2] * cs->whiteZ);
-
- return cs;
-}
-
-void GfxLabColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- GfxRGB rgb;
-
- getRGB(color, &rgb);
- *gray = clip01((GfxColorComp)(0.299 * rgb.r +
- 0.587 * rgb.g +
- 0.114 * rgb.b + 0.5));
-}
-
-void GfxLabColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- double X, Y, Z;
- double t1, t2;
- double r, g, b;
-
- // convert L*a*b* to CIE 1931 XYZ color space
- t1 = (colToDbl(color->c[0]) + 16) / 116;
- t2 = t1 + colToDbl(color->c[1]) / 500;
- if (t2 >= (6.0 / 29.0)) {
- X = t2 * t2 * t2;
- } else {
- X = (108.0 / 841.0) * (t2 - (4.0 / 29.0));
- }
- X *= whiteX;
- if (t1 >= (6.0 / 29.0)) {
- Y = t1 * t1 * t1;
- } else {
- Y = (108.0 / 841.0) * (t1 - (4.0 / 29.0));
- }
- Y *= whiteY;
- t2 = t1 - colToDbl(color->c[2]) / 200;
- if (t2 >= (6.0 / 29.0)) {
- Z = t2 * t2 * t2;
- } else {
- Z = (108.0 / 841.0) * (t2 - (4.0 / 29.0));
- }
- Z *= whiteZ;
-
- // convert XYZ to RGB, including gamut mapping and gamma correction
- r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z;
- g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
- b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
- rgb->r = dblToCol(pow(clip01(r * kr), 0.5));
- rgb->g = dblToCol(pow(clip01(g * kg), 0.5));
- rgb->b = dblToCol(pow(clip01(b * kb), 0.5));
-}
-
-void GfxLabColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- GfxRGB rgb;
- GfxColorComp c, m, y, k;
-
- getRGB(color, &rgb);
- c = clip01(gfxColorComp1 - rgb.r);
- m = clip01(gfxColorComp1 - rgb.g);
- y = clip01(gfxColorComp1 - rgb.b);
- k = c;
- if (m < k) {
- k = m;
- }
- if (y < k) {
- k = y;
- }
- cmyk->c = c - k;
- cmyk->m = m - k;
- cmyk->y = y - k;
- cmyk->k = k;
-}
-
-void GfxLabColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
- if (aMin > 0) {
- color->c[1] = dblToCol(aMin);
- } else if (aMax < 0) {
- color->c[1] = dblToCol(aMax);
- } else {
- color->c[1] = 0;
- }
- if (bMin > 0) {
- color->c[2] = dblToCol(bMin);
- } else if (bMax < 0) {
- color->c[2] = dblToCol(bMax);
- } else {
- color->c[2] = 0;
- }
-}
-
-void GfxLabColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
- int /*maxImgPixel*/) {
- decodeLow[0] = 0;
- decodeRange[0] = 100;
- decodeLow[1] = aMin;
- decodeRange[1] = aMax - aMin;
- decodeLow[2] = bMin;
- decodeRange[2] = bMax - bMin;
-}
-
-//------------------------------------------------------------------------
-// GfxICCBasedColorSpace
-//------------------------------------------------------------------------
-
-GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA,
- Ref *iccProfileStreamA) {
- nComps = nCompsA;
- alt = altA;
- iccProfileStream = *iccProfileStreamA;
- rangeMin[0] = rangeMin[1] = rangeMin[2] = rangeMin[3] = 0;
- rangeMax[0] = rangeMax[1] = rangeMax[2] = rangeMax[3] = 1;
-}
-
-GfxICCBasedColorSpace::~GfxICCBasedColorSpace() {
- delete alt;
-}
-
-GfxColorSpace *GfxICCBasedColorSpace::copy() {
- GfxICCBasedColorSpace *cs;
- int i;
-
- cs = new GfxICCBasedColorSpace(nComps, alt->copy(), &iccProfileStream);
- for (i = 0; i < 4; ++i) {
- cs->rangeMin[i] = rangeMin[i];
- cs->rangeMax[i] = rangeMax[i];
- }
- return cs;
-}
-
-GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr) {
- GfxICCBasedColorSpace *cs;
- Ref iccProfileStreamA;
- int nCompsA;
- GfxColorSpace *altA;
- Dict *dict;
- Object obj1, obj2, obj3;
- int i;
-
- arr->getNF(1, &obj1);
- if (obj1.isRef()) {
- iccProfileStreamA = obj1.getRef();
- } else {
- iccProfileStreamA.num = 0;
- iccProfileStreamA.gen = 0;
- }
- obj1.free();
- arr->get(1, &obj1);
- if (!obj1.isStream()) {
- error(-1, "Bad ICCBased color space (stream)");
- obj1.free();
- return NULL;
- }
- dict = obj1.streamGetDict();
- if (!dict->lookup("N", &obj2)->isInt()) {
- error(-1, "Bad ICCBased color space (N)");
- obj2.free();
- obj1.free();
- return NULL;
- }
- nCompsA = obj2.getInt();
- obj2.free();
- if (nCompsA > gfxColorMaxComps) {
- error(-1, "ICCBased color space with too many (%d > %d) components",
- nCompsA, gfxColorMaxComps);
- nCompsA = gfxColorMaxComps;
- }
- if (dict->lookup("Alternate", &obj2)->isNull() ||
- !(altA = GfxColorSpace::parse(&obj2))) {
- switch (nCompsA) {
- case 1:
- altA = new GfxDeviceGrayColorSpace();
- break;
- case 3:
- altA = new GfxDeviceRGBColorSpace();
- break;
- case 4:
- altA = new GfxDeviceCMYKColorSpace();
- break;
- default:
- error(-1, "Bad ICCBased color space - invalid N");
- obj2.free();
- obj1.free();
- return NULL;
- }
- }
- obj2.free();
- cs = new GfxICCBasedColorSpace(nCompsA, altA, &iccProfileStreamA);
- if (dict->lookup("Range", &obj2)->isArray() &&
- obj2.arrayGetLength() == 2 * nCompsA) {
- for (i = 0; i < nCompsA; ++i) {
- obj2.arrayGet(2*i, &obj3);
- cs->rangeMin[i] = obj3.getNum();
- obj3.free();
- obj2.arrayGet(2*i+1, &obj3);
- cs->rangeMax[i] = obj3.getNum();
- obj3.free();
- }
- }
- obj2.free();
- obj1.free();
- return cs;
-}
-
-void GfxICCBasedColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- alt->getGray(color, gray);
-}
-
-void GfxICCBasedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- alt->getRGB(color, rgb);
-}
-
-void GfxICCBasedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- alt->getCMYK(color, cmyk);
-}
-
-void GfxICCBasedColorSpace::getDefaultColor(GfxColor *color) {
- int i;
-
- for (i = 0; i < nComps; ++i) {
- if (rangeMin[i] > 0) {
- color->c[i] = dblToCol(rangeMin[i]);
- } else if (rangeMax[i] < 0) {
- color->c[i] = dblToCol(rangeMax[i]);
- } else {
- color->c[i] = 0;
- }
- }
-}
-
-void GfxICCBasedColorSpace::getDefaultRanges(double *decodeLow,
- double *decodeRange,
- int maxImgPixel) {
- alt->getDefaultRanges(decodeLow, decodeRange, maxImgPixel);
-
-#if 0
- // this is nominally correct, but some PDF files don't set the
- // correct ranges in the ICCBased dict
- int i;
-
- for (i = 0; i < nComps; ++i) {
- decodeLow[i] = rangeMin[i];
- decodeRange[i] = rangeMax[i] - rangeMin[i];
- }
-#endif
-}
-
-//------------------------------------------------------------------------
-// GfxIndexedColorSpace
-//------------------------------------------------------------------------
-
-GfxIndexedColorSpace::GfxIndexedColorSpace(GfxColorSpace *baseA,
- int indexHighA) {
- base = baseA;
- indexHigh = indexHighA;
- lookup = (Guchar *)gmallocn((indexHigh + 1) * base->getNComps(),
- sizeof(Guchar));
-}
-
-GfxIndexedColorSpace::~GfxIndexedColorSpace() {
- delete base;
- gfree(lookup);
-}
-
-GfxColorSpace *GfxIndexedColorSpace::copy() {
- GfxIndexedColorSpace *cs;
-
- cs = new GfxIndexedColorSpace(base->copy(), indexHigh);
- memcpy(cs->lookup, lookup,
- (indexHigh + 1) * base->getNComps() * sizeof(Guchar));
- return cs;
-}
-
-GfxColorSpace *GfxIndexedColorSpace::parse(Array *arr) {
- GfxIndexedColorSpace *cs;
- GfxColorSpace *baseA;
- int indexHighA;
- Object obj1;
- int x;
- char *s;
- int n, i, j;
-
- if (arr->getLength() != 4) {
- error(-1, "Bad Indexed color space");
- goto err1;
- }
- arr->get(1, &obj1);
- if (!(baseA = GfxColorSpace::parse(&obj1))) {
- error(-1, "Bad Indexed color space (base color space)");
- goto err2;
- }
- obj1.free();
- if (!arr->get(2, &obj1)->isInt()) {
- error(-1, "Bad Indexed color space (hival)");
- delete baseA;
- goto err2;
- }
- indexHighA = obj1.getInt();
- if (indexHighA < 0 || indexHighA > 255) {
- // the PDF spec requires indexHigh to be in [0,255] -- allowing
- // values larger than 255 creates a security hole: if nComps *
- // indexHigh is greater than 2^31, the loop below may overwrite
- // past the end of the array
- error(-1, "Bad Indexed color space (invalid indexHigh value)");
- delete baseA;
- goto err2;
- }
- obj1.free();
- cs = new GfxIndexedColorSpace(baseA, indexHighA);
- arr->get(3, &obj1);
- n = baseA->getNComps();
- if (obj1.isStream()) {
- obj1.streamReset();
- for (i = 0; i <= indexHighA; ++i) {
- for (j = 0; j < n; ++j) {
- if ((x = obj1.streamGetChar()) == EOF) {
- error(-1, "Bad Indexed color space (lookup table stream too short)");
- goto err3;
- }
- cs->lookup[i*n + j] = (Guchar)x;
- }
- }
- obj1.streamClose();
- } else if (obj1.isString()) {
- if (obj1.getString()->getLength() < (indexHighA + 1) * n) {
- error(-1, "Bad Indexed color space (lookup table string too short)");
- goto err3;
- }
- s = obj1.getString()->getCString();
- for (i = 0; i <= indexHighA; ++i) {
- for (j = 0; j < n; ++j) {
- cs->lookup[i*n + j] = (Guchar)*s++;
- }
- }
- } else {
- error(-1, "Bad Indexed color space (lookup table)");
- goto err3;
- }
- obj1.free();
- return cs;
-
- err3:
- delete cs;
- err2:
- obj1.free();
- err1:
- return NULL;
-}
-
-GfxColor *GfxIndexedColorSpace::mapColorToBase(GfxColor *color,
- GfxColor *baseColor) {
- Guchar *p;
- double low[gfxColorMaxComps], range[gfxColorMaxComps];
- int n, i;
-
- n = base->getNComps();
- base->getDefaultRanges(low, range, indexHigh);
- p = &lookup[(int)(colToDbl(color->c[0]) + 0.5) * n];
- for (i = 0; i < n; ++i) {
- baseColor->c[i] = dblToCol(low[i] + (p[i] / 255.0) * range[i]);
- }
- return baseColor;
-}
-
-void GfxIndexedColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- GfxColor color2;
-
- base->getGray(mapColorToBase(color, &color2), gray);
-}
-
-void GfxIndexedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- GfxColor color2;
-
- base->getRGB(mapColorToBase(color, &color2), rgb);
-}
-
-void GfxIndexedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- GfxColor color2;
-
- base->getCMYK(mapColorToBase(color, &color2), cmyk);
-}
-
-void GfxIndexedColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = 0;
-}
-
-void GfxIndexedColorSpace::getDefaultRanges(double *decodeLow,
- double *decodeRange,
- int maxImgPixel) {
- decodeLow[0] = 0;
- decodeRange[0] = maxImgPixel;
-}
-
-//------------------------------------------------------------------------
-// GfxSeparationColorSpace
-//------------------------------------------------------------------------
-
-GfxSeparationColorSpace::GfxSeparationColorSpace(GString *nameA,
- GfxColorSpace *altA,
- Function *funcA) {
- name = nameA;
- alt = altA;
- func = funcA;
- nonMarking = !name->cmp("None");
-}
-
-GfxSeparationColorSpace::~GfxSeparationColorSpace() {
- delete name;
- delete alt;
- delete func;
-}
-
-GfxColorSpace *GfxSeparationColorSpace::copy() {
- return new GfxSeparationColorSpace(name->copy(), alt->copy(), func->copy());
-}
-
-//~ handle the 'All' and 'None' colorants
-GfxColorSpace *GfxSeparationColorSpace::parse(Array *arr) {
- GfxSeparationColorSpace *cs;
- GString *nameA;
- GfxColorSpace *altA;
- Function *funcA;
- Object obj1;
-
- if (arr->getLength() != 4) {
- error(-1, "Bad Separation color space");
- goto err1;
- }
- if (!arr->get(1, &obj1)->isName()) {
- error(-1, "Bad Separation color space (name)");
- goto err2;
- }
- nameA = new GString(obj1.getName());
- obj1.free();
- arr->get(2, &obj1);
- if (!(altA = GfxColorSpace::parse(&obj1))) {
- error(-1, "Bad Separation color space (alternate color space)");
- goto err3;
- }
- obj1.free();
- arr->get(3, &obj1);
- if (!(funcA = Function::parse(&obj1))) {
- goto err4;
- }
- obj1.free();
- cs = new GfxSeparationColorSpace(nameA, altA, funcA);
- return cs;
-
- err4:
- delete altA;
- err3:
- delete nameA;
- err2:
- obj1.free();
- err1:
- return NULL;
-}
-
-void GfxSeparationColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- double x;
- double c[gfxColorMaxComps];
- GfxColor color2;
- int i;
-
- x = colToDbl(color->c[0]);
- func->transform(&x, c);
- for (i = 0; i < alt->getNComps(); ++i) {
- color2.c[i] = dblToCol(c[i]);
- }
- alt->getGray(&color2, gray);
-}
-
-void GfxSeparationColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- double x;
- double c[gfxColorMaxComps];
- GfxColor color2;
- int i;
-
- x = colToDbl(color->c[0]);
- func->transform(&x, c);
- for (i = 0; i < alt->getNComps(); ++i) {
- color2.c[i] = dblToCol(c[i]);
- }
- alt->getRGB(&color2, rgb);
-}
-
-void GfxSeparationColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- double x;
- double c[gfxColorMaxComps];
- GfxColor color2;
- int i;
-
- x = colToDbl(color->c[0]);
- func->transform(&x, c);
- for (i = 0; i < alt->getNComps(); ++i) {
- color2.c[i] = dblToCol(c[i]);
- }
- alt->getCMYK(&color2, cmyk);
-}
-
-void GfxSeparationColorSpace::getDefaultColor(GfxColor *color) {
- color->c[0] = gfxColorComp1;
-}
-
-//------------------------------------------------------------------------
-// GfxDeviceNColorSpace
-//------------------------------------------------------------------------
-
-GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA,
- GfxColorSpace *altA,
- Function *funcA) {
- nComps = nCompsA;
- alt = altA;
- func = funcA;
- nonMarking = gFalse;
-}
-
-GfxDeviceNColorSpace::~GfxDeviceNColorSpace() {
- int i;
-
- for (i = 0; i < nComps; ++i) {
- delete names[i];
- }
- delete alt;
- delete func;
-}
-
-GfxColorSpace *GfxDeviceNColorSpace::copy() {
- GfxDeviceNColorSpace *cs;
- int i;
-
- cs = new GfxDeviceNColorSpace(nComps, alt->copy(), func->copy());
- for (i = 0; i < nComps; ++i) {
- cs->names[i] = names[i]->copy();
- }
- cs->nonMarking = nonMarking;
- return cs;
-}
-
-//~ handle the 'None' colorant
-GfxColorSpace *GfxDeviceNColorSpace::parse(Array *arr) {
- GfxDeviceNColorSpace *cs;
- int nCompsA;
- GString *namesA[gfxColorMaxComps];
- GfxColorSpace *altA;
- Function *funcA;
- Object obj1, obj2;
- int i;
-
- if (arr->getLength() != 4 && arr->getLength() != 5) {
- error(-1, "Bad DeviceN color space");
- goto err1;
- }
- if (!arr->get(1, &obj1)->isArray()) {
- error(-1, "Bad DeviceN color space (names)");
- goto err2;
- }
- nCompsA = obj1.arrayGetLength();
- if (nCompsA > gfxColorMaxComps) {
- error(-1, "DeviceN color space with too many (%d > %d) components",
- nCompsA, gfxColorMaxComps);
- nCompsA = gfxColorMaxComps;
- }
- for (i = 0; i < nCompsA; ++i) {
- if (!obj1.arrayGet(i, &obj2)->isName()) {
- error(-1, "Bad DeviceN color space (names)");
- obj2.free();
- goto err2;
- }
- namesA[i] = new GString(obj2.getName());
- obj2.free();
- }
- obj1.free();
- arr->get(2, &obj1);
- if (!(altA = GfxColorSpace::parse(&obj1))) {
- error(-1, "Bad DeviceN color space (alternate color space)");
- goto err3;
- }
- obj1.free();
- arr->get(3, &obj1);
- if (!(funcA = Function::parse(&obj1))) {
- goto err4;
- }
- obj1.free();
- cs = new GfxDeviceNColorSpace(nCompsA, altA, funcA);
- cs->nonMarking = gTrue;
- for (i = 0; i < nCompsA; ++i) {
- cs->names[i] = namesA[i];
- if (namesA[i]->cmp("None")) {
- cs->nonMarking = gFalse;
- }
- }
- return cs;
-
- err4:
- delete altA;
- err3:
- for (i = 0; i < nCompsA; ++i) {
- delete namesA[i];
- }
- err2:
- obj1.free();
- err1:
- return NULL;
-}
-
-void GfxDeviceNColorSpace::getGray(GfxColor *color, GfxGray *gray) {
- double x[gfxColorMaxComps], c[gfxColorMaxComps];
- GfxColor color2;
- int i;
-
- for (i = 0; i < nComps; ++i) {
- x[i] = colToDbl(color->c[i]);
- }
- func->transform(x, c);
- for (i = 0; i < alt->getNComps(); ++i) {
- color2.c[i] = dblToCol(c[i]);
- }
- alt->getGray(&color2, gray);
-}
-
-void GfxDeviceNColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
- double x[gfxColorMaxComps], c[gfxColorMaxComps];
- GfxColor color2;
- int i;
-
- for (i = 0; i < nComps; ++i) {
- x[i] = colToDbl(color->c[i]);
- }
- func->transform(x, c);
- for (i = 0; i < alt->getNComps(); ++i) {
- color2.c[i] = dblToCol(c[i]);
- }
- alt->getRGB(&color2, rgb);
-}
-
-void GfxDeviceNColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
- double x[gfxColorMaxComps], c[gfxColorMaxComps];
- GfxColor color2;
- int i;
-
- for (i = 0; i < nComps; ++i) {
- x[i] = colToDbl(color->c[i]);
- }
- func->transform(x, c);
- for (i = 0; i < alt->getNComps(); ++i) {
- color2.c[i] = dblToCol(c[i]);
- }
- alt->getCMYK(&color2, cmyk);
-}
-
-void GfxDeviceNColorSpace::getDefaultColor(GfxColor *color) {
- int i;
-
- for (i = 0; i < nComps; ++i) {
- color->c[i] = gfxColorComp1;
- }
-}
-
-//------------------------------------------------------------------------
-// GfxPatternColorSpace
-//------------------------------------------------------------------------
-
-GfxPatternColorSpace::GfxPatternColorSpace(GfxColorSpace *underA) {
- under = underA;
-}
-
-GfxPatternColorSpace::~GfxPatternColorSpace() {
- if (under) {
- delete under;
- }
-}
-
-GfxColorSpace *GfxPatternColorSpace::copy() {
- return new GfxPatternColorSpace(under ? under->copy() :
- (GfxColorSpace *)NULL);
-}
-
-GfxColorSpace *GfxPatternColorSpace::parse(Array *arr) {
- GfxPatternColorSpace *cs;
- GfxColorSpace *underA;
- Object obj1;
-
- if (arr->getLength() != 1 && arr->getLength() != 2) {
- error(-1, "Bad Pattern color space");
- return NULL;
- }
- underA = NULL;
- if (arr->getLength() == 2) {
- arr->get(1, &obj1);
- if (!(underA = GfxColorSpace::parse(&obj1))) {
- error(-1, "Bad Pattern color space (underlying color space)");
- obj1.free();
- return NULL;
- }
- obj1.free();
- }
- cs = new GfxPatternColorSpace(underA);
- return cs;
-}
-
-void GfxPatternColorSpace::getGray(GfxColor * /*color*/, GfxGray *gray) {
- *gray = 0;
-}
-
-void GfxPatternColorSpace::getRGB(GfxColor * /*color*/, GfxRGB *rgb) {
- rgb->r = rgb->g = rgb->b = 0;
-}
-
-void GfxPatternColorSpace::getCMYK(GfxColor * /*color*/, GfxCMYK *cmyk) {
- cmyk->c = cmyk->m = cmyk->y = 0;
- cmyk->k = 1;
-}
-
-void GfxPatternColorSpace::getDefaultColor(GfxColor * /*color*/) {
- // not used
-}
-
-//------------------------------------------------------------------------
-// Pattern
-//------------------------------------------------------------------------
-
-GfxPattern::GfxPattern(int typeA) {
- type = typeA;
-}
-
-GfxPattern::~GfxPattern() {
-}
-
-GfxPattern *GfxPattern::parse(Object *obj) {
- GfxPattern *pattern;
- Object obj1;
-
- if (obj->isDict()) {
- obj->dictLookup("PatternType", &obj1);
- } else if (obj->isStream()) {
- obj->streamGetDict()->lookup("PatternType", &obj1);
- } else {
- return NULL;
- }
- pattern = NULL;
- if (obj1.isInt() && obj1.getInt() == 1) {
- pattern = GfxTilingPattern::parse(obj);
- } else if (obj1.isInt() && obj1.getInt() == 2) {
- pattern = GfxShadingPattern::parse(obj);
- }
- obj1.free();
- return pattern;
-}
-
-//------------------------------------------------------------------------
-// GfxTilingPattern
-//------------------------------------------------------------------------
-
-GfxTilingPattern *GfxTilingPattern::parse(Object *patObj) {
- GfxTilingPattern *pat;
- Dict *dict;
- int paintTypeA, tilingTypeA;
- double bboxA[4], matrixA[6];
- double xStepA, yStepA;
- Object resDictA;
- Object obj1, obj2;
- int i;
-
- if (!patObj->isStream()) {
- return NULL;
- }
- dict = patObj->streamGetDict();
-
- if (dict->lookup("PaintType", &obj1)->isInt()) {
- paintTypeA = obj1.getInt();
- } else {
- paintTypeA = 1;
- error(-1, "Invalid or missing PaintType in pattern");
- }
- obj1.free();
- if (dict->lookup("TilingType", &obj1)->isInt()) {
- tilingTypeA = obj1.getInt();
- } else {
- tilingTypeA = 1;
- error(-1, "Invalid or missing TilingType in pattern");
- }
- obj1.free();
- bboxA[0] = bboxA[1] = 0;
- bboxA[2] = bboxA[3] = 1;
- if (dict->lookup("BBox", &obj1)->isArray() &&
- obj1.arrayGetLength() == 4) {
- for (i = 0; i < 4; ++i) {
- if (obj1.arrayGet(i, &obj2)->isNum()) {
- bboxA[i] = obj2.getNum();
- }
- obj2.free();
- }
- } else {
- error(-1, "Invalid or missing BBox in pattern");
- }
- obj1.free();
- if (dict->lookup("XStep", &obj1)->isNum()) {
- xStepA = obj1.getNum();
- } else {
- xStepA = 1;
- error(-1, "Invalid or missing XStep in pattern");
- }
- obj1.free();
- if (dict->lookup("YStep", &obj1)->isNum()) {
- yStepA = obj1.getNum();
- } else {
- yStepA = 1;
- error(-1, "Invalid or missing YStep in pattern");
- }
- obj1.free();
- if (!dict->lookup("Resources", &resDictA)->isDict()) {
- resDictA.free();
- resDictA.initNull();
- error(-1, "Invalid or missing Resources in pattern");
- }
- matrixA[0] = 1; matrixA[1] = 0;
- matrixA[2] = 0; matrixA[3] = 1;
- matrixA[4] = 0; matrixA[5] = 0;
- if (dict->lookup("Matrix", &obj1)->isArray() &&
- obj1.arrayGetLength() == 6) {
- for (i = 0; i < 6; ++i) {
- if (obj1.arrayGet(i, &obj2)->isNum()) {
- matrixA[i] = obj2.getNum();
- }
- obj2.free();
- }
- }
- obj1.free();
-
- pat = new GfxTilingPattern(paintTypeA, tilingTypeA, bboxA, xStepA, yStepA,
- &resDictA, matrixA, patObj);
- resDictA.free();
- return pat;
-}
-
-GfxTilingPattern::GfxTilingPattern(int paintTypeA, int tilingTypeA,
- double *bboxA, double xStepA, double yStepA,
- Object *resDictA, double *matrixA,
- Object *contentStreamA):
- GfxPattern(1)
-{
- int i;
-
- paintType = paintTypeA;
- tilingType = tilingTypeA;
- for (i = 0; i < 4; ++i) {
- bbox[i] = bboxA[i];
- }
- xStep = xStepA;
- yStep = yStepA;
- resDictA->copy(&resDict);
- for (i = 0; i < 6; ++i) {
- matrix[i] = matrixA[i];
- }
- contentStreamA->copy(&contentStream);
-}
-
-GfxTilingPattern::~GfxTilingPattern() {
- resDict.free();
- contentStream.free();
-}
-
-GfxPattern *GfxTilingPattern::copy() {
- return new GfxTilingPattern(paintType, tilingType, bbox, xStep, yStep,
- &resDict, matrix, &contentStream);
-}
-
-//------------------------------------------------------------------------
-// GfxShadingPattern
-//------------------------------------------------------------------------
-
-GfxShadingPattern *GfxShadingPattern::parse(Object *patObj) {
- Dict *dict;
- GfxShading *shadingA;
- double matrixA[6];
- Object obj1, obj2;
- int i;
-
- if (!patObj->isDict()) {
- return NULL;
- }
- dict = patObj->getDict();
-
- dict->lookup("Shading", &obj1);
- shadingA = GfxShading::parse(&obj1);
- obj1.free();
- if (!shadingA) {
- return NULL;
- }
-
- matrixA[0] = 1; matrixA[1] = 0;
- matrixA[2] = 0; matrixA[3] = 1;
- matrixA[4] = 0; matrixA[5] = 0;
- if (dict->lookup("Matrix", &obj1)->isArray() &&
- obj1.arrayGetLength() == 6) {
- for (i = 0; i < 6; ++i) {
- if (obj1.arrayGet(i, &obj2)->isNum()) {
- matrixA[i] = obj2.getNum();
- }
- obj2.free();
- }
- }
- obj1.free();
-
- return new GfxShadingPattern(shadingA, matrixA);
-}
-
-GfxShadingPattern::GfxShadingPattern(GfxShading *shadingA, double *matrixA):
- GfxPattern(2)
-{
- int i;
-
- shading = shadingA;
- for (i = 0; i < 6; ++i) {
- matrix[i] = matrixA[i];
- }
-}
-
-GfxShadingPattern::~GfxShadingPattern() {
- delete shading;
-}
-
-GfxPattern *GfxShadingPattern::copy() {
- return new GfxShadingPattern(shading->copy(), matrix);
-}
-
-//------------------------------------------------------------------------
-// GfxShading
-//------------------------------------------------------------------------
-
-GfxShading::GfxShading(int typeA) {
- type = typeA;
- colorSpace = NULL;
-}
-
-GfxShading::GfxShading(GfxShading *shading) {
- int i;
-
- type = shading->type;
- colorSpace = shading->colorSpace->copy();
- for (i = 0; i < gfxColorMaxComps; ++i) {
- background.c[i] = shading->background.c[i];
- }
- hasBackground = shading->hasBackground;
- xMin = shading->xMin;
- yMin = shading->yMin;
- xMax = shading->xMax;
- yMax = shading->yMax;
- hasBBox = shading->hasBBox;
-}
-
-GfxShading::~GfxShading() {
- if (colorSpace) {
- delete colorSpace;
- }
-}
-
-GfxShading *GfxShading::parse(Object *obj) {
- GfxShading *shading;
- Dict *dict;
- int typeA;
- Object obj1;
-
- if (obj->isDict()) {
- dict = obj->getDict();
- } else if (obj->isStream()) {
- dict = obj->streamGetDict();
- } else {
- return NULL;
- }
-
- if (!dict->lookup("ShadingType", &obj1)->isInt()) {
- error(-1, "Invalid ShadingType in shading dictionary");
- obj1.free();
- return NULL;
- }
- typeA = obj1.getInt();
- obj1.free();
-
- switch (typeA) {
- case 1:
- shading = GfxFunctionShading::parse(dict);
- break;
- case 2:
- shading = GfxAxialShading::parse(dict);
- break;
- case 3:
- shading = GfxRadialShading::parse(dict);
- break;
- case 4:
- if (obj->isStream()) {
- shading = GfxGouraudTriangleShading::parse(4, dict, obj->getStream());
- } else {
- error(-1, "Invalid Type 4 shading object");
- goto err1;
- }
- break;
- case 5:
- if (obj->isStream()) {
- shading = GfxGouraudTriangleShading::parse(5, dict, obj->getStream());
- } else {
- error(-1, "Invalid Type 5 shading object");
- goto err1;
- }
- break;
- case 6:
- if (obj->isStream()) {
- shading = GfxPatchMeshShading::parse(6, dict, obj->getStream());
- } else {
- error(-1, "Invalid Type 6 shading object");
- goto err1;
- }
- break;
- case 7:
- if (obj->isStream()) {
- shading = GfxPatchMeshShading::parse(7, dict, obj->getStream());
- } else {
- error(-1, "Invalid Type 7 shading object");
- goto err1;
- }
- break;
- default:
- error(-1, "Unimplemented shading type %d", typeA);
- goto err1;
- }
-
- return shading;
-
- err1:
- return NULL;
-}
-
-GBool GfxShading::init(Dict *dict) {
- Object obj1, obj2;
- int i;
-
- dict->lookup("ColorSpace", &obj1);
- if (!(colorSpace = GfxColorSpace::parse(&obj1))) {
- error(-1, "Bad color space in shading dictionary");
- obj1.free();
- return gFalse;
- }
- obj1.free();
-
- for (i = 0; i < gfxColorMaxComps; ++i) {
- background.c[i] = 0;
- }
- hasBackground = gFalse;
- if (dict->lookup("Background", &obj1)->isArray()) {
- if (obj1.arrayGetLength() == colorSpace->getNComps()) {
- hasBackground = gTrue;
- for (i = 0; i < colorSpace->getNComps(); ++i) {
- background.c[i] = dblToCol(obj1.arrayGet(i, &obj2)->getNum());
- obj2.free();
- }
- } else {
- error(-1, "Bad Background in shading dictionary");
- }
- }
- obj1.free();
-
- xMin = yMin = xMax = yMax = 0;
- hasBBox = gFalse;
- if (dict->lookup("BBox", &obj1)->isArray()) {
- if (obj1.arrayGetLength() == 4) {
- hasBBox = gTrue;
- xMin = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- yMin = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- xMax = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- yMax = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- } else {
- error(-1, "Bad BBox in shading dictionary");
- }
- }
- obj1.free();
-
- return gTrue;
-}
-
-//------------------------------------------------------------------------
-// GfxFunctionShading
-//------------------------------------------------------------------------
-
-GfxFunctionShading::GfxFunctionShading(double x0A, double y0A,
- double x1A, double y1A,
- double *matrixA,
- Function **funcsA, int nFuncsA):
- GfxShading(1)
-{
- int i;
-
- x0 = x0A;
- y0 = y0A;
- x1 = x1A;
- y1 = y1A;
- for (i = 0; i < 6; ++i) {
- matrix[i] = matrixA[i];
- }
- nFuncs = nFuncsA;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = funcsA[i];
- }
-}
-
-GfxFunctionShading::GfxFunctionShading(GfxFunctionShading *shading):
- GfxShading(shading)
-{
- int i;
-
- x0 = shading->x0;
- y0 = shading->y0;
- x1 = shading->x1;
- y1 = shading->y1;
- for (i = 0; i < 6; ++i) {
- matrix[i] = shading->matrix[i];
- }
- nFuncs = shading->nFuncs;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = shading->funcs[i]->copy();
- }
-}
-
-GfxFunctionShading::~GfxFunctionShading() {
- int i;
-
- for (i = 0; i < nFuncs; ++i) {
- delete funcs[i];
- }
-}
-
-GfxFunctionShading *GfxFunctionShading::parse(Dict *dict) {
- GfxFunctionShading *shading;
- double x0A, y0A, x1A, y1A;
- double matrixA[6];
- Function *funcsA[gfxColorMaxComps];
- int nFuncsA;
- Object obj1, obj2;
- int i;
-
- x0A = y0A = 0;
- x1A = y1A = 1;
- if (dict->lookup("Domain", &obj1)->isArray() &&
- obj1.arrayGetLength() == 4) {
- x0A = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- x1A = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- y0A = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- y1A = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- }
- obj1.free();
-
- matrixA[0] = 1; matrixA[1] = 0;
- matrixA[2] = 0; matrixA[3] = 1;
- matrixA[4] = 0; matrixA[5] = 0;
- if (dict->lookup("Matrix", &obj1)->isArray() &&
- obj1.arrayGetLength() == 6) {
- matrixA[0] = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- matrixA[1] = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- matrixA[2] = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- matrixA[3] = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- matrixA[4] = obj1.arrayGet(4, &obj2)->getNum();
- obj2.free();
- matrixA[5] = obj1.arrayGet(5, &obj2)->getNum();
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("Function", &obj1);
- if (obj1.isArray()) {
- nFuncsA = obj1.arrayGetLength();
- if (nFuncsA > gfxColorMaxComps) {
- error(-1, "Invalid Function array in shading dictionary");
- goto err1;
- }
- for (i = 0; i < nFuncsA; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!(funcsA[i] = Function::parse(&obj2))) {
- goto err2;
- }
- obj2.free();
- }
- } else {
- nFuncsA = 1;
- if (!(funcsA[0] = Function::parse(&obj1))) {
- goto err1;
- }
- }
- obj1.free();
-
- shading = new GfxFunctionShading(x0A, y0A, x1A, y1A, matrixA,
- funcsA, nFuncsA);
- if (!shading->init(dict)) {
- delete shading;
- return NULL;
- }
- return shading;
-
- err2:
- obj2.free();
- err1:
- obj1.free();
- return NULL;
-}
-
-GfxShading *GfxFunctionShading::copy() {
- return new GfxFunctionShading(this);
-}
-
-void GfxFunctionShading::getColor(double x, double y, GfxColor *color) {
- double in[2], out[gfxColorMaxComps];
- int i;
-
- // NB: there can be one function with n outputs or n functions with
- // one output each (where n = number of color components)
- for (i = 0; i < gfxColorMaxComps; ++i) {
- out[i] = 0;
- }
- in[0] = x;
- in[1] = y;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i]->transform(in, &out[i]);
- }
- for (i = 0; i < gfxColorMaxComps; ++i) {
- color->c[i] = dblToCol(out[i]);
- }
-}
-
-//------------------------------------------------------------------------
-// GfxAxialShading
-//------------------------------------------------------------------------
-
-GfxAxialShading::GfxAxialShading(double x0A, double y0A,
- double x1A, double y1A,
- double t0A, double t1A,
- Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A):
- GfxShading(2)
-{
- int i;
-
- x0 = x0A;
- y0 = y0A;
- x1 = x1A;
- y1 = y1A;
- t0 = t0A;
- t1 = t1A;
- nFuncs = nFuncsA;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = funcsA[i];
- }
- extend0 = extend0A;
- extend1 = extend1A;
-}
-
-GfxAxialShading::GfxAxialShading(GfxAxialShading *shading):
- GfxShading(shading)
-{
- int i;
-
- x0 = shading->x0;
- y0 = shading->y0;
- x1 = shading->x1;
- y1 = shading->y1;
- t0 = shading->t0;
- y1 = shading->t1;
- nFuncs = shading->nFuncs;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = shading->funcs[i]->copy();
- }
- extend0 = shading->extend0;
- extend1 = shading->extend1;
-}
-
-GfxAxialShading::~GfxAxialShading() {
- int i;
-
- for (i = 0; i < nFuncs; ++i) {
- delete funcs[i];
- }
-}
-
-GfxAxialShading *GfxAxialShading::parse(Dict *dict) {
- GfxAxialShading *shading;
- double x0A, y0A, x1A, y1A;
- double t0A, t1A;
- Function *funcsA[gfxColorMaxComps];
- int nFuncsA;
- GBool extend0A, extend1A;
- Object obj1, obj2;
- int i;
-
- x0A = y0A = x1A = y1A = 0;
- if (dict->lookup("Coords", &obj1)->isArray() &&
- obj1.arrayGetLength() == 4) {
- x0A = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- y0A = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- x1A = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- y1A = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- } else {
- error(-1, "Missing or invalid Coords in shading dictionary");
- goto err1;
- }
- obj1.free();
-
- t0A = 0;
- t1A = 1;
- if (dict->lookup("Domain", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2) {
- t0A = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- t1A = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("Function", &obj1);
- if (obj1.isArray()) {
- nFuncsA = obj1.arrayGetLength();
- if (nFuncsA > gfxColorMaxComps) {
- error(-1, "Invalid Function array in shading dictionary");
- goto err1;
- }
- for (i = 0; i < nFuncsA; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!(funcsA[i] = Function::parse(&obj2))) {
- obj1.free();
- obj2.free();
- goto err1;
- }
- obj2.free();
- }
- } else {
- nFuncsA = 1;
- if (!(funcsA[0] = Function::parse(&obj1))) {
- obj1.free();
- goto err1;
- }
- }
- obj1.free();
-
- extend0A = extend1A = gFalse;
- if (dict->lookup("Extend", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2) {
- extend0A = obj1.arrayGet(0, &obj2)->getBool();
- obj2.free();
- extend1A = obj1.arrayGet(1, &obj2)->getBool();
- obj2.free();
- }
- obj1.free();
-
- shading = new GfxAxialShading(x0A, y0A, x1A, y1A, t0A, t1A,
- funcsA, nFuncsA, extend0A, extend1A);
- if (!shading->init(dict)) {
- delete shading;
- return NULL;
- }
- return shading;
-
- err1:
- return NULL;
-}
-
-GfxShading *GfxAxialShading::copy() {
- return new GfxAxialShading(this);
-}
-
-void GfxAxialShading::getColor(double t, GfxColor *color) {
- double out[gfxColorMaxComps];
- int i;
-
- // NB: there can be one function with n outputs or n functions with
- // one output each (where n = number of color components)
- for (i = 0; i < gfxColorMaxComps; ++i) {
- out[i] = 0;
- }
- for (i = 0; i < nFuncs; ++i) {
- funcs[i]->transform(&t, &out[i]);
- }
- for (i = 0; i < gfxColorMaxComps; ++i) {
- color->c[i] = dblToCol(out[i]);
- }
-}
-
-//------------------------------------------------------------------------
-// GfxRadialShading
-//------------------------------------------------------------------------
-
-GfxRadialShading::GfxRadialShading(double x0A, double y0A, double r0A,
- double x1A, double y1A, double r1A,
- double t0A, double t1A,
- Function **funcsA, int nFuncsA,
- GBool extend0A, GBool extend1A):
- GfxShading(3)
-{
- int i;
-
- x0 = x0A;
- y0 = y0A;
- r0 = r0A;
- x1 = x1A;
- y1 = y1A;
- r1 = r1A;
- t0 = t0A;
- t1 = t1A;
- nFuncs = nFuncsA;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = funcsA[i];
- }
- extend0 = extend0A;
- extend1 = extend1A;
-}
-
-GfxRadialShading::GfxRadialShading(GfxRadialShading *shading):
- GfxShading(shading)
-{
- int i;
-
- x0 = shading->x0;
- y0 = shading->y0;
- r0 = shading->r0;
- x1 = shading->x1;
- y1 = shading->y1;
- r1 = shading->r1;
- t0 = shading->t0;
- y1 = shading->t1;
- nFuncs = shading->nFuncs;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = shading->funcs[i]->copy();
- }
- extend0 = shading->extend0;
- extend1 = shading->extend1;
-}
-
-GfxRadialShading::~GfxRadialShading() {
- int i;
-
- for (i = 0; i < nFuncs; ++i) {
- delete funcs[i];
- }
-}
-
-GfxRadialShading *GfxRadialShading::parse(Dict *dict) {
- GfxRadialShading *shading;
- double x0A, y0A, r0A, x1A, y1A, r1A;
- double t0A, t1A;
- Function *funcsA[gfxColorMaxComps];
- int nFuncsA;
- GBool extend0A, extend1A;
- Object obj1, obj2;
- int i;
-
- x0A = y0A = r0A = x1A = y1A = r1A = 0;
- if (dict->lookup("Coords", &obj1)->isArray() &&
- obj1.arrayGetLength() == 6) {
- x0A = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- y0A = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- r0A = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- x1A = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- y1A = obj1.arrayGet(4, &obj2)->getNum();
- obj2.free();
- r1A = obj1.arrayGet(5, &obj2)->getNum();
- obj2.free();
- } else {
- error(-1, "Missing or invalid Coords in shading dictionary");
- goto err1;
- }
- obj1.free();
-
- t0A = 0;
- t1A = 1;
- if (dict->lookup("Domain", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2) {
- t0A = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- t1A = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("Function", &obj1);
- if (obj1.isArray()) {
- nFuncsA = obj1.arrayGetLength();
- if (nFuncsA > gfxColorMaxComps) {
- error(-1, "Invalid Function array in shading dictionary");
- goto err1;
- }
- for (i = 0; i < nFuncsA; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!(funcsA[i] = Function::parse(&obj2))) {
- obj1.free();
- obj2.free();
- goto err1;
- }
- obj2.free();
- }
- } else {
- nFuncsA = 1;
- if (!(funcsA[0] = Function::parse(&obj1))) {
- obj1.free();
- goto err1;
- }
- }
- obj1.free();
-
- extend0A = extend1A = gFalse;
- if (dict->lookup("Extend", &obj1)->isArray() &&
- obj1.arrayGetLength() == 2) {
- extend0A = obj1.arrayGet(0, &obj2)->getBool();
- obj2.free();
- extend1A = obj1.arrayGet(1, &obj2)->getBool();
- obj2.free();
- }
- obj1.free();
-
- shading = new GfxRadialShading(x0A, y0A, r0A, x1A, y1A, r1A, t0A, t1A,
- funcsA, nFuncsA, extend0A, extend1A);
- if (!shading->init(dict)) {
- delete shading;
- return NULL;
- }
- return shading;
-
- err1:
- return NULL;
-}
-
-GfxShading *GfxRadialShading::copy() {
- return new GfxRadialShading(this);
-}
-
-void GfxRadialShading::getColor(double t, GfxColor *color) {
- double out[gfxColorMaxComps];
- int i;
-
- // NB: there can be one function with n outputs or n functions with
- // one output each (where n = number of color components)
- for (i = 0; i < gfxColorMaxComps; ++i) {
- out[i] = 0;
- }
- for (i = 0; i < nFuncs; ++i) {
- funcs[i]->transform(&t, &out[i]);
- }
- for (i = 0; i < gfxColorMaxComps; ++i) {
- color->c[i] = dblToCol(out[i]);
- }
-}
-
-//------------------------------------------------------------------------
-// GfxShadingBitBuf
-//------------------------------------------------------------------------
-
-class GfxShadingBitBuf {
-public:
-
- GfxShadingBitBuf(Stream *strA);
- ~GfxShadingBitBuf();
- GBool getBits(int n, Guint *val);
- void flushBits();
-
-private:
-
- Stream *str;
- int bitBuf;
- int nBits;
-};
-
-GfxShadingBitBuf::GfxShadingBitBuf(Stream *strA) {
- str = strA;
- str->reset();
- bitBuf = 0;
- nBits = 0;
-}
-
-GfxShadingBitBuf::~GfxShadingBitBuf() {
- str->close();
-}
-
-GBool GfxShadingBitBuf::getBits(int n, Guint *val) {
- int x;
-
- if (nBits >= n) {
- x = (bitBuf >> (nBits - n)) & ((1 << n) - 1);
- nBits -= n;
- } else {
- x = 0;
- if (nBits > 0) {
- x = bitBuf & ((1 << nBits) - 1);
- n -= nBits;
- nBits = 0;
- }
- while (n > 0) {
- if ((bitBuf = str->getChar()) == EOF) {
- nBits = 0;
- return gFalse;
- }
- if (n >= 8) {
- x = (x << 8) | bitBuf;
- n -= 8;
- } else {
- x = (x << n) | (bitBuf >> (8 - n));
- nBits = 8 - n;
- n = 0;
- }
- }
- }
- *val = x;
- return gTrue;
-}
-
-void GfxShadingBitBuf::flushBits() {
- bitBuf = 0;
- nBits = 0;
-}
-
-//------------------------------------------------------------------------
-// GfxGouraudTriangleShading
-//------------------------------------------------------------------------
-
-GfxGouraudTriangleShading::GfxGouraudTriangleShading(
- int typeA,
- GfxGouraudVertex *verticesA, int nVerticesA,
- int (*trianglesA)[3], int nTrianglesA,
- Function **funcsA, int nFuncsA):
- GfxShading(typeA)
-{
- int i;
-
- vertices = verticesA;
- nVertices = nVerticesA;
- triangles = trianglesA;
- nTriangles = nTrianglesA;
- nFuncs = nFuncsA;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = funcsA[i];
- }
-}
-
-GfxGouraudTriangleShading::GfxGouraudTriangleShading(
- GfxGouraudTriangleShading *shading):
- GfxShading(shading)
-{
- int i;
-
- nVertices = shading->nVertices;
- vertices = (GfxGouraudVertex *)gmallocn(nVertices, sizeof(GfxGouraudVertex));
- memcpy(vertices, shading->vertices, nVertices * sizeof(GfxGouraudVertex));
- nTriangles = shading->nTriangles;
- triangles = (int (*)[3])gmallocn(nTriangles * 3, sizeof(int));
- memcpy(triangles, shading->triangles, nTriangles * 3 * sizeof(int));
- nFuncs = shading->nFuncs;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = shading->funcs[i]->copy();
- }
-}
-
-GfxGouraudTriangleShading::~GfxGouraudTriangleShading() {
- int i;
-
- gfree(vertices);
- gfree(triangles);
- for (i = 0; i < nFuncs; ++i) {
- delete funcs[i];
- }
-}
-
-GfxGouraudTriangleShading *GfxGouraudTriangleShading::parse(int typeA,
- Dict *dict,
- Stream *str) {
- GfxGouraudTriangleShading *shading;
- Function *funcsA[gfxColorMaxComps];
- int nFuncsA;
- int coordBits, compBits, flagBits, vertsPerRow, nRows;
- double xMin, xMax, yMin, yMax;
- double cMin[gfxColorMaxComps], cMax[gfxColorMaxComps];
- double xMul, yMul;
- double cMul[gfxColorMaxComps];
- GfxGouraudVertex *verticesA;
- int (*trianglesA)[3];
- int nComps, nVerticesA, nTrianglesA, vertSize, triSize;
- Guint x, y, flag;
- Guint c[gfxColorMaxComps];
- GfxShadingBitBuf *bitBuf;
- Object obj1, obj2;
- int i, j, k, state;
-
- if (dict->lookup("BitsPerCoordinate", &obj1)->isInt()) {
- coordBits = obj1.getInt();
- } else {
- error(-1, "Missing or invalid BitsPerCoordinate in shading dictionary");
- goto err2;
- }
- obj1.free();
- if (dict->lookup("BitsPerComponent", &obj1)->isInt()) {
- compBits = obj1.getInt();
- } else {
- error(-1, "Missing or invalid BitsPerComponent in shading dictionary");
- goto err2;
- }
- obj1.free();
- flagBits = vertsPerRow = 0; // make gcc happy
- if (typeA == 4) {
- if (dict->lookup("BitsPerFlag", &obj1)->isInt()) {
- flagBits = obj1.getInt();
- } else {
- error(-1, "Missing or invalid BitsPerFlag in shading dictionary");
- goto err2;
- }
- obj1.free();
- } else {
- if (dict->lookup("VerticesPerRow", &obj1)->isInt()) {
- vertsPerRow = obj1.getInt();
- } else {
- error(-1, "Missing or invalid VerticesPerRow in shading dictionary");
- goto err2;
- }
- obj1.free();
- }
- if (dict->lookup("Decode", &obj1)->isArray() &&
- obj1.arrayGetLength() >= 6) {
- xMin = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- xMax = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- xMul = (xMax - xMin) / (pow(2.0, coordBits) - 1);
- yMin = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- yMax = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- yMul = (yMax - yMin) / (pow(2.0, coordBits) - 1);
- for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) {
- cMin[i] = obj1.arrayGet(4 + 2*i, &obj2)->getNum();
- obj2.free();
- cMax[i] = obj1.arrayGet(5 + 2*i, &obj2)->getNum();
- obj2.free();
- cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1);
- }
- nComps = i;
- } else {
- error(-1, "Missing or invalid Decode array in shading dictionary");
- goto err2;
- }
- obj1.free();
-
- if (!dict->lookup("Function", &obj1)->isNull()) {
- if (obj1.isArray()) {
- nFuncsA = obj1.arrayGetLength();
- if (nFuncsA > gfxColorMaxComps) {
- error(-1, "Invalid Function array in shading dictionary");
- goto err1;
- }
- for (i = 0; i < nFuncsA; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!(funcsA[i] = Function::parse(&obj2))) {
- obj1.free();
- obj2.free();
- goto err1;
- }
- obj2.free();
- }
- } else {
- nFuncsA = 1;
- if (!(funcsA[0] = Function::parse(&obj1))) {
- obj1.free();
- goto err1;
- }
- }
- } else {
- nFuncsA = 0;
- }
- obj1.free();
-
- nVerticesA = nTrianglesA = 0;
- verticesA = NULL;
- trianglesA = NULL;
- vertSize = triSize = 0;
- state = 0;
- flag = 0; // make gcc happy
- bitBuf = new GfxShadingBitBuf(str);
- while (1) {
- if (typeA == 4) {
- if (!bitBuf->getBits(flagBits, &flag)) {
- break;
- }
- }
- if (!bitBuf->getBits(coordBits, &x) ||
- !bitBuf->getBits(coordBits, &y)) {
- break;
- }
- for (i = 0; i < nComps; ++i) {
- if (!bitBuf->getBits(compBits, &c[i])) {
- break;
- }
- }
- if (i < nComps) {
- break;
- }
- if (nVerticesA == vertSize) {
- vertSize = (vertSize == 0) ? 16 : 2 * vertSize;
- verticesA = (GfxGouraudVertex *)
- greallocn(verticesA, vertSize, sizeof(GfxGouraudVertex));
- }
- verticesA[nVerticesA].x = xMin + xMul * (double)x;
- verticesA[nVerticesA].y = yMin + yMul * (double)y;
- for (i = 0; i < nComps; ++i) {
- verticesA[nVerticesA].color.c[i] =
- dblToCol(cMin[i] + cMul[i] * (double)c[i]);
- }
- ++nVerticesA;
- bitBuf->flushBits();
- if (typeA == 4) {
- if (state == 0 || state == 1) {
- ++state;
- } else if (state == 2 || flag > 0) {
- if (nTrianglesA == triSize) {
- triSize = (triSize == 0) ? 16 : 2 * triSize;
- trianglesA = (int (*)[3])
- greallocn(trianglesA, triSize * 3, sizeof(int));
- }
- if (state == 2) {
- trianglesA[nTrianglesA][0] = nVerticesA - 3;
- trianglesA[nTrianglesA][1] = nVerticesA - 2;
- trianglesA[nTrianglesA][2] = nVerticesA - 1;
- ++state;
- } else if (flag == 1) {
- trianglesA[nTrianglesA][0] = trianglesA[nTrianglesA - 1][1];
- trianglesA[nTrianglesA][1] = trianglesA[nTrianglesA - 1][2];
- trianglesA[nTrianglesA][2] = nVerticesA - 1;
- } else { // flag == 2
- trianglesA[nTrianglesA][0] = trianglesA[nTrianglesA - 1][0];
- trianglesA[nTrianglesA][1] = trianglesA[nTrianglesA - 1][2];
- trianglesA[nTrianglesA][2] = nVerticesA - 1;
- }
- ++nTrianglesA;
- } else { // state == 3 && flag == 0
- state = 1;
- }
- }
- }
- delete bitBuf;
- if (typeA == 5) {
- nRows = nVerticesA / vertsPerRow;
- nTrianglesA = (nRows - 1) * 2 * (vertsPerRow - 1);
- trianglesA = (int (*)[3])gmallocn(nTrianglesA * 3, sizeof(int));
- k = 0;
- for (i = 0; i < nRows - 1; ++i) {
- for (j = 0; j < vertsPerRow - 1; ++j) {
- trianglesA[k][0] = i * vertsPerRow + j;
- trianglesA[k][1] = i * vertsPerRow + j+1;
- trianglesA[k][2] = (i+1) * vertsPerRow + j;
- ++k;
- trianglesA[k][0] = i * vertsPerRow + j+1;
- trianglesA[k][1] = (i+1) * vertsPerRow + j;
- trianglesA[k][2] = (i+1) * vertsPerRow + j+1;
- ++k;
- }
- }
- }
-
- shading = new GfxGouraudTriangleShading(typeA, verticesA, nVerticesA,
- trianglesA, nTrianglesA,
- funcsA, nFuncsA);
- if (!shading->init(dict)) {
- delete shading;
- return NULL;
- }
- return shading;
-
- err2:
- obj1.free();
- err1:
- return NULL;
-}
-
-GfxShading *GfxGouraudTriangleShading::copy() {
- return new GfxGouraudTriangleShading(this);
-}
-
-void GfxGouraudTriangleShading::getTriangle(
- int i,
- double *x0, double *y0, GfxColor *color0,
- double *x1, double *y1, GfxColor *color1,
- double *x2, double *y2, GfxColor *color2) {
- double in;
- double out[gfxColorMaxComps];
- int v, j;
-
- v = triangles[i][0];
- *x0 = vertices[v].x;
- *y0 = vertices[v].y;
- if (nFuncs > 0) {
- in = colToDbl(vertices[v].color.c[0]);
- for (j = 0; j < nFuncs; ++j) {
- funcs[j]->transform(&in, &out[j]);
- }
- for (j = 0; j < gfxColorMaxComps; ++j) {
- color0->c[j] = dblToCol(out[j]);
- }
- } else {
- *color0 = vertices[v].color;
- }
- v = triangles[i][1];
- *x1 = vertices[v].x;
- *y1 = vertices[v].y;
- if (nFuncs > 0) {
- in = colToDbl(vertices[v].color.c[0]);
- for (j = 0; j < nFuncs; ++j) {
- funcs[j]->transform(&in, &out[j]);
- }
- for (j = 0; j < gfxColorMaxComps; ++j) {
- color1->c[j] = dblToCol(out[j]);
- }
- } else {
- *color1 = vertices[v].color;
- }
- v = triangles[i][2];
- *x2 = vertices[v].x;
- *y2 = vertices[v].y;
- if (nFuncs > 0) {
- in = colToDbl(vertices[v].color.c[0]);
- for (j = 0; j < nFuncs; ++j) {
- funcs[j]->transform(&in, &out[j]);
- }
- for (j = 0; j < gfxColorMaxComps; ++j) {
- color2->c[j] = dblToCol(out[j]);
- }
- } else {
- *color2 = vertices[v].color;
- }
-}
-
-//------------------------------------------------------------------------
-// GfxPatchMeshShading
-//------------------------------------------------------------------------
-
-GfxPatchMeshShading::GfxPatchMeshShading(int typeA,
- GfxPatch *patchesA, int nPatchesA,
- Function **funcsA, int nFuncsA):
- GfxShading(typeA)
-{
- int i;
-
- patches = patchesA;
- nPatches = nPatchesA;
- nFuncs = nFuncsA;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = funcsA[i];
- }
-}
-
-GfxPatchMeshShading::GfxPatchMeshShading(GfxPatchMeshShading *shading):
- GfxShading(shading)
-{
- int i;
-
- nPatches = shading->nPatches;
- patches = (GfxPatch *)gmallocn(nPatches, sizeof(GfxPatch));
- memcpy(patches, shading->patches, nPatches * sizeof(GfxPatch));
- nFuncs = shading->nFuncs;
- for (i = 0; i < nFuncs; ++i) {
- funcs[i] = shading->funcs[i]->copy();
- }
-}
-
-GfxPatchMeshShading::~GfxPatchMeshShading() {
- int i;
-
- gfree(patches);
- for (i = 0; i < nFuncs; ++i) {
- delete funcs[i];
- }
-}
-
-GfxPatchMeshShading *GfxPatchMeshShading::parse(int typeA, Dict *dict,
- Stream *str) {
- GfxPatchMeshShading *shading;
- Function *funcsA[gfxColorMaxComps];
- int nFuncsA;
- int coordBits, compBits, flagBits;
- double xMin, xMax, yMin, yMax;
- double cMin[gfxColorMaxComps], cMax[gfxColorMaxComps];
- double xMul, yMul;
- double cMul[gfxColorMaxComps];
- GfxPatch *patchesA, *p;
- int nComps, nPatchesA, patchesSize, nPts, nColors;
- Guint flag;
- double x[16], y[16];
- Guint xi, yi;
- GfxColorComp c[4][gfxColorMaxComps];
- Guint ci[4];
- GfxShadingBitBuf *bitBuf;
- Object obj1, obj2;
- int i, j;
-
- if (dict->lookup("BitsPerCoordinate", &obj1)->isInt()) {
- coordBits = obj1.getInt();
- } else {
- error(-1, "Missing or invalid BitsPerCoordinate in shading dictionary");
- goto err2;
- }
- obj1.free();
- if (dict->lookup("BitsPerComponent", &obj1)->isInt()) {
- compBits = obj1.getInt();
- } else {
- error(-1, "Missing or invalid BitsPerComponent in shading dictionary");
- goto err2;
- }
- obj1.free();
- if (dict->lookup("BitsPerFlag", &obj1)->isInt()) {
- flagBits = obj1.getInt();
- } else {
- error(-1, "Missing or invalid BitsPerFlag in shading dictionary");
- goto err2;
- }
- obj1.free();
- if (dict->lookup("Decode", &obj1)->isArray() &&
- obj1.arrayGetLength() >= 6) {
- xMin = obj1.arrayGet(0, &obj2)->getNum();
- obj2.free();
- xMax = obj1.arrayGet(1, &obj2)->getNum();
- obj2.free();
- xMul = (xMax - xMin) / (pow(2.0, coordBits) - 1);
- yMin = obj1.arrayGet(2, &obj2)->getNum();
- obj2.free();
- yMax = obj1.arrayGet(3, &obj2)->getNum();
- obj2.free();
- yMul = (yMax - yMin) / (pow(2.0, coordBits) - 1);
- for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) {
- cMin[i] = obj1.arrayGet(4 + 2*i, &obj2)->getNum();
- obj2.free();
- cMax[i] = obj1.arrayGet(5 + 2*i, &obj2)->getNum();
- obj2.free();
- cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1);
- }
- nComps = i;
- } else {
- error(-1, "Missing or invalid Decode array in shading dictionary");
- goto err2;
- }
- obj1.free();
-
- if (!dict->lookup("Function", &obj1)->isNull()) {
- if (obj1.isArray()) {
- nFuncsA = obj1.arrayGetLength();
- if (nFuncsA > gfxColorMaxComps) {
- error(-1, "Invalid Function array in shading dictionary");
- goto err1;
- }
- for (i = 0; i < nFuncsA; ++i) {
- obj1.arrayGet(i, &obj2);
- if (!(funcsA[i] = Function::parse(&obj2))) {
- obj1.free();
- obj2.free();
- goto err1;
- }
- obj2.free();
- }
- } else {
- nFuncsA = 1;
- if (!(funcsA[0] = Function::parse(&obj1))) {
- obj1.free();
- goto err1;
- }
- }
- } else {
- nFuncsA = 0;
- }
- obj1.free();
-
- nPatchesA = 0;
- patchesA = NULL;
- patchesSize = 0;
- bitBuf = new GfxShadingBitBuf(str);
- while (1) {
- if (!bitBuf->getBits(flagBits, &flag)) {
- break;
- }
- if (typeA == 6) {
- switch (flag) {
- case 0: nPts = 12; nColors = 4; break;
- case 1:
- case 2:
- case 3:
- default: nPts = 8; nColors = 2; break;
- }
- } else {
- switch (flag) {
- case 0: nPts = 16; nColors = 4; break;
- case 1:
- case 2:
- case 3:
- default: nPts = 12; nColors = 2; break;
- }
- }
- for (i = 0; i < nPts; ++i) {
- if (!bitBuf->getBits(coordBits, &xi) ||
- !bitBuf->getBits(coordBits, &yi)) {
- break;
- }
- x[i] = xMin + xMul * (double)xi;
- y[i] = yMin + yMul * (double)yi;
- }
- if (i < nPts) {
- break;
- }
- for (i = 0; i < nColors; ++i) {
- for (j = 0; j < nComps; ++j) {
- if (!bitBuf->getBits(compBits, &ci[j])) {
- break;
- }
- c[i][j] = dblToCol(cMin[j] + cMul[j] * (double)ci[j]);
- }
- if (j < nComps) {
- break;
- }
- }
- if (i < nColors) {
- break;
- }
- if (nPatchesA == patchesSize) {
- patchesSize = (patchesSize == 0) ? 16 : 2 * patchesSize;
- patchesA = (GfxPatch *)greallocn(patchesA,
- patchesSize, sizeof(GfxPatch));
- }
- p = &patchesA[nPatchesA];
- if (typeA == 6) {
- switch (flag) {
- case 0:
- p->x[0][0] = x[0];
- p->y[0][0] = y[0];
- p->x[0][1] = x[1];
- p->y[0][1] = y[1];
- p->x[0][2] = x[2];
- p->y[0][2] = y[2];
- p->x[0][3] = x[3];
- p->y[0][3] = y[3];
- p->x[1][3] = x[4];
- p->y[1][3] = y[4];
- p->x[2][3] = x[5];
- p->y[2][3] = y[5];
- p->x[3][3] = x[6];
- p->y[3][3] = y[6];
- p->x[3][2] = x[7];
- p->y[3][2] = y[7];
- p->x[3][1] = x[8];
- p->y[3][1] = y[8];
- p->x[3][0] = x[9];
- p->y[3][0] = y[9];
- p->x[2][0] = x[10];
- p->y[2][0] = y[10];
- p->x[1][0] = x[11];
- p->y[1][0] = y[11];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = c[0][j];
- p->color[0][1].c[j] = c[1][j];
- p->color[1][1].c[j] = c[2][j];
- p->color[1][0].c[j] = c[3][j];
- }
- break;
- case 1:
- p->x[0][0] = patchesA[nPatchesA-1].x[0][3];
- p->y[0][0] = patchesA[nPatchesA-1].y[0][3];
- p->x[0][1] = patchesA[nPatchesA-1].x[1][3];
- p->y[0][1] = patchesA[nPatchesA-1].y[1][3];
- p->x[0][2] = patchesA[nPatchesA-1].x[2][3];
- p->y[0][2] = patchesA[nPatchesA-1].y[2][3];
- p->x[0][3] = patchesA[nPatchesA-1].x[3][3];
- p->y[0][3] = patchesA[nPatchesA-1].y[3][3];
- p->x[1][3] = x[0];
- p->y[1][3] = y[0];
- p->x[2][3] = x[1];
- p->y[2][3] = y[1];
- p->x[3][3] = x[2];
- p->y[3][3] = y[2];
- p->x[3][2] = x[3];
- p->y[3][2] = y[3];
- p->x[3][1] = x[4];
- p->y[3][1] = y[4];
- p->x[3][0] = x[5];
- p->y[3][0] = y[5];
- p->x[2][0] = x[6];
- p->y[2][0] = y[6];
- p->x[1][0] = x[7];
- p->y[1][0] = y[7];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = patchesA[nPatchesA-1].color[0][1].c[j];
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
- p->color[1][1].c[j] = c[0][j];
- p->color[1][0].c[j] = c[1][j];
- }
- break;
- case 2:
- p->x[0][0] = patchesA[nPatchesA-1].x[3][3];
- p->y[0][0] = patchesA[nPatchesA-1].y[3][3];
- p->x[0][1] = patchesA[nPatchesA-1].x[3][2];
- p->y[0][1] = patchesA[nPatchesA-1].y[3][2];
- p->x[0][2] = patchesA[nPatchesA-1].x[3][1];
- p->y[0][2] = patchesA[nPatchesA-1].y[3][1];
- p->x[0][3] = patchesA[nPatchesA-1].x[3][0];
- p->y[0][3] = patchesA[nPatchesA-1].y[3][0];
- p->x[1][3] = x[0];
- p->y[1][3] = y[0];
- p->x[2][3] = x[1];
- p->y[2][3] = y[1];
- p->x[3][3] = x[2];
- p->y[3][3] = y[2];
- p->x[3][2] = x[3];
- p->y[3][2] = y[3];
- p->x[3][1] = x[4];
- p->y[3][1] = y[4];
- p->x[3][0] = x[5];
- p->y[3][0] = y[5];
- p->x[2][0] = x[6];
- p->y[2][0] = y[6];
- p->x[1][0] = x[7];
- p->y[1][0] = y[7];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
- p->color[1][1].c[j] = c[0][j];
- p->color[1][0].c[j] = c[1][j];
- }
- break;
- case 3:
- p->x[0][0] = patchesA[nPatchesA-1].x[3][0];
- p->y[0][0] = patchesA[nPatchesA-1].y[3][0];
- p->x[0][1] = patchesA[nPatchesA-1].x[2][0];
- p->y[0][1] = patchesA[nPatchesA-1].y[2][0];
- p->x[0][2] = patchesA[nPatchesA-1].x[1][0];
- p->y[0][2] = patchesA[nPatchesA-1].y[1][0];
- p->x[0][3] = patchesA[nPatchesA-1].x[0][0];
- p->y[0][3] = patchesA[nPatchesA-1].y[0][0];
- p->x[1][3] = x[0];
- p->y[1][3] = y[0];
- p->x[2][3] = x[1];
- p->y[2][3] = y[1];
- p->x[3][3] = x[2];
- p->y[3][3] = y[2];
- p->x[3][2] = x[3];
- p->y[3][2] = y[3];
- p->x[3][1] = x[4];
- p->y[3][1] = y[4];
- p->x[3][0] = x[5];
- p->y[3][0] = y[5];
- p->x[2][0] = x[6];
- p->y[2][0] = y[6];
- p->x[1][0] = x[7];
- p->y[1][0] = y[7];
- for (j = 0; j < nComps; ++j) {
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[0][0].c[j];
- p->color[1][1].c[j] = c[0][j];
- p->color[1][0].c[j] = c[1][j];
- }
- break;
- }
- } else {
- switch (flag) {
- case 0:
- p->x[0][0] = x[0];
- p->y[0][0] = y[0];
- p->x[0][1] = x[1];
- p->y[0][1] = y[1];
- p->x[0][2] = x[2];
- p->y[0][2] = y[2];
- p->x[0][3] = x[3];
- p->y[0][3] = y[3];
- p->x[1][3] = x[4];
- p->y[1][3] = y[4];
- p->x[2][3] = x[5];
- p->y[2][3] = y[5];
- p->x[3][3] = x[6];
- p->y[3][3] = y[6];
- p->x[3][2] = x[7];
- p->y[3][2] = y[7];
- p->x[3][1] = x[8];
- p->y[3][1] = y[8];
- p->x[3][0] = x[9];
- p->y[3][0] = y[9];
- p->x[2][0] = x[10];
- p->y[2][0] = y[10];
- p->x[1][0] = x[11];
- p->y[1][0] = y[11];
- p->x[1][1] = x[12];
- p->y[1][1] = y[12];
- p->x[1][2] = x[13];
- p->y[1][2] = y[13];
- p->x[2][2] = x[14];
- p->y[2][2] = y[14];
- p->x[2][1] = x[15];
- p->y[2][1] = y[15];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = c[0][j];
- p->color[0][1].c[j] = c[1][j];
- p->color[1][1].c[j] = c[2][j];
- p->color[1][0].c[j] = c[3][j];
- }
- break;
- case 1:
- p->x[0][0] = patchesA[nPatchesA-1].x[0][3];
- p->y[0][0] = patchesA[nPatchesA-1].y[0][3];
- p->x[0][1] = patchesA[nPatchesA-1].x[1][3];
- p->y[0][1] = patchesA[nPatchesA-1].y[1][3];
- p->x[0][2] = patchesA[nPatchesA-1].x[2][3];
- p->y[0][2] = patchesA[nPatchesA-1].y[2][3];
- p->x[0][3] = patchesA[nPatchesA-1].x[3][3];
- p->y[0][3] = patchesA[nPatchesA-1].y[3][3];
- p->x[1][3] = x[0];
- p->y[1][3] = y[0];
- p->x[2][3] = x[1];
- p->y[2][3] = y[1];
- p->x[3][3] = x[2];
- p->y[3][3] = y[2];
- p->x[3][2] = x[3];
- p->y[3][2] = y[3];
- p->x[3][1] = x[4];
- p->y[3][1] = y[4];
- p->x[3][0] = x[5];
- p->y[3][0] = y[5];
- p->x[2][0] = x[6];
- p->y[2][0] = y[6];
- p->x[1][0] = x[7];
- p->y[1][0] = y[7];
- p->x[1][1] = x[8];
- p->y[1][1] = y[8];
- p->x[1][2] = x[9];
- p->y[1][2] = y[9];
- p->x[2][2] = x[10];
- p->y[2][2] = y[10];
- p->x[2][1] = x[11];
- p->y[2][1] = y[11];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = patchesA[nPatchesA-1].color[0][1].c[j];
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
- p->color[1][1].c[j] = c[0][j];
- p->color[1][0].c[j] = c[1][j];
- }
- break;
- case 2:
- p->x[0][0] = patchesA[nPatchesA-1].x[3][3];
- p->y[0][0] = patchesA[nPatchesA-1].y[3][3];
- p->x[0][1] = patchesA[nPatchesA-1].x[3][2];
- p->y[0][1] = patchesA[nPatchesA-1].y[3][2];
- p->x[0][2] = patchesA[nPatchesA-1].x[3][1];
- p->y[0][2] = patchesA[nPatchesA-1].y[3][1];
- p->x[0][3] = patchesA[nPatchesA-1].x[3][0];
- p->y[0][3] = patchesA[nPatchesA-1].y[3][0];
- p->x[1][3] = x[0];
- p->y[1][3] = y[0];
- p->x[2][3] = x[1];
- p->y[2][3] = y[1];
- p->x[3][3] = x[2];
- p->y[3][3] = y[2];
- p->x[3][2] = x[3];
- p->y[3][2] = y[3];
- p->x[3][1] = x[4];
- p->y[3][1] = y[4];
- p->x[3][0] = x[5];
- p->y[3][0] = y[5];
- p->x[2][0] = x[6];
- p->y[2][0] = y[6];
- p->x[1][0] = x[7];
- p->y[1][0] = y[7];
- p->x[1][1] = x[8];
- p->y[1][1] = y[8];
- p->x[1][2] = x[9];
- p->y[1][2] = y[9];
- p->x[2][2] = x[10];
- p->y[2][2] = y[10];
- p->x[2][1] = x[11];
- p->y[2][1] = y[11];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
- p->color[1][1].c[j] = c[0][j];
- p->color[1][0].c[j] = c[1][j];
- }
- break;
- case 3:
- p->x[0][0] = patchesA[nPatchesA-1].x[3][0];
- p->y[0][0] = patchesA[nPatchesA-1].y[3][0];
- p->x[0][1] = patchesA[nPatchesA-1].x[2][0];
- p->y[0][1] = patchesA[nPatchesA-1].y[2][0];
- p->x[0][2] = patchesA[nPatchesA-1].x[1][0];
- p->y[0][2] = patchesA[nPatchesA-1].y[1][0];
- p->x[0][3] = patchesA[nPatchesA-1].x[0][0];
- p->y[0][3] = patchesA[nPatchesA-1].y[0][0];
- p->x[1][3] = x[0];
- p->y[1][3] = y[0];
- p->x[2][3] = x[1];
- p->y[2][3] = y[1];
- p->x[3][3] = x[2];
- p->y[3][3] = y[2];
- p->x[3][2] = x[3];
- p->y[3][2] = y[3];
- p->x[3][1] = x[4];
- p->y[3][1] = y[4];
- p->x[3][0] = x[5];
- p->y[3][0] = y[5];
- p->x[2][0] = x[6];
- p->y[2][0] = y[6];
- p->x[1][0] = x[7];
- p->y[1][0] = y[7];
- p->x[1][1] = x[8];
- p->y[1][1] = y[8];
- p->x[1][2] = x[9];
- p->y[1][2] = y[9];
- p->x[2][2] = x[10];
- p->y[2][2] = y[10];
- p->x[2][1] = x[11];
- p->y[2][1] = y[11];
- for (j = 0; j < nComps; ++j) {
- p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
- p->color[0][1].c[j] = patchesA[nPatchesA-1].color[0][0].c[j];
- p->color[1][1].c[j] = c[0][j];
- p->color[1][0].c[j] = c[1][j];
- }
- break;
- }
- }
- ++nPatchesA;
- bitBuf->flushBits();
- }
- delete bitBuf;
-
- if (typeA == 6) {
- for (i = 0; i < nPatchesA; ++i) {
- p = &patchesA[i];
- p->x[1][1] = (-4 * p->x[0][0]
- +6 * (p->x[0][1] + p->x[1][0])
- -2 * (p->x[0][3] + p->x[3][0])
- +3 * (p->x[3][1] + p->x[1][3])
- - p->x[3][3]) / 9;
- p->y[1][1] = (-4 * p->y[0][0]
- +6 * (p->y[0][1] + p->y[1][0])
- -2 * (p->y[0][3] + p->y[3][0])
- +3 * (p->y[3][1] + p->y[1][3])
- - p->y[3][3]) / 9;
- p->x[1][2] = (-4 * p->x[0][3]
- +6 * (p->x[0][2] + p->x[1][3])
- -2 * (p->x[0][0] + p->x[3][3])
- +3 * (p->x[3][2] + p->x[1][0])
- - p->x[3][0]) / 9;
- p->y[1][2] = (-4 * p->y[0][3]
- +6 * (p->y[0][2] + p->y[1][3])
- -2 * (p->y[0][0] + p->y[3][3])
- +3 * (p->y[3][2] + p->y[1][0])
- - p->y[3][0]) / 9;
- p->x[2][1] = (-4 * p->x[3][0]
- +6 * (p->x[3][1] + p->x[2][0])
- -2 * (p->x[3][3] + p->x[0][0])
- +3 * (p->x[0][1] + p->x[2][3])
- - p->x[0][3]) / 9;
- p->y[2][1] = (-4 * p->y[3][0]
- +6 * (p->y[3][1] + p->y[2][0])
- -2 * (p->y[3][3] + p->y[0][0])
- +3 * (p->y[0][1] + p->y[2][3])
- - p->y[0][3]) / 9;
- p->x[2][2] = (-4 * p->x[3][3]
- +6 * (p->x[3][2] + p->x[2][3])
- -2 * (p->x[3][0] + p->x[0][3])
- +3 * (p->x[0][2] + p->x[2][0])
- - p->x[0][0]) / 9;
- p->y[2][2] = (-4 * p->y[3][3]
- +6 * (p->y[3][2] + p->y[2][3])
- -2 * (p->y[3][0] + p->y[0][3])
- +3 * (p->y[0][2] + p->y[2][0])
- - p->y[0][0]) / 9;
- }
- }
-
- shading = new GfxPatchMeshShading(typeA, patchesA, nPatchesA,
- funcsA, nFuncsA);
- if (!shading->init(dict)) {
- delete shading;
- return NULL;
- }
- return shading;
-
- err2:
- obj1.free();
- err1:
- return NULL;
-}
-
-GfxShading *GfxPatchMeshShading::copy() {
- return new GfxPatchMeshShading(this);
-}
-
-//------------------------------------------------------------------------
-// GfxImageColorMap
-//------------------------------------------------------------------------
-
-GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
- GfxColorSpace *colorSpaceA) {
- GfxIndexedColorSpace *indexedCS;
- GfxSeparationColorSpace *sepCS;
- int maxPixel, indexHigh;
- Guchar *lookup2;
- Function *sepFunc;
- Object obj;
- double x[gfxColorMaxComps];
- double y[gfxColorMaxComps];
- int i, j, k;
-
- ok = gTrue;
-
- // bits per component and color space
- bits = bitsA;
- maxPixel = (1 << bits) - 1;
- colorSpace = colorSpaceA;
-
- // initialize
- for (k = 0; k < gfxColorMaxComps; ++k) {
- lookup[k] = NULL;
- }
-
- // get decode map
- if (decode->isNull()) {
- nComps = colorSpace->getNComps();
- colorSpace->getDefaultRanges(decodeLow, decodeRange, maxPixel);
- } else if (decode->isArray()) {
- nComps = decode->arrayGetLength() / 2;
- if (nComps != colorSpace->getNComps()) {
- goto err1;
- }
- for (i = 0; i < nComps; ++i) {
- decode->arrayGet(2*i, &obj);
- if (!obj.isNum()) {
- goto err2;
- }
- decodeLow[i] = obj.getNum();
- obj.free();
- decode->arrayGet(2*i+1, &obj);
- if (!obj.isNum()) {
- goto err2;
- }
- decodeRange[i] = obj.getNum() - decodeLow[i];
- obj.free();
- }
- } else {
- goto err1;
- }
-
- // Construct a lookup table -- this stores pre-computed decoded
- // values for each component, i.e., the result of applying the
- // decode mapping to each possible image pixel component value.
- //
- // Optimization: for Indexed and Separation color spaces (which have
- // only one component), we store color values in the lookup table
- // rather than component values.
- colorSpace2 = NULL;
- nComps2 = 0;
- if (colorSpace->getMode() == csIndexed) {
- // Note that indexHigh may not be the same as maxPixel --
- // Distiller will remove unused palette entries, resulting in
- // indexHigh < maxPixel.
- indexedCS = (GfxIndexedColorSpace *)colorSpace;
- colorSpace2 = indexedCS->getBase();
- indexHigh = indexedCS->getIndexHigh();
- nComps2 = colorSpace2->getNComps();
- lookup2 = indexedCS->getLookup();
- colorSpace2->getDefaultRanges(x, y, indexHigh);
- for (k = 0; k < nComps2; ++k) {
- lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
- sizeof(GfxColorComp));
- for (i = 0; i <= maxPixel; ++i) {
- j = (int)(decodeLow[0] + (i * decodeRange[0]) / maxPixel + 0.5);
- if (j < 0) {
- j = 0;
- } else if (j > indexHigh) {
- j = indexHigh;
- }
- lookup[k][i] =
- dblToCol(x[k] + (lookup2[j*nComps2 + k] / 255.0) * y[k]);
- }
- }
- } else if (colorSpace->getMode() == csSeparation) {
- sepCS = (GfxSeparationColorSpace *)colorSpace;
- colorSpace2 = sepCS->getAlt();
- nComps2 = colorSpace2->getNComps();
- sepFunc = sepCS->getFunc();
- for (k = 0; k < nComps2; ++k) {
- lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
- sizeof(GfxColorComp));
- for (i = 0; i <= maxPixel; ++i) {
- x[0] = decodeLow[0] + (i * decodeRange[0]) / maxPixel;
- sepFunc->transform(x, y);
- lookup[k][i] = dblToCol(y[k]);
- }
- }
- } else {
- for (k = 0; k < nComps; ++k) {
- lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
- sizeof(GfxColorComp));
- for (i = 0; i <= maxPixel; ++i) {
- lookup[k][i] = dblToCol(decodeLow[k] +
- (i * decodeRange[k]) / maxPixel);
- }
- }
- }
-
- return;
-
- err2:
- obj.free();
- err1:
- ok = gFalse;
-}
-
-GfxImageColorMap::GfxImageColorMap(GfxImageColorMap *colorMap) {
- int n, i, k;
-
- colorSpace = colorMap->colorSpace->copy();
- bits = colorMap->bits;
- nComps = colorMap->nComps;
- nComps2 = colorMap->nComps2;
- colorSpace2 = NULL;
- for (k = 0; k < gfxColorMaxComps; ++k) {
- lookup[k] = NULL;
- }
- n = 1 << bits;
- if (colorSpace->getMode() == csIndexed) {
- colorSpace2 = ((GfxIndexedColorSpace *)colorSpace)->getBase();
- for (k = 0; k < nComps2; ++k) {
- lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp));
- memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
- }
- } else if (colorSpace->getMode() == csSeparation) {
- colorSpace2 = ((GfxSeparationColorSpace *)colorSpace)->getAlt();
- for (k = 0; k < nComps2; ++k) {
- lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp));
- memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
- }
- } else {
- for (k = 0; k < nComps; ++k) {
- lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp));
- memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
- }
- }
- for (i = 0; i < nComps; ++i) {
- decodeLow[i] = colorMap->decodeLow[i];
- decodeRange[i] = colorMap->decodeRange[i];
- }
- ok = gTrue;
-}
-
-GfxImageColorMap::~GfxImageColorMap() {
- int i;
-
- delete colorSpace;
- for (i = 0; i < gfxColorMaxComps; ++i) {
- gfree(lookup[i]);
- }
-}
-
-void GfxImageColorMap::getGray(Guchar *x, GfxGray *gray) {
- GfxColor color;
- int i;
-
- if (colorSpace2) {
- for (i = 0; i < nComps2; ++i) {
- color.c[i] = lookup[i][x[0]];
- }
- colorSpace2->getGray(&color, gray);
- } else {
- for (i = 0; i < nComps; ++i) {
- color.c[i] = lookup[i][x[i]];
- }
- colorSpace->getGray(&color, gray);
- }
-}
-
-void GfxImageColorMap::getRGB(Guchar *x, GfxRGB *rgb) {
- GfxColor color;
- int i;
-
- if (colorSpace2) {
- for (i = 0; i < nComps2; ++i) {
- color.c[i] = lookup[i][x[0]];
- }
- colorSpace2->getRGB(&color, rgb);
- } else {
- for (i = 0; i < nComps; ++i) {
- color.c[i] = lookup[i][x[i]];
- }
- colorSpace->getRGB(&color, rgb);
- }
-}
-
-void GfxImageColorMap::getCMYK(Guchar *x, GfxCMYK *cmyk) {
- GfxColor color;
- int i;
-
- if (colorSpace2) {
- for (i = 0; i < nComps2; ++i) {
- color.c[i] = lookup[i][x[0]];
- }
- colorSpace2->getCMYK(&color, cmyk);
- } else {
- for (i = 0; i < nComps; ++i) {
- color.c[i] = lookup[i][x[i]];
- }
- colorSpace->getCMYK(&color, cmyk);
- }
-}
-
-void GfxImageColorMap::getColor(Guchar *x, GfxColor *color) {
- int maxPixel, i;
-
- maxPixel = (1 << bits) - 1;
- for (i = 0; i < nComps; ++i) {
- color->c[i] = dblToCol(decodeLow[i] + (x[i] * decodeRange[i]) / maxPixel);
- }
-}
-
-//------------------------------------------------------------------------
-// GfxSubpath and GfxPath
-//------------------------------------------------------------------------
-
-GfxSubpath::GfxSubpath(double x1, double y1) {
- size = 16;
- x = (double *)gmallocn(size, sizeof(double));
- y = (double *)gmallocn(size, sizeof(double));
- curve = (GBool *)gmallocn(size, sizeof(GBool));
- n = 1;
- x[0] = x1;
- y[0] = y1;
- curve[0] = gFalse;
- closed = gFalse;
-}
-
-GfxSubpath::~GfxSubpath() {
- gfree(x);
- gfree(y);
- gfree(curve);
-}
-
-// Used for copy().
-GfxSubpath::GfxSubpath(GfxSubpath *subpath) {
- size = subpath->size;
- n = subpath->n;
- x = (double *)gmallocn(size, sizeof(double));
- y = (double *)gmallocn(size, sizeof(double));
- curve = (GBool *)gmallocn(size, sizeof(GBool));
- memcpy(x, subpath->x, n * sizeof(double));
- memcpy(y, subpath->y, n * sizeof(double));
- memcpy(curve, subpath->curve, n * sizeof(GBool));
- closed = subpath->closed;
-}
-
-void GfxSubpath::lineTo(double x1, double y1) {
- if (n >= size) {
- size += 16;
- x = (double *)greallocn(x, size, sizeof(double));
- y = (double *)greallocn(y, size, sizeof(double));
- curve = (GBool *)greallocn(curve, size, sizeof(GBool));
- }
- x[n] = x1;
- y[n] = y1;
- curve[n] = gFalse;
- ++n;
-}
-
-void GfxSubpath::curveTo(double x1, double y1, double x2, double y2,
- double x3, double y3) {
- if (n+3 > size) {
- size += 16;
- x = (double *)greallocn(x, size, sizeof(double));
- y = (double *)greallocn(y, size, sizeof(double));
- curve = (GBool *)greallocn(curve, size, sizeof(GBool));
- }
- x[n] = x1;
- y[n] = y1;
- x[n+1] = x2;
- y[n+1] = y2;
- x[n+2] = x3;
- y[n+2] = y3;
- curve[n] = curve[n+1] = gTrue;
- curve[n+2] = gFalse;
- n += 3;
-}
-
-void GfxSubpath::close() {
- if (x[n-1] != x[0] || y[n-1] != y[0]) {
- lineTo(x[0], y[0]);
- }
- closed = gTrue;
-}
-
-void GfxSubpath::offset(double dx, double dy) {
- int i;
-
- for (i = 0; i < n; ++i) {
- x[i] += dx;
- y[i] += dy;
- }
-}
-
-GfxPath::GfxPath() {
- justMoved = gFalse;
- size = 16;
- n = 0;
- firstX = firstY = 0;
- subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *));
-}
-
-GfxPath::~GfxPath() {
- int i;
-
- for (i = 0; i < n; ++i)
- delete subpaths[i];
- gfree(subpaths);
-}
-
-// Used for copy().
-GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1,
- GfxSubpath **subpaths1, int n1, int size1) {
- int i;
-
- justMoved = justMoved1;
- firstX = firstX1;
- firstY = firstY1;
- size = size1;
- n = n1;
- subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *));
- for (i = 0; i < n; ++i)
- subpaths[i] = subpaths1[i]->copy();
-}
-
-void GfxPath::moveTo(double x, double y) {
- justMoved = gTrue;
- firstX = x;
- firstY = y;
-}
-
-void GfxPath::lineTo(double x, double y) {
- if (justMoved) {
- if (n >= size) {
- size += 16;
- subpaths = (GfxSubpath **)
- greallocn(subpaths, size, sizeof(GfxSubpath *));
- }
- subpaths[n] = new GfxSubpath(firstX, firstY);
- ++n;
- justMoved = gFalse;
- }
- subpaths[n-1]->lineTo(x, y);
-}
-
-void GfxPath::curveTo(double x1, double y1, double x2, double y2,
- double x3, double y3) {
- if (justMoved) {
- if (n >= size) {
- size += 16;
- subpaths = (GfxSubpath **)
- greallocn(subpaths, size, sizeof(GfxSubpath *));
- }
- subpaths[n] = new GfxSubpath(firstX, firstY);
- ++n;
- justMoved = gFalse;
- }
- subpaths[n-1]->curveTo(x1, y1, x2, y2, x3, y3);
-}
-
-void GfxPath::close() {
- // this is necessary to handle the pathological case of
- // moveto/closepath/clip, which defines an empty clipping region
- if (justMoved) {
- if (n >= size) {
- size += 16;
- subpaths = (GfxSubpath **)
- greallocn(subpaths, size, sizeof(GfxSubpath *));
- }
- subpaths[n] = new GfxSubpath(firstX, firstY);
- ++n;
- justMoved = gFalse;
- }
- subpaths[n-1]->close();
-}
-
-void GfxPath::append(GfxPath *path) {
- int i;
-
- if (n + path->n > size) {
- size = n + path->n;
- subpaths = (GfxSubpath **)
- greallocn(subpaths, size, sizeof(GfxSubpath *));
- }
- for (i = 0; i < path->n; ++i) {
- subpaths[n++] = path->subpaths[i]->copy();
- }
- justMoved = gFalse;
-}
-
-void GfxPath::offset(double dx, double dy) {
- int i;
-
- for (i = 0; i < n; ++i) {
- subpaths[i]->offset(dx, dy);
- }
-}
-
-//------------------------------------------------------------------------
-// GfxState
-//------------------------------------------------------------------------
-
-GfxState::GfxState(double hDPIA, double vDPIA, PDFRectangle *pageBox,
- int rotateA, GBool upsideDown) {
- double kx, ky;
-
- hDPI = hDPIA;
- vDPI = vDPIA;
- rotate = rotateA;
- px1 = pageBox->x1;
- py1 = pageBox->y1;
- px2 = pageBox->x2;
- py2 = pageBox->y2;
- kx = hDPI / 72.0;
- ky = vDPI / 72.0;
- if (rotate == 90) {
- ctm[0] = 0;
- ctm[1] = upsideDown ? ky : -ky;
- ctm[2] = kx;
- ctm[3] = 0;
- ctm[4] = -kx * py1;
- ctm[5] = ky * (upsideDown ? -px1 : px2);
- pageWidth = kx * (py2 - py1);
- pageHeight = ky * (px2 - px1);
- } else if (rotate == 180) {
- ctm[0] = -kx;
- ctm[1] = 0;
- ctm[2] = 0;
- ctm[3] = upsideDown ? ky : -ky;
- ctm[4] = kx * px2;
- ctm[5] = ky * (upsideDown ? -py1 : py2);
- pageWidth = kx * (px2 - px1);
- pageHeight = ky * (py2 - py1);
- } else if (rotate == 270) {
- ctm[0] = 0;
- ctm[1] = upsideDown ? -ky : ky;
- ctm[2] = -kx;
- ctm[3] = 0;
- ctm[4] = kx * py2;
- ctm[5] = ky * (upsideDown ? px2 : -px1);
- pageWidth = kx * (py2 - py1);
- pageHeight = ky * (px2 - px1);
- } else {
- ctm[0] = kx;
- ctm[1] = 0;
- ctm[2] = 0;
- ctm[3] = upsideDown ? -ky : ky;
- ctm[4] = -kx * px1;
- ctm[5] = ky * (upsideDown ? py2 : -py1);
- pageWidth = kx * (px2 - px1);
- pageHeight = ky * (py2 - py1);
- }
-
- fillColorSpace = new GfxDeviceGrayColorSpace();
- strokeColorSpace = new GfxDeviceGrayColorSpace();
- fillColor.c[0] = 0;
- strokeColor.c[0] = 0;
- fillPattern = NULL;
- strokePattern = NULL;
- blendMode = gfxBlendNormal;
- fillOpacity = 1;
- strokeOpacity = 1;
- fillOverprint = gFalse;
- strokeOverprint = gFalse;
- transfer[0] = transfer[1] = transfer[2] = transfer[3] = NULL;
-
- lineWidth = 1;
- lineDash = NULL;
- lineDashLength = 0;
- lineDashStart = 0;
- flatness = 1;
- lineJoin = 0;
- lineCap = 0;
- miterLimit = 10;
- strokeAdjust = gFalse;
-
- font = NULL;
- fontSize = 0;
- textMat[0] = 1; textMat[1] = 0;
- textMat[2] = 0; textMat[3] = 1;
- textMat[4] = 0; textMat[5] = 0;
- charSpace = 0;
- wordSpace = 0;
- horizScaling = 1;
- leading = 0;
- rise = 0;
- render = 0;
-
- path = new GfxPath();
- curX = curY = 0;
- lineX = lineY = 0;
-
- clipXMin = 0;
- clipYMin = 0;
- clipXMax = pageWidth;
- clipYMax = pageHeight;
-
- saved = NULL;
-}
-
-GfxState::~GfxState() {
- int i;
-
- if (fillColorSpace) {
- delete fillColorSpace;
- }
- if (strokeColorSpace) {
- delete strokeColorSpace;
- }
- if (fillPattern) {
- delete fillPattern;
- }
- if (strokePattern) {
- delete strokePattern;
- }
- for (i = 0; i < 4; ++i) {
- if (transfer[i]) {
- delete transfer[i];
- }
- }
- gfree(lineDash);
- if (path) {
- // this gets set to NULL by restore()
- delete path;
- }
- if (saved) {
- delete saved;
- }
-}
-
-// Used for copy();
-GfxState::GfxState(GfxState *state) {
- int i;
-
- memcpy(this, state, sizeof(GfxState));
- if (fillColorSpace) {
- fillColorSpace = state->fillColorSpace->copy();
- }
- if (strokeColorSpace) {
- strokeColorSpace = state->strokeColorSpace->copy();
- }
- if (fillPattern) {
- fillPattern = state->fillPattern->copy();
- }
- if (strokePattern) {
- strokePattern = state->strokePattern->copy();
- }
- for (i = 0; i < 4; ++i) {
- if (transfer[i]) {
- transfer[i] = state->transfer[i]->copy();
- }
- }
- if (lineDashLength > 0) {
- lineDash = (double *)gmallocn(lineDashLength, sizeof(double));
- memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double));
- }
- saved = NULL;
-}
-
-void GfxState::setPath(GfxPath *pathA) {
- delete path;
- path = pathA;
-}
-
-void GfxState::getUserClipBBox(double *xMin, double *yMin,
- double *xMax, double *yMax) {
- double ictm[6];
- double xMin1, yMin1, xMax1, yMax1, det, tx, ty;
-
- // invert the CTM
- det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
- ictm[0] = ctm[3] * det;
- ictm[1] = -ctm[1] * det;
- ictm[2] = -ctm[2] * det;
- ictm[3] = ctm[0] * det;
- ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
- ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
-
- // transform all four corners of the clip bbox; find the min and max
- // x and y values
- xMin1 = xMax1 = clipXMin * ictm[0] + clipYMin * ictm[2] + ictm[4];
- yMin1 = yMax1 = clipXMin * ictm[1] + clipYMin * ictm[3] + ictm[5];
- tx = clipXMin * ictm[0] + clipYMax * ictm[2] + ictm[4];
- ty = clipXMin * ictm[1] + clipYMax * ictm[3] + ictm[5];
- if (tx < xMin1) {
- xMin1 = tx;
- } else if (tx > xMax1) {
- xMax1 = tx;
- }
- if (ty < yMin1) {
- yMin1 = ty;
- } else if (ty > yMax1) {
- yMax1 = ty;
- }
- tx = clipXMax * ictm[0] + clipYMin * ictm[2] + ictm[4];
- ty = clipXMax * ictm[1] + clipYMin * ictm[3] + ictm[5];
- if (tx < xMin1) {
- xMin1 = tx;
- } else if (tx > xMax1) {
- xMax1 = tx;
- }
- if (ty < yMin1) {
- yMin1 = ty;
- } else if (ty > yMax1) {
- yMax1 = ty;
- }
- tx = clipXMax * ictm[0] + clipYMax * ictm[2] + ictm[4];
- ty = clipXMax * ictm[1] + clipYMax * ictm[3] + ictm[5];
- if (tx < xMin1) {
- xMin1 = tx;
- } else if (tx > xMax1) {
- xMax1 = tx;
- }
- if (ty < yMin1) {
- yMin1 = ty;
- } else if (ty > yMax1) {
- yMax1 = ty;
- }
-
- *xMin = xMin1;
- *yMin = yMin1;
- *xMax = xMax1;
- *yMax = yMax1;
-}
-
-double GfxState::transformWidth(double w) {
- double x, y;
-
- x = ctm[0] + ctm[2];
- y = ctm[1] + ctm[3];
- return w * sqrt(0.5 * (x * x + y * y));
-}
-
-double GfxState::getTransformedFontSize() {
- double x1, y1, x2, y2;
-
- x1 = textMat[2] * fontSize;
- y1 = textMat[3] * fontSize;
- x2 = ctm[0] * x1 + ctm[2] * y1;
- y2 = ctm[1] * x1 + ctm[3] * y1;
- return sqrt(x2 * x2 + y2 * y2);
-}
-
-void GfxState::getFontTransMat(double *m11, double *m12,
- double *m21, double *m22) {
- *m11 = (textMat[0] * ctm[0] + textMat[1] * ctm[2]) * fontSize;
- *m12 = (textMat[0] * ctm[1] + textMat[1] * ctm[3]) * fontSize;
- *m21 = (textMat[2] * ctm[0] + textMat[3] * ctm[2]) * fontSize;
- *m22 = (textMat[2] * ctm[1] + textMat[3] * ctm[3]) * fontSize;
-}
-
-void GfxState::setCTM(double a, double b, double c,
- double d, double e, double f) {
- int i;
-
- ctm[0] = a;
- ctm[1] = b;
- ctm[2] = c;
- ctm[3] = d;
- ctm[4] = e;
- ctm[5] = f;
-
- // avoid FP exceptions on badly messed up PDF files
- for (i = 0; i < 6; ++i) {
- if (ctm[i] > 1e10) {
- ctm[i] = 1e10;
- } else if (ctm[i] < -1e10) {
- ctm[i] = -1e10;
- }
- }
-}
-
-void GfxState::concatCTM(double a, double b, double c,
- double d, double e, double f) {
- double a1 = ctm[0];
- double b1 = ctm[1];
- double c1 = ctm[2];
- double d1 = ctm[3];
- int i;
-
- ctm[0] = a * a1 + b * c1;
- ctm[1] = a * b1 + b * d1;
- ctm[2] = c * a1 + d * c1;
- ctm[3] = c * b1 + d * d1;
- ctm[4] = e * a1 + f * c1 + ctm[4];
- ctm[5] = e * b1 + f * d1 + ctm[5];
-
- // avoid FP exceptions on badly messed up PDF files
- for (i = 0; i < 6; ++i) {
- if (ctm[i] > 1e10) {
- ctm[i] = 1e10;
- } else if (ctm[i] < -1e10) {
- ctm[i] = -1e10;
- }
- }
-}
-
-void GfxState::shiftCTM(double tx, double ty) {
- ctm[4] += tx;
- ctm[5] += ty;
- clipXMin += tx;
- clipYMin += ty;
- clipXMax += tx;
- clipYMax += ty;
-}
-
-void GfxState::setFillColorSpace(GfxColorSpace *colorSpace) {
- if (fillColorSpace) {
- delete fillColorSpace;
- }
- fillColorSpace = colorSpace;
-}
-
-void GfxState::setStrokeColorSpace(GfxColorSpace *colorSpace) {
- if (strokeColorSpace) {
- delete strokeColorSpace;
- }
- strokeColorSpace = colorSpace;
-}
-
-void GfxState::setFillPattern(GfxPattern *pattern) {
- if (fillPattern) {
- delete fillPattern;
- }
- fillPattern = pattern;
-}
-
-void GfxState::setStrokePattern(GfxPattern *pattern) {
- if (strokePattern) {
- delete strokePattern;
- }
- strokePattern = pattern;
-}
-
-void GfxState::setTransfer(Function **funcs) {
- int i;
-
- for (i = 0; i < 4; ++i) {
- if (transfer[i]) {
- delete transfer[i];
- }
- transfer[i] = funcs[i];
- }
-}
-
-void GfxState::setLineDash(double *dash, int length, double start) {
- if (lineDash)
- gfree(lineDash);
- lineDash = dash;
- lineDashLength = length;
- lineDashStart = start;
-}
-
-void GfxState::clearPath() {
- delete path;
- path = new GfxPath();
-}
-
-void GfxState::clip() {
- double xMin, yMin, xMax, yMax, x, y;
- GfxSubpath *subpath;
- int i, j;
-
- xMin = xMax = yMin = yMax = 0; // make gcc happy
- for (i = 0; i < path->getNumSubpaths(); ++i) {
- subpath = path->getSubpath(i);
- for (j = 0; j < subpath->getNumPoints(); ++j) {
- transform(subpath->getX(j), subpath->getY(j), &x, &y);
- if (i == 0 && j == 0) {
- xMin = xMax = x;
- yMin = yMax = y;
- } else {
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- }
- }
- }
- if (xMin > clipXMin) {
- clipXMin = xMin;
- }
- if (yMin > clipYMin) {
- clipYMin = yMin;
- }
- if (xMax < clipXMax) {
- clipXMax = xMax;
- }
- if (yMax < clipYMax) {
- clipYMax = yMax;
- }
-}
-
-void GfxState::clipToStrokePath() {
- double xMin, yMin, xMax, yMax, x, y, t0, t1;
- GfxSubpath *subpath;
- int i, j;
-
- xMin = xMax = yMin = yMax = 0; // make gcc happy
- for (i = 0; i < path->getNumSubpaths(); ++i) {
- subpath = path->getSubpath(i);
- for (j = 0; j < subpath->getNumPoints(); ++j) {
- transform(subpath->getX(j), subpath->getY(j), &x, &y);
- if (i == 0 && j == 0) {
- xMin = xMax = x;
- yMin = yMax = y;
- } else {
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- }
- }
- }
-
- // allow for the line width
- //~ miter joins can extend farther than this
- t0 = fabs(ctm[0]);
- t1 = fabs(ctm[2]);
- if (t0 > t1) {
- xMin -= 0.5 * lineWidth * t0;
- xMax += 0.5 * lineWidth * t0;
- } else {
- xMin -= 0.5 * lineWidth * t1;
- xMax += 0.5 * lineWidth * t1;
- }
- t0 = fabs(ctm[0]);
- t1 = fabs(ctm[3]);
- if (t0 > t1) {
- yMin -= 0.5 * lineWidth * t0;
- yMax += 0.5 * lineWidth * t0;
- } else {
- yMin -= 0.5 * lineWidth * t1;
- yMax += 0.5 * lineWidth * t1;
- }
-
- if (xMin > clipXMin) {
- clipXMin = xMin;
- }
- if (yMin > clipYMin) {
- clipYMin = yMin;
- }
- if (xMax < clipXMax) {
- clipXMax = xMax;
- }
- if (yMax < clipYMax) {
- clipYMax = yMax;
- }
-}
-
-void GfxState::textShift(double tx, double ty) {
- double dx, dy;
-
- textTransformDelta(tx, ty, &dx, &dy);
- curX += dx;
- curY += dy;
-}
-
-void GfxState::shift(double dx, double dy) {
- curX += dx;
- curY += dy;
-}
-
-GfxState *GfxState::save() {
- GfxState *newState;
-
- newState = copy();
- newState->saved = this;
- return newState;
-}
-
-GfxState *GfxState::restore() {
- GfxState *oldState;
-
- if (saved) {
- oldState = saved;
-
- // these attributes aren't saved/restored by the q/Q operators
- oldState->path = path;
- oldState->curX = curX;
- oldState->curY = curY;
- oldState->lineX = lineX;
- oldState->lineY = lineY;
-
- path = NULL;
- saved = NULL;
- delete this;
-
- } else {
- oldState = this;
- }
-
- return oldState;
-}
-
-GBool GfxState::parseBlendMode(Object *obj, GfxBlendMode *mode) {
- Object obj2;
- int i, j;
-
- if (obj->isName()) {
- for (i = 0; i < nGfxBlendModeNames; ++i) {
- if (!strcmp(obj->getName(), gfxBlendModeNames[i].name)) {
- *mode = gfxBlendModeNames[i].mode;
- return gTrue;
- }
- }
- return gFalse;
- } else if (obj->isArray()) {
- for (i = 0; i < obj->arrayGetLength(); ++i) {
- obj->arrayGet(i, &obj2);
- if (!obj2.isName()) {
- obj2.free();
- return gFalse;
- }
- for (j = 0; j < nGfxBlendModeNames; ++j) {
- if (!strcmp(obj2.getName(), gfxBlendModeNames[j].name)) {
- obj2.free();
- *mode = gfxBlendModeNames[j].mode;
- return gTrue;
- }
- }
- obj2.free();
- }
- *mode = gfxBlendNormal;
- return gTrue;
- } else {
- return gFalse;
- }
-}
diff --git a/kpdf/xpdf/xpdf/GfxState.cpp b/kpdf/xpdf/xpdf/GfxState.cpp
new file mode 100644
index 00000000..f7cb1ce9
--- /dev/null
+++ b/kpdf/xpdf/xpdf/GfxState.cpp
@@ -0,0 +1,4137 @@
+//========================================================================
+//
+// GfxState.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <math.h>
+#include <string.h>
+#include "gmem.h"
+#include "Error.h"
+#include "Object.h"
+#include "Array.h"
+#include "Page.h"
+#include "GfxState.h"
+
+//------------------------------------------------------------------------
+
+static inline GfxColorComp clip01(GfxColorComp x) {
+ return (x < 0) ? 0 : (x > gfxColorComp1) ? gfxColorComp1 : x;
+}
+
+static inline double clip01(double x) {
+ return (x < 0) ? 0 : (x > 1) ? 1 : x;
+}
+
+//------------------------------------------------------------------------
+
+struct GfxBlendModeInfo {
+ char *name;
+ GfxBlendMode mode;
+};
+
+static GfxBlendModeInfo gfxBlendModeNames[] = {
+ { "Normal", gfxBlendNormal },
+ { "Compatible", gfxBlendNormal },
+ { "Multiply", gfxBlendMultiply },
+ { "Screen", gfxBlendScreen },
+ { "Overlay", gfxBlendOverlay },
+ { "Darken", gfxBlendDarken },
+ { "Lighten", gfxBlendLighten },
+ { "ColorDodge", gfxBlendColorDodge },
+ { "ColorBurn", gfxBlendColorBurn },
+ { "HardLight", gfxBlendHardLight },
+ { "SoftLight", gfxBlendSoftLight },
+ { "Difference", gfxBlendDifference },
+ { "Exclusion", gfxBlendExclusion },
+ { "Hue", gfxBlendHue },
+ { "Saturation", gfxBlendSaturation },
+ { "Color", gfxBlendColor },
+ { "Luminosity", gfxBlendLuminosity }
+};
+
+#define nGfxBlendModeNames \
+ ((int)((sizeof(gfxBlendModeNames) / sizeof(GfxBlendModeInfo))))
+
+//------------------------------------------------------------------------
+
+// NB: This must match the GfxColorSpaceMode enum defined in
+// GfxState.h
+static char *gfxColorSpaceModeNames[] = {
+ "DeviceGray",
+ "CalGray",
+ "DeviceRGB",
+ "CalRGB",
+ "DeviceCMYK",
+ "Lab",
+ "ICCBased",
+ "Indexed",
+ "Separation",
+ "DeviceN",
+ "Pattern"
+};
+
+#define nGfxColorSpaceModes ((sizeof(gfxColorSpaceModeNames) / sizeof(char *)))
+
+//------------------------------------------------------------------------
+// GfxColorSpace
+//------------------------------------------------------------------------
+
+GfxColorSpace::GfxColorSpace() {
+}
+
+GfxColorSpace::~GfxColorSpace() {
+}
+
+GfxColorSpace *GfxColorSpace::parse(Object *csObj) {
+ GfxColorSpace *cs;
+ Object obj1;
+
+ cs = NULL;
+ if (csObj->isName()) {
+ if (csObj->isName("DeviceGray") || csObj->isName("G")) {
+ cs = new GfxDeviceGrayColorSpace();
+ } else if (csObj->isName("DeviceRGB") || csObj->isName("RGB")) {
+ cs = new GfxDeviceRGBColorSpace();
+ } else if (csObj->isName("DeviceCMYK") || csObj->isName("CMYK")) {
+ cs = new GfxDeviceCMYKColorSpace();
+ } else if (csObj->isName("Pattern")) {
+ cs = new GfxPatternColorSpace(NULL);
+ } else {
+ error(-1, "Bad color space '%s'", csObj->getName());
+ }
+ } else if (csObj->isArray()) {
+ csObj->arrayGet(0, &obj1);
+ if (obj1.isName("DeviceGray") || obj1.isName("G")) {
+ cs = new GfxDeviceGrayColorSpace();
+ } else if (obj1.isName("DeviceRGB") || obj1.isName("RGB")) {
+ cs = new GfxDeviceRGBColorSpace();
+ } else if (obj1.isName("DeviceCMYK") || obj1.isName("CMYK")) {
+ cs = new GfxDeviceCMYKColorSpace();
+ } else if (obj1.isName("CalGray")) {
+ cs = GfxCalGrayColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("CalRGB")) {
+ cs = GfxCalRGBColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Lab")) {
+ cs = GfxLabColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("ICCBased")) {
+ cs = GfxICCBasedColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Indexed") || obj1.isName("I")) {
+ cs = GfxIndexedColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Separation")) {
+ cs = GfxSeparationColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("DeviceN")) {
+ cs = GfxDeviceNColorSpace::parse(csObj->getArray());
+ } else if (obj1.isName("Pattern")) {
+ cs = GfxPatternColorSpace::parse(csObj->getArray());
+ } else {
+ error(-1, "Bad color space");
+ }
+ obj1.free();
+ } else {
+ error(-1, "Bad color space - expected name or array");
+ }
+ return cs;
+}
+
+void GfxColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
+ int /*maxImgPixel*/) {
+ int i;
+
+ for (i = 0; i < getNComps(); ++i) {
+ decodeLow[i] = 0;
+ decodeRange[i] = 1;
+ }
+}
+
+int GfxColorSpace::getNumColorSpaceModes() {
+ return nGfxColorSpaceModes;
+}
+
+char *GfxColorSpace::getColorSpaceModeName(int idx) {
+ return gfxColorSpaceModeNames[idx];
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceGrayColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceGrayColorSpace::GfxDeviceGrayColorSpace() {
+}
+
+GfxDeviceGrayColorSpace::~GfxDeviceGrayColorSpace() {
+}
+
+GfxColorSpace *GfxDeviceGrayColorSpace::copy() {
+ return new GfxDeviceGrayColorSpace();
+}
+
+void GfxDeviceGrayColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ *gray = clip01(color->c[0]);
+}
+
+void GfxDeviceGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
+}
+
+void GfxDeviceGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = cmyk->m = cmyk->y = 0;
+ cmyk->k = clip01(gfxColorComp1 - color->c[0]);
+}
+
+void GfxDeviceGrayColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+}
+
+//------------------------------------------------------------------------
+// GfxCalGrayColorSpace
+//------------------------------------------------------------------------
+
+GfxCalGrayColorSpace::GfxCalGrayColorSpace() {
+ whiteX = whiteY = whiteZ = 1;
+ blackX = blackY = blackZ = 0;
+ gamma = 1;
+}
+
+GfxCalGrayColorSpace::~GfxCalGrayColorSpace() {
+}
+
+GfxColorSpace *GfxCalGrayColorSpace::copy() {
+ GfxCalGrayColorSpace *cs;
+
+ cs = new GfxCalGrayColorSpace();
+ cs->whiteX = whiteX;
+ cs->whiteY = whiteY;
+ cs->whiteZ = whiteZ;
+ cs->blackX = blackX;
+ cs->blackY = blackY;
+ cs->blackZ = blackZ;
+ cs->gamma = gamma;
+ return cs;
+}
+
+GfxColorSpace *GfxCalGrayColorSpace::parse(Array *arr) {
+ GfxCalGrayColorSpace *cs;
+ Object obj1, obj2, obj3;
+
+ arr->get(1, &obj1);
+ if (!obj1.isDict()) {
+ error(-1, "Bad CalGray color space");
+ obj1.free();
+ return NULL;
+ }
+ cs = new GfxCalGrayColorSpace();
+ if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->whiteX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->whiteY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->whiteZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->blackX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->blackY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->blackZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Gamma", &obj2)->isNum()) {
+ cs->gamma = obj2.getNum();
+ }
+ obj2.free();
+ obj1.free();
+ return cs;
+}
+
+void GfxCalGrayColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ *gray = clip01(color->c[0]);
+}
+
+void GfxCalGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
+}
+
+void GfxCalGrayColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = cmyk->m = cmyk->y = 0;
+ cmyk->k = clip01(gfxColorComp1 - color->c[0]);
+}
+
+void GfxCalGrayColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceRGBColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceRGBColorSpace::GfxDeviceRGBColorSpace() {
+}
+
+GfxDeviceRGBColorSpace::~GfxDeviceRGBColorSpace() {
+}
+
+GfxColorSpace *GfxDeviceRGBColorSpace::copy() {
+ return new GfxDeviceRGBColorSpace();
+}
+
+void GfxDeviceRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ *gray = clip01((GfxColorComp)(0.3 * color->c[0] +
+ 0.59 * color->c[1] +
+ 0.11 * color->c[2] + 0.5));
+}
+
+void GfxDeviceRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = clip01(color->c[0]);
+ rgb->g = clip01(color->c[1]);
+ rgb->b = clip01(color->c[2]);
+}
+
+void GfxDeviceRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxColorComp c, m, y, k;
+
+ c = clip01(gfxColorComp1 - color->c[0]);
+ m = clip01(gfxColorComp1 - color->c[1]);
+ y = clip01(gfxColorComp1 - color->c[2]);
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+ cmyk->c = c - k;
+ cmyk->m = m - k;
+ cmyk->y = y - k;
+ cmyk->k = k;
+}
+
+void GfxDeviceRGBColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+ color->c[1] = 0;
+ color->c[2] = 0;
+}
+
+//------------------------------------------------------------------------
+// GfxCalRGBColorSpace
+//------------------------------------------------------------------------
+
+GfxCalRGBColorSpace::GfxCalRGBColorSpace() {
+ whiteX = whiteY = whiteZ = 1;
+ blackX = blackY = blackZ = 0;
+ gammaR = gammaG = gammaB = 1;
+ mat[0] = 1; mat[1] = 0; mat[2] = 0;
+ mat[3] = 0; mat[4] = 1; mat[5] = 0;
+ mat[6] = 0; mat[7] = 0; mat[8] = 1;
+}
+
+GfxCalRGBColorSpace::~GfxCalRGBColorSpace() {
+}
+
+GfxColorSpace *GfxCalRGBColorSpace::copy() {
+ GfxCalRGBColorSpace *cs;
+ int i;
+
+ cs = new GfxCalRGBColorSpace();
+ cs->whiteX = whiteX;
+ cs->whiteY = whiteY;
+ cs->whiteZ = whiteZ;
+ cs->blackX = blackX;
+ cs->blackY = blackY;
+ cs->blackZ = blackZ;
+ cs->gammaR = gammaR;
+ cs->gammaG = gammaG;
+ cs->gammaB = gammaB;
+ for (i = 0; i < 9; ++i) {
+ cs->mat[i] = mat[i];
+ }
+ return cs;
+}
+
+GfxColorSpace *GfxCalRGBColorSpace::parse(Array *arr) {
+ GfxCalRGBColorSpace *cs;
+ Object obj1, obj2, obj3;
+ int i;
+
+ arr->get(1, &obj1);
+ if (!obj1.isDict()) {
+ error(-1, "Bad CalRGB color space");
+ obj1.free();
+ return NULL;
+ }
+ cs = new GfxCalRGBColorSpace();
+ if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->whiteX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->whiteY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->whiteZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->blackX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->blackY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->blackZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Gamma", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->gammaR = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->gammaG = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->gammaB = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Matrix", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 9) {
+ for (i = 0; i < 9; ++i) {
+ obj2.arrayGet(i, &obj3);
+ cs->mat[i] = obj3.getNum();
+ obj3.free();
+ }
+ }
+ obj2.free();
+ obj1.free();
+ return cs;
+}
+
+void GfxCalRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ *gray = clip01((GfxColorComp)(0.299 * color->c[0] +
+ 0.587 * color->c[1] +
+ 0.114 * color->c[2] + 0.5));
+}
+
+void GfxCalRGBColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ rgb->r = clip01(color->c[0]);
+ rgb->g = clip01(color->c[1]);
+ rgb->b = clip01(color->c[2]);
+}
+
+void GfxCalRGBColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxColorComp c, m, y, k;
+
+ c = clip01(gfxColorComp1 - color->c[0]);
+ m = clip01(gfxColorComp1 - color->c[1]);
+ y = clip01(gfxColorComp1 - color->c[2]);
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+ cmyk->c = c - k;
+ cmyk->m = m - k;
+ cmyk->y = y - k;
+ cmyk->k = k;
+}
+
+void GfxCalRGBColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+ color->c[1] = 0;
+ color->c[2] = 0;
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceCMYKColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceCMYKColorSpace::GfxDeviceCMYKColorSpace() {
+}
+
+GfxDeviceCMYKColorSpace::~GfxDeviceCMYKColorSpace() {
+}
+
+GfxColorSpace *GfxDeviceCMYKColorSpace::copy() {
+ return new GfxDeviceCMYKColorSpace();
+}
+
+void GfxDeviceCMYKColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ *gray = clip01((GfxColorComp)(gfxColorComp1 - color->c[3]
+ - 0.3 * color->c[0]
+ - 0.59 * color->c[1]
+ - 0.11 * color->c[2] + 0.5));
+}
+
+void GfxDeviceCMYKColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ double c, m, y, k, c1, m1, y1, k1, r, g, b, x;
+
+ c = colToDbl(color->c[0]);
+ m = colToDbl(color->c[1]);
+ y = colToDbl(color->c[2]);
+ k = colToDbl(color->c[3]);
+ c1 = 1 - c;
+ m1 = 1 - m;
+ y1 = 1 - y;
+ k1 = 1 - k;
+ // this is a matrix multiplication, unrolled for performance
+ // C M Y K
+ x = c1 * m1 * y1 * k1; // 0 0 0 0
+ r = g = b = x;
+ x = c1 * m1 * y1 * k; // 0 0 0 1
+ r += 0.1373 * x;
+ g += 0.1216 * x;
+ b += 0.1255 * x;
+ x = c1 * m1 * y * k1; // 0 0 1 0
+ r += x;
+ g += 0.9490 * x;
+ x = c1 * m1 * y * k; // 0 0 1 1
+ r += 0.1098 * x;
+ g += 0.1020 * x;
+ x = c1 * m * y1 * k1; // 0 1 0 0
+ r += 0.9255 * x;
+ b += 0.5490 * x;
+ x = c1 * m * y1 * k; // 0 1 0 1
+ r += 0.1412 * x;
+ x = c1 * m * y * k1; // 0 1 1 0
+ r += 0.9294 * x;
+ g += 0.1098 * x;
+ b += 0.1412 * x;
+ x = c1 * m * y * k; // 0 1 1 1
+ r += 0.1333 * x;
+ x = c * m1 * y1 * k1; // 1 0 0 0
+ g += 0.6784 * x;
+ b += 0.9373 * x;
+ x = c * m1 * y1 * k; // 1 0 0 1
+ g += 0.0588 * x;
+ b += 0.1412 * x;
+ x = c * m1 * y * k1; // 1 0 1 0
+ g += 0.6510 * x;
+ b += 0.3137 * x;
+ x = c * m1 * y * k; // 1 0 1 1
+ g += 0.0745 * x;
+ x = c * m * y1 * k1; // 1 1 0 0
+ r += 0.1804 * x;
+ g += 0.1922 * x;
+ b += 0.5725 * x;
+ x = c * m * y1 * k; // 1 1 0 1
+ b += 0.0078 * x;
+ x = c * m * y * k1; // 1 1 1 0
+ r += 0.2118 * x;
+ g += 0.2119 * x;
+ b += 0.2235 * x;
+ rgb->r = clip01(dblToCol(r));
+ rgb->g = clip01(dblToCol(g));
+ rgb->b = clip01(dblToCol(b));
+}
+
+void GfxDeviceCMYKColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ cmyk->c = clip01(color->c[0]);
+ cmyk->m = clip01(color->c[1]);
+ cmyk->y = clip01(color->c[2]);
+ cmyk->k = clip01(color->c[3]);
+}
+
+void GfxDeviceCMYKColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+ color->c[1] = 0;
+ color->c[2] = 0;
+ color->c[3] = gfxColorComp1;
+}
+
+//------------------------------------------------------------------------
+// GfxLabColorSpace
+//------------------------------------------------------------------------
+
+// This is the inverse of MatrixLMN in Example 4.10 from the PostScript
+// Language Reference, Third Edition.
+static double xyzrgb[3][3] = {
+ { 3.240449, -1.537136, -0.498531 },
+ { -0.969265, 1.876011, 0.041556 },
+ { 0.055643, -0.204026, 1.057229 }
+};
+
+GfxLabColorSpace::GfxLabColorSpace() {
+ whiteX = whiteY = whiteZ = 1;
+ blackX = blackY = blackZ = 0;
+ aMin = bMin = -100;
+ aMax = bMax = 100;
+}
+
+GfxLabColorSpace::~GfxLabColorSpace() {
+}
+
+GfxColorSpace *GfxLabColorSpace::copy() {
+ GfxLabColorSpace *cs;
+
+ cs = new GfxLabColorSpace();
+ cs->whiteX = whiteX;
+ cs->whiteY = whiteY;
+ cs->whiteZ = whiteZ;
+ cs->blackX = blackX;
+ cs->blackY = blackY;
+ cs->blackZ = blackZ;
+ cs->aMin = aMin;
+ cs->aMax = aMax;
+ cs->bMin = bMin;
+ cs->bMax = bMax;
+ cs->kr = kr;
+ cs->kg = kg;
+ cs->kb = kb;
+ return cs;
+}
+
+GfxColorSpace *GfxLabColorSpace::parse(Array *arr) {
+ GfxLabColorSpace *cs;
+ Object obj1, obj2, obj3;
+
+ arr->get(1, &obj1);
+ if (!obj1.isDict()) {
+ error(-1, "Bad Lab color space");
+ obj1.free();
+ return NULL;
+ }
+ cs = new GfxLabColorSpace();
+ if (obj1.dictLookup("WhitePoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->whiteX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->whiteY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->whiteZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("BlackPoint", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 3) {
+ obj2.arrayGet(0, &obj3);
+ cs->blackX = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->blackY = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->blackZ = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ if (obj1.dictLookup("Range", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 4) {
+ obj2.arrayGet(0, &obj3);
+ cs->aMin = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(1, &obj3);
+ cs->aMax = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2, &obj3);
+ cs->bMin = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(3, &obj3);
+ cs->bMax = obj3.getNum();
+ obj3.free();
+ }
+ obj2.free();
+ obj1.free();
+
+ cs->kr = 1 / (xyzrgb[0][0] * cs->whiteX +
+ xyzrgb[0][1] * cs->whiteY +
+ xyzrgb[0][2] * cs->whiteZ);
+ cs->kg = 1 / (xyzrgb[1][0] * cs->whiteX +
+ xyzrgb[1][1] * cs->whiteY +
+ xyzrgb[1][2] * cs->whiteZ);
+ cs->kb = 1 / (xyzrgb[2][0] * cs->whiteX +
+ xyzrgb[2][1] * cs->whiteY +
+ xyzrgb[2][2] * cs->whiteZ);
+
+ return cs;
+}
+
+void GfxLabColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ GfxRGB rgb;
+
+ getRGB(color, &rgb);
+ *gray = clip01((GfxColorComp)(0.299 * rgb.r +
+ 0.587 * rgb.g +
+ 0.114 * rgb.b + 0.5));
+}
+
+void GfxLabColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ double X, Y, Z;
+ double t1, t2;
+ double r, g, b;
+
+ // convert L*a*b* to CIE 1931 XYZ color space
+ t1 = (colToDbl(color->c[0]) + 16) / 116;
+ t2 = t1 + colToDbl(color->c[1]) / 500;
+ if (t2 >= (6.0 / 29.0)) {
+ X = t2 * t2 * t2;
+ } else {
+ X = (108.0 / 841.0) * (t2 - (4.0 / 29.0));
+ }
+ X *= whiteX;
+ if (t1 >= (6.0 / 29.0)) {
+ Y = t1 * t1 * t1;
+ } else {
+ Y = (108.0 / 841.0) * (t1 - (4.0 / 29.0));
+ }
+ Y *= whiteY;
+ t2 = t1 - colToDbl(color->c[2]) / 200;
+ if (t2 >= (6.0 / 29.0)) {
+ Z = t2 * t2 * t2;
+ } else {
+ Z = (108.0 / 841.0) * (t2 - (4.0 / 29.0));
+ }
+ Z *= whiteZ;
+
+ // convert XYZ to RGB, including gamut mapping and gamma correction
+ r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z;
+ g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
+ b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
+ rgb->r = dblToCol(pow(clip01(r * kr), 0.5));
+ rgb->g = dblToCol(pow(clip01(g * kg), 0.5));
+ rgb->b = dblToCol(pow(clip01(b * kb), 0.5));
+}
+
+void GfxLabColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxRGB rgb;
+ GfxColorComp c, m, y, k;
+
+ getRGB(color, &rgb);
+ c = clip01(gfxColorComp1 - rgb.r);
+ m = clip01(gfxColorComp1 - rgb.g);
+ y = clip01(gfxColorComp1 - rgb.b);
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+ cmyk->c = c - k;
+ cmyk->m = m - k;
+ cmyk->y = y - k;
+ cmyk->k = k;
+}
+
+void GfxLabColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+ if (aMin > 0) {
+ color->c[1] = dblToCol(aMin);
+ } else if (aMax < 0) {
+ color->c[1] = dblToCol(aMax);
+ } else {
+ color->c[1] = 0;
+ }
+ if (bMin > 0) {
+ color->c[2] = dblToCol(bMin);
+ } else if (bMax < 0) {
+ color->c[2] = dblToCol(bMax);
+ } else {
+ color->c[2] = 0;
+ }
+}
+
+void GfxLabColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
+ int /*maxImgPixel*/) {
+ decodeLow[0] = 0;
+ decodeRange[0] = 100;
+ decodeLow[1] = aMin;
+ decodeRange[1] = aMax - aMin;
+ decodeLow[2] = bMin;
+ decodeRange[2] = bMax - bMin;
+}
+
+//------------------------------------------------------------------------
+// GfxICCBasedColorSpace
+//------------------------------------------------------------------------
+
+GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA,
+ Ref *iccProfileStreamA) {
+ nComps = nCompsA;
+ alt = altA;
+ iccProfileStream = *iccProfileStreamA;
+ rangeMin[0] = rangeMin[1] = rangeMin[2] = rangeMin[3] = 0;
+ rangeMax[0] = rangeMax[1] = rangeMax[2] = rangeMax[3] = 1;
+}
+
+GfxICCBasedColorSpace::~GfxICCBasedColorSpace() {
+ delete alt;
+}
+
+GfxColorSpace *GfxICCBasedColorSpace::copy() {
+ GfxICCBasedColorSpace *cs;
+ int i;
+
+ cs = new GfxICCBasedColorSpace(nComps, alt->copy(), &iccProfileStream);
+ for (i = 0; i < 4; ++i) {
+ cs->rangeMin[i] = rangeMin[i];
+ cs->rangeMax[i] = rangeMax[i];
+ }
+ return cs;
+}
+
+GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr) {
+ GfxICCBasedColorSpace *cs;
+ Ref iccProfileStreamA;
+ int nCompsA;
+ GfxColorSpace *altA;
+ Dict *dict;
+ Object obj1, obj2, obj3;
+ int i;
+
+ arr->getNF(1, &obj1);
+ if (obj1.isRef()) {
+ iccProfileStreamA = obj1.getRef();
+ } else {
+ iccProfileStreamA.num = 0;
+ iccProfileStreamA.gen = 0;
+ }
+ obj1.free();
+ arr->get(1, &obj1);
+ if (!obj1.isStream()) {
+ error(-1, "Bad ICCBased color space (stream)");
+ obj1.free();
+ return NULL;
+ }
+ dict = obj1.streamGetDict();
+ if (!dict->lookup("N", &obj2)->isInt()) {
+ error(-1, "Bad ICCBased color space (N)");
+ obj2.free();
+ obj1.free();
+ return NULL;
+ }
+ nCompsA = obj2.getInt();
+ obj2.free();
+ if (nCompsA > gfxColorMaxComps) {
+ error(-1, "ICCBased color space with too many (%d > %d) components",
+ nCompsA, gfxColorMaxComps);
+ nCompsA = gfxColorMaxComps;
+ }
+ if (dict->lookup("Alternate", &obj2)->isNull() ||
+ !(altA = GfxColorSpace::parse(&obj2))) {
+ switch (nCompsA) {
+ case 1:
+ altA = new GfxDeviceGrayColorSpace();
+ break;
+ case 3:
+ altA = new GfxDeviceRGBColorSpace();
+ break;
+ case 4:
+ altA = new GfxDeviceCMYKColorSpace();
+ break;
+ default:
+ error(-1, "Bad ICCBased color space - invalid N");
+ obj2.free();
+ obj1.free();
+ return NULL;
+ }
+ }
+ obj2.free();
+ cs = new GfxICCBasedColorSpace(nCompsA, altA, &iccProfileStreamA);
+ if (dict->lookup("Range", &obj2)->isArray() &&
+ obj2.arrayGetLength() == 2 * nCompsA) {
+ for (i = 0; i < nCompsA; ++i) {
+ obj2.arrayGet(2*i, &obj3);
+ cs->rangeMin[i] = obj3.getNum();
+ obj3.free();
+ obj2.arrayGet(2*i+1, &obj3);
+ cs->rangeMax[i] = obj3.getNum();
+ obj3.free();
+ }
+ }
+ obj2.free();
+ obj1.free();
+ return cs;
+}
+
+void GfxICCBasedColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ alt->getGray(color, gray);
+}
+
+void GfxICCBasedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ alt->getRGB(color, rgb);
+}
+
+void GfxICCBasedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ alt->getCMYK(color, cmyk);
+}
+
+void GfxICCBasedColorSpace::getDefaultColor(GfxColor *color) {
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ if (rangeMin[i] > 0) {
+ color->c[i] = dblToCol(rangeMin[i]);
+ } else if (rangeMax[i] < 0) {
+ color->c[i] = dblToCol(rangeMax[i]);
+ } else {
+ color->c[i] = 0;
+ }
+ }
+}
+
+void GfxICCBasedColorSpace::getDefaultRanges(double *decodeLow,
+ double *decodeRange,
+ int maxImgPixel) {
+ alt->getDefaultRanges(decodeLow, decodeRange, maxImgPixel);
+
+#if 0
+ // this is nominally correct, but some PDF files don't set the
+ // correct ranges in the ICCBased dict
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ decodeLow[i] = rangeMin[i];
+ decodeRange[i] = rangeMax[i] - rangeMin[i];
+ }
+#endif
+}
+
+//------------------------------------------------------------------------
+// GfxIndexedColorSpace
+//------------------------------------------------------------------------
+
+GfxIndexedColorSpace::GfxIndexedColorSpace(GfxColorSpace *baseA,
+ int indexHighA) {
+ base = baseA;
+ indexHigh = indexHighA;
+ lookup = (Guchar *)gmallocn((indexHigh + 1) * base->getNComps(),
+ sizeof(Guchar));
+}
+
+GfxIndexedColorSpace::~GfxIndexedColorSpace() {
+ delete base;
+ gfree(lookup);
+}
+
+GfxColorSpace *GfxIndexedColorSpace::copy() {
+ GfxIndexedColorSpace *cs;
+
+ cs = new GfxIndexedColorSpace(base->copy(), indexHigh);
+ memcpy(cs->lookup, lookup,
+ (indexHigh + 1) * base->getNComps() * sizeof(Guchar));
+ return cs;
+}
+
+GfxColorSpace *GfxIndexedColorSpace::parse(Array *arr) {
+ GfxIndexedColorSpace *cs;
+ GfxColorSpace *baseA;
+ int indexHighA;
+ Object obj1;
+ int x;
+ char *s;
+ int n, i, j;
+
+ if (arr->getLength() != 4) {
+ error(-1, "Bad Indexed color space");
+ goto err1;
+ }
+ arr->get(1, &obj1);
+ if (!(baseA = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad Indexed color space (base color space)");
+ goto err2;
+ }
+ obj1.free();
+ if (!arr->get(2, &obj1)->isInt()) {
+ error(-1, "Bad Indexed color space (hival)");
+ delete baseA;
+ goto err2;
+ }
+ indexHighA = obj1.getInt();
+ if (indexHighA < 0 || indexHighA > 255) {
+ // the PDF spec requires indexHigh to be in [0,255] -- allowing
+ // values larger than 255 creates a security hole: if nComps *
+ // indexHigh is greater than 2^31, the loop below may overwrite
+ // past the end of the array
+ error(-1, "Bad Indexed color space (invalid indexHigh value)");
+ delete baseA;
+ goto err2;
+ }
+ obj1.free();
+ cs = new GfxIndexedColorSpace(baseA, indexHighA);
+ arr->get(3, &obj1);
+ n = baseA->getNComps();
+ if (obj1.isStream()) {
+ obj1.streamReset();
+ for (i = 0; i <= indexHighA; ++i) {
+ for (j = 0; j < n; ++j) {
+ if ((x = obj1.streamGetChar()) == EOF) {
+ error(-1, "Bad Indexed color space (lookup table stream too short)");
+ goto err3;
+ }
+ cs->lookup[i*n + j] = (Guchar)x;
+ }
+ }
+ obj1.streamClose();
+ } else if (obj1.isString()) {
+ if (obj1.getString()->getLength() < (indexHighA + 1) * n) {
+ error(-1, "Bad Indexed color space (lookup table string too short)");
+ goto err3;
+ }
+ s = obj1.getString()->getCString();
+ for (i = 0; i <= indexHighA; ++i) {
+ for (j = 0; j < n; ++j) {
+ cs->lookup[i*n + j] = (Guchar)*s++;
+ }
+ }
+ } else {
+ error(-1, "Bad Indexed color space (lookup table)");
+ goto err3;
+ }
+ obj1.free();
+ return cs;
+
+ err3:
+ delete cs;
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+GfxColor *GfxIndexedColorSpace::mapColorToBase(GfxColor *color,
+ GfxColor *baseColor) {
+ Guchar *p;
+ double low[gfxColorMaxComps], range[gfxColorMaxComps];
+ int n, i;
+
+ n = base->getNComps();
+ base->getDefaultRanges(low, range, indexHigh);
+ p = &lookup[(int)(colToDbl(color->c[0]) + 0.5) * n];
+ for (i = 0; i < n; ++i) {
+ baseColor->c[i] = dblToCol(low[i] + (p[i] / 255.0) * range[i]);
+ }
+ return baseColor;
+}
+
+void GfxIndexedColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ GfxColor color2;
+
+ base->getGray(mapColorToBase(color, &color2), gray);
+}
+
+void GfxIndexedColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ GfxColor color2;
+
+ base->getRGB(mapColorToBase(color, &color2), rgb);
+}
+
+void GfxIndexedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ GfxColor color2;
+
+ base->getCMYK(mapColorToBase(color, &color2), cmyk);
+}
+
+void GfxIndexedColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = 0;
+}
+
+void GfxIndexedColorSpace::getDefaultRanges(double *decodeLow,
+ double *decodeRange,
+ int maxImgPixel) {
+ decodeLow[0] = 0;
+ decodeRange[0] = maxImgPixel;
+}
+
+//------------------------------------------------------------------------
+// GfxSeparationColorSpace
+//------------------------------------------------------------------------
+
+GfxSeparationColorSpace::GfxSeparationColorSpace(GString *nameA,
+ GfxColorSpace *altA,
+ Function *funcA) {
+ name = nameA;
+ alt = altA;
+ func = funcA;
+ nonMarking = !name->cmp("None");
+}
+
+GfxSeparationColorSpace::~GfxSeparationColorSpace() {
+ delete name;
+ delete alt;
+ delete func;
+}
+
+GfxColorSpace *GfxSeparationColorSpace::copy() {
+ return new GfxSeparationColorSpace(name->copy(), alt->copy(), func->copy());
+}
+
+//~ handle the 'All' and 'None' colorants
+GfxColorSpace *GfxSeparationColorSpace::parse(Array *arr) {
+ GfxSeparationColorSpace *cs;
+ GString *nameA;
+ GfxColorSpace *altA;
+ Function *funcA;
+ Object obj1;
+
+ if (arr->getLength() != 4) {
+ error(-1, "Bad Separation color space");
+ goto err1;
+ }
+ if (!arr->get(1, &obj1)->isName()) {
+ error(-1, "Bad Separation color space (name)");
+ goto err2;
+ }
+ nameA = new GString(obj1.getName());
+ obj1.free();
+ arr->get(2, &obj1);
+ if (!(altA = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad Separation color space (alternate color space)");
+ goto err3;
+ }
+ obj1.free();
+ arr->get(3, &obj1);
+ if (!(funcA = Function::parse(&obj1))) {
+ goto err4;
+ }
+ obj1.free();
+ cs = new GfxSeparationColorSpace(nameA, altA, funcA);
+ return cs;
+
+ err4:
+ delete altA;
+ err3:
+ delete nameA;
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+void GfxSeparationColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ double x;
+ double c[gfxColorMaxComps];
+ GfxColor color2;
+ int i;
+
+ x = colToDbl(color->c[0]);
+ func->transform(&x, c);
+ for (i = 0; i < alt->getNComps(); ++i) {
+ color2.c[i] = dblToCol(c[i]);
+ }
+ alt->getGray(&color2, gray);
+}
+
+void GfxSeparationColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ double x;
+ double c[gfxColorMaxComps];
+ GfxColor color2;
+ int i;
+
+ x = colToDbl(color->c[0]);
+ func->transform(&x, c);
+ for (i = 0; i < alt->getNComps(); ++i) {
+ color2.c[i] = dblToCol(c[i]);
+ }
+ alt->getRGB(&color2, rgb);
+}
+
+void GfxSeparationColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ double x;
+ double c[gfxColorMaxComps];
+ GfxColor color2;
+ int i;
+
+ x = colToDbl(color->c[0]);
+ func->transform(&x, c);
+ for (i = 0; i < alt->getNComps(); ++i) {
+ color2.c[i] = dblToCol(c[i]);
+ }
+ alt->getCMYK(&color2, cmyk);
+}
+
+void GfxSeparationColorSpace::getDefaultColor(GfxColor *color) {
+ color->c[0] = gfxColorComp1;
+}
+
+//------------------------------------------------------------------------
+// GfxDeviceNColorSpace
+//------------------------------------------------------------------------
+
+GfxDeviceNColorSpace::GfxDeviceNColorSpace(int nCompsA,
+ GfxColorSpace *altA,
+ Function *funcA) {
+ nComps = nCompsA;
+ alt = altA;
+ func = funcA;
+ nonMarking = gFalse;
+}
+
+GfxDeviceNColorSpace::~GfxDeviceNColorSpace() {
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ delete names[i];
+ }
+ delete alt;
+ delete func;
+}
+
+GfxColorSpace *GfxDeviceNColorSpace::copy() {
+ GfxDeviceNColorSpace *cs;
+ int i;
+
+ cs = new GfxDeviceNColorSpace(nComps, alt->copy(), func->copy());
+ for (i = 0; i < nComps; ++i) {
+ cs->names[i] = names[i]->copy();
+ }
+ cs->nonMarking = nonMarking;
+ return cs;
+}
+
+//~ handle the 'None' colorant
+GfxColorSpace *GfxDeviceNColorSpace::parse(Array *arr) {
+ GfxDeviceNColorSpace *cs;
+ int nCompsA;
+ GString *namesA[gfxColorMaxComps];
+ GfxColorSpace *altA;
+ Function *funcA;
+ Object obj1, obj2;
+ int i;
+
+ if (arr->getLength() != 4 && arr->getLength() != 5) {
+ error(-1, "Bad DeviceN color space");
+ goto err1;
+ }
+ if (!arr->get(1, &obj1)->isArray()) {
+ error(-1, "Bad DeviceN color space (names)");
+ goto err2;
+ }
+ nCompsA = obj1.arrayGetLength();
+ if (nCompsA > gfxColorMaxComps) {
+ error(-1, "DeviceN color space with too many (%d > %d) components",
+ nCompsA, gfxColorMaxComps);
+ nCompsA = gfxColorMaxComps;
+ }
+ for (i = 0; i < nCompsA; ++i) {
+ if (!obj1.arrayGet(i, &obj2)->isName()) {
+ error(-1, "Bad DeviceN color space (names)");
+ obj2.free();
+ goto err2;
+ }
+ namesA[i] = new GString(obj2.getName());
+ obj2.free();
+ }
+ obj1.free();
+ arr->get(2, &obj1);
+ if (!(altA = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad DeviceN color space (alternate color space)");
+ goto err3;
+ }
+ obj1.free();
+ arr->get(3, &obj1);
+ if (!(funcA = Function::parse(&obj1))) {
+ goto err4;
+ }
+ obj1.free();
+ cs = new GfxDeviceNColorSpace(nCompsA, altA, funcA);
+ cs->nonMarking = gTrue;
+ for (i = 0; i < nCompsA; ++i) {
+ cs->names[i] = namesA[i];
+ if (namesA[i]->cmp("None")) {
+ cs->nonMarking = gFalse;
+ }
+ }
+ return cs;
+
+ err4:
+ delete altA;
+ err3:
+ for (i = 0; i < nCompsA; ++i) {
+ delete namesA[i];
+ }
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+void GfxDeviceNColorSpace::getGray(GfxColor *color, GfxGray *gray) {
+ double x[gfxColorMaxComps], c[gfxColorMaxComps];
+ GfxColor color2;
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ x[i] = colToDbl(color->c[i]);
+ }
+ func->transform(x, c);
+ for (i = 0; i < alt->getNComps(); ++i) {
+ color2.c[i] = dblToCol(c[i]);
+ }
+ alt->getGray(&color2, gray);
+}
+
+void GfxDeviceNColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
+ double x[gfxColorMaxComps], c[gfxColorMaxComps];
+ GfxColor color2;
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ x[i] = colToDbl(color->c[i]);
+ }
+ func->transform(x, c);
+ for (i = 0; i < alt->getNComps(); ++i) {
+ color2.c[i] = dblToCol(c[i]);
+ }
+ alt->getRGB(&color2, rgb);
+}
+
+void GfxDeviceNColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
+ double x[gfxColorMaxComps], c[gfxColorMaxComps];
+ GfxColor color2;
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ x[i] = colToDbl(color->c[i]);
+ }
+ func->transform(x, c);
+ for (i = 0; i < alt->getNComps(); ++i) {
+ color2.c[i] = dblToCol(c[i]);
+ }
+ alt->getCMYK(&color2, cmyk);
+}
+
+void GfxDeviceNColorSpace::getDefaultColor(GfxColor *color) {
+ int i;
+
+ for (i = 0; i < nComps; ++i) {
+ color->c[i] = gfxColorComp1;
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxPatternColorSpace
+//------------------------------------------------------------------------
+
+GfxPatternColorSpace::GfxPatternColorSpace(GfxColorSpace *underA) {
+ under = underA;
+}
+
+GfxPatternColorSpace::~GfxPatternColorSpace() {
+ if (under) {
+ delete under;
+ }
+}
+
+GfxColorSpace *GfxPatternColorSpace::copy() {
+ return new GfxPatternColorSpace(under ? under->copy() :
+ (GfxColorSpace *)NULL);
+}
+
+GfxColorSpace *GfxPatternColorSpace::parse(Array *arr) {
+ GfxPatternColorSpace *cs;
+ GfxColorSpace *underA;
+ Object obj1;
+
+ if (arr->getLength() != 1 && arr->getLength() != 2) {
+ error(-1, "Bad Pattern color space");
+ return NULL;
+ }
+ underA = NULL;
+ if (arr->getLength() == 2) {
+ arr->get(1, &obj1);
+ if (!(underA = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad Pattern color space (underlying color space)");
+ obj1.free();
+ return NULL;
+ }
+ obj1.free();
+ }
+ cs = new GfxPatternColorSpace(underA);
+ return cs;
+}
+
+void GfxPatternColorSpace::getGray(GfxColor * /*color*/, GfxGray *gray) {
+ *gray = 0;
+}
+
+void GfxPatternColorSpace::getRGB(GfxColor * /*color*/, GfxRGB *rgb) {
+ rgb->r = rgb->g = rgb->b = 0;
+}
+
+void GfxPatternColorSpace::getCMYK(GfxColor * /*color*/, GfxCMYK *cmyk) {
+ cmyk->c = cmyk->m = cmyk->y = 0;
+ cmyk->k = 1;
+}
+
+void GfxPatternColorSpace::getDefaultColor(GfxColor * /*color*/) {
+ // not used
+}
+
+//------------------------------------------------------------------------
+// Pattern
+//------------------------------------------------------------------------
+
+GfxPattern::GfxPattern(int typeA) {
+ type = typeA;
+}
+
+GfxPattern::~GfxPattern() {
+}
+
+GfxPattern *GfxPattern::parse(Object *obj) {
+ GfxPattern *pattern;
+ Object obj1;
+
+ if (obj->isDict()) {
+ obj->dictLookup("PatternType", &obj1);
+ } else if (obj->isStream()) {
+ obj->streamGetDict()->lookup("PatternType", &obj1);
+ } else {
+ return NULL;
+ }
+ pattern = NULL;
+ if (obj1.isInt() && obj1.getInt() == 1) {
+ pattern = GfxTilingPattern::parse(obj);
+ } else if (obj1.isInt() && obj1.getInt() == 2) {
+ pattern = GfxShadingPattern::parse(obj);
+ }
+ obj1.free();
+ return pattern;
+}
+
+//------------------------------------------------------------------------
+// GfxTilingPattern
+//------------------------------------------------------------------------
+
+GfxTilingPattern *GfxTilingPattern::parse(Object *patObj) {
+ GfxTilingPattern *pat;
+ Dict *dict;
+ int paintTypeA, tilingTypeA;
+ double bboxA[4], matrixA[6];
+ double xStepA, yStepA;
+ Object resDictA;
+ Object obj1, obj2;
+ int i;
+
+ if (!patObj->isStream()) {
+ return NULL;
+ }
+ dict = patObj->streamGetDict();
+
+ if (dict->lookup("PaintType", &obj1)->isInt()) {
+ paintTypeA = obj1.getInt();
+ } else {
+ paintTypeA = 1;
+ error(-1, "Invalid or missing PaintType in pattern");
+ }
+ obj1.free();
+ if (dict->lookup("TilingType", &obj1)->isInt()) {
+ tilingTypeA = obj1.getInt();
+ } else {
+ tilingTypeA = 1;
+ error(-1, "Invalid or missing TilingType in pattern");
+ }
+ obj1.free();
+ bboxA[0] = bboxA[1] = 0;
+ bboxA[2] = bboxA[3] = 1;
+ if (dict->lookup("BBox", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 4) {
+ for (i = 0; i < 4; ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ bboxA[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ } else {
+ error(-1, "Invalid or missing BBox in pattern");
+ }
+ obj1.free();
+ if (dict->lookup("XStep", &obj1)->isNum()) {
+ xStepA = obj1.getNum();
+ } else {
+ xStepA = 1;
+ error(-1, "Invalid or missing XStep in pattern");
+ }
+ obj1.free();
+ if (dict->lookup("YStep", &obj1)->isNum()) {
+ yStepA = obj1.getNum();
+ } else {
+ yStepA = 1;
+ error(-1, "Invalid or missing YStep in pattern");
+ }
+ obj1.free();
+ if (!dict->lookup("Resources", &resDictA)->isDict()) {
+ resDictA.free();
+ resDictA.initNull();
+ error(-1, "Invalid or missing Resources in pattern");
+ }
+ matrixA[0] = 1; matrixA[1] = 0;
+ matrixA[2] = 0; matrixA[3] = 1;
+ matrixA[4] = 0; matrixA[5] = 0;
+ if (dict->lookup("Matrix", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 6) {
+ for (i = 0; i < 6; ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ matrixA[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ }
+ obj1.free();
+
+ pat = new GfxTilingPattern(paintTypeA, tilingTypeA, bboxA, xStepA, yStepA,
+ &resDictA, matrixA, patObj);
+ resDictA.free();
+ return pat;
+}
+
+GfxTilingPattern::GfxTilingPattern(int paintTypeA, int tilingTypeA,
+ double *bboxA, double xStepA, double yStepA,
+ Object *resDictA, double *matrixA,
+ Object *contentStreamA):
+ GfxPattern(1)
+{
+ int i;
+
+ paintType = paintTypeA;
+ tilingType = tilingTypeA;
+ for (i = 0; i < 4; ++i) {
+ bbox[i] = bboxA[i];
+ }
+ xStep = xStepA;
+ yStep = yStepA;
+ resDictA->copy(&resDict);
+ for (i = 0; i < 6; ++i) {
+ matrix[i] = matrixA[i];
+ }
+ contentStreamA->copy(&contentStream);
+}
+
+GfxTilingPattern::~GfxTilingPattern() {
+ resDict.free();
+ contentStream.free();
+}
+
+GfxPattern *GfxTilingPattern::copy() {
+ return new GfxTilingPattern(paintType, tilingType, bbox, xStep, yStep,
+ &resDict, matrix, &contentStream);
+}
+
+//------------------------------------------------------------------------
+// GfxShadingPattern
+//------------------------------------------------------------------------
+
+GfxShadingPattern *GfxShadingPattern::parse(Object *patObj) {
+ Dict *dict;
+ GfxShading *shadingA;
+ double matrixA[6];
+ Object obj1, obj2;
+ int i;
+
+ if (!patObj->isDict()) {
+ return NULL;
+ }
+ dict = patObj->getDict();
+
+ dict->lookup("Shading", &obj1);
+ shadingA = GfxShading::parse(&obj1);
+ obj1.free();
+ if (!shadingA) {
+ return NULL;
+ }
+
+ matrixA[0] = 1; matrixA[1] = 0;
+ matrixA[2] = 0; matrixA[3] = 1;
+ matrixA[4] = 0; matrixA[5] = 0;
+ if (dict->lookup("Matrix", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 6) {
+ for (i = 0; i < 6; ++i) {
+ if (obj1.arrayGet(i, &obj2)->isNum()) {
+ matrixA[i] = obj2.getNum();
+ }
+ obj2.free();
+ }
+ }
+ obj1.free();
+
+ return new GfxShadingPattern(shadingA, matrixA);
+}
+
+GfxShadingPattern::GfxShadingPattern(GfxShading *shadingA, double *matrixA):
+ GfxPattern(2)
+{
+ int i;
+
+ shading = shadingA;
+ for (i = 0; i < 6; ++i) {
+ matrix[i] = matrixA[i];
+ }
+}
+
+GfxShadingPattern::~GfxShadingPattern() {
+ delete shading;
+}
+
+GfxPattern *GfxShadingPattern::copy() {
+ return new GfxShadingPattern(shading->copy(), matrix);
+}
+
+//------------------------------------------------------------------------
+// GfxShading
+//------------------------------------------------------------------------
+
+GfxShading::GfxShading(int typeA) {
+ type = typeA;
+ colorSpace = NULL;
+}
+
+GfxShading::GfxShading(GfxShading *shading) {
+ int i;
+
+ type = shading->type;
+ colorSpace = shading->colorSpace->copy();
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ background.c[i] = shading->background.c[i];
+ }
+ hasBackground = shading->hasBackground;
+ xMin = shading->xMin;
+ yMin = shading->yMin;
+ xMax = shading->xMax;
+ yMax = shading->yMax;
+ hasBBox = shading->hasBBox;
+}
+
+GfxShading::~GfxShading() {
+ if (colorSpace) {
+ delete colorSpace;
+ }
+}
+
+GfxShading *GfxShading::parse(Object *obj) {
+ GfxShading *shading;
+ Dict *dict;
+ int typeA;
+ Object obj1;
+
+ if (obj->isDict()) {
+ dict = obj->getDict();
+ } else if (obj->isStream()) {
+ dict = obj->streamGetDict();
+ } else {
+ return NULL;
+ }
+
+ if (!dict->lookup("ShadingType", &obj1)->isInt()) {
+ error(-1, "Invalid ShadingType in shading dictionary");
+ obj1.free();
+ return NULL;
+ }
+ typeA = obj1.getInt();
+ obj1.free();
+
+ switch (typeA) {
+ case 1:
+ shading = GfxFunctionShading::parse(dict);
+ break;
+ case 2:
+ shading = GfxAxialShading::parse(dict);
+ break;
+ case 3:
+ shading = GfxRadialShading::parse(dict);
+ break;
+ case 4:
+ if (obj->isStream()) {
+ shading = GfxGouraudTriangleShading::parse(4, dict, obj->getStream());
+ } else {
+ error(-1, "Invalid Type 4 shading object");
+ goto err1;
+ }
+ break;
+ case 5:
+ if (obj->isStream()) {
+ shading = GfxGouraudTriangleShading::parse(5, dict, obj->getStream());
+ } else {
+ error(-1, "Invalid Type 5 shading object");
+ goto err1;
+ }
+ break;
+ case 6:
+ if (obj->isStream()) {
+ shading = GfxPatchMeshShading::parse(6, dict, obj->getStream());
+ } else {
+ error(-1, "Invalid Type 6 shading object");
+ goto err1;
+ }
+ break;
+ case 7:
+ if (obj->isStream()) {
+ shading = GfxPatchMeshShading::parse(7, dict, obj->getStream());
+ } else {
+ error(-1, "Invalid Type 7 shading object");
+ goto err1;
+ }
+ break;
+ default:
+ error(-1, "Unimplemented shading type %d", typeA);
+ goto err1;
+ }
+
+ return shading;
+
+ err1:
+ return NULL;
+}
+
+GBool GfxShading::init(Dict *dict) {
+ Object obj1, obj2;
+ int i;
+
+ dict->lookup("ColorSpace", &obj1);
+ if (!(colorSpace = GfxColorSpace::parse(&obj1))) {
+ error(-1, "Bad color space in shading dictionary");
+ obj1.free();
+ return gFalse;
+ }
+ obj1.free();
+
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ background.c[i] = 0;
+ }
+ hasBackground = gFalse;
+ if (dict->lookup("Background", &obj1)->isArray()) {
+ if (obj1.arrayGetLength() == colorSpace->getNComps()) {
+ hasBackground = gTrue;
+ for (i = 0; i < colorSpace->getNComps(); ++i) {
+ background.c[i] = dblToCol(obj1.arrayGet(i, &obj2)->getNum());
+ obj2.free();
+ }
+ } else {
+ error(-1, "Bad Background in shading dictionary");
+ }
+ }
+ obj1.free();
+
+ xMin = yMin = xMax = yMax = 0;
+ hasBBox = gFalse;
+ if (dict->lookup("BBox", &obj1)->isArray()) {
+ if (obj1.arrayGetLength() == 4) {
+ hasBBox = gTrue;
+ xMin = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ yMin = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ xMax = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ yMax = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ } else {
+ error(-1, "Bad BBox in shading dictionary");
+ }
+ }
+ obj1.free();
+
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// GfxFunctionShading
+//------------------------------------------------------------------------
+
+GfxFunctionShading::GfxFunctionShading(double x0A, double y0A,
+ double x1A, double y1A,
+ double *matrixA,
+ Function **funcsA, int nFuncsA):
+ GfxShading(1)
+{
+ int i;
+
+ x0 = x0A;
+ y0 = y0A;
+ x1 = x1A;
+ y1 = y1A;
+ for (i = 0; i < 6; ++i) {
+ matrix[i] = matrixA[i];
+ }
+ nFuncs = nFuncsA;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = funcsA[i];
+ }
+}
+
+GfxFunctionShading::GfxFunctionShading(GfxFunctionShading *shading):
+ GfxShading(shading)
+{
+ int i;
+
+ x0 = shading->x0;
+ y0 = shading->y0;
+ x1 = shading->x1;
+ y1 = shading->y1;
+ for (i = 0; i < 6; ++i) {
+ matrix[i] = shading->matrix[i];
+ }
+ nFuncs = shading->nFuncs;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = shading->funcs[i]->copy();
+ }
+}
+
+GfxFunctionShading::~GfxFunctionShading() {
+ int i;
+
+ for (i = 0; i < nFuncs; ++i) {
+ delete funcs[i];
+ }
+}
+
+GfxFunctionShading *GfxFunctionShading::parse(Dict *dict) {
+ GfxFunctionShading *shading;
+ double x0A, y0A, x1A, y1A;
+ double matrixA[6];
+ Function *funcsA[gfxColorMaxComps];
+ int nFuncsA;
+ Object obj1, obj2;
+ int i;
+
+ x0A = y0A = 0;
+ x1A = y1A = 1;
+ if (dict->lookup("Domain", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 4) {
+ x0A = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ x1A = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ y0A = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ y1A = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ matrixA[0] = 1; matrixA[1] = 0;
+ matrixA[2] = 0; matrixA[3] = 1;
+ matrixA[4] = 0; matrixA[5] = 0;
+ if (dict->lookup("Matrix", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 6) {
+ matrixA[0] = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ matrixA[1] = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ matrixA[2] = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ matrixA[3] = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ matrixA[4] = obj1.arrayGet(4, &obj2)->getNum();
+ obj2.free();
+ matrixA[5] = obj1.arrayGet(5, &obj2)->getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("Function", &obj1);
+ if (obj1.isArray()) {
+ nFuncsA = obj1.arrayGetLength();
+ if (nFuncsA > gfxColorMaxComps) {
+ error(-1, "Invalid Function array in shading dictionary");
+ goto err1;
+ }
+ for (i = 0; i < nFuncsA; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!(funcsA[i] = Function::parse(&obj2))) {
+ goto err2;
+ }
+ obj2.free();
+ }
+ } else {
+ nFuncsA = 1;
+ if (!(funcsA[0] = Function::parse(&obj1))) {
+ goto err1;
+ }
+ }
+ obj1.free();
+
+ shading = new GfxFunctionShading(x0A, y0A, x1A, y1A, matrixA,
+ funcsA, nFuncsA);
+ if (!shading->init(dict)) {
+ delete shading;
+ return NULL;
+ }
+ return shading;
+
+ err2:
+ obj2.free();
+ err1:
+ obj1.free();
+ return NULL;
+}
+
+GfxShading *GfxFunctionShading::copy() {
+ return new GfxFunctionShading(this);
+}
+
+void GfxFunctionShading::getColor(double x, double y, GfxColor *color) {
+ double in[2], out[gfxColorMaxComps];
+ int i;
+
+ // NB: there can be one function with n outputs or n functions with
+ // one output each (where n = number of color components)
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ out[i] = 0;
+ }
+ in[0] = x;
+ in[1] = y;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i]->transform(in, &out[i]);
+ }
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ color->c[i] = dblToCol(out[i]);
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxAxialShading
+//------------------------------------------------------------------------
+
+GfxAxialShading::GfxAxialShading(double x0A, double y0A,
+ double x1A, double y1A,
+ double t0A, double t1A,
+ Function **funcsA, int nFuncsA,
+ GBool extend0A, GBool extend1A):
+ GfxShading(2)
+{
+ int i;
+
+ x0 = x0A;
+ y0 = y0A;
+ x1 = x1A;
+ y1 = y1A;
+ t0 = t0A;
+ t1 = t1A;
+ nFuncs = nFuncsA;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = funcsA[i];
+ }
+ extend0 = extend0A;
+ extend1 = extend1A;
+}
+
+GfxAxialShading::GfxAxialShading(GfxAxialShading *shading):
+ GfxShading(shading)
+{
+ int i;
+
+ x0 = shading->x0;
+ y0 = shading->y0;
+ x1 = shading->x1;
+ y1 = shading->y1;
+ t0 = shading->t0;
+ y1 = shading->t1;
+ nFuncs = shading->nFuncs;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = shading->funcs[i]->copy();
+ }
+ extend0 = shading->extend0;
+ extend1 = shading->extend1;
+}
+
+GfxAxialShading::~GfxAxialShading() {
+ int i;
+
+ for (i = 0; i < nFuncs; ++i) {
+ delete funcs[i];
+ }
+}
+
+GfxAxialShading *GfxAxialShading::parse(Dict *dict) {
+ GfxAxialShading *shading;
+ double x0A, y0A, x1A, y1A;
+ double t0A, t1A;
+ Function *funcsA[gfxColorMaxComps];
+ int nFuncsA;
+ GBool extend0A, extend1A;
+ Object obj1, obj2;
+ int i;
+
+ x0A = y0A = x1A = y1A = 0;
+ if (dict->lookup("Coords", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 4) {
+ x0A = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ y0A = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ x1A = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ y1A = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ } else {
+ error(-1, "Missing or invalid Coords in shading dictionary");
+ goto err1;
+ }
+ obj1.free();
+
+ t0A = 0;
+ t1A = 1;
+ if (dict->lookup("Domain", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2) {
+ t0A = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ t1A = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("Function", &obj1);
+ if (obj1.isArray()) {
+ nFuncsA = obj1.arrayGetLength();
+ if (nFuncsA > gfxColorMaxComps) {
+ error(-1, "Invalid Function array in shading dictionary");
+ goto err1;
+ }
+ for (i = 0; i < nFuncsA; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!(funcsA[i] = Function::parse(&obj2))) {
+ obj1.free();
+ obj2.free();
+ goto err1;
+ }
+ obj2.free();
+ }
+ } else {
+ nFuncsA = 1;
+ if (!(funcsA[0] = Function::parse(&obj1))) {
+ obj1.free();
+ goto err1;
+ }
+ }
+ obj1.free();
+
+ extend0A = extend1A = gFalse;
+ if (dict->lookup("Extend", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2) {
+ extend0A = obj1.arrayGet(0, &obj2)->getBool();
+ obj2.free();
+ extend1A = obj1.arrayGet(1, &obj2)->getBool();
+ obj2.free();
+ }
+ obj1.free();
+
+ shading = new GfxAxialShading(x0A, y0A, x1A, y1A, t0A, t1A,
+ funcsA, nFuncsA, extend0A, extend1A);
+ if (!shading->init(dict)) {
+ delete shading;
+ return NULL;
+ }
+ return shading;
+
+ err1:
+ return NULL;
+}
+
+GfxShading *GfxAxialShading::copy() {
+ return new GfxAxialShading(this);
+}
+
+void GfxAxialShading::getColor(double t, GfxColor *color) {
+ double out[gfxColorMaxComps];
+ int i;
+
+ // NB: there can be one function with n outputs or n functions with
+ // one output each (where n = number of color components)
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ out[i] = 0;
+ }
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i]->transform(&t, &out[i]);
+ }
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ color->c[i] = dblToCol(out[i]);
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxRadialShading
+//------------------------------------------------------------------------
+
+GfxRadialShading::GfxRadialShading(double x0A, double y0A, double r0A,
+ double x1A, double y1A, double r1A,
+ double t0A, double t1A,
+ Function **funcsA, int nFuncsA,
+ GBool extend0A, GBool extend1A):
+ GfxShading(3)
+{
+ int i;
+
+ x0 = x0A;
+ y0 = y0A;
+ r0 = r0A;
+ x1 = x1A;
+ y1 = y1A;
+ r1 = r1A;
+ t0 = t0A;
+ t1 = t1A;
+ nFuncs = nFuncsA;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = funcsA[i];
+ }
+ extend0 = extend0A;
+ extend1 = extend1A;
+}
+
+GfxRadialShading::GfxRadialShading(GfxRadialShading *shading):
+ GfxShading(shading)
+{
+ int i;
+
+ x0 = shading->x0;
+ y0 = shading->y0;
+ r0 = shading->r0;
+ x1 = shading->x1;
+ y1 = shading->y1;
+ r1 = shading->r1;
+ t0 = shading->t0;
+ y1 = shading->t1;
+ nFuncs = shading->nFuncs;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = shading->funcs[i]->copy();
+ }
+ extend0 = shading->extend0;
+ extend1 = shading->extend1;
+}
+
+GfxRadialShading::~GfxRadialShading() {
+ int i;
+
+ for (i = 0; i < nFuncs; ++i) {
+ delete funcs[i];
+ }
+}
+
+GfxRadialShading *GfxRadialShading::parse(Dict *dict) {
+ GfxRadialShading *shading;
+ double x0A, y0A, r0A, x1A, y1A, r1A;
+ double t0A, t1A;
+ Function *funcsA[gfxColorMaxComps];
+ int nFuncsA;
+ GBool extend0A, extend1A;
+ Object obj1, obj2;
+ int i;
+
+ x0A = y0A = r0A = x1A = y1A = r1A = 0;
+ if (dict->lookup("Coords", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 6) {
+ x0A = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ y0A = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ r0A = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ x1A = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ y1A = obj1.arrayGet(4, &obj2)->getNum();
+ obj2.free();
+ r1A = obj1.arrayGet(5, &obj2)->getNum();
+ obj2.free();
+ } else {
+ error(-1, "Missing or invalid Coords in shading dictionary");
+ goto err1;
+ }
+ obj1.free();
+
+ t0A = 0;
+ t1A = 1;
+ if (dict->lookup("Domain", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2) {
+ t0A = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ t1A = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("Function", &obj1);
+ if (obj1.isArray()) {
+ nFuncsA = obj1.arrayGetLength();
+ if (nFuncsA > gfxColorMaxComps) {
+ error(-1, "Invalid Function array in shading dictionary");
+ goto err1;
+ }
+ for (i = 0; i < nFuncsA; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!(funcsA[i] = Function::parse(&obj2))) {
+ obj1.free();
+ obj2.free();
+ goto err1;
+ }
+ obj2.free();
+ }
+ } else {
+ nFuncsA = 1;
+ if (!(funcsA[0] = Function::parse(&obj1))) {
+ obj1.free();
+ goto err1;
+ }
+ }
+ obj1.free();
+
+ extend0A = extend1A = gFalse;
+ if (dict->lookup("Extend", &obj1)->isArray() &&
+ obj1.arrayGetLength() == 2) {
+ extend0A = obj1.arrayGet(0, &obj2)->getBool();
+ obj2.free();
+ extend1A = obj1.arrayGet(1, &obj2)->getBool();
+ obj2.free();
+ }
+ obj1.free();
+
+ shading = new GfxRadialShading(x0A, y0A, r0A, x1A, y1A, r1A, t0A, t1A,
+ funcsA, nFuncsA, extend0A, extend1A);
+ if (!shading->init(dict)) {
+ delete shading;
+ return NULL;
+ }
+ return shading;
+
+ err1:
+ return NULL;
+}
+
+GfxShading *GfxRadialShading::copy() {
+ return new GfxRadialShading(this);
+}
+
+void GfxRadialShading::getColor(double t, GfxColor *color) {
+ double out[gfxColorMaxComps];
+ int i;
+
+ // NB: there can be one function with n outputs or n functions with
+ // one output each (where n = number of color components)
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ out[i] = 0;
+ }
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i]->transform(&t, &out[i]);
+ }
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ color->c[i] = dblToCol(out[i]);
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxShadingBitBuf
+//------------------------------------------------------------------------
+
+class GfxShadingBitBuf {
+public:
+
+ GfxShadingBitBuf(Stream *strA);
+ ~GfxShadingBitBuf();
+ GBool getBits(int n, Guint *val);
+ void flushBits();
+
+private:
+
+ Stream *str;
+ int bitBuf;
+ int nBits;
+};
+
+GfxShadingBitBuf::GfxShadingBitBuf(Stream *strA) {
+ str = strA;
+ str->reset();
+ bitBuf = 0;
+ nBits = 0;
+}
+
+GfxShadingBitBuf::~GfxShadingBitBuf() {
+ str->close();
+}
+
+GBool GfxShadingBitBuf::getBits(int n, Guint *val) {
+ int x;
+
+ if (nBits >= n) {
+ x = (bitBuf >> (nBits - n)) & ((1 << n) - 1);
+ nBits -= n;
+ } else {
+ x = 0;
+ if (nBits > 0) {
+ x = bitBuf & ((1 << nBits) - 1);
+ n -= nBits;
+ nBits = 0;
+ }
+ while (n > 0) {
+ if ((bitBuf = str->getChar()) == EOF) {
+ nBits = 0;
+ return gFalse;
+ }
+ if (n >= 8) {
+ x = (x << 8) | bitBuf;
+ n -= 8;
+ } else {
+ x = (x << n) | (bitBuf >> (8 - n));
+ nBits = 8 - n;
+ n = 0;
+ }
+ }
+ }
+ *val = x;
+ return gTrue;
+}
+
+void GfxShadingBitBuf::flushBits() {
+ bitBuf = 0;
+ nBits = 0;
+}
+
+//------------------------------------------------------------------------
+// GfxGouraudTriangleShading
+//------------------------------------------------------------------------
+
+GfxGouraudTriangleShading::GfxGouraudTriangleShading(
+ int typeA,
+ GfxGouraudVertex *verticesA, int nVerticesA,
+ int (*trianglesA)[3], int nTrianglesA,
+ Function **funcsA, int nFuncsA):
+ GfxShading(typeA)
+{
+ int i;
+
+ vertices = verticesA;
+ nVertices = nVerticesA;
+ triangles = trianglesA;
+ nTriangles = nTrianglesA;
+ nFuncs = nFuncsA;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = funcsA[i];
+ }
+}
+
+GfxGouraudTriangleShading::GfxGouraudTriangleShading(
+ GfxGouraudTriangleShading *shading):
+ GfxShading(shading)
+{
+ int i;
+
+ nVertices = shading->nVertices;
+ vertices = (GfxGouraudVertex *)gmallocn(nVertices, sizeof(GfxGouraudVertex));
+ memcpy(vertices, shading->vertices, nVertices * sizeof(GfxGouraudVertex));
+ nTriangles = shading->nTriangles;
+ triangles = (int (*)[3])gmallocn(nTriangles * 3, sizeof(int));
+ memcpy(triangles, shading->triangles, nTriangles * 3 * sizeof(int));
+ nFuncs = shading->nFuncs;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = shading->funcs[i]->copy();
+ }
+}
+
+GfxGouraudTriangleShading::~GfxGouraudTriangleShading() {
+ int i;
+
+ gfree(vertices);
+ gfree(triangles);
+ for (i = 0; i < nFuncs; ++i) {
+ delete funcs[i];
+ }
+}
+
+GfxGouraudTriangleShading *GfxGouraudTriangleShading::parse(int typeA,
+ Dict *dict,
+ Stream *str) {
+ GfxGouraudTriangleShading *shading;
+ Function *funcsA[gfxColorMaxComps];
+ int nFuncsA;
+ int coordBits, compBits, flagBits, vertsPerRow, nRows;
+ double xMin, xMax, yMin, yMax;
+ double cMin[gfxColorMaxComps], cMax[gfxColorMaxComps];
+ double xMul, yMul;
+ double cMul[gfxColorMaxComps];
+ GfxGouraudVertex *verticesA;
+ int (*trianglesA)[3];
+ int nComps, nVerticesA, nTrianglesA, vertSize, triSize;
+ Guint x, y, flag;
+ Guint c[gfxColorMaxComps];
+ GfxShadingBitBuf *bitBuf;
+ Object obj1, obj2;
+ int i, j, k, state;
+
+ if (dict->lookup("BitsPerCoordinate", &obj1)->isInt()) {
+ coordBits = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid BitsPerCoordinate in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ if (dict->lookup("BitsPerComponent", &obj1)->isInt()) {
+ compBits = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid BitsPerComponent in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ flagBits = vertsPerRow = 0; // make gcc happy
+ if (typeA == 4) {
+ if (dict->lookup("BitsPerFlag", &obj1)->isInt()) {
+ flagBits = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid BitsPerFlag in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ } else {
+ if (dict->lookup("VerticesPerRow", &obj1)->isInt()) {
+ vertsPerRow = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid VerticesPerRow in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ }
+ if (dict->lookup("Decode", &obj1)->isArray() &&
+ obj1.arrayGetLength() >= 6) {
+ xMin = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ xMax = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ xMul = (xMax - xMin) / (pow(2.0, coordBits) - 1);
+ yMin = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ yMax = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ yMul = (yMax - yMin) / (pow(2.0, coordBits) - 1);
+ for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) {
+ cMin[i] = obj1.arrayGet(4 + 2*i, &obj2)->getNum();
+ obj2.free();
+ cMax[i] = obj1.arrayGet(5 + 2*i, &obj2)->getNum();
+ obj2.free();
+ cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1);
+ }
+ nComps = i;
+ } else {
+ error(-1, "Missing or invalid Decode array in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+
+ if (!dict->lookup("Function", &obj1)->isNull()) {
+ if (obj1.isArray()) {
+ nFuncsA = obj1.arrayGetLength();
+ if (nFuncsA > gfxColorMaxComps) {
+ error(-1, "Invalid Function array in shading dictionary");
+ goto err1;
+ }
+ for (i = 0; i < nFuncsA; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!(funcsA[i] = Function::parse(&obj2))) {
+ obj1.free();
+ obj2.free();
+ goto err1;
+ }
+ obj2.free();
+ }
+ } else {
+ nFuncsA = 1;
+ if (!(funcsA[0] = Function::parse(&obj1))) {
+ obj1.free();
+ goto err1;
+ }
+ }
+ } else {
+ nFuncsA = 0;
+ }
+ obj1.free();
+
+ nVerticesA = nTrianglesA = 0;
+ verticesA = NULL;
+ trianglesA = NULL;
+ vertSize = triSize = 0;
+ state = 0;
+ flag = 0; // make gcc happy
+ bitBuf = new GfxShadingBitBuf(str);
+ while (1) {
+ if (typeA == 4) {
+ if (!bitBuf->getBits(flagBits, &flag)) {
+ break;
+ }
+ }
+ if (!bitBuf->getBits(coordBits, &x) ||
+ !bitBuf->getBits(coordBits, &y)) {
+ break;
+ }
+ for (i = 0; i < nComps; ++i) {
+ if (!bitBuf->getBits(compBits, &c[i])) {
+ break;
+ }
+ }
+ if (i < nComps) {
+ break;
+ }
+ if (nVerticesA == vertSize) {
+ vertSize = (vertSize == 0) ? 16 : 2 * vertSize;
+ verticesA = (GfxGouraudVertex *)
+ greallocn(verticesA, vertSize, sizeof(GfxGouraudVertex));
+ }
+ verticesA[nVerticesA].x = xMin + xMul * (double)x;
+ verticesA[nVerticesA].y = yMin + yMul * (double)y;
+ for (i = 0; i < nComps; ++i) {
+ verticesA[nVerticesA].color.c[i] =
+ dblToCol(cMin[i] + cMul[i] * (double)c[i]);
+ }
+ ++nVerticesA;
+ bitBuf->flushBits();
+ if (typeA == 4) {
+ if (state == 0 || state == 1) {
+ ++state;
+ } else if (state == 2 || flag > 0) {
+ if (nTrianglesA == triSize) {
+ triSize = (triSize == 0) ? 16 : 2 * triSize;
+ trianglesA = (int (*)[3])
+ greallocn(trianglesA, triSize * 3, sizeof(int));
+ }
+ if (state == 2) {
+ trianglesA[nTrianglesA][0] = nVerticesA - 3;
+ trianglesA[nTrianglesA][1] = nVerticesA - 2;
+ trianglesA[nTrianglesA][2] = nVerticesA - 1;
+ ++state;
+ } else if (flag == 1) {
+ trianglesA[nTrianglesA][0] = trianglesA[nTrianglesA - 1][1];
+ trianglesA[nTrianglesA][1] = trianglesA[nTrianglesA - 1][2];
+ trianglesA[nTrianglesA][2] = nVerticesA - 1;
+ } else { // flag == 2
+ trianglesA[nTrianglesA][0] = trianglesA[nTrianglesA - 1][0];
+ trianglesA[nTrianglesA][1] = trianglesA[nTrianglesA - 1][2];
+ trianglesA[nTrianglesA][2] = nVerticesA - 1;
+ }
+ ++nTrianglesA;
+ } else { // state == 3 && flag == 0
+ state = 1;
+ }
+ }
+ }
+ delete bitBuf;
+ if (typeA == 5) {
+ nRows = nVerticesA / vertsPerRow;
+ nTrianglesA = (nRows - 1) * 2 * (vertsPerRow - 1);
+ trianglesA = (int (*)[3])gmallocn(nTrianglesA * 3, sizeof(int));
+ k = 0;
+ for (i = 0; i < nRows - 1; ++i) {
+ for (j = 0; j < vertsPerRow - 1; ++j) {
+ trianglesA[k][0] = i * vertsPerRow + j;
+ trianglesA[k][1] = i * vertsPerRow + j+1;
+ trianglesA[k][2] = (i+1) * vertsPerRow + j;
+ ++k;
+ trianglesA[k][0] = i * vertsPerRow + j+1;
+ trianglesA[k][1] = (i+1) * vertsPerRow + j;
+ trianglesA[k][2] = (i+1) * vertsPerRow + j+1;
+ ++k;
+ }
+ }
+ }
+
+ shading = new GfxGouraudTriangleShading(typeA, verticesA, nVerticesA,
+ trianglesA, nTrianglesA,
+ funcsA, nFuncsA);
+ if (!shading->init(dict)) {
+ delete shading;
+ return NULL;
+ }
+ return shading;
+
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+GfxShading *GfxGouraudTriangleShading::copy() {
+ return new GfxGouraudTriangleShading(this);
+}
+
+void GfxGouraudTriangleShading::getTriangle(
+ int i,
+ double *x0, double *y0, GfxColor *color0,
+ double *x1, double *y1, GfxColor *color1,
+ double *x2, double *y2, GfxColor *color2) {
+ double in;
+ double out[gfxColorMaxComps];
+ int v, j;
+
+ v = triangles[i][0];
+ *x0 = vertices[v].x;
+ *y0 = vertices[v].y;
+ if (nFuncs > 0) {
+ in = colToDbl(vertices[v].color.c[0]);
+ for (j = 0; j < nFuncs; ++j) {
+ funcs[j]->transform(&in, &out[j]);
+ }
+ for (j = 0; j < gfxColorMaxComps; ++j) {
+ color0->c[j] = dblToCol(out[j]);
+ }
+ } else {
+ *color0 = vertices[v].color;
+ }
+ v = triangles[i][1];
+ *x1 = vertices[v].x;
+ *y1 = vertices[v].y;
+ if (nFuncs > 0) {
+ in = colToDbl(vertices[v].color.c[0]);
+ for (j = 0; j < nFuncs; ++j) {
+ funcs[j]->transform(&in, &out[j]);
+ }
+ for (j = 0; j < gfxColorMaxComps; ++j) {
+ color1->c[j] = dblToCol(out[j]);
+ }
+ } else {
+ *color1 = vertices[v].color;
+ }
+ v = triangles[i][2];
+ *x2 = vertices[v].x;
+ *y2 = vertices[v].y;
+ if (nFuncs > 0) {
+ in = colToDbl(vertices[v].color.c[0]);
+ for (j = 0; j < nFuncs; ++j) {
+ funcs[j]->transform(&in, &out[j]);
+ }
+ for (j = 0; j < gfxColorMaxComps; ++j) {
+ color2->c[j] = dblToCol(out[j]);
+ }
+ } else {
+ *color2 = vertices[v].color;
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxPatchMeshShading
+//------------------------------------------------------------------------
+
+GfxPatchMeshShading::GfxPatchMeshShading(int typeA,
+ GfxPatch *patchesA, int nPatchesA,
+ Function **funcsA, int nFuncsA):
+ GfxShading(typeA)
+{
+ int i;
+
+ patches = patchesA;
+ nPatches = nPatchesA;
+ nFuncs = nFuncsA;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = funcsA[i];
+ }
+}
+
+GfxPatchMeshShading::GfxPatchMeshShading(GfxPatchMeshShading *shading):
+ GfxShading(shading)
+{
+ int i;
+
+ nPatches = shading->nPatches;
+ patches = (GfxPatch *)gmallocn(nPatches, sizeof(GfxPatch));
+ memcpy(patches, shading->patches, nPatches * sizeof(GfxPatch));
+ nFuncs = shading->nFuncs;
+ for (i = 0; i < nFuncs; ++i) {
+ funcs[i] = shading->funcs[i]->copy();
+ }
+}
+
+GfxPatchMeshShading::~GfxPatchMeshShading() {
+ int i;
+
+ gfree(patches);
+ for (i = 0; i < nFuncs; ++i) {
+ delete funcs[i];
+ }
+}
+
+GfxPatchMeshShading *GfxPatchMeshShading::parse(int typeA, Dict *dict,
+ Stream *str) {
+ GfxPatchMeshShading *shading;
+ Function *funcsA[gfxColorMaxComps];
+ int nFuncsA;
+ int coordBits, compBits, flagBits;
+ double xMin, xMax, yMin, yMax;
+ double cMin[gfxColorMaxComps], cMax[gfxColorMaxComps];
+ double xMul, yMul;
+ double cMul[gfxColorMaxComps];
+ GfxPatch *patchesA, *p;
+ int nComps, nPatchesA, patchesSize, nPts, nColors;
+ Guint flag;
+ double x[16], y[16];
+ Guint xi, yi;
+ GfxColorComp c[4][gfxColorMaxComps];
+ Guint ci[4];
+ GfxShadingBitBuf *bitBuf;
+ Object obj1, obj2;
+ int i, j;
+
+ if (dict->lookup("BitsPerCoordinate", &obj1)->isInt()) {
+ coordBits = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid BitsPerCoordinate in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ if (dict->lookup("BitsPerComponent", &obj1)->isInt()) {
+ compBits = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid BitsPerComponent in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ if (dict->lookup("BitsPerFlag", &obj1)->isInt()) {
+ flagBits = obj1.getInt();
+ } else {
+ error(-1, "Missing or invalid BitsPerFlag in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+ if (dict->lookup("Decode", &obj1)->isArray() &&
+ obj1.arrayGetLength() >= 6) {
+ xMin = obj1.arrayGet(0, &obj2)->getNum();
+ obj2.free();
+ xMax = obj1.arrayGet(1, &obj2)->getNum();
+ obj2.free();
+ xMul = (xMax - xMin) / (pow(2.0, coordBits) - 1);
+ yMin = obj1.arrayGet(2, &obj2)->getNum();
+ obj2.free();
+ yMax = obj1.arrayGet(3, &obj2)->getNum();
+ obj2.free();
+ yMul = (yMax - yMin) / (pow(2.0, coordBits) - 1);
+ for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) {
+ cMin[i] = obj1.arrayGet(4 + 2*i, &obj2)->getNum();
+ obj2.free();
+ cMax[i] = obj1.arrayGet(5 + 2*i, &obj2)->getNum();
+ obj2.free();
+ cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1);
+ }
+ nComps = i;
+ } else {
+ error(-1, "Missing or invalid Decode array in shading dictionary");
+ goto err2;
+ }
+ obj1.free();
+
+ if (!dict->lookup("Function", &obj1)->isNull()) {
+ if (obj1.isArray()) {
+ nFuncsA = obj1.arrayGetLength();
+ if (nFuncsA > gfxColorMaxComps) {
+ error(-1, "Invalid Function array in shading dictionary");
+ goto err1;
+ }
+ for (i = 0; i < nFuncsA; ++i) {
+ obj1.arrayGet(i, &obj2);
+ if (!(funcsA[i] = Function::parse(&obj2))) {
+ obj1.free();
+ obj2.free();
+ goto err1;
+ }
+ obj2.free();
+ }
+ } else {
+ nFuncsA = 1;
+ if (!(funcsA[0] = Function::parse(&obj1))) {
+ obj1.free();
+ goto err1;
+ }
+ }
+ } else {
+ nFuncsA = 0;
+ }
+ obj1.free();
+
+ nPatchesA = 0;
+ patchesA = NULL;
+ patchesSize = 0;
+ bitBuf = new GfxShadingBitBuf(str);
+ while (1) {
+ if (!bitBuf->getBits(flagBits, &flag)) {
+ break;
+ }
+ if (typeA == 6) {
+ switch (flag) {
+ case 0: nPts = 12; nColors = 4; break;
+ case 1:
+ case 2:
+ case 3:
+ default: nPts = 8; nColors = 2; break;
+ }
+ } else {
+ switch (flag) {
+ case 0: nPts = 16; nColors = 4; break;
+ case 1:
+ case 2:
+ case 3:
+ default: nPts = 12; nColors = 2; break;
+ }
+ }
+ for (i = 0; i < nPts; ++i) {
+ if (!bitBuf->getBits(coordBits, &xi) ||
+ !bitBuf->getBits(coordBits, &yi)) {
+ break;
+ }
+ x[i] = xMin + xMul * (double)xi;
+ y[i] = yMin + yMul * (double)yi;
+ }
+ if (i < nPts) {
+ break;
+ }
+ for (i = 0; i < nColors; ++i) {
+ for (j = 0; j < nComps; ++j) {
+ if (!bitBuf->getBits(compBits, &ci[j])) {
+ break;
+ }
+ c[i][j] = dblToCol(cMin[j] + cMul[j] * (double)ci[j]);
+ }
+ if (j < nComps) {
+ break;
+ }
+ }
+ if (i < nColors) {
+ break;
+ }
+ if (nPatchesA == patchesSize) {
+ patchesSize = (patchesSize == 0) ? 16 : 2 * patchesSize;
+ patchesA = (GfxPatch *)greallocn(patchesA,
+ patchesSize, sizeof(GfxPatch));
+ }
+ p = &patchesA[nPatchesA];
+ if (typeA == 6) {
+ switch (flag) {
+ case 0:
+ p->x[0][0] = x[0];
+ p->y[0][0] = y[0];
+ p->x[0][1] = x[1];
+ p->y[0][1] = y[1];
+ p->x[0][2] = x[2];
+ p->y[0][2] = y[2];
+ p->x[0][3] = x[3];
+ p->y[0][3] = y[3];
+ p->x[1][3] = x[4];
+ p->y[1][3] = y[4];
+ p->x[2][3] = x[5];
+ p->y[2][3] = y[5];
+ p->x[3][3] = x[6];
+ p->y[3][3] = y[6];
+ p->x[3][2] = x[7];
+ p->y[3][2] = y[7];
+ p->x[3][1] = x[8];
+ p->y[3][1] = y[8];
+ p->x[3][0] = x[9];
+ p->y[3][0] = y[9];
+ p->x[2][0] = x[10];
+ p->y[2][0] = y[10];
+ p->x[1][0] = x[11];
+ p->y[1][0] = y[11];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = c[0][j];
+ p->color[0][1].c[j] = c[1][j];
+ p->color[1][1].c[j] = c[2][j];
+ p->color[1][0].c[j] = c[3][j];
+ }
+ break;
+ case 1:
+ p->x[0][0] = patchesA[nPatchesA-1].x[0][3];
+ p->y[0][0] = patchesA[nPatchesA-1].y[0][3];
+ p->x[0][1] = patchesA[nPatchesA-1].x[1][3];
+ p->y[0][1] = patchesA[nPatchesA-1].y[1][3];
+ p->x[0][2] = patchesA[nPatchesA-1].x[2][3];
+ p->y[0][2] = patchesA[nPatchesA-1].y[2][3];
+ p->x[0][3] = patchesA[nPatchesA-1].x[3][3];
+ p->y[0][3] = patchesA[nPatchesA-1].y[3][3];
+ p->x[1][3] = x[0];
+ p->y[1][3] = y[0];
+ p->x[2][3] = x[1];
+ p->y[2][3] = y[1];
+ p->x[3][3] = x[2];
+ p->y[3][3] = y[2];
+ p->x[3][2] = x[3];
+ p->y[3][2] = y[3];
+ p->x[3][1] = x[4];
+ p->y[3][1] = y[4];
+ p->x[3][0] = x[5];
+ p->y[3][0] = y[5];
+ p->x[2][0] = x[6];
+ p->y[2][0] = y[6];
+ p->x[1][0] = x[7];
+ p->y[1][0] = y[7];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = patchesA[nPatchesA-1].color[0][1].c[j];
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
+ p->color[1][1].c[j] = c[0][j];
+ p->color[1][0].c[j] = c[1][j];
+ }
+ break;
+ case 2:
+ p->x[0][0] = patchesA[nPatchesA-1].x[3][3];
+ p->y[0][0] = patchesA[nPatchesA-1].y[3][3];
+ p->x[0][1] = patchesA[nPatchesA-1].x[3][2];
+ p->y[0][1] = patchesA[nPatchesA-1].y[3][2];
+ p->x[0][2] = patchesA[nPatchesA-1].x[3][1];
+ p->y[0][2] = patchesA[nPatchesA-1].y[3][1];
+ p->x[0][3] = patchesA[nPatchesA-1].x[3][0];
+ p->y[0][3] = patchesA[nPatchesA-1].y[3][0];
+ p->x[1][3] = x[0];
+ p->y[1][3] = y[0];
+ p->x[2][3] = x[1];
+ p->y[2][3] = y[1];
+ p->x[3][3] = x[2];
+ p->y[3][3] = y[2];
+ p->x[3][2] = x[3];
+ p->y[3][2] = y[3];
+ p->x[3][1] = x[4];
+ p->y[3][1] = y[4];
+ p->x[3][0] = x[5];
+ p->y[3][0] = y[5];
+ p->x[2][0] = x[6];
+ p->y[2][0] = y[6];
+ p->x[1][0] = x[7];
+ p->y[1][0] = y[7];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
+ p->color[1][1].c[j] = c[0][j];
+ p->color[1][0].c[j] = c[1][j];
+ }
+ break;
+ case 3:
+ p->x[0][0] = patchesA[nPatchesA-1].x[3][0];
+ p->y[0][0] = patchesA[nPatchesA-1].y[3][0];
+ p->x[0][1] = patchesA[nPatchesA-1].x[2][0];
+ p->y[0][1] = patchesA[nPatchesA-1].y[2][0];
+ p->x[0][2] = patchesA[nPatchesA-1].x[1][0];
+ p->y[0][2] = patchesA[nPatchesA-1].y[1][0];
+ p->x[0][3] = patchesA[nPatchesA-1].x[0][0];
+ p->y[0][3] = patchesA[nPatchesA-1].y[0][0];
+ p->x[1][3] = x[0];
+ p->y[1][3] = y[0];
+ p->x[2][3] = x[1];
+ p->y[2][3] = y[1];
+ p->x[3][3] = x[2];
+ p->y[3][3] = y[2];
+ p->x[3][2] = x[3];
+ p->y[3][2] = y[3];
+ p->x[3][1] = x[4];
+ p->y[3][1] = y[4];
+ p->x[3][0] = x[5];
+ p->y[3][0] = y[5];
+ p->x[2][0] = x[6];
+ p->y[2][0] = y[6];
+ p->x[1][0] = x[7];
+ p->y[1][0] = y[7];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[0][0].c[j];
+ p->color[1][1].c[j] = c[0][j];
+ p->color[1][0].c[j] = c[1][j];
+ }
+ break;
+ }
+ } else {
+ switch (flag) {
+ case 0:
+ p->x[0][0] = x[0];
+ p->y[0][0] = y[0];
+ p->x[0][1] = x[1];
+ p->y[0][1] = y[1];
+ p->x[0][2] = x[2];
+ p->y[0][2] = y[2];
+ p->x[0][3] = x[3];
+ p->y[0][3] = y[3];
+ p->x[1][3] = x[4];
+ p->y[1][3] = y[4];
+ p->x[2][3] = x[5];
+ p->y[2][3] = y[5];
+ p->x[3][3] = x[6];
+ p->y[3][3] = y[6];
+ p->x[3][2] = x[7];
+ p->y[3][2] = y[7];
+ p->x[3][1] = x[8];
+ p->y[3][1] = y[8];
+ p->x[3][0] = x[9];
+ p->y[3][0] = y[9];
+ p->x[2][0] = x[10];
+ p->y[2][0] = y[10];
+ p->x[1][0] = x[11];
+ p->y[1][0] = y[11];
+ p->x[1][1] = x[12];
+ p->y[1][1] = y[12];
+ p->x[1][2] = x[13];
+ p->y[1][2] = y[13];
+ p->x[2][2] = x[14];
+ p->y[2][2] = y[14];
+ p->x[2][1] = x[15];
+ p->y[2][1] = y[15];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = c[0][j];
+ p->color[0][1].c[j] = c[1][j];
+ p->color[1][1].c[j] = c[2][j];
+ p->color[1][0].c[j] = c[3][j];
+ }
+ break;
+ case 1:
+ p->x[0][0] = patchesA[nPatchesA-1].x[0][3];
+ p->y[0][0] = patchesA[nPatchesA-1].y[0][3];
+ p->x[0][1] = patchesA[nPatchesA-1].x[1][3];
+ p->y[0][1] = patchesA[nPatchesA-1].y[1][3];
+ p->x[0][2] = patchesA[nPatchesA-1].x[2][3];
+ p->y[0][2] = patchesA[nPatchesA-1].y[2][3];
+ p->x[0][3] = patchesA[nPatchesA-1].x[3][3];
+ p->y[0][3] = patchesA[nPatchesA-1].y[3][3];
+ p->x[1][3] = x[0];
+ p->y[1][3] = y[0];
+ p->x[2][3] = x[1];
+ p->y[2][3] = y[1];
+ p->x[3][3] = x[2];
+ p->y[3][3] = y[2];
+ p->x[3][2] = x[3];
+ p->y[3][2] = y[3];
+ p->x[3][1] = x[4];
+ p->y[3][1] = y[4];
+ p->x[3][0] = x[5];
+ p->y[3][0] = y[5];
+ p->x[2][0] = x[6];
+ p->y[2][0] = y[6];
+ p->x[1][0] = x[7];
+ p->y[1][0] = y[7];
+ p->x[1][1] = x[8];
+ p->y[1][1] = y[8];
+ p->x[1][2] = x[9];
+ p->y[1][2] = y[9];
+ p->x[2][2] = x[10];
+ p->y[2][2] = y[10];
+ p->x[2][1] = x[11];
+ p->y[2][1] = y[11];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = patchesA[nPatchesA-1].color[0][1].c[j];
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
+ p->color[1][1].c[j] = c[0][j];
+ p->color[1][0].c[j] = c[1][j];
+ }
+ break;
+ case 2:
+ p->x[0][0] = patchesA[nPatchesA-1].x[3][3];
+ p->y[0][0] = patchesA[nPatchesA-1].y[3][3];
+ p->x[0][1] = patchesA[nPatchesA-1].x[3][2];
+ p->y[0][1] = patchesA[nPatchesA-1].y[3][2];
+ p->x[0][2] = patchesA[nPatchesA-1].x[3][1];
+ p->y[0][2] = patchesA[nPatchesA-1].y[3][1];
+ p->x[0][3] = patchesA[nPatchesA-1].x[3][0];
+ p->y[0][3] = patchesA[nPatchesA-1].y[3][0];
+ p->x[1][3] = x[0];
+ p->y[1][3] = y[0];
+ p->x[2][3] = x[1];
+ p->y[2][3] = y[1];
+ p->x[3][3] = x[2];
+ p->y[3][3] = y[2];
+ p->x[3][2] = x[3];
+ p->y[3][2] = y[3];
+ p->x[3][1] = x[4];
+ p->y[3][1] = y[4];
+ p->x[3][0] = x[5];
+ p->y[3][0] = y[5];
+ p->x[2][0] = x[6];
+ p->y[2][0] = y[6];
+ p->x[1][0] = x[7];
+ p->y[1][0] = y[7];
+ p->x[1][1] = x[8];
+ p->y[1][1] = y[8];
+ p->x[1][2] = x[9];
+ p->y[1][2] = y[9];
+ p->x[2][2] = x[10];
+ p->y[2][2] = y[10];
+ p->x[2][1] = x[11];
+ p->y[2][1] = y[11];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][1].c[j];
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
+ p->color[1][1].c[j] = c[0][j];
+ p->color[1][0].c[j] = c[1][j];
+ }
+ break;
+ case 3:
+ p->x[0][0] = patchesA[nPatchesA-1].x[3][0];
+ p->y[0][0] = patchesA[nPatchesA-1].y[3][0];
+ p->x[0][1] = patchesA[nPatchesA-1].x[2][0];
+ p->y[0][1] = patchesA[nPatchesA-1].y[2][0];
+ p->x[0][2] = patchesA[nPatchesA-1].x[1][0];
+ p->y[0][2] = patchesA[nPatchesA-1].y[1][0];
+ p->x[0][3] = patchesA[nPatchesA-1].x[0][0];
+ p->y[0][3] = patchesA[nPatchesA-1].y[0][0];
+ p->x[1][3] = x[0];
+ p->y[1][3] = y[0];
+ p->x[2][3] = x[1];
+ p->y[2][3] = y[1];
+ p->x[3][3] = x[2];
+ p->y[3][3] = y[2];
+ p->x[3][2] = x[3];
+ p->y[3][2] = y[3];
+ p->x[3][1] = x[4];
+ p->y[3][1] = y[4];
+ p->x[3][0] = x[5];
+ p->y[3][0] = y[5];
+ p->x[2][0] = x[6];
+ p->y[2][0] = y[6];
+ p->x[1][0] = x[7];
+ p->y[1][0] = y[7];
+ p->x[1][1] = x[8];
+ p->y[1][1] = y[8];
+ p->x[1][2] = x[9];
+ p->y[1][2] = y[9];
+ p->x[2][2] = x[10];
+ p->y[2][2] = y[10];
+ p->x[2][1] = x[11];
+ p->y[2][1] = y[11];
+ for (j = 0; j < nComps; ++j) {
+ p->color[0][0].c[j] = patchesA[nPatchesA-1].color[1][0].c[j];
+ p->color[0][1].c[j] = patchesA[nPatchesA-1].color[0][0].c[j];
+ p->color[1][1].c[j] = c[0][j];
+ p->color[1][0].c[j] = c[1][j];
+ }
+ break;
+ }
+ }
+ ++nPatchesA;
+ bitBuf->flushBits();
+ }
+ delete bitBuf;
+
+ if (typeA == 6) {
+ for (i = 0; i < nPatchesA; ++i) {
+ p = &patchesA[i];
+ p->x[1][1] = (-4 * p->x[0][0]
+ +6 * (p->x[0][1] + p->x[1][0])
+ -2 * (p->x[0][3] + p->x[3][0])
+ +3 * (p->x[3][1] + p->x[1][3])
+ - p->x[3][3]) / 9;
+ p->y[1][1] = (-4 * p->y[0][0]
+ +6 * (p->y[0][1] + p->y[1][0])
+ -2 * (p->y[0][3] + p->y[3][0])
+ +3 * (p->y[3][1] + p->y[1][3])
+ - p->y[3][3]) / 9;
+ p->x[1][2] = (-4 * p->x[0][3]
+ +6 * (p->x[0][2] + p->x[1][3])
+ -2 * (p->x[0][0] + p->x[3][3])
+ +3 * (p->x[3][2] + p->x[1][0])
+ - p->x[3][0]) / 9;
+ p->y[1][2] = (-4 * p->y[0][3]
+ +6 * (p->y[0][2] + p->y[1][3])
+ -2 * (p->y[0][0] + p->y[3][3])
+ +3 * (p->y[3][2] + p->y[1][0])
+ - p->y[3][0]) / 9;
+ p->x[2][1] = (-4 * p->x[3][0]
+ +6 * (p->x[3][1] + p->x[2][0])
+ -2 * (p->x[3][3] + p->x[0][0])
+ +3 * (p->x[0][1] + p->x[2][3])
+ - p->x[0][3]) / 9;
+ p->y[2][1] = (-4 * p->y[3][0]
+ +6 * (p->y[3][1] + p->y[2][0])
+ -2 * (p->y[3][3] + p->y[0][0])
+ +3 * (p->y[0][1] + p->y[2][3])
+ - p->y[0][3]) / 9;
+ p->x[2][2] = (-4 * p->x[3][3]
+ +6 * (p->x[3][2] + p->x[2][3])
+ -2 * (p->x[3][0] + p->x[0][3])
+ +3 * (p->x[0][2] + p->x[2][0])
+ - p->x[0][0]) / 9;
+ p->y[2][2] = (-4 * p->y[3][3]
+ +6 * (p->y[3][2] + p->y[2][3])
+ -2 * (p->y[3][0] + p->y[0][3])
+ +3 * (p->y[0][2] + p->y[2][0])
+ - p->y[0][0]) / 9;
+ }
+ }
+
+ shading = new GfxPatchMeshShading(typeA, patchesA, nPatchesA,
+ funcsA, nFuncsA);
+ if (!shading->init(dict)) {
+ delete shading;
+ return NULL;
+ }
+ return shading;
+
+ err2:
+ obj1.free();
+ err1:
+ return NULL;
+}
+
+GfxShading *GfxPatchMeshShading::copy() {
+ return new GfxPatchMeshShading(this);
+}
+
+//------------------------------------------------------------------------
+// GfxImageColorMap
+//------------------------------------------------------------------------
+
+GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
+ GfxColorSpace *colorSpaceA) {
+ GfxIndexedColorSpace *indexedCS;
+ GfxSeparationColorSpace *sepCS;
+ int maxPixel, indexHigh;
+ Guchar *lookup2;
+ Function *sepFunc;
+ Object obj;
+ double x[gfxColorMaxComps];
+ double y[gfxColorMaxComps];
+ int i, j, k;
+
+ ok = gTrue;
+
+ // bits per component and color space
+ bits = bitsA;
+ maxPixel = (1 << bits) - 1;
+ colorSpace = colorSpaceA;
+
+ // initialize
+ for (k = 0; k < gfxColorMaxComps; ++k) {
+ lookup[k] = NULL;
+ }
+
+ // get decode map
+ if (decode->isNull()) {
+ nComps = colorSpace->getNComps();
+ colorSpace->getDefaultRanges(decodeLow, decodeRange, maxPixel);
+ } else if (decode->isArray()) {
+ nComps = decode->arrayGetLength() / 2;
+ if (nComps != colorSpace->getNComps()) {
+ goto err1;
+ }
+ for (i = 0; i < nComps; ++i) {
+ decode->arrayGet(2*i, &obj);
+ if (!obj.isNum()) {
+ goto err2;
+ }
+ decodeLow[i] = obj.getNum();
+ obj.free();
+ decode->arrayGet(2*i+1, &obj);
+ if (!obj.isNum()) {
+ goto err2;
+ }
+ decodeRange[i] = obj.getNum() - decodeLow[i];
+ obj.free();
+ }
+ } else {
+ goto err1;
+ }
+
+ // Construct a lookup table -- this stores pre-computed decoded
+ // values for each component, i.e., the result of applying the
+ // decode mapping to each possible image pixel component value.
+ //
+ // Optimization: for Indexed and Separation color spaces (which have
+ // only one component), we store color values in the lookup table
+ // rather than component values.
+ colorSpace2 = NULL;
+ nComps2 = 0;
+ if (colorSpace->getMode() == csIndexed) {
+ // Note that indexHigh may not be the same as maxPixel --
+ // Distiller will remove unused palette entries, resulting in
+ // indexHigh < maxPixel.
+ indexedCS = (GfxIndexedColorSpace *)colorSpace;
+ colorSpace2 = indexedCS->getBase();
+ indexHigh = indexedCS->getIndexHigh();
+ nComps2 = colorSpace2->getNComps();
+ lookup2 = indexedCS->getLookup();
+ colorSpace2->getDefaultRanges(x, y, indexHigh);
+ for (k = 0; k < nComps2; ++k) {
+ lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
+ sizeof(GfxColorComp));
+ for (i = 0; i <= maxPixel; ++i) {
+ j = (int)(decodeLow[0] + (i * decodeRange[0]) / maxPixel + 0.5);
+ if (j < 0) {
+ j = 0;
+ } else if (j > indexHigh) {
+ j = indexHigh;
+ }
+ lookup[k][i] =
+ dblToCol(x[k] + (lookup2[j*nComps2 + k] / 255.0) * y[k]);
+ }
+ }
+ } else if (colorSpace->getMode() == csSeparation) {
+ sepCS = (GfxSeparationColorSpace *)colorSpace;
+ colorSpace2 = sepCS->getAlt();
+ nComps2 = colorSpace2->getNComps();
+ sepFunc = sepCS->getFunc();
+ for (k = 0; k < nComps2; ++k) {
+ lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
+ sizeof(GfxColorComp));
+ for (i = 0; i <= maxPixel; ++i) {
+ x[0] = decodeLow[0] + (i * decodeRange[0]) / maxPixel;
+ sepFunc->transform(x, y);
+ lookup[k][i] = dblToCol(y[k]);
+ }
+ }
+ } else {
+ for (k = 0; k < nComps; ++k) {
+ lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
+ sizeof(GfxColorComp));
+ for (i = 0; i <= maxPixel; ++i) {
+ lookup[k][i] = dblToCol(decodeLow[k] +
+ (i * decodeRange[k]) / maxPixel);
+ }
+ }
+ }
+
+ return;
+
+ err2:
+ obj.free();
+ err1:
+ ok = gFalse;
+}
+
+GfxImageColorMap::GfxImageColorMap(GfxImageColorMap *colorMap) {
+ int n, i, k;
+
+ colorSpace = colorMap->colorSpace->copy();
+ bits = colorMap->bits;
+ nComps = colorMap->nComps;
+ nComps2 = colorMap->nComps2;
+ colorSpace2 = NULL;
+ for (k = 0; k < gfxColorMaxComps; ++k) {
+ lookup[k] = NULL;
+ }
+ n = 1 << bits;
+ if (colorSpace->getMode() == csIndexed) {
+ colorSpace2 = ((GfxIndexedColorSpace *)colorSpace)->getBase();
+ for (k = 0; k < nComps2; ++k) {
+ lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp));
+ memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
+ }
+ } else if (colorSpace->getMode() == csSeparation) {
+ colorSpace2 = ((GfxSeparationColorSpace *)colorSpace)->getAlt();
+ for (k = 0; k < nComps2; ++k) {
+ lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp));
+ memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
+ }
+ } else {
+ for (k = 0; k < nComps; ++k) {
+ lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp));
+ memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
+ }
+ }
+ for (i = 0; i < nComps; ++i) {
+ decodeLow[i] = colorMap->decodeLow[i];
+ decodeRange[i] = colorMap->decodeRange[i];
+ }
+ ok = gTrue;
+}
+
+GfxImageColorMap::~GfxImageColorMap() {
+ int i;
+
+ delete colorSpace;
+ for (i = 0; i < gfxColorMaxComps; ++i) {
+ gfree(lookup[i]);
+ }
+}
+
+void GfxImageColorMap::getGray(Guchar *x, GfxGray *gray) {
+ GfxColor color;
+ int i;
+
+ if (colorSpace2) {
+ for (i = 0; i < nComps2; ++i) {
+ color.c[i] = lookup[i][x[0]];
+ }
+ colorSpace2->getGray(&color, gray);
+ } else {
+ for (i = 0; i < nComps; ++i) {
+ color.c[i] = lookup[i][x[i]];
+ }
+ colorSpace->getGray(&color, gray);
+ }
+}
+
+void GfxImageColorMap::getRGB(Guchar *x, GfxRGB *rgb) {
+ GfxColor color;
+ int i;
+
+ if (colorSpace2) {
+ for (i = 0; i < nComps2; ++i) {
+ color.c[i] = lookup[i][x[0]];
+ }
+ colorSpace2->getRGB(&color, rgb);
+ } else {
+ for (i = 0; i < nComps; ++i) {
+ color.c[i] = lookup[i][x[i]];
+ }
+ colorSpace->getRGB(&color, rgb);
+ }
+}
+
+void GfxImageColorMap::getCMYK(Guchar *x, GfxCMYK *cmyk) {
+ GfxColor color;
+ int i;
+
+ if (colorSpace2) {
+ for (i = 0; i < nComps2; ++i) {
+ color.c[i] = lookup[i][x[0]];
+ }
+ colorSpace2->getCMYK(&color, cmyk);
+ } else {
+ for (i = 0; i < nComps; ++i) {
+ color.c[i] = lookup[i][x[i]];
+ }
+ colorSpace->getCMYK(&color, cmyk);
+ }
+}
+
+void GfxImageColorMap::getColor(Guchar *x, GfxColor *color) {
+ int maxPixel, i;
+
+ maxPixel = (1 << bits) - 1;
+ for (i = 0; i < nComps; ++i) {
+ color->c[i] = dblToCol(decodeLow[i] + (x[i] * decodeRange[i]) / maxPixel);
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxSubpath and GfxPath
+//------------------------------------------------------------------------
+
+GfxSubpath::GfxSubpath(double x1, double y1) {
+ size = 16;
+ x = (double *)gmallocn(size, sizeof(double));
+ y = (double *)gmallocn(size, sizeof(double));
+ curve = (GBool *)gmallocn(size, sizeof(GBool));
+ n = 1;
+ x[0] = x1;
+ y[0] = y1;
+ curve[0] = gFalse;
+ closed = gFalse;
+}
+
+GfxSubpath::~GfxSubpath() {
+ gfree(x);
+ gfree(y);
+ gfree(curve);
+}
+
+// Used for copy().
+GfxSubpath::GfxSubpath(GfxSubpath *subpath) {
+ size = subpath->size;
+ n = subpath->n;
+ x = (double *)gmallocn(size, sizeof(double));
+ y = (double *)gmallocn(size, sizeof(double));
+ curve = (GBool *)gmallocn(size, sizeof(GBool));
+ memcpy(x, subpath->x, n * sizeof(double));
+ memcpy(y, subpath->y, n * sizeof(double));
+ memcpy(curve, subpath->curve, n * sizeof(GBool));
+ closed = subpath->closed;
+}
+
+void GfxSubpath::lineTo(double x1, double y1) {
+ if (n >= size) {
+ size += 16;
+ x = (double *)greallocn(x, size, sizeof(double));
+ y = (double *)greallocn(y, size, sizeof(double));
+ curve = (GBool *)greallocn(curve, size, sizeof(GBool));
+ }
+ x[n] = x1;
+ y[n] = y1;
+ curve[n] = gFalse;
+ ++n;
+}
+
+void GfxSubpath::curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3) {
+ if (n+3 > size) {
+ size += 16;
+ x = (double *)greallocn(x, size, sizeof(double));
+ y = (double *)greallocn(y, size, sizeof(double));
+ curve = (GBool *)greallocn(curve, size, sizeof(GBool));
+ }
+ x[n] = x1;
+ y[n] = y1;
+ x[n+1] = x2;
+ y[n+1] = y2;
+ x[n+2] = x3;
+ y[n+2] = y3;
+ curve[n] = curve[n+1] = gTrue;
+ curve[n+2] = gFalse;
+ n += 3;
+}
+
+void GfxSubpath::close() {
+ if (x[n-1] != x[0] || y[n-1] != y[0]) {
+ lineTo(x[0], y[0]);
+ }
+ closed = gTrue;
+}
+
+void GfxSubpath::offset(double dx, double dy) {
+ int i;
+
+ for (i = 0; i < n; ++i) {
+ x[i] += dx;
+ y[i] += dy;
+ }
+}
+
+GfxPath::GfxPath() {
+ justMoved = gFalse;
+ size = 16;
+ n = 0;
+ firstX = firstY = 0;
+ subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *));
+}
+
+GfxPath::~GfxPath() {
+ int i;
+
+ for (i = 0; i < n; ++i)
+ delete subpaths[i];
+ gfree(subpaths);
+}
+
+// Used for copy().
+GfxPath::GfxPath(GBool justMoved1, double firstX1, double firstY1,
+ GfxSubpath **subpaths1, int n1, int size1) {
+ int i;
+
+ justMoved = justMoved1;
+ firstX = firstX1;
+ firstY = firstY1;
+ size = size1;
+ n = n1;
+ subpaths = (GfxSubpath **)gmallocn(size, sizeof(GfxSubpath *));
+ for (i = 0; i < n; ++i)
+ subpaths[i] = subpaths1[i]->copy();
+}
+
+void GfxPath::moveTo(double x, double y) {
+ justMoved = gTrue;
+ firstX = x;
+ firstY = y;
+}
+
+void GfxPath::lineTo(double x, double y) {
+ if (justMoved) {
+ if (n >= size) {
+ size += 16;
+ subpaths = (GfxSubpath **)
+ greallocn(subpaths, size, sizeof(GfxSubpath *));
+ }
+ subpaths[n] = new GfxSubpath(firstX, firstY);
+ ++n;
+ justMoved = gFalse;
+ }
+ subpaths[n-1]->lineTo(x, y);
+}
+
+void GfxPath::curveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3) {
+ if (justMoved) {
+ if (n >= size) {
+ size += 16;
+ subpaths = (GfxSubpath **)
+ greallocn(subpaths, size, sizeof(GfxSubpath *));
+ }
+ subpaths[n] = new GfxSubpath(firstX, firstY);
+ ++n;
+ justMoved = gFalse;
+ }
+ subpaths[n-1]->curveTo(x1, y1, x2, y2, x3, y3);
+}
+
+void GfxPath::close() {
+ // this is necessary to handle the pathological case of
+ // moveto/closepath/clip, which defines an empty clipping region
+ if (justMoved) {
+ if (n >= size) {
+ size += 16;
+ subpaths = (GfxSubpath **)
+ greallocn(subpaths, size, sizeof(GfxSubpath *));
+ }
+ subpaths[n] = new GfxSubpath(firstX, firstY);
+ ++n;
+ justMoved = gFalse;
+ }
+ subpaths[n-1]->close();
+}
+
+void GfxPath::append(GfxPath *path) {
+ int i;
+
+ if (n + path->n > size) {
+ size = n + path->n;
+ subpaths = (GfxSubpath **)
+ greallocn(subpaths, size, sizeof(GfxSubpath *));
+ }
+ for (i = 0; i < path->n; ++i) {
+ subpaths[n++] = path->subpaths[i]->copy();
+ }
+ justMoved = gFalse;
+}
+
+void GfxPath::offset(double dx, double dy) {
+ int i;
+
+ for (i = 0; i < n; ++i) {
+ subpaths[i]->offset(dx, dy);
+ }
+}
+
+//------------------------------------------------------------------------
+// GfxState
+//------------------------------------------------------------------------
+
+GfxState::GfxState(double hDPIA, double vDPIA, PDFRectangle *pageBox,
+ int rotateA, GBool upsideDown) {
+ double kx, ky;
+
+ hDPI = hDPIA;
+ vDPI = vDPIA;
+ rotate = rotateA;
+ px1 = pageBox->x1;
+ py1 = pageBox->y1;
+ px2 = pageBox->x2;
+ py2 = pageBox->y2;
+ kx = hDPI / 72.0;
+ ky = vDPI / 72.0;
+ if (rotate == 90) {
+ ctm[0] = 0;
+ ctm[1] = upsideDown ? ky : -ky;
+ ctm[2] = kx;
+ ctm[3] = 0;
+ ctm[4] = -kx * py1;
+ ctm[5] = ky * (upsideDown ? -px1 : px2);
+ pageWidth = kx * (py2 - py1);
+ pageHeight = ky * (px2 - px1);
+ } else if (rotate == 180) {
+ ctm[0] = -kx;
+ ctm[1] = 0;
+ ctm[2] = 0;
+ ctm[3] = upsideDown ? ky : -ky;
+ ctm[4] = kx * px2;
+ ctm[5] = ky * (upsideDown ? -py1 : py2);
+ pageWidth = kx * (px2 - px1);
+ pageHeight = ky * (py2 - py1);
+ } else if (rotate == 270) {
+ ctm[0] = 0;
+ ctm[1] = upsideDown ? -ky : ky;
+ ctm[2] = -kx;
+ ctm[3] = 0;
+ ctm[4] = kx * py2;
+ ctm[5] = ky * (upsideDown ? px2 : -px1);
+ pageWidth = kx * (py2 - py1);
+ pageHeight = ky * (px2 - px1);
+ } else {
+ ctm[0] = kx;
+ ctm[1] = 0;
+ ctm[2] = 0;
+ ctm[3] = upsideDown ? -ky : ky;
+ ctm[4] = -kx * px1;
+ ctm[5] = ky * (upsideDown ? py2 : -py1);
+ pageWidth = kx * (px2 - px1);
+ pageHeight = ky * (py2 - py1);
+ }
+
+ fillColorSpace = new GfxDeviceGrayColorSpace();
+ strokeColorSpace = new GfxDeviceGrayColorSpace();
+ fillColor.c[0] = 0;
+ strokeColor.c[0] = 0;
+ fillPattern = NULL;
+ strokePattern = NULL;
+ blendMode = gfxBlendNormal;
+ fillOpacity = 1;
+ strokeOpacity = 1;
+ fillOverprint = gFalse;
+ strokeOverprint = gFalse;
+ transfer[0] = transfer[1] = transfer[2] = transfer[3] = NULL;
+
+ lineWidth = 1;
+ lineDash = NULL;
+ lineDashLength = 0;
+ lineDashStart = 0;
+ flatness = 1;
+ lineJoin = 0;
+ lineCap = 0;
+ miterLimit = 10;
+ strokeAdjust = gFalse;
+
+ font = NULL;
+ fontSize = 0;
+ textMat[0] = 1; textMat[1] = 0;
+ textMat[2] = 0; textMat[3] = 1;
+ textMat[4] = 0; textMat[5] = 0;
+ charSpace = 0;
+ wordSpace = 0;
+ horizScaling = 1;
+ leading = 0;
+ rise = 0;
+ render = 0;
+
+ path = new GfxPath();
+ curX = curY = 0;
+ lineX = lineY = 0;
+
+ clipXMin = 0;
+ clipYMin = 0;
+ clipXMax = pageWidth;
+ clipYMax = pageHeight;
+
+ saved = NULL;
+}
+
+GfxState::~GfxState() {
+ int i;
+
+ if (fillColorSpace) {
+ delete fillColorSpace;
+ }
+ if (strokeColorSpace) {
+ delete strokeColorSpace;
+ }
+ if (fillPattern) {
+ delete fillPattern;
+ }
+ if (strokePattern) {
+ delete strokePattern;
+ }
+ for (i = 0; i < 4; ++i) {
+ if (transfer[i]) {
+ delete transfer[i];
+ }
+ }
+ gfree(lineDash);
+ if (path) {
+ // this gets set to NULL by restore()
+ delete path;
+ }
+ if (saved) {
+ delete saved;
+ }
+}
+
+// Used for copy();
+GfxState::GfxState(GfxState *state) {
+ int i;
+
+ memcpy(this, state, sizeof(GfxState));
+ if (fillColorSpace) {
+ fillColorSpace = state->fillColorSpace->copy();
+ }
+ if (strokeColorSpace) {
+ strokeColorSpace = state->strokeColorSpace->copy();
+ }
+ if (fillPattern) {
+ fillPattern = state->fillPattern->copy();
+ }
+ if (strokePattern) {
+ strokePattern = state->strokePattern->copy();
+ }
+ for (i = 0; i < 4; ++i) {
+ if (transfer[i]) {
+ transfer[i] = state->transfer[i]->copy();
+ }
+ }
+ if (lineDashLength > 0) {
+ lineDash = (double *)gmallocn(lineDashLength, sizeof(double));
+ memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double));
+ }
+ saved = NULL;
+}
+
+void GfxState::setPath(GfxPath *pathA) {
+ delete path;
+ path = pathA;
+}
+
+void GfxState::getUserClipBBox(double *xMin, double *yMin,
+ double *xMax, double *yMax) {
+ double ictm[6];
+ double xMin1, yMin1, xMax1, yMax1, det, tx, ty;
+
+ // invert the CTM
+ det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+ ictm[0] = ctm[3] * det;
+ ictm[1] = -ctm[1] * det;
+ ictm[2] = -ctm[2] * det;
+ ictm[3] = ctm[0] * det;
+ ictm[4] = (ctm[2] * ctm[5] - ctm[3] * ctm[4]) * det;
+ ictm[5] = (ctm[1] * ctm[4] - ctm[0] * ctm[5]) * det;
+
+ // transform all four corners of the clip bbox; find the min and max
+ // x and y values
+ xMin1 = xMax1 = clipXMin * ictm[0] + clipYMin * ictm[2] + ictm[4];
+ yMin1 = yMax1 = clipXMin * ictm[1] + clipYMin * ictm[3] + ictm[5];
+ tx = clipXMin * ictm[0] + clipYMax * ictm[2] + ictm[4];
+ ty = clipXMin * ictm[1] + clipYMax * ictm[3] + ictm[5];
+ if (tx < xMin1) {
+ xMin1 = tx;
+ } else if (tx > xMax1) {
+ xMax1 = tx;
+ }
+ if (ty < yMin1) {
+ yMin1 = ty;
+ } else if (ty > yMax1) {
+ yMax1 = ty;
+ }
+ tx = clipXMax * ictm[0] + clipYMin * ictm[2] + ictm[4];
+ ty = clipXMax * ictm[1] + clipYMin * ictm[3] + ictm[5];
+ if (tx < xMin1) {
+ xMin1 = tx;
+ } else if (tx > xMax1) {
+ xMax1 = tx;
+ }
+ if (ty < yMin1) {
+ yMin1 = ty;
+ } else if (ty > yMax1) {
+ yMax1 = ty;
+ }
+ tx = clipXMax * ictm[0] + clipYMax * ictm[2] + ictm[4];
+ ty = clipXMax * ictm[1] + clipYMax * ictm[3] + ictm[5];
+ if (tx < xMin1) {
+ xMin1 = tx;
+ } else if (tx > xMax1) {
+ xMax1 = tx;
+ }
+ if (ty < yMin1) {
+ yMin1 = ty;
+ } else if (ty > yMax1) {
+ yMax1 = ty;
+ }
+
+ *xMin = xMin1;
+ *yMin = yMin1;
+ *xMax = xMax1;
+ *yMax = yMax1;
+}
+
+double GfxState::transformWidth(double w) {
+ double x, y;
+
+ x = ctm[0] + ctm[2];
+ y = ctm[1] + ctm[3];
+ return w * sqrt(0.5 * (x * x + y * y));
+}
+
+double GfxState::getTransformedFontSize() {
+ double x1, y1, x2, y2;
+
+ x1 = textMat[2] * fontSize;
+ y1 = textMat[3] * fontSize;
+ x2 = ctm[0] * x1 + ctm[2] * y1;
+ y2 = ctm[1] * x1 + ctm[3] * y1;
+ return sqrt(x2 * x2 + y2 * y2);
+}
+
+void GfxState::getFontTransMat(double *m11, double *m12,
+ double *m21, double *m22) {
+ *m11 = (textMat[0] * ctm[0] + textMat[1] * ctm[2]) * fontSize;
+ *m12 = (textMat[0] * ctm[1] + textMat[1] * ctm[3]) * fontSize;
+ *m21 = (textMat[2] * ctm[0] + textMat[3] * ctm[2]) * fontSize;
+ *m22 = (textMat[2] * ctm[1] + textMat[3] * ctm[3]) * fontSize;
+}
+
+void GfxState::setCTM(double a, double b, double c,
+ double d, double e, double f) {
+ int i;
+
+ ctm[0] = a;
+ ctm[1] = b;
+ ctm[2] = c;
+ ctm[3] = d;
+ ctm[4] = e;
+ ctm[5] = f;
+
+ // avoid FP exceptions on badly messed up PDF files
+ for (i = 0; i < 6; ++i) {
+ if (ctm[i] > 1e10) {
+ ctm[i] = 1e10;
+ } else if (ctm[i] < -1e10) {
+ ctm[i] = -1e10;
+ }
+ }
+}
+
+void GfxState::concatCTM(double a, double b, double c,
+ double d, double e, double f) {
+ double a1 = ctm[0];
+ double b1 = ctm[1];
+ double c1 = ctm[2];
+ double d1 = ctm[3];
+ int i;
+
+ ctm[0] = a * a1 + b * c1;
+ ctm[1] = a * b1 + b * d1;
+ ctm[2] = c * a1 + d * c1;
+ ctm[3] = c * b1 + d * d1;
+ ctm[4] = e * a1 + f * c1 + ctm[4];
+ ctm[5] = e * b1 + f * d1 + ctm[5];
+
+ // avoid FP exceptions on badly messed up PDF files
+ for (i = 0; i < 6; ++i) {
+ if (ctm[i] > 1e10) {
+ ctm[i] = 1e10;
+ } else if (ctm[i] < -1e10) {
+ ctm[i] = -1e10;
+ }
+ }
+}
+
+void GfxState::shiftCTM(double tx, double ty) {
+ ctm[4] += tx;
+ ctm[5] += ty;
+ clipXMin += tx;
+ clipYMin += ty;
+ clipXMax += tx;
+ clipYMax += ty;
+}
+
+void GfxState::setFillColorSpace(GfxColorSpace *colorSpace) {
+ if (fillColorSpace) {
+ delete fillColorSpace;
+ }
+ fillColorSpace = colorSpace;
+}
+
+void GfxState::setStrokeColorSpace(GfxColorSpace *colorSpace) {
+ if (strokeColorSpace) {
+ delete strokeColorSpace;
+ }
+ strokeColorSpace = colorSpace;
+}
+
+void GfxState::setFillPattern(GfxPattern *pattern) {
+ if (fillPattern) {
+ delete fillPattern;
+ }
+ fillPattern = pattern;
+}
+
+void GfxState::setStrokePattern(GfxPattern *pattern) {
+ if (strokePattern) {
+ delete strokePattern;
+ }
+ strokePattern = pattern;
+}
+
+void GfxState::setTransfer(Function **funcs) {
+ int i;
+
+ for (i = 0; i < 4; ++i) {
+ if (transfer[i]) {
+ delete transfer[i];
+ }
+ transfer[i] = funcs[i];
+ }
+}
+
+void GfxState::setLineDash(double *dash, int length, double start) {
+ if (lineDash)
+ gfree(lineDash);
+ lineDash = dash;
+ lineDashLength = length;
+ lineDashStart = start;
+}
+
+void GfxState::clearPath() {
+ delete path;
+ path = new GfxPath();
+}
+
+void GfxState::clip() {
+ double xMin, yMin, xMax, yMax, x, y;
+ GfxSubpath *subpath;
+ int i, j;
+
+ xMin = xMax = yMin = yMax = 0; // make gcc happy
+ for (i = 0; i < path->getNumSubpaths(); ++i) {
+ subpath = path->getSubpath(i);
+ for (j = 0; j < subpath->getNumPoints(); ++j) {
+ transform(subpath->getX(j), subpath->getY(j), &x, &y);
+ if (i == 0 && j == 0) {
+ xMin = xMax = x;
+ yMin = yMax = y;
+ } else {
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ }
+ }
+ }
+ if (xMin > clipXMin) {
+ clipXMin = xMin;
+ }
+ if (yMin > clipYMin) {
+ clipYMin = yMin;
+ }
+ if (xMax < clipXMax) {
+ clipXMax = xMax;
+ }
+ if (yMax < clipYMax) {
+ clipYMax = yMax;
+ }
+}
+
+void GfxState::clipToStrokePath() {
+ double xMin, yMin, xMax, yMax, x, y, t0, t1;
+ GfxSubpath *subpath;
+ int i, j;
+
+ xMin = xMax = yMin = yMax = 0; // make gcc happy
+ for (i = 0; i < path->getNumSubpaths(); ++i) {
+ subpath = path->getSubpath(i);
+ for (j = 0; j < subpath->getNumPoints(); ++j) {
+ transform(subpath->getX(j), subpath->getY(j), &x, &y);
+ if (i == 0 && j == 0) {
+ xMin = xMax = x;
+ yMin = yMax = y;
+ } else {
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ }
+ }
+ }
+
+ // allow for the line width
+ //~ miter joins can extend farther than this
+ t0 = fabs(ctm[0]);
+ t1 = fabs(ctm[2]);
+ if (t0 > t1) {
+ xMin -= 0.5 * lineWidth * t0;
+ xMax += 0.5 * lineWidth * t0;
+ } else {
+ xMin -= 0.5 * lineWidth * t1;
+ xMax += 0.5 * lineWidth * t1;
+ }
+ t0 = fabs(ctm[0]);
+ t1 = fabs(ctm[3]);
+ if (t0 > t1) {
+ yMin -= 0.5 * lineWidth * t0;
+ yMax += 0.5 * lineWidth * t0;
+ } else {
+ yMin -= 0.5 * lineWidth * t1;
+ yMax += 0.5 * lineWidth * t1;
+ }
+
+ if (xMin > clipXMin) {
+ clipXMin = xMin;
+ }
+ if (yMin > clipYMin) {
+ clipYMin = yMin;
+ }
+ if (xMax < clipXMax) {
+ clipXMax = xMax;
+ }
+ if (yMax < clipYMax) {
+ clipYMax = yMax;
+ }
+}
+
+void GfxState::textShift(double tx, double ty) {
+ double dx, dy;
+
+ textTransformDelta(tx, ty, &dx, &dy);
+ curX += dx;
+ curY += dy;
+}
+
+void GfxState::shift(double dx, double dy) {
+ curX += dx;
+ curY += dy;
+}
+
+GfxState *GfxState::save() {
+ GfxState *newState;
+
+ newState = copy();
+ newState->saved = this;
+ return newState;
+}
+
+GfxState *GfxState::restore() {
+ GfxState *oldState;
+
+ if (saved) {
+ oldState = saved;
+
+ // these attributes aren't saved/restored by the q/Q operators
+ oldState->path = path;
+ oldState->curX = curX;
+ oldState->curY = curY;
+ oldState->lineX = lineX;
+ oldState->lineY = lineY;
+
+ path = NULL;
+ saved = NULL;
+ delete this;
+
+ } else {
+ oldState = this;
+ }
+
+ return oldState;
+}
+
+GBool GfxState::parseBlendMode(Object *obj, GfxBlendMode *mode) {
+ Object obj2;
+ int i, j;
+
+ if (obj->isName()) {
+ for (i = 0; i < nGfxBlendModeNames; ++i) {
+ if (!strcmp(obj->getName(), gfxBlendModeNames[i].name)) {
+ *mode = gfxBlendModeNames[i].mode;
+ return gTrue;
+ }
+ }
+ return gFalse;
+ } else if (obj->isArray()) {
+ for (i = 0; i < obj->arrayGetLength(); ++i) {
+ obj->arrayGet(i, &obj2);
+ if (!obj2.isName()) {
+ obj2.free();
+ return gFalse;
+ }
+ for (j = 0; j < nGfxBlendModeNames; ++j) {
+ if (!strcmp(obj2.getName(), gfxBlendModeNames[j].name)) {
+ obj2.free();
+ *mode = gfxBlendModeNames[j].mode;
+ return gTrue;
+ }
+ }
+ obj2.free();
+ }
+ *mode = gfxBlendNormal;
+ return gTrue;
+ } else {
+ return gFalse;
+ }
+}
diff --git a/kpdf/xpdf/xpdf/GfxState.h b/kpdf/xpdf/xpdf/GfxState.h
index f85643dc..52c5c93c 100644
--- a/kpdf/xpdf/xpdf/GfxState.h
+++ b/kpdf/xpdf/xpdf/GfxState.h
@@ -114,7 +114,7 @@ struct GfxCMYK {
//------------------------------------------------------------------------
// NB: The nGfxColorSpaceModes constant and the gfxColorSpaceModeNames
-// array defined in GfxState.cc must match this enum.
+// array defined in GfxState.cpp must match this enum.
enum GfxColorSpaceMode {
csDeviceGray,
csCalGray,
diff --git a/kpdf/xpdf/xpdf/GlobalParams.cc b/kpdf/xpdf/xpdf/GlobalParams.cc
deleted file mode 100644
index 6212f42e..00000000
--- a/kpdf/xpdf/xpdf/GlobalParams.cc
+++ /dev/null
@@ -1,2989 +0,0 @@
-//========================================================================
-//
-// GlobalParams.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include <strings.h>
-// KPDF: additional includes for Qt and Xft
-#include <tqstring.h>
-#include <tqregexp.h>
-#include <tqwindowdefs.h>
-// -- gentoo compile fix (XFree 4.3.0, FC 2.2.3, FreeType 2.1.9) --
-// on other distros these 2 lines should't harm
-#include <ft2build.h>
-#include FT_FREETYPE_H
-// -- ---------------------------------------------------------- --
-#include <X11/Xlib.h>
-#include <X11/Xft/Xft.h>
-#include <X11/Xft/XftCompat.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#ifdef ENABLE_PLUGINS
-# ifndef WIN32
-# include <dlfcn.h>
-# endif
-#endif
-#ifdef WIN32
-# include <shlobj.h>
-#endif
-#if HAVE_PAPER_H
-#include <paper.h>
-#endif
-#include "gmem.h"
-#include "GString.h"
-#include "GList.h"
-#include "GHash.h"
-#include "gfile.h"
-#include "Error.h"
-#include "NameToCharCode.h"
-#include "CharCodeToUnicode.h"
-#include "UnicodeMap.h"
-#include "CMap.h"
-#include "BuiltinFontTables.h"
-#include "FontEncodingTables.h"
-#ifdef ENABLE_PLUGINS
-# include "XpdfPluginAPI.h"
-#endif
-#include "GlobalParams.h"
-
-#include <tqstring.h>
-#include <tqregexp.h>
-#include <fontconfig/fontconfig.h>
-
-#ifdef WIN32
-# define strcasecmp stricmp
-#endif
-
-#if MULTITHREADED
-# define lockGlobalParams gLockMutex(&mutex)
-# define lockUnicodeMapCache gLockMutex(&unicodeMapCacheMutex)
-# define lockCMapCache gLockMutex(&cMapCacheMutex)
-# define unlockGlobalParams gUnlockMutex(&mutex)
-# define unlockUnicodeMapCache gUnlockMutex(&unicodeMapCacheMutex)
-# define unlockCMapCache gUnlockMutex(&cMapCacheMutex)
-#else
-# define lockGlobalParams
-# define lockUnicodeMapCache
-# define lockCMapCache
-# define unlockGlobalParams
-# define unlockUnicodeMapCache
-# define unlockCMapCache
-#endif
-
-#include "NameToUnicodeTable.h"
-#include "UnicodeMapTables.h"
-#include "UTF8.h"
-
-#ifdef ENABLE_PLUGINS
-# ifdef WIN32
-extern XpdfPluginVecTable xpdfPluginVecTable;
-# endif
-#endif
-
-//------------------------------------------------------------------------
-
-#define cidToUnicodeCacheSize 4
-#define unicodeToUnicodeCacheSize 4
-
-//------------------------------------------------------------------------
-
-static struct {
- char *name;
- char *t1FileName;
- char *ttFileName;
-} displayFontTab[] = {
- {"Courier", "n022003l.pfb", "cour.ttf"},
- {"Courier-Bold", "n022004l.pfb", "courbd.ttf"},
- {"Courier-BoldOblique", "n022024l.pfb", "courbi.ttf"},
- {"Courier-Oblique", "n022023l.pfb", "couri.ttf"},
- {"Helvetica", "n019003l.pfb", "arial.ttf"},
- {"Helvetica-Bold", "n019004l.pfb", "arialbd.ttf"},
- {"Helvetica-BoldOblique", "n019024l.pfb", "arialbi.ttf"},
- {"Helvetica-Oblique", "n019023l.pfb", "ariali.ttf"},
- {"Symbol", "s050000l.pfb", NULL},
- {"Times-Bold", "n021004l.pfb", "timesbd.ttf"},
- {"Times-BoldItalic", "n021024l.pfb", "timesbi.ttf"},
- {"Times-Italic", "n021023l.pfb", "timesi.ttf"},
- {"Times-Roman", "n021003l.pfb", "times.ttf"},
- {"ZapfDingbats", "d050000l.pfb", NULL},
- {NULL, NULL, NULL}
-};
-
-#ifdef WIN32
-static char *displayFontDirs[] = {
- "c:/windows/fonts",
- "c:/winnt/fonts",
- NULL
-};
-#else
-static char *displayFontDirs[] = {
- "/usr/share/ghostscript/fonts",
- "/usr/pkg/share/ghostscript/fonts",
- "/usr/local/share/ghostscript/fonts",
- "/usr/share/fonts/default/Type1",
- "/usr/X11R6/lib/X11/fonts/Type1",
- "/usr/share/fonts/default/ghostscript",
- "/usr/share/fonts/type1/gsfonts",
- "/usr/share/fonts/Type1",
- NULL
-};
-#endif
-
-//------------------------------------------------------------------------
-
-GlobalParams *globalParams = NULL;
-
-//------------------------------------------------------------------------
-// DisplayFontParam
-//------------------------------------------------------------------------
-
-DisplayFontParam::DisplayFontParam(GString *nameA,
- DisplayFontParamKind kindA) {
- name = nameA;
- kind = kindA;
- switch (kind) {
- case displayFontT1:
- t1.fileName = NULL;
- break;
- case displayFontTT:
- tt.fileName = NULL;
- break;
- }
-}
-
-DisplayFontParam::~DisplayFontParam() {
- delete name;
- switch (kind) {
- case displayFontT1:
- if (t1.fileName) {
- delete t1.fileName;
- }
- break;
- case displayFontTT:
- if (tt.fileName) {
- delete tt.fileName;
- }
- break;
- }
-}
-
-#ifdef WIN32
-
-//------------------------------------------------------------------------
-// WinFontInfo
-//------------------------------------------------------------------------
-
-class WinFontInfo: public DisplayFontParam {
-public:
-
- GBool bold, italic;
-
- static WinFontInfo *make(GString *nameA, GBool boldA, GBool italicA,
- HKEY regKey, char *winFontDir);
- WinFontInfo(GString *nameA, GBool boldA, GBool italicA,
- GString *fileNameA);
- virtual ~WinFontInfo();
- GBool equals(WinFontInfo *fi);
-};
-
-WinFontInfo *WinFontInfo::make(GString *nameA, GBool boldA, GBool italicA,
- HKEY regKey, char *winFontDir) {
- GString *regName;
- GString *fileNameA;
- char buf[MAX_PATH];
- DWORD n;
- char c;
- int i;
-
- //----- find the font file
- fileNameA = NULL;
- regName = nameA->copy();
- if (boldA) {
- regName->append(" Bold");
- }
- if (italicA) {
- regName->append(" Italic");
- }
- regName->append(" (TrueType)");
- n = sizeof(buf);
- if (RegQueryValueEx(regKey, regName->getCString(), NULL, NULL,
- (LPBYTE)buf, &n) == ERROR_SUCCESS) {
- fileNameA = new GString(winFontDir);
- fileNameA->append('\\')->append(buf);
- }
- delete regName;
- if (!fileNameA) {
- delete nameA;
- return NULL;
- }
-
- //----- normalize the font name
- i = 0;
- while (i < nameA->getLength()) {
- c = nameA->getChar(i);
- if (c == ' ' || c == ',' || c == '-') {
- nameA->del(i);
- } else {
- ++i;
- }
- }
-
- return new WinFontInfo(nameA, boldA, italicA, fileNameA);
-}
-
-WinFontInfo::WinFontInfo(GString *nameA, GBool boldA, GBool italicA,
- GString *fileNameA):
- DisplayFontParam(nameA, displayFontTT)
-{
- bold = boldA;
- italic = italicA;
- tt.fileName = fileNameA;
-}
-
-WinFontInfo::~WinFontInfo() {
-}
-
-GBool WinFontInfo::equals(WinFontInfo *fi) {
- return !name->cmp(fi->name) && bold == fi->bold && italic == fi->italic;
-}
-
-//------------------------------------------------------------------------
-// WinFontList
-//------------------------------------------------------------------------
-
-class WinFontList {
-public:
-
- WinFontList(char *winFontDirA);
- ~WinFontList();
- WinFontInfo *find(GString *font);
-
-private:
-
- void add(WinFontInfo *fi);
- static int CALLBACK enumFunc1(CONST LOGFONT *font,
- CONST TEXTMETRIC *metrics,
- DWORD type, LPARAM data);
- static int CALLBACK enumFunc2(CONST LOGFONT *font,
- CONST TEXTMETRIC *metrics,
- DWORD type, LPARAM data);
-
- GList *fonts; // [WinFontInfo]
- HDC dc; // (only used during enumeration)
- HKEY regKey; // (only used during enumeration)
- char *winFontDir; // (only used during enumeration)
-};
-
-WinFontList::WinFontList(char *winFontDirA) {
- OSVERSIONINFO version;
- char *path;
-
- fonts = new GList();
- dc = GetDC(NULL);
- winFontDir = winFontDirA;
- version.dwOSVersionInfoSize = sizeof(version);
- GetVersionEx(&version);
- if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
- path = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\\";
- } else {
- path = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts\\";
- }
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0,
- KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
- &regKey) == ERROR_SUCCESS) {
- EnumFonts(dc, NULL, &WinFontList::enumFunc1, (LPARAM)this);
- RegCloseKey(regKey);
- }
- ReleaseDC(NULL, dc);
-}
-
-WinFontList::~WinFontList() {
- deleteGList(fonts, WinFontInfo);
-}
-
-void WinFontList::add(WinFontInfo *fi) {
- int i;
-
- for (i = 0; i < fonts->getLength(); ++i) {
- if (((WinFontInfo *)fonts->get(i))->equals(fi)) {
- delete fi;
- return;
- }
- }
- fonts->append(fi);
-}
-
-WinFontInfo *WinFontList::find(GString *font) {
- GString *name;
- GBool bold, italic;
- WinFontInfo *fi;
- char c;
- int n, i;
-
- name = font->copy();
-
- // remove space, comma, dash chars
- i = 0;
- while (i < name->getLength()) {
- c = name->getChar(i);
- if (c == ' ' || c == ',' || c == '-') {
- name->del(i);
- } else {
- ++i;
- }
- }
- n = name->getLength();
-
- // remove trailing "MT" (Foo-MT, Foo-BoldMT, etc.)
- if (!strcmp(name->getCString() + n - 2, "MT")) {
- name->del(n - 2, 2);
- n -= 2;
- }
-
- // look for "Italic"
- if (!strcmp(name->getCString() + n - 6, "Italic")) {
- name->del(n - 6, 6);
- italic = gTrue;
- n -= 6;
- } else {
- italic = gFalse;
- }
-
- // look for "Bold"
- if (!strcmp(name->getCString() + n - 4, "Bold")) {
- name->del(n - 4, 4);
- bold = gTrue;
- n -= 4;
- } else {
- bold = gFalse;
- }
-
- // remove trailing "MT" (FooMT-Bold, etc.)
- if (!strcmp(name->getCString() + n - 2, "MT")) {
- name->del(n - 2, 2);
- n -= 2;
- }
-
- // remove trailing "PS"
- if (!strcmp(name->getCString() + n - 2, "PS")) {
- name->del(n - 2, 2);
- n -= 2;
- }
-
- // search for the font
- fi = NULL;
- for (i = 0; i < fonts->getLength(); ++i) {
- fi = (WinFontInfo *)fonts->get(i);
- if (!fi->name->cmp(name) && fi->bold == bold && fi->italic == italic) {
- break;
- }
- fi = NULL;
- }
-
- delete name;
- return fi;
-}
-
-int CALLBACK WinFontList::enumFunc1(CONST LOGFONT *font,
- CONST TEXTMETRIC *metrics,
- DWORD type, LPARAM data) {
- WinFontList *fl = (WinFontList *)data;
-
- EnumFonts(fl->dc, font->lfFaceName, &WinFontList::enumFunc2, (LPARAM)fl);
- return 1;
-}
-
-int CALLBACK WinFontList::enumFunc2(CONST LOGFONT *font,
- CONST TEXTMETRIC *metrics,
- DWORD type, LPARAM data) {
- WinFontList *fl = (WinFontList *)data;
- WinFontInfo *fi;
-
- if (type & TRUETYPE_FONTTYPE) {
- if ((fi = WinFontInfo::make(new GString(font->lfFaceName),
- font->lfWeight >= 600,
- font->lfItalic ? gTrue : gFalse,
- fl->regKey, fl->winFontDir))) {
- fl->add(fi);
- }
- }
- return 1;
-}
-
-#endif // WIN32
-
-//------------------------------------------------------------------------
-// PSFontParam
-//------------------------------------------------------------------------
-
-PSFontParam::PSFontParam(GString *pdfFontNameA, int wModeA,
- GString *psFontNameA, GString *encodingA) {
- pdfFontName = pdfFontNameA;
- wMode = wModeA;
- psFontName = psFontNameA;
- encoding = encodingA;
-}
-
-PSFontParam::~PSFontParam() {
- delete pdfFontName;
- delete psFontName;
- if (encoding) {
- delete encoding;
- }
-}
-
-//------------------------------------------------------------------------
-// KeyBinding
-//------------------------------------------------------------------------
-
-KeyBinding::KeyBinding(int codeA, int modsA, int contextA, char *cmd0) {
- code = codeA;
- mods = modsA;
- context = contextA;
- cmds = new GList();
- cmds->append(new GString(cmd0));
-}
-
-KeyBinding::KeyBinding(int codeA, int modsA, int contextA,
- char *cmd0, char *cmd1) {
- code = codeA;
- mods = modsA;
- context = contextA;
- cmds = new GList();
- cmds->append(new GString(cmd0));
- cmds->append(new GString(cmd1));
-}
-
-KeyBinding::KeyBinding(int codeA, int modsA, int contextA, GList *cmdsA) {
- code = codeA;
- mods = modsA;
- context = contextA;
- cmds = cmdsA;
-}
-
-KeyBinding::~KeyBinding() {
- deleteGList(cmds, GString);
-}
-
-#ifdef ENABLE_PLUGINS
-//------------------------------------------------------------------------
-// Plugin
-//------------------------------------------------------------------------
-
-class Plugin {
-public:
-
- static Plugin *load(char *type, char *name);
- ~Plugin();
-
-private:
-
-#ifdef WIN32
- Plugin(HMODULE libA);
- HMODULE lib;
-#else
- Plugin(void *dlA);
- void *dl;
-#endif
-};
-
-Plugin *Plugin::load(char *type, char *name) {
- GString *path;
- Plugin *plugin;
- XpdfPluginVecTable *vt;
- XpdfBool (*xpdfInitPlugin)(void);
-#ifdef WIN32
- HMODULE libA;
-#else
- void *dlA;
-#endif
-
- path = globalParams->getBaseDir();
- appendToPath(path, "plugins");
- appendToPath(path, type);
- appendToPath(path, name);
-
-#ifdef WIN32
- path->append(".dll");
- if (!(libA = LoadLibrary(path->getCString()))) {
- error(-1, "Failed to load plugin '%s'",
- path->getCString());
- goto err1;
- }
- if (!(vt = (XpdfPluginVecTable *)
- GetProcAddress(libA, "xpdfPluginVecTable"))) {
- error(-1, "Failed to find xpdfPluginVecTable in plugin '%s'",
- path->getCString());
- goto err2;
- }
-#else
- //~ need to deal with other extensions here
- path->append(".so");
- if (!(dlA = dlopen(path->getCString(), RTLD_NOW))) {
- error(-1, "Failed to load plugin '%s': %s",
- path->getCString(), dlerror());
- goto err1;
- }
- if (!(vt = (XpdfPluginVecTable *)dlsym(dlA, "xpdfPluginVecTable"))) {
- error(-1, "Failed to find xpdfPluginVecTable in plugin '%s'",
- path->getCString());
- goto err2;
- }
-#endif
-
- if (vt->version != xpdfPluginVecTable.version) {
- error(-1, "Plugin '%s' is wrong version", path->getCString());
- goto err2;
- }
- memcpy(vt, &xpdfPluginVecTable, sizeof(xpdfPluginVecTable));
-
-#ifdef WIN32
- if (!(xpdfInitPlugin = (XpdfBool (*)(void))
- GetProcAddress(libA, "xpdfInitPlugin"))) {
- error(-1, "Failed to find xpdfInitPlugin in plugin '%s'",
- path->getCString());
- goto err2;
- }
-#else
- if (!(xpdfInitPlugin = (XpdfBool (*)(void))dlsym(dlA, "xpdfInitPlugin"))) {
- error(-1, "Failed to find xpdfInitPlugin in plugin '%s'",
- path->getCString());
- goto err2;
- }
-#endif
-
- if (!(*xpdfInitPlugin)()) {
- error(-1, "Initialization of plugin '%s' failed",
- path->getCString());
- goto err2;
- }
-
-#ifdef WIN32
- plugin = new Plugin(libA);
-#else
- plugin = new Plugin(dlA);
-#endif
-
- delete path;
- return plugin;
-
- err2:
-#ifdef WIN32
- FreeLibrary(libA);
-#else
- dlclose(dlA);
-#endif
- err1:
- delete path;
- return NULL;
-}
-
-#ifdef WIN32
-Plugin::Plugin(HMODULE libA) {
- lib = libA;
-}
-#else
-Plugin::Plugin(void *dlA) {
- dl = dlA;
-}
-#endif
-
-Plugin::~Plugin() {
- void (*xpdfFreePlugin)(void);
-
-#ifdef WIN32
- if ((xpdfFreePlugin = (void (*)(void))
- GetProcAddress(lib, "xpdfFreePlugin"))) {
- (*xpdfFreePlugin)();
- }
- FreeLibrary(lib);
-#else
- if ((xpdfFreePlugin = (void (*)(void))dlsym(dl, "xpdfFreePlugin"))) {
- (*xpdfFreePlugin)();
- }
- dlclose(dl);
-#endif
-}
-
-#endif // ENABLE_PLUGINS
-
-//------------------------------------------------------------------------
-// parsing
-//------------------------------------------------------------------------
-
-GlobalParams::GlobalParams(char *cfgFileName) {
- UnicodeMap *map;
- GString *fileName;
- FILE *f;
- int i;
-
-#if MULTITHREADED
- gInitMutex(&mutex);
- gInitMutex(&unicodeMapCacheMutex);
- gInitMutex(&cMapCacheMutex);
-#endif
-
- initBuiltinFontTables();
-
- // scan the encoding in reverse because we want the lowest-numbered
- // index for each char name ('space' is encoded twice)
- macRomanReverseMap = new NameToCharCode();
- for (i = 255; i >= 0; --i) {
- if (macRomanEncoding[i]) {
- macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
- }
- }
-
-#ifdef WIN32
- // baseDir will be set by a call to setBaseDir
- baseDir = new GString();
-#else
- baseDir = appendToPath(getHomeDir(), ".xpdf");
-#endif
- nameToUnicode = new NameToCharCode();
- cidToUnicodes = new GHash(gTrue);
- unicodeToUnicodes = new GHash(gTrue);
- residentUnicodeMaps = new GHash();
- unicodeMaps = new GHash(gTrue);
- cMapDirs = new GHash(gTrue);
- toUnicodeDirs = new GList();
- displayFonts = new GHash();
- displayCIDFonts = new GHash();
- displayNamedCIDFonts = new GHash();
-#if HAVE_PAPER_H
- char *paperName;
- const struct paper *paperType;
- paperinit();
- if ((paperName = systempapername())) {
- paperType = paperinfo(paperName);
- psPaperWidth = (int)paperpswidth(paperType);
- psPaperHeight = (int)paperpsheight(paperType);
- } else {
- error(-1, "No paper information available - using defaults");
- psPaperWidth = defPaperWidth;
- psPaperHeight = defPaperHeight;
- }
- paperdone();
-#else
- psPaperWidth = defPaperWidth;
- psPaperHeight = defPaperHeight;
-#endif
- psImageableLLX = psImageableLLY = 0;
- psImageableURX = psPaperWidth;
- psImageableURY = psPaperHeight;
- psCrop = gTrue;
- psExpandSmaller = gFalse;
- psShrinkLarger = gTrue;
- psCenter = gTrue;
- psDuplex = gFalse;
- psLevel = psLevel2;
- psFile = NULL;
- psFonts = new GHash();
- psNamedFonts16 = new GList();
- psFonts16 = new GList();
- psEmbedType1 = gTrue;
- psEmbedTrueType = gTrue;
- psEmbedCIDPostScript = gTrue;
- psEmbedCIDTrueType = gTrue;
- psPreload = gFalse;
- psOPI = gFalse;
- psASCIIHex = gFalse;
- // KPDF: use always UTF-8 and TQString::fromUtf
- textEncoding = new GString("UTF-8");
-#if defined(WIN32)
- textEOL = eolDOS;
-#elif defined(MACOS)
- textEOL = eolMac;
-#else
- textEOL = eolUnix;
-#endif
- textPageBreaks = gTrue;
- textKeepTinyChars = gFalse;
- fontDirs = new GList();
- initialZoom = new GString("125");
- continuousView = gFalse;
- enableT1lib = gTrue;
- enableFreeType = gTrue;
- antialias = gTrue;
- vectorAntialias = gTrue;
- strokeAdjust = gTrue;
- screenType = screenUnset;
- screenSize = -1;
- screenDotRadius = -1;
- screenGamma = 1.0;
- screenBlackThreshold = 0.0;
- screenWhiteThreshold = 1.0;
- urlCommand = NULL;
- movieCommand = NULL;
- mapNumericCharNames = gTrue;
- mapUnknownCharNames = gFalse;
- createDefaultKeyBindings();
- printCommands = gFalse;
- errQuiet = gFalse;
-
- cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
- unicodeToUnicodeCache =
- new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize);
- unicodeMapCache = new UnicodeMapCache();
- cMapCache = new CMapCache();
-
-#ifdef WIN32
- winFontList = NULL;
-#endif
-
-#ifdef ENABLE_PLUGINS
- plugins = new GList();
- securityHandlers = new GList();
-#endif
-
- // set up the initial nameToUnicode table
- for (i = 0; nameToUnicodeTab[i].name; ++i) {
- nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u);
- }
-
- // set up the residentUnicodeMaps table
- map = new UnicodeMap("Latin1", gFalse,
- latin1UnicodeMapRanges, latin1UnicodeMapLen);
- residentUnicodeMaps->add(map->getEncodingName(), map);
- map = new UnicodeMap("ASCII7", gFalse,
- ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
- residentUnicodeMaps->add(map->getEncodingName(), map);
- map = new UnicodeMap("Symbol", gFalse,
- symbolUnicodeMapRanges, symbolUnicodeMapLen);
- residentUnicodeMaps->add(map->getEncodingName(), map);
- map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
- zapfDingbatsUnicodeMapLen);
- residentUnicodeMaps->add(map->getEncodingName(), map);
- map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
- residentUnicodeMaps->add(map->getEncodingName(), map);
- map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
- residentUnicodeMaps->add(map->getEncodingName(), map);
-
- // look for a user config file, then a system-wide config file
- f = NULL;
- fileName = NULL;
- if (cfgFileName && cfgFileName[0]) {
- fileName = new GString(cfgFileName);
- if (!(f = fopen(fileName->getCString(), "r"))) {
- delete fileName;
- }
- }
- if (!f) {
- fileName = appendToPath(getHomeDir(), xpdfUserConfigFile);
- if (!(f = fopen(fileName->getCString(), "r"))) {
- delete fileName;
- }
- }
- if (!f) {
-#if defined(WIN32) && !defined(__CYGWIN32__)
- char buf[512];
- i = GetModuleFileName(NULL, buf, sizeof(buf));
- if (i <= 0 || i >= sizeof(buf)) {
- // error or path too long for buffer - just use the current dir
- buf[0] = '\0';
- }
- fileName = grabPath(buf);
- appendToPath(fileName, xpdfSysConfigFile);
-#else
- fileName = new GString(xpdfSysConfigFile);
-#endif
- if (!(f = fopen(fileName->getCString(), "r"))) {
- delete fileName;
- }
- }
- if (f) {
- parseFile(fileName, f);
- delete fileName;
- fclose(f);
- }
-}
-
-void GlobalParams::createDefaultKeyBindings() {
- keyBindings = new GList();
-
- //----- mouse buttons
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
- xpdfKeyContextAny, "startSelection"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
- xpdfKeyContextAny, "endSelection",
- "followLinkNoSel"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
- xpdfKeyContextAny, "startPan"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
- xpdfKeyContextAny, "endPan"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
- xpdfKeyContextAny, "postPopupMenu"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
- xpdfKeyContextAny,
- "scrollUpPrevPage(16)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
- xpdfKeyContextAny,
- "scrollDownNextPage(16)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollLeft(16)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollRight(16)"));
-
- //----- keys
- keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
- xpdfKeyContextAny, "gotoPage(1)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollToTopLeft"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
- xpdfKeyContextAny, "gotoLastPage"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
- xpdfKeyContextAny,
- "scrollToBottomRight"));
- keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
- xpdfKeyContextAny, "pageUp"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeBackspace, xpdfKeyModNone,
- xpdfKeyContextAny, "pageUp"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeDelete, xpdfKeyModNone,
- xpdfKeyContextAny, "pageUp"));
- keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
- xpdfKeyContextAny, "pageDown"));
- keyBindings->append(new KeyBinding(' ', xpdfKeyModNone,
- xpdfKeyContextAny, "pageDown"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollLeft(16)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollRight(16)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollUp(16)"));
- keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
- xpdfKeyContextAny, "scrollDown(16)"));
- keyBindings->append(new KeyBinding('o', xpdfKeyModNone,
- xpdfKeyContextAny, "open"));
- keyBindings->append(new KeyBinding('O', xpdfKeyModNone,
- xpdfKeyContextAny, "open"));
- keyBindings->append(new KeyBinding('r', xpdfKeyModNone,
- xpdfKeyContextAny, "reload"));
- keyBindings->append(new KeyBinding('R', xpdfKeyModNone,
- xpdfKeyContextAny, "reload"));
- keyBindings->append(new KeyBinding('f', xpdfKeyModNone,
- xpdfKeyContextAny, "find"));
- keyBindings->append(new KeyBinding('F', xpdfKeyModNone,
- xpdfKeyContextAny, "find"));
- keyBindings->append(new KeyBinding('f', xpdfKeyModCtrl,
- xpdfKeyContextAny, "find"));
- keyBindings->append(new KeyBinding('g', xpdfKeyModCtrl,
- xpdfKeyContextAny, "findNext"));
- keyBindings->append(new KeyBinding('p', xpdfKeyModCtrl,
- xpdfKeyContextAny, "print"));
- keyBindings->append(new KeyBinding('n', xpdfKeyModNone,
- xpdfKeyContextScrLockOff, "nextPage"));
- keyBindings->append(new KeyBinding('N', xpdfKeyModNone,
- xpdfKeyContextScrLockOff, "nextPage"));
- keyBindings->append(new KeyBinding('n', xpdfKeyModNone,
- xpdfKeyContextScrLockOn,
- "nextPageNoScroll"));
- keyBindings->append(new KeyBinding('N', xpdfKeyModNone,
- xpdfKeyContextScrLockOn,
- "nextPageNoScroll"));
- keyBindings->append(new KeyBinding('p', xpdfKeyModNone,
- xpdfKeyContextScrLockOff, "prevPage"));
- keyBindings->append(new KeyBinding('P', xpdfKeyModNone,
- xpdfKeyContextScrLockOff, "prevPage"));
- keyBindings->append(new KeyBinding('p', xpdfKeyModNone,
- xpdfKeyContextScrLockOn,
- "prevPageNoScroll"));
- keyBindings->append(new KeyBinding('P', xpdfKeyModNone,
- xpdfKeyContextScrLockOn,
- "prevPageNoScroll"));
- keyBindings->append(new KeyBinding('v', xpdfKeyModNone,
- xpdfKeyContextAny, "goForward"));
- keyBindings->append(new KeyBinding('b', xpdfKeyModNone,
- xpdfKeyContextAny, "goBackward"));
- keyBindings->append(new KeyBinding('g', xpdfKeyModNone,
- xpdfKeyContextAny, "focusToPageNum"));
- keyBindings->append(new KeyBinding('0', xpdfKeyModNone,
- xpdfKeyContextAny, "zoomPercent(125)"));
- keyBindings->append(new KeyBinding('+', xpdfKeyModNone,
- xpdfKeyContextAny, "zoomIn"));
- keyBindings->append(new KeyBinding('-', xpdfKeyModNone,
- xpdfKeyContextAny, "zoomOut"));
- keyBindings->append(new KeyBinding('z', xpdfKeyModNone,
- xpdfKeyContextAny, "zoomFitPage"));
- keyBindings->append(new KeyBinding('w', xpdfKeyModNone,
- xpdfKeyContextAny, "zoomFitWidth"));
- keyBindings->append(new KeyBinding('f', xpdfKeyModAlt,
- xpdfKeyContextAny,
- "toggleFullScreenMode"));
- keyBindings->append(new KeyBinding('l', xpdfKeyModCtrl,
- xpdfKeyContextAny, "redraw"));
- keyBindings->append(new KeyBinding('w', xpdfKeyModCtrl,
- xpdfKeyContextAny, "closeWindow"));
- keyBindings->append(new KeyBinding('?', xpdfKeyModNone,
- xpdfKeyContextAny, "about"));
- keyBindings->append(new KeyBinding('q', xpdfKeyModNone,
- xpdfKeyContextAny, "quit"));
- keyBindings->append(new KeyBinding('Q', xpdfKeyModNone,
- xpdfKeyContextAny, "quit"));
-}
-
-void GlobalParams::parseFile(GString *fileName, FILE *f) {
- int line;
- char buf[512];
-
- line = 1;
- while (getLine(buf, sizeof(buf) - 1, f)) {
- parseLine(buf, fileName, line);
- ++line;
- }
-}
-
-void GlobalParams::parseLine(char *buf, GString *fileName, int line) {
- GList *tokens;
- GString *cmd, *incFile;
- char *p1, *p2;
- FILE *f2;
-
- // break the line into tokens
- tokens = new GList();
- p1 = buf;
- while (*p1) {
- for (; *p1 && isspace(*p1); ++p1) ;
- if (!*p1) {
- break;
- }
- if (*p1 == '"' || *p1 == '\'') {
- for (p2 = p1 + 1; *p2 && *p2 != *p1; ++p2) ;
- ++p1;
- } else {
- for (p2 = p1 + 1; *p2 && !isspace(*p2); ++p2) ;
- }
- tokens->append(new GString(p1, p2 - p1));
- p1 = *p2 ? p2 + 1 : p2;
- }
-
- // parse the line
- if (tokens->getLength() > 0 &&
- ((GString *)tokens->get(0))->getChar(0) != '#') {
- cmd = (GString *)tokens->get(0);
- if (!cmd->cmp("include")) {
- if (tokens->getLength() == 2) {
- incFile = (GString *)tokens->get(1);
- if ((f2 = fopen(incFile->getCString(), "r"))) {
- parseFile(incFile, f2);
- fclose(f2);
- } else {
- error(-1, "Couldn't find included config file: '%s' (%s:%d)",
- incFile->getCString(), fileName->getCString(), line);
- }
- } else {
- error(-1, "Bad 'include' config file command (%s:%d)",
- fileName->getCString(), line);
- }
- } else if (!cmd->cmp("nameToUnicode")) {
- parseNameToUnicode(tokens, fileName, line);
- } else if (!cmd->cmp("cidToUnicode")) {
- parseCIDToUnicode(tokens, fileName, line);
- } else if (!cmd->cmp("unicodeToUnicode")) {
- parseUnicodeToUnicode(tokens, fileName, line);
- } else if (!cmd->cmp("unicodeMap")) {
- parseUnicodeMap(tokens, fileName, line);
- } else if (!cmd->cmp("cMapDir")) {
- parseCMapDir(tokens, fileName, line);
- } else if (!cmd->cmp("toUnicodeDir")) {
- parseToUnicodeDir(tokens, fileName, line);
- } else if (!cmd->cmp("displayFontT1")) {
- parseDisplayFont(tokens, displayFonts, displayFontT1, fileName, line);
- } else if (!cmd->cmp("displayFontTT")) {
- parseDisplayFont(tokens, displayFonts, displayFontTT, fileName, line);
- } else if (!cmd->cmp("displayNamedCIDFontT1")) {
- parseDisplayFont(tokens, displayNamedCIDFonts,
- displayFontT1, fileName, line);
- } else if (!cmd->cmp("displayCIDFontT1")) {
- parseDisplayFont(tokens, displayCIDFonts,
- displayFontT1, fileName, line);
- } else if (!cmd->cmp("displayNamedCIDFontTT")) {
- parseDisplayFont(tokens, displayNamedCIDFonts,
- displayFontTT, fileName, line);
- } else if (!cmd->cmp("displayCIDFontTT")) {
- parseDisplayFont(tokens, displayCIDFonts,
- displayFontTT, fileName, line);
- } else if (!cmd->cmp("psFile")) {
- parsePSFile(tokens, fileName, line);
- } else if (!cmd->cmp("psFont")) {
- parsePSFont(tokens, fileName, line);
- } else if (!cmd->cmp("psNamedFont16")) {
- parsePSFont16("psNamedFont16", psNamedFonts16,
- tokens, fileName, line);
- } else if (!cmd->cmp("psFont16")) {
- parsePSFont16("psFont16", psFonts16, tokens, fileName, line);
- } else if (!cmd->cmp("psPaperSize")) {
- parsePSPaperSize(tokens, fileName, line);
- } else if (!cmd->cmp("psImageableArea")) {
- parsePSImageableArea(tokens, fileName, line);
- } else if (!cmd->cmp("psCrop")) {
- parseYesNo("psCrop", &psCrop, tokens, fileName, line);
- } else if (!cmd->cmp("psExpandSmaller")) {
- parseYesNo("psExpandSmaller", &psExpandSmaller,
- tokens, fileName, line);
- } else if (!cmd->cmp("psShrinkLarger")) {
- parseYesNo("psShrinkLarger", &psShrinkLarger, tokens, fileName, line);
- } else if (!cmd->cmp("psCenter")) {
- parseYesNo("psCenter", &psCenter, tokens, fileName, line);
- } else if (!cmd->cmp("psDuplex")) {
- parseYesNo("psDuplex", &psDuplex, tokens, fileName, line);
- } else if (!cmd->cmp("psLevel")) {
- parsePSLevel(tokens, fileName, line);
- } else if (!cmd->cmp("psEmbedType1Fonts")) {
- parseYesNo("psEmbedType1", &psEmbedType1, tokens, fileName, line);
- } else if (!cmd->cmp("psEmbedTrueTypeFonts")) {
- parseYesNo("psEmbedTrueType", &psEmbedTrueType,
- tokens, fileName, line);
- } else if (!cmd->cmp("psEmbedCIDPostScriptFonts")) {
- parseYesNo("psEmbedCIDPostScript", &psEmbedCIDPostScript,
- tokens, fileName, line);
- } else if (!cmd->cmp("psEmbedCIDTrueTypeFonts")) {
- parseYesNo("psEmbedCIDTrueType", &psEmbedCIDTrueType,
- tokens, fileName, line);
- } else if (!cmd->cmp("psPreload")) {
- parseYesNo("psPreload", &psPreload, tokens, fileName, line);
- } else if (!cmd->cmp("psOPI")) {
- parseYesNo("psOPI", &psOPI, tokens, fileName, line);
- } else if (!cmd->cmp("psASCIIHex")) {
- parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
- } else if (!cmd->cmp("textEncoding")) {
-// Always use UTF-8 and allow TQString do the magic
-// parseTextEncoding(tokens, fileName, line);
- } else if (!cmd->cmp("textEOL")) {
- parseTextEOL(tokens, fileName, line);
- } else if (!cmd->cmp("textPageBreaks")) {
- parseYesNo("textPageBreaks", &textPageBreaks,
- tokens, fileName, line);
- } else if (!cmd->cmp("textKeepTinyChars")) {
- parseYesNo("textKeepTinyChars", &textKeepTinyChars,
- tokens, fileName, line);
- } else if (!cmd->cmp("fontDir")) {
- parseFontDir(tokens, fileName, line);
- } else if (!cmd->cmp("initialZoom")) {
- parseInitialZoom(tokens, fileName, line);
- } else if (!cmd->cmp("continuousView")) {
- parseYesNo("continuousView", &continuousView, tokens, fileName, line);
- } else if (!cmd->cmp("enableT1lib")) {
- parseYesNo("enableT1lib", &enableT1lib, tokens, fileName, line);
- } else if (!cmd->cmp("enableFreeType")) {
- parseYesNo("enableFreeType", &enableFreeType, tokens, fileName, line);
- } else if (!cmd->cmp("antialias")) {
- parseYesNo("antialias", &antialias, tokens, fileName, line);
- } else if (!cmd->cmp("vectorAntialias")) {
- parseYesNo("vectorAntialias", &vectorAntialias,
- tokens, fileName, line);
- } else if (!cmd->cmp("strokeAdjust")) {
- parseYesNo("strokeAdjust", &strokeAdjust, tokens, fileName, line);
- } else if (!cmd->cmp("screenType")) {
- parseScreenType(tokens, fileName, line);
- } else if (!cmd->cmp("screenSize")) {
- parseInteger("screenSize", &screenSize, tokens, fileName, line);
- } else if (!cmd->cmp("screenDotRadius")) {
- parseInteger("screenDotRadius", &screenDotRadius,
- tokens, fileName, line);
- } else if (!cmd->cmp("screenGamma")) {
- parseFloat("screenGamma", &screenGamma,
- tokens, fileName, line);
- } else if (!cmd->cmp("screenBlackThreshold")) {
- parseFloat("screenBlackThreshold", &screenBlackThreshold,
- tokens, fileName, line);
- } else if (!cmd->cmp("screenWhiteThreshold")) {
- parseFloat("screenWhiteThreshold", &screenWhiteThreshold,
- tokens, fileName, line);
- } else if (!cmd->cmp("urlCommand")) {
- parseCommand("urlCommand", &urlCommand, tokens, fileName, line);
- } else if (!cmd->cmp("movieCommand")) {
- parseCommand("movieCommand", &movieCommand, tokens, fileName, line);
- } else if (!cmd->cmp("mapNumericCharNames")) {
- parseYesNo("mapNumericCharNames", &mapNumericCharNames,
- tokens, fileName, line);
- } else if (!cmd->cmp("mapUnknownCharNames")) {
- parseYesNo("mapUnknownCharNames", &mapUnknownCharNames,
- tokens, fileName, line);
- } else if (!cmd->cmp("bind")) {
- parseBind(tokens, fileName, line);
- } else if (!cmd->cmp("unbind")) {
- parseUnbind(tokens, fileName, line);
- } else if (!cmd->cmp("printCommands")) {
- parseYesNo("printCommands", &printCommands, tokens, fileName, line);
- } else if (!cmd->cmp("errQuiet")) {
- parseYesNo("errQuiet", &errQuiet, tokens, fileName, line);
- } else {
- error(-1, "Unknown config file command '%s' (%s:%d)",
- cmd->getCString(), fileName->getCString(), line);
- if (!cmd->cmp("displayFontX") ||
- !cmd->cmp("displayNamedCIDFontX") ||
- !cmd->cmp("displayCIDFontX")) {
- error(-1, "-- Xpdf no longer supports X fonts");
- } else if (!cmd->cmp("t1libControl") || !cmd->cmp("freetypeControl")) {
- error(-1, "-- The t1libControl and freetypeControl options have been replaced");
- error(-1, " by the enableT1lib, enableFreeType, and antialias options");
- } else if (!cmd->cmp("fontpath") || !cmd->cmp("fontmap")) {
- error(-1, "-- the config file format has changed since Xpdf 0.9x");
- }
- }
- }
-
- deleteGList(tokens, GString);
-}
-
-void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
- int line) {
- GString *name;
- char *tok1, *tok2;
- FILE *f;
- char buf[256];
- int line2;
- Unicode u;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'nameToUnicode' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- name = (GString *)tokens->get(1);
- if (!(f = fopen(name->getCString(), "r"))) {
- error(-1, "Couldn't open 'nameToUnicode' file '%s'",
- name->getCString());
- return;
- }
- line2 = 1;
- while (getLine(buf, sizeof(buf), f)) {
- tok1 = strtok(buf, " \t\r\n");
- tok2 = strtok(NULL, " \t\r\n");
- if (tok1 && tok2) {
- sscanf(tok1, "%x", &u);
- nameToUnicode->add(tok2, u);
- } else {
- error(-1, "Bad line in 'nameToUnicode' file (%s:%d)", name, line2);
- }
- ++line2;
- }
- fclose(f);
-}
-
-void GlobalParams::parseCIDToUnicode(GList *tokens, GString *fileName,
- int line) {
- GString *collection, *name, *old;
-
- if (tokens->getLength() != 3) {
- error(-1, "Bad 'cidToUnicode' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- collection = (GString *)tokens->get(1);
- name = (GString *)tokens->get(2);
- if ((old = (GString *)cidToUnicodes->remove(collection))) {
- delete old;
- }
- cidToUnicodes->add(collection->copy(), name->copy());
-}
-
-void GlobalParams::parseUnicodeToUnicode(GList *tokens, GString *fileName,
- int line) {
- GString *font, *file, *old;
-
- if (tokens->getLength() != 3) {
- error(-1, "Bad 'unicodeToUnicode' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- font = (GString *)tokens->get(1);
- file = (GString *)tokens->get(2);
- if ((old = (GString *)unicodeToUnicodes->remove(font))) {
- delete old;
- }
- unicodeToUnicodes->add(font->copy(), file->copy());
-}
-
-void GlobalParams::parseUnicodeMap(GList *tokens, GString *fileName,
- int line) {
- GString *encodingName, *name, *old;
-
- if (tokens->getLength() != 3) {
- error(-1, "Bad 'unicodeMap' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- encodingName = (GString *)tokens->get(1);
- name = (GString *)tokens->get(2);
- if ((old = (GString *)unicodeMaps->remove(encodingName))) {
- delete old;
- }
- unicodeMaps->add(encodingName->copy(), name->copy());
-}
-
-void GlobalParams::parseCMapDir(GList *tokens, GString *fileName, int line) {
- GString *collection, *dir;
- GList *list;
-
- if (tokens->getLength() != 3) {
- error(-1, "Bad 'cMapDir' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- collection = (GString *)tokens->get(1);
- dir = (GString *)tokens->get(2);
- if (!(list = (GList *)cMapDirs->lookup(collection))) {
- list = new GList();
- cMapDirs->add(collection->copy(), list);
- }
- list->append(dir->copy());
-}
-
-void GlobalParams::parseToUnicodeDir(GList *tokens, GString *fileName,
- int line) {
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'toUnicodeDir' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
-}
-
-void GlobalParams::parseDisplayFont(GList *tokens, GHash *fontHash,
- DisplayFontParamKind kind,
- GString *fileName, int line) {
- DisplayFontParam *param, *old;
- struct stat statbuf;
-
- if (tokens->getLength() < 2) {
- goto err1;
- }
- param = new DisplayFontParam(((GString *)tokens->get(1))->copy(), kind);
-
- switch (kind) {
- case displayFontT1:
- if (tokens->getLength() != 3) {
- goto err2;
- }
- param->t1.fileName = ((GString *)tokens->get(2))->copy();
- if (stat((param->t1.fileName->getCString)(), &statbuf)) {
- delete param; // silently ignore non-existing files
- return;
- }
- break;
- case displayFontTT:
- if (tokens->getLength() < 3) {
- goto err2;
- }
- param->tt.fileName = ((GString *)tokens->get(2))->copy();
- if (stat((param->tt.fileName->getCString)(), &statbuf)) {
- delete param; // silently ignore non-existing files
- return;
- }
- if (tokens->getLength() > 3)
- param->tt.faceIndex = atoi(((GString *)tokens->get(3))->getCString());
- else
- param->tt.faceIndex = 0;
- break;
- }
-
- if ((old = (DisplayFontParam *)fontHash->remove(param->name))) {
- delete old;
- }
- fontHash->add(param->name, param);
- return;
-
- err2:
- delete param;
- err1:
- error(-1, "Bad 'display*Font*' config file command (%s:%d)",
- fileName->getCString(), line);
-}
-
-void GlobalParams::parsePSPaperSize(GList *tokens, GString *fileName,
- int line) {
- GString *tok;
-
- if (tokens->getLength() == 2) {
- tok = (GString *)tokens->get(1);
- if (!setPSPaperSize(tok->getCString())) {
- error(-1, "Bad 'psPaperSize' config file command (%s:%d)",
- fileName->getCString(), line);
- }
- } else if (tokens->getLength() == 3) {
- tok = (GString *)tokens->get(1);
- psPaperWidth = atoi(tok->getCString());
- tok = (GString *)tokens->get(2);
- psPaperHeight = atoi(tok->getCString());
- psImageableLLX = psImageableLLY = 0;
- psImageableURX = psPaperWidth;
- psImageableURY = psPaperHeight;
- } else {
- error(-1, "Bad 'psPaperSize' config file command (%s:%d)",
- fileName->getCString(), line);
- }
-}
-
-void GlobalParams::parsePSImageableArea(GList *tokens, GString *fileName,
- int line) {
- if (tokens->getLength() != 5) {
- error(-1, "Bad 'psImageableArea' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- psImageableLLX = atoi(((GString *)tokens->get(1))->getCString());
- psImageableLLY = atoi(((GString *)tokens->get(2))->getCString());
- psImageableURX = atoi(((GString *)tokens->get(3))->getCString());
- psImageableURY = atoi(((GString *)tokens->get(4))->getCString());
-}
-
-void GlobalParams::parsePSLevel(GList *tokens, GString *fileName, int line) {
- GString *tok;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'psLevel' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(1);
- if (!tok->cmp("level1")) {
- psLevel = psLevel1;
- } else if (!tok->cmp("level1sep")) {
- psLevel = psLevel1Sep;
- } else if (!tok->cmp("level2")) {
- psLevel = psLevel2;
- } else if (!tok->cmp("level2sep")) {
- psLevel = psLevel2Sep;
- } else if (!tok->cmp("level3")) {
- psLevel = psLevel3;
- } else if (!tok->cmp("level3Sep")) {
- psLevel = psLevel3Sep;
- } else {
- error(-1, "Bad 'psLevel' config file command (%s:%d)",
- fileName->getCString(), line);
- }
-}
-
-void GlobalParams::parsePSFile(GList *tokens, GString *fileName, int line) {
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'psFile' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- if (psFile) {
- delete psFile;
- }
- psFile = ((GString *)tokens->get(1))->copy();
-}
-
-void GlobalParams::parsePSFont(GList *tokens, GString *fileName, int line) {
- PSFontParam *param;
-
- if (tokens->getLength() != 3) {
- error(-1, "Bad 'psFont' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- param = new PSFontParam(((GString *)tokens->get(1))->copy(), 0,
- ((GString *)tokens->get(2))->copy(), NULL);
- psFonts->add(param->pdfFontName, param);
-}
-
-void GlobalParams::parsePSFont16(char *cmdName, GList *fontList,
- GList *tokens, GString *fileName, int line) {
- PSFontParam *param;
- int wMode;
- GString *tok;
-
- if (tokens->getLength() != 5) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(2);
- if (!tok->cmp("H")) {
- wMode = 0;
- } else if (!tok->cmp("V")) {
- wMode = 1;
- } else {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- param = new PSFontParam(((GString *)tokens->get(1))->copy(),
- wMode,
- ((GString *)tokens->get(3))->copy(),
- ((GString *)tokens->get(4))->copy());
- fontList->append(param);
-}
-
-void GlobalParams::parseTextEncoding(GList *tokens, GString *fileName,
- int line) {
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'textEncoding' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- delete textEncoding;
- textEncoding = ((GString *)tokens->get(1))->copy();
-}
-
-void GlobalParams::parseTextEOL(GList *tokens, GString *fileName, int line) {
- GString *tok;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'textEOL' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(1);
- if (!tok->cmp("unix")) {
- textEOL = eolUnix;
- } else if (!tok->cmp("dos")) {
- textEOL = eolDOS;
- } else if (!tok->cmp("mac")) {
- textEOL = eolMac;
- } else {
- error(-1, "Bad 'textEOL' config file command (%s:%d)",
- fileName->getCString(), line);
- }
-}
-
-void GlobalParams::parseFontDir(GList *tokens, GString *fileName, int line) {
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'fontDir' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- fontDirs->append(((GString *)tokens->get(1))->copy());
-}
-
-void GlobalParams::parseInitialZoom(GList *tokens,
- GString *fileName, int line) {
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'initialZoom' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- delete initialZoom;
- initialZoom = ((GString *)tokens->get(1))->copy();
-}
-
-void GlobalParams::parseScreenType(GList *tokens, GString *fileName,
- int line) {
- GString *tok;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad 'screenType' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(1);
- if (!tok->cmp("dispersed")) {
- screenType = screenDispersed;
- } else if (!tok->cmp("clustered")) {
- screenType = screenClustered;
- } else if (!tok->cmp("stochasticClustered")) {
- screenType = screenStochasticClustered;
- } else {
- error(-1, "Bad 'screenType' config file command (%s:%d)",
- fileName->getCString(), line);
- }
-}
-
-void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) {
- KeyBinding *binding;
- GList *cmds;
- int code, mods, context, i;
-
- if (tokens->getLength() < 4) {
- error(-1, "Bad 'bind' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- if (!parseKey((GString *)tokens->get(1), (GString *)tokens->get(2),
- &code, &mods, &context,
- "bind", tokens, fileName, line)) {
- return;
- }
- for (i = 0; i < keyBindings->getLength(); ++i) {
- binding = (KeyBinding *)keyBindings->get(i);
- if (binding->code == code &&
- binding->mods == mods &&
- binding->context == context) {
- delete (KeyBinding *)keyBindings->del(i);
- break;
- }
- }
- cmds = new GList();
- for (i = 3; i < tokens->getLength(); ++i) {
- cmds->append(((GString *)tokens->get(i))->copy());
- }
- keyBindings->append(new KeyBinding(code, mods, context, cmds));
-}
-
-void GlobalParams::parseUnbind(GList *tokens, GString *fileName, int line) {
- KeyBinding *binding;
- int code, mods, context, i;
-
- if (tokens->getLength() != 3) {
- error(-1, "Bad 'unbind' config file command (%s:%d)",
- fileName->getCString(), line);
- return;
- }
- if (!parseKey((GString *)tokens->get(1), (GString *)tokens->get(2),
- &code, &mods, &context,
- "unbind", tokens, fileName, line)) {
- return;
- }
- for (i = 0; i < keyBindings->getLength(); ++i) {
- binding = (KeyBinding *)keyBindings->get(i);
- if (binding->code == code &&
- binding->mods == mods &&
- binding->context == context) {
- delete (KeyBinding *)keyBindings->del(i);
- break;
- }
- }
-}
-
-GBool GlobalParams::parseKey(GString *modKeyStr, GString *contextStr,
- int *code, int *mods, int *context,
- char *cmdName,
- GList * /*tokens*/, GString *fileName, int line) {
- char *p0;
-
- *mods = xpdfKeyModNone;
- p0 = modKeyStr->getCString();
- while (1) {
- if (!strncmp(p0, "shift-", 6)) {
- *mods |= xpdfKeyModShift;
- p0 += 6;
- } else if (!strncmp(p0, "ctrl-", 5)) {
- *mods |= xpdfKeyModCtrl;
- p0 += 5;
- } else if (!strncmp(p0, "alt-", 4)) {
- *mods |= xpdfKeyModAlt;
- p0 += 4;
- } else {
- break;
- }
- }
-
- if (!strcmp(p0, "space")) {
- *code = ' ';
- } else if (!strcmp(p0, "tab")) {
- *code = xpdfKeyCodeTab;
- } else if (!strcmp(p0, "return")) {
- *code = xpdfKeyCodeReturn;
- } else if (!strcmp(p0, "enter")) {
- *code = xpdfKeyCodeEnter;
- } else if (!strcmp(p0, "backspace")) {
- *code = xpdfKeyCodeBackspace;
- } else if (!strcmp(p0, "insert")) {
- *code = xpdfKeyCodeInsert;
- } else if (!strcmp(p0, "delete")) {
- *code = xpdfKeyCodeDelete;
- } else if (!strcmp(p0, "home")) {
- *code = xpdfKeyCodeHome;
- } else if (!strcmp(p0, "end")) {
- *code = xpdfKeyCodeEnd;
- } else if (!strcmp(p0, "pgup")) {
- *code = xpdfKeyCodePgUp;
- } else if (!strcmp(p0, "pgdn")) {
- *code = xpdfKeyCodePgDn;
- } else if (!strcmp(p0, "left")) {
- *code = xpdfKeyCodeLeft;
- } else if (!strcmp(p0, "right")) {
- *code = xpdfKeyCodeRight;
- } else if (!strcmp(p0, "up")) {
- *code = xpdfKeyCodeUp;
- } else if (!strcmp(p0, "down")) {
- *code = xpdfKeyCodeDown;
- } else if (p0[0] == 'f' && p0[1] >= '1' && p0[1] <= '9' && !p0[2]) {
- *code = xpdfKeyCodeF1 + (p0[1] - '1');
- } else if (p0[0] == 'f' &&
- ((p0[1] >= '1' && p0[1] <= '2' && p0[2] >= '0' && p0[2] <= '9') ||
- (p0[1] == '3' && p0[2] >= '0' && p0[2] <= '5')) &&
- !p0[3]) {
- *code = xpdfKeyCodeF1 + 10 * (p0[1] - '0') + (p0[2] - '0') - 1;
- } else if (!strncmp(p0, "mousePress", 10) &&
- p0[10] >= '1' && p0[10] <= '7' && !p0[11]) {
- *code = xpdfKeyCodeMousePress1 + (p0[10] - '1');
- } else if (!strncmp(p0, "mouseRelease", 12) &&
- p0[12] >= '1' && p0[12] <= '7' && !p0[13]) {
- *code = xpdfKeyCodeMouseRelease1 + (p0[12] - '1');
- } else if (*p0 >= 0x20 && *p0 <= 0x7e && !p0[1]) {
- *code = (int)*p0;
- } else {
- error(-1, "Bad key/modifier in '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return gFalse;
- }
-
- p0 = contextStr->getCString();
- if (!strcmp(p0, "any")) {
- *context = xpdfKeyContextAny;
- } else {
- *context = xpdfKeyContextAny;
- while (1) {
- if (!strncmp(p0, "fullScreen", 10)) {
- *context |= xpdfKeyContextFullScreen;
- p0 += 10;
- } else if (!strncmp(p0, "window", 6)) {
- *context |= xpdfKeyContextWindow;
- p0 += 6;
- } else if (!strncmp(p0, "continuous", 10)) {
- *context |= xpdfKeyContextContinuous;
- p0 += 10;
- } else if (!strncmp(p0, "singlePage", 10)) {
- *context |= xpdfKeyContextSinglePage;
- p0 += 10;
- } else if (!strncmp(p0, "overLink", 8)) {
- *context |= xpdfKeyContextOverLink;
- p0 += 8;
- } else if (!strncmp(p0, "offLink", 7)) {
- *context |= xpdfKeyContextOffLink;
- p0 += 7;
- } else if (!strncmp(p0, "outline", 7)) {
- *context |= xpdfKeyContextOutline;
- p0 += 7;
- } else if (!strncmp(p0, "mainWin", 7)) {
- *context |= xpdfKeyContextMainWin;
- p0 += 7;
- } else if (!strncmp(p0, "scrLockOn", 9)) {
- *context |= xpdfKeyContextScrLockOn;
- p0 += 9;
- } else if (!strncmp(p0, "scrLockOff", 10)) {
- *context |= xpdfKeyContextScrLockOff;
- p0 += 10;
- } else {
- error(-1, "Bad context in '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return gFalse;
- }
- if (!*p0) {
- break;
- }
- if (*p0 != ',') {
- error(-1, "Bad context in '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return gFalse;
- }
- ++p0;
- }
- }
-
- return gTrue;
-}
-
-void GlobalParams::parseCommand(char *cmdName, GString **val,
- GList *tokens, GString *fileName, int line) {
- if (tokens->getLength() != 2) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- if (*val) {
- delete *val;
- }
- *val = ((GString *)tokens->get(1))->copy();
-}
-
-void GlobalParams::parseYesNo(char *cmdName, GBool *flag,
- GList *tokens, GString *fileName, int line) {
- GString *tok;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(1);
- if (!parseYesNo2(tok->getCString(), flag)) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- }
-}
-
-GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
- if (!strcmp(token, "yes")) {
- *flag = gTrue;
- } else if (!strcmp(token, "no")) {
- *flag = gFalse;
- } else {
- return gFalse;
- }
- return gTrue;
-}
-
-void GlobalParams::parseInteger(char *cmdName, int *val,
- GList *tokens, GString *fileName, int line) {
- GString *tok;
- int i;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(1);
- if (tok->getLength() == 0) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- if (tok->getChar(0) == '-') {
- i = 1;
- } else {
- i = 0;
- }
- for (; i < tok->getLength(); ++i) {
- if (tok->getChar(i) < '0' || tok->getChar(i) > '9') {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- }
- *val = atoi(tok->getCString());
-}
-
-void GlobalParams::parseFloat(char *cmdName, double *val,
- GList *tokens, GString *fileName, int line) {
- GString *tok;
- int i;
-
- if (tokens->getLength() != 2) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- tok = (GString *)tokens->get(1);
- if (tok->getLength() == 0) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- if (tok->getChar(0) == '-') {
- i = 1;
- } else {
- i = 0;
- }
- for (; i < tok->getLength(); ++i) {
- if (!((tok->getChar(i) >= '0' && tok->getChar(i) <= '9') ||
- tok->getChar(i) == '.')) {
- error(-1, "Bad '%s' config file command (%s:%d)",
- cmdName, fileName->getCString(), line);
- return;
- }
- }
- *val = atof(tok->getCString());
-}
-
-GlobalParams::~GlobalParams() {
- GHashIter *iter;
- GString *key;
- GList *list;
-
- freeBuiltinFontTables();
-
- delete macRomanReverseMap;
-
- delete baseDir;
- delete nameToUnicode;
- deleteGHash(cidToUnicodes, GString);
- deleteGHash(unicodeToUnicodes, GString);
- deleteGHash(residentUnicodeMaps, UnicodeMap);
- deleteGHash(unicodeMaps, GString);
- deleteGList(toUnicodeDirs, GString);
- deleteGHash(displayFonts, DisplayFontParam);
- deleteGHash(displayCIDFonts, DisplayFontParam);
- deleteGHash(displayNamedCIDFonts, DisplayFontParam);
-#ifdef WIN32
- if (winFontList) {
- delete winFontList;
- }
-#endif
- if (psFile) {
- delete psFile;
- }
- deleteGHash(psFonts, PSFontParam);
- deleteGList(psNamedFonts16, PSFontParam);
- deleteGList(psFonts16, PSFontParam);
- delete textEncoding;
- deleteGList(fontDirs, GString);
- delete initialZoom;
- if (urlCommand) {
- delete urlCommand;
- }
- if (movieCommand) {
- delete movieCommand;
- }
- deleteGList(keyBindings, KeyBinding);
-
- cMapDirs->startIter(&iter);
- while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
- deleteGList(list, GString);
- }
- delete cMapDirs;
-
- delete cidToUnicodeCache;
- delete unicodeToUnicodeCache;
- delete unicodeMapCache;
- delete cMapCache;
-
-#ifdef ENABLE_PLUGINS
- delete securityHandlers;
- deleteGList(plugins, Plugin);
-#endif
-
-#if MULTITHREADED
- gDestroyMutex(&mutex);
- gDestroyMutex(&unicodeMapCacheMutex);
- gDestroyMutex(&cMapCacheMutex);
-#endif
-}
-
-//------------------------------------------------------------------------
-
-void GlobalParams::setBaseDir(char *dir) {
- delete baseDir;
- baseDir = new GString(dir);
-}
-
-void GlobalParams::setupBaseFonts(char *dir) {
- GString *fontName;
- GString *fileName;
-#ifdef WIN32
- HMODULE shell32Lib;
- BOOL (__stdcall *SHGetSpecialFolderPathFunc)(HWND hwndOwner,
- LPTSTR lpszPath,
- int nFolder,
- BOOL fCreate);
- char winFontDir[MAX_PATH];
-#endif
- FILE *f;
- DisplayFontParamKind kind;
- DisplayFontParam *dfp;
- int i, j;
-
-#ifdef WIN32
- // SHGetSpecialFolderPath isn't available in older versions of
- // shell32.dll (Win95 and WinNT4), so do a dynamic load
- winFontDir[0] = '\0';
- if ((shell32Lib = LoadLibrary("shell32.dll"))) {
- if ((SHGetSpecialFolderPathFunc =
- (BOOL (__stdcall *)(HWND hwndOwner, LPTSTR lpszPath,
- int nFolder, BOOL fCreate))
- GetProcAddress(shell32Lib, "SHGetSpecialFolderPathA"))) {
- if (!(*SHGetSpecialFolderPathFunc)(NULL, winFontDir,
- CSIDL_FONTS, FALSE)) {
- winFontDir[0] = '\0';
- }
- }
- }
-#endif
- for (i = 0; displayFontTab[i].name; ++i) {
- fontName = new GString(displayFontTab[i].name);
- fileName = NULL;
- kind = displayFontT1; // make gcc happy
- if (dir) {
- fileName = appendToPath(new GString(dir), displayFontTab[i].t1FileName);
- kind = displayFontT1;
- if ((f = fopen(fileName->getCString(), "rb"))) {
- fclose(f);
- } else {
- delete fileName;
- fileName = NULL;
- }
- }
-#ifdef WIN32
- if (!fileName && winFontDir[0] && displayFontTab[i].ttFileName) {
- fileName = appendToPath(new GString(winFontDir),
- displayFontTab[i].ttFileName);
- kind = displayFontTT;
- if ((f = fopen(fileName->getCString(), "rb"))) {
- fclose(f);
- } else {
- delete fileName;
- fileName = NULL;
- }
- }
- // SHGetSpecialFolderPath(CSIDL_FONTS) doesn't work on Win 2k Server
- // or Win2003 Server, or with older versions of shell32.dll, so check
- // the "standard" directories
- if (displayFontTab[i].ttFileName) {
- for (j = 0; !fileName && displayFontDirs[j]; ++j) {
- fileName = appendToPath(new GString(displayFontDirs[j]),
- displayFontTab[i].ttFileName);
- kind = displayFontTT;
- if ((f = fopen(fileName->getCString(), "rb"))) {
- fclose(f);
- } else {
- delete fileName;
- fileName = NULL;
- }
- }
- }
-#else
- for (j = 0; !fileName && displayFontDirs[j]; ++j) {
- fileName = appendToPath(new GString(displayFontDirs[j]),
- displayFontTab[i].t1FileName);
- kind = displayFontT1;
- if ((f = fopen(fileName->getCString(), "rb"))) {
- fclose(f);
- } else {
- delete fileName;
- fileName = NULL;
- }
- }
-#endif
- if (!fileName) {
- error(-1, "No display font for '%s'", displayFontTab[i].name);
- delete fontName;
- continue;
- }
- dfp = new DisplayFontParam(fontName, kind);
- dfp->t1.fileName = fileName;
- globalParams->addDisplayFont(dfp);
- }
-
-#ifdef WIN32
- if (winFontDir[0]) {
- winFontList = new WinFontList(winFontDir);
- }
-#endif
-}
-
-//------------------------------------------------------------------------
-// accessors
-//------------------------------------------------------------------------
-
-CharCode GlobalParams::getMacRomanCharCode(char *charName) {
- // no need to lock - macRomanReverseMap is constant
- return macRomanReverseMap->lookup(charName);
-}
-
-GString *GlobalParams::getBaseDir() {
- GString *s;
-
- lockGlobalParams;
- s = baseDir->copy();
- unlockGlobalParams;
- return s;
-}
-
-Unicode GlobalParams::mapNameToUnicode(char *charName) {
- // no need to lock - nameToUnicode is constant
- return nameToUnicode->lookup(charName);
-}
-
-UnicodeMap *GlobalParams::getResidentUnicodeMap(GString *encodingName) {
- UnicodeMap *map;
-
- lockGlobalParams;
- map = (UnicodeMap *)residentUnicodeMaps->lookup(encodingName);
- unlockGlobalParams;
- if (map) {
- map->incRefCnt();
- }
- return map;
-}
-
-FILE *GlobalParams::getUnicodeMapFile(GString *encodingName) {
- GString *fileName;
- FILE *f;
-
- lockGlobalParams;
- if ((fileName = (GString *)unicodeMaps->lookup(encodingName))) {
- f = fopen(fileName->getCString(), "r");
- } else {
- f = NULL;
- }
- unlockGlobalParams;
- return f;
-}
-
-FILE *GlobalParams::findCMapFile(GString *collection, GString *cMapName) {
- GList *list;
- GString *dir;
- GString *fileName;
- FILE *f;
- int i;
-
- lockGlobalParams;
- if (!(list = (GList *)cMapDirs->lookup(collection))) {
- unlockGlobalParams;
- return NULL;
- }
- for (i = 0; i < list->getLength(); ++i) {
- dir = (GString *)list->get(i);
- fileName = appendToPath(dir->copy(), cMapName->getCString());
- f = fopen(fileName->getCString(), "r");
- delete fileName;
- if (f) {
- unlockGlobalParams;
- return f;
- }
- }
- unlockGlobalParams;
- return NULL;
-}
-
-FILE *GlobalParams::findToUnicodeFile(GString *name) {
- GString *dir, *fileName;
- FILE *f;
- int i;
-
- lockGlobalParams;
- for (i = 0; i < toUnicodeDirs->getLength(); ++i) {
- dir = (GString *)toUnicodeDirs->get(i);
- fileName = appendToPath(dir->copy(), name->getCString());
- f = fopen(fileName->getCString(), "r");
- delete fileName;
- if (f) {
- unlockGlobalParams;
- return f;
- }
- }
- unlockGlobalParams;
- return NULL;
-}
-
-// KPDF: parse xpdf font name into family and style
-// Helvetica-BoldOblique => name=Helvetica, weight=Bold, slant=Oblique
-
-void parseStyle(TQString& name, int& weight, int& slant, int& width)
-{
- if (name.find("MS-") == 0) name = "MS " + name.remove(0,3);
-
- if (!name.contains('-') && !name.contains(',')) return;
- TQString type = name.section(TQRegExp("[-,]"),-1);
- name = name.section(TQRegExp("[-,]"),0,-2);
- if (type.contains("Oblique")) slant=FC_SLANT_OBLIQUE;
- if (type.contains("Italic")) slant=FC_SLANT_ITALIC;
- if (type.contains("Bold")) weight=FC_WEIGHT_BOLD;
- if (type.contains("Light")) weight=FC_WEIGHT_LIGHT;
- if (type.contains("Condensed")) width=FC_WIDTH_CONDENSED;
-}
-
-DisplayFontParam *GlobalParams::getDisplayFont(GString *fontName) {
- DisplayFontParam *dfp;
- FcPattern *p=0,*m=0;
- FcChar8* s;
- char * ext;
- FcResult res;
-
- lockGlobalParams;
- dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
- // KPDF: try to find font using Xft
- if (!dfp) {
- int weight=FC_WEIGHT_MEDIUM, slant=FC_SLANT_ROMAN, width=FC_WIDTH_NORMAL;
- TQString name(fontName->getCString());
-
- parseStyle(name,weight,slant,width);
- p = FcPatternBuild(0,FC_FAMILY,FcTypeString, name.ascii(),
- FC_SLANT, FcTypeInteger, slant, FC_WEIGHT, FcTypeInteger, weight,
- FC_WIDTH, FcTypeInteger, width, FC_LANG, FcTypeString, "xx", (char*)0);
- if (!p) goto fin;
- m = XftFontMatch(tqt_xdisplay(),tqt_xscreen(),p,&res);
- if (!m) goto fin;
- res = FcPatternGetString (m, FC_FILE, 0, &s);
- if (res != FcResultMatch || !s) goto fin;
- ext = rindex((char*)s,'.');
- if (!ext) goto fin;
- if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext,".ttc",4)) {
- dfp = new DisplayFontParam(fontName->copy(), displayFontTT);
- dfp->tt.fileName = new GString((char*)s);
- FcPatternGetInteger(m, FC_INDEX, 0, &(dfp->tt.faceIndex));
- } else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4)) {
- dfp = new DisplayFontParam(fontName->copy(), displayFontT1);
- dfp->t1.fileName = new GString((char*)s);
- } else goto fin;
- displayFonts->add(dfp->name,dfp);
- }
-fin: unlockGlobalParams;
- if (m) FcPatternDestroy(m);
- if (p) FcPatternDestroy(p);
- return dfp;
-}
-
-DisplayFontParam *GlobalParams::getDisplayCIDFont(GString *fontName,
- GString *collection) {
- DisplayFontParam *dfp;
-
- lockGlobalParams;
- if (!fontName ||
- !(dfp = (DisplayFontParam *)displayNamedCIDFonts->lookup(fontName))) {
- dfp = (DisplayFontParam *)displayCIDFonts->lookup(collection);
- }
- unlockGlobalParams;
- if (!dfp) dfp = getDisplayFont(fontName);
- return dfp;
-}
-
-GString *GlobalParams::getPSFile() {
- GString *s;
-
- lockGlobalParams;
- s = psFile ? psFile->copy() : (GString *)NULL;
- unlockGlobalParams;
- return s;
-}
-
-int GlobalParams::getPSPaperWidth() {
- int w;
-
- lockGlobalParams;
- w = psPaperWidth;
- unlockGlobalParams;
- return w;
-}
-
-int GlobalParams::getPSPaperHeight() {
- int h;
-
- lockGlobalParams;
- h = psPaperHeight;
- unlockGlobalParams;
- return h;
-}
-
-void GlobalParams::getPSImageableArea(int *llx, int *lly, int *urx, int *ury) {
- lockGlobalParams;
- *llx = psImageableLLX;
- *lly = psImageableLLY;
- *urx = psImageableURX;
- *ury = psImageableURY;
- unlockGlobalParams;
-}
-
-GBool GlobalParams::getPSCrop() {
- GBool f;
-
- lockGlobalParams;
- f = psCrop;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getPSExpandSmaller() {
- GBool f;
-
- lockGlobalParams;
- f = psExpandSmaller;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getPSShrinkLarger() {
- GBool f;
-
- lockGlobalParams;
- f = psShrinkLarger;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getPSCenter() {
- GBool f;
-
- lockGlobalParams;
- f = psCenter;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getPSDuplex() {
- GBool d;
-
- lockGlobalParams;
- d = psDuplex;
- unlockGlobalParams;
- return d;
-}
-
-PSLevel GlobalParams::getPSLevel() {
- PSLevel level;
-
- lockGlobalParams;
- level = psLevel;
- unlockGlobalParams;
- return level;
-}
-
-PSFontParam *GlobalParams::getPSFont(GString *fontName) {
- PSFontParam *p;
-
- lockGlobalParams;
- p = (PSFontParam *)psFonts->lookup(fontName);
- unlockGlobalParams;
- return p;
-}
-
-PSFontParam *GlobalParams::getPSFont16(GString *fontName,
- GString *collection, int wMode) {
- PSFontParam *p;
- int i;
-
- lockGlobalParams;
- p = NULL;
- if (fontName) {
- for (i = 0; i < psNamedFonts16->getLength(); ++i) {
- p = (PSFontParam *)psNamedFonts16->get(i);
- if (!p->pdfFontName->cmp(fontName) &&
- p->wMode == wMode) {
- break;
- }
- p = NULL;
- }
- }
- if (!p && collection) {
- for (i = 0; i < psFonts16->getLength(); ++i) {
- p = (PSFontParam *)psFonts16->get(i);
- if (!p->pdfFontName->cmp(collection) &&
- p->wMode == wMode) {
- break;
- }
- p = NULL;
- }
- }
- unlockGlobalParams;
- return p;
-}
-
-GBool GlobalParams::getPSEmbedType1() {
- GBool e;
-
- lockGlobalParams;
- e = psEmbedType1;
- unlockGlobalParams;
- return e;
-}
-
-GBool GlobalParams::getPSEmbedTrueType() {
- GBool e;
-
- lockGlobalParams;
- e = psEmbedTrueType;
- unlockGlobalParams;
- return e;
-}
-
-GBool GlobalParams::getPSEmbedCIDPostScript() {
- GBool e;
-
- lockGlobalParams;
- e = psEmbedCIDPostScript;
- unlockGlobalParams;
- return e;
-}
-
-GBool GlobalParams::getPSEmbedCIDTrueType() {
- GBool e;
-
- lockGlobalParams;
- e = psEmbedCIDTrueType;
- unlockGlobalParams;
- return e;
-}
-
-GBool GlobalParams::getPSPreload() {
- GBool preload;
-
- lockGlobalParams;
- preload = psPreload;
- unlockGlobalParams;
- return preload;
-}
-
-GBool GlobalParams::getPSOPI() {
- GBool opi;
-
- lockGlobalParams;
- opi = psOPI;
- unlockGlobalParams;
- return opi;
-}
-
-GBool GlobalParams::getPSASCIIHex() {
- GBool ah;
-
- lockGlobalParams;
- ah = psASCIIHex;
- unlockGlobalParams;
- return ah;
-}
-
-GString *GlobalParams::getTextEncodingName() {
- GString *s;
-
- lockGlobalParams;
- s = textEncoding->copy();
- unlockGlobalParams;
- return s;
-}
-
-EndOfLineKind GlobalParams::getTextEOL() {
- EndOfLineKind eol;
-
- lockGlobalParams;
- eol = textEOL;
- unlockGlobalParams;
- return eol;
-}
-
-GBool GlobalParams::getTextPageBreaks() {
- GBool pageBreaks;
-
- lockGlobalParams;
- pageBreaks = textPageBreaks;
- unlockGlobalParams;
- return pageBreaks;
-}
-
-GBool GlobalParams::getTextKeepTinyChars() {
- GBool tiny;
-
- lockGlobalParams;
- tiny = textKeepTinyChars;
- unlockGlobalParams;
- return tiny;
-}
-
-GString *GlobalParams::findFontFile(GString *fontName, char **exts) {
- GString *dir, *fileName;
- char **ext;
- FILE *f;
- int i;
-
- lockGlobalParams;
- for (i = 0; i < fontDirs->getLength(); ++i) {
- dir = (GString *)fontDirs->get(i);
- for (ext = exts; *ext; ++ext) {
- fileName = appendToPath(dir->copy(), fontName->getCString());
- fileName->append(*ext);
- if ((f = fopen(fileName->getCString(), "rb"))) {
- fclose(f);
- unlockGlobalParams;
- return fileName;
- }
- delete fileName;
- }
- }
- unlockGlobalParams;
- return NULL;
-}
-
-GString *GlobalParams::getInitialZoom() {
- GString *s;
-
- lockGlobalParams;
- s = initialZoom->copy();
- unlockGlobalParams;
- return s;
-}
-
-GBool GlobalParams::getContinuousView() {
- GBool f;
-
- lockGlobalParams;
- f = continuousView;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getEnableT1lib() {
- GBool f;
-
- lockGlobalParams;
- f = enableT1lib;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getEnableFreeType() {
- GBool f;
-
- lockGlobalParams;
- f = enableFreeType;
- unlockGlobalParams;
- return f;
-}
-
-
-GBool GlobalParams::getAntialias() {
- GBool f;
-
- lockGlobalParams;
- f = antialias;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getVectorAntialias() {
- GBool f;
-
- lockGlobalParams;
- f = vectorAntialias;
- unlockGlobalParams;
- return f;
-}
-
-GBool GlobalParams::getStrokeAdjust() {
- GBool f;
-
- lockGlobalParams;
- f = strokeAdjust;
- unlockGlobalParams;
- return f;
-}
-
-ScreenType GlobalParams::getScreenType() {
- ScreenType t;
-
- lockGlobalParams;
- t = screenType;
- unlockGlobalParams;
- return t;
-}
-
-int GlobalParams::getScreenSize() {
- int size;
-
- lockGlobalParams;
- size = screenSize;
- unlockGlobalParams;
- return size;
-}
-
-int GlobalParams::getScreenDotRadius() {
- int r;
-
- lockGlobalParams;
- r = screenDotRadius;
- unlockGlobalParams;
- return r;
-}
-
-double GlobalParams::getScreenGamma() {
- double gamma;
-
- lockGlobalParams;
- gamma = screenGamma;
- unlockGlobalParams;
- return gamma;
-}
-
-double GlobalParams::getScreenBlackThreshold() {
- double thresh;
-
- lockGlobalParams;
- thresh = screenBlackThreshold;
- unlockGlobalParams;
- return thresh;
-}
-
-double GlobalParams::getScreenWhiteThreshold() {
- double thresh;
-
- lockGlobalParams;
- thresh = screenWhiteThreshold;
- unlockGlobalParams;
- return thresh;
-}
-
-GBool GlobalParams::getMapNumericCharNames() {
- GBool map;
-
- lockGlobalParams;
- map = mapNumericCharNames;
- unlockGlobalParams;
- return map;
-}
-
-GBool GlobalParams::getMapUnknownCharNames() {
- GBool map;
-
- lockGlobalParams;
- map = mapUnknownCharNames;
- unlockGlobalParams;
- return map;
-}
-
-GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
- KeyBinding *binding;
- GList *cmds;
- int modMask;
- int i, j;
-
- lockGlobalParams;
- cmds = NULL;
- // for ASCII chars, ignore the shift modifier
- modMask = code <= 0xff ? ~xpdfKeyModShift : ~0;
- for (i = 0; i < keyBindings->getLength(); ++i) {
- binding = (KeyBinding *)keyBindings->get(i);
- if (binding->code == code &&
- (binding->mods & modMask) == (mods & modMask) &&
- (~binding->context | context) == ~0) {
- cmds = new GList();
- for (j = 0; j < binding->cmds->getLength(); ++j) {
- cmds->append(((GString *)binding->cmds->get(j))->copy());
- }
- break;
- }
- }
- unlockGlobalParams;
- return cmds;
-}
-
-GBool GlobalParams::getPrintCommands() {
- GBool p;
-
- lockGlobalParams;
- p = printCommands;
- unlockGlobalParams;
- return p;
-}
-
-GBool GlobalParams::getErrQuiet() {
- // no locking -- this function may get called from inside a locked
- // section
- return errQuiet;
-}
-
-CharCodeToUnicode *GlobalParams::getCIDToUnicode(GString *collection) {
- GString *fileName;
- CharCodeToUnicode *ctu;
-
- lockGlobalParams;
- if (!(ctu = cidToUnicodeCache->getCharCodeToUnicode(collection))) {
- if ((fileName = (GString *)cidToUnicodes->lookup(collection)) &&
- (ctu = CharCodeToUnicode::parseCIDToUnicode(fileName, collection))) {
- cidToUnicodeCache->add(ctu);
- }
- }
- unlockGlobalParams;
- return ctu;
-}
-
-CharCodeToUnicode *GlobalParams::getUnicodeToUnicode(GString *fontName) {
- CharCodeToUnicode *ctu;
- GHashIter *iter;
- GString *fontPattern, *fileName;
-
- lockGlobalParams;
- fileName = NULL;
- unicodeToUnicodes->startIter(&iter);
- while (unicodeToUnicodes->getNext(&iter, &fontPattern, (void **)&fileName)) {
- if (strstr(fontName->getCString(), fontPattern->getCString())) {
- unicodeToUnicodes->killIter(&iter);
- break;
- }
- fileName = NULL;
- }
- if (fileName) {
- if (!(ctu = unicodeToUnicodeCache->getCharCodeToUnicode(fileName))) {
- if ((ctu = CharCodeToUnicode::parseUnicodeToUnicode(fileName))) {
- unicodeToUnicodeCache->add(ctu);
- }
- }
- } else {
- ctu = NULL;
- }
- unlockGlobalParams;
- return ctu;
-}
-
-UnicodeMap *GlobalParams::getUnicodeMap(GString *encodingName) {
- return getUnicodeMap2(encodingName);
-}
-
-UnicodeMap *GlobalParams::getUnicodeMap2(GString *encodingName) {
- UnicodeMap *map;
-
- if (!(map = getResidentUnicodeMap(encodingName))) {
- lockUnicodeMapCache;
- map = unicodeMapCache->getUnicodeMap(encodingName);
- unlockUnicodeMapCache;
- }
- return map;
-}
-
-CMap *GlobalParams::getCMap(GString *collection, GString *cMapName) {
- CMap *cMap;
-
- lockCMapCache;
- cMap = cMapCache->getCMap(collection, cMapName);
- unlockCMapCache;
- return cMap;
-}
-
-UnicodeMap *GlobalParams::getTextEncoding() {
- return getUnicodeMap2(textEncoding);
-}
-
-//------------------------------------------------------------------------
-// functions to set parameters
-//------------------------------------------------------------------------
-
-void GlobalParams::addDisplayFont(DisplayFontParam *param) {
- DisplayFontParam *old;
-
- lockGlobalParams;
- if ((old = (DisplayFontParam *)displayFonts->remove(param->name))) {
- delete old;
- }
- displayFonts->add(param->name, param);
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSFile(char *file) {
- lockGlobalParams;
- if (psFile) {
- delete psFile;
- }
- psFile = new GString(file);
- unlockGlobalParams;
-}
-
-GBool GlobalParams::setPSPaperSize(char *size) {
- lockGlobalParams;
- if (!strcmp(size, "match")) {
- psPaperWidth = psPaperHeight = -1;
- } else if (!strcmp(size, "letter")) {
- psPaperWidth = 612;
- psPaperHeight = 792;
- } else if (!strcmp(size, "legal")) {
- psPaperWidth = 612;
- psPaperHeight = 1008;
- } else if (!strcmp(size, "A4")) {
- psPaperWidth = 595;
- psPaperHeight = 842;
- } else if (!strcmp(size, "A3")) {
- psPaperWidth = 842;
- psPaperHeight = 1190;
- } else {
- unlockGlobalParams;
- return gFalse;
- }
- psImageableLLX = psImageableLLY = 0;
- psImageableURX = psPaperWidth;
- psImageableURY = psPaperHeight;
- unlockGlobalParams;
- return gTrue;
-}
-
-void GlobalParams::setPSPaperWidth(int width) {
- lockGlobalParams;
- psPaperWidth = width;
- psImageableLLX = 0;
- psImageableURX = psPaperWidth;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSPaperHeight(int height) {
- lockGlobalParams;
- psPaperHeight = height;
- psImageableLLY = 0;
- psImageableURY = psPaperHeight;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSImageableArea(int llx, int lly, int urx, int ury) {
- lockGlobalParams;
- psImageableLLX = llx;
- psImageableLLY = lly;
- psImageableURX = urx;
- psImageableURY = ury;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSCrop(GBool crop) {
- lockGlobalParams;
- psCrop = crop;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSExpandSmaller(GBool expand) {
- lockGlobalParams;
- psExpandSmaller = expand;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSShrinkLarger(GBool shrink) {
- lockGlobalParams;
- psShrinkLarger = shrink;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSCenter(GBool center) {
- lockGlobalParams;
- psCenter = center;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSDuplex(GBool duplex) {
- lockGlobalParams;
- psDuplex = duplex;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSLevel(PSLevel level) {
- lockGlobalParams;
- psLevel = level;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSEmbedType1(GBool embed) {
- lockGlobalParams;
- psEmbedType1 = embed;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSEmbedTrueType(GBool embed) {
- lockGlobalParams;
- psEmbedTrueType = embed;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSEmbedCIDPostScript(GBool embed) {
- lockGlobalParams;
- psEmbedCIDPostScript = embed;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSEmbedCIDTrueType(GBool embed) {
- lockGlobalParams;
- psEmbedCIDTrueType = embed;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSPreload(GBool preload) {
- lockGlobalParams;
- psPreload = preload;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSOPI(GBool opi) {
- lockGlobalParams;
- psOPI = opi;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPSASCIIHex(GBool hex) {
- lockGlobalParams;
- psASCIIHex = hex;
- unlockGlobalParams;
-}
-
-void GlobalParams::setTextEncoding(char *encodingName) {
- lockGlobalParams;
- delete textEncoding;
- textEncoding = new GString(encodingName);
- unlockGlobalParams;
-}
-
-GBool GlobalParams::setTextEOL(char *s) {
- lockGlobalParams;
- if (!strcmp(s, "unix")) {
- textEOL = eolUnix;
- } else if (!strcmp(s, "dos")) {
- textEOL = eolDOS;
- } else if (!strcmp(s, "mac")) {
- textEOL = eolMac;
- } else {
- unlockGlobalParams;
- return gFalse;
- }
- unlockGlobalParams;
- return gTrue;
-}
-
-void GlobalParams::setTextPageBreaks(GBool pageBreaks) {
- lockGlobalParams;
- textPageBreaks = pageBreaks;
- unlockGlobalParams;
-}
-
-void GlobalParams::setTextKeepTinyChars(GBool keep) {
- lockGlobalParams;
- textKeepTinyChars = keep;
- unlockGlobalParams;
-}
-
-void GlobalParams::setInitialZoom(char *s) {
- lockGlobalParams;
- delete initialZoom;
- initialZoom = new GString(s);
- unlockGlobalParams;
-}
-
-void GlobalParams::setContinuousView(GBool cont) {
- lockGlobalParams;
- continuousView = cont;
- unlockGlobalParams;
-}
-
-GBool GlobalParams::setEnableT1lib(char *s) {
- GBool ok;
-
- lockGlobalParams;
- ok = parseYesNo2(s, &enableT1lib);
- unlockGlobalParams;
- return ok;
-}
-
-GBool GlobalParams::setEnableFreeType(char *s) {
- GBool ok;
-
- lockGlobalParams;
- ok = parseYesNo2(s, &enableFreeType);
- unlockGlobalParams;
- return ok;
-}
-
-
-GBool GlobalParams::setAntialias(char *s) {
- GBool ok;
-
- lockGlobalParams;
- ok = parseYesNo2(s, &antialias);
- unlockGlobalParams;
- return ok;
-}
-
-GBool GlobalParams::setVectorAntialias(char *s) {
- GBool ok;
-
- lockGlobalParams;
- ok = parseYesNo2(s, &vectorAntialias);
- unlockGlobalParams;
- return ok;
-}
-
-void GlobalParams::setScreenType(ScreenType t) {
- lockGlobalParams;
- screenType = t;
- unlockGlobalParams;
-}
-
-void GlobalParams::setScreenSize(int size) {
- lockGlobalParams;
- screenSize = size;
- unlockGlobalParams;
-}
-
-void GlobalParams::setScreenDotRadius(int r) {
- lockGlobalParams;
- screenDotRadius = r;
- unlockGlobalParams;
-}
-
-void GlobalParams::setScreenGamma(double gamma) {
- lockGlobalParams;
- screenGamma = gamma;
- unlockGlobalParams;
-}
-
-void GlobalParams::setScreenBlackThreshold(double thresh) {
- lockGlobalParams;
- screenBlackThreshold = thresh;
- unlockGlobalParams;
-}
-
-void GlobalParams::setScreenWhiteThreshold(double thresh) {
- lockGlobalParams;
- screenWhiteThreshold = thresh;
- unlockGlobalParams;
-}
-
-void GlobalParams::setMapNumericCharNames(GBool map) {
- lockGlobalParams;
- mapNumericCharNames = map;
- unlockGlobalParams;
-}
-
-void GlobalParams::setMapUnknownCharNames(GBool map) {
- lockGlobalParams;
- mapUnknownCharNames = map;
- unlockGlobalParams;
-}
-
-void GlobalParams::setPrintCommands(GBool printCommandsA) {
- lockGlobalParams;
- printCommands = printCommandsA;
- unlockGlobalParams;
-}
-
-void GlobalParams::setErrQuiet(GBool errQuietA) {
- lockGlobalParams;
- errQuiet = errQuietA;
- unlockGlobalParams;
-}
-
-void GlobalParams::addSecurityHandler(XpdfSecurityHandler *handler) {
-#ifdef ENABLE_PLUGINS
- lockGlobalParams;
- securityHandlers->append(handler);
- unlockGlobalParams;
-#else
- (void)handler;
-#endif
-}
-
-XpdfSecurityHandler *GlobalParams::getSecurityHandler(char *name) {
-#ifdef ENABLE_PLUGINS
- XpdfSecurityHandler *hdlr;
- int i;
-
- lockGlobalParams;
- for (i = 0; i < securityHandlers->getLength(); ++i) {
- hdlr = (XpdfSecurityHandler *)securityHandlers->get(i);
- if (!strcasecmp(hdlr->name, name)) {
- unlockGlobalParams;
- return hdlr;
- }
- }
- unlockGlobalParams;
-
- if (!loadPlugin("security", name)) {
- return NULL;
- }
-
- lockGlobalParams;
- for (i = 0; i < securityHandlers->getLength(); ++i) {
- hdlr = (XpdfSecurityHandler *)securityHandlers->get(i);
- if (!strcmp(hdlr->name, name)) {
- unlockGlobalParams;
- return hdlr;
- }
- }
- unlockGlobalParams;
-#else
- (void)name;
-#endif
-
- return NULL;
-}
-
-#ifdef ENABLE_PLUGINS
-//------------------------------------------------------------------------
-// plugins
-//------------------------------------------------------------------------
-
-GBool GlobalParams::loadPlugin(char *type, char *name) {
- Plugin *plugin;
-
- if (!(plugin = Plugin::load(type, name))) {
- return gFalse;
- }
- lockGlobalParams;
- plugins->append(plugin);
- unlockGlobalParams;
- return gTrue;
-}
-
-#endif // ENABLE_PLUGINS
diff --git a/kpdf/xpdf/xpdf/GlobalParams.cpp b/kpdf/xpdf/xpdf/GlobalParams.cpp
new file mode 100644
index 00000000..f18026ee
--- /dev/null
+++ b/kpdf/xpdf/xpdf/GlobalParams.cpp
@@ -0,0 +1,2989 @@
+//========================================================================
+//
+// GlobalParams.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include <strings.h>
+// KPDF: additional includes for Qt and Xft
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <tqwindowdefs.h>
+// -- gentoo compile fix (XFree 4.3.0, FC 2.2.3, FreeType 2.1.9) --
+// on other distros these 2 lines should't harm
+#include <ft2build.h>
+#include FT_FREETYPE_H
+// -- ---------------------------------------------------------- --
+#include <X11/Xlib.h>
+#include <X11/Xft/Xft.h>
+#include <X11/Xft/XftCompat.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#ifdef ENABLE_PLUGINS
+# ifndef WIN32
+# include <dlfcn.h>
+# endif
+#endif
+#ifdef WIN32
+# include <shlobj.h>
+#endif
+#if HAVE_PAPER_H
+#include <paper.h>
+#endif
+#include "gmem.h"
+#include "GString.h"
+#include "GList.h"
+#include "GHash.h"
+#include "gfile.h"
+#include "Error.h"
+#include "NameToCharCode.h"
+#include "CharCodeToUnicode.h"
+#include "UnicodeMap.h"
+#include "CMap.h"
+#include "BuiltinFontTables.h"
+#include "FontEncodingTables.h"
+#ifdef ENABLE_PLUGINS
+# include "XpdfPluginAPI.h"
+#endif
+#include "GlobalParams.h"
+
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <fontconfig/fontconfig.h>
+
+#ifdef WIN32
+# define strcasecmp stricmp
+#endif
+
+#if MULTITHREADED
+# define lockGlobalParams gLockMutex(&mutex)
+# define lockUnicodeMapCache gLockMutex(&unicodeMapCacheMutex)
+# define lockCMapCache gLockMutex(&cMapCacheMutex)
+# define unlockGlobalParams gUnlockMutex(&mutex)
+# define unlockUnicodeMapCache gUnlockMutex(&unicodeMapCacheMutex)
+# define unlockCMapCache gUnlockMutex(&cMapCacheMutex)
+#else
+# define lockGlobalParams
+# define lockUnicodeMapCache
+# define lockCMapCache
+# define unlockGlobalParams
+# define unlockUnicodeMapCache
+# define unlockCMapCache
+#endif
+
+#include "NameToUnicodeTable.h"
+#include "UnicodeMapTables.h"
+#include "UTF8.h"
+
+#ifdef ENABLE_PLUGINS
+# ifdef WIN32
+extern XpdfPluginVecTable xpdfPluginVecTable;
+# endif
+#endif
+
+//------------------------------------------------------------------------
+
+#define cidToUnicodeCacheSize 4
+#define unicodeToUnicodeCacheSize 4
+
+//------------------------------------------------------------------------
+
+static struct {
+ char *name;
+ char *t1FileName;
+ char *ttFileName;
+} displayFontTab[] = {
+ {"Courier", "n022003l.pfb", "cour.ttf"},
+ {"Courier-Bold", "n022004l.pfb", "courbd.ttf"},
+ {"Courier-BoldOblique", "n022024l.pfb", "courbi.ttf"},
+ {"Courier-Oblique", "n022023l.pfb", "couri.ttf"},
+ {"Helvetica", "n019003l.pfb", "arial.ttf"},
+ {"Helvetica-Bold", "n019004l.pfb", "arialbd.ttf"},
+ {"Helvetica-BoldOblique", "n019024l.pfb", "arialbi.ttf"},
+ {"Helvetica-Oblique", "n019023l.pfb", "ariali.ttf"},
+ {"Symbol", "s050000l.pfb", NULL},
+ {"Times-Bold", "n021004l.pfb", "timesbd.ttf"},
+ {"Times-BoldItalic", "n021024l.pfb", "timesbi.ttf"},
+ {"Times-Italic", "n021023l.pfb", "timesi.ttf"},
+ {"Times-Roman", "n021003l.pfb", "times.ttf"},
+ {"ZapfDingbats", "d050000l.pfb", NULL},
+ {NULL, NULL, NULL}
+};
+
+#ifdef WIN32
+static char *displayFontDirs[] = {
+ "c:/windows/fonts",
+ "c:/winnt/fonts",
+ NULL
+};
+#else
+static char *displayFontDirs[] = {
+ "/usr/share/ghostscript/fonts",
+ "/usr/pkg/share/ghostscript/fonts",
+ "/usr/local/share/ghostscript/fonts",
+ "/usr/share/fonts/default/Type1",
+ "/usr/X11R6/lib/X11/fonts/Type1",
+ "/usr/share/fonts/default/ghostscript",
+ "/usr/share/fonts/type1/gsfonts",
+ "/usr/share/fonts/Type1",
+ NULL
+};
+#endif
+
+//------------------------------------------------------------------------
+
+GlobalParams *globalParams = NULL;
+
+//------------------------------------------------------------------------
+// DisplayFontParam
+//------------------------------------------------------------------------
+
+DisplayFontParam::DisplayFontParam(GString *nameA,
+ DisplayFontParamKind kindA) {
+ name = nameA;
+ kind = kindA;
+ switch (kind) {
+ case displayFontT1:
+ t1.fileName = NULL;
+ break;
+ case displayFontTT:
+ tt.fileName = NULL;
+ break;
+ }
+}
+
+DisplayFontParam::~DisplayFontParam() {
+ delete name;
+ switch (kind) {
+ case displayFontT1:
+ if (t1.fileName) {
+ delete t1.fileName;
+ }
+ break;
+ case displayFontTT:
+ if (tt.fileName) {
+ delete tt.fileName;
+ }
+ break;
+ }
+}
+
+#ifdef WIN32
+
+//------------------------------------------------------------------------
+// WinFontInfo
+//------------------------------------------------------------------------
+
+class WinFontInfo: public DisplayFontParam {
+public:
+
+ GBool bold, italic;
+
+ static WinFontInfo *make(GString *nameA, GBool boldA, GBool italicA,
+ HKEY regKey, char *winFontDir);
+ WinFontInfo(GString *nameA, GBool boldA, GBool italicA,
+ GString *fileNameA);
+ virtual ~WinFontInfo();
+ GBool equals(WinFontInfo *fi);
+};
+
+WinFontInfo *WinFontInfo::make(GString *nameA, GBool boldA, GBool italicA,
+ HKEY regKey, char *winFontDir) {
+ GString *regName;
+ GString *fileNameA;
+ char buf[MAX_PATH];
+ DWORD n;
+ char c;
+ int i;
+
+ //----- find the font file
+ fileNameA = NULL;
+ regName = nameA->copy();
+ if (boldA) {
+ regName->append(" Bold");
+ }
+ if (italicA) {
+ regName->append(" Italic");
+ }
+ regName->append(" (TrueType)");
+ n = sizeof(buf);
+ if (RegQueryValueEx(regKey, regName->getCString(), NULL, NULL,
+ (LPBYTE)buf, &n) == ERROR_SUCCESS) {
+ fileNameA = new GString(winFontDir);
+ fileNameA->append('\\')->append(buf);
+ }
+ delete regName;
+ if (!fileNameA) {
+ delete nameA;
+ return NULL;
+ }
+
+ //----- normalize the font name
+ i = 0;
+ while (i < nameA->getLength()) {
+ c = nameA->getChar(i);
+ if (c == ' ' || c == ',' || c == '-') {
+ nameA->del(i);
+ } else {
+ ++i;
+ }
+ }
+
+ return new WinFontInfo(nameA, boldA, italicA, fileNameA);
+}
+
+WinFontInfo::WinFontInfo(GString *nameA, GBool boldA, GBool italicA,
+ GString *fileNameA):
+ DisplayFontParam(nameA, displayFontTT)
+{
+ bold = boldA;
+ italic = italicA;
+ tt.fileName = fileNameA;
+}
+
+WinFontInfo::~WinFontInfo() {
+}
+
+GBool WinFontInfo::equals(WinFontInfo *fi) {
+ return !name->cmp(fi->name) && bold == fi->bold && italic == fi->italic;
+}
+
+//------------------------------------------------------------------------
+// WinFontList
+//------------------------------------------------------------------------
+
+class WinFontList {
+public:
+
+ WinFontList(char *winFontDirA);
+ ~WinFontList();
+ WinFontInfo *find(GString *font);
+
+private:
+
+ void add(WinFontInfo *fi);
+ static int CALLBACK enumFunc1(CONST LOGFONT *font,
+ CONST TEXTMETRIC *metrics,
+ DWORD type, LPARAM data);
+ static int CALLBACK enumFunc2(CONST LOGFONT *font,
+ CONST TEXTMETRIC *metrics,
+ DWORD type, LPARAM data);
+
+ GList *fonts; // [WinFontInfo]
+ HDC dc; // (only used during enumeration)
+ HKEY regKey; // (only used during enumeration)
+ char *winFontDir; // (only used during enumeration)
+};
+
+WinFontList::WinFontList(char *winFontDirA) {
+ OSVERSIONINFO version;
+ char *path;
+
+ fonts = new GList();
+ dc = GetDC(NULL);
+ winFontDir = winFontDirA;
+ version.dwOSVersionInfoSize = sizeof(version);
+ GetVersionEx(&version);
+ if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+ path = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\\";
+ } else {
+ path = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts\\";
+ }
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0,
+ KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
+ &regKey) == ERROR_SUCCESS) {
+ EnumFonts(dc, NULL, &WinFontList::enumFunc1, (LPARAM)this);
+ RegCloseKey(regKey);
+ }
+ ReleaseDC(NULL, dc);
+}
+
+WinFontList::~WinFontList() {
+ deleteGList(fonts, WinFontInfo);
+}
+
+void WinFontList::add(WinFontInfo *fi) {
+ int i;
+
+ for (i = 0; i < fonts->getLength(); ++i) {
+ if (((WinFontInfo *)fonts->get(i))->equals(fi)) {
+ delete fi;
+ return;
+ }
+ }
+ fonts->append(fi);
+}
+
+WinFontInfo *WinFontList::find(GString *font) {
+ GString *name;
+ GBool bold, italic;
+ WinFontInfo *fi;
+ char c;
+ int n, i;
+
+ name = font->copy();
+
+ // remove space, comma, dash chars
+ i = 0;
+ while (i < name->getLength()) {
+ c = name->getChar(i);
+ if (c == ' ' || c == ',' || c == '-') {
+ name->del(i);
+ } else {
+ ++i;
+ }
+ }
+ n = name->getLength();
+
+ // remove trailing "MT" (Foo-MT, Foo-BoldMT, etc.)
+ if (!strcmp(name->getCString() + n - 2, "MT")) {
+ name->del(n - 2, 2);
+ n -= 2;
+ }
+
+ // look for "Italic"
+ if (!strcmp(name->getCString() + n - 6, "Italic")) {
+ name->del(n - 6, 6);
+ italic = gTrue;
+ n -= 6;
+ } else {
+ italic = gFalse;
+ }
+
+ // look for "Bold"
+ if (!strcmp(name->getCString() + n - 4, "Bold")) {
+ name->del(n - 4, 4);
+ bold = gTrue;
+ n -= 4;
+ } else {
+ bold = gFalse;
+ }
+
+ // remove trailing "MT" (FooMT-Bold, etc.)
+ if (!strcmp(name->getCString() + n - 2, "MT")) {
+ name->del(n - 2, 2);
+ n -= 2;
+ }
+
+ // remove trailing "PS"
+ if (!strcmp(name->getCString() + n - 2, "PS")) {
+ name->del(n - 2, 2);
+ n -= 2;
+ }
+
+ // search for the font
+ fi = NULL;
+ for (i = 0; i < fonts->getLength(); ++i) {
+ fi = (WinFontInfo *)fonts->get(i);
+ if (!fi->name->cmp(name) && fi->bold == bold && fi->italic == italic) {
+ break;
+ }
+ fi = NULL;
+ }
+
+ delete name;
+ return fi;
+}
+
+int CALLBACK WinFontList::enumFunc1(CONST LOGFONT *font,
+ CONST TEXTMETRIC *metrics,
+ DWORD type, LPARAM data) {
+ WinFontList *fl = (WinFontList *)data;
+
+ EnumFonts(fl->dc, font->lfFaceName, &WinFontList::enumFunc2, (LPARAM)fl);
+ return 1;
+}
+
+int CALLBACK WinFontList::enumFunc2(CONST LOGFONT *font,
+ CONST TEXTMETRIC *metrics,
+ DWORD type, LPARAM data) {
+ WinFontList *fl = (WinFontList *)data;
+ WinFontInfo *fi;
+
+ if (type & TRUETYPE_FONTTYPE) {
+ if ((fi = WinFontInfo::make(new GString(font->lfFaceName),
+ font->lfWeight >= 600,
+ font->lfItalic ? gTrue : gFalse,
+ fl->regKey, fl->winFontDir))) {
+ fl->add(fi);
+ }
+ }
+ return 1;
+}
+
+#endif // WIN32
+
+//------------------------------------------------------------------------
+// PSFontParam
+//------------------------------------------------------------------------
+
+PSFontParam::PSFontParam(GString *pdfFontNameA, int wModeA,
+ GString *psFontNameA, GString *encodingA) {
+ pdfFontName = pdfFontNameA;
+ wMode = wModeA;
+ psFontName = psFontNameA;
+ encoding = encodingA;
+}
+
+PSFontParam::~PSFontParam() {
+ delete pdfFontName;
+ delete psFontName;
+ if (encoding) {
+ delete encoding;
+ }
+}
+
+//------------------------------------------------------------------------
+// KeyBinding
+//------------------------------------------------------------------------
+
+KeyBinding::KeyBinding(int codeA, int modsA, int contextA, char *cmd0) {
+ code = codeA;
+ mods = modsA;
+ context = contextA;
+ cmds = new GList();
+ cmds->append(new GString(cmd0));
+}
+
+KeyBinding::KeyBinding(int codeA, int modsA, int contextA,
+ char *cmd0, char *cmd1) {
+ code = codeA;
+ mods = modsA;
+ context = contextA;
+ cmds = new GList();
+ cmds->append(new GString(cmd0));
+ cmds->append(new GString(cmd1));
+}
+
+KeyBinding::KeyBinding(int codeA, int modsA, int contextA, GList *cmdsA) {
+ code = codeA;
+ mods = modsA;
+ context = contextA;
+ cmds = cmdsA;
+}
+
+KeyBinding::~KeyBinding() {
+ deleteGList(cmds, GString);
+}
+
+#ifdef ENABLE_PLUGINS
+//------------------------------------------------------------------------
+// Plugin
+//------------------------------------------------------------------------
+
+class Plugin {
+public:
+
+ static Plugin *load(char *type, char *name);
+ ~Plugin();
+
+private:
+
+#ifdef WIN32
+ Plugin(HMODULE libA);
+ HMODULE lib;
+#else
+ Plugin(void *dlA);
+ void *dl;
+#endif
+};
+
+Plugin *Plugin::load(char *type, char *name) {
+ GString *path;
+ Plugin *plugin;
+ XpdfPluginVecTable *vt;
+ XpdfBool (*xpdfInitPlugin)(void);
+#ifdef WIN32
+ HMODULE libA;
+#else
+ void *dlA;
+#endif
+
+ path = globalParams->getBaseDir();
+ appendToPath(path, "plugins");
+ appendToPath(path, type);
+ appendToPath(path, name);
+
+#ifdef WIN32
+ path->append(".dll");
+ if (!(libA = LoadLibrary(path->getCString()))) {
+ error(-1, "Failed to load plugin '%s'",
+ path->getCString());
+ goto err1;
+ }
+ if (!(vt = (XpdfPluginVecTable *)
+ GetProcAddress(libA, "xpdfPluginVecTable"))) {
+ error(-1, "Failed to find xpdfPluginVecTable in plugin '%s'",
+ path->getCString());
+ goto err2;
+ }
+#else
+ //~ need to deal with other extensions here
+ path->append(".so");
+ if (!(dlA = dlopen(path->getCString(), RTLD_NOW))) {
+ error(-1, "Failed to load plugin '%s': %s",
+ path->getCString(), dlerror());
+ goto err1;
+ }
+ if (!(vt = (XpdfPluginVecTable *)dlsym(dlA, "xpdfPluginVecTable"))) {
+ error(-1, "Failed to find xpdfPluginVecTable in plugin '%s'",
+ path->getCString());
+ goto err2;
+ }
+#endif
+
+ if (vt->version != xpdfPluginVecTable.version) {
+ error(-1, "Plugin '%s' is wrong version", path->getCString());
+ goto err2;
+ }
+ memcpy(vt, &xpdfPluginVecTable, sizeof(xpdfPluginVecTable));
+
+#ifdef WIN32
+ if (!(xpdfInitPlugin = (XpdfBool (*)(void))
+ GetProcAddress(libA, "xpdfInitPlugin"))) {
+ error(-1, "Failed to find xpdfInitPlugin in plugin '%s'",
+ path->getCString());
+ goto err2;
+ }
+#else
+ if (!(xpdfInitPlugin = (XpdfBool (*)(void))dlsym(dlA, "xpdfInitPlugin"))) {
+ error(-1, "Failed to find xpdfInitPlugin in plugin '%s'",
+ path->getCString());
+ goto err2;
+ }
+#endif
+
+ if (!(*xpdfInitPlugin)()) {
+ error(-1, "Initialization of plugin '%s' failed",
+ path->getCString());
+ goto err2;
+ }
+
+#ifdef WIN32
+ plugin = new Plugin(libA);
+#else
+ plugin = new Plugin(dlA);
+#endif
+
+ delete path;
+ return plugin;
+
+ err2:
+#ifdef WIN32
+ FreeLibrary(libA);
+#else
+ dlclose(dlA);
+#endif
+ err1:
+ delete path;
+ return NULL;
+}
+
+#ifdef WIN32
+Plugin::Plugin(HMODULE libA) {
+ lib = libA;
+}
+#else
+Plugin::Plugin(void *dlA) {
+ dl = dlA;
+}
+#endif
+
+Plugin::~Plugin() {
+ void (*xpdfFreePlugin)(void);
+
+#ifdef WIN32
+ if ((xpdfFreePlugin = (void (*)(void))
+ GetProcAddress(lib, "xpdfFreePlugin"))) {
+ (*xpdfFreePlugin)();
+ }
+ FreeLibrary(lib);
+#else
+ if ((xpdfFreePlugin = (void (*)(void))dlsym(dl, "xpdfFreePlugin"))) {
+ (*xpdfFreePlugin)();
+ }
+ dlclose(dl);
+#endif
+}
+
+#endif // ENABLE_PLUGINS
+
+//------------------------------------------------------------------------
+// parsing
+//------------------------------------------------------------------------
+
+GlobalParams::GlobalParams(char *cfgFileName) {
+ UnicodeMap *map;
+ GString *fileName;
+ FILE *f;
+ int i;
+
+#if MULTITHREADED
+ gInitMutex(&mutex);
+ gInitMutex(&unicodeMapCacheMutex);
+ gInitMutex(&cMapCacheMutex);
+#endif
+
+ initBuiltinFontTables();
+
+ // scan the encoding in reverse because we want the lowest-numbered
+ // index for each char name ('space' is encoded twice)
+ macRomanReverseMap = new NameToCharCode();
+ for (i = 255; i >= 0; --i) {
+ if (macRomanEncoding[i]) {
+ macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
+ }
+ }
+
+#ifdef WIN32
+ // baseDir will be set by a call to setBaseDir
+ baseDir = new GString();
+#else
+ baseDir = appendToPath(getHomeDir(), ".xpdf");
+#endif
+ nameToUnicode = new NameToCharCode();
+ cidToUnicodes = new GHash(gTrue);
+ unicodeToUnicodes = new GHash(gTrue);
+ residentUnicodeMaps = new GHash();
+ unicodeMaps = new GHash(gTrue);
+ cMapDirs = new GHash(gTrue);
+ toUnicodeDirs = new GList();
+ displayFonts = new GHash();
+ displayCIDFonts = new GHash();
+ displayNamedCIDFonts = new GHash();
+#if HAVE_PAPER_H
+ char *paperName;
+ const struct paper *paperType;
+ paperinit();
+ if ((paperName = systempapername())) {
+ paperType = paperinfo(paperName);
+ psPaperWidth = (int)paperpswidth(paperType);
+ psPaperHeight = (int)paperpsheight(paperType);
+ } else {
+ error(-1, "No paper information available - using defaults");
+ psPaperWidth = defPaperWidth;
+ psPaperHeight = defPaperHeight;
+ }
+ paperdone();
+#else
+ psPaperWidth = defPaperWidth;
+ psPaperHeight = defPaperHeight;
+#endif
+ psImageableLLX = psImageableLLY = 0;
+ psImageableURX = psPaperWidth;
+ psImageableURY = psPaperHeight;
+ psCrop = gTrue;
+ psExpandSmaller = gFalse;
+ psShrinkLarger = gTrue;
+ psCenter = gTrue;
+ psDuplex = gFalse;
+ psLevel = psLevel2;
+ psFile = NULL;
+ psFonts = new GHash();
+ psNamedFonts16 = new GList();
+ psFonts16 = new GList();
+ psEmbedType1 = gTrue;
+ psEmbedTrueType = gTrue;
+ psEmbedCIDPostScript = gTrue;
+ psEmbedCIDTrueType = gTrue;
+ psPreload = gFalse;
+ psOPI = gFalse;
+ psASCIIHex = gFalse;
+ // KPDF: use always UTF-8 and TQString::fromUtf
+ textEncoding = new GString("UTF-8");
+#if defined(WIN32)
+ textEOL = eolDOS;
+#elif defined(MACOS)
+ textEOL = eolMac;
+#else
+ textEOL = eolUnix;
+#endif
+ textPageBreaks = gTrue;
+ textKeepTinyChars = gFalse;
+ fontDirs = new GList();
+ initialZoom = new GString("125");
+ continuousView = gFalse;
+ enableT1lib = gTrue;
+ enableFreeType = gTrue;
+ antialias = gTrue;
+ vectorAntialias = gTrue;
+ strokeAdjust = gTrue;
+ screenType = screenUnset;
+ screenSize = -1;
+ screenDotRadius = -1;
+ screenGamma = 1.0;
+ screenBlackThreshold = 0.0;
+ screenWhiteThreshold = 1.0;
+ urlCommand = NULL;
+ movieCommand = NULL;
+ mapNumericCharNames = gTrue;
+ mapUnknownCharNames = gFalse;
+ createDefaultKeyBindings();
+ printCommands = gFalse;
+ errQuiet = gFalse;
+
+ cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
+ unicodeToUnicodeCache =
+ new CharCodeToUnicodeCache(unicodeToUnicodeCacheSize);
+ unicodeMapCache = new UnicodeMapCache();
+ cMapCache = new CMapCache();
+
+#ifdef WIN32
+ winFontList = NULL;
+#endif
+
+#ifdef ENABLE_PLUGINS
+ plugins = new GList();
+ securityHandlers = new GList();
+#endif
+
+ // set up the initial nameToUnicode table
+ for (i = 0; nameToUnicodeTab[i].name; ++i) {
+ nameToUnicode->add(nameToUnicodeTab[i].name, nameToUnicodeTab[i].u);
+ }
+
+ // set up the residentUnicodeMaps table
+ map = new UnicodeMap("Latin1", gFalse,
+ latin1UnicodeMapRanges, latin1UnicodeMapLen);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+ map = new UnicodeMap("ASCII7", gFalse,
+ ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+ map = new UnicodeMap("Symbol", gFalse,
+ symbolUnicodeMapRanges, symbolUnicodeMapLen);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+ map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
+ zapfDingbatsUnicodeMapLen);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+ map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+ map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
+ residentUnicodeMaps->add(map->getEncodingName(), map);
+
+ // look for a user config file, then a system-wide config file
+ f = NULL;
+ fileName = NULL;
+ if (cfgFileName && cfgFileName[0]) {
+ fileName = new GString(cfgFileName);
+ if (!(f = fopen(fileName->getCString(), "r"))) {
+ delete fileName;
+ }
+ }
+ if (!f) {
+ fileName = appendToPath(getHomeDir(), xpdfUserConfigFile);
+ if (!(f = fopen(fileName->getCString(), "r"))) {
+ delete fileName;
+ }
+ }
+ if (!f) {
+#if defined(WIN32) && !defined(__CYGWIN32__)
+ char buf[512];
+ i = GetModuleFileName(NULL, buf, sizeof(buf));
+ if (i <= 0 || i >= sizeof(buf)) {
+ // error or path too long for buffer - just use the current dir
+ buf[0] = '\0';
+ }
+ fileName = grabPath(buf);
+ appendToPath(fileName, xpdfSysConfigFile);
+#else
+ fileName = new GString(xpdfSysConfigFile);
+#endif
+ if (!(f = fopen(fileName->getCString(), "r"))) {
+ delete fileName;
+ }
+ }
+ if (f) {
+ parseFile(fileName, f);
+ delete fileName;
+ fclose(f);
+ }
+}
+
+void GlobalParams::createDefaultKeyBindings() {
+ keyBindings = new GList();
+
+ //----- mouse buttons
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress1, xpdfKeyModNone,
+ xpdfKeyContextAny, "startSelection"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease1, xpdfKeyModNone,
+ xpdfKeyContextAny, "endSelection",
+ "followLinkNoSel"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress2, xpdfKeyModNone,
+ xpdfKeyContextAny, "startPan"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMouseRelease2, xpdfKeyModNone,
+ xpdfKeyContextAny, "endPan"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress3, xpdfKeyModNone,
+ xpdfKeyContextAny, "postPopupMenu"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress4, xpdfKeyModNone,
+ xpdfKeyContextAny,
+ "scrollUpPrevPage(16)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress5, xpdfKeyModNone,
+ xpdfKeyContextAny,
+ "scrollDownNextPage(16)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress6, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollLeft(16)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeMousePress7, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollRight(16)"));
+
+ //----- keys
+ keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModCtrl,
+ xpdfKeyContextAny, "gotoPage(1)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeHome, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollToTopLeft"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModCtrl,
+ xpdfKeyContextAny, "gotoLastPage"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeEnd, xpdfKeyModNone,
+ xpdfKeyContextAny,
+ "scrollToBottomRight"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodePgUp, xpdfKeyModNone,
+ xpdfKeyContextAny, "pageUp"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeBackspace, xpdfKeyModNone,
+ xpdfKeyContextAny, "pageUp"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeDelete, xpdfKeyModNone,
+ xpdfKeyContextAny, "pageUp"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodePgDn, xpdfKeyModNone,
+ xpdfKeyContextAny, "pageDown"));
+ keyBindings->append(new KeyBinding(' ', xpdfKeyModNone,
+ xpdfKeyContextAny, "pageDown"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeLeft, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollLeft(16)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeRight, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollRight(16)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeUp, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollUp(16)"));
+ keyBindings->append(new KeyBinding(xpdfKeyCodeDown, xpdfKeyModNone,
+ xpdfKeyContextAny, "scrollDown(16)"));
+ keyBindings->append(new KeyBinding('o', xpdfKeyModNone,
+ xpdfKeyContextAny, "open"));
+ keyBindings->append(new KeyBinding('O', xpdfKeyModNone,
+ xpdfKeyContextAny, "open"));
+ keyBindings->append(new KeyBinding('r', xpdfKeyModNone,
+ xpdfKeyContextAny, "reload"));
+ keyBindings->append(new KeyBinding('R', xpdfKeyModNone,
+ xpdfKeyContextAny, "reload"));
+ keyBindings->append(new KeyBinding('f', xpdfKeyModNone,
+ xpdfKeyContextAny, "find"));
+ keyBindings->append(new KeyBinding('F', xpdfKeyModNone,
+ xpdfKeyContextAny, "find"));
+ keyBindings->append(new KeyBinding('f', xpdfKeyModCtrl,
+ xpdfKeyContextAny, "find"));
+ keyBindings->append(new KeyBinding('g', xpdfKeyModCtrl,
+ xpdfKeyContextAny, "findNext"));
+ keyBindings->append(new KeyBinding('p', xpdfKeyModCtrl,
+ xpdfKeyContextAny, "print"));
+ keyBindings->append(new KeyBinding('n', xpdfKeyModNone,
+ xpdfKeyContextScrLockOff, "nextPage"));
+ keyBindings->append(new KeyBinding('N', xpdfKeyModNone,
+ xpdfKeyContextScrLockOff, "nextPage"));
+ keyBindings->append(new KeyBinding('n', xpdfKeyModNone,
+ xpdfKeyContextScrLockOn,
+ "nextPageNoScroll"));
+ keyBindings->append(new KeyBinding('N', xpdfKeyModNone,
+ xpdfKeyContextScrLockOn,
+ "nextPageNoScroll"));
+ keyBindings->append(new KeyBinding('p', xpdfKeyModNone,
+ xpdfKeyContextScrLockOff, "prevPage"));
+ keyBindings->append(new KeyBinding('P', xpdfKeyModNone,
+ xpdfKeyContextScrLockOff, "prevPage"));
+ keyBindings->append(new KeyBinding('p', xpdfKeyModNone,
+ xpdfKeyContextScrLockOn,
+ "prevPageNoScroll"));
+ keyBindings->append(new KeyBinding('P', xpdfKeyModNone,
+ xpdfKeyContextScrLockOn,
+ "prevPageNoScroll"));
+ keyBindings->append(new KeyBinding('v', xpdfKeyModNone,
+ xpdfKeyContextAny, "goForward"));
+ keyBindings->append(new KeyBinding('b', xpdfKeyModNone,
+ xpdfKeyContextAny, "goBackward"));
+ keyBindings->append(new KeyBinding('g', xpdfKeyModNone,
+ xpdfKeyContextAny, "focusToPageNum"));
+ keyBindings->append(new KeyBinding('0', xpdfKeyModNone,
+ xpdfKeyContextAny, "zoomPercent(125)"));
+ keyBindings->append(new KeyBinding('+', xpdfKeyModNone,
+ xpdfKeyContextAny, "zoomIn"));
+ keyBindings->append(new KeyBinding('-', xpdfKeyModNone,
+ xpdfKeyContextAny, "zoomOut"));
+ keyBindings->append(new KeyBinding('z', xpdfKeyModNone,
+ xpdfKeyContextAny, "zoomFitPage"));
+ keyBindings->append(new KeyBinding('w', xpdfKeyModNone,
+ xpdfKeyContextAny, "zoomFitWidth"));
+ keyBindings->append(new KeyBinding('f', xpdfKeyModAlt,
+ xpdfKeyContextAny,
+ "toggleFullScreenMode"));
+ keyBindings->append(new KeyBinding('l', xpdfKeyModCtrl,
+ xpdfKeyContextAny, "redraw"));
+ keyBindings->append(new KeyBinding('w', xpdfKeyModCtrl,
+ xpdfKeyContextAny, "closeWindow"));
+ keyBindings->append(new KeyBinding('?', xpdfKeyModNone,
+ xpdfKeyContextAny, "about"));
+ keyBindings->append(new KeyBinding('q', xpdfKeyModNone,
+ xpdfKeyContextAny, "quit"));
+ keyBindings->append(new KeyBinding('Q', xpdfKeyModNone,
+ xpdfKeyContextAny, "quit"));
+}
+
+void GlobalParams::parseFile(GString *fileName, FILE *f) {
+ int line;
+ char buf[512];
+
+ line = 1;
+ while (getLine(buf, sizeof(buf) - 1, f)) {
+ parseLine(buf, fileName, line);
+ ++line;
+ }
+}
+
+void GlobalParams::parseLine(char *buf, GString *fileName, int line) {
+ GList *tokens;
+ GString *cmd, *incFile;
+ char *p1, *p2;
+ FILE *f2;
+
+ // break the line into tokens
+ tokens = new GList();
+ p1 = buf;
+ while (*p1) {
+ for (; *p1 && isspace(*p1); ++p1) ;
+ if (!*p1) {
+ break;
+ }
+ if (*p1 == '"' || *p1 == '\'') {
+ for (p2 = p1 + 1; *p2 && *p2 != *p1; ++p2) ;
+ ++p1;
+ } else {
+ for (p2 = p1 + 1; *p2 && !isspace(*p2); ++p2) ;
+ }
+ tokens->append(new GString(p1, p2 - p1));
+ p1 = *p2 ? p2 + 1 : p2;
+ }
+
+ // parse the line
+ if (tokens->getLength() > 0 &&
+ ((GString *)tokens->get(0))->getChar(0) != '#') {
+ cmd = (GString *)tokens->get(0);
+ if (!cmd->cmp("include")) {
+ if (tokens->getLength() == 2) {
+ incFile = (GString *)tokens->get(1);
+ if ((f2 = fopen(incFile->getCString(), "r"))) {
+ parseFile(incFile, f2);
+ fclose(f2);
+ } else {
+ error(-1, "Couldn't find included config file: '%s' (%s:%d)",
+ incFile->getCString(), fileName->getCString(), line);
+ }
+ } else {
+ error(-1, "Bad 'include' config file command (%s:%d)",
+ fileName->getCString(), line);
+ }
+ } else if (!cmd->cmp("nameToUnicode")) {
+ parseNameToUnicode(tokens, fileName, line);
+ } else if (!cmd->cmp("cidToUnicode")) {
+ parseCIDToUnicode(tokens, fileName, line);
+ } else if (!cmd->cmp("unicodeToUnicode")) {
+ parseUnicodeToUnicode(tokens, fileName, line);
+ } else if (!cmd->cmp("unicodeMap")) {
+ parseUnicodeMap(tokens, fileName, line);
+ } else if (!cmd->cmp("cMapDir")) {
+ parseCMapDir(tokens, fileName, line);
+ } else if (!cmd->cmp("toUnicodeDir")) {
+ parseToUnicodeDir(tokens, fileName, line);
+ } else if (!cmd->cmp("displayFontT1")) {
+ parseDisplayFont(tokens, displayFonts, displayFontT1, fileName, line);
+ } else if (!cmd->cmp("displayFontTT")) {
+ parseDisplayFont(tokens, displayFonts, displayFontTT, fileName, line);
+ } else if (!cmd->cmp("displayNamedCIDFontT1")) {
+ parseDisplayFont(tokens, displayNamedCIDFonts,
+ displayFontT1, fileName, line);
+ } else if (!cmd->cmp("displayCIDFontT1")) {
+ parseDisplayFont(tokens, displayCIDFonts,
+ displayFontT1, fileName, line);
+ } else if (!cmd->cmp("displayNamedCIDFontTT")) {
+ parseDisplayFont(tokens, displayNamedCIDFonts,
+ displayFontTT, fileName, line);
+ } else if (!cmd->cmp("displayCIDFontTT")) {
+ parseDisplayFont(tokens, displayCIDFonts,
+ displayFontTT, fileName, line);
+ } else if (!cmd->cmp("psFile")) {
+ parsePSFile(tokens, fileName, line);
+ } else if (!cmd->cmp("psFont")) {
+ parsePSFont(tokens, fileName, line);
+ } else if (!cmd->cmp("psNamedFont16")) {
+ parsePSFont16("psNamedFont16", psNamedFonts16,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("psFont16")) {
+ parsePSFont16("psFont16", psFonts16, tokens, fileName, line);
+ } else if (!cmd->cmp("psPaperSize")) {
+ parsePSPaperSize(tokens, fileName, line);
+ } else if (!cmd->cmp("psImageableArea")) {
+ parsePSImageableArea(tokens, fileName, line);
+ } else if (!cmd->cmp("psCrop")) {
+ parseYesNo("psCrop", &psCrop, tokens, fileName, line);
+ } else if (!cmd->cmp("psExpandSmaller")) {
+ parseYesNo("psExpandSmaller", &psExpandSmaller,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("psShrinkLarger")) {
+ parseYesNo("psShrinkLarger", &psShrinkLarger, tokens, fileName, line);
+ } else if (!cmd->cmp("psCenter")) {
+ parseYesNo("psCenter", &psCenter, tokens, fileName, line);
+ } else if (!cmd->cmp("psDuplex")) {
+ parseYesNo("psDuplex", &psDuplex, tokens, fileName, line);
+ } else if (!cmd->cmp("psLevel")) {
+ parsePSLevel(tokens, fileName, line);
+ } else if (!cmd->cmp("psEmbedType1Fonts")) {
+ parseYesNo("psEmbedType1", &psEmbedType1, tokens, fileName, line);
+ } else if (!cmd->cmp("psEmbedTrueTypeFonts")) {
+ parseYesNo("psEmbedTrueType", &psEmbedTrueType,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("psEmbedCIDPostScriptFonts")) {
+ parseYesNo("psEmbedCIDPostScript", &psEmbedCIDPostScript,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("psEmbedCIDTrueTypeFonts")) {
+ parseYesNo("psEmbedCIDTrueType", &psEmbedCIDTrueType,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("psPreload")) {
+ parseYesNo("psPreload", &psPreload, tokens, fileName, line);
+ } else if (!cmd->cmp("psOPI")) {
+ parseYesNo("psOPI", &psOPI, tokens, fileName, line);
+ } else if (!cmd->cmp("psASCIIHex")) {
+ parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
+ } else if (!cmd->cmp("textEncoding")) {
+// Always use UTF-8 and allow TQString do the magic
+// parseTextEncoding(tokens, fileName, line);
+ } else if (!cmd->cmp("textEOL")) {
+ parseTextEOL(tokens, fileName, line);
+ } else if (!cmd->cmp("textPageBreaks")) {
+ parseYesNo("textPageBreaks", &textPageBreaks,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("textKeepTinyChars")) {
+ parseYesNo("textKeepTinyChars", &textKeepTinyChars,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("fontDir")) {
+ parseFontDir(tokens, fileName, line);
+ } else if (!cmd->cmp("initialZoom")) {
+ parseInitialZoom(tokens, fileName, line);
+ } else if (!cmd->cmp("continuousView")) {
+ parseYesNo("continuousView", &continuousView, tokens, fileName, line);
+ } else if (!cmd->cmp("enableT1lib")) {
+ parseYesNo("enableT1lib", &enableT1lib, tokens, fileName, line);
+ } else if (!cmd->cmp("enableFreeType")) {
+ parseYesNo("enableFreeType", &enableFreeType, tokens, fileName, line);
+ } else if (!cmd->cmp("antialias")) {
+ parseYesNo("antialias", &antialias, tokens, fileName, line);
+ } else if (!cmd->cmp("vectorAntialias")) {
+ parseYesNo("vectorAntialias", &vectorAntialias,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("strokeAdjust")) {
+ parseYesNo("strokeAdjust", &strokeAdjust, tokens, fileName, line);
+ } else if (!cmd->cmp("screenType")) {
+ parseScreenType(tokens, fileName, line);
+ } else if (!cmd->cmp("screenSize")) {
+ parseInteger("screenSize", &screenSize, tokens, fileName, line);
+ } else if (!cmd->cmp("screenDotRadius")) {
+ parseInteger("screenDotRadius", &screenDotRadius,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("screenGamma")) {
+ parseFloat("screenGamma", &screenGamma,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("screenBlackThreshold")) {
+ parseFloat("screenBlackThreshold", &screenBlackThreshold,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("screenWhiteThreshold")) {
+ parseFloat("screenWhiteThreshold", &screenWhiteThreshold,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("urlCommand")) {
+ parseCommand("urlCommand", &urlCommand, tokens, fileName, line);
+ } else if (!cmd->cmp("movieCommand")) {
+ parseCommand("movieCommand", &movieCommand, tokens, fileName, line);
+ } else if (!cmd->cmp("mapNumericCharNames")) {
+ parseYesNo("mapNumericCharNames", &mapNumericCharNames,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("mapUnknownCharNames")) {
+ parseYesNo("mapUnknownCharNames", &mapUnknownCharNames,
+ tokens, fileName, line);
+ } else if (!cmd->cmp("bind")) {
+ parseBind(tokens, fileName, line);
+ } else if (!cmd->cmp("unbind")) {
+ parseUnbind(tokens, fileName, line);
+ } else if (!cmd->cmp("printCommands")) {
+ parseYesNo("printCommands", &printCommands, tokens, fileName, line);
+ } else if (!cmd->cmp("errQuiet")) {
+ parseYesNo("errQuiet", &errQuiet, tokens, fileName, line);
+ } else {
+ error(-1, "Unknown config file command '%s' (%s:%d)",
+ cmd->getCString(), fileName->getCString(), line);
+ if (!cmd->cmp("displayFontX") ||
+ !cmd->cmp("displayNamedCIDFontX") ||
+ !cmd->cmp("displayCIDFontX")) {
+ error(-1, "-- Xpdf no longer supports X fonts");
+ } else if (!cmd->cmp("t1libControl") || !cmd->cmp("freetypeControl")) {
+ error(-1, "-- The t1libControl and freetypeControl options have been replaced");
+ error(-1, " by the enableT1lib, enableFreeType, and antialias options");
+ } else if (!cmd->cmp("fontpath") || !cmd->cmp("fontmap")) {
+ error(-1, "-- the config file format has changed since Xpdf 0.9x");
+ }
+ }
+ }
+
+ deleteGList(tokens, GString);
+}
+
+void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
+ int line) {
+ GString *name;
+ char *tok1, *tok2;
+ FILE *f;
+ char buf[256];
+ int line2;
+ Unicode u;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'nameToUnicode' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ name = (GString *)tokens->get(1);
+ if (!(f = fopen(name->getCString(), "r"))) {
+ error(-1, "Couldn't open 'nameToUnicode' file '%s'",
+ name->getCString());
+ return;
+ }
+ line2 = 1;
+ while (getLine(buf, sizeof(buf), f)) {
+ tok1 = strtok(buf, " \t\r\n");
+ tok2 = strtok(NULL, " \t\r\n");
+ if (tok1 && tok2) {
+ sscanf(tok1, "%x", &u);
+ nameToUnicode->add(tok2, u);
+ } else {
+ error(-1, "Bad line in 'nameToUnicode' file (%s:%d)", name, line2);
+ }
+ ++line2;
+ }
+ fclose(f);
+}
+
+void GlobalParams::parseCIDToUnicode(GList *tokens, GString *fileName,
+ int line) {
+ GString *collection, *name, *old;
+
+ if (tokens->getLength() != 3) {
+ error(-1, "Bad 'cidToUnicode' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ collection = (GString *)tokens->get(1);
+ name = (GString *)tokens->get(2);
+ if ((old = (GString *)cidToUnicodes->remove(collection))) {
+ delete old;
+ }
+ cidToUnicodes->add(collection->copy(), name->copy());
+}
+
+void GlobalParams::parseUnicodeToUnicode(GList *tokens, GString *fileName,
+ int line) {
+ GString *font, *file, *old;
+
+ if (tokens->getLength() != 3) {
+ error(-1, "Bad 'unicodeToUnicode' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ font = (GString *)tokens->get(1);
+ file = (GString *)tokens->get(2);
+ if ((old = (GString *)unicodeToUnicodes->remove(font))) {
+ delete old;
+ }
+ unicodeToUnicodes->add(font->copy(), file->copy());
+}
+
+void GlobalParams::parseUnicodeMap(GList *tokens, GString *fileName,
+ int line) {
+ GString *encodingName, *name, *old;
+
+ if (tokens->getLength() != 3) {
+ error(-1, "Bad 'unicodeMap' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ encodingName = (GString *)tokens->get(1);
+ name = (GString *)tokens->get(2);
+ if ((old = (GString *)unicodeMaps->remove(encodingName))) {
+ delete old;
+ }
+ unicodeMaps->add(encodingName->copy(), name->copy());
+}
+
+void GlobalParams::parseCMapDir(GList *tokens, GString *fileName, int line) {
+ GString *collection, *dir;
+ GList *list;
+
+ if (tokens->getLength() != 3) {
+ error(-1, "Bad 'cMapDir' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ collection = (GString *)tokens->get(1);
+ dir = (GString *)tokens->get(2);
+ if (!(list = (GList *)cMapDirs->lookup(collection))) {
+ list = new GList();
+ cMapDirs->add(collection->copy(), list);
+ }
+ list->append(dir->copy());
+}
+
+void GlobalParams::parseToUnicodeDir(GList *tokens, GString *fileName,
+ int line) {
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'toUnicodeDir' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
+}
+
+void GlobalParams::parseDisplayFont(GList *tokens, GHash *fontHash,
+ DisplayFontParamKind kind,
+ GString *fileName, int line) {
+ DisplayFontParam *param, *old;
+ struct stat statbuf;
+
+ if (tokens->getLength() < 2) {
+ goto err1;
+ }
+ param = new DisplayFontParam(((GString *)tokens->get(1))->copy(), kind);
+
+ switch (kind) {
+ case displayFontT1:
+ if (tokens->getLength() != 3) {
+ goto err2;
+ }
+ param->t1.fileName = ((GString *)tokens->get(2))->copy();
+ if (stat((param->t1.fileName->getCString)(), &statbuf)) {
+ delete param; // silently ignore non-existing files
+ return;
+ }
+ break;
+ case displayFontTT:
+ if (tokens->getLength() < 3) {
+ goto err2;
+ }
+ param->tt.fileName = ((GString *)tokens->get(2))->copy();
+ if (stat((param->tt.fileName->getCString)(), &statbuf)) {
+ delete param; // silently ignore non-existing files
+ return;
+ }
+ if (tokens->getLength() > 3)
+ param->tt.faceIndex = atoi(((GString *)tokens->get(3))->getCString());
+ else
+ param->tt.faceIndex = 0;
+ break;
+ }
+
+ if ((old = (DisplayFontParam *)fontHash->remove(param->name))) {
+ delete old;
+ }
+ fontHash->add(param->name, param);
+ return;
+
+ err2:
+ delete param;
+ err1:
+ error(-1, "Bad 'display*Font*' config file command (%s:%d)",
+ fileName->getCString(), line);
+}
+
+void GlobalParams::parsePSPaperSize(GList *tokens, GString *fileName,
+ int line) {
+ GString *tok;
+
+ if (tokens->getLength() == 2) {
+ tok = (GString *)tokens->get(1);
+ if (!setPSPaperSize(tok->getCString())) {
+ error(-1, "Bad 'psPaperSize' config file command (%s:%d)",
+ fileName->getCString(), line);
+ }
+ } else if (tokens->getLength() == 3) {
+ tok = (GString *)tokens->get(1);
+ psPaperWidth = atoi(tok->getCString());
+ tok = (GString *)tokens->get(2);
+ psPaperHeight = atoi(tok->getCString());
+ psImageableLLX = psImageableLLY = 0;
+ psImageableURX = psPaperWidth;
+ psImageableURY = psPaperHeight;
+ } else {
+ error(-1, "Bad 'psPaperSize' config file command (%s:%d)",
+ fileName->getCString(), line);
+ }
+}
+
+void GlobalParams::parsePSImageableArea(GList *tokens, GString *fileName,
+ int line) {
+ if (tokens->getLength() != 5) {
+ error(-1, "Bad 'psImageableArea' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ psImageableLLX = atoi(((GString *)tokens->get(1))->getCString());
+ psImageableLLY = atoi(((GString *)tokens->get(2))->getCString());
+ psImageableURX = atoi(((GString *)tokens->get(3))->getCString());
+ psImageableURY = atoi(((GString *)tokens->get(4))->getCString());
+}
+
+void GlobalParams::parsePSLevel(GList *tokens, GString *fileName, int line) {
+ GString *tok;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'psLevel' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(1);
+ if (!tok->cmp("level1")) {
+ psLevel = psLevel1;
+ } else if (!tok->cmp("level1sep")) {
+ psLevel = psLevel1Sep;
+ } else if (!tok->cmp("level2")) {
+ psLevel = psLevel2;
+ } else if (!tok->cmp("level2sep")) {
+ psLevel = psLevel2Sep;
+ } else if (!tok->cmp("level3")) {
+ psLevel = psLevel3;
+ } else if (!tok->cmp("level3Sep")) {
+ psLevel = psLevel3Sep;
+ } else {
+ error(-1, "Bad 'psLevel' config file command (%s:%d)",
+ fileName->getCString(), line);
+ }
+}
+
+void GlobalParams::parsePSFile(GList *tokens, GString *fileName, int line) {
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'psFile' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ if (psFile) {
+ delete psFile;
+ }
+ psFile = ((GString *)tokens->get(1))->copy();
+}
+
+void GlobalParams::parsePSFont(GList *tokens, GString *fileName, int line) {
+ PSFontParam *param;
+
+ if (tokens->getLength() != 3) {
+ error(-1, "Bad 'psFont' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ param = new PSFontParam(((GString *)tokens->get(1))->copy(), 0,
+ ((GString *)tokens->get(2))->copy(), NULL);
+ psFonts->add(param->pdfFontName, param);
+}
+
+void GlobalParams::parsePSFont16(char *cmdName, GList *fontList,
+ GList *tokens, GString *fileName, int line) {
+ PSFontParam *param;
+ int wMode;
+ GString *tok;
+
+ if (tokens->getLength() != 5) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(2);
+ if (!tok->cmp("H")) {
+ wMode = 0;
+ } else if (!tok->cmp("V")) {
+ wMode = 1;
+ } else {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ param = new PSFontParam(((GString *)tokens->get(1))->copy(),
+ wMode,
+ ((GString *)tokens->get(3))->copy(),
+ ((GString *)tokens->get(4))->copy());
+ fontList->append(param);
+}
+
+void GlobalParams::parseTextEncoding(GList *tokens, GString *fileName,
+ int line) {
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'textEncoding' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ delete textEncoding;
+ textEncoding = ((GString *)tokens->get(1))->copy();
+}
+
+void GlobalParams::parseTextEOL(GList *tokens, GString *fileName, int line) {
+ GString *tok;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'textEOL' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(1);
+ if (!tok->cmp("unix")) {
+ textEOL = eolUnix;
+ } else if (!tok->cmp("dos")) {
+ textEOL = eolDOS;
+ } else if (!tok->cmp("mac")) {
+ textEOL = eolMac;
+ } else {
+ error(-1, "Bad 'textEOL' config file command (%s:%d)",
+ fileName->getCString(), line);
+ }
+}
+
+void GlobalParams::parseFontDir(GList *tokens, GString *fileName, int line) {
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'fontDir' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ fontDirs->append(((GString *)tokens->get(1))->copy());
+}
+
+void GlobalParams::parseInitialZoom(GList *tokens,
+ GString *fileName, int line) {
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'initialZoom' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ delete initialZoom;
+ initialZoom = ((GString *)tokens->get(1))->copy();
+}
+
+void GlobalParams::parseScreenType(GList *tokens, GString *fileName,
+ int line) {
+ GString *tok;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad 'screenType' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(1);
+ if (!tok->cmp("dispersed")) {
+ screenType = screenDispersed;
+ } else if (!tok->cmp("clustered")) {
+ screenType = screenClustered;
+ } else if (!tok->cmp("stochasticClustered")) {
+ screenType = screenStochasticClustered;
+ } else {
+ error(-1, "Bad 'screenType' config file command (%s:%d)",
+ fileName->getCString(), line);
+ }
+}
+
+void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) {
+ KeyBinding *binding;
+ GList *cmds;
+ int code, mods, context, i;
+
+ if (tokens->getLength() < 4) {
+ error(-1, "Bad 'bind' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ if (!parseKey((GString *)tokens->get(1), (GString *)tokens->get(2),
+ &code, &mods, &context,
+ "bind", tokens, fileName, line)) {
+ return;
+ }
+ for (i = 0; i < keyBindings->getLength(); ++i) {
+ binding = (KeyBinding *)keyBindings->get(i);
+ if (binding->code == code &&
+ binding->mods == mods &&
+ binding->context == context) {
+ delete (KeyBinding *)keyBindings->del(i);
+ break;
+ }
+ }
+ cmds = new GList();
+ for (i = 3; i < tokens->getLength(); ++i) {
+ cmds->append(((GString *)tokens->get(i))->copy());
+ }
+ keyBindings->append(new KeyBinding(code, mods, context, cmds));
+}
+
+void GlobalParams::parseUnbind(GList *tokens, GString *fileName, int line) {
+ KeyBinding *binding;
+ int code, mods, context, i;
+
+ if (tokens->getLength() != 3) {
+ error(-1, "Bad 'unbind' config file command (%s:%d)",
+ fileName->getCString(), line);
+ return;
+ }
+ if (!parseKey((GString *)tokens->get(1), (GString *)tokens->get(2),
+ &code, &mods, &context,
+ "unbind", tokens, fileName, line)) {
+ return;
+ }
+ for (i = 0; i < keyBindings->getLength(); ++i) {
+ binding = (KeyBinding *)keyBindings->get(i);
+ if (binding->code == code &&
+ binding->mods == mods &&
+ binding->context == context) {
+ delete (KeyBinding *)keyBindings->del(i);
+ break;
+ }
+ }
+}
+
+GBool GlobalParams::parseKey(GString *modKeyStr, GString *contextStr,
+ int *code, int *mods, int *context,
+ char *cmdName,
+ GList * /*tokens*/, GString *fileName, int line) {
+ char *p0;
+
+ *mods = xpdfKeyModNone;
+ p0 = modKeyStr->getCString();
+ while (1) {
+ if (!strncmp(p0, "shift-", 6)) {
+ *mods |= xpdfKeyModShift;
+ p0 += 6;
+ } else if (!strncmp(p0, "ctrl-", 5)) {
+ *mods |= xpdfKeyModCtrl;
+ p0 += 5;
+ } else if (!strncmp(p0, "alt-", 4)) {
+ *mods |= xpdfKeyModAlt;
+ p0 += 4;
+ } else {
+ break;
+ }
+ }
+
+ if (!strcmp(p0, "space")) {
+ *code = ' ';
+ } else if (!strcmp(p0, "tab")) {
+ *code = xpdfKeyCodeTab;
+ } else if (!strcmp(p0, "return")) {
+ *code = xpdfKeyCodeReturn;
+ } else if (!strcmp(p0, "enter")) {
+ *code = xpdfKeyCodeEnter;
+ } else if (!strcmp(p0, "backspace")) {
+ *code = xpdfKeyCodeBackspace;
+ } else if (!strcmp(p0, "insert")) {
+ *code = xpdfKeyCodeInsert;
+ } else if (!strcmp(p0, "delete")) {
+ *code = xpdfKeyCodeDelete;
+ } else if (!strcmp(p0, "home")) {
+ *code = xpdfKeyCodeHome;
+ } else if (!strcmp(p0, "end")) {
+ *code = xpdfKeyCodeEnd;
+ } else if (!strcmp(p0, "pgup")) {
+ *code = xpdfKeyCodePgUp;
+ } else if (!strcmp(p0, "pgdn")) {
+ *code = xpdfKeyCodePgDn;
+ } else if (!strcmp(p0, "left")) {
+ *code = xpdfKeyCodeLeft;
+ } else if (!strcmp(p0, "right")) {
+ *code = xpdfKeyCodeRight;
+ } else if (!strcmp(p0, "up")) {
+ *code = xpdfKeyCodeUp;
+ } else if (!strcmp(p0, "down")) {
+ *code = xpdfKeyCodeDown;
+ } else if (p0[0] == 'f' && p0[1] >= '1' && p0[1] <= '9' && !p0[2]) {
+ *code = xpdfKeyCodeF1 + (p0[1] - '1');
+ } else if (p0[0] == 'f' &&
+ ((p0[1] >= '1' && p0[1] <= '2' && p0[2] >= '0' && p0[2] <= '9') ||
+ (p0[1] == '3' && p0[2] >= '0' && p0[2] <= '5')) &&
+ !p0[3]) {
+ *code = xpdfKeyCodeF1 + 10 * (p0[1] - '0') + (p0[2] - '0') - 1;
+ } else if (!strncmp(p0, "mousePress", 10) &&
+ p0[10] >= '1' && p0[10] <= '7' && !p0[11]) {
+ *code = xpdfKeyCodeMousePress1 + (p0[10] - '1');
+ } else if (!strncmp(p0, "mouseRelease", 12) &&
+ p0[12] >= '1' && p0[12] <= '7' && !p0[13]) {
+ *code = xpdfKeyCodeMouseRelease1 + (p0[12] - '1');
+ } else if (*p0 >= 0x20 && *p0 <= 0x7e && !p0[1]) {
+ *code = (int)*p0;
+ } else {
+ error(-1, "Bad key/modifier in '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return gFalse;
+ }
+
+ p0 = contextStr->getCString();
+ if (!strcmp(p0, "any")) {
+ *context = xpdfKeyContextAny;
+ } else {
+ *context = xpdfKeyContextAny;
+ while (1) {
+ if (!strncmp(p0, "fullScreen", 10)) {
+ *context |= xpdfKeyContextFullScreen;
+ p0 += 10;
+ } else if (!strncmp(p0, "window", 6)) {
+ *context |= xpdfKeyContextWindow;
+ p0 += 6;
+ } else if (!strncmp(p0, "continuous", 10)) {
+ *context |= xpdfKeyContextContinuous;
+ p0 += 10;
+ } else if (!strncmp(p0, "singlePage", 10)) {
+ *context |= xpdfKeyContextSinglePage;
+ p0 += 10;
+ } else if (!strncmp(p0, "overLink", 8)) {
+ *context |= xpdfKeyContextOverLink;
+ p0 += 8;
+ } else if (!strncmp(p0, "offLink", 7)) {
+ *context |= xpdfKeyContextOffLink;
+ p0 += 7;
+ } else if (!strncmp(p0, "outline", 7)) {
+ *context |= xpdfKeyContextOutline;
+ p0 += 7;
+ } else if (!strncmp(p0, "mainWin", 7)) {
+ *context |= xpdfKeyContextMainWin;
+ p0 += 7;
+ } else if (!strncmp(p0, "scrLockOn", 9)) {
+ *context |= xpdfKeyContextScrLockOn;
+ p0 += 9;
+ } else if (!strncmp(p0, "scrLockOff", 10)) {
+ *context |= xpdfKeyContextScrLockOff;
+ p0 += 10;
+ } else {
+ error(-1, "Bad context in '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return gFalse;
+ }
+ if (!*p0) {
+ break;
+ }
+ if (*p0 != ',') {
+ error(-1, "Bad context in '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return gFalse;
+ }
+ ++p0;
+ }
+ }
+
+ return gTrue;
+}
+
+void GlobalParams::parseCommand(char *cmdName, GString **val,
+ GList *tokens, GString *fileName, int line) {
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ if (*val) {
+ delete *val;
+ }
+ *val = ((GString *)tokens->get(1))->copy();
+}
+
+void GlobalParams::parseYesNo(char *cmdName, GBool *flag,
+ GList *tokens, GString *fileName, int line) {
+ GString *tok;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(1);
+ if (!parseYesNo2(tok->getCString(), flag)) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ }
+}
+
+GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
+ if (!strcmp(token, "yes")) {
+ *flag = gTrue;
+ } else if (!strcmp(token, "no")) {
+ *flag = gFalse;
+ } else {
+ return gFalse;
+ }
+ return gTrue;
+}
+
+void GlobalParams::parseInteger(char *cmdName, int *val,
+ GList *tokens, GString *fileName, int line) {
+ GString *tok;
+ int i;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(1);
+ if (tok->getLength() == 0) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ if (tok->getChar(0) == '-') {
+ i = 1;
+ } else {
+ i = 0;
+ }
+ for (; i < tok->getLength(); ++i) {
+ if (tok->getChar(i) < '0' || tok->getChar(i) > '9') {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ }
+ *val = atoi(tok->getCString());
+}
+
+void GlobalParams::parseFloat(char *cmdName, double *val,
+ GList *tokens, GString *fileName, int line) {
+ GString *tok;
+ int i;
+
+ if (tokens->getLength() != 2) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ tok = (GString *)tokens->get(1);
+ if (tok->getLength() == 0) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ if (tok->getChar(0) == '-') {
+ i = 1;
+ } else {
+ i = 0;
+ }
+ for (; i < tok->getLength(); ++i) {
+ if (!((tok->getChar(i) >= '0' && tok->getChar(i) <= '9') ||
+ tok->getChar(i) == '.')) {
+ error(-1, "Bad '%s' config file command (%s:%d)",
+ cmdName, fileName->getCString(), line);
+ return;
+ }
+ }
+ *val = atof(tok->getCString());
+}
+
+GlobalParams::~GlobalParams() {
+ GHashIter *iter;
+ GString *key;
+ GList *list;
+
+ freeBuiltinFontTables();
+
+ delete macRomanReverseMap;
+
+ delete baseDir;
+ delete nameToUnicode;
+ deleteGHash(cidToUnicodes, GString);
+ deleteGHash(unicodeToUnicodes, GString);
+ deleteGHash(residentUnicodeMaps, UnicodeMap);
+ deleteGHash(unicodeMaps, GString);
+ deleteGList(toUnicodeDirs, GString);
+ deleteGHash(displayFonts, DisplayFontParam);
+ deleteGHash(displayCIDFonts, DisplayFontParam);
+ deleteGHash(displayNamedCIDFonts, DisplayFontParam);
+#ifdef WIN32
+ if (winFontList) {
+ delete winFontList;
+ }
+#endif
+ if (psFile) {
+ delete psFile;
+ }
+ deleteGHash(psFonts, PSFontParam);
+ deleteGList(psNamedFonts16, PSFontParam);
+ deleteGList(psFonts16, PSFontParam);
+ delete textEncoding;
+ deleteGList(fontDirs, GString);
+ delete initialZoom;
+ if (urlCommand) {
+ delete urlCommand;
+ }
+ if (movieCommand) {
+ delete movieCommand;
+ }
+ deleteGList(keyBindings, KeyBinding);
+
+ cMapDirs->startIter(&iter);
+ while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
+ deleteGList(list, GString);
+ }
+ delete cMapDirs;
+
+ delete cidToUnicodeCache;
+ delete unicodeToUnicodeCache;
+ delete unicodeMapCache;
+ delete cMapCache;
+
+#ifdef ENABLE_PLUGINS
+ delete securityHandlers;
+ deleteGList(plugins, Plugin);
+#endif
+
+#if MULTITHREADED
+ gDestroyMutex(&mutex);
+ gDestroyMutex(&unicodeMapCacheMutex);
+ gDestroyMutex(&cMapCacheMutex);
+#endif
+}
+
+//------------------------------------------------------------------------
+
+void GlobalParams::setBaseDir(char *dir) {
+ delete baseDir;
+ baseDir = new GString(dir);
+}
+
+void GlobalParams::setupBaseFonts(char *dir) {
+ GString *fontName;
+ GString *fileName;
+#ifdef WIN32
+ HMODULE shell32Lib;
+ BOOL (__stdcall *SHGetSpecialFolderPathFunc)(HWND hwndOwner,
+ LPTSTR lpszPath,
+ int nFolder,
+ BOOL fCreate);
+ char winFontDir[MAX_PATH];
+#endif
+ FILE *f;
+ DisplayFontParamKind kind;
+ DisplayFontParam *dfp;
+ int i, j;
+
+#ifdef WIN32
+ // SHGetSpecialFolderPath isn't available in older versions of
+ // shell32.dll (Win95 and WinNT4), so do a dynamic load
+ winFontDir[0] = '\0';
+ if ((shell32Lib = LoadLibrary("shell32.dll"))) {
+ if ((SHGetSpecialFolderPathFunc =
+ (BOOL (__stdcall *)(HWND hwndOwner, LPTSTR lpszPath,
+ int nFolder, BOOL fCreate))
+ GetProcAddress(shell32Lib, "SHGetSpecialFolderPathA"))) {
+ if (!(*SHGetSpecialFolderPathFunc)(NULL, winFontDir,
+ CSIDL_FONTS, FALSE)) {
+ winFontDir[0] = '\0';
+ }
+ }
+ }
+#endif
+ for (i = 0; displayFontTab[i].name; ++i) {
+ fontName = new GString(displayFontTab[i].name);
+ fileName = NULL;
+ kind = displayFontT1; // make gcc happy
+ if (dir) {
+ fileName = appendToPath(new GString(dir), displayFontTab[i].t1FileName);
+ kind = displayFontT1;
+ if ((f = fopen(fileName->getCString(), "rb"))) {
+ fclose(f);
+ } else {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+#ifdef WIN32
+ if (!fileName && winFontDir[0] && displayFontTab[i].ttFileName) {
+ fileName = appendToPath(new GString(winFontDir),
+ displayFontTab[i].ttFileName);
+ kind = displayFontTT;
+ if ((f = fopen(fileName->getCString(), "rb"))) {
+ fclose(f);
+ } else {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+ // SHGetSpecialFolderPath(CSIDL_FONTS) doesn't work on Win 2k Server
+ // or Win2003 Server, or with older versions of shell32.dll, so check
+ // the "standard" directories
+ if (displayFontTab[i].ttFileName) {
+ for (j = 0; !fileName && displayFontDirs[j]; ++j) {
+ fileName = appendToPath(new GString(displayFontDirs[j]),
+ displayFontTab[i].ttFileName);
+ kind = displayFontTT;
+ if ((f = fopen(fileName->getCString(), "rb"))) {
+ fclose(f);
+ } else {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+ }
+#else
+ for (j = 0; !fileName && displayFontDirs[j]; ++j) {
+ fileName = appendToPath(new GString(displayFontDirs[j]),
+ displayFontTab[i].t1FileName);
+ kind = displayFontT1;
+ if ((f = fopen(fileName->getCString(), "rb"))) {
+ fclose(f);
+ } else {
+ delete fileName;
+ fileName = NULL;
+ }
+ }
+#endif
+ if (!fileName) {
+ error(-1, "No display font for '%s'", displayFontTab[i].name);
+ delete fontName;
+ continue;
+ }
+ dfp = new DisplayFontParam(fontName, kind);
+ dfp->t1.fileName = fileName;
+ globalParams->addDisplayFont(dfp);
+ }
+
+#ifdef WIN32
+ if (winFontDir[0]) {
+ winFontList = new WinFontList(winFontDir);
+ }
+#endif
+}
+
+//------------------------------------------------------------------------
+// accessors
+//------------------------------------------------------------------------
+
+CharCode GlobalParams::getMacRomanCharCode(char *charName) {
+ // no need to lock - macRomanReverseMap is constant
+ return macRomanReverseMap->lookup(charName);
+}
+
+GString *GlobalParams::getBaseDir() {
+ GString *s;
+
+ lockGlobalParams;
+ s = baseDir->copy();
+ unlockGlobalParams;
+ return s;
+}
+
+Unicode GlobalParams::mapNameToUnicode(char *charName) {
+ // no need to lock - nameToUnicode is constant
+ return nameToUnicode->lookup(charName);
+}
+
+UnicodeMap *GlobalParams::getResidentUnicodeMap(GString *encodingName) {
+ UnicodeMap *map;
+
+ lockGlobalParams;
+ map = (UnicodeMap *)residentUnicodeMaps->lookup(encodingName);
+ unlockGlobalParams;
+ if (map) {
+ map->incRefCnt();
+ }
+ return map;
+}
+
+FILE *GlobalParams::getUnicodeMapFile(GString *encodingName) {
+ GString *fileName;
+ FILE *f;
+
+ lockGlobalParams;
+ if ((fileName = (GString *)unicodeMaps->lookup(encodingName))) {
+ f = fopen(fileName->getCString(), "r");
+ } else {
+ f = NULL;
+ }
+ unlockGlobalParams;
+ return f;
+}
+
+FILE *GlobalParams::findCMapFile(GString *collection, GString *cMapName) {
+ GList *list;
+ GString *dir;
+ GString *fileName;
+ FILE *f;
+ int i;
+
+ lockGlobalParams;
+ if (!(list = (GList *)cMapDirs->lookup(collection))) {
+ unlockGlobalParams;
+ return NULL;
+ }
+ for (i = 0; i < list->getLength(); ++i) {
+ dir = (GString *)list->get(i);
+ fileName = appendToPath(dir->copy(), cMapName->getCString());
+ f = fopen(fileName->getCString(), "r");
+ delete fileName;
+ if (f) {
+ unlockGlobalParams;
+ return f;
+ }
+ }
+ unlockGlobalParams;
+ return NULL;
+}
+
+FILE *GlobalParams::findToUnicodeFile(GString *name) {
+ GString *dir, *fileName;
+ FILE *f;
+ int i;
+
+ lockGlobalParams;
+ for (i = 0; i < toUnicodeDirs->getLength(); ++i) {
+ dir = (GString *)toUnicodeDirs->get(i);
+ fileName = appendToPath(dir->copy(), name->getCString());
+ f = fopen(fileName->getCString(), "r");
+ delete fileName;
+ if (f) {
+ unlockGlobalParams;
+ return f;
+ }
+ }
+ unlockGlobalParams;
+ return NULL;
+}
+
+// KPDF: parse xpdf font name into family and style
+// Helvetica-BoldOblique => name=Helvetica, weight=Bold, slant=Oblique
+
+void parseStyle(TQString& name, int& weight, int& slant, int& width)
+{
+ if (name.find("MS-") == 0) name = "MS " + name.remove(0,3);
+
+ if (!name.contains('-') && !name.contains(',')) return;
+ TQString type = name.section(TQRegExp("[-,]"),-1);
+ name = name.section(TQRegExp("[-,]"),0,-2);
+ if (type.contains("Oblique")) slant=FC_SLANT_OBLIQUE;
+ if (type.contains("Italic")) slant=FC_SLANT_ITALIC;
+ if (type.contains("Bold")) weight=FC_WEIGHT_BOLD;
+ if (type.contains("Light")) weight=FC_WEIGHT_LIGHT;
+ if (type.contains("Condensed")) width=FC_WIDTH_CONDENSED;
+}
+
+DisplayFontParam *GlobalParams::getDisplayFont(GString *fontName) {
+ DisplayFontParam *dfp;
+ FcPattern *p=0,*m=0;
+ FcChar8* s;
+ char * ext;
+ FcResult res;
+
+ lockGlobalParams;
+ dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
+ // KPDF: try to find font using Xft
+ if (!dfp) {
+ int weight=FC_WEIGHT_MEDIUM, slant=FC_SLANT_ROMAN, width=FC_WIDTH_NORMAL;
+ TQString name(fontName->getCString());
+
+ parseStyle(name,weight,slant,width);
+ p = FcPatternBuild(0,FC_FAMILY,FcTypeString, name.ascii(),
+ FC_SLANT, FcTypeInteger, slant, FC_WEIGHT, FcTypeInteger, weight,
+ FC_WIDTH, FcTypeInteger, width, FC_LANG, FcTypeString, "xx", (char*)0);
+ if (!p) goto fin;
+ m = XftFontMatch(tqt_xdisplay(),tqt_xscreen(),p,&res);
+ if (!m) goto fin;
+ res = FcPatternGetString (m, FC_FILE, 0, &s);
+ if (res != FcResultMatch || !s) goto fin;
+ ext = rindex((char*)s,'.');
+ if (!ext) goto fin;
+ if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext,".ttc",4)) {
+ dfp = new DisplayFontParam(fontName->copy(), displayFontTT);
+ dfp->tt.fileName = new GString((char*)s);
+ FcPatternGetInteger(m, FC_INDEX, 0, &(dfp->tt.faceIndex));
+ } else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4)) {
+ dfp = new DisplayFontParam(fontName->copy(), displayFontT1);
+ dfp->t1.fileName = new GString((char*)s);
+ } else goto fin;
+ displayFonts->add(dfp->name,dfp);
+ }
+fin: unlockGlobalParams;
+ if (m) FcPatternDestroy(m);
+ if (p) FcPatternDestroy(p);
+ return dfp;
+}
+
+DisplayFontParam *GlobalParams::getDisplayCIDFont(GString *fontName,
+ GString *collection) {
+ DisplayFontParam *dfp;
+
+ lockGlobalParams;
+ if (!fontName ||
+ !(dfp = (DisplayFontParam *)displayNamedCIDFonts->lookup(fontName))) {
+ dfp = (DisplayFontParam *)displayCIDFonts->lookup(collection);
+ }
+ unlockGlobalParams;
+ if (!dfp) dfp = getDisplayFont(fontName);
+ return dfp;
+}
+
+GString *GlobalParams::getPSFile() {
+ GString *s;
+
+ lockGlobalParams;
+ s = psFile ? psFile->copy() : (GString *)NULL;
+ unlockGlobalParams;
+ return s;
+}
+
+int GlobalParams::getPSPaperWidth() {
+ int w;
+
+ lockGlobalParams;
+ w = psPaperWidth;
+ unlockGlobalParams;
+ return w;
+}
+
+int GlobalParams::getPSPaperHeight() {
+ int h;
+
+ lockGlobalParams;
+ h = psPaperHeight;
+ unlockGlobalParams;
+ return h;
+}
+
+void GlobalParams::getPSImageableArea(int *llx, int *lly, int *urx, int *ury) {
+ lockGlobalParams;
+ *llx = psImageableLLX;
+ *lly = psImageableLLY;
+ *urx = psImageableURX;
+ *ury = psImageableURY;
+ unlockGlobalParams;
+}
+
+GBool GlobalParams::getPSCrop() {
+ GBool f;
+
+ lockGlobalParams;
+ f = psCrop;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getPSExpandSmaller() {
+ GBool f;
+
+ lockGlobalParams;
+ f = psExpandSmaller;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getPSShrinkLarger() {
+ GBool f;
+
+ lockGlobalParams;
+ f = psShrinkLarger;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getPSCenter() {
+ GBool f;
+
+ lockGlobalParams;
+ f = psCenter;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getPSDuplex() {
+ GBool d;
+
+ lockGlobalParams;
+ d = psDuplex;
+ unlockGlobalParams;
+ return d;
+}
+
+PSLevel GlobalParams::getPSLevel() {
+ PSLevel level;
+
+ lockGlobalParams;
+ level = psLevel;
+ unlockGlobalParams;
+ return level;
+}
+
+PSFontParam *GlobalParams::getPSFont(GString *fontName) {
+ PSFontParam *p;
+
+ lockGlobalParams;
+ p = (PSFontParam *)psFonts->lookup(fontName);
+ unlockGlobalParams;
+ return p;
+}
+
+PSFontParam *GlobalParams::getPSFont16(GString *fontName,
+ GString *collection, int wMode) {
+ PSFontParam *p;
+ int i;
+
+ lockGlobalParams;
+ p = NULL;
+ if (fontName) {
+ for (i = 0; i < psNamedFonts16->getLength(); ++i) {
+ p = (PSFontParam *)psNamedFonts16->get(i);
+ if (!p->pdfFontName->cmp(fontName) &&
+ p->wMode == wMode) {
+ break;
+ }
+ p = NULL;
+ }
+ }
+ if (!p && collection) {
+ for (i = 0; i < psFonts16->getLength(); ++i) {
+ p = (PSFontParam *)psFonts16->get(i);
+ if (!p->pdfFontName->cmp(collection) &&
+ p->wMode == wMode) {
+ break;
+ }
+ p = NULL;
+ }
+ }
+ unlockGlobalParams;
+ return p;
+}
+
+GBool GlobalParams::getPSEmbedType1() {
+ GBool e;
+
+ lockGlobalParams;
+ e = psEmbedType1;
+ unlockGlobalParams;
+ return e;
+}
+
+GBool GlobalParams::getPSEmbedTrueType() {
+ GBool e;
+
+ lockGlobalParams;
+ e = psEmbedTrueType;
+ unlockGlobalParams;
+ return e;
+}
+
+GBool GlobalParams::getPSEmbedCIDPostScript() {
+ GBool e;
+
+ lockGlobalParams;
+ e = psEmbedCIDPostScript;
+ unlockGlobalParams;
+ return e;
+}
+
+GBool GlobalParams::getPSEmbedCIDTrueType() {
+ GBool e;
+
+ lockGlobalParams;
+ e = psEmbedCIDTrueType;
+ unlockGlobalParams;
+ return e;
+}
+
+GBool GlobalParams::getPSPreload() {
+ GBool preload;
+
+ lockGlobalParams;
+ preload = psPreload;
+ unlockGlobalParams;
+ return preload;
+}
+
+GBool GlobalParams::getPSOPI() {
+ GBool opi;
+
+ lockGlobalParams;
+ opi = psOPI;
+ unlockGlobalParams;
+ return opi;
+}
+
+GBool GlobalParams::getPSASCIIHex() {
+ GBool ah;
+
+ lockGlobalParams;
+ ah = psASCIIHex;
+ unlockGlobalParams;
+ return ah;
+}
+
+GString *GlobalParams::getTextEncodingName() {
+ GString *s;
+
+ lockGlobalParams;
+ s = textEncoding->copy();
+ unlockGlobalParams;
+ return s;
+}
+
+EndOfLineKind GlobalParams::getTextEOL() {
+ EndOfLineKind eol;
+
+ lockGlobalParams;
+ eol = textEOL;
+ unlockGlobalParams;
+ return eol;
+}
+
+GBool GlobalParams::getTextPageBreaks() {
+ GBool pageBreaks;
+
+ lockGlobalParams;
+ pageBreaks = textPageBreaks;
+ unlockGlobalParams;
+ return pageBreaks;
+}
+
+GBool GlobalParams::getTextKeepTinyChars() {
+ GBool tiny;
+
+ lockGlobalParams;
+ tiny = textKeepTinyChars;
+ unlockGlobalParams;
+ return tiny;
+}
+
+GString *GlobalParams::findFontFile(GString *fontName, char **exts) {
+ GString *dir, *fileName;
+ char **ext;
+ FILE *f;
+ int i;
+
+ lockGlobalParams;
+ for (i = 0; i < fontDirs->getLength(); ++i) {
+ dir = (GString *)fontDirs->get(i);
+ for (ext = exts; *ext; ++ext) {
+ fileName = appendToPath(dir->copy(), fontName->getCString());
+ fileName->append(*ext);
+ if ((f = fopen(fileName->getCString(), "rb"))) {
+ fclose(f);
+ unlockGlobalParams;
+ return fileName;
+ }
+ delete fileName;
+ }
+ }
+ unlockGlobalParams;
+ return NULL;
+}
+
+GString *GlobalParams::getInitialZoom() {
+ GString *s;
+
+ lockGlobalParams;
+ s = initialZoom->copy();
+ unlockGlobalParams;
+ return s;
+}
+
+GBool GlobalParams::getContinuousView() {
+ GBool f;
+
+ lockGlobalParams;
+ f = continuousView;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getEnableT1lib() {
+ GBool f;
+
+ lockGlobalParams;
+ f = enableT1lib;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getEnableFreeType() {
+ GBool f;
+
+ lockGlobalParams;
+ f = enableFreeType;
+ unlockGlobalParams;
+ return f;
+}
+
+
+GBool GlobalParams::getAntialias() {
+ GBool f;
+
+ lockGlobalParams;
+ f = antialias;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getVectorAntialias() {
+ GBool f;
+
+ lockGlobalParams;
+ f = vectorAntialias;
+ unlockGlobalParams;
+ return f;
+}
+
+GBool GlobalParams::getStrokeAdjust() {
+ GBool f;
+
+ lockGlobalParams;
+ f = strokeAdjust;
+ unlockGlobalParams;
+ return f;
+}
+
+ScreenType GlobalParams::getScreenType() {
+ ScreenType t;
+
+ lockGlobalParams;
+ t = screenType;
+ unlockGlobalParams;
+ return t;
+}
+
+int GlobalParams::getScreenSize() {
+ int size;
+
+ lockGlobalParams;
+ size = screenSize;
+ unlockGlobalParams;
+ return size;
+}
+
+int GlobalParams::getScreenDotRadius() {
+ int r;
+
+ lockGlobalParams;
+ r = screenDotRadius;
+ unlockGlobalParams;
+ return r;
+}
+
+double GlobalParams::getScreenGamma() {
+ double gamma;
+
+ lockGlobalParams;
+ gamma = screenGamma;
+ unlockGlobalParams;
+ return gamma;
+}
+
+double GlobalParams::getScreenBlackThreshold() {
+ double thresh;
+
+ lockGlobalParams;
+ thresh = screenBlackThreshold;
+ unlockGlobalParams;
+ return thresh;
+}
+
+double GlobalParams::getScreenWhiteThreshold() {
+ double thresh;
+
+ lockGlobalParams;
+ thresh = screenWhiteThreshold;
+ unlockGlobalParams;
+ return thresh;
+}
+
+GBool GlobalParams::getMapNumericCharNames() {
+ GBool map;
+
+ lockGlobalParams;
+ map = mapNumericCharNames;
+ unlockGlobalParams;
+ return map;
+}
+
+GBool GlobalParams::getMapUnknownCharNames() {
+ GBool map;
+
+ lockGlobalParams;
+ map = mapUnknownCharNames;
+ unlockGlobalParams;
+ return map;
+}
+
+GList *GlobalParams::getKeyBinding(int code, int mods, int context) {
+ KeyBinding *binding;
+ GList *cmds;
+ int modMask;
+ int i, j;
+
+ lockGlobalParams;
+ cmds = NULL;
+ // for ASCII chars, ignore the shift modifier
+ modMask = code <= 0xff ? ~xpdfKeyModShift : ~0;
+ for (i = 0; i < keyBindings->getLength(); ++i) {
+ binding = (KeyBinding *)keyBindings->get(i);
+ if (binding->code == code &&
+ (binding->mods & modMask) == (mods & modMask) &&
+ (~binding->context | context) == ~0) {
+ cmds = new GList();
+ for (j = 0; j < binding->cmds->getLength(); ++j) {
+ cmds->append(((GString *)binding->cmds->get(j))->copy());
+ }
+ break;
+ }
+ }
+ unlockGlobalParams;
+ return cmds;
+}
+
+GBool GlobalParams::getPrintCommands() {
+ GBool p;
+
+ lockGlobalParams;
+ p = printCommands;
+ unlockGlobalParams;
+ return p;
+}
+
+GBool GlobalParams::getErrQuiet() {
+ // no locking -- this function may get called from inside a locked
+ // section
+ return errQuiet;
+}
+
+CharCodeToUnicode *GlobalParams::getCIDToUnicode(GString *collection) {
+ GString *fileName;
+ CharCodeToUnicode *ctu;
+
+ lockGlobalParams;
+ if (!(ctu = cidToUnicodeCache->getCharCodeToUnicode(collection))) {
+ if ((fileName = (GString *)cidToUnicodes->lookup(collection)) &&
+ (ctu = CharCodeToUnicode::parseCIDToUnicode(fileName, collection))) {
+ cidToUnicodeCache->add(ctu);
+ }
+ }
+ unlockGlobalParams;
+ return ctu;
+}
+
+CharCodeToUnicode *GlobalParams::getUnicodeToUnicode(GString *fontName) {
+ CharCodeToUnicode *ctu;
+ GHashIter *iter;
+ GString *fontPattern, *fileName;
+
+ lockGlobalParams;
+ fileName = NULL;
+ unicodeToUnicodes->startIter(&iter);
+ while (unicodeToUnicodes->getNext(&iter, &fontPattern, (void **)&fileName)) {
+ if (strstr(fontName->getCString(), fontPattern->getCString())) {
+ unicodeToUnicodes->killIter(&iter);
+ break;
+ }
+ fileName = NULL;
+ }
+ if (fileName) {
+ if (!(ctu = unicodeToUnicodeCache->getCharCodeToUnicode(fileName))) {
+ if ((ctu = CharCodeToUnicode::parseUnicodeToUnicode(fileName))) {
+ unicodeToUnicodeCache->add(ctu);
+ }
+ }
+ } else {
+ ctu = NULL;
+ }
+ unlockGlobalParams;
+ return ctu;
+}
+
+UnicodeMap *GlobalParams::getUnicodeMap(GString *encodingName) {
+ return getUnicodeMap2(encodingName);
+}
+
+UnicodeMap *GlobalParams::getUnicodeMap2(GString *encodingName) {
+ UnicodeMap *map;
+
+ if (!(map = getResidentUnicodeMap(encodingName))) {
+ lockUnicodeMapCache;
+ map = unicodeMapCache->getUnicodeMap(encodingName);
+ unlockUnicodeMapCache;
+ }
+ return map;
+}
+
+CMap *GlobalParams::getCMap(GString *collection, GString *cMapName) {
+ CMap *cMap;
+
+ lockCMapCache;
+ cMap = cMapCache->getCMap(collection, cMapName);
+ unlockCMapCache;
+ return cMap;
+}
+
+UnicodeMap *GlobalParams::getTextEncoding() {
+ return getUnicodeMap2(textEncoding);
+}
+
+//------------------------------------------------------------------------
+// functions to set parameters
+//------------------------------------------------------------------------
+
+void GlobalParams::addDisplayFont(DisplayFontParam *param) {
+ DisplayFontParam *old;
+
+ lockGlobalParams;
+ if ((old = (DisplayFontParam *)displayFonts->remove(param->name))) {
+ delete old;
+ }
+ displayFonts->add(param->name, param);
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSFile(char *file) {
+ lockGlobalParams;
+ if (psFile) {
+ delete psFile;
+ }
+ psFile = new GString(file);
+ unlockGlobalParams;
+}
+
+GBool GlobalParams::setPSPaperSize(char *size) {
+ lockGlobalParams;
+ if (!strcmp(size, "match")) {
+ psPaperWidth = psPaperHeight = -1;
+ } else if (!strcmp(size, "letter")) {
+ psPaperWidth = 612;
+ psPaperHeight = 792;
+ } else if (!strcmp(size, "legal")) {
+ psPaperWidth = 612;
+ psPaperHeight = 1008;
+ } else if (!strcmp(size, "A4")) {
+ psPaperWidth = 595;
+ psPaperHeight = 842;
+ } else if (!strcmp(size, "A3")) {
+ psPaperWidth = 842;
+ psPaperHeight = 1190;
+ } else {
+ unlockGlobalParams;
+ return gFalse;
+ }
+ psImageableLLX = psImageableLLY = 0;
+ psImageableURX = psPaperWidth;
+ psImageableURY = psPaperHeight;
+ unlockGlobalParams;
+ return gTrue;
+}
+
+void GlobalParams::setPSPaperWidth(int width) {
+ lockGlobalParams;
+ psPaperWidth = width;
+ psImageableLLX = 0;
+ psImageableURX = psPaperWidth;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSPaperHeight(int height) {
+ lockGlobalParams;
+ psPaperHeight = height;
+ psImageableLLY = 0;
+ psImageableURY = psPaperHeight;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSImageableArea(int llx, int lly, int urx, int ury) {
+ lockGlobalParams;
+ psImageableLLX = llx;
+ psImageableLLY = lly;
+ psImageableURX = urx;
+ psImageableURY = ury;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSCrop(GBool crop) {
+ lockGlobalParams;
+ psCrop = crop;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSExpandSmaller(GBool expand) {
+ lockGlobalParams;
+ psExpandSmaller = expand;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSShrinkLarger(GBool shrink) {
+ lockGlobalParams;
+ psShrinkLarger = shrink;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSCenter(GBool center) {
+ lockGlobalParams;
+ psCenter = center;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSDuplex(GBool duplex) {
+ lockGlobalParams;
+ psDuplex = duplex;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSLevel(PSLevel level) {
+ lockGlobalParams;
+ psLevel = level;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSEmbedType1(GBool embed) {
+ lockGlobalParams;
+ psEmbedType1 = embed;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSEmbedTrueType(GBool embed) {
+ lockGlobalParams;
+ psEmbedTrueType = embed;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSEmbedCIDPostScript(GBool embed) {
+ lockGlobalParams;
+ psEmbedCIDPostScript = embed;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSEmbedCIDTrueType(GBool embed) {
+ lockGlobalParams;
+ psEmbedCIDTrueType = embed;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSPreload(GBool preload) {
+ lockGlobalParams;
+ psPreload = preload;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSOPI(GBool opi) {
+ lockGlobalParams;
+ psOPI = opi;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPSASCIIHex(GBool hex) {
+ lockGlobalParams;
+ psASCIIHex = hex;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setTextEncoding(char *encodingName) {
+ lockGlobalParams;
+ delete textEncoding;
+ textEncoding = new GString(encodingName);
+ unlockGlobalParams;
+}
+
+GBool GlobalParams::setTextEOL(char *s) {
+ lockGlobalParams;
+ if (!strcmp(s, "unix")) {
+ textEOL = eolUnix;
+ } else if (!strcmp(s, "dos")) {
+ textEOL = eolDOS;
+ } else if (!strcmp(s, "mac")) {
+ textEOL = eolMac;
+ } else {
+ unlockGlobalParams;
+ return gFalse;
+ }
+ unlockGlobalParams;
+ return gTrue;
+}
+
+void GlobalParams::setTextPageBreaks(GBool pageBreaks) {
+ lockGlobalParams;
+ textPageBreaks = pageBreaks;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setTextKeepTinyChars(GBool keep) {
+ lockGlobalParams;
+ textKeepTinyChars = keep;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setInitialZoom(char *s) {
+ lockGlobalParams;
+ delete initialZoom;
+ initialZoom = new GString(s);
+ unlockGlobalParams;
+}
+
+void GlobalParams::setContinuousView(GBool cont) {
+ lockGlobalParams;
+ continuousView = cont;
+ unlockGlobalParams;
+}
+
+GBool GlobalParams::setEnableT1lib(char *s) {
+ GBool ok;
+
+ lockGlobalParams;
+ ok = parseYesNo2(s, &enableT1lib);
+ unlockGlobalParams;
+ return ok;
+}
+
+GBool GlobalParams::setEnableFreeType(char *s) {
+ GBool ok;
+
+ lockGlobalParams;
+ ok = parseYesNo2(s, &enableFreeType);
+ unlockGlobalParams;
+ return ok;
+}
+
+
+GBool GlobalParams::setAntialias(char *s) {
+ GBool ok;
+
+ lockGlobalParams;
+ ok = parseYesNo2(s, &antialias);
+ unlockGlobalParams;
+ return ok;
+}
+
+GBool GlobalParams::setVectorAntialias(char *s) {
+ GBool ok;
+
+ lockGlobalParams;
+ ok = parseYesNo2(s, &vectorAntialias);
+ unlockGlobalParams;
+ return ok;
+}
+
+void GlobalParams::setScreenType(ScreenType t) {
+ lockGlobalParams;
+ screenType = t;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setScreenSize(int size) {
+ lockGlobalParams;
+ screenSize = size;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setScreenDotRadius(int r) {
+ lockGlobalParams;
+ screenDotRadius = r;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setScreenGamma(double gamma) {
+ lockGlobalParams;
+ screenGamma = gamma;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setScreenBlackThreshold(double thresh) {
+ lockGlobalParams;
+ screenBlackThreshold = thresh;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setScreenWhiteThreshold(double thresh) {
+ lockGlobalParams;
+ screenWhiteThreshold = thresh;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setMapNumericCharNames(GBool map) {
+ lockGlobalParams;
+ mapNumericCharNames = map;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setMapUnknownCharNames(GBool map) {
+ lockGlobalParams;
+ mapUnknownCharNames = map;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setPrintCommands(GBool printCommandsA) {
+ lockGlobalParams;
+ printCommands = printCommandsA;
+ unlockGlobalParams;
+}
+
+void GlobalParams::setErrQuiet(GBool errQuietA) {
+ lockGlobalParams;
+ errQuiet = errQuietA;
+ unlockGlobalParams;
+}
+
+void GlobalParams::addSecurityHandler(XpdfSecurityHandler *handler) {
+#ifdef ENABLE_PLUGINS
+ lockGlobalParams;
+ securityHandlers->append(handler);
+ unlockGlobalParams;
+#else
+ (void)handler;
+#endif
+}
+
+XpdfSecurityHandler *GlobalParams::getSecurityHandler(char *name) {
+#ifdef ENABLE_PLUGINS
+ XpdfSecurityHandler *hdlr;
+ int i;
+
+ lockGlobalParams;
+ for (i = 0; i < securityHandlers->getLength(); ++i) {
+ hdlr = (XpdfSecurityHandler *)securityHandlers->get(i);
+ if (!strcasecmp(hdlr->name, name)) {
+ unlockGlobalParams;
+ return hdlr;
+ }
+ }
+ unlockGlobalParams;
+
+ if (!loadPlugin("security", name)) {
+ return NULL;
+ }
+
+ lockGlobalParams;
+ for (i = 0; i < securityHandlers->getLength(); ++i) {
+ hdlr = (XpdfSecurityHandler *)securityHandlers->get(i);
+ if (!strcmp(hdlr->name, name)) {
+ unlockGlobalParams;
+ return hdlr;
+ }
+ }
+ unlockGlobalParams;
+#else
+ (void)name;
+#endif
+
+ return NULL;
+}
+
+#ifdef ENABLE_PLUGINS
+//------------------------------------------------------------------------
+// plugins
+//------------------------------------------------------------------------
+
+GBool GlobalParams::loadPlugin(char *type, char *name) {
+ Plugin *plugin;
+
+ if (!(plugin = Plugin::load(type, name))) {
+ return gFalse;
+ }
+ lockGlobalParams;
+ plugins->append(plugin);
+ unlockGlobalParams;
+ return gTrue;
+}
+
+#endif // ENABLE_PLUGINS
diff --git a/kpdf/xpdf/xpdf/JArithmeticDecoder.cc b/kpdf/xpdf/xpdf/JArithmeticDecoder.cc
deleted file mode 100644
index 195b73e1..00000000
--- a/kpdf/xpdf/xpdf/JArithmeticDecoder.cc
+++ /dev/null
@@ -1,322 +0,0 @@
-//========================================================================
-//
-// JArithmeticDecoder.cc
-//
-// Copyright 2002-2004 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "Object.h"
-#include "Stream.h"
-#include "JArithmeticDecoder.h"
-
-//------------------------------------------------------------------------
-// JArithmeticDecoderStates
-//------------------------------------------------------------------------
-
-JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
- contextSize = contextSizeA;
- cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
- reset();
-}
-
-JArithmeticDecoderStats::~JArithmeticDecoderStats() {
- gfree(cxTab);
-}
-
-JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
- JArithmeticDecoderStats *stats;
-
- stats = new JArithmeticDecoderStats(contextSize);
- memcpy(stats->cxTab, cxTab, contextSize);
- return stats;
-}
-
-void JArithmeticDecoderStats::reset() {
- memset(cxTab, 0, contextSize);
-}
-
-void JArithmeticDecoderStats::copyFrom(JArithmeticDecoderStats *stats) {
- memcpy(cxTab, stats->cxTab, contextSize);
-}
-
-void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
- cxTab[cx] = (i << 1) + mps;
-}
-
-//------------------------------------------------------------------------
-// JArithmeticDecoder
-//------------------------------------------------------------------------
-
-Guint JArithmeticDecoder::qeTab[47] = {
- 0x56010000, 0x34010000, 0x18010000, 0x0AC10000,
- 0x05210000, 0x02210000, 0x56010000, 0x54010000,
- 0x48010000, 0x38010000, 0x30010000, 0x24010000,
- 0x1C010000, 0x16010000, 0x56010000, 0x54010000,
- 0x51010000, 0x48010000, 0x38010000, 0x34010000,
- 0x30010000, 0x28010000, 0x24010000, 0x22010000,
- 0x1C010000, 0x18010000, 0x16010000, 0x14010000,
- 0x12010000, 0x11010000, 0x0AC10000, 0x09C10000,
- 0x08A10000, 0x05210000, 0x04410000, 0x02A10000,
- 0x02210000, 0x01410000, 0x01110000, 0x00850000,
- 0x00490000, 0x00250000, 0x00150000, 0x00090000,
- 0x00050000, 0x00010000, 0x56010000
-};
-
-int JArithmeticDecoder::nmpsTab[47] = {
- 1, 2, 3, 4, 5, 38, 7, 8, 9, 10, 11, 12, 13, 29, 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, 45, 46
-};
-
-int JArithmeticDecoder::nlpsTab[47] = {
- 1, 6, 9, 12, 29, 33, 6, 14, 14, 14, 17, 18, 20, 21, 14, 14,
- 15, 16, 17, 18, 19, 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, 46
-};
-
-int JArithmeticDecoder::switchTab[47] = {
- 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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
-};
-
-JArithmeticDecoder::JArithmeticDecoder() {
- str = NULL;
- dataLen = 0;
- limitStream = gFalse;
-}
-
-inline Guint JArithmeticDecoder::readByte() {
- if (limitStream) {
- --dataLen;
- if (dataLen < 0) {
- return 0xff;
- }
- }
- return (Guint)str->getChar() & 0xff;
-}
-
-JArithmeticDecoder::~JArithmeticDecoder() {
- cleanup();
-}
-
-void JArithmeticDecoder::start() {
- buf0 = readByte();
- buf1 = readByte();
-
- // INITDEC
- c = (buf0 ^ 0xff) << 16;
- byteIn();
- c <<= 7;
- ct -= 7;
- a = 0x80000000;
-}
-
-void JArithmeticDecoder::restart(int dataLenA) {
- int oldDataLen;
-
- oldDataLen = dataLen;
- dataLen = dataLenA;
- if (oldDataLen == -1) {
- buf1 = readByte();
- } else if (oldDataLen <= -2) {
- buf0 = readByte();
- buf1 = readByte();
- }
-}
-
-void JArithmeticDecoder::cleanup() {
- if (limitStream) {
- while (dataLen > 0) {
- buf0 = buf1;
- buf1 = readByte();
- }
- }
-}
-
-int JArithmeticDecoder::decodeBit(Guint context,
- JArithmeticDecoderStats *stats) {
- int bit;
- Guint qe;
- int iCX, mpsCX;
-
- iCX = stats->cxTab[context] >> 1;
- mpsCX = stats->cxTab[context] & 1;
- qe = qeTab[iCX];
- a -= qe;
- if (c < a) {
- if (a & 0x80000000) {
- bit = mpsCX;
- } else {
- // MPS_EXCHANGE
- if (a < qe) {
- bit = 1 - mpsCX;
- if (switchTab[iCX]) {
- stats->cxTab[context] = (nlpsTab[iCX] << 1) | (1 - mpsCX);
- } else {
- stats->cxTab[context] = (nlpsTab[iCX] << 1) | mpsCX;
- }
- } else {
- bit = mpsCX;
- stats->cxTab[context] = (nmpsTab[iCX] << 1) | mpsCX;
- }
- // RENORMD
- do {
- if (ct == 0) {
- byteIn();
- }
- a <<= 1;
- c <<= 1;
- --ct;
- } while (!(a & 0x80000000));
- }
- } else {
- c -= a;
- // LPS_EXCHANGE
- if (a < qe) {
- bit = mpsCX;
- stats->cxTab[context] = (nmpsTab[iCX] << 1) | mpsCX;
- } else {
- bit = 1 - mpsCX;
- if (switchTab[iCX]) {
- stats->cxTab[context] = (nlpsTab[iCX] << 1) | (1 - mpsCX);
- } else {
- stats->cxTab[context] = (nlpsTab[iCX] << 1) | mpsCX;
- }
- }
- a = qe;
- // RENORMD
- do {
- if (ct == 0) {
- byteIn();
- }
- a <<= 1;
- c <<= 1;
- --ct;
- } while (!(a & 0x80000000));
- }
- return bit;
-}
-
-int JArithmeticDecoder::decodeByte(Guint context,
- JArithmeticDecoderStats *stats) {
- int byte;
- int i;
-
- byte = 0;
- for (i = 0; i < 8; ++i) {
- byte = (byte << 1) | decodeBit(context, stats);
- }
- return byte;
-}
-
-GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
- int s;
- Guint v;
- int i;
-
- prev = 1;
- s = decodeIntBit(stats);
- if (decodeIntBit(stats)) {
- if (decodeIntBit(stats)) {
- if (decodeIntBit(stats)) {
- if (decodeIntBit(stats)) {
- if (decodeIntBit(stats)) {
- v = 0;
- for (i = 0; i < 32; ++i) {
- v = (v << 1) | decodeIntBit(stats);
- }
- v += 4436;
- } else {
- v = 0;
- for (i = 0; i < 12; ++i) {
- v = (v << 1) | decodeIntBit(stats);
- }
- v += 340;
- }
- } else {
- v = 0;
- for (i = 0; i < 8; ++i) {
- v = (v << 1) | decodeIntBit(stats);
- }
- v += 84;
- }
- } else {
- v = 0;
- for (i = 0; i < 6; ++i) {
- v = (v << 1) | decodeIntBit(stats);
- }
- v += 20;
- }
- } else {
- v = decodeIntBit(stats);
- v = (v << 1) | decodeIntBit(stats);
- v = (v << 1) | decodeIntBit(stats);
- v = (v << 1) | decodeIntBit(stats);
- v += 4;
- }
- } else {
- v = decodeIntBit(stats);
- v = (v << 1) | decodeIntBit(stats);
- }
-
- if (s) {
- if (v == 0) {
- return gFalse;
- }
- *x = -(int)v;
- } else {
- *x = (int)v;
- }
- return gTrue;
-}
-
-int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
- int bit;
-
- bit = decodeBit(prev, stats);
- if (prev < 0x100) {
- prev = (prev << 1) | bit;
- } else {
- prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
- }
- return bit;
-}
-
-Guint JArithmeticDecoder::decodeIAID(Guint codeLen,
- JArithmeticDecoderStats *stats) {
- Guint i;
- int bit;
-
- prev = 1;
- for (i = 0; i < codeLen; ++i) {
- bit = decodeBit(prev, stats);
- prev = (prev << 1) | bit;
- }
- return prev - (1 << codeLen);
-}
-
-void JArithmeticDecoder::byteIn() {
- if (buf0 == 0xff) {
- if (buf1 > 0x8f) {
- ct = 8;
- } else {
- buf0 = buf1;
- buf1 = readByte();
- c = c + 0xfe00 - (buf0 << 9);
- ct = 7;
- }
- } else {
- buf0 = buf1;
- buf1 = readByte();
- c = c + 0xff00 - (buf0 << 8);
- ct = 8;
- }
-}
diff --git a/kpdf/xpdf/xpdf/JArithmeticDecoder.cpp b/kpdf/xpdf/xpdf/JArithmeticDecoder.cpp
new file mode 100644
index 00000000..7f7c7685
--- /dev/null
+++ b/kpdf/xpdf/xpdf/JArithmeticDecoder.cpp
@@ -0,0 +1,322 @@
+//========================================================================
+//
+// JArithmeticDecoder.cpp
+//
+// Copyright 2002-2004 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "Object.h"
+#include "Stream.h"
+#include "JArithmeticDecoder.h"
+
+//------------------------------------------------------------------------
+// JArithmeticDecoderStates
+//------------------------------------------------------------------------
+
+JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
+ contextSize = contextSizeA;
+ cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
+ reset();
+}
+
+JArithmeticDecoderStats::~JArithmeticDecoderStats() {
+ gfree(cxTab);
+}
+
+JArithmeticDecoderStats *JArithmeticDecoderStats::copy() {
+ JArithmeticDecoderStats *stats;
+
+ stats = new JArithmeticDecoderStats(contextSize);
+ memcpy(stats->cxTab, cxTab, contextSize);
+ return stats;
+}
+
+void JArithmeticDecoderStats::reset() {
+ memset(cxTab, 0, contextSize);
+}
+
+void JArithmeticDecoderStats::copyFrom(JArithmeticDecoderStats *stats) {
+ memcpy(cxTab, stats->cxTab, contextSize);
+}
+
+void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
+ cxTab[cx] = (i << 1) + mps;
+}
+
+//------------------------------------------------------------------------
+// JArithmeticDecoder
+//------------------------------------------------------------------------
+
+Guint JArithmeticDecoder::qeTab[47] = {
+ 0x56010000, 0x34010000, 0x18010000, 0x0AC10000,
+ 0x05210000, 0x02210000, 0x56010000, 0x54010000,
+ 0x48010000, 0x38010000, 0x30010000, 0x24010000,
+ 0x1C010000, 0x16010000, 0x56010000, 0x54010000,
+ 0x51010000, 0x48010000, 0x38010000, 0x34010000,
+ 0x30010000, 0x28010000, 0x24010000, 0x22010000,
+ 0x1C010000, 0x18010000, 0x16010000, 0x14010000,
+ 0x12010000, 0x11010000, 0x0AC10000, 0x09C10000,
+ 0x08A10000, 0x05210000, 0x04410000, 0x02A10000,
+ 0x02210000, 0x01410000, 0x01110000, 0x00850000,
+ 0x00490000, 0x00250000, 0x00150000, 0x00090000,
+ 0x00050000, 0x00010000, 0x56010000
+};
+
+int JArithmeticDecoder::nmpsTab[47] = {
+ 1, 2, 3, 4, 5, 38, 7, 8, 9, 10, 11, 12, 13, 29, 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, 45, 46
+};
+
+int JArithmeticDecoder::nlpsTab[47] = {
+ 1, 6, 9, 12, 29, 33, 6, 14, 14, 14, 17, 18, 20, 21, 14, 14,
+ 15, 16, 17, 18, 19, 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, 46
+};
+
+int JArithmeticDecoder::switchTab[47] = {
+ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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
+};
+
+JArithmeticDecoder::JArithmeticDecoder() {
+ str = NULL;
+ dataLen = 0;
+ limitStream = gFalse;
+}
+
+inline Guint JArithmeticDecoder::readByte() {
+ if (limitStream) {
+ --dataLen;
+ if (dataLen < 0) {
+ return 0xff;
+ }
+ }
+ return (Guint)str->getChar() & 0xff;
+}
+
+JArithmeticDecoder::~JArithmeticDecoder() {
+ cleanup();
+}
+
+void JArithmeticDecoder::start() {
+ buf0 = readByte();
+ buf1 = readByte();
+
+ // INITDEC
+ c = (buf0 ^ 0xff) << 16;
+ byteIn();
+ c <<= 7;
+ ct -= 7;
+ a = 0x80000000;
+}
+
+void JArithmeticDecoder::restart(int dataLenA) {
+ int oldDataLen;
+
+ oldDataLen = dataLen;
+ dataLen = dataLenA;
+ if (oldDataLen == -1) {
+ buf1 = readByte();
+ } else if (oldDataLen <= -2) {
+ buf0 = readByte();
+ buf1 = readByte();
+ }
+}
+
+void JArithmeticDecoder::cleanup() {
+ if (limitStream) {
+ while (dataLen > 0) {
+ buf0 = buf1;
+ buf1 = readByte();
+ }
+ }
+}
+
+int JArithmeticDecoder::decodeBit(Guint context,
+ JArithmeticDecoderStats *stats) {
+ int bit;
+ Guint qe;
+ int iCX, mpsCX;
+
+ iCX = stats->cxTab[context] >> 1;
+ mpsCX = stats->cxTab[context] & 1;
+ qe = qeTab[iCX];
+ a -= qe;
+ if (c < a) {
+ if (a & 0x80000000) {
+ bit = mpsCX;
+ } else {
+ // MPS_EXCHANGE
+ if (a < qe) {
+ bit = 1 - mpsCX;
+ if (switchTab[iCX]) {
+ stats->cxTab[context] = (nlpsTab[iCX] << 1) | (1 - mpsCX);
+ } else {
+ stats->cxTab[context] = (nlpsTab[iCX] << 1) | mpsCX;
+ }
+ } else {
+ bit = mpsCX;
+ stats->cxTab[context] = (nmpsTab[iCX] << 1) | mpsCX;
+ }
+ // RENORMD
+ do {
+ if (ct == 0) {
+ byteIn();
+ }
+ a <<= 1;
+ c <<= 1;
+ --ct;
+ } while (!(a & 0x80000000));
+ }
+ } else {
+ c -= a;
+ // LPS_EXCHANGE
+ if (a < qe) {
+ bit = mpsCX;
+ stats->cxTab[context] = (nmpsTab[iCX] << 1) | mpsCX;
+ } else {
+ bit = 1 - mpsCX;
+ if (switchTab[iCX]) {
+ stats->cxTab[context] = (nlpsTab[iCX] << 1) | (1 - mpsCX);
+ } else {
+ stats->cxTab[context] = (nlpsTab[iCX] << 1) | mpsCX;
+ }
+ }
+ a = qe;
+ // RENORMD
+ do {
+ if (ct == 0) {
+ byteIn();
+ }
+ a <<= 1;
+ c <<= 1;
+ --ct;
+ } while (!(a & 0x80000000));
+ }
+ return bit;
+}
+
+int JArithmeticDecoder::decodeByte(Guint context,
+ JArithmeticDecoderStats *stats) {
+ int byte;
+ int i;
+
+ byte = 0;
+ for (i = 0; i < 8; ++i) {
+ byte = (byte << 1) | decodeBit(context, stats);
+ }
+ return byte;
+}
+
+GBool JArithmeticDecoder::decodeInt(int *x, JArithmeticDecoderStats *stats) {
+ int s;
+ Guint v;
+ int i;
+
+ prev = 1;
+ s = decodeIntBit(stats);
+ if (decodeIntBit(stats)) {
+ if (decodeIntBit(stats)) {
+ if (decodeIntBit(stats)) {
+ if (decodeIntBit(stats)) {
+ if (decodeIntBit(stats)) {
+ v = 0;
+ for (i = 0; i < 32; ++i) {
+ v = (v << 1) | decodeIntBit(stats);
+ }
+ v += 4436;
+ } else {
+ v = 0;
+ for (i = 0; i < 12; ++i) {
+ v = (v << 1) | decodeIntBit(stats);
+ }
+ v += 340;
+ }
+ } else {
+ v = 0;
+ for (i = 0; i < 8; ++i) {
+ v = (v << 1) | decodeIntBit(stats);
+ }
+ v += 84;
+ }
+ } else {
+ v = 0;
+ for (i = 0; i < 6; ++i) {
+ v = (v << 1) | decodeIntBit(stats);
+ }
+ v += 20;
+ }
+ } else {
+ v = decodeIntBit(stats);
+ v = (v << 1) | decodeIntBit(stats);
+ v = (v << 1) | decodeIntBit(stats);
+ v = (v << 1) | decodeIntBit(stats);
+ v += 4;
+ }
+ } else {
+ v = decodeIntBit(stats);
+ v = (v << 1) | decodeIntBit(stats);
+ }
+
+ if (s) {
+ if (v == 0) {
+ return gFalse;
+ }
+ *x = -(int)v;
+ } else {
+ *x = (int)v;
+ }
+ return gTrue;
+}
+
+int JArithmeticDecoder::decodeIntBit(JArithmeticDecoderStats *stats) {
+ int bit;
+
+ bit = decodeBit(prev, stats);
+ if (prev < 0x100) {
+ prev = (prev << 1) | bit;
+ } else {
+ prev = (((prev << 1) | bit) & 0x1ff) | 0x100;
+ }
+ return bit;
+}
+
+Guint JArithmeticDecoder::decodeIAID(Guint codeLen,
+ JArithmeticDecoderStats *stats) {
+ Guint i;
+ int bit;
+
+ prev = 1;
+ for (i = 0; i < codeLen; ++i) {
+ bit = decodeBit(prev, stats);
+ prev = (prev << 1) | bit;
+ }
+ return prev - (1 << codeLen);
+}
+
+void JArithmeticDecoder::byteIn() {
+ if (buf0 == 0xff) {
+ if (buf1 > 0x8f) {
+ ct = 8;
+ } else {
+ buf0 = buf1;
+ buf1 = readByte();
+ c = c + 0xfe00 - (buf0 << 9);
+ ct = 7;
+ }
+ } else {
+ buf0 = buf1;
+ buf1 = readByte();
+ c = c + 0xff00 - (buf0 << 8);
+ ct = 8;
+ }
+}
diff --git a/kpdf/xpdf/xpdf/JBIG2Stream.cc b/kpdf/xpdf/xpdf/JBIG2Stream.cc
deleted file mode 100644
index 43f17712..00000000
--- a/kpdf/xpdf/xpdf/JBIG2Stream.cc
+++ /dev/null
@@ -1,3648 +0,0 @@
-//========================================================================
-//
-// JBIG2Stream.cc
-//
-// Copyright 2002-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <limits.h>
-#include "GList.h"
-#include "Error.h"
-#include "JArithmeticDecoder.h"
-#include "JBIG2Stream.h"
-
-//~ share these tables
-#include "Stream-CCITT.h"
-
-//------------------------------------------------------------------------
-
-static int contextSize[4] = { 16, 13, 10, 10 };
-static int refContextSize[2] = { 13, 10 };
-
-//------------------------------------------------------------------------
-// JBIG2HuffmanTable
-//------------------------------------------------------------------------
-
-#define jbig2HuffmanLOW 0xfffffffd
-#define jbig2HuffmanOOB 0xfffffffe
-#define jbig2HuffmanEOT 0xffffffff
-
-struct JBIG2HuffmanTable {
- int val;
- Guint prefixLen;
- Guint rangeLen; // can also be LOW, OOB, or EOT
- Guint prefix;
-};
-
-JBIG2HuffmanTable huffTableA[] = {
- { 0, 1, 4, 0x000 },
- { 16, 2, 8, 0x002 },
- { 272, 3, 16, 0x006 },
- { 65808, 3, 32, 0x007 },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableB[] = {
- { 0, 1, 0, 0x000 },
- { 1, 2, 0, 0x002 },
- { 2, 3, 0, 0x006 },
- { 3, 4, 3, 0x00e },
- { 11, 5, 6, 0x01e },
- { 75, 6, 32, 0x03e },
- { 0, 6, jbig2HuffmanOOB, 0x03f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableC[] = {
- { 0, 1, 0, 0x000 },
- { 1, 2, 0, 0x002 },
- { 2, 3, 0, 0x006 },
- { 3, 4, 3, 0x00e },
- { 11, 5, 6, 0x01e },
- { 0, 6, jbig2HuffmanOOB, 0x03e },
- { 75, 7, 32, 0x0fe },
- { -256, 8, 8, 0x0fe },
- { -257, 8, jbig2HuffmanLOW, 0x0ff },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableD[] = {
- { 1, 1, 0, 0x000 },
- { 2, 2, 0, 0x002 },
- { 3, 3, 0, 0x006 },
- { 4, 4, 3, 0x00e },
- { 12, 5, 6, 0x01e },
- { 76, 5, 32, 0x01f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableE[] = {
- { 1, 1, 0, 0x000 },
- { 2, 2, 0, 0x002 },
- { 3, 3, 0, 0x006 },
- { 4, 4, 3, 0x00e },
- { 12, 5, 6, 0x01e },
- { 76, 6, 32, 0x03e },
- { -255, 7, 8, 0x07e },
- { -256, 7, jbig2HuffmanLOW, 0x07f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableF[] = {
- { 0, 2, 7, 0x000 },
- { 128, 3, 7, 0x002 },
- { 256, 3, 8, 0x003 },
- { -1024, 4, 9, 0x008 },
- { -512, 4, 8, 0x009 },
- { -256, 4, 7, 0x00a },
- { -32, 4, 5, 0x00b },
- { 512, 4, 9, 0x00c },
- { 1024, 4, 10, 0x00d },
- { -2048, 5, 10, 0x01c },
- { -128, 5, 6, 0x01d },
- { -64, 5, 5, 0x01e },
- { -2049, 6, jbig2HuffmanLOW, 0x03e },
- { 2048, 6, 32, 0x03f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableG[] = {
- { -512, 3, 8, 0x000 },
- { 256, 3, 8, 0x001 },
- { 512, 3, 9, 0x002 },
- { 1024, 3, 10, 0x003 },
- { -1024, 4, 9, 0x008 },
- { -256, 4, 7, 0x009 },
- { -32, 4, 5, 0x00a },
- { 0, 4, 5, 0x00b },
- { 128, 4, 7, 0x00c },
- { -128, 5, 6, 0x01a },
- { -64, 5, 5, 0x01b },
- { 32, 5, 5, 0x01c },
- { 64, 5, 6, 0x01d },
- { -1025, 5, jbig2HuffmanLOW, 0x01e },
- { 2048, 5, 32, 0x01f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableH[] = {
- { 0, 2, 1, 0x000 },
- { 0, 2, jbig2HuffmanOOB, 0x001 },
- { 4, 3, 4, 0x004 },
- { -1, 4, 0, 0x00a },
- { 22, 4, 4, 0x00b },
- { 38, 4, 5, 0x00c },
- { 2, 5, 0, 0x01a },
- { 70, 5, 6, 0x01b },
- { 134, 5, 7, 0x01c },
- { 3, 6, 0, 0x03a },
- { 20, 6, 1, 0x03b },
- { 262, 6, 7, 0x03c },
- { 646, 6, 10, 0x03d },
- { -2, 7, 0, 0x07c },
- { 390, 7, 8, 0x07d },
- { -15, 8, 3, 0x0fc },
- { -5, 8, 1, 0x0fd },
- { -7, 9, 1, 0x1fc },
- { -3, 9, 0, 0x1fd },
- { -16, 9, jbig2HuffmanLOW, 0x1fe },
- { 1670, 9, 32, 0x1ff },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableI[] = {
- { 0, 2, jbig2HuffmanOOB, 0x000 },
- { -1, 3, 1, 0x002 },
- { 1, 3, 1, 0x003 },
- { 7, 3, 5, 0x004 },
- { -3, 4, 1, 0x00a },
- { 43, 4, 5, 0x00b },
- { 75, 4, 6, 0x00c },
- { 3, 5, 1, 0x01a },
- { 139, 5, 7, 0x01b },
- { 267, 5, 8, 0x01c },
- { 5, 6, 1, 0x03a },
- { 39, 6, 2, 0x03b },
- { 523, 6, 8, 0x03c },
- { 1291, 6, 11, 0x03d },
- { -5, 7, 1, 0x07c },
- { 779, 7, 9, 0x07d },
- { -31, 8, 4, 0x0fc },
- { -11, 8, 2, 0x0fd },
- { -15, 9, 2, 0x1fc },
- { -7, 9, 1, 0x1fd },
- { -32, 9, jbig2HuffmanLOW, 0x1fe },
- { 3339, 9, 32, 0x1ff },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableJ[] = {
- { -2, 2, 2, 0x000 },
- { 6, 2, 6, 0x001 },
- { 0, 2, jbig2HuffmanOOB, 0x002 },
- { -3, 5, 0, 0x018 },
- { 2, 5, 0, 0x019 },
- { 70, 5, 5, 0x01a },
- { 3, 6, 0, 0x036 },
- { 102, 6, 5, 0x037 },
- { 134, 6, 6, 0x038 },
- { 198, 6, 7, 0x039 },
- { 326, 6, 8, 0x03a },
- { 582, 6, 9, 0x03b },
- { 1094, 6, 10, 0x03c },
- { -21, 7, 4, 0x07a },
- { -4, 7, 0, 0x07b },
- { 4, 7, 0, 0x07c },
- { 2118, 7, 11, 0x07d },
- { -5, 8, 0, 0x0fc },
- { 5, 8, 0, 0x0fd },
- { -22, 8, jbig2HuffmanLOW, 0x0fe },
- { 4166, 8, 32, 0x0ff },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableK[] = {
- { 1, 1, 0, 0x000 },
- { 2, 2, 1, 0x002 },
- { 4, 4, 0, 0x00c },
- { 5, 4, 1, 0x00d },
- { 7, 5, 1, 0x01c },
- { 9, 5, 2, 0x01d },
- { 13, 6, 2, 0x03c },
- { 17, 7, 2, 0x07a },
- { 21, 7, 3, 0x07b },
- { 29, 7, 4, 0x07c },
- { 45, 7, 5, 0x07d },
- { 77, 7, 6, 0x07e },
- { 141, 7, 32, 0x07f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableL[] = {
- { 1, 1, 0, 0x000 },
- { 2, 2, 0, 0x002 },
- { 3, 3, 1, 0x006 },
- { 5, 5, 0, 0x01c },
- { 6, 5, 1, 0x01d },
- { 8, 6, 1, 0x03c },
- { 10, 7, 0, 0x07a },
- { 11, 7, 1, 0x07b },
- { 13, 7, 2, 0x07c },
- { 17, 7, 3, 0x07d },
- { 25, 7, 4, 0x07e },
- { 41, 8, 5, 0x0fe },
- { 73, 8, 32, 0x0ff },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableM[] = {
- { 1, 1, 0, 0x000 },
- { 2, 3, 0, 0x004 },
- { 7, 3, 3, 0x005 },
- { 3, 4, 0, 0x00c },
- { 5, 4, 1, 0x00d },
- { 4, 5, 0, 0x01c },
- { 15, 6, 1, 0x03a },
- { 17, 6, 2, 0x03b },
- { 21, 6, 3, 0x03c },
- { 29, 6, 4, 0x03d },
- { 45, 6, 5, 0x03e },
- { 77, 7, 6, 0x07e },
- { 141, 7, 32, 0x07f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableN[] = {
- { 0, 1, 0, 0x000 },
- { -2, 3, 0, 0x004 },
- { -1, 3, 0, 0x005 },
- { 1, 3, 0, 0x006 },
- { 2, 3, 0, 0x007 },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-JBIG2HuffmanTable huffTableO[] = {
- { 0, 1, 0, 0x000 },
- { -1, 3, 0, 0x004 },
- { 1, 3, 0, 0x005 },
- { -2, 4, 0, 0x00c },
- { 2, 4, 0, 0x00d },
- { -4, 5, 1, 0x01c },
- { 3, 5, 1, 0x01d },
- { -8, 6, 2, 0x03c },
- { 5, 6, 2, 0x03d },
- { -24, 7, 4, 0x07c },
- { 9, 7, 4, 0x07d },
- { -25, 7, jbig2HuffmanLOW, 0x07e },
- { 25, 7, 32, 0x07f },
- { 0, 0, jbig2HuffmanEOT, 0 }
-};
-
-//------------------------------------------------------------------------
-// JBIG2HuffmanDecoder
-//------------------------------------------------------------------------
-
-class JBIG2HuffmanDecoder {
-public:
-
- JBIG2HuffmanDecoder();
- ~JBIG2HuffmanDecoder();
- void setStream(Stream *strA) { str = strA; }
-
- void reset();
-
- // Returns false for OOB, otherwise sets *<x> and returns true.
- GBool decodeInt(int *x, JBIG2HuffmanTable *table);
-
- Guint readBits(Guint n);
- Guint readBit();
-
- // Sort the table by prefix length and assign prefix values.
- void buildTable(JBIG2HuffmanTable *table, Guint len);
-
-private:
-
- Stream *str;
- Guint buf;
- Guint bufLen;
-};
-
-JBIG2HuffmanDecoder::JBIG2HuffmanDecoder() {
- str = NULL;
- reset();
-}
-
-JBIG2HuffmanDecoder::~JBIG2HuffmanDecoder() {
-}
-
-void JBIG2HuffmanDecoder::reset() {
- buf = 0;
- bufLen = 0;
-}
-
-//~ optimize this
-GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
- Guint i, len, prefix;
-
- i = 0;
- len = 0;
- prefix = 0;
- while (table[i].rangeLen != jbig2HuffmanEOT) {
- while (len < table[i].prefixLen) {
- prefix = (prefix << 1) | readBit();
- ++len;
- }
- if (prefix == table[i].prefix) {
- if (table[i].rangeLen == jbig2HuffmanOOB) {
- return gFalse;
- }
- if (table[i].rangeLen == jbig2HuffmanLOW) {
- *x = table[i].val - readBits(32);
- } else if (table[i].rangeLen > 0) {
- *x = table[i].val + readBits(table[i].rangeLen);
- } else {
- *x = table[i].val;
- }
- return gTrue;
- }
- ++i;
- }
- return gFalse;
-}
-
-Guint JBIG2HuffmanDecoder::readBits(Guint n) {
- Guint x, mask, nLeft;
-
- mask = (n == 32) ? 0xffffffff : ((1 << n) - 1);
- if (bufLen >= n) {
- x = (buf >> (bufLen - n)) & mask;
- bufLen -= n;
- } else {
- x = buf & ((1 << bufLen) - 1);
- nLeft = n - bufLen;
- bufLen = 0;
- while (nLeft >= 8) {
- x = (x << 8) | (str->getChar() & 0xff);
- nLeft -= 8;
- }
- if (nLeft > 0) {
- buf = str->getChar();
- bufLen = 8 - nLeft;
- x = (x << nLeft) | ((buf >> bufLen) & ((1 << nLeft) - 1));
- }
- }
- return x;
-}
-
-Guint JBIG2HuffmanDecoder::readBit() {
- if (bufLen == 0) {
- buf = str->getChar();
- bufLen = 8;
- }
- --bufLen;
- return (buf >> bufLen) & 1;
-}
-
-void JBIG2HuffmanDecoder::buildTable(JBIG2HuffmanTable *table, Guint len) {
- Guint i, j, k, prefix;
- JBIG2HuffmanTable tab;
-
- // stable selection sort:
- // - entries with prefixLen > 0, in ascending prefixLen order
- // - entry with prefixLen = 0, rangeLen = EOT
- // - all other entries with prefixLen = 0
- // (on entry, table[len] has prefixLen = 0, rangeLen = EOT)
- for (i = 0; i < len; ++i) {
- for (j = i; j < len && table[j].prefixLen == 0; ++j) ;
- if (j == len) {
- break;
- }
- for (k = j + 1; k < len; ++k) {
- if (table[k].prefixLen > 0 &&
- table[k].prefixLen < table[j].prefixLen) {
- j = k;
- }
- }
- if (j != i) {
- tab = table[j];
- for (k = j; k > i; --k) {
- table[k] = table[k - 1];
- }
- table[i] = tab;
- }
- }
- table[i] = table[len];
-
- // assign prefixes
- if (table[0].rangeLen != jbig2HuffmanEOT) {
- i = 0;
- prefix = 0;
- table[i++].prefix = prefix++;
- for (; table[i].rangeLen != jbig2HuffmanEOT; ++i) {
- prefix <<= table[i].prefixLen - table[i-1].prefixLen;
- table[i].prefix = prefix++;
- }
- }
-}
-
-//------------------------------------------------------------------------
-// JBIG2MMRDecoder
-//------------------------------------------------------------------------
-
-class JBIG2MMRDecoder {
-public:
-
- JBIG2MMRDecoder();
- ~JBIG2MMRDecoder();
- void setStream(Stream *strA) { str = strA; }
- void reset();
- int get2DCode();
- int getBlackCode();
- int getWhiteCode();
- Guint get24Bits();
- void skipTo(Guint length);
-
-private:
-
- Stream *str;
- Guint buf;
- Guint bufLen;
- Guint nBytesRead;
-};
-
-JBIG2MMRDecoder::JBIG2MMRDecoder() {
- str = NULL;
- reset();
-}
-
-JBIG2MMRDecoder::~JBIG2MMRDecoder() {
-}
-
-void JBIG2MMRDecoder::reset() {
- buf = 0;
- bufLen = 0;
- nBytesRead = 0;
-}
-
-int JBIG2MMRDecoder::get2DCode() {
- CCITTCode *p;
-
- if (bufLen == 0) {
- buf = str->getChar() & 0xff;
- bufLen = 8;
- ++nBytesRead;
- p = &twoDimTab1[(buf >> 1) & 0x7f];
- } else if (bufLen == 8) {
- p = &twoDimTab1[(buf >> 1) & 0x7f];
- } else {
- p = &twoDimTab1[(buf << (7 - bufLen)) & 0x7f];
- if (p->bits < 0 || p->bits > (int)bufLen) {
- buf = (buf << 8) | (str->getChar() & 0xff);
- bufLen += 8;
- ++nBytesRead;
- p = &twoDimTab1[(buf >> (bufLen - 7)) & 0x7f];
- }
- }
- if (p->bits < 0) {
- error(str->getPos(), "Bad two dim code in JBIG2 MMR stream");
- return EOF;
- }
- bufLen -= p->bits;
- return p->n;
-}
-
-int JBIG2MMRDecoder::getWhiteCode() {
- CCITTCode *p;
- Guint code;
-
- if (bufLen == 0) {
- buf = str->getChar() & 0xff;
- bufLen = 8;
- ++nBytesRead;
- }
- while (1) {
- if (bufLen >= 11 && ((buf >> (bufLen - 7)) & 0x7f) == 0) {
- if (bufLen <= 12) {
- code = buf << (12 - bufLen);
- } else {
- code = buf >> (bufLen - 12);
- }
- p = &whiteTab1[code & 0x1f];
- } else {
- if (bufLen <= 9) {
- code = buf << (9 - bufLen);
- } else {
- code = buf >> (bufLen - 9);
- }
- p = &whiteTab2[code & 0x1ff];
- }
- if (p->bits > 0 && p->bits <= (int)bufLen) {
- bufLen -= p->bits;
- return p->n;
- }
- if (bufLen >= 12) {
- break;
- }
- buf = (buf << 8) | (str->getChar() & 0xff);
- bufLen += 8;
- ++nBytesRead;
- }
- error(str->getPos(), "Bad white code in JBIG2 MMR stream");
- // eat a bit and return a positive number so that the caller doesn't
- // go into an infinite loop
- --bufLen;
- return 1;
-}
-
-int JBIG2MMRDecoder::getBlackCode() {
- CCITTCode *p;
- Guint code;
-
- if (bufLen == 0) {
- buf = str->getChar() & 0xff;
- bufLen = 8;
- ++nBytesRead;
- }
- while (1) {
- if (bufLen >= 10 && ((buf >> (bufLen - 6)) & 0x3f) == 0) {
- if (bufLen <= 13) {
- code = buf << (13 - bufLen);
- } else {
- code = buf >> (bufLen - 13);
- }
- p = &blackTab1[code & 0x7f];
- } else if (bufLen >= 7 && ((buf >> (bufLen - 4)) & 0x0f) == 0 &&
- ((buf >> (bufLen - 6)) & 0x03) != 0) {
- if (bufLen <= 12) {
- code = buf << (12 - bufLen);
- } else {
- code = buf >> (bufLen - 12);
- }
- p = &blackTab2[(code & 0xff) - 64];
- } else {
- if (bufLen <= 6) {
- code = buf << (6 - bufLen);
- } else {
- code = buf >> (bufLen - 6);
- }
- p = &blackTab3[code & 0x3f];
- }
- if (p->bits > 0 && p->bits <= (int)bufLen) {
- bufLen -= p->bits;
- return p->n;
- }
- if (bufLen >= 13) {
- break;
- }
- buf = (buf << 8) | (str->getChar() & 0xff);
- bufLen += 8;
- ++nBytesRead;
- }
- error(str->getPos(), "Bad black code in JBIG2 MMR stream");
- // eat a bit and return a positive number so that the caller doesn't
- // go into an infinite loop
- --bufLen;
- return 1;
-}
-
-Guint JBIG2MMRDecoder::get24Bits() {
- while (bufLen < 24) {
- buf = (buf << 8) | (str->getChar() & 0xff);
- bufLen += 8;
- ++nBytesRead;
- }
- return (buf >> (bufLen - 24)) & 0xffffff;
-}
-
-void JBIG2MMRDecoder::skipTo(Guint length) {
- while (nBytesRead < length) {
- str->getChar();
- ++nBytesRead;
- }
-}
-
-//------------------------------------------------------------------------
-// JBIG2Segment
-//------------------------------------------------------------------------
-
-enum JBIG2SegmentType {
- jbig2SegBitmap,
- jbig2SegSymbolDict,
- jbig2SegPatternDict,
- jbig2SegCodeTable
-};
-
-class JBIG2Segment {
-public:
-
- JBIG2Segment(Guint segNumA) { segNum = segNumA; }
- virtual ~JBIG2Segment() {}
- void setSegNum(Guint segNumA) { segNum = segNumA; }
- Guint getSegNum() { return segNum; }
- virtual JBIG2SegmentType getType() = 0;
-
-private:
-
- Guint segNum;
-};
-
-//------------------------------------------------------------------------
-// JBIG2Bitmap
-//------------------------------------------------------------------------
-
-struct JBIG2BitmapPtr {
- Guchar *p;
- int shift;
- int x;
-};
-
-class JBIG2Bitmap: public JBIG2Segment {
-public:
-
- JBIG2Bitmap(Guint segNumA, int wA, int hA);
- virtual ~JBIG2Bitmap();
- virtual JBIG2SegmentType getType() { return jbig2SegBitmap; }
- JBIG2Bitmap *copy() { return new JBIG2Bitmap(0, this); }
- JBIG2Bitmap *getSlice(Guint x, Guint y, Guint wA, Guint hA);
- void expand(int newH, Guint pixel);
- void clearToZero();
- void clearToOne();
- int getWidth() { return w; }
- int getHeight() { return h; }
- int getPixel(int x, int y)
- { return (x < 0 || x >= w || y < 0 || y >= h) ? 0 :
- (data[y * line + (x >> 3)] >> (7 - (x & 7))) & 1; }
- void setPixel(int x, int y)
- { data[y * line + (x >> 3)] |= 1 << (7 - (x & 7)); }
- void clearPixel(int x, int y)
- { data[y * line + (x >> 3)] &= 0x7f7f >> (x & 7); }
- void getPixelPtr(int x, int y, JBIG2BitmapPtr *ptr);
- int nextPixel(JBIG2BitmapPtr *ptr);
- void duplicateRow(int yDest, int ySrc);
- void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp);
- Guchar *getDataPtr() { return data; }
- int getDataSize() { return h * line; }
-
-private:
-
- JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap);
-
- int w, h, line;
- Guchar *data;
-};
-
-JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, int wA, int hA):
- JBIG2Segment(segNumA)
-{
- w = wA;
- h = hA;
- line = (wA + 7) >> 3;
- if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
- // force a call to gmalloc(-1), which will throw an exception
- h = -1;
- line = 2;
- }
- // need to allocate one extra guard byte for use in combine()
- data = (Guchar *)gmalloc(h * line + 1);
- data[h * line] = 0;
-}
-
-JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap):
- JBIG2Segment(segNumA)
-{
- w = bitmap->w;
- h = bitmap->h;
- line = bitmap->line;
- if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
- // force a call to gmalloc(-1), which will throw an exception
- h = -1;
- line = 2;
- }
- // need to allocate one extra guard byte for use in combine()
- data = (Guchar *)gmalloc(h * line + 1);
- memcpy(data, bitmap->data, h * line);
- data[h * line] = 0;
-}
-
-JBIG2Bitmap::~JBIG2Bitmap() {
- gfree(data);
-}
-
-//~ optimize this
-JBIG2Bitmap *JBIG2Bitmap::getSlice(Guint x, Guint y, Guint wA, Guint hA) {
- JBIG2Bitmap *slice;
- Guint xx, yy;
-
- slice = new JBIG2Bitmap(0, wA, hA);
- slice->clearToZero();
- for (yy = 0; yy < hA; ++yy) {
- for (xx = 0; xx < wA; ++xx) {
- if (getPixel(x + xx, y + yy)) {
- slice->setPixel(xx, yy);
- }
- }
- }
- return slice;
-}
-
-void JBIG2Bitmap::expand(int newH, Guint pixel) {
- if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) {
- return;
- }
- // need to allocate one extra guard byte for use in combine()
- data = (Guchar *)grealloc(data, newH * line + 1);
- if (pixel) {
- memset(data + h * line, 0xff, (newH - h) * line);
- } else {
- memset(data + h * line, 0x00, (newH - h) * line);
- }
- h = newH;
- data[h * line] = 0;
-}
-
-void JBIG2Bitmap::clearToZero() {
- memset(data, 0, h * line);
-}
-
-void JBIG2Bitmap::clearToOne() {
- memset(data, 0xff, h * line);
-}
-
-inline void JBIG2Bitmap::getPixelPtr(int x, int y, JBIG2BitmapPtr *ptr) {
- if (y < 0 || y >= h || x >= w) {
- ptr->p = NULL;
- ptr->shift = 0; // make gcc happy
- ptr->x = 0; // make gcc happy
- } else if (x < 0) {
- ptr->p = &data[y * line];
- ptr->shift = 7;
- ptr->x = x;
- } else {
- ptr->p = &data[y * line + (x >> 3)];
- ptr->shift = 7 - (x & 7);
- ptr->x = x;
- }
-}
-
-inline int JBIG2Bitmap::nextPixel(JBIG2BitmapPtr *ptr) {
- int pix;
-
- if (!ptr->p) {
- pix = 0;
- } else if (ptr->x < 0) {
- ++ptr->x;
- pix = 0;
- } else {
- pix = (*ptr->p >> ptr->shift) & 1;
- if (++ptr->x == w) {
- ptr->p = NULL;
- } else if (ptr->shift == 0) {
- ++ptr->p;
- ptr->shift = 7;
- } else {
- --ptr->shift;
- }
- }
- return pix;
-}
-
-void JBIG2Bitmap::duplicateRow(int yDest, int ySrc) {
- memcpy(data + yDest * line, data + ySrc * line, line);
-}
-
-void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y,
- Guint combOp) {
- int x0, x1, y0, y1, xx, yy;
- Guchar *srcPtr, *destPtr;
- Guint src0, src1, src, dest, s1, s2, m1, m2, m3;
- GBool oneByte;
-
- // check for the pathological case where y = -2^31
- if (y < -0x7fffffff) {
- return;
- }
- if (y < 0) {
- y0 = -y;
- } else {
- y0 = 0;
- }
- if (y + bitmap->h > h) {
- y1 = h - y;
- } else {
- y1 = bitmap->h;
- }
- if (y0 >= y1) {
- return;
- }
-
- if (x >= 0) {
- x0 = x & ~7;
- } else {
- x0 = 0;
- }
- x1 = x + bitmap->w;
- if (x1 > w) {
- x1 = w;
- }
- if (x0 >= x1) {
- return;
- }
-
- s1 = x & 7;
- s2 = 8 - s1;
- m1 = 0xff >> (x1 & 7);
- m2 = 0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7));
- m3 = (0xff >> s1) & m2;
-
- oneByte = x0 == ((x1 - 1) & ~7);
-
- for (yy = y0; yy < y1; ++yy) {
-
- // one byte per line -- need to mask both left and right side
- if (oneByte) {
- if (x >= 0) {
- destPtr = data + (y + yy) * line + (x >> 3);
- srcPtr = bitmap->data + yy * bitmap->line;
- dest = *destPtr;
- src1 = *srcPtr;
- switch (combOp) {
- case 0: // or
- dest |= (src1 >> s1) & m2;
- break;
- case 1: // and
- dest &= ((0xff00 | src1) >> s1) | m1;
- break;
- case 2: // xor
- dest ^= (src1 >> s1) & m2;
- break;
- case 3: // xnor
- dest ^= ((src1 ^ 0xff) >> s1) & m2;
- break;
- case 4: // replace
- dest = (dest & ~m3) | ((src1 >> s1) & m3);
- break;
- }
- *destPtr = dest;
- } else {
- destPtr = data + (y + yy) * line;
- srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
- dest = *destPtr;
- src1 = *srcPtr;
- switch (combOp) {
- case 0: // or
- dest |= src1 & m2;
- break;
- case 1: // and
- dest &= src1 | m1;
- break;
- case 2: // xor
- dest ^= src1 & m2;
- break;
- case 3: // xnor
- dest ^= (src1 ^ 0xff) & m2;
- break;
- case 4: // replace
- dest = (src1 & m2) | (dest & m1);
- break;
- }
- *destPtr = dest;
- }
-
- // multiple bytes per line -- need to mask left side of left-most
- // byte and right side of right-most byte
- } else {
-
- // left-most byte
- if (x >= 0) {
- destPtr = data + (y + yy) * line + (x >> 3);
- srcPtr = bitmap->data + yy * bitmap->line;
- src1 = *srcPtr++;
- dest = *destPtr;
- switch (combOp) {
- case 0: // or
- dest |= src1 >> s1;
- break;
- case 1: // and
- dest &= (0xff00 | src1) >> s1;
- break;
- case 2: // xor
- dest ^= src1 >> s1;
- break;
- case 3: // xnor
- dest ^= (src1 ^ 0xff) >> s1;
- break;
- case 4: // replace
- dest = (dest & (0xff << s2)) | (src1 >> s1);
- break;
- }
- *destPtr++ = dest;
- xx = x0 + 8;
- } else {
- destPtr = data + (y + yy) * line;
- srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
- src1 = *srcPtr++;
- xx = x0;
- }
-
- // middle bytes
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- switch (combOp) {
- case 0: // or
- dest |= src;
- break;
- case 1: // and
- dest &= src;
- break;
- case 2: // xor
- dest ^= src;
- break;
- case 3: // xnor
- dest ^= src ^ 0xff;
- break;
- case 4: // replace
- dest = src;
- break;
- }
- *destPtr++ = dest;
- }
-
- // right-most byte
- // note: this last byte (src1) may not actually be used, depending
- // on the values of s1, m1, and m2 - and in fact, it may be off
- // the edge of the source bitmap, which means we need to allocate
- // one extra guard byte at the end of each bitmap
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- switch (combOp) {
- case 0: // or
- dest |= src & m2;
- break;
- case 1: // and
- dest &= src | m1;
- break;
- case 2: // xor
- dest ^= src & m2;
- break;
- case 3: // xnor
- dest ^= (src ^ 0xff) & m2;
- break;
- case 4: // replace
- dest = (src & m2) | (dest & m1);
- break;
- }
- *destPtr = dest;
- }
- }
-}
-
-//------------------------------------------------------------------------
-// JBIG2SymbolDict
-//------------------------------------------------------------------------
-
-class JBIG2SymbolDict: public JBIG2Segment {
-public:
-
- JBIG2SymbolDict(Guint segNumA, Guint sizeA);
- virtual ~JBIG2SymbolDict();
- virtual JBIG2SegmentType getType() { return jbig2SegSymbolDict; }
- Guint getSize() { return size; }
- void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
- JBIG2Bitmap *getBitmap(Guint idx) { return bitmaps[idx]; }
- void setGenericRegionStats(JArithmeticDecoderStats *stats)
- { genericRegionStats = stats; }
- void setRefinementRegionStats(JArithmeticDecoderStats *stats)
- { refinementRegionStats = stats; }
- JArithmeticDecoderStats *getGenericRegionStats()
- { return genericRegionStats; }
- JArithmeticDecoderStats *getRefinementRegionStats()
- { return refinementRegionStats; }
-
-private:
-
- Guint size;
- JBIG2Bitmap **bitmaps;
- JArithmeticDecoderStats *genericRegionStats;
- JArithmeticDecoderStats *refinementRegionStats;
-};
-
-JBIG2SymbolDict::JBIG2SymbolDict(Guint segNumA, Guint sizeA):
- JBIG2Segment(segNumA)
-{
- Guint i;
-
- size = sizeA;
- bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *));
- for (i = 0; i < size; ++i) {
- bitmaps[i] = NULL;
- }
- genericRegionStats = NULL;
- refinementRegionStats = NULL;
-}
-
-JBIG2SymbolDict::~JBIG2SymbolDict() {
- Guint i;
-
- for (i = 0; i < size; ++i) {
- if (bitmaps[i]) {
- delete bitmaps[i];
- }
- }
- gfree(bitmaps);
- if (genericRegionStats) {
- delete genericRegionStats;
- }
- if (refinementRegionStats) {
- delete refinementRegionStats;
- }
-}
-
-//------------------------------------------------------------------------
-// JBIG2PatternDict
-//------------------------------------------------------------------------
-
-class JBIG2PatternDict: public JBIG2Segment {
-public:
-
- JBIG2PatternDict(Guint segNumA, Guint sizeA);
- virtual ~JBIG2PatternDict();
- virtual JBIG2SegmentType getType() { return jbig2SegPatternDict; }
- Guint getSize() { return size; }
- void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
- JBIG2Bitmap *getBitmap(Guint idx) { return bitmaps[idx]; }
-
-private:
-
- Guint size;
- JBIG2Bitmap **bitmaps;
-};
-
-JBIG2PatternDict::JBIG2PatternDict(Guint segNumA, Guint sizeA):
- JBIG2Segment(segNumA)
-{
- size = sizeA;
- bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *));
-}
-
-JBIG2PatternDict::~JBIG2PatternDict() {
- Guint i;
-
- for (i = 0; i < size; ++i) {
- delete bitmaps[i];
- }
- gfree(bitmaps);
-}
-
-//------------------------------------------------------------------------
-// JBIG2CodeTable
-//------------------------------------------------------------------------
-
-class JBIG2CodeTable: public JBIG2Segment {
-public:
-
- JBIG2CodeTable(Guint segNumA, JBIG2HuffmanTable *tableA);
- virtual ~JBIG2CodeTable();
- virtual JBIG2SegmentType getType() { return jbig2SegCodeTable; }
- JBIG2HuffmanTable *getHuffTable() { return table; }
-
-private:
-
- JBIG2HuffmanTable *table;
-};
-
-JBIG2CodeTable::JBIG2CodeTable(Guint segNumA, JBIG2HuffmanTable *tableA):
- JBIG2Segment(segNumA)
-{
- table = tableA;
-}
-
-JBIG2CodeTable::~JBIG2CodeTable() {
- gfree(table);
-}
-
-//------------------------------------------------------------------------
-// JBIG2Stream
-//------------------------------------------------------------------------
-
-JBIG2Stream::JBIG2Stream(Stream *strA, Object *globalsStreamA):
- FilterStream(strA)
-{
- pageBitmap = NULL;
-
- arithDecoder = new JArithmeticDecoder();
- genericRegionStats = new JArithmeticDecoderStats(1 << 1);
- refinementRegionStats = new JArithmeticDecoderStats(1 << 1);
- iadhStats = new JArithmeticDecoderStats(1 << 9);
- iadwStats = new JArithmeticDecoderStats(1 << 9);
- iaexStats = new JArithmeticDecoderStats(1 << 9);
- iaaiStats = new JArithmeticDecoderStats(1 << 9);
- iadtStats = new JArithmeticDecoderStats(1 << 9);
- iaitStats = new JArithmeticDecoderStats(1 << 9);
- iafsStats = new JArithmeticDecoderStats(1 << 9);
- iadsStats = new JArithmeticDecoderStats(1 << 9);
- iardxStats = new JArithmeticDecoderStats(1 << 9);
- iardyStats = new JArithmeticDecoderStats(1 << 9);
- iardwStats = new JArithmeticDecoderStats(1 << 9);
- iardhStats = new JArithmeticDecoderStats(1 << 9);
- iariStats = new JArithmeticDecoderStats(1 << 9);
- iaidStats = new JArithmeticDecoderStats(1 << 1);
- huffDecoder = new JBIG2HuffmanDecoder();
- mmrDecoder = new JBIG2MMRDecoder();
-
- globalsStreamA->copy(&globalsStream);
- segments = globalSegments = NULL;
- curStr = NULL;
- dataPtr = dataEnd = NULL;
-}
-
-JBIG2Stream::~JBIG2Stream() {
- close();
- globalsStream.free();
- delete arithDecoder;
- delete genericRegionStats;
- delete refinementRegionStats;
- delete iadhStats;
- delete iadwStats;
- delete iaexStats;
- delete iaaiStats;
- delete iadtStats;
- delete iaitStats;
- delete iafsStats;
- delete iadsStats;
- delete iardxStats;
- delete iardyStats;
- delete iardwStats;
- delete iardhStats;
- delete iariStats;
- delete iaidStats;
- delete huffDecoder;
- delete mmrDecoder;
- delete str;
-}
-
-void JBIG2Stream::reset() {
- // read the globals stream
- globalSegments = new GList();
- if (globalsStream.isStream()) {
- segments = globalSegments;
- curStr = globalsStream.getStream();
- curStr->reset();
- arithDecoder->setStream(curStr);
- huffDecoder->setStream(curStr);
- mmrDecoder->setStream(curStr);
- readSegments();
- curStr->close();
- }
-
- // read the main stream
- segments = new GList();
- curStr = str;
- curStr->reset();
- arithDecoder->setStream(curStr);
- huffDecoder->setStream(curStr);
- mmrDecoder->setStream(curStr);
- readSegments();
-
- if (pageBitmap) {
- dataPtr = pageBitmap->getDataPtr();
- dataEnd = dataPtr + pageBitmap->getDataSize();
- } else {
- dataPtr = dataEnd = NULL;
- }
-}
-
-void JBIG2Stream::close() {
- if (pageBitmap) {
- delete pageBitmap;
- pageBitmap = NULL;
- }
- if (segments) {
- deleteGList(segments, JBIG2Segment);
- segments = NULL;
- }
- if (globalSegments) {
- deleteGList(globalSegments, JBIG2Segment);
- globalSegments = NULL;
- }
- dataPtr = dataEnd = NULL;
- FilterStream::close();
-}
-
-int JBIG2Stream::getChar() {
- if (dataPtr && dataPtr < dataEnd) {
- return (*dataPtr++ ^ 0xff) & 0xff;
- }
- return EOF;
-}
-
-int JBIG2Stream::lookChar() {
- if (dataPtr && dataPtr < dataEnd) {
- return (*dataPtr ^ 0xff) & 0xff;
- }
- return EOF;
-}
-
-GString *JBIG2Stream::getPSFilter(int /*psLevel*/, char * /*indent*/) {
- return NULL;
-}
-
-GBool JBIG2Stream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-void JBIG2Stream::readSegments() {
- Guint segNum, segFlags, segType, page, segLength;
- Guint refFlags, nRefSegs;
- Guint *refSegs;
- int segDataPos;
- int c1, c2, c3;
- Guint i;
-
- while (readULong(&segNum)) {
-
- // segment header flags
- if (!readUByte(&segFlags)) {
- goto eofError1;
- }
- segType = segFlags & 0x3f;
-
- // referred-to segment count and retention flags
- if (!readUByte(&refFlags)) {
- goto eofError1;
- }
- nRefSegs = refFlags >> 5;
- if (nRefSegs == 7) {
- if ((c1 = curStr->getChar()) == EOF ||
- (c2 = curStr->getChar()) == EOF ||
- (c3 = curStr->getChar()) == EOF) {
- goto eofError1;
- }
- refFlags = (refFlags << 24) | (c1 << 16) | (c2 << 8) | c3;
- nRefSegs = refFlags & 0x1fffffff;
- for (i = 0; i < (nRefSegs + 9) >> 3; ++i) {
- c1 = curStr->getChar();
- }
- }
-
- // referred-to segment numbers
- refSegs = (Guint *)gmallocn(nRefSegs, sizeof(Guint));
- if (segNum <= 256) {
- for (i = 0; i < nRefSegs; ++i) {
- if (!readUByte(&refSegs[i])) {
- goto eofError2;
- }
- }
- } else if (segNum <= 65536) {
- for (i = 0; i < nRefSegs; ++i) {
- if (!readUWord(&refSegs[i])) {
- goto eofError2;
- }
- }
- } else {
- for (i = 0; i < nRefSegs; ++i) {
- if (!readULong(&refSegs[i])) {
- goto eofError2;
- }
- }
- }
-
- // segment page association
- if (segFlags & 0x40) {
- if (!readULong(&page)) {
- goto eofError2;
- }
- } else {
- if (!readUByte(&page)) {
- goto eofError2;
- }
- }
-
- // segment data length
- if (!readULong(&segLength)) {
- goto eofError2;
- }
-
- // keep track of the start of the segment data
- segDataPos = getPos();
-
- // check for missing page information segment
- if (!pageBitmap && ((segType >= 4 && segType <= 7) ||
- (segType >= 20 && segType <= 43))) {
- error(getPos(), "First JBIG2 segment associated with a page must be a page information segment");
- goto syntaxError;
- }
-
- // read the segment data
- switch (segType) {
- case 0:
- if (!readSymbolDictSeg(segNum, segLength, refSegs, nRefSegs)) {
- goto syntaxError;
- }
- break;
- case 4:
- readTextRegionSeg(segNum, gFalse, gFalse, segLength, refSegs, nRefSegs);
- break;
- case 6:
- readTextRegionSeg(segNum, gTrue, gFalse, segLength, refSegs, nRefSegs);
- break;
- case 7:
- readTextRegionSeg(segNum, gTrue, gTrue, segLength, refSegs, nRefSegs);
- break;
- case 16:
- readPatternDictSeg(segNum, segLength);
- break;
- case 20:
- readHalftoneRegionSeg(segNum, gFalse, gFalse, segLength,
- refSegs, nRefSegs);
- break;
- case 22:
- readHalftoneRegionSeg(segNum, gTrue, gFalse, segLength,
- refSegs, nRefSegs);
- break;
- case 23:
- readHalftoneRegionSeg(segNum, gTrue, gTrue, segLength,
- refSegs, nRefSegs);
- break;
- case 36:
- readGenericRegionSeg(segNum, gFalse, gFalse, segLength);
- break;
- case 38:
- readGenericRegionSeg(segNum, gTrue, gFalse, segLength);
- break;
- case 39:
- readGenericRegionSeg(segNum, gTrue, gTrue, segLength);
- break;
- case 40:
- readGenericRefinementRegionSeg(segNum, gFalse, gFalse, segLength,
- refSegs, nRefSegs);
- break;
- case 42:
- readGenericRefinementRegionSeg(segNum, gTrue, gFalse, segLength,
- refSegs, nRefSegs);
- break;
- case 43:
- readGenericRefinementRegionSeg(segNum, gTrue, gTrue, segLength,
- refSegs, nRefSegs);
- break;
- case 48:
- readPageInfoSeg(segLength);
- break;
- case 50:
- readEndOfStripeSeg(segLength);
- break;
- case 52:
- readProfilesSeg(segLength);
- break;
- case 53:
- readCodeTableSeg(segNum, segLength);
- break;
- case 62:
- readExtensionSeg(segLength);
- break;
- default:
- error(getPos(), "Unknown segment type in JBIG2 stream");
- for (i = 0; i < segLength; ++i) {
- if ((c1 = curStr->getChar()) == EOF) {
- goto eofError2;
- }
- }
- break;
- }
-
- // Make sure the segment handler read all of the bytes in the
- // segment data, unless this segment is marked as having an
- // unknown length (section 7.2.7 of the JBIG2 Final Committee Draft)
-
- if (segLength != 0xffffffff) {
-
- int segExtraBytes = segDataPos + segLength - getPos();
- if (segExtraBytes > 0) {
-
- // If we didn't read all of the bytes in the segment data,
- // indicate an error, and throw away the rest of the data.
-
- // v.3.1.01.13 of the LuraTech PDF Compressor Server will
- // sometimes generate an extraneous NULL byte at the end of
- // arithmetic-coded symbol dictionary segments when numNewSyms
- // == 0. Segments like this often occur for blank pages.
-
- error(getPos(), "%d extraneous byte%s after segment",
- segExtraBytes, (segExtraBytes > 1) ? "s" : "");
-
- // Burn through the remaining bytes -- inefficient, but
- // hopefully we're not doing this much
-
- int trash;
- for (int i = segExtraBytes; i > 0; i--) {
- readByte(&trash);
- }
-
- } else if (segExtraBytes < 0) {
-
- // If we read more bytes than we should have, according to the
- // segment length field, note an error.
-
- error(getPos(), "Previous segment handler read too many bytes");
-
- }
-
- }
-
- gfree(refSegs);
- }
-
- return;
-
- syntaxError:
- gfree(refSegs);
- return;
-
- eofError2:
- gfree(refSegs);
- eofError1:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint /*length*/,
- Guint *refSegs, Guint nRefSegs) {
- JBIG2SymbolDict *symbolDict;
- JBIG2HuffmanTable *huffDHTable, *huffDWTable;
- JBIG2HuffmanTable *huffBMSizeTable, *huffAggInstTable;
- JBIG2Segment *seg;
- GList *codeTables;
- JBIG2SymbolDict *inputSymbolDict;
- Guint flags, sdTemplate, sdrTemplate, huff, refAgg;
- Guint huffDH, huffDW, huffBMSize, huffAggInst;
- Guint contextUsed, contextRetained;
- int sdATX[4], sdATY[4], sdrATX[2], sdrATY[2];
- Guint numExSyms, numNewSyms, numInputSyms, symCodeLen;
- JBIG2Bitmap **bitmaps;
- JBIG2Bitmap *collBitmap, *refBitmap;
- Guint *symWidths;
- Guint symHeight, symWidth, totalWidth, x, symID;
- int dh, dw, refAggNum, refDX, refDY, bmSize;
- GBool ex;
- int run, cnt;
- Guint i, j, k;
- Guchar *p;
-
- symWidths = NULL;
-
- // symbol dictionary flags
- if (!readUWord(&flags)) {
- goto eofError;
- }
- sdTemplate = (flags >> 10) & 3;
- sdrTemplate = (flags >> 12) & 1;
- huff = flags & 1;
- refAgg = (flags >> 1) & 1;
- huffDH = (flags >> 2) & 3;
- huffDW = (flags >> 4) & 3;
- huffBMSize = (flags >> 6) & 1;
- huffAggInst = (flags >> 7) & 1;
- contextUsed = (flags >> 8) & 1;
- contextRetained = (flags >> 9) & 1;
-
- // symbol dictionary AT flags
- if (!huff) {
- if (sdTemplate == 0) {
- if (!readByte(&sdATX[0]) ||
- !readByte(&sdATY[0]) ||
- !readByte(&sdATX[1]) ||
- !readByte(&sdATY[1]) ||
- !readByte(&sdATX[2]) ||
- !readByte(&sdATY[2]) ||
- !readByte(&sdATX[3]) ||
- !readByte(&sdATY[3])) {
- goto eofError;
- }
- } else {
- if (!readByte(&sdATX[0]) ||
- !readByte(&sdATY[0])) {
- goto eofError;
- }
- }
- }
-
- // symbol dictionary refinement AT flags
- if (refAgg && !sdrTemplate) {
- if (!readByte(&sdrATX[0]) ||
- !readByte(&sdrATY[0]) ||
- !readByte(&sdrATX[1]) ||
- !readByte(&sdrATY[1])) {
- goto eofError;
- }
- }
-
- // SDNUMEXSYMS and SDNUMNEWSYMS
- if (!readULong(&numExSyms) || !readULong(&numNewSyms)) {
- goto eofError;
- }
-
- // get referenced segments: input symbol dictionaries and code tables
- codeTables = new GList();
- numInputSyms = 0;
- for (i = 0; i < nRefSegs; ++i) {
- if ((seg = findSegment(refSegs[i]))) {
- if (seg->getType() == jbig2SegSymbolDict) {
- j = ((JBIG2SymbolDict *)seg)->getSize();
- if (numInputSyms > UINT_MAX - j) {
- error(getPos(), "Too many input symbols in JBIG2 symbol dictionary");
- delete codeTables;
- goto eofError;
- }
- numInputSyms += j;
- } else if (seg->getType() == jbig2SegCodeTable) {
- codeTables->append(seg);
- }
- }
- }
- if (numInputSyms > UINT_MAX - numNewSyms) {
- error(getPos(), "Too many input symbols in JBIG2 symbol dictionary");
- delete codeTables;
- goto eofError;
- }
-
- // compute symbol code length
- symCodeLen = 1;
- i = (numInputSyms + numNewSyms) >> 1;
- while (i) {
- ++symCodeLen;
- i >>= 1;
- }
-
- // get the input symbol bitmaps
- bitmaps = (JBIG2Bitmap **)gmallocn(numInputSyms + numNewSyms,
- sizeof(JBIG2Bitmap *));
- for (i = 0; i < numInputSyms + numNewSyms; ++i) {
- bitmaps[i] = NULL;
- }
- k = 0;
- inputSymbolDict = NULL;
- for (i = 0; i < nRefSegs; ++i) {
- if ((seg = findSegment(refSegs[i]))) {
- if (seg->getType() == jbig2SegSymbolDict) {
- inputSymbolDict = (JBIG2SymbolDict *)seg;
- for (j = 0; j < inputSymbolDict->getSize(); ++j) {
- bitmaps[k++] = inputSymbolDict->getBitmap(j);
- }
- }
- }
- }
-
- // get the Huffman tables
- huffDHTable = huffDWTable = NULL; // make gcc happy
- huffBMSizeTable = huffAggInstTable = NULL; // make gcc happy
- i = 0;
- if (huff) {
- if (huffDH == 0) {
- huffDHTable = huffTableD;
- } else if (huffDH == 1) {
- huffDHTable = huffTableE;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffDW == 0) {
- huffDWTable = huffTableB;
- } else if (huffDW == 1) {
- huffDWTable = huffTableC;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffBMSize == 0) {
- huffBMSizeTable = huffTableA;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffBMSizeTable =
- ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffAggInst == 0) {
- huffAggInstTable = huffTableA;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffAggInstTable =
- ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- }
- delete codeTables;
-
- // set up the Huffman decoder
- if (huff) {
- huffDecoder->reset();
-
- // set up the arithmetic decoder
- } else {
- if (contextUsed && inputSymbolDict) {
- resetGenericStats(sdTemplate, inputSymbolDict->getGenericRegionStats());
- } else {
- resetGenericStats(sdTemplate, NULL);
- }
- resetIntStats(symCodeLen);
- arithDecoder->start();
- }
-
- // set up the arithmetic decoder for refinement/aggregation
- if (refAgg) {
- if (contextUsed && inputSymbolDict) {
- resetRefinementStats(sdrTemplate,
- inputSymbolDict->getRefinementRegionStats());
- } else {
- resetRefinementStats(sdrTemplate, NULL);
- }
- }
-
- // allocate symbol widths storage
- if (huff && !refAgg) {
- symWidths = (Guint *)gmallocn(numNewSyms, sizeof(Guint));
- }
-
- symHeight = 0;
- i = 0;
- while (i < numNewSyms) {
-
- // read the height class delta height
- if (huff) {
- huffDecoder->decodeInt(&dh, huffDHTable);
- } else {
- arithDecoder->decodeInt(&dh, iadhStats);
- }
- if (dh < 0 && (Guint)-dh >= symHeight) {
- error(getPos(), "Bad delta-height value in JBIG2 symbol dictionary");
- goto syntaxError;
- }
- symHeight += dh;
- symWidth = 0;
- totalWidth = 0;
- j = i;
-
- // read the symbols in this height class
- while (1) {
-
- // read the delta width
- if (huff) {
- if (!huffDecoder->decodeInt(&dw, huffDWTable)) {
- break;
- }
- } else {
- if (!arithDecoder->decodeInt(&dw, iadwStats)) {
- break;
- }
- }
- if (dw < 0 && (Guint)-dw >= symWidth) {
- error(getPos(), "Bad delta-height value in JBIG2 symbol dictionary");
- goto syntaxError;
- }
- symWidth += dw;
- if (i >= numNewSyms) {
- error(getPos(), "Too many symbols in JBIG2 symbol dictionary");
- goto syntaxError;
- }
-
- // using a collective bitmap, so don't read a bitmap here
- if (huff && !refAgg) {
- symWidths[i] = symWidth;
- totalWidth += symWidth;
-
- // refinement/aggregate coding
- } else if (refAgg) {
- if (huff) {
- if (!huffDecoder->decodeInt(&refAggNum, huffAggInstTable)) {
- break;
- }
- } else {
- if (!arithDecoder->decodeInt(&refAggNum, iaaiStats)) {
- break;
- }
- }
-#if 0 //~ This special case was added about a year before the final draft
- //~ of the JBIG2 spec was released. I have encountered some old
- //~ JBIG2 images that predate it.
- if (0) {
-#else
- if (refAggNum == 1) {
-#endif
- if (huff) {
- symID = huffDecoder->readBits(symCodeLen);
- huffDecoder->decodeInt(&refDX, huffTableO);
- huffDecoder->decodeInt(&refDY, huffTableO);
- huffDecoder->decodeInt(&bmSize, huffTableA);
- huffDecoder->reset();
- arithDecoder->start();
- } else {
- symID = arithDecoder->decodeIAID(symCodeLen, iaidStats);
- arithDecoder->decodeInt(&refDX, iardxStats);
- arithDecoder->decodeInt(&refDY, iardyStats);
- }
- if (symID >= numInputSyms + i) {
- error(getPos(), "Invalid symbol ID in JBIG2 symbol dictionary");
- goto syntaxError;
- }
- refBitmap = bitmaps[symID];
- bitmaps[numInputSyms + i] =
- readGenericRefinementRegion(symWidth, symHeight,
- sdrTemplate, gFalse,
- refBitmap, refDX, refDY,
- sdrATX, sdrATY);
- //~ do we need to use the bmSize value here (in Huffman mode)?
- } else {
- bitmaps[numInputSyms + i] =
- readTextRegion(huff, gTrue, symWidth, symHeight,
- refAggNum, 0, numInputSyms + i, NULL,
- symCodeLen, bitmaps, 0, 0, 0, 1, 0,
- huffTableF, huffTableH, huffTableK, huffTableO,
- huffTableO, huffTableO, huffTableO, huffTableA,
- sdrTemplate, sdrATX, sdrATY);
- }
-
- // non-ref/agg coding
- } else {
- bitmaps[numInputSyms + i] =
- readGenericBitmap(gFalse, symWidth, symHeight,
- sdTemplate, gFalse, gFalse, NULL,
- sdATX, sdATY, 0);
- }
-
- ++i;
- }
-
- // read the collective bitmap
- if (huff && !refAgg) {
- huffDecoder->decodeInt(&bmSize, huffBMSizeTable);
- huffDecoder->reset();
- if (bmSize == 0) {
- collBitmap = new JBIG2Bitmap(0, totalWidth, symHeight);
- bmSize = symHeight * ((totalWidth + 7) >> 3);
- p = collBitmap->getDataPtr();
- for (k = 0; k < (Guint)bmSize; ++k) {
- *p++ = curStr->getChar();
- }
- } else {
- collBitmap = readGenericBitmap(gTrue, totalWidth, symHeight,
- 0, gFalse, gFalse, NULL, NULL, NULL,
- bmSize);
- }
- x = 0;
- for (; j < i; ++j) {
- bitmaps[numInputSyms + j] =
- collBitmap->getSlice(x, 0, symWidths[j], symHeight);
- x += symWidths[j];
- }
- delete collBitmap;
- }
- }
-
- // create the symbol dict object
- symbolDict = new JBIG2SymbolDict(segNum, numExSyms);
-
- // exported symbol list
- i = j = 0;
- ex = gFalse;
- while (i < numInputSyms + numNewSyms) {
- if (huff) {
- huffDecoder->decodeInt(&run, huffTableA);
- } else {
- arithDecoder->decodeInt(&run, iaexStats);
- }
- if (i + run > numInputSyms + numNewSyms ||
- (ex && j + run > numExSyms)) {
- error(getPos(), "Too many exported symbols in JBIG2 symbol dictionary");
- delete symbolDict;
- goto syntaxError;
- }
- if (ex) {
- for (cnt = 0; cnt < run; ++cnt) {
- symbolDict->setBitmap(j++, bitmaps[i++]->copy());
- }
- } else {
- i += run;
- }
- ex = !ex;
- }
- if (j != numExSyms) {
- error(getPos(), "Too few symbols in JBIG2 symbol dictionary");
- delete symbolDict;
- goto syntaxError;
- }
-
- for (i = 0; i < numNewSyms; ++i) {
- delete bitmaps[numInputSyms + i];
- }
- gfree(bitmaps);
- if (symWidths) {
- gfree(symWidths);
- }
-
- // save the arithmetic decoder stats
- if (!huff && contextRetained) {
- symbolDict->setGenericRegionStats(genericRegionStats->copy());
- if (refAgg) {
- symbolDict->setRefinementRegionStats(refinementRegionStats->copy());
- }
- }
-
- // store the new symbol dict
- segments->append(symbolDict);
-
- return gTrue;
-
- codeTableError:
- error(getPos(), "Missing code table in JBIG2 symbol dictionary");
- delete codeTables;
-
- syntaxError:
- for (i = 0; i < numNewSyms; ++i) {
- if (bitmaps[numInputSyms + i]) {
- delete bitmaps[numInputSyms + i];
- }
- }
- gfree(bitmaps);
- if (symWidths) {
- gfree(symWidths);
- }
- return gFalse;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
- return gFalse;
-}
-
-void JBIG2Stream::readTextRegionSeg(Guint segNum, GBool imm,
- GBool /*lossless*/, Guint /*length*/,
- Guint *refSegs, Guint nRefSegs) {
- JBIG2Bitmap *bitmap;
- JBIG2HuffmanTable runLengthTab[36];
- JBIG2HuffmanTable *symCodeTab;
- JBIG2HuffmanTable *huffFSTable, *huffDSTable, *huffDTTable;
- JBIG2HuffmanTable *huffRDWTable, *huffRDHTable;
- JBIG2HuffmanTable *huffRDXTable, *huffRDYTable, *huffRSizeTable;
- JBIG2Segment *seg;
- GList *codeTables;
- JBIG2SymbolDict *symbolDict;
- JBIG2Bitmap **syms;
- Guint w, h, x, y, segInfoFlags, extCombOp;
- Guint flags, huff, refine, logStrips, refCorner, transposed;
- Guint combOp, defPixel, templ;
- int sOffset;
- Guint huffFlags, huffFS, huffDS, huffDT;
- Guint huffRDW, huffRDH, huffRDX, huffRDY, huffRSize;
- Guint numInstances, numSyms, symCodeLen;
- int atx[2], aty[2];
- Guint i, k, kk;
- int j;
-
- // region segment info field
- if (!readULong(&w) || !readULong(&h) ||
- !readULong(&x) || !readULong(&y) ||
- !readUByte(&segInfoFlags)) {
- goto eofError;
- }
- extCombOp = segInfoFlags & 7;
-
- // rest of the text region header
- if (!readUWord(&flags)) {
- goto eofError;
- }
- huff = flags & 1;
- refine = (flags >> 1) & 1;
- logStrips = (flags >> 2) & 3;
- refCorner = (flags >> 4) & 3;
- transposed = (flags >> 6) & 1;
- combOp = (flags >> 7) & 3;
- defPixel = (flags >> 9) & 1;
- sOffset = (flags >> 10) & 0x1f;
- if (sOffset & 0x10) {
- sOffset |= -1 - 0x0f;
- }
- templ = (flags >> 15) & 1;
- huffFS = huffDS = huffDT = 0; // make gcc happy
- huffRDW = huffRDH = huffRDX = huffRDY = huffRSize = 0; // make gcc happy
- if (huff) {
- if (!readUWord(&huffFlags)) {
- goto eofError;
- }
- huffFS = huffFlags & 3;
- huffDS = (huffFlags >> 2) & 3;
- huffDT = (huffFlags >> 4) & 3;
- huffRDW = (huffFlags >> 6) & 3;
- huffRDH = (huffFlags >> 8) & 3;
- huffRDX = (huffFlags >> 10) & 3;
- huffRDY = (huffFlags >> 12) & 3;
- huffRSize = (huffFlags >> 14) & 1;
- }
- if (refine && templ == 0) {
- if (!readByte(&atx[0]) || !readByte(&aty[0]) ||
- !readByte(&atx[1]) || !readByte(&aty[1])) {
- goto eofError;
- }
- }
- if (!readULong(&numInstances)) {
- goto eofError;
- }
-
- // get symbol dictionaries and tables
- codeTables = new GList();
- numSyms = 0;
- for (i = 0; i < nRefSegs; ++i) {
- if ((seg = findSegment(refSegs[i]))) {
- if (seg->getType() == jbig2SegSymbolDict) {
- numSyms += ((JBIG2SymbolDict *)seg)->getSize();
- } else if (seg->getType() == jbig2SegCodeTable) {
- codeTables->append(seg);
- }
- } else {
- error(getPos(), "Invalid segment reference in JBIG2 text region");
- delete codeTables;
- return;
- }
- }
- symCodeLen = 0;
- i = 1;
- while (i < numSyms) {
- ++symCodeLen;
- i <<= 1;
- }
-
- // get the symbol bitmaps
- syms = (JBIG2Bitmap **)gmallocn(numSyms, sizeof(JBIG2Bitmap *));
- kk = 0;
- for (i = 0; i < nRefSegs; ++i) {
- if ((seg = findSegment(refSegs[i]))) {
- if (seg->getType() == jbig2SegSymbolDict) {
- symbolDict = (JBIG2SymbolDict *)seg;
- for (k = 0; k < symbolDict->getSize(); ++k) {
- syms[kk++] = symbolDict->getBitmap(k);
- }
- }
- }
- }
-
- // get the Huffman tables
- huffFSTable = huffDSTable = huffDTTable = NULL; // make gcc happy
- huffRDWTable = huffRDHTable = NULL; // make gcc happy
- huffRDXTable = huffRDYTable = huffRSizeTable = NULL; // make gcc happy
- i = 0;
- if (huff) {
- if (huffFS == 0) {
- huffFSTable = huffTableF;
- } else if (huffFS == 1) {
- huffFSTable = huffTableG;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffFSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffDS == 0) {
- huffDSTable = huffTableH;
- } else if (huffDS == 1) {
- huffDSTable = huffTableI;
- } else if (huffDS == 2) {
- huffDSTable = huffTableJ;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffDSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffDT == 0) {
- huffDTTable = huffTableK;
- } else if (huffDT == 1) {
- huffDTTable = huffTableL;
- } else if (huffDT == 2) {
- huffDTTable = huffTableM;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffDTTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffRDW == 0) {
- huffRDWTable = huffTableN;
- } else if (huffRDW == 1) {
- huffRDWTable = huffTableO;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffRDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffRDH == 0) {
- huffRDHTable = huffTableN;
- } else if (huffRDH == 1) {
- huffRDHTable = huffTableO;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffRDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffRDX == 0) {
- huffRDXTable = huffTableN;
- } else if (huffRDX == 1) {
- huffRDXTable = huffTableO;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffRDXTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffRDY == 0) {
- huffRDYTable = huffTableN;
- } else if (huffRDY == 1) {
- huffRDYTable = huffTableO;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffRDYTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- if (huffRSize == 0) {
- huffRSizeTable = huffTableA;
- } else {
- if (i >= (Guint)codeTables->getLength()) {
- goto codeTableError;
- }
- huffRSizeTable =
- ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
- }
- }
- delete codeTables;
-
- // symbol ID Huffman decoding table
- if (huff) {
- huffDecoder->reset();
- for (i = 0; i < 32; ++i) {
- runLengthTab[i].val = i;
- runLengthTab[i].prefixLen = huffDecoder->readBits(4);
- runLengthTab[i].rangeLen = 0;
- }
- runLengthTab[32].val = 0x103;
- runLengthTab[32].prefixLen = huffDecoder->readBits(4);
- runLengthTab[32].rangeLen = 2;
- runLengthTab[33].val = 0x203;
- runLengthTab[33].prefixLen = huffDecoder->readBits(4);
- runLengthTab[33].rangeLen = 3;
- runLengthTab[34].val = 0x20b;
- runLengthTab[34].prefixLen = huffDecoder->readBits(4);
- runLengthTab[34].rangeLen = 7;
- runLengthTab[35].prefixLen = 0;
- runLengthTab[35].rangeLen = jbig2HuffmanEOT;
- huffDecoder->buildTable(runLengthTab, 35);
- symCodeTab = (JBIG2HuffmanTable *)gmallocn(numSyms + 1,
- sizeof(JBIG2HuffmanTable));
- for (i = 0; i < numSyms; ++i) {
- symCodeTab[i].val = i;
- symCodeTab[i].rangeLen = 0;
- }
- i = 0;
- while (i < numSyms) {
- huffDecoder->decodeInt(&j, runLengthTab);
- if (j > 0x200) {
- for (j -= 0x200; j && i < numSyms; --j) {
- symCodeTab[i++].prefixLen = 0;
- }
- } else if (j > 0x100) {
- for (j -= 0x100; j && i < numSyms; --j) {
- symCodeTab[i].prefixLen = symCodeTab[i-1].prefixLen;
- ++i;
- }
- } else {
- symCodeTab[i++].prefixLen = j;
- }
- }
- symCodeTab[numSyms].prefixLen = 0;
- symCodeTab[numSyms].rangeLen = jbig2HuffmanEOT;
- huffDecoder->buildTable(symCodeTab, numSyms);
- huffDecoder->reset();
-
- // set up the arithmetic decoder
- } else {
- symCodeTab = NULL;
- resetIntStats(symCodeLen);
- arithDecoder->start();
- }
- if (refine) {
- resetRefinementStats(templ, NULL);
- }
-
- bitmap = readTextRegion(huff, refine, w, h, numInstances,
- logStrips, numSyms, symCodeTab, symCodeLen, syms,
- defPixel, combOp, transposed, refCorner, sOffset,
- huffFSTable, huffDSTable, huffDTTable,
- huffRDWTable, huffRDHTable,
- huffRDXTable, huffRDYTable, huffRSizeTable,
- templ, atx, aty);
-
- gfree(syms);
-
- // combine the region bitmap into the page bitmap
- if (imm) {
- if (pageH == 0xffffffff && y + h > curPageH) {
- pageBitmap->expand(y + h, pageDefPixel);
- }
- pageBitmap->combine(bitmap, x, y, extCombOp);
- delete bitmap;
-
- // store the region bitmap
- } else {
- bitmap->setSegNum(segNum);
- segments->append(bitmap);
- }
-
- // clean up the Huffman decoder
- if (huff) {
- gfree(symCodeTab);
- }
-
- return;
-
- codeTableError:
- error(getPos(), "Missing code table in JBIG2 text region");
- gfree(codeTables);
- delete syms;
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
- return;
-}
-
-JBIG2Bitmap *JBIG2Stream::readTextRegion(GBool huff, GBool refine,
- int w, int h,
- Guint numInstances,
- Guint logStrips,
- int numSyms,
- JBIG2HuffmanTable *symCodeTab,
- Guint symCodeLen,
- JBIG2Bitmap **syms,
- Guint defPixel, Guint combOp,
- Guint transposed, Guint refCorner,
- int sOffset,
- JBIG2HuffmanTable *huffFSTable,
- JBIG2HuffmanTable *huffDSTable,
- JBIG2HuffmanTable *huffDTTable,
- JBIG2HuffmanTable *huffRDWTable,
- JBIG2HuffmanTable *huffRDHTable,
- JBIG2HuffmanTable *huffRDXTable,
- JBIG2HuffmanTable *huffRDYTable,
- JBIG2HuffmanTable *huffRSizeTable,
- Guint templ,
- int *atx, int *aty) {
- JBIG2Bitmap *bitmap;
- JBIG2Bitmap *symbolBitmap;
- Guint strips;
- int t, dt, tt, s, ds, sFirst, j;
- int rdw, rdh, rdx, rdy, ri, refDX, refDY, bmSize;
- Guint symID, inst, bw, bh;
-
- strips = 1 << logStrips;
-
- // allocate the bitmap
- bitmap = new JBIG2Bitmap(0, w, h);
- if (defPixel) {
- bitmap->clearToOne();
- } else {
- bitmap->clearToZero();
- }
-
- // decode initial T value
- if (huff) {
- huffDecoder->decodeInt(&t, huffDTTable);
- } else {
- arithDecoder->decodeInt(&t, iadtStats);
- }
- t *= -(int)strips;
-
- inst = 0;
- sFirst = 0;
- while (inst < numInstances) {
-
- // decode delta-T
- if (huff) {
- huffDecoder->decodeInt(&dt, huffDTTable);
- } else {
- arithDecoder->decodeInt(&dt, iadtStats);
- }
- t += dt * strips;
-
- // first S value
- if (huff) {
- huffDecoder->decodeInt(&ds, huffFSTable);
- } else {
- arithDecoder->decodeInt(&ds, iafsStats);
- }
- sFirst += ds;
- s = sFirst;
-
- // read the instances
- while (1) {
-
- // T value
- if (strips == 1) {
- dt = 0;
- } else if (huff) {
- dt = huffDecoder->readBits(logStrips);
- } else {
- arithDecoder->decodeInt(&dt, iaitStats);
- }
- tt = t + dt;
-
- // symbol ID
- if (huff) {
- if (symCodeTab) {
- huffDecoder->decodeInt(&j, symCodeTab);
- symID = (Guint)j;
- } else {
- symID = huffDecoder->readBits(symCodeLen);
- }
- } else {
- symID = arithDecoder->decodeIAID(symCodeLen, iaidStats);
- }
-
- if (symID >= (Guint)numSyms) {
- error(getPos(), "Invalid symbol number in JBIG2 text region");
- } else {
-
- // get the symbol bitmap
- symbolBitmap = NULL;
- if (refine) {
- if (huff) {
- ri = (int)huffDecoder->readBit();
- } else {
- arithDecoder->decodeInt(&ri, iariStats);
- }
- } else {
- ri = 0;
- }
- if (ri) {
- if (huff) {
- huffDecoder->decodeInt(&rdw, huffRDWTable);
- huffDecoder->decodeInt(&rdh, huffRDHTable);
- huffDecoder->decodeInt(&rdx, huffRDXTable);
- huffDecoder->decodeInt(&rdy, huffRDYTable);
- huffDecoder->decodeInt(&bmSize, huffRSizeTable);
- huffDecoder->reset();
- arithDecoder->start();
- } else {
- arithDecoder->decodeInt(&rdw, iardwStats);
- arithDecoder->decodeInt(&rdh, iardhStats);
- arithDecoder->decodeInt(&rdx, iardxStats);
- arithDecoder->decodeInt(&rdy, iardyStats);
- }
- refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx;
- refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy;
-
- symbolBitmap =
- readGenericRefinementRegion(rdw + syms[symID]->getWidth(),
- rdh + syms[symID]->getHeight(),
- templ, gFalse, syms[symID],
- refDX, refDY, atx, aty);
- //~ do we need to use the bmSize value here (in Huffman mode)?
- } else {
- symbolBitmap = syms[symID];
- }
-
- // combine the symbol bitmap into the region bitmap
- //~ something is wrong here - refCorner shouldn't degenerate into
- //~ two cases
- bw = symbolBitmap->getWidth() - 1;
- bh = symbolBitmap->getHeight() - 1;
- if (transposed) {
- switch (refCorner) {
- case 0: // bottom left
- bitmap->combine(symbolBitmap, tt, s, combOp);
- break;
- case 1: // top left
- bitmap->combine(symbolBitmap, tt, s, combOp);
- break;
- case 2: // bottom right
- bitmap->combine(symbolBitmap, tt - bw, s, combOp);
- break;
- case 3: // top right
- bitmap->combine(symbolBitmap, tt - bw, s, combOp);
- break;
- }
- s += bh;
- } else {
- switch (refCorner) {
- case 0: // bottom left
- bitmap->combine(symbolBitmap, s, tt - bh, combOp);
- break;
- case 1: // top left
- bitmap->combine(symbolBitmap, s, tt, combOp);
- break;
- case 2: // bottom right
- bitmap->combine(symbolBitmap, s, tt - bh, combOp);
- break;
- case 3: // top right
- bitmap->combine(symbolBitmap, s, tt, combOp);
- break;
- }
- s += bw;
- }
- if (ri) {
- delete symbolBitmap;
- }
- }
-
- // next instance
- ++inst;
-
- // next S value
- if (huff) {
- if (!huffDecoder->decodeInt(&ds, huffDSTable)) {
- break;
- }
- } else {
- if (!arithDecoder->decodeInt(&ds, iadsStats)) {
- break;
- }
- }
- s += sOffset + ds;
- }
- }
-
- return bitmap;
-}
-
-void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) {
- JBIG2PatternDict *patternDict;
- JBIG2Bitmap *bitmap;
- Guint flags, patternW, patternH, grayMax, templ, mmr;
- int atx[4], aty[4];
- Guint i, x;
-
- // halftone dictionary flags, pattern width and height, max gray value
- if (!readUByte(&flags) ||
- !readUByte(&patternW) ||
- !readUByte(&patternH) ||
- !readULong(&grayMax)) {
- goto eofError;
- }
- templ = (flags >> 1) & 3;
- mmr = flags & 1;
-
- // set up the arithmetic decoder
- if (!mmr) {
- resetGenericStats(templ, NULL);
- arithDecoder->start();
- }
-
- // read the bitmap
- atx[0] = -(int)patternW; aty[0] = 0;
- atx[1] = -3; aty[1] = -1;
- atx[2] = 2; aty[2] = -2;
- atx[3] = -2; aty[3] = -2;
- bitmap = readGenericBitmap(mmr, (grayMax + 1) * patternW, patternH,
- templ, gFalse, gFalse, NULL,
- atx, aty, length - 7);
-
- // create the pattern dict object
- patternDict = new JBIG2PatternDict(segNum, grayMax + 1);
-
- // split up the bitmap
- x = 0;
- for (i = 0; i <= grayMax; ++i) {
- patternDict->setBitmap(i, bitmap->getSlice(x, 0, patternW, patternH));
- x += patternW;
- }
-
- // free memory
- delete bitmap;
-
- // store the new pattern dict
- segments->append(patternDict);
-
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
- GBool /*lossless*/, Guint /*length*/,
- Guint *refSegs, Guint nRefSegs) {
- JBIG2Bitmap *bitmap;
- JBIG2Segment *seg;
- JBIG2PatternDict *patternDict;
- JBIG2Bitmap *skipBitmap;
- Guint *grayImg;
- JBIG2Bitmap *grayBitmap;
- JBIG2Bitmap *patternBitmap;
- Guint w, h, x, y, segInfoFlags, extCombOp;
- Guint flags, mmr, templ, enableSkip, combOp;
- Guint gridW, gridH, stepX, stepY, patW, patH;
- int atx[4], aty[4];
- int gridX, gridY, xx, yy, bit, j;
- Guint bpp, m, n, i;
-
- // region segment info field
- if (!readULong(&w) || !readULong(&h) ||
- !readULong(&x) || !readULong(&y) ||
- !readUByte(&segInfoFlags)) {
- goto eofError;
- }
- extCombOp = segInfoFlags & 7;
-
- // rest of the halftone region header
- if (!readUByte(&flags)) {
- goto eofError;
- }
- mmr = flags & 1;
- templ = (flags >> 1) & 3;
- enableSkip = (flags >> 3) & 1;
- combOp = (flags >> 4) & 7;
- if (!readULong(&gridW) || !readULong(&gridH) ||
- !readLong(&gridX) || !readLong(&gridY) ||
- !readUWord(&stepX) || !readUWord(&stepY)) {
- goto eofError;
- }
- if (w == 0 || h == 0 || w >= INT_MAX / h) {
- error(getPos(), "Bad bitmap size in JBIG2 halftone segment");
- return;
- }
- if (gridH == 0 || gridW >= INT_MAX / gridH) {
- error(getPos(), "Bad grid size in JBIG2 halftone segment");
- return;
- }
-
- // get pattern dictionary
- if (nRefSegs != 1) {
- error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
- return;
- }
- if (!(seg = findSegment(refSegs[0])) ||
- seg->getType() != jbig2SegPatternDict) {
- error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
- return;
- }
- patternDict = (JBIG2PatternDict *)seg;
- bpp = 0;
- i = 1;
- while (i < patternDict->getSize()) {
- ++bpp;
- i <<= 1;
- }
- patW = patternDict->getBitmap(0)->getWidth();
- patH = patternDict->getBitmap(0)->getHeight();
-
- // set up the arithmetic decoder
- if (!mmr) {
- resetGenericStats(templ, NULL);
- arithDecoder->start();
- }
-
- // allocate the bitmap
- bitmap = new JBIG2Bitmap(segNum, w, h);
- if (flags & 0x80) { // HDEFPIXEL
- bitmap->clearToOne();
- } else {
- bitmap->clearToZero();
- }
-
- // compute the skip bitmap
- skipBitmap = NULL;
- if (enableSkip) {
- skipBitmap = new JBIG2Bitmap(0, gridW, gridH);
- skipBitmap->clearToZero();
- for (m = 0; m < gridH; ++m) {
- for (n = 0; n < gridW; ++n) {
- xx = gridX + m * stepY + n * stepX;
- yy = gridY + m * stepX - n * stepY;
- if (((xx + (int)patW) >> 8) <= 0 || (xx >> 8) >= (int)w ||
- ((yy + (int)patH) >> 8) <= 0 || (yy >> 8) >= (int)h) {
- skipBitmap->setPixel(n, m);
- }
- }
- }
- }
-
- // read the gray-scale image
- grayImg = (Guint *)gmallocn(gridW * gridH, sizeof(Guint));
- memset(grayImg, 0, gridW * gridH * sizeof(Guint));
- atx[0] = templ <= 1 ? 3 : 2; aty[0] = -1;
- atx[1] = -3; aty[1] = -1;
- atx[2] = 2; aty[2] = -2;
- atx[3] = -2; aty[3] = -2;
- for (j = bpp - 1; j >= 0; --j) {
- grayBitmap = readGenericBitmap(mmr, gridW, gridH, templ, gFalse,
- enableSkip, skipBitmap, atx, aty, -1);
- i = 0;
- for (m = 0; m < gridH; ++m) {
- for (n = 0; n < gridW; ++n) {
- bit = grayBitmap->getPixel(n, m) ^ (grayImg[i] & 1);
- grayImg[i] = (grayImg[i] << 1) | bit;
- ++i;
- }
- }
- delete grayBitmap;
- }
-
- // decode the image
- i = 0;
- for (m = 0; m < gridH; ++m) {
- xx = gridX + m * stepY;
- yy = gridY + m * stepX;
- for (n = 0; n < gridW; ++n) {
- if (!(enableSkip && skipBitmap->getPixel(n, m))) {
- patternBitmap = patternDict->getBitmap(grayImg[i]);
- bitmap->combine(patternBitmap, xx >> 8, yy >> 8, combOp);
- }
- xx += stepX;
- yy -= stepY;
- ++i;
- }
- }
-
- gfree(grayImg);
- if (skipBitmap) {
- delete skipBitmap;
- }
-
- // combine the region bitmap into the page bitmap
- if (imm) {
- if (pageH == 0xffffffff && y + h > curPageH) {
- pageBitmap->expand(y + h, pageDefPixel);
- }
- pageBitmap->combine(bitmap, x, y, extCombOp);
- delete bitmap;
-
- // store the region bitmap
- } else {
- segments->append(bitmap);
- }
-
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm,
- GBool /*lossless*/, Guint length) {
- JBIG2Bitmap *bitmap;
- Guint w, h, x, y, segInfoFlags, extCombOp;
- Guint flags, mmr, templ, tpgdOn;
- int atx[4], aty[4];
-
- // region segment info field
- if (!readULong(&w) || !readULong(&h) ||
- !readULong(&x) || !readULong(&y) ||
- !readUByte(&segInfoFlags)) {
- goto eofError;
- }
- extCombOp = segInfoFlags & 7;
-
- // rest of the generic region segment header
- if (!readUByte(&flags)) {
- goto eofError;
- }
- mmr = flags & 1;
- templ = (flags >> 1) & 3;
- tpgdOn = (flags >> 3) & 1;
-
- // AT flags
- if (!mmr) {
- if (templ == 0) {
- if (!readByte(&atx[0]) ||
- !readByte(&aty[0]) ||
- !readByte(&atx[1]) ||
- !readByte(&aty[1]) ||
- !readByte(&atx[2]) ||
- !readByte(&aty[2]) ||
- !readByte(&atx[3]) ||
- !readByte(&aty[3])) {
- goto eofError;
- }
- } else {
- if (!readByte(&atx[0]) ||
- !readByte(&aty[0])) {
- goto eofError;
- }
- }
- }
-
- // set up the arithmetic decoder
- if (!mmr) {
- resetGenericStats(templ, NULL);
- arithDecoder->start();
- }
-
- // read the bitmap
- bitmap = readGenericBitmap(mmr, w, h, templ, tpgdOn, gFalse,
- NULL, atx, aty, mmr ? length - 18 : 0);
-
- // combine the region bitmap into the page bitmap
- if (imm) {
- if (pageH == 0xffffffff && y + h > curPageH) {
- pageBitmap->expand(y + h, pageDefPixel);
- }
- pageBitmap->combine(bitmap, x, y, extCombOp);
- delete bitmap;
-
- // store the region bitmap
- } else {
- bitmap->setSegNum(segNum);
- segments->append(bitmap);
- }
-
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-inline void JBIG2Stream::mmrAddPixels(int a1, int blackPixels,
- int *codingLine, int *a0i, int w) {
- if (a1 > codingLine[*a0i]) {
- if (a1 > w) {
- error(getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1);
- a1 = w;
- }
- if ((*a0i & 1) ^ blackPixels) {
- ++*a0i;
- }
- codingLine[*a0i] = a1;
- }
-}
-
-inline void JBIG2Stream::mmrAddPixelsNeg(int a1, int blackPixels,
- int *codingLine, int *a0i, int w) {
- if (a1 > codingLine[*a0i]) {
- if (a1 > w) {
- error(getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1);
- a1 = w;
- }
- if ((*a0i & 1) ^ blackPixels) {
- ++*a0i;
- }
- codingLine[*a0i] = a1;
- } else if (a1 < codingLine[*a0i]) {
- if (a1 < 0) {
- error(getPos(), "Invalid JBIG2 MMR code");
- a1 = 0;
- }
- while (*a0i > 0 && a1 <= codingLine[*a0i - 1]) {
- --*a0i;
- }
- codingLine[*a0i] = a1;
- }
-}
-
-JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h,
- int templ, GBool tpgdOn,
- GBool useSkip, JBIG2Bitmap *skip,
- int *atx, int *aty,
- int mmrDataLength) {
- JBIG2Bitmap *bitmap;
- GBool ltp;
- Guint ltpCX, cx, cx0, cx1, cx2;
- JBIG2BitmapPtr cxPtr0, cxPtr1;
- JBIG2BitmapPtr atPtr0, atPtr1, atPtr2, atPtr3;
- int *refLine, *codingLine;
- int code1, code2, code3;
- int x, y, a0i, b1i, blackPixels, pix, i;
-
- bitmap = new JBIG2Bitmap(0, w, h);
- bitmap->clearToZero();
-
- //----- MMR decode
-
- if (mmr) {
-
- mmrDecoder->reset();
- if (w > INT_MAX - 2) {
- error(getPos(), "Bad width in JBIG2 generic bitmap");
- // force a call to gmalloc(-1), which will throw an exception
- w = -3;
- }
- // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w
- // ---> max codingLine size = w + 1
- // refLine has one extra guard entry at the end
- // ---> max refLine size = w + 2
- codingLine = (int *)gmallocn(w + 1, sizeof(int));
- refLine = (int *)gmallocn(w + 2, sizeof(int));
- codingLine[0] = w;
-
- for (y = 0; y < h; ++y) {
-
- // copy coding line to ref line
- for (i = 0; codingLine[i] < w; ++i) {
- refLine[i] = codingLine[i];
- }
- refLine[i++] = w;
- refLine[i] = w;
-
- // decode a line
- codingLine[0] = 0;
- a0i = 0;
- b1i = 0;
- blackPixels = 0;
- // invariant:
- // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1] <= w
- // exception at left edge:
- // codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
- // exception at right edge:
- // refLine[b1i] = refLine[b1i+1] = w is possible
- while (codingLine[a0i] < w) {
- code1 = mmrDecoder->get2DCode();
- switch (code1) {
- case twoDimPass:
- mmrAddPixels(refLine[b1i + 1], blackPixels, codingLine, &a0i, w);
- if (refLine[b1i + 1] < w) {
- b1i += 2;
- }
- break;
- case twoDimHoriz:
- code1 = code2 = 0;
- if (blackPixels) {
- do {
- code1 += code3 = mmrDecoder->getBlackCode();
- } while (code3 >= 64);
- do {
- code2 += code3 = mmrDecoder->getWhiteCode();
- } while (code3 >= 64);
- } else {
- do {
- code1 += code3 = mmrDecoder->getWhiteCode();
- } while (code3 >= 64);
- do {
- code2 += code3 = mmrDecoder->getBlackCode();
- } while (code3 >= 64);
- }
- mmrAddPixels(codingLine[a0i] + code1, blackPixels,
- codingLine, &a0i, w);
- if (codingLine[a0i] < w) {
- mmrAddPixels(codingLine[a0i] + code2, blackPixels ^ 1,
- codingLine, &a0i, w);
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- break;
- case twoDimVertR3:
- mmrAddPixels(refLine[b1i] + 3, blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertR2:
- mmrAddPixels(refLine[b1i] + 2, blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertR1:
- mmrAddPixels(refLine[b1i] + 1, blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case twoDimVert0:
- mmrAddPixels(refLine[b1i], blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertL3:
- mmrAddPixelsNeg(refLine[b1i] - 3, blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- if (b1i > 0) {
- --b1i;
- } else {
- ++b1i;
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertL2:
- mmrAddPixelsNeg(refLine[b1i] - 2, blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- if (b1i > 0) {
- --b1i;
- } else {
- ++b1i;
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertL1:
- mmrAddPixelsNeg(refLine[b1i] - 1, blackPixels, codingLine, &a0i, w);
- blackPixels ^= 1;
- if (codingLine[a0i] < w) {
- if (b1i > 0) {
- --b1i;
- } else {
- ++b1i;
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
- b1i += 2;
- }
- }
- break;
- case EOF:
- mmrAddPixels(w, 0, codingLine, &a0i, w);
- break;
- default:
- error(getPos(), "Illegal code in JBIG2 MMR bitmap data");
- mmrAddPixels(w, 0, codingLine, &a0i, w);
- break;
- }
- }
-
- // convert the run lengths to a bitmap line
- i = 0;
- while (1) {
- for (x = codingLine[i]; x < codingLine[i+1]; ++x) {
- bitmap->setPixel(x, y);
- }
- if (codingLine[i+1] >= w || codingLine[i+2] >= w) {
- break;
- }
- i += 2;
- }
- }
-
- if (mmrDataLength >= 0) {
- mmrDecoder->skipTo(mmrDataLength);
- } else {
- if (mmrDecoder->get24Bits() != 0x001001) {
- error(getPos(), "Missing EOFB in JBIG2 MMR bitmap data");
- }
- }
-
- gfree(refLine);
- gfree(codingLine);
-
- //----- arithmetic decode
-
- } else {
- // set up the typical row context
- ltpCX = 0; // make gcc happy
- if (tpgdOn) {
- switch (templ) {
- case 0:
- ltpCX = 0x3953; // 001 11001 0101 0011
- break;
- case 1:
- ltpCX = 0x079a; // 0011 11001 101 0
- break;
- case 2:
- ltpCX = 0x0e3; // 001 1100 01 1
- break;
- case 3:
- ltpCX = 0x18a; // 01100 0101 1
- break;
- }
- }
-
- ltp = 0;
- cx = cx0 = cx1 = cx2 = 0; // make gcc happy
- for (y = 0; y < h; ++y) {
-
- // check for a "typical" (duplicate) row
- if (tpgdOn) {
- if (arithDecoder->decodeBit(ltpCX, genericRegionStats)) {
- ltp = !ltp;
- }
- if (ltp) {
- if (y > 0) {
- bitmap->duplicateRow(y, y-1);
- }
- continue;
- }
- }
-
- switch (templ) {
- case 0:
-
- // set up the context
- bitmap->getPixelPtr(0, y-2, &cxPtr0);
- cx0 = bitmap->nextPixel(&cxPtr0);
- cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
- bitmap->getPixelPtr(0, y-1, &cxPtr1);
- cx1 = bitmap->nextPixel(&cxPtr1);
- cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
- cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
- cx2 = 0;
- bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
- bitmap->getPixelPtr(atx[1], y + aty[1], &atPtr1);
- bitmap->getPixelPtr(atx[2], y + aty[2], &atPtr2);
- bitmap->getPixelPtr(atx[3], y + aty[3], &atPtr3);
-
- // decode the row
- for (x = 0; x < w; ++x) {
-
- // build the context
- cx = (cx0 << 13) | (cx1 << 8) | (cx2 << 4) |
- (bitmap->nextPixel(&atPtr0) << 3) |
- (bitmap->nextPixel(&atPtr1) << 2) |
- (bitmap->nextPixel(&atPtr2) << 1) |
- bitmap->nextPixel(&atPtr3);
-
- // check for a skipped pixel
- if (useSkip && skip->getPixel(x, y)) {
- pix = 0;
-
- // decode the pixel
- } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
- bitmap->setPixel(x, y);
- }
-
- // update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x07;
- cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
- cx2 = ((cx2 << 1) | pix) & 0x0f;
- }
- break;
-
- case 1:
-
- // set up the context
- bitmap->getPixelPtr(0, y-2, &cxPtr0);
- cx0 = bitmap->nextPixel(&cxPtr0);
- cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
- cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
- bitmap->getPixelPtr(0, y-1, &cxPtr1);
- cx1 = bitmap->nextPixel(&cxPtr1);
- cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
- cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
- cx2 = 0;
- bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
-
- // decode the row
- for (x = 0; x < w; ++x) {
-
- // build the context
- cx = (cx0 << 9) | (cx1 << 4) | (cx2 << 1) |
- bitmap->nextPixel(&atPtr0);
-
- // check for a skipped pixel
- if (useSkip && skip->getPixel(x, y)) {
- pix = 0;
-
- // decode the pixel
- } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
- bitmap->setPixel(x, y);
- }
-
- // update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x0f;
- cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
- cx2 = ((cx2 << 1) | pix) & 0x07;
- }
- break;
-
- case 2:
-
- // set up the context
- bitmap->getPixelPtr(0, y-2, &cxPtr0);
- cx0 = bitmap->nextPixel(&cxPtr0);
- cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
- bitmap->getPixelPtr(0, y-1, &cxPtr1);
- cx1 = bitmap->nextPixel(&cxPtr1);
- cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
- cx2 = 0;
- bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
-
- // decode the row
- for (x = 0; x < w; ++x) {
-
- // build the context
- cx = (cx0 << 7) | (cx1 << 3) | (cx2 << 1) |
- bitmap->nextPixel(&atPtr0);
-
- // check for a skipped pixel
- if (useSkip && skip->getPixel(x, y)) {
- pix = 0;
-
- // decode the pixel
- } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
- bitmap->setPixel(x, y);
- }
-
- // update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x07;
- cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x0f;
- cx2 = ((cx2 << 1) | pix) & 0x03;
- }
- break;
-
- case 3:
-
- // set up the context
- bitmap->getPixelPtr(0, y-1, &cxPtr1);
- cx1 = bitmap->nextPixel(&cxPtr1);
- cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
- cx2 = 0;
- bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
-
- // decode the row
- for (x = 0; x < w; ++x) {
-
- // build the context
- cx = (cx1 << 5) | (cx2 << 1) |
- bitmap->nextPixel(&atPtr0);
-
- // check for a skipped pixel
- if (useSkip && skip->getPixel(x, y)) {
- pix = 0;
-
- // decode the pixel
- } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
- bitmap->setPixel(x, y);
- }
-
- // update the context
- cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
- cx2 = ((cx2 << 1) | pix) & 0x0f;
- }
- break;
- }
- }
- }
-
- return bitmap;
-}
-
-void JBIG2Stream::readGenericRefinementRegionSeg(Guint segNum, GBool imm,
- GBool /*lossless*/, Guint /*length*/,
- Guint *refSegs,
- Guint nRefSegs) {
- JBIG2Bitmap *bitmap, *refBitmap;
- Guint w, h, x, y, segInfoFlags, extCombOp;
- Guint flags, templ, tpgrOn;
- int atx[2], aty[2];
- JBIG2Segment *seg;
-
- // region segment info field
- if (!readULong(&w) || !readULong(&h) ||
- !readULong(&x) || !readULong(&y) ||
- !readUByte(&segInfoFlags)) {
- goto eofError;
- }
- extCombOp = segInfoFlags & 7;
-
- // rest of the generic refinement region segment header
- if (!readUByte(&flags)) {
- goto eofError;
- }
- templ = flags & 1;
- tpgrOn = (flags >> 1) & 1;
-
- // AT flags
- if (!templ) {
- if (!readByte(&atx[0]) || !readByte(&aty[0]) ||
- !readByte(&atx[1]) || !readByte(&aty[1])) {
- goto eofError;
- }
- }
-
- // resize the page bitmap if needed
- if (nRefSegs == 0 || imm) {
- if (pageH == 0xffffffff && y + h > curPageH) {
- pageBitmap->expand(y + h, pageDefPixel);
- }
- }
-
- // get referenced bitmap
- if (nRefSegs > 1) {
- error(getPos(), "Bad reference in JBIG2 generic refinement segment");
- return;
- }
- if (nRefSegs == 1) {
- if (!(seg = findSegment(refSegs[0])) ||
- seg->getType() != jbig2SegBitmap) {
- error(getPos(), "Bad bitmap reference in JBIG2 generic refinement segment");
- return;
- }
- refBitmap = (JBIG2Bitmap *)seg;
- } else {
- refBitmap = pageBitmap->getSlice(x, y, w, h);
- }
-
- // set up the arithmetic decoder
- resetRefinementStats(templ, NULL);
- arithDecoder->start();
-
- // read
- bitmap = readGenericRefinementRegion(w, h, templ, tpgrOn,
- refBitmap, 0, 0, atx, aty);
-
- // combine the region bitmap into the page bitmap
- if (imm) {
- pageBitmap->combine(bitmap, x, y, extCombOp);
- delete bitmap;
-
- // store the region bitmap
- } else {
- bitmap->setSegNum(segNum);
- segments->append(bitmap);
- }
-
- // delete the referenced bitmap
- if (nRefSegs == 1) {
- discardSegment(refSegs[0]);
- } else {
- delete refBitmap;
- }
-
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-JBIG2Bitmap *JBIG2Stream::readGenericRefinementRegion(int w, int h,
- int templ, GBool tpgrOn,
- JBIG2Bitmap *refBitmap,
- int refDX, int refDY,
- int *atx, int *aty) {
- JBIG2Bitmap *bitmap;
- GBool ltp;
- Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2;
- JBIG2BitmapPtr cxPtr0, cxPtr1, cxPtr2, cxPtr3, cxPtr4, cxPtr5, cxPtr6;
- JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2;
- int x, y, pix;
-
- bitmap = new JBIG2Bitmap(0, w, h);
- bitmap->clearToZero();
-
- // set up the typical row context
- if (templ) {
- ltpCX = 0x008;
- } else {
- ltpCX = 0x0010;
- }
-
- ltp = 0;
- for (y = 0; y < h; ++y) {
-
- if (templ) {
-
- // set up the context
- bitmap->getPixelPtr(0, y-1, &cxPtr0);
- cx0 = bitmap->nextPixel(&cxPtr0);
- bitmap->getPixelPtr(-1, y, &cxPtr1);
- refBitmap->getPixelPtr(-refDX, y-1-refDY, &cxPtr2);
- refBitmap->getPixelPtr(-1-refDX, y-refDY, &cxPtr3);
- cx3 = refBitmap->nextPixel(&cxPtr3);
- cx3 = (cx3 << 1) | refBitmap->nextPixel(&cxPtr3);
- refBitmap->getPixelPtr(-refDX, y+1-refDY, &cxPtr4);
- cx4 = refBitmap->nextPixel(&cxPtr4);
-
- // set up the typical prediction context
- tpgrCX0 = tpgrCX1 = tpgrCX2 = 0; // make gcc happy
- if (tpgrOn) {
- refBitmap->getPixelPtr(-1-refDX, y-1-refDY, &tpgrCXPtr0);
- tpgrCX0 = refBitmap->nextPixel(&tpgrCXPtr0);
- tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
- tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
- refBitmap->getPixelPtr(-1-refDX, y-refDY, &tpgrCXPtr1);
- tpgrCX1 = refBitmap->nextPixel(&tpgrCXPtr1);
- tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
- tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
- refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &tpgrCXPtr2);
- tpgrCX2 = refBitmap->nextPixel(&tpgrCXPtr2);
- tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
- tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
- } else {
- tpgrCXPtr0.p = tpgrCXPtr1.p = tpgrCXPtr2.p = NULL; // make gcc happy
- tpgrCXPtr0.shift = tpgrCXPtr1.shift = tpgrCXPtr2.shift = 0;
- tpgrCXPtr0.x = tpgrCXPtr1.x = tpgrCXPtr2.x = 0;
- }
-
- for (x = 0; x < w; ++x) {
-
- // update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 7;
- cx3 = ((cx3 << 1) | refBitmap->nextPixel(&cxPtr3)) & 7;
- cx4 = ((cx4 << 1) | refBitmap->nextPixel(&cxPtr4)) & 3;
-
- if (tpgrOn) {
- // update the typical predictor context
- tpgrCX0 = ((tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0)) & 7;
- tpgrCX1 = ((tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1)) & 7;
- tpgrCX2 = ((tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2)) & 7;
-
- // check for a "typical" pixel
- if (arithDecoder->decodeBit(ltpCX, refinementRegionStats)) {
- ltp = !ltp;
- }
- if (tpgrCX0 == 0 && tpgrCX1 == 0 && tpgrCX2 == 0) {
- bitmap->clearPixel(x, y);
- continue;
- } else if (tpgrCX0 == 7 && tpgrCX1 == 7 && tpgrCX2 == 7) {
- bitmap->setPixel(x, y);
- continue;
- }
- }
-
- // build the context
- cx = (cx0 << 7) | (bitmap->nextPixel(&cxPtr1) << 6) |
- (refBitmap->nextPixel(&cxPtr2) << 5) |
- (cx3 << 2) | cx4;
-
- // decode the pixel
- if ((pix = arithDecoder->decodeBit(cx, refinementRegionStats))) {
- bitmap->setPixel(x, y);
- }
- }
-
- } else {
-
- // set up the context
- bitmap->getPixelPtr(0, y-1, &cxPtr0);
- cx0 = bitmap->nextPixel(&cxPtr0);
- bitmap->getPixelPtr(-1, y, &cxPtr1);
- refBitmap->getPixelPtr(-refDX, y-1-refDY, &cxPtr2);
- cx2 = refBitmap->nextPixel(&cxPtr2);
- refBitmap->getPixelPtr(-1-refDX, y-refDY, &cxPtr3);
- cx3 = refBitmap->nextPixel(&cxPtr3);
- cx3 = (cx3 << 1) | refBitmap->nextPixel(&cxPtr3);
- refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &cxPtr4);
- cx4 = refBitmap->nextPixel(&cxPtr4);
- cx4 = (cx4 << 1) | refBitmap->nextPixel(&cxPtr4);
- bitmap->getPixelPtr(atx[0], y+aty[0], &cxPtr5);
- refBitmap->getPixelPtr(atx[1]-refDX, y+aty[1]-refDY, &cxPtr6);
-
- // set up the typical prediction context
- tpgrCX0 = tpgrCX1 = tpgrCX2 = 0; // make gcc happy
- if (tpgrOn) {
- refBitmap->getPixelPtr(-1-refDX, y-1-refDY, &tpgrCXPtr0);
- tpgrCX0 = refBitmap->nextPixel(&tpgrCXPtr0);
- tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
- tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
- refBitmap->getPixelPtr(-1-refDX, y-refDY, &tpgrCXPtr1);
- tpgrCX1 = refBitmap->nextPixel(&tpgrCXPtr1);
- tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
- tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
- refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &tpgrCXPtr2);
- tpgrCX2 = refBitmap->nextPixel(&tpgrCXPtr2);
- tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
- tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
- } else {
- tpgrCXPtr0.p = tpgrCXPtr1.p = tpgrCXPtr2.p = NULL; // make gcc happy
- tpgrCXPtr0.shift = tpgrCXPtr1.shift = tpgrCXPtr2.shift = 0;
- tpgrCXPtr0.x = tpgrCXPtr1.x = tpgrCXPtr2.x = 0;
- }
-
- for (x = 0; x < w; ++x) {
-
- // update the context
- cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 3;
- cx2 = ((cx2 << 1) | refBitmap->nextPixel(&cxPtr2)) & 3;
- cx3 = ((cx3 << 1) | refBitmap->nextPixel(&cxPtr3)) & 7;
- cx4 = ((cx4 << 1) | refBitmap->nextPixel(&cxPtr4)) & 7;
-
- if (tpgrOn) {
- // update the typical predictor context
- tpgrCX0 = ((tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0)) & 7;
- tpgrCX1 = ((tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1)) & 7;
- tpgrCX2 = ((tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2)) & 7;
-
- // check for a "typical" pixel
- if (arithDecoder->decodeBit(ltpCX, refinementRegionStats)) {
- ltp = !ltp;
- }
- if (tpgrCX0 == 0 && tpgrCX1 == 0 && tpgrCX2 == 0) {
- bitmap->clearPixel(x, y);
- continue;
- } else if (tpgrCX0 == 7 && tpgrCX1 == 7 && tpgrCX2 == 7) {
- bitmap->setPixel(x, y);
- continue;
- }
- }
-
- // build the context
- cx = (cx0 << 11) | (bitmap->nextPixel(&cxPtr1) << 10) |
- (cx2 << 8) | (cx3 << 5) | (cx4 << 2) |
- (bitmap->nextPixel(&cxPtr5) << 1) |
- refBitmap->nextPixel(&cxPtr6);
-
- // decode the pixel
- if ((pix = arithDecoder->decodeBit(cx, refinementRegionStats))) {
- bitmap->setPixel(x, y);
- }
- }
- }
- }
-
- return bitmap;
-}
-
-void JBIG2Stream::readPageInfoSeg(Guint /*length*/) {
- Guint xRes, yRes, flags, striping;
-
- if (!readULong(&pageW) || !readULong(&pageH) ||
- !readULong(&xRes) || !readULong(&yRes) ||
- !readUByte(&flags) || !readUWord(&striping)) {
- goto eofError;
- }
- pageDefPixel = (flags >> 2) & 1;
- defCombOp = (flags >> 3) & 3;
-
- // allocate the page bitmap
- if (pageH == 0xffffffff) {
- curPageH = striping & 0x7fff;
- } else {
- curPageH = pageH;
- }
- pageBitmap = new JBIG2Bitmap(0, pageW, curPageH);
-
- // default pixel value
- if (pageDefPixel) {
- pageBitmap->clearToOne();
- } else {
- pageBitmap->clearToZero();
- }
-
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-void JBIG2Stream::readEndOfStripeSeg(Guint length) {
- Guint i;
-
- // skip the segment
- for (i = 0; i < length; ++i) {
- curStr->getChar();
- }
-}
-
-void JBIG2Stream::readProfilesSeg(Guint length) {
- Guint i;
-
- // skip the segment
- for (i = 0; i < length; ++i) {
- curStr->getChar();
- }
-}
-
-void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint /*length*/) {
- JBIG2HuffmanTable *huffTab;
- Guint flags, oob, prefixBits, rangeBits;
- int lowVal, highVal, val;
- Guint huffTabSize, i;
-
- if (!readUByte(&flags) || !readLong(&lowVal) || !readLong(&highVal)) {
- goto eofError;
- }
- oob = flags & 1;
- prefixBits = ((flags >> 1) & 7) + 1;
- rangeBits = ((flags >> 4) & 7) + 1;
-
- huffDecoder->reset();
- huffTabSize = 8;
- huffTab = (JBIG2HuffmanTable *)
- gmallocn(huffTabSize, sizeof(JBIG2HuffmanTable));
- i = 0;
- val = lowVal;
- while (val < highVal) {
- if (i == huffTabSize) {
- huffTabSize *= 2;
- huffTab = (JBIG2HuffmanTable *)
- greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable));
- }
- huffTab[i].val = val;
- huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
- huffTab[i].rangeLen = huffDecoder->readBits(rangeBits);
- val += 1 << huffTab[i].rangeLen;
- ++i;
- }
- if (i + oob + 3 > huffTabSize) {
- huffTabSize = i + oob + 3;
- huffTab = (JBIG2HuffmanTable *)
- greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable));
- }
- huffTab[i].val = lowVal - 1;
- huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
- huffTab[i].rangeLen = jbig2HuffmanLOW;
- ++i;
- huffTab[i].val = highVal;
- huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
- huffTab[i].rangeLen = 32;
- ++i;
- if (oob) {
- huffTab[i].val = 0;
- huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
- huffTab[i].rangeLen = jbig2HuffmanOOB;
- ++i;
- }
- huffTab[i].val = 0;
- huffTab[i].prefixLen = 0;
- huffTab[i].rangeLen = jbig2HuffmanEOT;
- huffDecoder->buildTable(huffTab, i);
-
- // create and store the new table segment
- segments->append(new JBIG2CodeTable(segNum, huffTab));
-
- return;
-
- eofError:
- error(getPos(), "Unexpected EOF in JBIG2 stream");
-}
-
-void JBIG2Stream::readExtensionSeg(Guint length) {
- Guint i;
-
- // skip the segment
- for (i = 0; i < length; ++i) {
- curStr->getChar();
- }
-}
-
-JBIG2Segment *JBIG2Stream::findSegment(Guint segNum) {
- JBIG2Segment *seg;
- int i;
-
- for (i = 0; i < globalSegments->getLength(); ++i) {
- seg = (JBIG2Segment *)globalSegments->get(i);
- if (seg->getSegNum() == segNum) {
- return seg;
- }
- }
- for (i = 0; i < segments->getLength(); ++i) {
- seg = (JBIG2Segment *)segments->get(i);
- if (seg->getSegNum() == segNum) {
- return seg;
- }
- }
- return NULL;
-}
-
-void JBIG2Stream::discardSegment(Guint segNum) {
- JBIG2Segment *seg;
- int i;
-
- for (i = 0; i < globalSegments->getLength(); ++i) {
- seg = (JBIG2Segment *)globalSegments->get(i);
- if (seg->getSegNum() == segNum) {
- globalSegments->del(i);
- return;
- }
- }
- for (i = 0; i < segments->getLength(); ++i) {
- seg = (JBIG2Segment *)segments->get(i);
- if (seg->getSegNum() == segNum) {
- segments->del(i);
- return;
- }
- }
-}
-
-void JBIG2Stream::resetGenericStats(Guint templ,
- JArithmeticDecoderStats *prevStats) {
- int size;
-
- size = contextSize[templ];
- if (prevStats && prevStats->getContextSize() == size) {
- if (genericRegionStats->getContextSize() == size) {
- genericRegionStats->copyFrom(prevStats);
- } else {
- delete genericRegionStats;
- genericRegionStats = prevStats->copy();
- }
- } else {
- if (genericRegionStats->getContextSize() == size) {
- genericRegionStats->reset();
- } else {
- delete genericRegionStats;
- genericRegionStats = new JArithmeticDecoderStats(1 << size);
- }
- }
-}
-
-void JBIG2Stream::resetRefinementStats(Guint templ,
- JArithmeticDecoderStats *prevStats) {
- int size;
-
- size = refContextSize[templ];
- if (prevStats && prevStats->getContextSize() == size) {
- if (refinementRegionStats->getContextSize() == size) {
- refinementRegionStats->copyFrom(prevStats);
- } else {
- delete refinementRegionStats;
- refinementRegionStats = prevStats->copy();
- }
- } else {
- if (refinementRegionStats->getContextSize() == size) {
- refinementRegionStats->reset();
- } else {
- delete refinementRegionStats;
- refinementRegionStats = new JArithmeticDecoderStats(1 << size);
- }
- }
-}
-
-void JBIG2Stream::resetIntStats(int symCodeLen) {
- iadhStats->reset();
- iadwStats->reset();
- iaexStats->reset();
- iaaiStats->reset();
- iadtStats->reset();
- iaitStats->reset();
- iafsStats->reset();
- iadsStats->reset();
- iardxStats->reset();
- iardyStats->reset();
- iardwStats->reset();
- iardhStats->reset();
- iariStats->reset();
- if (iaidStats->getContextSize() == 1 << (symCodeLen + 1)) {
- iaidStats->reset();
- } else {
- delete iaidStats;
- iaidStats = new JArithmeticDecoderStats(1 << (symCodeLen + 1));
- }
-}
-
-GBool JBIG2Stream::readUByte(Guint *x) {
- int c0;
-
- if ((c0 = curStr->getChar()) == EOF) {
- return gFalse;
- }
- *x = (Guint)c0;
- return gTrue;
-}
-
-GBool JBIG2Stream::readByte(int *x) {
- int c0;
-
- if ((c0 = curStr->getChar()) == EOF) {
- return gFalse;
- }
- *x = c0;
- if (c0 & 0x80) {
- *x |= -1 - 0xff;
- }
- return gTrue;
-}
-
-GBool JBIG2Stream::readUWord(Guint *x) {
- int c0, c1;
-
- if ((c0 = curStr->getChar()) == EOF ||
- (c1 = curStr->getChar()) == EOF) {
- return gFalse;
- }
- *x = (Guint)((c0 << 8) | c1);
- return gTrue;
-}
-
-GBool JBIG2Stream::readULong(Guint *x) {
- int c0, c1, c2, c3;
-
- if ((c0 = curStr->getChar()) == EOF ||
- (c1 = curStr->getChar()) == EOF ||
- (c2 = curStr->getChar()) == EOF ||
- (c3 = curStr->getChar()) == EOF) {
- return gFalse;
- }
- *x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
- return gTrue;
-}
-
-GBool JBIG2Stream::readLong(int *x) {
- int c0, c1, c2, c3;
-
- if ((c0 = curStr->getChar()) == EOF ||
- (c1 = curStr->getChar()) == EOF ||
- (c2 = curStr->getChar()) == EOF ||
- (c3 = curStr->getChar()) == EOF) {
- return gFalse;
- }
- *x = ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
- if (c0 & 0x80) {
- *x |= -1 - (int)0xffffffff;
- }
- return gTrue;
-}
diff --git a/kpdf/xpdf/xpdf/JBIG2Stream.cpp b/kpdf/xpdf/xpdf/JBIG2Stream.cpp
new file mode 100644
index 00000000..1a4058f8
--- /dev/null
+++ b/kpdf/xpdf/xpdf/JBIG2Stream.cpp
@@ -0,0 +1,3648 @@
+//========================================================================
+//
+// JBIG2Stream.cpp
+//
+// Copyright 2002-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <limits.h>
+#include "GList.h"
+#include "Error.h"
+#include "JArithmeticDecoder.h"
+#include "JBIG2Stream.h"
+
+//~ share these tables
+#include "Stream-CCITT.h"
+
+//------------------------------------------------------------------------
+
+static int contextSize[4] = { 16, 13, 10, 10 };
+static int refContextSize[2] = { 13, 10 };
+
+//------------------------------------------------------------------------
+// JBIG2HuffmanTable
+//------------------------------------------------------------------------
+
+#define jbig2HuffmanLOW 0xfffffffd
+#define jbig2HuffmanOOB 0xfffffffe
+#define jbig2HuffmanEOT 0xffffffff
+
+struct JBIG2HuffmanTable {
+ int val;
+ Guint prefixLen;
+ Guint rangeLen; // can also be LOW, OOB, or EOT
+ Guint prefix;
+};
+
+JBIG2HuffmanTable huffTableA[] = {
+ { 0, 1, 4, 0x000 },
+ { 16, 2, 8, 0x002 },
+ { 272, 3, 16, 0x006 },
+ { 65808, 3, 32, 0x007 },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableB[] = {
+ { 0, 1, 0, 0x000 },
+ { 1, 2, 0, 0x002 },
+ { 2, 3, 0, 0x006 },
+ { 3, 4, 3, 0x00e },
+ { 11, 5, 6, 0x01e },
+ { 75, 6, 32, 0x03e },
+ { 0, 6, jbig2HuffmanOOB, 0x03f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableC[] = {
+ { 0, 1, 0, 0x000 },
+ { 1, 2, 0, 0x002 },
+ { 2, 3, 0, 0x006 },
+ { 3, 4, 3, 0x00e },
+ { 11, 5, 6, 0x01e },
+ { 0, 6, jbig2HuffmanOOB, 0x03e },
+ { 75, 7, 32, 0x0fe },
+ { -256, 8, 8, 0x0fe },
+ { -257, 8, jbig2HuffmanLOW, 0x0ff },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableD[] = {
+ { 1, 1, 0, 0x000 },
+ { 2, 2, 0, 0x002 },
+ { 3, 3, 0, 0x006 },
+ { 4, 4, 3, 0x00e },
+ { 12, 5, 6, 0x01e },
+ { 76, 5, 32, 0x01f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableE[] = {
+ { 1, 1, 0, 0x000 },
+ { 2, 2, 0, 0x002 },
+ { 3, 3, 0, 0x006 },
+ { 4, 4, 3, 0x00e },
+ { 12, 5, 6, 0x01e },
+ { 76, 6, 32, 0x03e },
+ { -255, 7, 8, 0x07e },
+ { -256, 7, jbig2HuffmanLOW, 0x07f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableF[] = {
+ { 0, 2, 7, 0x000 },
+ { 128, 3, 7, 0x002 },
+ { 256, 3, 8, 0x003 },
+ { -1024, 4, 9, 0x008 },
+ { -512, 4, 8, 0x009 },
+ { -256, 4, 7, 0x00a },
+ { -32, 4, 5, 0x00b },
+ { 512, 4, 9, 0x00c },
+ { 1024, 4, 10, 0x00d },
+ { -2048, 5, 10, 0x01c },
+ { -128, 5, 6, 0x01d },
+ { -64, 5, 5, 0x01e },
+ { -2049, 6, jbig2HuffmanLOW, 0x03e },
+ { 2048, 6, 32, 0x03f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableG[] = {
+ { -512, 3, 8, 0x000 },
+ { 256, 3, 8, 0x001 },
+ { 512, 3, 9, 0x002 },
+ { 1024, 3, 10, 0x003 },
+ { -1024, 4, 9, 0x008 },
+ { -256, 4, 7, 0x009 },
+ { -32, 4, 5, 0x00a },
+ { 0, 4, 5, 0x00b },
+ { 128, 4, 7, 0x00c },
+ { -128, 5, 6, 0x01a },
+ { -64, 5, 5, 0x01b },
+ { 32, 5, 5, 0x01c },
+ { 64, 5, 6, 0x01d },
+ { -1025, 5, jbig2HuffmanLOW, 0x01e },
+ { 2048, 5, 32, 0x01f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableH[] = {
+ { 0, 2, 1, 0x000 },
+ { 0, 2, jbig2HuffmanOOB, 0x001 },
+ { 4, 3, 4, 0x004 },
+ { -1, 4, 0, 0x00a },
+ { 22, 4, 4, 0x00b },
+ { 38, 4, 5, 0x00c },
+ { 2, 5, 0, 0x01a },
+ { 70, 5, 6, 0x01b },
+ { 134, 5, 7, 0x01c },
+ { 3, 6, 0, 0x03a },
+ { 20, 6, 1, 0x03b },
+ { 262, 6, 7, 0x03c },
+ { 646, 6, 10, 0x03d },
+ { -2, 7, 0, 0x07c },
+ { 390, 7, 8, 0x07d },
+ { -15, 8, 3, 0x0fc },
+ { -5, 8, 1, 0x0fd },
+ { -7, 9, 1, 0x1fc },
+ { -3, 9, 0, 0x1fd },
+ { -16, 9, jbig2HuffmanLOW, 0x1fe },
+ { 1670, 9, 32, 0x1ff },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableI[] = {
+ { 0, 2, jbig2HuffmanOOB, 0x000 },
+ { -1, 3, 1, 0x002 },
+ { 1, 3, 1, 0x003 },
+ { 7, 3, 5, 0x004 },
+ { -3, 4, 1, 0x00a },
+ { 43, 4, 5, 0x00b },
+ { 75, 4, 6, 0x00c },
+ { 3, 5, 1, 0x01a },
+ { 139, 5, 7, 0x01b },
+ { 267, 5, 8, 0x01c },
+ { 5, 6, 1, 0x03a },
+ { 39, 6, 2, 0x03b },
+ { 523, 6, 8, 0x03c },
+ { 1291, 6, 11, 0x03d },
+ { -5, 7, 1, 0x07c },
+ { 779, 7, 9, 0x07d },
+ { -31, 8, 4, 0x0fc },
+ { -11, 8, 2, 0x0fd },
+ { -15, 9, 2, 0x1fc },
+ { -7, 9, 1, 0x1fd },
+ { -32, 9, jbig2HuffmanLOW, 0x1fe },
+ { 3339, 9, 32, 0x1ff },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableJ[] = {
+ { -2, 2, 2, 0x000 },
+ { 6, 2, 6, 0x001 },
+ { 0, 2, jbig2HuffmanOOB, 0x002 },
+ { -3, 5, 0, 0x018 },
+ { 2, 5, 0, 0x019 },
+ { 70, 5, 5, 0x01a },
+ { 3, 6, 0, 0x036 },
+ { 102, 6, 5, 0x037 },
+ { 134, 6, 6, 0x038 },
+ { 198, 6, 7, 0x039 },
+ { 326, 6, 8, 0x03a },
+ { 582, 6, 9, 0x03b },
+ { 1094, 6, 10, 0x03c },
+ { -21, 7, 4, 0x07a },
+ { -4, 7, 0, 0x07b },
+ { 4, 7, 0, 0x07c },
+ { 2118, 7, 11, 0x07d },
+ { -5, 8, 0, 0x0fc },
+ { 5, 8, 0, 0x0fd },
+ { -22, 8, jbig2HuffmanLOW, 0x0fe },
+ { 4166, 8, 32, 0x0ff },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableK[] = {
+ { 1, 1, 0, 0x000 },
+ { 2, 2, 1, 0x002 },
+ { 4, 4, 0, 0x00c },
+ { 5, 4, 1, 0x00d },
+ { 7, 5, 1, 0x01c },
+ { 9, 5, 2, 0x01d },
+ { 13, 6, 2, 0x03c },
+ { 17, 7, 2, 0x07a },
+ { 21, 7, 3, 0x07b },
+ { 29, 7, 4, 0x07c },
+ { 45, 7, 5, 0x07d },
+ { 77, 7, 6, 0x07e },
+ { 141, 7, 32, 0x07f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableL[] = {
+ { 1, 1, 0, 0x000 },
+ { 2, 2, 0, 0x002 },
+ { 3, 3, 1, 0x006 },
+ { 5, 5, 0, 0x01c },
+ { 6, 5, 1, 0x01d },
+ { 8, 6, 1, 0x03c },
+ { 10, 7, 0, 0x07a },
+ { 11, 7, 1, 0x07b },
+ { 13, 7, 2, 0x07c },
+ { 17, 7, 3, 0x07d },
+ { 25, 7, 4, 0x07e },
+ { 41, 8, 5, 0x0fe },
+ { 73, 8, 32, 0x0ff },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableM[] = {
+ { 1, 1, 0, 0x000 },
+ { 2, 3, 0, 0x004 },
+ { 7, 3, 3, 0x005 },
+ { 3, 4, 0, 0x00c },
+ { 5, 4, 1, 0x00d },
+ { 4, 5, 0, 0x01c },
+ { 15, 6, 1, 0x03a },
+ { 17, 6, 2, 0x03b },
+ { 21, 6, 3, 0x03c },
+ { 29, 6, 4, 0x03d },
+ { 45, 6, 5, 0x03e },
+ { 77, 7, 6, 0x07e },
+ { 141, 7, 32, 0x07f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableN[] = {
+ { 0, 1, 0, 0x000 },
+ { -2, 3, 0, 0x004 },
+ { -1, 3, 0, 0x005 },
+ { 1, 3, 0, 0x006 },
+ { 2, 3, 0, 0x007 },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+JBIG2HuffmanTable huffTableO[] = {
+ { 0, 1, 0, 0x000 },
+ { -1, 3, 0, 0x004 },
+ { 1, 3, 0, 0x005 },
+ { -2, 4, 0, 0x00c },
+ { 2, 4, 0, 0x00d },
+ { -4, 5, 1, 0x01c },
+ { 3, 5, 1, 0x01d },
+ { -8, 6, 2, 0x03c },
+ { 5, 6, 2, 0x03d },
+ { -24, 7, 4, 0x07c },
+ { 9, 7, 4, 0x07d },
+ { -25, 7, jbig2HuffmanLOW, 0x07e },
+ { 25, 7, 32, 0x07f },
+ { 0, 0, jbig2HuffmanEOT, 0 }
+};
+
+//------------------------------------------------------------------------
+// JBIG2HuffmanDecoder
+//------------------------------------------------------------------------
+
+class JBIG2HuffmanDecoder {
+public:
+
+ JBIG2HuffmanDecoder();
+ ~JBIG2HuffmanDecoder();
+ void setStream(Stream *strA) { str = strA; }
+
+ void reset();
+
+ // Returns false for OOB, otherwise sets *<x> and returns true.
+ GBool decodeInt(int *x, JBIG2HuffmanTable *table);
+
+ Guint readBits(Guint n);
+ Guint readBit();
+
+ // Sort the table by prefix length and assign prefix values.
+ void buildTable(JBIG2HuffmanTable *table, Guint len);
+
+private:
+
+ Stream *str;
+ Guint buf;
+ Guint bufLen;
+};
+
+JBIG2HuffmanDecoder::JBIG2HuffmanDecoder() {
+ str = NULL;
+ reset();
+}
+
+JBIG2HuffmanDecoder::~JBIG2HuffmanDecoder() {
+}
+
+void JBIG2HuffmanDecoder::reset() {
+ buf = 0;
+ bufLen = 0;
+}
+
+//~ optimize this
+GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) {
+ Guint i, len, prefix;
+
+ i = 0;
+ len = 0;
+ prefix = 0;
+ while (table[i].rangeLen != jbig2HuffmanEOT) {
+ while (len < table[i].prefixLen) {
+ prefix = (prefix << 1) | readBit();
+ ++len;
+ }
+ if (prefix == table[i].prefix) {
+ if (table[i].rangeLen == jbig2HuffmanOOB) {
+ return gFalse;
+ }
+ if (table[i].rangeLen == jbig2HuffmanLOW) {
+ *x = table[i].val - readBits(32);
+ } else if (table[i].rangeLen > 0) {
+ *x = table[i].val + readBits(table[i].rangeLen);
+ } else {
+ *x = table[i].val;
+ }
+ return gTrue;
+ }
+ ++i;
+ }
+ return gFalse;
+}
+
+Guint JBIG2HuffmanDecoder::readBits(Guint n) {
+ Guint x, mask, nLeft;
+
+ mask = (n == 32) ? 0xffffffff : ((1 << n) - 1);
+ if (bufLen >= n) {
+ x = (buf >> (bufLen - n)) & mask;
+ bufLen -= n;
+ } else {
+ x = buf & ((1 << bufLen) - 1);
+ nLeft = n - bufLen;
+ bufLen = 0;
+ while (nLeft >= 8) {
+ x = (x << 8) | (str->getChar() & 0xff);
+ nLeft -= 8;
+ }
+ if (nLeft > 0) {
+ buf = str->getChar();
+ bufLen = 8 - nLeft;
+ x = (x << nLeft) | ((buf >> bufLen) & ((1 << nLeft) - 1));
+ }
+ }
+ return x;
+}
+
+Guint JBIG2HuffmanDecoder::readBit() {
+ if (bufLen == 0) {
+ buf = str->getChar();
+ bufLen = 8;
+ }
+ --bufLen;
+ return (buf >> bufLen) & 1;
+}
+
+void JBIG2HuffmanDecoder::buildTable(JBIG2HuffmanTable *table, Guint len) {
+ Guint i, j, k, prefix;
+ JBIG2HuffmanTable tab;
+
+ // stable selection sort:
+ // - entries with prefixLen > 0, in ascending prefixLen order
+ // - entry with prefixLen = 0, rangeLen = EOT
+ // - all other entries with prefixLen = 0
+ // (on entry, table[len] has prefixLen = 0, rangeLen = EOT)
+ for (i = 0; i < len; ++i) {
+ for (j = i; j < len && table[j].prefixLen == 0; ++j) ;
+ if (j == len) {
+ break;
+ }
+ for (k = j + 1; k < len; ++k) {
+ if (table[k].prefixLen > 0 &&
+ table[k].prefixLen < table[j].prefixLen) {
+ j = k;
+ }
+ }
+ if (j != i) {
+ tab = table[j];
+ for (k = j; k > i; --k) {
+ table[k] = table[k - 1];
+ }
+ table[i] = tab;
+ }
+ }
+ table[i] = table[len];
+
+ // assign prefixes
+ if (table[0].rangeLen != jbig2HuffmanEOT) {
+ i = 0;
+ prefix = 0;
+ table[i++].prefix = prefix++;
+ for (; table[i].rangeLen != jbig2HuffmanEOT; ++i) {
+ prefix <<= table[i].prefixLen - table[i-1].prefixLen;
+ table[i].prefix = prefix++;
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// JBIG2MMRDecoder
+//------------------------------------------------------------------------
+
+class JBIG2MMRDecoder {
+public:
+
+ JBIG2MMRDecoder();
+ ~JBIG2MMRDecoder();
+ void setStream(Stream *strA) { str = strA; }
+ void reset();
+ int get2DCode();
+ int getBlackCode();
+ int getWhiteCode();
+ Guint get24Bits();
+ void skipTo(Guint length);
+
+private:
+
+ Stream *str;
+ Guint buf;
+ Guint bufLen;
+ Guint nBytesRead;
+};
+
+JBIG2MMRDecoder::JBIG2MMRDecoder() {
+ str = NULL;
+ reset();
+}
+
+JBIG2MMRDecoder::~JBIG2MMRDecoder() {
+}
+
+void JBIG2MMRDecoder::reset() {
+ buf = 0;
+ bufLen = 0;
+ nBytesRead = 0;
+}
+
+int JBIG2MMRDecoder::get2DCode() {
+ CCITTCode *p;
+
+ if (bufLen == 0) {
+ buf = str->getChar() & 0xff;
+ bufLen = 8;
+ ++nBytesRead;
+ p = &twoDimTab1[(buf >> 1) & 0x7f];
+ } else if (bufLen == 8) {
+ p = &twoDimTab1[(buf >> 1) & 0x7f];
+ } else {
+ p = &twoDimTab1[(buf << (7 - bufLen)) & 0x7f];
+ if (p->bits < 0 || p->bits > (int)bufLen) {
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bufLen += 8;
+ ++nBytesRead;
+ p = &twoDimTab1[(buf >> (bufLen - 7)) & 0x7f];
+ }
+ }
+ if (p->bits < 0) {
+ error(str->getPos(), "Bad two dim code in JBIG2 MMR stream");
+ return EOF;
+ }
+ bufLen -= p->bits;
+ return p->n;
+}
+
+int JBIG2MMRDecoder::getWhiteCode() {
+ CCITTCode *p;
+ Guint code;
+
+ if (bufLen == 0) {
+ buf = str->getChar() & 0xff;
+ bufLen = 8;
+ ++nBytesRead;
+ }
+ while (1) {
+ if (bufLen >= 11 && ((buf >> (bufLen - 7)) & 0x7f) == 0) {
+ if (bufLen <= 12) {
+ code = buf << (12 - bufLen);
+ } else {
+ code = buf >> (bufLen - 12);
+ }
+ p = &whiteTab1[code & 0x1f];
+ } else {
+ if (bufLen <= 9) {
+ code = buf << (9 - bufLen);
+ } else {
+ code = buf >> (bufLen - 9);
+ }
+ p = &whiteTab2[code & 0x1ff];
+ }
+ if (p->bits > 0 && p->bits <= (int)bufLen) {
+ bufLen -= p->bits;
+ return p->n;
+ }
+ if (bufLen >= 12) {
+ break;
+ }
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bufLen += 8;
+ ++nBytesRead;
+ }
+ error(str->getPos(), "Bad white code in JBIG2 MMR stream");
+ // eat a bit and return a positive number so that the caller doesn't
+ // go into an infinite loop
+ --bufLen;
+ return 1;
+}
+
+int JBIG2MMRDecoder::getBlackCode() {
+ CCITTCode *p;
+ Guint code;
+
+ if (bufLen == 0) {
+ buf = str->getChar() & 0xff;
+ bufLen = 8;
+ ++nBytesRead;
+ }
+ while (1) {
+ if (bufLen >= 10 && ((buf >> (bufLen - 6)) & 0x3f) == 0) {
+ if (bufLen <= 13) {
+ code = buf << (13 - bufLen);
+ } else {
+ code = buf >> (bufLen - 13);
+ }
+ p = &blackTab1[code & 0x7f];
+ } else if (bufLen >= 7 && ((buf >> (bufLen - 4)) & 0x0f) == 0 &&
+ ((buf >> (bufLen - 6)) & 0x03) != 0) {
+ if (bufLen <= 12) {
+ code = buf << (12 - bufLen);
+ } else {
+ code = buf >> (bufLen - 12);
+ }
+ p = &blackTab2[(code & 0xff) - 64];
+ } else {
+ if (bufLen <= 6) {
+ code = buf << (6 - bufLen);
+ } else {
+ code = buf >> (bufLen - 6);
+ }
+ p = &blackTab3[code & 0x3f];
+ }
+ if (p->bits > 0 && p->bits <= (int)bufLen) {
+ bufLen -= p->bits;
+ return p->n;
+ }
+ if (bufLen >= 13) {
+ break;
+ }
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bufLen += 8;
+ ++nBytesRead;
+ }
+ error(str->getPos(), "Bad black code in JBIG2 MMR stream");
+ // eat a bit and return a positive number so that the caller doesn't
+ // go into an infinite loop
+ --bufLen;
+ return 1;
+}
+
+Guint JBIG2MMRDecoder::get24Bits() {
+ while (bufLen < 24) {
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bufLen += 8;
+ ++nBytesRead;
+ }
+ return (buf >> (bufLen - 24)) & 0xffffff;
+}
+
+void JBIG2MMRDecoder::skipTo(Guint length) {
+ while (nBytesRead < length) {
+ str->getChar();
+ ++nBytesRead;
+ }
+}
+
+//------------------------------------------------------------------------
+// JBIG2Segment
+//------------------------------------------------------------------------
+
+enum JBIG2SegmentType {
+ jbig2SegBitmap,
+ jbig2SegSymbolDict,
+ jbig2SegPatternDict,
+ jbig2SegCodeTable
+};
+
+class JBIG2Segment {
+public:
+
+ JBIG2Segment(Guint segNumA) { segNum = segNumA; }
+ virtual ~JBIG2Segment() {}
+ void setSegNum(Guint segNumA) { segNum = segNumA; }
+ Guint getSegNum() { return segNum; }
+ virtual JBIG2SegmentType getType() = 0;
+
+private:
+
+ Guint segNum;
+};
+
+//------------------------------------------------------------------------
+// JBIG2Bitmap
+//------------------------------------------------------------------------
+
+struct JBIG2BitmapPtr {
+ Guchar *p;
+ int shift;
+ int x;
+};
+
+class JBIG2Bitmap: public JBIG2Segment {
+public:
+
+ JBIG2Bitmap(Guint segNumA, int wA, int hA);
+ virtual ~JBIG2Bitmap();
+ virtual JBIG2SegmentType getType() { return jbig2SegBitmap; }
+ JBIG2Bitmap *copy() { return new JBIG2Bitmap(0, this); }
+ JBIG2Bitmap *getSlice(Guint x, Guint y, Guint wA, Guint hA);
+ void expand(int newH, Guint pixel);
+ void clearToZero();
+ void clearToOne();
+ int getWidth() { return w; }
+ int getHeight() { return h; }
+ int getPixel(int x, int y)
+ { return (x < 0 || x >= w || y < 0 || y >= h) ? 0 :
+ (data[y * line + (x >> 3)] >> (7 - (x & 7))) & 1; }
+ void setPixel(int x, int y)
+ { data[y * line + (x >> 3)] |= 1 << (7 - (x & 7)); }
+ void clearPixel(int x, int y)
+ { data[y * line + (x >> 3)] &= 0x7f7f >> (x & 7); }
+ void getPixelPtr(int x, int y, JBIG2BitmapPtr *ptr);
+ int nextPixel(JBIG2BitmapPtr *ptr);
+ void duplicateRow(int yDest, int ySrc);
+ void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp);
+ Guchar *getDataPtr() { return data; }
+ int getDataSize() { return h * line; }
+
+private:
+
+ JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap);
+
+ int w, h, line;
+ Guchar *data;
+};
+
+JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, int wA, int hA):
+ JBIG2Segment(segNumA)
+{
+ w = wA;
+ h = hA;
+ line = (wA + 7) >> 3;
+ if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
+ // force a call to gmalloc(-1), which will throw an exception
+ h = -1;
+ line = 2;
+ }
+ // need to allocate one extra guard byte for use in combine()
+ data = (Guchar *)gmalloc(h * line + 1);
+ data[h * line] = 0;
+}
+
+JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap):
+ JBIG2Segment(segNumA)
+{
+ w = bitmap->w;
+ h = bitmap->h;
+ line = bitmap->line;
+ if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
+ // force a call to gmalloc(-1), which will throw an exception
+ h = -1;
+ line = 2;
+ }
+ // need to allocate one extra guard byte for use in combine()
+ data = (Guchar *)gmalloc(h * line + 1);
+ memcpy(data, bitmap->data, h * line);
+ data[h * line] = 0;
+}
+
+JBIG2Bitmap::~JBIG2Bitmap() {
+ gfree(data);
+}
+
+//~ optimize this
+JBIG2Bitmap *JBIG2Bitmap::getSlice(Guint x, Guint y, Guint wA, Guint hA) {
+ JBIG2Bitmap *slice;
+ Guint xx, yy;
+
+ slice = new JBIG2Bitmap(0, wA, hA);
+ slice->clearToZero();
+ for (yy = 0; yy < hA; ++yy) {
+ for (xx = 0; xx < wA; ++xx) {
+ if (getPixel(x + xx, y + yy)) {
+ slice->setPixel(xx, yy);
+ }
+ }
+ }
+ return slice;
+}
+
+void JBIG2Bitmap::expand(int newH, Guint pixel) {
+ if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) {
+ return;
+ }
+ // need to allocate one extra guard byte for use in combine()
+ data = (Guchar *)grealloc(data, newH * line + 1);
+ if (pixel) {
+ memset(data + h * line, 0xff, (newH - h) * line);
+ } else {
+ memset(data + h * line, 0x00, (newH - h) * line);
+ }
+ h = newH;
+ data[h * line] = 0;
+}
+
+void JBIG2Bitmap::clearToZero() {
+ memset(data, 0, h * line);
+}
+
+void JBIG2Bitmap::clearToOne() {
+ memset(data, 0xff, h * line);
+}
+
+inline void JBIG2Bitmap::getPixelPtr(int x, int y, JBIG2BitmapPtr *ptr) {
+ if (y < 0 || y >= h || x >= w) {
+ ptr->p = NULL;
+ ptr->shift = 0; // make gcc happy
+ ptr->x = 0; // make gcc happy
+ } else if (x < 0) {
+ ptr->p = &data[y * line];
+ ptr->shift = 7;
+ ptr->x = x;
+ } else {
+ ptr->p = &data[y * line + (x >> 3)];
+ ptr->shift = 7 - (x & 7);
+ ptr->x = x;
+ }
+}
+
+inline int JBIG2Bitmap::nextPixel(JBIG2BitmapPtr *ptr) {
+ int pix;
+
+ if (!ptr->p) {
+ pix = 0;
+ } else if (ptr->x < 0) {
+ ++ptr->x;
+ pix = 0;
+ } else {
+ pix = (*ptr->p >> ptr->shift) & 1;
+ if (++ptr->x == w) {
+ ptr->p = NULL;
+ } else if (ptr->shift == 0) {
+ ++ptr->p;
+ ptr->shift = 7;
+ } else {
+ --ptr->shift;
+ }
+ }
+ return pix;
+}
+
+void JBIG2Bitmap::duplicateRow(int yDest, int ySrc) {
+ memcpy(data + yDest * line, data + ySrc * line, line);
+}
+
+void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y,
+ Guint combOp) {
+ int x0, x1, y0, y1, xx, yy;
+ Guchar *srcPtr, *destPtr;
+ Guint src0, src1, src, dest, s1, s2, m1, m2, m3;
+ GBool oneByte;
+
+ // check for the pathological case where y = -2^31
+ if (y < -0x7fffffff) {
+ return;
+ }
+ if (y < 0) {
+ y0 = -y;
+ } else {
+ y0 = 0;
+ }
+ if (y + bitmap->h > h) {
+ y1 = h - y;
+ } else {
+ y1 = bitmap->h;
+ }
+ if (y0 >= y1) {
+ return;
+ }
+
+ if (x >= 0) {
+ x0 = x & ~7;
+ } else {
+ x0 = 0;
+ }
+ x1 = x + bitmap->w;
+ if (x1 > w) {
+ x1 = w;
+ }
+ if (x0 >= x1) {
+ return;
+ }
+
+ s1 = x & 7;
+ s2 = 8 - s1;
+ m1 = 0xff >> (x1 & 7);
+ m2 = 0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7));
+ m3 = (0xff >> s1) & m2;
+
+ oneByte = x0 == ((x1 - 1) & ~7);
+
+ for (yy = y0; yy < y1; ++yy) {
+
+ // one byte per line -- need to mask both left and right side
+ if (oneByte) {
+ if (x >= 0) {
+ destPtr = data + (y + yy) * line + (x >> 3);
+ srcPtr = bitmap->data + yy * bitmap->line;
+ dest = *destPtr;
+ src1 = *srcPtr;
+ switch (combOp) {
+ case 0: // or
+ dest |= (src1 >> s1) & m2;
+ break;
+ case 1: // and
+ dest &= ((0xff00 | src1) >> s1) | m1;
+ break;
+ case 2: // xor
+ dest ^= (src1 >> s1) & m2;
+ break;
+ case 3: // xnor
+ dest ^= ((src1 ^ 0xff) >> s1) & m2;
+ break;
+ case 4: // replace
+ dest = (dest & ~m3) | ((src1 >> s1) & m3);
+ break;
+ }
+ *destPtr = dest;
+ } else {
+ destPtr = data + (y + yy) * line;
+ srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
+ dest = *destPtr;
+ src1 = *srcPtr;
+ switch (combOp) {
+ case 0: // or
+ dest |= src1 & m2;
+ break;
+ case 1: // and
+ dest &= src1 | m1;
+ break;
+ case 2: // xor
+ dest ^= src1 & m2;
+ break;
+ case 3: // xnor
+ dest ^= (src1 ^ 0xff) & m2;
+ break;
+ case 4: // replace
+ dest = (src1 & m2) | (dest & m1);
+ break;
+ }
+ *destPtr = dest;
+ }
+
+ // multiple bytes per line -- need to mask left side of left-most
+ // byte and right side of right-most byte
+ } else {
+
+ // left-most byte
+ if (x >= 0) {
+ destPtr = data + (y + yy) * line + (x >> 3);
+ srcPtr = bitmap->data + yy * bitmap->line;
+ src1 = *srcPtr++;
+ dest = *destPtr;
+ switch (combOp) {
+ case 0: // or
+ dest |= src1 >> s1;
+ break;
+ case 1: // and
+ dest &= (0xff00 | src1) >> s1;
+ break;
+ case 2: // xor
+ dest ^= src1 >> s1;
+ break;
+ case 3: // xnor
+ dest ^= (src1 ^ 0xff) >> s1;
+ break;
+ case 4: // replace
+ dest = (dest & (0xff << s2)) | (src1 >> s1);
+ break;
+ }
+ *destPtr++ = dest;
+ xx = x0 + 8;
+ } else {
+ destPtr = data + (y + yy) * line;
+ srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
+ src1 = *srcPtr++;
+ xx = x0;
+ }
+
+ // middle bytes
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ switch (combOp) {
+ case 0: // or
+ dest |= src;
+ break;
+ case 1: // and
+ dest &= src;
+ break;
+ case 2: // xor
+ dest ^= src;
+ break;
+ case 3: // xnor
+ dest ^= src ^ 0xff;
+ break;
+ case 4: // replace
+ dest = src;
+ break;
+ }
+ *destPtr++ = dest;
+ }
+
+ // right-most byte
+ // note: this last byte (src1) may not actually be used, depending
+ // on the values of s1, m1, and m2 - and in fact, it may be off
+ // the edge of the source bitmap, which means we need to allocate
+ // one extra guard byte at the end of each bitmap
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ switch (combOp) {
+ case 0: // or
+ dest |= src & m2;
+ break;
+ case 1: // and
+ dest &= src | m1;
+ break;
+ case 2: // xor
+ dest ^= src & m2;
+ break;
+ case 3: // xnor
+ dest ^= (src ^ 0xff) & m2;
+ break;
+ case 4: // replace
+ dest = (src & m2) | (dest & m1);
+ break;
+ }
+ *destPtr = dest;
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+// JBIG2SymbolDict
+//------------------------------------------------------------------------
+
+class JBIG2SymbolDict: public JBIG2Segment {
+public:
+
+ JBIG2SymbolDict(Guint segNumA, Guint sizeA);
+ virtual ~JBIG2SymbolDict();
+ virtual JBIG2SegmentType getType() { return jbig2SegSymbolDict; }
+ Guint getSize() { return size; }
+ void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
+ JBIG2Bitmap *getBitmap(Guint idx) { return bitmaps[idx]; }
+ void setGenericRegionStats(JArithmeticDecoderStats *stats)
+ { genericRegionStats = stats; }
+ void setRefinementRegionStats(JArithmeticDecoderStats *stats)
+ { refinementRegionStats = stats; }
+ JArithmeticDecoderStats *getGenericRegionStats()
+ { return genericRegionStats; }
+ JArithmeticDecoderStats *getRefinementRegionStats()
+ { return refinementRegionStats; }
+
+private:
+
+ Guint size;
+ JBIG2Bitmap **bitmaps;
+ JArithmeticDecoderStats *genericRegionStats;
+ JArithmeticDecoderStats *refinementRegionStats;
+};
+
+JBIG2SymbolDict::JBIG2SymbolDict(Guint segNumA, Guint sizeA):
+ JBIG2Segment(segNumA)
+{
+ Guint i;
+
+ size = sizeA;
+ bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *));
+ for (i = 0; i < size; ++i) {
+ bitmaps[i] = NULL;
+ }
+ genericRegionStats = NULL;
+ refinementRegionStats = NULL;
+}
+
+JBIG2SymbolDict::~JBIG2SymbolDict() {
+ Guint i;
+
+ for (i = 0; i < size; ++i) {
+ if (bitmaps[i]) {
+ delete bitmaps[i];
+ }
+ }
+ gfree(bitmaps);
+ if (genericRegionStats) {
+ delete genericRegionStats;
+ }
+ if (refinementRegionStats) {
+ delete refinementRegionStats;
+ }
+}
+
+//------------------------------------------------------------------------
+// JBIG2PatternDict
+//------------------------------------------------------------------------
+
+class JBIG2PatternDict: public JBIG2Segment {
+public:
+
+ JBIG2PatternDict(Guint segNumA, Guint sizeA);
+ virtual ~JBIG2PatternDict();
+ virtual JBIG2SegmentType getType() { return jbig2SegPatternDict; }
+ Guint getSize() { return size; }
+ void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; }
+ JBIG2Bitmap *getBitmap(Guint idx) { return bitmaps[idx]; }
+
+private:
+
+ Guint size;
+ JBIG2Bitmap **bitmaps;
+};
+
+JBIG2PatternDict::JBIG2PatternDict(Guint segNumA, Guint sizeA):
+ JBIG2Segment(segNumA)
+{
+ size = sizeA;
+ bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *));
+}
+
+JBIG2PatternDict::~JBIG2PatternDict() {
+ Guint i;
+
+ for (i = 0; i < size; ++i) {
+ delete bitmaps[i];
+ }
+ gfree(bitmaps);
+}
+
+//------------------------------------------------------------------------
+// JBIG2CodeTable
+//------------------------------------------------------------------------
+
+class JBIG2CodeTable: public JBIG2Segment {
+public:
+
+ JBIG2CodeTable(Guint segNumA, JBIG2HuffmanTable *tableA);
+ virtual ~JBIG2CodeTable();
+ virtual JBIG2SegmentType getType() { return jbig2SegCodeTable; }
+ JBIG2HuffmanTable *getHuffTable() { return table; }
+
+private:
+
+ JBIG2HuffmanTable *table;
+};
+
+JBIG2CodeTable::JBIG2CodeTable(Guint segNumA, JBIG2HuffmanTable *tableA):
+ JBIG2Segment(segNumA)
+{
+ table = tableA;
+}
+
+JBIG2CodeTable::~JBIG2CodeTable() {
+ gfree(table);
+}
+
+//------------------------------------------------------------------------
+// JBIG2Stream
+//------------------------------------------------------------------------
+
+JBIG2Stream::JBIG2Stream(Stream *strA, Object *globalsStreamA):
+ FilterStream(strA)
+{
+ pageBitmap = NULL;
+
+ arithDecoder = new JArithmeticDecoder();
+ genericRegionStats = new JArithmeticDecoderStats(1 << 1);
+ refinementRegionStats = new JArithmeticDecoderStats(1 << 1);
+ iadhStats = new JArithmeticDecoderStats(1 << 9);
+ iadwStats = new JArithmeticDecoderStats(1 << 9);
+ iaexStats = new JArithmeticDecoderStats(1 << 9);
+ iaaiStats = new JArithmeticDecoderStats(1 << 9);
+ iadtStats = new JArithmeticDecoderStats(1 << 9);
+ iaitStats = new JArithmeticDecoderStats(1 << 9);
+ iafsStats = new JArithmeticDecoderStats(1 << 9);
+ iadsStats = new JArithmeticDecoderStats(1 << 9);
+ iardxStats = new JArithmeticDecoderStats(1 << 9);
+ iardyStats = new JArithmeticDecoderStats(1 << 9);
+ iardwStats = new JArithmeticDecoderStats(1 << 9);
+ iardhStats = new JArithmeticDecoderStats(1 << 9);
+ iariStats = new JArithmeticDecoderStats(1 << 9);
+ iaidStats = new JArithmeticDecoderStats(1 << 1);
+ huffDecoder = new JBIG2HuffmanDecoder();
+ mmrDecoder = new JBIG2MMRDecoder();
+
+ globalsStreamA->copy(&globalsStream);
+ segments = globalSegments = NULL;
+ curStr = NULL;
+ dataPtr = dataEnd = NULL;
+}
+
+JBIG2Stream::~JBIG2Stream() {
+ close();
+ globalsStream.free();
+ delete arithDecoder;
+ delete genericRegionStats;
+ delete refinementRegionStats;
+ delete iadhStats;
+ delete iadwStats;
+ delete iaexStats;
+ delete iaaiStats;
+ delete iadtStats;
+ delete iaitStats;
+ delete iafsStats;
+ delete iadsStats;
+ delete iardxStats;
+ delete iardyStats;
+ delete iardwStats;
+ delete iardhStats;
+ delete iariStats;
+ delete iaidStats;
+ delete huffDecoder;
+ delete mmrDecoder;
+ delete str;
+}
+
+void JBIG2Stream::reset() {
+ // read the globals stream
+ globalSegments = new GList();
+ if (globalsStream.isStream()) {
+ segments = globalSegments;
+ curStr = globalsStream.getStream();
+ curStr->reset();
+ arithDecoder->setStream(curStr);
+ huffDecoder->setStream(curStr);
+ mmrDecoder->setStream(curStr);
+ readSegments();
+ curStr->close();
+ }
+
+ // read the main stream
+ segments = new GList();
+ curStr = str;
+ curStr->reset();
+ arithDecoder->setStream(curStr);
+ huffDecoder->setStream(curStr);
+ mmrDecoder->setStream(curStr);
+ readSegments();
+
+ if (pageBitmap) {
+ dataPtr = pageBitmap->getDataPtr();
+ dataEnd = dataPtr + pageBitmap->getDataSize();
+ } else {
+ dataPtr = dataEnd = NULL;
+ }
+}
+
+void JBIG2Stream::close() {
+ if (pageBitmap) {
+ delete pageBitmap;
+ pageBitmap = NULL;
+ }
+ if (segments) {
+ deleteGList(segments, JBIG2Segment);
+ segments = NULL;
+ }
+ if (globalSegments) {
+ deleteGList(globalSegments, JBIG2Segment);
+ globalSegments = NULL;
+ }
+ dataPtr = dataEnd = NULL;
+ FilterStream::close();
+}
+
+int JBIG2Stream::getChar() {
+ if (dataPtr && dataPtr < dataEnd) {
+ return (*dataPtr++ ^ 0xff) & 0xff;
+ }
+ return EOF;
+}
+
+int JBIG2Stream::lookChar() {
+ if (dataPtr && dataPtr < dataEnd) {
+ return (*dataPtr ^ 0xff) & 0xff;
+ }
+ return EOF;
+}
+
+GString *JBIG2Stream::getPSFilter(int /*psLevel*/, char * /*indent*/) {
+ return NULL;
+}
+
+GBool JBIG2Stream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+void JBIG2Stream::readSegments() {
+ Guint segNum, segFlags, segType, page, segLength;
+ Guint refFlags, nRefSegs;
+ Guint *refSegs;
+ int segDataPos;
+ int c1, c2, c3;
+ Guint i;
+
+ while (readULong(&segNum)) {
+
+ // segment header flags
+ if (!readUByte(&segFlags)) {
+ goto eofError1;
+ }
+ segType = segFlags & 0x3f;
+
+ // referred-to segment count and retention flags
+ if (!readUByte(&refFlags)) {
+ goto eofError1;
+ }
+ nRefSegs = refFlags >> 5;
+ if (nRefSegs == 7) {
+ if ((c1 = curStr->getChar()) == EOF ||
+ (c2 = curStr->getChar()) == EOF ||
+ (c3 = curStr->getChar()) == EOF) {
+ goto eofError1;
+ }
+ refFlags = (refFlags << 24) | (c1 << 16) | (c2 << 8) | c3;
+ nRefSegs = refFlags & 0x1fffffff;
+ for (i = 0; i < (nRefSegs + 9) >> 3; ++i) {
+ c1 = curStr->getChar();
+ }
+ }
+
+ // referred-to segment numbers
+ refSegs = (Guint *)gmallocn(nRefSegs, sizeof(Guint));
+ if (segNum <= 256) {
+ for (i = 0; i < nRefSegs; ++i) {
+ if (!readUByte(&refSegs[i])) {
+ goto eofError2;
+ }
+ }
+ } else if (segNum <= 65536) {
+ for (i = 0; i < nRefSegs; ++i) {
+ if (!readUWord(&refSegs[i])) {
+ goto eofError2;
+ }
+ }
+ } else {
+ for (i = 0; i < nRefSegs; ++i) {
+ if (!readULong(&refSegs[i])) {
+ goto eofError2;
+ }
+ }
+ }
+
+ // segment page association
+ if (segFlags & 0x40) {
+ if (!readULong(&page)) {
+ goto eofError2;
+ }
+ } else {
+ if (!readUByte(&page)) {
+ goto eofError2;
+ }
+ }
+
+ // segment data length
+ if (!readULong(&segLength)) {
+ goto eofError2;
+ }
+
+ // keep track of the start of the segment data
+ segDataPos = getPos();
+
+ // check for missing page information segment
+ if (!pageBitmap && ((segType >= 4 && segType <= 7) ||
+ (segType >= 20 && segType <= 43))) {
+ error(getPos(), "First JBIG2 segment associated with a page must be a page information segment");
+ goto syntaxError;
+ }
+
+ // read the segment data
+ switch (segType) {
+ case 0:
+ if (!readSymbolDictSeg(segNum, segLength, refSegs, nRefSegs)) {
+ goto syntaxError;
+ }
+ break;
+ case 4:
+ readTextRegionSeg(segNum, gFalse, gFalse, segLength, refSegs, nRefSegs);
+ break;
+ case 6:
+ readTextRegionSeg(segNum, gTrue, gFalse, segLength, refSegs, nRefSegs);
+ break;
+ case 7:
+ readTextRegionSeg(segNum, gTrue, gTrue, segLength, refSegs, nRefSegs);
+ break;
+ case 16:
+ readPatternDictSeg(segNum, segLength);
+ break;
+ case 20:
+ readHalftoneRegionSeg(segNum, gFalse, gFalse, segLength,
+ refSegs, nRefSegs);
+ break;
+ case 22:
+ readHalftoneRegionSeg(segNum, gTrue, gFalse, segLength,
+ refSegs, nRefSegs);
+ break;
+ case 23:
+ readHalftoneRegionSeg(segNum, gTrue, gTrue, segLength,
+ refSegs, nRefSegs);
+ break;
+ case 36:
+ readGenericRegionSeg(segNum, gFalse, gFalse, segLength);
+ break;
+ case 38:
+ readGenericRegionSeg(segNum, gTrue, gFalse, segLength);
+ break;
+ case 39:
+ readGenericRegionSeg(segNum, gTrue, gTrue, segLength);
+ break;
+ case 40:
+ readGenericRefinementRegionSeg(segNum, gFalse, gFalse, segLength,
+ refSegs, nRefSegs);
+ break;
+ case 42:
+ readGenericRefinementRegionSeg(segNum, gTrue, gFalse, segLength,
+ refSegs, nRefSegs);
+ break;
+ case 43:
+ readGenericRefinementRegionSeg(segNum, gTrue, gTrue, segLength,
+ refSegs, nRefSegs);
+ break;
+ case 48:
+ readPageInfoSeg(segLength);
+ break;
+ case 50:
+ readEndOfStripeSeg(segLength);
+ break;
+ case 52:
+ readProfilesSeg(segLength);
+ break;
+ case 53:
+ readCodeTableSeg(segNum, segLength);
+ break;
+ case 62:
+ readExtensionSeg(segLength);
+ break;
+ default:
+ error(getPos(), "Unknown segment type in JBIG2 stream");
+ for (i = 0; i < segLength; ++i) {
+ if ((c1 = curStr->getChar()) == EOF) {
+ goto eofError2;
+ }
+ }
+ break;
+ }
+
+ // Make sure the segment handler read all of the bytes in the
+ // segment data, unless this segment is marked as having an
+ // unknown length (section 7.2.7 of the JBIG2 Final Committee Draft)
+
+ if (segLength != 0xffffffff) {
+
+ int segExtraBytes = segDataPos + segLength - getPos();
+ if (segExtraBytes > 0) {
+
+ // If we didn't read all of the bytes in the segment data,
+ // indicate an error, and throw away the rest of the data.
+
+ // v.3.1.01.13 of the LuraTech PDF Compressor Server will
+ // sometimes generate an extraneous NULL byte at the end of
+ // arithmetic-coded symbol dictionary segments when numNewSyms
+ // == 0. Segments like this often occur for blank pages.
+
+ error(getPos(), "%d extraneous byte%s after segment",
+ segExtraBytes, (segExtraBytes > 1) ? "s" : "");
+
+ // Burn through the remaining bytes -- inefficient, but
+ // hopefully we're not doing this much
+
+ int trash;
+ for (int i = segExtraBytes; i > 0; i--) {
+ readByte(&trash);
+ }
+
+ } else if (segExtraBytes < 0) {
+
+ // If we read more bytes than we should have, according to the
+ // segment length field, note an error.
+
+ error(getPos(), "Previous segment handler read too many bytes");
+
+ }
+
+ }
+
+ gfree(refSegs);
+ }
+
+ return;
+
+ syntaxError:
+ gfree(refSegs);
+ return;
+
+ eofError2:
+ gfree(refSegs);
+ eofError1:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint /*length*/,
+ Guint *refSegs, Guint nRefSegs) {
+ JBIG2SymbolDict *symbolDict;
+ JBIG2HuffmanTable *huffDHTable, *huffDWTable;
+ JBIG2HuffmanTable *huffBMSizeTable, *huffAggInstTable;
+ JBIG2Segment *seg;
+ GList *codeTables;
+ JBIG2SymbolDict *inputSymbolDict;
+ Guint flags, sdTemplate, sdrTemplate, huff, refAgg;
+ Guint huffDH, huffDW, huffBMSize, huffAggInst;
+ Guint contextUsed, contextRetained;
+ int sdATX[4], sdATY[4], sdrATX[2], sdrATY[2];
+ Guint numExSyms, numNewSyms, numInputSyms, symCodeLen;
+ JBIG2Bitmap **bitmaps;
+ JBIG2Bitmap *collBitmap, *refBitmap;
+ Guint *symWidths;
+ Guint symHeight, symWidth, totalWidth, x, symID;
+ int dh, dw, refAggNum, refDX, refDY, bmSize;
+ GBool ex;
+ int run, cnt;
+ Guint i, j, k;
+ Guchar *p;
+
+ symWidths = NULL;
+
+ // symbol dictionary flags
+ if (!readUWord(&flags)) {
+ goto eofError;
+ }
+ sdTemplate = (flags >> 10) & 3;
+ sdrTemplate = (flags >> 12) & 1;
+ huff = flags & 1;
+ refAgg = (flags >> 1) & 1;
+ huffDH = (flags >> 2) & 3;
+ huffDW = (flags >> 4) & 3;
+ huffBMSize = (flags >> 6) & 1;
+ huffAggInst = (flags >> 7) & 1;
+ contextUsed = (flags >> 8) & 1;
+ contextRetained = (flags >> 9) & 1;
+
+ // symbol dictionary AT flags
+ if (!huff) {
+ if (sdTemplate == 0) {
+ if (!readByte(&sdATX[0]) ||
+ !readByte(&sdATY[0]) ||
+ !readByte(&sdATX[1]) ||
+ !readByte(&sdATY[1]) ||
+ !readByte(&sdATX[2]) ||
+ !readByte(&sdATY[2]) ||
+ !readByte(&sdATX[3]) ||
+ !readByte(&sdATY[3])) {
+ goto eofError;
+ }
+ } else {
+ if (!readByte(&sdATX[0]) ||
+ !readByte(&sdATY[0])) {
+ goto eofError;
+ }
+ }
+ }
+
+ // symbol dictionary refinement AT flags
+ if (refAgg && !sdrTemplate) {
+ if (!readByte(&sdrATX[0]) ||
+ !readByte(&sdrATY[0]) ||
+ !readByte(&sdrATX[1]) ||
+ !readByte(&sdrATY[1])) {
+ goto eofError;
+ }
+ }
+
+ // SDNUMEXSYMS and SDNUMNEWSYMS
+ if (!readULong(&numExSyms) || !readULong(&numNewSyms)) {
+ goto eofError;
+ }
+
+ // get referenced segments: input symbol dictionaries and code tables
+ codeTables = new GList();
+ numInputSyms = 0;
+ for (i = 0; i < nRefSegs; ++i) {
+ if ((seg = findSegment(refSegs[i]))) {
+ if (seg->getType() == jbig2SegSymbolDict) {
+ j = ((JBIG2SymbolDict *)seg)->getSize();
+ if (numInputSyms > UINT_MAX - j) {
+ error(getPos(), "Too many input symbols in JBIG2 symbol dictionary");
+ delete codeTables;
+ goto eofError;
+ }
+ numInputSyms += j;
+ } else if (seg->getType() == jbig2SegCodeTable) {
+ codeTables->append(seg);
+ }
+ }
+ }
+ if (numInputSyms > UINT_MAX - numNewSyms) {
+ error(getPos(), "Too many input symbols in JBIG2 symbol dictionary");
+ delete codeTables;
+ goto eofError;
+ }
+
+ // compute symbol code length
+ symCodeLen = 1;
+ i = (numInputSyms + numNewSyms) >> 1;
+ while (i) {
+ ++symCodeLen;
+ i >>= 1;
+ }
+
+ // get the input symbol bitmaps
+ bitmaps = (JBIG2Bitmap **)gmallocn(numInputSyms + numNewSyms,
+ sizeof(JBIG2Bitmap *));
+ for (i = 0; i < numInputSyms + numNewSyms; ++i) {
+ bitmaps[i] = NULL;
+ }
+ k = 0;
+ inputSymbolDict = NULL;
+ for (i = 0; i < nRefSegs; ++i) {
+ if ((seg = findSegment(refSegs[i]))) {
+ if (seg->getType() == jbig2SegSymbolDict) {
+ inputSymbolDict = (JBIG2SymbolDict *)seg;
+ for (j = 0; j < inputSymbolDict->getSize(); ++j) {
+ bitmaps[k++] = inputSymbolDict->getBitmap(j);
+ }
+ }
+ }
+ }
+
+ // get the Huffman tables
+ huffDHTable = huffDWTable = NULL; // make gcc happy
+ huffBMSizeTable = huffAggInstTable = NULL; // make gcc happy
+ i = 0;
+ if (huff) {
+ if (huffDH == 0) {
+ huffDHTable = huffTableD;
+ } else if (huffDH == 1) {
+ huffDHTable = huffTableE;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffDW == 0) {
+ huffDWTable = huffTableB;
+ } else if (huffDW == 1) {
+ huffDWTable = huffTableC;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffBMSize == 0) {
+ huffBMSizeTable = huffTableA;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffBMSizeTable =
+ ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffAggInst == 0) {
+ huffAggInstTable = huffTableA;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffAggInstTable =
+ ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ }
+ delete codeTables;
+
+ // set up the Huffman decoder
+ if (huff) {
+ huffDecoder->reset();
+
+ // set up the arithmetic decoder
+ } else {
+ if (contextUsed && inputSymbolDict) {
+ resetGenericStats(sdTemplate, inputSymbolDict->getGenericRegionStats());
+ } else {
+ resetGenericStats(sdTemplate, NULL);
+ }
+ resetIntStats(symCodeLen);
+ arithDecoder->start();
+ }
+
+ // set up the arithmetic decoder for refinement/aggregation
+ if (refAgg) {
+ if (contextUsed && inputSymbolDict) {
+ resetRefinementStats(sdrTemplate,
+ inputSymbolDict->getRefinementRegionStats());
+ } else {
+ resetRefinementStats(sdrTemplate, NULL);
+ }
+ }
+
+ // allocate symbol widths storage
+ if (huff && !refAgg) {
+ symWidths = (Guint *)gmallocn(numNewSyms, sizeof(Guint));
+ }
+
+ symHeight = 0;
+ i = 0;
+ while (i < numNewSyms) {
+
+ // read the height class delta height
+ if (huff) {
+ huffDecoder->decodeInt(&dh, huffDHTable);
+ } else {
+ arithDecoder->decodeInt(&dh, iadhStats);
+ }
+ if (dh < 0 && (Guint)-dh >= symHeight) {
+ error(getPos(), "Bad delta-height value in JBIG2 symbol dictionary");
+ goto syntaxError;
+ }
+ symHeight += dh;
+ symWidth = 0;
+ totalWidth = 0;
+ j = i;
+
+ // read the symbols in this height class
+ while (1) {
+
+ // read the delta width
+ if (huff) {
+ if (!huffDecoder->decodeInt(&dw, huffDWTable)) {
+ break;
+ }
+ } else {
+ if (!arithDecoder->decodeInt(&dw, iadwStats)) {
+ break;
+ }
+ }
+ if (dw < 0 && (Guint)-dw >= symWidth) {
+ error(getPos(), "Bad delta-height value in JBIG2 symbol dictionary");
+ goto syntaxError;
+ }
+ symWidth += dw;
+ if (i >= numNewSyms) {
+ error(getPos(), "Too many symbols in JBIG2 symbol dictionary");
+ goto syntaxError;
+ }
+
+ // using a collective bitmap, so don't read a bitmap here
+ if (huff && !refAgg) {
+ symWidths[i] = symWidth;
+ totalWidth += symWidth;
+
+ // refinement/aggregate coding
+ } else if (refAgg) {
+ if (huff) {
+ if (!huffDecoder->decodeInt(&refAggNum, huffAggInstTable)) {
+ break;
+ }
+ } else {
+ if (!arithDecoder->decodeInt(&refAggNum, iaaiStats)) {
+ break;
+ }
+ }
+#if 0 //~ This special case was added about a year before the final draft
+ //~ of the JBIG2 spec was released. I have encountered some old
+ //~ JBIG2 images that predate it.
+ if (0) {
+#else
+ if (refAggNum == 1) {
+#endif
+ if (huff) {
+ symID = huffDecoder->readBits(symCodeLen);
+ huffDecoder->decodeInt(&refDX, huffTableO);
+ huffDecoder->decodeInt(&refDY, huffTableO);
+ huffDecoder->decodeInt(&bmSize, huffTableA);
+ huffDecoder->reset();
+ arithDecoder->start();
+ } else {
+ symID = arithDecoder->decodeIAID(symCodeLen, iaidStats);
+ arithDecoder->decodeInt(&refDX, iardxStats);
+ arithDecoder->decodeInt(&refDY, iardyStats);
+ }
+ if (symID >= numInputSyms + i) {
+ error(getPos(), "Invalid symbol ID in JBIG2 symbol dictionary");
+ goto syntaxError;
+ }
+ refBitmap = bitmaps[symID];
+ bitmaps[numInputSyms + i] =
+ readGenericRefinementRegion(symWidth, symHeight,
+ sdrTemplate, gFalse,
+ refBitmap, refDX, refDY,
+ sdrATX, sdrATY);
+ //~ do we need to use the bmSize value here (in Huffman mode)?
+ } else {
+ bitmaps[numInputSyms + i] =
+ readTextRegion(huff, gTrue, symWidth, symHeight,
+ refAggNum, 0, numInputSyms + i, NULL,
+ symCodeLen, bitmaps, 0, 0, 0, 1, 0,
+ huffTableF, huffTableH, huffTableK, huffTableO,
+ huffTableO, huffTableO, huffTableO, huffTableA,
+ sdrTemplate, sdrATX, sdrATY);
+ }
+
+ // non-ref/agg coding
+ } else {
+ bitmaps[numInputSyms + i] =
+ readGenericBitmap(gFalse, symWidth, symHeight,
+ sdTemplate, gFalse, gFalse, NULL,
+ sdATX, sdATY, 0);
+ }
+
+ ++i;
+ }
+
+ // read the collective bitmap
+ if (huff && !refAgg) {
+ huffDecoder->decodeInt(&bmSize, huffBMSizeTable);
+ huffDecoder->reset();
+ if (bmSize == 0) {
+ collBitmap = new JBIG2Bitmap(0, totalWidth, symHeight);
+ bmSize = symHeight * ((totalWidth + 7) >> 3);
+ p = collBitmap->getDataPtr();
+ for (k = 0; k < (Guint)bmSize; ++k) {
+ *p++ = curStr->getChar();
+ }
+ } else {
+ collBitmap = readGenericBitmap(gTrue, totalWidth, symHeight,
+ 0, gFalse, gFalse, NULL, NULL, NULL,
+ bmSize);
+ }
+ x = 0;
+ for (; j < i; ++j) {
+ bitmaps[numInputSyms + j] =
+ collBitmap->getSlice(x, 0, symWidths[j], symHeight);
+ x += symWidths[j];
+ }
+ delete collBitmap;
+ }
+ }
+
+ // create the symbol dict object
+ symbolDict = new JBIG2SymbolDict(segNum, numExSyms);
+
+ // exported symbol list
+ i = j = 0;
+ ex = gFalse;
+ while (i < numInputSyms + numNewSyms) {
+ if (huff) {
+ huffDecoder->decodeInt(&run, huffTableA);
+ } else {
+ arithDecoder->decodeInt(&run, iaexStats);
+ }
+ if (i + run > numInputSyms + numNewSyms ||
+ (ex && j + run > numExSyms)) {
+ error(getPos(), "Too many exported symbols in JBIG2 symbol dictionary");
+ delete symbolDict;
+ goto syntaxError;
+ }
+ if (ex) {
+ for (cnt = 0; cnt < run; ++cnt) {
+ symbolDict->setBitmap(j++, bitmaps[i++]->copy());
+ }
+ } else {
+ i += run;
+ }
+ ex = !ex;
+ }
+ if (j != numExSyms) {
+ error(getPos(), "Too few symbols in JBIG2 symbol dictionary");
+ delete symbolDict;
+ goto syntaxError;
+ }
+
+ for (i = 0; i < numNewSyms; ++i) {
+ delete bitmaps[numInputSyms + i];
+ }
+ gfree(bitmaps);
+ if (symWidths) {
+ gfree(symWidths);
+ }
+
+ // save the arithmetic decoder stats
+ if (!huff && contextRetained) {
+ symbolDict->setGenericRegionStats(genericRegionStats->copy());
+ if (refAgg) {
+ symbolDict->setRefinementRegionStats(refinementRegionStats->copy());
+ }
+ }
+
+ // store the new symbol dict
+ segments->append(symbolDict);
+
+ return gTrue;
+
+ codeTableError:
+ error(getPos(), "Missing code table in JBIG2 symbol dictionary");
+ delete codeTables;
+
+ syntaxError:
+ for (i = 0; i < numNewSyms; ++i) {
+ if (bitmaps[numInputSyms + i]) {
+ delete bitmaps[numInputSyms + i];
+ }
+ }
+ gfree(bitmaps);
+ if (symWidths) {
+ gfree(symWidths);
+ }
+ return gFalse;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+ return gFalse;
+}
+
+void JBIG2Stream::readTextRegionSeg(Guint segNum, GBool imm,
+ GBool /*lossless*/, Guint /*length*/,
+ Guint *refSegs, Guint nRefSegs) {
+ JBIG2Bitmap *bitmap;
+ JBIG2HuffmanTable runLengthTab[36];
+ JBIG2HuffmanTable *symCodeTab;
+ JBIG2HuffmanTable *huffFSTable, *huffDSTable, *huffDTTable;
+ JBIG2HuffmanTable *huffRDWTable, *huffRDHTable;
+ JBIG2HuffmanTable *huffRDXTable, *huffRDYTable, *huffRSizeTable;
+ JBIG2Segment *seg;
+ GList *codeTables;
+ JBIG2SymbolDict *symbolDict;
+ JBIG2Bitmap **syms;
+ Guint w, h, x, y, segInfoFlags, extCombOp;
+ Guint flags, huff, refine, logStrips, refCorner, transposed;
+ Guint combOp, defPixel, templ;
+ int sOffset;
+ Guint huffFlags, huffFS, huffDS, huffDT;
+ Guint huffRDW, huffRDH, huffRDX, huffRDY, huffRSize;
+ Guint numInstances, numSyms, symCodeLen;
+ int atx[2], aty[2];
+ Guint i, k, kk;
+ int j;
+
+ // region segment info field
+ if (!readULong(&w) || !readULong(&h) ||
+ !readULong(&x) || !readULong(&y) ||
+ !readUByte(&segInfoFlags)) {
+ goto eofError;
+ }
+ extCombOp = segInfoFlags & 7;
+
+ // rest of the text region header
+ if (!readUWord(&flags)) {
+ goto eofError;
+ }
+ huff = flags & 1;
+ refine = (flags >> 1) & 1;
+ logStrips = (flags >> 2) & 3;
+ refCorner = (flags >> 4) & 3;
+ transposed = (flags >> 6) & 1;
+ combOp = (flags >> 7) & 3;
+ defPixel = (flags >> 9) & 1;
+ sOffset = (flags >> 10) & 0x1f;
+ if (sOffset & 0x10) {
+ sOffset |= -1 - 0x0f;
+ }
+ templ = (flags >> 15) & 1;
+ huffFS = huffDS = huffDT = 0; // make gcc happy
+ huffRDW = huffRDH = huffRDX = huffRDY = huffRSize = 0; // make gcc happy
+ if (huff) {
+ if (!readUWord(&huffFlags)) {
+ goto eofError;
+ }
+ huffFS = huffFlags & 3;
+ huffDS = (huffFlags >> 2) & 3;
+ huffDT = (huffFlags >> 4) & 3;
+ huffRDW = (huffFlags >> 6) & 3;
+ huffRDH = (huffFlags >> 8) & 3;
+ huffRDX = (huffFlags >> 10) & 3;
+ huffRDY = (huffFlags >> 12) & 3;
+ huffRSize = (huffFlags >> 14) & 1;
+ }
+ if (refine && templ == 0) {
+ if (!readByte(&atx[0]) || !readByte(&aty[0]) ||
+ !readByte(&atx[1]) || !readByte(&aty[1])) {
+ goto eofError;
+ }
+ }
+ if (!readULong(&numInstances)) {
+ goto eofError;
+ }
+
+ // get symbol dictionaries and tables
+ codeTables = new GList();
+ numSyms = 0;
+ for (i = 0; i < nRefSegs; ++i) {
+ if ((seg = findSegment(refSegs[i]))) {
+ if (seg->getType() == jbig2SegSymbolDict) {
+ numSyms += ((JBIG2SymbolDict *)seg)->getSize();
+ } else if (seg->getType() == jbig2SegCodeTable) {
+ codeTables->append(seg);
+ }
+ } else {
+ error(getPos(), "Invalid segment reference in JBIG2 text region");
+ delete codeTables;
+ return;
+ }
+ }
+ symCodeLen = 0;
+ i = 1;
+ while (i < numSyms) {
+ ++symCodeLen;
+ i <<= 1;
+ }
+
+ // get the symbol bitmaps
+ syms = (JBIG2Bitmap **)gmallocn(numSyms, sizeof(JBIG2Bitmap *));
+ kk = 0;
+ for (i = 0; i < nRefSegs; ++i) {
+ if ((seg = findSegment(refSegs[i]))) {
+ if (seg->getType() == jbig2SegSymbolDict) {
+ symbolDict = (JBIG2SymbolDict *)seg;
+ for (k = 0; k < symbolDict->getSize(); ++k) {
+ syms[kk++] = symbolDict->getBitmap(k);
+ }
+ }
+ }
+ }
+
+ // get the Huffman tables
+ huffFSTable = huffDSTable = huffDTTable = NULL; // make gcc happy
+ huffRDWTable = huffRDHTable = NULL; // make gcc happy
+ huffRDXTable = huffRDYTable = huffRSizeTable = NULL; // make gcc happy
+ i = 0;
+ if (huff) {
+ if (huffFS == 0) {
+ huffFSTable = huffTableF;
+ } else if (huffFS == 1) {
+ huffFSTable = huffTableG;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffFSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffDS == 0) {
+ huffDSTable = huffTableH;
+ } else if (huffDS == 1) {
+ huffDSTable = huffTableI;
+ } else if (huffDS == 2) {
+ huffDSTable = huffTableJ;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffDSTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffDT == 0) {
+ huffDTTable = huffTableK;
+ } else if (huffDT == 1) {
+ huffDTTable = huffTableL;
+ } else if (huffDT == 2) {
+ huffDTTable = huffTableM;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffDTTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffRDW == 0) {
+ huffRDWTable = huffTableN;
+ } else if (huffRDW == 1) {
+ huffRDWTable = huffTableO;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffRDWTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffRDH == 0) {
+ huffRDHTable = huffTableN;
+ } else if (huffRDH == 1) {
+ huffRDHTable = huffTableO;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffRDHTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffRDX == 0) {
+ huffRDXTable = huffTableN;
+ } else if (huffRDX == 1) {
+ huffRDXTable = huffTableO;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffRDXTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffRDY == 0) {
+ huffRDYTable = huffTableN;
+ } else if (huffRDY == 1) {
+ huffRDYTable = huffTableO;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffRDYTable = ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ if (huffRSize == 0) {
+ huffRSizeTable = huffTableA;
+ } else {
+ if (i >= (Guint)codeTables->getLength()) {
+ goto codeTableError;
+ }
+ huffRSizeTable =
+ ((JBIG2CodeTable *)codeTables->get(i++))->getHuffTable();
+ }
+ }
+ delete codeTables;
+
+ // symbol ID Huffman decoding table
+ if (huff) {
+ huffDecoder->reset();
+ for (i = 0; i < 32; ++i) {
+ runLengthTab[i].val = i;
+ runLengthTab[i].prefixLen = huffDecoder->readBits(4);
+ runLengthTab[i].rangeLen = 0;
+ }
+ runLengthTab[32].val = 0x103;
+ runLengthTab[32].prefixLen = huffDecoder->readBits(4);
+ runLengthTab[32].rangeLen = 2;
+ runLengthTab[33].val = 0x203;
+ runLengthTab[33].prefixLen = huffDecoder->readBits(4);
+ runLengthTab[33].rangeLen = 3;
+ runLengthTab[34].val = 0x20b;
+ runLengthTab[34].prefixLen = huffDecoder->readBits(4);
+ runLengthTab[34].rangeLen = 7;
+ runLengthTab[35].prefixLen = 0;
+ runLengthTab[35].rangeLen = jbig2HuffmanEOT;
+ huffDecoder->buildTable(runLengthTab, 35);
+ symCodeTab = (JBIG2HuffmanTable *)gmallocn(numSyms + 1,
+ sizeof(JBIG2HuffmanTable));
+ for (i = 0; i < numSyms; ++i) {
+ symCodeTab[i].val = i;
+ symCodeTab[i].rangeLen = 0;
+ }
+ i = 0;
+ while (i < numSyms) {
+ huffDecoder->decodeInt(&j, runLengthTab);
+ if (j > 0x200) {
+ for (j -= 0x200; j && i < numSyms; --j) {
+ symCodeTab[i++].prefixLen = 0;
+ }
+ } else if (j > 0x100) {
+ for (j -= 0x100; j && i < numSyms; --j) {
+ symCodeTab[i].prefixLen = symCodeTab[i-1].prefixLen;
+ ++i;
+ }
+ } else {
+ symCodeTab[i++].prefixLen = j;
+ }
+ }
+ symCodeTab[numSyms].prefixLen = 0;
+ symCodeTab[numSyms].rangeLen = jbig2HuffmanEOT;
+ huffDecoder->buildTable(symCodeTab, numSyms);
+ huffDecoder->reset();
+
+ // set up the arithmetic decoder
+ } else {
+ symCodeTab = NULL;
+ resetIntStats(symCodeLen);
+ arithDecoder->start();
+ }
+ if (refine) {
+ resetRefinementStats(templ, NULL);
+ }
+
+ bitmap = readTextRegion(huff, refine, w, h, numInstances,
+ logStrips, numSyms, symCodeTab, symCodeLen, syms,
+ defPixel, combOp, transposed, refCorner, sOffset,
+ huffFSTable, huffDSTable, huffDTTable,
+ huffRDWTable, huffRDHTable,
+ huffRDXTable, huffRDYTable, huffRSizeTable,
+ templ, atx, aty);
+
+ gfree(syms);
+
+ // combine the region bitmap into the page bitmap
+ if (imm) {
+ if (pageH == 0xffffffff && y + h > curPageH) {
+ pageBitmap->expand(y + h, pageDefPixel);
+ }
+ pageBitmap->combine(bitmap, x, y, extCombOp);
+ delete bitmap;
+
+ // store the region bitmap
+ } else {
+ bitmap->setSegNum(segNum);
+ segments->append(bitmap);
+ }
+
+ // clean up the Huffman decoder
+ if (huff) {
+ gfree(symCodeTab);
+ }
+
+ return;
+
+ codeTableError:
+ error(getPos(), "Missing code table in JBIG2 text region");
+ gfree(codeTables);
+ delete syms;
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+ return;
+}
+
+JBIG2Bitmap *JBIG2Stream::readTextRegion(GBool huff, GBool refine,
+ int w, int h,
+ Guint numInstances,
+ Guint logStrips,
+ int numSyms,
+ JBIG2HuffmanTable *symCodeTab,
+ Guint symCodeLen,
+ JBIG2Bitmap **syms,
+ Guint defPixel, Guint combOp,
+ Guint transposed, Guint refCorner,
+ int sOffset,
+ JBIG2HuffmanTable *huffFSTable,
+ JBIG2HuffmanTable *huffDSTable,
+ JBIG2HuffmanTable *huffDTTable,
+ JBIG2HuffmanTable *huffRDWTable,
+ JBIG2HuffmanTable *huffRDHTable,
+ JBIG2HuffmanTable *huffRDXTable,
+ JBIG2HuffmanTable *huffRDYTable,
+ JBIG2HuffmanTable *huffRSizeTable,
+ Guint templ,
+ int *atx, int *aty) {
+ JBIG2Bitmap *bitmap;
+ JBIG2Bitmap *symbolBitmap;
+ Guint strips;
+ int t, dt, tt, s, ds, sFirst, j;
+ int rdw, rdh, rdx, rdy, ri, refDX, refDY, bmSize;
+ Guint symID, inst, bw, bh;
+
+ strips = 1 << logStrips;
+
+ // allocate the bitmap
+ bitmap = new JBIG2Bitmap(0, w, h);
+ if (defPixel) {
+ bitmap->clearToOne();
+ } else {
+ bitmap->clearToZero();
+ }
+
+ // decode initial T value
+ if (huff) {
+ huffDecoder->decodeInt(&t, huffDTTable);
+ } else {
+ arithDecoder->decodeInt(&t, iadtStats);
+ }
+ t *= -(int)strips;
+
+ inst = 0;
+ sFirst = 0;
+ while (inst < numInstances) {
+
+ // decode delta-T
+ if (huff) {
+ huffDecoder->decodeInt(&dt, huffDTTable);
+ } else {
+ arithDecoder->decodeInt(&dt, iadtStats);
+ }
+ t += dt * strips;
+
+ // first S value
+ if (huff) {
+ huffDecoder->decodeInt(&ds, huffFSTable);
+ } else {
+ arithDecoder->decodeInt(&ds, iafsStats);
+ }
+ sFirst += ds;
+ s = sFirst;
+
+ // read the instances
+ while (1) {
+
+ // T value
+ if (strips == 1) {
+ dt = 0;
+ } else if (huff) {
+ dt = huffDecoder->readBits(logStrips);
+ } else {
+ arithDecoder->decodeInt(&dt, iaitStats);
+ }
+ tt = t + dt;
+
+ // symbol ID
+ if (huff) {
+ if (symCodeTab) {
+ huffDecoder->decodeInt(&j, symCodeTab);
+ symID = (Guint)j;
+ } else {
+ symID = huffDecoder->readBits(symCodeLen);
+ }
+ } else {
+ symID = arithDecoder->decodeIAID(symCodeLen, iaidStats);
+ }
+
+ if (symID >= (Guint)numSyms) {
+ error(getPos(), "Invalid symbol number in JBIG2 text region");
+ } else {
+
+ // get the symbol bitmap
+ symbolBitmap = NULL;
+ if (refine) {
+ if (huff) {
+ ri = (int)huffDecoder->readBit();
+ } else {
+ arithDecoder->decodeInt(&ri, iariStats);
+ }
+ } else {
+ ri = 0;
+ }
+ if (ri) {
+ if (huff) {
+ huffDecoder->decodeInt(&rdw, huffRDWTable);
+ huffDecoder->decodeInt(&rdh, huffRDHTable);
+ huffDecoder->decodeInt(&rdx, huffRDXTable);
+ huffDecoder->decodeInt(&rdy, huffRDYTable);
+ huffDecoder->decodeInt(&bmSize, huffRSizeTable);
+ huffDecoder->reset();
+ arithDecoder->start();
+ } else {
+ arithDecoder->decodeInt(&rdw, iardwStats);
+ arithDecoder->decodeInt(&rdh, iardhStats);
+ arithDecoder->decodeInt(&rdx, iardxStats);
+ arithDecoder->decodeInt(&rdy, iardyStats);
+ }
+ refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx;
+ refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy;
+
+ symbolBitmap =
+ readGenericRefinementRegion(rdw + syms[symID]->getWidth(),
+ rdh + syms[symID]->getHeight(),
+ templ, gFalse, syms[symID],
+ refDX, refDY, atx, aty);
+ //~ do we need to use the bmSize value here (in Huffman mode)?
+ } else {
+ symbolBitmap = syms[symID];
+ }
+
+ // combine the symbol bitmap into the region bitmap
+ //~ something is wrong here - refCorner shouldn't degenerate into
+ //~ two cases
+ bw = symbolBitmap->getWidth() - 1;
+ bh = symbolBitmap->getHeight() - 1;
+ if (transposed) {
+ switch (refCorner) {
+ case 0: // bottom left
+ bitmap->combine(symbolBitmap, tt, s, combOp);
+ break;
+ case 1: // top left
+ bitmap->combine(symbolBitmap, tt, s, combOp);
+ break;
+ case 2: // bottom right
+ bitmap->combine(symbolBitmap, tt - bw, s, combOp);
+ break;
+ case 3: // top right
+ bitmap->combine(symbolBitmap, tt - bw, s, combOp);
+ break;
+ }
+ s += bh;
+ } else {
+ switch (refCorner) {
+ case 0: // bottom left
+ bitmap->combine(symbolBitmap, s, tt - bh, combOp);
+ break;
+ case 1: // top left
+ bitmap->combine(symbolBitmap, s, tt, combOp);
+ break;
+ case 2: // bottom right
+ bitmap->combine(symbolBitmap, s, tt - bh, combOp);
+ break;
+ case 3: // top right
+ bitmap->combine(symbolBitmap, s, tt, combOp);
+ break;
+ }
+ s += bw;
+ }
+ if (ri) {
+ delete symbolBitmap;
+ }
+ }
+
+ // next instance
+ ++inst;
+
+ // next S value
+ if (huff) {
+ if (!huffDecoder->decodeInt(&ds, huffDSTable)) {
+ break;
+ }
+ } else {
+ if (!arithDecoder->decodeInt(&ds, iadsStats)) {
+ break;
+ }
+ }
+ s += sOffset + ds;
+ }
+ }
+
+ return bitmap;
+}
+
+void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) {
+ JBIG2PatternDict *patternDict;
+ JBIG2Bitmap *bitmap;
+ Guint flags, patternW, patternH, grayMax, templ, mmr;
+ int atx[4], aty[4];
+ Guint i, x;
+
+ // halftone dictionary flags, pattern width and height, max gray value
+ if (!readUByte(&flags) ||
+ !readUByte(&patternW) ||
+ !readUByte(&patternH) ||
+ !readULong(&grayMax)) {
+ goto eofError;
+ }
+ templ = (flags >> 1) & 3;
+ mmr = flags & 1;
+
+ // set up the arithmetic decoder
+ if (!mmr) {
+ resetGenericStats(templ, NULL);
+ arithDecoder->start();
+ }
+
+ // read the bitmap
+ atx[0] = -(int)patternW; aty[0] = 0;
+ atx[1] = -3; aty[1] = -1;
+ atx[2] = 2; aty[2] = -2;
+ atx[3] = -2; aty[3] = -2;
+ bitmap = readGenericBitmap(mmr, (grayMax + 1) * patternW, patternH,
+ templ, gFalse, gFalse, NULL,
+ atx, aty, length - 7);
+
+ // create the pattern dict object
+ patternDict = new JBIG2PatternDict(segNum, grayMax + 1);
+
+ // split up the bitmap
+ x = 0;
+ for (i = 0; i <= grayMax; ++i) {
+ patternDict->setBitmap(i, bitmap->getSlice(x, 0, patternW, patternH));
+ x += patternW;
+ }
+
+ // free memory
+ delete bitmap;
+
+ // store the new pattern dict
+ segments->append(patternDict);
+
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
+ GBool /*lossless*/, Guint /*length*/,
+ Guint *refSegs, Guint nRefSegs) {
+ JBIG2Bitmap *bitmap;
+ JBIG2Segment *seg;
+ JBIG2PatternDict *patternDict;
+ JBIG2Bitmap *skipBitmap;
+ Guint *grayImg;
+ JBIG2Bitmap *grayBitmap;
+ JBIG2Bitmap *patternBitmap;
+ Guint w, h, x, y, segInfoFlags, extCombOp;
+ Guint flags, mmr, templ, enableSkip, combOp;
+ Guint gridW, gridH, stepX, stepY, patW, patH;
+ int atx[4], aty[4];
+ int gridX, gridY, xx, yy, bit, j;
+ Guint bpp, m, n, i;
+
+ // region segment info field
+ if (!readULong(&w) || !readULong(&h) ||
+ !readULong(&x) || !readULong(&y) ||
+ !readUByte(&segInfoFlags)) {
+ goto eofError;
+ }
+ extCombOp = segInfoFlags & 7;
+
+ // rest of the halftone region header
+ if (!readUByte(&flags)) {
+ goto eofError;
+ }
+ mmr = flags & 1;
+ templ = (flags >> 1) & 3;
+ enableSkip = (flags >> 3) & 1;
+ combOp = (flags >> 4) & 7;
+ if (!readULong(&gridW) || !readULong(&gridH) ||
+ !readLong(&gridX) || !readLong(&gridY) ||
+ !readUWord(&stepX) || !readUWord(&stepY)) {
+ goto eofError;
+ }
+ if (w == 0 || h == 0 || w >= INT_MAX / h) {
+ error(getPos(), "Bad bitmap size in JBIG2 halftone segment");
+ return;
+ }
+ if (gridH == 0 || gridW >= INT_MAX / gridH) {
+ error(getPos(), "Bad grid size in JBIG2 halftone segment");
+ return;
+ }
+
+ // get pattern dictionary
+ if (nRefSegs != 1) {
+ error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
+ return;
+ }
+ if (!(seg = findSegment(refSegs[0])) ||
+ seg->getType() != jbig2SegPatternDict) {
+ error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
+ return;
+ }
+ patternDict = (JBIG2PatternDict *)seg;
+ bpp = 0;
+ i = 1;
+ while (i < patternDict->getSize()) {
+ ++bpp;
+ i <<= 1;
+ }
+ patW = patternDict->getBitmap(0)->getWidth();
+ patH = patternDict->getBitmap(0)->getHeight();
+
+ // set up the arithmetic decoder
+ if (!mmr) {
+ resetGenericStats(templ, NULL);
+ arithDecoder->start();
+ }
+
+ // allocate the bitmap
+ bitmap = new JBIG2Bitmap(segNum, w, h);
+ if (flags & 0x80) { // HDEFPIXEL
+ bitmap->clearToOne();
+ } else {
+ bitmap->clearToZero();
+ }
+
+ // compute the skip bitmap
+ skipBitmap = NULL;
+ if (enableSkip) {
+ skipBitmap = new JBIG2Bitmap(0, gridW, gridH);
+ skipBitmap->clearToZero();
+ for (m = 0; m < gridH; ++m) {
+ for (n = 0; n < gridW; ++n) {
+ xx = gridX + m * stepY + n * stepX;
+ yy = gridY + m * stepX - n * stepY;
+ if (((xx + (int)patW) >> 8) <= 0 || (xx >> 8) >= (int)w ||
+ ((yy + (int)patH) >> 8) <= 0 || (yy >> 8) >= (int)h) {
+ skipBitmap->setPixel(n, m);
+ }
+ }
+ }
+ }
+
+ // read the gray-scale image
+ grayImg = (Guint *)gmallocn(gridW * gridH, sizeof(Guint));
+ memset(grayImg, 0, gridW * gridH * sizeof(Guint));
+ atx[0] = templ <= 1 ? 3 : 2; aty[0] = -1;
+ atx[1] = -3; aty[1] = -1;
+ atx[2] = 2; aty[2] = -2;
+ atx[3] = -2; aty[3] = -2;
+ for (j = bpp - 1; j >= 0; --j) {
+ grayBitmap = readGenericBitmap(mmr, gridW, gridH, templ, gFalse,
+ enableSkip, skipBitmap, atx, aty, -1);
+ i = 0;
+ for (m = 0; m < gridH; ++m) {
+ for (n = 0; n < gridW; ++n) {
+ bit = grayBitmap->getPixel(n, m) ^ (grayImg[i] & 1);
+ grayImg[i] = (grayImg[i] << 1) | bit;
+ ++i;
+ }
+ }
+ delete grayBitmap;
+ }
+
+ // decode the image
+ i = 0;
+ for (m = 0; m < gridH; ++m) {
+ xx = gridX + m * stepY;
+ yy = gridY + m * stepX;
+ for (n = 0; n < gridW; ++n) {
+ if (!(enableSkip && skipBitmap->getPixel(n, m))) {
+ patternBitmap = patternDict->getBitmap(grayImg[i]);
+ bitmap->combine(patternBitmap, xx >> 8, yy >> 8, combOp);
+ }
+ xx += stepX;
+ yy -= stepY;
+ ++i;
+ }
+ }
+
+ gfree(grayImg);
+ if (skipBitmap) {
+ delete skipBitmap;
+ }
+
+ // combine the region bitmap into the page bitmap
+ if (imm) {
+ if (pageH == 0xffffffff && y + h > curPageH) {
+ pageBitmap->expand(y + h, pageDefPixel);
+ }
+ pageBitmap->combine(bitmap, x, y, extCombOp);
+ delete bitmap;
+
+ // store the region bitmap
+ } else {
+ segments->append(bitmap);
+ }
+
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+void JBIG2Stream::readGenericRegionSeg(Guint segNum, GBool imm,
+ GBool /*lossless*/, Guint length) {
+ JBIG2Bitmap *bitmap;
+ Guint w, h, x, y, segInfoFlags, extCombOp;
+ Guint flags, mmr, templ, tpgdOn;
+ int atx[4], aty[4];
+
+ // region segment info field
+ if (!readULong(&w) || !readULong(&h) ||
+ !readULong(&x) || !readULong(&y) ||
+ !readUByte(&segInfoFlags)) {
+ goto eofError;
+ }
+ extCombOp = segInfoFlags & 7;
+
+ // rest of the generic region segment header
+ if (!readUByte(&flags)) {
+ goto eofError;
+ }
+ mmr = flags & 1;
+ templ = (flags >> 1) & 3;
+ tpgdOn = (flags >> 3) & 1;
+
+ // AT flags
+ if (!mmr) {
+ if (templ == 0) {
+ if (!readByte(&atx[0]) ||
+ !readByte(&aty[0]) ||
+ !readByte(&atx[1]) ||
+ !readByte(&aty[1]) ||
+ !readByte(&atx[2]) ||
+ !readByte(&aty[2]) ||
+ !readByte(&atx[3]) ||
+ !readByte(&aty[3])) {
+ goto eofError;
+ }
+ } else {
+ if (!readByte(&atx[0]) ||
+ !readByte(&aty[0])) {
+ goto eofError;
+ }
+ }
+ }
+
+ // set up the arithmetic decoder
+ if (!mmr) {
+ resetGenericStats(templ, NULL);
+ arithDecoder->start();
+ }
+
+ // read the bitmap
+ bitmap = readGenericBitmap(mmr, w, h, templ, tpgdOn, gFalse,
+ NULL, atx, aty, mmr ? length - 18 : 0);
+
+ // combine the region bitmap into the page bitmap
+ if (imm) {
+ if (pageH == 0xffffffff && y + h > curPageH) {
+ pageBitmap->expand(y + h, pageDefPixel);
+ }
+ pageBitmap->combine(bitmap, x, y, extCombOp);
+ delete bitmap;
+
+ // store the region bitmap
+ } else {
+ bitmap->setSegNum(segNum);
+ segments->append(bitmap);
+ }
+
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+inline void JBIG2Stream::mmrAddPixels(int a1, int blackPixels,
+ int *codingLine, int *a0i, int w) {
+ if (a1 > codingLine[*a0i]) {
+ if (a1 > w) {
+ error(getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1);
+ a1 = w;
+ }
+ if ((*a0i & 1) ^ blackPixels) {
+ ++*a0i;
+ }
+ codingLine[*a0i] = a1;
+ }
+}
+
+inline void JBIG2Stream::mmrAddPixelsNeg(int a1, int blackPixels,
+ int *codingLine, int *a0i, int w) {
+ if (a1 > codingLine[*a0i]) {
+ if (a1 > w) {
+ error(getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1);
+ a1 = w;
+ }
+ if ((*a0i & 1) ^ blackPixels) {
+ ++*a0i;
+ }
+ codingLine[*a0i] = a1;
+ } else if (a1 < codingLine[*a0i]) {
+ if (a1 < 0) {
+ error(getPos(), "Invalid JBIG2 MMR code");
+ a1 = 0;
+ }
+ while (*a0i > 0 && a1 <= codingLine[*a0i - 1]) {
+ --*a0i;
+ }
+ codingLine[*a0i] = a1;
+ }
+}
+
+JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h,
+ int templ, GBool tpgdOn,
+ GBool useSkip, JBIG2Bitmap *skip,
+ int *atx, int *aty,
+ int mmrDataLength) {
+ JBIG2Bitmap *bitmap;
+ GBool ltp;
+ Guint ltpCX, cx, cx0, cx1, cx2;
+ JBIG2BitmapPtr cxPtr0, cxPtr1;
+ JBIG2BitmapPtr atPtr0, atPtr1, atPtr2, atPtr3;
+ int *refLine, *codingLine;
+ int code1, code2, code3;
+ int x, y, a0i, b1i, blackPixels, pix, i;
+
+ bitmap = new JBIG2Bitmap(0, w, h);
+ bitmap->clearToZero();
+
+ //----- MMR decode
+
+ if (mmr) {
+
+ mmrDecoder->reset();
+ if (w > INT_MAX - 2) {
+ error(getPos(), "Bad width in JBIG2 generic bitmap");
+ // force a call to gmalloc(-1), which will throw an exception
+ w = -3;
+ }
+ // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w
+ // ---> max codingLine size = w + 1
+ // refLine has one extra guard entry at the end
+ // ---> max refLine size = w + 2
+ codingLine = (int *)gmallocn(w + 1, sizeof(int));
+ refLine = (int *)gmallocn(w + 2, sizeof(int));
+ codingLine[0] = w;
+
+ for (y = 0; y < h; ++y) {
+
+ // copy coding line to ref line
+ for (i = 0; codingLine[i] < w; ++i) {
+ refLine[i] = codingLine[i];
+ }
+ refLine[i++] = w;
+ refLine[i] = w;
+
+ // decode a line
+ codingLine[0] = 0;
+ a0i = 0;
+ b1i = 0;
+ blackPixels = 0;
+ // invariant:
+ // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1] <= w
+ // exception at left edge:
+ // codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
+ // exception at right edge:
+ // refLine[b1i] = refLine[b1i+1] = w is possible
+ while (codingLine[a0i] < w) {
+ code1 = mmrDecoder->get2DCode();
+ switch (code1) {
+ case twoDimPass:
+ mmrAddPixels(refLine[b1i + 1], blackPixels, codingLine, &a0i, w);
+ if (refLine[b1i + 1] < w) {
+ b1i += 2;
+ }
+ break;
+ case twoDimHoriz:
+ code1 = code2 = 0;
+ if (blackPixels) {
+ do {
+ code1 += code3 = mmrDecoder->getBlackCode();
+ } while (code3 >= 64);
+ do {
+ code2 += code3 = mmrDecoder->getWhiteCode();
+ } while (code3 >= 64);
+ } else {
+ do {
+ code1 += code3 = mmrDecoder->getWhiteCode();
+ } while (code3 >= 64);
+ do {
+ code2 += code3 = mmrDecoder->getBlackCode();
+ } while (code3 >= 64);
+ }
+ mmrAddPixels(codingLine[a0i] + code1, blackPixels,
+ codingLine, &a0i, w);
+ if (codingLine[a0i] < w) {
+ mmrAddPixels(codingLine[a0i] + code2, blackPixels ^ 1,
+ codingLine, &a0i, w);
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ break;
+ case twoDimVertR3:
+ mmrAddPixels(refLine[b1i] + 3, blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertR2:
+ mmrAddPixels(refLine[b1i] + 2, blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertR1:
+ mmrAddPixels(refLine[b1i] + 1, blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVert0:
+ mmrAddPixels(refLine[b1i], blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertL3:
+ mmrAddPixelsNeg(refLine[b1i] - 3, blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ if (b1i > 0) {
+ --b1i;
+ } else {
+ ++b1i;
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertL2:
+ mmrAddPixelsNeg(refLine[b1i] - 2, blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ if (b1i > 0) {
+ --b1i;
+ } else {
+ ++b1i;
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertL1:
+ mmrAddPixelsNeg(refLine[b1i] - 1, blackPixels, codingLine, &a0i, w);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < w) {
+ if (b1i > 0) {
+ --b1i;
+ } else {
+ ++b1i;
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < w) {
+ b1i += 2;
+ }
+ }
+ break;
+ case EOF:
+ mmrAddPixels(w, 0, codingLine, &a0i, w);
+ break;
+ default:
+ error(getPos(), "Illegal code in JBIG2 MMR bitmap data");
+ mmrAddPixels(w, 0, codingLine, &a0i, w);
+ break;
+ }
+ }
+
+ // convert the run lengths to a bitmap line
+ i = 0;
+ while (1) {
+ for (x = codingLine[i]; x < codingLine[i+1]; ++x) {
+ bitmap->setPixel(x, y);
+ }
+ if (codingLine[i+1] >= w || codingLine[i+2] >= w) {
+ break;
+ }
+ i += 2;
+ }
+ }
+
+ if (mmrDataLength >= 0) {
+ mmrDecoder->skipTo(mmrDataLength);
+ } else {
+ if (mmrDecoder->get24Bits() != 0x001001) {
+ error(getPos(), "Missing EOFB in JBIG2 MMR bitmap data");
+ }
+ }
+
+ gfree(refLine);
+ gfree(codingLine);
+
+ //----- arithmetic decode
+
+ } else {
+ // set up the typical row context
+ ltpCX = 0; // make gcc happy
+ if (tpgdOn) {
+ switch (templ) {
+ case 0:
+ ltpCX = 0x3953; // 001 11001 0101 0011
+ break;
+ case 1:
+ ltpCX = 0x079a; // 0011 11001 101 0
+ break;
+ case 2:
+ ltpCX = 0x0e3; // 001 1100 01 1
+ break;
+ case 3:
+ ltpCX = 0x18a; // 01100 0101 1
+ break;
+ }
+ }
+
+ ltp = 0;
+ cx = cx0 = cx1 = cx2 = 0; // make gcc happy
+ for (y = 0; y < h; ++y) {
+
+ // check for a "typical" (duplicate) row
+ if (tpgdOn) {
+ if (arithDecoder->decodeBit(ltpCX, genericRegionStats)) {
+ ltp = !ltp;
+ }
+ if (ltp) {
+ if (y > 0) {
+ bitmap->duplicateRow(y, y-1);
+ }
+ continue;
+ }
+ }
+
+ switch (templ) {
+ case 0:
+
+ // set up the context
+ bitmap->getPixelPtr(0, y-2, &cxPtr0);
+ cx0 = bitmap->nextPixel(&cxPtr0);
+ cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
+ bitmap->getPixelPtr(0, y-1, &cxPtr1);
+ cx1 = bitmap->nextPixel(&cxPtr1);
+ cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
+ cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
+ cx2 = 0;
+ bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
+ bitmap->getPixelPtr(atx[1], y + aty[1], &atPtr1);
+ bitmap->getPixelPtr(atx[2], y + aty[2], &atPtr2);
+ bitmap->getPixelPtr(atx[3], y + aty[3], &atPtr3);
+
+ // decode the row
+ for (x = 0; x < w; ++x) {
+
+ // build the context
+ cx = (cx0 << 13) | (cx1 << 8) | (cx2 << 4) |
+ (bitmap->nextPixel(&atPtr0) << 3) |
+ (bitmap->nextPixel(&atPtr1) << 2) |
+ (bitmap->nextPixel(&atPtr2) << 1) |
+ bitmap->nextPixel(&atPtr3);
+
+ // check for a skipped pixel
+ if (useSkip && skip->getPixel(x, y)) {
+ pix = 0;
+
+ // decode the pixel
+ } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
+ bitmap->setPixel(x, y);
+ }
+
+ // update the context
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x07;
+ cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
+ cx2 = ((cx2 << 1) | pix) & 0x0f;
+ }
+ break;
+
+ case 1:
+
+ // set up the context
+ bitmap->getPixelPtr(0, y-2, &cxPtr0);
+ cx0 = bitmap->nextPixel(&cxPtr0);
+ cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
+ cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
+ bitmap->getPixelPtr(0, y-1, &cxPtr1);
+ cx1 = bitmap->nextPixel(&cxPtr1);
+ cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
+ cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
+ cx2 = 0;
+ bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
+
+ // decode the row
+ for (x = 0; x < w; ++x) {
+
+ // build the context
+ cx = (cx0 << 9) | (cx1 << 4) | (cx2 << 1) |
+ bitmap->nextPixel(&atPtr0);
+
+ // check for a skipped pixel
+ if (useSkip && skip->getPixel(x, y)) {
+ pix = 0;
+
+ // decode the pixel
+ } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
+ bitmap->setPixel(x, y);
+ }
+
+ // update the context
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x0f;
+ cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
+ cx2 = ((cx2 << 1) | pix) & 0x07;
+ }
+ break;
+
+ case 2:
+
+ // set up the context
+ bitmap->getPixelPtr(0, y-2, &cxPtr0);
+ cx0 = bitmap->nextPixel(&cxPtr0);
+ cx0 = (cx0 << 1) | bitmap->nextPixel(&cxPtr0);
+ bitmap->getPixelPtr(0, y-1, &cxPtr1);
+ cx1 = bitmap->nextPixel(&cxPtr1);
+ cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
+ cx2 = 0;
+ bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
+
+ // decode the row
+ for (x = 0; x < w; ++x) {
+
+ // build the context
+ cx = (cx0 << 7) | (cx1 << 3) | (cx2 << 1) |
+ bitmap->nextPixel(&atPtr0);
+
+ // check for a skipped pixel
+ if (useSkip && skip->getPixel(x, y)) {
+ pix = 0;
+
+ // decode the pixel
+ } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
+ bitmap->setPixel(x, y);
+ }
+
+ // update the context
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 0x07;
+ cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x0f;
+ cx2 = ((cx2 << 1) | pix) & 0x03;
+ }
+ break;
+
+ case 3:
+
+ // set up the context
+ bitmap->getPixelPtr(0, y-1, &cxPtr1);
+ cx1 = bitmap->nextPixel(&cxPtr1);
+ cx1 = (cx1 << 1) | bitmap->nextPixel(&cxPtr1);
+ cx2 = 0;
+ bitmap->getPixelPtr(atx[0], y + aty[0], &atPtr0);
+
+ // decode the row
+ for (x = 0; x < w; ++x) {
+
+ // build the context
+ cx = (cx1 << 5) | (cx2 << 1) |
+ bitmap->nextPixel(&atPtr0);
+
+ // check for a skipped pixel
+ if (useSkip && skip->getPixel(x, y)) {
+ pix = 0;
+
+ // decode the pixel
+ } else if ((pix = arithDecoder->decodeBit(cx, genericRegionStats))) {
+ bitmap->setPixel(x, y);
+ }
+
+ // update the context
+ cx1 = ((cx1 << 1) | bitmap->nextPixel(&cxPtr1)) & 0x1f;
+ cx2 = ((cx2 << 1) | pix) & 0x0f;
+ }
+ break;
+ }
+ }
+ }
+
+ return bitmap;
+}
+
+void JBIG2Stream::readGenericRefinementRegionSeg(Guint segNum, GBool imm,
+ GBool /*lossless*/, Guint /*length*/,
+ Guint *refSegs,
+ Guint nRefSegs) {
+ JBIG2Bitmap *bitmap, *refBitmap;
+ Guint w, h, x, y, segInfoFlags, extCombOp;
+ Guint flags, templ, tpgrOn;
+ int atx[2], aty[2];
+ JBIG2Segment *seg;
+
+ // region segment info field
+ if (!readULong(&w) || !readULong(&h) ||
+ !readULong(&x) || !readULong(&y) ||
+ !readUByte(&segInfoFlags)) {
+ goto eofError;
+ }
+ extCombOp = segInfoFlags & 7;
+
+ // rest of the generic refinement region segment header
+ if (!readUByte(&flags)) {
+ goto eofError;
+ }
+ templ = flags & 1;
+ tpgrOn = (flags >> 1) & 1;
+
+ // AT flags
+ if (!templ) {
+ if (!readByte(&atx[0]) || !readByte(&aty[0]) ||
+ !readByte(&atx[1]) || !readByte(&aty[1])) {
+ goto eofError;
+ }
+ }
+
+ // resize the page bitmap if needed
+ if (nRefSegs == 0 || imm) {
+ if (pageH == 0xffffffff && y + h > curPageH) {
+ pageBitmap->expand(y + h, pageDefPixel);
+ }
+ }
+
+ // get referenced bitmap
+ if (nRefSegs > 1) {
+ error(getPos(), "Bad reference in JBIG2 generic refinement segment");
+ return;
+ }
+ if (nRefSegs == 1) {
+ if (!(seg = findSegment(refSegs[0])) ||
+ seg->getType() != jbig2SegBitmap) {
+ error(getPos(), "Bad bitmap reference in JBIG2 generic refinement segment");
+ return;
+ }
+ refBitmap = (JBIG2Bitmap *)seg;
+ } else {
+ refBitmap = pageBitmap->getSlice(x, y, w, h);
+ }
+
+ // set up the arithmetic decoder
+ resetRefinementStats(templ, NULL);
+ arithDecoder->start();
+
+ // read
+ bitmap = readGenericRefinementRegion(w, h, templ, tpgrOn,
+ refBitmap, 0, 0, atx, aty);
+
+ // combine the region bitmap into the page bitmap
+ if (imm) {
+ pageBitmap->combine(bitmap, x, y, extCombOp);
+ delete bitmap;
+
+ // store the region bitmap
+ } else {
+ bitmap->setSegNum(segNum);
+ segments->append(bitmap);
+ }
+
+ // delete the referenced bitmap
+ if (nRefSegs == 1) {
+ discardSegment(refSegs[0]);
+ } else {
+ delete refBitmap;
+ }
+
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+JBIG2Bitmap *JBIG2Stream::readGenericRefinementRegion(int w, int h,
+ int templ, GBool tpgrOn,
+ JBIG2Bitmap *refBitmap,
+ int refDX, int refDY,
+ int *atx, int *aty) {
+ JBIG2Bitmap *bitmap;
+ GBool ltp;
+ Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2;
+ JBIG2BitmapPtr cxPtr0, cxPtr1, cxPtr2, cxPtr3, cxPtr4, cxPtr5, cxPtr6;
+ JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2;
+ int x, y, pix;
+
+ bitmap = new JBIG2Bitmap(0, w, h);
+ bitmap->clearToZero();
+
+ // set up the typical row context
+ if (templ) {
+ ltpCX = 0x008;
+ } else {
+ ltpCX = 0x0010;
+ }
+
+ ltp = 0;
+ for (y = 0; y < h; ++y) {
+
+ if (templ) {
+
+ // set up the context
+ bitmap->getPixelPtr(0, y-1, &cxPtr0);
+ cx0 = bitmap->nextPixel(&cxPtr0);
+ bitmap->getPixelPtr(-1, y, &cxPtr1);
+ refBitmap->getPixelPtr(-refDX, y-1-refDY, &cxPtr2);
+ refBitmap->getPixelPtr(-1-refDX, y-refDY, &cxPtr3);
+ cx3 = refBitmap->nextPixel(&cxPtr3);
+ cx3 = (cx3 << 1) | refBitmap->nextPixel(&cxPtr3);
+ refBitmap->getPixelPtr(-refDX, y+1-refDY, &cxPtr4);
+ cx4 = refBitmap->nextPixel(&cxPtr4);
+
+ // set up the typical prediction context
+ tpgrCX0 = tpgrCX1 = tpgrCX2 = 0; // make gcc happy
+ if (tpgrOn) {
+ refBitmap->getPixelPtr(-1-refDX, y-1-refDY, &tpgrCXPtr0);
+ tpgrCX0 = refBitmap->nextPixel(&tpgrCXPtr0);
+ tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
+ tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
+ refBitmap->getPixelPtr(-1-refDX, y-refDY, &tpgrCXPtr1);
+ tpgrCX1 = refBitmap->nextPixel(&tpgrCXPtr1);
+ tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
+ tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
+ refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &tpgrCXPtr2);
+ tpgrCX2 = refBitmap->nextPixel(&tpgrCXPtr2);
+ tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
+ tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
+ } else {
+ tpgrCXPtr0.p = tpgrCXPtr1.p = tpgrCXPtr2.p = NULL; // make gcc happy
+ tpgrCXPtr0.shift = tpgrCXPtr1.shift = tpgrCXPtr2.shift = 0;
+ tpgrCXPtr0.x = tpgrCXPtr1.x = tpgrCXPtr2.x = 0;
+ }
+
+ for (x = 0; x < w; ++x) {
+
+ // update the context
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 7;
+ cx3 = ((cx3 << 1) | refBitmap->nextPixel(&cxPtr3)) & 7;
+ cx4 = ((cx4 << 1) | refBitmap->nextPixel(&cxPtr4)) & 3;
+
+ if (tpgrOn) {
+ // update the typical predictor context
+ tpgrCX0 = ((tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0)) & 7;
+ tpgrCX1 = ((tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1)) & 7;
+ tpgrCX2 = ((tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2)) & 7;
+
+ // check for a "typical" pixel
+ if (arithDecoder->decodeBit(ltpCX, refinementRegionStats)) {
+ ltp = !ltp;
+ }
+ if (tpgrCX0 == 0 && tpgrCX1 == 0 && tpgrCX2 == 0) {
+ bitmap->clearPixel(x, y);
+ continue;
+ } else if (tpgrCX0 == 7 && tpgrCX1 == 7 && tpgrCX2 == 7) {
+ bitmap->setPixel(x, y);
+ continue;
+ }
+ }
+
+ // build the context
+ cx = (cx0 << 7) | (bitmap->nextPixel(&cxPtr1) << 6) |
+ (refBitmap->nextPixel(&cxPtr2) << 5) |
+ (cx3 << 2) | cx4;
+
+ // decode the pixel
+ if ((pix = arithDecoder->decodeBit(cx, refinementRegionStats))) {
+ bitmap->setPixel(x, y);
+ }
+ }
+
+ } else {
+
+ // set up the context
+ bitmap->getPixelPtr(0, y-1, &cxPtr0);
+ cx0 = bitmap->nextPixel(&cxPtr0);
+ bitmap->getPixelPtr(-1, y, &cxPtr1);
+ refBitmap->getPixelPtr(-refDX, y-1-refDY, &cxPtr2);
+ cx2 = refBitmap->nextPixel(&cxPtr2);
+ refBitmap->getPixelPtr(-1-refDX, y-refDY, &cxPtr3);
+ cx3 = refBitmap->nextPixel(&cxPtr3);
+ cx3 = (cx3 << 1) | refBitmap->nextPixel(&cxPtr3);
+ refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &cxPtr4);
+ cx4 = refBitmap->nextPixel(&cxPtr4);
+ cx4 = (cx4 << 1) | refBitmap->nextPixel(&cxPtr4);
+ bitmap->getPixelPtr(atx[0], y+aty[0], &cxPtr5);
+ refBitmap->getPixelPtr(atx[1]-refDX, y+aty[1]-refDY, &cxPtr6);
+
+ // set up the typical prediction context
+ tpgrCX0 = tpgrCX1 = tpgrCX2 = 0; // make gcc happy
+ if (tpgrOn) {
+ refBitmap->getPixelPtr(-1-refDX, y-1-refDY, &tpgrCXPtr0);
+ tpgrCX0 = refBitmap->nextPixel(&tpgrCXPtr0);
+ tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
+ tpgrCX0 = (tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0);
+ refBitmap->getPixelPtr(-1-refDX, y-refDY, &tpgrCXPtr1);
+ tpgrCX1 = refBitmap->nextPixel(&tpgrCXPtr1);
+ tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
+ tpgrCX1 = (tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1);
+ refBitmap->getPixelPtr(-1-refDX, y+1-refDY, &tpgrCXPtr2);
+ tpgrCX2 = refBitmap->nextPixel(&tpgrCXPtr2);
+ tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
+ tpgrCX2 = (tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2);
+ } else {
+ tpgrCXPtr0.p = tpgrCXPtr1.p = tpgrCXPtr2.p = NULL; // make gcc happy
+ tpgrCXPtr0.shift = tpgrCXPtr1.shift = tpgrCXPtr2.shift = 0;
+ tpgrCXPtr0.x = tpgrCXPtr1.x = tpgrCXPtr2.x = 0;
+ }
+
+ for (x = 0; x < w; ++x) {
+
+ // update the context
+ cx0 = ((cx0 << 1) | bitmap->nextPixel(&cxPtr0)) & 3;
+ cx2 = ((cx2 << 1) | refBitmap->nextPixel(&cxPtr2)) & 3;
+ cx3 = ((cx3 << 1) | refBitmap->nextPixel(&cxPtr3)) & 7;
+ cx4 = ((cx4 << 1) | refBitmap->nextPixel(&cxPtr4)) & 7;
+
+ if (tpgrOn) {
+ // update the typical predictor context
+ tpgrCX0 = ((tpgrCX0 << 1) | refBitmap->nextPixel(&tpgrCXPtr0)) & 7;
+ tpgrCX1 = ((tpgrCX1 << 1) | refBitmap->nextPixel(&tpgrCXPtr1)) & 7;
+ tpgrCX2 = ((tpgrCX2 << 1) | refBitmap->nextPixel(&tpgrCXPtr2)) & 7;
+
+ // check for a "typical" pixel
+ if (arithDecoder->decodeBit(ltpCX, refinementRegionStats)) {
+ ltp = !ltp;
+ }
+ if (tpgrCX0 == 0 && tpgrCX1 == 0 && tpgrCX2 == 0) {
+ bitmap->clearPixel(x, y);
+ continue;
+ } else if (tpgrCX0 == 7 && tpgrCX1 == 7 && tpgrCX2 == 7) {
+ bitmap->setPixel(x, y);
+ continue;
+ }
+ }
+
+ // build the context
+ cx = (cx0 << 11) | (bitmap->nextPixel(&cxPtr1) << 10) |
+ (cx2 << 8) | (cx3 << 5) | (cx4 << 2) |
+ (bitmap->nextPixel(&cxPtr5) << 1) |
+ refBitmap->nextPixel(&cxPtr6);
+
+ // decode the pixel
+ if ((pix = arithDecoder->decodeBit(cx, refinementRegionStats))) {
+ bitmap->setPixel(x, y);
+ }
+ }
+ }
+ }
+
+ return bitmap;
+}
+
+void JBIG2Stream::readPageInfoSeg(Guint /*length*/) {
+ Guint xRes, yRes, flags, striping;
+
+ if (!readULong(&pageW) || !readULong(&pageH) ||
+ !readULong(&xRes) || !readULong(&yRes) ||
+ !readUByte(&flags) || !readUWord(&striping)) {
+ goto eofError;
+ }
+ pageDefPixel = (flags >> 2) & 1;
+ defCombOp = (flags >> 3) & 3;
+
+ // allocate the page bitmap
+ if (pageH == 0xffffffff) {
+ curPageH = striping & 0x7fff;
+ } else {
+ curPageH = pageH;
+ }
+ pageBitmap = new JBIG2Bitmap(0, pageW, curPageH);
+
+ // default pixel value
+ if (pageDefPixel) {
+ pageBitmap->clearToOne();
+ } else {
+ pageBitmap->clearToZero();
+ }
+
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+void JBIG2Stream::readEndOfStripeSeg(Guint length) {
+ Guint i;
+
+ // skip the segment
+ for (i = 0; i < length; ++i) {
+ curStr->getChar();
+ }
+}
+
+void JBIG2Stream::readProfilesSeg(Guint length) {
+ Guint i;
+
+ // skip the segment
+ for (i = 0; i < length; ++i) {
+ curStr->getChar();
+ }
+}
+
+void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint /*length*/) {
+ JBIG2HuffmanTable *huffTab;
+ Guint flags, oob, prefixBits, rangeBits;
+ int lowVal, highVal, val;
+ Guint huffTabSize, i;
+
+ if (!readUByte(&flags) || !readLong(&lowVal) || !readLong(&highVal)) {
+ goto eofError;
+ }
+ oob = flags & 1;
+ prefixBits = ((flags >> 1) & 7) + 1;
+ rangeBits = ((flags >> 4) & 7) + 1;
+
+ huffDecoder->reset();
+ huffTabSize = 8;
+ huffTab = (JBIG2HuffmanTable *)
+ gmallocn(huffTabSize, sizeof(JBIG2HuffmanTable));
+ i = 0;
+ val = lowVal;
+ while (val < highVal) {
+ if (i == huffTabSize) {
+ huffTabSize *= 2;
+ huffTab = (JBIG2HuffmanTable *)
+ greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable));
+ }
+ huffTab[i].val = val;
+ huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
+ huffTab[i].rangeLen = huffDecoder->readBits(rangeBits);
+ val += 1 << huffTab[i].rangeLen;
+ ++i;
+ }
+ if (i + oob + 3 > huffTabSize) {
+ huffTabSize = i + oob + 3;
+ huffTab = (JBIG2HuffmanTable *)
+ greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable));
+ }
+ huffTab[i].val = lowVal - 1;
+ huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
+ huffTab[i].rangeLen = jbig2HuffmanLOW;
+ ++i;
+ huffTab[i].val = highVal;
+ huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
+ huffTab[i].rangeLen = 32;
+ ++i;
+ if (oob) {
+ huffTab[i].val = 0;
+ huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
+ huffTab[i].rangeLen = jbig2HuffmanOOB;
+ ++i;
+ }
+ huffTab[i].val = 0;
+ huffTab[i].prefixLen = 0;
+ huffTab[i].rangeLen = jbig2HuffmanEOT;
+ huffDecoder->buildTable(huffTab, i);
+
+ // create and store the new table segment
+ segments->append(new JBIG2CodeTable(segNum, huffTab));
+
+ return;
+
+ eofError:
+ error(getPos(), "Unexpected EOF in JBIG2 stream");
+}
+
+void JBIG2Stream::readExtensionSeg(Guint length) {
+ Guint i;
+
+ // skip the segment
+ for (i = 0; i < length; ++i) {
+ curStr->getChar();
+ }
+}
+
+JBIG2Segment *JBIG2Stream::findSegment(Guint segNum) {
+ JBIG2Segment *seg;
+ int i;
+
+ for (i = 0; i < globalSegments->getLength(); ++i) {
+ seg = (JBIG2Segment *)globalSegments->get(i);
+ if (seg->getSegNum() == segNum) {
+ return seg;
+ }
+ }
+ for (i = 0; i < segments->getLength(); ++i) {
+ seg = (JBIG2Segment *)segments->get(i);
+ if (seg->getSegNum() == segNum) {
+ return seg;
+ }
+ }
+ return NULL;
+}
+
+void JBIG2Stream::discardSegment(Guint segNum) {
+ JBIG2Segment *seg;
+ int i;
+
+ for (i = 0; i < globalSegments->getLength(); ++i) {
+ seg = (JBIG2Segment *)globalSegments->get(i);
+ if (seg->getSegNum() == segNum) {
+ globalSegments->del(i);
+ return;
+ }
+ }
+ for (i = 0; i < segments->getLength(); ++i) {
+ seg = (JBIG2Segment *)segments->get(i);
+ if (seg->getSegNum() == segNum) {
+ segments->del(i);
+ return;
+ }
+ }
+}
+
+void JBIG2Stream::resetGenericStats(Guint templ,
+ JArithmeticDecoderStats *prevStats) {
+ int size;
+
+ size = contextSize[templ];
+ if (prevStats && prevStats->getContextSize() == size) {
+ if (genericRegionStats->getContextSize() == size) {
+ genericRegionStats->copyFrom(prevStats);
+ } else {
+ delete genericRegionStats;
+ genericRegionStats = prevStats->copy();
+ }
+ } else {
+ if (genericRegionStats->getContextSize() == size) {
+ genericRegionStats->reset();
+ } else {
+ delete genericRegionStats;
+ genericRegionStats = new JArithmeticDecoderStats(1 << size);
+ }
+ }
+}
+
+void JBIG2Stream::resetRefinementStats(Guint templ,
+ JArithmeticDecoderStats *prevStats) {
+ int size;
+
+ size = refContextSize[templ];
+ if (prevStats && prevStats->getContextSize() == size) {
+ if (refinementRegionStats->getContextSize() == size) {
+ refinementRegionStats->copyFrom(prevStats);
+ } else {
+ delete refinementRegionStats;
+ refinementRegionStats = prevStats->copy();
+ }
+ } else {
+ if (refinementRegionStats->getContextSize() == size) {
+ refinementRegionStats->reset();
+ } else {
+ delete refinementRegionStats;
+ refinementRegionStats = new JArithmeticDecoderStats(1 << size);
+ }
+ }
+}
+
+void JBIG2Stream::resetIntStats(int symCodeLen) {
+ iadhStats->reset();
+ iadwStats->reset();
+ iaexStats->reset();
+ iaaiStats->reset();
+ iadtStats->reset();
+ iaitStats->reset();
+ iafsStats->reset();
+ iadsStats->reset();
+ iardxStats->reset();
+ iardyStats->reset();
+ iardwStats->reset();
+ iardhStats->reset();
+ iariStats->reset();
+ if (iaidStats->getContextSize() == 1 << (symCodeLen + 1)) {
+ iaidStats->reset();
+ } else {
+ delete iaidStats;
+ iaidStats = new JArithmeticDecoderStats(1 << (symCodeLen + 1));
+ }
+}
+
+GBool JBIG2Stream::readUByte(Guint *x) {
+ int c0;
+
+ if ((c0 = curStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = (Guint)c0;
+ return gTrue;
+}
+
+GBool JBIG2Stream::readByte(int *x) {
+ int c0;
+
+ if ((c0 = curStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = c0;
+ if (c0 & 0x80) {
+ *x |= -1 - 0xff;
+ }
+ return gTrue;
+}
+
+GBool JBIG2Stream::readUWord(Guint *x) {
+ int c0, c1;
+
+ if ((c0 = curStr->getChar()) == EOF ||
+ (c1 = curStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = (Guint)((c0 << 8) | c1);
+ return gTrue;
+}
+
+GBool JBIG2Stream::readULong(Guint *x) {
+ int c0, c1, c2, c3;
+
+ if ((c0 = curStr->getChar()) == EOF ||
+ (c1 = curStr->getChar()) == EOF ||
+ (c2 = curStr->getChar()) == EOF ||
+ (c3 = curStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
+ return gTrue;
+}
+
+GBool JBIG2Stream::readLong(int *x) {
+ int c0, c1, c2, c3;
+
+ if ((c0 = curStr->getChar()) == EOF ||
+ (c1 = curStr->getChar()) == EOF ||
+ (c2 = curStr->getChar()) == EOF ||
+ (c3 = curStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
+ if (c0 & 0x80) {
+ *x |= -1 - (int)0xffffffff;
+ }
+ return gTrue;
+}
diff --git a/kpdf/xpdf/xpdf/JPXStream.cc b/kpdf/xpdf/xpdf/JPXStream.cc
deleted file mode 100644
index 54a9e103..00000000
--- a/kpdf/xpdf/xpdf/JPXStream.cc
+++ /dev/null
@@ -1,3144 +0,0 @@
-//========================================================================
-//
-// JPXStream.cc
-//
-// Copyright 2002-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <limits.h>
-#include "gmem.h"
-#include "Error.h"
-#include "JArithmeticDecoder.h"
-#include "JPXStream.h"
-
-//~ to do:
-// - precincts
-// - ROI
-// - progression order changes
-// - packed packet headers
-// - support for palettes, channel maps, etc.
-// - make sure all needed JP2/JPX subboxes are parsed (readBoxes)
-// - can we assume that QCC segments must come after the QCD segment?
-// - skip EPH markers (readTilePartData)
-// - handle tilePartToEOC in readTilePartData
-// - deal with multiple codeword segments (readTilePartData,
-// readCodeBlockData)
-// - progression orders 2, 3, and 4
-// - in coefficient decoding (readCodeBlockData):
-// - termination pattern: terminate after every coding pass
-// - error resilience segmentation symbol
-// - selective arithmetic coding bypass
-// - vertically causal context formation
-// - coeffs longer than 31 bits (should just ignore the extra bits?)
-// - handle boxes larger than 2^32 bytes
-// - the fixed-point arithmetic won't handle 16-bit pixels
-
-//------------------------------------------------------------------------
-
-// number of contexts for the arithmetic decoder
-#define jpxNContexts 19
-
-#define jpxContextSigProp 0 // 0 - 8: significance prop and cleanup
-#define jpxContextSign 9 // 9 - 13: sign
-#define jpxContextMagRef 14 // 14 -16: magnitude refinement
-#define jpxContextRunLength 17 // cleanup: run length
-#define jpxContextUniform 18 // cleanup: first signif coeff
-
-//------------------------------------------------------------------------
-
-#define jpxPassSigProp 0
-#define jpxPassMagRef 1
-#define jpxPassCleanup 2
-
-//------------------------------------------------------------------------
-
-// arithmetic decoder context for the significance propagation and
-// cleanup passes:
-// [horiz][vert][diag][subband]
-// where subband = 0 for HL
-// = 1 for LH and LL
-// = 2 for HH
-static Guint sigPropContext[3][3][5][3] = {
- {{{ 0, 0, 0 }, // horiz=0, vert=0, diag=0
- { 1, 1, 3 }, // horiz=0, vert=0, diag=1
- { 2, 2, 6 }, // horiz=0, vert=0, diag=2
- { 2, 2, 8 }, // horiz=0, vert=0, diag=3
- { 2, 2, 8 }}, // horiz=0, vert=0, diag=4
- {{ 5, 3, 1 }, // horiz=0, vert=1, diag=0
- { 6, 3, 4 }, // horiz=0, vert=1, diag=1
- { 6, 3, 7 }, // horiz=0, vert=1, diag=2
- { 6, 3, 8 }, // horiz=0, vert=1, diag=3
- { 6, 3, 8 }}, // horiz=0, vert=1, diag=4
- {{ 8, 4, 2 }, // horiz=0, vert=2, diag=0
- { 8, 4, 5 }, // horiz=0, vert=2, diag=1
- { 8, 4, 7 }, // horiz=0, vert=2, diag=2
- { 8, 4, 8 }, // horiz=0, vert=2, diag=3
- { 8, 4, 8 }}}, // horiz=0, vert=2, diag=4
- {{{ 3, 5, 1 }, // horiz=1, vert=0, diag=0
- { 3, 6, 4 }, // horiz=1, vert=0, diag=1
- { 3, 6, 7 }, // horiz=1, vert=0, diag=2
- { 3, 6, 8 }, // horiz=1, vert=0, diag=3
- { 3, 6, 8 }}, // horiz=1, vert=0, diag=4
- {{ 7, 7, 2 }, // horiz=1, vert=1, diag=0
- { 7, 7, 5 }, // horiz=1, vert=1, diag=1
- { 7, 7, 7 }, // horiz=1, vert=1, diag=2
- { 7, 7, 8 }, // horiz=1, vert=1, diag=3
- { 7, 7, 8 }}, // horiz=1, vert=1, diag=4
- {{ 8, 7, 2 }, // horiz=1, vert=2, diag=0
- { 8, 7, 5 }, // horiz=1, vert=2, diag=1
- { 8, 7, 7 }, // horiz=1, vert=2, diag=2
- { 8, 7, 8 }, // horiz=1, vert=2, diag=3
- { 8, 7, 8 }}}, // horiz=1, vert=2, diag=4
- {{{ 4, 8, 2 }, // horiz=2, vert=0, diag=0
- { 4, 8, 5 }, // horiz=2, vert=0, diag=1
- { 4, 8, 7 }, // horiz=2, vert=0, diag=2
- { 4, 8, 8 }, // horiz=2, vert=0, diag=3
- { 4, 8, 8 }}, // horiz=2, vert=0, diag=4
- {{ 7, 8, 2 }, // horiz=2, vert=1, diag=0
- { 7, 8, 5 }, // horiz=2, vert=1, diag=1
- { 7, 8, 7 }, // horiz=2, vert=1, diag=2
- { 7, 8, 8 }, // horiz=2, vert=1, diag=3
- { 7, 8, 8 }}, // horiz=2, vert=1, diag=4
- {{ 8, 8, 2 }, // horiz=2, vert=2, diag=0
- { 8, 8, 5 }, // horiz=2, vert=2, diag=1
- { 8, 8, 7 }, // horiz=2, vert=2, diag=2
- { 8, 8, 8 }, // horiz=2, vert=2, diag=3
- { 8, 8, 8 }}} // horiz=2, vert=2, diag=4
-};
-
-// arithmetic decoder context and xor bit for the sign bit in the
-// significance propagation pass:
-// [horiz][vert][k]
-// where horiz/vert are offset by 2 (i.e., range is -2 .. 2)
-// and k = 0 for the context
-// = 1 for the xor bit
-static Guint signContext[5][5][2] = {
- {{ 13, 1 }, // horiz=-2, vert=-2
- { 13, 1 }, // horiz=-2, vert=-1
- { 12, 1 }, // horiz=-2, vert= 0
- { 11, 1 }, // horiz=-2, vert=+1
- { 11, 1 }}, // horiz=-2, vert=+2
- {{ 13, 1 }, // horiz=-1, vert=-2
- { 13, 1 }, // horiz=-1, vert=-1
- { 12, 1 }, // horiz=-1, vert= 0
- { 11, 1 }, // horiz=-1, vert=+1
- { 11, 1 }}, // horiz=-1, vert=+2
- {{ 10, 1 }, // horiz= 0, vert=-2
- { 10, 1 }, // horiz= 0, vert=-1
- { 9, 0 }, // horiz= 0, vert= 0
- { 10, 0 }, // horiz= 0, vert=+1
- { 10, 0 }}, // horiz= 0, vert=+2
- {{ 11, 0 }, // horiz=+1, vert=-2
- { 11, 0 }, // horiz=+1, vert=-1
- { 12, 0 }, // horiz=+1, vert= 0
- { 13, 0 }, // horiz=+1, vert=+1
- { 13, 0 }}, // horiz=+1, vert=+2
- {{ 11, 0 }, // horiz=+2, vert=-2
- { 11, 0 }, // horiz=+2, vert=-1
- { 12, 0 }, // horiz=+2, vert= 0
- { 13, 0 }, // horiz=+2, vert=+1
- { 13, 0 }}, // horiz=+2, vert=+2
-};
-
-//------------------------------------------------------------------------
-
-// constants used in the IDWT
-#define idwtAlpha -1.586134342059924
-#define idwtBeta -0.052980118572961
-#define idwtGamma 0.882911075530934
-#define idwtDelta 0.443506852043971
-#define idwtKappa 1.230174104914001
-#define idwtIKappa (1.0 / idwtKappa)
-
-// number of bits to the right of the decimal point for the fixed
-// point arithmetic used in the IDWT
-#define fracBits 16
-
-//------------------------------------------------------------------------
-
-// floor(x / y)
-#define jpxFloorDiv(x, y) ((x) / (y))
-
-// floor(x / 2^y)
-#define jpxFloorDivPow2(x, y) ((x) >> (y))
-
-// ceil(x / y)
-#define jpxCeilDiv(x, y) (((x) + (y) - 1) / (y))
-
-// ceil(x / 2^y)
-#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
-
-//------------------------------------------------------------------------
-
-#if 1 //----- disable coverage tracking
-
-#define cover(idx)
-
-#else //----- enable coverage tracking
-
-class JPXCover {
-public:
-
- JPXCover(int sizeA);
- ~JPXCover();
- void incr(int idx);
-
-private:
-
- int size, used;
- int *data;
-};
-
-JPXCover::JPXCover(int sizeA) {
- size = sizeA;
- used = -1;
- data = (int *)gmallocn(size, sizeof(int));
- memset(data, 0, size * sizeof(int));
-}
-
-JPXCover::~JPXCover() {
- int i;
-
- printf("JPX coverage:\n");
- for (i = 0; i <= used; ++i) {
- printf(" %4d: %8d\n", i, data[i]);
- }
- gfree(data);
-}
-
-void JPXCover::incr(int idx) {
- if (idx < size) {
- ++data[idx];
- if (idx > used) {
- used = idx;
- }
- }
-}
-
-JPXCover jpxCover(150);
-
-#define cover(idx) jpxCover.incr(idx)
-
-#endif //----- coverage tracking
-
-//------------------------------------------------------------------------
-
-JPXStream::JPXStream(Stream *strA):
- FilterStream(strA)
-{
- nComps = 0;
- bpc = NULL;
- width = height = 0;
- haveCS = gFalse;
- havePalette = gFalse;
- haveCompMap = gFalse;
- haveChannelDefn = gFalse;
-
- img.tiles = NULL;
- bitBuf = 0;
- bitBufLen = 0;
- bitBufSkip = gFalse;
- byteCount = 0;
-}
-
-JPXStream::~JPXStream() {
- close();
- delete str;
-}
-
-void JPXStream::reset() {
- str->reset();
- if (readBoxes()) {
- curY = img.yOffset;
- } else {
- // readBoxes reported an error, so we go immediately to EOF
- curY = img.ySize;
- }
- curX = img.xOffset;
- curComp = 0;
- readBufLen = 0;
-}
-
-void JPXStream::close() {
- JPXTile *tile;
- JPXTileComp *tileComp;
- JPXResLevel *resLevel;
- JPXPrecinct *precinct;
- JPXSubband *subband;
- JPXCodeBlock *cb;
- Guint comp, i, k, r, pre, sb;
-
- gfree(bpc);
- bpc = NULL;
- if (havePalette) {
- gfree(palette.bpc);
- gfree(palette.c);
- havePalette = gFalse;
- }
- if (haveCompMap) {
- gfree(compMap.comp);
- gfree(compMap.type);
- gfree(compMap.pComp);
- haveCompMap = gFalse;
- }
- if (haveChannelDefn) {
- gfree(channelDefn.idx);
- gfree(channelDefn.type);
- gfree(channelDefn.assoc);
- haveChannelDefn = gFalse;
- }
-
- if (img.tiles) {
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- tile = &img.tiles[i];
- if (tile->tileComps) {
- for (comp = 0; comp < img.nComps; ++comp) {
- tileComp = &tile->tileComps[comp];
- gfree(tileComp->quantSteps);
- gfree(tileComp->data);
- gfree(tileComp->buf);
- if (tileComp->resLevels) {
- for (r = 0; r <= tileComp->nDecompLevels; ++r) {
- resLevel = &tileComp->resLevels[r];
- if (resLevel->precincts) {
- for (pre = 0; pre < 1; ++pre) {
- precinct = &resLevel->precincts[pre];
- if (precinct->subbands) {
- for (sb = 0; sb < (Guint)(r == 0 ? 1 : 3); ++sb) {
- subband = &precinct->subbands[sb];
- gfree(subband->inclusion);
- gfree(subband->zeroBitPlane);
- if (subband->cbs) {
- for (k = 0; k < subband->nXCBs * subband->nYCBs; ++k) {
- cb = &subband->cbs[k];
- gfree(cb->coeffs);
- if (cb->arithDecoder) {
- delete cb->arithDecoder;
- }
- if (cb->stats) {
- delete cb->stats;
- }
- }
- gfree(subband->cbs);
- }
- }
- gfree(precinct->subbands);
- }
- }
- gfree(img.tiles[i].tileComps[comp].resLevels[r].precincts);
- }
- }
- gfree(img.tiles[i].tileComps[comp].resLevels);
- }
- }
- gfree(img.tiles[i].tileComps);
- }
- }
- gfree(img.tiles);
- img.tiles = NULL;
- }
- FilterStream::close();
-}
-
-int JPXStream::getChar() {
- int c;
-
- if (readBufLen < 8) {
- fillReadBuf();
- }
- if (readBufLen == 8) {
- c = readBuf & 0xff;
- readBufLen = 0;
- } else if (readBufLen > 8) {
- c = (readBuf >> (readBufLen - 8)) & 0xff;
- readBufLen -= 8;
- } else if (readBufLen == 0) {
- c = EOF;
- } else {
- c = (readBuf << (8 - readBufLen)) & 0xff;
- readBufLen = 0;
- }
- return c;
-}
-
-int JPXStream::lookChar() {
- int c;
-
- if (readBufLen < 8) {
- fillReadBuf();
- }
- if (readBufLen == 8) {
- c = readBuf & 0xff;
- } else if (readBufLen > 8) {
- c = (readBuf >> (readBufLen - 8)) & 0xff;
- } else if (readBufLen == 0) {
- c = EOF;
- } else {
- c = (readBuf << (8 - readBufLen)) & 0xff;
- }
- return c;
-}
-
-void JPXStream::fillReadBuf() {
- JPXTileComp *tileComp;
- Guint tileIdx, tx, ty;
- int pix, pixBits;
-
- do {
- if (curY >= img.ySize) {
- return;
- }
- tileIdx = ((curY - img.yTileOffset) / img.yTileSize) * img.nXTiles
- + (curX - img.xTileOffset) / img.xTileSize;
-#if 1 //~ ignore the palette, assume the PDF ColorSpace object is valid
- tileComp = &img.tiles[tileIdx].tileComps[curComp];
-#else
- tileComp = &img.tiles[tileIdx].tileComps[havePalette ? 0 : curComp];
-#endif
- tx = jpxCeilDiv((curX - img.xTileOffset) % img.xTileSize, tileComp->hSep);
- ty = jpxCeilDiv((curY - img.yTileOffset) % img.yTileSize, tileComp->vSep);
- pix = (int)tileComp->data[ty * (tileComp->x1 - tileComp->x0) + tx];
- pixBits = tileComp->prec;
-#if 1 //~ ignore the palette, assume the PDF ColorSpace object is valid
- if (++curComp == img.nComps) {
-#else
- if (havePalette) {
- if (pix >= 0 && pix < palette.nEntries) {
- pix = palette.c[pix * palette.nComps + curComp];
- } else {
- pix =
- pixBits = palette.bpc[curComp];
- }
- if (++curComp == (Guint)(havePalette ? palette.nComps : img.nComps)) {
-#endif
- curComp = 0;
- if (++curX == img.xSize) {
- curX = img.xOffset;
- ++curY;
- }
- }
- if (pixBits == 8) {
- readBuf = (readBuf << 8) | (pix & 0xff);
- } else {
- readBuf = (readBuf << pixBits) | (pix & ((1 << pixBits) - 1));
- }
- readBufLen += pixBits;
- } while (readBufLen < 8);
-}
-
-GString *JPXStream::getPSFilter(int /*psLevel*/, char * /*indent*/) {
- return NULL;
-}
-
-GBool JPXStream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-void JPXStream::getImageParams(int *bitsPerComponent,
- StreamColorSpaceMode *csMode) {
- Guint boxType, boxLen, dataLen, csEnum;
- Guint bpc1, dummy, i;
- int csMeth, csPrec, csPrec1, dummy2;
- StreamColorSpaceMode csMode1;
- GBool haveBPC, haveCSMode;
-
- csPrec = 0; // make gcc happy
- haveBPC = haveCSMode = gFalse;
- str->reset();
- if (str->lookChar() == 0xff) {
- getImageParams2(bitsPerComponent, csMode);
- } else {
- while (readBoxHdr(&boxType, &boxLen, &dataLen)) {
- if (boxType == 0x6a703268) { // JP2 header
- cover(0);
- // skip the superbox
- } else if (boxType == 0x69686472) { // image header
- cover(1);
- if (readULong(&dummy) &&
- readULong(&dummy) &&
- readUWord(&dummy) &&
- readUByte(&bpc1) &&
- readUByte(&dummy) &&
- readUByte(&dummy) &&
- readUByte(&dummy)) {
- *bitsPerComponent = bpc1 + 1;
- haveBPC = gTrue;
- }
- } else if (boxType == 0x636F6C72) { // color specification
- cover(2);
- if (readByte(&csMeth) &&
- readByte(&csPrec1) &&
- readByte(&dummy2)) {
- if (csMeth == 1) {
- if (readULong(&csEnum)) {
- csMode1 = streamCSNone;
- if (csEnum == jpxCSBiLevel ||
- csEnum == jpxCSGrayscale) {
- csMode1 = streamCSDeviceGray;
- } else if (csEnum == jpxCSCMYK) {
- csMode1 = streamCSDeviceCMYK;
- } else if (csEnum == jpxCSsRGB ||
- csEnum == jpxCSCISesRGB ||
- csEnum == jpxCSROMMRGB) {
- csMode1 = streamCSDeviceRGB;
- }
- if (csMode1 != streamCSNone &&
- (!haveCSMode || csPrec1 > csPrec)) {
- *csMode = csMode1;
- csPrec = csPrec1;
- haveCSMode = gTrue;
- }
- for (i = 0; i < dataLen - 7; ++i) {
- str->getChar();
- }
- }
- } else {
- for (i = 0; i < dataLen - 3; ++i) {
- str->getChar();
- }
- }
- }
- } else if (boxType == 0x6A703263) { // codestream
- cover(3);
- if (!(haveBPC && haveCSMode)) {
- getImageParams2(bitsPerComponent, csMode);
- }
- break;
- } else {
- cover(4);
- for (i = 0; i < dataLen; ++i) {
- str->getChar();
- }
- }
- }
- }
- str->close();
-}
-
-// Get image parameters from the codestream.
-void JPXStream::getImageParams2(int *bitsPerComponent,
- StreamColorSpaceMode *csMode) {
- int segType;
- Guint segLen, nComps1, bpc1, dummy, i;
-
- while (readMarkerHdr(&segType, &segLen)) {
- if (segType == 0x51) { // SIZ - image and tile size
- cover(5);
- if (readUWord(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readULong(&dummy) &&
- readUWord(&nComps1) &&
- readUByte(&bpc1)) {
- *bitsPerComponent = (bpc1 & 0x7f) + 1;
- // if there's no color space info, take a guess
- if (nComps1 == 1) {
- *csMode = streamCSDeviceGray;
- } else if (nComps1 == 3) {
- *csMode = streamCSDeviceRGB;
- } else if (nComps1 == 4) {
- *csMode = streamCSDeviceCMYK;
- }
- }
- break;
- } else {
- cover(6);
- if (segLen > 2) {
- for (i = 0; i < segLen - 2; ++i) {
- str->getChar();
- }
- }
- }
- }
-}
-
-GBool JPXStream::readBoxes() {
- Guint boxType, boxLen, dataLen;
- Guint bpc1, compression, unknownColorspace, ipr;
- Guint i, j;
-
- haveImgHdr = gFalse;
-
- // check for a naked JPEG 2000 codestream (without the JP2/JPX
- // wrapper) -- this appears to be a violation of the PDF spec, but
- // Acrobat allows it
- if (str->lookChar() == 0xff) {
- cover(7);
- error(getPos(), "Naked JPEG 2000 codestream, missing JP2/JPX wrapper");
- readCodestream(0);
- nComps = img.nComps;
- bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
- for (i = 0; i < nComps; ++i) {
- bpc[i] = img.tiles[0].tileComps[i].prec;
- }
- width = img.xSize - img.xOffset;
- height = img.ySize - img.yOffset;
- return gTrue;
- }
-
- while (readBoxHdr(&boxType, &boxLen, &dataLen)) {
- switch (boxType) {
- case 0x6a703268: // JP2 header
- // this is a grouping box ('superbox') which has no real
- // contents and doesn't appear to be used consistently, i.e.,
- // some things which should be subboxes of the JP2 header box
- // show up outside of it - so we simply ignore the JP2 header
- // box
- cover(8);
- break;
- case 0x69686472: // image header
- cover(9);
- if (!readULong(&height) ||
- !readULong(&width) ||
- !readUWord(&nComps) ||
- !readUByte(&bpc1) ||
- !readUByte(&compression) ||
- !readUByte(&unknownColorspace) ||
- !readUByte(&ipr)) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- if (compression != 7) {
- error(getPos(), "Unknown compression type in JPX stream");
- return gFalse;
- }
- bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
- for (i = 0; i < nComps; ++i) {
- bpc[i] = bpc1;
- }
- haveImgHdr = gTrue;
- break;
- case 0x62706363: // bits per component
- cover(10);
- if (!haveImgHdr) {
- error(getPos(), "Found bits per component box before image header box in JPX stream");
- return gFalse;
- }
- if (dataLen != nComps) {
- error(getPos(), "Invalid bits per component box in JPX stream");
- return gFalse;
- }
- for (i = 0; i < nComps; ++i) {
- if (!readUByte(&bpc[i])) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- }
- break;
- case 0x636F6C72: // color specification
- cover(11);
- if (!readColorSpecBox(dataLen)) {
- return gFalse;
- }
- break;
- case 0x70636c72: // palette
- cover(12);
- if (!readUWord(&palette.nEntries) ||
- !readUByte(&palette.nComps)) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- palette.bpc = (Guint *)gmallocn(palette.nComps, sizeof(Guint));
- palette.c =
- (int *)gmallocn(palette.nEntries * palette.nComps, sizeof(int));
- for (i = 0; i < palette.nComps; ++i) {
- if (!readUByte(&palette.bpc[i])) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- ++palette.bpc[i];
- }
- for (i = 0; i < palette.nEntries; ++i) {
- for (j = 0; j < palette.nComps; ++j) {
- if (!readNBytes(((palette.bpc[j] & 0x7f) + 7) >> 3,
- (palette.bpc[j] & 0x80) ? gTrue : gFalse,
- &palette.c[i * palette.nComps + j])) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- }
- }
- havePalette = gTrue;
- break;
- case 0x636d6170: // component mapping
- cover(13);
- compMap.nChannels = dataLen / 4;
- compMap.comp = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
- compMap.type = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
- compMap.pComp = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
- for (i = 0; i < compMap.nChannels; ++i) {
- if (!readUWord(&compMap.comp[i]) ||
- !readUByte(&compMap.type[i]) ||
- !readUByte(&compMap.pComp[i])) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- }
- haveCompMap = gTrue;
- break;
- case 0x63646566: // channel definition
- cover(14);
- if (!readUWord(&channelDefn.nChannels)) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- channelDefn.idx =
- (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
- channelDefn.type =
- (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
- channelDefn.assoc =
- (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
- for (i = 0; i < channelDefn.nChannels; ++i) {
- if (!readUWord(&channelDefn.idx[i]) ||
- !readUWord(&channelDefn.type[i]) ||
- !readUWord(&channelDefn.assoc[i])) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- }
- haveChannelDefn = gTrue;
- break;
- case 0x6A703263: // contiguous codestream
- cover(15);
- if (!bpc) {
- error(getPos(), "JPX stream is missing the image header box");
- }
- if (!haveCS) {
- error(getPos(), "JPX stream has no supported color spec");
- }
- if (!readCodestream(dataLen)) {
- return gFalse;
- }
- break;
- default:
- cover(16);
- for (i = 0; i < dataLen; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Unexpected EOF in JPX stream");
- return gFalse;
- }
- }
- break;
- }
- }
- return gTrue;
-}
-
-GBool JPXStream::readColorSpecBox(Guint dataLen) {
- JPXColorSpec newCS;
- Guint csApprox, csEnum;
- Guint i;
- GBool ok;
-
- ok = gFalse;
- if (!readUByte(&newCS.meth) ||
- !readByte(&newCS.prec) ||
- !readUByte(&csApprox)) {
- goto err;
- }
- switch (newCS.meth) {
- case 1: // enumerated colorspace
- cover(17);
- if (!readULong(&csEnum)) {
- goto err;
- }
- newCS.enumerated.type = (JPXColorSpaceType)csEnum;
- switch (newCS.enumerated.type) {
- case jpxCSBiLevel:
- ok = gTrue;
- break;
- case jpxCSYCbCr1:
- ok = gTrue;
- break;
- case jpxCSYCbCr2:
- ok = gTrue;
- break;
- case jpxCSYCBCr3:
- ok = gTrue;
- break;
- case jpxCSPhotoYCC:
- ok = gTrue;
- break;
- case jpxCSCMY:
- ok = gTrue;
- break;
- case jpxCSCMYK:
- ok = gTrue;
- break;
- case jpxCSYCCK:
- ok = gTrue;
- break;
- case jpxCSCIELab:
- if (dataLen == 7 + 7*4) {
- if (!readULong(&newCS.enumerated.cieLab.rl) ||
- !readULong(&newCS.enumerated.cieLab.ol) ||
- !readULong(&newCS.enumerated.cieLab.ra) ||
- !readULong(&newCS.enumerated.cieLab.oa) ||
- !readULong(&newCS.enumerated.cieLab.rb) ||
- !readULong(&newCS.enumerated.cieLab.ob) ||
- !readULong(&newCS.enumerated.cieLab.il)) {
- goto err;
- }
- } else if (dataLen == 7) {
- //~ this assumes the 8-bit case
- cover(92);
- newCS.enumerated.cieLab.rl = 100;
- newCS.enumerated.cieLab.ol = 0;
- newCS.enumerated.cieLab.ra = 255;
- newCS.enumerated.cieLab.oa = 128;
- newCS.enumerated.cieLab.rb = 255;
- newCS.enumerated.cieLab.ob = 96;
- newCS.enumerated.cieLab.il = 0x00443530;
- } else {
- goto err;
- }
- ok = gTrue;
- break;
- case jpxCSsRGB:
- ok = gTrue;
- break;
- case jpxCSGrayscale:
- ok = gTrue;
- break;
- case jpxCSBiLevel2:
- ok = gTrue;
- break;
- case jpxCSCIEJab:
- // not allowed in PDF
- goto err;
- case jpxCSCISesRGB:
- ok = gTrue;
- break;
- case jpxCSROMMRGB:
- ok = gTrue;
- break;
- case jpxCSsRGBYCbCr:
- ok = gTrue;
- break;
- case jpxCSYPbPr1125:
- ok = gTrue;
- break;
- case jpxCSYPbPr1250:
- ok = gTrue;
- break;
- default:
- goto err;
- }
- break;
- case 2: // restricted ICC profile
- case 3: // any ICC profile (JPX)
- case 4: // vendor color (JPX)
- cover(18);
- for (i = 0; i < dataLen - 3; ++i) {
- if (str->getChar() == EOF) {
- goto err;
- }
- }
- break;
- }
-
- if (ok && (!haveCS || newCS.prec > cs.prec)) {
- cs = newCS;
- haveCS = gTrue;
- }
-
- return gTrue;
-
- err:
- error(getPos(), "Error in JPX color spec");
- return gFalse;
-}
-
-GBool JPXStream::readCodestream(Guint /*len*/) {
- JPXTile *tile;
- JPXTileComp *tileComp;
- int segType;
- GBool haveSIZ, haveCOD, haveQCD, haveSOT;
- Guint precinctSize, style;
- Guint segLen, capabilities, comp, i, j, r;
-
- //----- main header
- haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
- do {
- if (!readMarkerHdr(&segType, &segLen)) {
- error(getPos(), "Error in JPX codestream");
- return gFalse;
- }
- switch (segType) {
- case 0x4f: // SOC - start of codestream
- // marker only
- cover(19);
- break;
- case 0x51: // SIZ - image and tile size
- cover(20);
- if (!readUWord(&capabilities) ||
- !readULong(&img.xSize) ||
- !readULong(&img.ySize) ||
- !readULong(&img.xOffset) ||
- !readULong(&img.yOffset) ||
- !readULong(&img.xTileSize) ||
- !readULong(&img.yTileSize) ||
- !readULong(&img.xTileOffset) ||
- !readULong(&img.yTileOffset) ||
- !readUWord(&img.nComps)) {
- error(getPos(), "Error in JPX SIZ marker segment");
- return gFalse;
- }
- if (haveImgHdr && img.nComps != nComps) {
- error(getPos(), "Different number of components in JPX SIZ marker segment");
- return gFalse;
- }
- img.nXTiles = (img.xSize - img.xTileOffset + img.xTileSize - 1)
- / img.xTileSize;
- img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
- / img.yTileSize;
- // check for overflow before allocating memory
- if (img.nXTiles <= 0 || img.nYTiles <= 0 ||
- img.nXTiles >= INT_MAX / img.nYTiles) {
- error(getPos(), "Bad tile count in JPX SIZ marker segment");
- return gFalse;
- }
- img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
- sizeof(JPXTile));
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps,
- sizeof(JPXTileComp));
- for (comp = 0; comp < img.nComps; ++comp) {
- img.tiles[i].tileComps[comp].quantSteps = NULL;
- img.tiles[i].tileComps[comp].data = NULL;
- img.tiles[i].tileComps[comp].buf = NULL;
- img.tiles[i].tileComps[comp].resLevels = NULL;
- }
- }
- for (comp = 0; comp < img.nComps; ++comp) {
- if (!readUByte(&img.tiles[0].tileComps[comp].prec) ||
- !readUByte(&img.tiles[0].tileComps[comp].hSep) ||
- !readUByte(&img.tiles[0].tileComps[comp].vSep)) {
- error(getPos(), "Error in JPX SIZ marker segment");
- return gFalse;
- }
- img.tiles[0].tileComps[comp].sgned =
- (img.tiles[0].tileComps[comp].prec & 0x80) ? gTrue : gFalse;
- img.tiles[0].tileComps[comp].prec =
- (img.tiles[0].tileComps[comp].prec & 0x7f) + 1;
- for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
- img.tiles[i].tileComps[comp] = img.tiles[0].tileComps[comp];
- }
- }
- haveSIZ = gTrue;
- break;
- case 0x52: // COD - coding style default
- cover(21);
- if (!readUByte(&img.tiles[0].tileComps[0].style) ||
- !readUByte(&img.tiles[0].progOrder) ||
- !readUWord(&img.tiles[0].nLayers) ||
- !readUByte(&img.tiles[0].multiComp) ||
- !readUByte(&img.tiles[0].tileComps[0].nDecompLevels) ||
- !readUByte(&img.tiles[0].tileComps[0].codeBlockW) ||
- !readUByte(&img.tiles[0].tileComps[0].codeBlockH) ||
- !readUByte(&img.tiles[0].tileComps[0].codeBlockStyle) ||
- !readUByte(&img.tiles[0].tileComps[0].transform)) {
- error(getPos(), "Error in JPX COD marker segment");
- return gFalse;
- }
- img.tiles[0].tileComps[0].codeBlockW += 2;
- img.tiles[0].tileComps[0].codeBlockH += 2;
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- if (i != 0) {
- img.tiles[i].progOrder = img.tiles[0].progOrder;
- img.tiles[i].nLayers = img.tiles[0].nLayers;
- img.tiles[i].multiComp = img.tiles[0].multiComp;
- }
- for (comp = 0; comp < img.nComps; ++comp) {
- if (!(i == 0 && comp == 0)) {
- img.tiles[i].tileComps[comp].style =
- img.tiles[0].tileComps[0].style;
- img.tiles[i].tileComps[comp].nDecompLevels =
- img.tiles[0].tileComps[0].nDecompLevels;
- img.tiles[i].tileComps[comp].codeBlockW =
- img.tiles[0].tileComps[0].codeBlockW;
- img.tiles[i].tileComps[comp].codeBlockH =
- img.tiles[0].tileComps[0].codeBlockH;
- img.tiles[i].tileComps[comp].codeBlockStyle =
- img.tiles[0].tileComps[0].codeBlockStyle;
- img.tiles[i].tileComps[comp].transform =
- img.tiles[0].tileComps[0].transform;
- }
- img.tiles[i].tileComps[comp].resLevels =
- (JPXResLevel *)gmallocn(
- (img.tiles[i].tileComps[comp].nDecompLevels + 1),
- sizeof(JPXResLevel));
- for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
- img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
- }
- }
- }
- for (r = 0; r <= img.tiles[0].tileComps[0].nDecompLevels; ++r) {
- if (img.tiles[0].tileComps[0].style & 0x01) {
- cover(91);
- if (!readUByte(&precinctSize)) {
- error(getPos(), "Error in JPX COD marker segment");
- return gFalse;
- }
- img.tiles[0].tileComps[0].resLevels[r].precinctWidth =
- precinctSize & 0x0f;
- img.tiles[0].tileComps[0].resLevels[r].precinctHeight =
- (precinctSize >> 4) & 0x0f;
- } else {
- img.tiles[0].tileComps[0].resLevels[r].precinctWidth = 15;
- img.tiles[0].tileComps[0].resLevels[r].precinctHeight = 15;
- }
- }
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- for (comp = 0; comp < img.nComps; ++comp) {
- if (!(i == 0 && comp == 0)) {
- for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
- img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
- img.tiles[0].tileComps[0].resLevels[r].precinctWidth;
- img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
- img.tiles[0].tileComps[0].resLevels[r].precinctHeight;
- }
- }
- }
- }
- haveCOD = gTrue;
- break;
- case 0x53: // COC - coding style component
- cover(22);
- if (!haveCOD) {
- error(getPos(), "JPX COC marker segment before COD segment");
- return gFalse;
- }
- if ((img.nComps > 256 && !readUWord(&comp)) ||
- (img.nComps <= 256 && !readUByte(&comp)) ||
- comp >= img.nComps ||
- !readUByte(&style) ||
- !readUByte(&img.tiles[0].tileComps[comp].nDecompLevels) ||
- !readUByte(&img.tiles[0].tileComps[comp].codeBlockW) ||
- !readUByte(&img.tiles[0].tileComps[comp].codeBlockH) ||
- !readUByte(&img.tiles[0].tileComps[comp].codeBlockStyle) ||
- !readUByte(&img.tiles[0].tileComps[comp].transform)) {
- error(getPos(), "Error in JPX COC marker segment");
- return gFalse;
- }
- img.tiles[0].tileComps[comp].style =
- (img.tiles[0].tileComps[comp].style & ~1) | (style & 1);
- img.tiles[0].tileComps[comp].codeBlockW += 2;
- img.tiles[0].tileComps[comp].codeBlockH += 2;
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- if (i != 0) {
- img.tiles[i].tileComps[comp].style =
- img.tiles[0].tileComps[comp].style;
- img.tiles[i].tileComps[comp].nDecompLevels =
- img.tiles[0].tileComps[comp].nDecompLevels;
- img.tiles[i].tileComps[comp].codeBlockW =
- img.tiles[0].tileComps[comp].codeBlockW;
- img.tiles[i].tileComps[comp].codeBlockH =
- img.tiles[0].tileComps[comp].codeBlockH;
- img.tiles[i].tileComps[comp].codeBlockStyle =
- img.tiles[0].tileComps[comp].codeBlockStyle;
- img.tiles[i].tileComps[comp].transform =
- img.tiles[0].tileComps[comp].transform;
- }
- img.tiles[i].tileComps[comp].resLevels =
- (JPXResLevel *)greallocn(
- img.tiles[i].tileComps[comp].resLevels,
- (img.tiles[i].tileComps[comp].nDecompLevels + 1),
- sizeof(JPXResLevel));
- for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
- img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
- }
- }
- for (r = 0; r <= img.tiles[0].tileComps[comp].nDecompLevels; ++r) {
- if (img.tiles[0].tileComps[comp].style & 0x01) {
- if (!readUByte(&precinctSize)) {
- error(getPos(), "Error in JPX COD marker segment");
- return gFalse;
- }
- img.tiles[0].tileComps[comp].resLevels[r].precinctWidth =
- precinctSize & 0x0f;
- img.tiles[0].tileComps[comp].resLevels[r].precinctHeight =
- (precinctSize >> 4) & 0x0f;
- } else {
- img.tiles[0].tileComps[comp].resLevels[r].precinctWidth = 15;
- img.tiles[0].tileComps[comp].resLevels[r].precinctHeight = 15;
- }
- }
- for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
- for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
- img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
- img.tiles[0].tileComps[comp].resLevels[r].precinctWidth;
- img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
- img.tiles[0].tileComps[comp].resLevels[r].precinctHeight;
- }
- }
- break;
- case 0x5c: // QCD - quantization default
- cover(23);
- if (!readUByte(&img.tiles[0].tileComps[0].quantStyle)) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x00) {
- img.tiles[0].tileComps[0].nQuantSteps = segLen - 3;
- img.tiles[0].tileComps[0].quantSteps =
- (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
- img.tiles[0].tileComps[0].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
- if (!readUByte(&img.tiles[0].tileComps[0].quantSteps[i])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- }
- } else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x01) {
- img.tiles[0].tileComps[0].nQuantSteps = 1;
- img.tiles[0].tileComps[0].quantSteps =
- (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
- img.tiles[0].tileComps[0].nQuantSteps,
- sizeof(Guint));
- if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[0])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- } else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x02) {
- img.tiles[0].tileComps[0].nQuantSteps = (segLen - 3) / 2;
- img.tiles[0].tileComps[0].quantSteps =
- (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
- img.tiles[0].tileComps[0].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
- if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[i])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- }
- } else {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- for (comp = 0; comp < img.nComps; ++comp) {
- if (!(i == 0 && comp == 0)) {
- img.tiles[i].tileComps[comp].quantStyle =
- img.tiles[0].tileComps[0].quantStyle;
- img.tiles[i].tileComps[comp].nQuantSteps =
- img.tiles[0].tileComps[0].nQuantSteps;
- img.tiles[i].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[i].tileComps[comp].quantSteps,
- img.tiles[0].tileComps[0].nQuantSteps,
- sizeof(Guint));
- for (j = 0; j < img.tiles[0].tileComps[0].nQuantSteps; ++j) {
- img.tiles[i].tileComps[comp].quantSteps[j] =
- img.tiles[0].tileComps[0].quantSteps[j];
- }
- }
- }
- }
- haveQCD = gTrue;
- break;
- case 0x5d: // QCC - quantization component
- cover(24);
- if (!haveQCD) {
- error(getPos(), "JPX QCC marker segment before QCD segment");
- return gFalse;
- }
- if ((img.nComps > 256 && !readUWord(&comp)) ||
- (img.nComps <= 256 && !readUByte(&comp)) ||
- comp >= img.nComps ||
- !readUByte(&img.tiles[0].tileComps[comp].quantStyle)) {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x00) {
- img.tiles[0].tileComps[comp].nQuantSteps =
- segLen - (img.nComps > 256 ? 5 : 4);
- img.tiles[0].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
- img.tiles[0].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
- if (!readUByte(&img.tiles[0].tileComps[comp].quantSteps[i])) {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- }
- } else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x01) {
- img.tiles[0].tileComps[comp].nQuantSteps = 1;
- img.tiles[0].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
- img.tiles[0].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[0])) {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- } else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x02) {
- img.tiles[0].tileComps[comp].nQuantSteps =
- (segLen - (img.nComps > 256 ? 5 : 4)) / 2;
- img.tiles[0].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
- img.tiles[0].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
- if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[i])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- }
- } else {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
- img.tiles[i].tileComps[comp].quantStyle =
- img.tiles[0].tileComps[comp].quantStyle;
- img.tiles[i].tileComps[comp].nQuantSteps =
- img.tiles[0].tileComps[comp].nQuantSteps;
- img.tiles[i].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[i].tileComps[comp].quantSteps,
- img.tiles[0].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- for (j = 0; j < img.tiles[0].tileComps[comp].nQuantSteps; ++j) {
- img.tiles[i].tileComps[comp].quantSteps[j] =
- img.tiles[0].tileComps[comp].quantSteps[j];
- }
- }
- break;
- case 0x5e: // RGN - region of interest
- cover(25);
-#if 1 //~ ROI is unimplemented
- fprintf(stderr, "RGN\n");
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PPM marker segment");
- return gFalse;
- }
- }
-#else
- if ((img.nComps > 256 && !readUWord(&comp)) ||
- (img.nComps <= 256 && !readUByte(&comp)) ||
- comp >= img.nComps ||
- !readUByte(&compInfo[comp].defROI.style) ||
- !readUByte(&compInfo[comp].defROI.shift)) {
- error(getPos(), "Error in JPX RGN marker segment");
- return gFalse;
- }
-#endif
- break;
- case 0x5f: // POC - progression order change
- cover(26);
-#if 1 //~ progression order changes are unimplemented
- fprintf(stderr, "POC\n");
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PPM marker segment");
- return gFalse;
- }
- }
-#else
- nProgs = (segLen - 2) / (img.nComps > 256 ? 9 : 7);
- progs = (JPXProgOrder *)gmallocn(nProgs, sizeof(JPXProgOrder));
- for (i = 0; i < nProgs; ++i) {
- if (!readUByte(&progs[i].startRes) ||
- !(img.nComps > 256 && readUWord(&progs[i].startComp)) ||
- !(img.nComps <= 256 && readUByte(&progs[i].startComp)) ||
- !readUWord(&progs[i].endLayer) ||
- !readUByte(&progs[i].endRes) ||
- !(img.nComps > 256 && readUWord(&progs[i].endComp)) ||
- !(img.nComps <= 256 && readUByte(&progs[i].endComp)) ||
- !readUByte(&progs[i].progOrder)) {
- error(getPos(), "Error in JPX POC marker segment");
- return gFalse;
- }
- }
-#endif
- break;
- case 0x60: // PPM - packed packet headers, main header
- cover(27);
-#if 1 //~ packed packet headers are unimplemented
- fprintf(stderr, "PPM\n");
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PPM marker segment");
- return gFalse;
- }
- }
-#endif
- break;
- case 0x55: // TLM - tile-part lengths
- // skipped
- cover(28);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX TLM marker segment");
- return gFalse;
- }
- }
- break;
- case 0x57: // PLM - packet length, main header
- // skipped
- cover(29);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PLM marker segment");
- return gFalse;
- }
- }
- break;
- case 0x63: // CRG - component registration
- // skipped
- cover(30);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX CRG marker segment");
- return gFalse;
- }
- }
- break;
- case 0x64: // COM - comment
- // skipped
- cover(31);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX COM marker segment");
- return gFalse;
- }
- }
- break;
- case 0x90: // SOT - start of tile
- cover(32);
- haveSOT = gTrue;
- break;
- default:
- cover(33);
- error(getPos(), "Unknown marker segment %02x in JPX stream", segType);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- break;
- }
- }
- break;
- }
- } while (!haveSOT);
-
- if (!haveSIZ) {
- error(getPos(), "Missing SIZ marker segment in JPX stream");
- return gFalse;
- }
- if (!haveCOD) {
- error(getPos(), "Missing COD marker segment in JPX stream");
- return gFalse;
- }
- if (!haveQCD) {
- error(getPos(), "Missing QCD marker segment in JPX stream");
- return gFalse;
- }
-
- //----- read the tile-parts
- while (1) {
- if (!readTilePart()) {
- return gFalse;
- }
- if (!readMarkerHdr(&segType, &segLen)) {
- error(getPos(), "Error in JPX codestream");
- return gFalse;
- }
- if (segType != 0x90) { // SOT - start of tile
- break;
- }
- }
-
- if (segType != 0xd9) { // EOC - end of codestream
- error(getPos(), "Missing EOC marker in JPX codestream");
- return gFalse;
- }
-
- //----- finish decoding the image
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- tile = &img.tiles[i];
- for (comp = 0; comp < img.nComps; ++comp) {
- tileComp = &tile->tileComps[comp];
- inverseTransform(tileComp);
- }
- if (!inverseMultiCompAndDC(tile)) {
- return gFalse;
- }
- }
-
- //~ can free memory below tileComps here, and also tileComp.buf
-
- return gTrue;
-}
-
-GBool JPXStream::readTilePart() {
- JPXTile *tile;
- JPXTileComp *tileComp;
- JPXResLevel *resLevel;
- JPXPrecinct *precinct;
- JPXSubband *subband;
- JPXCodeBlock *cb;
- GBool haveSOD;
- Guint tileIdx, tilePartLen, tilePartIdx, nTileParts;
- GBool tilePartToEOC;
- Guint precinctSize, style;
- Guint n, nSBs, nx, ny, sbx0, sby0, comp, segLen;
- Guint i, j, k, cbX, cbY, r, pre, sb, cbi;
- int segType, level;
-
- // process the SOT marker segment
- if (!readUWord(&tileIdx) ||
- !readULong(&tilePartLen) ||
- !readUByte(&tilePartIdx) ||
- !readUByte(&nTileParts)) {
- error(getPos(), "Error in JPX SOT marker segment");
- return gFalse;
- }
-
- if (tileIdx >= img.nXTiles * img.nYTiles) {
- error(getPos(), "Weird tile index in JPX stream");
- return gFalse;
- }
-
- tilePartToEOC = tilePartLen == 0;
- tilePartLen -= 12; // subtract size of SOT segment
-
- haveSOD = gFalse;
- do {
- if (!readMarkerHdr(&segType, &segLen)) {
- error(getPos(), "Error in JPX tile-part codestream");
- return gFalse;
- }
- tilePartLen -= 2 + segLen;
- switch (segType) {
- case 0x52: // COD - coding style default
- cover(34);
- if (!readUByte(&img.tiles[tileIdx].tileComps[0].style) ||
- !readUByte(&img.tiles[tileIdx].progOrder) ||
- !readUWord(&img.tiles[tileIdx].nLayers) ||
- !readUByte(&img.tiles[tileIdx].multiComp) ||
- !readUByte(&img.tiles[tileIdx].tileComps[0].nDecompLevels) ||
- !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockW) ||
- !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockH) ||
- !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockStyle) ||
- !readUByte(&img.tiles[tileIdx].tileComps[0].transform)) {
- error(getPos(), "Error in JPX COD marker segment");
- return gFalse;
- }
- img.tiles[tileIdx].tileComps[0].codeBlockW += 2;
- img.tiles[tileIdx].tileComps[0].codeBlockH += 2;
- for (comp = 0; comp < img.nComps; ++comp) {
- if (comp != 0) {
- img.tiles[tileIdx].tileComps[comp].style =
- img.tiles[tileIdx].tileComps[0].style;
- img.tiles[tileIdx].tileComps[comp].nDecompLevels =
- img.tiles[tileIdx].tileComps[0].nDecompLevels;
- img.tiles[tileIdx].tileComps[comp].codeBlockW =
- img.tiles[tileIdx].tileComps[0].codeBlockW;
- img.tiles[tileIdx].tileComps[comp].codeBlockH =
- img.tiles[tileIdx].tileComps[0].codeBlockH;
- img.tiles[tileIdx].tileComps[comp].codeBlockStyle =
- img.tiles[tileIdx].tileComps[0].codeBlockStyle;
- img.tiles[tileIdx].tileComps[comp].transform =
- img.tiles[tileIdx].tileComps[0].transform;
- }
- img.tiles[tileIdx].tileComps[comp].resLevels =
- (JPXResLevel *)greallocn(
- img.tiles[tileIdx].tileComps[comp].resLevels,
- (img.tiles[tileIdx].tileComps[comp].nDecompLevels + 1),
- sizeof(JPXResLevel));
- for (r = 0;
- r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels;
- ++r) {
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
- }
- }
- for (r = 0; r <= img.tiles[tileIdx].tileComps[0].nDecompLevels; ++r) {
- if (img.tiles[tileIdx].tileComps[0].style & 0x01) {
- if (!readUByte(&precinctSize)) {
- error(getPos(), "Error in JPX COD marker segment");
- return gFalse;
- }
- img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth =
- precinctSize & 0x0f;
- img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight =
- (precinctSize >> 4) & 0x0f;
- } else {
- img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth = 15;
- img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight = 15;
- }
- }
- for (comp = 1; comp < img.nComps; ++comp) {
- for (r = 0;
- r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels;
- ++r) {
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
- img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth;
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
- img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight;
- }
- }
- break;
- case 0x53: // COC - coding style component
- cover(35);
- if ((img.nComps > 256 && !readUWord(&comp)) ||
- (img.nComps <= 256 && !readUByte(&comp)) ||
- comp >= img.nComps ||
- !readUByte(&style) ||
- !readUByte(&img.tiles[tileIdx].tileComps[comp].nDecompLevels) ||
- !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockW) ||
- !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockH) ||
- !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockStyle) ||
- !readUByte(&img.tiles[tileIdx].tileComps[comp].transform)) {
- error(getPos(), "Error in JPX COC marker segment");
- return gFalse;
- }
- img.tiles[tileIdx].tileComps[comp].style =
- (img.tiles[tileIdx].tileComps[comp].style & ~1) | (style & 1);
- img.tiles[tileIdx].tileComps[comp].codeBlockW += 2;
- img.tiles[tileIdx].tileComps[comp].codeBlockH += 2;
- img.tiles[tileIdx].tileComps[comp].resLevels =
- (JPXResLevel *)greallocn(
- img.tiles[tileIdx].tileComps[comp].resLevels,
- (img.tiles[tileIdx].tileComps[comp].nDecompLevels + 1),
- sizeof(JPXResLevel));
- for (r = 0; r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels; ++r) {
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
- }
- for (r = 0; r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels; ++r) {
- if (img.tiles[tileIdx].tileComps[comp].style & 0x01) {
- if (!readUByte(&precinctSize)) {
- error(getPos(), "Error in JPX COD marker segment");
- return gFalse;
- }
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
- precinctSize & 0x0f;
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
- (precinctSize >> 4) & 0x0f;
- } else {
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth = 15;
- img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight = 15;
- }
- }
- break;
- case 0x5c: // QCD - quantization default
- cover(36);
- if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantStyle)) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x00) {
- img.tiles[tileIdx].tileComps[0].nQuantSteps =
- segLen - 3;
- img.tiles[tileIdx].tileComps[0].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
- img.tiles[tileIdx].tileComps[0].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
- if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- }
- } else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x01) {
- img.tiles[tileIdx].tileComps[0].nQuantSteps = 1;
- img.tiles[tileIdx].tileComps[0].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
- img.tiles[tileIdx].tileComps[0].nQuantSteps,
- sizeof(Guint));
- if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[0])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- } else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x02) {
- img.tiles[tileIdx].tileComps[0].nQuantSteps = (segLen - 3) / 2;
- img.tiles[tileIdx].tileComps[0].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
- img.tiles[tileIdx].tileComps[0].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
- if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- }
- } else {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- for (comp = 1; comp < img.nComps; ++comp) {
- img.tiles[tileIdx].tileComps[comp].quantStyle =
- img.tiles[tileIdx].tileComps[0].quantStyle;
- img.tiles[tileIdx].tileComps[comp].nQuantSteps =
- img.tiles[tileIdx].tileComps[0].nQuantSteps;
- img.tiles[tileIdx].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
- img.tiles[tileIdx].tileComps[0].nQuantSteps,
- sizeof(Guint));
- for (j = 0; j < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++j) {
- img.tiles[tileIdx].tileComps[comp].quantSteps[j] =
- img.tiles[tileIdx].tileComps[0].quantSteps[j];
- }
- }
- break;
- case 0x5d: // QCC - quantization component
- cover(37);
- if ((img.nComps > 256 && !readUWord(&comp)) ||
- (img.nComps <= 256 && !readUByte(&comp)) ||
- comp >= img.nComps ||
- !readUByte(&img.tiles[tileIdx].tileComps[comp].quantStyle)) {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f) == 0x00) {
- img.tiles[tileIdx].tileComps[comp].nQuantSteps =
- segLen - (img.nComps > 256 ? 5 : 4);
- img.tiles[tileIdx].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
- img.tiles[tileIdx].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
- if (!readUByte(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- }
- } else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
- == 0x01) {
- img.tiles[tileIdx].tileComps[comp].nQuantSteps = 1;
- img.tiles[tileIdx].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
- img.tiles[tileIdx].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[0])) {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- } else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
- == 0x02) {
- img.tiles[tileIdx].tileComps[comp].nQuantSteps =
- (segLen - (img.nComps > 256 ? 5 : 4)) / 2;
- img.tiles[tileIdx].tileComps[comp].quantSteps =
- (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
- img.tiles[tileIdx].tileComps[comp].nQuantSteps,
- sizeof(Guint));
- for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
- if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
- error(getPos(), "Error in JPX QCD marker segment");
- return gFalse;
- }
- }
- } else {
- error(getPos(), "Error in JPX QCC marker segment");
- return gFalse;
- }
- break;
- case 0x5e: // RGN - region of interest
- cover(38);
-#if 1 //~ ROI is unimplemented
- fprintf(stderr, "RGN\n");
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PPM marker segment");
- return gFalse;
- }
- }
-#else
- if ((img.nComps > 256 && !readUWord(&comp)) ||
- (img.nComps <= 256 && !readUByte(&comp)) ||
- comp >= img.nComps ||
- !readUByte(&compInfo[comp].roi.style) ||
- !readUByte(&compInfo[comp].roi.shift)) {
- error(getPos(), "Error in JPX RGN marker segment");
- return gFalse;
- }
-#endif
- break;
- case 0x5f: // POC - progression order change
- cover(39);
-#if 1 //~ progression order changes are unimplemented
- fprintf(stderr, "POC\n");
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PPM marker segment");
- return gFalse;
- }
- }
-#else
- nTileProgs = (segLen - 2) / (img.nComps > 256 ? 9 : 7);
- tileProgs = (JPXProgOrder *)gmallocn(nTileProgs, sizeof(JPXProgOrder));
- for (i = 0; i < nTileProgs; ++i) {
- if (!readUByte(&tileProgs[i].startRes) ||
- !(img.nComps > 256 && readUWord(&tileProgs[i].startComp)) ||
- !(img.nComps <= 256 && readUByte(&tileProgs[i].startComp)) ||
- !readUWord(&tileProgs[i].endLayer) ||
- !readUByte(&tileProgs[i].endRes) ||
- !(img.nComps > 256 && readUWord(&tileProgs[i].endComp)) ||
- !(img.nComps <= 256 && readUByte(&tileProgs[i].endComp)) ||
- !readUByte(&tileProgs[i].progOrder)) {
- error(getPos(), "Error in JPX POC marker segment");
- return gFalse;
- }
- }
-#endif
- break;
- case 0x61: // PPT - packed packet headers, tile-part hdr
- cover(40);
-#if 1 //~ packed packet headers are unimplemented
- fprintf(stderr, "PPT\n");
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PPT marker segment");
- return gFalse;
- }
- }
-#endif
- case 0x58: // PLT - packet length, tile-part header
- // skipped
- cover(41);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX PLT marker segment");
- return gFalse;
- }
- }
- break;
- case 0x64: // COM - comment
- // skipped
- cover(42);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- error(getPos(), "Error in JPX COM marker segment");
- return gFalse;
- }
- }
- break;
- case 0x93: // SOD - start of data
- cover(43);
- haveSOD = gTrue;
- break;
- default:
- cover(44);
- error(getPos(), "Unknown marker segment %02x in JPX tile-part stream",
- segType);
- for (i = 0; i < segLen - 2; ++i) {
- if (str->getChar() == EOF) {
- break;
- }
- }
- break;
- }
- } while (!haveSOD);
-
- //----- initialize the tile, precincts, and code-blocks
- if (tilePartIdx == 0) {
- tile = &img.tiles[tileIdx];
- i = tileIdx / img.nXTiles;
- j = tileIdx % img.nXTiles;
- if ((tile->x0 = img.xTileOffset + j * img.xTileSize) < img.xOffset) {
- tile->x0 = img.xOffset;
- }
- if ((tile->y0 = img.yTileOffset + i * img.yTileSize) < img.yOffset) {
- tile->y0 = img.yOffset;
- }
- if ((tile->x1 = img.xTileOffset + (j + 1) * img.xTileSize) > img.xSize) {
- tile->x1 = img.xSize;
- }
- if ((tile->y1 = img.yTileOffset + (i + 1) * img.yTileSize) > img.ySize) {
- tile->y1 = img.ySize;
- }
- tile->comp = 0;
- tile->res = 0;
- tile->precinct = 0;
- tile->layer = 0;
- tile->maxNDecompLevels = 0;
- for (comp = 0; comp < img.nComps; ++comp) {
- tileComp = &tile->tileComps[comp];
- if (tileComp->nDecompLevels > tile->maxNDecompLevels) {
- tile->maxNDecompLevels = tileComp->nDecompLevels;
- }
- tileComp->x0 = jpxCeilDiv(tile->x0, tileComp->hSep);
- tileComp->y0 = jpxCeilDiv(tile->y0, tileComp->hSep);
- tileComp->x1 = jpxCeilDiv(tile->x1, tileComp->hSep);
- tileComp->y1 = jpxCeilDiv(tile->y1, tileComp->hSep);
- tileComp->cbW = 1 << tileComp->codeBlockW;
- tileComp->cbH = 1 << tileComp->codeBlockH;
- tileComp->data = (int *)gmallocn((tileComp->x1 - tileComp->x0) *
- (tileComp->y1 - tileComp->y0),
- sizeof(int));
- if (tileComp->x1 - tileComp->x0 > tileComp->y1 - tileComp->y0) {
- n = tileComp->x1 - tileComp->x0;
- } else {
- n = tileComp->y1 - tileComp->y0;
- }
- tileComp->buf = (int *)gmallocn(n + 8, sizeof(int));
- for (r = 0; r <= tileComp->nDecompLevels; ++r) {
- resLevel = &tileComp->resLevels[r];
- k = r == 0 ? tileComp->nDecompLevels
- : tileComp->nDecompLevels - r + 1;
- resLevel->x0 = jpxCeilDivPow2(tileComp->x0, k);
- resLevel->y0 = jpxCeilDivPow2(tileComp->y0, k);
- resLevel->x1 = jpxCeilDivPow2(tileComp->x1, k);
- resLevel->y1 = jpxCeilDivPow2(tileComp->y1, k);
- if (r == 0) {
- resLevel->bx0[0] = resLevel->x0;
- resLevel->by0[0] = resLevel->y0;
- resLevel->bx1[0] = resLevel->x1;
- resLevel->by1[0] = resLevel->y1;
- } else {
- resLevel->bx0[0] = jpxCeilDivPow2(tileComp->x0 - (1 << (k-1)), k);
- resLevel->by0[0] = resLevel->y0;
- resLevel->bx1[0] = jpxCeilDivPow2(tileComp->x1 - (1 << (k-1)), k);
- resLevel->by1[0] = resLevel->y1;
- resLevel->bx0[1] = resLevel->x0;
- resLevel->by0[1] = jpxCeilDivPow2(tileComp->y0 - (1 << (k-1)), k);
- resLevel->bx1[1] = resLevel->x1;
- resLevel->by1[1] = jpxCeilDivPow2(tileComp->y1 - (1 << (k-1)), k);
- resLevel->bx0[2] = jpxCeilDivPow2(tileComp->x0 - (1 << (k-1)), k);
- resLevel->by0[2] = jpxCeilDivPow2(tileComp->y0 - (1 << (k-1)), k);
- resLevel->bx1[2] = jpxCeilDivPow2(tileComp->x1 - (1 << (k-1)), k);
- resLevel->by1[2] = jpxCeilDivPow2(tileComp->y1 - (1 << (k-1)), k);
- }
- resLevel->precincts = (JPXPrecinct *)gmallocn(1, sizeof(JPXPrecinct));
- for (pre = 0; pre < 1; ++pre) {
- precinct = &resLevel->precincts[pre];
- precinct->x0 = resLevel->x0;
- precinct->y0 = resLevel->y0;
- precinct->x1 = resLevel->x1;
- precinct->y1 = resLevel->y1;
- nSBs = r == 0 ? 1 : 3;
- precinct->subbands =
- (JPXSubband *)gmallocn(nSBs, sizeof(JPXSubband));
- for (sb = 0; sb < nSBs; ++sb) {
- subband = &precinct->subbands[sb];
- subband->x0 = resLevel->bx0[sb];
- subband->y0 = resLevel->by0[sb];
- subband->x1 = resLevel->bx1[sb];
- subband->y1 = resLevel->by1[sb];
- subband->nXCBs = jpxCeilDivPow2(subband->x1,
- tileComp->codeBlockW)
- - jpxFloorDivPow2(subband->x0,
- tileComp->codeBlockW);
- subband->nYCBs = jpxCeilDivPow2(subband->y1,
- tileComp->codeBlockH)
- - jpxFloorDivPow2(subband->y0,
- tileComp->codeBlockH);
- n = subband->nXCBs > subband->nYCBs ? subband->nXCBs
- : subband->nYCBs;
- for (subband->maxTTLevel = 0, --n;
- n;
- ++subband->maxTTLevel, n >>= 1) ;
- n = 0;
- for (level = subband->maxTTLevel; level >= 0; --level) {
- nx = jpxCeilDivPow2(subband->nXCBs, level);
- ny = jpxCeilDivPow2(subband->nYCBs, level);
- n += nx * ny;
- }
- subband->inclusion =
- (JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
- subband->zeroBitPlane =
- (JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
- for (k = 0; k < n; ++k) {
- subband->inclusion[k].finished = gFalse;
- subband->inclusion[k].val = 0;
- subband->zeroBitPlane[k].finished = gFalse;
- subband->zeroBitPlane[k].val = 0;
- }
- subband->cbs = (JPXCodeBlock *)gmallocn(subband->nXCBs *
- subband->nYCBs,
- sizeof(JPXCodeBlock));
- sbx0 = jpxFloorDivPow2(subband->x0, tileComp->codeBlockW);
- sby0 = jpxFloorDivPow2(subband->y0, tileComp->codeBlockH);
- cb = subband->cbs;
- for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
- for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
- cb->x0 = (sbx0 + cbX) << tileComp->codeBlockW;
- cb->x1 = cb->x0 + tileComp->cbW;
- if (subband->x0 > cb->x0) {
- cb->x0 = subband->x0;
- }
- if (subband->x1 < cb->x1) {
- cb->x1 = subband->x1;
- }
- cb->y0 = (sby0 + cbY) << tileComp->codeBlockH;
- cb->y1 = cb->y0 + tileComp->cbH;
- if (subband->y0 > cb->y0) {
- cb->y0 = subband->y0;
- }
- if (subband->y1 < cb->y1) {
- cb->y1 = subband->y1;
- }
- cb->seen = gFalse;
- cb->lBlock = 3;
- cb->nextPass = jpxPassCleanup;
- cb->nZeroBitPlanes = 0;
- cb->coeffs =
- (JPXCoeff *)gmallocn((1 << (tileComp->codeBlockW
- + tileComp->codeBlockH)),
- sizeof(JPXCoeff));
- for (cbi = 0;
- cbi < (Guint)(1 << (tileComp->codeBlockW
- + tileComp->codeBlockH));
- ++cbi) {
- cb->coeffs[cbi].flags = 0;
- cb->coeffs[cbi].len = 0;
- cb->coeffs[cbi].mag = 0;
- }
- cb->arithDecoder = NULL;
- cb->stats = NULL;
- ++cb;
- }
- }
- }
- }
- }
- }
- }
-
- return readTilePartData(tileIdx, tilePartLen, tilePartToEOC);
-}
-
-GBool JPXStream::readTilePartData(Guint tileIdx,
- Guint tilePartLen, GBool tilePartToEOC) {
- JPXTile *tile;
- JPXTileComp *tileComp;
- JPXResLevel *resLevel;
- JPXPrecinct *precinct;
- JPXSubband *subband;
- JPXCodeBlock *cb;
- Guint ttVal;
- Guint bits, cbX, cbY, nx, ny, i, j, n, sb;
- int level;
-
- tile = &img.tiles[tileIdx];
-
- // read all packets from this tile-part
- while (1) {
- if (tilePartToEOC) {
- //~ peek for an EOC marker
- cover(93);
- } else if (tilePartLen == 0) {
- break;
- }
-
- tileComp = &tile->tileComps[tile->comp];
- resLevel = &tileComp->resLevels[tile->res];
- precinct = &resLevel->precincts[tile->precinct];
-
- //----- packet header
-
- // setup
- startBitBuf(tilePartLen);
-
- // zero-length flag
- if (!readBits(1, &bits)) {
- goto err;
- }
- if (!bits) {
- // packet is empty -- clear all code-block inclusion flags
- cover(45);
- for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
- subband = &precinct->subbands[sb];
- for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
- for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
- cb = &subband->cbs[cbY * subband->nXCBs + cbX];
- cb->included = gFalse;
- }
- }
- }
- } else {
-
- for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
- subband = &precinct->subbands[sb];
- for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
- for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
- cb = &subband->cbs[cbY * subband->nXCBs + cbX];
-
- // skip code-blocks with no coefficients
- if (cb->x0 >= cb->x1 || cb->y0 >= cb->y1) {
- cover(46);
- cb->included = gFalse;
- continue;
- }
-
- // code-block inclusion
- if (cb->seen) {
- cover(47);
- if (!readBits(1, &cb->included)) {
- goto err;
- }
- } else {
- cover(48);
- ttVal = 0;
- i = 0;
- for (level = subband->maxTTLevel; level >= 0; --level) {
- nx = jpxCeilDivPow2(subband->nXCBs, level);
- ny = jpxCeilDivPow2(subband->nYCBs, level);
- j = i + (cbY >> level) * nx + (cbX >> level);
- if (!subband->inclusion[j].finished &&
- !subband->inclusion[j].val) {
- subband->inclusion[j].val = ttVal;
- } else {
- ttVal = subband->inclusion[j].val;
- }
- while (!subband->inclusion[j].finished &&
- ttVal <= tile->layer) {
- if (!readBits(1, &bits)) {
- goto err;
- }
- if (bits == 1) {
- subband->inclusion[j].finished = gTrue;
- } else {
- ++ttVal;
- }
- }
- subband->inclusion[j].val = ttVal;
- if (ttVal > tile->layer) {
- break;
- }
- i += nx * ny;
- }
- cb->included = level < 0;
- }
-
- if (cb->included) {
- cover(49);
-
- // zero bit-plane count
- if (!cb->seen) {
- cover(50);
- ttVal = 0;
- i = 0;
- for (level = subband->maxTTLevel; level >= 0; --level) {
- nx = jpxCeilDivPow2(subband->nXCBs, level);
- ny = jpxCeilDivPow2(subband->nYCBs, level);
- j = i + (cbY >> level) * nx + (cbX >> level);
- if (!subband->zeroBitPlane[j].finished &&
- !subband->zeroBitPlane[j].val) {
- subband->zeroBitPlane[j].val = ttVal;
- } else {
- ttVal = subband->zeroBitPlane[j].val;
- }
- while (!subband->zeroBitPlane[j].finished) {
- if (!readBits(1, &bits)) {
- goto err;
- }
- if (bits == 1) {
- subband->zeroBitPlane[j].finished = gTrue;
- } else {
- ++ttVal;
- }
- }
- subband->zeroBitPlane[j].val = ttVal;
- i += nx * ny;
- }
- cb->nZeroBitPlanes = ttVal;
- }
-
- // number of coding passes
- if (!readBits(1, &bits)) {
- goto err;
- }
- if (bits == 0) {
- cover(51);
- cb->nCodingPasses = 1;
- } else {
- if (!readBits(1, &bits)) {
- goto err;
- }
- if (bits == 0) {
- cover(52);
- cb->nCodingPasses = 2;
- } else {
- cover(53);
- if (!readBits(2, &bits)) {
- goto err;
- }
- if (bits < 3) {
- cover(54);
- cb->nCodingPasses = 3 + bits;
- } else {
- cover(55);
- if (!readBits(5, &bits)) {
- goto err;
- }
- if (bits < 31) {
- cover(56);
- cb->nCodingPasses = 6 + bits;
- } else {
- cover(57);
- if (!readBits(7, &bits)) {
- goto err;
- }
- cb->nCodingPasses = 37 + bits;
- }
- }
- }
- }
-
- // update Lblock
- while (1) {
- if (!readBits(1, &bits)) {
- goto err;
- }
- if (!bits) {
- break;
- }
- ++cb->lBlock;
- }
-
- // length of compressed data
- //~ deal with multiple codeword segments
- for (n = cb->lBlock, i = cb->nCodingPasses >> 1;
- i;
- ++n, i >>= 1) ;
- if (!readBits(n, &cb->dataLen)) {
- goto err;
- }
- }
- }
- }
- }
- }
- tilePartLen = finishBitBuf();
-
- //----- packet data
-
- for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
- subband = &precinct->subbands[sb];
- for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
- for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
- cb = &subband->cbs[cbY * subband->nXCBs + cbX];
- if (cb->included) {
- if (!readCodeBlockData(tileComp, resLevel, precinct, subband,
- tile->res, sb, cb)) {
- return gFalse;
- }
- tilePartLen -= cb->dataLen;
- cb->seen = gTrue;
- }
- }
- }
- }
-
- //----- next packet
-
- switch (tile->progOrder) {
- case 0: // layer, resolution level, component, precinct
- cover(58);
- if (++tile->comp == img.nComps) {
- tile->comp = 0;
- if (++tile->res == tile->maxNDecompLevels + 1) {
- tile->res = 0;
- if (++tile->layer == tile->nLayers) {
- tile->layer = 0;
- }
- }
- }
- break;
- case 1: // resolution level, layer, component, precinct
- cover(59);
- if (++tile->comp == img.nComps) {
- tile->comp = 0;
- if (++tile->layer == tile->nLayers) {
- tile->layer = 0;
- if (++tile->res == tile->maxNDecompLevels + 1) {
- tile->res = 0;
- }
- }
- }
- break;
- case 2: // resolution level, precinct, component, layer
- //~ this isn't correct -- see B.12.1.3
- cover(60);
- if (++tile->layer == tile->nLayers) {
- tile->layer = 0;
- if (++tile->comp == img.nComps) {
- tile->comp = 0;
- if (++tile->res == tile->maxNDecompLevels + 1) {
- tile->res = 0;
- }
- }
- }
- break;
- case 3: // precinct, component, resolution level, layer
- //~ this isn't correct -- see B.12.1.4
- cover(61);
- if (++tile->layer == tile->nLayers) {
- tile->layer = 0;
- if (++tile->res == tile->maxNDecompLevels + 1) {
- tile->res = 0;
- if (++tile->comp == img.nComps) {
- tile->comp = 0;
- }
- }
- }
- break;
- case 4: // component, precinct, resolution level, layer
- //~ this isn't correct -- see B.12.1.5
- cover(62);
- if (++tile->layer == tile->nLayers) {
- tile->layer = 0;
- if (++tile->res == tile->maxNDecompLevels + 1) {
- tile->res = 0;
- if (++tile->comp == img.nComps) {
- tile->comp = 0;
- }
- }
- }
- break;
- }
- }
-
- return gTrue;
-
- err:
- error(getPos(), "Error in JPX stream");
- return gFalse;
-}
-
-GBool JPXStream::readCodeBlockData(JPXTileComp *tileComp,
- JPXResLevel * /*resLevel*/,
- JPXPrecinct * /*precinct*/,
- JPXSubband * /*subband*/,
- Guint res, Guint sb,
- JPXCodeBlock *cb) {
- JPXCoeff *coeff0, *coeff1, *coeff;
- Guint horiz, vert, diag, all, cx, xorBit;
- int horizSign, vertSign;
- Guint i, x, y0, y1, y2;
-
- if (cb->arithDecoder) {
- cover(63);
- cb->arithDecoder->restart(cb->dataLen);
- } else {
- cover(64);
- cb->arithDecoder = new JArithmeticDecoder();
- cb->arithDecoder->setStream(str, cb->dataLen);
- cb->arithDecoder->start();
- cb->stats = new JArithmeticDecoderStats(jpxNContexts);
- cb->stats->setEntry(jpxContextSigProp, 4, 0);
- cb->stats->setEntry(jpxContextRunLength, 3, 0);
- cb->stats->setEntry(jpxContextUniform, 46, 0);
- }
-
- for (i = 0; i < cb->nCodingPasses; ++i) {
- switch (cb->nextPass) {
-
- //----- significance propagation pass
- case jpxPassSigProp:
- cover(65);
- for (y0 = cb->y0, coeff0 = cb->coeffs;
- y0 < cb->y1;
- y0 += 4, coeff0 += 4 << tileComp->codeBlockW) {
- for (x = cb->x0, coeff1 = coeff0;
- x < cb->x1;
- ++x, ++coeff1) {
- for (y1 = 0, coeff = coeff1;
- y1 < 4 && y0+y1 < cb->y1;
- ++y1, coeff += tileComp->cbW) {
- if (!(coeff->flags & jpxCoeffSignificant)) {
- horiz = vert = diag = 0;
- horizSign = vertSign = 2;
- if (x > cb->x0) {
- if (coeff[-1].flags & jpxCoeffSignificant) {
- ++horiz;
- horizSign += (coeff[-1].flags & jpxCoeffSign) ? -1 : 1;
- }
- if (y0+y1 > cb->y0) {
- diag += (coeff[-(int)tileComp->cbW - 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- diag += (coeff[tileComp->cbW - 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- }
- if (x < cb->x1 - 1) {
- if (coeff[1].flags & jpxCoeffSignificant) {
- ++horiz;
- horizSign += (coeff[1].flags & jpxCoeffSign) ? -1 : 1;
- }
- if (y0+y1 > cb->y0) {
- diag += (coeff[-(int)tileComp->cbW + 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- diag += (coeff[tileComp->cbW + 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- }
- if (y0+y1 > cb->y0) {
- if (coeff[-(int)tileComp->cbW].flags & jpxCoeffSignificant) {
- ++vert;
- vertSign += (coeff[-(int)tileComp->cbW].flags & jpxCoeffSign)
- ? -1 : 1;
- }
- }
- if (y0+y1 < cb->y1 - 1) {
- if (coeff[tileComp->cbW].flags & jpxCoeffSignificant) {
- ++vert;
- vertSign += (coeff[tileComp->cbW].flags & jpxCoeffSign)
- ? -1 : 1;
- }
- }
- cx = sigPropContext[horiz][vert][diag][res == 0 ? 1 : sb];
- if (cx != 0) {
- if (cb->arithDecoder->decodeBit(cx, cb->stats)) {
- coeff->flags |= jpxCoeffSignificant | jpxCoeffFirstMagRef;
- coeff->mag = (coeff->mag << 1) | 1;
- cx = signContext[horizSign][vertSign][0];
- xorBit = signContext[horizSign][vertSign][1];
- if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
- coeff->flags |= jpxCoeffSign;
- }
- }
- ++coeff->len;
- coeff->flags |= jpxCoeffTouched;
- }
- }
- }
- }
- }
- ++cb->nextPass;
- break;
-
- //----- magnitude refinement pass
- case jpxPassMagRef:
- cover(66);
- for (y0 = cb->y0, coeff0 = cb->coeffs;
- y0 < cb->y1;
- y0 += 4, coeff0 += 4 << tileComp->codeBlockW) {
- for (x = cb->x0, coeff1 = coeff0;
- x < cb->x1;
- ++x, ++coeff1) {
- for (y1 = 0, coeff = coeff1;
- y1 < 4 && y0+y1 < cb->y1;
- ++y1, coeff += tileComp->cbW) {
- if ((coeff->flags & jpxCoeffSignificant) &&
- !(coeff->flags & jpxCoeffTouched)) {
- if (coeff->flags & jpxCoeffFirstMagRef) {
- all = 0;
- if (x > cb->x0) {
- all += (coeff[-1].flags >> jpxCoeffSignificantB) & 1;
- if (y0+y1 > cb->y0) {
- all += (coeff[-(int)tileComp->cbW - 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- all += (coeff[tileComp->cbW - 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- }
- if (x < cb->x1 - 1) {
- all += (coeff[1].flags >> jpxCoeffSignificantB) & 1;
- if (y0+y1 > cb->y0) {
- all += (coeff[-(int)tileComp->cbW + 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- all += (coeff[tileComp->cbW + 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- }
- if (y0+y1 > cb->y0) {
- all += (coeff[-(int)tileComp->cbW].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- all += (coeff[tileComp->cbW].flags
- >> jpxCoeffSignificantB) & 1;
- }
- cx = all ? 15 : 14;
- } else {
- cx = 16;
- }
- coeff->mag = (coeff->mag << 1) |
- cb->arithDecoder->decodeBit(cx, cb->stats);
- ++coeff->len;
- coeff->flags |= jpxCoeffTouched;
- coeff->flags &= ~jpxCoeffFirstMagRef;
- }
- }
- }
- }
- ++cb->nextPass;
- break;
-
- //----- cleanup pass
- case jpxPassCleanup:
- cover(67);
- for (y0 = cb->y0, coeff0 = cb->coeffs;
- y0 < cb->y1;
- y0 += 4, coeff0 += 4 << tileComp->codeBlockW) {
- for (x = cb->x0, coeff1 = coeff0;
- x < cb->x1;
- ++x, ++coeff1) {
- y1 = 0;
- if (y0 + 3 < cb->y1 &&
- !(coeff1->flags & jpxCoeffTouched) &&
- !(coeff1[tileComp->cbW].flags & jpxCoeffTouched) &&
- !(coeff1[2 * tileComp->cbW].flags & jpxCoeffTouched) &&
- !(coeff1[3 * tileComp->cbW].flags & jpxCoeffTouched) &&
- (x == cb->x0 || y0 == cb->y0 ||
- !(coeff1[-(int)tileComp->cbW - 1].flags
- & jpxCoeffSignificant)) &&
- (y0 == cb->y0 ||
- !(coeff1[-(int)tileComp->cbW].flags
- & jpxCoeffSignificant)) &&
- (x == cb->x1 - 1 || y0 == cb->y0 ||
- !(coeff1[-(int)tileComp->cbW + 1].flags
- & jpxCoeffSignificant)) &&
- (x == cb->x0 ||
- (!(coeff1[-1].flags & jpxCoeffSignificant) &&
- !(coeff1[tileComp->cbW - 1].flags
- & jpxCoeffSignificant) &&
- !(coeff1[2 * tileComp->cbW - 1].flags
- & jpxCoeffSignificant) &&
- !(coeff1[3 * tileComp->cbW - 1].flags
- & jpxCoeffSignificant))) &&
- (x == cb->x1 - 1 ||
- (!(coeff1[1].flags & jpxCoeffSignificant) &&
- !(coeff1[tileComp->cbW + 1].flags
- & jpxCoeffSignificant) &&
- !(coeff1[2 * tileComp->cbW + 1].flags
- & jpxCoeffSignificant) &&
- !(coeff1[3 * tileComp->cbW + 1].flags
- & jpxCoeffSignificant))) &&
- (x == cb->x0 || y0+4 == cb->y1 ||
- !(coeff1[4 * tileComp->cbW - 1].flags & jpxCoeffSignificant)) &&
- (y0+4 == cb->y1 ||
- !(coeff1[4 * tileComp->cbW].flags & jpxCoeffSignificant)) &&
- (x == cb->x1 - 1 || y0+4 == cb->y1 ||
- !(coeff1[4 * tileComp->cbW + 1].flags
- & jpxCoeffSignificant))) {
- if (cb->arithDecoder->decodeBit(jpxContextRunLength, cb->stats)) {
- y1 = cb->arithDecoder->decodeBit(jpxContextUniform, cb->stats);
- y1 = (y1 << 1) |
- cb->arithDecoder->decodeBit(jpxContextUniform, cb->stats);
- for (y2 = 0, coeff = coeff1;
- y2 < y1;
- ++y2, coeff += tileComp->cbW) {
- ++coeff->len;
- }
- coeff->flags |= jpxCoeffSignificant | jpxCoeffFirstMagRef;
- coeff->mag = (coeff->mag << 1) | 1;
- ++coeff->len;
- cx = signContext[2][2][0];
- xorBit = signContext[2][2][1];
- if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
- coeff->flags |= jpxCoeffSign;
- }
- ++y1;
- } else {
- for (y1 = 0, coeff = coeff1;
- y1 < 4;
- ++y1, coeff += tileComp->cbW) {
- ++coeff->len;
- }
- y1 = 4;
- }
- }
- for (coeff = &coeff1[y1 << tileComp->codeBlockW];
- y1 < 4 && y0 + y1 < cb->y1;
- ++y1, coeff += tileComp->cbW) {
- if (!(coeff->flags & jpxCoeffTouched)) {
- horiz = vert = diag = 0;
- horizSign = vertSign = 2;
- if (x > cb->x0) {
- if (coeff[-1].flags & jpxCoeffSignificant) {
- ++horiz;
- horizSign += (coeff[-1].flags & jpxCoeffSign) ? -1 : 1;
- }
- if (y0+y1 > cb->y0) {
- diag += (coeff[-(int)tileComp->cbW - 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- diag += (coeff[tileComp->cbW - 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- }
- if (x < cb->x1 - 1) {
- if (coeff[1].flags & jpxCoeffSignificant) {
- ++horiz;
- horizSign += (coeff[1].flags & jpxCoeffSign) ? -1 : 1;
- }
- if (y0+y1 > cb->y0) {
- diag += (coeff[-(int)tileComp->cbW + 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- if (y0+y1 < cb->y1 - 1) {
- diag += (coeff[tileComp->cbW + 1].flags
- >> jpxCoeffSignificantB) & 1;
- }
- }
- if (y0+y1 > cb->y0) {
- if (coeff[-(int)tileComp->cbW].flags & jpxCoeffSignificant) {
- ++vert;
- vertSign += (coeff[-(int)tileComp->cbW].flags & jpxCoeffSign)
- ? -1 : 1;
- }
- }
- if (y0+y1 < cb->y1 - 1) {
- if (coeff[tileComp->cbW].flags & jpxCoeffSignificant) {
- ++vert;
- vertSign += (coeff[tileComp->cbW].flags & jpxCoeffSign)
- ? -1 : 1;
- }
- }
- cx = sigPropContext[horiz][vert][diag][res == 0 ? 1 : sb];
- if (cb->arithDecoder->decodeBit(cx, cb->stats)) {
- coeff->flags |= jpxCoeffSignificant | jpxCoeffFirstMagRef;
- coeff->mag = (coeff->mag << 1) | 1;
- cx = signContext[horizSign][vertSign][0];
- xorBit = signContext[horizSign][vertSign][1];
- if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
- coeff->flags |= jpxCoeffSign;
- }
- }
- ++coeff->len;
- } else {
- coeff->flags &= ~jpxCoeffTouched;
- }
- }
- }
- }
- cb->nextPass = jpxPassSigProp;
- break;
- }
- }
-
- cb->arithDecoder->cleanup();
- return gTrue;
-}
-
-// Inverse quantization, and wavelet transform (IDWT). This also does
-// the initial shift to convert to fixed point format.
-void JPXStream::inverseTransform(JPXTileComp *tileComp) {
- JPXResLevel *resLevel;
- JPXPrecinct *precinct;
- JPXSubband *subband;
- JPXCodeBlock *cb;
- JPXCoeff *coeff0, *coeff;
- Guint qStyle, guard, eps, shift;
- int shift2;
- double mu;
- int val;
- int *dataPtr;
- Guint nx0, ny0, nx1, ny1;
- Guint r, cbX, cbY, x, y;
-
- cover(68);
-
- //----- (NL)LL subband (resolution level 0)
-
- resLevel = &tileComp->resLevels[0];
- precinct = &resLevel->precincts[0];
- subband = &precinct->subbands[0];
-
- // i-quant parameters
- qStyle = tileComp->quantStyle & 0x1f;
- guard = (tileComp->quantStyle >> 5) & 7;
- if (qStyle == 0) {
- cover(69);
- eps = (tileComp->quantSteps[0] >> 3) & 0x1f;
- shift = guard + eps - 1;
- mu = 0; // make gcc happy
- } else {
- cover(70);
- shift = guard - 1 + tileComp->prec;
- mu = (double)(0x800 + (tileComp->quantSteps[0] & 0x7ff)) / 2048.0;
- }
- if (tileComp->transform == 0) {
- cover(71);
- shift += fracBits;
- }
-
- // copy (NL)LL into the upper-left corner of the data array, doing
- // the fixed point adjustment and dequantization along the way
- cb = subband->cbs;
- for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
- for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
- for (y = cb->y0, coeff0 = cb->coeffs;
- y < cb->y1;
- ++y, coeff0 += tileComp->cbW) {
- dataPtr = &tileComp->data[(y - subband->y0)
- * (tileComp->x1 - tileComp->x0)
- + (cb->x0 - subband->x0)];
- for (x = cb->x0, coeff = coeff0; x < cb->x1; ++x, ++coeff) {
- val = (int)coeff->mag;
- if (val != 0) {
- shift2 = shift - (cb->nZeroBitPlanes + coeff->len);
- if (shift2 > 0) {
- cover(94);
- val = (val << shift2) + (1 << (shift2 - 1));
- } else {
- cover(95);
- val >>= -shift2;
- }
- if (qStyle == 0) {
- cover(96);
- if (tileComp->transform == 0) {
- cover(97);
- val &= -1 << fracBits;
- }
- } else {
- cover(98);
- val = (int)((double)val * mu);
- }
- if (coeff->flags & jpxCoeffSign) {
- cover(99);
- val = -val;
- }
- }
- *dataPtr++ = val;
- }
- }
- ++cb;
- }
- }
-
- //----- IDWT for each level
-
- for (r = 1; r <= tileComp->nDecompLevels; ++r) {
- resLevel = &tileComp->resLevels[r];
-
- // (n)LL is already in the upper-left corner of the
- // tile-component data array -- interleave with (n)HL/LH/HH
- // and inverse transform to get (n-1)LL, which will be stored
- // in the upper-left corner of the tile-component data array
- if (r == tileComp->nDecompLevels) {
- cover(72);
- nx0 = tileComp->x0;
- ny0 = tileComp->y0;
- nx1 = tileComp->x1;
- ny1 = tileComp->y1;
- } else {
- cover(73);
- nx0 = tileComp->resLevels[r+1].x0;
- ny0 = tileComp->resLevels[r+1].y0;
- nx1 = tileComp->resLevels[r+1].x1;
- ny1 = tileComp->resLevels[r+1].y1;
- }
- inverseTransformLevel(tileComp, r, resLevel, nx0, ny0, nx1, ny1);
- }
-}
-
-// Do one level of the inverse transform:
-// - take (n)LL from the tile-component data array
-// - take (n)HL/LH/HH from <resLevel>
-// - leave the resulting (n-1)LL in the tile-component data array
-void JPXStream::inverseTransformLevel(JPXTileComp *tileComp,
- Guint r, JPXResLevel *resLevel,
- Guint nx0, Guint ny0,
- Guint nx1, Guint ny1) {
- JPXPrecinct *precinct;
- JPXSubband *subband;
- JPXCodeBlock *cb;
- JPXCoeff *coeff0, *coeff;
- Guint qStyle, guard, eps, shift, t;
- int shift2;
- double mu;
- int val;
- int *dataPtr;
- Guint xo, yo;
- Guint x, y, sb, cbX, cbY;
- int xx, yy;
-
- //----- interleave
-
- // spread out LL
- for (yy = resLevel->y1 - 1; yy >= (int)resLevel->y0; --yy) {
- for (xx = resLevel->x1 - 1; xx >= (int)resLevel->x0; --xx) {
- tileComp->data[(2 * yy - ny0) * (tileComp->x1 - tileComp->x0)
- + (2 * xx - nx0)] =
- tileComp->data[(yy - resLevel->y0) * (tileComp->x1 - tileComp->x0)
- + (xx - resLevel->x0)];
- }
- }
-
- // i-quant parameters
- qStyle = tileComp->quantStyle & 0x1f;
- guard = (tileComp->quantStyle >> 5) & 7;
-
- // interleave HL/LH/HH
- precinct = &resLevel->precincts[0];
- for (sb = 0; sb < 3; ++sb) {
-
- // i-quant parameters
- if (qStyle == 0) {
- cover(100);
- eps = (tileComp->quantSteps[3*r - 2 + sb] >> 3) & 0x1f;
- shift = guard + eps - 1;
- mu = 0; // make gcc happy
- } else {
- cover(101);
- shift = guard + tileComp->prec;
- if (sb == 2) {
- cover(102);
- ++shift;
- }
- t = tileComp->quantSteps[qStyle == 1 ? 0 : (3*r - 2 + sb)];
- mu = (double)(0x800 + (t & 0x7ff)) / 2048.0;
- }
- if (tileComp->transform == 0) {
- cover(103);
- shift += fracBits;
- }
-
- // copy the subband coefficients into the data array, doing the
- // fixed point adjustment and dequantization along the way
- xo = (sb & 1) ? 0 : 1;
- yo = (sb > 0) ? 1 : 0;
- subband = &precinct->subbands[sb];
- cb = subband->cbs;
- for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
- for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
- for (y = cb->y0, coeff0 = cb->coeffs;
- y < cb->y1;
- ++y, coeff0 += tileComp->cbW) {
- dataPtr = &tileComp->data[(2 * y + yo - ny0)
- * (tileComp->x1 - tileComp->x0)
- + (2 * cb->x0 + xo - nx0)];
- for (x = cb->x0, coeff = coeff0; x < cb->x1; ++x, ++coeff) {
- val = (int)coeff->mag;
- if (val != 0) {
- shift2 = shift - (cb->nZeroBitPlanes + coeff->len);
- if (shift2 > 0) {
- cover(74);
- val = (val << shift2) + (1 << (shift2 - 1));
- } else {
- cover(75);
- val >>= -shift2;
- }
- if (qStyle == 0) {
- cover(76);
- if (tileComp->transform == 0) {
- val &= -1 << fracBits;
- }
- } else {
- cover(77);
- val = (int)((double)val * mu);
- }
- if (coeff->flags & jpxCoeffSign) {
- cover(78);
- val = -val;
- }
- }
- *dataPtr = val;
- dataPtr += 2;
- }
- }
- ++cb;
- }
- }
- }
-
- //----- horizontal (row) transforms
- dataPtr = tileComp->data;
- for (y = 0; y < ny1 - ny0; ++y) {
- inverseTransform1D(tileComp, dataPtr, 1, nx0, nx1);
- dataPtr += tileComp->x1 - tileComp->x0;
- }
-
- //----- vertical (column) transforms
- dataPtr = tileComp->data;
- for (x = 0; x < nx1 - nx0; ++x) {
- inverseTransform1D(tileComp, dataPtr,
- tileComp->x1 - tileComp->x0, ny0, ny1);
- ++dataPtr;
- }
-}
-
-void JPXStream::inverseTransform1D(JPXTileComp *tileComp,
- int *data, Guint stride,
- Guint i0, Guint i1) {
- int *buf;
- Guint offset, end, i;
-
- //----- special case for length = 1
- if (i1 - i0 == 1) {
- cover(79);
- if (i0 & 1) {
- cover(104);
- *data >>= 1;
- }
-
- } else {
- cover(80);
-
- // choose an offset: this makes even buf[] indexes correspond to
- // odd values of i, and vice versa
- offset = 3 + (i0 & 1);
- end = offset + i1 - i0;
-
- //----- gather
- buf = tileComp->buf;
- for (i = 0; i < i1 - i0; ++i) {
- buf[offset + i] = data[i * stride];
- }
-
- //----- extend right
- buf[end] = buf[end - 2];
- if (i1 - i0 == 2) {
- cover(81);
- buf[end+1] = buf[offset + 1];
- buf[end+2] = buf[offset];
- buf[end+3] = buf[offset + 1];
- } else {
- cover(82);
- buf[end+1] = buf[end - 3];
- if (i1 - i0 == 3) {
- cover(105);
- buf[end+2] = buf[offset + 1];
- buf[end+3] = buf[offset + 2];
- } else {
- cover(106);
- buf[end+2] = buf[end - 4];
- if (i1 - i0 == 4) {
- cover(107);
- buf[end+3] = buf[offset + 1];
- } else {
- cover(108);
- buf[end+3] = buf[end - 5];
- }
- }
- }
-
- //----- extend left
- buf[offset - 1] = buf[offset + 1];
- buf[offset - 2] = buf[offset + 2];
- buf[offset - 3] = buf[offset + 3];
- if (offset == 4) {
- cover(83);
- buf[0] = buf[offset + 4];
- }
-
- //----- 9-7 irreversible filter
-
- if (tileComp->transform == 0) {
- cover(84);
- // step 1 (even)
- for (i = 1; i <= end + 2; i += 2) {
- buf[i] = (int)(idwtKappa * buf[i]);
- }
- // step 2 (odd)
- for (i = 0; i <= end + 3; i += 2) {
- buf[i] = (int)(idwtIKappa * buf[i]);
- }
- // step 3 (even)
- for (i = 1; i <= end + 2; i += 2) {
- buf[i] = (int)(buf[i] - idwtDelta * (buf[i-1] + buf[i+1]));
- }
- // step 4 (odd)
- for (i = 2; i <= end + 1; i += 2) {
- buf[i] = (int)(buf[i] - idwtGamma * (buf[i-1] + buf[i+1]));
- }
- // step 5 (even)
- for (i = 3; i <= end; i += 2) {
- buf[i] = (int)(buf[i] - idwtBeta * (buf[i-1] + buf[i+1]));
- }
- // step 6 (odd)
- for (i = 4; i <= end - 1; i += 2) {
- buf[i] = (int)(buf[i] - idwtAlpha * (buf[i-1] + buf[i+1]));
- }
-
- //----- 5-3 reversible filter
-
- } else {
- cover(85);
- // step 1 (even)
- for (i = 3; i <= end; i += 2) {
- buf[i] -= (buf[i-1] + buf[i+1] + 2) >> 2;
- }
- // step 2 (odd)
- for (i = 4; i < end; i += 2) {
- buf[i] += (buf[i-1] + buf[i+1]) >> 1;
- }
- }
-
- //----- scatter
- for (i = 0; i < i1 - i0; ++i) {
- data[i * stride] = buf[offset + i];
- }
- }
-}
-
-// Inverse multi-component transform and DC level shift. This also
-// converts fixed point samples back to integers.
-GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
- JPXTileComp *tileComp;
- int coeff, d0, d1, d2, t, minVal, maxVal, zeroVal;
- int *dataPtr;
- Guint j, comp, x, y;
-
- //----- inverse multi-component transform
-
- if (tile->multiComp == 1) {
- cover(86);
- if (img.nComps < 3 ||
- tile->tileComps[0].hSep != tile->tileComps[1].hSep ||
- tile->tileComps[0].vSep != tile->tileComps[1].vSep ||
- tile->tileComps[1].hSep != tile->tileComps[2].hSep ||
- tile->tileComps[1].vSep != tile->tileComps[2].vSep) {
- return gFalse;
- }
-
- // inverse irreversible multiple component transform
- if (tile->tileComps[0].transform == 0) {
- cover(87);
- j = 0;
- for (y = 0; y < tile->tileComps[0].y1 - tile->tileComps[0].y0; ++y) {
- for (x = 0; x < tile->tileComps[0].x1 - tile->tileComps[0].x0; ++x) {
- d0 = tile->tileComps[0].data[j];
- d1 = tile->tileComps[1].data[j];
- d2 = tile->tileComps[2].data[j];
- tile->tileComps[0].data[j] = (int)(d0 + 1.402 * d2 + 0.5);
- tile->tileComps[1].data[j] =
- (int)(d0 - 0.34413 * d1 - 0.71414 * d2 + 0.5);
- tile->tileComps[2].data[j] = (int)(d0 + 1.772 * d1 + 0.5);
- ++j;
- }
- }
-
- // inverse reversible multiple component transform
- } else {
- cover(88);
- j = 0;
- for (y = 0; y < tile->tileComps[0].y1 - tile->tileComps[0].y0; ++y) {
- for (x = 0; x < tile->tileComps[0].x1 - tile->tileComps[0].x0; ++x) {
- d0 = tile->tileComps[0].data[j];
- d1 = tile->tileComps[1].data[j];
- d2 = tile->tileComps[2].data[j];
- tile->tileComps[1].data[j] = t = d0 - ((d2 + d1) >> 2);
- tile->tileComps[0].data[j] = d2 + t;
- tile->tileComps[2].data[j] = d1 + t;
- ++j;
- }
- }
- }
- }
-
- //----- DC level shift
- for (comp = 0; comp < img.nComps; ++comp) {
- tileComp = &tile->tileComps[comp];
-
- // signed: clip
- if (tileComp->sgned) {
- cover(89);
- minVal = -(1 << (tileComp->prec - 1));
- maxVal = (1 << (tileComp->prec - 1)) - 1;
- dataPtr = tileComp->data;
- for (y = 0; y < tileComp->y1 - tileComp->y0; ++y) {
- for (x = 0; x < tileComp->x1 - tileComp->x0; ++x) {
- coeff = *dataPtr;
- if (tileComp->transform == 0) {
- cover(109);
- coeff >>= fracBits;
- }
- if (coeff < minVal) {
- cover(110);
- coeff = minVal;
- } else if (coeff > maxVal) {
- cover(111);
- coeff = maxVal;
- }
- *dataPtr++ = coeff;
- }
- }
-
- // unsigned: inverse DC level shift and clip
- } else {
- cover(90);
- maxVal = (1 << tileComp->prec) - 1;
- zeroVal = 1 << (tileComp->prec - 1);
- dataPtr = tileComp->data;
- for (y = 0; y < tileComp->y1 - tileComp->y0; ++y) {
- for (x = 0; x < tileComp->x1 - tileComp->x0; ++x) {
- coeff = *dataPtr;
- if (tileComp->transform == 0) {
- cover(112);
- coeff >>= fracBits;
- }
- coeff += zeroVal;
- if (coeff < 0) {
- cover(113);
- coeff = 0;
- } else if (coeff > maxVal) {
- cover(114);
- coeff = maxVal;
- }
- *dataPtr++ = coeff;
- }
- }
- }
- }
-
- return gTrue;
-}
-
-GBool JPXStream::readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
- Guint len, lenH;
-
- if (!readULong(&len) ||
- !readULong(boxType)) {
- return gFalse;
- }
- if (len == 1) {
- if (!readULong(&lenH) || !readULong(&len)) {
- return gFalse;
- }
- if (lenH) {
- error(getPos(), "JPX stream contains a box larger than 2^32 bytes");
- return gFalse;
- }
- *boxLen = len;
- *dataLen = len - 16;
- } else if (len == 0) {
- *boxLen = 0;
- *dataLen = 0;
- } else {
- *boxLen = len;
- *dataLen = len - 8;
- }
- return gTrue;
-}
-
-int JPXStream::readMarkerHdr(int *segType, Guint *segLen) {
- int c;
-
- do {
- do {
- if ((c = str->getChar()) == EOF) {
- return gFalse;
- }
- } while (c != 0xff);
- do {
- if ((c = str->getChar()) == EOF) {
- return gFalse;
- }
- } while (c == 0xff);
- } while (c == 0x00);
- *segType = c;
- if ((c >= 0x30 && c <= 0x3f) ||
- c == 0x4f || c == 0x92 || c == 0x93 || c == 0xd9) {
- *segLen = 0;
- return gTrue;
- }
- return readUWord(segLen);
-}
-
-GBool JPXStream::readUByte(Guint *x) {
- int c0;
-
- if ((c0 = str->getChar()) == EOF) {
- return gFalse;
- }
- *x = (Guint)c0;
- return gTrue;
-}
-
-GBool JPXStream::readByte(int *x) {
- int c0;
-
- if ((c0 = str->getChar()) == EOF) {
- return gFalse;
- }
- *x = c0;
- if (c0 & 0x80) {
- *x |= -1 - 0xff;
- }
- return gTrue;
-}
-
-GBool JPXStream::readUWord(Guint *x) {
- int c0, c1;
-
- if ((c0 = str->getChar()) == EOF ||
- (c1 = str->getChar()) == EOF) {
- return gFalse;
- }
- *x = (Guint)((c0 << 8) | c1);
- return gTrue;
-}
-
-GBool JPXStream::readULong(Guint *x) {
- int c0, c1, c2, c3;
-
- if ((c0 = str->getChar()) == EOF ||
- (c1 = str->getChar()) == EOF ||
- (c2 = str->getChar()) == EOF ||
- (c3 = str->getChar()) == EOF) {
- return gFalse;
- }
- *x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
- return gTrue;
-}
-
-GBool JPXStream::readNBytes(int nBytes, GBool signd, int *x) {
- int y, c, i;
-
- y = 0;
- for (i = 0; i < nBytes; ++i) {
- if ((c = str->getChar()) == EOF) {
- return gFalse;
- }
- y = (y << 8) + c;
- }
- if (signd) {
- if (y & (1 << (8 * nBytes - 1))) {
- y |= -1 << (8 * nBytes);
- }
- }
- *x = y;
- return gTrue;
-}
-
-GBool JPXStream::readBits(int nBits, Guint *x) {
- int c;
-
- while (bitBufLen < nBits) {
- if (byteCount == 0 || (c = str->getChar()) == EOF) {
- return gFalse;
- }
- --byteCount;
- if (bitBufSkip) {
- bitBuf = (bitBuf << 7) | (c & 0x7f);
- bitBufLen += 7;
- } else {
- bitBuf = (bitBuf << 8) | (c & 0xff);
- bitBufLen += 8;
- }
- bitBufSkip = c == 0xff;
- }
- *x = (bitBuf >> (bitBufLen - nBits)) & ((1 << nBits) - 1);
- bitBufLen -= nBits;
- return gTrue;
-}
-
-void JPXStream::startBitBuf(Guint byteCountA) {
- bitBufLen = 0;
- bitBufSkip = gFalse;
- byteCount = byteCountA;
-}
-
-Guint JPXStream::finishBitBuf() {
- if (bitBufSkip) {
- str->getChar();
- --byteCount;
- }
- return byteCount;
-}
diff --git a/kpdf/xpdf/xpdf/JPXStream.cpp b/kpdf/xpdf/xpdf/JPXStream.cpp
new file mode 100644
index 00000000..93b46471
--- /dev/null
+++ b/kpdf/xpdf/xpdf/JPXStream.cpp
@@ -0,0 +1,3144 @@
+//========================================================================
+//
+// JPXStream.cpp
+//
+// Copyright 2002-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <limits.h>
+#include "gmem.h"
+#include "Error.h"
+#include "JArithmeticDecoder.h"
+#include "JPXStream.h"
+
+//~ to do:
+// - precincts
+// - ROI
+// - progression order changes
+// - packed packet headers
+// - support for palettes, channel maps, etc.
+// - make sure all needed JP2/JPX subboxes are parsed (readBoxes)
+// - can we assume that QCC segments must come after the QCD segment?
+// - skip EPH markers (readTilePartData)
+// - handle tilePartToEOC in readTilePartData
+// - deal with multiple codeword segments (readTilePartData,
+// readCodeBlockData)
+// - progression orders 2, 3, and 4
+// - in coefficient decoding (readCodeBlockData):
+// - termination pattern: terminate after every coding pass
+// - error resilience segmentation symbol
+// - selective arithmetic coding bypass
+// - vertically causal context formation
+// - coeffs longer than 31 bits (should just ignore the extra bits?)
+// - handle boxes larger than 2^32 bytes
+// - the fixed-point arithmetic won't handle 16-bit pixels
+
+//------------------------------------------------------------------------
+
+// number of contexts for the arithmetic decoder
+#define jpxNContexts 19
+
+#define jpxContextSigProp 0 // 0 - 8: significance prop and cleanup
+#define jpxContextSign 9 // 9 - 13: sign
+#define jpxContextMagRef 14 // 14 -16: magnitude refinement
+#define jpxContextRunLength 17 // cleanup: run length
+#define jpxContextUniform 18 // cleanup: first signif coeff
+
+//------------------------------------------------------------------------
+
+#define jpxPassSigProp 0
+#define jpxPassMagRef 1
+#define jpxPassCleanup 2
+
+//------------------------------------------------------------------------
+
+// arithmetic decoder context for the significance propagation and
+// cleanup passes:
+// [horiz][vert][diag][subband]
+// where subband = 0 for HL
+// = 1 for LH and LL
+// = 2 for HH
+static Guint sigPropContext[3][3][5][3] = {
+ {{{ 0, 0, 0 }, // horiz=0, vert=0, diag=0
+ { 1, 1, 3 }, // horiz=0, vert=0, diag=1
+ { 2, 2, 6 }, // horiz=0, vert=0, diag=2
+ { 2, 2, 8 }, // horiz=0, vert=0, diag=3
+ { 2, 2, 8 }}, // horiz=0, vert=0, diag=4
+ {{ 5, 3, 1 }, // horiz=0, vert=1, diag=0
+ { 6, 3, 4 }, // horiz=0, vert=1, diag=1
+ { 6, 3, 7 }, // horiz=0, vert=1, diag=2
+ { 6, 3, 8 }, // horiz=0, vert=1, diag=3
+ { 6, 3, 8 }}, // horiz=0, vert=1, diag=4
+ {{ 8, 4, 2 }, // horiz=0, vert=2, diag=0
+ { 8, 4, 5 }, // horiz=0, vert=2, diag=1
+ { 8, 4, 7 }, // horiz=0, vert=2, diag=2
+ { 8, 4, 8 }, // horiz=0, vert=2, diag=3
+ { 8, 4, 8 }}}, // horiz=0, vert=2, diag=4
+ {{{ 3, 5, 1 }, // horiz=1, vert=0, diag=0
+ { 3, 6, 4 }, // horiz=1, vert=0, diag=1
+ { 3, 6, 7 }, // horiz=1, vert=0, diag=2
+ { 3, 6, 8 }, // horiz=1, vert=0, diag=3
+ { 3, 6, 8 }}, // horiz=1, vert=0, diag=4
+ {{ 7, 7, 2 }, // horiz=1, vert=1, diag=0
+ { 7, 7, 5 }, // horiz=1, vert=1, diag=1
+ { 7, 7, 7 }, // horiz=1, vert=1, diag=2
+ { 7, 7, 8 }, // horiz=1, vert=1, diag=3
+ { 7, 7, 8 }}, // horiz=1, vert=1, diag=4
+ {{ 8, 7, 2 }, // horiz=1, vert=2, diag=0
+ { 8, 7, 5 }, // horiz=1, vert=2, diag=1
+ { 8, 7, 7 }, // horiz=1, vert=2, diag=2
+ { 8, 7, 8 }, // horiz=1, vert=2, diag=3
+ { 8, 7, 8 }}}, // horiz=1, vert=2, diag=4
+ {{{ 4, 8, 2 }, // horiz=2, vert=0, diag=0
+ { 4, 8, 5 }, // horiz=2, vert=0, diag=1
+ { 4, 8, 7 }, // horiz=2, vert=0, diag=2
+ { 4, 8, 8 }, // horiz=2, vert=0, diag=3
+ { 4, 8, 8 }}, // horiz=2, vert=0, diag=4
+ {{ 7, 8, 2 }, // horiz=2, vert=1, diag=0
+ { 7, 8, 5 }, // horiz=2, vert=1, diag=1
+ { 7, 8, 7 }, // horiz=2, vert=1, diag=2
+ { 7, 8, 8 }, // horiz=2, vert=1, diag=3
+ { 7, 8, 8 }}, // horiz=2, vert=1, diag=4
+ {{ 8, 8, 2 }, // horiz=2, vert=2, diag=0
+ { 8, 8, 5 }, // horiz=2, vert=2, diag=1
+ { 8, 8, 7 }, // horiz=2, vert=2, diag=2
+ { 8, 8, 8 }, // horiz=2, vert=2, diag=3
+ { 8, 8, 8 }}} // horiz=2, vert=2, diag=4
+};
+
+// arithmetic decoder context and xor bit for the sign bit in the
+// significance propagation pass:
+// [horiz][vert][k]
+// where horiz/vert are offset by 2 (i.e., range is -2 .. 2)
+// and k = 0 for the context
+// = 1 for the xor bit
+static Guint signContext[5][5][2] = {
+ {{ 13, 1 }, // horiz=-2, vert=-2
+ { 13, 1 }, // horiz=-2, vert=-1
+ { 12, 1 }, // horiz=-2, vert= 0
+ { 11, 1 }, // horiz=-2, vert=+1
+ { 11, 1 }}, // horiz=-2, vert=+2
+ {{ 13, 1 }, // horiz=-1, vert=-2
+ { 13, 1 }, // horiz=-1, vert=-1
+ { 12, 1 }, // horiz=-1, vert= 0
+ { 11, 1 }, // horiz=-1, vert=+1
+ { 11, 1 }}, // horiz=-1, vert=+2
+ {{ 10, 1 }, // horiz= 0, vert=-2
+ { 10, 1 }, // horiz= 0, vert=-1
+ { 9, 0 }, // horiz= 0, vert= 0
+ { 10, 0 }, // horiz= 0, vert=+1
+ { 10, 0 }}, // horiz= 0, vert=+2
+ {{ 11, 0 }, // horiz=+1, vert=-2
+ { 11, 0 }, // horiz=+1, vert=-1
+ { 12, 0 }, // horiz=+1, vert= 0
+ { 13, 0 }, // horiz=+1, vert=+1
+ { 13, 0 }}, // horiz=+1, vert=+2
+ {{ 11, 0 }, // horiz=+2, vert=-2
+ { 11, 0 }, // horiz=+2, vert=-1
+ { 12, 0 }, // horiz=+2, vert= 0
+ { 13, 0 }, // horiz=+2, vert=+1
+ { 13, 0 }}, // horiz=+2, vert=+2
+};
+
+//------------------------------------------------------------------------
+
+// constants used in the IDWT
+#define idwtAlpha -1.586134342059924
+#define idwtBeta -0.052980118572961
+#define idwtGamma 0.882911075530934
+#define idwtDelta 0.443506852043971
+#define idwtKappa 1.230174104914001
+#define idwtIKappa (1.0 / idwtKappa)
+
+// number of bits to the right of the decimal point for the fixed
+// point arithmetic used in the IDWT
+#define fracBits 16
+
+//------------------------------------------------------------------------
+
+// floor(x / y)
+#define jpxFloorDiv(x, y) ((x) / (y))
+
+// floor(x / 2^y)
+#define jpxFloorDivPow2(x, y) ((x) >> (y))
+
+// ceil(x / y)
+#define jpxCeilDiv(x, y) (((x) + (y) - 1) / (y))
+
+// ceil(x / 2^y)
+#define jpxCeilDivPow2(x, y) (((x) + (1 << (y)) - 1) >> (y))
+
+//------------------------------------------------------------------------
+
+#if 1 //----- disable coverage tracking
+
+#define cover(idx)
+
+#else //----- enable coverage tracking
+
+class JPXCover {
+public:
+
+ JPXCover(int sizeA);
+ ~JPXCover();
+ void incr(int idx);
+
+private:
+
+ int size, used;
+ int *data;
+};
+
+JPXCover::JPXCover(int sizeA) {
+ size = sizeA;
+ used = -1;
+ data = (int *)gmallocn(size, sizeof(int));
+ memset(data, 0, size * sizeof(int));
+}
+
+JPXCover::~JPXCover() {
+ int i;
+
+ printf("JPX coverage:\n");
+ for (i = 0; i <= used; ++i) {
+ printf(" %4d: %8d\n", i, data[i]);
+ }
+ gfree(data);
+}
+
+void JPXCover::incr(int idx) {
+ if (idx < size) {
+ ++data[idx];
+ if (idx > used) {
+ used = idx;
+ }
+ }
+}
+
+JPXCover jpxCover(150);
+
+#define cover(idx) jpxCover.incr(idx)
+
+#endif //----- coverage tracking
+
+//------------------------------------------------------------------------
+
+JPXStream::JPXStream(Stream *strA):
+ FilterStream(strA)
+{
+ nComps = 0;
+ bpc = NULL;
+ width = height = 0;
+ haveCS = gFalse;
+ havePalette = gFalse;
+ haveCompMap = gFalse;
+ haveChannelDefn = gFalse;
+
+ img.tiles = NULL;
+ bitBuf = 0;
+ bitBufLen = 0;
+ bitBufSkip = gFalse;
+ byteCount = 0;
+}
+
+JPXStream::~JPXStream() {
+ close();
+ delete str;
+}
+
+void JPXStream::reset() {
+ str->reset();
+ if (readBoxes()) {
+ curY = img.yOffset;
+ } else {
+ // readBoxes reported an error, so we go immediately to EOF
+ curY = img.ySize;
+ }
+ curX = img.xOffset;
+ curComp = 0;
+ readBufLen = 0;
+}
+
+void JPXStream::close() {
+ JPXTile *tile;
+ JPXTileComp *tileComp;
+ JPXResLevel *resLevel;
+ JPXPrecinct *precinct;
+ JPXSubband *subband;
+ JPXCodeBlock *cb;
+ Guint comp, i, k, r, pre, sb;
+
+ gfree(bpc);
+ bpc = NULL;
+ if (havePalette) {
+ gfree(palette.bpc);
+ gfree(palette.c);
+ havePalette = gFalse;
+ }
+ if (haveCompMap) {
+ gfree(compMap.comp);
+ gfree(compMap.type);
+ gfree(compMap.pComp);
+ haveCompMap = gFalse;
+ }
+ if (haveChannelDefn) {
+ gfree(channelDefn.idx);
+ gfree(channelDefn.type);
+ gfree(channelDefn.assoc);
+ haveChannelDefn = gFalse;
+ }
+
+ if (img.tiles) {
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ tile = &img.tiles[i];
+ if (tile->tileComps) {
+ for (comp = 0; comp < img.nComps; ++comp) {
+ tileComp = &tile->tileComps[comp];
+ gfree(tileComp->quantSteps);
+ gfree(tileComp->data);
+ gfree(tileComp->buf);
+ if (tileComp->resLevels) {
+ for (r = 0; r <= tileComp->nDecompLevels; ++r) {
+ resLevel = &tileComp->resLevels[r];
+ if (resLevel->precincts) {
+ for (pre = 0; pre < 1; ++pre) {
+ precinct = &resLevel->precincts[pre];
+ if (precinct->subbands) {
+ for (sb = 0; sb < (Guint)(r == 0 ? 1 : 3); ++sb) {
+ subband = &precinct->subbands[sb];
+ gfree(subband->inclusion);
+ gfree(subband->zeroBitPlane);
+ if (subband->cbs) {
+ for (k = 0; k < subband->nXCBs * subband->nYCBs; ++k) {
+ cb = &subband->cbs[k];
+ gfree(cb->coeffs);
+ if (cb->arithDecoder) {
+ delete cb->arithDecoder;
+ }
+ if (cb->stats) {
+ delete cb->stats;
+ }
+ }
+ gfree(subband->cbs);
+ }
+ }
+ gfree(precinct->subbands);
+ }
+ }
+ gfree(img.tiles[i].tileComps[comp].resLevels[r].precincts);
+ }
+ }
+ gfree(img.tiles[i].tileComps[comp].resLevels);
+ }
+ }
+ gfree(img.tiles[i].tileComps);
+ }
+ }
+ gfree(img.tiles);
+ img.tiles = NULL;
+ }
+ FilterStream::close();
+}
+
+int JPXStream::getChar() {
+ int c;
+
+ if (readBufLen < 8) {
+ fillReadBuf();
+ }
+ if (readBufLen == 8) {
+ c = readBuf & 0xff;
+ readBufLen = 0;
+ } else if (readBufLen > 8) {
+ c = (readBuf >> (readBufLen - 8)) & 0xff;
+ readBufLen -= 8;
+ } else if (readBufLen == 0) {
+ c = EOF;
+ } else {
+ c = (readBuf << (8 - readBufLen)) & 0xff;
+ readBufLen = 0;
+ }
+ return c;
+}
+
+int JPXStream::lookChar() {
+ int c;
+
+ if (readBufLen < 8) {
+ fillReadBuf();
+ }
+ if (readBufLen == 8) {
+ c = readBuf & 0xff;
+ } else if (readBufLen > 8) {
+ c = (readBuf >> (readBufLen - 8)) & 0xff;
+ } else if (readBufLen == 0) {
+ c = EOF;
+ } else {
+ c = (readBuf << (8 - readBufLen)) & 0xff;
+ }
+ return c;
+}
+
+void JPXStream::fillReadBuf() {
+ JPXTileComp *tileComp;
+ Guint tileIdx, tx, ty;
+ int pix, pixBits;
+
+ do {
+ if (curY >= img.ySize) {
+ return;
+ }
+ tileIdx = ((curY - img.yTileOffset) / img.yTileSize) * img.nXTiles
+ + (curX - img.xTileOffset) / img.xTileSize;
+#if 1 //~ ignore the palette, assume the PDF ColorSpace object is valid
+ tileComp = &img.tiles[tileIdx].tileComps[curComp];
+#else
+ tileComp = &img.tiles[tileIdx].tileComps[havePalette ? 0 : curComp];
+#endif
+ tx = jpxCeilDiv((curX - img.xTileOffset) % img.xTileSize, tileComp->hSep);
+ ty = jpxCeilDiv((curY - img.yTileOffset) % img.yTileSize, tileComp->vSep);
+ pix = (int)tileComp->data[ty * (tileComp->x1 - tileComp->x0) + tx];
+ pixBits = tileComp->prec;
+#if 1 //~ ignore the palette, assume the PDF ColorSpace object is valid
+ if (++curComp == img.nComps) {
+#else
+ if (havePalette) {
+ if (pix >= 0 && pix < palette.nEntries) {
+ pix = palette.c[pix * palette.nComps + curComp];
+ } else {
+ pix =
+ pixBits = palette.bpc[curComp];
+ }
+ if (++curComp == (Guint)(havePalette ? palette.nComps : img.nComps)) {
+#endif
+ curComp = 0;
+ if (++curX == img.xSize) {
+ curX = img.xOffset;
+ ++curY;
+ }
+ }
+ if (pixBits == 8) {
+ readBuf = (readBuf << 8) | (pix & 0xff);
+ } else {
+ readBuf = (readBuf << pixBits) | (pix & ((1 << pixBits) - 1));
+ }
+ readBufLen += pixBits;
+ } while (readBufLen < 8);
+}
+
+GString *JPXStream::getPSFilter(int /*psLevel*/, char * /*indent*/) {
+ return NULL;
+}
+
+GBool JPXStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+void JPXStream::getImageParams(int *bitsPerComponent,
+ StreamColorSpaceMode *csMode) {
+ Guint boxType, boxLen, dataLen, csEnum;
+ Guint bpc1, dummy, i;
+ int csMeth, csPrec, csPrec1, dummy2;
+ StreamColorSpaceMode csMode1;
+ GBool haveBPC, haveCSMode;
+
+ csPrec = 0; // make gcc happy
+ haveBPC = haveCSMode = gFalse;
+ str->reset();
+ if (str->lookChar() == 0xff) {
+ getImageParams2(bitsPerComponent, csMode);
+ } else {
+ while (readBoxHdr(&boxType, &boxLen, &dataLen)) {
+ if (boxType == 0x6a703268) { // JP2 header
+ cover(0);
+ // skip the superbox
+ } else if (boxType == 0x69686472) { // image header
+ cover(1);
+ if (readULong(&dummy) &&
+ readULong(&dummy) &&
+ readUWord(&dummy) &&
+ readUByte(&bpc1) &&
+ readUByte(&dummy) &&
+ readUByte(&dummy) &&
+ readUByte(&dummy)) {
+ *bitsPerComponent = bpc1 + 1;
+ haveBPC = gTrue;
+ }
+ } else if (boxType == 0x636F6C72) { // color specification
+ cover(2);
+ if (readByte(&csMeth) &&
+ readByte(&csPrec1) &&
+ readByte(&dummy2)) {
+ if (csMeth == 1) {
+ if (readULong(&csEnum)) {
+ csMode1 = streamCSNone;
+ if (csEnum == jpxCSBiLevel ||
+ csEnum == jpxCSGrayscale) {
+ csMode1 = streamCSDeviceGray;
+ } else if (csEnum == jpxCSCMYK) {
+ csMode1 = streamCSDeviceCMYK;
+ } else if (csEnum == jpxCSsRGB ||
+ csEnum == jpxCSCISesRGB ||
+ csEnum == jpxCSROMMRGB) {
+ csMode1 = streamCSDeviceRGB;
+ }
+ if (csMode1 != streamCSNone &&
+ (!haveCSMode || csPrec1 > csPrec)) {
+ *csMode = csMode1;
+ csPrec = csPrec1;
+ haveCSMode = gTrue;
+ }
+ for (i = 0; i < dataLen - 7; ++i) {
+ str->getChar();
+ }
+ }
+ } else {
+ for (i = 0; i < dataLen - 3; ++i) {
+ str->getChar();
+ }
+ }
+ }
+ } else if (boxType == 0x6A703263) { // codestream
+ cover(3);
+ if (!(haveBPC && haveCSMode)) {
+ getImageParams2(bitsPerComponent, csMode);
+ }
+ break;
+ } else {
+ cover(4);
+ for (i = 0; i < dataLen; ++i) {
+ str->getChar();
+ }
+ }
+ }
+ }
+ str->close();
+}
+
+// Get image parameters from the codestream.
+void JPXStream::getImageParams2(int *bitsPerComponent,
+ StreamColorSpaceMode *csMode) {
+ int segType;
+ Guint segLen, nComps1, bpc1, dummy, i;
+
+ while (readMarkerHdr(&segType, &segLen)) {
+ if (segType == 0x51) { // SIZ - image and tile size
+ cover(5);
+ if (readUWord(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readULong(&dummy) &&
+ readUWord(&nComps1) &&
+ readUByte(&bpc1)) {
+ *bitsPerComponent = (bpc1 & 0x7f) + 1;
+ // if there's no color space info, take a guess
+ if (nComps1 == 1) {
+ *csMode = streamCSDeviceGray;
+ } else if (nComps1 == 3) {
+ *csMode = streamCSDeviceRGB;
+ } else if (nComps1 == 4) {
+ *csMode = streamCSDeviceCMYK;
+ }
+ }
+ break;
+ } else {
+ cover(6);
+ if (segLen > 2) {
+ for (i = 0; i < segLen - 2; ++i) {
+ str->getChar();
+ }
+ }
+ }
+ }
+}
+
+GBool JPXStream::readBoxes() {
+ Guint boxType, boxLen, dataLen;
+ Guint bpc1, compression, unknownColorspace, ipr;
+ Guint i, j;
+
+ haveImgHdr = gFalse;
+
+ // check for a naked JPEG 2000 codestream (without the JP2/JPX
+ // wrapper) -- this appears to be a violation of the PDF spec, but
+ // Acrobat allows it
+ if (str->lookChar() == 0xff) {
+ cover(7);
+ error(getPos(), "Naked JPEG 2000 codestream, missing JP2/JPX wrapper");
+ readCodestream(0);
+ nComps = img.nComps;
+ bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
+ for (i = 0; i < nComps; ++i) {
+ bpc[i] = img.tiles[0].tileComps[i].prec;
+ }
+ width = img.xSize - img.xOffset;
+ height = img.ySize - img.yOffset;
+ return gTrue;
+ }
+
+ while (readBoxHdr(&boxType, &boxLen, &dataLen)) {
+ switch (boxType) {
+ case 0x6a703268: // JP2 header
+ // this is a grouping box ('superbox') which has no real
+ // contents and doesn't appear to be used consistently, i.e.,
+ // some things which should be subboxes of the JP2 header box
+ // show up outside of it - so we simply ignore the JP2 header
+ // box
+ cover(8);
+ break;
+ case 0x69686472: // image header
+ cover(9);
+ if (!readULong(&height) ||
+ !readULong(&width) ||
+ !readUWord(&nComps) ||
+ !readUByte(&bpc1) ||
+ !readUByte(&compression) ||
+ !readUByte(&unknownColorspace) ||
+ !readUByte(&ipr)) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ if (compression != 7) {
+ error(getPos(), "Unknown compression type in JPX stream");
+ return gFalse;
+ }
+ bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
+ for (i = 0; i < nComps; ++i) {
+ bpc[i] = bpc1;
+ }
+ haveImgHdr = gTrue;
+ break;
+ case 0x62706363: // bits per component
+ cover(10);
+ if (!haveImgHdr) {
+ error(getPos(), "Found bits per component box before image header box in JPX stream");
+ return gFalse;
+ }
+ if (dataLen != nComps) {
+ error(getPos(), "Invalid bits per component box in JPX stream");
+ return gFalse;
+ }
+ for (i = 0; i < nComps; ++i) {
+ if (!readUByte(&bpc[i])) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x636F6C72: // color specification
+ cover(11);
+ if (!readColorSpecBox(dataLen)) {
+ return gFalse;
+ }
+ break;
+ case 0x70636c72: // palette
+ cover(12);
+ if (!readUWord(&palette.nEntries) ||
+ !readUByte(&palette.nComps)) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ palette.bpc = (Guint *)gmallocn(palette.nComps, sizeof(Guint));
+ palette.c =
+ (int *)gmallocn(palette.nEntries * palette.nComps, sizeof(int));
+ for (i = 0; i < palette.nComps; ++i) {
+ if (!readUByte(&palette.bpc[i])) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ ++palette.bpc[i];
+ }
+ for (i = 0; i < palette.nEntries; ++i) {
+ for (j = 0; j < palette.nComps; ++j) {
+ if (!readNBytes(((palette.bpc[j] & 0x7f) + 7) >> 3,
+ (palette.bpc[j] & 0x80) ? gTrue : gFalse,
+ &palette.c[i * palette.nComps + j])) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ }
+ }
+ havePalette = gTrue;
+ break;
+ case 0x636d6170: // component mapping
+ cover(13);
+ compMap.nChannels = dataLen / 4;
+ compMap.comp = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
+ compMap.type = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
+ compMap.pComp = (Guint *)gmallocn(compMap.nChannels, sizeof(Guint));
+ for (i = 0; i < compMap.nChannels; ++i) {
+ if (!readUWord(&compMap.comp[i]) ||
+ !readUByte(&compMap.type[i]) ||
+ !readUByte(&compMap.pComp[i])) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ }
+ haveCompMap = gTrue;
+ break;
+ case 0x63646566: // channel definition
+ cover(14);
+ if (!readUWord(&channelDefn.nChannels)) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ channelDefn.idx =
+ (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
+ channelDefn.type =
+ (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
+ channelDefn.assoc =
+ (Guint *)gmallocn(channelDefn.nChannels, sizeof(Guint));
+ for (i = 0; i < channelDefn.nChannels; ++i) {
+ if (!readUWord(&channelDefn.idx[i]) ||
+ !readUWord(&channelDefn.type[i]) ||
+ !readUWord(&channelDefn.assoc[i])) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ }
+ haveChannelDefn = gTrue;
+ break;
+ case 0x6A703263: // contiguous codestream
+ cover(15);
+ if (!bpc) {
+ error(getPos(), "JPX stream is missing the image header box");
+ }
+ if (!haveCS) {
+ error(getPos(), "JPX stream has no supported color spec");
+ }
+ if (!readCodestream(dataLen)) {
+ return gFalse;
+ }
+ break;
+ default:
+ cover(16);
+ for (i = 0; i < dataLen; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Unexpected EOF in JPX stream");
+ return gFalse;
+ }
+ }
+ break;
+ }
+ }
+ return gTrue;
+}
+
+GBool JPXStream::readColorSpecBox(Guint dataLen) {
+ JPXColorSpec newCS;
+ Guint csApprox, csEnum;
+ Guint i;
+ GBool ok;
+
+ ok = gFalse;
+ if (!readUByte(&newCS.meth) ||
+ !readByte(&newCS.prec) ||
+ !readUByte(&csApprox)) {
+ goto err;
+ }
+ switch (newCS.meth) {
+ case 1: // enumerated colorspace
+ cover(17);
+ if (!readULong(&csEnum)) {
+ goto err;
+ }
+ newCS.enumerated.type = (JPXColorSpaceType)csEnum;
+ switch (newCS.enumerated.type) {
+ case jpxCSBiLevel:
+ ok = gTrue;
+ break;
+ case jpxCSYCbCr1:
+ ok = gTrue;
+ break;
+ case jpxCSYCbCr2:
+ ok = gTrue;
+ break;
+ case jpxCSYCBCr3:
+ ok = gTrue;
+ break;
+ case jpxCSPhotoYCC:
+ ok = gTrue;
+ break;
+ case jpxCSCMY:
+ ok = gTrue;
+ break;
+ case jpxCSCMYK:
+ ok = gTrue;
+ break;
+ case jpxCSYCCK:
+ ok = gTrue;
+ break;
+ case jpxCSCIELab:
+ if (dataLen == 7 + 7*4) {
+ if (!readULong(&newCS.enumerated.cieLab.rl) ||
+ !readULong(&newCS.enumerated.cieLab.ol) ||
+ !readULong(&newCS.enumerated.cieLab.ra) ||
+ !readULong(&newCS.enumerated.cieLab.oa) ||
+ !readULong(&newCS.enumerated.cieLab.rb) ||
+ !readULong(&newCS.enumerated.cieLab.ob) ||
+ !readULong(&newCS.enumerated.cieLab.il)) {
+ goto err;
+ }
+ } else if (dataLen == 7) {
+ //~ this assumes the 8-bit case
+ cover(92);
+ newCS.enumerated.cieLab.rl = 100;
+ newCS.enumerated.cieLab.ol = 0;
+ newCS.enumerated.cieLab.ra = 255;
+ newCS.enumerated.cieLab.oa = 128;
+ newCS.enumerated.cieLab.rb = 255;
+ newCS.enumerated.cieLab.ob = 96;
+ newCS.enumerated.cieLab.il = 0x00443530;
+ } else {
+ goto err;
+ }
+ ok = gTrue;
+ break;
+ case jpxCSsRGB:
+ ok = gTrue;
+ break;
+ case jpxCSGrayscale:
+ ok = gTrue;
+ break;
+ case jpxCSBiLevel2:
+ ok = gTrue;
+ break;
+ case jpxCSCIEJab:
+ // not allowed in PDF
+ goto err;
+ case jpxCSCISesRGB:
+ ok = gTrue;
+ break;
+ case jpxCSROMMRGB:
+ ok = gTrue;
+ break;
+ case jpxCSsRGBYCbCr:
+ ok = gTrue;
+ break;
+ case jpxCSYPbPr1125:
+ ok = gTrue;
+ break;
+ case jpxCSYPbPr1250:
+ ok = gTrue;
+ break;
+ default:
+ goto err;
+ }
+ break;
+ case 2: // restricted ICC profile
+ case 3: // any ICC profile (JPX)
+ case 4: // vendor color (JPX)
+ cover(18);
+ for (i = 0; i < dataLen - 3; ++i) {
+ if (str->getChar() == EOF) {
+ goto err;
+ }
+ }
+ break;
+ }
+
+ if (ok && (!haveCS || newCS.prec > cs.prec)) {
+ cs = newCS;
+ haveCS = gTrue;
+ }
+
+ return gTrue;
+
+ err:
+ error(getPos(), "Error in JPX color spec");
+ return gFalse;
+}
+
+GBool JPXStream::readCodestream(Guint /*len*/) {
+ JPXTile *tile;
+ JPXTileComp *tileComp;
+ int segType;
+ GBool haveSIZ, haveCOD, haveQCD, haveSOT;
+ Guint precinctSize, style;
+ Guint segLen, capabilities, comp, i, j, r;
+
+ //----- main header
+ haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
+ do {
+ if (!readMarkerHdr(&segType, &segLen)) {
+ error(getPos(), "Error in JPX codestream");
+ return gFalse;
+ }
+ switch (segType) {
+ case 0x4f: // SOC - start of codestream
+ // marker only
+ cover(19);
+ break;
+ case 0x51: // SIZ - image and tile size
+ cover(20);
+ if (!readUWord(&capabilities) ||
+ !readULong(&img.xSize) ||
+ !readULong(&img.ySize) ||
+ !readULong(&img.xOffset) ||
+ !readULong(&img.yOffset) ||
+ !readULong(&img.xTileSize) ||
+ !readULong(&img.yTileSize) ||
+ !readULong(&img.xTileOffset) ||
+ !readULong(&img.yTileOffset) ||
+ !readUWord(&img.nComps)) {
+ error(getPos(), "Error in JPX SIZ marker segment");
+ return gFalse;
+ }
+ if (haveImgHdr && img.nComps != nComps) {
+ error(getPos(), "Different number of components in JPX SIZ marker segment");
+ return gFalse;
+ }
+ img.nXTiles = (img.xSize - img.xTileOffset + img.xTileSize - 1)
+ / img.xTileSize;
+ img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
+ / img.yTileSize;
+ // check for overflow before allocating memory
+ if (img.nXTiles <= 0 || img.nYTiles <= 0 ||
+ img.nXTiles >= INT_MAX / img.nYTiles) {
+ error(getPos(), "Bad tile count in JPX SIZ marker segment");
+ return gFalse;
+ }
+ img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
+ sizeof(JPXTile));
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps,
+ sizeof(JPXTileComp));
+ for (comp = 0; comp < img.nComps; ++comp) {
+ img.tiles[i].tileComps[comp].quantSteps = NULL;
+ img.tiles[i].tileComps[comp].data = NULL;
+ img.tiles[i].tileComps[comp].buf = NULL;
+ img.tiles[i].tileComps[comp].resLevels = NULL;
+ }
+ }
+ for (comp = 0; comp < img.nComps; ++comp) {
+ if (!readUByte(&img.tiles[0].tileComps[comp].prec) ||
+ !readUByte(&img.tiles[0].tileComps[comp].hSep) ||
+ !readUByte(&img.tiles[0].tileComps[comp].vSep)) {
+ error(getPos(), "Error in JPX SIZ marker segment");
+ return gFalse;
+ }
+ img.tiles[0].tileComps[comp].sgned =
+ (img.tiles[0].tileComps[comp].prec & 0x80) ? gTrue : gFalse;
+ img.tiles[0].tileComps[comp].prec =
+ (img.tiles[0].tileComps[comp].prec & 0x7f) + 1;
+ for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
+ img.tiles[i].tileComps[comp] = img.tiles[0].tileComps[comp];
+ }
+ }
+ haveSIZ = gTrue;
+ break;
+ case 0x52: // COD - coding style default
+ cover(21);
+ if (!readUByte(&img.tiles[0].tileComps[0].style) ||
+ !readUByte(&img.tiles[0].progOrder) ||
+ !readUWord(&img.tiles[0].nLayers) ||
+ !readUByte(&img.tiles[0].multiComp) ||
+ !readUByte(&img.tiles[0].tileComps[0].nDecompLevels) ||
+ !readUByte(&img.tiles[0].tileComps[0].codeBlockW) ||
+ !readUByte(&img.tiles[0].tileComps[0].codeBlockH) ||
+ !readUByte(&img.tiles[0].tileComps[0].codeBlockStyle) ||
+ !readUByte(&img.tiles[0].tileComps[0].transform)) {
+ error(getPos(), "Error in JPX COD marker segment");
+ return gFalse;
+ }
+ img.tiles[0].tileComps[0].codeBlockW += 2;
+ img.tiles[0].tileComps[0].codeBlockH += 2;
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ if (i != 0) {
+ img.tiles[i].progOrder = img.tiles[0].progOrder;
+ img.tiles[i].nLayers = img.tiles[0].nLayers;
+ img.tiles[i].multiComp = img.tiles[0].multiComp;
+ }
+ for (comp = 0; comp < img.nComps; ++comp) {
+ if (!(i == 0 && comp == 0)) {
+ img.tiles[i].tileComps[comp].style =
+ img.tiles[0].tileComps[0].style;
+ img.tiles[i].tileComps[comp].nDecompLevels =
+ img.tiles[0].tileComps[0].nDecompLevels;
+ img.tiles[i].tileComps[comp].codeBlockW =
+ img.tiles[0].tileComps[0].codeBlockW;
+ img.tiles[i].tileComps[comp].codeBlockH =
+ img.tiles[0].tileComps[0].codeBlockH;
+ img.tiles[i].tileComps[comp].codeBlockStyle =
+ img.tiles[0].tileComps[0].codeBlockStyle;
+ img.tiles[i].tileComps[comp].transform =
+ img.tiles[0].tileComps[0].transform;
+ }
+ img.tiles[i].tileComps[comp].resLevels =
+ (JPXResLevel *)gmallocn(
+ (img.tiles[i].tileComps[comp].nDecompLevels + 1),
+ sizeof(JPXResLevel));
+ for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+ img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
+ }
+ }
+ }
+ for (r = 0; r <= img.tiles[0].tileComps[0].nDecompLevels; ++r) {
+ if (img.tiles[0].tileComps[0].style & 0x01) {
+ cover(91);
+ if (!readUByte(&precinctSize)) {
+ error(getPos(), "Error in JPX COD marker segment");
+ return gFalse;
+ }
+ img.tiles[0].tileComps[0].resLevels[r].precinctWidth =
+ precinctSize & 0x0f;
+ img.tiles[0].tileComps[0].resLevels[r].precinctHeight =
+ (precinctSize >> 4) & 0x0f;
+ } else {
+ img.tiles[0].tileComps[0].resLevels[r].precinctWidth = 15;
+ img.tiles[0].tileComps[0].resLevels[r].precinctHeight = 15;
+ }
+ }
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ for (comp = 0; comp < img.nComps; ++comp) {
+ if (!(i == 0 && comp == 0)) {
+ for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+ img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
+ img.tiles[0].tileComps[0].resLevels[r].precinctWidth;
+ img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
+ img.tiles[0].tileComps[0].resLevels[r].precinctHeight;
+ }
+ }
+ }
+ }
+ haveCOD = gTrue;
+ break;
+ case 0x53: // COC - coding style component
+ cover(22);
+ if (!haveCOD) {
+ error(getPos(), "JPX COC marker segment before COD segment");
+ return gFalse;
+ }
+ if ((img.nComps > 256 && !readUWord(&comp)) ||
+ (img.nComps <= 256 && !readUByte(&comp)) ||
+ comp >= img.nComps ||
+ !readUByte(&style) ||
+ !readUByte(&img.tiles[0].tileComps[comp].nDecompLevels) ||
+ !readUByte(&img.tiles[0].tileComps[comp].codeBlockW) ||
+ !readUByte(&img.tiles[0].tileComps[comp].codeBlockH) ||
+ !readUByte(&img.tiles[0].tileComps[comp].codeBlockStyle) ||
+ !readUByte(&img.tiles[0].tileComps[comp].transform)) {
+ error(getPos(), "Error in JPX COC marker segment");
+ return gFalse;
+ }
+ img.tiles[0].tileComps[comp].style =
+ (img.tiles[0].tileComps[comp].style & ~1) | (style & 1);
+ img.tiles[0].tileComps[comp].codeBlockW += 2;
+ img.tiles[0].tileComps[comp].codeBlockH += 2;
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ if (i != 0) {
+ img.tiles[i].tileComps[comp].style =
+ img.tiles[0].tileComps[comp].style;
+ img.tiles[i].tileComps[comp].nDecompLevels =
+ img.tiles[0].tileComps[comp].nDecompLevels;
+ img.tiles[i].tileComps[comp].codeBlockW =
+ img.tiles[0].tileComps[comp].codeBlockW;
+ img.tiles[i].tileComps[comp].codeBlockH =
+ img.tiles[0].tileComps[comp].codeBlockH;
+ img.tiles[i].tileComps[comp].codeBlockStyle =
+ img.tiles[0].tileComps[comp].codeBlockStyle;
+ img.tiles[i].tileComps[comp].transform =
+ img.tiles[0].tileComps[comp].transform;
+ }
+ img.tiles[i].tileComps[comp].resLevels =
+ (JPXResLevel *)greallocn(
+ img.tiles[i].tileComps[comp].resLevels,
+ (img.tiles[i].tileComps[comp].nDecompLevels + 1),
+ sizeof(JPXResLevel));
+ for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+ img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
+ }
+ }
+ for (r = 0; r <= img.tiles[0].tileComps[comp].nDecompLevels; ++r) {
+ if (img.tiles[0].tileComps[comp].style & 0x01) {
+ if (!readUByte(&precinctSize)) {
+ error(getPos(), "Error in JPX COD marker segment");
+ return gFalse;
+ }
+ img.tiles[0].tileComps[comp].resLevels[r].precinctWidth =
+ precinctSize & 0x0f;
+ img.tiles[0].tileComps[comp].resLevels[r].precinctHeight =
+ (precinctSize >> 4) & 0x0f;
+ } else {
+ img.tiles[0].tileComps[comp].resLevels[r].precinctWidth = 15;
+ img.tiles[0].tileComps[comp].resLevels[r].precinctHeight = 15;
+ }
+ }
+ for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
+ for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+ img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
+ img.tiles[0].tileComps[comp].resLevels[r].precinctWidth;
+ img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
+ img.tiles[0].tileComps[comp].resLevels[r].precinctHeight;
+ }
+ }
+ break;
+ case 0x5c: // QCD - quantization default
+ cover(23);
+ if (!readUByte(&img.tiles[0].tileComps[0].quantStyle)) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x00) {
+ img.tiles[0].tileComps[0].nQuantSteps = segLen - 3;
+ img.tiles[0].tileComps[0].quantSteps =
+ (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
+ img.tiles[0].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
+ if (!readUByte(&img.tiles[0].tileComps[0].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ }
+ } else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x01) {
+ img.tiles[0].tileComps[0].nQuantSteps = 1;
+ img.tiles[0].tileComps[0].quantSteps =
+ (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
+ img.tiles[0].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[0])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ } else if ((img.tiles[0].tileComps[0].quantStyle & 0x1f) == 0x02) {
+ img.tiles[0].tileComps[0].nQuantSteps = (segLen - 3) / 2;
+ img.tiles[0].tileComps[0].quantSteps =
+ (Guint *)greallocn(img.tiles[0].tileComps[0].quantSteps,
+ img.tiles[0].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[0].tileComps[0].nQuantSteps; ++i) {
+ if (!readUWord(&img.tiles[0].tileComps[0].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ }
+ } else {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ for (comp = 0; comp < img.nComps; ++comp) {
+ if (!(i == 0 && comp == 0)) {
+ img.tiles[i].tileComps[comp].quantStyle =
+ img.tiles[0].tileComps[0].quantStyle;
+ img.tiles[i].tileComps[comp].nQuantSteps =
+ img.tiles[0].tileComps[0].nQuantSteps;
+ img.tiles[i].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[i].tileComps[comp].quantSteps,
+ img.tiles[0].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ for (j = 0; j < img.tiles[0].tileComps[0].nQuantSteps; ++j) {
+ img.tiles[i].tileComps[comp].quantSteps[j] =
+ img.tiles[0].tileComps[0].quantSteps[j];
+ }
+ }
+ }
+ }
+ haveQCD = gTrue;
+ break;
+ case 0x5d: // QCC - quantization component
+ cover(24);
+ if (!haveQCD) {
+ error(getPos(), "JPX QCC marker segment before QCD segment");
+ return gFalse;
+ }
+ if ((img.nComps > 256 && !readUWord(&comp)) ||
+ (img.nComps <= 256 && !readUByte(&comp)) ||
+ comp >= img.nComps ||
+ !readUByte(&img.tiles[0].tileComps[comp].quantStyle)) {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x00) {
+ img.tiles[0].tileComps[comp].nQuantSteps =
+ segLen - (img.nComps > 256 ? 5 : 4);
+ img.tiles[0].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
+ img.tiles[0].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
+ if (!readUByte(&img.tiles[0].tileComps[comp].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ }
+ } else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x01) {
+ img.tiles[0].tileComps[comp].nQuantSteps = 1;
+ img.tiles[0].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
+ img.tiles[0].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[0])) {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ } else if ((img.tiles[0].tileComps[comp].quantStyle & 0x1f) == 0x02) {
+ img.tiles[0].tileComps[comp].nQuantSteps =
+ (segLen - (img.nComps > 256 ? 5 : 4)) / 2;
+ img.tiles[0].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[0].tileComps[comp].quantSteps,
+ img.tiles[0].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[0].tileComps[comp].nQuantSteps; ++i) {
+ if (!readUWord(&img.tiles[0].tileComps[comp].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ }
+ } else {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ for (i = 1; i < img.nXTiles * img.nYTiles; ++i) {
+ img.tiles[i].tileComps[comp].quantStyle =
+ img.tiles[0].tileComps[comp].quantStyle;
+ img.tiles[i].tileComps[comp].nQuantSteps =
+ img.tiles[0].tileComps[comp].nQuantSteps;
+ img.tiles[i].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[i].tileComps[comp].quantSteps,
+ img.tiles[0].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ for (j = 0; j < img.tiles[0].tileComps[comp].nQuantSteps; ++j) {
+ img.tiles[i].tileComps[comp].quantSteps[j] =
+ img.tiles[0].tileComps[comp].quantSteps[j];
+ }
+ }
+ break;
+ case 0x5e: // RGN - region of interest
+ cover(25);
+#if 1 //~ ROI is unimplemented
+ fprintf(stderr, "RGN\n");
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PPM marker segment");
+ return gFalse;
+ }
+ }
+#else
+ if ((img.nComps > 256 && !readUWord(&comp)) ||
+ (img.nComps <= 256 && !readUByte(&comp)) ||
+ comp >= img.nComps ||
+ !readUByte(&compInfo[comp].defROI.style) ||
+ !readUByte(&compInfo[comp].defROI.shift)) {
+ error(getPos(), "Error in JPX RGN marker segment");
+ return gFalse;
+ }
+#endif
+ break;
+ case 0x5f: // POC - progression order change
+ cover(26);
+#if 1 //~ progression order changes are unimplemented
+ fprintf(stderr, "POC\n");
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PPM marker segment");
+ return gFalse;
+ }
+ }
+#else
+ nProgs = (segLen - 2) / (img.nComps > 256 ? 9 : 7);
+ progs = (JPXProgOrder *)gmallocn(nProgs, sizeof(JPXProgOrder));
+ for (i = 0; i < nProgs; ++i) {
+ if (!readUByte(&progs[i].startRes) ||
+ !(img.nComps > 256 && readUWord(&progs[i].startComp)) ||
+ !(img.nComps <= 256 && readUByte(&progs[i].startComp)) ||
+ !readUWord(&progs[i].endLayer) ||
+ !readUByte(&progs[i].endRes) ||
+ !(img.nComps > 256 && readUWord(&progs[i].endComp)) ||
+ !(img.nComps <= 256 && readUByte(&progs[i].endComp)) ||
+ !readUByte(&progs[i].progOrder)) {
+ error(getPos(), "Error in JPX POC marker segment");
+ return gFalse;
+ }
+ }
+#endif
+ break;
+ case 0x60: // PPM - packed packet headers, main header
+ cover(27);
+#if 1 //~ packed packet headers are unimplemented
+ fprintf(stderr, "PPM\n");
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PPM marker segment");
+ return gFalse;
+ }
+ }
+#endif
+ break;
+ case 0x55: // TLM - tile-part lengths
+ // skipped
+ cover(28);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX TLM marker segment");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x57: // PLM - packet length, main header
+ // skipped
+ cover(29);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PLM marker segment");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x63: // CRG - component registration
+ // skipped
+ cover(30);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX CRG marker segment");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x64: // COM - comment
+ // skipped
+ cover(31);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX COM marker segment");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x90: // SOT - start of tile
+ cover(32);
+ haveSOT = gTrue;
+ break;
+ default:
+ cover(33);
+ error(getPos(), "Unknown marker segment %02x in JPX stream", segType);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ break;
+ }
+ }
+ break;
+ }
+ } while (!haveSOT);
+
+ if (!haveSIZ) {
+ error(getPos(), "Missing SIZ marker segment in JPX stream");
+ return gFalse;
+ }
+ if (!haveCOD) {
+ error(getPos(), "Missing COD marker segment in JPX stream");
+ return gFalse;
+ }
+ if (!haveQCD) {
+ error(getPos(), "Missing QCD marker segment in JPX stream");
+ return gFalse;
+ }
+
+ //----- read the tile-parts
+ while (1) {
+ if (!readTilePart()) {
+ return gFalse;
+ }
+ if (!readMarkerHdr(&segType, &segLen)) {
+ error(getPos(), "Error in JPX codestream");
+ return gFalse;
+ }
+ if (segType != 0x90) { // SOT - start of tile
+ break;
+ }
+ }
+
+ if (segType != 0xd9) { // EOC - end of codestream
+ error(getPos(), "Missing EOC marker in JPX codestream");
+ return gFalse;
+ }
+
+ //----- finish decoding the image
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ tile = &img.tiles[i];
+ for (comp = 0; comp < img.nComps; ++comp) {
+ tileComp = &tile->tileComps[comp];
+ inverseTransform(tileComp);
+ }
+ if (!inverseMultiCompAndDC(tile)) {
+ return gFalse;
+ }
+ }
+
+ //~ can free memory below tileComps here, and also tileComp.buf
+
+ return gTrue;
+}
+
+GBool JPXStream::readTilePart() {
+ JPXTile *tile;
+ JPXTileComp *tileComp;
+ JPXResLevel *resLevel;
+ JPXPrecinct *precinct;
+ JPXSubband *subband;
+ JPXCodeBlock *cb;
+ GBool haveSOD;
+ Guint tileIdx, tilePartLen, tilePartIdx, nTileParts;
+ GBool tilePartToEOC;
+ Guint precinctSize, style;
+ Guint n, nSBs, nx, ny, sbx0, sby0, comp, segLen;
+ Guint i, j, k, cbX, cbY, r, pre, sb, cbi;
+ int segType, level;
+
+ // process the SOT marker segment
+ if (!readUWord(&tileIdx) ||
+ !readULong(&tilePartLen) ||
+ !readUByte(&tilePartIdx) ||
+ !readUByte(&nTileParts)) {
+ error(getPos(), "Error in JPX SOT marker segment");
+ return gFalse;
+ }
+
+ if (tileIdx >= img.nXTiles * img.nYTiles) {
+ error(getPos(), "Weird tile index in JPX stream");
+ return gFalse;
+ }
+
+ tilePartToEOC = tilePartLen == 0;
+ tilePartLen -= 12; // subtract size of SOT segment
+
+ haveSOD = gFalse;
+ do {
+ if (!readMarkerHdr(&segType, &segLen)) {
+ error(getPos(), "Error in JPX tile-part codestream");
+ return gFalse;
+ }
+ tilePartLen -= 2 + segLen;
+ switch (segType) {
+ case 0x52: // COD - coding style default
+ cover(34);
+ if (!readUByte(&img.tiles[tileIdx].tileComps[0].style) ||
+ !readUByte(&img.tiles[tileIdx].progOrder) ||
+ !readUWord(&img.tiles[tileIdx].nLayers) ||
+ !readUByte(&img.tiles[tileIdx].multiComp) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[0].nDecompLevels) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockW) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockH) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockStyle) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[0].transform)) {
+ error(getPos(), "Error in JPX COD marker segment");
+ return gFalse;
+ }
+ img.tiles[tileIdx].tileComps[0].codeBlockW += 2;
+ img.tiles[tileIdx].tileComps[0].codeBlockH += 2;
+ for (comp = 0; comp < img.nComps; ++comp) {
+ if (comp != 0) {
+ img.tiles[tileIdx].tileComps[comp].style =
+ img.tiles[tileIdx].tileComps[0].style;
+ img.tiles[tileIdx].tileComps[comp].nDecompLevels =
+ img.tiles[tileIdx].tileComps[0].nDecompLevels;
+ img.tiles[tileIdx].tileComps[comp].codeBlockW =
+ img.tiles[tileIdx].tileComps[0].codeBlockW;
+ img.tiles[tileIdx].tileComps[comp].codeBlockH =
+ img.tiles[tileIdx].tileComps[0].codeBlockH;
+ img.tiles[tileIdx].tileComps[comp].codeBlockStyle =
+ img.tiles[tileIdx].tileComps[0].codeBlockStyle;
+ img.tiles[tileIdx].tileComps[comp].transform =
+ img.tiles[tileIdx].tileComps[0].transform;
+ }
+ img.tiles[tileIdx].tileComps[comp].resLevels =
+ (JPXResLevel *)greallocn(
+ img.tiles[tileIdx].tileComps[comp].resLevels,
+ (img.tiles[tileIdx].tileComps[comp].nDecompLevels + 1),
+ sizeof(JPXResLevel));
+ for (r = 0;
+ r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels;
+ ++r) {
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
+ }
+ }
+ for (r = 0; r <= img.tiles[tileIdx].tileComps[0].nDecompLevels; ++r) {
+ if (img.tiles[tileIdx].tileComps[0].style & 0x01) {
+ if (!readUByte(&precinctSize)) {
+ error(getPos(), "Error in JPX COD marker segment");
+ return gFalse;
+ }
+ img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth =
+ precinctSize & 0x0f;
+ img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight =
+ (precinctSize >> 4) & 0x0f;
+ } else {
+ img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth = 15;
+ img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight = 15;
+ }
+ }
+ for (comp = 1; comp < img.nComps; ++comp) {
+ for (r = 0;
+ r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels;
+ ++r) {
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
+ img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth;
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
+ img.tiles[tileIdx].tileComps[0].resLevels[r].precinctHeight;
+ }
+ }
+ break;
+ case 0x53: // COC - coding style component
+ cover(35);
+ if ((img.nComps > 256 && !readUWord(&comp)) ||
+ (img.nComps <= 256 && !readUByte(&comp)) ||
+ comp >= img.nComps ||
+ !readUByte(&style) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[comp].nDecompLevels) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockW) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockH) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockStyle) ||
+ !readUByte(&img.tiles[tileIdx].tileComps[comp].transform)) {
+ error(getPos(), "Error in JPX COC marker segment");
+ return gFalse;
+ }
+ img.tiles[tileIdx].tileComps[comp].style =
+ (img.tiles[tileIdx].tileComps[comp].style & ~1) | (style & 1);
+ img.tiles[tileIdx].tileComps[comp].codeBlockW += 2;
+ img.tiles[tileIdx].tileComps[comp].codeBlockH += 2;
+ img.tiles[tileIdx].tileComps[comp].resLevels =
+ (JPXResLevel *)greallocn(
+ img.tiles[tileIdx].tileComps[comp].resLevels,
+ (img.tiles[tileIdx].tileComps[comp].nDecompLevels + 1),
+ sizeof(JPXResLevel));
+ for (r = 0; r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels; ++r) {
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
+ }
+ for (r = 0; r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels; ++r) {
+ if (img.tiles[tileIdx].tileComps[comp].style & 0x01) {
+ if (!readUByte(&precinctSize)) {
+ error(getPos(), "Error in JPX COD marker segment");
+ return gFalse;
+ }
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
+ precinctSize & 0x0f;
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
+ (precinctSize >> 4) & 0x0f;
+ } else {
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth = 15;
+ img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight = 15;
+ }
+ }
+ break;
+ case 0x5c: // QCD - quantization default
+ cover(36);
+ if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantStyle)) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x00) {
+ img.tiles[tileIdx].tileComps[0].nQuantSteps =
+ segLen - 3;
+ img.tiles[tileIdx].tileComps[0].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
+ img.tiles[tileIdx].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
+ if (!readUByte(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ }
+ } else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x01) {
+ img.tiles[tileIdx].tileComps[0].nQuantSteps = 1;
+ img.tiles[tileIdx].tileComps[0].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
+ img.tiles[tileIdx].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[0])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ } else if ((img.tiles[tileIdx].tileComps[0].quantStyle & 0x1f) == 0x02) {
+ img.tiles[tileIdx].tileComps[0].nQuantSteps = (segLen - 3) / 2;
+ img.tiles[tileIdx].tileComps[0].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[0].quantSteps,
+ img.tiles[tileIdx].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++i) {
+ if (!readUWord(&img.tiles[tileIdx].tileComps[0].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ }
+ } else {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ for (comp = 1; comp < img.nComps; ++comp) {
+ img.tiles[tileIdx].tileComps[comp].quantStyle =
+ img.tiles[tileIdx].tileComps[0].quantStyle;
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps =
+ img.tiles[tileIdx].tileComps[0].nQuantSteps;
+ img.tiles[tileIdx].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
+ img.tiles[tileIdx].tileComps[0].nQuantSteps,
+ sizeof(Guint));
+ for (j = 0; j < img.tiles[tileIdx].tileComps[0].nQuantSteps; ++j) {
+ img.tiles[tileIdx].tileComps[comp].quantSteps[j] =
+ img.tiles[tileIdx].tileComps[0].quantSteps[j];
+ }
+ }
+ break;
+ case 0x5d: // QCC - quantization component
+ cover(37);
+ if ((img.nComps > 256 && !readUWord(&comp)) ||
+ (img.nComps <= 256 && !readUByte(&comp)) ||
+ comp >= img.nComps ||
+ !readUByte(&img.tiles[tileIdx].tileComps[comp].quantStyle)) {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f) == 0x00) {
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps =
+ segLen - (img.nComps > 256 ? 5 : 4);
+ img.tiles[tileIdx].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
+ if (!readUByte(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ }
+ } else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
+ == 0x01) {
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps = 1;
+ img.tiles[tileIdx].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[0])) {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ } else if ((img.tiles[tileIdx].tileComps[comp].quantStyle & 0x1f)
+ == 0x02) {
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps =
+ (segLen - (img.nComps > 256 ? 5 : 4)) / 2;
+ img.tiles[tileIdx].tileComps[comp].quantSteps =
+ (Guint *)greallocn(img.tiles[tileIdx].tileComps[comp].quantSteps,
+ img.tiles[tileIdx].tileComps[comp].nQuantSteps,
+ sizeof(Guint));
+ for (i = 0; i < img.tiles[tileIdx].tileComps[comp].nQuantSteps; ++i) {
+ if (!readUWord(&img.tiles[tileIdx].tileComps[comp].quantSteps[i])) {
+ error(getPos(), "Error in JPX QCD marker segment");
+ return gFalse;
+ }
+ }
+ } else {
+ error(getPos(), "Error in JPX QCC marker segment");
+ return gFalse;
+ }
+ break;
+ case 0x5e: // RGN - region of interest
+ cover(38);
+#if 1 //~ ROI is unimplemented
+ fprintf(stderr, "RGN\n");
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PPM marker segment");
+ return gFalse;
+ }
+ }
+#else
+ if ((img.nComps > 256 && !readUWord(&comp)) ||
+ (img.nComps <= 256 && !readUByte(&comp)) ||
+ comp >= img.nComps ||
+ !readUByte(&compInfo[comp].roi.style) ||
+ !readUByte(&compInfo[comp].roi.shift)) {
+ error(getPos(), "Error in JPX RGN marker segment");
+ return gFalse;
+ }
+#endif
+ break;
+ case 0x5f: // POC - progression order change
+ cover(39);
+#if 1 //~ progression order changes are unimplemented
+ fprintf(stderr, "POC\n");
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PPM marker segment");
+ return gFalse;
+ }
+ }
+#else
+ nTileProgs = (segLen - 2) / (img.nComps > 256 ? 9 : 7);
+ tileProgs = (JPXProgOrder *)gmallocn(nTileProgs, sizeof(JPXProgOrder));
+ for (i = 0; i < nTileProgs; ++i) {
+ if (!readUByte(&tileProgs[i].startRes) ||
+ !(img.nComps > 256 && readUWord(&tileProgs[i].startComp)) ||
+ !(img.nComps <= 256 && readUByte(&tileProgs[i].startComp)) ||
+ !readUWord(&tileProgs[i].endLayer) ||
+ !readUByte(&tileProgs[i].endRes) ||
+ !(img.nComps > 256 && readUWord(&tileProgs[i].endComp)) ||
+ !(img.nComps <= 256 && readUByte(&tileProgs[i].endComp)) ||
+ !readUByte(&tileProgs[i].progOrder)) {
+ error(getPos(), "Error in JPX POC marker segment");
+ return gFalse;
+ }
+ }
+#endif
+ break;
+ case 0x61: // PPT - packed packet headers, tile-part hdr
+ cover(40);
+#if 1 //~ packed packet headers are unimplemented
+ fprintf(stderr, "PPT\n");
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PPT marker segment");
+ return gFalse;
+ }
+ }
+#endif
+ case 0x58: // PLT - packet length, tile-part header
+ // skipped
+ cover(41);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX PLT marker segment");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x64: // COM - comment
+ // skipped
+ cover(42);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Error in JPX COM marker segment");
+ return gFalse;
+ }
+ }
+ break;
+ case 0x93: // SOD - start of data
+ cover(43);
+ haveSOD = gTrue;
+ break;
+ default:
+ cover(44);
+ error(getPos(), "Unknown marker segment %02x in JPX tile-part stream",
+ segType);
+ for (i = 0; i < segLen - 2; ++i) {
+ if (str->getChar() == EOF) {
+ break;
+ }
+ }
+ break;
+ }
+ } while (!haveSOD);
+
+ //----- initialize the tile, precincts, and code-blocks
+ if (tilePartIdx == 0) {
+ tile = &img.tiles[tileIdx];
+ i = tileIdx / img.nXTiles;
+ j = tileIdx % img.nXTiles;
+ if ((tile->x0 = img.xTileOffset + j * img.xTileSize) < img.xOffset) {
+ tile->x0 = img.xOffset;
+ }
+ if ((tile->y0 = img.yTileOffset + i * img.yTileSize) < img.yOffset) {
+ tile->y0 = img.yOffset;
+ }
+ if ((tile->x1 = img.xTileOffset + (j + 1) * img.xTileSize) > img.xSize) {
+ tile->x1 = img.xSize;
+ }
+ if ((tile->y1 = img.yTileOffset + (i + 1) * img.yTileSize) > img.ySize) {
+ tile->y1 = img.ySize;
+ }
+ tile->comp = 0;
+ tile->res = 0;
+ tile->precinct = 0;
+ tile->layer = 0;
+ tile->maxNDecompLevels = 0;
+ for (comp = 0; comp < img.nComps; ++comp) {
+ tileComp = &tile->tileComps[comp];
+ if (tileComp->nDecompLevels > tile->maxNDecompLevels) {
+ tile->maxNDecompLevels = tileComp->nDecompLevels;
+ }
+ tileComp->x0 = jpxCeilDiv(tile->x0, tileComp->hSep);
+ tileComp->y0 = jpxCeilDiv(tile->y0, tileComp->hSep);
+ tileComp->x1 = jpxCeilDiv(tile->x1, tileComp->hSep);
+ tileComp->y1 = jpxCeilDiv(tile->y1, tileComp->hSep);
+ tileComp->cbW = 1 << tileComp->codeBlockW;
+ tileComp->cbH = 1 << tileComp->codeBlockH;
+ tileComp->data = (int *)gmallocn((tileComp->x1 - tileComp->x0) *
+ (tileComp->y1 - tileComp->y0),
+ sizeof(int));
+ if (tileComp->x1 - tileComp->x0 > tileComp->y1 - tileComp->y0) {
+ n = tileComp->x1 - tileComp->x0;
+ } else {
+ n = tileComp->y1 - tileComp->y0;
+ }
+ tileComp->buf = (int *)gmallocn(n + 8, sizeof(int));
+ for (r = 0; r <= tileComp->nDecompLevels; ++r) {
+ resLevel = &tileComp->resLevels[r];
+ k = r == 0 ? tileComp->nDecompLevels
+ : tileComp->nDecompLevels - r + 1;
+ resLevel->x0 = jpxCeilDivPow2(tileComp->x0, k);
+ resLevel->y0 = jpxCeilDivPow2(tileComp->y0, k);
+ resLevel->x1 = jpxCeilDivPow2(tileComp->x1, k);
+ resLevel->y1 = jpxCeilDivPow2(tileComp->y1, k);
+ if (r == 0) {
+ resLevel->bx0[0] = resLevel->x0;
+ resLevel->by0[0] = resLevel->y0;
+ resLevel->bx1[0] = resLevel->x1;
+ resLevel->by1[0] = resLevel->y1;
+ } else {
+ resLevel->bx0[0] = jpxCeilDivPow2(tileComp->x0 - (1 << (k-1)), k);
+ resLevel->by0[0] = resLevel->y0;
+ resLevel->bx1[0] = jpxCeilDivPow2(tileComp->x1 - (1 << (k-1)), k);
+ resLevel->by1[0] = resLevel->y1;
+ resLevel->bx0[1] = resLevel->x0;
+ resLevel->by0[1] = jpxCeilDivPow2(tileComp->y0 - (1 << (k-1)), k);
+ resLevel->bx1[1] = resLevel->x1;
+ resLevel->by1[1] = jpxCeilDivPow2(tileComp->y1 - (1 << (k-1)), k);
+ resLevel->bx0[2] = jpxCeilDivPow2(tileComp->x0 - (1 << (k-1)), k);
+ resLevel->by0[2] = jpxCeilDivPow2(tileComp->y0 - (1 << (k-1)), k);
+ resLevel->bx1[2] = jpxCeilDivPow2(tileComp->x1 - (1 << (k-1)), k);
+ resLevel->by1[2] = jpxCeilDivPow2(tileComp->y1 - (1 << (k-1)), k);
+ }
+ resLevel->precincts = (JPXPrecinct *)gmallocn(1, sizeof(JPXPrecinct));
+ for (pre = 0; pre < 1; ++pre) {
+ precinct = &resLevel->precincts[pre];
+ precinct->x0 = resLevel->x0;
+ precinct->y0 = resLevel->y0;
+ precinct->x1 = resLevel->x1;
+ precinct->y1 = resLevel->y1;
+ nSBs = r == 0 ? 1 : 3;
+ precinct->subbands =
+ (JPXSubband *)gmallocn(nSBs, sizeof(JPXSubband));
+ for (sb = 0; sb < nSBs; ++sb) {
+ subband = &precinct->subbands[sb];
+ subband->x0 = resLevel->bx0[sb];
+ subband->y0 = resLevel->by0[sb];
+ subband->x1 = resLevel->bx1[sb];
+ subband->y1 = resLevel->by1[sb];
+ subband->nXCBs = jpxCeilDivPow2(subband->x1,
+ tileComp->codeBlockW)
+ - jpxFloorDivPow2(subband->x0,
+ tileComp->codeBlockW);
+ subband->nYCBs = jpxCeilDivPow2(subband->y1,
+ tileComp->codeBlockH)
+ - jpxFloorDivPow2(subband->y0,
+ tileComp->codeBlockH);
+ n = subband->nXCBs > subband->nYCBs ? subband->nXCBs
+ : subband->nYCBs;
+ for (subband->maxTTLevel = 0, --n;
+ n;
+ ++subband->maxTTLevel, n >>= 1) ;
+ n = 0;
+ for (level = subband->maxTTLevel; level >= 0; --level) {
+ nx = jpxCeilDivPow2(subband->nXCBs, level);
+ ny = jpxCeilDivPow2(subband->nYCBs, level);
+ n += nx * ny;
+ }
+ subband->inclusion =
+ (JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
+ subband->zeroBitPlane =
+ (JPXTagTreeNode *)gmallocn(n, sizeof(JPXTagTreeNode));
+ for (k = 0; k < n; ++k) {
+ subband->inclusion[k].finished = gFalse;
+ subband->inclusion[k].val = 0;
+ subband->zeroBitPlane[k].finished = gFalse;
+ subband->zeroBitPlane[k].val = 0;
+ }
+ subband->cbs = (JPXCodeBlock *)gmallocn(subband->nXCBs *
+ subband->nYCBs,
+ sizeof(JPXCodeBlock));
+ sbx0 = jpxFloorDivPow2(subband->x0, tileComp->codeBlockW);
+ sby0 = jpxFloorDivPow2(subband->y0, tileComp->codeBlockH);
+ cb = subband->cbs;
+ for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
+ for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
+ cb->x0 = (sbx0 + cbX) << tileComp->codeBlockW;
+ cb->x1 = cb->x0 + tileComp->cbW;
+ if (subband->x0 > cb->x0) {
+ cb->x0 = subband->x0;
+ }
+ if (subband->x1 < cb->x1) {
+ cb->x1 = subband->x1;
+ }
+ cb->y0 = (sby0 + cbY) << tileComp->codeBlockH;
+ cb->y1 = cb->y0 + tileComp->cbH;
+ if (subband->y0 > cb->y0) {
+ cb->y0 = subband->y0;
+ }
+ if (subband->y1 < cb->y1) {
+ cb->y1 = subband->y1;
+ }
+ cb->seen = gFalse;
+ cb->lBlock = 3;
+ cb->nextPass = jpxPassCleanup;
+ cb->nZeroBitPlanes = 0;
+ cb->coeffs =
+ (JPXCoeff *)gmallocn((1 << (tileComp->codeBlockW
+ + tileComp->codeBlockH)),
+ sizeof(JPXCoeff));
+ for (cbi = 0;
+ cbi < (Guint)(1 << (tileComp->codeBlockW
+ + tileComp->codeBlockH));
+ ++cbi) {
+ cb->coeffs[cbi].flags = 0;
+ cb->coeffs[cbi].len = 0;
+ cb->coeffs[cbi].mag = 0;
+ }
+ cb->arithDecoder = NULL;
+ cb->stats = NULL;
+ ++cb;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return readTilePartData(tileIdx, tilePartLen, tilePartToEOC);
+}
+
+GBool JPXStream::readTilePartData(Guint tileIdx,
+ Guint tilePartLen, GBool tilePartToEOC) {
+ JPXTile *tile;
+ JPXTileComp *tileComp;
+ JPXResLevel *resLevel;
+ JPXPrecinct *precinct;
+ JPXSubband *subband;
+ JPXCodeBlock *cb;
+ Guint ttVal;
+ Guint bits, cbX, cbY, nx, ny, i, j, n, sb;
+ int level;
+
+ tile = &img.tiles[tileIdx];
+
+ // read all packets from this tile-part
+ while (1) {
+ if (tilePartToEOC) {
+ //~ peek for an EOC marker
+ cover(93);
+ } else if (tilePartLen == 0) {
+ break;
+ }
+
+ tileComp = &tile->tileComps[tile->comp];
+ resLevel = &tileComp->resLevels[tile->res];
+ precinct = &resLevel->precincts[tile->precinct];
+
+ //----- packet header
+
+ // setup
+ startBitBuf(tilePartLen);
+
+ // zero-length flag
+ if (!readBits(1, &bits)) {
+ goto err;
+ }
+ if (!bits) {
+ // packet is empty -- clear all code-block inclusion flags
+ cover(45);
+ for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
+ subband = &precinct->subbands[sb];
+ for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
+ for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
+ cb = &subband->cbs[cbY * subband->nXCBs + cbX];
+ cb->included = gFalse;
+ }
+ }
+ }
+ } else {
+
+ for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
+ subband = &precinct->subbands[sb];
+ for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
+ for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
+ cb = &subband->cbs[cbY * subband->nXCBs + cbX];
+
+ // skip code-blocks with no coefficients
+ if (cb->x0 >= cb->x1 || cb->y0 >= cb->y1) {
+ cover(46);
+ cb->included = gFalse;
+ continue;
+ }
+
+ // code-block inclusion
+ if (cb->seen) {
+ cover(47);
+ if (!readBits(1, &cb->included)) {
+ goto err;
+ }
+ } else {
+ cover(48);
+ ttVal = 0;
+ i = 0;
+ for (level = subband->maxTTLevel; level >= 0; --level) {
+ nx = jpxCeilDivPow2(subband->nXCBs, level);
+ ny = jpxCeilDivPow2(subband->nYCBs, level);
+ j = i + (cbY >> level) * nx + (cbX >> level);
+ if (!subband->inclusion[j].finished &&
+ !subband->inclusion[j].val) {
+ subband->inclusion[j].val = ttVal;
+ } else {
+ ttVal = subband->inclusion[j].val;
+ }
+ while (!subband->inclusion[j].finished &&
+ ttVal <= tile->layer) {
+ if (!readBits(1, &bits)) {
+ goto err;
+ }
+ if (bits == 1) {
+ subband->inclusion[j].finished = gTrue;
+ } else {
+ ++ttVal;
+ }
+ }
+ subband->inclusion[j].val = ttVal;
+ if (ttVal > tile->layer) {
+ break;
+ }
+ i += nx * ny;
+ }
+ cb->included = level < 0;
+ }
+
+ if (cb->included) {
+ cover(49);
+
+ // zero bit-plane count
+ if (!cb->seen) {
+ cover(50);
+ ttVal = 0;
+ i = 0;
+ for (level = subband->maxTTLevel; level >= 0; --level) {
+ nx = jpxCeilDivPow2(subband->nXCBs, level);
+ ny = jpxCeilDivPow2(subband->nYCBs, level);
+ j = i + (cbY >> level) * nx + (cbX >> level);
+ if (!subband->zeroBitPlane[j].finished &&
+ !subband->zeroBitPlane[j].val) {
+ subband->zeroBitPlane[j].val = ttVal;
+ } else {
+ ttVal = subband->zeroBitPlane[j].val;
+ }
+ while (!subband->zeroBitPlane[j].finished) {
+ if (!readBits(1, &bits)) {
+ goto err;
+ }
+ if (bits == 1) {
+ subband->zeroBitPlane[j].finished = gTrue;
+ } else {
+ ++ttVal;
+ }
+ }
+ subband->zeroBitPlane[j].val = ttVal;
+ i += nx * ny;
+ }
+ cb->nZeroBitPlanes = ttVal;
+ }
+
+ // number of coding passes
+ if (!readBits(1, &bits)) {
+ goto err;
+ }
+ if (bits == 0) {
+ cover(51);
+ cb->nCodingPasses = 1;
+ } else {
+ if (!readBits(1, &bits)) {
+ goto err;
+ }
+ if (bits == 0) {
+ cover(52);
+ cb->nCodingPasses = 2;
+ } else {
+ cover(53);
+ if (!readBits(2, &bits)) {
+ goto err;
+ }
+ if (bits < 3) {
+ cover(54);
+ cb->nCodingPasses = 3 + bits;
+ } else {
+ cover(55);
+ if (!readBits(5, &bits)) {
+ goto err;
+ }
+ if (bits < 31) {
+ cover(56);
+ cb->nCodingPasses = 6 + bits;
+ } else {
+ cover(57);
+ if (!readBits(7, &bits)) {
+ goto err;
+ }
+ cb->nCodingPasses = 37 + bits;
+ }
+ }
+ }
+ }
+
+ // update Lblock
+ while (1) {
+ if (!readBits(1, &bits)) {
+ goto err;
+ }
+ if (!bits) {
+ break;
+ }
+ ++cb->lBlock;
+ }
+
+ // length of compressed data
+ //~ deal with multiple codeword segments
+ for (n = cb->lBlock, i = cb->nCodingPasses >> 1;
+ i;
+ ++n, i >>= 1) ;
+ if (!readBits(n, &cb->dataLen)) {
+ goto err;
+ }
+ }
+ }
+ }
+ }
+ }
+ tilePartLen = finishBitBuf();
+
+ //----- packet data
+
+ for (sb = 0; sb < (Guint)(tile->res == 0 ? 1 : 3); ++sb) {
+ subband = &precinct->subbands[sb];
+ for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
+ for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
+ cb = &subband->cbs[cbY * subband->nXCBs + cbX];
+ if (cb->included) {
+ if (!readCodeBlockData(tileComp, resLevel, precinct, subband,
+ tile->res, sb, cb)) {
+ return gFalse;
+ }
+ tilePartLen -= cb->dataLen;
+ cb->seen = gTrue;
+ }
+ }
+ }
+ }
+
+ //----- next packet
+
+ switch (tile->progOrder) {
+ case 0: // layer, resolution level, component, precinct
+ cover(58);
+ if (++tile->comp == img.nComps) {
+ tile->comp = 0;
+ if (++tile->res == tile->maxNDecompLevels + 1) {
+ tile->res = 0;
+ if (++tile->layer == tile->nLayers) {
+ tile->layer = 0;
+ }
+ }
+ }
+ break;
+ case 1: // resolution level, layer, component, precinct
+ cover(59);
+ if (++tile->comp == img.nComps) {
+ tile->comp = 0;
+ if (++tile->layer == tile->nLayers) {
+ tile->layer = 0;
+ if (++tile->res == tile->maxNDecompLevels + 1) {
+ tile->res = 0;
+ }
+ }
+ }
+ break;
+ case 2: // resolution level, precinct, component, layer
+ //~ this isn't correct -- see B.12.1.3
+ cover(60);
+ if (++tile->layer == tile->nLayers) {
+ tile->layer = 0;
+ if (++tile->comp == img.nComps) {
+ tile->comp = 0;
+ if (++tile->res == tile->maxNDecompLevels + 1) {
+ tile->res = 0;
+ }
+ }
+ }
+ break;
+ case 3: // precinct, component, resolution level, layer
+ //~ this isn't correct -- see B.12.1.4
+ cover(61);
+ if (++tile->layer == tile->nLayers) {
+ tile->layer = 0;
+ if (++tile->res == tile->maxNDecompLevels + 1) {
+ tile->res = 0;
+ if (++tile->comp == img.nComps) {
+ tile->comp = 0;
+ }
+ }
+ }
+ break;
+ case 4: // component, precinct, resolution level, layer
+ //~ this isn't correct -- see B.12.1.5
+ cover(62);
+ if (++tile->layer == tile->nLayers) {
+ tile->layer = 0;
+ if (++tile->res == tile->maxNDecompLevels + 1) {
+ tile->res = 0;
+ if (++tile->comp == img.nComps) {
+ tile->comp = 0;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return gTrue;
+
+ err:
+ error(getPos(), "Error in JPX stream");
+ return gFalse;
+}
+
+GBool JPXStream::readCodeBlockData(JPXTileComp *tileComp,
+ JPXResLevel * /*resLevel*/,
+ JPXPrecinct * /*precinct*/,
+ JPXSubband * /*subband*/,
+ Guint res, Guint sb,
+ JPXCodeBlock *cb) {
+ JPXCoeff *coeff0, *coeff1, *coeff;
+ Guint horiz, vert, diag, all, cx, xorBit;
+ int horizSign, vertSign;
+ Guint i, x, y0, y1, y2;
+
+ if (cb->arithDecoder) {
+ cover(63);
+ cb->arithDecoder->restart(cb->dataLen);
+ } else {
+ cover(64);
+ cb->arithDecoder = new JArithmeticDecoder();
+ cb->arithDecoder->setStream(str, cb->dataLen);
+ cb->arithDecoder->start();
+ cb->stats = new JArithmeticDecoderStats(jpxNContexts);
+ cb->stats->setEntry(jpxContextSigProp, 4, 0);
+ cb->stats->setEntry(jpxContextRunLength, 3, 0);
+ cb->stats->setEntry(jpxContextUniform, 46, 0);
+ }
+
+ for (i = 0; i < cb->nCodingPasses; ++i) {
+ switch (cb->nextPass) {
+
+ //----- significance propagation pass
+ case jpxPassSigProp:
+ cover(65);
+ for (y0 = cb->y0, coeff0 = cb->coeffs;
+ y0 < cb->y1;
+ y0 += 4, coeff0 += 4 << tileComp->codeBlockW) {
+ for (x = cb->x0, coeff1 = coeff0;
+ x < cb->x1;
+ ++x, ++coeff1) {
+ for (y1 = 0, coeff = coeff1;
+ y1 < 4 && y0+y1 < cb->y1;
+ ++y1, coeff += tileComp->cbW) {
+ if (!(coeff->flags & jpxCoeffSignificant)) {
+ horiz = vert = diag = 0;
+ horizSign = vertSign = 2;
+ if (x > cb->x0) {
+ if (coeff[-1].flags & jpxCoeffSignificant) {
+ ++horiz;
+ horizSign += (coeff[-1].flags & jpxCoeffSign) ? -1 : 1;
+ }
+ if (y0+y1 > cb->y0) {
+ diag += (coeff[-(int)tileComp->cbW - 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ diag += (coeff[tileComp->cbW - 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ }
+ if (x < cb->x1 - 1) {
+ if (coeff[1].flags & jpxCoeffSignificant) {
+ ++horiz;
+ horizSign += (coeff[1].flags & jpxCoeffSign) ? -1 : 1;
+ }
+ if (y0+y1 > cb->y0) {
+ diag += (coeff[-(int)tileComp->cbW + 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ diag += (coeff[tileComp->cbW + 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ }
+ if (y0+y1 > cb->y0) {
+ if (coeff[-(int)tileComp->cbW].flags & jpxCoeffSignificant) {
+ ++vert;
+ vertSign += (coeff[-(int)tileComp->cbW].flags & jpxCoeffSign)
+ ? -1 : 1;
+ }
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ if (coeff[tileComp->cbW].flags & jpxCoeffSignificant) {
+ ++vert;
+ vertSign += (coeff[tileComp->cbW].flags & jpxCoeffSign)
+ ? -1 : 1;
+ }
+ }
+ cx = sigPropContext[horiz][vert][diag][res == 0 ? 1 : sb];
+ if (cx != 0) {
+ if (cb->arithDecoder->decodeBit(cx, cb->stats)) {
+ coeff->flags |= jpxCoeffSignificant | jpxCoeffFirstMagRef;
+ coeff->mag = (coeff->mag << 1) | 1;
+ cx = signContext[horizSign][vertSign][0];
+ xorBit = signContext[horizSign][vertSign][1];
+ if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
+ coeff->flags |= jpxCoeffSign;
+ }
+ }
+ ++coeff->len;
+ coeff->flags |= jpxCoeffTouched;
+ }
+ }
+ }
+ }
+ }
+ ++cb->nextPass;
+ break;
+
+ //----- magnitude refinement pass
+ case jpxPassMagRef:
+ cover(66);
+ for (y0 = cb->y0, coeff0 = cb->coeffs;
+ y0 < cb->y1;
+ y0 += 4, coeff0 += 4 << tileComp->codeBlockW) {
+ for (x = cb->x0, coeff1 = coeff0;
+ x < cb->x1;
+ ++x, ++coeff1) {
+ for (y1 = 0, coeff = coeff1;
+ y1 < 4 && y0+y1 < cb->y1;
+ ++y1, coeff += tileComp->cbW) {
+ if ((coeff->flags & jpxCoeffSignificant) &&
+ !(coeff->flags & jpxCoeffTouched)) {
+ if (coeff->flags & jpxCoeffFirstMagRef) {
+ all = 0;
+ if (x > cb->x0) {
+ all += (coeff[-1].flags >> jpxCoeffSignificantB) & 1;
+ if (y0+y1 > cb->y0) {
+ all += (coeff[-(int)tileComp->cbW - 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ all += (coeff[tileComp->cbW - 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ }
+ if (x < cb->x1 - 1) {
+ all += (coeff[1].flags >> jpxCoeffSignificantB) & 1;
+ if (y0+y1 > cb->y0) {
+ all += (coeff[-(int)tileComp->cbW + 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ all += (coeff[tileComp->cbW + 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ }
+ if (y0+y1 > cb->y0) {
+ all += (coeff[-(int)tileComp->cbW].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ all += (coeff[tileComp->cbW].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ cx = all ? 15 : 14;
+ } else {
+ cx = 16;
+ }
+ coeff->mag = (coeff->mag << 1) |
+ cb->arithDecoder->decodeBit(cx, cb->stats);
+ ++coeff->len;
+ coeff->flags |= jpxCoeffTouched;
+ coeff->flags &= ~jpxCoeffFirstMagRef;
+ }
+ }
+ }
+ }
+ ++cb->nextPass;
+ break;
+
+ //----- cleanup pass
+ case jpxPassCleanup:
+ cover(67);
+ for (y0 = cb->y0, coeff0 = cb->coeffs;
+ y0 < cb->y1;
+ y0 += 4, coeff0 += 4 << tileComp->codeBlockW) {
+ for (x = cb->x0, coeff1 = coeff0;
+ x < cb->x1;
+ ++x, ++coeff1) {
+ y1 = 0;
+ if (y0 + 3 < cb->y1 &&
+ !(coeff1->flags & jpxCoeffTouched) &&
+ !(coeff1[tileComp->cbW].flags & jpxCoeffTouched) &&
+ !(coeff1[2 * tileComp->cbW].flags & jpxCoeffTouched) &&
+ !(coeff1[3 * tileComp->cbW].flags & jpxCoeffTouched) &&
+ (x == cb->x0 || y0 == cb->y0 ||
+ !(coeff1[-(int)tileComp->cbW - 1].flags
+ & jpxCoeffSignificant)) &&
+ (y0 == cb->y0 ||
+ !(coeff1[-(int)tileComp->cbW].flags
+ & jpxCoeffSignificant)) &&
+ (x == cb->x1 - 1 || y0 == cb->y0 ||
+ !(coeff1[-(int)tileComp->cbW + 1].flags
+ & jpxCoeffSignificant)) &&
+ (x == cb->x0 ||
+ (!(coeff1[-1].flags & jpxCoeffSignificant) &&
+ !(coeff1[tileComp->cbW - 1].flags
+ & jpxCoeffSignificant) &&
+ !(coeff1[2 * tileComp->cbW - 1].flags
+ & jpxCoeffSignificant) &&
+ !(coeff1[3 * tileComp->cbW - 1].flags
+ & jpxCoeffSignificant))) &&
+ (x == cb->x1 - 1 ||
+ (!(coeff1[1].flags & jpxCoeffSignificant) &&
+ !(coeff1[tileComp->cbW + 1].flags
+ & jpxCoeffSignificant) &&
+ !(coeff1[2 * tileComp->cbW + 1].flags
+ & jpxCoeffSignificant) &&
+ !(coeff1[3 * tileComp->cbW + 1].flags
+ & jpxCoeffSignificant))) &&
+ (x == cb->x0 || y0+4 == cb->y1 ||
+ !(coeff1[4 * tileComp->cbW - 1].flags & jpxCoeffSignificant)) &&
+ (y0+4 == cb->y1 ||
+ !(coeff1[4 * tileComp->cbW].flags & jpxCoeffSignificant)) &&
+ (x == cb->x1 - 1 || y0+4 == cb->y1 ||
+ !(coeff1[4 * tileComp->cbW + 1].flags
+ & jpxCoeffSignificant))) {
+ if (cb->arithDecoder->decodeBit(jpxContextRunLength, cb->stats)) {
+ y1 = cb->arithDecoder->decodeBit(jpxContextUniform, cb->stats);
+ y1 = (y1 << 1) |
+ cb->arithDecoder->decodeBit(jpxContextUniform, cb->stats);
+ for (y2 = 0, coeff = coeff1;
+ y2 < y1;
+ ++y2, coeff += tileComp->cbW) {
+ ++coeff->len;
+ }
+ coeff->flags |= jpxCoeffSignificant | jpxCoeffFirstMagRef;
+ coeff->mag = (coeff->mag << 1) | 1;
+ ++coeff->len;
+ cx = signContext[2][2][0];
+ xorBit = signContext[2][2][1];
+ if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
+ coeff->flags |= jpxCoeffSign;
+ }
+ ++y1;
+ } else {
+ for (y1 = 0, coeff = coeff1;
+ y1 < 4;
+ ++y1, coeff += tileComp->cbW) {
+ ++coeff->len;
+ }
+ y1 = 4;
+ }
+ }
+ for (coeff = &coeff1[y1 << tileComp->codeBlockW];
+ y1 < 4 && y0 + y1 < cb->y1;
+ ++y1, coeff += tileComp->cbW) {
+ if (!(coeff->flags & jpxCoeffTouched)) {
+ horiz = vert = diag = 0;
+ horizSign = vertSign = 2;
+ if (x > cb->x0) {
+ if (coeff[-1].flags & jpxCoeffSignificant) {
+ ++horiz;
+ horizSign += (coeff[-1].flags & jpxCoeffSign) ? -1 : 1;
+ }
+ if (y0+y1 > cb->y0) {
+ diag += (coeff[-(int)tileComp->cbW - 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ diag += (coeff[tileComp->cbW - 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ }
+ if (x < cb->x1 - 1) {
+ if (coeff[1].flags & jpxCoeffSignificant) {
+ ++horiz;
+ horizSign += (coeff[1].flags & jpxCoeffSign) ? -1 : 1;
+ }
+ if (y0+y1 > cb->y0) {
+ diag += (coeff[-(int)tileComp->cbW + 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ diag += (coeff[tileComp->cbW + 1].flags
+ >> jpxCoeffSignificantB) & 1;
+ }
+ }
+ if (y0+y1 > cb->y0) {
+ if (coeff[-(int)tileComp->cbW].flags & jpxCoeffSignificant) {
+ ++vert;
+ vertSign += (coeff[-(int)tileComp->cbW].flags & jpxCoeffSign)
+ ? -1 : 1;
+ }
+ }
+ if (y0+y1 < cb->y1 - 1) {
+ if (coeff[tileComp->cbW].flags & jpxCoeffSignificant) {
+ ++vert;
+ vertSign += (coeff[tileComp->cbW].flags & jpxCoeffSign)
+ ? -1 : 1;
+ }
+ }
+ cx = sigPropContext[horiz][vert][diag][res == 0 ? 1 : sb];
+ if (cb->arithDecoder->decodeBit(cx, cb->stats)) {
+ coeff->flags |= jpxCoeffSignificant | jpxCoeffFirstMagRef;
+ coeff->mag = (coeff->mag << 1) | 1;
+ cx = signContext[horizSign][vertSign][0];
+ xorBit = signContext[horizSign][vertSign][1];
+ if (cb->arithDecoder->decodeBit(cx, cb->stats) ^ xorBit) {
+ coeff->flags |= jpxCoeffSign;
+ }
+ }
+ ++coeff->len;
+ } else {
+ coeff->flags &= ~jpxCoeffTouched;
+ }
+ }
+ }
+ }
+ cb->nextPass = jpxPassSigProp;
+ break;
+ }
+ }
+
+ cb->arithDecoder->cleanup();
+ return gTrue;
+}
+
+// Inverse quantization, and wavelet transform (IDWT). This also does
+// the initial shift to convert to fixed point format.
+void JPXStream::inverseTransform(JPXTileComp *tileComp) {
+ JPXResLevel *resLevel;
+ JPXPrecinct *precinct;
+ JPXSubband *subband;
+ JPXCodeBlock *cb;
+ JPXCoeff *coeff0, *coeff;
+ Guint qStyle, guard, eps, shift;
+ int shift2;
+ double mu;
+ int val;
+ int *dataPtr;
+ Guint nx0, ny0, nx1, ny1;
+ Guint r, cbX, cbY, x, y;
+
+ cover(68);
+
+ //----- (NL)LL subband (resolution level 0)
+
+ resLevel = &tileComp->resLevels[0];
+ precinct = &resLevel->precincts[0];
+ subband = &precinct->subbands[0];
+
+ // i-quant parameters
+ qStyle = tileComp->quantStyle & 0x1f;
+ guard = (tileComp->quantStyle >> 5) & 7;
+ if (qStyle == 0) {
+ cover(69);
+ eps = (tileComp->quantSteps[0] >> 3) & 0x1f;
+ shift = guard + eps - 1;
+ mu = 0; // make gcc happy
+ } else {
+ cover(70);
+ shift = guard - 1 + tileComp->prec;
+ mu = (double)(0x800 + (tileComp->quantSteps[0] & 0x7ff)) / 2048.0;
+ }
+ if (tileComp->transform == 0) {
+ cover(71);
+ shift += fracBits;
+ }
+
+ // copy (NL)LL into the upper-left corner of the data array, doing
+ // the fixed point adjustment and dequantization along the way
+ cb = subband->cbs;
+ for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
+ for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
+ for (y = cb->y0, coeff0 = cb->coeffs;
+ y < cb->y1;
+ ++y, coeff0 += tileComp->cbW) {
+ dataPtr = &tileComp->data[(y - subband->y0)
+ * (tileComp->x1 - tileComp->x0)
+ + (cb->x0 - subband->x0)];
+ for (x = cb->x0, coeff = coeff0; x < cb->x1; ++x, ++coeff) {
+ val = (int)coeff->mag;
+ if (val != 0) {
+ shift2 = shift - (cb->nZeroBitPlanes + coeff->len);
+ if (shift2 > 0) {
+ cover(94);
+ val = (val << shift2) + (1 << (shift2 - 1));
+ } else {
+ cover(95);
+ val >>= -shift2;
+ }
+ if (qStyle == 0) {
+ cover(96);
+ if (tileComp->transform == 0) {
+ cover(97);
+ val &= -1 << fracBits;
+ }
+ } else {
+ cover(98);
+ val = (int)((double)val * mu);
+ }
+ if (coeff->flags & jpxCoeffSign) {
+ cover(99);
+ val = -val;
+ }
+ }
+ *dataPtr++ = val;
+ }
+ }
+ ++cb;
+ }
+ }
+
+ //----- IDWT for each level
+
+ for (r = 1; r <= tileComp->nDecompLevels; ++r) {
+ resLevel = &tileComp->resLevels[r];
+
+ // (n)LL is already in the upper-left corner of the
+ // tile-component data array -- interleave with (n)HL/LH/HH
+ // and inverse transform to get (n-1)LL, which will be stored
+ // in the upper-left corner of the tile-component data array
+ if (r == tileComp->nDecompLevels) {
+ cover(72);
+ nx0 = tileComp->x0;
+ ny0 = tileComp->y0;
+ nx1 = tileComp->x1;
+ ny1 = tileComp->y1;
+ } else {
+ cover(73);
+ nx0 = tileComp->resLevels[r+1].x0;
+ ny0 = tileComp->resLevels[r+1].y0;
+ nx1 = tileComp->resLevels[r+1].x1;
+ ny1 = tileComp->resLevels[r+1].y1;
+ }
+ inverseTransformLevel(tileComp, r, resLevel, nx0, ny0, nx1, ny1);
+ }
+}
+
+// Do one level of the inverse transform:
+// - take (n)LL from the tile-component data array
+// - take (n)HL/LH/HH from <resLevel>
+// - leave the resulting (n-1)LL in the tile-component data array
+void JPXStream::inverseTransformLevel(JPXTileComp *tileComp,
+ Guint r, JPXResLevel *resLevel,
+ Guint nx0, Guint ny0,
+ Guint nx1, Guint ny1) {
+ JPXPrecinct *precinct;
+ JPXSubband *subband;
+ JPXCodeBlock *cb;
+ JPXCoeff *coeff0, *coeff;
+ Guint qStyle, guard, eps, shift, t;
+ int shift2;
+ double mu;
+ int val;
+ int *dataPtr;
+ Guint xo, yo;
+ Guint x, y, sb, cbX, cbY;
+ int xx, yy;
+
+ //----- interleave
+
+ // spread out LL
+ for (yy = resLevel->y1 - 1; yy >= (int)resLevel->y0; --yy) {
+ for (xx = resLevel->x1 - 1; xx >= (int)resLevel->x0; --xx) {
+ tileComp->data[(2 * yy - ny0) * (tileComp->x1 - tileComp->x0)
+ + (2 * xx - nx0)] =
+ tileComp->data[(yy - resLevel->y0) * (tileComp->x1 - tileComp->x0)
+ + (xx - resLevel->x0)];
+ }
+ }
+
+ // i-quant parameters
+ qStyle = tileComp->quantStyle & 0x1f;
+ guard = (tileComp->quantStyle >> 5) & 7;
+
+ // interleave HL/LH/HH
+ precinct = &resLevel->precincts[0];
+ for (sb = 0; sb < 3; ++sb) {
+
+ // i-quant parameters
+ if (qStyle == 0) {
+ cover(100);
+ eps = (tileComp->quantSteps[3*r - 2 + sb] >> 3) & 0x1f;
+ shift = guard + eps - 1;
+ mu = 0; // make gcc happy
+ } else {
+ cover(101);
+ shift = guard + tileComp->prec;
+ if (sb == 2) {
+ cover(102);
+ ++shift;
+ }
+ t = tileComp->quantSteps[qStyle == 1 ? 0 : (3*r - 2 + sb)];
+ mu = (double)(0x800 + (t & 0x7ff)) / 2048.0;
+ }
+ if (tileComp->transform == 0) {
+ cover(103);
+ shift += fracBits;
+ }
+
+ // copy the subband coefficients into the data array, doing the
+ // fixed point adjustment and dequantization along the way
+ xo = (sb & 1) ? 0 : 1;
+ yo = (sb > 0) ? 1 : 0;
+ subband = &precinct->subbands[sb];
+ cb = subband->cbs;
+ for (cbY = 0; cbY < subband->nYCBs; ++cbY) {
+ for (cbX = 0; cbX < subband->nXCBs; ++cbX) {
+ for (y = cb->y0, coeff0 = cb->coeffs;
+ y < cb->y1;
+ ++y, coeff0 += tileComp->cbW) {
+ dataPtr = &tileComp->data[(2 * y + yo - ny0)
+ * (tileComp->x1 - tileComp->x0)
+ + (2 * cb->x0 + xo - nx0)];
+ for (x = cb->x0, coeff = coeff0; x < cb->x1; ++x, ++coeff) {
+ val = (int)coeff->mag;
+ if (val != 0) {
+ shift2 = shift - (cb->nZeroBitPlanes + coeff->len);
+ if (shift2 > 0) {
+ cover(74);
+ val = (val << shift2) + (1 << (shift2 - 1));
+ } else {
+ cover(75);
+ val >>= -shift2;
+ }
+ if (qStyle == 0) {
+ cover(76);
+ if (tileComp->transform == 0) {
+ val &= -1 << fracBits;
+ }
+ } else {
+ cover(77);
+ val = (int)((double)val * mu);
+ }
+ if (coeff->flags & jpxCoeffSign) {
+ cover(78);
+ val = -val;
+ }
+ }
+ *dataPtr = val;
+ dataPtr += 2;
+ }
+ }
+ ++cb;
+ }
+ }
+ }
+
+ //----- horizontal (row) transforms
+ dataPtr = tileComp->data;
+ for (y = 0; y < ny1 - ny0; ++y) {
+ inverseTransform1D(tileComp, dataPtr, 1, nx0, nx1);
+ dataPtr += tileComp->x1 - tileComp->x0;
+ }
+
+ //----- vertical (column) transforms
+ dataPtr = tileComp->data;
+ for (x = 0; x < nx1 - nx0; ++x) {
+ inverseTransform1D(tileComp, dataPtr,
+ tileComp->x1 - tileComp->x0, ny0, ny1);
+ ++dataPtr;
+ }
+}
+
+void JPXStream::inverseTransform1D(JPXTileComp *tileComp,
+ int *data, Guint stride,
+ Guint i0, Guint i1) {
+ int *buf;
+ Guint offset, end, i;
+
+ //----- special case for length = 1
+ if (i1 - i0 == 1) {
+ cover(79);
+ if (i0 & 1) {
+ cover(104);
+ *data >>= 1;
+ }
+
+ } else {
+ cover(80);
+
+ // choose an offset: this makes even buf[] indexes correspond to
+ // odd values of i, and vice versa
+ offset = 3 + (i0 & 1);
+ end = offset + i1 - i0;
+
+ //----- gather
+ buf = tileComp->buf;
+ for (i = 0; i < i1 - i0; ++i) {
+ buf[offset + i] = data[i * stride];
+ }
+
+ //----- extend right
+ buf[end] = buf[end - 2];
+ if (i1 - i0 == 2) {
+ cover(81);
+ buf[end+1] = buf[offset + 1];
+ buf[end+2] = buf[offset];
+ buf[end+3] = buf[offset + 1];
+ } else {
+ cover(82);
+ buf[end+1] = buf[end - 3];
+ if (i1 - i0 == 3) {
+ cover(105);
+ buf[end+2] = buf[offset + 1];
+ buf[end+3] = buf[offset + 2];
+ } else {
+ cover(106);
+ buf[end+2] = buf[end - 4];
+ if (i1 - i0 == 4) {
+ cover(107);
+ buf[end+3] = buf[offset + 1];
+ } else {
+ cover(108);
+ buf[end+3] = buf[end - 5];
+ }
+ }
+ }
+
+ //----- extend left
+ buf[offset - 1] = buf[offset + 1];
+ buf[offset - 2] = buf[offset + 2];
+ buf[offset - 3] = buf[offset + 3];
+ if (offset == 4) {
+ cover(83);
+ buf[0] = buf[offset + 4];
+ }
+
+ //----- 9-7 irreversible filter
+
+ if (tileComp->transform == 0) {
+ cover(84);
+ // step 1 (even)
+ for (i = 1; i <= end + 2; i += 2) {
+ buf[i] = (int)(idwtKappa * buf[i]);
+ }
+ // step 2 (odd)
+ for (i = 0; i <= end + 3; i += 2) {
+ buf[i] = (int)(idwtIKappa * buf[i]);
+ }
+ // step 3 (even)
+ for (i = 1; i <= end + 2; i += 2) {
+ buf[i] = (int)(buf[i] - idwtDelta * (buf[i-1] + buf[i+1]));
+ }
+ // step 4 (odd)
+ for (i = 2; i <= end + 1; i += 2) {
+ buf[i] = (int)(buf[i] - idwtGamma * (buf[i-1] + buf[i+1]));
+ }
+ // step 5 (even)
+ for (i = 3; i <= end; i += 2) {
+ buf[i] = (int)(buf[i] - idwtBeta * (buf[i-1] + buf[i+1]));
+ }
+ // step 6 (odd)
+ for (i = 4; i <= end - 1; i += 2) {
+ buf[i] = (int)(buf[i] - idwtAlpha * (buf[i-1] + buf[i+1]));
+ }
+
+ //----- 5-3 reversible filter
+
+ } else {
+ cover(85);
+ // step 1 (even)
+ for (i = 3; i <= end; i += 2) {
+ buf[i] -= (buf[i-1] + buf[i+1] + 2) >> 2;
+ }
+ // step 2 (odd)
+ for (i = 4; i < end; i += 2) {
+ buf[i] += (buf[i-1] + buf[i+1]) >> 1;
+ }
+ }
+
+ //----- scatter
+ for (i = 0; i < i1 - i0; ++i) {
+ data[i * stride] = buf[offset + i];
+ }
+ }
+}
+
+// Inverse multi-component transform and DC level shift. This also
+// converts fixed point samples back to integers.
+GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) {
+ JPXTileComp *tileComp;
+ int coeff, d0, d1, d2, t, minVal, maxVal, zeroVal;
+ int *dataPtr;
+ Guint j, comp, x, y;
+
+ //----- inverse multi-component transform
+
+ if (tile->multiComp == 1) {
+ cover(86);
+ if (img.nComps < 3 ||
+ tile->tileComps[0].hSep != tile->tileComps[1].hSep ||
+ tile->tileComps[0].vSep != tile->tileComps[1].vSep ||
+ tile->tileComps[1].hSep != tile->tileComps[2].hSep ||
+ tile->tileComps[1].vSep != tile->tileComps[2].vSep) {
+ return gFalse;
+ }
+
+ // inverse irreversible multiple component transform
+ if (tile->tileComps[0].transform == 0) {
+ cover(87);
+ j = 0;
+ for (y = 0; y < tile->tileComps[0].y1 - tile->tileComps[0].y0; ++y) {
+ for (x = 0; x < tile->tileComps[0].x1 - tile->tileComps[0].x0; ++x) {
+ d0 = tile->tileComps[0].data[j];
+ d1 = tile->tileComps[1].data[j];
+ d2 = tile->tileComps[2].data[j];
+ tile->tileComps[0].data[j] = (int)(d0 + 1.402 * d2 + 0.5);
+ tile->tileComps[1].data[j] =
+ (int)(d0 - 0.34413 * d1 - 0.71414 * d2 + 0.5);
+ tile->tileComps[2].data[j] = (int)(d0 + 1.772 * d1 + 0.5);
+ ++j;
+ }
+ }
+
+ // inverse reversible multiple component transform
+ } else {
+ cover(88);
+ j = 0;
+ for (y = 0; y < tile->tileComps[0].y1 - tile->tileComps[0].y0; ++y) {
+ for (x = 0; x < tile->tileComps[0].x1 - tile->tileComps[0].x0; ++x) {
+ d0 = tile->tileComps[0].data[j];
+ d1 = tile->tileComps[1].data[j];
+ d2 = tile->tileComps[2].data[j];
+ tile->tileComps[1].data[j] = t = d0 - ((d2 + d1) >> 2);
+ tile->tileComps[0].data[j] = d2 + t;
+ tile->tileComps[2].data[j] = d1 + t;
+ ++j;
+ }
+ }
+ }
+ }
+
+ //----- DC level shift
+ for (comp = 0; comp < img.nComps; ++comp) {
+ tileComp = &tile->tileComps[comp];
+
+ // signed: clip
+ if (tileComp->sgned) {
+ cover(89);
+ minVal = -(1 << (tileComp->prec - 1));
+ maxVal = (1 << (tileComp->prec - 1)) - 1;
+ dataPtr = tileComp->data;
+ for (y = 0; y < tileComp->y1 - tileComp->y0; ++y) {
+ for (x = 0; x < tileComp->x1 - tileComp->x0; ++x) {
+ coeff = *dataPtr;
+ if (tileComp->transform == 0) {
+ cover(109);
+ coeff >>= fracBits;
+ }
+ if (coeff < minVal) {
+ cover(110);
+ coeff = minVal;
+ } else if (coeff > maxVal) {
+ cover(111);
+ coeff = maxVal;
+ }
+ *dataPtr++ = coeff;
+ }
+ }
+
+ // unsigned: inverse DC level shift and clip
+ } else {
+ cover(90);
+ maxVal = (1 << tileComp->prec) - 1;
+ zeroVal = 1 << (tileComp->prec - 1);
+ dataPtr = tileComp->data;
+ for (y = 0; y < tileComp->y1 - tileComp->y0; ++y) {
+ for (x = 0; x < tileComp->x1 - tileComp->x0; ++x) {
+ coeff = *dataPtr;
+ if (tileComp->transform == 0) {
+ cover(112);
+ coeff >>= fracBits;
+ }
+ coeff += zeroVal;
+ if (coeff < 0) {
+ cover(113);
+ coeff = 0;
+ } else if (coeff > maxVal) {
+ cover(114);
+ coeff = maxVal;
+ }
+ *dataPtr++ = coeff;
+ }
+ }
+ }
+ }
+
+ return gTrue;
+}
+
+GBool JPXStream::readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
+ Guint len, lenH;
+
+ if (!readULong(&len) ||
+ !readULong(boxType)) {
+ return gFalse;
+ }
+ if (len == 1) {
+ if (!readULong(&lenH) || !readULong(&len)) {
+ return gFalse;
+ }
+ if (lenH) {
+ error(getPos(), "JPX stream contains a box larger than 2^32 bytes");
+ return gFalse;
+ }
+ *boxLen = len;
+ *dataLen = len - 16;
+ } else if (len == 0) {
+ *boxLen = 0;
+ *dataLen = 0;
+ } else {
+ *boxLen = len;
+ *dataLen = len - 8;
+ }
+ return gTrue;
+}
+
+int JPXStream::readMarkerHdr(int *segType, Guint *segLen) {
+ int c;
+
+ do {
+ do {
+ if ((c = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ } while (c != 0xff);
+ do {
+ if ((c = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ } while (c == 0xff);
+ } while (c == 0x00);
+ *segType = c;
+ if ((c >= 0x30 && c <= 0x3f) ||
+ c == 0x4f || c == 0x92 || c == 0x93 || c == 0xd9) {
+ *segLen = 0;
+ return gTrue;
+ }
+ return readUWord(segLen);
+}
+
+GBool JPXStream::readUByte(Guint *x) {
+ int c0;
+
+ if ((c0 = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = (Guint)c0;
+ return gTrue;
+}
+
+GBool JPXStream::readByte(int *x) {
+ int c0;
+
+ if ((c0 = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = c0;
+ if (c0 & 0x80) {
+ *x |= -1 - 0xff;
+ }
+ return gTrue;
+}
+
+GBool JPXStream::readUWord(Guint *x) {
+ int c0, c1;
+
+ if ((c0 = str->getChar()) == EOF ||
+ (c1 = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = (Guint)((c0 << 8) | c1);
+ return gTrue;
+}
+
+GBool JPXStream::readULong(Guint *x) {
+ int c0, c1, c2, c3;
+
+ if ((c0 = str->getChar()) == EOF ||
+ (c1 = str->getChar()) == EOF ||
+ (c2 = str->getChar()) == EOF ||
+ (c3 = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ *x = (Guint)((c0 << 24) | (c1 << 16) | (c2 << 8) | c3);
+ return gTrue;
+}
+
+GBool JPXStream::readNBytes(int nBytes, GBool signd, int *x) {
+ int y, c, i;
+
+ y = 0;
+ for (i = 0; i < nBytes; ++i) {
+ if ((c = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ y = (y << 8) + c;
+ }
+ if (signd) {
+ if (y & (1 << (8 * nBytes - 1))) {
+ y |= -1 << (8 * nBytes);
+ }
+ }
+ *x = y;
+ return gTrue;
+}
+
+GBool JPXStream::readBits(int nBits, Guint *x) {
+ int c;
+
+ while (bitBufLen < nBits) {
+ if (byteCount == 0 || (c = str->getChar()) == EOF) {
+ return gFalse;
+ }
+ --byteCount;
+ if (bitBufSkip) {
+ bitBuf = (bitBuf << 7) | (c & 0x7f);
+ bitBufLen += 7;
+ } else {
+ bitBuf = (bitBuf << 8) | (c & 0xff);
+ bitBufLen += 8;
+ }
+ bitBufSkip = c == 0xff;
+ }
+ *x = (bitBuf >> (bitBufLen - nBits)) & ((1 << nBits) - 1);
+ bitBufLen -= nBits;
+ return gTrue;
+}
+
+void JPXStream::startBitBuf(Guint byteCountA) {
+ bitBufLen = 0;
+ bitBufSkip = gFalse;
+ byteCount = byteCountA;
+}
+
+Guint JPXStream::finishBitBuf() {
+ if (bitBufSkip) {
+ str->getChar();
+ --byteCount;
+ }
+ return byteCount;
+}
diff --git a/kpdf/xpdf/xpdf/Lexer.cc b/kpdf/xpdf/xpdf/Lexer.cc
deleted file mode 100644
index 1ef37175..00000000
--- a/kpdf/xpdf/xpdf/Lexer.cc
+++ /dev/null
@@ -1,521 +0,0 @@
-//========================================================================
-//
-// Lexer.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include <ctype.h>
-#include "Lexer.h"
-#include "Error.h"
-#include "XRef.h"
-
-//------------------------------------------------------------------------
-
-// A '1' in this array means the character is white space. A '1' or
-// '2' means the character ends a name or command.
-static char specialChars[256] = {
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
- 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx
-};
-
-//------------------------------------------------------------------------
-// Lexer
-//------------------------------------------------------------------------
-
-Lexer::Lexer(XRef *xrefA, Stream *str) {
- Object obj;
-
- xref = xrefA;
-
- curStr.initStream(str);
- streams = new Array(xref);
- streams->add(curStr.copy(&obj));
- strPtr = 0;
- freeArray = gTrue;
- curStr.streamReset();
-}
-
-Lexer::Lexer(XRef *xrefA, Object *obj) {
- Object obj2;
-
- xref = xrefA;
-
- if (obj->isStream()) {
- streams = new Array(xref);
- freeArray = gTrue;
- streams->add(obj->copy(&obj2));
- } else {
- streams = obj->getArray();
- freeArray = gFalse;
- }
- strPtr = 0;
- if (streams->getLength() > 0) {
- streams->get(strPtr, &curStr);
- curStr.streamReset();
- }
-}
-
-Lexer::~Lexer() {
- if (!curStr.isNone()) {
- curStr.streamClose();
- curStr.free();
- }
- if (freeArray) {
- delete streams;
- }
-}
-
-int Lexer::getChar() {
- int c;
-
- c = EOF;
- while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
- curStr.streamClose();
- curStr.free();
- ++strPtr;
- if (strPtr < streams->getLength()) {
- streams->get(strPtr, &curStr);
- curStr.streamReset();
- }
- }
- return c;
-}
-
-int Lexer::lookChar() {
- if (curStr.isNone()) {
- return EOF;
- }
- return curStr.streamLookChar();
-}
-
-Object *Lexer::getObj(Object *obj, int objNum) {
- char *p;
- int c, c2;
- GBool comment, neg, done;
- int numParen;
- int xi;
- double xf, scale;
- GString *s;
- int n, m;
-
- // skip whitespace and comments
- comment = gFalse;
- while (1) {
- if ((c = getChar()) == EOF) {
- return obj->initEOF();
- }
- if (comment) {
- if (c == '\r' || c == '\n')
- comment = gFalse;
- } else if (c == '%') {
- comment = gTrue;
- } else if (specialChars[c] != 1) {
- break;
- }
- }
-
- // start reading token
- switch (c) {
-
- // number
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case '-': case '.':
- neg = gFalse;
- xi = 0;
- if (c == '-') {
- neg = gTrue;
- } else if (c == '.') {
- goto doReal;
- } else {
- xi = c - '0';
- }
- while (1) {
- c = lookChar();
- if (isdigit(c)) {
- getChar();
- xi = xi * 10 + (c - '0');
- } else if (c == '.') {
- getChar();
- goto doReal;
- } else {
- break;
- }
- }
- if (neg)
- xi = -xi;
- obj->initInt(xi);
- break;
- doReal:
- xf = xi;
- scale = 0.1;
- while (1) {
- c = lookChar();
- if (c == '-') {
- // ignore minus signs in the middle of numbers to match
- // Adobe's behavior
- error(getPos(), "Badly formatted number");
- getChar();
- continue;
- }
- if (!isdigit(c)) {
- break;
- }
- getChar();
- xf = xf + scale * (c - '0');
- scale *= 0.1;
- }
- if (neg)
- xf = -xf;
- obj->initReal(xf);
- break;
-
- // string
- case '(':
- p = tokBuf;
- n = 0;
- numParen = 1;
- done = gFalse;
- s = NULL;
- do {
- c2 = EOF;
- switch (c = getChar()) {
-
- case EOF:
-#if 0
- // This breaks some PDF files, e.g., ones from Photoshop.
- case '\r':
- case '\n':
-#endif
- error(getPos(), "Unterminated string");
- done = gTrue;
- break;
-
- case '(':
- ++numParen;
- c2 = c;
- break;
-
- case ')':
- if (--numParen == 0) {
- done = gTrue;
- } else {
- c2 = c;
- }
- break;
-
- case '\\':
- switch (c = getChar()) {
- case 'n':
- c2 = '\n';
- break;
- case 'r':
- c2 = '\r';
- break;
- case 't':
- c2 = '\t';
- break;
- case 'b':
- c2 = '\b';
- break;
- case 'f':
- c2 = '\f';
- break;
- case '\\':
- case '(':
- case ')':
- c2 = c;
- break;
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- c2 = c - '0';
- c = lookChar();
- if (c >= '0' && c <= '7') {
- getChar();
- c2 = (c2 << 3) + (c - '0');
- c = lookChar();
- if (c >= '0' && c <= '7') {
- getChar();
- c2 = (c2 << 3) + (c - '0');
- }
- }
- break;
- case '\r':
- c = lookChar();
- if (c == '\n') {
- getChar();
- }
- break;
- case '\n':
- break;
- case EOF:
- error(getPos(), "Unterminated string");
- done = gTrue;
- break;
- default:
- c2 = c;
- break;
- }
- break;
-
- default:
- c2 = c;
- break;
- }
-
- if (c2 != EOF) {
- if (n == tokBufSize) {
- if (!s)
- s = new GString(tokBuf, tokBufSize);
- else
- s->append(tokBuf, tokBufSize);
- p = tokBuf;
- n = 0;
-
- // we are growing see if the document is not malformed and we are growing too much
- if (objNum > 0 && xref != NULL)
- {
- int newObjNum = xref->getNumEntry(curStr.streamGetPos());
- if (newObjNum != objNum)
- {
- error(getPos(), "Unterminated string");
- done = gTrue;
- delete s;
- n = -2;
- }
- }
- }
- *p++ = (char)c2;
- ++n;
- }
- } while (!done);
- if (n >= 0) {
- if (!s)
- s = new GString(tokBuf, n);
- else
- s->append(tokBuf, n);
- obj->initString(s);
- } else {
- obj->initEOF();
- }
- break;
-
- // name
- case '/':
- p = tokBuf;
- n = 0;
- s = NULL;
- while ((c = lookChar()) != EOF && !specialChars[c]) {
- getChar();
- if (c == '#') {
- c2 = lookChar();
- if (c2 >= '0' && c2 <= '9') {
- c = c2 - '0';
- } else if (c2 >= 'A' && c2 <= 'F') {
- c = c2 - 'A' + 10;
- } else if (c2 >= 'a' && c2 <= 'f') {
- c = c2 - 'a' + 10;
- } else {
- goto notEscChar;
- }
- getChar();
- c <<= 4;
- c2 = getChar();
- if (c2 >= '0' && c2 <= '9') {
- c += c2 - '0';
- } else if (c2 >= 'A' && c2 <= 'F') {
- c += c2 - 'A' + 10;
- } else if (c2 >= 'a' && c2 <= 'f') {
- c += c2 - 'a' + 10;
- } else {
- error(getPos(), "Illegal digit in hex char in name");
- }
- }
- notEscChar:
- if (n == tokBufSize) {
- if (!s)
- s = new GString(tokBuf, tokBufSize);
- else
- {
- // the spec says 127 is the maximum, we are already at 256 so bail out
- error(getPos(), "Name token too long");
- break;
- }
- p = tokBuf;
- n = 0;
- }
- *p++ = c;
- ++n;
- }
- *p = '\0';
- if (s) {
- s->append(tokBuf, n);
- obj->initName(s->getCString());
- delete s;
- } else obj->initName(tokBuf);
- break;
-
- // array punctuation
- case '[':
- case ']':
- tokBuf[0] = c;
- tokBuf[1] = '\0';
- obj->initCmd(tokBuf);
- break;
-
- // hex string or dict punctuation
- case '<':
- c = lookChar();
-
- // dict punctuation
- if (c == '<') {
- getChar();
- tokBuf[0] = tokBuf[1] = '<';
- tokBuf[2] = '\0';
- obj->initCmd(tokBuf);
-
- // hex string
- } else {
- p = tokBuf;
- m = n = 0;
- c2 = 0;
- s = NULL;
- while (1) {
- c = getChar();
- if (c == '>') {
- break;
- } else if (c == EOF) {
- error(getPos(), "Unterminated hex string");
- break;
- } else if (specialChars[c] != 1) {
- c2 = c2 << 4;
- if (c >= '0' && c <= '9')
- c2 += c - '0';
- else if (c >= 'A' && c <= 'F')
- c2 += c - 'A' + 10;
- else if (c >= 'a' && c <= 'f')
- c2 += c - 'a' + 10;
- else
- error(getPos(), "Illegal character <%02x> in hex string", c);
- if (++m == 2) {
- if (n == tokBufSize) {
- if (!s)
- s = new GString(tokBuf, tokBufSize);
- else
- s->append(tokBuf, tokBufSize);
- p = tokBuf;
- n = 0;
- }
- *p++ = (char)c2;
- ++n;
- c2 = 0;
- m = 0;
- }
- }
- }
- if (!s)
- s = new GString(tokBuf, n);
- else
- s->append(tokBuf, n);
- if (m == 1)
- s->append((char)(c2 << 4));
- obj->initString(s);
- }
- break;
-
- // dict punctuation
- case '>':
- c = lookChar();
- if (c == '>') {
- getChar();
- tokBuf[0] = tokBuf[1] = '>';
- tokBuf[2] = '\0';
- obj->initCmd(tokBuf);
- } else {
- error(getPos(), "Illegal character '>'");
- obj->initError();
- }
- break;
-
- // error
- case ')':
- case '{':
- case '}':
- error(getPos(), "Illegal character '%c'", c);
- obj->initError();
- break;
-
- // command
- default:
- p = tokBuf;
- *p++ = c;
- n = 1;
- while ((c = lookChar()) != EOF && !specialChars[c]) {
- getChar();
- if (++n == tokBufSize) {
- error(getPos(), "Command token too long");
- break;
- }
- *p++ = c;
- }
- *p = '\0';
- if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
- obj->initBool(gTrue);
- } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
- obj->initBool(gFalse);
- } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
- obj->initNull();
- } else {
- obj->initCmd(tokBuf);
- }
- break;
- }
-
- return obj;
-}
-
-void Lexer::skipToNextLine() {
- int c;
-
- while (1) {
- c = getChar();
- if (c == EOF || c == '\n') {
- return;
- }
- if (c == '\r') {
- if ((c = lookChar()) == '\n') {
- getChar();
- }
- return;
- }
- }
-}
-
-GBool Lexer::isSpace(int c) {
- return c >= 0 && c <= 0xff && specialChars[c] == 1;
-}
diff --git a/kpdf/xpdf/xpdf/Lexer.cpp b/kpdf/xpdf/xpdf/Lexer.cpp
new file mode 100644
index 00000000..04eadef2
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Lexer.cpp
@@ -0,0 +1,521 @@
+//========================================================================
+//
+// Lexer.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include "Lexer.h"
+#include "Error.h"
+#include "XRef.h"
+
+//------------------------------------------------------------------------
+
+// A '1' in this array means the character is white space. A '1' or
+// '2' means the character ends a name or command.
+static char specialChars[256] = {
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
+ 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx
+};
+
+//------------------------------------------------------------------------
+// Lexer
+//------------------------------------------------------------------------
+
+Lexer::Lexer(XRef *xrefA, Stream *str) {
+ Object obj;
+
+ xref = xrefA;
+
+ curStr.initStream(str);
+ streams = new Array(xref);
+ streams->add(curStr.copy(&obj));
+ strPtr = 0;
+ freeArray = gTrue;
+ curStr.streamReset();
+}
+
+Lexer::Lexer(XRef *xrefA, Object *obj) {
+ Object obj2;
+
+ xref = xrefA;
+
+ if (obj->isStream()) {
+ streams = new Array(xref);
+ freeArray = gTrue;
+ streams->add(obj->copy(&obj2));
+ } else {
+ streams = obj->getArray();
+ freeArray = gFalse;
+ }
+ strPtr = 0;
+ if (streams->getLength() > 0) {
+ streams->get(strPtr, &curStr);
+ curStr.streamReset();
+ }
+}
+
+Lexer::~Lexer() {
+ if (!curStr.isNone()) {
+ curStr.streamClose();
+ curStr.free();
+ }
+ if (freeArray) {
+ delete streams;
+ }
+}
+
+int Lexer::getChar() {
+ int c;
+
+ c = EOF;
+ while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
+ curStr.streamClose();
+ curStr.free();
+ ++strPtr;
+ if (strPtr < streams->getLength()) {
+ streams->get(strPtr, &curStr);
+ curStr.streamReset();
+ }
+ }
+ return c;
+}
+
+int Lexer::lookChar() {
+ if (curStr.isNone()) {
+ return EOF;
+ }
+ return curStr.streamLookChar();
+}
+
+Object *Lexer::getObj(Object *obj, int objNum) {
+ char *p;
+ int c, c2;
+ GBool comment, neg, done;
+ int numParen;
+ int xi;
+ double xf, scale;
+ GString *s;
+ int n, m;
+
+ // skip whitespace and comments
+ comment = gFalse;
+ while (1) {
+ if ((c = getChar()) == EOF) {
+ return obj->initEOF();
+ }
+ if (comment) {
+ if (c == '\r' || c == '\n')
+ comment = gFalse;
+ } else if (c == '%') {
+ comment = gTrue;
+ } else if (specialChars[c] != 1) {
+ break;
+ }
+ }
+
+ // start reading token
+ switch (c) {
+
+ // number
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case '-': case '.':
+ neg = gFalse;
+ xi = 0;
+ if (c == '-') {
+ neg = gTrue;
+ } else if (c == '.') {
+ goto doReal;
+ } else {
+ xi = c - '0';
+ }
+ while (1) {
+ c = lookChar();
+ if (isdigit(c)) {
+ getChar();
+ xi = xi * 10 + (c - '0');
+ } else if (c == '.') {
+ getChar();
+ goto doReal;
+ } else {
+ break;
+ }
+ }
+ if (neg)
+ xi = -xi;
+ obj->initInt(xi);
+ break;
+ doReal:
+ xf = xi;
+ scale = 0.1;
+ while (1) {
+ c = lookChar();
+ if (c == '-') {
+ // ignore minus signs in the middle of numbers to match
+ // Adobe's behavior
+ error(getPos(), "Badly formatted number");
+ getChar();
+ continue;
+ }
+ if (!isdigit(c)) {
+ break;
+ }
+ getChar();
+ xf = xf + scale * (c - '0');
+ scale *= 0.1;
+ }
+ if (neg)
+ xf = -xf;
+ obj->initReal(xf);
+ break;
+
+ // string
+ case '(':
+ p = tokBuf;
+ n = 0;
+ numParen = 1;
+ done = gFalse;
+ s = NULL;
+ do {
+ c2 = EOF;
+ switch (c = getChar()) {
+
+ case EOF:
+#if 0
+ // This breaks some PDF files, e.g., ones from Photoshop.
+ case '\r':
+ case '\n':
+#endif
+ error(getPos(), "Unterminated string");
+ done = gTrue;
+ break;
+
+ case '(':
+ ++numParen;
+ c2 = c;
+ break;
+
+ case ')':
+ if (--numParen == 0) {
+ done = gTrue;
+ } else {
+ c2 = c;
+ }
+ break;
+
+ case '\\':
+ switch (c = getChar()) {
+ case 'n':
+ c2 = '\n';
+ break;
+ case 'r':
+ c2 = '\r';
+ break;
+ case 't':
+ c2 = '\t';
+ break;
+ case 'b':
+ c2 = '\b';
+ break;
+ case 'f':
+ c2 = '\f';
+ break;
+ case '\\':
+ case '(':
+ case ')':
+ c2 = c;
+ break;
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ c2 = c - '0';
+ c = lookChar();
+ if (c >= '0' && c <= '7') {
+ getChar();
+ c2 = (c2 << 3) + (c - '0');
+ c = lookChar();
+ if (c >= '0' && c <= '7') {
+ getChar();
+ c2 = (c2 << 3) + (c - '0');
+ }
+ }
+ break;
+ case '\r':
+ c = lookChar();
+ if (c == '\n') {
+ getChar();
+ }
+ break;
+ case '\n':
+ break;
+ case EOF:
+ error(getPos(), "Unterminated string");
+ done = gTrue;
+ break;
+ default:
+ c2 = c;
+ break;
+ }
+ break;
+
+ default:
+ c2 = c;
+ break;
+ }
+
+ if (c2 != EOF) {
+ if (n == tokBufSize) {
+ if (!s)
+ s = new GString(tokBuf, tokBufSize);
+ else
+ s->append(tokBuf, tokBufSize);
+ p = tokBuf;
+ n = 0;
+
+ // we are growing see if the document is not malformed and we are growing too much
+ if (objNum > 0 && xref != NULL)
+ {
+ int newObjNum = xref->getNumEntry(curStr.streamGetPos());
+ if (newObjNum != objNum)
+ {
+ error(getPos(), "Unterminated string");
+ done = gTrue;
+ delete s;
+ n = -2;
+ }
+ }
+ }
+ *p++ = (char)c2;
+ ++n;
+ }
+ } while (!done);
+ if (n >= 0) {
+ if (!s)
+ s = new GString(tokBuf, n);
+ else
+ s->append(tokBuf, n);
+ obj->initString(s);
+ } else {
+ obj->initEOF();
+ }
+ break;
+
+ // name
+ case '/':
+ p = tokBuf;
+ n = 0;
+ s = NULL;
+ while ((c = lookChar()) != EOF && !specialChars[c]) {
+ getChar();
+ if (c == '#') {
+ c2 = lookChar();
+ if (c2 >= '0' && c2 <= '9') {
+ c = c2 - '0';
+ } else if (c2 >= 'A' && c2 <= 'F') {
+ c = c2 - 'A' + 10;
+ } else if (c2 >= 'a' && c2 <= 'f') {
+ c = c2 - 'a' + 10;
+ } else {
+ goto notEscChar;
+ }
+ getChar();
+ c <<= 4;
+ c2 = getChar();
+ if (c2 >= '0' && c2 <= '9') {
+ c += c2 - '0';
+ } else if (c2 >= 'A' && c2 <= 'F') {
+ c += c2 - 'A' + 10;
+ } else if (c2 >= 'a' && c2 <= 'f') {
+ c += c2 - 'a' + 10;
+ } else {
+ error(getPos(), "Illegal digit in hex char in name");
+ }
+ }
+ notEscChar:
+ if (n == tokBufSize) {
+ if (!s)
+ s = new GString(tokBuf, tokBufSize);
+ else
+ {
+ // the spec says 127 is the maximum, we are already at 256 so bail out
+ error(getPos(), "Name token too long");
+ break;
+ }
+ p = tokBuf;
+ n = 0;
+ }
+ *p++ = c;
+ ++n;
+ }
+ *p = '\0';
+ if (s) {
+ s->append(tokBuf, n);
+ obj->initName(s->getCString());
+ delete s;
+ } else obj->initName(tokBuf);
+ break;
+
+ // array punctuation
+ case '[':
+ case ']':
+ tokBuf[0] = c;
+ tokBuf[1] = '\0';
+ obj->initCmd(tokBuf);
+ break;
+
+ // hex string or dict punctuation
+ case '<':
+ c = lookChar();
+
+ // dict punctuation
+ if (c == '<') {
+ getChar();
+ tokBuf[0] = tokBuf[1] = '<';
+ tokBuf[2] = '\0';
+ obj->initCmd(tokBuf);
+
+ // hex string
+ } else {
+ p = tokBuf;
+ m = n = 0;
+ c2 = 0;
+ s = NULL;
+ while (1) {
+ c = getChar();
+ if (c == '>') {
+ break;
+ } else if (c == EOF) {
+ error(getPos(), "Unterminated hex string");
+ break;
+ } else if (specialChars[c] != 1) {
+ c2 = c2 << 4;
+ if (c >= '0' && c <= '9')
+ c2 += c - '0';
+ else if (c >= 'A' && c <= 'F')
+ c2 += c - 'A' + 10;
+ else if (c >= 'a' && c <= 'f')
+ c2 += c - 'a' + 10;
+ else
+ error(getPos(), "Illegal character <%02x> in hex string", c);
+ if (++m == 2) {
+ if (n == tokBufSize) {
+ if (!s)
+ s = new GString(tokBuf, tokBufSize);
+ else
+ s->append(tokBuf, tokBufSize);
+ p = tokBuf;
+ n = 0;
+ }
+ *p++ = (char)c2;
+ ++n;
+ c2 = 0;
+ m = 0;
+ }
+ }
+ }
+ if (!s)
+ s = new GString(tokBuf, n);
+ else
+ s->append(tokBuf, n);
+ if (m == 1)
+ s->append((char)(c2 << 4));
+ obj->initString(s);
+ }
+ break;
+
+ // dict punctuation
+ case '>':
+ c = lookChar();
+ if (c == '>') {
+ getChar();
+ tokBuf[0] = tokBuf[1] = '>';
+ tokBuf[2] = '\0';
+ obj->initCmd(tokBuf);
+ } else {
+ error(getPos(), "Illegal character '>'");
+ obj->initError();
+ }
+ break;
+
+ // error
+ case ')':
+ case '{':
+ case '}':
+ error(getPos(), "Illegal character '%c'", c);
+ obj->initError();
+ break;
+
+ // command
+ default:
+ p = tokBuf;
+ *p++ = c;
+ n = 1;
+ while ((c = lookChar()) != EOF && !specialChars[c]) {
+ getChar();
+ if (++n == tokBufSize) {
+ error(getPos(), "Command token too long");
+ break;
+ }
+ *p++ = c;
+ }
+ *p = '\0';
+ if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
+ obj->initBool(gTrue);
+ } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
+ obj->initBool(gFalse);
+ } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
+ obj->initNull();
+ } else {
+ obj->initCmd(tokBuf);
+ }
+ break;
+ }
+
+ return obj;
+}
+
+void Lexer::skipToNextLine() {
+ int c;
+
+ while (1) {
+ c = getChar();
+ if (c == EOF || c == '\n') {
+ return;
+ }
+ if (c == '\r') {
+ if ((c = lookChar()) == '\n') {
+ getChar();
+ }
+ return;
+ }
+ }
+}
+
+GBool Lexer::isSpace(int c) {
+ return c >= 0 && c <= 0xff && specialChars[c] == 1;
+}
diff --git a/kpdf/xpdf/xpdf/Link.cc b/kpdf/xpdf/xpdf/Link.cc
deleted file mode 100644
index ae2de537..00000000
--- a/kpdf/xpdf/xpdf/Link.cc
+++ /dev/null
@@ -1,784 +0,0 @@
-//========================================================================
-//
-// Link.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include <string.h>
-#include "gmem.h"
-#include "GString.h"
-#include "Error.h"
-#include "Object.h"
-#include "Array.h"
-#include "Dict.h"
-#include "Link.h"
-
-//------------------------------------------------------------------------
-// LinkAction
-//------------------------------------------------------------------------
-
-LinkAction *LinkAction::parseDest(Object *obj) {
- LinkAction *action;
-
- action = new LinkGoTo(obj);
- if (!action->isOk()) {
- delete action;
- return NULL;
- }
- return action;
-}
-
-LinkAction *LinkAction::parseAction(Object *obj, GString *baseURI) {
- LinkAction *action;
- Object obj2, obj3, obj4;
-
- if (!obj->isDict()) {
- error(-1, "Bad annotation action");
- return NULL;
- }
-
- obj->dictLookup("S", &obj2);
-
- // GoTo action
- if (obj2.isName("GoTo")) {
- obj->dictLookup("D", &obj3);
- action = new LinkGoTo(&obj3);
- obj3.free();
-
- // GoToR action
- } else if (obj2.isName("GoToR")) {
- obj->dictLookup("F", &obj3);
- obj->dictLookup("D", &obj4);
- action = new LinkGoToR(&obj3, &obj4);
- obj3.free();
- obj4.free();
-
- // Launch action
- } else if (obj2.isName("Launch")) {
- action = new LinkLaunch(obj);
-
- // URI action
- } else if (obj2.isName("URI")) {
- obj->dictLookup("URI", &obj3);
- action = new LinkURI(&obj3, baseURI);
- obj3.free();
-
- // Named action
- } else if (obj2.isName("Named")) {
- obj->dictLookup("N", &obj3);
- action = new LinkNamed(&obj3);
- obj3.free();
-
- // Movie action
- } else if (obj2.isName("Movie")) {
- obj->dictLookupNF("Annot", &obj3);
- obj->dictLookup("T", &obj4);
- action = new LinkMovie(&obj3, &obj4);
- obj3.free();
- obj4.free();
-
- // unknown action
- } else if (obj2.isName()) {
- action = new LinkUnknown(obj2.getName());
-
- // action is missing or wrong type
- } else {
- error(-1, "Bad annotation action");
- action = NULL;
- }
-
- obj2.free();
-
- if (action && !action->isOk()) {
- delete action;
- return NULL;
- }
- return action;
-}
-
-GString *LinkAction::getFileSpecName(Object *fileSpecObj) {
- GString *name;
- Object obj1;
-
- name = NULL;
-
- // string
- if (fileSpecObj->isString()) {
- name = fileSpecObj->getString()->copy();
-
- // dictionary
- } else if (fileSpecObj->isDict()) {
-#ifdef WIN32
- if (!fileSpecObj->dictLookup("DOS", &obj1)->isString()) {
-#else
- if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
-#endif
- obj1.free();
- fileSpecObj->dictLookup("F", &obj1);
- }
- if (obj1.isString()) {
- name = obj1.getString()->copy();
- } else {
- error(-1, "Illegal file spec in link");
- }
- obj1.free();
-
- // error
- } else {
- error(-1, "Illegal file spec in link");
- }
-
- // system-dependent path manipulation
- if (name) {
-#ifdef WIN32
- int i, j;
-
- // "//...." --> "\...."
- // "/x/...." --> "x:\...."
- // "/server/share/...." --> "\\server\share\...."
- // convert escaped slashes to slashes and unescaped slashes to backslashes
- i = 0;
- if (name->getChar(0) == '/') {
- if (name->getLength() >= 2 && name->getChar(1) == '/') {
- name->del(0);
- i = 0;
- } else if (name->getLength() >= 2 &&
- ((name->getChar(1) >= 'a' && name->getChar(1) <= 'z') ||
- (name->getChar(1) >= 'A' && name->getChar(1) <= 'Z')) &&
- (name->getLength() == 2 || name->getChar(2) == '/')) {
- name->setChar(0, name->getChar(1));
- name->setChar(1, ':');
- i = 2;
- } else {
- for (j = 2; j < name->getLength(); ++j) {
- if (name->getChar(j-1) != '\\' &&
- name->getChar(j) == '/') {
- break;
- }
- }
- if (j < name->getLength()) {
- name->setChar(0, '\\');
- name->insert(0, '\\');
- i = 2;
- }
- }
- }
- for (; i < name->getLength(); ++i) {
- if (name->getChar(i) == '/') {
- name->setChar(i, '\\');
- } else if (name->getChar(i) == '\\' &&
- i+1 < name->getLength() &&
- name->getChar(i+1) == '/') {
- name->del(i);
- }
- }
-#else
- // no manipulation needed for Unix
-#endif
- }
-
- return name;
-}
-
-//------------------------------------------------------------------------
-// LinkDest
-//------------------------------------------------------------------------
-
-LinkDest::LinkDest(Array *a) {
- Object obj1, obj2;
-
- // initialize fields
- left = bottom = right = top = zoom = 0;
- ok = gFalse;
-
- // get page
- if (a->getLength() < 2) {
- error(-1, "Annotation destination array is too short");
- return;
- }
- a->getNF(0, &obj1);
- if (obj1.isInt()) {
- pageNum = obj1.getInt() + 1;
- pageIsRef = gFalse;
- } else if (obj1.isRef()) {
- pageRef.num = obj1.getRefNum();
- pageRef.gen = obj1.getRefGen();
- pageIsRef = gTrue;
- } else {
- error(-1, "Bad annotation destination");
- goto err2;
- }
- obj1.free();
-
- // get destination type
- a->get(1, &obj1);
-
- // XYZ link
- if (obj1.isName("XYZ")) {
- kind = destXYZ;
- if (a->getLength() < 3) {
- changeLeft = gFalse;
- } else {
- a->get(2, &obj2);
- if (obj2.isNull()) {
- changeLeft = gFalse;
- } else if (obj2.isNum()) {
- changeLeft = gTrue;
- left = obj2.getNum();
- } else {
- error(-1, "Bad annotation destination position");
- goto err1;
- }
- obj2.free();
- }
- if (a->getLength() < 4) {
- changeTop = gFalse;
- } else {
- a->get(3, &obj2);
- if (obj2.isNull()) {
- changeTop = gFalse;
- } else if (obj2.isNum()) {
- changeTop = gTrue;
- top = obj2.getNum();
- } else {
- error(-1, "Bad annotation destination position");
- goto err1;
- }
- obj2.free();
- }
- if (a->getLength() < 5) {
- changeZoom = gFalse;
- } else {
- a->get(4, &obj2);
- if (obj2.isNull()) {
- changeZoom = gFalse;
- } else if (obj2.isNum()) {
- changeZoom = gTrue;
- zoom = obj2.getNum();
- } else {
- error(-1, "Bad annotation destination position");
- goto err1;
- }
- obj2.free();
- }
-
- // Fit link
- } else if (obj1.isName("Fit")) {
- if (a->getLength() < 2) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFit;
-
- // FitH link
- } else if (obj1.isName("FitH")) {
- if (a->getLength() < 3) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFitH;
- if (!a->get(2, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- top = obj2.getNum();
- obj2.free();
-
- // FitV link
- } else if (obj1.isName("FitV")) {
- if (a->getLength() < 3) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFitV;
- if (!a->get(2, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- left = obj2.getNum();
- obj2.free();
-
- // FitR link
- } else if (obj1.isName("FitR")) {
- if (a->getLength() < 6) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFitR;
- if (!a->get(2, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- left = obj2.getNum();
- obj2.free();
- if (!a->get(3, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- bottom = obj2.getNum();
- obj2.free();
- if (!a->get(4, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- right = obj2.getNum();
- obj2.free();
- if (!a->get(5, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- top = obj2.getNum();
- obj2.free();
-
- // FitB link
- } else if (obj1.isName("FitB")) {
- if (a->getLength() < 2) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFitB;
-
- // FitBH link
- } else if (obj1.isName("FitBH")) {
- if (a->getLength() < 3) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFitBH;
- if (!a->get(2, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- top = obj2.getNum();
- obj2.free();
-
- // FitBV link
- } else if (obj1.isName("FitBV")) {
- if (a->getLength() < 3) {
- error(-1, "Annotation destination array is too short");
- goto err2;
- }
- kind = destFitBV;
- if (!a->get(2, &obj2)->isNum()) {
- error(-1, "Bad annotation destination position");
- kind = destFit;
- }
- left = obj2.getNum();
- obj2.free();
-
- // unknown link kind
- } else {
- error(-1, "Unknown annotation destination type");
- goto err2;
- }
-
- obj1.free();
- ok = gTrue;
- return;
-
- err1:
- obj2.free();
- err2:
- obj1.free();
-}
-
-LinkDest::LinkDest(LinkDest *dest) {
- kind = dest->kind;
- pageIsRef = dest->pageIsRef;
- if (pageIsRef)
- pageRef = dest->pageRef;
- else
- pageNum = dest->pageNum;
- left = dest->left;
- bottom = dest->bottom;
- right = dest->right;
- top = dest->top;
- zoom = dest->zoom;
- changeLeft = dest->changeLeft;
- changeTop = dest->changeTop;
- changeZoom = dest->changeZoom;
- ok = gTrue;
-}
-
-//------------------------------------------------------------------------
-// LinkGoTo
-//------------------------------------------------------------------------
-
-LinkGoTo::LinkGoTo(Object *destObj) {
- dest = NULL;
- namedDest = NULL;
-
- // named destination
- if (destObj->isName()) {
- namedDest = new GString(destObj->getName());
- } else if (destObj->isString()) {
- namedDest = destObj->getString()->copy();
-
- // destination dictionary
- } else if (destObj->isArray()) {
- dest = new LinkDest(destObj->getArray());
- if (!dest->isOk()) {
- delete dest;
- dest = NULL;
- }
-
- // error
- } else {
- error(-1, "Illegal annotation destination");
- }
-}
-
-LinkGoTo::~LinkGoTo() {
- if (dest)
- delete dest;
- if (namedDest)
- delete namedDest;
-}
-
-//------------------------------------------------------------------------
-// LinkGoToR
-//------------------------------------------------------------------------
-
-LinkGoToR::LinkGoToR(Object *fileSpecObj, Object *destObj) {
- dest = NULL;
- namedDest = NULL;
-
- // get file name
- fileName = getFileSpecName(fileSpecObj);
-
- // named destination
- if (destObj->isName()) {
- namedDest = new GString(destObj->getName());
- } else if (destObj->isString()) {
- namedDest = destObj->getString()->copy();
-
- // destination dictionary
- } else if (destObj->isArray()) {
- dest = new LinkDest(destObj->getArray());
- if (!dest->isOk()) {
- delete dest;
- dest = NULL;
- }
-
- // error
- } else {
- error(-1, "Illegal annotation destination");
- }
-}
-
-LinkGoToR::~LinkGoToR() {
- if (fileName)
- delete fileName;
- if (dest)
- delete dest;
- if (namedDest)
- delete namedDest;
-}
-
-
-//------------------------------------------------------------------------
-// LinkLaunch
-//------------------------------------------------------------------------
-
-LinkLaunch::LinkLaunch(Object *actionObj) {
- Object obj1, obj2;
-
- fileName = NULL;
- params = NULL;
-
- if (actionObj->isDict()) {
- if (!actionObj->dictLookup("F", &obj1)->isNull()) {
- fileName = getFileSpecName(&obj1);
- } else {
- obj1.free();
-#ifdef WIN32
- if (actionObj->dictLookup("Win", &obj1)->isDict()) {
- obj1.dictLookup("F", &obj2);
- fileName = getFileSpecName(&obj2);
- obj2.free();
- if (obj1.dictLookup("P", &obj2)->isString()) {
- params = obj2.getString()->copy();
- }
- obj2.free();
- } else {
- error(-1, "Bad launch-type link action");
- }
-#else
- //~ This hasn't been defined by Adobe yet, so assume it looks
- //~ just like the Win dictionary until they say otherwise.
- if (actionObj->dictLookup("Unix", &obj1)->isDict()) {
- obj1.dictLookup("F", &obj2);
- fileName = getFileSpecName(&obj2);
- obj2.free();
- if (obj1.dictLookup("P", &obj2)->isString()) {
- params = obj2.getString()->copy();
- }
- obj2.free();
- } else {
- error(-1, "Bad launch-type link action");
- }
-#endif
- }
- obj1.free();
- }
-}
-
-LinkLaunch::~LinkLaunch() {
- if (fileName)
- delete fileName;
- if (params)
- delete params;
-}
-
-//------------------------------------------------------------------------
-// LinkURI
-//------------------------------------------------------------------------
-
-LinkURI::LinkURI(Object *uriObj, GString *baseURI) {
- GString *uri2;
- int n;
- char c;
-
- uri = NULL;
- if (uriObj->isString()) {
- uri2 = uriObj->getString()->copy();
- if (baseURI && baseURI->getLength() > 0) {
- n = strcspn(uri2->getCString(), "/:");
- if (n == uri2->getLength() || uri2->getChar(n) == '/') {
- uri = baseURI->copy();
- c = uri->getChar(uri->getLength() - 1);
- if (c == '/' || c == '?') {
- if (uri2->getChar(0) == '/') {
- uri2->del(0);
- }
- } else {
- if (uri2->getChar(0) != '/') {
- uri->append('/');
- }
- }
- uri->append(uri2);
- delete uri2;
- } else {
- uri = uri2;
- }
- } else {
- uri = uri2;
- }
- } else {
- error(-1, "Illegal URI-type link");
- }
-}
-
-LinkURI::~LinkURI() {
- if (uri)
- delete uri;
-}
-
-//------------------------------------------------------------------------
-// LinkNamed
-//------------------------------------------------------------------------
-
-LinkNamed::LinkNamed(Object *nameObj) {
- name = NULL;
- if (nameObj->isName()) {
- name = new GString(nameObj->getName());
- }
-}
-
-LinkNamed::~LinkNamed() {
- if (name) {
- delete name;
- }
-}
-
-//------------------------------------------------------------------------
-// LinkMovie
-//------------------------------------------------------------------------
-
-LinkMovie::LinkMovie(Object *annotObj, Object *titleObj) {
- annotRef.num = -1;
- title = NULL;
- if (annotObj->isRef()) {
- annotRef = annotObj->getRef();
- } else if (titleObj->isString()) {
- title = titleObj->getString()->copy();
- } else {
- error(-1, "Movie action is missing both the Annot and T keys");
- }
-}
-
-LinkMovie::~LinkMovie() {
- if (title) {
- delete title;
- }
-}
-
-//------------------------------------------------------------------------
-// LinkUnknown
-//------------------------------------------------------------------------
-
-LinkUnknown::LinkUnknown(char *actionA) {
- action = new GString(actionA);
-}
-
-LinkUnknown::~LinkUnknown() {
- delete action;
-}
-
-//------------------------------------------------------------------------
-// Link
-//------------------------------------------------------------------------
-
-Link::Link(Dict *dict, GString *baseURI) {
- Object obj1, obj2;
- double t;
-
- action = NULL;
- ok = gFalse;
-
- // get rectangle
- if (!dict->lookup("Rect", &obj1)->isArray()) {
- error(-1, "Annotation rectangle is wrong type");
- goto err2;
- }
- if (!obj1.arrayGet(0, &obj2)->isNum()) {
- error(-1, "Bad annotation rectangle");
- goto err1;
- }
- x1 = obj2.getNum();
- obj2.free();
- if (!obj1.arrayGet(1, &obj2)->isNum()) {
- error(-1, "Bad annotation rectangle");
- goto err1;
- }
- y1 = obj2.getNum();
- obj2.free();
- if (!obj1.arrayGet(2, &obj2)->isNum()) {
- error(-1, "Bad annotation rectangle");
- goto err1;
- }
- x2 = obj2.getNum();
- obj2.free();
- if (!obj1.arrayGet(3, &obj2)->isNum()) {
- error(-1, "Bad annotation rectangle");
- goto err1;
- }
- y2 = obj2.getNum();
- obj2.free();
- obj1.free();
- if (x1 > x2) {
- t = x1;
- x1 = x2;
- x2 = t;
- }
- if (y1 > y2) {
- t = y1;
- y1 = y2;
- y2 = t;
- }
-
- // look for destination
- if (!dict->lookup("Dest", &obj1)->isNull()) {
- action = LinkAction::parseDest(&obj1);
-
- // look for action
- } else {
- obj1.free();
- if (dict->lookup("A", &obj1)->isDict()) {
- action = LinkAction::parseAction(&obj1, baseURI);
- }
- }
- obj1.free();
-
- // check for bad action
- if (action) {
- ok = gTrue;
- }
-
- return;
-
- err1:
- obj2.free();
- err2:
- obj1.free();
-}
-
-Link::~Link() {
- if (action) {
- delete action;
- }
-}
-
-//------------------------------------------------------------------------
-// Links
-//------------------------------------------------------------------------
-
-Links::Links(Object *annots, GString *baseURI) {
- Link *link;
- Object obj1, obj2;
- int size;
- int i;
-
- links = NULL;
- size = 0;
- numLinks = 0;
-
- if (annots->isArray()) {
- for (i = 0; i < annots->arrayGetLength(); ++i) {
- if (annots->arrayGet(i, &obj1)->isDict()) {
- if (obj1.dictLookup("Subtype", &obj2)->isName("Link")) {
- link = new Link(obj1.getDict(), baseURI);
- if (link->isOk()) {
- if (numLinks >= size) {
- size += 16;
- links = (Link **)greallocn(links, size, sizeof(Link *));
- }
- links[numLinks++] = link;
- } else {
- delete link;
- }
- }
- obj2.free();
- }
- obj1.free();
- }
- }
-}
-
-Links::~Links() {
- int i;
-
- for (i = 0; i < numLinks; ++i)
- delete links[i];
- gfree(links);
-}
-
-LinkAction *Links::find(double x, double y) {
- int i;
-
- for (i = numLinks - 1; i >= 0; --i) {
- if (links[i]->inRect(x, y)) {
- return links[i]->getAction();
- }
- }
- return NULL;
-}
-
-GBool Links::onLink(double x, double y) {
- int i;
-
- for (i = 0; i < numLinks; ++i) {
- if (links[i]->inRect(x, y))
- return gTrue;
- }
- return gFalse;
-}
diff --git a/kpdf/xpdf/xpdf/Link.cpp b/kpdf/xpdf/xpdf/Link.cpp
new file mode 100644
index 00000000..69106e13
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Link.cpp
@@ -0,0 +1,784 @@
+//========================================================================
+//
+// Link.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include "gmem.h"
+#include "GString.h"
+#include "Error.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Link.h"
+
+//------------------------------------------------------------------------
+// LinkAction
+//------------------------------------------------------------------------
+
+LinkAction *LinkAction::parseDest(Object *obj) {
+ LinkAction *action;
+
+ action = new LinkGoTo(obj);
+ if (!action->isOk()) {
+ delete action;
+ return NULL;
+ }
+ return action;
+}
+
+LinkAction *LinkAction::parseAction(Object *obj, GString *baseURI) {
+ LinkAction *action;
+ Object obj2, obj3, obj4;
+
+ if (!obj->isDict()) {
+ error(-1, "Bad annotation action");
+ return NULL;
+ }
+
+ obj->dictLookup("S", &obj2);
+
+ // GoTo action
+ if (obj2.isName("GoTo")) {
+ obj->dictLookup("D", &obj3);
+ action = new LinkGoTo(&obj3);
+ obj3.free();
+
+ // GoToR action
+ } else if (obj2.isName("GoToR")) {
+ obj->dictLookup("F", &obj3);
+ obj->dictLookup("D", &obj4);
+ action = new LinkGoToR(&obj3, &obj4);
+ obj3.free();
+ obj4.free();
+
+ // Launch action
+ } else if (obj2.isName("Launch")) {
+ action = new LinkLaunch(obj);
+
+ // URI action
+ } else if (obj2.isName("URI")) {
+ obj->dictLookup("URI", &obj3);
+ action = new LinkURI(&obj3, baseURI);
+ obj3.free();
+
+ // Named action
+ } else if (obj2.isName("Named")) {
+ obj->dictLookup("N", &obj3);
+ action = new LinkNamed(&obj3);
+ obj3.free();
+
+ // Movie action
+ } else if (obj2.isName("Movie")) {
+ obj->dictLookupNF("Annot", &obj3);
+ obj->dictLookup("T", &obj4);
+ action = new LinkMovie(&obj3, &obj4);
+ obj3.free();
+ obj4.free();
+
+ // unknown action
+ } else if (obj2.isName()) {
+ action = new LinkUnknown(obj2.getName());
+
+ // action is missing or wrong type
+ } else {
+ error(-1, "Bad annotation action");
+ action = NULL;
+ }
+
+ obj2.free();
+
+ if (action && !action->isOk()) {
+ delete action;
+ return NULL;
+ }
+ return action;
+}
+
+GString *LinkAction::getFileSpecName(Object *fileSpecObj) {
+ GString *name;
+ Object obj1;
+
+ name = NULL;
+
+ // string
+ if (fileSpecObj->isString()) {
+ name = fileSpecObj->getString()->copy();
+
+ // dictionary
+ } else if (fileSpecObj->isDict()) {
+#ifdef WIN32
+ if (!fileSpecObj->dictLookup("DOS", &obj1)->isString()) {
+#else
+ if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
+#endif
+ obj1.free();
+ fileSpecObj->dictLookup("F", &obj1);
+ }
+ if (obj1.isString()) {
+ name = obj1.getString()->copy();
+ } else {
+ error(-1, "Illegal file spec in link");
+ }
+ obj1.free();
+
+ // error
+ } else {
+ error(-1, "Illegal file spec in link");
+ }
+
+ // system-dependent path manipulation
+ if (name) {
+#ifdef WIN32
+ int i, j;
+
+ // "//...." --> "\...."
+ // "/x/...." --> "x:\...."
+ // "/server/share/...." --> "\\server\share\...."
+ // convert escaped slashes to slashes and unescaped slashes to backslashes
+ i = 0;
+ if (name->getChar(0) == '/') {
+ if (name->getLength() >= 2 && name->getChar(1) == '/') {
+ name->del(0);
+ i = 0;
+ } else if (name->getLength() >= 2 &&
+ ((name->getChar(1) >= 'a' && name->getChar(1) <= 'z') ||
+ (name->getChar(1) >= 'A' && name->getChar(1) <= 'Z')) &&
+ (name->getLength() == 2 || name->getChar(2) == '/')) {
+ name->setChar(0, name->getChar(1));
+ name->setChar(1, ':');
+ i = 2;
+ } else {
+ for (j = 2; j < name->getLength(); ++j) {
+ if (name->getChar(j-1) != '\\' &&
+ name->getChar(j) == '/') {
+ break;
+ }
+ }
+ if (j < name->getLength()) {
+ name->setChar(0, '\\');
+ name->insert(0, '\\');
+ i = 2;
+ }
+ }
+ }
+ for (; i < name->getLength(); ++i) {
+ if (name->getChar(i) == '/') {
+ name->setChar(i, '\\');
+ } else if (name->getChar(i) == '\\' &&
+ i+1 < name->getLength() &&
+ name->getChar(i+1) == '/') {
+ name->del(i);
+ }
+ }
+#else
+ // no manipulation needed for Unix
+#endif
+ }
+
+ return name;
+}
+
+//------------------------------------------------------------------------
+// LinkDest
+//------------------------------------------------------------------------
+
+LinkDest::LinkDest(Array *a) {
+ Object obj1, obj2;
+
+ // initialize fields
+ left = bottom = right = top = zoom = 0;
+ ok = gFalse;
+
+ // get page
+ if (a->getLength() < 2) {
+ error(-1, "Annotation destination array is too short");
+ return;
+ }
+ a->getNF(0, &obj1);
+ if (obj1.isInt()) {
+ pageNum = obj1.getInt() + 1;
+ pageIsRef = gFalse;
+ } else if (obj1.isRef()) {
+ pageRef.num = obj1.getRefNum();
+ pageRef.gen = obj1.getRefGen();
+ pageIsRef = gTrue;
+ } else {
+ error(-1, "Bad annotation destination");
+ goto err2;
+ }
+ obj1.free();
+
+ // get destination type
+ a->get(1, &obj1);
+
+ // XYZ link
+ if (obj1.isName("XYZ")) {
+ kind = destXYZ;
+ if (a->getLength() < 3) {
+ changeLeft = gFalse;
+ } else {
+ a->get(2, &obj2);
+ if (obj2.isNull()) {
+ changeLeft = gFalse;
+ } else if (obj2.isNum()) {
+ changeLeft = gTrue;
+ left = obj2.getNum();
+ } else {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ obj2.free();
+ }
+ if (a->getLength() < 4) {
+ changeTop = gFalse;
+ } else {
+ a->get(3, &obj2);
+ if (obj2.isNull()) {
+ changeTop = gFalse;
+ } else if (obj2.isNum()) {
+ changeTop = gTrue;
+ top = obj2.getNum();
+ } else {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ obj2.free();
+ }
+ if (a->getLength() < 5) {
+ changeZoom = gFalse;
+ } else {
+ a->get(4, &obj2);
+ if (obj2.isNull()) {
+ changeZoom = gFalse;
+ } else if (obj2.isNum()) {
+ changeZoom = gTrue;
+ zoom = obj2.getNum();
+ } else {
+ error(-1, "Bad annotation destination position");
+ goto err1;
+ }
+ obj2.free();
+ }
+
+ // Fit link
+ } else if (obj1.isName("Fit")) {
+ if (a->getLength() < 2) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFit;
+
+ // FitH link
+ } else if (obj1.isName("FitH")) {
+ if (a->getLength() < 3) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFitH;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ top = obj2.getNum();
+ obj2.free();
+
+ // FitV link
+ } else if (obj1.isName("FitV")) {
+ if (a->getLength() < 3) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFitV;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ left = obj2.getNum();
+ obj2.free();
+
+ // FitR link
+ } else if (obj1.isName("FitR")) {
+ if (a->getLength() < 6) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFitR;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ left = obj2.getNum();
+ obj2.free();
+ if (!a->get(3, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ bottom = obj2.getNum();
+ obj2.free();
+ if (!a->get(4, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ right = obj2.getNum();
+ obj2.free();
+ if (!a->get(5, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ top = obj2.getNum();
+ obj2.free();
+
+ // FitB link
+ } else if (obj1.isName("FitB")) {
+ if (a->getLength() < 2) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFitB;
+
+ // FitBH link
+ } else if (obj1.isName("FitBH")) {
+ if (a->getLength() < 3) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFitBH;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ top = obj2.getNum();
+ obj2.free();
+
+ // FitBV link
+ } else if (obj1.isName("FitBV")) {
+ if (a->getLength() < 3) {
+ error(-1, "Annotation destination array is too short");
+ goto err2;
+ }
+ kind = destFitBV;
+ if (!a->get(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation destination position");
+ kind = destFit;
+ }
+ left = obj2.getNum();
+ obj2.free();
+
+ // unknown link kind
+ } else {
+ error(-1, "Unknown annotation destination type");
+ goto err2;
+ }
+
+ obj1.free();
+ ok = gTrue;
+ return;
+
+ err1:
+ obj2.free();
+ err2:
+ obj1.free();
+}
+
+LinkDest::LinkDest(LinkDest *dest) {
+ kind = dest->kind;
+ pageIsRef = dest->pageIsRef;
+ if (pageIsRef)
+ pageRef = dest->pageRef;
+ else
+ pageNum = dest->pageNum;
+ left = dest->left;
+ bottom = dest->bottom;
+ right = dest->right;
+ top = dest->top;
+ zoom = dest->zoom;
+ changeLeft = dest->changeLeft;
+ changeTop = dest->changeTop;
+ changeZoom = dest->changeZoom;
+ ok = gTrue;
+}
+
+//------------------------------------------------------------------------
+// LinkGoTo
+//------------------------------------------------------------------------
+
+LinkGoTo::LinkGoTo(Object *destObj) {
+ dest = NULL;
+ namedDest = NULL;
+
+ // named destination
+ if (destObj->isName()) {
+ namedDest = new GString(destObj->getName());
+ } else if (destObj->isString()) {
+ namedDest = destObj->getString()->copy();
+
+ // destination dictionary
+ } else if (destObj->isArray()) {
+ dest = new LinkDest(destObj->getArray());
+ if (!dest->isOk()) {
+ delete dest;
+ dest = NULL;
+ }
+
+ // error
+ } else {
+ error(-1, "Illegal annotation destination");
+ }
+}
+
+LinkGoTo::~LinkGoTo() {
+ if (dest)
+ delete dest;
+ if (namedDest)
+ delete namedDest;
+}
+
+//------------------------------------------------------------------------
+// LinkGoToR
+//------------------------------------------------------------------------
+
+LinkGoToR::LinkGoToR(Object *fileSpecObj, Object *destObj) {
+ dest = NULL;
+ namedDest = NULL;
+
+ // get file name
+ fileName = getFileSpecName(fileSpecObj);
+
+ // named destination
+ if (destObj->isName()) {
+ namedDest = new GString(destObj->getName());
+ } else if (destObj->isString()) {
+ namedDest = destObj->getString()->copy();
+
+ // destination dictionary
+ } else if (destObj->isArray()) {
+ dest = new LinkDest(destObj->getArray());
+ if (!dest->isOk()) {
+ delete dest;
+ dest = NULL;
+ }
+
+ // error
+ } else {
+ error(-1, "Illegal annotation destination");
+ }
+}
+
+LinkGoToR::~LinkGoToR() {
+ if (fileName)
+ delete fileName;
+ if (dest)
+ delete dest;
+ if (namedDest)
+ delete namedDest;
+}
+
+
+//------------------------------------------------------------------------
+// LinkLaunch
+//------------------------------------------------------------------------
+
+LinkLaunch::LinkLaunch(Object *actionObj) {
+ Object obj1, obj2;
+
+ fileName = NULL;
+ params = NULL;
+
+ if (actionObj->isDict()) {
+ if (!actionObj->dictLookup("F", &obj1)->isNull()) {
+ fileName = getFileSpecName(&obj1);
+ } else {
+ obj1.free();
+#ifdef WIN32
+ if (actionObj->dictLookup("Win", &obj1)->isDict()) {
+ obj1.dictLookup("F", &obj2);
+ fileName = getFileSpecName(&obj2);
+ obj2.free();
+ if (obj1.dictLookup("P", &obj2)->isString()) {
+ params = obj2.getString()->copy();
+ }
+ obj2.free();
+ } else {
+ error(-1, "Bad launch-type link action");
+ }
+#else
+ //~ This hasn't been defined by Adobe yet, so assume it looks
+ //~ just like the Win dictionary until they say otherwise.
+ if (actionObj->dictLookup("Unix", &obj1)->isDict()) {
+ obj1.dictLookup("F", &obj2);
+ fileName = getFileSpecName(&obj2);
+ obj2.free();
+ if (obj1.dictLookup("P", &obj2)->isString()) {
+ params = obj2.getString()->copy();
+ }
+ obj2.free();
+ } else {
+ error(-1, "Bad launch-type link action");
+ }
+#endif
+ }
+ obj1.free();
+ }
+}
+
+LinkLaunch::~LinkLaunch() {
+ if (fileName)
+ delete fileName;
+ if (params)
+ delete params;
+}
+
+//------------------------------------------------------------------------
+// LinkURI
+//------------------------------------------------------------------------
+
+LinkURI::LinkURI(Object *uriObj, GString *baseURI) {
+ GString *uri2;
+ int n;
+ char c;
+
+ uri = NULL;
+ if (uriObj->isString()) {
+ uri2 = uriObj->getString()->copy();
+ if (baseURI && baseURI->getLength() > 0) {
+ n = strcspn(uri2->getCString(), "/:");
+ if (n == uri2->getLength() || uri2->getChar(n) == '/') {
+ uri = baseURI->copy();
+ c = uri->getChar(uri->getLength() - 1);
+ if (c == '/' || c == '?') {
+ if (uri2->getChar(0) == '/') {
+ uri2->del(0);
+ }
+ } else {
+ if (uri2->getChar(0) != '/') {
+ uri->append('/');
+ }
+ }
+ uri->append(uri2);
+ delete uri2;
+ } else {
+ uri = uri2;
+ }
+ } else {
+ uri = uri2;
+ }
+ } else {
+ error(-1, "Illegal URI-type link");
+ }
+}
+
+LinkURI::~LinkURI() {
+ if (uri)
+ delete uri;
+}
+
+//------------------------------------------------------------------------
+// LinkNamed
+//------------------------------------------------------------------------
+
+LinkNamed::LinkNamed(Object *nameObj) {
+ name = NULL;
+ if (nameObj->isName()) {
+ name = new GString(nameObj->getName());
+ }
+}
+
+LinkNamed::~LinkNamed() {
+ if (name) {
+ delete name;
+ }
+}
+
+//------------------------------------------------------------------------
+// LinkMovie
+//------------------------------------------------------------------------
+
+LinkMovie::LinkMovie(Object *annotObj, Object *titleObj) {
+ annotRef.num = -1;
+ title = NULL;
+ if (annotObj->isRef()) {
+ annotRef = annotObj->getRef();
+ } else if (titleObj->isString()) {
+ title = titleObj->getString()->copy();
+ } else {
+ error(-1, "Movie action is missing both the Annot and T keys");
+ }
+}
+
+LinkMovie::~LinkMovie() {
+ if (title) {
+ delete title;
+ }
+}
+
+//------------------------------------------------------------------------
+// LinkUnknown
+//------------------------------------------------------------------------
+
+LinkUnknown::LinkUnknown(char *actionA) {
+ action = new GString(actionA);
+}
+
+LinkUnknown::~LinkUnknown() {
+ delete action;
+}
+
+//------------------------------------------------------------------------
+// Link
+//------------------------------------------------------------------------
+
+Link::Link(Dict *dict, GString *baseURI) {
+ Object obj1, obj2;
+ double t;
+
+ action = NULL;
+ ok = gFalse;
+
+ // get rectangle
+ if (!dict->lookup("Rect", &obj1)->isArray()) {
+ error(-1, "Annotation rectangle is wrong type");
+ goto err2;
+ }
+ if (!obj1.arrayGet(0, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ x1 = obj2.getNum();
+ obj2.free();
+ if (!obj1.arrayGet(1, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ y1 = obj2.getNum();
+ obj2.free();
+ if (!obj1.arrayGet(2, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ x2 = obj2.getNum();
+ obj2.free();
+ if (!obj1.arrayGet(3, &obj2)->isNum()) {
+ error(-1, "Bad annotation rectangle");
+ goto err1;
+ }
+ y2 = obj2.getNum();
+ obj2.free();
+ obj1.free();
+ if (x1 > x2) {
+ t = x1;
+ x1 = x2;
+ x2 = t;
+ }
+ if (y1 > y2) {
+ t = y1;
+ y1 = y2;
+ y2 = t;
+ }
+
+ // look for destination
+ if (!dict->lookup("Dest", &obj1)->isNull()) {
+ action = LinkAction::parseDest(&obj1);
+
+ // look for action
+ } else {
+ obj1.free();
+ if (dict->lookup("A", &obj1)->isDict()) {
+ action = LinkAction::parseAction(&obj1, baseURI);
+ }
+ }
+ obj1.free();
+
+ // check for bad action
+ if (action) {
+ ok = gTrue;
+ }
+
+ return;
+
+ err1:
+ obj2.free();
+ err2:
+ obj1.free();
+}
+
+Link::~Link() {
+ if (action) {
+ delete action;
+ }
+}
+
+//------------------------------------------------------------------------
+// Links
+//------------------------------------------------------------------------
+
+Links::Links(Object *annots, GString *baseURI) {
+ Link *link;
+ Object obj1, obj2;
+ int size;
+ int i;
+
+ links = NULL;
+ size = 0;
+ numLinks = 0;
+
+ if (annots->isArray()) {
+ for (i = 0; i < annots->arrayGetLength(); ++i) {
+ if (annots->arrayGet(i, &obj1)->isDict()) {
+ if (obj1.dictLookup("Subtype", &obj2)->isName("Link")) {
+ link = new Link(obj1.getDict(), baseURI);
+ if (link->isOk()) {
+ if (numLinks >= size) {
+ size += 16;
+ links = (Link **)greallocn(links, size, sizeof(Link *));
+ }
+ links[numLinks++] = link;
+ } else {
+ delete link;
+ }
+ }
+ obj2.free();
+ }
+ obj1.free();
+ }
+ }
+}
+
+Links::~Links() {
+ int i;
+
+ for (i = 0; i < numLinks; ++i)
+ delete links[i];
+ gfree(links);
+}
+
+LinkAction *Links::find(double x, double y) {
+ int i;
+
+ for (i = numLinks - 1; i >= 0; --i) {
+ if (links[i]->inRect(x, y)) {
+ return links[i]->getAction();
+ }
+ }
+ return NULL;
+}
+
+GBool Links::onLink(double x, double y) {
+ int i;
+
+ for (i = 0; i < numLinks; ++i) {
+ if (links[i]->inRect(x, y))
+ return gTrue;
+ }
+ return gFalse;
+}
diff --git a/kpdf/xpdf/xpdf/Makefile.am b/kpdf/xpdf/xpdf/Makefile.am
index 4c0593ad..b86e26b8 100644
--- a/kpdf/xpdf/xpdf/Makefile.am
+++ b/kpdf/xpdf/xpdf/Makefile.am
@@ -2,14 +2,14 @@ INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../fofi -I$(srcdir)/../splash -I$(srcdir)/
libxpdf_la_LDFLAGS = $(all_libraries)
libxpdf_la_LIBADD = $(LIB_X11) $(LIBFREETYPE_LIBS) $(LIBPAPER_LIBS) $(XFT_LIBS) $(LIBJPEG) ../goo/libgoo.la ../fofi/libfofi.la ../splash/libsplash.la
-libxpdf_la_SOURCES = Annot.cc Array.cc BuiltinFont.cc BuiltinFontTables.cc \
- Catalog.cc CharCodeToUnicode.cc CMap.cc Decrypt.cc Dict.cc \
- FontEncodingTables.cc Function.cc Gfx.cc \
- GfxFont.cc GfxState.cc GlobalParams.cc JArithmeticDecoder.cc \
- JBIG2Stream.cc Lexer.cc Link.cc NameToCharCode.cc Object.cc Outline.cc \
- OutputDev.cc PDFDoc.cc PDFDocEncoding.cc PreScanOutputDev.cc PSTokenizer.cc \
- Page.cc Parser.cc PSOutputDev.cc SecurityHandler.cc SplashOutputDev.cc Stream.cc JPXStream.cc \
- TextOutputDev.cc UnicodeMap.cc UnicodeTypeTable.cc XRef.cc
+libxpdf_la_SOURCES = Annot.cpp Array.cpp BuiltinFont.cpp BuiltinFontTables.cpp \
+ Catalog.cpp CharCodeToUnicode.cpp CMap.cpp Decrypt.cpp Dict.cpp \
+ FontEncodingTables.cpp Function.cpp Gfx.cpp \
+ GfxFont.cpp GfxState.cpp GlobalParams.cpp JArithmeticDecoder.cpp \
+ JBIG2Stream.cpp Lexer.cpp Link.cpp NameToCharCode.cpp Object.cpp Outline.cpp \
+ OutputDev.cpp PDFDoc.cpp PDFDocEncoding.cpp PreScanOutputDev.cpp PSTokenizer.cpp \
+ Page.cpp Parser.cpp PSOutputDev.cpp SecurityHandler.cpp SplashOutputDev.cpp Stream.cpp JPXStream.cpp \
+ TextOutputDev.cpp UnicodeMap.cpp UnicodeTypeTable.cpp XRef.cpp
noinst_LTLIBRARIES = libxpdf.la
diff --git a/kpdf/xpdf/xpdf/NameToCharCode.cc b/kpdf/xpdf/xpdf/NameToCharCode.cc
deleted file mode 100644
index 7ebf4e16..00000000
--- a/kpdf/xpdf/xpdf/NameToCharCode.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-//========================================================================
-//
-// NameToCharCode.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include "gmem.h"
-#include "NameToCharCode.h"
-
-//------------------------------------------------------------------------
-
-struct NameToCharCodeEntry {
- char *name;
- CharCode c;
-};
-
-//------------------------------------------------------------------------
-
-NameToCharCode::NameToCharCode() {
- int i;
-
- size = 31;
- len = 0;
- tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
- for (i = 0; i < size; ++i) {
- tab[i].name = NULL;
- }
-}
-
-NameToCharCode::~NameToCharCode() {
- int i;
-
- for (i = 0; i < size; ++i) {
- if (tab[i].name) {
- gfree(tab[i].name);
- }
- }
- gfree(tab);
-}
-
-void NameToCharCode::add(char *name, CharCode c) {
- NameToCharCodeEntry *oldTab;
- int h, i, oldSize;
-
- // expand the table if necessary
- if (len >= size / 2) {
- oldSize = size;
- oldTab = tab;
- size = 2*size + 1;
- tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
- for (h = 0; h < size; ++h) {
- tab[h].name = NULL;
- }
- for (i = 0; i < oldSize; ++i) {
- if (oldTab[i].name) {
- h = hash(oldTab[i].name);
- while (tab[h].name) {
- if (++h == size) {
- h = 0;
- }
- }
- tab[h] = oldTab[i];
- }
- }
- gfree(oldTab);
- }
-
- // add the new name
- h = hash(name);
- while (tab[h].name && strcmp(tab[h].name, name)) {
- if (++h == size) {
- h = 0;
- }
- }
- if (!tab[h].name) {
- tab[h].name = copyString(name);
- }
- tab[h].c = c;
-
- ++len;
-}
-
-CharCode NameToCharCode::lookup(char *name) {
- int h;
-
- h = hash(name);
- while (tab[h].name) {
- if (!strcmp(tab[h].name, name)) {
- return tab[h].c;
- }
- if (++h == size) {
- h = 0;
- }
- }
- return 0;
-}
-
-int NameToCharCode::hash(char *name) {
- char *p;
- unsigned int h;
-
- h = 0;
- for (p = name; *p; ++p) {
- h = 17 * h + (int)(*p & 0xff);
- }
- return (int)(h % size);
-}
diff --git a/kpdf/xpdf/xpdf/NameToCharCode.cpp b/kpdf/xpdf/xpdf/NameToCharCode.cpp
new file mode 100644
index 00000000..23779f05
--- /dev/null
+++ b/kpdf/xpdf/xpdf/NameToCharCode.cpp
@@ -0,0 +1,116 @@
+//========================================================================
+//
+// NameToCharCode.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include "gmem.h"
+#include "NameToCharCode.h"
+
+//------------------------------------------------------------------------
+
+struct NameToCharCodeEntry {
+ char *name;
+ CharCode c;
+};
+
+//------------------------------------------------------------------------
+
+NameToCharCode::NameToCharCode() {
+ int i;
+
+ size = 31;
+ len = 0;
+ tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
+ for (i = 0; i < size; ++i) {
+ tab[i].name = NULL;
+ }
+}
+
+NameToCharCode::~NameToCharCode() {
+ int i;
+
+ for (i = 0; i < size; ++i) {
+ if (tab[i].name) {
+ gfree(tab[i].name);
+ }
+ }
+ gfree(tab);
+}
+
+void NameToCharCode::add(char *name, CharCode c) {
+ NameToCharCodeEntry *oldTab;
+ int h, i, oldSize;
+
+ // expand the table if necessary
+ if (len >= size / 2) {
+ oldSize = size;
+ oldTab = tab;
+ size = 2*size + 1;
+ tab = (NameToCharCodeEntry *)gmallocn(size, sizeof(NameToCharCodeEntry));
+ for (h = 0; h < size; ++h) {
+ tab[h].name = NULL;
+ }
+ for (i = 0; i < oldSize; ++i) {
+ if (oldTab[i].name) {
+ h = hash(oldTab[i].name);
+ while (tab[h].name) {
+ if (++h == size) {
+ h = 0;
+ }
+ }
+ tab[h] = oldTab[i];
+ }
+ }
+ gfree(oldTab);
+ }
+
+ // add the new name
+ h = hash(name);
+ while (tab[h].name && strcmp(tab[h].name, name)) {
+ if (++h == size) {
+ h = 0;
+ }
+ }
+ if (!tab[h].name) {
+ tab[h].name = copyString(name);
+ }
+ tab[h].c = c;
+
+ ++len;
+}
+
+CharCode NameToCharCode::lookup(char *name) {
+ int h;
+
+ h = hash(name);
+ while (tab[h].name) {
+ if (!strcmp(tab[h].name, name)) {
+ return tab[h].c;
+ }
+ if (++h == size) {
+ h = 0;
+ }
+ }
+ return 0;
+}
+
+int NameToCharCode::hash(char *name) {
+ char *p;
+ unsigned int h;
+
+ h = 0;
+ for (p = name; *p; ++p) {
+ h = 17 * h + (int)(*p & 0xff);
+ }
+ return (int)(h % size);
+}
diff --git a/kpdf/xpdf/xpdf/Object.cc b/kpdf/xpdf/xpdf/Object.cc
deleted file mode 100644
index f0a3a092..00000000
--- a/kpdf/xpdf/xpdf/Object.cc
+++ /dev/null
@@ -1,233 +0,0 @@
-//========================================================================
-//
-// Object.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include "Object.h"
-#include "Array.h"
-#include "Dict.h"
-#include "Error.h"
-#include "Stream.h"
-#include "XRef.h"
-
-//------------------------------------------------------------------------
-// Object
-//------------------------------------------------------------------------
-
-char *objTypeNames[numObjTypes] = {
- "boolean",
- "integer",
- "real",
- "string",
- "name",
- "null",
- "array",
- "dictionary",
- "stream",
- "ref",
- "cmd",
- "error",
- "eof",
- "none"
-};
-
-#ifdef DEBUG_MEM
-int Object::numAlloc[numObjTypes] =
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-#endif
-
-Object *Object::initArray(XRef *xref) {
- initObj(objArray);
- array = new Array(xref);
- return this;
-}
-
-Object *Object::initDict(XRef *xref) {
- initObj(objDict);
- dict = new Dict(xref);
- return this;
-}
-
-Object *Object::initDict(Dict *dictA) {
- initObj(objDict);
- dict = dictA;
- dict->incRef();
- return this;
-}
-
-Object *Object::initStream(Stream *streamA) {
- initObj(objStream);
- stream = streamA;
- return this;
-}
-
-Object *Object::copy(Object *obj) {
- *obj = *this;
- switch (type) {
- case objString:
- obj->string = string->copy();
- break;
- case objName:
- obj->name = copyString(name);
- break;
- case objArray:
- array->incRef();
- break;
- case objDict:
- dict->incRef();
- break;
- case objStream:
- stream->incRef();
- break;
- case objCmd:
- obj->cmd = copyString(cmd);
- break;
- default:
- break;
- }
-#ifdef DEBUG_MEM
- ++numAlloc[type];
-#endif
- return obj;
-}
-
-Object *Object::fetch(XRef *xref, Object *obj) {
- return (type == objRef && xref) ?
- xref->fetch(ref.num, ref.gen, obj) : copy(obj);
-}
-
-void Object::free() {
- switch (type) {
- case objString:
- delete string;
- break;
- case objName:
- gfree(name);
- break;
- case objArray:
- if (!array->decRef()) {
- delete array;
- }
- break;
- case objDict:
- if (!dict->decRef()) {
- delete dict;
- }
- break;
- case objStream:
- if (!stream->decRef()) {
- delete stream;
- }
- break;
- case objCmd:
- gfree(cmd);
- break;
- default:
- break;
- }
-#ifdef DEBUG_MEM
- --numAlloc[type];
-#endif
- type = objNone;
-}
-
-char *Object::getTypeName() {
- return objTypeNames[type];
-}
-
-void Object::print(FILE *f) {
- Object obj;
- int i;
-
- switch (type) {
- case objBool:
- fprintf(f, "%s", booln ? "true" : "false");
- break;
- case objInt:
- fprintf(f, "%d", intg);
- break;
- case objReal:
- fprintf(f, "%g", real);
- break;
- case objString:
- fprintf(f, "(");
- fwrite(string->getCString(), 1, string->getLength(), f);
- fprintf(f, ")");
- break;
- case objName:
- fprintf(f, "/%s", name);
- break;
- case objNull:
- fprintf(f, "null");
- break;
- case objArray:
- fprintf(f, "[");
- for (i = 0; i < arrayGetLength(); ++i) {
- if (i > 0)
- fprintf(f, " ");
- arrayGetNF(i, &obj);
- obj.print(f);
- obj.free();
- }
- fprintf(f, "]");
- break;
- case objDict:
- fprintf(f, "<<");
- for (i = 0; i < dictGetLength(); ++i) {
- fprintf(f, " /%s ", dictGetKey(i));
- dictGetValNF(i, &obj);
- obj.print(f);
- obj.free();
- }
- fprintf(f, " >>");
- break;
- case objStream:
- fprintf(f, "<stream>");
- break;
- case objRef:
- fprintf(f, "%d %d R", ref.num, ref.gen);
- break;
- case objCmd:
- fprintf(f, "%s", cmd);
- break;
- case objError:
- fprintf(f, "<error>");
- break;
- case objEOF:
- fprintf(f, "<EOF>");
- break;
- case objNone:
- fprintf(f, "<none>");
- break;
- }
-}
-
-void Object::memCheck(FILE *f) {
-#ifdef DEBUG_MEM
- int i;
- int t;
-
- t = 0;
- for (i = 0; i < numObjTypes; ++i)
- t += numAlloc[i];
- if (t > 0) {
- fprintf(f, "Allocated objects:\n");
- for (i = 0; i < numObjTypes; ++i) {
- if (numAlloc[i] > 0)
- fprintf(f, " %-20s: %6d\n", objTypeNames[i], numAlloc[i]);
- }
- }
-#else
- (void)f;
-#endif
-}
diff --git a/kpdf/xpdf/xpdf/Object.cpp b/kpdf/xpdf/xpdf/Object.cpp
new file mode 100644
index 00000000..81760b44
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Object.cpp
@@ -0,0 +1,233 @@
+//========================================================================
+//
+// Object.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Error.h"
+#include "Stream.h"
+#include "XRef.h"
+
+//------------------------------------------------------------------------
+// Object
+//------------------------------------------------------------------------
+
+char *objTypeNames[numObjTypes] = {
+ "boolean",
+ "integer",
+ "real",
+ "string",
+ "name",
+ "null",
+ "array",
+ "dictionary",
+ "stream",
+ "ref",
+ "cmd",
+ "error",
+ "eof",
+ "none"
+};
+
+#ifdef DEBUG_MEM
+int Object::numAlloc[numObjTypes] =
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+#endif
+
+Object *Object::initArray(XRef *xref) {
+ initObj(objArray);
+ array = new Array(xref);
+ return this;
+}
+
+Object *Object::initDict(XRef *xref) {
+ initObj(objDict);
+ dict = new Dict(xref);
+ return this;
+}
+
+Object *Object::initDict(Dict *dictA) {
+ initObj(objDict);
+ dict = dictA;
+ dict->incRef();
+ return this;
+}
+
+Object *Object::initStream(Stream *streamA) {
+ initObj(objStream);
+ stream = streamA;
+ return this;
+}
+
+Object *Object::copy(Object *obj) {
+ *obj = *this;
+ switch (type) {
+ case objString:
+ obj->string = string->copy();
+ break;
+ case objName:
+ obj->name = copyString(name);
+ break;
+ case objArray:
+ array->incRef();
+ break;
+ case objDict:
+ dict->incRef();
+ break;
+ case objStream:
+ stream->incRef();
+ break;
+ case objCmd:
+ obj->cmd = copyString(cmd);
+ break;
+ default:
+ break;
+ }
+#ifdef DEBUG_MEM
+ ++numAlloc[type];
+#endif
+ return obj;
+}
+
+Object *Object::fetch(XRef *xref, Object *obj) {
+ return (type == objRef && xref) ?
+ xref->fetch(ref.num, ref.gen, obj) : copy(obj);
+}
+
+void Object::free() {
+ switch (type) {
+ case objString:
+ delete string;
+ break;
+ case objName:
+ gfree(name);
+ break;
+ case objArray:
+ if (!array->decRef()) {
+ delete array;
+ }
+ break;
+ case objDict:
+ if (!dict->decRef()) {
+ delete dict;
+ }
+ break;
+ case objStream:
+ if (!stream->decRef()) {
+ delete stream;
+ }
+ break;
+ case objCmd:
+ gfree(cmd);
+ break;
+ default:
+ break;
+ }
+#ifdef DEBUG_MEM
+ --numAlloc[type];
+#endif
+ type = objNone;
+}
+
+char *Object::getTypeName() {
+ return objTypeNames[type];
+}
+
+void Object::print(FILE *f) {
+ Object obj;
+ int i;
+
+ switch (type) {
+ case objBool:
+ fprintf(f, "%s", booln ? "true" : "false");
+ break;
+ case objInt:
+ fprintf(f, "%d", intg);
+ break;
+ case objReal:
+ fprintf(f, "%g", real);
+ break;
+ case objString:
+ fprintf(f, "(");
+ fwrite(string->getCString(), 1, string->getLength(), f);
+ fprintf(f, ")");
+ break;
+ case objName:
+ fprintf(f, "/%s", name);
+ break;
+ case objNull:
+ fprintf(f, "null");
+ break;
+ case objArray:
+ fprintf(f, "[");
+ for (i = 0; i < arrayGetLength(); ++i) {
+ if (i > 0)
+ fprintf(f, " ");
+ arrayGetNF(i, &obj);
+ obj.print(f);
+ obj.free();
+ }
+ fprintf(f, "]");
+ break;
+ case objDict:
+ fprintf(f, "<<");
+ for (i = 0; i < dictGetLength(); ++i) {
+ fprintf(f, " /%s ", dictGetKey(i));
+ dictGetValNF(i, &obj);
+ obj.print(f);
+ obj.free();
+ }
+ fprintf(f, " >>");
+ break;
+ case objStream:
+ fprintf(f, "<stream>");
+ break;
+ case objRef:
+ fprintf(f, "%d %d R", ref.num, ref.gen);
+ break;
+ case objCmd:
+ fprintf(f, "%s", cmd);
+ break;
+ case objError:
+ fprintf(f, "<error>");
+ break;
+ case objEOF:
+ fprintf(f, "<EOF>");
+ break;
+ case objNone:
+ fprintf(f, "<none>");
+ break;
+ }
+}
+
+void Object::memCheck(FILE *f) {
+#ifdef DEBUG_MEM
+ int i;
+ int t;
+
+ t = 0;
+ for (i = 0; i < numObjTypes; ++i)
+ t += numAlloc[i];
+ if (t > 0) {
+ fprintf(f, "Allocated objects:\n");
+ for (i = 0; i < numObjTypes; ++i) {
+ if (numAlloc[i] > 0)
+ fprintf(f, " %-20s: %6d\n", objTypeNames[i], numAlloc[i]);
+ }
+ }
+#else
+ (void)f;
+#endif
+}
diff --git a/kpdf/xpdf/xpdf/Outline.cc b/kpdf/xpdf/xpdf/Outline.cc
deleted file mode 100644
index 39e89a3c..00000000
--- a/kpdf/xpdf/xpdf/Outline.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-//========================================================================
-//
-// Outline.cc
-//
-// Copyright 2002-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "gmem.h"
-#include "GString.h"
-#include "GList.h"
-#include "Link.h"
-#include "PDFDocEncoding.h"
-#include "Outline.h"
-
-//------------------------------------------------------------------------
-
-Outline::Outline(Object *outlineObj, XRef *xref) {
- Object first, last;
-
- items = NULL;
- if (!outlineObj->isDict()) {
- return;
- }
- items = OutlineItem::readItemList(outlineObj->dictLookupNF("First", &first),
- outlineObj->dictLookupNF("Last", &last),
- xref);
- first.free();
- last.free();
-}
-
-Outline::~Outline() {
- if (items) {
- deleteGList(items, OutlineItem);
- }
-}
-
-//------------------------------------------------------------------------
-
-OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
- Object obj1;
- GString *s;
- int i;
-
- xref = xrefA;
- title = NULL;
- action = NULL;
- kids = NULL;
-
- if (dict->lookup("Title", &obj1)->isString()) {
- s = obj1.getString();
- if ((s->getChar(0) & 0xff) == 0xfe &&
- (s->getChar(1) & 0xff) == 0xff) {
- titleLen = (s->getLength() - 2) / 2;
- title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
- for (i = 0; i < titleLen; ++i) {
- title[i] = ((s->getChar(2 + 2*i) & 0xff) << 8) |
- (s->getChar(3 + 2*i) & 0xff);
- }
- } else {
- titleLen = s->getLength();
- title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
- for (i = 0; i < titleLen; ++i) {
- title[i] = pdfDocEncoding[s->getChar(i) & 0xff];
- }
- }
- } else {
- titleLen = 0;
- }
- obj1.free();
-
- if (!dict->lookup("Dest", &obj1)->isNull()) {
- action = LinkAction::parseDest(&obj1);
- } else {
- obj1.free();
- if (!dict->lookup("A", &obj1)->isNull()) {
- action = LinkAction::parseAction(&obj1);
- }
- }
- obj1.free();
-
- dict->lookupNF("First", &firstRef);
- dict->lookupNF("Last", &lastRef);
- dict->lookupNF("Next", &nextRef);
-
- startsOpen = gFalse;
- if (dict->lookup("Count", &obj1)->isInt()) {
- if (obj1.getInt() > 0) {
- startsOpen = gTrue;
- }
- }
- obj1.free();
-}
-
-OutlineItem::~OutlineItem() {
- close();
- if (title) {
- gfree(title);
- }
- if (action) {
- delete action;
- }
- firstRef.free();
- lastRef.free();
- nextRef.free();
-}
-
-GList *OutlineItem::readItemList(Object *firstItemRef, Object *lastItemRef,
- XRef *xrefA) {
- GList *items;
- OutlineItem *item;
- Object obj;
- Object *p;
-
- items = new GList();
- p = firstItemRef;
- while (p->isRef()) {
- if (!p->fetch(xrefA, &obj)->isDict()) {
- obj.free();
- break;
- }
- item = new OutlineItem(obj.getDict(), xrefA);
- obj.free();
- items->append(item);
- if (p->getRef().num == lastItemRef->getRef().num &&
- p->getRef().gen == lastItemRef->getRef().gen) {
- break;
- }
- p = &item->nextRef;
- }
- return items;
-}
-
-void OutlineItem::open() {
- if (!kids) {
- kids = readItemList(&firstRef, &lastRef, xref);
- }
-}
-
-void OutlineItem::close() {
- if (kids) {
- deleteGList(kids, OutlineItem);
- kids = NULL;
- }
-}
diff --git a/kpdf/xpdf/xpdf/Outline.cpp b/kpdf/xpdf/xpdf/Outline.cpp
new file mode 100644
index 00000000..f5aba636
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Outline.cpp
@@ -0,0 +1,151 @@
+//========================================================================
+//
+// Outline.cpp
+//
+// Copyright 2002-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "gmem.h"
+#include "GString.h"
+#include "GList.h"
+#include "Link.h"
+#include "PDFDocEncoding.h"
+#include "Outline.h"
+
+//------------------------------------------------------------------------
+
+Outline::Outline(Object *outlineObj, XRef *xref) {
+ Object first, last;
+
+ items = NULL;
+ if (!outlineObj->isDict()) {
+ return;
+ }
+ items = OutlineItem::readItemList(outlineObj->dictLookupNF("First", &first),
+ outlineObj->dictLookupNF("Last", &last),
+ xref);
+ first.free();
+ last.free();
+}
+
+Outline::~Outline() {
+ if (items) {
+ deleteGList(items, OutlineItem);
+ }
+}
+
+//------------------------------------------------------------------------
+
+OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
+ Object obj1;
+ GString *s;
+ int i;
+
+ xref = xrefA;
+ title = NULL;
+ action = NULL;
+ kids = NULL;
+
+ if (dict->lookup("Title", &obj1)->isString()) {
+ s = obj1.getString();
+ if ((s->getChar(0) & 0xff) == 0xfe &&
+ (s->getChar(1) & 0xff) == 0xff) {
+ titleLen = (s->getLength() - 2) / 2;
+ title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
+ for (i = 0; i < titleLen; ++i) {
+ title[i] = ((s->getChar(2 + 2*i) & 0xff) << 8) |
+ (s->getChar(3 + 2*i) & 0xff);
+ }
+ } else {
+ titleLen = s->getLength();
+ title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
+ for (i = 0; i < titleLen; ++i) {
+ title[i] = pdfDocEncoding[s->getChar(i) & 0xff];
+ }
+ }
+ } else {
+ titleLen = 0;
+ }
+ obj1.free();
+
+ if (!dict->lookup("Dest", &obj1)->isNull()) {
+ action = LinkAction::parseDest(&obj1);
+ } else {
+ obj1.free();
+ if (!dict->lookup("A", &obj1)->isNull()) {
+ action = LinkAction::parseAction(&obj1);
+ }
+ }
+ obj1.free();
+
+ dict->lookupNF("First", &firstRef);
+ dict->lookupNF("Last", &lastRef);
+ dict->lookupNF("Next", &nextRef);
+
+ startsOpen = gFalse;
+ if (dict->lookup("Count", &obj1)->isInt()) {
+ if (obj1.getInt() > 0) {
+ startsOpen = gTrue;
+ }
+ }
+ obj1.free();
+}
+
+OutlineItem::~OutlineItem() {
+ close();
+ if (title) {
+ gfree(title);
+ }
+ if (action) {
+ delete action;
+ }
+ firstRef.free();
+ lastRef.free();
+ nextRef.free();
+}
+
+GList *OutlineItem::readItemList(Object *firstItemRef, Object *lastItemRef,
+ XRef *xrefA) {
+ GList *items;
+ OutlineItem *item;
+ Object obj;
+ Object *p;
+
+ items = new GList();
+ p = firstItemRef;
+ while (p->isRef()) {
+ if (!p->fetch(xrefA, &obj)->isDict()) {
+ obj.free();
+ break;
+ }
+ item = new OutlineItem(obj.getDict(), xrefA);
+ obj.free();
+ items->append(item);
+ if (p->getRef().num == lastItemRef->getRef().num &&
+ p->getRef().gen == lastItemRef->getRef().gen) {
+ break;
+ }
+ p = &item->nextRef;
+ }
+ return items;
+}
+
+void OutlineItem::open() {
+ if (!kids) {
+ kids = readItemList(&firstRef, &lastRef, xref);
+ }
+}
+
+void OutlineItem::close() {
+ if (kids) {
+ deleteGList(kids, OutlineItem);
+ kids = NULL;
+ }
+}
diff --git a/kpdf/xpdf/xpdf/OutputDev.cc b/kpdf/xpdf/xpdf/OutputDev.cc
deleted file mode 100644
index 3ba19973..00000000
--- a/kpdf/xpdf/xpdf/OutputDev.cc
+++ /dev/null
@@ -1,131 +0,0 @@
-//========================================================================
-//
-// OutputDev.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include "Object.h"
-#include "Stream.h"
-#include "GfxState.h"
-#include "OutputDev.h"
-
-//------------------------------------------------------------------------
-// OutputDev
-//------------------------------------------------------------------------
-
-void OutputDev::setDefaultCTM(double *ctm) {
- int i;
- double det;
-
- for (i = 0; i < 6; ++i) {
- defCTM[i] = ctm[i];
- }
- det = 1 / (defCTM[0] * defCTM[3] - defCTM[1] * defCTM[2]);
- defICTM[0] = defCTM[3] * det;
- defICTM[1] = -defCTM[1] * det;
- defICTM[2] = -defCTM[2] * det;
- defICTM[3] = defCTM[0] * det;
- defICTM[4] = (defCTM[2] * defCTM[5] - defCTM[3] * defCTM[4]) * det;
- defICTM[5] = (defCTM[1] * defCTM[4] - defCTM[0] * defCTM[5]) * det;
-}
-
-void OutputDev::cvtDevToUser(double dx, double dy, double *ux, double *uy) {
- *ux = defICTM[0] * dx + defICTM[2] * dy + defICTM[4];
- *uy = defICTM[1] * dx + defICTM[3] * dy + defICTM[5];
-}
-
-void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) {
- *dx = (int)(defCTM[0] * ux + defCTM[2] * uy + defCTM[4] + 0.5);
- *dy = (int)(defCTM[1] * ux + defCTM[3] * uy + defCTM[5] + 0.5);
-}
-
-void OutputDev::updateAll(GfxState *state) {
- updateLineDash(state);
- updateFlatness(state);
- updateLineJoin(state);
- updateLineCap(state);
- updateMiterLimit(state);
- updateLineWidth(state);
- updateStrokeAdjust(state);
- updateFillColorSpace(state);
- updateFillColor(state);
- updateStrokeColorSpace(state);
- updateStrokeColor(state);
- updateBlendMode(state);
- updateFillOpacity(state);
- updateStrokeOpacity(state);
- updateFillOverprint(state);
- updateStrokeOverprint(state);
- updateTransfer(state);
- updateFont(state);
-}
-
-GBool OutputDev::beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
- double /*dx*/, double /*dy*/,
- CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) {
- return gFalse;
-}
-
-void OutputDev::drawImageMask(GfxState * /*state*/, Object * /*ref*/, Stream *str,
- int width, int height, GBool /*invert*/,
- GBool inlineImg) {
- int i, j;
-
- if (inlineImg) {
- str->reset();
- j = height * ((width + 7) / 8);
- for (i = 0; i < j; ++i)
- str->getChar();
- str->close();
- }
-}
-
-void OutputDev::drawImage(GfxState * /*state*/, Object * /*ref*/, Stream *str,
- int width, int height, GfxImageColorMap *colorMap,
- int * /*maskColors*/, GBool inlineImg) {
- int i, j;
-
- if (inlineImg) {
- str->reset();
- j = height * ((width * colorMap->getNumPixelComps() *
- colorMap->getBits() + 7) / 8);
- for (i = 0; i < j; ++i)
- str->getChar();
- str->close();
- }
-}
-
-void OutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
- Stream * /*maskStr*/,
- int /*maskWidth*/, int /*maskHeight*/,
- GBool /*maskInvert*/) {
- drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
-}
-
-void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
- Stream * /*maskStr*/,
- int /*maskWidth*/, int /*maskHeight*/,
- GfxImageColorMap * /*maskColorMap*/) {
- drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
-}
-
-#if OPI_SUPPORT
-void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
-}
-
-void OutputDev::opiEnd(GfxState *state, Dict *opiDict) {
-}
-#endif
diff --git a/kpdf/xpdf/xpdf/OutputDev.cpp b/kpdf/xpdf/xpdf/OutputDev.cpp
new file mode 100644
index 00000000..1b394ad4
--- /dev/null
+++ b/kpdf/xpdf/xpdf/OutputDev.cpp
@@ -0,0 +1,131 @@
+//========================================================================
+//
+// OutputDev.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Stream.h"
+#include "GfxState.h"
+#include "OutputDev.h"
+
+//------------------------------------------------------------------------
+// OutputDev
+//------------------------------------------------------------------------
+
+void OutputDev::setDefaultCTM(double *ctm) {
+ int i;
+ double det;
+
+ for (i = 0; i < 6; ++i) {
+ defCTM[i] = ctm[i];
+ }
+ det = 1 / (defCTM[0] * defCTM[3] - defCTM[1] * defCTM[2]);
+ defICTM[0] = defCTM[3] * det;
+ defICTM[1] = -defCTM[1] * det;
+ defICTM[2] = -defCTM[2] * det;
+ defICTM[3] = defCTM[0] * det;
+ defICTM[4] = (defCTM[2] * defCTM[5] - defCTM[3] * defCTM[4]) * det;
+ defICTM[5] = (defCTM[1] * defCTM[4] - defCTM[0] * defCTM[5]) * det;
+}
+
+void OutputDev::cvtDevToUser(double dx, double dy, double *ux, double *uy) {
+ *ux = defICTM[0] * dx + defICTM[2] * dy + defICTM[4];
+ *uy = defICTM[1] * dx + defICTM[3] * dy + defICTM[5];
+}
+
+void OutputDev::cvtUserToDev(double ux, double uy, int *dx, int *dy) {
+ *dx = (int)(defCTM[0] * ux + defCTM[2] * uy + defCTM[4] + 0.5);
+ *dy = (int)(defCTM[1] * ux + defCTM[3] * uy + defCTM[5] + 0.5);
+}
+
+void OutputDev::updateAll(GfxState *state) {
+ updateLineDash(state);
+ updateFlatness(state);
+ updateLineJoin(state);
+ updateLineCap(state);
+ updateMiterLimit(state);
+ updateLineWidth(state);
+ updateStrokeAdjust(state);
+ updateFillColorSpace(state);
+ updateFillColor(state);
+ updateStrokeColorSpace(state);
+ updateStrokeColor(state);
+ updateBlendMode(state);
+ updateFillOpacity(state);
+ updateStrokeOpacity(state);
+ updateFillOverprint(state);
+ updateStrokeOverprint(state);
+ updateTransfer(state);
+ updateFont(state);
+}
+
+GBool OutputDev::beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
+ double /*dx*/, double /*dy*/,
+ CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) {
+ return gFalse;
+}
+
+void OutputDev::drawImageMask(GfxState * /*state*/, Object * /*ref*/, Stream *str,
+ int width, int height, GBool /*invert*/,
+ GBool inlineImg) {
+ int i, j;
+
+ if (inlineImg) {
+ str->reset();
+ j = height * ((width + 7) / 8);
+ for (i = 0; i < j; ++i)
+ str->getChar();
+ str->close();
+ }
+}
+
+void OutputDev::drawImage(GfxState * /*state*/, Object * /*ref*/, Stream *str,
+ int width, int height, GfxImageColorMap *colorMap,
+ int * /*maskColors*/, GBool inlineImg) {
+ int i, j;
+
+ if (inlineImg) {
+ str->reset();
+ j = height * ((width * colorMap->getNumPixelComps() *
+ colorMap->getBits() + 7) / 8);
+ for (i = 0; i < j; ++i)
+ str->getChar();
+ str->close();
+ }
+}
+
+void OutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
+ Stream * /*maskStr*/,
+ int /*maskWidth*/, int /*maskHeight*/,
+ GBool /*maskInvert*/) {
+ drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
+}
+
+void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
+ Stream * /*maskStr*/,
+ int /*maskWidth*/, int /*maskHeight*/,
+ GfxImageColorMap * /*maskColorMap*/) {
+ drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
+}
+
+#if OPI_SUPPORT
+void OutputDev::opiBegin(GfxState *state, Dict *opiDict) {
+}
+
+void OutputDev::opiEnd(GfxState *state, Dict *opiDict) {
+}
+#endif
diff --git a/kpdf/xpdf/xpdf/PDFDoc.cc b/kpdf/xpdf/xpdf/PDFDoc.cc
deleted file mode 100644
index dc24d97e..00000000
--- a/kpdf/xpdf/xpdf/PDFDoc.cc
+++ /dev/null
@@ -1,433 +0,0 @@
-//========================================================================
-//
-// PDFDoc.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#ifdef WIN32
-# include <windows.h>
-#endif
-#include "GString.h"
-#include "config.h"
-#include "GlobalParams.h"
-#include "Page.h"
-#include "Catalog.h"
-#include "Stream.h"
-#include "XRef.h"
-#include "Link.h"
-#include "OutputDev.h"
-#include "Error.h"
-#include "ErrorCodes.h"
-#include "Lexer.h"
-#include "Parser.h"
-#include "SecurityHandler.h"
-#ifndef DISABLE_OUTLINE
-#include "Outline.h"
-#endif
-#include "PDFDoc.h"
-
-//------------------------------------------------------------------------
-
-#define headerSearchSize 1024 // read this many bytes at beginning of
- // file to look for '%PDF'
-
-//------------------------------------------------------------------------
-// PDFDoc
-//------------------------------------------------------------------------
-
-PDFDoc::PDFDoc(GString *fileNameA, GString *ownerPassword,
- GString *userPassword, void *guiDataA) {
- Object obj;
- GString *fileName1, *fileName2;
-
- ok = gFalse;
- errCode = errNone;
-
- guiData = guiDataA;
-
- file = NULL;
- str = NULL;
- xref = NULL;
- catalog = NULL;
-#ifndef DISABLE_OUTLINE
- outline = NULL;
-#endif
-
- fileName = fileNameA;
- fileName1 = fileName;
-
-
- // try to open file
- fileName2 = NULL;
-#ifdef VMS
- if (!(file = fopen(fileName1->getCString(), "rb", "ctx=stm"))) {
- error(-1, "Couldn't open file '%s'", fileName1->getCString());
- errCode = errOpenFile;
- return;
- }
-#else
- if (!(file = fopen(fileName1->getCString(), "rb"))) {
- fileName2 = fileName->copy();
- fileName2->lowerCase();
- if (!(file = fopen(fileName2->getCString(), "rb"))) {
- fileName2->upperCase();
- if (!(file = fopen(fileName2->getCString(), "rb"))) {
- error(-1, "Couldn't open file '%s'", fileName->getCString());
- delete fileName2;
- errCode = errOpenFile;
- return;
- }
- }
- delete fileName2;
- }
-#endif
-
- // create stream
- obj.initNull();
- str = new FileStream(file, 0, gFalse, 0, &obj);
-
- ok = setup(ownerPassword, userPassword);
-}
-
-#ifdef WIN32
-PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GString *ownerPassword,
- GString *userPassword, void *guiDataA) {
- OSVERSIONINFO version;
- wchar_t fileName2[_MAX_PATH + 1];
- Object obj;
- int i;
-
- ok = gFalse;
- errCode = errNone;
-
- guiData = guiDataA;
-
- file = NULL;
- str = NULL;
- xref = NULL;
- catalog = NULL;
-#ifndef DISABLE_OUTLINE
- outline = NULL;
-#endif
-
- //~ file name should be stored in Unicode (?)
- fileName = new GString();
- for (i = 0; i < fileNameLen; ++i) {
- fileName->append((char)fileNameA[i]);
- }
-
- // zero-terminate the file name string
- for (i = 0; i < fileNameLen && i < _MAX_PATH; ++i) {
- fileName2[i] = fileNameA[i];
- }
- fileName2[i] = 0;
-
- // try to open file
- // NB: _wfopen is only available in NT
- version.dwOSVersionInfoSize = sizeof(version);
- GetVersionEx(&version);
- if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
- file = _wfopen(fileName2, L"rb");
- } else {
- file = fopen(fileName->getCString(), "rb");
- }
- if (!file) {
- error(-1, "Couldn't open file '%s'", fileName->getCString());
- errCode = errOpenFile;
- return;
- }
-
- // create stream
- obj.initNull();
- str = new FileStream(file, 0, gFalse, 0, &obj);
-
- ok = setup(ownerPassword, userPassword);
-}
-#endif
-
-PDFDoc::PDFDoc(BaseStream *strA, GString *ownerPassword,
- GString *userPassword, void *guiDataA) {
- ok = gFalse;
- errCode = errNone;
- guiData = guiDataA;
- if (strA->getFileName()) {
- fileName = strA->getFileName()->copy();
- } else {
- fileName = NULL;
- }
- file = NULL;
- str = strA;
- xref = NULL;
- catalog = NULL;
-#ifndef DISABLE_OUTLINE
- outline = NULL;
-#endif
- ok = setup(ownerPassword, userPassword);
-}
-
-GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
- str->reset();
-
- char *eof = new char[1025];
- int pos = str->getPos();
- str->setPos(1024, -1);
- int i, ch;
- for (i = 0; i < 1024; i++)
- {
- ch = str->getChar();
- if (ch == EOF)
- break;
- eof[i] = ch;
- }
- eof[i] = '\0';
-
- bool found = false;
- for (i = i - 5; i >= 0; i--) {
- if (strncmp (&eof[i], "%%EOF", 5) == 0) {
- found = true;
- break;
- }
- }
- if (!found)
- {
- error(-1, "Document does not have ending %%EOF");
- errCode = errDamaged;
- delete[] eof;
- return gFalse;
- }
- delete[] eof;
-
- str->setPos(pos);
-
- // check header
- checkHeader();
-
- // read xref table
- xref = new XRef(str);
- if (!xref->isOk()) {
- error(-1, "Couldn't read xref table");
- errCode = xref->getErrorCode();
- return gFalse;
- }
-
- // check for encryption
- if (!checkEncryption(ownerPassword, userPassword)) {
- errCode = errEncrypted;
- return gFalse;
- }
-
- // read catalog
- catalog = new Catalog(xref);
- if (!catalog->isOk()) {
- error(-1, "Couldn't read page catalog");
- errCode = errBadCatalog;
- return gFalse;
- }
-
-#ifndef DISABLE_OUTLINE
- // read outline
- outline = new Outline(catalog->getOutline(), xref);
-#endif
-
- // done
- return gTrue;
-}
-
-PDFDoc::~PDFDoc() {
-#ifndef DISABLE_OUTLINE
- if (outline) {
- delete outline;
- }
-#endif
- if (catalog) {
- delete catalog;
- }
- if (xref) {
- delete xref;
- }
- if (str) {
- delete str;
- }
- if (file) {
- fclose(file);
- }
- if (fileName) {
- delete fileName;
- }
-}
-
-// Check for a PDF header on this stream. Skip past some garbage
-// if necessary.
-void PDFDoc::checkHeader() {
- char hdrBuf[headerSearchSize+1];
- char *p;
- int i;
-
- pdfVersion = 0;
- for (i = 0; i < headerSearchSize; ++i) {
- hdrBuf[i] = str->getChar();
- }
- hdrBuf[headerSearchSize] = '\0';
- for (i = 0; i < headerSearchSize - 5; ++i) {
- if (!strncmp(&hdrBuf[i], "%PDF-", 5)) {
- break;
- }
- }
- if (i >= headerSearchSize - 5) {
- error(-1, "May not be a PDF file (continuing anyway)");
- return;
- }
- str->moveStart(i);
- if (!(p = strtok(&hdrBuf[i+5], " \t\n\r"))) {
- error(-1, "May not be a PDF file (continuing anyway)");
- return;
- }
- pdfVersion = atof(p);
- if (!(hdrBuf[i+5] >= '0' && hdrBuf[i+5] <= '9') ||
- pdfVersion > supportedPDFVersionNum + 0.0001) {
- error(-1, "PDF version %s -- xpdf supports version %s"
- " (continuing anyway)", p, supportedPDFVersionStr);
- }
-}
-
-GBool PDFDoc::checkEncryption(GString *ownerPassword, GString *userPassword) {
- Object encrypt;
- GBool encrypted;
- SecurityHandler *secHdlr;
- GBool ret;
-
- xref->getTrailerDict()->dictLookup("Encrypt", &encrypt);
- if ((encrypted = encrypt.isDict())) {
- if ((secHdlr = SecurityHandler::make(this, &encrypt))) {
- if (secHdlr->checkEncryption(ownerPassword, userPassword)) {
- // authorization succeeded
- xref->setEncryption(secHdlr->getPermissionFlags(),
- secHdlr->getOwnerPasswordOk(),
- secHdlr->getFileKey(),
- secHdlr->getFileKeyLength(),
- secHdlr->getEncVersion(),
- secHdlr->getEncAlgorithm());
- ret = gTrue;
- } else {
- // authorization failed
- ret = gFalse;
- }
- delete secHdlr;
- } else {
- // couldn't find the matching security handler
- ret = gFalse;
- }
- } else {
- // document is not encrypted
- ret = gTrue;
- }
- encrypt.free();
- return ret;
-}
-
-void PDFDoc::displayPage(OutputDev *out, int page,
- double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool crop, GBool printing,
- GBool (*abortCheckCbk)(void *data),
- void *abortCheckCbkData) {
- if (globalParams->getPrintCommands()) {
- printf("***** page %d *****\n", page);
- }
- catalog->getPage(page)->display(out, hDPI, vDPI,
- rotate, useMediaBox, crop, printing, catalog,
- abortCheckCbk, abortCheckCbkData);
-}
-
-void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
- double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool crop, GBool printing,
- GBool (*abortCheckCbk)(void *data),
- void *abortCheckCbkData) {
- int page;
-
- for (page = firstPage; page <= lastPage; ++page) {
- displayPage(out, page, hDPI, vDPI, rotate, useMediaBox, crop, printing,
- abortCheckCbk, abortCheckCbkData);
- }
-}
-
-void PDFDoc::displayPageSlice(OutputDev *out, int page,
- double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool crop, GBool printing,
- int sliceX, int sliceY, int sliceW, int sliceH,
- GBool (*abortCheckCbk)(void *data),
- void *abortCheckCbkData) {
- catalog->getPage(page)->displaySlice(out, hDPI, vDPI,
- rotate, useMediaBox, crop,
- sliceX, sliceY, sliceW, sliceH,
- printing, catalog,
- abortCheckCbk, abortCheckCbkData);
-}
-
-Links *PDFDoc::getLinks(int page) {
- return catalog->getPage(page)->getLinks(catalog);
-}
-
-void PDFDoc::processLinks(OutputDev *out, int page) {
- catalog->getPage(page)->processLinks(out, catalog);
-}
-
-GBool PDFDoc::isLinearized() {
- Parser *parser;
- Object obj1, obj2, obj3, obj4, obj5;
- GBool lin;
-
- lin = gFalse;
- obj1.initNull();
- parser = new Parser(xref,
- new Lexer(xref,
- str->makeSubStream(str->getStart(), gFalse, 0, &obj1)),
- gTrue);
- parser->getObj(&obj1);
- parser->getObj(&obj2);
- parser->getObj(&obj3);
- parser->getObj(&obj4);
- if (obj1.isInt() && obj2.isInt() && obj3.isCmd("obj") &&
- obj4.isDict()) {
- obj4.dictLookup("Linearized", &obj5);
- if (obj5.isNum() && obj5.getNum() > 0) {
- lin = gTrue;
- }
- obj5.free();
- }
- obj4.free();
- obj3.free();
- obj2.free();
- obj1.free();
- delete parser;
- return lin;
-}
-
-GBool PDFDoc::saveAs(GString *name) {
- FILE *f;
- int c;
-
- if (!(f = fopen(name->getCString(), "wb"))) {
- error(-1, "Couldn't open file '%s'", name->getCString());
- return gFalse;
- }
- str->reset();
- while ((c = str->getChar()) != EOF) {
- fputc(c, f);
- }
- str->close();
- fclose(f);
- return gTrue;
-}
diff --git a/kpdf/xpdf/xpdf/PDFDoc.cpp b/kpdf/xpdf/xpdf/PDFDoc.cpp
new file mode 100644
index 00000000..ee2bc4df
--- /dev/null
+++ b/kpdf/xpdf/xpdf/PDFDoc.cpp
@@ -0,0 +1,433 @@
+//========================================================================
+//
+// PDFDoc.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#ifdef WIN32
+# include <windows.h>
+#endif
+#include "GString.h"
+#include "config.h"
+#include "GlobalParams.h"
+#include "Page.h"
+#include "Catalog.h"
+#include "Stream.h"
+#include "XRef.h"
+#include "Link.h"
+#include "OutputDev.h"
+#include "Error.h"
+#include "ErrorCodes.h"
+#include "Lexer.h"
+#include "Parser.h"
+#include "SecurityHandler.h"
+#ifndef DISABLE_OUTLINE
+#include "Outline.h"
+#endif
+#include "PDFDoc.h"
+
+//------------------------------------------------------------------------
+
+#define headerSearchSize 1024 // read this many bytes at beginning of
+ // file to look for '%PDF'
+
+//------------------------------------------------------------------------
+// PDFDoc
+//------------------------------------------------------------------------
+
+PDFDoc::PDFDoc(GString *fileNameA, GString *ownerPassword,
+ GString *userPassword, void *guiDataA) {
+ Object obj;
+ GString *fileName1, *fileName2;
+
+ ok = gFalse;
+ errCode = errNone;
+
+ guiData = guiDataA;
+
+ file = NULL;
+ str = NULL;
+ xref = NULL;
+ catalog = NULL;
+#ifndef DISABLE_OUTLINE
+ outline = NULL;
+#endif
+
+ fileName = fileNameA;
+ fileName1 = fileName;
+
+
+ // try to open file
+ fileName2 = NULL;
+#ifdef VMS
+ if (!(file = fopen(fileName1->getCString(), "rb", "ctx=stm"))) {
+ error(-1, "Couldn't open file '%s'", fileName1->getCString());
+ errCode = errOpenFile;
+ return;
+ }
+#else
+ if (!(file = fopen(fileName1->getCString(), "rb"))) {
+ fileName2 = fileName->copy();
+ fileName2->lowerCase();
+ if (!(file = fopen(fileName2->getCString(), "rb"))) {
+ fileName2->upperCase();
+ if (!(file = fopen(fileName2->getCString(), "rb"))) {
+ error(-1, "Couldn't open file '%s'", fileName->getCString());
+ delete fileName2;
+ errCode = errOpenFile;
+ return;
+ }
+ }
+ delete fileName2;
+ }
+#endif
+
+ // create stream
+ obj.initNull();
+ str = new FileStream(file, 0, gFalse, 0, &obj);
+
+ ok = setup(ownerPassword, userPassword);
+}
+
+#ifdef WIN32
+PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GString *ownerPassword,
+ GString *userPassword, void *guiDataA) {
+ OSVERSIONINFO version;
+ wchar_t fileName2[_MAX_PATH + 1];
+ Object obj;
+ int i;
+
+ ok = gFalse;
+ errCode = errNone;
+
+ guiData = guiDataA;
+
+ file = NULL;
+ str = NULL;
+ xref = NULL;
+ catalog = NULL;
+#ifndef DISABLE_OUTLINE
+ outline = NULL;
+#endif
+
+ //~ file name should be stored in Unicode (?)
+ fileName = new GString();
+ for (i = 0; i < fileNameLen; ++i) {
+ fileName->append((char)fileNameA[i]);
+ }
+
+ // zero-terminate the file name string
+ for (i = 0; i < fileNameLen && i < _MAX_PATH; ++i) {
+ fileName2[i] = fileNameA[i];
+ }
+ fileName2[i] = 0;
+
+ // try to open file
+ // NB: _wfopen is only available in NT
+ version.dwOSVersionInfoSize = sizeof(version);
+ GetVersionEx(&version);
+ if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+ file = _wfopen(fileName2, L"rb");
+ } else {
+ file = fopen(fileName->getCString(), "rb");
+ }
+ if (!file) {
+ error(-1, "Couldn't open file '%s'", fileName->getCString());
+ errCode = errOpenFile;
+ return;
+ }
+
+ // create stream
+ obj.initNull();
+ str = new FileStream(file, 0, gFalse, 0, &obj);
+
+ ok = setup(ownerPassword, userPassword);
+}
+#endif
+
+PDFDoc::PDFDoc(BaseStream *strA, GString *ownerPassword,
+ GString *userPassword, void *guiDataA) {
+ ok = gFalse;
+ errCode = errNone;
+ guiData = guiDataA;
+ if (strA->getFileName()) {
+ fileName = strA->getFileName()->copy();
+ } else {
+ fileName = NULL;
+ }
+ file = NULL;
+ str = strA;
+ xref = NULL;
+ catalog = NULL;
+#ifndef DISABLE_OUTLINE
+ outline = NULL;
+#endif
+ ok = setup(ownerPassword, userPassword);
+}
+
+GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
+ str->reset();
+
+ char *eof = new char[1025];
+ int pos = str->getPos();
+ str->setPos(1024, -1);
+ int i, ch;
+ for (i = 0; i < 1024; i++)
+ {
+ ch = str->getChar();
+ if (ch == EOF)
+ break;
+ eof[i] = ch;
+ }
+ eof[i] = '\0';
+
+ bool found = false;
+ for (i = i - 5; i >= 0; i--) {
+ if (strncmp (&eof[i], "%%EOF", 5) == 0) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ error(-1, "Document does not have ending %%EOF");
+ errCode = errDamaged;
+ delete[] eof;
+ return gFalse;
+ }
+ delete[] eof;
+
+ str->setPos(pos);
+
+ // check header
+ checkHeader();
+
+ // read xref table
+ xref = new XRef(str);
+ if (!xref->isOk()) {
+ error(-1, "Couldn't read xref table");
+ errCode = xref->getErrorCode();
+ return gFalse;
+ }
+
+ // check for encryption
+ if (!checkEncryption(ownerPassword, userPassword)) {
+ errCode = errEncrypted;
+ return gFalse;
+ }
+
+ // read catalog
+ catalog = new Catalog(xref);
+ if (!catalog->isOk()) {
+ error(-1, "Couldn't read page catalog");
+ errCode = errBadCatalog;
+ return gFalse;
+ }
+
+#ifndef DISABLE_OUTLINE
+ // read outline
+ outline = new Outline(catalog->getOutline(), xref);
+#endif
+
+ // done
+ return gTrue;
+}
+
+PDFDoc::~PDFDoc() {
+#ifndef DISABLE_OUTLINE
+ if (outline) {
+ delete outline;
+ }
+#endif
+ if (catalog) {
+ delete catalog;
+ }
+ if (xref) {
+ delete xref;
+ }
+ if (str) {
+ delete str;
+ }
+ if (file) {
+ fclose(file);
+ }
+ if (fileName) {
+ delete fileName;
+ }
+}
+
+// Check for a PDF header on this stream. Skip past some garbage
+// if necessary.
+void PDFDoc::checkHeader() {
+ char hdrBuf[headerSearchSize+1];
+ char *p;
+ int i;
+
+ pdfVersion = 0;
+ for (i = 0; i < headerSearchSize; ++i) {
+ hdrBuf[i] = str->getChar();
+ }
+ hdrBuf[headerSearchSize] = '\0';
+ for (i = 0; i < headerSearchSize - 5; ++i) {
+ if (!strncmp(&hdrBuf[i], "%PDF-", 5)) {
+ break;
+ }
+ }
+ if (i >= headerSearchSize - 5) {
+ error(-1, "May not be a PDF file (continuing anyway)");
+ return;
+ }
+ str->moveStart(i);
+ if (!(p = strtok(&hdrBuf[i+5], " \t\n\r"))) {
+ error(-1, "May not be a PDF file (continuing anyway)");
+ return;
+ }
+ pdfVersion = atof(p);
+ if (!(hdrBuf[i+5] >= '0' && hdrBuf[i+5] <= '9') ||
+ pdfVersion > supportedPDFVersionNum + 0.0001) {
+ error(-1, "PDF version %s -- xpdf supports version %s"
+ " (continuing anyway)", p, supportedPDFVersionStr);
+ }
+}
+
+GBool PDFDoc::checkEncryption(GString *ownerPassword, GString *userPassword) {
+ Object encrypt;
+ GBool encrypted;
+ SecurityHandler *secHdlr;
+ GBool ret;
+
+ xref->getTrailerDict()->dictLookup("Encrypt", &encrypt);
+ if ((encrypted = encrypt.isDict())) {
+ if ((secHdlr = SecurityHandler::make(this, &encrypt))) {
+ if (secHdlr->checkEncryption(ownerPassword, userPassword)) {
+ // authorization succeeded
+ xref->setEncryption(secHdlr->getPermissionFlags(),
+ secHdlr->getOwnerPasswordOk(),
+ secHdlr->getFileKey(),
+ secHdlr->getFileKeyLength(),
+ secHdlr->getEncVersion(),
+ secHdlr->getEncAlgorithm());
+ ret = gTrue;
+ } else {
+ // authorization failed
+ ret = gFalse;
+ }
+ delete secHdlr;
+ } else {
+ // couldn't find the matching security handler
+ ret = gFalse;
+ }
+ } else {
+ // document is not encrypted
+ ret = gTrue;
+ }
+ encrypt.free();
+ return ret;
+}
+
+void PDFDoc::displayPage(OutputDev *out, int page,
+ double hDPI, double vDPI, int rotate,
+ GBool useMediaBox, GBool crop, GBool printing,
+ GBool (*abortCheckCbk)(void *data),
+ void *abortCheckCbkData) {
+ if (globalParams->getPrintCommands()) {
+ printf("***** page %d *****\n", page);
+ }
+ catalog->getPage(page)->display(out, hDPI, vDPI,
+ rotate, useMediaBox, crop, printing, catalog,
+ abortCheckCbk, abortCheckCbkData);
+}
+
+void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
+ double hDPI, double vDPI, int rotate,
+ GBool useMediaBox, GBool crop, GBool printing,
+ GBool (*abortCheckCbk)(void *data),
+ void *abortCheckCbkData) {
+ int page;
+
+ for (page = firstPage; page <= lastPage; ++page) {
+ displayPage(out, page, hDPI, vDPI, rotate, useMediaBox, crop, printing,
+ abortCheckCbk, abortCheckCbkData);
+ }
+}
+
+void PDFDoc::displayPageSlice(OutputDev *out, int page,
+ double hDPI, double vDPI, int rotate,
+ GBool useMediaBox, GBool crop, GBool printing,
+ int sliceX, int sliceY, int sliceW, int sliceH,
+ GBool (*abortCheckCbk)(void *data),
+ void *abortCheckCbkData) {
+ catalog->getPage(page)->displaySlice(out, hDPI, vDPI,
+ rotate, useMediaBox, crop,
+ sliceX, sliceY, sliceW, sliceH,
+ printing, catalog,
+ abortCheckCbk, abortCheckCbkData);
+}
+
+Links *PDFDoc::getLinks(int page) {
+ return catalog->getPage(page)->getLinks(catalog);
+}
+
+void PDFDoc::processLinks(OutputDev *out, int page) {
+ catalog->getPage(page)->processLinks(out, catalog);
+}
+
+GBool PDFDoc::isLinearized() {
+ Parser *parser;
+ Object obj1, obj2, obj3, obj4, obj5;
+ GBool lin;
+
+ lin = gFalse;
+ obj1.initNull();
+ parser = new Parser(xref,
+ new Lexer(xref,
+ str->makeSubStream(str->getStart(), gFalse, 0, &obj1)),
+ gTrue);
+ parser->getObj(&obj1);
+ parser->getObj(&obj2);
+ parser->getObj(&obj3);
+ parser->getObj(&obj4);
+ if (obj1.isInt() && obj2.isInt() && obj3.isCmd("obj") &&
+ obj4.isDict()) {
+ obj4.dictLookup("Linearized", &obj5);
+ if (obj5.isNum() && obj5.getNum() > 0) {
+ lin = gTrue;
+ }
+ obj5.free();
+ }
+ obj4.free();
+ obj3.free();
+ obj2.free();
+ obj1.free();
+ delete parser;
+ return lin;
+}
+
+GBool PDFDoc::saveAs(GString *name) {
+ FILE *f;
+ int c;
+
+ if (!(f = fopen(name->getCString(), "wb"))) {
+ error(-1, "Couldn't open file '%s'", name->getCString());
+ return gFalse;
+ }
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ fputc(c, f);
+ }
+ str->close();
+ fclose(f);
+ return gTrue;
+}
diff --git a/kpdf/xpdf/xpdf/PDFDocEncoding.cc b/kpdf/xpdf/xpdf/PDFDocEncoding.cpp
index 89dc3828..89dc3828 100644
--- a/kpdf/xpdf/xpdf/PDFDocEncoding.cc
+++ b/kpdf/xpdf/xpdf/PDFDocEncoding.cpp
diff --git a/kpdf/xpdf/xpdf/PSOutputDev.cc b/kpdf/xpdf/xpdf/PSOutputDev.cc
deleted file mode 100644
index 4fb2cbfd..00000000
--- a/kpdf/xpdf/xpdf/PSOutputDev.cc
+++ /dev/null
@@ -1,6307 +0,0 @@
-//========================================================================
-//
-// PSOutputDev.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-#include <locale.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <math.h>
-#include "GString.h"
-#include "GList.h"
-#include "config.h"
-#include "GlobalParams.h"
-#include "Object.h"
-#include "Error.h"
-#include "Function.h"
-#include "Gfx.h"
-#include "GfxState.h"
-#include "GfxFont.h"
-#include "UnicodeMap.h"
-#include "FoFiType1C.h"
-#include "FoFiTrueType.h"
-#include "Catalog.h"
-#include "Page.h"
-#include "Stream.h"
-#include "Annot.h"
-#include "XRef.h"
-#include "PreScanOutputDev.h"
-#if HAVE_SPLASH
-# include "Splash.h"
-# include "SplashBitmap.h"
-# include "SplashOutputDev.h"
-#endif
-#include "PSOutputDev.h"
-
-#ifdef MACOS
-// needed for setting type/creator of MacOS files
-#include "ICSupport.h"
-#endif
-
-// the MSVC math.h doesn't define this
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-//------------------------------------------------------------------------
-
-// Resolution at which pages with transparency will be rasterized.
-#define splashDPI 300
-
-//------------------------------------------------------------------------
-// PostScript prolog and setup
-//------------------------------------------------------------------------
-
-// The '~' escapes mark prolog code that is emitted only in certain
-// levels:
-//
-// ~[123][sn]
-// ^ ^----- s=psLevel*Sep, n=psLevel*
-// +----- 1=psLevel1*, 2=psLevel2*, 3=psLevel3*
-
-static char *prolog[] = {
- "/xpdf 75 dict def xpdf begin",
- "% PDF special state",
- "/pdfDictSize 15 def",
- "~1sn",
- "/pdfStates 64 array def",
- " 0 1 63 {",
- " pdfStates exch pdfDictSize dict",
- " dup /pdfStateIdx 3 index put",
- " put",
- " } for",
- "~123sn",
- "/pdfSetup {",
- " 3 1 roll 2 array astore",
- " /setpagedevice where {",
- " pop 3 dict begin",
- " /PageSize exch def",
- " /ImagingBBox null def",
- " /Policies 1 dict dup begin /PageSize 3 def end def",
- " { /Duplex true def } if",
- " currentdict end setpagedevice",
- " } {",
- " pop pop",
- " } ifelse",
- "} def",
- "~1sn",
- "/pdfOpNames [",
- " /pdfFill /pdfStroke /pdfLastFill /pdfLastStroke",
- " /pdfTextMat /pdfFontSize /pdfCharSpacing /pdfTextRender",
- " /pdfTextRise /pdfWordSpacing /pdfHorizScaling /pdfTextClipPath",
- "] def",
- "~123sn",
- "/pdfStartPage {",
- "~1sn",
- " pdfStates 0 get begin",
- "~23sn",
- " pdfDictSize dict begin",
- "~23n",
- " /pdfFillCS [] def",
- " /pdfFillXform {} def",
- " /pdfStrokeCS [] def",
- " /pdfStrokeXform {} def",
- "~1n",
- " /pdfFill 0 def",
- " /pdfStroke 0 def",
- "~1s",
- " /pdfFill [0 0 0 1] def",
- " /pdfStroke [0 0 0 1] def",
- "~23sn",
- " /pdfFill [0] def",
- " /pdfStroke [0] def",
- " /pdfFillOP false def",
- " /pdfStrokeOP false def",
- "~123sn",
- " /pdfLastFill false def",
- " /pdfLastStroke false def",
- " /pdfTextMat [1 0 0 1 0 0] def",
- " /pdfFontSize 0 def",
- " /pdfCharSpacing 0 def",
- " /pdfTextRender 0 def",
- " /pdfTextRise 0 def",
- " /pdfWordSpacing 0 def",
- " /pdfHorizScaling 1 def",
- " /pdfTextClipPath [] def",
- "} def",
- "/pdfEndPage { end } def",
- "~23s",
- "% separation convention operators",
- "/findcmykcustomcolor where {",
- " pop",
- "}{",
- " /findcmykcustomcolor { 5 array astore } def",
- "} ifelse",
- "/setcustomcolor where {",
- " pop",
- "}{",
- " /setcustomcolor {",
- " exch",
- " [ exch /Separation exch dup 4 get exch /DeviceCMYK exch",
- " 0 4 getinterval cvx",
- " [ exch /dup load exch { mul exch dup } /forall load",
- " /pop load dup ] cvx",
- " ] setcolorspace setcolor",
- " } def",
- "} ifelse",
- "/customcolorimage where {",
- " pop",
- "}{",
- " /customcolorimage {",
- " gsave",
- " [ exch /Separation exch dup 4 get exch /DeviceCMYK exch",
- " 0 4 getinterval",
- " [ exch /dup load exch { mul exch dup } /forall load",
- " /pop load dup ] cvx",
- " ] setcolorspace",
- " 10 dict begin",
- " /ImageType 1 def",
- " /DataSource exch def",
- " /ImageMatrix exch def",
- " /BitsPerComponent exch def",
- " /Height exch def",
- " /Width exch def",
- " /Decode [1 0] def",
- " currentdict end",
- " image",
- " grestore",
- " } def",
- "} ifelse",
- "~123sn",
- "% PDF color state",
- "~1n",
- "/g { dup /pdfFill exch def setgray",
- " /pdfLastFill true def /pdfLastStroke false def } def",
- "/G { dup /pdfStroke exch def setgray",
- " /pdfLastStroke true def /pdfLastFill false def } def",
- "/fCol {",
- " pdfLastFill not {",
- " pdfFill setgray",
- " /pdfLastFill true def /pdfLastStroke false def",
- " } if",
- "} def",
- "/sCol {",
- " pdfLastStroke not {",
- " pdfStroke setgray",
- " /pdfLastStroke true def /pdfLastFill false def",
- " } if",
- "} def",
- "~1s",
- "/k { 4 copy 4 array astore /pdfFill exch def setcmykcolor",
- " /pdfLastFill true def /pdfLastStroke false def } def",
- "/K { 4 copy 4 array astore /pdfStroke exch def setcmykcolor",
- " /pdfLastStroke true def /pdfLastFill false def } def",
- "/fCol {",
- " pdfLastFill not {",
- " pdfFill aload pop setcmykcolor",
- " /pdfLastFill true def /pdfLastStroke false def",
- " } if",
- "} def",
- "/sCol {",
- " pdfLastStroke not {",
- " pdfStroke aload pop setcmykcolor",
- " /pdfLastStroke true def /pdfLastFill false def",
- " } if",
- "} def",
- "~23n",
- "/cs { /pdfFillXform exch def dup /pdfFillCS exch def",
- " setcolorspace } def",
- "/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def",
- " setcolorspace } def",
- "/sc { pdfLastFill not { pdfFillCS setcolorspace } if",
- " dup /pdfFill exch def aload pop pdfFillXform setcolor",
- " /pdfLastFill true def /pdfLastStroke false def } def",
- "/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if",
- " dup /pdfStroke exch def aload pop pdfStrokeXform setcolor",
- " /pdfLastStroke true def /pdfLastFill false def } def",
- "/op { /pdfFillOP exch def",
- " pdfLastFill { pdfFillOP setoverprint } if } def",
- "/OP { /pdfStrokeOP exch def",
- " pdfLastStroke { pdfStrokeOP setoverprint } if } def",
- "/fCol {",
- " pdfLastFill not {",
- " pdfFillCS setcolorspace",
- " pdfFill aload pop pdfFillXform setcolor",
- " pdfFillOP setoverprint",
- " /pdfLastFill true def /pdfLastStroke false def",
- " } if",
- "} def",
- "/sCol {",
- " pdfLastStroke not {",
- " pdfStrokeCS setcolorspace",
- " pdfStroke aload pop pdfStrokeXform setcolor",
- " pdfStrokeOP setoverprint",
- " /pdfLastStroke true def /pdfLastFill false def",
- " } if",
- "} def",
- "~23s",
- "/k { 4 copy 4 array astore /pdfFill exch def setcmykcolor",
- " /pdfLastFill true def /pdfLastStroke false def } def",
- "/K { 4 copy 4 array astore /pdfStroke exch def setcmykcolor",
- " /pdfLastStroke true def /pdfLastFill false def } def",
- "/ck { 6 copy 6 array astore /pdfFill exch def",
- " findcmykcustomcolor exch setcustomcolor",
- " /pdfLastFill true def /pdfLastStroke false def } def",
- "/CK { 6 copy 6 array astore /pdfStroke exch def",
- " findcmykcustomcolor exch setcustomcolor",
- " /pdfLastStroke true def /pdfLastFill false def } def",
- "/op { /pdfFillOP exch def",
- " pdfLastFill { pdfFillOP setoverprint } if } def",
- "/OP { /pdfStrokeOP exch def",
- " pdfLastStroke { pdfStrokeOP setoverprint } if } def",
- "/fCol {",
- " pdfLastFill not {",
- " pdfFill aload length 4 eq {",
- " setcmykcolor",
- " }{",
- " findcmykcustomcolor exch setcustomcolor",
- " } ifelse",
- " pdfFillOP setoverprint",
- " /pdfLastFill true def /pdfLastStroke false def",
- " } if",
- "} def",
- "/sCol {",
- " pdfLastStroke not {",
- " pdfStroke aload length 4 eq {",
- " setcmykcolor",
- " }{",
- " findcmykcustomcolor exch setcustomcolor",
- " } ifelse",
- " pdfStrokeOP setoverprint",
- " /pdfLastStroke true def /pdfLastFill false def",
- " } if",
- "} def",
- "~123sn",
- "% build a font",
- "/pdfMakeFont {",
- " 4 3 roll findfont",
- " 4 2 roll matrix scale makefont",
- " dup length dict begin",
- " { 1 index /FID ne { def } { pop pop } ifelse } forall",
- " /Encoding exch def",
- " currentdict",
- " end",
- " definefont pop",
- "} def",
- "/pdfMakeFont16 {",
- " exch findfont",
- " dup length dict begin",
- " { 1 index /FID ne { def } { pop pop } ifelse } forall",
- " /WMode exch def",
- " currentdict",
- " end",
- " definefont pop",
- "} def",
- "~3sn",
- "/pdfMakeFont16L3 {",
- " 1 index /CIDFont resourcestatus {",
- " pop pop 1 index /CIDFont findresource /CIDFontType known",
- " } {",
- " false",
- " } ifelse",
- " {",
- " 0 eq { /Identity-H } { /Identity-V } ifelse",
- " exch 1 array astore composefont pop",
- " } {",
- " pdfMakeFont16",
- " } ifelse",
- "} def",
- "~123sn",
- "% graphics state operators",
- "~1sn",
- "/q {",
- " gsave",
- " pdfOpNames length 1 sub -1 0 { pdfOpNames exch get load } for",
- " pdfStates pdfStateIdx 1 add get begin",
- " pdfOpNames { exch def } forall",
- "} def",
- "/Q { end grestore } def",
- "~23sn",
- "/q { gsave pdfDictSize dict begin } def",
- "/Q {",
- " end grestore",
- " /pdfLastFill where {",
- " pop",
- " pdfLastFill {",
- " pdfFillOP setoverprint",
- " } {",
- " pdfStrokeOP setoverprint",
- " } ifelse",
- " } if",
- "} def",
- "~123sn",
- "/cm { concat } def",
- "/d { setdash } def",
- "/i { setflat } def",
- "/j { setlinejoin } def",
- "/J { setlinecap } def",
- "/M { setmiterlimit } def",
- "/w { setlinewidth } def",
- "% path segment operators",
- "/m { moveto } def",
- "/l { lineto } def",
- "/c { curveto } def",
- "/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto",
- " neg 0 rlineto closepath } def",
- "/h { closepath } def",
- "% path painting operators",
- "/S { sCol stroke } def",
- "/Sf { fCol stroke } def",
- "/f { fCol fill } def",
- "/f* { fCol eofill } def",
- "% clipping operators",
- "/W { clip newpath } def",
- "/W* { eoclip newpath } def",
- "/Ws { strokepath clip newpath } def",
- "% text state operators",
- "/Tc { /pdfCharSpacing exch def } def",
- "/Tf { dup /pdfFontSize exch def",
- " dup pdfHorizScaling mul exch matrix scale",
- " pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put",
- " exch findfont exch makefont setfont } def",
- "/Tr { /pdfTextRender exch def } def",
- "/Ts { /pdfTextRise exch def } def",
- "/Tw { /pdfWordSpacing exch def } def",
- "/Tz { /pdfHorizScaling exch def } def",
- "% text positioning operators",
- "/Td { pdfTextMat transform moveto } def",
- "/Tm { /pdfTextMat exch def } def",
- "% text string operators",
- "/cshow where {",
- " pop",
- " /cshow2 {",
- " dup {",
- " pop pop",
- " 1 string dup 0 3 index put 3 index exec",
- " } exch cshow",
- " pop pop",
- " } def",
- "}{",
- " /cshow2 {",
- " currentfont /FontType get 0 eq {",
- " 0 2 2 index length 1 sub {",
- " 2 copy get exch 1 add 2 index exch get",
- " 2 copy exch 256 mul add",
- " 2 string dup 0 6 5 roll put dup 1 5 4 roll put",
- " 3 index exec",
- " } for",
- " } {",
- " dup {",
- " 1 string dup 0 3 index put 3 index exec",
- " } forall",
- " } ifelse",
- " pop pop",
- " } def",
- "} ifelse",
- "/awcp {", // awidthcharpath
- " exch {",
- " false charpath",
- " 5 index 5 index rmoveto",
- " 6 index eq { 7 index 7 index rmoveto } if",
- " } exch cshow2",
- " 6 {pop} repeat",
- "} def",
- "/Tj {",
- " fCol", // because stringwidth has to draw Type 3 chars
- " 1 index stringwidth pdfTextMat idtransform pop",
- " sub 1 index length dup 0 ne { div } { pop pop 0 } ifelse",
- " pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32",
- " 4 3 roll pdfCharSpacing pdfHorizScaling mul add 0",
- " pdfTextMat dtransform",
- " 6 5 roll Tj1",
- "} def",
- "/Tj16 {",
- " fCol", // because stringwidth has to draw Type 3 chars
- " 2 index stringwidth pdfTextMat idtransform pop",
- " sub exch div",
- " pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32",
- " 4 3 roll pdfCharSpacing pdfHorizScaling mul add 0",
- " pdfTextMat dtransform",
- " 6 5 roll Tj1",
- "} def",
- "/Tj16V {",
- " fCol", // because stringwidth has to draw Type 3 chars
- " 2 index stringwidth pdfTextMat idtransform exch pop",
- " sub exch div",
- " 0 pdfWordSpacing pdfTextMat dtransform 32",
- " 4 3 roll pdfCharSpacing add 0 exch",
- " pdfTextMat dtransform",
- " 6 5 roll Tj1",
- "} def",
- "/Tj1 {",
- " 0 pdfTextRise pdfTextMat dtransform rmoveto",
- " currentpoint 8 2 roll",
- " pdfTextRender 1 and 0 eq {",
- " 6 copy awidthshow",
- " } if",
- " pdfTextRender 3 and dup 1 eq exch 2 eq or {",
- " 7 index 7 index moveto",
- " 6 copy",
- " currentfont /FontType get 3 eq { fCol } { sCol } ifelse",
- " false awcp currentpoint stroke moveto",
- " } if",
- " pdfTextRender 4 and 0 ne {",
- " 8 6 roll moveto",
- " false awcp",
- " /pdfTextClipPath [ pdfTextClipPath aload pop",
- " {/moveto cvx}",
- " {/lineto cvx}",
- " {/curveto cvx}",
- " {/closepath cvx}",
- " pathforall ] def",
- " currentpoint newpath moveto",
- " } {",
- " 8 {pop} repeat",
- " } ifelse",
- " 0 pdfTextRise neg pdfTextMat dtransform rmoveto",
- "} def",
- "/TJm { pdfFontSize 0.001 mul mul neg 0",
- " pdfTextMat dtransform rmoveto } def",
- "/TJmV { pdfFontSize 0.001 mul mul neg 0 exch",
- " pdfTextMat dtransform rmoveto } def",
- "/Tclip { pdfTextClipPath cvx exec clip newpath",
- " /pdfTextClipPath [] def } def",
- "~1ns",
- "% Level 1 image operators",
- "~1n",
- "/pdfIm1 {",
- " /pdfImBuf1 4 index string def",
- " { currentfile pdfImBuf1 readhexstring pop } image",
- "} def",
- "~1s",
- "/pdfIm1Sep {",
- " /pdfImBuf1 4 index string def",
- " /pdfImBuf2 4 index string def",
- " /pdfImBuf3 4 index string def",
- " /pdfImBuf4 4 index string def",
- " { currentfile pdfImBuf1 readhexstring pop }",
- " { currentfile pdfImBuf2 readhexstring pop }",
- " { currentfile pdfImBuf3 readhexstring pop }",
- " { currentfile pdfImBuf4 readhexstring pop }",
- " true 4 colorimage",
- "} def",
- "~1ns",
- "/pdfImM1 {",
- " fCol /pdfImBuf1 4 index 7 add 8 idiv string def",
- " { currentfile pdfImBuf1 readhexstring pop } imagemask",
- "} def",
- "/pdfImM1a {",
- " { 2 copy get exch 1 add exch } imagemask",
- " pop pop",
- "} def",
- "~23sn",
- "% Level 2 image operators",
- "/pdfImBuf 100 string def",
- "/pdfIm {",
- " image",
- " { currentfile pdfImBuf readline",
- " not { pop exit } if",
- " (%-EOD-) eq { exit } if } loop",
- "} def",
- "~23s",
- "/pdfImSep {",
- " findcmykcustomcolor exch",
- " dup /Width get /pdfImBuf1 exch string def",
- " dup /Decode get aload pop 1 index sub /pdfImDecodeRange exch def",
- " /pdfImDecodeLow exch def",
- " begin Width Height BitsPerComponent ImageMatrix DataSource end",
- " /pdfImData exch def",
- " { pdfImData pdfImBuf1 readstring pop",
- " 0 1 2 index length 1 sub {",
- " 1 index exch 2 copy get",
- " pdfImDecodeRange mul 255 div pdfImDecodeLow add round cvi",
- " 255 exch sub put",
- " } for }",
- " 6 5 roll customcolorimage",
- " { currentfile pdfImBuf readline",
- " not { pop exit } if",
- " (%-EOD-) eq { exit } if } loop",
- "} def",
- "~23sn",
- "/pdfImM {",
- " fCol imagemask",
- " { currentfile pdfImBuf readline",
- " not { pop exit } if",
- " (%-EOD-) eq { exit } if } loop",
- "} def",
- "/pr { 2 index 2 index 3 2 roll putinterval 4 add } def",
- "/pdfImClip {",
- " gsave",
- " 0 2 4 index length 1 sub {",
- " dup 4 index exch 2 copy",
- " get 5 index div put",
- " 1 add 3 index exch 2 copy",
- " get 3 index div put",
- " } for",
- " pop pop rectclip",
- "} def",
- "/pdfImClipEnd { grestore } def",
- "~23sn",
- "% shading operators",
- "/colordelta {",
- " false 0 1 3 index length 1 sub {",
- " dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {",
- " pop true",
- " } if",
- " } for",
- " exch pop exch pop",
- "} def",
- "/funcCol { func n array astore } def",
- "/funcSH {",
- " dup 0 eq {",
- " true",
- " } {",
- " dup 6 eq {",
- " false",
- " } {",
- " 4 index 4 index funcCol dup",
- " 6 index 4 index funcCol dup",
- " 3 1 roll colordelta 3 1 roll",
- " 5 index 5 index funcCol dup",
- " 3 1 roll colordelta 3 1 roll",
- " 6 index 8 index funcCol dup",
- " 3 1 roll colordelta 3 1 roll",
- " colordelta or or or",
- " } ifelse",
- " } ifelse",
- " {",
- " 1 add",
- " 4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch",
- " 6 index 6 index 4 index 4 index 4 index funcSH",
- " 2 index 6 index 6 index 4 index 4 index funcSH",
- " 6 index 2 index 4 index 6 index 4 index funcSH",
- " 5 3 roll 3 2 roll funcSH pop pop",
- " } {",
- " pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul",
- "~23n",
- " funcCol sc",
- "~23s",
- " funcCol aload pop k",
- "~23sn",
- " dup 4 index exch mat transform m",
- " 3 index 3 index mat transform l",
- " 1 index 3 index mat transform l",
- " mat transform l pop pop h f*",
- " } ifelse",
- "} def",
- "/axialCol {",
- " dup 0 lt {",
- " pop t0",
- " } {",
- " dup 1 gt {",
- " pop t1",
- " } {",
- " dt mul t0 add",
- " } ifelse",
- " } ifelse",
- " func n array astore",
- "} def",
- "/axialSH {",
- " dup 0 eq {",
- " true",
- " } {",
- " dup 8 eq {",
- " false",
- " } {",
- " 2 index axialCol 2 index axialCol colordelta",
- " } ifelse",
- " } ifelse",
- " {",
- " 1 add 3 1 roll 2 copy add 0.5 mul",
- " dup 4 3 roll exch 4 index axialSH",
- " exch 3 2 roll axialSH",
- " } {",
- " pop 2 copy add 0.5 mul",
- "~23n",
- " axialCol sc",
- "~23s",
- " axialCol aload pop k",
- "~23sn",
- " exch dup dx mul x0 add exch dy mul y0 add",
- " 3 2 roll dup dx mul x0 add exch dy mul y0 add",
- " dx abs dy abs ge {",
- " 2 copy yMin sub dy mul dx div add yMin m",
- " yMax sub dy mul dx div add yMax l",
- " 2 copy yMax sub dy mul dx div add yMax l",
- " yMin sub dy mul dx div add yMin l",
- " h f*",
- " } {",
- " exch 2 copy xMin sub dx mul dy div add xMin exch m",
- " xMax sub dx mul dy div add xMax exch l",
- " exch 2 copy xMax sub dx mul dy div add xMax exch l",
- " xMin sub dx mul dy div add xMin exch l",
- " h f*",
- " } ifelse",
- " } ifelse",
- "} def",
- "/radialCol {",
- " dup t0 lt {",
- " pop t0",
- " } {",
- " dup t1 gt {",
- " pop t1",
- " } if",
- " } ifelse",
- " func n array astore",
- "} def",
- "/radialSH {",
- " dup 0 eq {",
- " true",
- " } {",
- " dup 8 eq {",
- " false",
- " } {",
- " 2 index dt mul t0 add radialCol",
- " 2 index dt mul t0 add radialCol colordelta",
- " } ifelse",
- " } ifelse",
- " {",
- " 1 add 3 1 roll 2 copy add 0.5 mul",
- " dup 4 3 roll exch 4 index radialSH",
- " exch 3 2 roll radialSH",
- " } {",
- " pop 2 copy add 0.5 mul dt mul t0 add",
- "~23n",
- " radialCol sc",
- "~23s",
- " radialCol aload pop k",
- "~23sn",
- " encl {",
- " exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
- " 0 360 arc h",
- " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
- " 360 0 arcn h f",
- " } {",
- " 2 copy",
- " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
- " a1 a2 arcn",
- " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
- " a2 a1 arcn h",
- " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
- " a1 a2 arc",
- " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
- " a2 a1 arc h f",
- " } ifelse",
- " } ifelse",
- "} def",
- "~123sn",
- "end",
- NULL
-};
-
-static char *cmapProlog[] = {
- "/CIDInit /ProcSet findresource begin",
- "10 dict begin",
- " begincmap",
- " /CMapType 1 def",
- " /CMapName /Identity-H def",
- " /CIDSystemInfo 3 dict dup begin",
- " /Registry (Adobe) def",
- " /Ordering (Identity) def",
- " /Supplement 0 def",
- " end def",
- " 1 begincodespacerange",
- " <0000> <ffff>",
- " endcodespacerange",
- " 0 usefont",
- " 1 begincidrange",
- " <0000> <ffff> 0",
- " endcidrange",
- " endcmap",
- " currentdict CMapName exch /CMap defineresource pop",
- "end",
- "10 dict begin",
- " begincmap",
- " /CMapType 1 def",
- " /CMapName /Identity-V def",
- " /CIDSystemInfo 3 dict dup begin",
- " /Registry (Adobe) def",
- " /Ordering (Identity) def",
- " /Supplement 0 def",
- " end def",
- " /WMode 1 def",
- " 1 begincodespacerange",
- " <0000> <ffff>",
- " endcodespacerange",
- " 0 usefont",
- " 1 begincidrange",
- " <0000> <ffff> 0",
- " endcidrange",
- " endcmap",
- " currentdict CMapName exch /CMap defineresource pop",
- "end",
- "end",
- NULL
-};
-
-//------------------------------------------------------------------------
-// Fonts
-//------------------------------------------------------------------------
-
-struct PSSubstFont {
- char *psName; // PostScript name
- double mWidth; // width of 'm' character
-};
-
-static char *psFonts[] = {
- "Courier",
- "Courier-Bold",
- "Courier-Oblique",
- "Courier-BoldOblique",
- "Helvetica",
- "Helvetica-Bold",
- "Helvetica-Oblique",
- "Helvetica-BoldOblique",
- "Symbol",
- "Times-Roman",
- "Times-Bold",
- "Times-Italic",
- "Times-BoldItalic",
- "ZapfDingbats",
- NULL
-};
-
-static PSSubstFont psSubstFonts[] = {
- {"Helvetica", 0.833},
- {"Helvetica-Oblique", 0.833},
- {"Helvetica-Bold", 0.889},
- {"Helvetica-BoldOblique", 0.889},
- {"Times-Roman", 0.788},
- {"Times-Italic", 0.722},
- {"Times-Bold", 0.833},
- {"Times-BoldItalic", 0.778},
- {"Courier", 0.600},
- {"Courier-Oblique", 0.600},
- {"Courier-Bold", 0.600},
- {"Courier-BoldOblique", 0.600}
-};
-
-// Info for 8-bit fonts
-struct PSFont8Info {
- Ref fontID;
- Gushort *codeToGID; // code-to-GID mapping for TrueType fonts
-};
-
-// Encoding info for substitute 16-bit font
-struct PSFont16Enc {
- Ref fontID;
- GString *enc;
-};
-
-//------------------------------------------------------------------------
-// process colors
-//------------------------------------------------------------------------
-
-#define psProcessCyan 1
-#define psProcessMagenta 2
-#define psProcessYellow 4
-#define psProcessBlack 8
-#define psProcessCMYK 15
-
-//------------------------------------------------------------------------
-// PSOutCustomColor
-//------------------------------------------------------------------------
-
-class PSOutCustomColor {
-public:
-
- PSOutCustomColor(double cA, double mA,
- double yA, double kA, GString *nameA);
- ~PSOutCustomColor();
-
- double c, m, y, k;
- GString *name;
- PSOutCustomColor *next;
-};
-
-PSOutCustomColor::PSOutCustomColor(double cA, double mA,
- double yA, double kA, GString *nameA) {
- c = cA;
- m = mA;
- y = yA;
- k = kA;
- name = nameA;
- next = NULL;
-}
-
-PSOutCustomColor::~PSOutCustomColor() {
- delete name;
-}
-
-//------------------------------------------------------------------------
-
-struct PSOutImgClipRect {
- int x0, x1, y0, y1;
-};
-
-//------------------------------------------------------------------------
-// DeviceNRecoder
-//------------------------------------------------------------------------
-
-class DeviceNRecoder: public FilterStream {
-public:
-
- DeviceNRecoder(Stream *strA, int widthA, int heightA,
- GfxImageColorMap *colorMapA);
- virtual ~DeviceNRecoder();
- virtual StreamKind getKind() { return strWeird; }
- virtual void reset();
- virtual int getChar()
- { return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx++]; }
- virtual int lookChar()
- { return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx]; }
- virtual GString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
- virtual GBool isBinary(GBool /*last*/ = gTrue) { return gTrue; }
- virtual GBool isEncoder() { return gTrue; }
-
-private:
-
- GBool fillBuf();
-
- int width, height;
- GfxImageColorMap *colorMap;
- Function *func;
- ImageStream *imgStr;
- int buf[gfxColorMaxComps];
- int pixelIdx;
- int bufIdx;
- int bufSize;
-};
-
-DeviceNRecoder::DeviceNRecoder(Stream *strA, int widthA, int heightA,
- GfxImageColorMap *colorMapA):
- FilterStream(strA) {
- width = widthA;
- height = heightA;
- colorMap = colorMapA;
- imgStr = NULL;
- pixelIdx = 0;
- bufIdx = gfxColorMaxComps;
- bufSize = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
- getAlt()->getNComps();
- func = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
- getTintTransformFunc();
-}
-
-DeviceNRecoder::~DeviceNRecoder() {
- if (imgStr) {
- delete imgStr;
- }
-}
-
-void DeviceNRecoder::reset() {
- imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
- colorMap->getBits());
- imgStr->reset();
-}
-
-GBool DeviceNRecoder::fillBuf() {
- Guchar pixBuf[gfxColorMaxComps];
- GfxColor color;
- double x[gfxColorMaxComps], y[gfxColorMaxComps];
- int i;
-
- if (pixelIdx >= width * height) {
- return gFalse;
- }
- imgStr->getPixel(pixBuf);
- colorMap->getColor(pixBuf, &color);
- for (i = 0;
- i < ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->getNComps();
- ++i) {
- x[i] = colToDbl(color.c[i]);
- }
- func->transform(x, y);
- for (i = 0; i < bufSize; ++i) {
- buf[i] = (int)(y[i] * 255 + 0.5);
- }
- bufIdx = 0;
- ++pixelIdx;
- return gTrue;
-}
-
-//------------------------------------------------------------------------
-// PSOutputDev
-//------------------------------------------------------------------------
-
-extern "C" {
-typedef void (*SignalFunc)(int);
-}
-
-static void outputToFile(void *stream, char *data, int len) {
- fwrite(data, 1, len, (FILE *)stream);
-}
-
-PSOutputDev::PSOutputDev(char *fileName, char *pstitle, XRef *xrefA, Catalog *catalog,
- int firstPage, int lastPage, PSOutMode modeA,
- int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
- GBool forceRasterizeA,
- GBool manualCtrlA) {
- FILE *f;
- PSFileType fileTypeA;
-
- underlayCbk = NULL;
- underlayCbkData = NULL;
- overlayCbk = NULL;
- overlayCbkData = NULL;
-
- fontIDs = NULL;
- fontFileIDs = NULL;
- fontFileNames = NULL;
- font8Info = NULL;
- font16Enc = NULL;
- imgIDs = NULL;
- formIDs = NULL;
- xobjStack = NULL;
- embFontList = NULL;
- customColors = NULL;
- haveTextClip = gFalse;
- t3String = NULL;
-
- forceRasterize = forceRasterizeA;
-
- // open file or pipe
- if (!strcmp(fileName, "-")) {
- fileTypeA = psStdout;
- f = stdout;
- } else if (fileName[0] == '|') {
- fileTypeA = psPipe;
-#ifdef HAVE_POPEN
-#ifndef WIN32
- signal(SIGPIPE, (SignalFunc)SIG_IGN);
-#endif
- if (!(f = popen(fileName + 1, "w"))) {
- error(-1, "Couldn't run print command '%s'", fileName);
- ok = gFalse;
- return;
- }
-#else
- error(-1, "Print commands are not supported ('%s')", fileName);
- ok = gFalse;
- return;
-#endif
- } else {
- fileTypeA = psFile;
- if (!(f = fopen(fileName, "w"))) {
- error(-1, "Couldn't open PostScript file '%s'", fileName);
- ok = gFalse;
- return;
- }
- }
-
- init(outputToFile, f, fileTypeA, pstitle,
- xrefA, catalog, firstPage, lastPage, modeA,
- imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA);
-}
-
-void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
- PSFileType fileTypeA, char *pstitle, XRef *xrefA, Catalog *catalog,
- int firstPage, int lastPage, PSOutMode modeA,
- int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
- GBool manualCtrlA) {
- Page *page;
- PDFRectangle *box;
-
- // initialize
- setlocale(LC_NUMERIC,"POSIX");
- ok = gTrue;
- outputFunc = outputFuncA;
- outputStream = outputStreamA;
- fileType = fileTypeA;
- xref = xrefA;
- level = globalParams->getPSLevel();
- mode = modeA;
- paperWidth = globalParams->getPSPaperWidth();
- paperHeight = globalParams->getPSPaperHeight();
- imgLLX = imgLLXA;
- imgLLY = imgLLYA;
- imgURX = imgURXA;
- imgURY = imgURYA;
- if (imgLLX == 0 && imgURX == 0 && imgLLY == 0 && imgURY == 0) {
- globalParams->getPSImageableArea(&imgLLX, &imgLLY, &imgURX, &imgURY);
- }
- if (paperWidth < 0 || paperHeight < 0) {
- // this check is needed in case the document has zero pages
- if (firstPage > 0 && firstPage <= catalog->getNumPages()) {
- page = catalog->getPage(firstPage);
- paperWidth = (int)ceil(page->getMediaWidth());
- paperHeight = (int)ceil(page->getMediaHeight());
- } else {
- paperWidth = 1;
- paperHeight = 1;
- }
- imgLLX = imgLLY = 0;
- imgURX = paperWidth;
- imgURY = paperHeight;
- }
- preload = globalParams->getPSPreload();
- manualCtrl = manualCtrlA;
- if (mode == psModeForm) {
- lastPage = firstPage;
- }
- processColors = 0;
- inType3Char = gFalse;
-
-#if OPI_SUPPORT
- // initialize OPI nesting levels
- opi13Nest = 0;
- opi20Nest = 0;
-#endif
-
- tx0 = ty0 = -1;
- xScale0 = yScale0 = 0;
- rotate0 = -1;
- clipLLX0 = clipLLY0 = 0;
- clipURX0 = clipURY0 = -1;
-
- // initialize fontIDs, fontFileIDs, and fontFileNames lists
- fontIDSize = 64;
- fontIDLen = 0;
- fontIDs = (Ref *)gmallocn(fontIDSize, sizeof(Ref));
- fontFileIDSize = 64;
- fontFileIDLen = 0;
- fontFileIDs = (Ref *)gmallocn(fontFileIDSize, sizeof(Ref));
- fontFileNameSize = 64;
- fontFileNameLen = 0;
- fontFileNames = (GString **)gmallocn(fontFileNameSize, sizeof(GString *));
- psFileNames = (GString **)gmallocn(fontFileNameSize, sizeof(GString *));
- nextTrueTypeNum = 0;
- font8InfoLen = 0;
- font8InfoSize = 0;
- font16EncLen = 0;
- font16EncSize = 0;
- imgIDLen = 0;
- imgIDSize = 0;
- formIDLen = 0;
- formIDSize = 0;
-
- xobjStack = new GList();
- numSaves = 0;
- numTilingPatterns = 0;
- nextFunc = 0;
-
- // initialize embedded font resource comment list
- embFontList = new GString();
-
- if (!manualCtrl) {
- // this check is needed in case the document has zero pages
- if (firstPage > 0 && firstPage <= catalog->getNumPages()) {
- writeHeader(firstPage, lastPage,
- catalog->getPage(firstPage)->getMediaBox(),
- catalog->getPage(firstPage)->getCropBox(),
- catalog->getPage(firstPage)->getRotate(), pstitle);
- } else {
- box = new PDFRectangle(0, 0, 1, 1);
- writeHeader(firstPage, lastPage, box, box, 0, pstitle);
- delete box;
- }
- if (mode != psModeForm) {
- writePS("%%BeginProlog\n");
- }
- writeXpdfProcset();
- if (mode != psModeForm) {
- writePS("%%EndProlog\n");
- writePS("%%BeginSetup\n");
- }
- writeDocSetup(catalog, firstPage, lastPage);
- if (mode != psModeForm) {
- writePS("%%EndSetup\n");
- }
- }
-
- // initialize sequential page number
- seqPage = 1;
-}
-
-PSOutputDev::~PSOutputDev() {
- PSOutCustomColor *cc;
- int i;
-
- if (ok) {
- if (!manualCtrl) {
- writePS("%%Trailer\n");
- writeTrailer();
- if (mode != psModeForm) {
- writePS("%%EOF\n");
- }
- }
- if (fileType == psFile) {
-#ifdef MACOS
- ICS_MapRefNumAndAssign((short)((FILE *)outputStream)->handle);
-#endif
- fclose((FILE *)outputStream);
- }
-#ifdef HAVE_POPEN
- else if (fileType == psPipe) {
- pclose((FILE *)outputStream);
-#ifndef WIN32
- signal(SIGPIPE, (SignalFunc)SIG_DFL);
-#endif
- }
-#endif
- }
- if (embFontList) {
- delete embFontList;
- }
- if (fontIDs) {
- gfree(fontIDs);
- }
- if (fontFileIDs) {
- gfree(fontFileIDs);
- }
- if (fontFileNames) {
- for (i = 0; i < fontFileNameLen; ++i) {
- delete fontFileNames[i];
- }
- gfree(fontFileNames);
- }
- if (font8Info) {
- for (i = 0; i < font8InfoLen; ++i) {
- gfree(font8Info[i].codeToGID);
- }
- gfree(font8Info);
- }
- if (psFileNames) {
- for (i = 0; i < fontFileNameLen; ++i) {
- if (psFileNames[i])
- delete psFileNames[i];
- }
- gfree(psFileNames);
- }
- if (font16Enc) {
- for (i = 0; i < font16EncLen; ++i) {
- delete font16Enc[i].enc;
- }
- gfree(font16Enc);
- }
- gfree(imgIDs);
- gfree(formIDs);
- if (xobjStack) {
- delete xobjStack;
- }
- while (customColors) {
- cc = customColors;
- customColors = cc->next;
- delete cc;
- }
-}
-
-void PSOutputDev::writeHeader(int firstPage, int lastPage,
- PDFRectangle *mediaBox, PDFRectangle *cropBox,
- int pageRotate, char *pstitle) {
- Object info, obj1;
- double x1, y1, x2, y2;
-
- switch (mode) {
- case psModePS:
- writePS("%!PS-Adobe-3.0\n");
- break;
- case psModeEPS:
- writePS("%!PS-Adobe-3.0 EPSF-3.0\n");
- break;
- case psModeForm:
- writePS("%!PS-Adobe-3.0 Resource-Form\n");
- break;
- }
-
- xref->getDocInfo(&info);
- if (info.isDict() && info.dictLookup("Creator", &obj1)->isString()) {
- writePS("%%Creator: ");
- writePSTextLine(obj1.getString());
- }
- obj1.free();
- info.free();
- if(pstitle) {
- writePSFmt("%%Title: {0:s}\n", pstitle);
- }
- writePSFmt("%%LanguageLevel: {0:d}\n",
- (level == psLevel1 || level == psLevel1Sep) ? 1 :
- (level == psLevel2 || level == psLevel2Sep) ? 2 : 3);
- if (level == psLevel1Sep || level == psLevel2Sep || level == psLevel3Sep) {
- writePS("%%DocumentProcessColors: (atend)\n");
- writePS("%%DocumentCustomColors: (atend)\n");
- }
- writePS("%%DocumentSuppliedResources: (atend)\n");
-
- switch (mode) {
- case psModePS:
- writePSFmt("%%DocumentMedia: plain {0:d} {1:d} 0 () ()\n",
- paperWidth, paperHeight);
- writePSFmt("%%BoundingBox: 0 0 {0:d} {1:d}\n", paperWidth, paperHeight);
- writePSFmt("%%Pages: {0:d}\n", lastPage - firstPage + 1);
- writePS("%%EndComments\n");
- writePS("%%BeginDefaults\n");
- writePS("%%PageMedia: plain\n");
- writePS("%%EndDefaults\n");
- break;
- case psModeEPS:
- epsX1 = cropBox->x1;
- epsY1 = cropBox->y1;
- epsX2 = cropBox->x2;
- epsY2 = cropBox->y2;
- if (pageRotate == 0 || pageRotate == 180) {
- x1 = epsX1;
- y1 = epsY1;
- x2 = epsX2;
- y2 = epsY2;
- } else { // pageRotate == 90 || pageRotate == 270
- x1 = 0;
- y1 = 0;
- x2 = epsY2 - epsY1;
- y2 = epsX2 - epsX1;
- }
- writePSFmt("%%BoundingBox: {0:d} {1:d} {2:d} {3:d}\n",
- (int)floor(x1), (int)floor(y1), (int)ceil(x2), (int)ceil(y2));
- if (floor(x1) != ceil(x1) || floor(y1) != ceil(y1) ||
- floor(x2) != ceil(x2) || floor(y2) != ceil(y2)) {
- writePSFmt("%%HiResBoundingBox: {0:.4g} {1:.4g} {2:.4g} {3:.4g}\n",
- x1, y1, x2, y2);
- }
- writePS("%%EndComments\n");
- break;
- case psModeForm:
- writePS("%%EndComments\n");
- writePS("32 dict dup begin\n");
- writePSFmt("/BBox [{0:d} {1:d} {2:d} {3:d}] def\n",
- (int)floor(mediaBox->x1), (int)floor(mediaBox->y1),
- (int)ceil(mediaBox->x2), (int)ceil(mediaBox->y2));
- writePS("/FormType 1 def\n");
- writePS("/Matrix [1 0 0 1 0 0] def\n");
- break;
- }
-}
-
-void PSOutputDev::writeXpdfProcset() {
- GBool lev1, lev2, lev3, sep, nonSep;
- char **p;
- char *q;
-
- writePSFmt("%%BeginResource: procset xpdf {0:s} 0\n", xpdfVersion);
- writePSFmt("%%Copyright: {0:s}\n", xpdfCopyright);
- lev1 = lev2 = lev3 = sep = nonSep = gTrue;
- for (p = prolog; *p; ++p) {
- if ((*p)[0] == '~') {
- lev1 = lev2 = lev3 = sep = nonSep = gFalse;
- for (q = *p + 1; *q; ++q) {
- switch (*q) {
- case '1': lev1 = gTrue; break;
- case '2': lev2 = gTrue; break;
- case '3': lev3 = gTrue; break;
- case 's': sep = gTrue; break;
- case 'n': nonSep = gTrue; break;
- }
- }
- } else if ((level == psLevel1 && lev1 && nonSep) ||
- (level == psLevel1Sep && lev1 && sep) ||
- (level == psLevel2 && lev2 && nonSep) ||
- (level == psLevel2Sep && lev2 && sep) ||
- (level == psLevel3 && lev3 && nonSep) ||
- (level == psLevel3Sep && lev3 && sep)) {
- writePSFmt("{0:s}\n", *p);
- }
- }
- writePS("%%EndResource\n");
-
- if (level >= psLevel3) {
- for (p = cmapProlog; *p; ++p) {
- writePSFmt("{0:s}\n", *p);
- }
- }
-}
-
-void PSOutputDev::writeDocSetup(Catalog *catalog,
- int firstPage, int lastPage) {
- Page *page;
- Dict *resDict;
- Annots *annots;
- Object obj1, obj2;
- int pg, i;
-
- if (mode == psModeForm) {
- // swap the form and xpdf dicts
- writePS("xpdf end begin dup begin\n");
- } else {
- writePS("xpdf begin\n");
- }
- for (pg = firstPage; pg <= lastPage; ++pg) {
- page = catalog->getPage(pg);
- if ((resDict = page->getResourceDict())) {
- setupResources(resDict);
- }
- annots = new Annots(xref, catalog, page->getAnnots(&obj1));
- obj1.free();
- for (i = 0; i < annots->getNumAnnots(); ++i) {
- if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) {
- obj1.streamGetDict()->lookup("Resources", &obj2);
- if (obj2.isDict()) {
- setupResources(obj2.getDict());
- }
- obj2.free();
- }
- obj1.free();
- }
- delete annots;
- }
- if (mode != psModeForm) {
- if (mode != psModeEPS && !manualCtrl) {
- writePSFmt("{0:d} {1:d} {2:s} pdfSetup\n",
- paperWidth, paperHeight,
- globalParams->getPSDuplex() ? "true" : "false");
- }
-#if OPI_SUPPORT
- if (globalParams->getPSOPI()) {
- writePS("/opiMatrix matrix currentmatrix def\n");
- }
-#endif
- }
-}
-
-void PSOutputDev::writePageTrailer() {
- if (mode != psModeForm) {
- writePS("pdfEndPage\n");
- }
-}
-
-void PSOutputDev::writeTrailer() {
- PSOutCustomColor *cc;
-
- if (mode == psModeForm) {
- writePS("/Foo exch /Form defineresource pop\n");
- } else {
- writePS("end\n");
- writePS("%%DocumentSuppliedResources:\n");
- writePS(embFontList->getCString());
- if (level == psLevel1Sep || level == psLevel2Sep ||
- level == psLevel3Sep) {
- writePS("%%DocumentProcessColors:");
- if (processColors & psProcessCyan) {
- writePS(" Cyan");
- }
- if (processColors & psProcessMagenta) {
- writePS(" Magenta");
- }
- if (processColors & psProcessYellow) {
- writePS(" Yellow");
- }
- if (processColors & psProcessBlack) {
- writePS(" Black");
- }
- writePS("\n");
- writePS("%%DocumentCustomColors:");
- for (cc = customColors; cc; cc = cc->next) {
- writePSFmt(" ({0:s})", cc->name->getCString());
- }
- writePS("\n");
- writePS("%%CMYKCustomColor:\n");
- for (cc = customColors; cc; cc = cc->next) {
- writePSFmt("%%+ {0:.4g} {1:.4g} {2:.4g} {3:.4g} ({4:t})\n",
- cc->c, cc->m, cc->y, cc->k, cc->name);
- }
- }
- }
-}
-
-void PSOutputDev::setupResources(Dict *resDict) {
- Object xObjDict, xObjRef, xObj, patDict, patRef, pat, resObj;
- Ref ref0, ref1;
- GBool skip;
- int i, j;
-
- setupFonts(resDict);
- setupImages(resDict);
- setupForms(resDict);
-
- //----- recursively scan XObjects
- resDict->lookup("XObject", &xObjDict);
- if (xObjDict.isDict()) {
- for (i = 0; i < xObjDict.dictGetLength(); ++i) {
-
- // avoid infinite recursion on XObjects
- skip = gFalse;
- if ((xObjDict.dictGetValNF(i, &xObjRef)->isRef())) {
- ref0 = xObjRef.getRef();
- for (j = 0; j < xobjStack->getLength(); ++j) {
- ref1 = *(Ref *)xobjStack->get(j);
- if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
- skip = gTrue;
- break;
- }
- }
- if (!skip) {
- xobjStack->append(&ref0);
- }
- }
- if (!skip) {
-
- // process the XObject's resource dictionary
- xObjDict.dictGetVal(i, &xObj);
- if (xObj.isStream()) {
- xObj.streamGetDict()->lookup("Resources", &resObj);
- if (resObj.isDict()) {
- setupResources(resObj.getDict());
- }
- resObj.free();
- }
- xObj.free();
- }
-
- if (xObjRef.isRef() && !skip) {
- xobjStack->del(xobjStack->getLength() - 1);
- }
- xObjRef.free();
- }
- }
- xObjDict.free();
-
- //----- recursively scan Patterns
- resDict->lookup("Pattern", &patDict);
- if (patDict.isDict()) {
- inType3Char = gTrue;
- for (i = 0; i < patDict.dictGetLength(); ++i) {
-
- // avoid infinite recursion on Patterns
- skip = gFalse;
- if ((patDict.dictGetValNF(i, &patRef)->isRef())) {
- ref0 = patRef.getRef();
- for (j = 0; j < xobjStack->getLength(); ++j) {
- ref1 = *(Ref *)xobjStack->get(j);
- if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
- skip = gTrue;
- break;
- }
- }
- if (!skip) {
- xobjStack->append(&ref0);
- }
- }
- if (!skip) {
-
- // process the Pattern's resource dictionary
- patDict.dictGetVal(i, &pat);
- if (pat.isStream()) {
- pat.streamGetDict()->lookup("Resources", &resObj);
- if (resObj.isDict()) {
- setupResources(resObj.getDict());
- }
- resObj.free();
- }
- pat.free();
- }
-
- if (patRef.isRef() && !skip) {
- xobjStack->del(xobjStack->getLength() - 1);
- }
- patRef.free();
- }
- inType3Char = gFalse;
- }
- patDict.free();
-}
-
-void PSOutputDev::setupFonts(Dict *resDict) {
- Object obj1, obj2;
- Ref r;
- GfxFontDict *gfxFontDict;
- GfxFont *font;
- int i;
-
- if (forceRasterize) return;
-
- gfxFontDict = NULL;
- resDict->lookupNF("Font", &obj1);
- if (obj1.isRef()) {
- obj1.fetch(xref, &obj2);
- if (obj2.isDict()) {
- r = obj1.getRef();
- gfxFontDict = new GfxFontDict(xref, &r, obj2.getDict());
- }
- obj2.free();
- } else if (obj1.isDict()) {
- gfxFontDict = new GfxFontDict(xref, NULL, obj1.getDict());
- }
- if (gfxFontDict) {
- for (i = 0; i < gfxFontDict->getNumFonts(); ++i) {
- if ((font = gfxFontDict->getFont(i))) {
- setupFont(font, resDict);
- }
- }
- delete gfxFontDict;
- }
- obj1.free();
-}
-
-void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
- Ref fontFileID;
- GString *name;
- PSFontParam *fontParam;
- GString *psName;
- char buf[16];
- GBool subst;
- UnicodeMap *uMap;
- char *charName;
- double xs, ys;
- int code;
- double w1, w2;
- double *fm;
- int i, j;
- DisplayFontParam *dfp;
-
- // check if font is already set up
- for (i = 0; i < fontIDLen; ++i) {
- if (fontIDs[i].num == font->getID()->num &&
- fontIDs[i].gen == font->getID()->gen) {
- return;
- }
- }
-
- // add entry to fontIDs list
- if (fontIDLen >= fontIDSize) {
- fontIDSize += 64;
- fontIDs = (Ref *)greallocn(fontIDs, fontIDSize, sizeof(Ref));
- }
- fontIDs[fontIDLen++] = *font->getID();
-
- xs = ys = 1;
- subst = gFalse;
-
- // check for resident 8-bit font
- if (font->getName() &&
- (fontParam = globalParams->getPSFont(font->getName()))) {
- psName = new GString(fontParam->psFontName->getCString());
-
- // check for embedded Type 1 font
- } else if (globalParams->getPSEmbedType1() &&
- font->getType() == fontType1 &&
- font->getEmbeddedFontID(&fontFileID)) {
- psName = filterPSName(font->getEmbeddedFontName());
- setupEmbeddedType1Font(&fontFileID, psName);
-
- // check for embedded Type 1C font
- } else if (globalParams->getPSEmbedType1() &&
- font->getType() == fontType1C &&
- font->getEmbeddedFontID(&fontFileID)) {
- // use the PDF font name because the embedded font name might
- // not include the subset prefix
- psName = filterPSName(font->getOrigName());
- setupEmbeddedType1CFont(font, &fontFileID, psName);
-
- // check for embedded OpenType - Type 1C font
- } else if (globalParams->getPSEmbedType1() &&
- font->getType() == fontType1COT &&
- font->getEmbeddedFontID(&fontFileID)) {
- // use the PDF font name because the embedded font name might
- // not include the subset prefix
- psName = filterPSName(font->getOrigName());
- setupEmbeddedOpenTypeT1CFont(font, &fontFileID, psName);
-
- // check for external Type 1 font file
- } else if (globalParams->getPSEmbedType1() &&
- font->getType() == fontType1 &&
- font->getExtFontFile()) {
- // this assumes that the PS font name matches the PDF font name
- psName = font->getName()->copy();
- setupExternalType1Font(font->getExtFontFile(), psName);
-
- // check for embedded TrueType font
- } else if (globalParams->getPSEmbedTrueType() &&
- (font->getType() == fontTrueType ||
- font->getType() == fontTrueTypeOT) &&
- font->getEmbeddedFontID(&fontFileID)) {
- psName = filterPSName(font->getEmbeddedFontName());
- setupEmbeddedTrueTypeFont(font, &fontFileID, psName);
-
- // check for external TrueType font file
- } else if (globalParams->getPSEmbedTrueType() &&
- font->getType() == fontTrueType &&
- font->getExtFontFile()) {
- psName = setupExternalTrueTypeFont(font);
-
- // check for embedded CID PostScript font
- } else if (globalParams->getPSEmbedCIDPostScript() &&
- font->getType() == fontCIDType0C &&
- font->getEmbeddedFontID(&fontFileID)) {
- psName = filterPSName(font->getEmbeddedFontName());
- setupEmbeddedCIDType0Font(font, &fontFileID, psName);
-
- // check for embedded CID TrueType font
- } else if (globalParams->getPSEmbedCIDTrueType() &&
- (font->getType() == fontCIDType2 ||
- font->getType() == fontCIDType2OT) &&
- font->getEmbeddedFontID(&fontFileID)) {
- psName = filterPSName(font->getEmbeddedFontName());
- //~ should check to see if font actually uses vertical mode
- setupEmbeddedCIDTrueTypeFont(font, &fontFileID, psName, gTrue);
-
- // check for embedded OpenType - CID CFF font
- } else if (globalParams->getPSEmbedCIDPostScript() &&
- font->getType() == fontCIDType0COT &&
- font->getEmbeddedFontID(&fontFileID)) {
- psName = filterPSName(font->getEmbeddedFontName());
- setupEmbeddedOpenTypeCFFFont(font, &fontFileID, psName);
-
- // check for Type 3 font
- } else if (font->getType() == fontType3) {
- psName = GString::format("T3_{0:d}_{1:d}",
- font->getID()->num, font->getID()->gen);
- setupType3Font(font, psName, parentResDict);
- // check for external CID TrueType font file
- } else if (globalParams->getPSEmbedCIDTrueType() &&
- font->getType() == fontCIDType2 &&
- font->getExtFontFile()) {
- psName = setupExternalCIDTrueTypeFont(font, font->getExtFontFile());
- // do 8-bit font substitution
- } else if (!font->isCIDFont()) {
- subst = gTrue;
- name = font->getName();
- psName = NULL;
- if (name) {
- for (i = 0; psFonts[i]; ++i) {
- if (name->cmp(psFonts[i]) == 0) {
- psName = new GString(psFonts[i]);
- break;
- }
- }
- }
- if (!psName) {
- if (font->isFixedWidth()) {
- i = 8;
- } else if (font->isSerif()) {
- i = 4;
- } else {
- i = 0;
- }
- if (font->isBold()) {
- i += 2;
- }
- if (font->isItalic()) {
- i += 1;
- }
- psName = new GString(psSubstFonts[i].psName);
- for (code = 0; code < 256; ++code) {
- if ((charName = ((Gfx8BitFont *)font)->getCharName(code)) &&
- charName[0] == 'm' && charName[1] == '\0') {
- break;
- }
- }
- if (code < 256) {
- w1 = ((Gfx8BitFont *)font)->getWidth(code);
- } else {
- w1 = 0;
- }
- w2 = psSubstFonts[i].mWidth;
- xs = w1 / w2;
- if (xs < 0.1) {
- xs = 1;
- }
- if (font->getType() == fontType3) {
- // This is a hack which makes it possible to substitute for some
- // Type 3 fonts. The problem is that it's impossible to know what
- // the base coordinate system used in the font is without actually
- // rendering the font.
- ys = xs;
- fm = font->getFontMatrix();
- if (fm[0] != 0) {
- ys *= fm[3] / fm[0];
- }
- } else {
- ys = 1;
- }
- }
-
- // do 16-bit font substitution
- } else if ((fontParam = globalParams->
- getPSFont16(font->getName(),
- ((GfxCIDFont *)font)->getCollection(),
- font->getWMode()))) {
- subst = gTrue;
- psName = fontParam->psFontName->copy();
- if (font16EncLen >= font16EncSize) {
- font16EncSize += 16;
- font16Enc = (PSFont16Enc *)greallocn(font16Enc,
- font16EncSize, sizeof(PSFont16Enc));
- }
- font16Enc[font16EncLen].fontID = *font->getID();
- font16Enc[font16EncLen].enc = fontParam->encoding->copy();
- if ((uMap = globalParams->getUnicodeMap(font16Enc[font16EncLen].enc))) {
- uMap->decRefCnt();
- ++font16EncLen;
- } else {
- error(-1, "Couldn't find Unicode map for 16-bit font encoding '%s'",
- font16Enc[font16EncLen].enc->getCString());
- }
-
- // try the display font for embedding
- } else if (globalParams->getPSEmbedCIDTrueType() &&
- ((GfxCIDFont *)font)->getCollection() &&
- (dfp = globalParams->
- getDisplayCIDFont(font->getName(),
- ((GfxCIDFont *)font)->getCollection())) &&
- dfp->kind == displayFontTT) {
- psName = setupExternalCIDTrueTypeFont(font, dfp->tt.fileName, dfp->tt.faceIndex);
-
- // give up - can't do anything with this font
- } else {
- error(-1, "Couldn't find a font to substitute for '%s' ('%s' character collection)",
- font->getName() ? font->getName()->getCString() : "(unnamed)",
- ((GfxCIDFont *)font)->getCollection()
- ? ((GfxCIDFont *)font)->getCollection()->getCString()
- : "(unknown)");
- return;
- }
-
- // generate PostScript code to set up the font
- if (font->isCIDFont()) {
- if (level == psLevel3 || level == psLevel3Sep) {
- writePSFmt("/F{0:d}_{1:d} /{2:t} {3:d} pdfMakeFont16L3\n",
- font->getID()->num, font->getID()->gen, psName,
- font->getWMode());
- } else {
- writePSFmt("/F{0:d}_{1:d} /{2:t} {3:d} pdfMakeFont16\n",
- font->getID()->num, font->getID()->gen, psName,
- font->getWMode());
- }
- } else {
- writePSFmt("/F{0:d}_{1:d} /{2:t} {3:.4g} {4:.4g}\n",
- font->getID()->num, font->getID()->gen, psName, xs, ys);
- for (i = 0; i < 256; i += 8) {
- writePS((char *)((i == 0) ? "[ " : " "));
- for (j = 0; j < 8; ++j) {
- if (font->getType() == fontTrueType &&
- !subst &&
- !((Gfx8BitFont *)font)->getHasEncoding()) {
- sprintf(buf, "c%02x", i+j);
- charName = buf;
- } else {
- charName = ((Gfx8BitFont *)font)->getCharName(i+j);
- // this is a kludge for broken PDF files that encode char 32
- // as .notdef
- if (i+j == 32 && charName && !strcmp(charName, ".notdef")) {
- charName = "space";
- }
- }
- writePS("/");
- writePSName(charName ? charName : (char *)".notdef");
- // the empty name is legal in PDF and PostScript, but PostScript
- // uses a double-slash (//...) for "immediately evaluated names",
- // so we need to add a space character here
- if (charName && !charName[0]) {
- writePS(" ");
- }
- }
- writePS((i == 256-8) ? (char *)"]\n" : (char *)"\n");
- }
- writePS("pdfMakeFont\n");
- }
-
- delete psName;
-}
-
-void PSOutputDev::setupEmbeddedType1Font(Ref *id, GString *psName) {
- static char hexChar[17] = "0123456789abcdef";
- Object refObj, strObj, obj1, obj2, obj3;
- Dict *dict;
- int length1, length2, length3;
- int c;
- int start[4];
- GBool binMode;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen)
- return;
- }
-
- // add entry to fontFileIDs list
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
-
- // get the font stream and info
- refObj.initRef(id->num, id->gen);
- refObj.fetch(xref, &strObj);
- refObj.free();
- if (!strObj.isStream()) {
- error(-1, "Embedded font file object is not a stream");
- goto err1;
- }
- if (!(dict = strObj.streamGetDict())) {
- error(-1, "Embedded font stream is missing its dictionary");
- goto err1;
- }
- dict->lookup("Length1", &obj1);
- dict->lookup("Length2", &obj2);
- dict->lookup("Length3", &obj3);
- if (!obj1.isInt() || !obj2.isInt() || !obj3.isInt()) {
- error(-1, "Missing length fields in embedded font stream dictionary");
- obj1.free();
- obj2.free();
- obj3.free();
- goto err1;
- }
- length1 = obj1.getInt();
- length2 = obj2.getInt();
- length3 = obj3.getInt();
- obj1.free();
- obj2.free();
- obj3.free();
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // copy ASCII portion of font
- strObj.streamReset();
- for (i = 0; i < length1 && (c = strObj.streamGetChar()) != EOF; ++i) {
- writePSChar(c);
- }
-
- // figure out if encrypted portion is binary or ASCII
- binMode = gFalse;
- for (i = 0; i < 4; ++i) {
- start[i] = strObj.streamGetChar();
- if (start[i] == EOF) {
- error(-1, "Unexpected end of file in embedded font stream");
- goto err1;
- }
- if (!((start[i] >= '0' && start[i] <= '9') ||
- (start[i] >= 'A' && start[i] <= 'F') ||
- (start[i] >= 'a' && start[i] <= 'f')))
- binMode = gTrue;
- }
-
- // convert binary data to ASCII
- if (binMode) {
- for (i = 0; i < 4; ++i) {
- writePSChar(hexChar[(start[i] >> 4) & 0x0f]);
- writePSChar(hexChar[start[i] & 0x0f]);
- }
-#if 0 // this causes trouble for various PostScript printers
- // if Length2 is incorrect (too small), font data gets chopped, so
- // we take a few extra characters from the trailer just in case
- length2 += length3 >= 8 ? 8 : length3;
-#endif
- while (i < length2) {
- if ((c = strObj.streamGetChar()) == EOF) {
- break;
- }
- writePSChar(hexChar[(c >> 4) & 0x0f]);
- writePSChar(hexChar[c & 0x0f]);
- if (++i % 32 == 0) {
- writePSChar('\n');
- }
- }
- if (i % 32 > 0) {
- writePSChar('\n');
- }
-
- // already in ASCII format -- just copy it
- } else {
- for (i = 0; i < 4; ++i) {
- writePSChar(start[i]);
- }
- for (i = 4; i < length2; ++i) {
- if ((c = strObj.streamGetChar()) == EOF) {
- break;
- }
- writePSChar(c);
- }
- }
-
- // write padding and "cleartomark"
- for (i = 0; i < 8; ++i) {
- writePS("00000000000000000000000000000000"
- "00000000000000000000000000000000\n");
- }
- writePS("cleartomark\n");
-
- // ending comment
- writePS("%%EndResource\n");
-
- err1:
- strObj.streamClose();
- strObj.free();
-}
-
-//~ This doesn't handle .pfb files or binary eexec data (which only
-//~ happens in pfb files?).
-void PSOutputDev::setupExternalType1Font(GString *fileName, GString *psName) {
- FILE *fontFile;
- int c;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileNameLen; ++i) {
- if (!fontFileNames[i]->cmp(fileName)) {
- return;
- }
- }
-
- // add entry to fontFileNames list
- if (fontFileNameLen >= fontFileNameSize) {
- fontFileNameSize += 64;
- fontFileNames = (GString **)greallocn(fontFileNames,
- fontFileNameSize, sizeof(GString *));
- psFileNames = (GString **)greallocn(psFileNames,
- fontFileNameSize, sizeof(GString *));
- }
- fontFileNames[fontFileNameLen] = fileName->copy();
- psFileNames[fontFileNameLen] = psName->copy();
- fontFileNameLen++;
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // copy the font file
- if (!(fontFile = fopen(fileName->getCString(), "rb"))) {
- error(-1, "Couldn't open external font file");
- return;
- }
- while ((c = fgetc(fontFile)) != EOF) {
- writePSChar(c);
- }
- fclose(fontFile);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
- GString *psName) {
- char *fontBuf;
- int fontLen;
- FoFiType1C *ffT1C;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen)
- return;
- }
-
- // add entry to fontFileIDs list
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 1 font
- fontBuf = font->readEmbFontFile(xref, &fontLen);
- if ((ffT1C = FoFiType1C::make(fontBuf, fontLen))) {
- ffT1C->convertToType1(psName->getCString(), NULL, gTrue,
- outputFunc, outputStream);
- delete ffT1C;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupEmbeddedOpenTypeT1CFont(GfxFont *font, Ref *id,
- GString *psName) {
- char *fontBuf;
- int fontLen;
- FoFiTrueType *ffTT;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen)
- return;
- }
-
- // add entry to fontFileIDs list
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 1 font
- fontBuf = font->readEmbFontFile(xref, &fontLen);
- if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
- if (ffTT->isOpenTypeCFF()) {
- ffTT->convertToType1(psName->getCString(), NULL, gTrue,
- outputFunc, outputStream);
- }
- delete ffTT;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id,
- GString *psName) {
- char *fontBuf;
- int fontLen;
- FoFiTrueType *ffTT;
- Gushort *codeToGID;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen) {
- psName->appendf("_{0:d}", nextTrueTypeNum++);
- break;
- }
- }
-
- // add entry to fontFileIDs list
- if (i == fontFileIDLen) {
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
- }
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 42 font
- fontBuf = font->readEmbFontFile(xref, &fontLen);
- if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
- codeToGID = ((Gfx8BitFont *)font)->getCodeToGIDMap(ffTT);
- ffTT->convertToType42(psName->getCString(),
- ((Gfx8BitFont *)font)->getHasEncoding()
- ? ((Gfx8BitFont *)font)->getEncoding()
- : (char **)NULL,
- codeToGID, outputFunc, outputStream);
- if (codeToGID) {
- if (font8InfoLen >= font8InfoSize) {
- font8InfoSize += 16;
- font8Info = (PSFont8Info *)greallocn(font8Info,
- font8InfoSize,
- sizeof(PSFont8Info));
- }
- font8Info[font8InfoLen].fontID = *font->getID();
- font8Info[font8InfoLen].codeToGID = codeToGID;
- ++font8InfoLen;
- }
- delete ffTT;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-GString *PSOutputDev::setupExternalTrueTypeFont(GfxFont *font) {
- GString *fileName;
- char *fontBuf;
- int fontLen;
- FoFiTrueType *ffTT;
- Gushort *codeToGID;
- GString *psName;
- int i;
-
- // check if font is already embedded
- fileName = font->getExtFontFile();
- for (i = 0; i < fontFileNameLen; ++i) {
- if (!fontFileNames[i]->cmp(fileName)) {
- return psFileNames[i]->copy();
- }
- }
-
- psName = filterPSName(font->getName());
- // add entry to fontFileNames list
- if (i == fontFileNameLen) {
- if (fontFileNameLen >= fontFileNameSize) {
- fontFileNameSize += 64;
- fontFileNames =
- (GString **)greallocn(fontFileNames,
- fontFileNameSize, sizeof(GString *));
- psFileNames =
- (GString **)greallocn(psFileNames,
- fontFileNameSize, sizeof(GString *));
- }
- fontFileNames[fontFileNameLen] = fileName->copy();
- psFileNames[fontFileNameLen] = psName->copy();
- fontFileNameLen++;
- }
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 42 font
- fontBuf = font->readExtFontFile(&fontLen);
- if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
- codeToGID = ((Gfx8BitFont *)font)->getCodeToGIDMap(ffTT);
- ffTT->convertToType42(psName->getCString(),
- ((Gfx8BitFont *)font)->getHasEncoding()
- ? ((Gfx8BitFont *)font)->getEncoding()
- : (char **)NULL,
- codeToGID, outputFunc, outputStream);
- if (codeToGID) {
- if (font8InfoLen >= font8InfoSize) {
- font8InfoSize += 16;
- font8Info = (PSFont8Info *)greallocn(font8Info,
- font8InfoSize,
- sizeof(PSFont8Info));
- }
- font8Info[font8InfoLen].fontID = *font->getID();
- font8Info[font8InfoLen].codeToGID = codeToGID;
- ++font8InfoLen;
- }
- delete ffTT;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
- return psName;
-}
-
-GString *PSOutputDev::setupExternalCIDTrueTypeFont(GfxFont *font, GString *fileName, int faceIndex) {
- FoFiTrueType *ffTT;
- Gushort *codeToGID;
- GString *psName;
- int i;
- GString *myFileName;
-
- myFileName = fileName->copy();
- if (faceIndex > 0) {
- char tmp[32];
- sprintf(tmp, ",%d", faceIndex);
- myFileName->append(tmp);
- }
- // check if font is already embedded
- for (i = 0; i < fontFileNameLen; ++i) {
- if (!fontFileNames[i]->cmp(myFileName)) {
- delete myFileName;
- return psFileNames[i]->copy();
- }
- }
-
- psName = filterPSName(font->getName());
- // add entry to fontFileNames list
- if (i == fontFileNameLen) {
- if (fontFileNameLen >= fontFileNameSize) {
- fontFileNameSize += 64;
- fontFileNames =
- (GString **)grealloc(fontFileNames,
- fontFileNameSize * sizeof(GString *));
- psFileNames =
- (GString **)grealloc(psFileNames,
- fontFileNameSize * sizeof(GString *));
- }
- }
- fontFileNames[fontFileNameLen] = myFileName;
- psFileNames[fontFileNameLen] = psName->copy();
- fontFileNameLen++;
-
- // beginning comment
- writePSFmt("%%%%BeginResource: font %s\n", psName->getCString());
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a CID type2 font
- if ((ffTT = FoFiTrueType::load(fileName->getCString(), faceIndex))) {
- int n = ((GfxCIDFont *)font)->getCIDToGIDLen();
- if (n) {
- codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
- memcpy(codeToGID, ((GfxCIDFont *)font)->getCIDToGID(), n * sizeof(Gushort));
- } else {
- codeToGID = ((GfxCIDFont *)font)->getCodeToGIDMap(ffTT, &n);
- }
- if (globalParams->getPSLevel() >= psLevel3) {
- // Level 3: use a CID font
- ffTT->convertToCIDType2(psName->getCString(),
- codeToGID, n, gTrue,
- outputFunc, outputStream);
- } else {
- // otherwise: use a non-CID composite font
- ffTT->convertToType0(psName->getCString(),
- codeToGID, n, gTrue,
- outputFunc, outputStream);
- }
- gfree(codeToGID);
- delete ffTT;
- }
-
- // ending comment
- writePS("%%EndResource\n");
- return psName;
-}
-
-void PSOutputDev::setupEmbeddedCIDType0Font(GfxFont *font, Ref *id,
- GString *psName) {
- char *fontBuf;
- int fontLen;
- FoFiType1C *ffT1C;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen)
- return;
- }
-
- // add entry to fontFileIDs list
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 0 font
- fontBuf = font->readEmbFontFile(xref, &fontLen);
- if ((ffT1C = FoFiType1C::make(fontBuf, fontLen))) {
- if (globalParams->getPSLevel() >= psLevel3) {
- // Level 3: use a CID font
- ffT1C->convertToCIDType0(psName->getCString(), outputFunc, outputStream);
- } else {
- // otherwise: use a non-CID composite font
- ffT1C->convertToType0(psName->getCString(), outputFunc, outputStream);
- }
- delete ffT1C;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id,
- GString *psName,
- GBool needVerticalMetrics) {
- char *fontBuf;
- int fontLen;
- FoFiTrueType *ffTT;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen) {
- psName->appendf("_{0:d}", nextTrueTypeNum++);
- break;
- }
- }
-
- // add entry to fontFileIDs list
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 0 font
- fontBuf = font->readEmbFontFile(xref, &fontLen);
- if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
- if (globalParams->getPSLevel() >= psLevel3) {
- // Level 3: use a CID font
- ffTT->convertToCIDType2(psName->getCString(),
- ((GfxCIDFont *)font)->getCIDToGID(),
- ((GfxCIDFont *)font)->getCIDToGIDLen(),
- needVerticalMetrics,
- outputFunc, outputStream);
- } else {
- // otherwise: use a non-CID composite font
- ffTT->convertToType0(psName->getCString(),
- ((GfxCIDFont *)font)->getCIDToGID(),
- ((GfxCIDFont *)font)->getCIDToGIDLen(),
- needVerticalMetrics,
- outputFunc, outputStream);
- }
- delete ffTT;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupEmbeddedOpenTypeCFFFont(GfxFont *font, Ref *id,
- GString *psName) {
- char *fontBuf;
- int fontLen;
- FoFiTrueType *ffTT;
- int i;
-
- // check if font is already embedded
- for (i = 0; i < fontFileIDLen; ++i) {
- if (fontFileIDs[i].num == id->num &&
- fontFileIDs[i].gen == id->gen)
- return;
- }
-
- // add entry to fontFileIDs list
- if (fontFileIDLen >= fontFileIDSize) {
- fontFileIDSize += 64;
- fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
- }
- fontFileIDs[fontFileIDLen++] = *id;
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // convert it to a Type 0 font
- fontBuf = font->readEmbFontFile(xref, &fontLen);
- if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
- if (ffTT->isOpenTypeCFF()) {
- if (globalParams->getPSLevel() >= psLevel3) {
- // Level 3: use a CID font
- ffTT->convertToCIDType0(psName->getCString(),
- outputFunc, outputStream);
- } else {
- // otherwise: use a non-CID composite font
- ffTT->convertToType0(psName->getCString(), outputFunc, outputStream);
- }
- }
- delete ffTT;
- }
- gfree(fontBuf);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupType3Font(GfxFont *font, GString *psName,
- Dict *parentResDict) {
- Dict *resDict;
- Dict *charProcs;
- Object charProc;
- Gfx *gfx;
- PDFRectangle box;
- double *m;
- GString *buf;
- int i;
-
- // set up resources used by font
- if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
- inType3Char = gTrue;
- setupResources(resDict);
- inType3Char = gFalse;
- } else {
- resDict = parentResDict;
- }
-
- // beginning comment
- writePSFmt("%%BeginResource: font {0:t}\n", psName);
- embFontList->append("%%+ font ");
- embFontList->append(psName->getCString());
- embFontList->append("\n");
-
- // font dictionary
- writePS("8 dict begin\n");
- writePS("/FontType 3 def\n");
- m = font->getFontMatrix();
- writePSFmt("/FontMatrix [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] def\n",
- m[0], m[1], m[2], m[3], m[4], m[5]);
- m = font->getFontBBox();
- writePSFmt("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
- m[0], m[1], m[2], m[3]);
- writePS("/Encoding 256 array def\n");
- writePS(" 0 1 255 { Encoding exch /.notdef put } for\n");
- writePS("/BuildGlyph {\n");
- writePS(" exch /CharProcs get exch\n");
- writePS(" 2 copy known not { pop /.notdef } if\n");
- writePS(" get exec\n");
- writePS("} bind def\n");
- writePS("/BuildChar {\n");
- writePS(" 1 index /Encoding get exch get\n");
- writePS(" 1 index /BuildGlyph get exec\n");
- writePS("} bind def\n");
- if ((charProcs = ((Gfx8BitFont *)font)->getCharProcs())) {
- writePSFmt("/CharProcs {0:d} dict def\n", charProcs->getLength());
- writePS("CharProcs begin\n");
- box.x1 = m[0];
- box.y1 = m[1];
- box.x2 = m[2];
- box.y2 = m[3];
- gfx = new Gfx(xref, this, resDict, &box, NULL);
- inType3Char = gTrue;
- for (i = 0; i < charProcs->getLength(); ++i) {
- t3Cacheable = gFalse;
- t3NeedsRestore = gFalse;
- writePS("/");
- writePSName(charProcs->getKey(i));
- writePS(" {\n");
- gfx->display(charProcs->getVal(i, &charProc));
- charProc.free();
- if (t3String) {
- if (t3Cacheable) {
- buf = GString::format("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} setcachedevice\n",
- t3WX, t3WY, t3LLX, t3LLY, t3URX, t3URY);
- } else {
- buf = GString::format("{0:.4g} {1:.4g} setcharwidth\n", t3WX, t3WY);
- }
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- (*outputFunc)(outputStream, t3String->getCString(),
- t3String->getLength());
- delete t3String;
- t3String = NULL;
- }
- if (t3NeedsRestore) {
- (*outputFunc)(outputStream, "Q\n", 2);
- }
- writePS("} def\n");
- }
- inType3Char = gFalse;
- delete gfx;
- writePS("end\n");
- }
- writePS("currentdict end\n");
- writePSFmt("/{0:t} exch definefont pop\n", psName);
-
- // ending comment
- writePS("%%EndResource\n");
-}
-
-void PSOutputDev::setupImages(Dict *resDict) {
- Object xObjDict, xObj, xObjRef, subtypeObj;
- int i;
-
- if (!(mode == psModeForm || inType3Char || preload)) {
- return;
- }
-
- resDict->lookup("XObject", &xObjDict);
- if (xObjDict.isDict()) {
- for (i = 0; i < xObjDict.dictGetLength(); ++i) {
- xObjDict.dictGetValNF(i, &xObjRef);
- xObjDict.dictGetVal(i, &xObj);
- if (xObj.isStream()) {
- xObj.streamGetDict()->lookup("Subtype", &subtypeObj);
- if (subtypeObj.isName("Image")) {
- if (xObjRef.isRef()) {
- setupImage(xObjRef.getRef(), xObj.getStream());
- } else {
- error(-1, "Image in resource dict is not an indirect reference");
- }
- }
- subtypeObj.free();
- }
- xObj.free();
- xObjRef.free();
- }
- }
- xObjDict.free();
-}
-
-void PSOutputDev::setupImage(Ref id, Stream *str) {
- GBool useRLE, useCompressed, useASCIIHex;
- GString *s;
- int c;
- int size, line, col, i;
-
- // check if image is already setup
- for (i = 0; i < imgIDLen; ++i) {
- if (imgIDs[i].num == id.num && imgIDs[i].gen == id.gen) {
- return;
- }
- }
-
- // add entry to imgIDs list
- if (imgIDLen >= imgIDSize) {
- if (imgIDSize == 0) {
- imgIDSize = 64;
- } else {
- imgIDSize *= 2;
- }
- imgIDs = (Ref *)greallocn(imgIDs, imgIDSize, sizeof(Ref));
- }
- imgIDs[imgIDLen++] = id;
-
- // filters
- //~ this does not correctly handle the DeviceN color space
- //~ -- need to use DeviceNRecoder
- if (level < psLevel2) {
- useRLE = gFalse;
- useCompressed = gFalse;
- useASCIIHex = gTrue;
- } else {
- s = str->getPSFilter(level < psLevel3 ? 2 : 3, "");
- if (s) {
- useRLE = gFalse;
- useCompressed = gTrue;
- delete s;
- } else {
- useRLE = gTrue;
- useCompressed = gFalse;
- }
- useASCIIHex = level == psLevel1 || level == psLevel1Sep ||
- globalParams->getPSASCIIHex();
- }
- if (useCompressed) {
- str = str->getUndecodedStream();
- }
- if (useRLE) {
- str = new RunLengthEncoder(str);
- }
- if (useASCIIHex) {
- str = new ASCIIHexEncoder(str);
- } else {
- str = new ASCII85Encoder(str);
- }
-
- // compute image data size
- str->reset();
- col = size = 0;
- do {
- do {
- c = str->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- if (c == 'z') {
- ++col;
- } else {
- ++col;
- for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
- do {
- c = str->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- ++col;
- }
- }
- if (col > 225) {
- ++size;
- col = 0;
- }
- } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
- // add one entry for the final line of data; add another entry
- // because the RunLengthDecode filter may read past the end
- ++size;
- if (useRLE) {
- ++size;
- }
- writePSFmt("{0:d} array dup /ImData_{1:d}_{2:d} exch def\n",
- size, id.num, id.gen);
- str->close();
-
- // write the data into the array
- str->reset();
- line = col = 0;
- writePS((char *)(useASCIIHex ? "dup 0 <" : "dup 0 <~"));
- do {
- do {
- c = str->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- if (c == 'z') {
- writePSChar(c);
- ++col;
- } else {
- writePSChar(c);
- ++col;
- for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
- do {
- c = str->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- writePSChar(c);
- ++col;
- }
- }
- // each line is: "dup nnnnn <~...data...~> put<eol>"
- // so max data length = 255 - 20 = 235
- // chunks are 1 or 4 bytes each, so we have to stop at 232
- // but make it 225 just to be safe
- if (col > 225) {
- writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
- ++line;
- writePSFmt((char *)(useASCIIHex ? "dup {0:d} <" : "dup {0:d} <~"), line);
- col = 0;
- }
- } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
- writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
- if (useRLE) {
- ++line;
- writePSFmt("{0:d} <> put\n", line);
- } else {
- writePS("pop\n");
- }
- str->close();
-
- delete str;
-}
-
-void PSOutputDev::setupForms(Dict *resDict) {
- Object xObjDict, xObj, xObjRef, subtypeObj;
- int i;
-
- if (!preload) {
- return;
- }
-
- resDict->lookup("XObject", &xObjDict);
- if (xObjDict.isDict()) {
- for (i = 0; i < xObjDict.dictGetLength(); ++i) {
- xObjDict.dictGetValNF(i, &xObjRef);
- xObjDict.dictGetVal(i, &xObj);
- if (xObj.isStream()) {
- xObj.streamGetDict()->lookup("Subtype", &subtypeObj);
- if (subtypeObj.isName("Form")) {
- if (xObjRef.isRef()) {
- setupForm(xObjRef.getRef(), &xObj);
- } else {
- error(-1, "Form in resource dict is not an indirect reference");
- }
- }
- subtypeObj.free();
- }
- xObj.free();
- xObjRef.free();
- }
- }
- xObjDict.free();
-}
-
-void PSOutputDev::setupForm(Ref id, Object *strObj) {
- Dict *dict, *resDict;
- Object matrixObj, bboxObj, resObj, obj1;
- double m[6], bbox[4];
- PDFRectangle box;
- Gfx *gfx;
- int i;
-
- // check if form is already defined
- for (i = 0; i < formIDLen; ++i) {
- if (formIDs[i].num == id.num && formIDs[i].gen == id.gen) {
- return;
- }
- }
-
- // add entry to formIDs list
- if (formIDLen >= formIDSize) {
- if (formIDSize == 0) {
- formIDSize = 64;
- } else {
- formIDSize *= 2;
- }
- formIDs = (Ref *)greallocn(formIDs, formIDSize, sizeof(Ref));
- }
- formIDs[formIDLen++] = id;
-
- dict = strObj->streamGetDict();
-
- // get bounding box
- dict->lookup("BBox", &bboxObj);
- if (!bboxObj.isArray()) {
- bboxObj.free();
- error(-1, "Bad form bounding box");
- return;
- }
- for (i = 0; i < 4; ++i) {
- bboxObj.arrayGet(i, &obj1);
- bbox[i] = obj1.getNum();
- obj1.free();
- }
- bboxObj.free();
-
- // get matrix
- dict->lookup("Matrix", &matrixObj);
- if (matrixObj.isArray()) {
- for (i = 0; i < 6; ++i) {
- matrixObj.arrayGet(i, &obj1);
- m[i] = obj1.getNum();
- obj1.free();
- }
- } else {
- m[0] = 1; m[1] = 0;
- m[2] = 0; m[3] = 1;
- m[4] = 0; m[5] = 0;
- }
- matrixObj.free();
-
- // get resources
- dict->lookup("Resources", &resObj);
- resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
-
- writePSFmt("/f_{0:d}_{1:d} {{\n", id.num, id.gen);
- writePS("q\n");
- writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] cm\n",
- m[0], m[1], m[2], m[3], m[4], m[5]);
-
- box.x1 = bbox[0];
- box.y1 = bbox[1];
- box.x2 = bbox[2];
- box.y2 = bbox[3];
- gfx = new Gfx(xref, this, resDict, &box, &box);
- gfx->display(strObj);
- delete gfx;
-
- writePS("Q\n");
- writePS("} def\n");
-
- resObj.free();
-}
-
-GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
- int rotateA, GBool useMediaBox, GBool crop,
- int sliceX, int sliceY,
- int sliceW, int sliceH,
- GBool printing, Catalog *catalog,
- GBool (*abortCheckCbk)(void *data),
- void *abortCheckCbkData) {
-#if HAVE_SPLASH
- PreScanOutputDev *scan;
- GBool rasterize;
- SplashOutputDev *splashOut;
- SplashColor paperColor;
- PDFRectangle box;
- GfxState *state;
- SplashBitmap *bitmap;
- Stream *str0, *str;
- Object obj;
- Guchar *p;
- Guchar col[4];
- double m0, m1, m2, m3, m4, m5;
- int c, w, h, x, y, comp, i;
-
- if (!forceRasterize) {
- scan = new PreScanOutputDev();
- page->displaySlice(scan, 72, 72, rotateA, useMediaBox, crop,
- sliceX, sliceY, sliceW, sliceH,
- printing, catalog, abortCheckCbk, abortCheckCbkData);
- rasterize = scan->usesTransparency();
- delete scan;
- } else {
- rasterize = true;
- }
- if (!rasterize) {
- return gTrue;
- }
-
- // rasterize the page
- if (level == psLevel1) {
- paperColor[0] = 0xff;
- splashOut = new SplashOutputDev(splashModeMono8, 1, gFalse,
- paperColor, gTrue, gFalse);
-#if SPLASH_CMYK
- } else if (level == psLevel1Sep) {
- paperColor[0] = paperColor[1] = paperColor[2] = paperColor[3] = 0;
- splashOut = new SplashOutputDev(splashModeCMYK8, 1, gFalse,
- paperColor, gTrue, gFalse);
-#endif
- } else {
- paperColor[0] = paperColor[1] = paperColor[2] = 0xff;
- splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse,
- paperColor, gTrue, gFalse);
- }
- splashOut->startDoc(xref);
- page->displaySlice(splashOut, splashDPI, splashDPI, rotateA,
- useMediaBox, crop,
- sliceX, sliceY, sliceW, sliceH,
- printing, catalog, abortCheckCbk, abortCheckCbkData);
-
- // start the PS page
- page->makeBox(splashDPI, splashDPI, rotateA, useMediaBox, gFalse,
- sliceX, sliceY, sliceW, sliceH, &box, &crop);
- rotateA += page->getRotate();
- if (rotateA >= 360) {
- rotateA -= 360;
- } else if (rotateA < 0) {
- rotateA += 360;
- }
- state = new GfxState(splashDPI, splashDPI, &box, rotateA, gFalse);
- startPage(page->getNum(), state);
- delete state;
- switch (rotateA) {
- case 0:
- default: // this should never happen
- m0 = box.x2 - box.x1;
- m1 = 0;
- m2 = 0;
- m3 = box.y2 - box.y1;
- m4 = box.x1;
- m5 = box.y1;
- break;
- case 90:
- m0 = 0;
- m1 = box.y2 - box.y1;
- m2 = -(box.x2 - box.x1);
- m3 = 0;
- m4 = box.x2;
- m5 = box.y1;
- break;
- case 180:
- m0 = -(box.x2 - box.x1);
- m1 = 0;
- m2 = 0;
- m3 = -(box.y2 - box.y1);
- m4 = box.x2;
- m5 = box.y2;
- break;
- case 270:
- m0 = 0;
- m1 = -(box.y2 - box.y1);
- m2 = box.x2 - box.x1;
- m3 = 0;
- m4 = box.x1;
- m5 = box.y2;
- break;
- }
-
- //~ need to add the process colors
-
- // draw the rasterized image
- bitmap = splashOut->getBitmap();
- w = bitmap->getWidth();
- h = bitmap->getHeight();
- writePS("gsave\n");
- writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] concat\n",
- m0, m1, m2, m3, m4, m5);
- switch (level) {
- case psLevel1:
- writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1\n",
- w, h, w, -h, h);
- p = bitmap->getDataPtr();
- i = 0;
- for (y = 0; y < h; ++y) {
- for (x = 0; x < w; ++x) {
- writePSFmt("{0:02x}", *p++);
- if (++i == 32) {
- writePSChar('\n');
- i = 0;
- }
- }
- }
- if (i != 0) {
- writePSChar('\n');
- }
- break;
- case psLevel1Sep:
- writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1Sep\n",
- w, h, w, -h, h);
- p = bitmap->getDataPtr();
- i = 0;
- col[0] = col[1] = col[2] = col[3] = 0;
- for (y = 0; y < h; ++y) {
- for (comp = 0; comp < 4; ++comp) {
- for (x = 0; x < w; ++x) {
- writePSFmt("{0:02x}", p[4*x + comp]);
- col[comp] |= p[4*x + comp];
- if (++i == 32) {
- writePSChar('\n');
- i = 0;
- }
- }
- }
- p += bitmap->getRowSize();
- }
- if (i != 0) {
- writePSChar('\n');
- }
- if (col[0]) {
- processColors |= psProcessCyan;
- }
- if (col[1]) {
- processColors |= psProcessMagenta;
- }
- if (col[2]) {
- processColors |= psProcessYellow;
- }
- if (col[3]) {
- processColors |= psProcessBlack;
- }
- break;
- case psLevel2:
- case psLevel2Sep:
- case psLevel3:
- case psLevel3Sep:
- writePS("/DeviceRGB setcolorspace\n");
- writePS("<<\n /ImageType 1\n");
- writePSFmt(" /Width {0:d}\n", bitmap->getWidth());
- writePSFmt(" /Height {0:d}\n", bitmap->getHeight());
- writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n", w, -h, h);
- writePS(" /BitsPerComponent 8\n");
- writePS(" /Decode [0 1 0 1 0 1]\n");
- writePS(" /DataSource currentfile\n");
- if (globalParams->getPSASCIIHex()) {
- writePS(" /ASCIIHexDecode filter\n");
- } else {
- writePS(" /ASCII85Decode filter\n");
- }
- writePS(" /RunLengthDecode filter\n");
- writePS(">>\n");
- writePS("image\n");
- obj.initNull();
- str0 = new MemStream((char *)bitmap->getDataPtr(), 0, w * h * 3, &obj);
- str = new RunLengthEncoder(str0);
- if (globalParams->getPSASCIIHex()) {
- str = new ASCIIHexEncoder(str);
- } else {
- str = new ASCII85Encoder(str);
- }
- str->reset();
- while ((c = str->getChar()) != EOF) {
- writePSChar(c);
- }
- str->close();
- delete str;
- delete str0;
- processColors |= psProcessCMYK;
- break;
- }
- delete splashOut;
- writePS("grestore\n");
-
- // finish the PS page
- endPage();
-
- return gFalse;
-#else
- return gTrue;
-#endif
-}
-
-void PSOutputDev::startPage(int pageNum, GfxState *state) {
- int x1, y1, x2, y2, width, height;
- int imgWidth, imgHeight, imgWidth2, imgHeight2;
- GBool landscape;
-
-
- if (mode == psModePS) {
- writePSFmt("%%Page: {0:d} {1:d}\n", pageNum, seqPage);
- writePS("%%BeginPageSetup\n");
- }
-
- // underlays
- if (underlayCbk) {
- (*underlayCbk)(this, underlayCbkData);
- }
- if (overlayCbk) {
- saveState(NULL);
- }
-
- switch (mode) {
-
- case psModePS:
- // rotate, translate, and scale page
- imgWidth = imgURX - imgLLX;
- imgHeight = imgURY - imgLLY;
- x1 = (int)floor(state->getX1());
- y1 = (int)floor(state->getY1());
- x2 = (int)ceil(state->getX2());
- y2 = (int)ceil(state->getY2());
- width = x2 - x1;
- height = y2 - y1;
- tx = ty = 0;
- // rotation and portrait/landscape mode
- if (rotate0 >= 0) {
- rotate = (360 - rotate0) % 360;
- landscape = gFalse;
- } else {
- rotate = (360 - state->getRotate()) % 360;
- if (rotate == 0 || rotate == 180) {
- if (width > height && width > imgWidth) {
- rotate += 90;
- landscape = gTrue;
- } else {
- landscape = gFalse;
- }
- } else { // rotate == 90 || rotate == 270
- if (height > width && height > imgWidth) {
- rotate = 270 - rotate;
- landscape = gTrue;
- } else {
- landscape = gFalse;
- }
- }
- }
- writePSFmt("%%PageOrientation: {0:s}\n",
- landscape ? "Landscape" : "Portrait");
- writePS("pdfStartPage\n");
- if (rotate == 0) {
- imgWidth2 = imgWidth;
- imgHeight2 = imgHeight;
- } else if (rotate == 90) {
- writePS("90 rotate\n");
- ty = -imgWidth;
- imgWidth2 = imgHeight;
- imgHeight2 = imgWidth;
- } else if (rotate == 180) {
- writePS("180 rotate\n");
- imgWidth2 = imgWidth;
- imgHeight2 = imgHeight;
- tx = -imgWidth;
- ty = -imgHeight;
- } else { // rotate == 270
- writePS("270 rotate\n");
- tx = -imgHeight;
- imgWidth2 = imgHeight;
- imgHeight2 = imgWidth;
- }
- // shrink or expand
- if (xScale0 > 0 && yScale0 > 0) {
- xScale = xScale0;
- yScale = yScale0;
- } else if ((globalParams->getPSShrinkLarger() &&
- (width > imgWidth2 || height > imgHeight2)) ||
- (globalParams->getPSExpandSmaller() &&
- (width < imgWidth2 && height < imgHeight2))) {
- xScale = (double)imgWidth2 / (double)width;
- yScale = (double)imgHeight2 / (double)height;
- if (yScale < xScale) {
- xScale = yScale;
- } else {
- yScale = xScale;
- }
- } else {
- xScale = yScale = 1;
- }
- // deal with odd bounding boxes or clipping
- if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) {
- tx -= xScale * clipLLX0;
- ty -= yScale * clipLLY0;
- } else {
- tx -= xScale * x1;
- ty -= yScale * y1;
- }
- // center
- if (tx0 >= 0 && ty0 >= 0) {
- tx += rotate == 0 ? tx0 : ty0;
- ty += rotate == 0 ? ty0 : -tx0;
- } else if (globalParams->getPSCenter()) {
- if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) {
- tx += (imgWidth2 - xScale * (clipURX0 - clipLLX0)) / 2;
- ty += (imgHeight2 - yScale * (clipURY0 - clipLLY0)) / 2;
- } else {
- tx += (imgWidth2 - xScale * width) / 2;
- ty += (imgHeight2 - yScale * height) / 2;
- }
- }
- tx += rotate == 0 ? imgLLX : imgLLY;
- ty += rotate == 0 ? imgLLY : -imgLLX;
- if (tx != 0 || ty != 0) {
- writePSFmt("{0:.4g} {1:.4g} translate\n", tx, ty);
- }
- if (xScale != 1 || yScale != 1) {
- writePSFmt("{0:.4f} {1:.4f} scale\n", xScale, yScale);
- }
- if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) {
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re W\n",
- clipLLX0, clipLLY0, clipURX0 - clipLLX0, clipURY0 - clipLLY0);
- } else {
- writePSFmt("{0:d} {1:d} {2:d} {3:d} re W\n", x1, y1, x2 - x1, y2 - y1);
- }
-
- writePS("%%EndPageSetup\n");
- ++seqPage;
- break;
-
- case psModeEPS:
- writePS("pdfStartPage\n");
- tx = ty = 0;
- rotate = (360 - state->getRotate()) % 360;
- if (rotate == 0) {
- } else if (rotate == 90) {
- writePS("90 rotate\n");
- tx = -epsX1;
- ty = -epsY2;
- } else if (rotate == 180) {
- writePS("180 rotate\n");
- tx = -(epsX1 + epsX2);
- ty = -(epsY1 + epsY2);
- } else { // rotate == 270
- writePS("270 rotate\n");
- tx = -epsX2;
- ty = -epsY1;
- }
- if (tx != 0 || ty != 0) {
- writePSFmt("{0:.4g} {1:.4g} translate\n", tx, ty);
- }
- xScale = yScale = 1;
- break;
-
- case psModeForm:
- writePS("/PaintProc {\n");
- writePS("begin xpdf begin\n");
- writePS("pdfStartPage\n");
- tx = ty = 0;
- xScale = yScale = 1;
- rotate = 0;
- break;
- }
-}
-
-void PSOutputDev::endPage() {
- if (overlayCbk) {
- restoreState(NULL);
- (*overlayCbk)(this, overlayCbkData);
- }
-
-
- if (mode == psModeForm) {
- writePS("pdfEndPage\n");
- writePS("end end\n");
- writePS("} def\n");
- writePS("end end\n");
- } else {
- if (!manualCtrl) {
- writePS("showpage\n");
- }
- writePS("%%PageTrailer\n");
- writePageTrailer();
- }
-}
-
-void PSOutputDev::saveState(GfxState * /*state*/) {
- writePS("q\n");
- ++numSaves;
-}
-
-void PSOutputDev::restoreState(GfxState * /*state*/) {
- writePS("Q\n");
- --numSaves;
-}
-
-void PSOutputDev::updateCTM(GfxState * /*state*/, double m11, double m12,
- double m21, double m22, double m31, double m32) {
- writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] cm\n",
- m11, m12, m21, m22, m31, m32);
-}
-
-void PSOutputDev::updateLineDash(GfxState *state) {
- double *dash;
- double start;
- int length, i;
-
- state->getLineDash(&dash, &length, &start);
- writePS("[");
- for (i = 0; i < length; ++i) {
- writePSFmt("{0:.4g}{1:w}",
- dash[i] < 0 ? 0 : dash[i],
- (i == length-1) ? 0 : 1);
- }
- writePSFmt("] {0:.4g} d\n", start);
-}
-
-void PSOutputDev::updateFlatness(GfxState *state) {
- writePSFmt("{0:d} i\n", state->getFlatness());
-}
-
-void PSOutputDev::updateLineJoin(GfxState *state) {
- writePSFmt("{0:d} j\n", state->getLineJoin());
-}
-
-void PSOutputDev::updateLineCap(GfxState *state) {
- writePSFmt("{0:d} J\n", state->getLineCap());
-}
-
-void PSOutputDev::updateMiterLimit(GfxState *state) {
- writePSFmt("{0:.4g} M\n", state->getMiterLimit());
-}
-
-void PSOutputDev::updateLineWidth(GfxState *state) {
- writePSFmt("{0:.4g} w\n", state->getLineWidth());
-}
-
-void PSOutputDev::updateFillColorSpace(GfxState *state) {
- switch (level) {
- case psLevel1:
- case psLevel1Sep:
- break;
- case psLevel2:
- case psLevel3:
- if (state->getFillColorSpace()->getMode() != csPattern) {
- dumpColorSpaceL2(state->getFillColorSpace(), gTrue, gFalse, gFalse);
- writePS(" cs\n");
- }
- break;
- case psLevel2Sep:
- case psLevel3Sep:
- break;
- }
-}
-
-void PSOutputDev::updateStrokeColorSpace(GfxState *state) {
- switch (level) {
- case psLevel1:
- case psLevel1Sep:
- break;
- case psLevel2:
- case psLevel3:
- if (state->getStrokeColorSpace()->getMode() != csPattern) {
- dumpColorSpaceL2(state->getStrokeColorSpace(), gTrue, gFalse, gFalse);
- writePS(" CS\n");
- }
- break;
- case psLevel2Sep:
- case psLevel3Sep:
- break;
- }
-}
-
-void PSOutputDev::updateFillColor(GfxState *state) {
- GfxColor color;
- GfxColor *colorPtr;
- GfxGray gray;
- GfxCMYK cmyk;
- GfxSeparationColorSpace *sepCS;
- double c, m, y, k;
- int i;
-
- switch (level) {
- case psLevel1:
- state->getFillGray(&gray);
- writePSFmt("{0:.4g} g\n", colToDbl(gray));
- break;
- case psLevel1Sep:
- state->getFillCMYK(&cmyk);
- c = colToDbl(cmyk.c);
- m = colToDbl(cmyk.m);
- y = colToDbl(cmyk.y);
- k = colToDbl(cmyk.k);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} k\n", c, m, y, k);
- addProcessColor(c, m, y, k);
- break;
- case psLevel2:
- case psLevel3:
- if (state->getFillColorSpace()->getMode() != csPattern) {
- colorPtr = state->getFillColor();
- writePS("[");
- for (i = 0; i < state->getFillColorSpace()->getNComps(); ++i) {
- if (i > 0) {
- writePS(" ");
- }
- writePSFmt("{0:.4g}", colToDbl(colorPtr->c[i]));
- }
- writePS("] sc\n");
- }
- break;
- case psLevel2Sep:
- case psLevel3Sep:
- if (state->getFillColorSpace()->getMode() == csSeparation) {
- sepCS = (GfxSeparationColorSpace *)state->getFillColorSpace();
- color.c[0] = gfxColorComp1;
- sepCS->getCMYK(&color, &cmyk);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} ({5:t}) ck\n",
- colToDbl(state->getFillColor()->c[0]),
- colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k),
- sepCS->getName());
- addCustomColor(sepCS);
- } else {
- state->getFillCMYK(&cmyk);
- c = colToDbl(cmyk.c);
- m = colToDbl(cmyk.m);
- y = colToDbl(cmyk.y);
- k = colToDbl(cmyk.k);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} k\n", c, m, y, k);
- addProcessColor(c, m, y, k);
- }
- break;
- }
- t3Cacheable = gFalse;
-}
-
-void PSOutputDev::updateStrokeColor(GfxState *state) {
- GfxColor color;
- GfxColor *colorPtr;
- GfxGray gray;
- GfxCMYK cmyk;
- GfxSeparationColorSpace *sepCS;
- double c, m, y, k;
- int i;
-
- switch (level) {
- case psLevel1:
- state->getStrokeGray(&gray);
- writePSFmt("{0:.4g} G\n", colToDbl(gray));
- break;
- case psLevel1Sep:
- state->getStrokeCMYK(&cmyk);
- c = colToDbl(cmyk.c);
- m = colToDbl(cmyk.m);
- y = colToDbl(cmyk.y);
- k = colToDbl(cmyk.k);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} K\n", c, m, y, k);
- addProcessColor(c, m, y, k);
- break;
- case psLevel2:
- case psLevel3:
- if (state->getStrokeColorSpace()->getMode() != csPattern) {
- colorPtr = state->getStrokeColor();
- writePS("[");
- for (i = 0; i < state->getStrokeColorSpace()->getNComps(); ++i) {
- if (i > 0) {
- writePS(" ");
- }
- writePSFmt("{0:.4g}", colToDbl(colorPtr->c[i]));
- }
- writePS("] SC\n");
- }
- break;
- case psLevel2Sep:
- case psLevel3Sep:
- if (state->getStrokeColorSpace()->getMode() == csSeparation) {
- sepCS = (GfxSeparationColorSpace *)state->getStrokeColorSpace();
- color.c[0] = gfxColorComp1;
- sepCS->getCMYK(&color, &cmyk);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} ({5:t}) CK\n",
- colToDbl(state->getStrokeColor()->c[0]),
- colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k),
- sepCS->getName());
- addCustomColor(sepCS);
- } else {
- state->getStrokeCMYK(&cmyk);
- c = colToDbl(cmyk.c);
- m = colToDbl(cmyk.m);
- y = colToDbl(cmyk.y);
- k = colToDbl(cmyk.k);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} K\n", c, m, y, k);
- addProcessColor(c, m, y, k);
- }
- break;
- }
- t3Cacheable = gFalse;
-}
-
-void PSOutputDev::addProcessColor(double c, double m, double y, double k) {
- if (c > 0) {
- processColors |= psProcessCyan;
- }
- if (m > 0) {
- processColors |= psProcessMagenta;
- }
- if (y > 0) {
- processColors |= psProcessYellow;
- }
- if (k > 0) {
- processColors |= psProcessBlack;
- }
-}
-
-void PSOutputDev::addCustomColor(GfxSeparationColorSpace *sepCS) {
- PSOutCustomColor *cc;
- GfxColor color;
- GfxCMYK cmyk;
-
- for (cc = customColors; cc; cc = cc->next) {
- if (!cc->name->cmp(sepCS->getName())) {
- return;
- }
- }
- color.c[0] = gfxColorComp1;
- sepCS->getCMYK(&color, &cmyk);
- cc = new PSOutCustomColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k),
- sepCS->getName()->copy());
- cc->next = customColors;
- customColors = cc;
-}
-
-void PSOutputDev::updateFillOverprint(GfxState *state) {
- if (level >= psLevel2) {
- writePSFmt("{0:s} op\n", state->getFillOverprint() ? "true" : "false");
- }
-}
-
-void PSOutputDev::updateStrokeOverprint(GfxState *state) {
- if (level >= psLevel2) {
- writePSFmt("{0:s} OP\n", state->getStrokeOverprint() ? "true" : "false");
- }
-}
-
-void PSOutputDev::updateTransfer(GfxState *state) {
- Function **funcs;
- int i;
-
- funcs = state->getTransfer();
- if (funcs[0] && funcs[1] && funcs[2] && funcs[3]) {
- if (level >= psLevel2) {
- for (i = 0; i < 4; ++i) {
- cvtFunction(funcs[i]);
- }
- writePS("setcolortransfer\n");
- } else {
- cvtFunction(funcs[3]);
- writePS("settransfer\n");
- }
- } else if (funcs[0]) {
- cvtFunction(funcs[0]);
- writePS("settransfer\n");
- } else {
- writePS("{} settransfer\n");
- }
-}
-
-void PSOutputDev::updateFont(GfxState *state) {
- if (state->getFont()) {
- writePSFmt("/F{0:d}_{1:d} {2:.4g} Tf\n",
- state->getFont()->getID()->num, state->getFont()->getID()->gen,
- fabs(state->getFontSize()) < 0.00001 ? 0.00001
- : state->getFontSize());
- }
-}
-
-void PSOutputDev::updateTextMat(GfxState *state) {
- double *mat;
-
- mat = state->getTextMat();
- if (fabs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.00001) {
- // avoid a singular (or close-to-singular) matrix
- writePSFmt("[0.00001 0 0 0.00001 {0:.4g} {1:.4g}] Tm\n", mat[4], mat[5]);
- } else {
- writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] Tm\n",
- mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
- }
-}
-
-void PSOutputDev::updateCharSpace(GfxState *state) {
- writePSFmt("{0:.4g} Tc\n", state->getCharSpace());
-}
-
-void PSOutputDev::updateRender(GfxState *state) {
- int rm;
-
- rm = state->getRender();
- writePSFmt("{0:d} Tr\n", rm);
- rm &= 3;
- if (rm != 0 && rm != 3) {
- t3Cacheable = gFalse;
- }
-}
-
-void PSOutputDev::updateRise(GfxState *state) {
- writePSFmt("{0:.4g} Ts\n", state->getRise());
-}
-
-void PSOutputDev::updateWordSpace(GfxState *state) {
- writePSFmt("{0:.4g} Tw\n", state->getWordSpace());
-}
-
-void PSOutputDev::updateHorizScaling(GfxState *state) {
- double h;
-
- h = state->getHorizScaling();
- if (fabs(h) < 0.01) {
- h = 0.01;
- }
- writePSFmt("{0:.4g} Tz\n", h);
-}
-
-void PSOutputDev::updateTextPos(GfxState *state) {
- writePSFmt("{0:.4g} {1:.4g} Td\n", state->getLineX(), state->getLineY());
-}
-
-void PSOutputDev::updateTextShift(GfxState *state, double shift) {
- if (state->getFont()->getWMode()) {
- writePSFmt("{0:.4g} TJmV\n", shift);
- } else {
- writePSFmt("{0:.4g} TJm\n", shift);
- }
-}
-
-void PSOutputDev::stroke(GfxState *state) {
- doPath(state->getPath());
- if (t3String) {
- // if we're construct a cacheable Type 3 glyph, we need to do
- // everything in the fill color
- writePS("Sf\n");
- } else {
- writePS("S\n");
- }
-}
-
-void PSOutputDev::fill(GfxState *state) {
- doPath(state->getPath());
- writePS("f\n");
-}
-
-void PSOutputDev::eoFill(GfxState *state) {
- doPath(state->getPath());
- writePS("f*\n");
-}
-
-void PSOutputDev::tilingPatternFill(GfxState * /*state*/, Object *str,
- int paintType, Dict *resDict,
- double *mat, double *bbox,
- int x0, int y0, int x1, int y1,
- double xStep, double yStep) {
- PDFRectangle box;
- Gfx *gfx;
-
- // define a Type 3 font
- writePS("8 dict begin\n");
- writePS("/FontType 3 def\n");
- writePS("/FontMatrix [1 0 0 1 0 0] def\n");
- writePSFmt("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
- bbox[0], bbox[1], bbox[2], bbox[3]);
- writePS("/Encoding 256 array def\n");
- writePS(" 0 1 255 { Encoding exch /.notdef put } for\n");
- writePS(" Encoding 120 /x put\n");
- writePS("/BuildGlyph {\n");
- writePS(" exch /CharProcs get exch\n");
- writePS(" 2 copy known not { pop /.notdef } if\n");
- writePS(" get exec\n");
- writePS("} bind def\n");
- writePS("/BuildChar {\n");
- writePS(" 1 index /Encoding get exch get\n");
- writePS(" 1 index /BuildGlyph get exec\n");
- writePS("} bind def\n");
- writePS("/CharProcs 1 dict def\n");
- writePS("CharProcs begin\n");
- box.x1 = bbox[0];
- box.y1 = bbox[1];
- box.x2 = bbox[2];
- box.y2 = bbox[3];
- gfx = new Gfx(xref, this, resDict, &box, NULL);
- writePS("/x {\n");
- if (paintType == 2) {
- writePSFmt("{0:.4g} 0 {1:.4g} {2:.4g} {3:.4g} {4:.4g} setcachedevice\n",
- xStep, bbox[0], bbox[1], bbox[2], bbox[3]);
- } else {
- if (x1 - 1 <= x0) {
- writePS("1 0 setcharwidth\n");
- } else {
- writePSFmt("{0:.4g} 0 setcharwidth\n", xStep);
- }
- }
- inType3Char = gTrue;
- ++numTilingPatterns;
- gfx->display(str);
- --numTilingPatterns;
- inType3Char = gFalse;
- writePS("} def\n");
- delete gfx;
- writePS("end\n");
- writePS("currentdict end\n");
- writePSFmt("/xpdfTile{0:d} exch definefont pop\n", numTilingPatterns);
-
- // draw the tiles
- writePSFmt("/xpdfTile{0:d} findfont setfont\n", numTilingPatterns);
- writePSFmt("gsave [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] concat\n",
- mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
- writePSFmt("{0:d} 1 {1:d} {{ {2:.4g} exch {3:.4g} mul m {4:d} 1 {5:d} {{ pop (x) show }} for }} for\n",
- y0, y1 - 1, x0 * xStep, yStep, x0, x1 - 1);
- writePS("grestore\n");
-}
-
-GBool PSOutputDev::functionShadedFill(GfxState * /*state*/,
- GfxFunctionShading *shading) {
- double x0, y0, x1, y1;
- double *mat;
- int i;
-
- if (level == psLevel2Sep || level == psLevel3Sep) {
- if (shading->getColorSpace()->getMode() != csDeviceCMYK) {
- return gFalse;
- }
- processColors |= psProcessCMYK;
- }
-
- shading->getDomain(&x0, &y0, &x1, &y1);
- mat = shading->getMatrix();
- writePSFmt("/mat [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] def\n",
- mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
- writePSFmt("/n {0:d} def\n", shading->getColorSpace()->getNComps());
- if (shading->getNFuncs() == 1) {
- writePS("/func ");
- cvtFunction(shading->getFunc(0));
- writePS("def\n");
- } else {
- writePS("/func {\n");
- for (i = 0; i < shading->getNFuncs(); ++i) {
- if (i < shading->getNFuncs() - 1) {
- writePS("2 copy\n");
- }
- cvtFunction(shading->getFunc(i));
- writePS("exec\n");
- if (i < shading->getNFuncs() - 1) {
- writePS("3 1 roll\n");
- }
- }
- writePS("} def\n");
- }
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} 0 funcSH\n", x0, y0, x1, y1);
-
- return gTrue;
-}
-
-GBool PSOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading) {
- double xMin, yMin, xMax, yMax;
- double x0, y0, x1, y1, dx, dy, mul;
- double tMin, tMax, t, t0, t1;
- int i;
-
- if (level == psLevel2Sep || level == psLevel3Sep) {
- if (shading->getColorSpace()->getMode() != csDeviceCMYK) {
- return gFalse;
- }
- processColors |= psProcessCMYK;
- }
-
- // get the clip region bbox
- state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
-
- // compute min and max t values, based on the four corners of the
- // clip region bbox
- shading->getCoords(&x0, &y0, &x1, &y1);
- dx = x1 - x0;
- dy = y1 - y0;
- if (fabs(dx) < 0.01 && fabs(dy) < 0.01) {
- return gTrue;
- } else {
- mul = 1 / (dx * dx + dy * dy);
- tMin = tMax = ((xMin - x0) * dx + (yMin - y0) * dy) * mul;
- t = ((xMin - x0) * dx + (yMax - y0) * dy) * mul;
- if (t < tMin) {
- tMin = t;
- } else if (t > tMax) {
- tMax = t;
- }
- t = ((xMax - x0) * dx + (yMin - y0) * dy) * mul;
- if (t < tMin) {
- tMin = t;
- } else if (t > tMax) {
- tMax = t;
- }
- t = ((xMax - x0) * dx + (yMax - y0) * dy) * mul;
- if (t < tMin) {
- tMin = t;
- } else if (t > tMax) {
- tMax = t;
- }
- if (tMin < 0 && !shading->getExtend0()) {
- tMin = 0;
- }
- if (tMax > 1 && !shading->getExtend1()) {
- tMax = 1;
- }
- }
-
- // get the function domain
- t0 = shading->getDomain0();
- t1 = shading->getDomain1();
-
- // generate the PS code
- writePSFmt("/t0 {0:.4g} def\n", t0);
- writePSFmt("/t1 {0:.4g} def\n", t1);
- writePSFmt("/dt {0:.4g} def\n", t1 - t0);
- writePSFmt("/x0 {0:.4g} def\n", x0);
- writePSFmt("/y0 {0:.4g} def\n", y0);
- writePSFmt("/dx {0:.4g} def\n", x1 - x0);
- writePSFmt("/x1 {0:.4g} def\n", x1);
- writePSFmt("/y1 {0:.4g} def\n", y1);
- writePSFmt("/dy {0:.4g} def\n", y1 - y0);
- writePSFmt("/xMin {0:.4g} def\n", xMin);
- writePSFmt("/yMin {0:.4g} def\n", yMin);
- writePSFmt("/xMax {0:.4g} def\n", xMax);
- writePSFmt("/yMax {0:.4g} def\n", yMax);
- writePSFmt("/n {0:d} def\n", shading->getColorSpace()->getNComps());
- if (shading->getNFuncs() == 1) {
- writePS("/func ");
- cvtFunction(shading->getFunc(0));
- writePS("def\n");
- } else {
- writePS("/func {\n");
- for (i = 0; i < shading->getNFuncs(); ++i) {
- if (i < shading->getNFuncs() - 1) {
- writePS("dup\n");
- }
- cvtFunction(shading->getFunc(i));
- writePS("exec\n");
- if (i < shading->getNFuncs() - 1) {
- writePS("exch\n");
- }
- }
- writePS("} def\n");
- }
- writePSFmt("{0:.4g} {1:.4g} 0 axialSH\n", tMin, tMax);
-
- return gTrue;
-}
-
-GBool PSOutputDev::radialShadedFill(GfxState *state,
- GfxRadialShading *shading) {
- double xMin, yMin, xMax, yMax;
- double x0, y0, r0, x1, y1, r1, t0, t1;
- double xa, ya, ra;
- double sz, xz, yz, sMin, sMax, sa, ta;
- double theta, alpha, a1, a2;
- GBool enclosed;
- int i;
-
- if (level == psLevel2Sep || level == psLevel3Sep) {
- if (shading->getColorSpace()->getMode() != csDeviceCMYK) {
- return gFalse;
- }
- processColors |= psProcessCMYK;
- }
-
- // get the shading info
- shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
- t0 = shading->getDomain0();
- t1 = shading->getDomain1();
-
- // Compute the point at which r(s) = 0; check for the enclosed
- // circles case; and compute the angles for the tangent lines.
- if (r0 == r1) {
- enclosed = x0 == x1 && y0 == y1;
- theta = 0;
- sz = 0; // make gcc happy
- } else {
- sz = -r0 / (r1 - r0);
- xz = x0 + sz * (x1 - x0);
- yz = y0 + sz * (y1 - y0);
- enclosed = (xz - x0) * (xz - x0) + (yz - y0) * (yz - y0) <= r0 * r0;
- theta = asin(r0 / sqrt((x0 - xz) * (x0 - xz) + (y0 - yz) * (y0 - yz)));
- if (r0 > r1) {
- theta = -theta;
- }
- }
- if (enclosed) {
- a1 = 0;
- a2 = 360;
- } else {
- alpha = atan2(y1 - y0, x1 - x0);
- a1 = (180 / M_PI) * (alpha + theta) + 90;
- a2 = (180 / M_PI) * (alpha - theta) - 90;
- while (a2 < a1) {
- a2 += 360;
- }
- }
-
- // compute the (possibly extended) s range
- state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
- if (enclosed) {
- sMin = 0;
- sMax = 1;
- } else {
- sMin = 1;
- sMax = 0;
- // solve for x(s) + r(s) = xMin
- if ((x1 + r1) - (x0 + r0) != 0) {
- sa = (xMin - (x0 + r0)) / ((x1 + r1) - (x0 + r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // solve for x(s) - r(s) = xMax
- if ((x1 - r1) - (x0 - r0) != 0) {
- sa = (xMax - (x0 - r0)) / ((x1 - r1) - (x0 - r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // solve for y(s) + r(s) = yMin
- if ((y1 + r1) - (y0 + r0) != 0) {
- sa = (yMin - (y0 + r0)) / ((y1 + r1) - (y0 + r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // solve for y(s) - r(s) = yMax
- if ((y1 - r1) - (y0 - r0) != 0) {
- sa = (yMax - (y0 - r0)) / ((y1 - r1) - (y0 - r0));
- if (sa < sMin) {
- sMin = sa;
- } else if (sa > sMax) {
- sMax = sa;
- }
- }
- // check against sz
- if (r0 < r1) {
- if (sMin < sz) {
- sMin = sz;
- }
- } else if (r0 > r1) {
- if (sMax > sz) {
- sMax = sz;
- }
- }
- // check the 'extend' flags
- if (!shading->getExtend0() && sMin < 0) {
- sMin = 0;
- }
- if (!shading->getExtend1() && sMax > 1) {
- sMax = 1;
- }
- }
-
- // generate the PS code
- writePSFmt("/x0 {0:.4g} def\n", x0);
- writePSFmt("/x1 {0:.4g} def\n", x1);
- writePSFmt("/dx {0:.4g} def\n", x1 - x0);
- writePSFmt("/y0 {0:.4g} def\n", y0);
- writePSFmt("/y1 {0:.4g} def\n", y1);
- writePSFmt("/dy {0:.4g} def\n", y1 - y0);
- writePSFmt("/r0 {0:.4g} def\n", r0);
- writePSFmt("/r1 {0:.4g} def\n", r1);
- writePSFmt("/dr {0:.4g} def\n", r1 - r0);
- writePSFmt("/t0 {0:.4g} def\n", t0);
- writePSFmt("/t1 {0:.4g} def\n", t1);
- writePSFmt("/dt {0:.4g} def\n", t1 - t0);
- writePSFmt("/n {0:d} def\n", shading->getColorSpace()->getNComps());
- writePSFmt("/encl {0:s} def\n", enclosed ? "true" : "false");
- writePSFmt("/a1 {0:.4g} def\n", a1);
- writePSFmt("/a2 {0:.4g} def\n", a2);
- if (shading->getNFuncs() == 1) {
- writePS("/func ");
- cvtFunction(shading->getFunc(0));
- writePS("def\n");
- } else {
- writePS("/func {\n");
- for (i = 0; i < shading->getNFuncs(); ++i) {
- if (i < shading->getNFuncs() - 1) {
- writePS("dup\n");
- }
- cvtFunction(shading->getFunc(i));
- writePS("exec\n");
- if (i < shading->getNFuncs() - 1) {
- writePS("exch\n");
- }
- }
- writePS("} def\n");
- }
- writePSFmt("{0:.4g} {1:.4g} 0 radialSH\n", sMin, sMax);
-
- // extend the 'enclosed' case
- if (enclosed) {
- // extend the smaller circle
- if ((shading->getExtend0() && r0 <= r1) ||
- (shading->getExtend1() && r1 < r0)) {
- if (r0 <= r1) {
- ta = t0;
- ra = r0;
- xa = x0;
- ya = y0;
- } else {
- ta = t1;
- ra = r1;
- xa = x1;
- ya = y1;
- }
- if (level == psLevel2Sep || level == psLevel3Sep) {
- writePSFmt("{0:.4g} radialCol aload pop k\n", ta);
- } else {
- writePSFmt("{0:.4g} radialCol sc\n", ta);
- }
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} 0 360 arc h f*\n", xa, ya, ra);
- }
-
- // extend the larger circle
- if ((shading->getExtend0() && r0 > r1) ||
- (shading->getExtend1() && r1 >= r0)) {
- if (r0 > r1) {
- ta = t0;
- ra = r0;
- xa = x0;
- ya = y0;
- } else {
- ta = t1;
- ra = r1;
- xa = x1;
- ya = y1;
- }
- if (level == psLevel2Sep || level == psLevel3Sep) {
- writePSFmt("{0:.4g} radialCol aload pop k\n", ta);
- } else {
- writePSFmt("{0:.4g} radialCol sc\n", ta);
- }
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} 0 360 arc h\n", xa, ya, ra);
- writePSFmt("{0:.4g} {1:.4g} m {2:.4g} {3:.4g} l {4:.4g} {5:.4g} l {6:.4g} {7:.4g} l h f*\n",
- xMin, yMin, xMin, yMax, xMax, yMax, xMax, yMin);
- }
- }
-
- return gTrue;
-}
-
-void PSOutputDev::clip(GfxState *state) {
- doPath(state->getPath());
- writePS("W\n");
-}
-
-void PSOutputDev::eoClip(GfxState *state) {
- doPath(state->getPath());
- writePS("W*\n");
-}
-
-void PSOutputDev::clipToStrokePath(GfxState *state) {
- doPath(state->getPath());
- writePS("Ws\n");
-}
-
-void PSOutputDev::doPath(GfxPath *path) {
- GfxSubpath *subpath;
- double x0, y0, x1, y1, x2, y2, x3, y3, x4, y4;
- int n, m, i, j;
-
- n = path->getNumSubpaths();
-
- if (n == 1 && path->getSubpath(0)->getNumPoints() == 5) {
- subpath = path->getSubpath(0);
- x0 = subpath->getX(0);
- y0 = subpath->getY(0);
- x4 = subpath->getX(4);
- y4 = subpath->getY(4);
- if (x4 == x0 && y4 == y0) {
- x1 = subpath->getX(1);
- y1 = subpath->getY(1);
- x2 = subpath->getX(2);
- y2 = subpath->getY(2);
- x3 = subpath->getX(3);
- y3 = subpath->getY(3);
- if (x0 == x1 && x2 == x3 && y0 == y3 && y1 == y2) {
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re\n",
- x0 < x2 ? x0 : x2, y0 < y1 ? y0 : y1,
- fabs(x2 - x0), fabs(y1 - y0));
- return;
- } else if (x0 == x3 && x1 == x2 && y0 == y1 && y2 == y3) {
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re\n",
- x0 < x1 ? x0 : x1, y0 < y2 ? y0 : y2,
- fabs(x1 - x0), fabs(y2 - y0));
- return;
- }
- }
- }
-
- for (i = 0; i < n; ++i) {
- subpath = path->getSubpath(i);
- m = subpath->getNumPoints();
- writePSFmt("{0:.4g} {1:.4g} m\n", subpath->getX(0), subpath->getY(0));
- j = 1;
- while (j < m) {
- if (subpath->getCurve(j)) {
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} c\n",
- subpath->getX(j), subpath->getY(j),
- subpath->getX(j+1), subpath->getY(j+1),
- subpath->getX(j+2), subpath->getY(j+2));
- j += 3;
- } else {
- writePSFmt("{0:.4g} {1:.4g} l\n", subpath->getX(j), subpath->getY(j));
- ++j;
- }
- }
- if (subpath->isClosed()) {
- writePS("h\n");
- }
- }
-}
-
-void PSOutputDev::drawString(GfxState *state, GString *s) {
- GfxFont *font;
- int wMode;
- Gushort *codeToGID;
- GString *s2;
- double dx, dy, dx2, dy2, originX, originY;
- char *p;
- UnicodeMap *uMap;
- CharCode code;
- Unicode u[8];
- char buf[8];
- int len, nChars, uLen, n, m, i, j;
-
- // check for invisible text -- this is used by Acrobat Capture
- if (state->getRender() == 3) {
- return;
- }
-
- // ignore empty strings
- if (s->getLength() == 0) {
- return;
- }
-
- // get the font
- if (!(font = state->getFont())) {
- return;
- }
- wMode = font->getWMode();
-
- // check for a subtitute 16-bit font
- uMap = NULL;
- codeToGID = NULL;
- if (font->isCIDFont()) {
- for (i = 0; i < font16EncLen; ++i) {
- if (font->getID()->num == font16Enc[i].fontID.num &&
- font->getID()->gen == font16Enc[i].fontID.gen) {
- uMap = globalParams->getUnicodeMap(font16Enc[i].enc);
- break;
- }
- }
-
- // check for a code-to-GID map
- } else {
- for (i = 0; i < font8InfoLen; ++i) {
- if (font->getID()->num == font8Info[i].fontID.num &&
- font->getID()->gen == font8Info[i].fontID.gen) {
- codeToGID = font8Info[i].codeToGID;
- break;
- }
- }
- }
-
- // compute width of chars in string, ignoring char spacing and word
- // spacing -- the Tj operator will adjust for the metrics of the
- // font that's actually used
- dx = dy = 0;
- nChars = 0;
- p = s->getCString();
- len = s->getLength();
- s2 = new GString();
- while (len > 0) {
- n = font->getNextChar(p, len, &code,
- u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
- &dx2, &dy2, &originX, &originY);
- if (font->isCIDFont()) {
- if (uMap) {
- for (i = 0; i < uLen; ++i) {
- m = uMap->mapUnicode(u[i], buf, (int)sizeof(buf));
- for (j = 0; j < m; ++j) {
- s2->append(buf[j]);
- }
- }
- //~ this really needs to get the number of chars in the target
- //~ encoding - which may be more than the number of Unicode
- //~ chars
- nChars += uLen;
- } else {
- s2->append((char)((code >> 8) & 0xff));
- s2->append((char)(code & 0xff));
- ++nChars;
- }
- } else {
- if (!codeToGID || codeToGID[code]) {
- s2->append((char)code);
- }
- }
- dx += dx2;
- dy += dy2;
- p += n;
- len -= n;
- }
- dx *= state->getFontSize() * state->getHorizScaling();
- dy *= state->getFontSize();
- if (uMap) {
- uMap->decRefCnt();
- }
-
- if (s2->getLength() > 0) {
- writePSString(s2);
- if (font->isCIDFont()) {
- if (wMode) {
- writePSFmt(" {0:d} {1:.4g} Tj16V\n", nChars, dy);
- } else {
- writePSFmt(" {0:d} {1:.4g} Tj16\n", nChars, dx);
- }
- } else {
- writePSFmt(" {0:.4g} Tj\n", dx);
- }
- }
- delete s2;
-
- if (state->getRender() & 4) {
- haveTextClip = gTrue;
- }
-}
-
-void PSOutputDev::endTextObject(GfxState * /*state*/) {
- if (haveTextClip) {
- writePS("Tclip\n");
- haveTextClip = gFalse;
- }
-}
-
-void PSOutputDev::drawImageMask(GfxState * /*state*/, Object *ref, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg) {
- int len;
-
- len = height * ((width + 7) / 8);
- switch (level) {
- case psLevel1:
- case psLevel1Sep:
- doImageL1(ref, NULL, invert, inlineImg, str, width, height, len);
- break;
- case psLevel2:
- case psLevel2Sep:
- doImageL2(ref, NULL, invert, inlineImg, str, width, height, len,
- NULL, NULL, 0, 0, gFalse);
- break;
- case psLevel3:
- case psLevel3Sep:
- doImageL3(ref, NULL, invert, inlineImg, str, width, height, len,
- NULL, NULL, 0, 0, gFalse);
- break;
- }
-}
-
-void PSOutputDev::drawImage(GfxState * /*state*/, Object *ref, Stream *str,
- int width, int height, GfxImageColorMap *colorMap,
- int *maskColors, GBool inlineImg) {
- int len;
-
- len = height * ((width * colorMap->getNumPixelComps() *
- colorMap->getBits() + 7) / 8);
- switch (level) {
- case psLevel1:
- doImageL1(ref, colorMap, gFalse, inlineImg, str, width, height, len);
- break;
- case psLevel1Sep:
- //~ handle indexed, separation, ... color spaces
- doImageL1Sep(colorMap, gFalse, inlineImg, str, width, height, len);
- break;
- case psLevel2:
- case psLevel2Sep:
- doImageL2(ref, colorMap, gFalse, inlineImg, str,
- width, height, len, maskColors, NULL, 0, 0, gFalse);
- break;
- case psLevel3:
- case psLevel3Sep:
- doImageL3(ref, colorMap, gFalse, inlineImg, str,
- width, height, len, maskColors, NULL, 0, 0, gFalse);
- break;
- }
- t3Cacheable = gFalse;
-}
-
-void PSOutputDev::drawMaskedImage(GfxState * /*state*/, Object *ref, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
- Stream *maskStr,
- int maskWidth, int maskHeight,
- GBool maskInvert) {
- int len;
-
- len = height * ((width * colorMap->getNumPixelComps() *
- colorMap->getBits() + 7) / 8);
- switch (level) {
- case psLevel1:
- doImageL1(ref, colorMap, gFalse, gFalse, str, width, height, len);
- break;
- case psLevel1Sep:
- //~ handle indexed, separation, ... color spaces
- doImageL1Sep(colorMap, gFalse, gFalse, str, width, height, len);
- break;
- case psLevel2:
- case psLevel2Sep:
- doImageL2(ref, colorMap, gFalse, gFalse, str, width, height, len,
- NULL, maskStr, maskWidth, maskHeight, maskInvert);
- break;
- case psLevel3:
- case psLevel3Sep:
- doImageL3(ref, colorMap, gFalse, gFalse, str, width, height, len,
- NULL, maskStr, maskWidth, maskHeight, maskInvert);
- break;
- }
- t3Cacheable = gFalse;
-}
-
-void PSOutputDev::doImageL1(Object *ref, GfxImageColorMap *colorMap,
- GBool invert, GBool inlineImg,
- Stream *str, int width, int height, int len) {
- ImageStream *imgStr;
- Guchar pixBuf[gfxColorMaxComps];
- GfxGray gray;
- int col, x, y, c, i;
-
- if ((inType3Char || preload) && !colorMap) {
- if (inlineImg) {
- // create an array
- str = new FixedLengthEncoder(str, len);
- str = new ASCIIHexEncoder(str);
- str->reset();
- col = 0;
- writePS("[<");
- do {
- do {
- c = str->getChar();
- } while (c == '\n' || c == '\r');
- if (c == '>' || c == EOF) {
- break;
- }
- writePSChar(c);
- ++col;
- // each line is: "<...data...><eol>"
- // so max data length = 255 - 4 = 251
- // but make it 240 just to be safe
- // chunks are 2 bytes each, so we need to stop on an even col number
- if (col == 240) {
- writePS(">\n<");
- col = 0;
- }
- } while (c != '>' && c != EOF);
- writePS(">]\n");
- writePS("0\n");
- str->close();
- delete str;
- } else {
- // set up to use the array already created by setupImages()
- writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
- }
- }
-
- // image/imagemask command
- if ((inType3Char || preload) && !colorMap) {
- writePSFmt("{0:d} {1:d} {2:s} [{3:d} 0 0 {4:d} 0 {5:d}] pdfImM1a\n",
- width, height, invert ? "true" : "false",
- width, -height, height);
- } else if (colorMap) {
- writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1\n",
- width, height,
- width, -height, height);
- } else {
- writePSFmt("{0:d} {1:d} {2:s} [{3:d} 0 0 {4:d} 0 {5:d}] pdfImM1\n",
- width, height, invert ? "true" : "false",
- width, -height, height);
- }
-
- // image data
- if (!((inType3Char || preload) && !colorMap)) {
-
- if (colorMap) {
-
- // set up to process the data stream
- imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
- colorMap->getBits());
- imgStr->reset();
-
- // process the data stream
- i = 0;
- for (y = 0; y < height; ++y) {
-
- // write the line
- for (x = 0; x < width; ++x) {
- imgStr->getPixel(pixBuf);
- colorMap->getGray(pixBuf, &gray);
- writePSFmt("{0:02x}", colToByte(gray));
- if (++i == 32) {
- writePSChar('\n');
- i = 0;
- }
- }
- }
- if (i != 0) {
- writePSChar('\n');
- }
- str->close();
- delete imgStr;
-
- // imagemask
- } else {
- str->reset();
- i = 0;
- for (y = 0; y < height; ++y) {
- for (x = 0; x < width; x += 8) {
- writePSFmt("{0:02x}", str->getChar() & 0xff);
- if (++i == 32) {
- writePSChar('\n');
- i = 0;
- }
- }
- }
- if (i != 0) {
- writePSChar('\n');
- }
- str->close();
- }
- }
-}
-
-void PSOutputDev::doImageL1Sep(GfxImageColorMap *colorMap,
- GBool /*invert*/, GBool /*inlineImg*/,
- Stream *str, int width, int height, int /*len*/) {
- ImageStream *imgStr;
- Guchar *lineBuf;
- Guchar pixBuf[gfxColorMaxComps];
- GfxCMYK cmyk;
- int x, y, i, comp;
-
- // width, height, matrix, bits per component
- writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1Sep\n",
- width, height,
- width, -height, height);
-
- // allocate a line buffer
- lineBuf = (Guchar *)gmallocn(width, 4);
-
- // set up to process the data stream
- imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
- colorMap->getBits());
- imgStr->reset();
-
- // process the data stream
- i = 0;
- for (y = 0; y < height; ++y) {
-
- // read the line
- for (x = 0; x < width; ++x) {
- imgStr->getPixel(pixBuf);
- colorMap->getCMYK(pixBuf, &cmyk);
- lineBuf[4*x+0] = colToByte(cmyk.c);
- lineBuf[4*x+1] = colToByte(cmyk.m);
- lineBuf[4*x+2] = colToByte(cmyk.y);
- lineBuf[4*x+3] = colToByte(cmyk.k);
- addProcessColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k));
- }
-
- // write one line of each color component
- for (comp = 0; comp < 4; ++comp) {
- for (x = 0; x < width; ++x) {
- writePSFmt("{0:02x}", lineBuf[4*x + comp]);
- if (++i == 32) {
- writePSChar('\n');
- i = 0;
- }
- }
- }
- }
-
- if (i != 0) {
- writePSChar('\n');
- }
-
- str->close();
- delete imgStr;
- gfree(lineBuf);
-}
-
-void PSOutputDev::doImageL2(Object *ref, GfxImageColorMap *colorMap,
- GBool invert, GBool inlineImg,
- Stream *str, int width, int height, int len,
- int *maskColors, Stream *maskStr,
- int maskWidth, int maskHeight, GBool maskInvert) {
- Stream *str2;
- ImageStream *imgStr;
- Guchar *line;
- PSOutImgClipRect *rects0, *rects1, *rectsTmp, *rectsOut;
- int rects0Len, rects1Len, rectsSize, rectsOutLen, rectsOutSize;
- GBool emitRect, addRect, extendRect;
- GString *s;
- int n, numComps;
- GBool useRLE, useASCII, useASCIIHex, useCompressed;
- GfxSeparationColorSpace *sepCS;
- GfxColor color;
- GfxCMYK cmyk;
- int c;
- int col, i, j, x0, x1, y, maskXor;
-
- // color key masking
- if (maskColors && colorMap && !inlineImg) {
- // can't read the stream twice for inline images -- but masking
- // isn't allowed with inline images anyway
- numComps = colorMap->getNumPixelComps();
- imgStr = new ImageStream(str, width, numComps, colorMap->getBits());
- imgStr->reset();
- rects0Len = rects1Len = rectsOutLen = 0;
- rectsSize = rectsOutSize = 64;
- rects0 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
- rects1 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
- rectsOut = (PSOutImgClipRect *)gmallocn(rectsOutSize,
- sizeof(PSOutImgClipRect));
- for (y = 0; y < height; ++y) {
- if (!(line = imgStr->getLine())) {
- break;
- }
- i = 0;
- rects1Len = 0;
- for (x0 = 0; x0 < width; ++x0) {
- for (j = 0; j < numComps; ++j) {
- if (line[x0*numComps+j] < maskColors[2*j] ||
- line[x0*numComps+j] > maskColors[2*j+1]) {
- break;
- }
- }
- if (j < numComps) {
- break;
- }
- }
- for (x1 = x0; x1 < width; ++x1) {
- for (j = 0; j < numComps; ++j) {
- if (line[x1*numComps+j] < maskColors[2*j] ||
- line[x1*numComps+j] > maskColors[2*j+1]) {
- break;
- }
- }
- if (j == numComps) {
- break;
- }
- }
- while (x0 < width || i < rects0Len) {
- emitRect = addRect = extendRect = gFalse;
- if (x0 >= width) {
- emitRect = gTrue;
- } else if (i >= rects0Len) {
- addRect = gTrue;
- } else if (rects0[i].x0 < x0) {
- emitRect = gTrue;
- } else if (x0 < rects0[i].x0) {
- addRect = gTrue;
- } else if (rects0[i].x1 == x1) {
- extendRect = gTrue;
- } else {
- emitRect = addRect = gTrue;
- }
- if (emitRect) {
- if (rectsOutLen == rectsOutSize) {
- rectsOutSize *= 2;
- rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
- sizeof(PSOutImgClipRect));
- }
- rectsOut[rectsOutLen].x0 = rects0[i].x0;
- rectsOut[rectsOutLen].x1 = rects0[i].x1;
- rectsOut[rectsOutLen].y0 = height - y - 1;
- rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1;
- ++rectsOutLen;
- ++i;
- }
- if (addRect || extendRect) {
- if (rects1Len == rectsSize) {
- rectsSize *= 2;
- rects0 = (PSOutImgClipRect *)greallocn(rects0, rectsSize,
- sizeof(PSOutImgClipRect));
- rects1 = (PSOutImgClipRect *)greallocn(rects1, rectsSize,
- sizeof(PSOutImgClipRect));
- }
- rects1[rects1Len].x0 = x0;
- rects1[rects1Len].x1 = x1;
- if (addRect) {
- rects1[rects1Len].y0 = y;
- }
- if (extendRect) {
- rects1[rects1Len].y0 = rects0[i].y0;
- ++i;
- }
- ++rects1Len;
- for (x0 = x1; x0 < width; ++x0) {
- for (j = 0; j < numComps; ++j) {
- if (line[x0*numComps+j] < maskColors[2*j] ||
- line[x0*numComps+j] > maskColors[2*j+1]) {
- break;
- }
- }
- if (j < numComps) {
- break;
- }
- }
- for (x1 = x0; x1 < width; ++x1) {
- for (j = 0; j < numComps; ++j) {
- if (line[x1*numComps+j] < maskColors[2*j] ||
- line[x1*numComps+j] > maskColors[2*j+1]) {
- break;
- }
- }
- if (j == numComps) {
- break;
- }
- }
- }
- }
- rectsTmp = rects0;
- rects0 = rects1;
- rects1 = rectsTmp;
- i = rects0Len;
- rects0Len = rects1Len;
- rects1Len = i;
- }
- for (i = 0; i < rects0Len; ++i) {
- if (rectsOutLen == rectsOutSize) {
- rectsOutSize *= 2;
- rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
- sizeof(PSOutImgClipRect));
- }
- rectsOut[rectsOutLen].x0 = rects0[i].x0;
- rectsOut[rectsOutLen].x1 = rects0[i].x1;
- rectsOut[rectsOutLen].y0 = height - y - 1;
- rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1;
- ++rectsOutLen;
- }
- writePSFmt("{0:d} array 0\n", rectsOutLen * 4);
- for (i = 0; i < rectsOutLen; ++i) {
- writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n",
- rectsOut[i].x0, rectsOut[i].y0,
- rectsOut[i].x1 - rectsOut[i].x0,
- rectsOut[i].y1 - rectsOut[i].y0);
- }
- writePSFmt("pop {0:d} {1:d} pdfImClip\n", width, height);
- gfree(rectsOut);
- gfree(rects0);
- gfree(rects1);
- delete imgStr;
- str->close();
-
- // explicit masking
- } else if (maskStr) {
- imgStr = new ImageStream(maskStr, maskWidth, 1, 1);
- imgStr->reset();
- rects0Len = rects1Len = rectsOutLen = 0;
- rectsSize = rectsOutSize = 64;
- rects0 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
- rects1 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
- rectsOut = (PSOutImgClipRect *)gmallocn(rectsOutSize,
- sizeof(PSOutImgClipRect));
- maskXor = maskInvert ? 1 : 0;
- for (y = 0; y < maskHeight; ++y) {
- if (!(line = imgStr->getLine())) {
- break;
- }
- i = 0;
- rects1Len = 0;
- for (x0 = 0; x0 < maskWidth && (line[x0] ^ maskXor); ++x0) ;
- for (x1 = x0; x1 < maskWidth && !(line[x1] ^ maskXor); ++x1) ;
- while (x0 < maskWidth || i < rects0Len) {
- emitRect = addRect = extendRect = gFalse;
- if (x0 >= maskWidth) {
- emitRect = gTrue;
- } else if (i >= rects0Len) {
- addRect = gTrue;
- } else if (rects0[i].x0 < x0) {
- emitRect = gTrue;
- } else if (x0 < rects0[i].x0) {
- addRect = gTrue;
- } else if (rects0[i].x1 == x1) {
- extendRect = gTrue;
- } else {
- emitRect = addRect = gTrue;
- }
- if (emitRect) {
- if (rectsOutLen == rectsOutSize) {
- rectsOutSize *= 2;
- rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
- sizeof(PSOutImgClipRect));
- }
- rectsOut[rectsOutLen].x0 = rects0[i].x0;
- rectsOut[rectsOutLen].x1 = rects0[i].x1;
- rectsOut[rectsOutLen].y0 = maskHeight - y - 1;
- rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1;
- ++rectsOutLen;
- ++i;
- }
- if (addRect || extendRect) {
- if (rects1Len == rectsSize) {
- rectsSize *= 2;
- rects0 = (PSOutImgClipRect *)greallocn(rects0, rectsSize,
- sizeof(PSOutImgClipRect));
- rects1 = (PSOutImgClipRect *)greallocn(rects1, rectsSize,
- sizeof(PSOutImgClipRect));
- }
- rects1[rects1Len].x0 = x0;
- rects1[rects1Len].x1 = x1;
- if (addRect) {
- rects1[rects1Len].y0 = y;
- }
- if (extendRect) {
- rects1[rects1Len].y0 = rects0[i].y0;
- ++i;
- }
- ++rects1Len;
- for (x0 = x1; x0 < maskWidth && (line[x0] ^ maskXor); ++x0) ;
- for (x1 = x0; x1 < maskWidth && !(line[x1] ^ maskXor); ++x1) ;
- }
- }
- rectsTmp = rects0;
- rects0 = rects1;
- rects1 = rectsTmp;
- i = rects0Len;
- rects0Len = rects1Len;
- rects1Len = i;
- }
- for (i = 0; i < rects0Len; ++i) {
- if (rectsOutLen == rectsOutSize) {
- rectsOutSize *= 2;
- rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
- sizeof(PSOutImgClipRect));
- }
- rectsOut[rectsOutLen].x0 = rects0[i].x0;
- rectsOut[rectsOutLen].x1 = rects0[i].x1;
- rectsOut[rectsOutLen].y0 = maskHeight - y - 1;
- rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1;
- ++rectsOutLen;
- }
- writePSFmt("{0:d} array 0\n", rectsOutLen * 4);
- for (i = 0; i < rectsOutLen; ++i) {
- writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n",
- rectsOut[i].x0, rectsOut[i].y0,
- rectsOut[i].x1 - rectsOut[i].x0,
- rectsOut[i].y1 - rectsOut[i].y0);
- }
- writePSFmt("pop {0:d} {1:d} pdfImClip\n", maskWidth, maskHeight);
- gfree(rectsOut);
- gfree(rects0);
- gfree(rects1);
- delete imgStr;
- maskStr->close();
- }
-
- // color space
- if (colorMap) {
- dumpColorSpaceL2(colorMap->getColorSpace(), gFalse, gTrue, gFalse);
- writePS(" setcolorspace\n");
- }
-
- useASCIIHex = globalParams->getPSASCIIHex();
-
- // set up the image data
- if (mode == psModeForm || inType3Char || preload) {
- if (inlineImg) {
- // create an array
- str2 = new FixedLengthEncoder(str, len);
- str2 = new RunLengthEncoder(str2);
- if (useASCIIHex) {
- str2 = new ASCIIHexEncoder(str2);
- } else {
- str2 = new ASCII85Encoder(str2);
- }
- str2->reset();
- col = 0;
- writePS((char *)(useASCIIHex ? "[<" : "[<~"));
- do {
- do {
- c = str2->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- if (c == 'z') {
- writePSChar(c);
- ++col;
- } else {
- writePSChar(c);
- ++col;
- for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
- do {
- c = str2->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- writePSChar(c);
- ++col;
- }
- }
- // each line is: "<~...data...~><eol>"
- // so max data length = 255 - 6 = 249
- // chunks are 1 or 5 bytes each, so we have to stop at 245
- // but make it 240 just to be safe
- if (col > 240) {
- writePS((char *)(useASCIIHex ? ">\n<" : "~>\n<~"));
- col = 0;
- }
- } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
- writePS((char *)(useASCIIHex ? ">\n" : "~>\n"));
- // add an extra entry because the RunLengthDecode filter may
- // read past the end
- writePS("<>]\n");
- writePS("0\n");
- str2->close();
- delete str2;
- } else {
- // set up to use the array already created by setupImages()
- writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
- }
- }
-
- // image dictionary
- writePS("<<\n /ImageType 1\n");
-
- // width, height, matrix, bits per component
- writePSFmt(" /Width {0:d}\n", width);
- writePSFmt(" /Height {0:d}\n", height);
- writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n",
- width, -height, height);
- if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
- writePS(" /BitsPerComponent 8\n");
- } else {
- writePSFmt(" /BitsPerComponent {0:d}\n",
- colorMap ? colorMap->getBits() : 1);
- }
-
- // decode
- if (colorMap) {
- writePS(" /Decode [");
- if ((level == psLevel2Sep || level == psLevel3Sep) &&
- colorMap->getColorSpace()->getMode() == csSeparation) {
- // this matches up with the code in the pdfImSep operator
- n = (1 << colorMap->getBits()) - 1;
- writePSFmt("{0:.4g} {1:.4g}", colorMap->getDecodeLow(0) * n,
- colorMap->getDecodeHigh(0) * n);
- } else if (colorMap->getColorSpace()->getMode() == csDeviceN) {
- numComps = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
- getAlt()->getNComps();
- for (i = 0; i < numComps; ++i) {
- if (i > 0) {
- writePS(" ");
- }
- writePS("0 1");
- }
- } else {
- numComps = colorMap->getNumPixelComps();
- for (i = 0; i < numComps; ++i) {
- if (i > 0) {
- writePS(" ");
- }
- writePSFmt("{0:.4g} {1:.4g}",
- colorMap->getDecodeLow(i), colorMap->getDecodeHigh(i));
- }
- }
- writePS("]\n");
- } else {
- writePSFmt(" /Decode [{0:d} {1:d}]\n", invert ? 1 : 0, invert ? 0 : 1);
- }
-
- // data source
- if (mode == psModeForm || inType3Char || preload) {
- writePS(" /DataSource { 2 copy get exch 1 add exch }\n");
- } else {
- writePS(" /DataSource currentfile\n");
- }
-
- // filters
- s = str->getPSFilter(level < psLevel2 ? 1 : level < psLevel3 ? 2 : 3,
- " ");
- if ((colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) ||
- inlineImg || !s) {
- useRLE = gTrue;
- useASCII = !(mode == psModeForm || inType3Char || preload);
- useCompressed = gFalse;
- } else {
- useRLE = gFalse;
- useASCII = str->isBinary() &&
- !(mode == psModeForm || inType3Char || preload);
- useCompressed = gTrue;
- }
- if (useASCII) {
- writePSFmt(" /ASCII{0:s}Decode filter\n",
- useASCIIHex ? "Hex" : "85");
- }
- if (useRLE) {
- writePS(" /RunLengthDecode filter\n");
- }
- if (useCompressed) {
- writePS(s->getCString());
- }
- if (s) {
- delete s;
- }
-
- if (mode == psModeForm || inType3Char || preload) {
-
- // end of image dictionary
- writePSFmt(">>\n{0:s}\n", colorMap ? "image" : "imagemask");
-
- // get rid of the array and index
- writePS("pop pop\n");
-
- } else {
-
- // cut off inline image streams at appropriate length
- if (inlineImg) {
- str = new FixedLengthEncoder(str, len);
- } else if (useCompressed) {
- str = str->getUndecodedStream();
- }
-
- // recode DeviceN data
- if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
- str = new DeviceNRecoder(str, width, height, colorMap);
- }
-
- // add RunLengthEncode and ASCIIHex/85 encode filters
- if (useRLE) {
- str = new RunLengthEncoder(str);
- }
- if (useASCII) {
- if (useASCIIHex) {
- str = new ASCIIHexEncoder(str);
- } else {
- str = new ASCII85Encoder(str);
- }
- }
-
- // end of image dictionary
- writePS(">>\n");
-#if OPI_SUPPORT
- if (opi13Nest) {
- if (inlineImg) {
- // this can't happen -- OPI dictionaries are in XObjects
- error(-1, "Internal: OPI in inline image");
- n = 0;
- } else {
- // need to read the stream to count characters -- the length
- // is data-dependent (because of ASCII and RLE filters)
- str->reset();
- n = 0;
- while ((c = str->getChar()) != EOF) {
- ++n;
- }
- str->close();
- }
- // +6/7 for "pdfIm\n" / "pdfImM\n"
- // +8 for newline + trailer
- n += colorMap ? 14 : 15;
- writePSFmt("%%BeginData: {0:d} Hex Bytes\n", n);
- }
-#endif
- if ((level == psLevel2Sep || level == psLevel3Sep) && colorMap &&
- colorMap->getColorSpace()->getMode() == csSeparation) {
- color.c[0] = gfxColorComp1;
- sepCS = (GfxSeparationColorSpace *)colorMap->getColorSpace();
- sepCS->getCMYK(&color, &cmyk);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} ({4:t}) pdfImSep\n",
- colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k),
- sepCS->getName());
- } else {
- writePSFmt("{0:s}\n", colorMap ? "pdfIm" : "pdfImM");
- }
-
- // copy the stream data
- str->reset();
- while ((c = str->getChar()) != EOF) {
- writePSChar(c);
- }
- str->close();
-
- // add newline and trailer to the end
- writePSChar('\n');
- writePS("%-EOD-\n");
-#if OPI_SUPPORT
- if (opi13Nest) {
- writePS("%%EndData\n");
- }
-#endif
-
- // delete encoders
- if (useRLE || useASCII || inlineImg) {
- delete str;
- }
- }
-
- if ((maskColors && colorMap && !inlineImg) || maskStr) {
- writePS("pdfImClipEnd\n");
- }
-}
-
-//~ this doesn't currently support OPI
-void PSOutputDev::doImageL3(Object *ref, GfxImageColorMap *colorMap,
- GBool invert, GBool inlineImg,
- Stream *str, int width, int height, int len,
- int *maskColors, Stream *maskStr,
- int maskWidth, int maskHeight, GBool maskInvert) {
- Stream *str2;
- GString *s;
- int n, numComps;
- GBool useRLE, useASCII, useASCIIHex, useCompressed;
- GBool maskUseRLE, maskUseASCII, maskUseCompressed;
- GfxSeparationColorSpace *sepCS;
- GfxColor color;
- GfxCMYK cmyk;
- int c;
- int col, i;
-
- useASCIIHex = globalParams->getPSASCIIHex();
- useRLE = useASCII = useCompressed = gFalse; // make gcc happy
- maskUseRLE = maskUseASCII = maskUseCompressed = gFalse; // make gcc happy
-
- // color space
- if (colorMap) {
- dumpColorSpaceL2(colorMap->getColorSpace(), gFalse, gTrue, gFalse);
- writePS(" setcolorspace\n");
- }
-
- // set up the image data
- if (mode == psModeForm || inType3Char || preload) {
- if (inlineImg) {
- // create an array
- str2 = new FixedLengthEncoder(str, len);
- str2 = new RunLengthEncoder(str2);
- if (useASCIIHex) {
- str2 = new ASCIIHexEncoder(str2);
- } else {
- str2 = new ASCII85Encoder(str2);
- }
- str2->reset();
- col = 0;
- writePS((char *)(useASCIIHex ? "[<" : "[<~"));
- do {
- do {
- c = str2->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- if (c == 'z') {
- writePSChar(c);
- ++col;
- } else {
- writePSChar(c);
- ++col;
- for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
- do {
- c = str2->getChar();
- } while (c == '\n' || c == '\r');
- if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
- break;
- }
- writePSChar(c);
- ++col;
- }
- }
- // each line is: "<~...data...~><eol>"
- // so max data length = 255 - 6 = 249
- // chunks are 1 or 5 bytes each, so we have to stop at 245
- // but make it 240 just to be safe
- if (col > 240) {
- writePS((char *)(useASCIIHex ? ">\n<" : "~>\n<~"));
- col = 0;
- }
- } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
- writePS((char *)(useASCIIHex ? ">\n" : "~>\n"));
- // add an extra entry because the RunLengthDecode filter may
- // read past the end
- writePS("<>]\n");
- writePS("0\n");
- str2->close();
- delete str2;
- } else {
- // set up to use the array already created by setupImages()
- writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
- }
- }
-
- // explicit masking
- if (maskStr) {
- writePS("<<\n /ImageType 3\n");
- writePS(" /InterleaveType 3\n");
- writePS(" /DataDict\n");
- }
-
- // image (data) dictionary
- writePSFmt("<<\n /ImageType {0:d}\n", (maskColors && colorMap) ? 4 : 1);
-
- // color key masking
- if (maskColors && colorMap) {
- writePS(" /MaskColor [\n");
- numComps = colorMap->getNumPixelComps();
- for (i = 0; i < 2 * numComps; i += 2) {
- writePSFmt(" {0:d} {1:d}\n", maskColors[i], maskColors[i+1]);
- }
- writePS(" ]\n");
- }
-
- // width, height, matrix, bits per component
- writePSFmt(" /Width {0:d}\n", width);
- writePSFmt(" /Height {0:d}\n", height);
- writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n",
- width, -height, height);
- if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
- writePS(" /BitsPerComponent 8\n");
- } else {
- writePSFmt(" /BitsPerComponent {0:d}\n",
- colorMap ? colorMap->getBits() : 1);
- }
-
- // decode
- if (colorMap) {
- writePS(" /Decode [");
- if ((level == psLevel2Sep || level == psLevel3Sep) &&
- colorMap->getColorSpace()->getMode() == csSeparation) {
- // this matches up with the code in the pdfImSep operator
- n = (1 << colorMap->getBits()) - 1;
- writePSFmt("{0:.4g} {1:.4g}", colorMap->getDecodeLow(0) * n,
- colorMap->getDecodeHigh(0) * n);
- } else if (colorMap->getColorSpace()->getMode() == csDeviceN) {
- numComps = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
- getAlt()->getNComps();
- for (i = 0; i < numComps; ++i) {
- if (i > 0) {
- writePS(" ");
- }
- writePS("0 1");
- }
- } else {
- numComps = colorMap->getNumPixelComps();
- for (i = 0; i < numComps; ++i) {
- if (i > 0) {
- writePS(" ");
- }
- writePSFmt("{0:.4g} {1:.4g}", colorMap->getDecodeLow(i),
- colorMap->getDecodeHigh(i));
- }
- }
- writePS("]\n");
- } else {
- writePSFmt(" /Decode [{0:d} {1:d}]\n", invert ? 1 : 0, invert ? 0 : 1);
- }
-
- // data source
- if (mode == psModeForm || inType3Char || preload) {
- writePS(" /DataSource { 2 copy get exch 1 add exch }\n");
- } else {
- writePS(" /DataSource currentfile\n");
- }
-
- // filters
- s = str->getPSFilter(level < psLevel2 ? 1 : level < psLevel3 ? 2 : 3,
- " ");
- if ((colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) ||
- inlineImg || !s) {
- useRLE = gTrue;
- useASCII = !(mode == psModeForm || inType3Char || preload);
- useCompressed = gFalse;
- } else {
- useRLE = gFalse;
- useASCII = str->isBinary() &&
- !(mode == psModeForm || inType3Char || preload);
- useCompressed = gTrue;
- }
- if (useASCII) {
- writePSFmt(" /ASCII{0:s}Decode filter\n",
- useASCIIHex ? "Hex" : "85");
- }
- if (useRLE) {
- writePS(" /RunLengthDecode filter\n");
- }
- if (useCompressed) {
- writePS(s->getCString());
- }
- if (s) {
- delete s;
- }
-
- // end of image (data) dictionary
- writePS(">>\n");
-
- // explicit masking
- if (maskStr) {
- writePS(" /MaskDict\n");
- writePS("<<\n");
- writePS(" /ImageType 1\n");
- writePSFmt(" /Width {0:d}\n", maskWidth);
- writePSFmt(" /Height {0:d}\n", maskHeight);
- writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n",
- maskWidth, -maskHeight, maskHeight);
- writePS(" /BitsPerComponent 1\n");
- writePSFmt(" /Decode [{0:d} {1:d}]\n",
- maskInvert ? 1 : 0, maskInvert ? 0 : 1);
-
- // mask data source
- writePS(" /DataSource currentfile\n");
- s = maskStr->getPSFilter(3, " ");
- if (!s) {
- maskUseRLE = gTrue;
- maskUseASCII = gTrue;
- maskUseCompressed = gFalse;
- } else {
- maskUseRLE = gFalse;
- maskUseASCII = maskStr->isBinary();
- maskUseCompressed = gTrue;
- }
- if (maskUseASCII) {
- writePSFmt(" /ASCII{0:s}Decode filter\n",
- useASCIIHex ? "Hex" : "85");
- }
- if (maskUseRLE) {
- writePS(" /RunLengthDecode filter\n");
- }
- if (maskUseCompressed) {
- writePS(s->getCString());
- }
- if (s) {
- delete s;
- }
-
- writePS(">>\n");
- writePS(">>\n");
- }
-
- if (mode == psModeForm || inType3Char || preload) {
-
- // image command
- writePSFmt("{0:s}\n", colorMap ? "image" : "imagemask");
-
- } else {
-
- if ((level == psLevel2Sep || level == psLevel3Sep) && colorMap &&
- colorMap->getColorSpace()->getMode() == csSeparation) {
- color.c[0] = gfxColorComp1;
- sepCS = (GfxSeparationColorSpace *)colorMap->getColorSpace();
- sepCS->getCMYK(&color, &cmyk);
- writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} ({4:t}) pdfImSep\n",
- colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k),
- sepCS->getName());
- } else {
- writePSFmt("{0:s}\n", colorMap ? "pdfIm" : "pdfImM");
- }
-
- }
-
- // explicit masking
- if (maskStr) {
-
- if (maskUseCompressed) {
- maskStr = maskStr->getUndecodedStream();
- }
-
- // add RunLengthEncode and ASCIIHex/85 encode filters
- if (maskUseRLE) {
- maskStr = new RunLengthEncoder(maskStr);
- }
- if (maskUseASCII) {
- if (useASCIIHex) {
- maskStr = new ASCIIHexEncoder(maskStr);
- } else {
- maskStr = new ASCII85Encoder(maskStr);
- }
- }
-
- // copy the stream data
- maskStr->reset();
- while ((c = maskStr->getChar()) != EOF) {
- writePSChar(c);
- }
- maskStr->close();
- writePSChar('\n');
-
- // delete encoders
- if (maskUseRLE || maskUseASCII) {
- delete maskStr;
- }
- }
-
- // get rid of the array and index
- if (mode == psModeForm || inType3Char || preload) {
- writePS("pop pop\n");
-
- // image data
- } else {
-
- // cut off inline image streams at appropriate length
- if (inlineImg) {
- str = new FixedLengthEncoder(str, len);
- } else if (useCompressed) {
- str = str->getUndecodedStream();
- }
-
- // recode DeviceN data
- if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
- str = new DeviceNRecoder(str, width, height, colorMap);
- }
-
- // add RunLengthEncode and ASCIIHex/85 encode filters
- if (useRLE) {
- str = new RunLengthEncoder(str);
- }
- if (useASCII) {
- if (useASCIIHex) {
- str = new ASCIIHexEncoder(str);
- } else {
- str = new ASCII85Encoder(str);
- }
- }
-
- // copy the stream data
- str->reset();
- while ((c = str->getChar()) != EOF) {
- writePSChar(c);
- }
- str->close();
-
- // add newline and trailer to the end
- writePSChar('\n');
- writePS("%-EOD-\n");
-
- // delete encoders
- if (useRLE || useASCII || inlineImg) {
- delete str;
- }
- }
-}
-
-void PSOutputDev::dumpColorSpaceL2(GfxColorSpace *colorSpace,
- GBool genXform, GBool updateColors,
- GBool map01) {
- GfxCalGrayColorSpace *calGrayCS;
- GfxCalRGBColorSpace *calRGBCS;
- GfxLabColorSpace *labCS;
- GfxIndexedColorSpace *indexedCS;
- GfxSeparationColorSpace *separationCS;
- GfxDeviceNColorSpace *deviceNCS;
- GfxColorSpace *baseCS;
- Guchar *lookup, *p;
- double x[gfxColorMaxComps], y[gfxColorMaxComps];
- double low[gfxColorMaxComps], range[gfxColorMaxComps];
- GfxColor color;
- GfxCMYK cmyk;
- Function *func;
- int n, numComps, numAltComps;
- int byte;
- int i, j, k;
-
- switch (colorSpace->getMode()) {
-
- case csDeviceGray:
- writePS("/DeviceGray");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- processColors |= psProcessBlack;
- }
- break;
-
- case csCalGray:
- calGrayCS = (GfxCalGrayColorSpace *)colorSpace;
- writePS("[/CIEBasedA <<\n");
- writePSFmt(" /DecodeA {{{0:.4g} exp}} bind\n", calGrayCS->getGamma());
- writePSFmt(" /MatrixA [{0:.4g} {1:.4g} {2:.4g}]\n",
- calGrayCS->getWhiteX(), calGrayCS->getWhiteY(),
- calGrayCS->getWhiteZ());
- writePSFmt(" /WhitePoint [{0:.4g} {1:.4g} {2:.4g}]\n",
- calGrayCS->getWhiteX(), calGrayCS->getWhiteY(),
- calGrayCS->getWhiteZ());
- writePSFmt(" /BlackPoint [{0:.4g} {1:.4g} {2:.4g}]\n",
- calGrayCS->getBlackX(), calGrayCS->getBlackY(),
- calGrayCS->getBlackZ());
- writePS(">>]");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- processColors |= psProcessBlack;
- }
- break;
-
- case csDeviceRGB:
- writePS("/DeviceRGB");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- processColors |= psProcessCMYK;
- }
- break;
-
- case csCalRGB:
- calRGBCS = (GfxCalRGBColorSpace *)colorSpace;
- writePS("[/CIEBasedABC <<\n");
- writePSFmt(" /DecodeABC [{{{0:.4g} exp}} bind {{{1:.4g} exp}} bind {{{2:.4g} exp}} bind]\n",
- calRGBCS->getGammaR(), calRGBCS->getGammaG(),
- calRGBCS->getGammaB());
- writePSFmt(" /MatrixABC [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} {6:.4g} {7:.4g} {8:.4g}]\n",
- calRGBCS->getMatrix()[0], calRGBCS->getMatrix()[1],
- calRGBCS->getMatrix()[2], calRGBCS->getMatrix()[3],
- calRGBCS->getMatrix()[4], calRGBCS->getMatrix()[5],
- calRGBCS->getMatrix()[6], calRGBCS->getMatrix()[7],
- calRGBCS->getMatrix()[8]);
- writePSFmt(" /WhitePoint [{0:.4g} {1:.4g} {2:.4g}]\n",
- calRGBCS->getWhiteX(), calRGBCS->getWhiteY(),
- calRGBCS->getWhiteZ());
- writePSFmt(" /BlackPoint [{0:.4g} {1:.4g} {2:.4g}]\n",
- calRGBCS->getBlackX(), calRGBCS->getBlackY(),
- calRGBCS->getBlackZ());
- writePS(">>]");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- processColors |= psProcessCMYK;
- }
- break;
-
- case csDeviceCMYK:
- writePS("/DeviceCMYK");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- processColors |= psProcessCMYK;
- }
- break;
-
- case csLab:
- labCS = (GfxLabColorSpace *)colorSpace;
- writePS("[/CIEBasedABC <<\n");
- if (map01) {
- writePS(" /RangeABC [0 1 0 1 0 1]\n");
- writePSFmt(" /DecodeABC [{{100 mul 16 add 116 div}} bind {{{0:.4g} mul {1:.4g} add}} bind {{{2:.4g} mul {3:.4g} add}} bind]\n",
- (labCS->getAMax() - labCS->getAMin()) / 500.0,
- labCS->getAMin() / 500.0,
- (labCS->getBMax() - labCS->getBMin()) / 200.0,
- labCS->getBMin() / 200.0);
- } else {
- writePSFmt(" /RangeABC [0 100 {0:.4g} {1:.4g} {2:.4g} {3:.4g}]\n",
- labCS->getAMin(), labCS->getAMax(),
- labCS->getBMin(), labCS->getBMax());
- writePS(" /DecodeABC [{16 add 116 div} bind {500 div} bind {200 div} bind]\n");
- }
- writePS(" /MatrixABC [1 1 1 1 0 0 0 0 -1]\n");
- writePS(" /DecodeLMN\n");
- writePS(" [{dup 6 29 div ge {dup dup mul mul}\n");
- writePSFmt(" {{4 29 div sub 108 841 div mul }} ifelse {0:.4g} mul}} bind\n",
- labCS->getWhiteX());
- writePS(" {dup 6 29 div ge {dup dup mul mul}\n");
- writePSFmt(" {{4 29 div sub 108 841 div mul }} ifelse {0:.4g} mul}} bind\n",
- labCS->getWhiteY());
- writePS(" {dup 6 29 div ge {dup dup mul mul}\n");
- writePSFmt(" {{4 29 div sub 108 841 div mul }} ifelse {0:.4g} mul}} bind]\n",
- labCS->getWhiteZ());
- writePSFmt(" /WhitePoint [{0:.4g} {1:.4g} {2:.4g}]\n",
- labCS->getWhiteX(), labCS->getWhiteY(), labCS->getWhiteZ());
- writePSFmt(" /BlackPoint [{0:.4g} {1:.4g} {2:.4g}]\n",
- labCS->getBlackX(), labCS->getBlackY(), labCS->getBlackZ());
- writePS(">>]");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- processColors |= psProcessCMYK;
- }
- break;
-
- case csICCBased:
- // there is no transform function to the alternate color space, so
- // we can use it directly
- dumpColorSpaceL2(((GfxICCBasedColorSpace *)colorSpace)->getAlt(),
- genXform, updateColors, gFalse);
- break;
-
- case csIndexed:
- indexedCS = (GfxIndexedColorSpace *)colorSpace;
- baseCS = indexedCS->getBase();
- writePS("[/Indexed ");
- dumpColorSpaceL2(baseCS, gFalse, gFalse, gTrue);
- n = indexedCS->getIndexHigh();
- numComps = baseCS->getNComps();
- lookup = indexedCS->getLookup();
- writePSFmt(" {0:d} <\n", n);
- if (baseCS->getMode() == csDeviceN) {
- func = ((GfxDeviceNColorSpace *)baseCS)->getTintTransformFunc();
- baseCS->getDefaultRanges(low, range, indexedCS->getIndexHigh());
- if (((GfxDeviceNColorSpace *)baseCS)->getAlt()->getMode() == csLab) {
- labCS = (GfxLabColorSpace *)((GfxDeviceNColorSpace *)baseCS)->getAlt();
- } else {
- labCS = NULL;
- }
- numAltComps = ((GfxDeviceNColorSpace *)baseCS)->getAlt()->getNComps();
- p = lookup;
- for (i = 0; i <= n; i += 8) {
- writePS(" ");
- for (j = i; j < i+8 && j <= n; ++j) {
- for (k = 0; k < numComps; ++k) {
- x[k] = low[k] + (*p++ / 255.0) * range[k];
- }
- func->transform(x, y);
- if (labCS) {
- y[0] /= 100.0;
- y[1] = (y[1] - labCS->getAMin()) /
- (labCS->getAMax() - labCS->getAMin());
- y[2] = (y[2] - labCS->getBMin()) /
- (labCS->getBMax() - labCS->getBMin());
- }
- for (k = 0; k < numAltComps; ++k) {
- byte = (int)(y[k] * 255 + 0.5);
- if (byte < 0) {
- byte = 0;
- } else if (byte > 255) {
- byte = 255;
- }
- writePSFmt("{0:02x}", byte);
- }
- if (updateColors) {
- color.c[0] = dblToCol(j);
- indexedCS->getCMYK(&color, &cmyk);
- addProcessColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k));
- }
- }
- writePS("\n");
- }
- } else {
- for (i = 0; i <= n; i += 8) {
- writePS(" ");
- for (j = i; j < i+8 && j <= n; ++j) {
- for (k = 0; k < numComps; ++k) {
- writePSFmt("{0:02x}", lookup[j * numComps + k]);
- }
- if (updateColors) {
- color.c[0] = dblToCol(j);
- indexedCS->getCMYK(&color, &cmyk);
- addProcessColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
- colToDbl(cmyk.y), colToDbl(cmyk.k));
- }
- }
- writePS("\n");
- }
- }
- writePS(">]");
- if (genXform) {
- writePS(" {}");
- }
- break;
-
- case csSeparation:
- separationCS = (GfxSeparationColorSpace *)colorSpace;
- writePS("[/Separation ");
- writePSString(separationCS->getName());
- writePS(" ");
- dumpColorSpaceL2(separationCS->getAlt(), gFalse, gFalse, gFalse);
- writePS("\n");
- cvtFunction(separationCS->getFunc());
- writePS("]");
- if (genXform) {
- writePS(" {}");
- }
- if (updateColors) {
- addCustomColor(separationCS);
- }
- break;
-
- case csDeviceN:
- // DeviceN color spaces are a Level 3 PostScript feature.
- deviceNCS = (GfxDeviceNColorSpace *)colorSpace;
- dumpColorSpaceL2(deviceNCS->getAlt(), gFalse, updateColors, map01);
- if (genXform) {
- writePS(" ");
- cvtFunction(deviceNCS->getTintTransformFunc());
- }
- break;
-
- case csPattern:
- //~ unimplemented
- break;
- }
-}
-
-#if OPI_SUPPORT
-void PSOutputDev::opiBegin(GfxState *state, Dict *opiDict) {
- Object dict;
-
- if (globalParams->getPSOPI()) {
- opiDict->lookup("2.0", &dict);
- if (dict.isDict()) {
- opiBegin20(state, dict.getDict());
- dict.free();
- } else {
- dict.free();
- opiDict->lookup("1.3", &dict);
- if (dict.isDict()) {
- opiBegin13(state, dict.getDict());
- }
- dict.free();
- }
- }
-}
-
-void PSOutputDev::opiBegin20(GfxState *state, Dict *dict) {
- Object obj1, obj2, obj3, obj4;
- double width, height, left, right, top, bottom;
- int w, h;
- int i;
-
- writePS("%%BeginOPI: 2.0\n");
- writePS("%%Distilled\n");
-
- dict->lookup("F", &obj1);
- if (getFileSpec(&obj1, &obj2)) {
- writePSFmt("%%ImageFileName: {0:t}\n", obj2.getString());
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("MainImage", &obj1);
- if (obj1.isString()) {
- writePSFmt("%%MainImage: {0:t}\n", obj1.getString());
- }
- obj1.free();
-
- //~ ignoring 'Tags' entry
- //~ need to use writePSString() and deal with >255-char lines
-
- dict->lookup("Size", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 2) {
- obj1.arrayGet(0, &obj2);
- width = obj2.getNum();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- height = obj2.getNum();
- obj2.free();
- writePSFmt("%%ImageDimensions: {0:.4g} {1:.4g}\n", width, height);
- }
- obj1.free();
-
- dict->lookup("CropRect", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 4) {
- obj1.arrayGet(0, &obj2);
- left = obj2.getNum();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- top = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2, &obj2);
- right = obj2.getNum();
- obj2.free();
- obj1.arrayGet(3, &obj2);
- bottom = obj2.getNum();
- obj2.free();
- writePSFmt("%%ImageCropRect: {0:.4g} {1:.4g} {2:.4g} {3:.4g}\n",
- left, top, right, bottom);
- }
- obj1.free();
-
- dict->lookup("Overprint", &obj1);
- if (obj1.isBool()) {
- writePSFmt("%%ImageOverprint: {0:s}\n", obj1.getBool() ? "true" : "false");
- }
- obj1.free();
-
- dict->lookup("Inks", &obj1);
- if (obj1.isName()) {
- writePSFmt("%%ImageInks: {0:s}\n", obj1.getName());
- } else if (obj1.isArray() && obj1.arrayGetLength() >= 1) {
- obj1.arrayGet(0, &obj2);
- if (obj2.isName()) {
- writePSFmt("%%ImageInks: {0:s} {1:d}",
- obj2.getName(), (obj1.arrayGetLength() - 1) / 2);
- for (i = 1; i+1 < obj1.arrayGetLength(); i += 2) {
- obj1.arrayGet(i, &obj3);
- obj1.arrayGet(i+1, &obj4);
- if (obj3.isString() && obj4.isNum()) {
- writePS(" ");
- writePSString(obj3.getString());
- writePSFmt(" {0:.4g}", obj4.getNum());
- }
- obj3.free();
- obj4.free();
- }
- writePS("\n");
- }
- obj2.free();
- }
- obj1.free();
-
- writePS("gsave\n");
-
- writePS("%%BeginIncludedImage\n");
-
- dict->lookup("IncludedImageDimensions", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 2) {
- obj1.arrayGet(0, &obj2);
- w = obj2.getInt();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- h = obj2.getInt();
- obj2.free();
- writePSFmt("%%IncludedImageDimensions: {0:d} {1:d}\n", w, h);
- }
- obj1.free();
-
- dict->lookup("IncludedImageQuality", &obj1);
- if (obj1.isNum()) {
- writePSFmt("%%IncludedImageQuality: {0:.4g}\n", obj1.getNum());
- }
- obj1.free();
-
- ++opi20Nest;
-}
-
-void PSOutputDev::opiBegin13(GfxState *state, Dict *dict) {
- Object obj1, obj2;
- int left, right, top, bottom, samples, bits, width, height;
- double c, m, y, k;
- double llx, lly, ulx, uly, urx, ury, lrx, lry;
- double tllx, tlly, tulx, tuly, turx, tury, tlrx, tlry;
- double horiz, vert;
- int i, j;
-
- writePS("save\n");
- writePS("/opiMatrix2 matrix currentmatrix def\n");
- writePS("opiMatrix setmatrix\n");
-
- dict->lookup("F", &obj1);
- if (getFileSpec(&obj1, &obj2)) {
- writePSFmt("%ALDImageFileName: {0:t}\n", obj2.getString());
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("CropRect", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 4) {
- obj1.arrayGet(0, &obj2);
- left = obj2.getInt();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- top = obj2.getInt();
- obj2.free();
- obj1.arrayGet(2, &obj2);
- right = obj2.getInt();
- obj2.free();
- obj1.arrayGet(3, &obj2);
- bottom = obj2.getInt();
- obj2.free();
- writePSFmt("%ALDImageCropRect: {0:d} {1:d} {2:d} {3:d}\n",
- left, top, right, bottom);
- }
- obj1.free();
-
- dict->lookup("Color", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 5) {
- obj1.arrayGet(0, &obj2);
- c = obj2.getNum();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- m = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2, &obj2);
- y = obj2.getNum();
- obj2.free();
- obj1.arrayGet(3, &obj2);
- k = obj2.getNum();
- obj2.free();
- obj1.arrayGet(4, &obj2);
- if (obj2.isString()) {
- writePSFmt("%ALDImageColor: {0:.4g} {1:.4g} {2:.4g} {3:.4g} ",
- c, m, y, k);
- writePSString(obj2.getString());
- writePS("\n");
- }
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("ColorType", &obj1);
- if (obj1.isName()) {
- writePSFmt("%ALDImageColorType: {0:s}\n", obj1.getName());
- }
- obj1.free();
-
- //~ ignores 'Comments' entry
- //~ need to handle multiple lines
-
- dict->lookup("CropFixed", &obj1);
- if (obj1.isArray()) {
- obj1.arrayGet(0, &obj2);
- ulx = obj2.getNum();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- uly = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2, &obj2);
- lrx = obj2.getNum();
- obj2.free();
- obj1.arrayGet(3, &obj2);
- lry = obj2.getNum();
- obj2.free();
- writePSFmt("%ALDImageCropFixed: {0:.4g} {1:.4g} {2:.4g} {3:.4g}\n",
- ulx, uly, lrx, lry);
- }
- obj1.free();
-
- dict->lookup("GrayMap", &obj1);
- if (obj1.isArray()) {
- writePS("%ALDImageGrayMap:");
- for (i = 0; i < obj1.arrayGetLength(); i += 16) {
- if (i > 0) {
- writePS("\n%%+");
- }
- for (j = 0; j < 16 && i+j < obj1.arrayGetLength(); ++j) {
- obj1.arrayGet(i+j, &obj2);
- writePSFmt(" {0:d}", obj2.getInt());
- obj2.free();
- }
- }
- writePS("\n");
- }
- obj1.free();
-
- dict->lookup("ID", &obj1);
- if (obj1.isString()) {
- writePSFmt("%ALDImageID: {0:t}\n", obj1.getString());
- }
- obj1.free();
-
- dict->lookup("ImageType", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 2) {
- obj1.arrayGet(0, &obj2);
- samples = obj2.getInt();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- bits = obj2.getInt();
- obj2.free();
- writePSFmt("%ALDImageType: {0:d} {1:d}\n", samples, bits);
- }
- obj1.free();
-
- dict->lookup("Overprint", &obj1);
- if (obj1.isBool()) {
- writePSFmt("%ALDImageOverprint: {0:s}\n",
- obj1.getBool() ? "true" : "false");
- }
- obj1.free();
-
- dict->lookup("Position", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 8) {
- obj1.arrayGet(0, &obj2);
- llx = obj2.getNum();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- lly = obj2.getNum();
- obj2.free();
- obj1.arrayGet(2, &obj2);
- ulx = obj2.getNum();
- obj2.free();
- obj1.arrayGet(3, &obj2);
- uly = obj2.getNum();
- obj2.free();
- obj1.arrayGet(4, &obj2);
- urx = obj2.getNum();
- obj2.free();
- obj1.arrayGet(5, &obj2);
- ury = obj2.getNum();
- obj2.free();
- obj1.arrayGet(6, &obj2);
- lrx = obj2.getNum();
- obj2.free();
- obj1.arrayGet(7, &obj2);
- lry = obj2.getNum();
- obj2.free();
- opiTransform(state, llx, lly, &tllx, &tlly);
- opiTransform(state, ulx, uly, &tulx, &tuly);
- opiTransform(state, urx, ury, &turx, &tury);
- opiTransform(state, lrx, lry, &tlrx, &tlry);
- writePSFmt("%ALDImagePosition: {0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} {6:.4g} {7:.4g}\n",
- tllx, tlly, tulx, tuly, turx, tury, tlrx, tlry);
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("Resolution", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 2) {
- obj1.arrayGet(0, &obj2);
- horiz = obj2.getNum();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- vert = obj2.getNum();
- obj2.free();
- writePSFmt("%ALDImageResoution: {0:.4g} {1:.4g}\n", horiz, vert);
- obj2.free();
- }
- obj1.free();
-
- dict->lookup("Size", &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 2) {
- obj1.arrayGet(0, &obj2);
- width = obj2.getInt();
- obj2.free();
- obj1.arrayGet(1, &obj2);
- height = obj2.getInt();
- obj2.free();
- writePSFmt("%ALDImageDimensions: {0:d} {1:d}\n", width, height);
- }
- obj1.free();
-
- //~ ignoring 'Tags' entry
- //~ need to use writePSString() and deal with >255-char lines
-
- dict->lookup("Tint", &obj1);
- if (obj1.isNum()) {
- writePSFmt("%ALDImageTint: {0:.4g}\n", obj1.getNum());
- }
- obj1.free();
-
- dict->lookup("Transparency", &obj1);
- if (obj1.isBool()) {
- writePSFmt("%ALDImageTransparency: {0:s}\n",
- obj1.getBool() ? "true" : "false");
- }
- obj1.free();
-
- writePS("%%BeginObject: image\n");
- writePS("opiMatrix2 setmatrix\n");
- ++opi13Nest;
-}
-
-// Convert PDF user space coordinates to PostScript default user space
-// coordinates. This has to account for both the PDF CTM and the
-// PSOutputDev page-fitting transform.
-void PSOutputDev::opiTransform(GfxState *state, double x0, double y0,
- double *x1, double *y1) {
- double t;
-
- state->transform(x0, y0, x1, y1);
- *x1 += tx;
- *y1 += ty;
- if (rotate == 90) {
- t = *x1;
- *x1 = -*y1;
- *y1 = t;
- } else if (rotate == 180) {
- *x1 = -*x1;
- *y1 = -*y1;
- } else if (rotate == 270) {
- t = *x1;
- *x1 = *y1;
- *y1 = -t;
- }
- *x1 *= xScale;
- *y1 *= yScale;
-}
-
-void PSOutputDev::opiEnd(GfxState *state, Dict *opiDict) {
- Object dict;
-
- if (globalParams->getPSOPI()) {
- opiDict->lookup("2.0", &dict);
- if (dict.isDict()) {
- writePS("%%EndIncludedImage\n");
- writePS("%%EndOPI\n");
- writePS("grestore\n");
- --opi20Nest;
- dict.free();
- } else {
- dict.free();
- opiDict->lookup("1.3", &dict);
- if (dict.isDict()) {
- writePS("%%EndObject\n");
- writePS("restore\n");
- --opi13Nest;
- }
- dict.free();
- }
- }
-}
-
-GBool PSOutputDev::getFileSpec(Object *fileSpec, Object *fileName) {
- if (fileSpec->isString()) {
- fileSpec->copy(fileName);
- return gTrue;
- }
- if (fileSpec->isDict()) {
- fileSpec->dictLookup("DOS", fileName);
- if (fileName->isString()) {
- return gTrue;
- }
- fileName->free();
- fileSpec->dictLookup("Mac", fileName);
- if (fileName->isString()) {
- return gTrue;
- }
- fileName->free();
- fileSpec->dictLookup("Unix", fileName);
- if (fileName->isString()) {
- return gTrue;
- }
- fileName->free();
- fileSpec->dictLookup("F", fileName);
- if (fileName->isString()) {
- return gTrue;
- }
- fileName->free();
- }
- return gFalse;
-}
-#endif // OPI_SUPPORT
-
-void PSOutputDev::type3D0(GfxState * /*state*/, double wx, double wy) {
- writePSFmt("{0:.4g} {1:.4g} setcharwidth\n", wx, wy);
- writePS("q\n");
- t3NeedsRestore = gTrue;
-}
-
-void PSOutputDev::type3D1(GfxState * /*state*/, double wx, double wy,
- double llx, double lly, double urx, double ury) {
- t3WX = wx;
- t3WY = wy;
- t3LLX = llx;
- t3LLY = lly;
- t3URX = urx;
- t3URY = ury;
- t3String = new GString();
- writePS("q\n");
- t3Cacheable = gTrue;
- t3NeedsRestore = gTrue;
-}
-
-void PSOutputDev::drawForm(Ref id) {
- writePSFmt("f_{0:d}_{1:d}\n", id.num, id.gen);
-}
-
-void PSOutputDev::psXObject(Stream *psStream, Stream *level1Stream) {
- Stream *str;
- int c;
-
- if ((level == psLevel1 || level == psLevel1Sep) && level1Stream) {
- str = level1Stream;
- } else {
- str = psStream;
- }
- str->reset();
- while ((c = str->getChar()) != EOF) {
- writePSChar(c);
- }
- str->close();
-}
-
-//~ can nextFunc be reset to 0 -- maybe at the start of each page?
-//~ or maybe at the start of each color space / pattern?
-void PSOutputDev::cvtFunction(Function *func) {
- SampledFunction *func0;
- ExponentialFunction *func2;
- StitchingFunction *func3;
- PostScriptFunction *func4;
- int thisFunc, m, n, nSamples, i, j, k;
-
- switch (func->getType()) {
-
- case -1: // identity
- writePS("{}\n");
- break;
-
- case 0: // sampled
- func0 = (SampledFunction *)func;
- thisFunc = nextFunc++;
- m = func0->getInputSize();
- n = func0->getOutputSize();
- nSamples = n;
- for (i = 0; i < m; ++i) {
- nSamples *= func0->getSampleSize(i);
- }
- writePSFmt("/xpdfSamples{0:d} [\n", thisFunc);
- for (i = 0; i < nSamples; ++i) {
- writePSFmt("{0:.4g}\n", func0->getSamples()[i]);
- }
- writePS("] def\n");
- writePSFmt("{{ {0:d} array {1:d} array {2:d} 2 roll\n", 2*m, m, m+2);
- // [e01] [efrac] x0 x1 ... xm-1
- for (i = m-1; i >= 0; --i) {
- // [e01] [efrac] x0 x1 ... xi
- writePSFmt("{0:.4g} sub {1:.4g} mul {2:.4g} add\n",
- func0->getDomainMin(i),
- (func0->getEncodeMax(i) - func0->getEncodeMin(i)) /
- (func0->getDomainMax(i) - func0->getDomainMin(i)),
- func0->getEncodeMin(i));
- // [e01] [efrac] x0 x1 ... xi-1 xi'
- writePSFmt("dup 0 lt {{ pop 0 }} {{ dup {0:d} gt {{ pop {1:d} }} if }} ifelse\n",
- func0->getSampleSize(i) - 1, func0->getSampleSize(i) - 1);
- // [e01] [efrac] x0 x1 ... xi-1 xi'
- writePS("dup floor cvi exch dup ceiling cvi exch 2 index sub\n");
- // [e01] [efrac] x0 x1 ... xi-1 floor(xi') ceiling(xi') xi'-floor(xi')
- writePSFmt("{0:d} index {1:d} 3 2 roll put\n", i+3, i);
- // [e01] [efrac] x0 x1 ... xi-1 floor(xi') ceiling(xi')
- writePSFmt("{0:d} index {1:d} 3 2 roll put\n", i+3, 2*i+1);
- // [e01] [efrac] x0 x1 ... xi-1 floor(xi')
- writePSFmt("{0:d} index {1:d} 3 2 roll put\n", i+2, 2*i);
- // [e01] [efrac] x0 x1 ... xi-1
- }
- // [e01] [efrac]
- for (i = 0; i < n; ++i) {
- // [e01] [efrac] y(0) ... y(i-1)
- for (j = 0; j < (1<<m); ++j) {
- // [e01] [efrac] y(0) ... y(i-1) s(0) s(1) ... s(j-1)
- writePSFmt("xpdfSamples{0:d}\n", thisFunc);
- k = m - 1;
- writePSFmt("{0:d} index {1:d} get\n", i+j+2, 2 * k + ((j >> k) & 1));
- for (k = m - 2; k >= 0; --k) {
- writePSFmt("{0:d} mul {1:d} index {2:d} get add\n",
- func0->getSampleSize(k),
- i + j + 3,
- 2 * k + ((j >> k) & 1));
- }
- if (n > 1) {
- writePSFmt("{0:d} mul {1:d} add ", n, i);
- }
- writePS("get\n");
- }
- // [e01] [efrac] y(0) ... y(i-1) s(0) s(1) ... s(2^m-1)
- for (j = 0; j < m; ++j) {
- // [e01] [efrac] y(0) ... y(i-1) s(0) s(1) ... s(2^(m-j)-1)
- for (k = 0; k < (1 << (m - j)); k += 2) {
- // [e01] [efrac] y(0) ... y(i-1) <k/2 s' values> <2^(m-j)-k s values>
- writePSFmt("{0:d} index {1:d} get dup\n",
- i + k/2 + (1 << (m-j)) - k, j);
- writePS("3 2 roll mul exch 1 exch sub 3 2 roll mul add\n");
- writePSFmt("{0:d} 1 roll\n", k/2 + (1 << m-j) - k - 1);
- }
- // [e01] [efrac] s'(0) s'(1) ... s(2^(m-j-1)-1)
- }
- // [e01] [efrac] y(0) ... y(i-1) s
- writePSFmt("{0:.4g} mul {1:.4g} add\n",
- func0->getDecodeMax(i) - func0->getDecodeMin(i),
- func0->getDecodeMin(i));
- writePSFmt("dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
- func0->getRangeMin(i), func0->getRangeMin(i),
- func0->getRangeMax(i), func0->getRangeMax(i));
- // [e01] [efrac] y(0) ... y(i-1) y(i)
- }
- // [e01] [efrac] y(0) ... y(n-1)
- writePSFmt("{0:d} {1:d} roll pop pop }}\n", n+2, n);
- break;
-
- case 2: // exponential
- func2 = (ExponentialFunction *)func;
- n = func2->getOutputSize();
- writePSFmt("{{ dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
- func2->getDomainMin(0), func2->getDomainMin(0),
- func2->getDomainMax(0), func2->getDomainMax(0));
- // x
- for (i = 0; i < n; ++i) {
- // x y(0) .. y(i-1)
- writePSFmt("{0:d} index {1:.4g} exp {2:.4g} mul {3:.4g} add\n",
- i, func2->getE(), func2->getC1()[i] - func2->getC0()[i],
- func2->getC0()[i]);
- if (func2->getHasRange()) {
- writePSFmt("dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
- func2->getRangeMin(i), func2->getRangeMin(i),
- func2->getRangeMax(i), func2->getRangeMax(i));
- }
- }
- // x y(0) .. y(n-1)
- writePSFmt("{0:d} {1:d} roll pop }}\n", n+1, n);
- break;
-
- case 3: // stitching
- func3 = (StitchingFunction *)func;
- thisFunc = nextFunc++;
- for (i = 0; i < func3->getNumFuncs(); ++i) {
- cvtFunction(func3->getFunc(i));
- writePSFmt("/xpdfFunc{0:d}_{1:d} exch def\n", thisFunc, i);
- }
- writePSFmt("{{ dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
- func3->getDomainMin(0), func3->getDomainMin(0),
- func3->getDomainMax(0), func3->getDomainMax(0));
- for (i = 0; i < func3->getNumFuncs() - 1; ++i) {
- writePSFmt("dup {0:.4g} lt {{ {1:.4g} sub {2:.4g} mul {3:.4g} add xpdfFunc{4:d}_{5:d} }} {{\n",
- func3->getBounds()[i+1],
- func3->getBounds()[i],
- func3->getScale()[i],
- func3->getEncode()[2*i],
- thisFunc, i);
- }
- writePSFmt("{0:.4g} sub {1:.4g} mul {2:.4g} add xpdfFunc{3:d}_{4:d}\n",
- func3->getBounds()[i],
- func3->getScale()[i],
- func3->getEncode()[2*i],
- thisFunc, i);
- for (i = 0; i < func3->getNumFuncs() - 1; ++i) {
- writePS("} ifelse\n");
- }
- writePS("}\n");
- break;
-
- case 4: // PostScript
- func4 = (PostScriptFunction *)func;
- writePS(func4->getCodeString()->getCString());
- writePS("\n");
- break;
- }
-}
-
-void PSOutputDev::writePSChar(char c) {
- if (t3String) {
- t3String->append(c);
- } else {
- (*outputFunc)(outputStream, &c, 1);
- }
-}
-
-void PSOutputDev::writePS(char *s) {
- if (t3String) {
- t3String->append(s);
- } else {
- (*outputFunc)(outputStream, s, strlen(s));
- }
-}
-
-void PSOutputDev::writePSFmt(const char *fmt, ...) {
- va_list args;
- GString *buf;
-
- va_start(args, fmt);
- if (t3String) {
- t3String->appendfv((char *)fmt, args);
- } else {
- buf = GString::formatv((char *)fmt, args);
- (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
- delete buf;
- }
- va_end(args);
-}
-
-void PSOutputDev::writePSString(GString *s) {
- Guchar *p;
- int n, line;
- char buf[8];
-
- writePSChar('(');
- line = 1;
- for (p = (Guchar *)s->getCString(), n = s->getLength(); n; ++p, --n) {
- if (line >= 64) {
- writePSChar('\\');
- writePSChar('\n');
- line = 0;
- }
- if (*p == '(' || *p == ')' || *p == '\\') {
- writePSChar('\\');
- writePSChar((char)*p);
- line += 2;
- } else if (*p < 0x20 || *p >= 0x80) {
- sprintf(buf, "\\%03o", *p);
- writePS(buf);
- line += 4;
- } else {
- writePSChar((char)*p);
- ++line;
- }
- }
- writePSChar(')');
-}
-
-void PSOutputDev::writePSName(char *s) {
- char *p;
- char c;
-
- p = s;
- while ((c = *p++)) {
- if (c <= (char)0x20 || c >= (char)0x7f ||
- c == '(' || c == ')' || c == '<' || c == '>' ||
- c == '[' || c == ']' || c == '{' || c == '}' ||
- c == '/' || c == '%') {
- writePSFmt("#{0:02x}", c & 0xff);
- } else {
- writePSChar(c);
- }
- }
-}
-
-GString *PSOutputDev::filterPSName(GString *name) {
- GString *name2;
- char buf[8];
- int i;
- char c;
-
- name2 = new GString();
-
- // ghostscript chokes on names that begin with out-of-limits
- // numbers, e.g., 1e4foo is handled correctly (as a name), but
- // 1e999foo generates a limitcheck error
- c = name->getChar(0);
- if (c >= '0' && c <= '9') {
- name2->append('f');
- }
-
- for (i = 0; i < name->getLength(); ++i) {
- c = name->getChar(i);
- if (c <= (char)0x20 || c >= (char)0x7f ||
- c == '(' || c == ')' || c == '<' || c == '>' ||
- c == '[' || c == ']' || c == '{' || c == '}' ||
- c == '/' || c == '%') {
- sprintf(buf, "#%02x", c & 0xff);
- name2->append(buf);
- } else {
- name2->append(c);
- }
- }
- return name2;
-}
-
-// Write a DSC-compliant <textline>.
-void PSOutputDev::writePSTextLine(GString *s) {
- int i, j, step;
- int c;
-
- // - DSC comments must be printable ASCII; control chars and
- // backslashes have to be escaped (we do cheap Unicode-to-ASCII
- // conversion by simply ignoring the high byte)
- // - lines are limited to 255 chars (we limit to 200 here to allow
- // for the keyword, which was emitted by the caller)
- // - lines that start with a left paren are treated as <text>
- // instead of <textline>, so we escape a leading paren
- if (s->getLength() >= 2 &&
- (s->getChar(0) & 0xff) == 0xfe &&
- (s->getChar(1) & 0xff) == 0xff) {
- i = 3;
- step = 2;
- } else {
- i = 0;
- step = 1;
- }
- for (j = 0; i < s->getLength() && j < 200; i += step) {
- c = s->getChar(i) & 0xff;
- if (c == '\\') {
- writePS("\\\\");
- j += 2;
- } else if (c < 0x20 || c > 0x7e || (j == 0 && c == '(')) {
- writePSFmt("\\{0:03o}", c);
- j += 4;
- } else {
- writePSChar(c);
- ++j;
- }
- }
- writePS("\n");
-}
diff --git a/kpdf/xpdf/xpdf/PSOutputDev.cpp b/kpdf/xpdf/xpdf/PSOutputDev.cpp
new file mode 100644
index 00000000..9d1d7648
--- /dev/null
+++ b/kpdf/xpdf/xpdf/PSOutputDev.cpp
@@ -0,0 +1,6307 @@
+//========================================================================
+//
+// PSOutputDev.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+#include <locale.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdarg.h>
+#include <signal.h>
+#include <math.h>
+#include "GString.h"
+#include "GList.h"
+#include "config.h"
+#include "GlobalParams.h"
+#include "Object.h"
+#include "Error.h"
+#include "Function.h"
+#include "Gfx.h"
+#include "GfxState.h"
+#include "GfxFont.h"
+#include "UnicodeMap.h"
+#include "FoFiType1C.h"
+#include "FoFiTrueType.h"
+#include "Catalog.h"
+#include "Page.h"
+#include "Stream.h"
+#include "Annot.h"
+#include "XRef.h"
+#include "PreScanOutputDev.h"
+#if HAVE_SPLASH
+# include "Splash.h"
+# include "SplashBitmap.h"
+# include "SplashOutputDev.h"
+#endif
+#include "PSOutputDev.h"
+
+#ifdef MACOS
+// needed for setting type/creator of MacOS files
+#include "ICSupport.h"
+#endif
+
+// the MSVC math.h doesn't define this
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+//------------------------------------------------------------------------
+
+// Resolution at which pages with transparency will be rasterized.
+#define splashDPI 300
+
+//------------------------------------------------------------------------
+// PostScript prolog and setup
+//------------------------------------------------------------------------
+
+// The '~' escapes mark prolog code that is emitted only in certain
+// levels:
+//
+// ~[123][sn]
+// ^ ^----- s=psLevel*Sep, n=psLevel*
+// +----- 1=psLevel1*, 2=psLevel2*, 3=psLevel3*
+
+static char *prolog[] = {
+ "/xpdf 75 dict def xpdf begin",
+ "% PDF special state",
+ "/pdfDictSize 15 def",
+ "~1sn",
+ "/pdfStates 64 array def",
+ " 0 1 63 {",
+ " pdfStates exch pdfDictSize dict",
+ " dup /pdfStateIdx 3 index put",
+ " put",
+ " } for",
+ "~123sn",
+ "/pdfSetup {",
+ " 3 1 roll 2 array astore",
+ " /setpagedevice where {",
+ " pop 3 dict begin",
+ " /PageSize exch def",
+ " /ImagingBBox null def",
+ " /Policies 1 dict dup begin /PageSize 3 def end def",
+ " { /Duplex true def } if",
+ " currentdict end setpagedevice",
+ " } {",
+ " pop pop",
+ " } ifelse",
+ "} def",
+ "~1sn",
+ "/pdfOpNames [",
+ " /pdfFill /pdfStroke /pdfLastFill /pdfLastStroke",
+ " /pdfTextMat /pdfFontSize /pdfCharSpacing /pdfTextRender",
+ " /pdfTextRise /pdfWordSpacing /pdfHorizScaling /pdfTextClipPath",
+ "] def",
+ "~123sn",
+ "/pdfStartPage {",
+ "~1sn",
+ " pdfStates 0 get begin",
+ "~23sn",
+ " pdfDictSize dict begin",
+ "~23n",
+ " /pdfFillCS [] def",
+ " /pdfFillXform {} def",
+ " /pdfStrokeCS [] def",
+ " /pdfStrokeXform {} def",
+ "~1n",
+ " /pdfFill 0 def",
+ " /pdfStroke 0 def",
+ "~1s",
+ " /pdfFill [0 0 0 1] def",
+ " /pdfStroke [0 0 0 1] def",
+ "~23sn",
+ " /pdfFill [0] def",
+ " /pdfStroke [0] def",
+ " /pdfFillOP false def",
+ " /pdfStrokeOP false def",
+ "~123sn",
+ " /pdfLastFill false def",
+ " /pdfLastStroke false def",
+ " /pdfTextMat [1 0 0 1 0 0] def",
+ " /pdfFontSize 0 def",
+ " /pdfCharSpacing 0 def",
+ " /pdfTextRender 0 def",
+ " /pdfTextRise 0 def",
+ " /pdfWordSpacing 0 def",
+ " /pdfHorizScaling 1 def",
+ " /pdfTextClipPath [] def",
+ "} def",
+ "/pdfEndPage { end } def",
+ "~23s",
+ "% separation convention operators",
+ "/findcmykcustomcolor where {",
+ " pop",
+ "}{",
+ " /findcmykcustomcolor { 5 array astore } def",
+ "} ifelse",
+ "/setcustomcolor where {",
+ " pop",
+ "}{",
+ " /setcustomcolor {",
+ " exch",
+ " [ exch /Separation exch dup 4 get exch /DeviceCMYK exch",
+ " 0 4 getinterval cvx",
+ " [ exch /dup load exch { mul exch dup } /forall load",
+ " /pop load dup ] cvx",
+ " ] setcolorspace setcolor",
+ " } def",
+ "} ifelse",
+ "/customcolorimage where {",
+ " pop",
+ "}{",
+ " /customcolorimage {",
+ " gsave",
+ " [ exch /Separation exch dup 4 get exch /DeviceCMYK exch",
+ " 0 4 getinterval",
+ " [ exch /dup load exch { mul exch dup } /forall load",
+ " /pop load dup ] cvx",
+ " ] setcolorspace",
+ " 10 dict begin",
+ " /ImageType 1 def",
+ " /DataSource exch def",
+ " /ImageMatrix exch def",
+ " /BitsPerComponent exch def",
+ " /Height exch def",
+ " /Width exch def",
+ " /Decode [1 0] def",
+ " currentdict end",
+ " image",
+ " grestore",
+ " } def",
+ "} ifelse",
+ "~123sn",
+ "% PDF color state",
+ "~1n",
+ "/g { dup /pdfFill exch def setgray",
+ " /pdfLastFill true def /pdfLastStroke false def } def",
+ "/G { dup /pdfStroke exch def setgray",
+ " /pdfLastStroke true def /pdfLastFill false def } def",
+ "/fCol {",
+ " pdfLastFill not {",
+ " pdfFill setgray",
+ " /pdfLastFill true def /pdfLastStroke false def",
+ " } if",
+ "} def",
+ "/sCol {",
+ " pdfLastStroke not {",
+ " pdfStroke setgray",
+ " /pdfLastStroke true def /pdfLastFill false def",
+ " } if",
+ "} def",
+ "~1s",
+ "/k { 4 copy 4 array astore /pdfFill exch def setcmykcolor",
+ " /pdfLastFill true def /pdfLastStroke false def } def",
+ "/K { 4 copy 4 array astore /pdfStroke exch def setcmykcolor",
+ " /pdfLastStroke true def /pdfLastFill false def } def",
+ "/fCol {",
+ " pdfLastFill not {",
+ " pdfFill aload pop setcmykcolor",
+ " /pdfLastFill true def /pdfLastStroke false def",
+ " } if",
+ "} def",
+ "/sCol {",
+ " pdfLastStroke not {",
+ " pdfStroke aload pop setcmykcolor",
+ " /pdfLastStroke true def /pdfLastFill false def",
+ " } if",
+ "} def",
+ "~23n",
+ "/cs { /pdfFillXform exch def dup /pdfFillCS exch def",
+ " setcolorspace } def",
+ "/CS { /pdfStrokeXform exch def dup /pdfStrokeCS exch def",
+ " setcolorspace } def",
+ "/sc { pdfLastFill not { pdfFillCS setcolorspace } if",
+ " dup /pdfFill exch def aload pop pdfFillXform setcolor",
+ " /pdfLastFill true def /pdfLastStroke false def } def",
+ "/SC { pdfLastStroke not { pdfStrokeCS setcolorspace } if",
+ " dup /pdfStroke exch def aload pop pdfStrokeXform setcolor",
+ " /pdfLastStroke true def /pdfLastFill false def } def",
+ "/op { /pdfFillOP exch def",
+ " pdfLastFill { pdfFillOP setoverprint } if } def",
+ "/OP { /pdfStrokeOP exch def",
+ " pdfLastStroke { pdfStrokeOP setoverprint } if } def",
+ "/fCol {",
+ " pdfLastFill not {",
+ " pdfFillCS setcolorspace",
+ " pdfFill aload pop pdfFillXform setcolor",
+ " pdfFillOP setoverprint",
+ " /pdfLastFill true def /pdfLastStroke false def",
+ " } if",
+ "} def",
+ "/sCol {",
+ " pdfLastStroke not {",
+ " pdfStrokeCS setcolorspace",
+ " pdfStroke aload pop pdfStrokeXform setcolor",
+ " pdfStrokeOP setoverprint",
+ " /pdfLastStroke true def /pdfLastFill false def",
+ " } if",
+ "} def",
+ "~23s",
+ "/k { 4 copy 4 array astore /pdfFill exch def setcmykcolor",
+ " /pdfLastFill true def /pdfLastStroke false def } def",
+ "/K { 4 copy 4 array astore /pdfStroke exch def setcmykcolor",
+ " /pdfLastStroke true def /pdfLastFill false def } def",
+ "/ck { 6 copy 6 array astore /pdfFill exch def",
+ " findcmykcustomcolor exch setcustomcolor",
+ " /pdfLastFill true def /pdfLastStroke false def } def",
+ "/CK { 6 copy 6 array astore /pdfStroke exch def",
+ " findcmykcustomcolor exch setcustomcolor",
+ " /pdfLastStroke true def /pdfLastFill false def } def",
+ "/op { /pdfFillOP exch def",
+ " pdfLastFill { pdfFillOP setoverprint } if } def",
+ "/OP { /pdfStrokeOP exch def",
+ " pdfLastStroke { pdfStrokeOP setoverprint } if } def",
+ "/fCol {",
+ " pdfLastFill not {",
+ " pdfFill aload length 4 eq {",
+ " setcmykcolor",
+ " }{",
+ " findcmykcustomcolor exch setcustomcolor",
+ " } ifelse",
+ " pdfFillOP setoverprint",
+ " /pdfLastFill true def /pdfLastStroke false def",
+ " } if",
+ "} def",
+ "/sCol {",
+ " pdfLastStroke not {",
+ " pdfStroke aload length 4 eq {",
+ " setcmykcolor",
+ " }{",
+ " findcmykcustomcolor exch setcustomcolor",
+ " } ifelse",
+ " pdfStrokeOP setoverprint",
+ " /pdfLastStroke true def /pdfLastFill false def",
+ " } if",
+ "} def",
+ "~123sn",
+ "% build a font",
+ "/pdfMakeFont {",
+ " 4 3 roll findfont",
+ " 4 2 roll matrix scale makefont",
+ " dup length dict begin",
+ " { 1 index /FID ne { def } { pop pop } ifelse } forall",
+ " /Encoding exch def",
+ " currentdict",
+ " end",
+ " definefont pop",
+ "} def",
+ "/pdfMakeFont16 {",
+ " exch findfont",
+ " dup length dict begin",
+ " { 1 index /FID ne { def } { pop pop } ifelse } forall",
+ " /WMode exch def",
+ " currentdict",
+ " end",
+ " definefont pop",
+ "} def",
+ "~3sn",
+ "/pdfMakeFont16L3 {",
+ " 1 index /CIDFont resourcestatus {",
+ " pop pop 1 index /CIDFont findresource /CIDFontType known",
+ " } {",
+ " false",
+ " } ifelse",
+ " {",
+ " 0 eq { /Identity-H } { /Identity-V } ifelse",
+ " exch 1 array astore composefont pop",
+ " } {",
+ " pdfMakeFont16",
+ " } ifelse",
+ "} def",
+ "~123sn",
+ "% graphics state operators",
+ "~1sn",
+ "/q {",
+ " gsave",
+ " pdfOpNames length 1 sub -1 0 { pdfOpNames exch get load } for",
+ " pdfStates pdfStateIdx 1 add get begin",
+ " pdfOpNames { exch def } forall",
+ "} def",
+ "/Q { end grestore } def",
+ "~23sn",
+ "/q { gsave pdfDictSize dict begin } def",
+ "/Q {",
+ " end grestore",
+ " /pdfLastFill where {",
+ " pop",
+ " pdfLastFill {",
+ " pdfFillOP setoverprint",
+ " } {",
+ " pdfStrokeOP setoverprint",
+ " } ifelse",
+ " } if",
+ "} def",
+ "~123sn",
+ "/cm { concat } def",
+ "/d { setdash } def",
+ "/i { setflat } def",
+ "/j { setlinejoin } def",
+ "/J { setlinecap } def",
+ "/M { setmiterlimit } def",
+ "/w { setlinewidth } def",
+ "% path segment operators",
+ "/m { moveto } def",
+ "/l { lineto } def",
+ "/c { curveto } def",
+ "/re { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto",
+ " neg 0 rlineto closepath } def",
+ "/h { closepath } def",
+ "% path painting operators",
+ "/S { sCol stroke } def",
+ "/Sf { fCol stroke } def",
+ "/f { fCol fill } def",
+ "/f* { fCol eofill } def",
+ "% clipping operators",
+ "/W { clip newpath } def",
+ "/W* { eoclip newpath } def",
+ "/Ws { strokepath clip newpath } def",
+ "% text state operators",
+ "/Tc { /pdfCharSpacing exch def } def",
+ "/Tf { dup /pdfFontSize exch def",
+ " dup pdfHorizScaling mul exch matrix scale",
+ " pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put",
+ " exch findfont exch makefont setfont } def",
+ "/Tr { /pdfTextRender exch def } def",
+ "/Ts { /pdfTextRise exch def } def",
+ "/Tw { /pdfWordSpacing exch def } def",
+ "/Tz { /pdfHorizScaling exch def } def",
+ "% text positioning operators",
+ "/Td { pdfTextMat transform moveto } def",
+ "/Tm { /pdfTextMat exch def } def",
+ "% text string operators",
+ "/cshow where {",
+ " pop",
+ " /cshow2 {",
+ " dup {",
+ " pop pop",
+ " 1 string dup 0 3 index put 3 index exec",
+ " } exch cshow",
+ " pop pop",
+ " } def",
+ "}{",
+ " /cshow2 {",
+ " currentfont /FontType get 0 eq {",
+ " 0 2 2 index length 1 sub {",
+ " 2 copy get exch 1 add 2 index exch get",
+ " 2 copy exch 256 mul add",
+ " 2 string dup 0 6 5 roll put dup 1 5 4 roll put",
+ " 3 index exec",
+ " } for",
+ " } {",
+ " dup {",
+ " 1 string dup 0 3 index put 3 index exec",
+ " } forall",
+ " } ifelse",
+ " pop pop",
+ " } def",
+ "} ifelse",
+ "/awcp {", // awidthcharpath
+ " exch {",
+ " false charpath",
+ " 5 index 5 index rmoveto",
+ " 6 index eq { 7 index 7 index rmoveto } if",
+ " } exch cshow2",
+ " 6 {pop} repeat",
+ "} def",
+ "/Tj {",
+ " fCol", // because stringwidth has to draw Type 3 chars
+ " 1 index stringwidth pdfTextMat idtransform pop",
+ " sub 1 index length dup 0 ne { div } { pop pop 0 } ifelse",
+ " pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32",
+ " 4 3 roll pdfCharSpacing pdfHorizScaling mul add 0",
+ " pdfTextMat dtransform",
+ " 6 5 roll Tj1",
+ "} def",
+ "/Tj16 {",
+ " fCol", // because stringwidth has to draw Type 3 chars
+ " 2 index stringwidth pdfTextMat idtransform pop",
+ " sub exch div",
+ " pdfWordSpacing pdfHorizScaling mul 0 pdfTextMat dtransform 32",
+ " 4 3 roll pdfCharSpacing pdfHorizScaling mul add 0",
+ " pdfTextMat dtransform",
+ " 6 5 roll Tj1",
+ "} def",
+ "/Tj16V {",
+ " fCol", // because stringwidth has to draw Type 3 chars
+ " 2 index stringwidth pdfTextMat idtransform exch pop",
+ " sub exch div",
+ " 0 pdfWordSpacing pdfTextMat dtransform 32",
+ " 4 3 roll pdfCharSpacing add 0 exch",
+ " pdfTextMat dtransform",
+ " 6 5 roll Tj1",
+ "} def",
+ "/Tj1 {",
+ " 0 pdfTextRise pdfTextMat dtransform rmoveto",
+ " currentpoint 8 2 roll",
+ " pdfTextRender 1 and 0 eq {",
+ " 6 copy awidthshow",
+ " } if",
+ " pdfTextRender 3 and dup 1 eq exch 2 eq or {",
+ " 7 index 7 index moveto",
+ " 6 copy",
+ " currentfont /FontType get 3 eq { fCol } { sCol } ifelse",
+ " false awcp currentpoint stroke moveto",
+ " } if",
+ " pdfTextRender 4 and 0 ne {",
+ " 8 6 roll moveto",
+ " false awcp",
+ " /pdfTextClipPath [ pdfTextClipPath aload pop",
+ " {/moveto cvx}",
+ " {/lineto cvx}",
+ " {/curveto cvx}",
+ " {/closepath cvx}",
+ " pathforall ] def",
+ " currentpoint newpath moveto",
+ " } {",
+ " 8 {pop} repeat",
+ " } ifelse",
+ " 0 pdfTextRise neg pdfTextMat dtransform rmoveto",
+ "} def",
+ "/TJm { pdfFontSize 0.001 mul mul neg 0",
+ " pdfTextMat dtransform rmoveto } def",
+ "/TJmV { pdfFontSize 0.001 mul mul neg 0 exch",
+ " pdfTextMat dtransform rmoveto } def",
+ "/Tclip { pdfTextClipPath cvx exec clip newpath",
+ " /pdfTextClipPath [] def } def",
+ "~1ns",
+ "% Level 1 image operators",
+ "~1n",
+ "/pdfIm1 {",
+ " /pdfImBuf1 4 index string def",
+ " { currentfile pdfImBuf1 readhexstring pop } image",
+ "} def",
+ "~1s",
+ "/pdfIm1Sep {",
+ " /pdfImBuf1 4 index string def",
+ " /pdfImBuf2 4 index string def",
+ " /pdfImBuf3 4 index string def",
+ " /pdfImBuf4 4 index string def",
+ " { currentfile pdfImBuf1 readhexstring pop }",
+ " { currentfile pdfImBuf2 readhexstring pop }",
+ " { currentfile pdfImBuf3 readhexstring pop }",
+ " { currentfile pdfImBuf4 readhexstring pop }",
+ " true 4 colorimage",
+ "} def",
+ "~1ns",
+ "/pdfImM1 {",
+ " fCol /pdfImBuf1 4 index 7 add 8 idiv string def",
+ " { currentfile pdfImBuf1 readhexstring pop } imagemask",
+ "} def",
+ "/pdfImM1a {",
+ " { 2 copy get exch 1 add exch } imagemask",
+ " pop pop",
+ "} def",
+ "~23sn",
+ "% Level 2 image operators",
+ "/pdfImBuf 100 string def",
+ "/pdfIm {",
+ " image",
+ " { currentfile pdfImBuf readline",
+ " not { pop exit } if",
+ " (%-EOD-) eq { exit } if } loop",
+ "} def",
+ "~23s",
+ "/pdfImSep {",
+ " findcmykcustomcolor exch",
+ " dup /Width get /pdfImBuf1 exch string def",
+ " dup /Decode get aload pop 1 index sub /pdfImDecodeRange exch def",
+ " /pdfImDecodeLow exch def",
+ " begin Width Height BitsPerComponent ImageMatrix DataSource end",
+ " /pdfImData exch def",
+ " { pdfImData pdfImBuf1 readstring pop",
+ " 0 1 2 index length 1 sub {",
+ " 1 index exch 2 copy get",
+ " pdfImDecodeRange mul 255 div pdfImDecodeLow add round cvi",
+ " 255 exch sub put",
+ " } for }",
+ " 6 5 roll customcolorimage",
+ " { currentfile pdfImBuf readline",
+ " not { pop exit } if",
+ " (%-EOD-) eq { exit } if } loop",
+ "} def",
+ "~23sn",
+ "/pdfImM {",
+ " fCol imagemask",
+ " { currentfile pdfImBuf readline",
+ " not { pop exit } if",
+ " (%-EOD-) eq { exit } if } loop",
+ "} def",
+ "/pr { 2 index 2 index 3 2 roll putinterval 4 add } def",
+ "/pdfImClip {",
+ " gsave",
+ " 0 2 4 index length 1 sub {",
+ " dup 4 index exch 2 copy",
+ " get 5 index div put",
+ " 1 add 3 index exch 2 copy",
+ " get 3 index div put",
+ " } for",
+ " pop pop rectclip",
+ "} def",
+ "/pdfImClipEnd { grestore } def",
+ "~23sn",
+ "% shading operators",
+ "/colordelta {",
+ " false 0 1 3 index length 1 sub {",
+ " dup 4 index exch get 3 index 3 2 roll get sub abs 0.004 gt {",
+ " pop true",
+ " } if",
+ " } for",
+ " exch pop exch pop",
+ "} def",
+ "/funcCol { func n array astore } def",
+ "/funcSH {",
+ " dup 0 eq {",
+ " true",
+ " } {",
+ " dup 6 eq {",
+ " false",
+ " } {",
+ " 4 index 4 index funcCol dup",
+ " 6 index 4 index funcCol dup",
+ " 3 1 roll colordelta 3 1 roll",
+ " 5 index 5 index funcCol dup",
+ " 3 1 roll colordelta 3 1 roll",
+ " 6 index 8 index funcCol dup",
+ " 3 1 roll colordelta 3 1 roll",
+ " colordelta or or or",
+ " } ifelse",
+ " } ifelse",
+ " {",
+ " 1 add",
+ " 4 index 3 index add 0.5 mul exch 4 index 3 index add 0.5 mul exch",
+ " 6 index 6 index 4 index 4 index 4 index funcSH",
+ " 2 index 6 index 6 index 4 index 4 index funcSH",
+ " 6 index 2 index 4 index 6 index 4 index funcSH",
+ " 5 3 roll 3 2 roll funcSH pop pop",
+ " } {",
+ " pop 3 index 2 index add 0.5 mul 3 index 2 index add 0.5 mul",
+ "~23n",
+ " funcCol sc",
+ "~23s",
+ " funcCol aload pop k",
+ "~23sn",
+ " dup 4 index exch mat transform m",
+ " 3 index 3 index mat transform l",
+ " 1 index 3 index mat transform l",
+ " mat transform l pop pop h f*",
+ " } ifelse",
+ "} def",
+ "/axialCol {",
+ " dup 0 lt {",
+ " pop t0",
+ " } {",
+ " dup 1 gt {",
+ " pop t1",
+ " } {",
+ " dt mul t0 add",
+ " } ifelse",
+ " } ifelse",
+ " func n array astore",
+ "} def",
+ "/axialSH {",
+ " dup 0 eq {",
+ " true",
+ " } {",
+ " dup 8 eq {",
+ " false",
+ " } {",
+ " 2 index axialCol 2 index axialCol colordelta",
+ " } ifelse",
+ " } ifelse",
+ " {",
+ " 1 add 3 1 roll 2 copy add 0.5 mul",
+ " dup 4 3 roll exch 4 index axialSH",
+ " exch 3 2 roll axialSH",
+ " } {",
+ " pop 2 copy add 0.5 mul",
+ "~23n",
+ " axialCol sc",
+ "~23s",
+ " axialCol aload pop k",
+ "~23sn",
+ " exch dup dx mul x0 add exch dy mul y0 add",
+ " 3 2 roll dup dx mul x0 add exch dy mul y0 add",
+ " dx abs dy abs ge {",
+ " 2 copy yMin sub dy mul dx div add yMin m",
+ " yMax sub dy mul dx div add yMax l",
+ " 2 copy yMax sub dy mul dx div add yMax l",
+ " yMin sub dy mul dx div add yMin l",
+ " h f*",
+ " } {",
+ " exch 2 copy xMin sub dx mul dy div add xMin exch m",
+ " xMax sub dx mul dy div add xMax exch l",
+ " exch 2 copy xMax sub dx mul dy div add xMax exch l",
+ " xMin sub dx mul dy div add xMin exch l",
+ " h f*",
+ " } ifelse",
+ " } ifelse",
+ "} def",
+ "/radialCol {",
+ " dup t0 lt {",
+ " pop t0",
+ " } {",
+ " dup t1 gt {",
+ " pop t1",
+ " } if",
+ " } ifelse",
+ " func n array astore",
+ "} def",
+ "/radialSH {",
+ " dup 0 eq {",
+ " true",
+ " } {",
+ " dup 8 eq {",
+ " false",
+ " } {",
+ " 2 index dt mul t0 add radialCol",
+ " 2 index dt mul t0 add radialCol colordelta",
+ " } ifelse",
+ " } ifelse",
+ " {",
+ " 1 add 3 1 roll 2 copy add 0.5 mul",
+ " dup 4 3 roll exch 4 index radialSH",
+ " exch 3 2 roll radialSH",
+ " } {",
+ " pop 2 copy add 0.5 mul dt mul t0 add",
+ "~23n",
+ " radialCol sc",
+ "~23s",
+ " radialCol aload pop k",
+ "~23sn",
+ " encl {",
+ " exch dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
+ " 0 360 arc h",
+ " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
+ " 360 0 arcn h f",
+ " } {",
+ " 2 copy",
+ " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
+ " a1 a2 arcn",
+ " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
+ " a2 a1 arcn h",
+ " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
+ " a1 a2 arc",
+ " dup dx mul x0 add exch dup dy mul y0 add exch dr mul r0 add",
+ " a2 a1 arc h f",
+ " } ifelse",
+ " } ifelse",
+ "} def",
+ "~123sn",
+ "end",
+ NULL
+};
+
+static char *cmapProlog[] = {
+ "/CIDInit /ProcSet findresource begin",
+ "10 dict begin",
+ " begincmap",
+ " /CMapType 1 def",
+ " /CMapName /Identity-H def",
+ " /CIDSystemInfo 3 dict dup begin",
+ " /Registry (Adobe) def",
+ " /Ordering (Identity) def",
+ " /Supplement 0 def",
+ " end def",
+ " 1 begincodespacerange",
+ " <0000> <ffff>",
+ " endcodespacerange",
+ " 0 usefont",
+ " 1 begincidrange",
+ " <0000> <ffff> 0",
+ " endcidrange",
+ " endcmap",
+ " currentdict CMapName exch /CMap defineresource pop",
+ "end",
+ "10 dict begin",
+ " begincmap",
+ " /CMapType 1 def",
+ " /CMapName /Identity-V def",
+ " /CIDSystemInfo 3 dict dup begin",
+ " /Registry (Adobe) def",
+ " /Ordering (Identity) def",
+ " /Supplement 0 def",
+ " end def",
+ " /WMode 1 def",
+ " 1 begincodespacerange",
+ " <0000> <ffff>",
+ " endcodespacerange",
+ " 0 usefont",
+ " 1 begincidrange",
+ " <0000> <ffff> 0",
+ " endcidrange",
+ " endcmap",
+ " currentdict CMapName exch /CMap defineresource pop",
+ "end",
+ "end",
+ NULL
+};
+
+//------------------------------------------------------------------------
+// Fonts
+//------------------------------------------------------------------------
+
+struct PSSubstFont {
+ char *psName; // PostScript name
+ double mWidth; // width of 'm' character
+};
+
+static char *psFonts[] = {
+ "Courier",
+ "Courier-Bold",
+ "Courier-Oblique",
+ "Courier-BoldOblique",
+ "Helvetica",
+ "Helvetica-Bold",
+ "Helvetica-Oblique",
+ "Helvetica-BoldOblique",
+ "Symbol",
+ "Times-Roman",
+ "Times-Bold",
+ "Times-Italic",
+ "Times-BoldItalic",
+ "ZapfDingbats",
+ NULL
+};
+
+static PSSubstFont psSubstFonts[] = {
+ {"Helvetica", 0.833},
+ {"Helvetica-Oblique", 0.833},
+ {"Helvetica-Bold", 0.889},
+ {"Helvetica-BoldOblique", 0.889},
+ {"Times-Roman", 0.788},
+ {"Times-Italic", 0.722},
+ {"Times-Bold", 0.833},
+ {"Times-BoldItalic", 0.778},
+ {"Courier", 0.600},
+ {"Courier-Oblique", 0.600},
+ {"Courier-Bold", 0.600},
+ {"Courier-BoldOblique", 0.600}
+};
+
+// Info for 8-bit fonts
+struct PSFont8Info {
+ Ref fontID;
+ Gushort *codeToGID; // code-to-GID mapping for TrueType fonts
+};
+
+// Encoding info for substitute 16-bit font
+struct PSFont16Enc {
+ Ref fontID;
+ GString *enc;
+};
+
+//------------------------------------------------------------------------
+// process colors
+//------------------------------------------------------------------------
+
+#define psProcessCyan 1
+#define psProcessMagenta 2
+#define psProcessYellow 4
+#define psProcessBlack 8
+#define psProcessCMYK 15
+
+//------------------------------------------------------------------------
+// PSOutCustomColor
+//------------------------------------------------------------------------
+
+class PSOutCustomColor {
+public:
+
+ PSOutCustomColor(double cA, double mA,
+ double yA, double kA, GString *nameA);
+ ~PSOutCustomColor();
+
+ double c, m, y, k;
+ GString *name;
+ PSOutCustomColor *next;
+};
+
+PSOutCustomColor::PSOutCustomColor(double cA, double mA,
+ double yA, double kA, GString *nameA) {
+ c = cA;
+ m = mA;
+ y = yA;
+ k = kA;
+ name = nameA;
+ next = NULL;
+}
+
+PSOutCustomColor::~PSOutCustomColor() {
+ delete name;
+}
+
+//------------------------------------------------------------------------
+
+struct PSOutImgClipRect {
+ int x0, x1, y0, y1;
+};
+
+//------------------------------------------------------------------------
+// DeviceNRecoder
+//------------------------------------------------------------------------
+
+class DeviceNRecoder: public FilterStream {
+public:
+
+ DeviceNRecoder(Stream *strA, int widthA, int heightA,
+ GfxImageColorMap *colorMapA);
+ virtual ~DeviceNRecoder();
+ virtual StreamKind getKind() { return strWeird; }
+ virtual void reset();
+ virtual int getChar()
+ { return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx++]; }
+ virtual int lookChar()
+ { return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx]; }
+ virtual GString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
+ virtual GBool isBinary(GBool /*last*/ = gTrue) { return gTrue; }
+ virtual GBool isEncoder() { return gTrue; }
+
+private:
+
+ GBool fillBuf();
+
+ int width, height;
+ GfxImageColorMap *colorMap;
+ Function *func;
+ ImageStream *imgStr;
+ int buf[gfxColorMaxComps];
+ int pixelIdx;
+ int bufIdx;
+ int bufSize;
+};
+
+DeviceNRecoder::DeviceNRecoder(Stream *strA, int widthA, int heightA,
+ GfxImageColorMap *colorMapA):
+ FilterStream(strA) {
+ width = widthA;
+ height = heightA;
+ colorMap = colorMapA;
+ imgStr = NULL;
+ pixelIdx = 0;
+ bufIdx = gfxColorMaxComps;
+ bufSize = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
+ getAlt()->getNComps();
+ func = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
+ getTintTransformFunc();
+}
+
+DeviceNRecoder::~DeviceNRecoder() {
+ if (imgStr) {
+ delete imgStr;
+ }
+}
+
+void DeviceNRecoder::reset() {
+ imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
+ colorMap->getBits());
+ imgStr->reset();
+}
+
+GBool DeviceNRecoder::fillBuf() {
+ Guchar pixBuf[gfxColorMaxComps];
+ GfxColor color;
+ double x[gfxColorMaxComps], y[gfxColorMaxComps];
+ int i;
+
+ if (pixelIdx >= width * height) {
+ return gFalse;
+ }
+ imgStr->getPixel(pixBuf);
+ colorMap->getColor(pixBuf, &color);
+ for (i = 0;
+ i < ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->getNComps();
+ ++i) {
+ x[i] = colToDbl(color.c[i]);
+ }
+ func->transform(x, y);
+ for (i = 0; i < bufSize; ++i) {
+ buf[i] = (int)(y[i] * 255 + 0.5);
+ }
+ bufIdx = 0;
+ ++pixelIdx;
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// PSOutputDev
+//------------------------------------------------------------------------
+
+extern "C" {
+typedef void (*SignalFunc)(int);
+}
+
+static void outputToFile(void *stream, char *data, int len) {
+ fwrite(data, 1, len, (FILE *)stream);
+}
+
+PSOutputDev::PSOutputDev(char *fileName, char *pstitle, XRef *xrefA, Catalog *catalog,
+ int firstPage, int lastPage, PSOutMode modeA,
+ int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
+ GBool forceRasterizeA,
+ GBool manualCtrlA) {
+ FILE *f;
+ PSFileType fileTypeA;
+
+ underlayCbk = NULL;
+ underlayCbkData = NULL;
+ overlayCbk = NULL;
+ overlayCbkData = NULL;
+
+ fontIDs = NULL;
+ fontFileIDs = NULL;
+ fontFileNames = NULL;
+ font8Info = NULL;
+ font16Enc = NULL;
+ imgIDs = NULL;
+ formIDs = NULL;
+ xobjStack = NULL;
+ embFontList = NULL;
+ customColors = NULL;
+ haveTextClip = gFalse;
+ t3String = NULL;
+
+ forceRasterize = forceRasterizeA;
+
+ // open file or pipe
+ if (!strcmp(fileName, "-")) {
+ fileTypeA = psStdout;
+ f = stdout;
+ } else if (fileName[0] == '|') {
+ fileTypeA = psPipe;
+#ifdef HAVE_POPEN
+#ifndef WIN32
+ signal(SIGPIPE, (SignalFunc)SIG_IGN);
+#endif
+ if (!(f = popen(fileName + 1, "w"))) {
+ error(-1, "Couldn't run print command '%s'", fileName);
+ ok = gFalse;
+ return;
+ }
+#else
+ error(-1, "Print commands are not supported ('%s')", fileName);
+ ok = gFalse;
+ return;
+#endif
+ } else {
+ fileTypeA = psFile;
+ if (!(f = fopen(fileName, "w"))) {
+ error(-1, "Couldn't open PostScript file '%s'", fileName);
+ ok = gFalse;
+ return;
+ }
+ }
+
+ init(outputToFile, f, fileTypeA, pstitle,
+ xrefA, catalog, firstPage, lastPage, modeA,
+ imgLLXA, imgLLYA, imgURXA, imgURYA, manualCtrlA);
+}
+
+void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
+ PSFileType fileTypeA, char *pstitle, XRef *xrefA, Catalog *catalog,
+ int firstPage, int lastPage, PSOutMode modeA,
+ int imgLLXA, int imgLLYA, int imgURXA, int imgURYA,
+ GBool manualCtrlA) {
+ Page *page;
+ PDFRectangle *box;
+
+ // initialize
+ setlocale(LC_NUMERIC,"POSIX");
+ ok = gTrue;
+ outputFunc = outputFuncA;
+ outputStream = outputStreamA;
+ fileType = fileTypeA;
+ xref = xrefA;
+ level = globalParams->getPSLevel();
+ mode = modeA;
+ paperWidth = globalParams->getPSPaperWidth();
+ paperHeight = globalParams->getPSPaperHeight();
+ imgLLX = imgLLXA;
+ imgLLY = imgLLYA;
+ imgURX = imgURXA;
+ imgURY = imgURYA;
+ if (imgLLX == 0 && imgURX == 0 && imgLLY == 0 && imgURY == 0) {
+ globalParams->getPSImageableArea(&imgLLX, &imgLLY, &imgURX, &imgURY);
+ }
+ if (paperWidth < 0 || paperHeight < 0) {
+ // this check is needed in case the document has zero pages
+ if (firstPage > 0 && firstPage <= catalog->getNumPages()) {
+ page = catalog->getPage(firstPage);
+ paperWidth = (int)ceil(page->getMediaWidth());
+ paperHeight = (int)ceil(page->getMediaHeight());
+ } else {
+ paperWidth = 1;
+ paperHeight = 1;
+ }
+ imgLLX = imgLLY = 0;
+ imgURX = paperWidth;
+ imgURY = paperHeight;
+ }
+ preload = globalParams->getPSPreload();
+ manualCtrl = manualCtrlA;
+ if (mode == psModeForm) {
+ lastPage = firstPage;
+ }
+ processColors = 0;
+ inType3Char = gFalse;
+
+#if OPI_SUPPORT
+ // initialize OPI nesting levels
+ opi13Nest = 0;
+ opi20Nest = 0;
+#endif
+
+ tx0 = ty0 = -1;
+ xScale0 = yScale0 = 0;
+ rotate0 = -1;
+ clipLLX0 = clipLLY0 = 0;
+ clipURX0 = clipURY0 = -1;
+
+ // initialize fontIDs, fontFileIDs, and fontFileNames lists
+ fontIDSize = 64;
+ fontIDLen = 0;
+ fontIDs = (Ref *)gmallocn(fontIDSize, sizeof(Ref));
+ fontFileIDSize = 64;
+ fontFileIDLen = 0;
+ fontFileIDs = (Ref *)gmallocn(fontFileIDSize, sizeof(Ref));
+ fontFileNameSize = 64;
+ fontFileNameLen = 0;
+ fontFileNames = (GString **)gmallocn(fontFileNameSize, sizeof(GString *));
+ psFileNames = (GString **)gmallocn(fontFileNameSize, sizeof(GString *));
+ nextTrueTypeNum = 0;
+ font8InfoLen = 0;
+ font8InfoSize = 0;
+ font16EncLen = 0;
+ font16EncSize = 0;
+ imgIDLen = 0;
+ imgIDSize = 0;
+ formIDLen = 0;
+ formIDSize = 0;
+
+ xobjStack = new GList();
+ numSaves = 0;
+ numTilingPatterns = 0;
+ nextFunc = 0;
+
+ // initialize embedded font resource comment list
+ embFontList = new GString();
+
+ if (!manualCtrl) {
+ // this check is needed in case the document has zero pages
+ if (firstPage > 0 && firstPage <= catalog->getNumPages()) {
+ writeHeader(firstPage, lastPage,
+ catalog->getPage(firstPage)->getMediaBox(),
+ catalog->getPage(firstPage)->getCropBox(),
+ catalog->getPage(firstPage)->getRotate(), pstitle);
+ } else {
+ box = new PDFRectangle(0, 0, 1, 1);
+ writeHeader(firstPage, lastPage, box, box, 0, pstitle);
+ delete box;
+ }
+ if (mode != psModeForm) {
+ writePS("%%BeginProlog\n");
+ }
+ writeXpdfProcset();
+ if (mode != psModeForm) {
+ writePS("%%EndProlog\n");
+ writePS("%%BeginSetup\n");
+ }
+ writeDocSetup(catalog, firstPage, lastPage);
+ if (mode != psModeForm) {
+ writePS("%%EndSetup\n");
+ }
+ }
+
+ // initialize sequential page number
+ seqPage = 1;
+}
+
+PSOutputDev::~PSOutputDev() {
+ PSOutCustomColor *cc;
+ int i;
+
+ if (ok) {
+ if (!manualCtrl) {
+ writePS("%%Trailer\n");
+ writeTrailer();
+ if (mode != psModeForm) {
+ writePS("%%EOF\n");
+ }
+ }
+ if (fileType == psFile) {
+#ifdef MACOS
+ ICS_MapRefNumAndAssign((short)((FILE *)outputStream)->handle);
+#endif
+ fclose((FILE *)outputStream);
+ }
+#ifdef HAVE_POPEN
+ else if (fileType == psPipe) {
+ pclose((FILE *)outputStream);
+#ifndef WIN32
+ signal(SIGPIPE, (SignalFunc)SIG_DFL);
+#endif
+ }
+#endif
+ }
+ if (embFontList) {
+ delete embFontList;
+ }
+ if (fontIDs) {
+ gfree(fontIDs);
+ }
+ if (fontFileIDs) {
+ gfree(fontFileIDs);
+ }
+ if (fontFileNames) {
+ for (i = 0; i < fontFileNameLen; ++i) {
+ delete fontFileNames[i];
+ }
+ gfree(fontFileNames);
+ }
+ if (font8Info) {
+ for (i = 0; i < font8InfoLen; ++i) {
+ gfree(font8Info[i].codeToGID);
+ }
+ gfree(font8Info);
+ }
+ if (psFileNames) {
+ for (i = 0; i < fontFileNameLen; ++i) {
+ if (psFileNames[i])
+ delete psFileNames[i];
+ }
+ gfree(psFileNames);
+ }
+ if (font16Enc) {
+ for (i = 0; i < font16EncLen; ++i) {
+ delete font16Enc[i].enc;
+ }
+ gfree(font16Enc);
+ }
+ gfree(imgIDs);
+ gfree(formIDs);
+ if (xobjStack) {
+ delete xobjStack;
+ }
+ while (customColors) {
+ cc = customColors;
+ customColors = cc->next;
+ delete cc;
+ }
+}
+
+void PSOutputDev::writeHeader(int firstPage, int lastPage,
+ PDFRectangle *mediaBox, PDFRectangle *cropBox,
+ int pageRotate, char *pstitle) {
+ Object info, obj1;
+ double x1, y1, x2, y2;
+
+ switch (mode) {
+ case psModePS:
+ writePS("%!PS-Adobe-3.0\n");
+ break;
+ case psModeEPS:
+ writePS("%!PS-Adobe-3.0 EPSF-3.0\n");
+ break;
+ case psModeForm:
+ writePS("%!PS-Adobe-3.0 Resource-Form\n");
+ break;
+ }
+
+ xref->getDocInfo(&info);
+ if (info.isDict() && info.dictLookup("Creator", &obj1)->isString()) {
+ writePS("%%Creator: ");
+ writePSTextLine(obj1.getString());
+ }
+ obj1.free();
+ info.free();
+ if(pstitle) {
+ writePSFmt("%%Title: {0:s}\n", pstitle);
+ }
+ writePSFmt("%%LanguageLevel: {0:d}\n",
+ (level == psLevel1 || level == psLevel1Sep) ? 1 :
+ (level == psLevel2 || level == psLevel2Sep) ? 2 : 3);
+ if (level == psLevel1Sep || level == psLevel2Sep || level == psLevel3Sep) {
+ writePS("%%DocumentProcessColors: (atend)\n");
+ writePS("%%DocumentCustomColors: (atend)\n");
+ }
+ writePS("%%DocumentSuppliedResources: (atend)\n");
+
+ switch (mode) {
+ case psModePS:
+ writePSFmt("%%DocumentMedia: plain {0:d} {1:d} 0 () ()\n",
+ paperWidth, paperHeight);
+ writePSFmt("%%BoundingBox: 0 0 {0:d} {1:d}\n", paperWidth, paperHeight);
+ writePSFmt("%%Pages: {0:d}\n", lastPage - firstPage + 1);
+ writePS("%%EndComments\n");
+ writePS("%%BeginDefaults\n");
+ writePS("%%PageMedia: plain\n");
+ writePS("%%EndDefaults\n");
+ break;
+ case psModeEPS:
+ epsX1 = cropBox->x1;
+ epsY1 = cropBox->y1;
+ epsX2 = cropBox->x2;
+ epsY2 = cropBox->y2;
+ if (pageRotate == 0 || pageRotate == 180) {
+ x1 = epsX1;
+ y1 = epsY1;
+ x2 = epsX2;
+ y2 = epsY2;
+ } else { // pageRotate == 90 || pageRotate == 270
+ x1 = 0;
+ y1 = 0;
+ x2 = epsY2 - epsY1;
+ y2 = epsX2 - epsX1;
+ }
+ writePSFmt("%%BoundingBox: {0:d} {1:d} {2:d} {3:d}\n",
+ (int)floor(x1), (int)floor(y1), (int)ceil(x2), (int)ceil(y2));
+ if (floor(x1) != ceil(x1) || floor(y1) != ceil(y1) ||
+ floor(x2) != ceil(x2) || floor(y2) != ceil(y2)) {
+ writePSFmt("%%HiResBoundingBox: {0:.4g} {1:.4g} {2:.4g} {3:.4g}\n",
+ x1, y1, x2, y2);
+ }
+ writePS("%%EndComments\n");
+ break;
+ case psModeForm:
+ writePS("%%EndComments\n");
+ writePS("32 dict dup begin\n");
+ writePSFmt("/BBox [{0:d} {1:d} {2:d} {3:d}] def\n",
+ (int)floor(mediaBox->x1), (int)floor(mediaBox->y1),
+ (int)ceil(mediaBox->x2), (int)ceil(mediaBox->y2));
+ writePS("/FormType 1 def\n");
+ writePS("/Matrix [1 0 0 1 0 0] def\n");
+ break;
+ }
+}
+
+void PSOutputDev::writeXpdfProcset() {
+ GBool lev1, lev2, lev3, sep, nonSep;
+ char **p;
+ char *q;
+
+ writePSFmt("%%BeginResource: procset xpdf {0:s} 0\n", xpdfVersion);
+ writePSFmt("%%Copyright: {0:s}\n", xpdfCopyright);
+ lev1 = lev2 = lev3 = sep = nonSep = gTrue;
+ for (p = prolog; *p; ++p) {
+ if ((*p)[0] == '~') {
+ lev1 = lev2 = lev3 = sep = nonSep = gFalse;
+ for (q = *p + 1; *q; ++q) {
+ switch (*q) {
+ case '1': lev1 = gTrue; break;
+ case '2': lev2 = gTrue; break;
+ case '3': lev3 = gTrue; break;
+ case 's': sep = gTrue; break;
+ case 'n': nonSep = gTrue; break;
+ }
+ }
+ } else if ((level == psLevel1 && lev1 && nonSep) ||
+ (level == psLevel1Sep && lev1 && sep) ||
+ (level == psLevel2 && lev2 && nonSep) ||
+ (level == psLevel2Sep && lev2 && sep) ||
+ (level == psLevel3 && lev3 && nonSep) ||
+ (level == psLevel3Sep && lev3 && sep)) {
+ writePSFmt("{0:s}\n", *p);
+ }
+ }
+ writePS("%%EndResource\n");
+
+ if (level >= psLevel3) {
+ for (p = cmapProlog; *p; ++p) {
+ writePSFmt("{0:s}\n", *p);
+ }
+ }
+}
+
+void PSOutputDev::writeDocSetup(Catalog *catalog,
+ int firstPage, int lastPage) {
+ Page *page;
+ Dict *resDict;
+ Annots *annots;
+ Object obj1, obj2;
+ int pg, i;
+
+ if (mode == psModeForm) {
+ // swap the form and xpdf dicts
+ writePS("xpdf end begin dup begin\n");
+ } else {
+ writePS("xpdf begin\n");
+ }
+ for (pg = firstPage; pg <= lastPage; ++pg) {
+ page = catalog->getPage(pg);
+ if ((resDict = page->getResourceDict())) {
+ setupResources(resDict);
+ }
+ annots = new Annots(xref, catalog, page->getAnnots(&obj1));
+ obj1.free();
+ for (i = 0; i < annots->getNumAnnots(); ++i) {
+ if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) {
+ obj1.streamGetDict()->lookup("Resources", &obj2);
+ if (obj2.isDict()) {
+ setupResources(obj2.getDict());
+ }
+ obj2.free();
+ }
+ obj1.free();
+ }
+ delete annots;
+ }
+ if (mode != psModeForm) {
+ if (mode != psModeEPS && !manualCtrl) {
+ writePSFmt("{0:d} {1:d} {2:s} pdfSetup\n",
+ paperWidth, paperHeight,
+ globalParams->getPSDuplex() ? "true" : "false");
+ }
+#if OPI_SUPPORT
+ if (globalParams->getPSOPI()) {
+ writePS("/opiMatrix matrix currentmatrix def\n");
+ }
+#endif
+ }
+}
+
+void PSOutputDev::writePageTrailer() {
+ if (mode != psModeForm) {
+ writePS("pdfEndPage\n");
+ }
+}
+
+void PSOutputDev::writeTrailer() {
+ PSOutCustomColor *cc;
+
+ if (mode == psModeForm) {
+ writePS("/Foo exch /Form defineresource pop\n");
+ } else {
+ writePS("end\n");
+ writePS("%%DocumentSuppliedResources:\n");
+ writePS(embFontList->getCString());
+ if (level == psLevel1Sep || level == psLevel2Sep ||
+ level == psLevel3Sep) {
+ writePS("%%DocumentProcessColors:");
+ if (processColors & psProcessCyan) {
+ writePS(" Cyan");
+ }
+ if (processColors & psProcessMagenta) {
+ writePS(" Magenta");
+ }
+ if (processColors & psProcessYellow) {
+ writePS(" Yellow");
+ }
+ if (processColors & psProcessBlack) {
+ writePS(" Black");
+ }
+ writePS("\n");
+ writePS("%%DocumentCustomColors:");
+ for (cc = customColors; cc; cc = cc->next) {
+ writePSFmt(" ({0:s})", cc->name->getCString());
+ }
+ writePS("\n");
+ writePS("%%CMYKCustomColor:\n");
+ for (cc = customColors; cc; cc = cc->next) {
+ writePSFmt("%%+ {0:.4g} {1:.4g} {2:.4g} {3:.4g} ({4:t})\n",
+ cc->c, cc->m, cc->y, cc->k, cc->name);
+ }
+ }
+ }
+}
+
+void PSOutputDev::setupResources(Dict *resDict) {
+ Object xObjDict, xObjRef, xObj, patDict, patRef, pat, resObj;
+ Ref ref0, ref1;
+ GBool skip;
+ int i, j;
+
+ setupFonts(resDict);
+ setupImages(resDict);
+ setupForms(resDict);
+
+ //----- recursively scan XObjects
+ resDict->lookup("XObject", &xObjDict);
+ if (xObjDict.isDict()) {
+ for (i = 0; i < xObjDict.dictGetLength(); ++i) {
+
+ // avoid infinite recursion on XObjects
+ skip = gFalse;
+ if ((xObjDict.dictGetValNF(i, &xObjRef)->isRef())) {
+ ref0 = xObjRef.getRef();
+ for (j = 0; j < xobjStack->getLength(); ++j) {
+ ref1 = *(Ref *)xobjStack->get(j);
+ if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
+ skip = gTrue;
+ break;
+ }
+ }
+ if (!skip) {
+ xobjStack->append(&ref0);
+ }
+ }
+ if (!skip) {
+
+ // process the XObject's resource dictionary
+ xObjDict.dictGetVal(i, &xObj);
+ if (xObj.isStream()) {
+ xObj.streamGetDict()->lookup("Resources", &resObj);
+ if (resObj.isDict()) {
+ setupResources(resObj.getDict());
+ }
+ resObj.free();
+ }
+ xObj.free();
+ }
+
+ if (xObjRef.isRef() && !skip) {
+ xobjStack->del(xobjStack->getLength() - 1);
+ }
+ xObjRef.free();
+ }
+ }
+ xObjDict.free();
+
+ //----- recursively scan Patterns
+ resDict->lookup("Pattern", &patDict);
+ if (patDict.isDict()) {
+ inType3Char = gTrue;
+ for (i = 0; i < patDict.dictGetLength(); ++i) {
+
+ // avoid infinite recursion on Patterns
+ skip = gFalse;
+ if ((patDict.dictGetValNF(i, &patRef)->isRef())) {
+ ref0 = patRef.getRef();
+ for (j = 0; j < xobjStack->getLength(); ++j) {
+ ref1 = *(Ref *)xobjStack->get(j);
+ if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
+ skip = gTrue;
+ break;
+ }
+ }
+ if (!skip) {
+ xobjStack->append(&ref0);
+ }
+ }
+ if (!skip) {
+
+ // process the Pattern's resource dictionary
+ patDict.dictGetVal(i, &pat);
+ if (pat.isStream()) {
+ pat.streamGetDict()->lookup("Resources", &resObj);
+ if (resObj.isDict()) {
+ setupResources(resObj.getDict());
+ }
+ resObj.free();
+ }
+ pat.free();
+ }
+
+ if (patRef.isRef() && !skip) {
+ xobjStack->del(xobjStack->getLength() - 1);
+ }
+ patRef.free();
+ }
+ inType3Char = gFalse;
+ }
+ patDict.free();
+}
+
+void PSOutputDev::setupFonts(Dict *resDict) {
+ Object obj1, obj2;
+ Ref r;
+ GfxFontDict *gfxFontDict;
+ GfxFont *font;
+ int i;
+
+ if (forceRasterize) return;
+
+ gfxFontDict = NULL;
+ resDict->lookupNF("Font", &obj1);
+ if (obj1.isRef()) {
+ obj1.fetch(xref, &obj2);
+ if (obj2.isDict()) {
+ r = obj1.getRef();
+ gfxFontDict = new GfxFontDict(xref, &r, obj2.getDict());
+ }
+ obj2.free();
+ } else if (obj1.isDict()) {
+ gfxFontDict = new GfxFontDict(xref, NULL, obj1.getDict());
+ }
+ if (gfxFontDict) {
+ for (i = 0; i < gfxFontDict->getNumFonts(); ++i) {
+ if ((font = gfxFontDict->getFont(i))) {
+ setupFont(font, resDict);
+ }
+ }
+ delete gfxFontDict;
+ }
+ obj1.free();
+}
+
+void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
+ Ref fontFileID;
+ GString *name;
+ PSFontParam *fontParam;
+ GString *psName;
+ char buf[16];
+ GBool subst;
+ UnicodeMap *uMap;
+ char *charName;
+ double xs, ys;
+ int code;
+ double w1, w2;
+ double *fm;
+ int i, j;
+ DisplayFontParam *dfp;
+
+ // check if font is already set up
+ for (i = 0; i < fontIDLen; ++i) {
+ if (fontIDs[i].num == font->getID()->num &&
+ fontIDs[i].gen == font->getID()->gen) {
+ return;
+ }
+ }
+
+ // add entry to fontIDs list
+ if (fontIDLen >= fontIDSize) {
+ fontIDSize += 64;
+ fontIDs = (Ref *)greallocn(fontIDs, fontIDSize, sizeof(Ref));
+ }
+ fontIDs[fontIDLen++] = *font->getID();
+
+ xs = ys = 1;
+ subst = gFalse;
+
+ // check for resident 8-bit font
+ if (font->getName() &&
+ (fontParam = globalParams->getPSFont(font->getName()))) {
+ psName = new GString(fontParam->psFontName->getCString());
+
+ // check for embedded Type 1 font
+ } else if (globalParams->getPSEmbedType1() &&
+ font->getType() == fontType1 &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ psName = filterPSName(font->getEmbeddedFontName());
+ setupEmbeddedType1Font(&fontFileID, psName);
+
+ // check for embedded Type 1C font
+ } else if (globalParams->getPSEmbedType1() &&
+ font->getType() == fontType1C &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ // use the PDF font name because the embedded font name might
+ // not include the subset prefix
+ psName = filterPSName(font->getOrigName());
+ setupEmbeddedType1CFont(font, &fontFileID, psName);
+
+ // check for embedded OpenType - Type 1C font
+ } else if (globalParams->getPSEmbedType1() &&
+ font->getType() == fontType1COT &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ // use the PDF font name because the embedded font name might
+ // not include the subset prefix
+ psName = filterPSName(font->getOrigName());
+ setupEmbeddedOpenTypeT1CFont(font, &fontFileID, psName);
+
+ // check for external Type 1 font file
+ } else if (globalParams->getPSEmbedType1() &&
+ font->getType() == fontType1 &&
+ font->getExtFontFile()) {
+ // this assumes that the PS font name matches the PDF font name
+ psName = font->getName()->copy();
+ setupExternalType1Font(font->getExtFontFile(), psName);
+
+ // check for embedded TrueType font
+ } else if (globalParams->getPSEmbedTrueType() &&
+ (font->getType() == fontTrueType ||
+ font->getType() == fontTrueTypeOT) &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ psName = filterPSName(font->getEmbeddedFontName());
+ setupEmbeddedTrueTypeFont(font, &fontFileID, psName);
+
+ // check for external TrueType font file
+ } else if (globalParams->getPSEmbedTrueType() &&
+ font->getType() == fontTrueType &&
+ font->getExtFontFile()) {
+ psName = setupExternalTrueTypeFont(font);
+
+ // check for embedded CID PostScript font
+ } else if (globalParams->getPSEmbedCIDPostScript() &&
+ font->getType() == fontCIDType0C &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ psName = filterPSName(font->getEmbeddedFontName());
+ setupEmbeddedCIDType0Font(font, &fontFileID, psName);
+
+ // check for embedded CID TrueType font
+ } else if (globalParams->getPSEmbedCIDTrueType() &&
+ (font->getType() == fontCIDType2 ||
+ font->getType() == fontCIDType2OT) &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ psName = filterPSName(font->getEmbeddedFontName());
+ //~ should check to see if font actually uses vertical mode
+ setupEmbeddedCIDTrueTypeFont(font, &fontFileID, psName, gTrue);
+
+ // check for embedded OpenType - CID CFF font
+ } else if (globalParams->getPSEmbedCIDPostScript() &&
+ font->getType() == fontCIDType0COT &&
+ font->getEmbeddedFontID(&fontFileID)) {
+ psName = filterPSName(font->getEmbeddedFontName());
+ setupEmbeddedOpenTypeCFFFont(font, &fontFileID, psName);
+
+ // check for Type 3 font
+ } else if (font->getType() == fontType3) {
+ psName = GString::format("T3_{0:d}_{1:d}",
+ font->getID()->num, font->getID()->gen);
+ setupType3Font(font, psName, parentResDict);
+ // check for external CID TrueType font file
+ } else if (globalParams->getPSEmbedCIDTrueType() &&
+ font->getType() == fontCIDType2 &&
+ font->getExtFontFile()) {
+ psName = setupExternalCIDTrueTypeFont(font, font->getExtFontFile());
+ // do 8-bit font substitution
+ } else if (!font->isCIDFont()) {
+ subst = gTrue;
+ name = font->getName();
+ psName = NULL;
+ if (name) {
+ for (i = 0; psFonts[i]; ++i) {
+ if (name->cmp(psFonts[i]) == 0) {
+ psName = new GString(psFonts[i]);
+ break;
+ }
+ }
+ }
+ if (!psName) {
+ if (font->isFixedWidth()) {
+ i = 8;
+ } else if (font->isSerif()) {
+ i = 4;
+ } else {
+ i = 0;
+ }
+ if (font->isBold()) {
+ i += 2;
+ }
+ if (font->isItalic()) {
+ i += 1;
+ }
+ psName = new GString(psSubstFonts[i].psName);
+ for (code = 0; code < 256; ++code) {
+ if ((charName = ((Gfx8BitFont *)font)->getCharName(code)) &&
+ charName[0] == 'm' && charName[1] == '\0') {
+ break;
+ }
+ }
+ if (code < 256) {
+ w1 = ((Gfx8BitFont *)font)->getWidth(code);
+ } else {
+ w1 = 0;
+ }
+ w2 = psSubstFonts[i].mWidth;
+ xs = w1 / w2;
+ if (xs < 0.1) {
+ xs = 1;
+ }
+ if (font->getType() == fontType3) {
+ // This is a hack which makes it possible to substitute for some
+ // Type 3 fonts. The problem is that it's impossible to know what
+ // the base coordinate system used in the font is without actually
+ // rendering the font.
+ ys = xs;
+ fm = font->getFontMatrix();
+ if (fm[0] != 0) {
+ ys *= fm[3] / fm[0];
+ }
+ } else {
+ ys = 1;
+ }
+ }
+
+ // do 16-bit font substitution
+ } else if ((fontParam = globalParams->
+ getPSFont16(font->getName(),
+ ((GfxCIDFont *)font)->getCollection(),
+ font->getWMode()))) {
+ subst = gTrue;
+ psName = fontParam->psFontName->copy();
+ if (font16EncLen >= font16EncSize) {
+ font16EncSize += 16;
+ font16Enc = (PSFont16Enc *)greallocn(font16Enc,
+ font16EncSize, sizeof(PSFont16Enc));
+ }
+ font16Enc[font16EncLen].fontID = *font->getID();
+ font16Enc[font16EncLen].enc = fontParam->encoding->copy();
+ if ((uMap = globalParams->getUnicodeMap(font16Enc[font16EncLen].enc))) {
+ uMap->decRefCnt();
+ ++font16EncLen;
+ } else {
+ error(-1, "Couldn't find Unicode map for 16-bit font encoding '%s'",
+ font16Enc[font16EncLen].enc->getCString());
+ }
+
+ // try the display font for embedding
+ } else if (globalParams->getPSEmbedCIDTrueType() &&
+ ((GfxCIDFont *)font)->getCollection() &&
+ (dfp = globalParams->
+ getDisplayCIDFont(font->getName(),
+ ((GfxCIDFont *)font)->getCollection())) &&
+ dfp->kind == displayFontTT) {
+ psName = setupExternalCIDTrueTypeFont(font, dfp->tt.fileName, dfp->tt.faceIndex);
+
+ // give up - can't do anything with this font
+ } else {
+ error(-1, "Couldn't find a font to substitute for '%s' ('%s' character collection)",
+ font->getName() ? font->getName()->getCString() : "(unnamed)",
+ ((GfxCIDFont *)font)->getCollection()
+ ? ((GfxCIDFont *)font)->getCollection()->getCString()
+ : "(unknown)");
+ return;
+ }
+
+ // generate PostScript code to set up the font
+ if (font->isCIDFont()) {
+ if (level == psLevel3 || level == psLevel3Sep) {
+ writePSFmt("/F{0:d}_{1:d} /{2:t} {3:d} pdfMakeFont16L3\n",
+ font->getID()->num, font->getID()->gen, psName,
+ font->getWMode());
+ } else {
+ writePSFmt("/F{0:d}_{1:d} /{2:t} {3:d} pdfMakeFont16\n",
+ font->getID()->num, font->getID()->gen, psName,
+ font->getWMode());
+ }
+ } else {
+ writePSFmt("/F{0:d}_{1:d} /{2:t} {3:.4g} {4:.4g}\n",
+ font->getID()->num, font->getID()->gen, psName, xs, ys);
+ for (i = 0; i < 256; i += 8) {
+ writePS((char *)((i == 0) ? "[ " : " "));
+ for (j = 0; j < 8; ++j) {
+ if (font->getType() == fontTrueType &&
+ !subst &&
+ !((Gfx8BitFont *)font)->getHasEncoding()) {
+ sprintf(buf, "c%02x", i+j);
+ charName = buf;
+ } else {
+ charName = ((Gfx8BitFont *)font)->getCharName(i+j);
+ // this is a kludge for broken PDF files that encode char 32
+ // as .notdef
+ if (i+j == 32 && charName && !strcmp(charName, ".notdef")) {
+ charName = "space";
+ }
+ }
+ writePS("/");
+ writePSName(charName ? charName : (char *)".notdef");
+ // the empty name is legal in PDF and PostScript, but PostScript
+ // uses a double-slash (//...) for "immediately evaluated names",
+ // so we need to add a space character here
+ if (charName && !charName[0]) {
+ writePS(" ");
+ }
+ }
+ writePS((i == 256-8) ? (char *)"]\n" : (char *)"\n");
+ }
+ writePS("pdfMakeFont\n");
+ }
+
+ delete psName;
+}
+
+void PSOutputDev::setupEmbeddedType1Font(Ref *id, GString *psName) {
+ static char hexChar[17] = "0123456789abcdef";
+ Object refObj, strObj, obj1, obj2, obj3;
+ Dict *dict;
+ int length1, length2, length3;
+ int c;
+ int start[4];
+ GBool binMode;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen)
+ return;
+ }
+
+ // add entry to fontFileIDs list
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+
+ // get the font stream and info
+ refObj.initRef(id->num, id->gen);
+ refObj.fetch(xref, &strObj);
+ refObj.free();
+ if (!strObj.isStream()) {
+ error(-1, "Embedded font file object is not a stream");
+ goto err1;
+ }
+ if (!(dict = strObj.streamGetDict())) {
+ error(-1, "Embedded font stream is missing its dictionary");
+ goto err1;
+ }
+ dict->lookup("Length1", &obj1);
+ dict->lookup("Length2", &obj2);
+ dict->lookup("Length3", &obj3);
+ if (!obj1.isInt() || !obj2.isInt() || !obj3.isInt()) {
+ error(-1, "Missing length fields in embedded font stream dictionary");
+ obj1.free();
+ obj2.free();
+ obj3.free();
+ goto err1;
+ }
+ length1 = obj1.getInt();
+ length2 = obj2.getInt();
+ length3 = obj3.getInt();
+ obj1.free();
+ obj2.free();
+ obj3.free();
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // copy ASCII portion of font
+ strObj.streamReset();
+ for (i = 0; i < length1 && (c = strObj.streamGetChar()) != EOF; ++i) {
+ writePSChar(c);
+ }
+
+ // figure out if encrypted portion is binary or ASCII
+ binMode = gFalse;
+ for (i = 0; i < 4; ++i) {
+ start[i] = strObj.streamGetChar();
+ if (start[i] == EOF) {
+ error(-1, "Unexpected end of file in embedded font stream");
+ goto err1;
+ }
+ if (!((start[i] >= '0' && start[i] <= '9') ||
+ (start[i] >= 'A' && start[i] <= 'F') ||
+ (start[i] >= 'a' && start[i] <= 'f')))
+ binMode = gTrue;
+ }
+
+ // convert binary data to ASCII
+ if (binMode) {
+ for (i = 0; i < 4; ++i) {
+ writePSChar(hexChar[(start[i] >> 4) & 0x0f]);
+ writePSChar(hexChar[start[i] & 0x0f]);
+ }
+#if 0 // this causes trouble for various PostScript printers
+ // if Length2 is incorrect (too small), font data gets chopped, so
+ // we take a few extra characters from the trailer just in case
+ length2 += length3 >= 8 ? 8 : length3;
+#endif
+ while (i < length2) {
+ if ((c = strObj.streamGetChar()) == EOF) {
+ break;
+ }
+ writePSChar(hexChar[(c >> 4) & 0x0f]);
+ writePSChar(hexChar[c & 0x0f]);
+ if (++i % 32 == 0) {
+ writePSChar('\n');
+ }
+ }
+ if (i % 32 > 0) {
+ writePSChar('\n');
+ }
+
+ // already in ASCII format -- just copy it
+ } else {
+ for (i = 0; i < 4; ++i) {
+ writePSChar(start[i]);
+ }
+ for (i = 4; i < length2; ++i) {
+ if ((c = strObj.streamGetChar()) == EOF) {
+ break;
+ }
+ writePSChar(c);
+ }
+ }
+
+ // write padding and "cleartomark"
+ for (i = 0; i < 8; ++i) {
+ writePS("00000000000000000000000000000000"
+ "00000000000000000000000000000000\n");
+ }
+ writePS("cleartomark\n");
+
+ // ending comment
+ writePS("%%EndResource\n");
+
+ err1:
+ strObj.streamClose();
+ strObj.free();
+}
+
+//~ This doesn't handle .pfb files or binary eexec data (which only
+//~ happens in pfb files?).
+void PSOutputDev::setupExternalType1Font(GString *fileName, GString *psName) {
+ FILE *fontFile;
+ int c;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileNameLen; ++i) {
+ if (!fontFileNames[i]->cmp(fileName)) {
+ return;
+ }
+ }
+
+ // add entry to fontFileNames list
+ if (fontFileNameLen >= fontFileNameSize) {
+ fontFileNameSize += 64;
+ fontFileNames = (GString **)greallocn(fontFileNames,
+ fontFileNameSize, sizeof(GString *));
+ psFileNames = (GString **)greallocn(psFileNames,
+ fontFileNameSize, sizeof(GString *));
+ }
+ fontFileNames[fontFileNameLen] = fileName->copy();
+ psFileNames[fontFileNameLen] = psName->copy();
+ fontFileNameLen++;
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // copy the font file
+ if (!(fontFile = fopen(fileName->getCString(), "rb"))) {
+ error(-1, "Couldn't open external font file");
+ return;
+ }
+ while ((c = fgetc(fontFile)) != EOF) {
+ writePSChar(c);
+ }
+ fclose(fontFile);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
+ GString *psName) {
+ char *fontBuf;
+ int fontLen;
+ FoFiType1C *ffT1C;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen)
+ return;
+ }
+
+ // add entry to fontFileIDs list
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 1 font
+ fontBuf = font->readEmbFontFile(xref, &fontLen);
+ if ((ffT1C = FoFiType1C::make(fontBuf, fontLen))) {
+ ffT1C->convertToType1(psName->getCString(), NULL, gTrue,
+ outputFunc, outputStream);
+ delete ffT1C;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupEmbeddedOpenTypeT1CFont(GfxFont *font, Ref *id,
+ GString *psName) {
+ char *fontBuf;
+ int fontLen;
+ FoFiTrueType *ffTT;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen)
+ return;
+ }
+
+ // add entry to fontFileIDs list
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 1 font
+ fontBuf = font->readEmbFontFile(xref, &fontLen);
+ if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
+ if (ffTT->isOpenTypeCFF()) {
+ ffTT->convertToType1(psName->getCString(), NULL, gTrue,
+ outputFunc, outputStream);
+ }
+ delete ffTT;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id,
+ GString *psName) {
+ char *fontBuf;
+ int fontLen;
+ FoFiTrueType *ffTT;
+ Gushort *codeToGID;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen) {
+ psName->appendf("_{0:d}", nextTrueTypeNum++);
+ break;
+ }
+ }
+
+ // add entry to fontFileIDs list
+ if (i == fontFileIDLen) {
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+ }
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 42 font
+ fontBuf = font->readEmbFontFile(xref, &fontLen);
+ if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
+ codeToGID = ((Gfx8BitFont *)font)->getCodeToGIDMap(ffTT);
+ ffTT->convertToType42(psName->getCString(),
+ ((Gfx8BitFont *)font)->getHasEncoding()
+ ? ((Gfx8BitFont *)font)->getEncoding()
+ : (char **)NULL,
+ codeToGID, outputFunc, outputStream);
+ if (codeToGID) {
+ if (font8InfoLen >= font8InfoSize) {
+ font8InfoSize += 16;
+ font8Info = (PSFont8Info *)greallocn(font8Info,
+ font8InfoSize,
+ sizeof(PSFont8Info));
+ }
+ font8Info[font8InfoLen].fontID = *font->getID();
+ font8Info[font8InfoLen].codeToGID = codeToGID;
+ ++font8InfoLen;
+ }
+ delete ffTT;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+GString *PSOutputDev::setupExternalTrueTypeFont(GfxFont *font) {
+ GString *fileName;
+ char *fontBuf;
+ int fontLen;
+ FoFiTrueType *ffTT;
+ Gushort *codeToGID;
+ GString *psName;
+ int i;
+
+ // check if font is already embedded
+ fileName = font->getExtFontFile();
+ for (i = 0; i < fontFileNameLen; ++i) {
+ if (!fontFileNames[i]->cmp(fileName)) {
+ return psFileNames[i]->copy();
+ }
+ }
+
+ psName = filterPSName(font->getName());
+ // add entry to fontFileNames list
+ if (i == fontFileNameLen) {
+ if (fontFileNameLen >= fontFileNameSize) {
+ fontFileNameSize += 64;
+ fontFileNames =
+ (GString **)greallocn(fontFileNames,
+ fontFileNameSize, sizeof(GString *));
+ psFileNames =
+ (GString **)greallocn(psFileNames,
+ fontFileNameSize, sizeof(GString *));
+ }
+ fontFileNames[fontFileNameLen] = fileName->copy();
+ psFileNames[fontFileNameLen] = psName->copy();
+ fontFileNameLen++;
+ }
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 42 font
+ fontBuf = font->readExtFontFile(&fontLen);
+ if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
+ codeToGID = ((Gfx8BitFont *)font)->getCodeToGIDMap(ffTT);
+ ffTT->convertToType42(psName->getCString(),
+ ((Gfx8BitFont *)font)->getHasEncoding()
+ ? ((Gfx8BitFont *)font)->getEncoding()
+ : (char **)NULL,
+ codeToGID, outputFunc, outputStream);
+ if (codeToGID) {
+ if (font8InfoLen >= font8InfoSize) {
+ font8InfoSize += 16;
+ font8Info = (PSFont8Info *)greallocn(font8Info,
+ font8InfoSize,
+ sizeof(PSFont8Info));
+ }
+ font8Info[font8InfoLen].fontID = *font->getID();
+ font8Info[font8InfoLen].codeToGID = codeToGID;
+ ++font8InfoLen;
+ }
+ delete ffTT;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+ return psName;
+}
+
+GString *PSOutputDev::setupExternalCIDTrueTypeFont(GfxFont *font, GString *fileName, int faceIndex) {
+ FoFiTrueType *ffTT;
+ Gushort *codeToGID;
+ GString *psName;
+ int i;
+ GString *myFileName;
+
+ myFileName = fileName->copy();
+ if (faceIndex > 0) {
+ char tmp[32];
+ sprintf(tmp, ",%d", faceIndex);
+ myFileName->append(tmp);
+ }
+ // check if font is already embedded
+ for (i = 0; i < fontFileNameLen; ++i) {
+ if (!fontFileNames[i]->cmp(myFileName)) {
+ delete myFileName;
+ return psFileNames[i]->copy();
+ }
+ }
+
+ psName = filterPSName(font->getName());
+ // add entry to fontFileNames list
+ if (i == fontFileNameLen) {
+ if (fontFileNameLen >= fontFileNameSize) {
+ fontFileNameSize += 64;
+ fontFileNames =
+ (GString **)grealloc(fontFileNames,
+ fontFileNameSize * sizeof(GString *));
+ psFileNames =
+ (GString **)grealloc(psFileNames,
+ fontFileNameSize * sizeof(GString *));
+ }
+ }
+ fontFileNames[fontFileNameLen] = myFileName;
+ psFileNames[fontFileNameLen] = psName->copy();
+ fontFileNameLen++;
+
+ // beginning comment
+ writePSFmt("%%%%BeginResource: font %s\n", psName->getCString());
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a CID type2 font
+ if ((ffTT = FoFiTrueType::load(fileName->getCString(), faceIndex))) {
+ int n = ((GfxCIDFont *)font)->getCIDToGIDLen();
+ if (n) {
+ codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
+ memcpy(codeToGID, ((GfxCIDFont *)font)->getCIDToGID(), n * sizeof(Gushort));
+ } else {
+ codeToGID = ((GfxCIDFont *)font)->getCodeToGIDMap(ffTT, &n);
+ }
+ if (globalParams->getPSLevel() >= psLevel3) {
+ // Level 3: use a CID font
+ ffTT->convertToCIDType2(psName->getCString(),
+ codeToGID, n, gTrue,
+ outputFunc, outputStream);
+ } else {
+ // otherwise: use a non-CID composite font
+ ffTT->convertToType0(psName->getCString(),
+ codeToGID, n, gTrue,
+ outputFunc, outputStream);
+ }
+ gfree(codeToGID);
+ delete ffTT;
+ }
+
+ // ending comment
+ writePS("%%EndResource\n");
+ return psName;
+}
+
+void PSOutputDev::setupEmbeddedCIDType0Font(GfxFont *font, Ref *id,
+ GString *psName) {
+ char *fontBuf;
+ int fontLen;
+ FoFiType1C *ffT1C;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen)
+ return;
+ }
+
+ // add entry to fontFileIDs list
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 0 font
+ fontBuf = font->readEmbFontFile(xref, &fontLen);
+ if ((ffT1C = FoFiType1C::make(fontBuf, fontLen))) {
+ if (globalParams->getPSLevel() >= psLevel3) {
+ // Level 3: use a CID font
+ ffT1C->convertToCIDType0(psName->getCString(), outputFunc, outputStream);
+ } else {
+ // otherwise: use a non-CID composite font
+ ffT1C->convertToType0(psName->getCString(), outputFunc, outputStream);
+ }
+ delete ffT1C;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id,
+ GString *psName,
+ GBool needVerticalMetrics) {
+ char *fontBuf;
+ int fontLen;
+ FoFiTrueType *ffTT;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen) {
+ psName->appendf("_{0:d}", nextTrueTypeNum++);
+ break;
+ }
+ }
+
+ // add entry to fontFileIDs list
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 0 font
+ fontBuf = font->readEmbFontFile(xref, &fontLen);
+ if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
+ if (globalParams->getPSLevel() >= psLevel3) {
+ // Level 3: use a CID font
+ ffTT->convertToCIDType2(psName->getCString(),
+ ((GfxCIDFont *)font)->getCIDToGID(),
+ ((GfxCIDFont *)font)->getCIDToGIDLen(),
+ needVerticalMetrics,
+ outputFunc, outputStream);
+ } else {
+ // otherwise: use a non-CID composite font
+ ffTT->convertToType0(psName->getCString(),
+ ((GfxCIDFont *)font)->getCIDToGID(),
+ ((GfxCIDFont *)font)->getCIDToGIDLen(),
+ needVerticalMetrics,
+ outputFunc, outputStream);
+ }
+ delete ffTT;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupEmbeddedOpenTypeCFFFont(GfxFont *font, Ref *id,
+ GString *psName) {
+ char *fontBuf;
+ int fontLen;
+ FoFiTrueType *ffTT;
+ int i;
+
+ // check if font is already embedded
+ for (i = 0; i < fontFileIDLen; ++i) {
+ if (fontFileIDs[i].num == id->num &&
+ fontFileIDs[i].gen == id->gen)
+ return;
+ }
+
+ // add entry to fontFileIDs list
+ if (fontFileIDLen >= fontFileIDSize) {
+ fontFileIDSize += 64;
+ fontFileIDs = (Ref *)greallocn(fontFileIDs, fontFileIDSize, sizeof(Ref));
+ }
+ fontFileIDs[fontFileIDLen++] = *id;
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // convert it to a Type 0 font
+ fontBuf = font->readEmbFontFile(xref, &fontLen);
+ if ((ffTT = FoFiTrueType::make(fontBuf, fontLen))) {
+ if (ffTT->isOpenTypeCFF()) {
+ if (globalParams->getPSLevel() >= psLevel3) {
+ // Level 3: use a CID font
+ ffTT->convertToCIDType0(psName->getCString(),
+ outputFunc, outputStream);
+ } else {
+ // otherwise: use a non-CID composite font
+ ffTT->convertToType0(psName->getCString(), outputFunc, outputStream);
+ }
+ }
+ delete ffTT;
+ }
+ gfree(fontBuf);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupType3Font(GfxFont *font, GString *psName,
+ Dict *parentResDict) {
+ Dict *resDict;
+ Dict *charProcs;
+ Object charProc;
+ Gfx *gfx;
+ PDFRectangle box;
+ double *m;
+ GString *buf;
+ int i;
+
+ // set up resources used by font
+ if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
+ inType3Char = gTrue;
+ setupResources(resDict);
+ inType3Char = gFalse;
+ } else {
+ resDict = parentResDict;
+ }
+
+ // beginning comment
+ writePSFmt("%%BeginResource: font {0:t}\n", psName);
+ embFontList->append("%%+ font ");
+ embFontList->append(psName->getCString());
+ embFontList->append("\n");
+
+ // font dictionary
+ writePS("8 dict begin\n");
+ writePS("/FontType 3 def\n");
+ m = font->getFontMatrix();
+ writePSFmt("/FontMatrix [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] def\n",
+ m[0], m[1], m[2], m[3], m[4], m[5]);
+ m = font->getFontBBox();
+ writePSFmt("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
+ m[0], m[1], m[2], m[3]);
+ writePS("/Encoding 256 array def\n");
+ writePS(" 0 1 255 { Encoding exch /.notdef put } for\n");
+ writePS("/BuildGlyph {\n");
+ writePS(" exch /CharProcs get exch\n");
+ writePS(" 2 copy known not { pop /.notdef } if\n");
+ writePS(" get exec\n");
+ writePS("} bind def\n");
+ writePS("/BuildChar {\n");
+ writePS(" 1 index /Encoding get exch get\n");
+ writePS(" 1 index /BuildGlyph get exec\n");
+ writePS("} bind def\n");
+ if ((charProcs = ((Gfx8BitFont *)font)->getCharProcs())) {
+ writePSFmt("/CharProcs {0:d} dict def\n", charProcs->getLength());
+ writePS("CharProcs begin\n");
+ box.x1 = m[0];
+ box.y1 = m[1];
+ box.x2 = m[2];
+ box.y2 = m[3];
+ gfx = new Gfx(xref, this, resDict, &box, NULL);
+ inType3Char = gTrue;
+ for (i = 0; i < charProcs->getLength(); ++i) {
+ t3Cacheable = gFalse;
+ t3NeedsRestore = gFalse;
+ writePS("/");
+ writePSName(charProcs->getKey(i));
+ writePS(" {\n");
+ gfx->display(charProcs->getVal(i, &charProc));
+ charProc.free();
+ if (t3String) {
+ if (t3Cacheable) {
+ buf = GString::format("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} setcachedevice\n",
+ t3WX, t3WY, t3LLX, t3LLY, t3URX, t3URY);
+ } else {
+ buf = GString::format("{0:.4g} {1:.4g} setcharwidth\n", t3WX, t3WY);
+ }
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ (*outputFunc)(outputStream, t3String->getCString(),
+ t3String->getLength());
+ delete t3String;
+ t3String = NULL;
+ }
+ if (t3NeedsRestore) {
+ (*outputFunc)(outputStream, "Q\n", 2);
+ }
+ writePS("} def\n");
+ }
+ inType3Char = gFalse;
+ delete gfx;
+ writePS("end\n");
+ }
+ writePS("currentdict end\n");
+ writePSFmt("/{0:t} exch definefont pop\n", psName);
+
+ // ending comment
+ writePS("%%EndResource\n");
+}
+
+void PSOutputDev::setupImages(Dict *resDict) {
+ Object xObjDict, xObj, xObjRef, subtypeObj;
+ int i;
+
+ if (!(mode == psModeForm || inType3Char || preload)) {
+ return;
+ }
+
+ resDict->lookup("XObject", &xObjDict);
+ if (xObjDict.isDict()) {
+ for (i = 0; i < xObjDict.dictGetLength(); ++i) {
+ xObjDict.dictGetValNF(i, &xObjRef);
+ xObjDict.dictGetVal(i, &xObj);
+ if (xObj.isStream()) {
+ xObj.streamGetDict()->lookup("Subtype", &subtypeObj);
+ if (subtypeObj.isName("Image")) {
+ if (xObjRef.isRef()) {
+ setupImage(xObjRef.getRef(), xObj.getStream());
+ } else {
+ error(-1, "Image in resource dict is not an indirect reference");
+ }
+ }
+ subtypeObj.free();
+ }
+ xObj.free();
+ xObjRef.free();
+ }
+ }
+ xObjDict.free();
+}
+
+void PSOutputDev::setupImage(Ref id, Stream *str) {
+ GBool useRLE, useCompressed, useASCIIHex;
+ GString *s;
+ int c;
+ int size, line, col, i;
+
+ // check if image is already setup
+ for (i = 0; i < imgIDLen; ++i) {
+ if (imgIDs[i].num == id.num && imgIDs[i].gen == id.gen) {
+ return;
+ }
+ }
+
+ // add entry to imgIDs list
+ if (imgIDLen >= imgIDSize) {
+ if (imgIDSize == 0) {
+ imgIDSize = 64;
+ } else {
+ imgIDSize *= 2;
+ }
+ imgIDs = (Ref *)greallocn(imgIDs, imgIDSize, sizeof(Ref));
+ }
+ imgIDs[imgIDLen++] = id;
+
+ // filters
+ //~ this does not correctly handle the DeviceN color space
+ //~ -- need to use DeviceNRecoder
+ if (level < psLevel2) {
+ useRLE = gFalse;
+ useCompressed = gFalse;
+ useASCIIHex = gTrue;
+ } else {
+ s = str->getPSFilter(level < psLevel3 ? 2 : 3, "");
+ if (s) {
+ useRLE = gFalse;
+ useCompressed = gTrue;
+ delete s;
+ } else {
+ useRLE = gTrue;
+ useCompressed = gFalse;
+ }
+ useASCIIHex = level == psLevel1 || level == psLevel1Sep ||
+ globalParams->getPSASCIIHex();
+ }
+ if (useCompressed) {
+ str = str->getUndecodedStream();
+ }
+ if (useRLE) {
+ str = new RunLengthEncoder(str);
+ }
+ if (useASCIIHex) {
+ str = new ASCIIHexEncoder(str);
+ } else {
+ str = new ASCII85Encoder(str);
+ }
+
+ // compute image data size
+ str->reset();
+ col = size = 0;
+ do {
+ do {
+ c = str->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ if (c == 'z') {
+ ++col;
+ } else {
+ ++col;
+ for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
+ do {
+ c = str->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ ++col;
+ }
+ }
+ if (col > 225) {
+ ++size;
+ col = 0;
+ }
+ } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
+ // add one entry for the final line of data; add another entry
+ // because the RunLengthDecode filter may read past the end
+ ++size;
+ if (useRLE) {
+ ++size;
+ }
+ writePSFmt("{0:d} array dup /ImData_{1:d}_{2:d} exch def\n",
+ size, id.num, id.gen);
+ str->close();
+
+ // write the data into the array
+ str->reset();
+ line = col = 0;
+ writePS((char *)(useASCIIHex ? "dup 0 <" : "dup 0 <~"));
+ do {
+ do {
+ c = str->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ if (c == 'z') {
+ writePSChar(c);
+ ++col;
+ } else {
+ writePSChar(c);
+ ++col;
+ for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
+ do {
+ c = str->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ writePSChar(c);
+ ++col;
+ }
+ }
+ // each line is: "dup nnnnn <~...data...~> put<eol>"
+ // so max data length = 255 - 20 = 235
+ // chunks are 1 or 4 bytes each, so we have to stop at 232
+ // but make it 225 just to be safe
+ if (col > 225) {
+ writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
+ ++line;
+ writePSFmt((char *)(useASCIIHex ? "dup {0:d} <" : "dup {0:d} <~"), line);
+ col = 0;
+ }
+ } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
+ writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
+ if (useRLE) {
+ ++line;
+ writePSFmt("{0:d} <> put\n", line);
+ } else {
+ writePS("pop\n");
+ }
+ str->close();
+
+ delete str;
+}
+
+void PSOutputDev::setupForms(Dict *resDict) {
+ Object xObjDict, xObj, xObjRef, subtypeObj;
+ int i;
+
+ if (!preload) {
+ return;
+ }
+
+ resDict->lookup("XObject", &xObjDict);
+ if (xObjDict.isDict()) {
+ for (i = 0; i < xObjDict.dictGetLength(); ++i) {
+ xObjDict.dictGetValNF(i, &xObjRef);
+ xObjDict.dictGetVal(i, &xObj);
+ if (xObj.isStream()) {
+ xObj.streamGetDict()->lookup("Subtype", &subtypeObj);
+ if (subtypeObj.isName("Form")) {
+ if (xObjRef.isRef()) {
+ setupForm(xObjRef.getRef(), &xObj);
+ } else {
+ error(-1, "Form in resource dict is not an indirect reference");
+ }
+ }
+ subtypeObj.free();
+ }
+ xObj.free();
+ xObjRef.free();
+ }
+ }
+ xObjDict.free();
+}
+
+void PSOutputDev::setupForm(Ref id, Object *strObj) {
+ Dict *dict, *resDict;
+ Object matrixObj, bboxObj, resObj, obj1;
+ double m[6], bbox[4];
+ PDFRectangle box;
+ Gfx *gfx;
+ int i;
+
+ // check if form is already defined
+ for (i = 0; i < formIDLen; ++i) {
+ if (formIDs[i].num == id.num && formIDs[i].gen == id.gen) {
+ return;
+ }
+ }
+
+ // add entry to formIDs list
+ if (formIDLen >= formIDSize) {
+ if (formIDSize == 0) {
+ formIDSize = 64;
+ } else {
+ formIDSize *= 2;
+ }
+ formIDs = (Ref *)greallocn(formIDs, formIDSize, sizeof(Ref));
+ }
+ formIDs[formIDLen++] = id;
+
+ dict = strObj->streamGetDict();
+
+ // get bounding box
+ dict->lookup("BBox", &bboxObj);
+ if (!bboxObj.isArray()) {
+ bboxObj.free();
+ error(-1, "Bad form bounding box");
+ return;
+ }
+ for (i = 0; i < 4; ++i) {
+ bboxObj.arrayGet(i, &obj1);
+ bbox[i] = obj1.getNum();
+ obj1.free();
+ }
+ bboxObj.free();
+
+ // get matrix
+ dict->lookup("Matrix", &matrixObj);
+ if (matrixObj.isArray()) {
+ for (i = 0; i < 6; ++i) {
+ matrixObj.arrayGet(i, &obj1);
+ m[i] = obj1.getNum();
+ obj1.free();
+ }
+ } else {
+ m[0] = 1; m[1] = 0;
+ m[2] = 0; m[3] = 1;
+ m[4] = 0; m[5] = 0;
+ }
+ matrixObj.free();
+
+ // get resources
+ dict->lookup("Resources", &resObj);
+ resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
+
+ writePSFmt("/f_{0:d}_{1:d} {{\n", id.num, id.gen);
+ writePS("q\n");
+ writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] cm\n",
+ m[0], m[1], m[2], m[3], m[4], m[5]);
+
+ box.x1 = bbox[0];
+ box.y1 = bbox[1];
+ box.x2 = bbox[2];
+ box.y2 = bbox[3];
+ gfx = new Gfx(xref, this, resDict, &box, &box);
+ gfx->display(strObj);
+ delete gfx;
+
+ writePS("Q\n");
+ writePS("} def\n");
+
+ resObj.free();
+}
+
+GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
+ int rotateA, GBool useMediaBox, GBool crop,
+ int sliceX, int sliceY,
+ int sliceW, int sliceH,
+ GBool printing, Catalog *catalog,
+ GBool (*abortCheckCbk)(void *data),
+ void *abortCheckCbkData) {
+#if HAVE_SPLASH
+ PreScanOutputDev *scan;
+ GBool rasterize;
+ SplashOutputDev *splashOut;
+ SplashColor paperColor;
+ PDFRectangle box;
+ GfxState *state;
+ SplashBitmap *bitmap;
+ Stream *str0, *str;
+ Object obj;
+ Guchar *p;
+ Guchar col[4];
+ double m0, m1, m2, m3, m4, m5;
+ int c, w, h, x, y, comp, i;
+
+ if (!forceRasterize) {
+ scan = new PreScanOutputDev();
+ page->displaySlice(scan, 72, 72, rotateA, useMediaBox, crop,
+ sliceX, sliceY, sliceW, sliceH,
+ printing, catalog, abortCheckCbk, abortCheckCbkData);
+ rasterize = scan->usesTransparency();
+ delete scan;
+ } else {
+ rasterize = true;
+ }
+ if (!rasterize) {
+ return gTrue;
+ }
+
+ // rasterize the page
+ if (level == psLevel1) {
+ paperColor[0] = 0xff;
+ splashOut = new SplashOutputDev(splashModeMono8, 1, gFalse,
+ paperColor, gTrue, gFalse);
+#if SPLASH_CMYK
+ } else if (level == psLevel1Sep) {
+ paperColor[0] = paperColor[1] = paperColor[2] = paperColor[3] = 0;
+ splashOut = new SplashOutputDev(splashModeCMYK8, 1, gFalse,
+ paperColor, gTrue, gFalse);
+#endif
+ } else {
+ paperColor[0] = paperColor[1] = paperColor[2] = 0xff;
+ splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse,
+ paperColor, gTrue, gFalse);
+ }
+ splashOut->startDoc(xref);
+ page->displaySlice(splashOut, splashDPI, splashDPI, rotateA,
+ useMediaBox, crop,
+ sliceX, sliceY, sliceW, sliceH,
+ printing, catalog, abortCheckCbk, abortCheckCbkData);
+
+ // start the PS page
+ page->makeBox(splashDPI, splashDPI, rotateA, useMediaBox, gFalse,
+ sliceX, sliceY, sliceW, sliceH, &box, &crop);
+ rotateA += page->getRotate();
+ if (rotateA >= 360) {
+ rotateA -= 360;
+ } else if (rotateA < 0) {
+ rotateA += 360;
+ }
+ state = new GfxState(splashDPI, splashDPI, &box, rotateA, gFalse);
+ startPage(page->getNum(), state);
+ delete state;
+ switch (rotateA) {
+ case 0:
+ default: // this should never happen
+ m0 = box.x2 - box.x1;
+ m1 = 0;
+ m2 = 0;
+ m3 = box.y2 - box.y1;
+ m4 = box.x1;
+ m5 = box.y1;
+ break;
+ case 90:
+ m0 = 0;
+ m1 = box.y2 - box.y1;
+ m2 = -(box.x2 - box.x1);
+ m3 = 0;
+ m4 = box.x2;
+ m5 = box.y1;
+ break;
+ case 180:
+ m0 = -(box.x2 - box.x1);
+ m1 = 0;
+ m2 = 0;
+ m3 = -(box.y2 - box.y1);
+ m4 = box.x2;
+ m5 = box.y2;
+ break;
+ case 270:
+ m0 = 0;
+ m1 = -(box.y2 - box.y1);
+ m2 = box.x2 - box.x1;
+ m3 = 0;
+ m4 = box.x1;
+ m5 = box.y2;
+ break;
+ }
+
+ //~ need to add the process colors
+
+ // draw the rasterized image
+ bitmap = splashOut->getBitmap();
+ w = bitmap->getWidth();
+ h = bitmap->getHeight();
+ writePS("gsave\n");
+ writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] concat\n",
+ m0, m1, m2, m3, m4, m5);
+ switch (level) {
+ case psLevel1:
+ writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1\n",
+ w, h, w, -h, h);
+ p = bitmap->getDataPtr();
+ i = 0;
+ for (y = 0; y < h; ++y) {
+ for (x = 0; x < w; ++x) {
+ writePSFmt("{0:02x}", *p++);
+ if (++i == 32) {
+ writePSChar('\n');
+ i = 0;
+ }
+ }
+ }
+ if (i != 0) {
+ writePSChar('\n');
+ }
+ break;
+ case psLevel1Sep:
+ writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1Sep\n",
+ w, h, w, -h, h);
+ p = bitmap->getDataPtr();
+ i = 0;
+ col[0] = col[1] = col[2] = col[3] = 0;
+ for (y = 0; y < h; ++y) {
+ for (comp = 0; comp < 4; ++comp) {
+ for (x = 0; x < w; ++x) {
+ writePSFmt("{0:02x}", p[4*x + comp]);
+ col[comp] |= p[4*x + comp];
+ if (++i == 32) {
+ writePSChar('\n');
+ i = 0;
+ }
+ }
+ }
+ p += bitmap->getRowSize();
+ }
+ if (i != 0) {
+ writePSChar('\n');
+ }
+ if (col[0]) {
+ processColors |= psProcessCyan;
+ }
+ if (col[1]) {
+ processColors |= psProcessMagenta;
+ }
+ if (col[2]) {
+ processColors |= psProcessYellow;
+ }
+ if (col[3]) {
+ processColors |= psProcessBlack;
+ }
+ break;
+ case psLevel2:
+ case psLevel2Sep:
+ case psLevel3:
+ case psLevel3Sep:
+ writePS("/DeviceRGB setcolorspace\n");
+ writePS("<<\n /ImageType 1\n");
+ writePSFmt(" /Width {0:d}\n", bitmap->getWidth());
+ writePSFmt(" /Height {0:d}\n", bitmap->getHeight());
+ writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n", w, -h, h);
+ writePS(" /BitsPerComponent 8\n");
+ writePS(" /Decode [0 1 0 1 0 1]\n");
+ writePS(" /DataSource currentfile\n");
+ if (globalParams->getPSASCIIHex()) {
+ writePS(" /ASCIIHexDecode filter\n");
+ } else {
+ writePS(" /ASCII85Decode filter\n");
+ }
+ writePS(" /RunLengthDecode filter\n");
+ writePS(">>\n");
+ writePS("image\n");
+ obj.initNull();
+ str0 = new MemStream((char *)bitmap->getDataPtr(), 0, w * h * 3, &obj);
+ str = new RunLengthEncoder(str0);
+ if (globalParams->getPSASCIIHex()) {
+ str = new ASCIIHexEncoder(str);
+ } else {
+ str = new ASCII85Encoder(str);
+ }
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ writePSChar(c);
+ }
+ str->close();
+ delete str;
+ delete str0;
+ processColors |= psProcessCMYK;
+ break;
+ }
+ delete splashOut;
+ writePS("grestore\n");
+
+ // finish the PS page
+ endPage();
+
+ return gFalse;
+#else
+ return gTrue;
+#endif
+}
+
+void PSOutputDev::startPage(int pageNum, GfxState *state) {
+ int x1, y1, x2, y2, width, height;
+ int imgWidth, imgHeight, imgWidth2, imgHeight2;
+ GBool landscape;
+
+
+ if (mode == psModePS) {
+ writePSFmt("%%Page: {0:d} {1:d}\n", pageNum, seqPage);
+ writePS("%%BeginPageSetup\n");
+ }
+
+ // underlays
+ if (underlayCbk) {
+ (*underlayCbk)(this, underlayCbkData);
+ }
+ if (overlayCbk) {
+ saveState(NULL);
+ }
+
+ switch (mode) {
+
+ case psModePS:
+ // rotate, translate, and scale page
+ imgWidth = imgURX - imgLLX;
+ imgHeight = imgURY - imgLLY;
+ x1 = (int)floor(state->getX1());
+ y1 = (int)floor(state->getY1());
+ x2 = (int)ceil(state->getX2());
+ y2 = (int)ceil(state->getY2());
+ width = x2 - x1;
+ height = y2 - y1;
+ tx = ty = 0;
+ // rotation and portrait/landscape mode
+ if (rotate0 >= 0) {
+ rotate = (360 - rotate0) % 360;
+ landscape = gFalse;
+ } else {
+ rotate = (360 - state->getRotate()) % 360;
+ if (rotate == 0 || rotate == 180) {
+ if (width > height && width > imgWidth) {
+ rotate += 90;
+ landscape = gTrue;
+ } else {
+ landscape = gFalse;
+ }
+ } else { // rotate == 90 || rotate == 270
+ if (height > width && height > imgWidth) {
+ rotate = 270 - rotate;
+ landscape = gTrue;
+ } else {
+ landscape = gFalse;
+ }
+ }
+ }
+ writePSFmt("%%PageOrientation: {0:s}\n",
+ landscape ? "Landscape" : "Portrait");
+ writePS("pdfStartPage\n");
+ if (rotate == 0) {
+ imgWidth2 = imgWidth;
+ imgHeight2 = imgHeight;
+ } else if (rotate == 90) {
+ writePS("90 rotate\n");
+ ty = -imgWidth;
+ imgWidth2 = imgHeight;
+ imgHeight2 = imgWidth;
+ } else if (rotate == 180) {
+ writePS("180 rotate\n");
+ imgWidth2 = imgWidth;
+ imgHeight2 = imgHeight;
+ tx = -imgWidth;
+ ty = -imgHeight;
+ } else { // rotate == 270
+ writePS("270 rotate\n");
+ tx = -imgHeight;
+ imgWidth2 = imgHeight;
+ imgHeight2 = imgWidth;
+ }
+ // shrink or expand
+ if (xScale0 > 0 && yScale0 > 0) {
+ xScale = xScale0;
+ yScale = yScale0;
+ } else if ((globalParams->getPSShrinkLarger() &&
+ (width > imgWidth2 || height > imgHeight2)) ||
+ (globalParams->getPSExpandSmaller() &&
+ (width < imgWidth2 && height < imgHeight2))) {
+ xScale = (double)imgWidth2 / (double)width;
+ yScale = (double)imgHeight2 / (double)height;
+ if (yScale < xScale) {
+ xScale = yScale;
+ } else {
+ yScale = xScale;
+ }
+ } else {
+ xScale = yScale = 1;
+ }
+ // deal with odd bounding boxes or clipping
+ if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) {
+ tx -= xScale * clipLLX0;
+ ty -= yScale * clipLLY0;
+ } else {
+ tx -= xScale * x1;
+ ty -= yScale * y1;
+ }
+ // center
+ if (tx0 >= 0 && ty0 >= 0) {
+ tx += rotate == 0 ? tx0 : ty0;
+ ty += rotate == 0 ? ty0 : -tx0;
+ } else if (globalParams->getPSCenter()) {
+ if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) {
+ tx += (imgWidth2 - xScale * (clipURX0 - clipLLX0)) / 2;
+ ty += (imgHeight2 - yScale * (clipURY0 - clipLLY0)) / 2;
+ } else {
+ tx += (imgWidth2 - xScale * width) / 2;
+ ty += (imgHeight2 - yScale * height) / 2;
+ }
+ }
+ tx += rotate == 0 ? imgLLX : imgLLY;
+ ty += rotate == 0 ? imgLLY : -imgLLX;
+ if (tx != 0 || ty != 0) {
+ writePSFmt("{0:.4g} {1:.4g} translate\n", tx, ty);
+ }
+ if (xScale != 1 || yScale != 1) {
+ writePSFmt("{0:.4f} {1:.4f} scale\n", xScale, yScale);
+ }
+ if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) {
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re W\n",
+ clipLLX0, clipLLY0, clipURX0 - clipLLX0, clipURY0 - clipLLY0);
+ } else {
+ writePSFmt("{0:d} {1:d} {2:d} {3:d} re W\n", x1, y1, x2 - x1, y2 - y1);
+ }
+
+ writePS("%%EndPageSetup\n");
+ ++seqPage;
+ break;
+
+ case psModeEPS:
+ writePS("pdfStartPage\n");
+ tx = ty = 0;
+ rotate = (360 - state->getRotate()) % 360;
+ if (rotate == 0) {
+ } else if (rotate == 90) {
+ writePS("90 rotate\n");
+ tx = -epsX1;
+ ty = -epsY2;
+ } else if (rotate == 180) {
+ writePS("180 rotate\n");
+ tx = -(epsX1 + epsX2);
+ ty = -(epsY1 + epsY2);
+ } else { // rotate == 270
+ writePS("270 rotate\n");
+ tx = -epsX2;
+ ty = -epsY1;
+ }
+ if (tx != 0 || ty != 0) {
+ writePSFmt("{0:.4g} {1:.4g} translate\n", tx, ty);
+ }
+ xScale = yScale = 1;
+ break;
+
+ case psModeForm:
+ writePS("/PaintProc {\n");
+ writePS("begin xpdf begin\n");
+ writePS("pdfStartPage\n");
+ tx = ty = 0;
+ xScale = yScale = 1;
+ rotate = 0;
+ break;
+ }
+}
+
+void PSOutputDev::endPage() {
+ if (overlayCbk) {
+ restoreState(NULL);
+ (*overlayCbk)(this, overlayCbkData);
+ }
+
+
+ if (mode == psModeForm) {
+ writePS("pdfEndPage\n");
+ writePS("end end\n");
+ writePS("} def\n");
+ writePS("end end\n");
+ } else {
+ if (!manualCtrl) {
+ writePS("showpage\n");
+ }
+ writePS("%%PageTrailer\n");
+ writePageTrailer();
+ }
+}
+
+void PSOutputDev::saveState(GfxState * /*state*/) {
+ writePS("q\n");
+ ++numSaves;
+}
+
+void PSOutputDev::restoreState(GfxState * /*state*/) {
+ writePS("Q\n");
+ --numSaves;
+}
+
+void PSOutputDev::updateCTM(GfxState * /*state*/, double m11, double m12,
+ double m21, double m22, double m31, double m32) {
+ writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] cm\n",
+ m11, m12, m21, m22, m31, m32);
+}
+
+void PSOutputDev::updateLineDash(GfxState *state) {
+ double *dash;
+ double start;
+ int length, i;
+
+ state->getLineDash(&dash, &length, &start);
+ writePS("[");
+ for (i = 0; i < length; ++i) {
+ writePSFmt("{0:.4g}{1:w}",
+ dash[i] < 0 ? 0 : dash[i],
+ (i == length-1) ? 0 : 1);
+ }
+ writePSFmt("] {0:.4g} d\n", start);
+}
+
+void PSOutputDev::updateFlatness(GfxState *state) {
+ writePSFmt("{0:d} i\n", state->getFlatness());
+}
+
+void PSOutputDev::updateLineJoin(GfxState *state) {
+ writePSFmt("{0:d} j\n", state->getLineJoin());
+}
+
+void PSOutputDev::updateLineCap(GfxState *state) {
+ writePSFmt("{0:d} J\n", state->getLineCap());
+}
+
+void PSOutputDev::updateMiterLimit(GfxState *state) {
+ writePSFmt("{0:.4g} M\n", state->getMiterLimit());
+}
+
+void PSOutputDev::updateLineWidth(GfxState *state) {
+ writePSFmt("{0:.4g} w\n", state->getLineWidth());
+}
+
+void PSOutputDev::updateFillColorSpace(GfxState *state) {
+ switch (level) {
+ case psLevel1:
+ case psLevel1Sep:
+ break;
+ case psLevel2:
+ case psLevel3:
+ if (state->getFillColorSpace()->getMode() != csPattern) {
+ dumpColorSpaceL2(state->getFillColorSpace(), gTrue, gFalse, gFalse);
+ writePS(" cs\n");
+ }
+ break;
+ case psLevel2Sep:
+ case psLevel3Sep:
+ break;
+ }
+}
+
+void PSOutputDev::updateStrokeColorSpace(GfxState *state) {
+ switch (level) {
+ case psLevel1:
+ case psLevel1Sep:
+ break;
+ case psLevel2:
+ case psLevel3:
+ if (state->getStrokeColorSpace()->getMode() != csPattern) {
+ dumpColorSpaceL2(state->getStrokeColorSpace(), gTrue, gFalse, gFalse);
+ writePS(" CS\n");
+ }
+ break;
+ case psLevel2Sep:
+ case psLevel3Sep:
+ break;
+ }
+}
+
+void PSOutputDev::updateFillColor(GfxState *state) {
+ GfxColor color;
+ GfxColor *colorPtr;
+ GfxGray gray;
+ GfxCMYK cmyk;
+ GfxSeparationColorSpace *sepCS;
+ double c, m, y, k;
+ int i;
+
+ switch (level) {
+ case psLevel1:
+ state->getFillGray(&gray);
+ writePSFmt("{0:.4g} g\n", colToDbl(gray));
+ break;
+ case psLevel1Sep:
+ state->getFillCMYK(&cmyk);
+ c = colToDbl(cmyk.c);
+ m = colToDbl(cmyk.m);
+ y = colToDbl(cmyk.y);
+ k = colToDbl(cmyk.k);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} k\n", c, m, y, k);
+ addProcessColor(c, m, y, k);
+ break;
+ case psLevel2:
+ case psLevel3:
+ if (state->getFillColorSpace()->getMode() != csPattern) {
+ colorPtr = state->getFillColor();
+ writePS("[");
+ for (i = 0; i < state->getFillColorSpace()->getNComps(); ++i) {
+ if (i > 0) {
+ writePS(" ");
+ }
+ writePSFmt("{0:.4g}", colToDbl(colorPtr->c[i]));
+ }
+ writePS("] sc\n");
+ }
+ break;
+ case psLevel2Sep:
+ case psLevel3Sep:
+ if (state->getFillColorSpace()->getMode() == csSeparation) {
+ sepCS = (GfxSeparationColorSpace *)state->getFillColorSpace();
+ color.c[0] = gfxColorComp1;
+ sepCS->getCMYK(&color, &cmyk);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} ({5:t}) ck\n",
+ colToDbl(state->getFillColor()->c[0]),
+ colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k),
+ sepCS->getName());
+ addCustomColor(sepCS);
+ } else {
+ state->getFillCMYK(&cmyk);
+ c = colToDbl(cmyk.c);
+ m = colToDbl(cmyk.m);
+ y = colToDbl(cmyk.y);
+ k = colToDbl(cmyk.k);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} k\n", c, m, y, k);
+ addProcessColor(c, m, y, k);
+ }
+ break;
+ }
+ t3Cacheable = gFalse;
+}
+
+void PSOutputDev::updateStrokeColor(GfxState *state) {
+ GfxColor color;
+ GfxColor *colorPtr;
+ GfxGray gray;
+ GfxCMYK cmyk;
+ GfxSeparationColorSpace *sepCS;
+ double c, m, y, k;
+ int i;
+
+ switch (level) {
+ case psLevel1:
+ state->getStrokeGray(&gray);
+ writePSFmt("{0:.4g} G\n", colToDbl(gray));
+ break;
+ case psLevel1Sep:
+ state->getStrokeCMYK(&cmyk);
+ c = colToDbl(cmyk.c);
+ m = colToDbl(cmyk.m);
+ y = colToDbl(cmyk.y);
+ k = colToDbl(cmyk.k);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} K\n", c, m, y, k);
+ addProcessColor(c, m, y, k);
+ break;
+ case psLevel2:
+ case psLevel3:
+ if (state->getStrokeColorSpace()->getMode() != csPattern) {
+ colorPtr = state->getStrokeColor();
+ writePS("[");
+ for (i = 0; i < state->getStrokeColorSpace()->getNComps(); ++i) {
+ if (i > 0) {
+ writePS(" ");
+ }
+ writePSFmt("{0:.4g}", colToDbl(colorPtr->c[i]));
+ }
+ writePS("] SC\n");
+ }
+ break;
+ case psLevel2Sep:
+ case psLevel3Sep:
+ if (state->getStrokeColorSpace()->getMode() == csSeparation) {
+ sepCS = (GfxSeparationColorSpace *)state->getStrokeColorSpace();
+ color.c[0] = gfxColorComp1;
+ sepCS->getCMYK(&color, &cmyk);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} ({5:t}) CK\n",
+ colToDbl(state->getStrokeColor()->c[0]),
+ colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k),
+ sepCS->getName());
+ addCustomColor(sepCS);
+ } else {
+ state->getStrokeCMYK(&cmyk);
+ c = colToDbl(cmyk.c);
+ m = colToDbl(cmyk.m);
+ y = colToDbl(cmyk.y);
+ k = colToDbl(cmyk.k);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} K\n", c, m, y, k);
+ addProcessColor(c, m, y, k);
+ }
+ break;
+ }
+ t3Cacheable = gFalse;
+}
+
+void PSOutputDev::addProcessColor(double c, double m, double y, double k) {
+ if (c > 0) {
+ processColors |= psProcessCyan;
+ }
+ if (m > 0) {
+ processColors |= psProcessMagenta;
+ }
+ if (y > 0) {
+ processColors |= psProcessYellow;
+ }
+ if (k > 0) {
+ processColors |= psProcessBlack;
+ }
+}
+
+void PSOutputDev::addCustomColor(GfxSeparationColorSpace *sepCS) {
+ PSOutCustomColor *cc;
+ GfxColor color;
+ GfxCMYK cmyk;
+
+ for (cc = customColors; cc; cc = cc->next) {
+ if (!cc->name->cmp(sepCS->getName())) {
+ return;
+ }
+ }
+ color.c[0] = gfxColorComp1;
+ sepCS->getCMYK(&color, &cmyk);
+ cc = new PSOutCustomColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k),
+ sepCS->getName()->copy());
+ cc->next = customColors;
+ customColors = cc;
+}
+
+void PSOutputDev::updateFillOverprint(GfxState *state) {
+ if (level >= psLevel2) {
+ writePSFmt("{0:s} op\n", state->getFillOverprint() ? "true" : "false");
+ }
+}
+
+void PSOutputDev::updateStrokeOverprint(GfxState *state) {
+ if (level >= psLevel2) {
+ writePSFmt("{0:s} OP\n", state->getStrokeOverprint() ? "true" : "false");
+ }
+}
+
+void PSOutputDev::updateTransfer(GfxState *state) {
+ Function **funcs;
+ int i;
+
+ funcs = state->getTransfer();
+ if (funcs[0] && funcs[1] && funcs[2] && funcs[3]) {
+ if (level >= psLevel2) {
+ for (i = 0; i < 4; ++i) {
+ cvtFunction(funcs[i]);
+ }
+ writePS("setcolortransfer\n");
+ } else {
+ cvtFunction(funcs[3]);
+ writePS("settransfer\n");
+ }
+ } else if (funcs[0]) {
+ cvtFunction(funcs[0]);
+ writePS("settransfer\n");
+ } else {
+ writePS("{} settransfer\n");
+ }
+}
+
+void PSOutputDev::updateFont(GfxState *state) {
+ if (state->getFont()) {
+ writePSFmt("/F{0:d}_{1:d} {2:.4g} Tf\n",
+ state->getFont()->getID()->num, state->getFont()->getID()->gen,
+ fabs(state->getFontSize()) < 0.00001 ? 0.00001
+ : state->getFontSize());
+ }
+}
+
+void PSOutputDev::updateTextMat(GfxState *state) {
+ double *mat;
+
+ mat = state->getTextMat();
+ if (fabs(mat[0] * mat[3] - mat[1] * mat[2]) < 0.00001) {
+ // avoid a singular (or close-to-singular) matrix
+ writePSFmt("[0.00001 0 0 0.00001 {0:.4g} {1:.4g}] Tm\n", mat[4], mat[5]);
+ } else {
+ writePSFmt("[{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] Tm\n",
+ mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
+ }
+}
+
+void PSOutputDev::updateCharSpace(GfxState *state) {
+ writePSFmt("{0:.4g} Tc\n", state->getCharSpace());
+}
+
+void PSOutputDev::updateRender(GfxState *state) {
+ int rm;
+
+ rm = state->getRender();
+ writePSFmt("{0:d} Tr\n", rm);
+ rm &= 3;
+ if (rm != 0 && rm != 3) {
+ t3Cacheable = gFalse;
+ }
+}
+
+void PSOutputDev::updateRise(GfxState *state) {
+ writePSFmt("{0:.4g} Ts\n", state->getRise());
+}
+
+void PSOutputDev::updateWordSpace(GfxState *state) {
+ writePSFmt("{0:.4g} Tw\n", state->getWordSpace());
+}
+
+void PSOutputDev::updateHorizScaling(GfxState *state) {
+ double h;
+
+ h = state->getHorizScaling();
+ if (fabs(h) < 0.01) {
+ h = 0.01;
+ }
+ writePSFmt("{0:.4g} Tz\n", h);
+}
+
+void PSOutputDev::updateTextPos(GfxState *state) {
+ writePSFmt("{0:.4g} {1:.4g} Td\n", state->getLineX(), state->getLineY());
+}
+
+void PSOutputDev::updateTextShift(GfxState *state, double shift) {
+ if (state->getFont()->getWMode()) {
+ writePSFmt("{0:.4g} TJmV\n", shift);
+ } else {
+ writePSFmt("{0:.4g} TJm\n", shift);
+ }
+}
+
+void PSOutputDev::stroke(GfxState *state) {
+ doPath(state->getPath());
+ if (t3String) {
+ // if we're construct a cacheable Type 3 glyph, we need to do
+ // everything in the fill color
+ writePS("Sf\n");
+ } else {
+ writePS("S\n");
+ }
+}
+
+void PSOutputDev::fill(GfxState *state) {
+ doPath(state->getPath());
+ writePS("f\n");
+}
+
+void PSOutputDev::eoFill(GfxState *state) {
+ doPath(state->getPath());
+ writePS("f*\n");
+}
+
+void PSOutputDev::tilingPatternFill(GfxState * /*state*/, Object *str,
+ int paintType, Dict *resDict,
+ double *mat, double *bbox,
+ int x0, int y0, int x1, int y1,
+ double xStep, double yStep) {
+ PDFRectangle box;
+ Gfx *gfx;
+
+ // define a Type 3 font
+ writePS("8 dict begin\n");
+ writePS("/FontType 3 def\n");
+ writePS("/FontMatrix [1 0 0 1 0 0] def\n");
+ writePSFmt("/FontBBox [{0:.4g} {1:.4g} {2:.4g} {3:.4g}] def\n",
+ bbox[0], bbox[1], bbox[2], bbox[3]);
+ writePS("/Encoding 256 array def\n");
+ writePS(" 0 1 255 { Encoding exch /.notdef put } for\n");
+ writePS(" Encoding 120 /x put\n");
+ writePS("/BuildGlyph {\n");
+ writePS(" exch /CharProcs get exch\n");
+ writePS(" 2 copy known not { pop /.notdef } if\n");
+ writePS(" get exec\n");
+ writePS("} bind def\n");
+ writePS("/BuildChar {\n");
+ writePS(" 1 index /Encoding get exch get\n");
+ writePS(" 1 index /BuildGlyph get exec\n");
+ writePS("} bind def\n");
+ writePS("/CharProcs 1 dict def\n");
+ writePS("CharProcs begin\n");
+ box.x1 = bbox[0];
+ box.y1 = bbox[1];
+ box.x2 = bbox[2];
+ box.y2 = bbox[3];
+ gfx = new Gfx(xref, this, resDict, &box, NULL);
+ writePS("/x {\n");
+ if (paintType == 2) {
+ writePSFmt("{0:.4g} 0 {1:.4g} {2:.4g} {3:.4g} {4:.4g} setcachedevice\n",
+ xStep, bbox[0], bbox[1], bbox[2], bbox[3]);
+ } else {
+ if (x1 - 1 <= x0) {
+ writePS("1 0 setcharwidth\n");
+ } else {
+ writePSFmt("{0:.4g} 0 setcharwidth\n", xStep);
+ }
+ }
+ inType3Char = gTrue;
+ ++numTilingPatterns;
+ gfx->display(str);
+ --numTilingPatterns;
+ inType3Char = gFalse;
+ writePS("} def\n");
+ delete gfx;
+ writePS("end\n");
+ writePS("currentdict end\n");
+ writePSFmt("/xpdfTile{0:d} exch definefont pop\n", numTilingPatterns);
+
+ // draw the tiles
+ writePSFmt("/xpdfTile{0:d} findfont setfont\n", numTilingPatterns);
+ writePSFmt("gsave [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] concat\n",
+ mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
+ writePSFmt("{0:d} 1 {1:d} {{ {2:.4g} exch {3:.4g} mul m {4:d} 1 {5:d} {{ pop (x) show }} for }} for\n",
+ y0, y1 - 1, x0 * xStep, yStep, x0, x1 - 1);
+ writePS("grestore\n");
+}
+
+GBool PSOutputDev::functionShadedFill(GfxState * /*state*/,
+ GfxFunctionShading *shading) {
+ double x0, y0, x1, y1;
+ double *mat;
+ int i;
+
+ if (level == psLevel2Sep || level == psLevel3Sep) {
+ if (shading->getColorSpace()->getMode() != csDeviceCMYK) {
+ return gFalse;
+ }
+ processColors |= psProcessCMYK;
+ }
+
+ shading->getDomain(&x0, &y0, &x1, &y1);
+ mat = shading->getMatrix();
+ writePSFmt("/mat [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g}] def\n",
+ mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
+ writePSFmt("/n {0:d} def\n", shading->getColorSpace()->getNComps());
+ if (shading->getNFuncs() == 1) {
+ writePS("/func ");
+ cvtFunction(shading->getFunc(0));
+ writePS("def\n");
+ } else {
+ writePS("/func {\n");
+ for (i = 0; i < shading->getNFuncs(); ++i) {
+ if (i < shading->getNFuncs() - 1) {
+ writePS("2 copy\n");
+ }
+ cvtFunction(shading->getFunc(i));
+ writePS("exec\n");
+ if (i < shading->getNFuncs() - 1) {
+ writePS("3 1 roll\n");
+ }
+ }
+ writePS("} def\n");
+ }
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} 0 funcSH\n", x0, y0, x1, y1);
+
+ return gTrue;
+}
+
+GBool PSOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading) {
+ double xMin, yMin, xMax, yMax;
+ double x0, y0, x1, y1, dx, dy, mul;
+ double tMin, tMax, t, t0, t1;
+ int i;
+
+ if (level == psLevel2Sep || level == psLevel3Sep) {
+ if (shading->getColorSpace()->getMode() != csDeviceCMYK) {
+ return gFalse;
+ }
+ processColors |= psProcessCMYK;
+ }
+
+ // get the clip region bbox
+ state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
+
+ // compute min and max t values, based on the four corners of the
+ // clip region bbox
+ shading->getCoords(&x0, &y0, &x1, &y1);
+ dx = x1 - x0;
+ dy = y1 - y0;
+ if (fabs(dx) < 0.01 && fabs(dy) < 0.01) {
+ return gTrue;
+ } else {
+ mul = 1 / (dx * dx + dy * dy);
+ tMin = tMax = ((xMin - x0) * dx + (yMin - y0) * dy) * mul;
+ t = ((xMin - x0) * dx + (yMax - y0) * dy) * mul;
+ if (t < tMin) {
+ tMin = t;
+ } else if (t > tMax) {
+ tMax = t;
+ }
+ t = ((xMax - x0) * dx + (yMin - y0) * dy) * mul;
+ if (t < tMin) {
+ tMin = t;
+ } else if (t > tMax) {
+ tMax = t;
+ }
+ t = ((xMax - x0) * dx + (yMax - y0) * dy) * mul;
+ if (t < tMin) {
+ tMin = t;
+ } else if (t > tMax) {
+ tMax = t;
+ }
+ if (tMin < 0 && !shading->getExtend0()) {
+ tMin = 0;
+ }
+ if (tMax > 1 && !shading->getExtend1()) {
+ tMax = 1;
+ }
+ }
+
+ // get the function domain
+ t0 = shading->getDomain0();
+ t1 = shading->getDomain1();
+
+ // generate the PS code
+ writePSFmt("/t0 {0:.4g} def\n", t0);
+ writePSFmt("/t1 {0:.4g} def\n", t1);
+ writePSFmt("/dt {0:.4g} def\n", t1 - t0);
+ writePSFmt("/x0 {0:.4g} def\n", x0);
+ writePSFmt("/y0 {0:.4g} def\n", y0);
+ writePSFmt("/dx {0:.4g} def\n", x1 - x0);
+ writePSFmt("/x1 {0:.4g} def\n", x1);
+ writePSFmt("/y1 {0:.4g} def\n", y1);
+ writePSFmt("/dy {0:.4g} def\n", y1 - y0);
+ writePSFmt("/xMin {0:.4g} def\n", xMin);
+ writePSFmt("/yMin {0:.4g} def\n", yMin);
+ writePSFmt("/xMax {0:.4g} def\n", xMax);
+ writePSFmt("/yMax {0:.4g} def\n", yMax);
+ writePSFmt("/n {0:d} def\n", shading->getColorSpace()->getNComps());
+ if (shading->getNFuncs() == 1) {
+ writePS("/func ");
+ cvtFunction(shading->getFunc(0));
+ writePS("def\n");
+ } else {
+ writePS("/func {\n");
+ for (i = 0; i < shading->getNFuncs(); ++i) {
+ if (i < shading->getNFuncs() - 1) {
+ writePS("dup\n");
+ }
+ cvtFunction(shading->getFunc(i));
+ writePS("exec\n");
+ if (i < shading->getNFuncs() - 1) {
+ writePS("exch\n");
+ }
+ }
+ writePS("} def\n");
+ }
+ writePSFmt("{0:.4g} {1:.4g} 0 axialSH\n", tMin, tMax);
+
+ return gTrue;
+}
+
+GBool PSOutputDev::radialShadedFill(GfxState *state,
+ GfxRadialShading *shading) {
+ double xMin, yMin, xMax, yMax;
+ double x0, y0, r0, x1, y1, r1, t0, t1;
+ double xa, ya, ra;
+ double sz, xz, yz, sMin, sMax, sa, ta;
+ double theta, alpha, a1, a2;
+ GBool enclosed;
+ int i;
+
+ if (level == psLevel2Sep || level == psLevel3Sep) {
+ if (shading->getColorSpace()->getMode() != csDeviceCMYK) {
+ return gFalse;
+ }
+ processColors |= psProcessCMYK;
+ }
+
+ // get the shading info
+ shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
+ t0 = shading->getDomain0();
+ t1 = shading->getDomain1();
+
+ // Compute the point at which r(s) = 0; check for the enclosed
+ // circles case; and compute the angles for the tangent lines.
+ if (r0 == r1) {
+ enclosed = x0 == x1 && y0 == y1;
+ theta = 0;
+ sz = 0; // make gcc happy
+ } else {
+ sz = -r0 / (r1 - r0);
+ xz = x0 + sz * (x1 - x0);
+ yz = y0 + sz * (y1 - y0);
+ enclosed = (xz - x0) * (xz - x0) + (yz - y0) * (yz - y0) <= r0 * r0;
+ theta = asin(r0 / sqrt((x0 - xz) * (x0 - xz) + (y0 - yz) * (y0 - yz)));
+ if (r0 > r1) {
+ theta = -theta;
+ }
+ }
+ if (enclosed) {
+ a1 = 0;
+ a2 = 360;
+ } else {
+ alpha = atan2(y1 - y0, x1 - x0);
+ a1 = (180 / M_PI) * (alpha + theta) + 90;
+ a2 = (180 / M_PI) * (alpha - theta) - 90;
+ while (a2 < a1) {
+ a2 += 360;
+ }
+ }
+
+ // compute the (possibly extended) s range
+ state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
+ if (enclosed) {
+ sMin = 0;
+ sMax = 1;
+ } else {
+ sMin = 1;
+ sMax = 0;
+ // solve for x(s) + r(s) = xMin
+ if ((x1 + r1) - (x0 + r0) != 0) {
+ sa = (xMin - (x0 + r0)) / ((x1 + r1) - (x0 + r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // solve for x(s) - r(s) = xMax
+ if ((x1 - r1) - (x0 - r0) != 0) {
+ sa = (xMax - (x0 - r0)) / ((x1 - r1) - (x0 - r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // solve for y(s) + r(s) = yMin
+ if ((y1 + r1) - (y0 + r0) != 0) {
+ sa = (yMin - (y0 + r0)) / ((y1 + r1) - (y0 + r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // solve for y(s) - r(s) = yMax
+ if ((y1 - r1) - (y0 - r0) != 0) {
+ sa = (yMax - (y0 - r0)) / ((y1 - r1) - (y0 - r0));
+ if (sa < sMin) {
+ sMin = sa;
+ } else if (sa > sMax) {
+ sMax = sa;
+ }
+ }
+ // check against sz
+ if (r0 < r1) {
+ if (sMin < sz) {
+ sMin = sz;
+ }
+ } else if (r0 > r1) {
+ if (sMax > sz) {
+ sMax = sz;
+ }
+ }
+ // check the 'extend' flags
+ if (!shading->getExtend0() && sMin < 0) {
+ sMin = 0;
+ }
+ if (!shading->getExtend1() && sMax > 1) {
+ sMax = 1;
+ }
+ }
+
+ // generate the PS code
+ writePSFmt("/x0 {0:.4g} def\n", x0);
+ writePSFmt("/x1 {0:.4g} def\n", x1);
+ writePSFmt("/dx {0:.4g} def\n", x1 - x0);
+ writePSFmt("/y0 {0:.4g} def\n", y0);
+ writePSFmt("/y1 {0:.4g} def\n", y1);
+ writePSFmt("/dy {0:.4g} def\n", y1 - y0);
+ writePSFmt("/r0 {0:.4g} def\n", r0);
+ writePSFmt("/r1 {0:.4g} def\n", r1);
+ writePSFmt("/dr {0:.4g} def\n", r1 - r0);
+ writePSFmt("/t0 {0:.4g} def\n", t0);
+ writePSFmt("/t1 {0:.4g} def\n", t1);
+ writePSFmt("/dt {0:.4g} def\n", t1 - t0);
+ writePSFmt("/n {0:d} def\n", shading->getColorSpace()->getNComps());
+ writePSFmt("/encl {0:s} def\n", enclosed ? "true" : "false");
+ writePSFmt("/a1 {0:.4g} def\n", a1);
+ writePSFmt("/a2 {0:.4g} def\n", a2);
+ if (shading->getNFuncs() == 1) {
+ writePS("/func ");
+ cvtFunction(shading->getFunc(0));
+ writePS("def\n");
+ } else {
+ writePS("/func {\n");
+ for (i = 0; i < shading->getNFuncs(); ++i) {
+ if (i < shading->getNFuncs() - 1) {
+ writePS("dup\n");
+ }
+ cvtFunction(shading->getFunc(i));
+ writePS("exec\n");
+ if (i < shading->getNFuncs() - 1) {
+ writePS("exch\n");
+ }
+ }
+ writePS("} def\n");
+ }
+ writePSFmt("{0:.4g} {1:.4g} 0 radialSH\n", sMin, sMax);
+
+ // extend the 'enclosed' case
+ if (enclosed) {
+ // extend the smaller circle
+ if ((shading->getExtend0() && r0 <= r1) ||
+ (shading->getExtend1() && r1 < r0)) {
+ if (r0 <= r1) {
+ ta = t0;
+ ra = r0;
+ xa = x0;
+ ya = y0;
+ } else {
+ ta = t1;
+ ra = r1;
+ xa = x1;
+ ya = y1;
+ }
+ if (level == psLevel2Sep || level == psLevel3Sep) {
+ writePSFmt("{0:.4g} radialCol aload pop k\n", ta);
+ } else {
+ writePSFmt("{0:.4g} radialCol sc\n", ta);
+ }
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} 0 360 arc h f*\n", xa, ya, ra);
+ }
+
+ // extend the larger circle
+ if ((shading->getExtend0() && r0 > r1) ||
+ (shading->getExtend1() && r1 >= r0)) {
+ if (r0 > r1) {
+ ta = t0;
+ ra = r0;
+ xa = x0;
+ ya = y0;
+ } else {
+ ta = t1;
+ ra = r1;
+ xa = x1;
+ ya = y1;
+ }
+ if (level == psLevel2Sep || level == psLevel3Sep) {
+ writePSFmt("{0:.4g} radialCol aload pop k\n", ta);
+ } else {
+ writePSFmt("{0:.4g} radialCol sc\n", ta);
+ }
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} 0 360 arc h\n", xa, ya, ra);
+ writePSFmt("{0:.4g} {1:.4g} m {2:.4g} {3:.4g} l {4:.4g} {5:.4g} l {6:.4g} {7:.4g} l h f*\n",
+ xMin, yMin, xMin, yMax, xMax, yMax, xMax, yMin);
+ }
+ }
+
+ return gTrue;
+}
+
+void PSOutputDev::clip(GfxState *state) {
+ doPath(state->getPath());
+ writePS("W\n");
+}
+
+void PSOutputDev::eoClip(GfxState *state) {
+ doPath(state->getPath());
+ writePS("W*\n");
+}
+
+void PSOutputDev::clipToStrokePath(GfxState *state) {
+ doPath(state->getPath());
+ writePS("Ws\n");
+}
+
+void PSOutputDev::doPath(GfxPath *path) {
+ GfxSubpath *subpath;
+ double x0, y0, x1, y1, x2, y2, x3, y3, x4, y4;
+ int n, m, i, j;
+
+ n = path->getNumSubpaths();
+
+ if (n == 1 && path->getSubpath(0)->getNumPoints() == 5) {
+ subpath = path->getSubpath(0);
+ x0 = subpath->getX(0);
+ y0 = subpath->getY(0);
+ x4 = subpath->getX(4);
+ y4 = subpath->getY(4);
+ if (x4 == x0 && y4 == y0) {
+ x1 = subpath->getX(1);
+ y1 = subpath->getY(1);
+ x2 = subpath->getX(2);
+ y2 = subpath->getY(2);
+ x3 = subpath->getX(3);
+ y3 = subpath->getY(3);
+ if (x0 == x1 && x2 == x3 && y0 == y3 && y1 == y2) {
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re\n",
+ x0 < x2 ? x0 : x2, y0 < y1 ? y0 : y1,
+ fabs(x2 - x0), fabs(y1 - y0));
+ return;
+ } else if (x0 == x3 && x1 == x2 && y0 == y1 && y2 == y3) {
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re\n",
+ x0 < x1 ? x0 : x1, y0 < y2 ? y0 : y2,
+ fabs(x1 - x0), fabs(y2 - y0));
+ return;
+ }
+ }
+ }
+
+ for (i = 0; i < n; ++i) {
+ subpath = path->getSubpath(i);
+ m = subpath->getNumPoints();
+ writePSFmt("{0:.4g} {1:.4g} m\n", subpath->getX(0), subpath->getY(0));
+ j = 1;
+ while (j < m) {
+ if (subpath->getCurve(j)) {
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} c\n",
+ subpath->getX(j), subpath->getY(j),
+ subpath->getX(j+1), subpath->getY(j+1),
+ subpath->getX(j+2), subpath->getY(j+2));
+ j += 3;
+ } else {
+ writePSFmt("{0:.4g} {1:.4g} l\n", subpath->getX(j), subpath->getY(j));
+ ++j;
+ }
+ }
+ if (subpath->isClosed()) {
+ writePS("h\n");
+ }
+ }
+}
+
+void PSOutputDev::drawString(GfxState *state, GString *s) {
+ GfxFont *font;
+ int wMode;
+ Gushort *codeToGID;
+ GString *s2;
+ double dx, dy, dx2, dy2, originX, originY;
+ char *p;
+ UnicodeMap *uMap;
+ CharCode code;
+ Unicode u[8];
+ char buf[8];
+ int len, nChars, uLen, n, m, i, j;
+
+ // check for invisible text -- this is used by Acrobat Capture
+ if (state->getRender() == 3) {
+ return;
+ }
+
+ // ignore empty strings
+ if (s->getLength() == 0) {
+ return;
+ }
+
+ // get the font
+ if (!(font = state->getFont())) {
+ return;
+ }
+ wMode = font->getWMode();
+
+ // check for a subtitute 16-bit font
+ uMap = NULL;
+ codeToGID = NULL;
+ if (font->isCIDFont()) {
+ for (i = 0; i < font16EncLen; ++i) {
+ if (font->getID()->num == font16Enc[i].fontID.num &&
+ font->getID()->gen == font16Enc[i].fontID.gen) {
+ uMap = globalParams->getUnicodeMap(font16Enc[i].enc);
+ break;
+ }
+ }
+
+ // check for a code-to-GID map
+ } else {
+ for (i = 0; i < font8InfoLen; ++i) {
+ if (font->getID()->num == font8Info[i].fontID.num &&
+ font->getID()->gen == font8Info[i].fontID.gen) {
+ codeToGID = font8Info[i].codeToGID;
+ break;
+ }
+ }
+ }
+
+ // compute width of chars in string, ignoring char spacing and word
+ // spacing -- the Tj operator will adjust for the metrics of the
+ // font that's actually used
+ dx = dy = 0;
+ nChars = 0;
+ p = s->getCString();
+ len = s->getLength();
+ s2 = new GString();
+ while (len > 0) {
+ n = font->getNextChar(p, len, &code,
+ u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
+ &dx2, &dy2, &originX, &originY);
+ if (font->isCIDFont()) {
+ if (uMap) {
+ for (i = 0; i < uLen; ++i) {
+ m = uMap->mapUnicode(u[i], buf, (int)sizeof(buf));
+ for (j = 0; j < m; ++j) {
+ s2->append(buf[j]);
+ }
+ }
+ //~ this really needs to get the number of chars in the target
+ //~ encoding - which may be more than the number of Unicode
+ //~ chars
+ nChars += uLen;
+ } else {
+ s2->append((char)((code >> 8) & 0xff));
+ s2->append((char)(code & 0xff));
+ ++nChars;
+ }
+ } else {
+ if (!codeToGID || codeToGID[code]) {
+ s2->append((char)code);
+ }
+ }
+ dx += dx2;
+ dy += dy2;
+ p += n;
+ len -= n;
+ }
+ dx *= state->getFontSize() * state->getHorizScaling();
+ dy *= state->getFontSize();
+ if (uMap) {
+ uMap->decRefCnt();
+ }
+
+ if (s2->getLength() > 0) {
+ writePSString(s2);
+ if (font->isCIDFont()) {
+ if (wMode) {
+ writePSFmt(" {0:d} {1:.4g} Tj16V\n", nChars, dy);
+ } else {
+ writePSFmt(" {0:d} {1:.4g} Tj16\n", nChars, dx);
+ }
+ } else {
+ writePSFmt(" {0:.4g} Tj\n", dx);
+ }
+ }
+ delete s2;
+
+ if (state->getRender() & 4) {
+ haveTextClip = gTrue;
+ }
+}
+
+void PSOutputDev::endTextObject(GfxState * /*state*/) {
+ if (haveTextClip) {
+ writePS("Tclip\n");
+ haveTextClip = gFalse;
+ }
+}
+
+void PSOutputDev::drawImageMask(GfxState * /*state*/, Object *ref, Stream *str,
+ int width, int height, GBool invert,
+ GBool inlineImg) {
+ int len;
+
+ len = height * ((width + 7) / 8);
+ switch (level) {
+ case psLevel1:
+ case psLevel1Sep:
+ doImageL1(ref, NULL, invert, inlineImg, str, width, height, len);
+ break;
+ case psLevel2:
+ case psLevel2Sep:
+ doImageL2(ref, NULL, invert, inlineImg, str, width, height, len,
+ NULL, NULL, 0, 0, gFalse);
+ break;
+ case psLevel3:
+ case psLevel3Sep:
+ doImageL3(ref, NULL, invert, inlineImg, str, width, height, len,
+ NULL, NULL, 0, 0, gFalse);
+ break;
+ }
+}
+
+void PSOutputDev::drawImage(GfxState * /*state*/, Object *ref, Stream *str,
+ int width, int height, GfxImageColorMap *colorMap,
+ int *maskColors, GBool inlineImg) {
+ int len;
+
+ len = height * ((width * colorMap->getNumPixelComps() *
+ colorMap->getBits() + 7) / 8);
+ switch (level) {
+ case psLevel1:
+ doImageL1(ref, colorMap, gFalse, inlineImg, str, width, height, len);
+ break;
+ case psLevel1Sep:
+ //~ handle indexed, separation, ... color spaces
+ doImageL1Sep(colorMap, gFalse, inlineImg, str, width, height, len);
+ break;
+ case psLevel2:
+ case psLevel2Sep:
+ doImageL2(ref, colorMap, gFalse, inlineImg, str,
+ width, height, len, maskColors, NULL, 0, 0, gFalse);
+ break;
+ case psLevel3:
+ case psLevel3Sep:
+ doImageL3(ref, colorMap, gFalse, inlineImg, str,
+ width, height, len, maskColors, NULL, 0, 0, gFalse);
+ break;
+ }
+ t3Cacheable = gFalse;
+}
+
+void PSOutputDev::drawMaskedImage(GfxState * /*state*/, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
+ Stream *maskStr,
+ int maskWidth, int maskHeight,
+ GBool maskInvert) {
+ int len;
+
+ len = height * ((width * colorMap->getNumPixelComps() *
+ colorMap->getBits() + 7) / 8);
+ switch (level) {
+ case psLevel1:
+ doImageL1(ref, colorMap, gFalse, gFalse, str, width, height, len);
+ break;
+ case psLevel1Sep:
+ //~ handle indexed, separation, ... color spaces
+ doImageL1Sep(colorMap, gFalse, gFalse, str, width, height, len);
+ break;
+ case psLevel2:
+ case psLevel2Sep:
+ doImageL2(ref, colorMap, gFalse, gFalse, str, width, height, len,
+ NULL, maskStr, maskWidth, maskHeight, maskInvert);
+ break;
+ case psLevel3:
+ case psLevel3Sep:
+ doImageL3(ref, colorMap, gFalse, gFalse, str, width, height, len,
+ NULL, maskStr, maskWidth, maskHeight, maskInvert);
+ break;
+ }
+ t3Cacheable = gFalse;
+}
+
+void PSOutputDev::doImageL1(Object *ref, GfxImageColorMap *colorMap,
+ GBool invert, GBool inlineImg,
+ Stream *str, int width, int height, int len) {
+ ImageStream *imgStr;
+ Guchar pixBuf[gfxColorMaxComps];
+ GfxGray gray;
+ int col, x, y, c, i;
+
+ if ((inType3Char || preload) && !colorMap) {
+ if (inlineImg) {
+ // create an array
+ str = new FixedLengthEncoder(str, len);
+ str = new ASCIIHexEncoder(str);
+ str->reset();
+ col = 0;
+ writePS("[<");
+ do {
+ do {
+ c = str->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == '>' || c == EOF) {
+ break;
+ }
+ writePSChar(c);
+ ++col;
+ // each line is: "<...data...><eol>"
+ // so max data length = 255 - 4 = 251
+ // but make it 240 just to be safe
+ // chunks are 2 bytes each, so we need to stop on an even col number
+ if (col == 240) {
+ writePS(">\n<");
+ col = 0;
+ }
+ } while (c != '>' && c != EOF);
+ writePS(">]\n");
+ writePS("0\n");
+ str->close();
+ delete str;
+ } else {
+ // set up to use the array already created by setupImages()
+ writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
+ }
+ }
+
+ // image/imagemask command
+ if ((inType3Char || preload) && !colorMap) {
+ writePSFmt("{0:d} {1:d} {2:s} [{3:d} 0 0 {4:d} 0 {5:d}] pdfImM1a\n",
+ width, height, invert ? "true" : "false",
+ width, -height, height);
+ } else if (colorMap) {
+ writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1\n",
+ width, height,
+ width, -height, height);
+ } else {
+ writePSFmt("{0:d} {1:d} {2:s} [{3:d} 0 0 {4:d} 0 {5:d}] pdfImM1\n",
+ width, height, invert ? "true" : "false",
+ width, -height, height);
+ }
+
+ // image data
+ if (!((inType3Char || preload) && !colorMap)) {
+
+ if (colorMap) {
+
+ // set up to process the data stream
+ imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
+ colorMap->getBits());
+ imgStr->reset();
+
+ // process the data stream
+ i = 0;
+ for (y = 0; y < height; ++y) {
+
+ // write the line
+ for (x = 0; x < width; ++x) {
+ imgStr->getPixel(pixBuf);
+ colorMap->getGray(pixBuf, &gray);
+ writePSFmt("{0:02x}", colToByte(gray));
+ if (++i == 32) {
+ writePSChar('\n');
+ i = 0;
+ }
+ }
+ }
+ if (i != 0) {
+ writePSChar('\n');
+ }
+ str->close();
+ delete imgStr;
+
+ // imagemask
+ } else {
+ str->reset();
+ i = 0;
+ for (y = 0; y < height; ++y) {
+ for (x = 0; x < width; x += 8) {
+ writePSFmt("{0:02x}", str->getChar() & 0xff);
+ if (++i == 32) {
+ writePSChar('\n');
+ i = 0;
+ }
+ }
+ }
+ if (i != 0) {
+ writePSChar('\n');
+ }
+ str->close();
+ }
+ }
+}
+
+void PSOutputDev::doImageL1Sep(GfxImageColorMap *colorMap,
+ GBool /*invert*/, GBool /*inlineImg*/,
+ Stream *str, int width, int height, int /*len*/) {
+ ImageStream *imgStr;
+ Guchar *lineBuf;
+ Guchar pixBuf[gfxColorMaxComps];
+ GfxCMYK cmyk;
+ int x, y, i, comp;
+
+ // width, height, matrix, bits per component
+ writePSFmt("{0:d} {1:d} 8 [{2:d} 0 0 {3:d} 0 {4:d}] pdfIm1Sep\n",
+ width, height,
+ width, -height, height);
+
+ // allocate a line buffer
+ lineBuf = (Guchar *)gmallocn(width, 4);
+
+ // set up to process the data stream
+ imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
+ colorMap->getBits());
+ imgStr->reset();
+
+ // process the data stream
+ i = 0;
+ for (y = 0; y < height; ++y) {
+
+ // read the line
+ for (x = 0; x < width; ++x) {
+ imgStr->getPixel(pixBuf);
+ colorMap->getCMYK(pixBuf, &cmyk);
+ lineBuf[4*x+0] = colToByte(cmyk.c);
+ lineBuf[4*x+1] = colToByte(cmyk.m);
+ lineBuf[4*x+2] = colToByte(cmyk.y);
+ lineBuf[4*x+3] = colToByte(cmyk.k);
+ addProcessColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k));
+ }
+
+ // write one line of each color component
+ for (comp = 0; comp < 4; ++comp) {
+ for (x = 0; x < width; ++x) {
+ writePSFmt("{0:02x}", lineBuf[4*x + comp]);
+ if (++i == 32) {
+ writePSChar('\n');
+ i = 0;
+ }
+ }
+ }
+ }
+
+ if (i != 0) {
+ writePSChar('\n');
+ }
+
+ str->close();
+ delete imgStr;
+ gfree(lineBuf);
+}
+
+void PSOutputDev::doImageL2(Object *ref, GfxImageColorMap *colorMap,
+ GBool invert, GBool inlineImg,
+ Stream *str, int width, int height, int len,
+ int *maskColors, Stream *maskStr,
+ int maskWidth, int maskHeight, GBool maskInvert) {
+ Stream *str2;
+ ImageStream *imgStr;
+ Guchar *line;
+ PSOutImgClipRect *rects0, *rects1, *rectsTmp, *rectsOut;
+ int rects0Len, rects1Len, rectsSize, rectsOutLen, rectsOutSize;
+ GBool emitRect, addRect, extendRect;
+ GString *s;
+ int n, numComps;
+ GBool useRLE, useASCII, useASCIIHex, useCompressed;
+ GfxSeparationColorSpace *sepCS;
+ GfxColor color;
+ GfxCMYK cmyk;
+ int c;
+ int col, i, j, x0, x1, y, maskXor;
+
+ // color key masking
+ if (maskColors && colorMap && !inlineImg) {
+ // can't read the stream twice for inline images -- but masking
+ // isn't allowed with inline images anyway
+ numComps = colorMap->getNumPixelComps();
+ imgStr = new ImageStream(str, width, numComps, colorMap->getBits());
+ imgStr->reset();
+ rects0Len = rects1Len = rectsOutLen = 0;
+ rectsSize = rectsOutSize = 64;
+ rects0 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
+ rects1 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
+ rectsOut = (PSOutImgClipRect *)gmallocn(rectsOutSize,
+ sizeof(PSOutImgClipRect));
+ for (y = 0; y < height; ++y) {
+ if (!(line = imgStr->getLine())) {
+ break;
+ }
+ i = 0;
+ rects1Len = 0;
+ for (x0 = 0; x0 < width; ++x0) {
+ for (j = 0; j < numComps; ++j) {
+ if (line[x0*numComps+j] < maskColors[2*j] ||
+ line[x0*numComps+j] > maskColors[2*j+1]) {
+ break;
+ }
+ }
+ if (j < numComps) {
+ break;
+ }
+ }
+ for (x1 = x0; x1 < width; ++x1) {
+ for (j = 0; j < numComps; ++j) {
+ if (line[x1*numComps+j] < maskColors[2*j] ||
+ line[x1*numComps+j] > maskColors[2*j+1]) {
+ break;
+ }
+ }
+ if (j == numComps) {
+ break;
+ }
+ }
+ while (x0 < width || i < rects0Len) {
+ emitRect = addRect = extendRect = gFalse;
+ if (x0 >= width) {
+ emitRect = gTrue;
+ } else if (i >= rects0Len) {
+ addRect = gTrue;
+ } else if (rects0[i].x0 < x0) {
+ emitRect = gTrue;
+ } else if (x0 < rects0[i].x0) {
+ addRect = gTrue;
+ } else if (rects0[i].x1 == x1) {
+ extendRect = gTrue;
+ } else {
+ emitRect = addRect = gTrue;
+ }
+ if (emitRect) {
+ if (rectsOutLen == rectsOutSize) {
+ rectsOutSize *= 2;
+ rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
+ sizeof(PSOutImgClipRect));
+ }
+ rectsOut[rectsOutLen].x0 = rects0[i].x0;
+ rectsOut[rectsOutLen].x1 = rects0[i].x1;
+ rectsOut[rectsOutLen].y0 = height - y - 1;
+ rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1;
+ ++rectsOutLen;
+ ++i;
+ }
+ if (addRect || extendRect) {
+ if (rects1Len == rectsSize) {
+ rectsSize *= 2;
+ rects0 = (PSOutImgClipRect *)greallocn(rects0, rectsSize,
+ sizeof(PSOutImgClipRect));
+ rects1 = (PSOutImgClipRect *)greallocn(rects1, rectsSize,
+ sizeof(PSOutImgClipRect));
+ }
+ rects1[rects1Len].x0 = x0;
+ rects1[rects1Len].x1 = x1;
+ if (addRect) {
+ rects1[rects1Len].y0 = y;
+ }
+ if (extendRect) {
+ rects1[rects1Len].y0 = rects0[i].y0;
+ ++i;
+ }
+ ++rects1Len;
+ for (x0 = x1; x0 < width; ++x0) {
+ for (j = 0; j < numComps; ++j) {
+ if (line[x0*numComps+j] < maskColors[2*j] ||
+ line[x0*numComps+j] > maskColors[2*j+1]) {
+ break;
+ }
+ }
+ if (j < numComps) {
+ break;
+ }
+ }
+ for (x1 = x0; x1 < width; ++x1) {
+ for (j = 0; j < numComps; ++j) {
+ if (line[x1*numComps+j] < maskColors[2*j] ||
+ line[x1*numComps+j] > maskColors[2*j+1]) {
+ break;
+ }
+ }
+ if (j == numComps) {
+ break;
+ }
+ }
+ }
+ }
+ rectsTmp = rects0;
+ rects0 = rects1;
+ rects1 = rectsTmp;
+ i = rects0Len;
+ rects0Len = rects1Len;
+ rects1Len = i;
+ }
+ for (i = 0; i < rects0Len; ++i) {
+ if (rectsOutLen == rectsOutSize) {
+ rectsOutSize *= 2;
+ rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
+ sizeof(PSOutImgClipRect));
+ }
+ rectsOut[rectsOutLen].x0 = rects0[i].x0;
+ rectsOut[rectsOutLen].x1 = rects0[i].x1;
+ rectsOut[rectsOutLen].y0 = height - y - 1;
+ rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1;
+ ++rectsOutLen;
+ }
+ writePSFmt("{0:d} array 0\n", rectsOutLen * 4);
+ for (i = 0; i < rectsOutLen; ++i) {
+ writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n",
+ rectsOut[i].x0, rectsOut[i].y0,
+ rectsOut[i].x1 - rectsOut[i].x0,
+ rectsOut[i].y1 - rectsOut[i].y0);
+ }
+ writePSFmt("pop {0:d} {1:d} pdfImClip\n", width, height);
+ gfree(rectsOut);
+ gfree(rects0);
+ gfree(rects1);
+ delete imgStr;
+ str->close();
+
+ // explicit masking
+ } else if (maskStr) {
+ imgStr = new ImageStream(maskStr, maskWidth, 1, 1);
+ imgStr->reset();
+ rects0Len = rects1Len = rectsOutLen = 0;
+ rectsSize = rectsOutSize = 64;
+ rects0 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
+ rects1 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect));
+ rectsOut = (PSOutImgClipRect *)gmallocn(rectsOutSize,
+ sizeof(PSOutImgClipRect));
+ maskXor = maskInvert ? 1 : 0;
+ for (y = 0; y < maskHeight; ++y) {
+ if (!(line = imgStr->getLine())) {
+ break;
+ }
+ i = 0;
+ rects1Len = 0;
+ for (x0 = 0; x0 < maskWidth && (line[x0] ^ maskXor); ++x0) ;
+ for (x1 = x0; x1 < maskWidth && !(line[x1] ^ maskXor); ++x1) ;
+ while (x0 < maskWidth || i < rects0Len) {
+ emitRect = addRect = extendRect = gFalse;
+ if (x0 >= maskWidth) {
+ emitRect = gTrue;
+ } else if (i >= rects0Len) {
+ addRect = gTrue;
+ } else if (rects0[i].x0 < x0) {
+ emitRect = gTrue;
+ } else if (x0 < rects0[i].x0) {
+ addRect = gTrue;
+ } else if (rects0[i].x1 == x1) {
+ extendRect = gTrue;
+ } else {
+ emitRect = addRect = gTrue;
+ }
+ if (emitRect) {
+ if (rectsOutLen == rectsOutSize) {
+ rectsOutSize *= 2;
+ rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
+ sizeof(PSOutImgClipRect));
+ }
+ rectsOut[rectsOutLen].x0 = rects0[i].x0;
+ rectsOut[rectsOutLen].x1 = rects0[i].x1;
+ rectsOut[rectsOutLen].y0 = maskHeight - y - 1;
+ rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1;
+ ++rectsOutLen;
+ ++i;
+ }
+ if (addRect || extendRect) {
+ if (rects1Len == rectsSize) {
+ rectsSize *= 2;
+ rects0 = (PSOutImgClipRect *)greallocn(rects0, rectsSize,
+ sizeof(PSOutImgClipRect));
+ rects1 = (PSOutImgClipRect *)greallocn(rects1, rectsSize,
+ sizeof(PSOutImgClipRect));
+ }
+ rects1[rects1Len].x0 = x0;
+ rects1[rects1Len].x1 = x1;
+ if (addRect) {
+ rects1[rects1Len].y0 = y;
+ }
+ if (extendRect) {
+ rects1[rects1Len].y0 = rects0[i].y0;
+ ++i;
+ }
+ ++rects1Len;
+ for (x0 = x1; x0 < maskWidth && (line[x0] ^ maskXor); ++x0) ;
+ for (x1 = x0; x1 < maskWidth && !(line[x1] ^ maskXor); ++x1) ;
+ }
+ }
+ rectsTmp = rects0;
+ rects0 = rects1;
+ rects1 = rectsTmp;
+ i = rects0Len;
+ rects0Len = rects1Len;
+ rects1Len = i;
+ }
+ for (i = 0; i < rects0Len; ++i) {
+ if (rectsOutLen == rectsOutSize) {
+ rectsOutSize *= 2;
+ rectsOut = (PSOutImgClipRect *)greallocn(rectsOut, rectsOutSize,
+ sizeof(PSOutImgClipRect));
+ }
+ rectsOut[rectsOutLen].x0 = rects0[i].x0;
+ rectsOut[rectsOutLen].x1 = rects0[i].x1;
+ rectsOut[rectsOutLen].y0 = maskHeight - y - 1;
+ rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1;
+ ++rectsOutLen;
+ }
+ writePSFmt("{0:d} array 0\n", rectsOutLen * 4);
+ for (i = 0; i < rectsOutLen; ++i) {
+ writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n",
+ rectsOut[i].x0, rectsOut[i].y0,
+ rectsOut[i].x1 - rectsOut[i].x0,
+ rectsOut[i].y1 - rectsOut[i].y0);
+ }
+ writePSFmt("pop {0:d} {1:d} pdfImClip\n", maskWidth, maskHeight);
+ gfree(rectsOut);
+ gfree(rects0);
+ gfree(rects1);
+ delete imgStr;
+ maskStr->close();
+ }
+
+ // color space
+ if (colorMap) {
+ dumpColorSpaceL2(colorMap->getColorSpace(), gFalse, gTrue, gFalse);
+ writePS(" setcolorspace\n");
+ }
+
+ useASCIIHex = globalParams->getPSASCIIHex();
+
+ // set up the image data
+ if (mode == psModeForm || inType3Char || preload) {
+ if (inlineImg) {
+ // create an array
+ str2 = new FixedLengthEncoder(str, len);
+ str2 = new RunLengthEncoder(str2);
+ if (useASCIIHex) {
+ str2 = new ASCIIHexEncoder(str2);
+ } else {
+ str2 = new ASCII85Encoder(str2);
+ }
+ str2->reset();
+ col = 0;
+ writePS((char *)(useASCIIHex ? "[<" : "[<~"));
+ do {
+ do {
+ c = str2->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ if (c == 'z') {
+ writePSChar(c);
+ ++col;
+ } else {
+ writePSChar(c);
+ ++col;
+ for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
+ do {
+ c = str2->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ writePSChar(c);
+ ++col;
+ }
+ }
+ // each line is: "<~...data...~><eol>"
+ // so max data length = 255 - 6 = 249
+ // chunks are 1 or 5 bytes each, so we have to stop at 245
+ // but make it 240 just to be safe
+ if (col > 240) {
+ writePS((char *)(useASCIIHex ? ">\n<" : "~>\n<~"));
+ col = 0;
+ }
+ } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
+ writePS((char *)(useASCIIHex ? ">\n" : "~>\n"));
+ // add an extra entry because the RunLengthDecode filter may
+ // read past the end
+ writePS("<>]\n");
+ writePS("0\n");
+ str2->close();
+ delete str2;
+ } else {
+ // set up to use the array already created by setupImages()
+ writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
+ }
+ }
+
+ // image dictionary
+ writePS("<<\n /ImageType 1\n");
+
+ // width, height, matrix, bits per component
+ writePSFmt(" /Width {0:d}\n", width);
+ writePSFmt(" /Height {0:d}\n", height);
+ writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n",
+ width, -height, height);
+ if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
+ writePS(" /BitsPerComponent 8\n");
+ } else {
+ writePSFmt(" /BitsPerComponent {0:d}\n",
+ colorMap ? colorMap->getBits() : 1);
+ }
+
+ // decode
+ if (colorMap) {
+ writePS(" /Decode [");
+ if ((level == psLevel2Sep || level == psLevel3Sep) &&
+ colorMap->getColorSpace()->getMode() == csSeparation) {
+ // this matches up with the code in the pdfImSep operator
+ n = (1 << colorMap->getBits()) - 1;
+ writePSFmt("{0:.4g} {1:.4g}", colorMap->getDecodeLow(0) * n,
+ colorMap->getDecodeHigh(0) * n);
+ } else if (colorMap->getColorSpace()->getMode() == csDeviceN) {
+ numComps = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
+ getAlt()->getNComps();
+ for (i = 0; i < numComps; ++i) {
+ if (i > 0) {
+ writePS(" ");
+ }
+ writePS("0 1");
+ }
+ } else {
+ numComps = colorMap->getNumPixelComps();
+ for (i = 0; i < numComps; ++i) {
+ if (i > 0) {
+ writePS(" ");
+ }
+ writePSFmt("{0:.4g} {1:.4g}",
+ colorMap->getDecodeLow(i), colorMap->getDecodeHigh(i));
+ }
+ }
+ writePS("]\n");
+ } else {
+ writePSFmt(" /Decode [{0:d} {1:d}]\n", invert ? 1 : 0, invert ? 0 : 1);
+ }
+
+ // data source
+ if (mode == psModeForm || inType3Char || preload) {
+ writePS(" /DataSource { 2 copy get exch 1 add exch }\n");
+ } else {
+ writePS(" /DataSource currentfile\n");
+ }
+
+ // filters
+ s = str->getPSFilter(level < psLevel2 ? 1 : level < psLevel3 ? 2 : 3,
+ " ");
+ if ((colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) ||
+ inlineImg || !s) {
+ useRLE = gTrue;
+ useASCII = !(mode == psModeForm || inType3Char || preload);
+ useCompressed = gFalse;
+ } else {
+ useRLE = gFalse;
+ useASCII = str->isBinary() &&
+ !(mode == psModeForm || inType3Char || preload);
+ useCompressed = gTrue;
+ }
+ if (useASCII) {
+ writePSFmt(" /ASCII{0:s}Decode filter\n",
+ useASCIIHex ? "Hex" : "85");
+ }
+ if (useRLE) {
+ writePS(" /RunLengthDecode filter\n");
+ }
+ if (useCompressed) {
+ writePS(s->getCString());
+ }
+ if (s) {
+ delete s;
+ }
+
+ if (mode == psModeForm || inType3Char || preload) {
+
+ // end of image dictionary
+ writePSFmt(">>\n{0:s}\n", colorMap ? "image" : "imagemask");
+
+ // get rid of the array and index
+ writePS("pop pop\n");
+
+ } else {
+
+ // cut off inline image streams at appropriate length
+ if (inlineImg) {
+ str = new FixedLengthEncoder(str, len);
+ } else if (useCompressed) {
+ str = str->getUndecodedStream();
+ }
+
+ // recode DeviceN data
+ if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
+ str = new DeviceNRecoder(str, width, height, colorMap);
+ }
+
+ // add RunLengthEncode and ASCIIHex/85 encode filters
+ if (useRLE) {
+ str = new RunLengthEncoder(str);
+ }
+ if (useASCII) {
+ if (useASCIIHex) {
+ str = new ASCIIHexEncoder(str);
+ } else {
+ str = new ASCII85Encoder(str);
+ }
+ }
+
+ // end of image dictionary
+ writePS(">>\n");
+#if OPI_SUPPORT
+ if (opi13Nest) {
+ if (inlineImg) {
+ // this can't happen -- OPI dictionaries are in XObjects
+ error(-1, "Internal: OPI in inline image");
+ n = 0;
+ } else {
+ // need to read the stream to count characters -- the length
+ // is data-dependent (because of ASCII and RLE filters)
+ str->reset();
+ n = 0;
+ while ((c = str->getChar()) != EOF) {
+ ++n;
+ }
+ str->close();
+ }
+ // +6/7 for "pdfIm\n" / "pdfImM\n"
+ // +8 for newline + trailer
+ n += colorMap ? 14 : 15;
+ writePSFmt("%%BeginData: {0:d} Hex Bytes\n", n);
+ }
+#endif
+ if ((level == psLevel2Sep || level == psLevel3Sep) && colorMap &&
+ colorMap->getColorSpace()->getMode() == csSeparation) {
+ color.c[0] = gfxColorComp1;
+ sepCS = (GfxSeparationColorSpace *)colorMap->getColorSpace();
+ sepCS->getCMYK(&color, &cmyk);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} ({4:t}) pdfImSep\n",
+ colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k),
+ sepCS->getName());
+ } else {
+ writePSFmt("{0:s}\n", colorMap ? "pdfIm" : "pdfImM");
+ }
+
+ // copy the stream data
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ writePSChar(c);
+ }
+ str->close();
+
+ // add newline and trailer to the end
+ writePSChar('\n');
+ writePS("%-EOD-\n");
+#if OPI_SUPPORT
+ if (opi13Nest) {
+ writePS("%%EndData\n");
+ }
+#endif
+
+ // delete encoders
+ if (useRLE || useASCII || inlineImg) {
+ delete str;
+ }
+ }
+
+ if ((maskColors && colorMap && !inlineImg) || maskStr) {
+ writePS("pdfImClipEnd\n");
+ }
+}
+
+//~ this doesn't currently support OPI
+void PSOutputDev::doImageL3(Object *ref, GfxImageColorMap *colorMap,
+ GBool invert, GBool inlineImg,
+ Stream *str, int width, int height, int len,
+ int *maskColors, Stream *maskStr,
+ int maskWidth, int maskHeight, GBool maskInvert) {
+ Stream *str2;
+ GString *s;
+ int n, numComps;
+ GBool useRLE, useASCII, useASCIIHex, useCompressed;
+ GBool maskUseRLE, maskUseASCII, maskUseCompressed;
+ GfxSeparationColorSpace *sepCS;
+ GfxColor color;
+ GfxCMYK cmyk;
+ int c;
+ int col, i;
+
+ useASCIIHex = globalParams->getPSASCIIHex();
+ useRLE = useASCII = useCompressed = gFalse; // make gcc happy
+ maskUseRLE = maskUseASCII = maskUseCompressed = gFalse; // make gcc happy
+
+ // color space
+ if (colorMap) {
+ dumpColorSpaceL2(colorMap->getColorSpace(), gFalse, gTrue, gFalse);
+ writePS(" setcolorspace\n");
+ }
+
+ // set up the image data
+ if (mode == psModeForm || inType3Char || preload) {
+ if (inlineImg) {
+ // create an array
+ str2 = new FixedLengthEncoder(str, len);
+ str2 = new RunLengthEncoder(str2);
+ if (useASCIIHex) {
+ str2 = new ASCIIHexEncoder(str2);
+ } else {
+ str2 = new ASCII85Encoder(str2);
+ }
+ str2->reset();
+ col = 0;
+ writePS((char *)(useASCIIHex ? "[<" : "[<~"));
+ do {
+ do {
+ c = str2->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ if (c == 'z') {
+ writePSChar(c);
+ ++col;
+ } else {
+ writePSChar(c);
+ ++col;
+ for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
+ do {
+ c = str2->getChar();
+ } while (c == '\n' || c == '\r');
+ if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+ break;
+ }
+ writePSChar(c);
+ ++col;
+ }
+ }
+ // each line is: "<~...data...~><eol>"
+ // so max data length = 255 - 6 = 249
+ // chunks are 1 or 5 bytes each, so we have to stop at 245
+ // but make it 240 just to be safe
+ if (col > 240) {
+ writePS((char *)(useASCIIHex ? ">\n<" : "~>\n<~"));
+ col = 0;
+ }
+ } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
+ writePS((char *)(useASCIIHex ? ">\n" : "~>\n"));
+ // add an extra entry because the RunLengthDecode filter may
+ // read past the end
+ writePS("<>]\n");
+ writePS("0\n");
+ str2->close();
+ delete str2;
+ } else {
+ // set up to use the array already created by setupImages()
+ writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
+ }
+ }
+
+ // explicit masking
+ if (maskStr) {
+ writePS("<<\n /ImageType 3\n");
+ writePS(" /InterleaveType 3\n");
+ writePS(" /DataDict\n");
+ }
+
+ // image (data) dictionary
+ writePSFmt("<<\n /ImageType {0:d}\n", (maskColors && colorMap) ? 4 : 1);
+
+ // color key masking
+ if (maskColors && colorMap) {
+ writePS(" /MaskColor [\n");
+ numComps = colorMap->getNumPixelComps();
+ for (i = 0; i < 2 * numComps; i += 2) {
+ writePSFmt(" {0:d} {1:d}\n", maskColors[i], maskColors[i+1]);
+ }
+ writePS(" ]\n");
+ }
+
+ // width, height, matrix, bits per component
+ writePSFmt(" /Width {0:d}\n", width);
+ writePSFmt(" /Height {0:d}\n", height);
+ writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n",
+ width, -height, height);
+ if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
+ writePS(" /BitsPerComponent 8\n");
+ } else {
+ writePSFmt(" /BitsPerComponent {0:d}\n",
+ colorMap ? colorMap->getBits() : 1);
+ }
+
+ // decode
+ if (colorMap) {
+ writePS(" /Decode [");
+ if ((level == psLevel2Sep || level == psLevel3Sep) &&
+ colorMap->getColorSpace()->getMode() == csSeparation) {
+ // this matches up with the code in the pdfImSep operator
+ n = (1 << colorMap->getBits()) - 1;
+ writePSFmt("{0:.4g} {1:.4g}", colorMap->getDecodeLow(0) * n,
+ colorMap->getDecodeHigh(0) * n);
+ } else if (colorMap->getColorSpace()->getMode() == csDeviceN) {
+ numComps = ((GfxDeviceNColorSpace *)colorMap->getColorSpace())->
+ getAlt()->getNComps();
+ for (i = 0; i < numComps; ++i) {
+ if (i > 0) {
+ writePS(" ");
+ }
+ writePS("0 1");
+ }
+ } else {
+ numComps = colorMap->getNumPixelComps();
+ for (i = 0; i < numComps; ++i) {
+ if (i > 0) {
+ writePS(" ");
+ }
+ writePSFmt("{0:.4g} {1:.4g}", colorMap->getDecodeLow(i),
+ colorMap->getDecodeHigh(i));
+ }
+ }
+ writePS("]\n");
+ } else {
+ writePSFmt(" /Decode [{0:d} {1:d}]\n", invert ? 1 : 0, invert ? 0 : 1);
+ }
+
+ // data source
+ if (mode == psModeForm || inType3Char || preload) {
+ writePS(" /DataSource { 2 copy get exch 1 add exch }\n");
+ } else {
+ writePS(" /DataSource currentfile\n");
+ }
+
+ // filters
+ s = str->getPSFilter(level < psLevel2 ? 1 : level < psLevel3 ? 2 : 3,
+ " ");
+ if ((colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) ||
+ inlineImg || !s) {
+ useRLE = gTrue;
+ useASCII = !(mode == psModeForm || inType3Char || preload);
+ useCompressed = gFalse;
+ } else {
+ useRLE = gFalse;
+ useASCII = str->isBinary() &&
+ !(mode == psModeForm || inType3Char || preload);
+ useCompressed = gTrue;
+ }
+ if (useASCII) {
+ writePSFmt(" /ASCII{0:s}Decode filter\n",
+ useASCIIHex ? "Hex" : "85");
+ }
+ if (useRLE) {
+ writePS(" /RunLengthDecode filter\n");
+ }
+ if (useCompressed) {
+ writePS(s->getCString());
+ }
+ if (s) {
+ delete s;
+ }
+
+ // end of image (data) dictionary
+ writePS(">>\n");
+
+ // explicit masking
+ if (maskStr) {
+ writePS(" /MaskDict\n");
+ writePS("<<\n");
+ writePS(" /ImageType 1\n");
+ writePSFmt(" /Width {0:d}\n", maskWidth);
+ writePSFmt(" /Height {0:d}\n", maskHeight);
+ writePSFmt(" /ImageMatrix [{0:d} 0 0 {1:d} 0 {2:d}]\n",
+ maskWidth, -maskHeight, maskHeight);
+ writePS(" /BitsPerComponent 1\n");
+ writePSFmt(" /Decode [{0:d} {1:d}]\n",
+ maskInvert ? 1 : 0, maskInvert ? 0 : 1);
+
+ // mask data source
+ writePS(" /DataSource currentfile\n");
+ s = maskStr->getPSFilter(3, " ");
+ if (!s) {
+ maskUseRLE = gTrue;
+ maskUseASCII = gTrue;
+ maskUseCompressed = gFalse;
+ } else {
+ maskUseRLE = gFalse;
+ maskUseASCII = maskStr->isBinary();
+ maskUseCompressed = gTrue;
+ }
+ if (maskUseASCII) {
+ writePSFmt(" /ASCII{0:s}Decode filter\n",
+ useASCIIHex ? "Hex" : "85");
+ }
+ if (maskUseRLE) {
+ writePS(" /RunLengthDecode filter\n");
+ }
+ if (maskUseCompressed) {
+ writePS(s->getCString());
+ }
+ if (s) {
+ delete s;
+ }
+
+ writePS(">>\n");
+ writePS(">>\n");
+ }
+
+ if (mode == psModeForm || inType3Char || preload) {
+
+ // image command
+ writePSFmt("{0:s}\n", colorMap ? "image" : "imagemask");
+
+ } else {
+
+ if ((level == psLevel2Sep || level == psLevel3Sep) && colorMap &&
+ colorMap->getColorSpace()->getMode() == csSeparation) {
+ color.c[0] = gfxColorComp1;
+ sepCS = (GfxSeparationColorSpace *)colorMap->getColorSpace();
+ sepCS->getCMYK(&color, &cmyk);
+ writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} ({4:t}) pdfImSep\n",
+ colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k),
+ sepCS->getName());
+ } else {
+ writePSFmt("{0:s}\n", colorMap ? "pdfIm" : "pdfImM");
+ }
+
+ }
+
+ // explicit masking
+ if (maskStr) {
+
+ if (maskUseCompressed) {
+ maskStr = maskStr->getUndecodedStream();
+ }
+
+ // add RunLengthEncode and ASCIIHex/85 encode filters
+ if (maskUseRLE) {
+ maskStr = new RunLengthEncoder(maskStr);
+ }
+ if (maskUseASCII) {
+ if (useASCIIHex) {
+ maskStr = new ASCIIHexEncoder(maskStr);
+ } else {
+ maskStr = new ASCII85Encoder(maskStr);
+ }
+ }
+
+ // copy the stream data
+ maskStr->reset();
+ while ((c = maskStr->getChar()) != EOF) {
+ writePSChar(c);
+ }
+ maskStr->close();
+ writePSChar('\n');
+
+ // delete encoders
+ if (maskUseRLE || maskUseASCII) {
+ delete maskStr;
+ }
+ }
+
+ // get rid of the array and index
+ if (mode == psModeForm || inType3Char || preload) {
+ writePS("pop pop\n");
+
+ // image data
+ } else {
+
+ // cut off inline image streams at appropriate length
+ if (inlineImg) {
+ str = new FixedLengthEncoder(str, len);
+ } else if (useCompressed) {
+ str = str->getUndecodedStream();
+ }
+
+ // recode DeviceN data
+ if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
+ str = new DeviceNRecoder(str, width, height, colorMap);
+ }
+
+ // add RunLengthEncode and ASCIIHex/85 encode filters
+ if (useRLE) {
+ str = new RunLengthEncoder(str);
+ }
+ if (useASCII) {
+ if (useASCIIHex) {
+ str = new ASCIIHexEncoder(str);
+ } else {
+ str = new ASCII85Encoder(str);
+ }
+ }
+
+ // copy the stream data
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ writePSChar(c);
+ }
+ str->close();
+
+ // add newline and trailer to the end
+ writePSChar('\n');
+ writePS("%-EOD-\n");
+
+ // delete encoders
+ if (useRLE || useASCII || inlineImg) {
+ delete str;
+ }
+ }
+}
+
+void PSOutputDev::dumpColorSpaceL2(GfxColorSpace *colorSpace,
+ GBool genXform, GBool updateColors,
+ GBool map01) {
+ GfxCalGrayColorSpace *calGrayCS;
+ GfxCalRGBColorSpace *calRGBCS;
+ GfxLabColorSpace *labCS;
+ GfxIndexedColorSpace *indexedCS;
+ GfxSeparationColorSpace *separationCS;
+ GfxDeviceNColorSpace *deviceNCS;
+ GfxColorSpace *baseCS;
+ Guchar *lookup, *p;
+ double x[gfxColorMaxComps], y[gfxColorMaxComps];
+ double low[gfxColorMaxComps], range[gfxColorMaxComps];
+ GfxColor color;
+ GfxCMYK cmyk;
+ Function *func;
+ int n, numComps, numAltComps;
+ int byte;
+ int i, j, k;
+
+ switch (colorSpace->getMode()) {
+
+ case csDeviceGray:
+ writePS("/DeviceGray");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ processColors |= psProcessBlack;
+ }
+ break;
+
+ case csCalGray:
+ calGrayCS = (GfxCalGrayColorSpace *)colorSpace;
+ writePS("[/CIEBasedA <<\n");
+ writePSFmt(" /DecodeA {{{0:.4g} exp}} bind\n", calGrayCS->getGamma());
+ writePSFmt(" /MatrixA [{0:.4g} {1:.4g} {2:.4g}]\n",
+ calGrayCS->getWhiteX(), calGrayCS->getWhiteY(),
+ calGrayCS->getWhiteZ());
+ writePSFmt(" /WhitePoint [{0:.4g} {1:.4g} {2:.4g}]\n",
+ calGrayCS->getWhiteX(), calGrayCS->getWhiteY(),
+ calGrayCS->getWhiteZ());
+ writePSFmt(" /BlackPoint [{0:.4g} {1:.4g} {2:.4g}]\n",
+ calGrayCS->getBlackX(), calGrayCS->getBlackY(),
+ calGrayCS->getBlackZ());
+ writePS(">>]");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ processColors |= psProcessBlack;
+ }
+ break;
+
+ case csDeviceRGB:
+ writePS("/DeviceRGB");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ processColors |= psProcessCMYK;
+ }
+ break;
+
+ case csCalRGB:
+ calRGBCS = (GfxCalRGBColorSpace *)colorSpace;
+ writePS("[/CIEBasedABC <<\n");
+ writePSFmt(" /DecodeABC [{{{0:.4g} exp}} bind {{{1:.4g} exp}} bind {{{2:.4g} exp}} bind]\n",
+ calRGBCS->getGammaR(), calRGBCS->getGammaG(),
+ calRGBCS->getGammaB());
+ writePSFmt(" /MatrixABC [{0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} {6:.4g} {7:.4g} {8:.4g}]\n",
+ calRGBCS->getMatrix()[0], calRGBCS->getMatrix()[1],
+ calRGBCS->getMatrix()[2], calRGBCS->getMatrix()[3],
+ calRGBCS->getMatrix()[4], calRGBCS->getMatrix()[5],
+ calRGBCS->getMatrix()[6], calRGBCS->getMatrix()[7],
+ calRGBCS->getMatrix()[8]);
+ writePSFmt(" /WhitePoint [{0:.4g} {1:.4g} {2:.4g}]\n",
+ calRGBCS->getWhiteX(), calRGBCS->getWhiteY(),
+ calRGBCS->getWhiteZ());
+ writePSFmt(" /BlackPoint [{0:.4g} {1:.4g} {2:.4g}]\n",
+ calRGBCS->getBlackX(), calRGBCS->getBlackY(),
+ calRGBCS->getBlackZ());
+ writePS(">>]");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ processColors |= psProcessCMYK;
+ }
+ break;
+
+ case csDeviceCMYK:
+ writePS("/DeviceCMYK");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ processColors |= psProcessCMYK;
+ }
+ break;
+
+ case csLab:
+ labCS = (GfxLabColorSpace *)colorSpace;
+ writePS("[/CIEBasedABC <<\n");
+ if (map01) {
+ writePS(" /RangeABC [0 1 0 1 0 1]\n");
+ writePSFmt(" /DecodeABC [{{100 mul 16 add 116 div}} bind {{{0:.4g} mul {1:.4g} add}} bind {{{2:.4g} mul {3:.4g} add}} bind]\n",
+ (labCS->getAMax() - labCS->getAMin()) / 500.0,
+ labCS->getAMin() / 500.0,
+ (labCS->getBMax() - labCS->getBMin()) / 200.0,
+ labCS->getBMin() / 200.0);
+ } else {
+ writePSFmt(" /RangeABC [0 100 {0:.4g} {1:.4g} {2:.4g} {3:.4g}]\n",
+ labCS->getAMin(), labCS->getAMax(),
+ labCS->getBMin(), labCS->getBMax());
+ writePS(" /DecodeABC [{16 add 116 div} bind {500 div} bind {200 div} bind]\n");
+ }
+ writePS(" /MatrixABC [1 1 1 1 0 0 0 0 -1]\n");
+ writePS(" /DecodeLMN\n");
+ writePS(" [{dup 6 29 div ge {dup dup mul mul}\n");
+ writePSFmt(" {{4 29 div sub 108 841 div mul }} ifelse {0:.4g} mul}} bind\n",
+ labCS->getWhiteX());
+ writePS(" {dup 6 29 div ge {dup dup mul mul}\n");
+ writePSFmt(" {{4 29 div sub 108 841 div mul }} ifelse {0:.4g} mul}} bind\n",
+ labCS->getWhiteY());
+ writePS(" {dup 6 29 div ge {dup dup mul mul}\n");
+ writePSFmt(" {{4 29 div sub 108 841 div mul }} ifelse {0:.4g} mul}} bind]\n",
+ labCS->getWhiteZ());
+ writePSFmt(" /WhitePoint [{0:.4g} {1:.4g} {2:.4g}]\n",
+ labCS->getWhiteX(), labCS->getWhiteY(), labCS->getWhiteZ());
+ writePSFmt(" /BlackPoint [{0:.4g} {1:.4g} {2:.4g}]\n",
+ labCS->getBlackX(), labCS->getBlackY(), labCS->getBlackZ());
+ writePS(">>]");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ processColors |= psProcessCMYK;
+ }
+ break;
+
+ case csICCBased:
+ // there is no transform function to the alternate color space, so
+ // we can use it directly
+ dumpColorSpaceL2(((GfxICCBasedColorSpace *)colorSpace)->getAlt(),
+ genXform, updateColors, gFalse);
+ break;
+
+ case csIndexed:
+ indexedCS = (GfxIndexedColorSpace *)colorSpace;
+ baseCS = indexedCS->getBase();
+ writePS("[/Indexed ");
+ dumpColorSpaceL2(baseCS, gFalse, gFalse, gTrue);
+ n = indexedCS->getIndexHigh();
+ numComps = baseCS->getNComps();
+ lookup = indexedCS->getLookup();
+ writePSFmt(" {0:d} <\n", n);
+ if (baseCS->getMode() == csDeviceN) {
+ func = ((GfxDeviceNColorSpace *)baseCS)->getTintTransformFunc();
+ baseCS->getDefaultRanges(low, range, indexedCS->getIndexHigh());
+ if (((GfxDeviceNColorSpace *)baseCS)->getAlt()->getMode() == csLab) {
+ labCS = (GfxLabColorSpace *)((GfxDeviceNColorSpace *)baseCS)->getAlt();
+ } else {
+ labCS = NULL;
+ }
+ numAltComps = ((GfxDeviceNColorSpace *)baseCS)->getAlt()->getNComps();
+ p = lookup;
+ for (i = 0; i <= n; i += 8) {
+ writePS(" ");
+ for (j = i; j < i+8 && j <= n; ++j) {
+ for (k = 0; k < numComps; ++k) {
+ x[k] = low[k] + (*p++ / 255.0) * range[k];
+ }
+ func->transform(x, y);
+ if (labCS) {
+ y[0] /= 100.0;
+ y[1] = (y[1] - labCS->getAMin()) /
+ (labCS->getAMax() - labCS->getAMin());
+ y[2] = (y[2] - labCS->getBMin()) /
+ (labCS->getBMax() - labCS->getBMin());
+ }
+ for (k = 0; k < numAltComps; ++k) {
+ byte = (int)(y[k] * 255 + 0.5);
+ if (byte < 0) {
+ byte = 0;
+ } else if (byte > 255) {
+ byte = 255;
+ }
+ writePSFmt("{0:02x}", byte);
+ }
+ if (updateColors) {
+ color.c[0] = dblToCol(j);
+ indexedCS->getCMYK(&color, &cmyk);
+ addProcessColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k));
+ }
+ }
+ writePS("\n");
+ }
+ } else {
+ for (i = 0; i <= n; i += 8) {
+ writePS(" ");
+ for (j = i; j < i+8 && j <= n; ++j) {
+ for (k = 0; k < numComps; ++k) {
+ writePSFmt("{0:02x}", lookup[j * numComps + k]);
+ }
+ if (updateColors) {
+ color.c[0] = dblToCol(j);
+ indexedCS->getCMYK(&color, &cmyk);
+ addProcessColor(colToDbl(cmyk.c), colToDbl(cmyk.m),
+ colToDbl(cmyk.y), colToDbl(cmyk.k));
+ }
+ }
+ writePS("\n");
+ }
+ }
+ writePS(">]");
+ if (genXform) {
+ writePS(" {}");
+ }
+ break;
+
+ case csSeparation:
+ separationCS = (GfxSeparationColorSpace *)colorSpace;
+ writePS("[/Separation ");
+ writePSString(separationCS->getName());
+ writePS(" ");
+ dumpColorSpaceL2(separationCS->getAlt(), gFalse, gFalse, gFalse);
+ writePS("\n");
+ cvtFunction(separationCS->getFunc());
+ writePS("]");
+ if (genXform) {
+ writePS(" {}");
+ }
+ if (updateColors) {
+ addCustomColor(separationCS);
+ }
+ break;
+
+ case csDeviceN:
+ // DeviceN color spaces are a Level 3 PostScript feature.
+ deviceNCS = (GfxDeviceNColorSpace *)colorSpace;
+ dumpColorSpaceL2(deviceNCS->getAlt(), gFalse, updateColors, map01);
+ if (genXform) {
+ writePS(" ");
+ cvtFunction(deviceNCS->getTintTransformFunc());
+ }
+ break;
+
+ case csPattern:
+ //~ unimplemented
+ break;
+ }
+}
+
+#if OPI_SUPPORT
+void PSOutputDev::opiBegin(GfxState *state, Dict *opiDict) {
+ Object dict;
+
+ if (globalParams->getPSOPI()) {
+ opiDict->lookup("2.0", &dict);
+ if (dict.isDict()) {
+ opiBegin20(state, dict.getDict());
+ dict.free();
+ } else {
+ dict.free();
+ opiDict->lookup("1.3", &dict);
+ if (dict.isDict()) {
+ opiBegin13(state, dict.getDict());
+ }
+ dict.free();
+ }
+ }
+}
+
+void PSOutputDev::opiBegin20(GfxState *state, Dict *dict) {
+ Object obj1, obj2, obj3, obj4;
+ double width, height, left, right, top, bottom;
+ int w, h;
+ int i;
+
+ writePS("%%BeginOPI: 2.0\n");
+ writePS("%%Distilled\n");
+
+ dict->lookup("F", &obj1);
+ if (getFileSpec(&obj1, &obj2)) {
+ writePSFmt("%%ImageFileName: {0:t}\n", obj2.getString());
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("MainImage", &obj1);
+ if (obj1.isString()) {
+ writePSFmt("%%MainImage: {0:t}\n", obj1.getString());
+ }
+ obj1.free();
+
+ //~ ignoring 'Tags' entry
+ //~ need to use writePSString() and deal with >255-char lines
+
+ dict->lookup("Size", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 2) {
+ obj1.arrayGet(0, &obj2);
+ width = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ height = obj2.getNum();
+ obj2.free();
+ writePSFmt("%%ImageDimensions: {0:.4g} {1:.4g}\n", width, height);
+ }
+ obj1.free();
+
+ dict->lookup("CropRect", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 4) {
+ obj1.arrayGet(0, &obj2);
+ left = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ top = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ right = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ bottom = obj2.getNum();
+ obj2.free();
+ writePSFmt("%%ImageCropRect: {0:.4g} {1:.4g} {2:.4g} {3:.4g}\n",
+ left, top, right, bottom);
+ }
+ obj1.free();
+
+ dict->lookup("Overprint", &obj1);
+ if (obj1.isBool()) {
+ writePSFmt("%%ImageOverprint: {0:s}\n", obj1.getBool() ? "true" : "false");
+ }
+ obj1.free();
+
+ dict->lookup("Inks", &obj1);
+ if (obj1.isName()) {
+ writePSFmt("%%ImageInks: {0:s}\n", obj1.getName());
+ } else if (obj1.isArray() && obj1.arrayGetLength() >= 1) {
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isName()) {
+ writePSFmt("%%ImageInks: {0:s} {1:d}",
+ obj2.getName(), (obj1.arrayGetLength() - 1) / 2);
+ for (i = 1; i+1 < obj1.arrayGetLength(); i += 2) {
+ obj1.arrayGet(i, &obj3);
+ obj1.arrayGet(i+1, &obj4);
+ if (obj3.isString() && obj4.isNum()) {
+ writePS(" ");
+ writePSString(obj3.getString());
+ writePSFmt(" {0:.4g}", obj4.getNum());
+ }
+ obj3.free();
+ obj4.free();
+ }
+ writePS("\n");
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ writePS("gsave\n");
+
+ writePS("%%BeginIncludedImage\n");
+
+ dict->lookup("IncludedImageDimensions", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 2) {
+ obj1.arrayGet(0, &obj2);
+ w = obj2.getInt();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ h = obj2.getInt();
+ obj2.free();
+ writePSFmt("%%IncludedImageDimensions: {0:d} {1:d}\n", w, h);
+ }
+ obj1.free();
+
+ dict->lookup("IncludedImageQuality", &obj1);
+ if (obj1.isNum()) {
+ writePSFmt("%%IncludedImageQuality: {0:.4g}\n", obj1.getNum());
+ }
+ obj1.free();
+
+ ++opi20Nest;
+}
+
+void PSOutputDev::opiBegin13(GfxState *state, Dict *dict) {
+ Object obj1, obj2;
+ int left, right, top, bottom, samples, bits, width, height;
+ double c, m, y, k;
+ double llx, lly, ulx, uly, urx, ury, lrx, lry;
+ double tllx, tlly, tulx, tuly, turx, tury, tlrx, tlry;
+ double horiz, vert;
+ int i, j;
+
+ writePS("save\n");
+ writePS("/opiMatrix2 matrix currentmatrix def\n");
+ writePS("opiMatrix setmatrix\n");
+
+ dict->lookup("F", &obj1);
+ if (getFileSpec(&obj1, &obj2)) {
+ writePSFmt("%ALDImageFileName: {0:t}\n", obj2.getString());
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("CropRect", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 4) {
+ obj1.arrayGet(0, &obj2);
+ left = obj2.getInt();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ top = obj2.getInt();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ right = obj2.getInt();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ bottom = obj2.getInt();
+ obj2.free();
+ writePSFmt("%ALDImageCropRect: {0:d} {1:d} {2:d} {3:d}\n",
+ left, top, right, bottom);
+ }
+ obj1.free();
+
+ dict->lookup("Color", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 5) {
+ obj1.arrayGet(0, &obj2);
+ c = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ m = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ y = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ k = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(4, &obj2);
+ if (obj2.isString()) {
+ writePSFmt("%ALDImageColor: {0:.4g} {1:.4g} {2:.4g} {3:.4g} ",
+ c, m, y, k);
+ writePSString(obj2.getString());
+ writePS("\n");
+ }
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("ColorType", &obj1);
+ if (obj1.isName()) {
+ writePSFmt("%ALDImageColorType: {0:s}\n", obj1.getName());
+ }
+ obj1.free();
+
+ //~ ignores 'Comments' entry
+ //~ need to handle multiple lines
+
+ dict->lookup("CropFixed", &obj1);
+ if (obj1.isArray()) {
+ obj1.arrayGet(0, &obj2);
+ ulx = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ uly = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ lrx = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ lry = obj2.getNum();
+ obj2.free();
+ writePSFmt("%ALDImageCropFixed: {0:.4g} {1:.4g} {2:.4g} {3:.4g}\n",
+ ulx, uly, lrx, lry);
+ }
+ obj1.free();
+
+ dict->lookup("GrayMap", &obj1);
+ if (obj1.isArray()) {
+ writePS("%ALDImageGrayMap:");
+ for (i = 0; i < obj1.arrayGetLength(); i += 16) {
+ if (i > 0) {
+ writePS("\n%%+");
+ }
+ for (j = 0; j < 16 && i+j < obj1.arrayGetLength(); ++j) {
+ obj1.arrayGet(i+j, &obj2);
+ writePSFmt(" {0:d}", obj2.getInt());
+ obj2.free();
+ }
+ }
+ writePS("\n");
+ }
+ obj1.free();
+
+ dict->lookup("ID", &obj1);
+ if (obj1.isString()) {
+ writePSFmt("%ALDImageID: {0:t}\n", obj1.getString());
+ }
+ obj1.free();
+
+ dict->lookup("ImageType", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 2) {
+ obj1.arrayGet(0, &obj2);
+ samples = obj2.getInt();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ bits = obj2.getInt();
+ obj2.free();
+ writePSFmt("%ALDImageType: {0:d} {1:d}\n", samples, bits);
+ }
+ obj1.free();
+
+ dict->lookup("Overprint", &obj1);
+ if (obj1.isBool()) {
+ writePSFmt("%ALDImageOverprint: {0:s}\n",
+ obj1.getBool() ? "true" : "false");
+ }
+ obj1.free();
+
+ dict->lookup("Position", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 8) {
+ obj1.arrayGet(0, &obj2);
+ llx = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ lly = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ ulx = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ uly = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(4, &obj2);
+ urx = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(5, &obj2);
+ ury = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(6, &obj2);
+ lrx = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(7, &obj2);
+ lry = obj2.getNum();
+ obj2.free();
+ opiTransform(state, llx, lly, &tllx, &tlly);
+ opiTransform(state, ulx, uly, &tulx, &tuly);
+ opiTransform(state, urx, ury, &turx, &tury);
+ opiTransform(state, lrx, lry, &tlrx, &tlry);
+ writePSFmt("%ALDImagePosition: {0:.4g} {1:.4g} {2:.4g} {3:.4g} {4:.4g} {5:.4g} {6:.4g} {7:.4g}\n",
+ tllx, tlly, tulx, tuly, turx, tury, tlrx, tlry);
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("Resolution", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 2) {
+ obj1.arrayGet(0, &obj2);
+ horiz = obj2.getNum();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ vert = obj2.getNum();
+ obj2.free();
+ writePSFmt("%ALDImageResoution: {0:.4g} {1:.4g}\n", horiz, vert);
+ obj2.free();
+ }
+ obj1.free();
+
+ dict->lookup("Size", &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 2) {
+ obj1.arrayGet(0, &obj2);
+ width = obj2.getInt();
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ height = obj2.getInt();
+ obj2.free();
+ writePSFmt("%ALDImageDimensions: {0:d} {1:d}\n", width, height);
+ }
+ obj1.free();
+
+ //~ ignoring 'Tags' entry
+ //~ need to use writePSString() and deal with >255-char lines
+
+ dict->lookup("Tint", &obj1);
+ if (obj1.isNum()) {
+ writePSFmt("%ALDImageTint: {0:.4g}\n", obj1.getNum());
+ }
+ obj1.free();
+
+ dict->lookup("Transparency", &obj1);
+ if (obj1.isBool()) {
+ writePSFmt("%ALDImageTransparency: {0:s}\n",
+ obj1.getBool() ? "true" : "false");
+ }
+ obj1.free();
+
+ writePS("%%BeginObject: image\n");
+ writePS("opiMatrix2 setmatrix\n");
+ ++opi13Nest;
+}
+
+// Convert PDF user space coordinates to PostScript default user space
+// coordinates. This has to account for both the PDF CTM and the
+// PSOutputDev page-fitting transform.
+void PSOutputDev::opiTransform(GfxState *state, double x0, double y0,
+ double *x1, double *y1) {
+ double t;
+
+ state->transform(x0, y0, x1, y1);
+ *x1 += tx;
+ *y1 += ty;
+ if (rotate == 90) {
+ t = *x1;
+ *x1 = -*y1;
+ *y1 = t;
+ } else if (rotate == 180) {
+ *x1 = -*x1;
+ *y1 = -*y1;
+ } else if (rotate == 270) {
+ t = *x1;
+ *x1 = *y1;
+ *y1 = -t;
+ }
+ *x1 *= xScale;
+ *y1 *= yScale;
+}
+
+void PSOutputDev::opiEnd(GfxState *state, Dict *opiDict) {
+ Object dict;
+
+ if (globalParams->getPSOPI()) {
+ opiDict->lookup("2.0", &dict);
+ if (dict.isDict()) {
+ writePS("%%EndIncludedImage\n");
+ writePS("%%EndOPI\n");
+ writePS("grestore\n");
+ --opi20Nest;
+ dict.free();
+ } else {
+ dict.free();
+ opiDict->lookup("1.3", &dict);
+ if (dict.isDict()) {
+ writePS("%%EndObject\n");
+ writePS("restore\n");
+ --opi13Nest;
+ }
+ dict.free();
+ }
+ }
+}
+
+GBool PSOutputDev::getFileSpec(Object *fileSpec, Object *fileName) {
+ if (fileSpec->isString()) {
+ fileSpec->copy(fileName);
+ return gTrue;
+ }
+ if (fileSpec->isDict()) {
+ fileSpec->dictLookup("DOS", fileName);
+ if (fileName->isString()) {
+ return gTrue;
+ }
+ fileName->free();
+ fileSpec->dictLookup("Mac", fileName);
+ if (fileName->isString()) {
+ return gTrue;
+ }
+ fileName->free();
+ fileSpec->dictLookup("Unix", fileName);
+ if (fileName->isString()) {
+ return gTrue;
+ }
+ fileName->free();
+ fileSpec->dictLookup("F", fileName);
+ if (fileName->isString()) {
+ return gTrue;
+ }
+ fileName->free();
+ }
+ return gFalse;
+}
+#endif // OPI_SUPPORT
+
+void PSOutputDev::type3D0(GfxState * /*state*/, double wx, double wy) {
+ writePSFmt("{0:.4g} {1:.4g} setcharwidth\n", wx, wy);
+ writePS("q\n");
+ t3NeedsRestore = gTrue;
+}
+
+void PSOutputDev::type3D1(GfxState * /*state*/, double wx, double wy,
+ double llx, double lly, double urx, double ury) {
+ t3WX = wx;
+ t3WY = wy;
+ t3LLX = llx;
+ t3LLY = lly;
+ t3URX = urx;
+ t3URY = ury;
+ t3String = new GString();
+ writePS("q\n");
+ t3Cacheable = gTrue;
+ t3NeedsRestore = gTrue;
+}
+
+void PSOutputDev::drawForm(Ref id) {
+ writePSFmt("f_{0:d}_{1:d}\n", id.num, id.gen);
+}
+
+void PSOutputDev::psXObject(Stream *psStream, Stream *level1Stream) {
+ Stream *str;
+ int c;
+
+ if ((level == psLevel1 || level == psLevel1Sep) && level1Stream) {
+ str = level1Stream;
+ } else {
+ str = psStream;
+ }
+ str->reset();
+ while ((c = str->getChar()) != EOF) {
+ writePSChar(c);
+ }
+ str->close();
+}
+
+//~ can nextFunc be reset to 0 -- maybe at the start of each page?
+//~ or maybe at the start of each color space / pattern?
+void PSOutputDev::cvtFunction(Function *func) {
+ SampledFunction *func0;
+ ExponentialFunction *func2;
+ StitchingFunction *func3;
+ PostScriptFunction *func4;
+ int thisFunc, m, n, nSamples, i, j, k;
+
+ switch (func->getType()) {
+
+ case -1: // identity
+ writePS("{}\n");
+ break;
+
+ case 0: // sampled
+ func0 = (SampledFunction *)func;
+ thisFunc = nextFunc++;
+ m = func0->getInputSize();
+ n = func0->getOutputSize();
+ nSamples = n;
+ for (i = 0; i < m; ++i) {
+ nSamples *= func0->getSampleSize(i);
+ }
+ writePSFmt("/xpdfSamples{0:d} [\n", thisFunc);
+ for (i = 0; i < nSamples; ++i) {
+ writePSFmt("{0:.4g}\n", func0->getSamples()[i]);
+ }
+ writePS("] def\n");
+ writePSFmt("{{ {0:d} array {1:d} array {2:d} 2 roll\n", 2*m, m, m+2);
+ // [e01] [efrac] x0 x1 ... xm-1
+ for (i = m-1; i >= 0; --i) {
+ // [e01] [efrac] x0 x1 ... xi
+ writePSFmt("{0:.4g} sub {1:.4g} mul {2:.4g} add\n",
+ func0->getDomainMin(i),
+ (func0->getEncodeMax(i) - func0->getEncodeMin(i)) /
+ (func0->getDomainMax(i) - func0->getDomainMin(i)),
+ func0->getEncodeMin(i));
+ // [e01] [efrac] x0 x1 ... xi-1 xi'
+ writePSFmt("dup 0 lt {{ pop 0 }} {{ dup {0:d} gt {{ pop {1:d} }} if }} ifelse\n",
+ func0->getSampleSize(i) - 1, func0->getSampleSize(i) - 1);
+ // [e01] [efrac] x0 x1 ... xi-1 xi'
+ writePS("dup floor cvi exch dup ceiling cvi exch 2 index sub\n");
+ // [e01] [efrac] x0 x1 ... xi-1 floor(xi') ceiling(xi') xi'-floor(xi')
+ writePSFmt("{0:d} index {1:d} 3 2 roll put\n", i+3, i);
+ // [e01] [efrac] x0 x1 ... xi-1 floor(xi') ceiling(xi')
+ writePSFmt("{0:d} index {1:d} 3 2 roll put\n", i+3, 2*i+1);
+ // [e01] [efrac] x0 x1 ... xi-1 floor(xi')
+ writePSFmt("{0:d} index {1:d} 3 2 roll put\n", i+2, 2*i);
+ // [e01] [efrac] x0 x1 ... xi-1
+ }
+ // [e01] [efrac]
+ for (i = 0; i < n; ++i) {
+ // [e01] [efrac] y(0) ... y(i-1)
+ for (j = 0; j < (1<<m); ++j) {
+ // [e01] [efrac] y(0) ... y(i-1) s(0) s(1) ... s(j-1)
+ writePSFmt("xpdfSamples{0:d}\n", thisFunc);
+ k = m - 1;
+ writePSFmt("{0:d} index {1:d} get\n", i+j+2, 2 * k + ((j >> k) & 1));
+ for (k = m - 2; k >= 0; --k) {
+ writePSFmt("{0:d} mul {1:d} index {2:d} get add\n",
+ func0->getSampleSize(k),
+ i + j + 3,
+ 2 * k + ((j >> k) & 1));
+ }
+ if (n > 1) {
+ writePSFmt("{0:d} mul {1:d} add ", n, i);
+ }
+ writePS("get\n");
+ }
+ // [e01] [efrac] y(0) ... y(i-1) s(0) s(1) ... s(2^m-1)
+ for (j = 0; j < m; ++j) {
+ // [e01] [efrac] y(0) ... y(i-1) s(0) s(1) ... s(2^(m-j)-1)
+ for (k = 0; k < (1 << (m - j)); k += 2) {
+ // [e01] [efrac] y(0) ... y(i-1) <k/2 s' values> <2^(m-j)-k s values>
+ writePSFmt("{0:d} index {1:d} get dup\n",
+ i + k/2 + (1 << (m-j)) - k, j);
+ writePS("3 2 roll mul exch 1 exch sub 3 2 roll mul add\n");
+ writePSFmt("{0:d} 1 roll\n", k/2 + (1 << m-j) - k - 1);
+ }
+ // [e01] [efrac] s'(0) s'(1) ... s(2^(m-j-1)-1)
+ }
+ // [e01] [efrac] y(0) ... y(i-1) s
+ writePSFmt("{0:.4g} mul {1:.4g} add\n",
+ func0->getDecodeMax(i) - func0->getDecodeMin(i),
+ func0->getDecodeMin(i));
+ writePSFmt("dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
+ func0->getRangeMin(i), func0->getRangeMin(i),
+ func0->getRangeMax(i), func0->getRangeMax(i));
+ // [e01] [efrac] y(0) ... y(i-1) y(i)
+ }
+ // [e01] [efrac] y(0) ... y(n-1)
+ writePSFmt("{0:d} {1:d} roll pop pop }}\n", n+2, n);
+ break;
+
+ case 2: // exponential
+ func2 = (ExponentialFunction *)func;
+ n = func2->getOutputSize();
+ writePSFmt("{{ dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
+ func2->getDomainMin(0), func2->getDomainMin(0),
+ func2->getDomainMax(0), func2->getDomainMax(0));
+ // x
+ for (i = 0; i < n; ++i) {
+ // x y(0) .. y(i-1)
+ writePSFmt("{0:d} index {1:.4g} exp {2:.4g} mul {3:.4g} add\n",
+ i, func2->getE(), func2->getC1()[i] - func2->getC0()[i],
+ func2->getC0()[i]);
+ if (func2->getHasRange()) {
+ writePSFmt("dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
+ func2->getRangeMin(i), func2->getRangeMin(i),
+ func2->getRangeMax(i), func2->getRangeMax(i));
+ }
+ }
+ // x y(0) .. y(n-1)
+ writePSFmt("{0:d} {1:d} roll pop }}\n", n+1, n);
+ break;
+
+ case 3: // stitching
+ func3 = (StitchingFunction *)func;
+ thisFunc = nextFunc++;
+ for (i = 0; i < func3->getNumFuncs(); ++i) {
+ cvtFunction(func3->getFunc(i));
+ writePSFmt("/xpdfFunc{0:d}_{1:d} exch def\n", thisFunc, i);
+ }
+ writePSFmt("{{ dup {0:.4g} lt {{ pop {1:.4g} }} {{ dup {2:.4g} gt {{ pop {3:.4g} }} if }} ifelse\n",
+ func3->getDomainMin(0), func3->getDomainMin(0),
+ func3->getDomainMax(0), func3->getDomainMax(0));
+ for (i = 0; i < func3->getNumFuncs() - 1; ++i) {
+ writePSFmt("dup {0:.4g} lt {{ {1:.4g} sub {2:.4g} mul {3:.4g} add xpdfFunc{4:d}_{5:d} }} {{\n",
+ func3->getBounds()[i+1],
+ func3->getBounds()[i],
+ func3->getScale()[i],
+ func3->getEncode()[2*i],
+ thisFunc, i);
+ }
+ writePSFmt("{0:.4g} sub {1:.4g} mul {2:.4g} add xpdfFunc{3:d}_{4:d}\n",
+ func3->getBounds()[i],
+ func3->getScale()[i],
+ func3->getEncode()[2*i],
+ thisFunc, i);
+ for (i = 0; i < func3->getNumFuncs() - 1; ++i) {
+ writePS("} ifelse\n");
+ }
+ writePS("}\n");
+ break;
+
+ case 4: // PostScript
+ func4 = (PostScriptFunction *)func;
+ writePS(func4->getCodeString()->getCString());
+ writePS("\n");
+ break;
+ }
+}
+
+void PSOutputDev::writePSChar(char c) {
+ if (t3String) {
+ t3String->append(c);
+ } else {
+ (*outputFunc)(outputStream, &c, 1);
+ }
+}
+
+void PSOutputDev::writePS(char *s) {
+ if (t3String) {
+ t3String->append(s);
+ } else {
+ (*outputFunc)(outputStream, s, strlen(s));
+ }
+}
+
+void PSOutputDev::writePSFmt(const char *fmt, ...) {
+ va_list args;
+ GString *buf;
+
+ va_start(args, fmt);
+ if (t3String) {
+ t3String->appendfv((char *)fmt, args);
+ } else {
+ buf = GString::formatv((char *)fmt, args);
+ (*outputFunc)(outputStream, buf->getCString(), buf->getLength());
+ delete buf;
+ }
+ va_end(args);
+}
+
+void PSOutputDev::writePSString(GString *s) {
+ Guchar *p;
+ int n, line;
+ char buf[8];
+
+ writePSChar('(');
+ line = 1;
+ for (p = (Guchar *)s->getCString(), n = s->getLength(); n; ++p, --n) {
+ if (line >= 64) {
+ writePSChar('\\');
+ writePSChar('\n');
+ line = 0;
+ }
+ if (*p == '(' || *p == ')' || *p == '\\') {
+ writePSChar('\\');
+ writePSChar((char)*p);
+ line += 2;
+ } else if (*p < 0x20 || *p >= 0x80) {
+ sprintf(buf, "\\%03o", *p);
+ writePS(buf);
+ line += 4;
+ } else {
+ writePSChar((char)*p);
+ ++line;
+ }
+ }
+ writePSChar(')');
+}
+
+void PSOutputDev::writePSName(char *s) {
+ char *p;
+ char c;
+
+ p = s;
+ while ((c = *p++)) {
+ if (c <= (char)0x20 || c >= (char)0x7f ||
+ c == '(' || c == ')' || c == '<' || c == '>' ||
+ c == '[' || c == ']' || c == '{' || c == '}' ||
+ c == '/' || c == '%') {
+ writePSFmt("#{0:02x}", c & 0xff);
+ } else {
+ writePSChar(c);
+ }
+ }
+}
+
+GString *PSOutputDev::filterPSName(GString *name) {
+ GString *name2;
+ char buf[8];
+ int i;
+ char c;
+
+ name2 = new GString();
+
+ // ghostscript chokes on names that begin with out-of-limits
+ // numbers, e.g., 1e4foo is handled correctly (as a name), but
+ // 1e999foo generates a limitcheck error
+ c = name->getChar(0);
+ if (c >= '0' && c <= '9') {
+ name2->append('f');
+ }
+
+ for (i = 0; i < name->getLength(); ++i) {
+ c = name->getChar(i);
+ if (c <= (char)0x20 || c >= (char)0x7f ||
+ c == '(' || c == ')' || c == '<' || c == '>' ||
+ c == '[' || c == ']' || c == '{' || c == '}' ||
+ c == '/' || c == '%') {
+ sprintf(buf, "#%02x", c & 0xff);
+ name2->append(buf);
+ } else {
+ name2->append(c);
+ }
+ }
+ return name2;
+}
+
+// Write a DSC-compliant <textline>.
+void PSOutputDev::writePSTextLine(GString *s) {
+ int i, j, step;
+ int c;
+
+ // - DSC comments must be printable ASCII; control chars and
+ // backslashes have to be escaped (we do cheap Unicode-to-ASCII
+ // conversion by simply ignoring the high byte)
+ // - lines are limited to 255 chars (we limit to 200 here to allow
+ // for the keyword, which was emitted by the caller)
+ // - lines that start with a left paren are treated as <text>
+ // instead of <textline>, so we escape a leading paren
+ if (s->getLength() >= 2 &&
+ (s->getChar(0) & 0xff) == 0xfe &&
+ (s->getChar(1) & 0xff) == 0xff) {
+ i = 3;
+ step = 2;
+ } else {
+ i = 0;
+ step = 1;
+ }
+ for (j = 0; i < s->getLength() && j < 200; i += step) {
+ c = s->getChar(i) & 0xff;
+ if (c == '\\') {
+ writePS("\\\\");
+ j += 2;
+ } else if (c < 0x20 || c > 0x7e || (j == 0 && c == '(')) {
+ writePSFmt("\\{0:03o}", c);
+ j += 4;
+ } else {
+ writePSChar(c);
+ ++j;
+ }
+ }
+ writePS("\n");
+}
diff --git a/kpdf/xpdf/xpdf/PSTokenizer.cc b/kpdf/xpdf/xpdf/PSTokenizer.cc
deleted file mode 100644
index a959cc73..00000000
--- a/kpdf/xpdf/xpdf/PSTokenizer.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-//========================================================================
-//
-// PSTokenizer.cc
-//
-// Copyright 2002-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "PSTokenizer.h"
-
-//------------------------------------------------------------------------
-
-// A '1' in this array means the character is white space. A '1' or
-// '2' means the character ends a name or command.
-static char PSTokenizer_specialChars[256] = {
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
- 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx
-};
-
-//------------------------------------------------------------------------
-
-PSTokenizer::PSTokenizer(int (*getCharFuncA)(void *), void *dataA) {
- getCharFunc = getCharFuncA;
- data = dataA;
- charBuf = -1;
-}
-
-PSTokenizer::~PSTokenizer() {
-}
-
-GBool PSTokenizer::getToken(char *buf, int size, int *length) {
- GBool comment, backslash;
- int c;
- int i;
-
- // skip whitespace and comments
- comment = gFalse;
- while (1) {
- if ((c = getChar()) == EOF) {
- buf[0] = '\0';
- *length = 0;
- return gFalse;
- }
- if (comment) {
- if (c == '\x0a' || c == '\x0d') {
- comment = gFalse;
- }
- } else if (c == '%') {
- comment = gTrue;
- } else if (PSTokenizer_specialChars[c] != 1) {
- break;
- }
- }
-
- // read a token
- i = 0;
- buf[i++] = c;
- if (c == '(') {
- backslash = gFalse;
- while ((c = lookChar()) != EOF) {
- if (i < size - 1) {
- buf[i++] = c;
- }
- getChar();
- if (c == '\\') {
- backslash = gTrue;
- } else if (!backslash && c == ')') {
- break;
- } else {
- backslash = gFalse;
- }
- }
- } else if (c == '<') {
- while ((c = lookChar()) != EOF) {
- getChar();
- if (i < size - 1 && PSTokenizer_specialChars[c] != 1) {
- buf[i++] = c;
- }
- if (c == '>') {
- break;
- }
- }
- } else if (c != '[' && c != ']') {
- while ((c = lookChar()) != EOF && !PSTokenizer_specialChars[c]) {
- getChar();
- if (i < size - 1) {
- buf[i++] = c;
- }
- }
- }
- buf[i] = '\0';
- *length = i;
-
- return gTrue;
-}
-
-int PSTokenizer::lookChar() {
- if (charBuf < 0) {
- charBuf = (*getCharFunc)(data);
- }
- return charBuf;
-}
-
-int PSTokenizer::getChar() {
- int c;
-
- if (charBuf < 0) {
- charBuf = (*getCharFunc)(data);
- }
- c = charBuf;
- charBuf = -1;
- return c;
-}
diff --git a/kpdf/xpdf/xpdf/PSTokenizer.cpp b/kpdf/xpdf/xpdf/PSTokenizer.cpp
new file mode 100644
index 00000000..4898fe42
--- /dev/null
+++ b/kpdf/xpdf/xpdf/PSTokenizer.cpp
@@ -0,0 +1,135 @@
+//========================================================================
+//
+// PSTokenizer.cpp
+//
+// Copyright 2002-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "PSTokenizer.h"
+
+//------------------------------------------------------------------------
+
+// A '1' in this array means the character is white space. A '1' or
+// '2' means the character ends a name or command.
+static char PSTokenizer_specialChars[256] = {
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
+ 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx
+};
+
+//------------------------------------------------------------------------
+
+PSTokenizer::PSTokenizer(int (*getCharFuncA)(void *), void *dataA) {
+ getCharFunc = getCharFuncA;
+ data = dataA;
+ charBuf = -1;
+}
+
+PSTokenizer::~PSTokenizer() {
+}
+
+GBool PSTokenizer::getToken(char *buf, int size, int *length) {
+ GBool comment, backslash;
+ int c;
+ int i;
+
+ // skip whitespace and comments
+ comment = gFalse;
+ while (1) {
+ if ((c = getChar()) == EOF) {
+ buf[0] = '\0';
+ *length = 0;
+ return gFalse;
+ }
+ if (comment) {
+ if (c == '\x0a' || c == '\x0d') {
+ comment = gFalse;
+ }
+ } else if (c == '%') {
+ comment = gTrue;
+ } else if (PSTokenizer_specialChars[c] != 1) {
+ break;
+ }
+ }
+
+ // read a token
+ i = 0;
+ buf[i++] = c;
+ if (c == '(') {
+ backslash = gFalse;
+ while ((c = lookChar()) != EOF) {
+ if (i < size - 1) {
+ buf[i++] = c;
+ }
+ getChar();
+ if (c == '\\') {
+ backslash = gTrue;
+ } else if (!backslash && c == ')') {
+ break;
+ } else {
+ backslash = gFalse;
+ }
+ }
+ } else if (c == '<') {
+ while ((c = lookChar()) != EOF) {
+ getChar();
+ if (i < size - 1 && PSTokenizer_specialChars[c] != 1) {
+ buf[i++] = c;
+ }
+ if (c == '>') {
+ break;
+ }
+ }
+ } else if (c != '[' && c != ']') {
+ while ((c = lookChar()) != EOF && !PSTokenizer_specialChars[c]) {
+ getChar();
+ if (i < size - 1) {
+ buf[i++] = c;
+ }
+ }
+ }
+ buf[i] = '\0';
+ *length = i;
+
+ return gTrue;
+}
+
+int PSTokenizer::lookChar() {
+ if (charBuf < 0) {
+ charBuf = (*getCharFunc)(data);
+ }
+ return charBuf;
+}
+
+int PSTokenizer::getChar() {
+ int c;
+
+ if (charBuf < 0) {
+ charBuf = (*getCharFunc)(data);
+ }
+ c = charBuf;
+ charBuf = -1;
+ return c;
+}
diff --git a/kpdf/xpdf/xpdf/Page.cc b/kpdf/xpdf/xpdf/Page.cc
deleted file mode 100644
index cfeab88b..00000000
--- a/kpdf/xpdf/xpdf/Page.cc
+++ /dev/null
@@ -1,558 +0,0 @@
-//========================================================================
-//
-// Page.cc
-//
-// Copyright 1996-2007 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include "GlobalParams.h"
-#include "Object.h"
-#include "Array.h"
-#include "Dict.h"
-#include "XRef.h"
-#include "Link.h"
-#include "OutputDev.h"
-#ifndef PDF_PARSER_ONLY
-#include "Gfx.h"
-#include "GfxState.h"
-#include "Annot.h"
-#endif
-#include "Error.h"
-#include "Catalog.h"
-#include "Page.h"
-
-//------------------------------------------------------------------------
-// PDFRectangle
-//------------------------------------------------------------------------
-
-void PDFRectangle::clipTo(PDFRectangle *rect) {
- if (x1 < rect->x1) {
- x1 = rect->x1;
- } else if (x1 > rect->x2) {
- x1 = rect->x2;
- }
- if (x2 < rect->x1) {
- x2 = rect->x1;
- } else if (x2 > rect->x2) {
- x2 = rect->x2;
- }
- if (y1 < rect->y1) {
- y1 = rect->y1;
- } else if (y1 > rect->y2) {
- y1 = rect->y2;
- }
- if (y2 < rect->y1) {
- y2 = rect->y1;
- } else if (y2 > rect->y2) {
- y2 = rect->y2;
- }
-}
-
-//------------------------------------------------------------------------
-// PageAttrs
-//------------------------------------------------------------------------
-
-PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
- Object obj1;
-
- // get old/default values
- if (attrs) {
- mediaBox = attrs->mediaBox;
- cropBox = attrs->cropBox;
- haveCropBox = attrs->haveCropBox;
- rotate = attrs->rotate;
- attrs->resources.copy(&resources);
- } else {
- // set default MediaBox to 8.5" x 11" -- this shouldn't be necessary
- // but some (non-compliant) PDF files don't specify a MediaBox
- mediaBox.x1 = 0;
- mediaBox.y1 = 0;
- mediaBox.x2 = 612;
- mediaBox.y2 = 792;
- cropBox.x1 = cropBox.y1 = cropBox.x2 = cropBox.y2 = 0;
- haveCropBox = gFalse;
- rotate = 0;
- resources.initNull();
- }
-
- // media box
- readBox(dict, "MediaBox", &mediaBox);
-
- // crop box
- if (readBox(dict, "CropBox", &cropBox)) {
- haveCropBox = gTrue;
- }
- if (!haveCropBox) {
- cropBox = mediaBox;
- }
- else
- {
- // cropBox can not be bigger than mediaBox
- if (cropBox.x2 - cropBox.x1 > mediaBox.x2 - mediaBox.x1)
- {
- cropBox.x1 = mediaBox.x1;
- cropBox.x2 = mediaBox.x2;
- }
- if (cropBox.y2 - cropBox.y1 > mediaBox.y2 - mediaBox.y1)
- {
- cropBox.y1 = mediaBox.y1;
- cropBox.y2 = mediaBox.y2;
- }
- }
-
- // other boxes
- bleedBox = cropBox;
- readBox(dict, "BleedBox", &bleedBox);
- trimBox = cropBox;
- readBox(dict, "TrimBox", &trimBox);
- artBox = cropBox;
- readBox(dict, "ArtBox", &artBox);
-
- // clip all other boxes to the media box
- cropBox.clipTo(&mediaBox);
- bleedBox.clipTo(&mediaBox);
- trimBox.clipTo(&mediaBox);
- artBox.clipTo(&mediaBox);
-
- // rotate
- dict->lookup("Rotate", &obj1);
- if (obj1.isInt()) {
- rotate = obj1.getInt();
- }
- obj1.free();
- while (rotate < 0) {
- rotate += 360;
- }
- while (rotate >= 360) {
- rotate -= 360;
- }
-
- // misc attributes
- dict->lookup("LastModified", &lastModified);
- dict->lookup("BoxColorInfo", &boxColorInfo);
- dict->lookup("Group", &group);
- dict->lookup("Metadata", &metadata);
- dict->lookup("PieceInfo", &pieceInfo);
- dict->lookup("SeparationInfo", &separationInfo);
-
- // resource dictionary
- dict->lookup("Resources", &obj1);
- if (obj1.isDict()) {
- resources.free();
- obj1.copy(&resources);
- }
- obj1.free();
-}
-
-PageAttrs::~PageAttrs() {
- lastModified.free();
- boxColorInfo.free();
- group.free();
- metadata.free();
- pieceInfo.free();
- separationInfo.free();
- resources.free();
-}
-
-GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {
- PDFRectangle tmp;
- double t;
- Object obj1, obj2;
- GBool ok;
-
- dict->lookup(key, &obj1);
- if (obj1.isArray() && obj1.arrayGetLength() == 4) {
- ok = gTrue;
- obj1.arrayGet(0, &obj2);
- if (obj2.isNum()) {
- tmp.x1 = obj2.getNum();
- } else {
- ok = gFalse;
- }
- obj2.free();
- obj1.arrayGet(1, &obj2);
- if (obj2.isNum()) {
- tmp.y1 = obj2.getNum();
- } else {
- ok = gFalse;
- }
- obj2.free();
- obj1.arrayGet(2, &obj2);
- if (obj2.isNum()) {
- tmp.x2 = obj2.getNum();
- } else {
- ok = gFalse;
- }
- obj2.free();
- obj1.arrayGet(3, &obj2);
- if (obj2.isNum()) {
- tmp.y2 = obj2.getNum();
- } else {
- ok = gFalse;
- }
- obj2.free();
- if (ok) {
- if (tmp.x1 > tmp.x2) {
- t = tmp.x1; tmp.x1 = tmp.x2; tmp.x2 = t;
- }
- if (tmp.y1 > tmp.y2) {
- t = tmp.y1; tmp.y1 = tmp.y2; tmp.y2 = t;
- }
- *box = tmp;
- }
- } else {
- ok = gFalse;
- }
- obj1.free();
- return ok;
-}
-
-//------------------------------------------------------------------------
-// PageTransition
-//------------------------------------------------------------------------
-
-PageTransition::PageTransition(Dict *dict)
- : type(Replace),
- duration(1),
- alignment(Horizontal),
- direction(Inward),
- angle(0),
- scale(1.0),
- rectangular(false)
-{
- Object dictObj;
- Object obj;
-
- dict->lookup("Trans", &dictObj);
- if (dictObj.isDict()) {
- Dict *transDict = dictObj.getDict();
-
- if (transDict->lookup("S", &obj)->isName()) {
- const char *s = obj.getName();
- if (strcmp("R", s) == 0)
- type = Replace;
- else if (strcmp("Split", s) == 0)
- type = Split;
- else if (strcmp("Blinds", s) == 0)
- type = Blinds;
- else if (strcmp("Box", s) == 0)
- type = Box;
- else if (strcmp("Wipe", s) == 0)
- type = Wipe;
- else if (strcmp("Dissolve", s) == 0)
- type = Dissolve;
- else if (strcmp("Glitter", s) == 0)
- type = Glitter;
- else if (strcmp("Fly", s) == 0)
- type = Fly;
- else if (strcmp("Push", s) == 0)
- type = Push;
- else if (strcmp("Cover", s) == 0)
- type = Cover;
- else if (strcmp("Uncover", s) == 0)
- type = Push;
- else if (strcmp("Fade", s) == 0)
- type = Cover;
- }
- obj.free();
-
- if (transDict->lookup("D", &obj)->isInt()) {
- duration = obj.getInt();
- }
- obj.free();
-
- if (transDict->lookup("Dm", &obj)->isName()) {
- const char *dm = obj.getName();
- if ( strcmp( "H", dm ) == 0 )
- alignment = Horizontal;
- else if ( strcmp( "V", dm ) == 0 )
- alignment = Vertical;
- }
- obj.free();
-
- if (transDict->lookup("M", &obj)->isName()) {
- const char *m = obj.getName();
- if ( strcmp( "I", m ) == 0 )
- direction = Inward;
- else if ( strcmp( "O", m ) == 0 )
- direction = Outward;
- }
- obj.free();
-
- if (transDict->lookup("Di", &obj)->isInt()) {
- angle = obj.getInt();
- }
- obj.free();
-
- if (transDict->lookup("Di", &obj)->isName()) {
- if ( strcmp( "None", obj.getName() ) == 0 )
- angle = 0;
- }
- obj.free();
-
- if (transDict->lookup("SS", &obj)->isReal()) {
- scale = obj.getReal();
- }
- obj.free();
-
- if (transDict->lookup("B", &obj)->isBool()) {
- rectangular = obj.getBool();
- }
- obj.free();
- }
- dictObj.free();
-}
-
-PageTransition::~PageTransition() {
-}
-
-//------------------------------------------------------------------------
-// Page
-//------------------------------------------------------------------------
-
-Page::Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA) {
- ok = gTrue;
- xref = xrefA;
- num = numA;
-
- // get attributes
- attrs = attrsA;
-
- // get transition
- transition = new PageTransition( pageDict );
-
- // annotations
- pageDict->lookupNF("Annots", &annots);
- if (!(annots.isRef() || annots.isArray() || annots.isNull())) {
- error(-1, "Page annotations object (page %d) is wrong type (%s)",
- num, annots.getTypeName());
- annots.free();
- goto err2;
- }
-
- // contents
- pageDict->lookupNF("Contents", &contents);
- if (!(contents.isRef() || contents.isArray() ||
- contents.isNull())) {
- error(-1, "Page contents object (page %d) is wrong type (%s)",
- num, contents.getTypeName());
- contents.free();
- goto err1;
- }
-
- return;
-
- err2:
- annots.initNull();
- err1:
- contents.initNull();
- ok = gFalse;
-}
-
-Page::~Page() {
- delete attrs;
- delete transition;
- annots.free();
- contents.free();
-}
-
-Links *Page::getLinks(Catalog *catalog) {
- Links *links;
- Object obj;
-
- links = new Links(getAnnots(&obj), catalog->getBaseURI());
- obj.free();
- return links;
-}
-
-void Page::display(OutputDev *out, double hDPI, double vDPI,
- int rotate, GBool useMediaBox, GBool crop,
- GBool printing, Catalog *catalog,
- GBool (*abortCheckCbk)(void *data),
- void *abortCheckCbkData) {
- displaySlice(out, hDPI, vDPI, rotate, useMediaBox, crop,
- -1, -1, -1, -1, printing, catalog,
- abortCheckCbk, abortCheckCbkData);
-}
-
-void Page::displaySlice(OutputDev *out, double hDPI, double vDPI,
- int rotate, GBool useMediaBox, GBool crop,
- int sliceX, int sliceY, int sliceW, int sliceH,
- GBool printing, Catalog *catalog,
- GBool (*abortCheckCbk)(void *data),
- void *abortCheckCbkData) {
-#ifndef PDF_PARSER_ONLY
- PDFRectangle *mediaBox, *cropBox;
- PDFRectangle box;
- Gfx *gfx;
- Object obj;
- Annots *annotList;
- Dict *acroForm;
- int i;
-
- if (!out->checkPageSlice(this, hDPI, vDPI, rotate, useMediaBox, crop,
- sliceX, sliceY, sliceW, sliceH,
- printing, catalog,
- abortCheckCbk, abortCheckCbkData)) {
- return;
- }
-
- rotate += getRotate();
- if (rotate >= 360) {
- rotate -= 360;
- } else if (rotate < 0) {
- rotate += 360;
- }
-
- makeBox(hDPI, vDPI, rotate, useMediaBox, out->upsideDown(),
- sliceX, sliceY, sliceW, sliceH, &box, &crop);
- cropBox = getCropBox();
-
- if (globalParams->getPrintCommands()) {
- mediaBox = getMediaBox();
- printf("***** MediaBox = ll:%g,%g ur:%g,%g\n",
- mediaBox->x1, mediaBox->y1, mediaBox->x2, mediaBox->y2);
- printf("***** CropBox = ll:%g,%g ur:%g,%g\n",
- cropBox->x1, cropBox->y1, cropBox->x2, cropBox->y2);
- printf("***** Rotate = %d\n", attrs->getRotate());
- }
-
- gfx = new Gfx(xref, out, num, attrs->getResourceDict(),
- hDPI, vDPI, &box, crop ? cropBox : (PDFRectangle *)NULL,
- rotate, abortCheckCbk, abortCheckCbkData);
- contents.fetch(xref, &obj);
- if (!obj.isNull()) {
- gfx->saveState();
- gfx->display(&obj);
- gfx->restoreState();
- }
- obj.free();
-
- // draw annotations
- annotList = new Annots(xref, catalog, getAnnots(&obj));
- obj.free();
- acroForm = catalog->getAcroForm()->isDict() ?
- catalog->getAcroForm()->getDict() : NULL;
- if (acroForm) {
- if (acroForm->lookup("NeedAppearances", &obj)) {
- if (obj.isBool() && obj.getBool()) {
- annotList->generateAppearances(acroForm);
- }
- }
- obj.free();
- }
- if (annotList->getNumAnnots() > 0) {
- if (globalParams->getPrintCommands()) {
- printf("***** Annotations\n");
- }
- for (i = 0; i < annotList->getNumAnnots(); ++i) {
- annotList->getAnnot(i)->draw(gfx, printing);
- }
- out->dump();
- }
- delete annotList;
-
- delete gfx;
-#endif
-}
-
-void Page::makeBox(double hDPI, double vDPI, int rotate,
- GBool useMediaBox, GBool upsideDown,
- double sliceX, double sliceY, double sliceW, double sliceH,
- PDFRectangle *box, GBool *crop) {
- PDFRectangle *mediaBox, *cropBox, *baseBox;
- double kx, ky;
-
- mediaBox = getMediaBox();
- cropBox = getCropBox();
- if (sliceW >= 0 && sliceH >= 0) {
- baseBox = useMediaBox ? mediaBox : cropBox;
- kx = 72.0 / hDPI;
- ky = 72.0 / vDPI;
- if (rotate == 90) {
- if (upsideDown) {
- box->x1 = baseBox->x1 + ky * sliceY;
- box->x2 = baseBox->x1 + ky * (sliceY + sliceH);
- } else {
- box->x1 = baseBox->x2 - ky * (sliceY + sliceH);
- box->x2 = baseBox->x2 - ky * sliceY;
- }
- box->y1 = baseBox->y1 + kx * sliceX;
- box->y2 = baseBox->y1 + kx * (sliceX + sliceW);
- } else if (rotate == 180) {
- box->x1 = baseBox->x2 - kx * (sliceX + sliceW);
- box->x2 = baseBox->x2 - kx * sliceX;
- if (upsideDown) {
- box->y1 = baseBox->y1 + ky * sliceY;
- box->y2 = baseBox->y1 + ky * (sliceY + sliceH);
- } else {
- box->y1 = baseBox->y2 - ky * (sliceY + sliceH);
- box->y2 = baseBox->y2 - ky * sliceY;
- }
- } else if (rotate == 270) {
- if (upsideDown) {
- box->x1 = baseBox->x2 - ky * (sliceY + sliceH);
- box->x2 = baseBox->x2 - ky * sliceY;
- } else {
- box->x1 = baseBox->x1 + ky * sliceY;
- box->x2 = baseBox->x1 + ky * (sliceY + sliceH);
- }
- box->y1 = baseBox->y2 - kx * (sliceX + sliceW);
- box->y2 = baseBox->y2 - kx * sliceX;
- } else {
- box->x1 = baseBox->x1 + kx * sliceX;
- box->x2 = baseBox->x1 + kx * (sliceX + sliceW);
- if (upsideDown) {
- box->y1 = baseBox->y2 - ky * (sliceY + sliceH);
- box->y2 = baseBox->y2 - ky * sliceY;
- } else {
- box->y1 = baseBox->y1 + ky * sliceY;
- box->y2 = baseBox->y1 + ky * (sliceY + sliceH);
- }
- }
- } else if (useMediaBox) {
- *box = *mediaBox;
- } else {
- *box = *cropBox;
- *crop = gFalse;
- }
-}
-
-void Page::processLinks(OutputDev *out, Catalog *catalog) {
- Links *links;
- int i;
-
- links = getLinks(catalog);
- for (i = 0; i < links->getNumLinks(); ++i) {
- out->processLink(links->getLink(i), catalog);
- }
- delete links;
-}
-
-void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
- int rotate, GBool useMediaBox, GBool upsideDown) {
- GfxState *state;
- int i;
-
- rotate += getRotate();
- if (rotate >= 360) {
- rotate -= 360;
- } else if (rotate < 0) {
- rotate += 360;
- }
- state = new GfxState(hDPI, vDPI,
- useMediaBox ? getMediaBox() : getCropBox(),
- rotate, upsideDown);
- for (i = 0; i < 6; ++i) {
- ctm[i] = state->getCTM()[i];
- }
- delete state;
-}
diff --git a/kpdf/xpdf/xpdf/Page.cpp b/kpdf/xpdf/xpdf/Page.cpp
new file mode 100644
index 00000000..de2fe6c0
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Page.cpp
@@ -0,0 +1,558 @@
+//========================================================================
+//
+// Page.cpp
+//
+// Copyright 1996-2007 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "GlobalParams.h"
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "XRef.h"
+#include "Link.h"
+#include "OutputDev.h"
+#ifndef PDF_PARSER_ONLY
+#include "Gfx.h"
+#include "GfxState.h"
+#include "Annot.h"
+#endif
+#include "Error.h"
+#include "Catalog.h"
+#include "Page.h"
+
+//------------------------------------------------------------------------
+// PDFRectangle
+//------------------------------------------------------------------------
+
+void PDFRectangle::clipTo(PDFRectangle *rect) {
+ if (x1 < rect->x1) {
+ x1 = rect->x1;
+ } else if (x1 > rect->x2) {
+ x1 = rect->x2;
+ }
+ if (x2 < rect->x1) {
+ x2 = rect->x1;
+ } else if (x2 > rect->x2) {
+ x2 = rect->x2;
+ }
+ if (y1 < rect->y1) {
+ y1 = rect->y1;
+ } else if (y1 > rect->y2) {
+ y1 = rect->y2;
+ }
+ if (y2 < rect->y1) {
+ y2 = rect->y1;
+ } else if (y2 > rect->y2) {
+ y2 = rect->y2;
+ }
+}
+
+//------------------------------------------------------------------------
+// PageAttrs
+//------------------------------------------------------------------------
+
+PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
+ Object obj1;
+
+ // get old/default values
+ if (attrs) {
+ mediaBox = attrs->mediaBox;
+ cropBox = attrs->cropBox;
+ haveCropBox = attrs->haveCropBox;
+ rotate = attrs->rotate;
+ attrs->resources.copy(&resources);
+ } else {
+ // set default MediaBox to 8.5" x 11" -- this shouldn't be necessary
+ // but some (non-compliant) PDF files don't specify a MediaBox
+ mediaBox.x1 = 0;
+ mediaBox.y1 = 0;
+ mediaBox.x2 = 612;
+ mediaBox.y2 = 792;
+ cropBox.x1 = cropBox.y1 = cropBox.x2 = cropBox.y2 = 0;
+ haveCropBox = gFalse;
+ rotate = 0;
+ resources.initNull();
+ }
+
+ // media box
+ readBox(dict, "MediaBox", &mediaBox);
+
+ // crop box
+ if (readBox(dict, "CropBox", &cropBox)) {
+ haveCropBox = gTrue;
+ }
+ if (!haveCropBox) {
+ cropBox = mediaBox;
+ }
+ else
+ {
+ // cropBox can not be bigger than mediaBox
+ if (cropBox.x2 - cropBox.x1 > mediaBox.x2 - mediaBox.x1)
+ {
+ cropBox.x1 = mediaBox.x1;
+ cropBox.x2 = mediaBox.x2;
+ }
+ if (cropBox.y2 - cropBox.y1 > mediaBox.y2 - mediaBox.y1)
+ {
+ cropBox.y1 = mediaBox.y1;
+ cropBox.y2 = mediaBox.y2;
+ }
+ }
+
+ // other boxes
+ bleedBox = cropBox;
+ readBox(dict, "BleedBox", &bleedBox);
+ trimBox = cropBox;
+ readBox(dict, "TrimBox", &trimBox);
+ artBox = cropBox;
+ readBox(dict, "ArtBox", &artBox);
+
+ // clip all other boxes to the media box
+ cropBox.clipTo(&mediaBox);
+ bleedBox.clipTo(&mediaBox);
+ trimBox.clipTo(&mediaBox);
+ artBox.clipTo(&mediaBox);
+
+ // rotate
+ dict->lookup("Rotate", &obj1);
+ if (obj1.isInt()) {
+ rotate = obj1.getInt();
+ }
+ obj1.free();
+ while (rotate < 0) {
+ rotate += 360;
+ }
+ while (rotate >= 360) {
+ rotate -= 360;
+ }
+
+ // misc attributes
+ dict->lookup("LastModified", &lastModified);
+ dict->lookup("BoxColorInfo", &boxColorInfo);
+ dict->lookup("Group", &group);
+ dict->lookup("Metadata", &metadata);
+ dict->lookup("PieceInfo", &pieceInfo);
+ dict->lookup("SeparationInfo", &separationInfo);
+
+ // resource dictionary
+ dict->lookup("Resources", &obj1);
+ if (obj1.isDict()) {
+ resources.free();
+ obj1.copy(&resources);
+ }
+ obj1.free();
+}
+
+PageAttrs::~PageAttrs() {
+ lastModified.free();
+ boxColorInfo.free();
+ group.free();
+ metadata.free();
+ pieceInfo.free();
+ separationInfo.free();
+ resources.free();
+}
+
+GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {
+ PDFRectangle tmp;
+ double t;
+ Object obj1, obj2;
+ GBool ok;
+
+ dict->lookup(key, &obj1);
+ if (obj1.isArray() && obj1.arrayGetLength() == 4) {
+ ok = gTrue;
+ obj1.arrayGet(0, &obj2);
+ if (obj2.isNum()) {
+ tmp.x1 = obj2.getNum();
+ } else {
+ ok = gFalse;
+ }
+ obj2.free();
+ obj1.arrayGet(1, &obj2);
+ if (obj2.isNum()) {
+ tmp.y1 = obj2.getNum();
+ } else {
+ ok = gFalse;
+ }
+ obj2.free();
+ obj1.arrayGet(2, &obj2);
+ if (obj2.isNum()) {
+ tmp.x2 = obj2.getNum();
+ } else {
+ ok = gFalse;
+ }
+ obj2.free();
+ obj1.arrayGet(3, &obj2);
+ if (obj2.isNum()) {
+ tmp.y2 = obj2.getNum();
+ } else {
+ ok = gFalse;
+ }
+ obj2.free();
+ if (ok) {
+ if (tmp.x1 > tmp.x2) {
+ t = tmp.x1; tmp.x1 = tmp.x2; tmp.x2 = t;
+ }
+ if (tmp.y1 > tmp.y2) {
+ t = tmp.y1; tmp.y1 = tmp.y2; tmp.y2 = t;
+ }
+ *box = tmp;
+ }
+ } else {
+ ok = gFalse;
+ }
+ obj1.free();
+ return ok;
+}
+
+//------------------------------------------------------------------------
+// PageTransition
+//------------------------------------------------------------------------
+
+PageTransition::PageTransition(Dict *dict)
+ : type(Replace),
+ duration(1),
+ alignment(Horizontal),
+ direction(Inward),
+ angle(0),
+ scale(1.0),
+ rectangular(false)
+{
+ Object dictObj;
+ Object obj;
+
+ dict->lookup("Trans", &dictObj);
+ if (dictObj.isDict()) {
+ Dict *transDict = dictObj.getDict();
+
+ if (transDict->lookup("S", &obj)->isName()) {
+ const char *s = obj.getName();
+ if (strcmp("R", s) == 0)
+ type = Replace;
+ else if (strcmp("Split", s) == 0)
+ type = Split;
+ else if (strcmp("Blinds", s) == 0)
+ type = Blinds;
+ else if (strcmp("Box", s) == 0)
+ type = Box;
+ else if (strcmp("Wipe", s) == 0)
+ type = Wipe;
+ else if (strcmp("Dissolve", s) == 0)
+ type = Dissolve;
+ else if (strcmp("Glitter", s) == 0)
+ type = Glitter;
+ else if (strcmp("Fly", s) == 0)
+ type = Fly;
+ else if (strcmp("Push", s) == 0)
+ type = Push;
+ else if (strcmp("Cover", s) == 0)
+ type = Cover;
+ else if (strcmp("Uncover", s) == 0)
+ type = Push;
+ else if (strcmp("Fade", s) == 0)
+ type = Cover;
+ }
+ obj.free();
+
+ if (transDict->lookup("D", &obj)->isInt()) {
+ duration = obj.getInt();
+ }
+ obj.free();
+
+ if (transDict->lookup("Dm", &obj)->isName()) {
+ const char *dm = obj.getName();
+ if ( strcmp( "H", dm ) == 0 )
+ alignment = Horizontal;
+ else if ( strcmp( "V", dm ) == 0 )
+ alignment = Vertical;
+ }
+ obj.free();
+
+ if (transDict->lookup("M", &obj)->isName()) {
+ const char *m = obj.getName();
+ if ( strcmp( "I", m ) == 0 )
+ direction = Inward;
+ else if ( strcmp( "O", m ) == 0 )
+ direction = Outward;
+ }
+ obj.free();
+
+ if (transDict->lookup("Di", &obj)->isInt()) {
+ angle = obj.getInt();
+ }
+ obj.free();
+
+ if (transDict->lookup("Di", &obj)->isName()) {
+ if ( strcmp( "None", obj.getName() ) == 0 )
+ angle = 0;
+ }
+ obj.free();
+
+ if (transDict->lookup("SS", &obj)->isReal()) {
+ scale = obj.getReal();
+ }
+ obj.free();
+
+ if (transDict->lookup("B", &obj)->isBool()) {
+ rectangular = obj.getBool();
+ }
+ obj.free();
+ }
+ dictObj.free();
+}
+
+PageTransition::~PageTransition() {
+}
+
+//------------------------------------------------------------------------
+// Page
+//------------------------------------------------------------------------
+
+Page::Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA) {
+ ok = gTrue;
+ xref = xrefA;
+ num = numA;
+
+ // get attributes
+ attrs = attrsA;
+
+ // get transition
+ transition = new PageTransition( pageDict );
+
+ // annotations
+ pageDict->lookupNF("Annots", &annots);
+ if (!(annots.isRef() || annots.isArray() || annots.isNull())) {
+ error(-1, "Page annotations object (page %d) is wrong type (%s)",
+ num, annots.getTypeName());
+ annots.free();
+ goto err2;
+ }
+
+ // contents
+ pageDict->lookupNF("Contents", &contents);
+ if (!(contents.isRef() || contents.isArray() ||
+ contents.isNull())) {
+ error(-1, "Page contents object (page %d) is wrong type (%s)",
+ num, contents.getTypeName());
+ contents.free();
+ goto err1;
+ }
+
+ return;
+
+ err2:
+ annots.initNull();
+ err1:
+ contents.initNull();
+ ok = gFalse;
+}
+
+Page::~Page() {
+ delete attrs;
+ delete transition;
+ annots.free();
+ contents.free();
+}
+
+Links *Page::getLinks(Catalog *catalog) {
+ Links *links;
+ Object obj;
+
+ links = new Links(getAnnots(&obj), catalog->getBaseURI());
+ obj.free();
+ return links;
+}
+
+void Page::display(OutputDev *out, double hDPI, double vDPI,
+ int rotate, GBool useMediaBox, GBool crop,
+ GBool printing, Catalog *catalog,
+ GBool (*abortCheckCbk)(void *data),
+ void *abortCheckCbkData) {
+ displaySlice(out, hDPI, vDPI, rotate, useMediaBox, crop,
+ -1, -1, -1, -1, printing, catalog,
+ abortCheckCbk, abortCheckCbkData);
+}
+
+void Page::displaySlice(OutputDev *out, double hDPI, double vDPI,
+ int rotate, GBool useMediaBox, GBool crop,
+ int sliceX, int sliceY, int sliceW, int sliceH,
+ GBool printing, Catalog *catalog,
+ GBool (*abortCheckCbk)(void *data),
+ void *abortCheckCbkData) {
+#ifndef PDF_PARSER_ONLY
+ PDFRectangle *mediaBox, *cropBox;
+ PDFRectangle box;
+ Gfx *gfx;
+ Object obj;
+ Annots *annotList;
+ Dict *acroForm;
+ int i;
+
+ if (!out->checkPageSlice(this, hDPI, vDPI, rotate, useMediaBox, crop,
+ sliceX, sliceY, sliceW, sliceH,
+ printing, catalog,
+ abortCheckCbk, abortCheckCbkData)) {
+ return;
+ }
+
+ rotate += getRotate();
+ if (rotate >= 360) {
+ rotate -= 360;
+ } else if (rotate < 0) {
+ rotate += 360;
+ }
+
+ makeBox(hDPI, vDPI, rotate, useMediaBox, out->upsideDown(),
+ sliceX, sliceY, sliceW, sliceH, &box, &crop);
+ cropBox = getCropBox();
+
+ if (globalParams->getPrintCommands()) {
+ mediaBox = getMediaBox();
+ printf("***** MediaBox = ll:%g,%g ur:%g,%g\n",
+ mediaBox->x1, mediaBox->y1, mediaBox->x2, mediaBox->y2);
+ printf("***** CropBox = ll:%g,%g ur:%g,%g\n",
+ cropBox->x1, cropBox->y1, cropBox->x2, cropBox->y2);
+ printf("***** Rotate = %d\n", attrs->getRotate());
+ }
+
+ gfx = new Gfx(xref, out, num, attrs->getResourceDict(),
+ hDPI, vDPI, &box, crop ? cropBox : (PDFRectangle *)NULL,
+ rotate, abortCheckCbk, abortCheckCbkData);
+ contents.fetch(xref, &obj);
+ if (!obj.isNull()) {
+ gfx->saveState();
+ gfx->display(&obj);
+ gfx->restoreState();
+ }
+ obj.free();
+
+ // draw annotations
+ annotList = new Annots(xref, catalog, getAnnots(&obj));
+ obj.free();
+ acroForm = catalog->getAcroForm()->isDict() ?
+ catalog->getAcroForm()->getDict() : NULL;
+ if (acroForm) {
+ if (acroForm->lookup("NeedAppearances", &obj)) {
+ if (obj.isBool() && obj.getBool()) {
+ annotList->generateAppearances(acroForm);
+ }
+ }
+ obj.free();
+ }
+ if (annotList->getNumAnnots() > 0) {
+ if (globalParams->getPrintCommands()) {
+ printf("***** Annotations\n");
+ }
+ for (i = 0; i < annotList->getNumAnnots(); ++i) {
+ annotList->getAnnot(i)->draw(gfx, printing);
+ }
+ out->dump();
+ }
+ delete annotList;
+
+ delete gfx;
+#endif
+}
+
+void Page::makeBox(double hDPI, double vDPI, int rotate,
+ GBool useMediaBox, GBool upsideDown,
+ double sliceX, double sliceY, double sliceW, double sliceH,
+ PDFRectangle *box, GBool *crop) {
+ PDFRectangle *mediaBox, *cropBox, *baseBox;
+ double kx, ky;
+
+ mediaBox = getMediaBox();
+ cropBox = getCropBox();
+ if (sliceW >= 0 && sliceH >= 0) {
+ baseBox = useMediaBox ? mediaBox : cropBox;
+ kx = 72.0 / hDPI;
+ ky = 72.0 / vDPI;
+ if (rotate == 90) {
+ if (upsideDown) {
+ box->x1 = baseBox->x1 + ky * sliceY;
+ box->x2 = baseBox->x1 + ky * (sliceY + sliceH);
+ } else {
+ box->x1 = baseBox->x2 - ky * (sliceY + sliceH);
+ box->x2 = baseBox->x2 - ky * sliceY;
+ }
+ box->y1 = baseBox->y1 + kx * sliceX;
+ box->y2 = baseBox->y1 + kx * (sliceX + sliceW);
+ } else if (rotate == 180) {
+ box->x1 = baseBox->x2 - kx * (sliceX + sliceW);
+ box->x2 = baseBox->x2 - kx * sliceX;
+ if (upsideDown) {
+ box->y1 = baseBox->y1 + ky * sliceY;
+ box->y2 = baseBox->y1 + ky * (sliceY + sliceH);
+ } else {
+ box->y1 = baseBox->y2 - ky * (sliceY + sliceH);
+ box->y2 = baseBox->y2 - ky * sliceY;
+ }
+ } else if (rotate == 270) {
+ if (upsideDown) {
+ box->x1 = baseBox->x2 - ky * (sliceY + sliceH);
+ box->x2 = baseBox->x2 - ky * sliceY;
+ } else {
+ box->x1 = baseBox->x1 + ky * sliceY;
+ box->x2 = baseBox->x1 + ky * (sliceY + sliceH);
+ }
+ box->y1 = baseBox->y2 - kx * (sliceX + sliceW);
+ box->y2 = baseBox->y2 - kx * sliceX;
+ } else {
+ box->x1 = baseBox->x1 + kx * sliceX;
+ box->x2 = baseBox->x1 + kx * (sliceX + sliceW);
+ if (upsideDown) {
+ box->y1 = baseBox->y2 - ky * (sliceY + sliceH);
+ box->y2 = baseBox->y2 - ky * sliceY;
+ } else {
+ box->y1 = baseBox->y1 + ky * sliceY;
+ box->y2 = baseBox->y1 + ky * (sliceY + sliceH);
+ }
+ }
+ } else if (useMediaBox) {
+ *box = *mediaBox;
+ } else {
+ *box = *cropBox;
+ *crop = gFalse;
+ }
+}
+
+void Page::processLinks(OutputDev *out, Catalog *catalog) {
+ Links *links;
+ int i;
+
+ links = getLinks(catalog);
+ for (i = 0; i < links->getNumLinks(); ++i) {
+ out->processLink(links->getLink(i), catalog);
+ }
+ delete links;
+}
+
+void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
+ int rotate, GBool useMediaBox, GBool upsideDown) {
+ GfxState *state;
+ int i;
+
+ rotate += getRotate();
+ if (rotate >= 360) {
+ rotate -= 360;
+ } else if (rotate < 0) {
+ rotate += 360;
+ }
+ state = new GfxState(hDPI, vDPI,
+ useMediaBox ? getMediaBox() : getCropBox(),
+ rotate, upsideDown);
+ for (i = 0; i < 6; ++i) {
+ ctm[i] = state->getCTM()[i];
+ }
+ delete state;
+}
diff --git a/kpdf/xpdf/xpdf/Parser.cc b/kpdf/xpdf/xpdf/Parser.cc
deleted file mode 100644
index 65a43d94..00000000
--- a/kpdf/xpdf/xpdf/Parser.cc
+++ /dev/null
@@ -1,227 +0,0 @@
-//========================================================================
-//
-// Parser.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stddef.h>
-#include "Object.h"
-#include "Array.h"
-#include "Dict.h"
-#include "Decrypt.h"
-#include "Parser.h"
-#include "XRef.h"
-#include "Error.h"
-
-Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
- xref = xrefA;
- lexer = lexerA;
- inlineImg = 0;
- allowStreams = allowStreamsA;
- lexer->getObj(&buf1);
- lexer->getObj(&buf2);
-}
-
-Parser::~Parser() {
- buf1.free();
- buf2.free();
- delete lexer;
-}
-
-Object *Parser::getObj(Object *obj, Guchar *fileKey,
- CryptAlgorithm encAlgorithm, int keyLength,
- int objNum, int objGen) {
- char *key;
- Stream *str;
- Object obj2;
- int num;
- DecryptStream *decrypt;
- GString *s, *s2;
- int c;
-
- // refill buffer after inline image data
- if (inlineImg == 2) {
- buf1.free();
- buf2.free();
- lexer->getObj(&buf1);
- lexer->getObj(&buf2);
- inlineImg = 0;
- }
-
- // array
- if (buf1.isCmd("[")) {
- shift();
- obj->initArray(xref);
- while (!buf1.isCmd("]") && !buf1.isEOF())
- obj->arrayAdd(getObj(&obj2, fileKey, encAlgorithm, keyLength,
- objNum, objGen));
- if (buf1.isEOF())
- error(getPos(), "End of file inside array");
- shift();
-
- // dictionary or stream
- } else if (buf1.isCmd("<<")) {
- shift(objNum);
- obj->initDict(xref);
- while (!buf1.isCmd(">>") && !buf1.isEOF()) {
- if (!buf1.isName()) {
- error(getPos(), "Dictionary key must be a name object");
- shift();
- } else {
- key = copyString(buf1.getName());
- shift();
- if (buf1.isEOF() || buf1.isError()) {
- gfree(key);
- break;
- }
- obj->dictAdd(key, getObj(&obj2, fileKey, encAlgorithm, keyLength,
- objNum, objGen));
- }
- }
- if (buf1.isEOF())
- error(getPos(), "End of file inside dictionary");
- // stream objects are not allowed inside content streams or
- // object streams
- if (allowStreams && buf2.isCmd("stream")) {
- if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
- objNum, objGen))) {
- obj->initStream(str);
- } else {
- obj->free();
- obj->initError();
- }
- } else {
- shift();
- }
-
- // indirect reference or integer
- } else if (buf1.isInt()) {
- num = buf1.getInt();
- shift();
- if (buf1.isInt() && buf2.isCmd("R")) {
- obj->initRef(num, buf1.getInt());
- shift();
- shift();
- } else {
- obj->initInt(num);
- }
-
- // string
- } else if (buf1.isString() && fileKey) {
- s = buf1.getString();
- s2 = new GString();
- obj2.initNull();
- decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
- s->getLength(), &obj2),
- fileKey, encAlgorithm, keyLength,
- objNum, objGen);
- decrypt->reset();
- while ((c = decrypt->getChar()) != EOF) {
- s2->append((char)c);
- }
- delete decrypt;
- obj->initString(s2);
- shift();
-
- // simple object
- } else {
- buf1.copy(obj);
- shift();
- }
-
- return obj;
-}
-
-Stream *Parser::makeStream(Object *dict, Guchar *fileKey,
- CryptAlgorithm encAlgorithm, int keyLength,
- int objNum, int objGen) {
- Object obj;
- BaseStream *baseStr;
- Stream *str;
- Guint pos, endPos, length;
-
- // get stream start position
- lexer->skipToNextLine();
- pos = lexer->getPos();
-
- // get length
- dict->dictLookup("Length", &obj);
- if (obj.isInt()) {
- length = (Guint)obj.getInt();
- obj.free();
- } else {
- error(getPos(), "Bad 'Length' attribute in stream");
- obj.free();
- return NULL;
- }
-
- // check for length in damaged file
- if (xref && xref->getStreamEnd(pos, &endPos)) {
- length = endPos - pos;
- }
-
- // in badly damaged PDF files, we can run off the end of the input
- // stream immediately after the "stream" token
- if (!lexer->getStream()) {
- return NULL;
- }
- baseStr = lexer->getStream()->getBaseStream();
-
- // skip over stream data
- lexer->setPos(pos + length);
-
- // refill token buffers and check for 'endstream'
- shift(); // kill '>>'
- shift(); // kill 'stream'
- if (buf1.isCmd("endstream")) {
- shift();
- } else {
- error(getPos(), "Missing 'endstream'");
- // kludge for broken PDF files: just add 5k to the length, and
- // hope its enough
- length += 5000;
- }
-
- // make base stream
- str = baseStr->makeSubStream(pos, gTrue, length, dict);
-
- // handle decryption
- if (fileKey) {
- str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
- objNum, objGen);
- }
-
- // get filters
- str = str->addFilters(dict);
-
- return str;
-}
-
-void Parser::shift(int objNum) {
- if (inlineImg > 0) {
- if (inlineImg < 2) {
- ++inlineImg;
- } else {
- // in a damaged content stream, if 'ID' shows up in the middle
- // of a dictionary, we need to reset
- inlineImg = 0;
- }
- } else if (buf2.isCmd("ID")) {
- lexer->skipChar(); // skip char after 'ID' command
- inlineImg = 1;
- }
- buf1.free();
- buf1 = buf2;
- if (inlineImg > 0) // don't buffer inline image data
- buf2.initNull();
- else
- lexer->getObj(&buf2, objNum);
-}
diff --git a/kpdf/xpdf/xpdf/Parser.cpp b/kpdf/xpdf/xpdf/Parser.cpp
new file mode 100644
index 00000000..95475b85
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Parser.cpp
@@ -0,0 +1,227 @@
+//========================================================================
+//
+// Parser.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stddef.h>
+#include "Object.h"
+#include "Array.h"
+#include "Dict.h"
+#include "Decrypt.h"
+#include "Parser.h"
+#include "XRef.h"
+#include "Error.h"
+
+Parser::Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA) {
+ xref = xrefA;
+ lexer = lexerA;
+ inlineImg = 0;
+ allowStreams = allowStreamsA;
+ lexer->getObj(&buf1);
+ lexer->getObj(&buf2);
+}
+
+Parser::~Parser() {
+ buf1.free();
+ buf2.free();
+ delete lexer;
+}
+
+Object *Parser::getObj(Object *obj, Guchar *fileKey,
+ CryptAlgorithm encAlgorithm, int keyLength,
+ int objNum, int objGen) {
+ char *key;
+ Stream *str;
+ Object obj2;
+ int num;
+ DecryptStream *decrypt;
+ GString *s, *s2;
+ int c;
+
+ // refill buffer after inline image data
+ if (inlineImg == 2) {
+ buf1.free();
+ buf2.free();
+ lexer->getObj(&buf1);
+ lexer->getObj(&buf2);
+ inlineImg = 0;
+ }
+
+ // array
+ if (buf1.isCmd("[")) {
+ shift();
+ obj->initArray(xref);
+ while (!buf1.isCmd("]") && !buf1.isEOF())
+ obj->arrayAdd(getObj(&obj2, fileKey, encAlgorithm, keyLength,
+ objNum, objGen));
+ if (buf1.isEOF())
+ error(getPos(), "End of file inside array");
+ shift();
+
+ // dictionary or stream
+ } else if (buf1.isCmd("<<")) {
+ shift(objNum);
+ obj->initDict(xref);
+ while (!buf1.isCmd(">>") && !buf1.isEOF()) {
+ if (!buf1.isName()) {
+ error(getPos(), "Dictionary key must be a name object");
+ shift();
+ } else {
+ key = copyString(buf1.getName());
+ shift();
+ if (buf1.isEOF() || buf1.isError()) {
+ gfree(key);
+ break;
+ }
+ obj->dictAdd(key, getObj(&obj2, fileKey, encAlgorithm, keyLength,
+ objNum, objGen));
+ }
+ }
+ if (buf1.isEOF())
+ error(getPos(), "End of file inside dictionary");
+ // stream objects are not allowed inside content streams or
+ // object streams
+ if (allowStreams && buf2.isCmd("stream")) {
+ if ((str = makeStream(obj, fileKey, encAlgorithm, keyLength,
+ objNum, objGen))) {
+ obj->initStream(str);
+ } else {
+ obj->free();
+ obj->initError();
+ }
+ } else {
+ shift();
+ }
+
+ // indirect reference or integer
+ } else if (buf1.isInt()) {
+ num = buf1.getInt();
+ shift();
+ if (buf1.isInt() && buf2.isCmd("R")) {
+ obj->initRef(num, buf1.getInt());
+ shift();
+ shift();
+ } else {
+ obj->initInt(num);
+ }
+
+ // string
+ } else if (buf1.isString() && fileKey) {
+ s = buf1.getString();
+ s2 = new GString();
+ obj2.initNull();
+ decrypt = new DecryptStream(new MemStream(s->getCString(), 0,
+ s->getLength(), &obj2),
+ fileKey, encAlgorithm, keyLength,
+ objNum, objGen);
+ decrypt->reset();
+ while ((c = decrypt->getChar()) != EOF) {
+ s2->append((char)c);
+ }
+ delete decrypt;
+ obj->initString(s2);
+ shift();
+
+ // simple object
+ } else {
+ buf1.copy(obj);
+ shift();
+ }
+
+ return obj;
+}
+
+Stream *Parser::makeStream(Object *dict, Guchar *fileKey,
+ CryptAlgorithm encAlgorithm, int keyLength,
+ int objNum, int objGen) {
+ Object obj;
+ BaseStream *baseStr;
+ Stream *str;
+ Guint pos, endPos, length;
+
+ // get stream start position
+ lexer->skipToNextLine();
+ pos = lexer->getPos();
+
+ // get length
+ dict->dictLookup("Length", &obj);
+ if (obj.isInt()) {
+ length = (Guint)obj.getInt();
+ obj.free();
+ } else {
+ error(getPos(), "Bad 'Length' attribute in stream");
+ obj.free();
+ return NULL;
+ }
+
+ // check for length in damaged file
+ if (xref && xref->getStreamEnd(pos, &endPos)) {
+ length = endPos - pos;
+ }
+
+ // in badly damaged PDF files, we can run off the end of the input
+ // stream immediately after the "stream" token
+ if (!lexer->getStream()) {
+ return NULL;
+ }
+ baseStr = lexer->getStream()->getBaseStream();
+
+ // skip over stream data
+ lexer->setPos(pos + length);
+
+ // refill token buffers and check for 'endstream'
+ shift(); // kill '>>'
+ shift(); // kill 'stream'
+ if (buf1.isCmd("endstream")) {
+ shift();
+ } else {
+ error(getPos(), "Missing 'endstream'");
+ // kludge for broken PDF files: just add 5k to the length, and
+ // hope its enough
+ length += 5000;
+ }
+
+ // make base stream
+ str = baseStr->makeSubStream(pos, gTrue, length, dict);
+
+ // handle decryption
+ if (fileKey) {
+ str = new DecryptStream(str, fileKey, encAlgorithm, keyLength,
+ objNum, objGen);
+ }
+
+ // get filters
+ str = str->addFilters(dict);
+
+ return str;
+}
+
+void Parser::shift(int objNum) {
+ if (inlineImg > 0) {
+ if (inlineImg < 2) {
+ ++inlineImg;
+ } else {
+ // in a damaged content stream, if 'ID' shows up in the middle
+ // of a dictionary, we need to reset
+ inlineImg = 0;
+ }
+ } else if (buf2.isCmd("ID")) {
+ lexer->skipChar(); // skip char after 'ID' command
+ inlineImg = 1;
+ }
+ buf1.free();
+ buf1 = buf2;
+ if (inlineImg > 0) // don't buffer inline image data
+ buf2.initNull();
+ else
+ lexer->getObj(&buf2, objNum);
+}
diff --git a/kpdf/xpdf/xpdf/PreScanOutputDev.cc b/kpdf/xpdf/xpdf/PreScanOutputDev.cc
deleted file mode 100644
index 52ffeb7f..00000000
--- a/kpdf/xpdf/xpdf/PreScanOutputDev.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-//========================================================================
-//
-// PreScanOutputDev.cc
-//
-// Copyright 2005 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <math.h>
-#include "GlobalParams.h"
-#include "GfxFont.h"
-#include "Link.h"
-#include "PreScanOutputDev.h"
-
-//------------------------------------------------------------------------
-// PreScanOutputDev
-//------------------------------------------------------------------------
-
-PreScanOutputDev::PreScanOutputDev() {
- clearStats();
-}
-
-PreScanOutputDev::~PreScanOutputDev() {
-}
-
-void PreScanOutputDev::startPage(int /*pageNum*/, GfxState * /*state*/) {
-}
-
-void PreScanOutputDev::endPage() {
-}
-
-void PreScanOutputDev::stroke(GfxState *state) {
- double *dash;
- int dashLen;
- double dashStart;
-
- check(state->getStrokeColorSpace(), state->getStrokeColor(),
- state->getStrokeOpacity(), state->getBlendMode());
- state->getLineDash(&dash, &dashLen, &dashStart);
- if (dashLen != 0) {
- gdi = gFalse;
- }
-}
-
-void PreScanOutputDev::fill(GfxState *state) {
- check(state->getFillColorSpace(), state->getFillColor(),
- state->getFillOpacity(), state->getBlendMode());
-}
-
-void PreScanOutputDev::eoFill(GfxState *state) {
- check(state->getFillColorSpace(), state->getFillColor(),
- state->getFillOpacity(), state->getBlendMode());
-}
-
-void PreScanOutputDev::clip(GfxState * /*state*/) {
- //~ check for a rectangle "near" the edge of the page;
- //~ else set gdi to false
-}
-
-void PreScanOutputDev::eoClip(GfxState * /*state*/) {
- //~ see clip()
-}
-
-void PreScanOutputDev::beginStringOp(GfxState *state) {
- int render;
- GfxFont *font;
- double m11, m12, m21, m22;
- Ref embRef;
- DisplayFontParam *dfp;
- GBool simpleTTF;
-
- render = state->getRender();
- if (!(render & 1)) {
- check(state->getFillColorSpace(), state->getFillColor(),
- state->getFillOpacity(), state->getBlendMode());
- }
- if ((render & 3) == 1 || (render & 3) == 2) {
- check(state->getStrokeColorSpace(), state->getStrokeColor(),
- state->getStrokeOpacity(), state->getBlendMode());
- }
-
- font = state->getFont();
- state->getFontTransMat(&m11, &m12, &m21, &m22);
- simpleTTF = fabs(m11 + m22) < 0.01 &&
- m11 > 0 &&
- fabs(m12) < 0.01 &&
- fabs(m21) < 0.01 &&
- fabs(state->getHorizScaling() - 1) < 0.001 &&
- (font->getType() == fontTrueType ||
- font->getType() == fontTrueTypeOT) &&
- (font->getEmbeddedFontID(&embRef) ||
- font->getExtFontFile() ||
- (font->getName() &&
- (dfp = globalParams->getDisplayFont(font->getName())) &&
- dfp->kind == displayFontTT));
- if (simpleTTF) {
- //~ need to create a FoFiTrueType object, and check for a Unicode cmap
- }
- if (state->getRender() != 0 || !simpleTTF) {
- gdi = gFalse;
- }
-}
-
-void PreScanOutputDev::endStringOp(GfxState * /*state*/) {
-}
-
-GBool PreScanOutputDev::beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
- double /*dx*/, double /*dy*/,
- CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) {
- // return false so all Type 3 chars get rendered (no caching)
- return gFalse;
-}
-
-void PreScanOutputDev::endType3Char(GfxState * /*state*/) {
-}
-
-void PreScanOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *str,
- int width, int height, GBool /*invert*/,
- GBool inlineImg) {
- int i, j;
-
- check(state->getFillColorSpace(), state->getFillColor(),
- state->getFillOpacity(), state->getBlendMode());
- gdi = gFalse;
-
- if (inlineImg) {
- str->reset();
- j = height * ((width + 7) / 8);
- for (i = 0; i < j; ++i)
- str->getChar();
- str->close();
- }
-}
-
-void PreScanOutputDev::drawImage(GfxState *state, Object * /*ref*/, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
- int * /*maskColors*/, GBool inlineImg) {
- GfxColorSpace *colorSpace;
- int i, j;
-
- colorSpace = colorMap->getColorSpace();
- if (colorSpace->getMode() == csIndexed) {
- colorSpace = ((GfxIndexedColorSpace *)colorSpace)->getBase();
- }
- if (colorSpace->getMode() != csDeviceGray &&
- colorSpace->getMode() != csCalGray) {
- gray = gFalse;
- }
- mono = gFalse;
- if (state->getBlendMode() != gfxBlendNormal) {
- transparency = gTrue;
- }
- gdi = gFalse;
-
- if (inlineImg) {
- str->reset();
- j = height * ((width * colorMap->getNumPixelComps() *
- colorMap->getBits() + 7) / 8);
- for (i = 0; i < j; ++i)
- str->getChar();
- str->close();
- }
-}
-
-void PreScanOutputDev::drawMaskedImage(GfxState *state, Object * /*ref*/,
- Stream * /*str*/,
- int /*width*/, int /*height*/,
- GfxImageColorMap *colorMap,
- Stream * /*maskStr*/,
- int /*maskWidth*/, int /*maskHeight*/,
- GBool /*maskInvert*/) {
- GfxColorSpace *colorSpace;
-
- colorSpace = colorMap->getColorSpace();
- if (colorSpace->getMode() == csIndexed) {
- colorSpace = ((GfxIndexedColorSpace *)colorSpace)->getBase();
- }
- if (colorSpace->getMode() != csDeviceGray &&
- colorSpace->getMode() != csCalGray) {
- gray = gFalse;
- }
- mono = gFalse;
- if (state->getBlendMode() != gfxBlendNormal) {
- transparency = gTrue;
- }
- gdi = gFalse;
-}
-
-void PreScanOutputDev::drawSoftMaskedImage(GfxState * /*state*/, Object * /*ref*/,
- Stream * /*str*/,
- int /*width*/, int /*height*/,
- GfxImageColorMap *colorMap,
- Stream * /*maskStr*/,
- int /*maskWidth*/, int /*maskHeight*/,
- GfxImageColorMap * /*maskColorMap*/) {
- GfxColorSpace *colorSpace;
-
- colorSpace = colorMap->getColorSpace();
- if (colorSpace->getMode() == csIndexed) {
- colorSpace = ((GfxIndexedColorSpace *)colorSpace)->getBase();
- }
- if (colorSpace->getMode() != csDeviceGray &&
- colorSpace->getMode() != csCalGray) {
- gray = gFalse;
- }
- mono = gFalse;
- transparency = gTrue;
- gdi = gFalse;
-}
-
-void PreScanOutputDev::beginTransparencyGroup(
- GfxState * /*state*/, double * /*bbox*/,
- GfxColorSpace * /*blendingColorSpace*/,
- GBool /*isolated*/, GBool /*knockout*/,
- GBool /*forSoftMask*/) {
- transparency = gTrue;
- gdi = gFalse;
-}
-
-void PreScanOutputDev::check(GfxColorSpace *colorSpace, GfxColor *color,
- double opacity, GfxBlendMode blendMode) {
- GfxRGB rgb;
-
- if (colorSpace->getMode() == csPattern) {
- mono = gFalse;
- gray = gFalse;
- gdi = gFalse;
- } else {
- colorSpace->getRGB(color, &rgb);
- if (rgb.r != rgb.g || rgb.g != rgb.b || rgb.b != rgb.r) {
- mono = gFalse;
- gray = gFalse;
- } else if (!((rgb.r == 0 && rgb.g == 0 && rgb.b == 0) ||
- (rgb.r == gfxColorComp1 &&
- rgb.g == gfxColorComp1 &&
- rgb.b == gfxColorComp1))) {
- mono = gFalse;
- }
- }
- if (opacity != 1 || blendMode != gfxBlendNormal) {
- transparency = gTrue;
- }
-}
-
-void PreScanOutputDev::clearStats() {
- mono = gTrue;
- gray = gTrue;
- transparency = gFalse;
- gdi = gTrue;
-}
diff --git a/kpdf/xpdf/xpdf/PreScanOutputDev.cpp b/kpdf/xpdf/xpdf/PreScanOutputDev.cpp
new file mode 100644
index 00000000..e05cdc34
--- /dev/null
+++ b/kpdf/xpdf/xpdf/PreScanOutputDev.cpp
@@ -0,0 +1,257 @@
+//========================================================================
+//
+// PreScanOutputDev.cpp
+//
+// Copyright 2005 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <math.h>
+#include "GlobalParams.h"
+#include "GfxFont.h"
+#include "Link.h"
+#include "PreScanOutputDev.h"
+
+//------------------------------------------------------------------------
+// PreScanOutputDev
+//------------------------------------------------------------------------
+
+PreScanOutputDev::PreScanOutputDev() {
+ clearStats();
+}
+
+PreScanOutputDev::~PreScanOutputDev() {
+}
+
+void PreScanOutputDev::startPage(int /*pageNum*/, GfxState * /*state*/) {
+}
+
+void PreScanOutputDev::endPage() {
+}
+
+void PreScanOutputDev::stroke(GfxState *state) {
+ double *dash;
+ int dashLen;
+ double dashStart;
+
+ check(state->getStrokeColorSpace(), state->getStrokeColor(),
+ state->getStrokeOpacity(), state->getBlendMode());
+ state->getLineDash(&dash, &dashLen, &dashStart);
+ if (dashLen != 0) {
+ gdi = gFalse;
+ }
+}
+
+void PreScanOutputDev::fill(GfxState *state) {
+ check(state->getFillColorSpace(), state->getFillColor(),
+ state->getFillOpacity(), state->getBlendMode());
+}
+
+void PreScanOutputDev::eoFill(GfxState *state) {
+ check(state->getFillColorSpace(), state->getFillColor(),
+ state->getFillOpacity(), state->getBlendMode());
+}
+
+void PreScanOutputDev::clip(GfxState * /*state*/) {
+ //~ check for a rectangle "near" the edge of the page;
+ //~ else set gdi to false
+}
+
+void PreScanOutputDev::eoClip(GfxState * /*state*/) {
+ //~ see clip()
+}
+
+void PreScanOutputDev::beginStringOp(GfxState *state) {
+ int render;
+ GfxFont *font;
+ double m11, m12, m21, m22;
+ Ref embRef;
+ DisplayFontParam *dfp;
+ GBool simpleTTF;
+
+ render = state->getRender();
+ if (!(render & 1)) {
+ check(state->getFillColorSpace(), state->getFillColor(),
+ state->getFillOpacity(), state->getBlendMode());
+ }
+ if ((render & 3) == 1 || (render & 3) == 2) {
+ check(state->getStrokeColorSpace(), state->getStrokeColor(),
+ state->getStrokeOpacity(), state->getBlendMode());
+ }
+
+ font = state->getFont();
+ state->getFontTransMat(&m11, &m12, &m21, &m22);
+ simpleTTF = fabs(m11 + m22) < 0.01 &&
+ m11 > 0 &&
+ fabs(m12) < 0.01 &&
+ fabs(m21) < 0.01 &&
+ fabs(state->getHorizScaling() - 1) < 0.001 &&
+ (font->getType() == fontTrueType ||
+ font->getType() == fontTrueTypeOT) &&
+ (font->getEmbeddedFontID(&embRef) ||
+ font->getExtFontFile() ||
+ (font->getName() &&
+ (dfp = globalParams->getDisplayFont(font->getName())) &&
+ dfp->kind == displayFontTT));
+ if (simpleTTF) {
+ //~ need to create a FoFiTrueType object, and check for a Unicode cmap
+ }
+ if (state->getRender() != 0 || !simpleTTF) {
+ gdi = gFalse;
+ }
+}
+
+void PreScanOutputDev::endStringOp(GfxState * /*state*/) {
+}
+
+GBool PreScanOutputDev::beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/,
+ double /*dx*/, double /*dy*/,
+ CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) {
+ // return false so all Type 3 chars get rendered (no caching)
+ return gFalse;
+}
+
+void PreScanOutputDev::endType3Char(GfxState * /*state*/) {
+}
+
+void PreScanOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *str,
+ int width, int height, GBool /*invert*/,
+ GBool inlineImg) {
+ int i, j;
+
+ check(state->getFillColorSpace(), state->getFillColor(),
+ state->getFillOpacity(), state->getBlendMode());
+ gdi = gFalse;
+
+ if (inlineImg) {
+ str->reset();
+ j = height * ((width + 7) / 8);
+ for (i = 0; i < j; ++i)
+ str->getChar();
+ str->close();
+ }
+}
+
+void PreScanOutputDev::drawImage(GfxState *state, Object * /*ref*/, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
+ int * /*maskColors*/, GBool inlineImg) {
+ GfxColorSpace *colorSpace;
+ int i, j;
+
+ colorSpace = colorMap->getColorSpace();
+ if (colorSpace->getMode() == csIndexed) {
+ colorSpace = ((GfxIndexedColorSpace *)colorSpace)->getBase();
+ }
+ if (colorSpace->getMode() != csDeviceGray &&
+ colorSpace->getMode() != csCalGray) {
+ gray = gFalse;
+ }
+ mono = gFalse;
+ if (state->getBlendMode() != gfxBlendNormal) {
+ transparency = gTrue;
+ }
+ gdi = gFalse;
+
+ if (inlineImg) {
+ str->reset();
+ j = height * ((width * colorMap->getNumPixelComps() *
+ colorMap->getBits() + 7) / 8);
+ for (i = 0; i < j; ++i)
+ str->getChar();
+ str->close();
+ }
+}
+
+void PreScanOutputDev::drawMaskedImage(GfxState *state, Object * /*ref*/,
+ Stream * /*str*/,
+ int /*width*/, int /*height*/,
+ GfxImageColorMap *colorMap,
+ Stream * /*maskStr*/,
+ int /*maskWidth*/, int /*maskHeight*/,
+ GBool /*maskInvert*/) {
+ GfxColorSpace *colorSpace;
+
+ colorSpace = colorMap->getColorSpace();
+ if (colorSpace->getMode() == csIndexed) {
+ colorSpace = ((GfxIndexedColorSpace *)colorSpace)->getBase();
+ }
+ if (colorSpace->getMode() != csDeviceGray &&
+ colorSpace->getMode() != csCalGray) {
+ gray = gFalse;
+ }
+ mono = gFalse;
+ if (state->getBlendMode() != gfxBlendNormal) {
+ transparency = gTrue;
+ }
+ gdi = gFalse;
+}
+
+void PreScanOutputDev::drawSoftMaskedImage(GfxState * /*state*/, Object * /*ref*/,
+ Stream * /*str*/,
+ int /*width*/, int /*height*/,
+ GfxImageColorMap *colorMap,
+ Stream * /*maskStr*/,
+ int /*maskWidth*/, int /*maskHeight*/,
+ GfxImageColorMap * /*maskColorMap*/) {
+ GfxColorSpace *colorSpace;
+
+ colorSpace = colorMap->getColorSpace();
+ if (colorSpace->getMode() == csIndexed) {
+ colorSpace = ((GfxIndexedColorSpace *)colorSpace)->getBase();
+ }
+ if (colorSpace->getMode() != csDeviceGray &&
+ colorSpace->getMode() != csCalGray) {
+ gray = gFalse;
+ }
+ mono = gFalse;
+ transparency = gTrue;
+ gdi = gFalse;
+}
+
+void PreScanOutputDev::beginTransparencyGroup(
+ GfxState * /*state*/, double * /*bbox*/,
+ GfxColorSpace * /*blendingColorSpace*/,
+ GBool /*isolated*/, GBool /*knockout*/,
+ GBool /*forSoftMask*/) {
+ transparency = gTrue;
+ gdi = gFalse;
+}
+
+void PreScanOutputDev::check(GfxColorSpace *colorSpace, GfxColor *color,
+ double opacity, GfxBlendMode blendMode) {
+ GfxRGB rgb;
+
+ if (colorSpace->getMode() == csPattern) {
+ mono = gFalse;
+ gray = gFalse;
+ gdi = gFalse;
+ } else {
+ colorSpace->getRGB(color, &rgb);
+ if (rgb.r != rgb.g || rgb.g != rgb.b || rgb.b != rgb.r) {
+ mono = gFalse;
+ gray = gFalse;
+ } else if (!((rgb.r == 0 && rgb.g == 0 && rgb.b == 0) ||
+ (rgb.r == gfxColorComp1 &&
+ rgb.g == gfxColorComp1 &&
+ rgb.b == gfxColorComp1))) {
+ mono = gFalse;
+ }
+ }
+ if (opacity != 1 || blendMode != gfxBlendNormal) {
+ transparency = gTrue;
+ }
+}
+
+void PreScanOutputDev::clearStats() {
+ mono = gTrue;
+ gray = gTrue;
+ transparency = gFalse;
+ gdi = gTrue;
+}
diff --git a/kpdf/xpdf/xpdf/SecurityHandler.cc b/kpdf/xpdf/xpdf/SecurityHandler.cc
deleted file mode 100644
index ea0f9341..00000000
--- a/kpdf/xpdf/xpdf/SecurityHandler.cc
+++ /dev/null
@@ -1,390 +0,0 @@
-//========================================================================
-//
-// SecurityHandler.cc
-//
-// Copyright 2004 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "GString.h"
-#include "PDFDoc.h"
-#include "Decrypt.h"
-#include "Error.h"
-#include "GlobalParams.h"
-#if HAVE_XPDFCORE
-# include "XPDFCore.h"
-#elif HAVE_WINPDFCORE
-# include "WinPDFCore.h"
-#endif
-#ifdef ENABLE_PLUGINS
-# include "XpdfPluginAPI.h"
-#endif
-#include "SecurityHandler.h"
-
-//------------------------------------------------------------------------
-// SecurityHandler
-//------------------------------------------------------------------------
-
-SecurityHandler *SecurityHandler::make(PDFDoc *docA, Object *encryptDictA) {
- Object filterObj;
- SecurityHandler *secHdlr;
-#ifdef ENABLE_PLUGINS
- XpdfSecurityHandler *xsh;
-#endif
-
- encryptDictA->dictLookup("Filter", &filterObj);
- if (filterObj.isName("Standard")) {
- secHdlr = new StandardSecurityHandler(docA, encryptDictA);
- } else if (filterObj.isName()) {
-#ifdef ENABLE_PLUGINS
- if ((xsh = globalParams->getSecurityHandler(filterObj.getName()))) {
- secHdlr = new ExternalSecurityHandler(docA, encryptDictA, xsh);
- } else {
-#endif
- error(-1, "Couldn't find the '%s' security handler",
- filterObj.getName());
- secHdlr = NULL;
-#ifdef ENABLE_PLUGINS
- }
-#endif
- } else {
- error(-1, "Missing or invalid 'Filter' entry in encryption dictionary");
- secHdlr = NULL;
- }
- filterObj.free();
- return secHdlr;
-}
-
-SecurityHandler::SecurityHandler(PDFDoc *docA) {
- doc = docA;
-}
-
-SecurityHandler::~SecurityHandler() {
-}
-
-GBool SecurityHandler::checkEncryption(GString *ownerPassword,
- GString *userPassword) {
- void *authData;
- GBool ok;
- int i;
-
- if (ownerPassword || userPassword) {
- authData = makeAuthData(ownerPassword, userPassword);
- } else {
- authData = NULL;
- }
- ok = authorize(authData);
- if (authData) {
- freeAuthData(authData);
- }
- for (i = 0; !ok && i < 3; ++i) {
- if (!(authData = getAuthData())) {
- break;
- }
- ok = authorize(authData);
- if (authData) {
- freeAuthData(authData);
- }
- }
- if (!ok) {
- error(-1, "Incorrect password");
- }
- return ok;
-}
-
-//------------------------------------------------------------------------
-// StandardSecurityHandler
-//------------------------------------------------------------------------
-
-class StandardAuthData {
-public:
-
- StandardAuthData(GString *ownerPasswordA, GString *userPasswordA) {
- ownerPassword = ownerPasswordA;
- userPassword = userPasswordA;
- }
-
- ~StandardAuthData() {
- if (ownerPassword) {
- delete ownerPassword;
- }
- if (userPassword) {
- delete userPassword;
- }
- }
-
- GString *ownerPassword;
- GString *userPassword;
-};
-
-StandardSecurityHandler::StandardSecurityHandler(PDFDoc *docA,
- Object *encryptDictA):
- SecurityHandler(docA)
-{
- Object versionObj, revisionObj, lengthObj;
- Object ownerKeyObj, userKeyObj, permObj, fileIDObj;
- Object fileIDObj1;
- Object cryptFiltersObj, streamFilterObj, stringFilterObj;
- Object cryptFilterObj, cfmObj, cfLengthObj;
- Object encryptMetadataObj;
-
- ok = gFalse;
- fileID = NULL;
- ownerKey = NULL;
- userKey = NULL;
-
- encryptDictA->dictLookup("V", &versionObj);
- encryptDictA->dictLookup("R", &revisionObj);
- encryptDictA->dictLookup("Length", &lengthObj);
- encryptDictA->dictLookup("O", &ownerKeyObj);
- encryptDictA->dictLookup("U", &userKeyObj);
- encryptDictA->dictLookup("P", &permObj);
- doc->getXRef()->getTrailerDict()->dictLookup("ID", &fileIDObj);
- if (versionObj.isInt() &&
- revisionObj.isInt() &&
- ownerKeyObj.isString() && ownerKeyObj.getString()->getLength() == 32 &&
- userKeyObj.isString() && userKeyObj.getString()->getLength() == 32 &&
- permObj.isInt()) {
- encVersion = versionObj.getInt();
- encRevision = revisionObj.getInt();
- encAlgorithm = cryptRC4;
- // revision 2 forces a 40-bit key - some buggy PDF generators
- // set the Length value incorrectly
- if (encRevision == 2 || !lengthObj.isInt()) {
- fileKeyLength = 5;
- } else {
- fileKeyLength = lengthObj.getInt() / 8;
- }
- encryptMetadata = gTrue;
- //~ this currently only handles a subset of crypt filter functionality
- if (encVersion == 4 && encRevision == 4) {
- encryptDictA->dictLookup("CF", &cryptFiltersObj);
- encryptDictA->dictLookup("StmF", &streamFilterObj);
- encryptDictA->dictLookup("StrF", &stringFilterObj);
- if (cryptFiltersObj.isDict() &&
- streamFilterObj.isName() &&
- stringFilterObj.isName() &&
- !strcmp(streamFilterObj.getName(), stringFilterObj.getName())) {
- if (cryptFiltersObj.dictLookup(streamFilterObj.getName(),
- &cryptFilterObj)->isDict()) {
- cryptFilterObj.dictLookup("CFM", &cfmObj);
- if (cfmObj.isName("V2")) {
- encVersion = 2;
- encRevision = 3;
- if (cryptFilterObj.dictLookup("Length", &cfLengthObj)->isInt()) {
- //~ according to the spec, this should be cfLengthObj / 8
- fileKeyLength = cfLengthObj.getInt();
- }
- cfLengthObj.free();
- } else if (cfmObj.isName("AESV2")) {
- encVersion = 2;
- encRevision = 3;
- encAlgorithm = cryptAES;
- if (cryptFilterObj.dictLookup("Length", &cfLengthObj)->isInt()) {
- //~ according to the spec, this should be cfLengthObj / 8
- fileKeyLength = cfLengthObj.getInt();
- }
- cfLengthObj.free();
- }
- cfmObj.free();
- }
- cryptFilterObj.free();
- }
- stringFilterObj.free();
- streamFilterObj.free();
- cryptFiltersObj.free();
- if (encryptDictA->dictLookup("EncryptMetadata",
- &encryptMetadataObj)->isBool()) {
- encryptMetadata = encryptMetadataObj.getBool();
- }
- encryptMetadataObj.free();
- }
- permFlags = permObj.getInt();
- ownerKey = ownerKeyObj.getString()->copy();
- userKey = userKeyObj.getString()->copy();
- if (encVersion >= 1 && encVersion <= 2 &&
- encRevision >= 2 && encRevision <= 3) {
- if (fileIDObj.isArray()) {
- if (fileIDObj.arrayGet(0, &fileIDObj1)->isString()) {
- fileID = fileIDObj1.getString()->copy();
- } else {
- fileID = new GString();
- }
- fileIDObj1.free();
- } else {
- fileID = new GString();
- }
- ok = gTrue;
- } else {
- error(-1, "Unsupported version/revision (%d/%d) of Standard security handler",
- encVersion, encRevision);
- }
- } else {
- error(-1, "Weird encryption info");
- }
- if (fileKeyLength > 16) {
- fileKeyLength = 16;
- }
- fileIDObj.free();
- permObj.free();
- userKeyObj.free();
- ownerKeyObj.free();
- lengthObj.free();
- revisionObj.free();
- versionObj.free();
-}
-
-StandardSecurityHandler::~StandardSecurityHandler() {
- if (fileID) {
- delete fileID;
- }
- if (ownerKey) {
- delete ownerKey;
- }
- if (userKey) {
- delete userKey;
- }
-}
-
-void *StandardSecurityHandler::makeAuthData(GString *ownerPassword,
- GString *userPassword) {
- return new StandardAuthData(ownerPassword ? ownerPassword->copy()
- : (GString *)NULL,
- userPassword ? userPassword->copy()
- : (GString *)NULL);
-}
-
-void *StandardSecurityHandler::getAuthData() {
-#if HAVE_XPDFCORE
- XPDFCore *core;
- GString *password;
-
- if (!(core = (XPDFCore *)doc->getGUIData()) ||
- !(password = core->getPassword())) {
- return NULL;
- }
- return new StandardAuthData(password, password->copy());
-#elif HAVE_WINPDFCORE
- WinPDFCore *core;
- GString *password;
-
- if (!(core = (WinPDFCore *)doc->getGUIData()) ||
- !(password = core->getPassword())) {
- return NULL;
- }
- return new StandardAuthData(password, password->copy());
-#else
- return NULL;
-#endif
-}
-
-void StandardSecurityHandler::freeAuthData(void *authData) {
- delete (StandardAuthData *)authData;
-}
-
-GBool StandardSecurityHandler::authorize(void *authData) {
- GString *ownerPassword, *userPassword;
-
- if (!ok) {
- return gFalse;
- }
- if (authData) {
- ownerPassword = ((StandardAuthData *)authData)->ownerPassword;
- userPassword = ((StandardAuthData *)authData)->userPassword;
- } else {
- ownerPassword = NULL;
- userPassword = NULL;
- }
- if (!Decrypt::makeFileKey(encVersion, encRevision, fileKeyLength,
- ownerKey, userKey, permFlags, fileID,
- ownerPassword, userPassword, fileKey,
- encryptMetadata, &ownerPasswordOk)) {
- return gFalse;
- }
- return gTrue;
-}
-
-#ifdef ENABLE_PLUGINS
-
-//------------------------------------------------------------------------
-// ExternalSecurityHandler
-//------------------------------------------------------------------------
-
-ExternalSecurityHandler::ExternalSecurityHandler(PDFDoc *docA,
- Object *encryptDictA,
- XpdfSecurityHandler *xshA):
- SecurityHandler(docA)
-{
- encryptDictA->copy(&encryptDict);
- xsh = xshA;
- encAlgorithm = cryptRC4; //~ this should be obtained via getKey
- ok = gFalse;
-
- if (!(*xsh->newDoc)(xsh->handlerData, (XpdfDoc)docA,
- (XpdfObject)encryptDictA, &docData)) {
- return;
- }
-
- ok = gTrue;
-}
-
-ExternalSecurityHandler::~ExternalSecurityHandler() {
- (*xsh->freeDoc)(xsh->handlerData, docData);
- encryptDict.free();
-}
-
-void *ExternalSecurityHandler::makeAuthData(GString *ownerPassword,
- GString *userPassword) {
- char *opw, *upw;
- void *authData;
-
- opw = ownerPassword ? ownerPassword->getCString() : (char *)NULL;
- upw = userPassword ? userPassword->getCString() : (char *)NULL;
- if (!(*xsh->makeAuthData)(xsh->handlerData, docData, opw, upw, &authData)) {
- return NULL;
- }
- return authData;
-}
-
-void *ExternalSecurityHandler::getAuthData() {
- void *authData;
-
- if (!(*xsh->getAuthData)(xsh->handlerData, docData, &authData)) {
- return NULL;
- }
- return authData;
-}
-
-void ExternalSecurityHandler::freeAuthData(void *authData) {
- (*xsh->freeAuthData)(xsh->handlerData, docData, authData);
-}
-
-GBool ExternalSecurityHandler::authorize(void *authData) {
- char *key;
- int length;
-
- if (!ok) {
- return gFalse;
- }
- permFlags = (*xsh->authorize)(xsh->handlerData, docData, authData);
- if (!(permFlags & xpdfPermissionOpen)) {
- return gFalse;
- }
- if (!(*xsh->getKey)(xsh->handlerData, docData, &key, &length, &encVersion)) {
- return gFalse;
- }
- if ((fileKeyLength = length) > 16) {
- fileKeyLength = 16;
- }
- memcpy(fileKey, key, fileKeyLength);
- (*xsh->freeKey)(xsh->handlerData, docData, key, length);
- return gTrue;
-}
-
-#endif // ENABLE_PLUGINS
diff --git a/kpdf/xpdf/xpdf/SecurityHandler.cpp b/kpdf/xpdf/xpdf/SecurityHandler.cpp
new file mode 100644
index 00000000..6c2abba0
--- /dev/null
+++ b/kpdf/xpdf/xpdf/SecurityHandler.cpp
@@ -0,0 +1,390 @@
+//========================================================================
+//
+// SecurityHandler.cpp
+//
+// Copyright 2004 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include "GString.h"
+#include "PDFDoc.h"
+#include "Decrypt.h"
+#include "Error.h"
+#include "GlobalParams.h"
+#if HAVE_XPDFCORE
+# include "XPDFCore.h"
+#elif HAVE_WINPDFCORE
+# include "WinPDFCore.h"
+#endif
+#ifdef ENABLE_PLUGINS
+# include "XpdfPluginAPI.h"
+#endif
+#include "SecurityHandler.h"
+
+//------------------------------------------------------------------------
+// SecurityHandler
+//------------------------------------------------------------------------
+
+SecurityHandler *SecurityHandler::make(PDFDoc *docA, Object *encryptDictA) {
+ Object filterObj;
+ SecurityHandler *secHdlr;
+#ifdef ENABLE_PLUGINS
+ XpdfSecurityHandler *xsh;
+#endif
+
+ encryptDictA->dictLookup("Filter", &filterObj);
+ if (filterObj.isName("Standard")) {
+ secHdlr = new StandardSecurityHandler(docA, encryptDictA);
+ } else if (filterObj.isName()) {
+#ifdef ENABLE_PLUGINS
+ if ((xsh = globalParams->getSecurityHandler(filterObj.getName()))) {
+ secHdlr = new ExternalSecurityHandler(docA, encryptDictA, xsh);
+ } else {
+#endif
+ error(-1, "Couldn't find the '%s' security handler",
+ filterObj.getName());
+ secHdlr = NULL;
+#ifdef ENABLE_PLUGINS
+ }
+#endif
+ } else {
+ error(-1, "Missing or invalid 'Filter' entry in encryption dictionary");
+ secHdlr = NULL;
+ }
+ filterObj.free();
+ return secHdlr;
+}
+
+SecurityHandler::SecurityHandler(PDFDoc *docA) {
+ doc = docA;
+}
+
+SecurityHandler::~SecurityHandler() {
+}
+
+GBool SecurityHandler::checkEncryption(GString *ownerPassword,
+ GString *userPassword) {
+ void *authData;
+ GBool ok;
+ int i;
+
+ if (ownerPassword || userPassword) {
+ authData = makeAuthData(ownerPassword, userPassword);
+ } else {
+ authData = NULL;
+ }
+ ok = authorize(authData);
+ if (authData) {
+ freeAuthData(authData);
+ }
+ for (i = 0; !ok && i < 3; ++i) {
+ if (!(authData = getAuthData())) {
+ break;
+ }
+ ok = authorize(authData);
+ if (authData) {
+ freeAuthData(authData);
+ }
+ }
+ if (!ok) {
+ error(-1, "Incorrect password");
+ }
+ return ok;
+}
+
+//------------------------------------------------------------------------
+// StandardSecurityHandler
+//------------------------------------------------------------------------
+
+class StandardAuthData {
+public:
+
+ StandardAuthData(GString *ownerPasswordA, GString *userPasswordA) {
+ ownerPassword = ownerPasswordA;
+ userPassword = userPasswordA;
+ }
+
+ ~StandardAuthData() {
+ if (ownerPassword) {
+ delete ownerPassword;
+ }
+ if (userPassword) {
+ delete userPassword;
+ }
+ }
+
+ GString *ownerPassword;
+ GString *userPassword;
+};
+
+StandardSecurityHandler::StandardSecurityHandler(PDFDoc *docA,
+ Object *encryptDictA):
+ SecurityHandler(docA)
+{
+ Object versionObj, revisionObj, lengthObj;
+ Object ownerKeyObj, userKeyObj, permObj, fileIDObj;
+ Object fileIDObj1;
+ Object cryptFiltersObj, streamFilterObj, stringFilterObj;
+ Object cryptFilterObj, cfmObj, cfLengthObj;
+ Object encryptMetadataObj;
+
+ ok = gFalse;
+ fileID = NULL;
+ ownerKey = NULL;
+ userKey = NULL;
+
+ encryptDictA->dictLookup("V", &versionObj);
+ encryptDictA->dictLookup("R", &revisionObj);
+ encryptDictA->dictLookup("Length", &lengthObj);
+ encryptDictA->dictLookup("O", &ownerKeyObj);
+ encryptDictA->dictLookup("U", &userKeyObj);
+ encryptDictA->dictLookup("P", &permObj);
+ doc->getXRef()->getTrailerDict()->dictLookup("ID", &fileIDObj);
+ if (versionObj.isInt() &&
+ revisionObj.isInt() &&
+ ownerKeyObj.isString() && ownerKeyObj.getString()->getLength() == 32 &&
+ userKeyObj.isString() && userKeyObj.getString()->getLength() == 32 &&
+ permObj.isInt()) {
+ encVersion = versionObj.getInt();
+ encRevision = revisionObj.getInt();
+ encAlgorithm = cryptRC4;
+ // revision 2 forces a 40-bit key - some buggy PDF generators
+ // set the Length value incorrectly
+ if (encRevision == 2 || !lengthObj.isInt()) {
+ fileKeyLength = 5;
+ } else {
+ fileKeyLength = lengthObj.getInt() / 8;
+ }
+ encryptMetadata = gTrue;
+ //~ this currently only handles a subset of crypt filter functionality
+ if (encVersion == 4 && encRevision == 4) {
+ encryptDictA->dictLookup("CF", &cryptFiltersObj);
+ encryptDictA->dictLookup("StmF", &streamFilterObj);
+ encryptDictA->dictLookup("StrF", &stringFilterObj);
+ if (cryptFiltersObj.isDict() &&
+ streamFilterObj.isName() &&
+ stringFilterObj.isName() &&
+ !strcmp(streamFilterObj.getName(), stringFilterObj.getName())) {
+ if (cryptFiltersObj.dictLookup(streamFilterObj.getName(),
+ &cryptFilterObj)->isDict()) {
+ cryptFilterObj.dictLookup("CFM", &cfmObj);
+ if (cfmObj.isName("V2")) {
+ encVersion = 2;
+ encRevision = 3;
+ if (cryptFilterObj.dictLookup("Length", &cfLengthObj)->isInt()) {
+ //~ according to the spec, this should be cfLengthObj / 8
+ fileKeyLength = cfLengthObj.getInt();
+ }
+ cfLengthObj.free();
+ } else if (cfmObj.isName("AESV2")) {
+ encVersion = 2;
+ encRevision = 3;
+ encAlgorithm = cryptAES;
+ if (cryptFilterObj.dictLookup("Length", &cfLengthObj)->isInt()) {
+ //~ according to the spec, this should be cfLengthObj / 8
+ fileKeyLength = cfLengthObj.getInt();
+ }
+ cfLengthObj.free();
+ }
+ cfmObj.free();
+ }
+ cryptFilterObj.free();
+ }
+ stringFilterObj.free();
+ streamFilterObj.free();
+ cryptFiltersObj.free();
+ if (encryptDictA->dictLookup("EncryptMetadata",
+ &encryptMetadataObj)->isBool()) {
+ encryptMetadata = encryptMetadataObj.getBool();
+ }
+ encryptMetadataObj.free();
+ }
+ permFlags = permObj.getInt();
+ ownerKey = ownerKeyObj.getString()->copy();
+ userKey = userKeyObj.getString()->copy();
+ if (encVersion >= 1 && encVersion <= 2 &&
+ encRevision >= 2 && encRevision <= 3) {
+ if (fileIDObj.isArray()) {
+ if (fileIDObj.arrayGet(0, &fileIDObj1)->isString()) {
+ fileID = fileIDObj1.getString()->copy();
+ } else {
+ fileID = new GString();
+ }
+ fileIDObj1.free();
+ } else {
+ fileID = new GString();
+ }
+ ok = gTrue;
+ } else {
+ error(-1, "Unsupported version/revision (%d/%d) of Standard security handler",
+ encVersion, encRevision);
+ }
+ } else {
+ error(-1, "Weird encryption info");
+ }
+ if (fileKeyLength > 16) {
+ fileKeyLength = 16;
+ }
+ fileIDObj.free();
+ permObj.free();
+ userKeyObj.free();
+ ownerKeyObj.free();
+ lengthObj.free();
+ revisionObj.free();
+ versionObj.free();
+}
+
+StandardSecurityHandler::~StandardSecurityHandler() {
+ if (fileID) {
+ delete fileID;
+ }
+ if (ownerKey) {
+ delete ownerKey;
+ }
+ if (userKey) {
+ delete userKey;
+ }
+}
+
+void *StandardSecurityHandler::makeAuthData(GString *ownerPassword,
+ GString *userPassword) {
+ return new StandardAuthData(ownerPassword ? ownerPassword->copy()
+ : (GString *)NULL,
+ userPassword ? userPassword->copy()
+ : (GString *)NULL);
+}
+
+void *StandardSecurityHandler::getAuthData() {
+#if HAVE_XPDFCORE
+ XPDFCore *core;
+ GString *password;
+
+ if (!(core = (XPDFCore *)doc->getGUIData()) ||
+ !(password = core->getPassword())) {
+ return NULL;
+ }
+ return new StandardAuthData(password, password->copy());
+#elif HAVE_WINPDFCORE
+ WinPDFCore *core;
+ GString *password;
+
+ if (!(core = (WinPDFCore *)doc->getGUIData()) ||
+ !(password = core->getPassword())) {
+ return NULL;
+ }
+ return new StandardAuthData(password, password->copy());
+#else
+ return NULL;
+#endif
+}
+
+void StandardSecurityHandler::freeAuthData(void *authData) {
+ delete (StandardAuthData *)authData;
+}
+
+GBool StandardSecurityHandler::authorize(void *authData) {
+ GString *ownerPassword, *userPassword;
+
+ if (!ok) {
+ return gFalse;
+ }
+ if (authData) {
+ ownerPassword = ((StandardAuthData *)authData)->ownerPassword;
+ userPassword = ((StandardAuthData *)authData)->userPassword;
+ } else {
+ ownerPassword = NULL;
+ userPassword = NULL;
+ }
+ if (!Decrypt::makeFileKey(encVersion, encRevision, fileKeyLength,
+ ownerKey, userKey, permFlags, fileID,
+ ownerPassword, userPassword, fileKey,
+ encryptMetadata, &ownerPasswordOk)) {
+ return gFalse;
+ }
+ return gTrue;
+}
+
+#ifdef ENABLE_PLUGINS
+
+//------------------------------------------------------------------------
+// ExternalSecurityHandler
+//------------------------------------------------------------------------
+
+ExternalSecurityHandler::ExternalSecurityHandler(PDFDoc *docA,
+ Object *encryptDictA,
+ XpdfSecurityHandler *xshA):
+ SecurityHandler(docA)
+{
+ encryptDictA->copy(&encryptDict);
+ xsh = xshA;
+ encAlgorithm = cryptRC4; //~ this should be obtained via getKey
+ ok = gFalse;
+
+ if (!(*xsh->newDoc)(xsh->handlerData, (XpdfDoc)docA,
+ (XpdfObject)encryptDictA, &docData)) {
+ return;
+ }
+
+ ok = gTrue;
+}
+
+ExternalSecurityHandler::~ExternalSecurityHandler() {
+ (*xsh->freeDoc)(xsh->handlerData, docData);
+ encryptDict.free();
+}
+
+void *ExternalSecurityHandler::makeAuthData(GString *ownerPassword,
+ GString *userPassword) {
+ char *opw, *upw;
+ void *authData;
+
+ opw = ownerPassword ? ownerPassword->getCString() : (char *)NULL;
+ upw = userPassword ? userPassword->getCString() : (char *)NULL;
+ if (!(*xsh->makeAuthData)(xsh->handlerData, docData, opw, upw, &authData)) {
+ return NULL;
+ }
+ return authData;
+}
+
+void *ExternalSecurityHandler::getAuthData() {
+ void *authData;
+
+ if (!(*xsh->getAuthData)(xsh->handlerData, docData, &authData)) {
+ return NULL;
+ }
+ return authData;
+}
+
+void ExternalSecurityHandler::freeAuthData(void *authData) {
+ (*xsh->freeAuthData)(xsh->handlerData, docData, authData);
+}
+
+GBool ExternalSecurityHandler::authorize(void *authData) {
+ char *key;
+ int length;
+
+ if (!ok) {
+ return gFalse;
+ }
+ permFlags = (*xsh->authorize)(xsh->handlerData, docData, authData);
+ if (!(permFlags & xpdfPermissionOpen)) {
+ return gFalse;
+ }
+ if (!(*xsh->getKey)(xsh->handlerData, docData, &key, &length, &encVersion)) {
+ return gFalse;
+ }
+ if ((fileKeyLength = length) > 16) {
+ fileKeyLength = 16;
+ }
+ memcpy(fileKey, key, fileKeyLength);
+ (*xsh->freeKey)(xsh->handlerData, docData, key, length);
+ return gTrue;
+}
+
+#endif // ENABLE_PLUGINS
diff --git a/kpdf/xpdf/xpdf/SplashOutputDev.cc b/kpdf/xpdf/xpdf/SplashOutputDev.cc
deleted file mode 100644
index fe235fb8..00000000
--- a/kpdf/xpdf/xpdf/SplashOutputDev.cc
+++ /dev/null
@@ -1,2851 +0,0 @@
-//========================================================================
-//
-// SplashOutputDev.cc
-//
-// Copyright 2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <string.h>
-#include <math.h>
-#include "gfile.h"
-#include "GlobalParams.h"
-#include "Error.h"
-#include "Object.h"
-#include "GfxFont.h"
-#include "Link.h"
-#include "CharCodeToUnicode.h"
-#include "FontEncodingTables.h"
-#include "FoFiTrueType.h"
-#include "SplashBitmap.h"
-#include "SplashGlyphBitmap.h"
-#include "SplashPattern.h"
-#include "SplashScreen.h"
-#include "SplashPath.h"
-#include "SplashState.h"
-#include "SplashErrorCodes.h"
-#include "SplashFontEngine.h"
-#include "SplashFont.h"
-#include "SplashFontFile.h"
-#include "SplashFontFileID.h"
-#include "Splash.h"
-#include "SplashOutputDev.h"
-
-#ifdef VMS
-#if (__VMS_VER < 70000000)
-extern "C" int unlink(char *filename);
-#endif
-#endif
-
-//------------------------------------------------------------------------
-
-// Divide a 16-bit value (in [0, 255*255]) by 255, returning an 8-bit result.
-static inline Guchar div255(int x) {
- return (Guchar)((x + (x >> 8) + 0x80) >> 8);
-}
-
-//------------------------------------------------------------------------
-// Blend functions
-//------------------------------------------------------------------------
-
-static void splashOutBlendMultiply(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = (dest[i] * src[i]) / 255;
- }
-}
-
-static void splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = dest[i] + src[i] - (dest[i] * src[i]) / 255;
- }
-}
-
-static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = dest[i] < 0x80
- ? (src[i] * 2 * dest[i]) / 255
- : 255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255;
- }
-}
-
-static void splashOutBlendDarken(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = dest[i] < src[i] ? dest[i] : src[i];
- }
-}
-
-static void splashOutBlendLighten(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = dest[i] > src[i] ? dest[i] : src[i];
- }
-}
-
-static void splashOutBlendColorDodge(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend,
- SplashColorMode cm) {
- int i, x;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- if (src[i] == 255) {
- blend[i] = 255;
- } else {
- x = (dest[i] * 255) / (255 - src[i]);
- blend[i] = x <= 255 ? x : 255;
- }
- }
-}
-
-static void splashOutBlendColorBurn(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i, x;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- if (src[i] == 0) {
- blend[i] = 0;
- } else {
- x = ((255 - dest[i]) * 255) / src[i];
- blend[i] = x <= 255 ? 255 - x : 0;
- }
- }
-}
-
-static void splashOutBlendHardLight(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = src[i] < 0x80
- ? (dest[i] * 2 * src[i]) / 255
- : 255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255;
- }
-}
-
-static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i, x;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- if (src[i] < 0x80) {
- blend[i] = dest[i] - (255 - 2 * src[i]) * dest[i] * (255 - dest[i]) /
- (255 * 255);
- } else {
- if (dest[i] < 0x40) {
- x = (((((16 * dest[i] - 12 * 255) * dest[i]) / 255)
- + 4 * 255) * dest[i]) / 255;
- } else {
- x = (int)sqrt(255.0 * dest[i]);
- }
- blend[i] = dest[i] + (2 * src[i] - 255) * (x - dest[i]) / 255;
- }
- }
-}
-
-static void splashOutBlendDifference(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend,
- SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = dest[i] < src[i] ? src[i] - dest[i] : dest[i] - src[i];
- }
-}
-
-static void splashOutBlendExclusion(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int i;
-
- for (i = 0; i < splashColorModeNComps[cm]; ++i) {
- blend[i] = dest[i] + src[i] - (2 * dest[i] * src[i]) / 255;
- }
-}
-
-static void cvtRGBToHSV(Guchar r, Guchar g, Guchar b, int *h, int *s, int *v) {
- int cmax, cmid, cmin, x;
-
- if (r >= g) {
- if (g >= b) { x = 0; cmax = r; cmid = g; cmin = b; }
- else if (b >= r) { x = 4; cmax = b; cmid = r; cmin = g; }
- else { x = 5; cmax = r; cmid = b; cmin = g; }
- } else {
- if (r >= b) { x = 1; cmax = g; cmid = r; cmin = b; }
- else if (g >= b) { x = 2; cmax = g; cmid = b; cmin = r; }
- else { x = 3; cmax = b; cmid = g; cmin = r; }
- }
- if (cmax == cmin) {
- *h = *s = 0;
- } else {
- *h = x * 60;
- if (x & 1) {
- *h += ((cmax - cmid) * 60) / (cmax - cmin);
- } else {
- *h += ((cmid - cmin) * 60) / (cmax - cmin);
- }
- *s = (255 * (cmax - cmin)) / cmax;
- }
- *v = cmax;
-}
-
-static void cvtHSVToRGB(int h, int s, int v, Guchar *r, Guchar *g, Guchar *b) {
- int x, f, cmax, cmid, cmin;
-
- if (s == 0) {
- *r = *g = *b = v;
- } else {
- x = h / 60;
- f = h % 60;
- cmax = v;
- if (x & 1) {
- cmid = div255(v * 255 - ((s * f) / 60));
- } else {
- cmid = div255(v * (255 - ((s * (60 - f)) / 60)));
- }
- cmin = div255(v * (255 - s));
- switch (x) {
- case 0: *r = cmax; *g = cmid; *b = cmin; break;
- case 1: *g = cmax; *r = cmid; *b = cmin; break;
- case 2: *g = cmax; *b = cmid; *r = cmin; break;
- case 3: *b = cmax; *g = cmid; *r = cmin; break;
- case 4: *b = cmax; *r = cmid; *g = cmin; break;
- case 5: *r = cmax; *b = cmid; *g = cmin; break;
- }
- }
-}
-
-static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int hs, ss, vs, hd, sd, vd;
-#if SPLASH_CMYK
- Guchar r, g, b;
-#endif
-
- switch (cm) {
- case splashModeMono1:
- case splashModeMono8:
- blend[0] = dest[0];
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
- cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
- cvtHSVToRGB(hs, sd, vd, &blend[0], &blend[1], &blend[2]);
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- //~ (0xff - ...) should be clipped
- cvtRGBToHSV(0xff - (src[0] + src[3]),
- 0xff - (src[1] + src[3]),
- 0xff - (src[2] + src[3]), &hs, &ss, &vs);
- cvtRGBToHSV(0xff - (dest[0] + dest[3]),
- 0xff - (dest[1] + dest[3]),
- 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
- cvtHSVToRGB(hs, sd, vd, &r, &g, &b);
- //~ should do black generation
- blend[0] = 0xff - r;
- blend[1] = 0xff - g;
- blend[2] = 0xff - b;
- blend[3] = 0;
- break;
-#endif
- }
-}
-
-static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend,
- SplashColorMode cm) {
- int hs, ss, vs, hd, sd, vd;
-#if SPLASH_CMYK
- Guchar r, g, b;
-#endif
-
- switch (cm) {
- case splashModeMono1:
- case splashModeMono8:
- blend[0] = dest[0];
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
- cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
- cvtHSVToRGB(hd, ss, vd, &blend[0], &blend[1], &blend[2]);
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- //~ (0xff - ...) should be clipped
- cvtRGBToHSV(0xff - (src[0] + src[3]),
- 0xff - (src[1] + src[3]),
- 0xff - (src[2] + src[3]), &hs, &ss, &vs);
- cvtRGBToHSV(0xff - (dest[0] + dest[3]),
- 0xff - (dest[1] + dest[3]),
- 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
- cvtHSVToRGB(hd, ss, vd, &r, &g, &b);
- //~ should do black generation
- blend[0] = 0xff - r;
- blend[1] = 0xff - g;
- blend[2] = 0xff - b;
- blend[3] = 0;
- break;
-#endif
- }
-}
-
-static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend, SplashColorMode cm) {
- int hs, ss, vs, hd, sd, vd;
-#if SPLASH_CMYK
- Guchar r, g, b;
-#endif
-
- switch (cm) {
- case splashModeMono1:
- case splashModeMono8:
- blend[0] = dest[0];
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
- cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
- cvtHSVToRGB(hs, ss, vd, &blend[0], &blend[1], &blend[2]);
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- //~ (0xff - ...) should be clipped
- cvtRGBToHSV(0xff - (src[0] + src[3]),
- 0xff - (src[1] + src[3]),
- 0xff - (src[2] + src[3]), &hs, &ss, &vs);
- cvtRGBToHSV(0xff - (dest[0] + dest[3]),
- 0xff - (dest[1] + dest[3]),
- 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
- cvtHSVToRGB(hs, ss, vd, &r, &g, &b);
- //~ should do black generation
- blend[0] = 0xff - r;
- blend[1] = 0xff - g;
- blend[2] = 0xff - b;
- blend[3] = 0;
- break;
-#endif
- }
-}
-
-static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
- SplashColorPtr blend,
- SplashColorMode cm) {
- int hs, ss, vs, hd, sd, vd;
-#if SPLASH_CMYK
- Guchar r, g, b;
-#endif
-
- switch (cm) {
- case splashModeMono1:
- case splashModeMono8:
- blend[0] = dest[0];
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
- cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
- cvtHSVToRGB(hd, sd, vs, &blend[0], &blend[1], &blend[2]);
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- //~ (0xff - ...) should be clipped
- cvtRGBToHSV(0xff - (src[0] + src[3]),
- 0xff - (src[1] + src[3]),
- 0xff - (src[2] + src[3]), &hs, &ss, &vs);
- cvtRGBToHSV(0xff - (dest[0] + dest[3]),
- 0xff - (dest[1] + dest[3]),
- 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
- cvtHSVToRGB(hd, sd, vs, &r, &g, &b);
- //~ should do black generation
- blend[0] = 0xff - r;
- blend[1] = 0xff - g;
- blend[2] = 0xff - b;
- blend[3] = 0;
- break;
-#endif
- }
-}
-
-// NB: This must match the GfxBlendMode enum defined in GfxState.h.
-SplashBlendFunc splashOutBlendFuncs[] = {
- NULL,
- &splashOutBlendMultiply,
- &splashOutBlendScreen,
- &splashOutBlendOverlay,
- &splashOutBlendDarken,
- &splashOutBlendLighten,
- &splashOutBlendColorDodge,
- &splashOutBlendColorBurn,
- &splashOutBlendHardLight,
- &splashOutBlendSoftLight,
- &splashOutBlendDifference,
- &splashOutBlendExclusion,
- &splashOutBlendHue,
- &splashOutBlendSaturation,
- &splashOutBlendColor,
- &splashOutBlendLuminosity
-};
-
-//------------------------------------------------------------------------
-// Font substitutions
-//------------------------------------------------------------------------
-
-struct SplashOutFontSubst {
- char *name;
- double mWidth;
-};
-
-// index: {symbolic:12, fixed:8, serif:4, sans-serif:0} + bold*2 + italic
-static SplashOutFontSubst splashOutSubstFonts[16] = {
- {"Helvetica", 0.833},
- {"Helvetica-Oblique", 0.833},
- {"Helvetica-Bold", 0.889},
- {"Helvetica-BoldOblique", 0.889},
- {"Times-Roman", 0.788},
- {"Times-Italic", 0.722},
- {"Times-Bold", 0.833},
- {"Times-BoldItalic", 0.778},
- {"Courier", 0.600},
- {"Courier-Oblique", 0.600},
- {"Courier-Bold", 0.600},
- {"Courier-BoldOblique", 0.600},
- {"Symbol", 0.576},
- {"Symbol", 0.576},
- {"Symbol", 0.576},
- {"Symbol", 0.576}
-};
-
-//------------------------------------------------------------------------
-// SplashOutFontFileID
-//------------------------------------------------------------------------
-
-class SplashOutFontFileID: public SplashFontFileID {
-public:
-
- SplashOutFontFileID(Ref *rA) { r = *rA; substIdx = -1; }
-
- ~SplashOutFontFileID() {}
-
- GBool matches(SplashFontFileID *id) {
- return ((SplashOutFontFileID *)id)->r.num == r.num &&
- ((SplashOutFontFileID *)id)->r.gen == r.gen;
- }
-
- void setSubstIdx(int substIdxA) { substIdx = substIdxA; }
- int getSubstIdx() { return substIdx; }
-
-private:
-
- Ref r;
- int substIdx;
-};
-
-//------------------------------------------------------------------------
-// T3FontCache
-//------------------------------------------------------------------------
-
-struct T3FontCacheTag {
- Gushort code;
- Gushort mru; // valid bit (0x8000) and MRU index
-};
-
-class T3FontCache {
-public:
-
- T3FontCache(Ref *fontID, double m11A, double m12A,
- double m21A, double m22A,
- int glyphXA, int glyphYA, int glyphWA, int glyphHA,
- GBool aa, GBool validBBoxA);
- ~T3FontCache();
- GBool matches(Ref *idA, double m11A, double m12A,
- double m21A, double m22A)
- { return fontID.num == idA->num && fontID.gen == idA->gen &&
- m11 == m11A && m12 == m12A && m21 == m21A && m22 == m22A; }
-
- Ref fontID; // PDF font ID
- double m11, m12, m21, m22; // transform matrix
- int glyphX, glyphY; // pixel offset of glyph bitmaps
- int glyphW, glyphH; // size of glyph bitmaps, in pixels
- GBool validBBox; // false if the bbox was [0 0 0 0]
- int glyphSize; // size of glyph bitmaps, in bytes
- int cacheSets; // number of sets in cache
- int cacheAssoc; // cache associativity (glyphs per set)
- Guchar *cacheData; // glyph pixmap cache
- T3FontCacheTag *cacheTags; // cache tags, i.e., char codes
-};
-
-T3FontCache::T3FontCache(Ref *fontIDA, double m11A, double m12A,
- double m21A, double m22A,
- int glyphXA, int glyphYA, int glyphWA, int glyphHA,
- GBool validBBoxA, GBool aa) {
- int i;
-
- fontID = *fontIDA;
- m11 = m11A;
- m12 = m12A;
- m21 = m21A;
- m22 = m22A;
- glyphX = glyphXA;
- glyphY = glyphYA;
- glyphW = glyphWA;
- glyphH = glyphHA;
- validBBox = validBBoxA;
- if (aa) {
- glyphSize = glyphW * glyphH;
- } else {
- glyphSize = ((glyphW + 7) >> 3) * glyphH;
- }
- cacheAssoc = 8;
- if (glyphSize <= 256) {
- cacheSets = 8;
- } else if (glyphSize <= 512) {
- cacheSets = 4;
- } else if (glyphSize <= 1024) {
- cacheSets = 2;
- } else {
- cacheSets = 1;
- }
- cacheData = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
- if (cacheData != NULL)
- {
- cacheTags = (T3FontCacheTag *)gmallocn(cacheSets * cacheAssoc,
- sizeof(T3FontCacheTag));
- for (i = 0; i < cacheSets * cacheAssoc; ++i) {
- cacheTags[i].mru = i & (cacheAssoc - 1);
- }
- }
- else
- {
- cacheTags = NULL;
- }
-}
-
-T3FontCache::~T3FontCache() {
- gfree(cacheData);
- gfree(cacheTags);
-}
-
-struct T3GlyphStack {
- Gushort code; // character code
-
- //----- cache info
- T3FontCache *cache; // font cache for the current font
- T3FontCacheTag *cacheTag; // pointer to cache tag for the glyph
- Guchar *cacheData; // pointer to cache data for the glyph
-
- //----- saved state
- SplashBitmap *origBitmap;
- Splash *origSplash;
- double origCTM4, origCTM5;
-
- T3GlyphStack *next; // next object on stack
-};
-
-//------------------------------------------------------------------------
-// SplashTransparencyGroup
-//------------------------------------------------------------------------
-
-struct SplashTransparencyGroup {
- int tx, ty; // translation coordinates
- SplashBitmap *tBitmap; // bitmap for transparency group
- GfxColorSpace *blendingColorSpace;
- GBool isolated;
-
- //----- saved state
- SplashBitmap *origBitmap;
- Splash *origSplash;
-
- SplashTransparencyGroup *next;
-};
-
-//------------------------------------------------------------------------
-// SplashOutputDev
-//------------------------------------------------------------------------
-
-SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA,
- int bitmapRowPadA,
- GBool reverseVideoA,
- SplashColorPtr paperColorA,
- GBool bitmapTopDownA,
- GBool allowAntialiasA) {
- colorMode = colorModeA;
- bitmapRowPad = bitmapRowPadA;
- bitmapTopDown = bitmapTopDownA;
- allowAntialias = allowAntialiasA;
- vectorAntialias = allowAntialias &&
- globalParams->getVectorAntialias() &&
- colorMode != splashModeMono1;
- setupScreenParams(72.0, 72.0);
- reverseVideo = reverseVideoA;
- splashColorCopy(paperColor, paperColorA);
-
- xref = NULL;
-
- bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode,
- colorMode != splashModeMono1, bitmapTopDown);
- splash = new Splash(bitmap, vectorAntialias, &screenParams);
- splash->clear(paperColor, 0);
-
- fontEngine = NULL;
-
- nT3Fonts = 0;
- t3GlyphStack = NULL;
-
- font = NULL;
- needFontUpdate = gFalse;
- textClipPath = NULL;
-
- transpGroupStack = NULL;
-}
-
-void SplashOutputDev::setupScreenParams(double hDPI, double vDPI) {
- screenParams.size = globalParams->getScreenSize();
- screenParams.dotRadius = globalParams->getScreenDotRadius();
- screenParams.gamma = (SplashCoord)globalParams->getScreenGamma();
- screenParams.blackThreshold =
- (SplashCoord)globalParams->getScreenBlackThreshold();
- screenParams.whiteThreshold =
- (SplashCoord)globalParams->getScreenWhiteThreshold();
- switch (globalParams->getScreenType()) {
- case screenDispersed:
- screenParams.type = splashScreenDispersed;
- if (screenParams.size < 0) {
- screenParams.size = 4;
- }
- break;
- case screenClustered:
- screenParams.type = splashScreenClustered;
- if (screenParams.size < 0) {
- screenParams.size = 10;
- }
- break;
- case screenStochasticClustered:
- screenParams.type = splashScreenStochasticClustered;
- if (screenParams.size < 0) {
- screenParams.size = 100;
- }
- if (screenParams.dotRadius < 0) {
- screenParams.dotRadius = 2;
- }
- break;
- case screenUnset:
- default:
- // use clustered dithering for resolution >= 300 dpi
- // (compare to 299.9 to avoid floating point issues)
- if (hDPI > 299.9 && vDPI > 299.9) {
- screenParams.type = splashScreenStochasticClustered;
- if (screenParams.size < 0) {
- screenParams.size = 100;
- }
- if (screenParams.dotRadius < 0) {
- screenParams.dotRadius = 2;
- }
- } else {
- screenParams.type = splashScreenDispersed;
- if (screenParams.size < 0) {
- screenParams.size = 4;
- }
- }
- }
-}
-
-SplashOutputDev::~SplashOutputDev() {
- int i;
-
- for (i = 0; i < nT3Fonts; ++i) {
- delete t3FontCache[i];
- }
- if (fontEngine) {
- delete fontEngine;
- }
- if (splash) {
- delete splash;
- }
- if (bitmap) {
- delete bitmap;
- }
-}
-
-void SplashOutputDev::startDoc(XRef *xrefA) {
- int i;
-
- xref = xrefA;
- if (fontEngine) {
- delete fontEngine;
- }
- fontEngine = new SplashFontEngine(
-#if HAVE_T1LIB_H
- globalParams->getEnableT1lib(),
-#endif
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
- globalParams->getEnableFreeType(),
-#endif
- allowAntialias &&
- globalParams->getAntialias() &&
- colorMode != splashModeMono1);
- for (i = 0; i < nT3Fonts; ++i) {
- delete t3FontCache[i];
- }
- nT3Fonts = 0;
-}
-
-void SplashOutputDev::startPage(int /*pageNum*/, GfxState *state) {
- int w, h;
- double *ctm;
- SplashCoord mat[6];
- SplashColor color;
-
- if (state) {
- setupScreenParams(state->getHDPI(), state->getVDPI());
- w = (int)(state->getPageWidth() + 0.5);
- if (w <= 0) {
- w = 1;
- }
- h = (int)(state->getPageHeight() + 0.5);
- if (h <= 0) {
- h = 1;
- }
- } else {
- w = h = 1;
- }
- if (splash) {
- delete splash;
- }
- if (!bitmap || w != bitmap->getWidth() || h != bitmap->getHeight()) {
- if (bitmap) {
- delete bitmap;
- }
- bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode,
- colorMode != splashModeMono1, bitmapTopDown);
- }
- splash = new Splash(bitmap, vectorAntialias, &screenParams);
- if (state) {
- ctm = state->getCTM();
- mat[0] = (SplashCoord)ctm[0];
- mat[1] = (SplashCoord)ctm[1];
- mat[2] = (SplashCoord)ctm[2];
- mat[3] = (SplashCoord)ctm[3];
- mat[4] = (SplashCoord)ctm[4];
- mat[5] = (SplashCoord)ctm[5];
- splash->setMatrix(mat);
- }
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- color[0] = 0;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- color[0] = color[1] = color[2] = 0;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- color[0] = color[1] = color[2] = color[3] = 0;
- break;
-#endif
- }
- splash->setStrokePattern(new SplashSolidColor(color));
- splash->setFillPattern(new SplashSolidColor(color));
- splash->setLineCap(splashLineCapButt);
- splash->setLineJoin(splashLineJoinMiter);
- splash->setLineDash(NULL, 0, 0);
- splash->setMiterLimit(10);
- splash->setFlatness(1);
- // the SA parameter supposedly defaults to false, but Acrobat
- // apparently hardwires it to true
- splash->setStrokeAdjust(globalParams->getStrokeAdjust());
- splash->clear(paperColor, 0);
-}
-
-void SplashOutputDev::endPage() {
- if (colorMode != splashModeMono1) {
- splash->compositeBackground(paperColor);
- }
-}
-
-void SplashOutputDev::saveState(GfxState * /*state*/) {
- splash->saveState();
-}
-
-void SplashOutputDev::restoreState(GfxState * /*state*/) {
- splash->restoreState();
- needFontUpdate = gTrue;
-}
-
-void SplashOutputDev::updateAll(GfxState *state) {
- updateLineDash(state);
- updateLineJoin(state);
- updateLineCap(state);
- updateLineWidth(state);
- updateFlatness(state);
- updateMiterLimit(state);
- updateStrokeAdjust(state);
- updateFillColor(state);
- updateStrokeColor(state);
- needFontUpdate = gTrue;
-}
-
-void SplashOutputDev::updateCTM(GfxState *state, double /*m11*/, double /*m12*/,
- double /*m21*/, double /*m22*/,
- double /*m31*/, double /*m32*/) {
- double *ctm;
- SplashCoord mat[6];
-
- ctm = state->getCTM();
- mat[0] = (SplashCoord)ctm[0];
- mat[1] = (SplashCoord)ctm[1];
- mat[2] = (SplashCoord)ctm[2];
- mat[3] = (SplashCoord)ctm[3];
- mat[4] = (SplashCoord)ctm[4];
- mat[5] = (SplashCoord)ctm[5];
- splash->setMatrix(mat);
-}
-
-void SplashOutputDev::updateLineDash(GfxState *state) {
- double *dashPattern;
- int dashLength;
- double dashStart;
- SplashCoord dash[20];
- int i;
-
- state->getLineDash(&dashPattern, &dashLength, &dashStart);
- if (dashLength > 20) {
- dashLength = 20;
- }
- for (i = 0; i < dashLength; ++i) {
- dash[i] = (SplashCoord)dashPattern[i];
- if (dash[i] < 0) {
- dash[i] = 0;
- }
- }
- splash->setLineDash(dash, dashLength, (SplashCoord)dashStart);
-}
-
-void SplashOutputDev::updateFlatness(GfxState *state) {
- splash->setFlatness(state->getFlatness());
-}
-
-void SplashOutputDev::updateLineJoin(GfxState *state) {
- splash->setLineJoin(state->getLineJoin());
-}
-
-void SplashOutputDev::updateLineCap(GfxState *state) {
- splash->setLineCap(state->getLineCap());
-}
-
-void SplashOutputDev::updateMiterLimit(GfxState *state) {
- splash->setMiterLimit(state->getMiterLimit());
-}
-
-void SplashOutputDev::updateLineWidth(GfxState *state) {
- splash->setLineWidth(state->getLineWidth());
-}
-
-void SplashOutputDev::updateStrokeAdjust(GfxState * /*state*/) {
-#if 0 // the SA parameter supposedly defaults to false, but Acrobat
- // apparently hardwires it to true
- splash->setStrokeAdjust(state->getStrokeAdjust());
-#endif
-}
-
-void SplashOutputDev::updateFillColor(GfxState *state) {
- GfxGray gray;
- GfxRGB rgb;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
-
- state->getFillGray(&gray);
- state->getFillRGB(&rgb);
-#if SPLASH_CMYK
- state->getFillCMYK(&cmyk);
- splash->setFillPattern(getColor(gray, &rgb, &cmyk));
-#else
- splash->setFillPattern(getColor(gray, &rgb));
-#endif
-}
-
-void SplashOutputDev::updateStrokeColor(GfxState *state) {
- GfxGray gray;
- GfxRGB rgb;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
-
- state->getStrokeGray(&gray);
- state->getStrokeRGB(&rgb);
-#if SPLASH_CMYK
- state->getStrokeCMYK(&cmyk);
- splash->setStrokePattern(getColor(gray, &rgb, &cmyk));
-#else
- splash->setStrokePattern(getColor(gray, &rgb));
-#endif
-}
-
-#if SPLASH_CMYK
-SplashPattern *SplashOutputDev::getColor(GfxGray gray, GfxRGB *rgb,
- GfxCMYK *cmyk) {
-#else
-SplashPattern *SplashOutputDev::getColor(GfxGray gray, GfxRGB *rgb) {
-#endif
- SplashPattern *pattern;
- SplashColor color;
- GfxColorComp r, g, b;
-
- if (reverseVideo) {
- gray = gfxColorComp1 - gray;
- r = gfxColorComp1 - rgb->r;
- g = gfxColorComp1 - rgb->g;
- b = gfxColorComp1 - rgb->b;
- } else {
- r = rgb->r;
- g = rgb->g;
- b = rgb->b;
- }
-
- pattern = NULL; // make gcc happy
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- color[0] = colToByte(gray);
- pattern = new SplashSolidColor(color);
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- color[0] = colToByte(r);
- color[1] = colToByte(g);
- color[2] = colToByte(b);
- pattern = new SplashSolidColor(color);
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- color[0] = colToByte(cmyk->c);
- color[1] = colToByte(cmyk->m);
- color[2] = colToByte(cmyk->y);
- color[3] = colToByte(cmyk->k);
- pattern = new SplashSolidColor(color);
- break;
-#endif
- }
-
- return pattern;
-}
-
-void SplashOutputDev::updateBlendMode(GfxState *state) {
- splash->setBlendFunc(splashOutBlendFuncs[state->getBlendMode()]);
-}
-
-void SplashOutputDev::updateFillOpacity(GfxState *state) {
- splash->setFillAlpha((SplashCoord)state->getFillOpacity());
-}
-
-void SplashOutputDev::updateStrokeOpacity(GfxState *state) {
- splash->setStrokeAlpha((SplashCoord)state->getStrokeOpacity());
-}
-
-void SplashOutputDev::updateFont(GfxState * /*state*/) {
- needFontUpdate = gTrue;
-}
-
-void SplashOutputDev::doUpdateFont(GfxState *state) {
- GfxFont *gfxFont;
- GfxFontType fontType;
- SplashOutFontFileID *id;
- SplashFontFile *fontFile;
- SplashFontSrc *fontsrc = NULL;
- FoFiTrueType *ff;
- Ref embRef;
- Object refObj, strObj;
- GString *fileName, *substName;
- char *tmpBuf;
- int tmpBufLen;
- Gushort *codeToGID;
- DisplayFontParam *dfp;
- CharCodeToUnicode *ctu;
- double *textMat;
- double m11, m12, m21, m22, w1, w2, fontSize;
- SplashCoord mat[4];
- char *name;
- Unicode uBuf[8];
- int substIdx, n, code, cmap;
- int faceIndex = 0;
-
- needFontUpdate = gFalse;
- font = NULL;
- fileName = NULL;
- tmpBuf = NULL;
- substIdx = -1;
- dfp = NULL;
-
- if (!(gfxFont = state->getFont())) {
- goto err1;
- }
- fontType = gfxFont->getType();
- if (fontType == fontType3) {
- goto err1;
- }
-
- // check the font file cache
- id = new SplashOutFontFileID(gfxFont->getID());
- if ((fontFile = fontEngine->getFontFile(id))) {
- delete id;
-
- } else {
-
- // if there is an embedded font, write it to disk
- if (gfxFont->getEmbeddedFontID(&embRef)) {
- tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
- if (! tmpBuf)
- goto err2;
-
- // if there is an external font file, use it
- } else if (!(fileName = gfxFont->getExtFontFile())) {
-
- // look for a display font mapping or a substitute font
- if (gfxFont->isCIDFont()) {
- if (((GfxCIDFont *)gfxFont)->getCollection()) {
- dfp = globalParams->
- getDisplayCIDFont(gfxFont->getName(),
- ((GfxCIDFont *)gfxFont)->getCollection());
- }
- } else {
- if (gfxFont->getName()) {
- dfp = globalParams->getDisplayFont(gfxFont->getName());
- }
- if (!dfp) {
- // 8-bit font substitution
- if (gfxFont->isFixedWidth()) {
- substIdx = 8;
- } else if (gfxFont->isSerif()) {
- substIdx = 4;
- } else {
- substIdx = 0;
- }
- if (gfxFont->isBold()) {
- substIdx += 2;
- }
- if (gfxFont->isItalic()) {
- substIdx += 1;
- }
- substName = new GString(splashOutSubstFonts[substIdx].name);
- dfp = globalParams->getDisplayFont(substName);
- delete substName;
- id->setSubstIdx(substIdx);
- }
- }
- if (!dfp) {
- error(-1, "Couldn't find a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- switch (dfp->kind) {
- case displayFontT1:
- fileName = dfp->t1.fileName;
- fontType = gfxFont->isCIDFont() ? fontCIDType0 : fontType1;
- break;
- case displayFontTT:
- fileName = dfp->tt.fileName;
- fontType = gfxFont->isCIDFont() ? fontCIDType2 : fontTrueType;
- faceIndex = dfp->tt.faceIndex;
- break;
- }
- }
-
- fontsrc = new SplashFontSrc;
- if (fileName)
- fontsrc->setFile(fileName, gFalse);
- else
- fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
-
- // load the font file
- switch (fontType) {
- case fontType1:
- if (!(fontFile = fontEngine->loadType1Font(
- id,
- fontsrc,
- ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- case fontType1C:
- if (!(fontFile = fontEngine->loadType1CFont(
- id,
- fontsrc,
- ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- case fontType1COT:
- if (!(fontFile = fontEngine->loadOpenTypeT1CFont(
- id,
- fontsrc,
- ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- case fontTrueType:
- case fontTrueTypeOT:
- if (fileName)
- ff = FoFiTrueType::load(fileName->getCString());
- else
- ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
- if (ff) {
- codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
- n = 256;
- delete ff;
- } else {
- codeToGID = NULL;
- n = 0;
- }
- if (!(fontFile = fontEngine->loadTrueTypeFont(
- id,
- fontsrc,
- codeToGID, n))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- case fontCIDType0:
- case fontCIDType0C:
- if (!(fontFile = fontEngine->loadCIDFont(
- id,
- fontsrc))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- case fontCIDType0COT:
- if (!(fontFile = fontEngine->loadOpenTypeCFFFont(
- id,
- fontsrc))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- case fontCIDType2:
- case fontCIDType2OT:
- codeToGID = NULL;
- n = 0;
- if (dfp) {
- // create a CID-to-GID mapping, via Unicode
- if ((ctu = ((GfxCIDFont *)gfxFont)->getToUnicode())) {
- if (fileName)
- ff = FoFiTrueType::load(fileName->getCString());
- else
- ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
- if (ff) {
- // look for a Unicode cmap
- for (cmap = 0; cmap < ff->getNumCmaps(); ++cmap) {
- if ((ff->getCmapPlatform(cmap) == 3 &&
- ff->getCmapEncoding(cmap) == 1) ||
- ff->getCmapPlatform(cmap) == 0) {
- break;
- }
- }
- if (cmap < ff->getNumCmaps()) {
- // map CID -> Unicode -> GID
- n = ctu->getLength();
- codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
- for (code = 0; code < n; ++code) {
- if (ctu->mapToUnicode(code, uBuf, 8) > 0) {
- codeToGID[code] = ff->mapCodeToGID(cmap, uBuf[0]);
- } else {
- codeToGID[code] = 0;
- }
- }
- }
- delete ff;
- }
- ctu->decRefCnt();
- } else {
- error(-1, "Couldn't find a mapping to Unicode for font '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- }
- } else {
- if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
- n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
- codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
- memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
- n * sizeof(Gushort));
- }
- }
- if (!(fontFile = fontEngine->loadTrueTypeFont(
- id,
- fontsrc,
- codeToGID, n, faceIndex))) {
- error(-1, "Couldn't create a font for '%s'",
- gfxFont->getName() ? gfxFont->getName()->getCString()
- : "(unnamed)");
- goto err2;
- }
- break;
- default:
- // this shouldn't happen
- goto err2;
- }
- }
-
- // get the font matrix
- textMat = state->getTextMat();
- fontSize = state->getFontSize();
- m11 = textMat[0] * fontSize * state->getHorizScaling();
- m12 = textMat[1] * fontSize * state->getHorizScaling();
- m21 = textMat[2] * fontSize;
- m22 = textMat[3] * fontSize;
-
- // for substituted fonts: adjust the font matrix -- compare the
- // width of 'm' in the original font and the substituted font
- substIdx = ((SplashOutFontFileID *)fontFile->getID())->getSubstIdx();
- if (substIdx >= 0) {
- for (code = 0; code < 256; ++code) {
- if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
- name[0] == 'm' && name[1] == '\0') {
- break;
- }
- }
- if (code < 256) {
- w1 = ((Gfx8BitFont *)gfxFont)->getWidth(code);
- w2 = splashOutSubstFonts[substIdx].mWidth;
- if (!gfxFont->isSymbolic()) {
- // if real font is substantially narrower than substituted
- // font, reduce the font size accordingly
- if (w1 > 0.01 && w1 < 0.9 * w2) {
- w1 /= w2;
- m11 *= w1;
- m21 *= w1;
- }
- }
- }
- }
-
- // create the scaled font
- mat[0] = m11; mat[1] = m12;
- mat[2] = m21; mat[3] = m22;
- font = fontEngine->getFont(fontFile, mat, splash->getMatrix());
-
- if (fontsrc && !fontsrc->isFile)
- fontsrc->unref();
-
- return;
-
- err2:
- delete id;
- err1:
- if (fontsrc && !fontsrc->isFile)
- fontsrc->unref();
- return;
-}
-
-void SplashOutputDev::stroke(GfxState *state) {
- SplashPath *path;
-
- if (state->getStrokeColorSpace()->isNonMarking()) {
- return;
- }
- path = convertPath(state, state->getPath());
- splash->stroke(path);
- delete path;
-}
-
-void SplashOutputDev::fill(GfxState *state) {
- SplashPath *path;
-
- if (state->getFillColorSpace()->isNonMarking()) {
- return;
- }
- path = convertPath(state, state->getPath());
- splash->fill(path, gFalse);
- delete path;
-}
-
-void SplashOutputDev::eoFill(GfxState *state) {
- SplashPath *path;
-
- if (state->getFillColorSpace()->isNonMarking()) {
- return;
- }
- path = convertPath(state, state->getPath());
- splash->fill(path, gTrue);
- delete path;
-}
-
-void SplashOutputDev::clip(GfxState *state) {
- SplashPath *path;
-
- path = convertPath(state, state->getPath());
- splash->clipToPath(path, gFalse);
- delete path;
-}
-
-void SplashOutputDev::eoClip(GfxState *state) {
- SplashPath *path;
-
- path = convertPath(state, state->getPath());
- splash->clipToPath(path, gTrue);
- delete path;
-}
-
-void SplashOutputDev::clipToStrokePath(GfxState *state) {
- SplashPath *path, *path2;
-
- path = convertPath(state, state->getPath());
- path2 = splash->makeStrokePath(path);
- delete path;
- splash->clipToPath(path2, gFalse);
- delete path2;
-}
-
-SplashPath *SplashOutputDev::convertPath(GfxState * /*state*/, GfxPath *path) {
- SplashPath *sPath;
- GfxSubpath *subpath;
- int i, j;
-
- sPath = new SplashPath();
- for (i = 0; i < path->getNumSubpaths(); ++i) {
- subpath = path->getSubpath(i);
- if (subpath->getNumPoints() > 0) {
- sPath->moveTo((SplashCoord)subpath->getX(0),
- (SplashCoord)subpath->getY(0));
- j = 1;
- while (j < subpath->getNumPoints()) {
- if (subpath->getCurve(j)) {
- sPath->curveTo((SplashCoord)subpath->getX(j),
- (SplashCoord)subpath->getY(j),
- (SplashCoord)subpath->getX(j+1),
- (SplashCoord)subpath->getY(j+1),
- (SplashCoord)subpath->getX(j+2),
- (SplashCoord)subpath->getY(j+2));
- j += 3;
- } else {
- sPath->lineTo((SplashCoord)subpath->getX(j),
- (SplashCoord)subpath->getY(j));
- ++j;
- }
- }
- if (subpath->isClosed()) {
- sPath->close();
- }
- }
- }
- return sPath;
-}
-
-void SplashOutputDev::drawChar(GfxState *state, double x, double y,
- double /*dx*/, double /*dy*/,
- double originX, double originY,
- CharCode code, int /*nBytes*/,
- Unicode * /*u*/, int /*uLen*/) {
- SplashPath *path;
- int render;
-
- // check for invisible text -- this is used by Acrobat Capture
- render = state->getRender();
- if (render == 3) {
- return;
- }
-
- if (needFontUpdate) {
- doUpdateFont(state);
- }
- if (!font) {
- return;
- }
-
- x -= originX;
- y -= originY;
-
- // fill
- if (!(render & 1)) {
- if (!state->getFillColorSpace()->isNonMarking()) {
- splash->fillChar((SplashCoord)x, (SplashCoord)y, code, font);
- }
- }
-
- // stroke
- if ((render & 3) == 1 || (render & 3) == 2) {
- if (!state->getStrokeColorSpace()->isNonMarking()) {
- if ((path = font->getGlyphPath(code))) {
- path->offset((SplashCoord)x, (SplashCoord)y);
- splash->stroke(path);
- delete path;
- }
- }
- }
-
- // clip
- if (render & 4) {
- if ((path = font->getGlyphPath(code))) {
- path->offset((SplashCoord)x, (SplashCoord)y);
- if (textClipPath) {
- textClipPath->append(path);
- delete path;
- } else {
- textClipPath = path;
- }
- }
- }
-}
-
-GBool SplashOutputDev::beginType3Char(GfxState *state, double /*x*/, double /*y*/,
- double /*dx*/, double /*dy*/,
- CharCode code, Unicode * /*u*/, int /*uLen*/) {
- GfxFont *gfxFont;
- Ref *fontID;
- double *ctm, *bbox;
- T3FontCache *t3Font;
- T3GlyphStack *t3gs;
- GBool validBBox;
- double x1, y1, xMin, yMin, xMax, yMax, xt, yt;
- int i, j;
-
- if (!(gfxFont = state->getFont())) {
- return gFalse;
- }
- fontID = gfxFont->getID();
- ctm = state->getCTM();
- state->transform(0, 0, &xt, &yt);
-
- // is it the first (MRU) font in the cache?
- if (!(nT3Fonts > 0 &&
- t3FontCache[0]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3]))) {
-
- // is the font elsewhere in the cache?
- for (i = 1; i < nT3Fonts; ++i) {
- if (t3FontCache[i]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3])) {
- t3Font = t3FontCache[i];
- for (j = i; j > 0; --j) {
- t3FontCache[j] = t3FontCache[j - 1];
- }
- t3FontCache[0] = t3Font;
- break;
- }
- }
- if (i >= nT3Fonts) {
-
- // create new entry in the font cache
- if (nT3Fonts == splashOutT3FontCacheSize) {
- delete t3FontCache[nT3Fonts - 1];
- --nT3Fonts;
- }
- for (j = nT3Fonts; j > 0; --j) {
- t3FontCache[j] = t3FontCache[j - 1];
- }
- ++nT3Fonts;
- bbox = gfxFont->getFontBBox();
- if (bbox[0] == 0 && bbox[1] == 0 && bbox[2] == 0 && bbox[3] == 0) {
- // unspecified bounding box -- just take a guess
- xMin = xt - 5;
- xMax = xMin + 30;
- yMax = yt + 15;
- yMin = yMax - 45;
- validBBox = gFalse;
- } else {
- state->transform(bbox[0], bbox[1], &x1, &y1);
- xMin = xMax = x1;
- yMin = yMax = y1;
- state->transform(bbox[0], bbox[3], &x1, &y1);
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- state->transform(bbox[2], bbox[1], &x1, &y1);
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- state->transform(bbox[2], bbox[3], &x1, &y1);
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- validBBox = gTrue;
- }
- t3FontCache[0] = new T3FontCache(fontID, ctm[0], ctm[1], ctm[2], ctm[3],
- (int)floor(xMin - xt),
- (int)floor(yMin - yt),
- (int)ceil(xMax) - (int)floor(xMin) + 3,
- (int)ceil(yMax) - (int)floor(yMin) + 3,
- validBBox,
- colorMode != splashModeMono1);
- }
- }
- t3Font = t3FontCache[0];
-
- // is the glyph in the cache?
- i = (code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
- for (j = 0; j < t3Font->cacheAssoc; ++j) {
- if (t3Font->cacheTags != NULL) {
- if ((t3Font->cacheTags[i+j].mru & 0x8000) &&
- t3Font->cacheTags[i+j].code == code) {
- drawType3Glyph(t3Font, &t3Font->cacheTags[i+j],
- t3Font->cacheData + (i+j) * t3Font->glyphSize);
- return gTrue;
- }
- }
- }
-
- // push a new Type 3 glyph record
- t3gs = new T3GlyphStack();
- t3gs->next = t3GlyphStack;
- t3GlyphStack = t3gs;
- t3GlyphStack->code = code;
- t3GlyphStack->cache = t3Font;
- t3GlyphStack->cacheTag = NULL;
- t3GlyphStack->cacheData = NULL;
-
- return gFalse;
-}
-
-void SplashOutputDev::endType3Char(GfxState *state) {
- T3GlyphStack *t3gs;
- double *ctm;
-
- if (t3GlyphStack->cacheTag) {
- memcpy(t3GlyphStack->cacheData, bitmap->getDataPtr(),
- t3GlyphStack->cache->glyphSize);
- delete bitmap;
- delete splash;
- bitmap = t3GlyphStack->origBitmap;
- splash = t3GlyphStack->origSplash;
- ctm = state->getCTM();
- state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
- t3GlyphStack->origCTM4, t3GlyphStack->origCTM5);
- updateCTM(state, 0, 0, 0, 0, 0, 0);
- drawType3Glyph(t3GlyphStack->cache,
- t3GlyphStack->cacheTag, t3GlyphStack->cacheData);
- }
- t3gs = t3GlyphStack;
- t3GlyphStack = t3gs->next;
- delete t3gs;
-}
-
-void SplashOutputDev::type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) {
-}
-
-void SplashOutputDev::type3D1(GfxState *state, double /*wx*/, double /*wy*/,
- double llx, double lly, double urx, double ury) {
- double *ctm;
- T3FontCache *t3Font;
- SplashColor color;
- double xt, yt, xMin, xMax, yMin, yMax, x1, y1;
- int i, j;
-
- t3Font = t3GlyphStack->cache;
-
- // check for a valid bbox
- state->transform(0, 0, &xt, &yt);
- state->transform(llx, lly, &x1, &y1);
- xMin = xMax = x1;
- yMin = yMax = y1;
- state->transform(llx, ury, &x1, &y1);
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- state->transform(urx, lly, &x1, &y1);
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- state->transform(urx, ury, &x1, &y1);
- if (x1 < xMin) {
- xMin = x1;
- } else if (x1 > xMax) {
- xMax = x1;
- }
- if (y1 < yMin) {
- yMin = y1;
- } else if (y1 > yMax) {
- yMax = y1;
- }
- if (xMin - xt < t3Font->glyphX ||
- yMin - yt < t3Font->glyphY ||
- xMax - xt > t3Font->glyphX + t3Font->glyphW ||
- yMax - yt > t3Font->glyphY + t3Font->glyphH) {
- if (t3Font->validBBox) {
- error(-1, "Bad bounding box in Type 3 glyph");
- }
- return;
- }
-
- // allocate a cache entry
- i = (t3GlyphStack->code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
- for (j = 0; j < t3Font->cacheAssoc; ++j) {
- if ((t3Font->cacheTags[i+j].mru & 0x7fff) == t3Font->cacheAssoc - 1) {
- t3Font->cacheTags[i+j].mru = 0x8000;
- t3Font->cacheTags[i+j].code = t3GlyphStack->code;
- t3GlyphStack->cacheTag = &t3Font->cacheTags[i+j];
- t3GlyphStack->cacheData = t3Font->cacheData + (i+j) * t3Font->glyphSize;
- } else {
- ++t3Font->cacheTags[i+j].mru;
- }
- }
-
- // save state
- t3GlyphStack->origBitmap = bitmap;
- t3GlyphStack->origSplash = splash;
- ctm = state->getCTM();
- t3GlyphStack->origCTM4 = ctm[4];
- t3GlyphStack->origCTM5 = ctm[5];
-
- // create the temporary bitmap
- if (colorMode == splashModeMono1) {
- bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
- splashModeMono1, gFalse);
- splash = new Splash(bitmap, gFalse,
- t3GlyphStack->origSplash->getScreen());
- color[0] = 0;
- splash->clear(color);
- color[0] = 1;
- } else {
- bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
- splashModeMono8, gFalse);
- splash = new Splash(bitmap, vectorAntialias,
- t3GlyphStack->origSplash->getScreen());
- color[0] = 0x00;
- splash->clear(color);
- color[0] = 0xff;
- }
- splash->setFillPattern(new SplashSolidColor(color));
- splash->setStrokePattern(new SplashSolidColor(color));
- //~ this should copy other state from t3GlyphStack->origSplash?
- state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
- -t3Font->glyphX, -t3Font->glyphY);
- updateCTM(state, 0, 0, 0, 0, 0, 0);
-}
-
-void SplashOutputDev::drawType3Glyph(T3FontCache *t3Font,
- T3FontCacheTag * /*tag*/, Guchar *data) {
- SplashGlyphBitmap glyph;
-
- glyph.x = -t3Font->glyphX;
- glyph.y = -t3Font->glyphY;
- glyph.w = t3Font->glyphW;
- glyph.h = t3Font->glyphH;
- glyph.aa = colorMode != splashModeMono1;
- glyph.data = data;
- glyph.freeData = gFalse;
- splash->fillGlyph(0, 0, &glyph);
-}
-
-void SplashOutputDev::endTextObject(GfxState * /*state*/) {
- if (textClipPath) {
- splash->clipToPath(textClipPath, gFalse);
- delete textClipPath;
- textClipPath = NULL;
- }
-}
-
-struct SplashOutImageMaskData {
- ImageStream *imgStr;
- GBool invert;
- int width, height, y;
-};
-
-GBool SplashOutputDev::imageMaskSrc(void *data, SplashColorPtr line) {
- SplashOutImageMaskData *imgMaskData = (SplashOutImageMaskData *)data;
- Guchar *p;
- SplashColorPtr q;
- int x;
-
- if (imgMaskData->y == imgMaskData->height) {
- return gFalse;
- }
- for (x = 0, p = imgMaskData->imgStr->getLine(), q = line;
- x < imgMaskData->width;
- ++x) {
- *q++ = *p++ ^ imgMaskData->invert;
- }
- ++imgMaskData->y;
- return gTrue;
-}
-
-void SplashOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *str,
- int width, int height, GBool invert,
- GBool inlineImg) {
- double *ctm;
- SplashCoord mat[6];
- SplashOutImageMaskData imgMaskData;
-
- if (state->getFillColorSpace()->isNonMarking()) {
- return;
- }
-
- ctm = state->getCTM();
- mat[0] = ctm[0];
- mat[1] = ctm[1];
- mat[2] = -ctm[2];
- mat[3] = -ctm[3];
- mat[4] = ctm[2] + ctm[4];
- mat[5] = ctm[3] + ctm[5];
-
- imgMaskData.imgStr = new ImageStream(str, width, 1, 1);
- imgMaskData.imgStr->reset();
- imgMaskData.invert = invert ? 0 : 1;
- imgMaskData.width = width;
- imgMaskData.height = height;
- imgMaskData.y = 0;
-
- splash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat,
- t3GlyphStack != NULL);
- if (inlineImg) {
- while (imgMaskData.y < height) {
- imgMaskData.imgStr->getLine();
- ++imgMaskData.y;
- }
- }
-
- delete imgMaskData.imgStr;
- str->close();
-}
-
-struct SplashOutImageData {
- ImageStream *imgStr;
- GfxImageColorMap *colorMap;
- SplashColorPtr lookup;
- int *maskColors;
- SplashColorMode colorMode;
- int width, height, y;
-};
-
-GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
- Guchar * /*alphaLine*/) {
- SplashOutImageData *imgData = (SplashOutImageData *)data;
- Guchar *p;
- SplashColorPtr q, col;
- GfxRGB rgb;
- GfxGray gray;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- int nComps, x;
-
- if (imgData->y == imgData->height) {
- return gFalse;
- }
-
- nComps = imgData->colorMap->getNumPixelComps();
-
- if (imgData->lookup) {
- switch (imgData->colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
- x < imgData->width;
- ++x, ++p) {
- *q++ = imgData->lookup[*p];
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
- x < imgData->width;
- ++x, ++p) {
- col = &imgData->lookup[3 * *p];
- *q++ = col[0];
- *q++ = col[1];
- *q++ = col[2];
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
- x < imgData->width;
- ++x, ++p) {
- col = &imgData->lookup[4 * *p];
- *q++ = col[0];
- *q++ = col[1];
- *q++ = col[2];
- *q++ = col[3];
- }
- break;
-#endif
- }
- } else {
- switch (imgData->colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
- x < imgData->width;
- ++x, p += nComps) {
- imgData->colorMap->getGray(p, &gray);
- *q++ = colToByte(gray);
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
- x < imgData->width;
- ++x, p += nComps) {
- imgData->colorMap->getRGB(p, &rgb);
- *q++ = colToByte(rgb.r);
- *q++ = colToByte(rgb.g);
- *q++ = colToByte(rgb.b);
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
- x < imgData->width;
- ++x, p += nComps) {
- imgData->colorMap->getCMYK(p, &cmyk);
- *q++ = colToByte(cmyk.c);
- *q++ = colToByte(cmyk.m);
- *q++ = colToByte(cmyk.y);
- *q++ = colToByte(cmyk.k);
- }
- break;
-#endif
- }
- }
-
- ++imgData->y;
- return gTrue;
-}
-
-GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
- Guchar *alphaLine) {
- SplashOutImageData *imgData = (SplashOutImageData *)data;
- Guchar *p, *aq;
- SplashColorPtr q, col;
- GfxRGB rgb;
- GfxGray gray;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- Guchar alpha;
- int nComps, x, i;
-
- if (imgData->y == imgData->height) {
- return gFalse;
- }
-
- nComps = imgData->colorMap->getNumPixelComps();
-
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine, aq = alphaLine;
- x < imgData->width;
- ++x, p += nComps) {
- alpha = 0;
- for (i = 0; i < nComps; ++i) {
- if (p[i] < imgData->maskColors[2*i] ||
- p[i] > imgData->maskColors[2*i+1]) {
- alpha = 0xff;
- break;
- }
- }
- if (imgData->lookup) {
- switch (imgData->colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- *q++ = imgData->lookup[*p];
- *aq++ = alpha;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- col = &imgData->lookup[3 * *p];
- *q++ = col[0];
- *q++ = col[1];
- *q++ = col[2];
- *aq++ = alpha;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- col = &imgData->lookup[4 * *p];
- *q++ = col[0];
- *q++ = col[1];
- *q++ = col[2];
- *q++ = col[3];
- *aq++ = alpha;
- break;
-#endif
- }
- } else {
- switch (imgData->colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- imgData->colorMap->getGray(p, &gray);
- *q++ = colToByte(gray);
- *aq++ = alpha;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- imgData->colorMap->getRGB(p, &rgb);
- *q++ = colToByte(rgb.r);
- *q++ = colToByte(rgb.g);
- *q++ = colToByte(rgb.b);
- *aq++ = alpha;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- imgData->colorMap->getCMYK(p, &cmyk);
- *q++ = colToByte(cmyk.c);
- *q++ = colToByte(cmyk.m);
- *q++ = colToByte(cmyk.y);
- *q++ = colToByte(cmyk.k);
- *aq++ = alpha;
- break;
-#endif
- }
- }
- }
-
- ++imgData->y;
- return gTrue;
-}
-
-void SplashOutputDev::drawImage(GfxState *state, Object * /*ref*/, Stream *str,
- int width, int height,
- GfxImageColorMap *colorMap,
- int *maskColors, GBool inlineImg) {
- double *ctm;
- SplashCoord mat[6];
- SplashOutImageData imgData;
- SplashColorMode srcMode;
- SplashImageSource src;
- GfxGray gray;
- GfxRGB rgb;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- Guchar pix;
- int n, i;
-
- ctm = state->getCTM();
- mat[0] = ctm[0];
- mat[1] = ctm[1];
- mat[2] = -ctm[2];
- mat[3] = -ctm[3];
- mat[4] = ctm[2] + ctm[4];
- mat[5] = ctm[3] + ctm[5];
-
- imgData.imgStr = new ImageStream(str, width,
- colorMap->getNumPixelComps(),
- colorMap->getBits());
- imgData.imgStr->reset();
- imgData.colorMap = colorMap;
- imgData.maskColors = maskColors;
- imgData.colorMode = colorMode;
- imgData.width = width;
- imgData.height = height;
- imgData.y = 0;
-
- // special case for one-channel (monochrome/gray/separation) images:
- // build a lookup table here
- imgData.lookup = NULL;
- if (colorMap->getNumPixelComps() == 1) {
- n = 1 << colorMap->getBits();
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- imgData.lookup = (SplashColorPtr)gmalloc(n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getGray(&pix, &gray);
- imgData.lookup[i] = colToByte(gray);
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getRGB(&pix, &rgb);
- imgData.lookup[3*i] = colToByte(rgb.r);
- imgData.lookup[3*i+1] = colToByte(rgb.g);
- imgData.lookup[3*i+2] = colToByte(rgb.b);
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getCMYK(&pix, &cmyk);
- imgData.lookup[4*i] = colToByte(cmyk.c);
- imgData.lookup[4*i+1] = colToByte(cmyk.m);
- imgData.lookup[4*i+2] = colToByte(cmyk.y);
- imgData.lookup[4*i+3] = colToByte(cmyk.k);
- }
- break;
-#endif
- break;
- }
- }
-
- if (colorMode == splashModeMono1) {
- srcMode = splashModeMono8;
- } else {
- srcMode = colorMode;
- }
- src = maskColors ? &alphaImageSrc : &imageSrc;
- splash->drawImage(src, &imgData, srcMode, maskColors ? gTrue : gFalse,
- width, height, mat);
- if (inlineImg) {
- while (imgData.y < height) {
- imgData.imgStr->getLine();
- ++imgData.y;
- }
- }
-
- gfree(imgData.lookup);
- delete imgData.imgStr;
- str->close();
-}
-
-struct SplashOutMaskedImageData {
- ImageStream *imgStr;
- GfxImageColorMap *colorMap;
- SplashBitmap *mask;
- SplashColorPtr lookup;
- SplashColorMode colorMode;
- int width, height, y;
-};
-
-GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
- Guchar *alphaLine) {
- SplashOutMaskedImageData *imgData = (SplashOutMaskedImageData *)data;
- Guchar *p, *aq;
- SplashColor maskColor;
- SplashColorPtr q, col;
- GfxRGB rgb;
- GfxGray gray;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- Guchar alpha;
- int nComps, x;
-
- if (imgData->y == imgData->height) {
- return gFalse;
- }
-
- nComps = imgData->colorMap->getNumPixelComps();
-
- for (x = 0, p = imgData->imgStr->getLine(), q = colorLine, aq = alphaLine;
- x < imgData->width;
- ++x, p += nComps) {
- imgData->mask->getPixel(x, imgData->y, maskColor);
- alpha = maskColor[0] ? 0xff : 0x00;
- if (imgData->lookup) {
- switch (imgData->colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- *q++ = imgData->lookup[*p];
- *aq++ = alpha;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- col = &imgData->lookup[3 * *p];
- *q++ = col[0];
- *q++ = col[1];
- *q++ = col[2];
- *aq++ = alpha;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- col = &imgData->lookup[4 * *p];
- *q++ = col[0];
- *q++ = col[1];
- *q++ = col[2];
- *q++ = col[3];
- *aq++ = alpha;
- break;
-#endif
- }
- } else {
- switch (imgData->colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- imgData->colorMap->getGray(p, &gray);
- *q++ = colToByte(gray);
- *aq++ = alpha;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- imgData->colorMap->getRGB(p, &rgb);
- *q++ = colToByte(rgb.r);
- *q++ = colToByte(rgb.g);
- *q++ = colToByte(rgb.b);
- *aq++ = alpha;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- imgData->colorMap->getCMYK(p, &cmyk);
- *q++ = colToByte(cmyk.c);
- *q++ = colToByte(cmyk.m);
- *q++ = colToByte(cmyk.y);
- *q++ = colToByte(cmyk.k);
- *aq++ = alpha;
- break;
-#endif
- }
- }
- }
-
- ++imgData->y;
- return gTrue;
-}
-
-void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
- Stream *str, int width, int height,
- GfxImageColorMap *colorMap,
- Stream *maskStr, int maskWidth,
- int maskHeight, GBool maskInvert) {
- GfxImageColorMap *maskColorMap;
- Object maskDecode, decodeLow, decodeHigh;
- double *ctm;
- SplashCoord mat[6];
- SplashOutMaskedImageData imgData;
- SplashOutImageMaskData imgMaskData;
- SplashColorMode srcMode;
- SplashBitmap *maskBitmap;
- Splash *maskSplash;
- SplashColor maskColor;
- GfxGray gray;
- GfxRGB rgb;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- Guchar pix;
- int n, i;
-
- // If the mask is higher resolution than the image, use
- // drawSoftMaskedImage() instead.
- if (maskWidth > width || maskHeight > height) {
- decodeLow.initInt(maskInvert ? 0 : 1);
- decodeHigh.initInt(maskInvert ? 1 : 0);
- maskDecode.initArray(xref);
- maskDecode.arrayAdd(&decodeLow);
- maskDecode.arrayAdd(&decodeHigh);
- maskColorMap = new GfxImageColorMap(1, &maskDecode,
- new GfxDeviceGrayColorSpace());
- maskDecode.free();
- drawSoftMaskedImage(state, ref, str, width, height, colorMap,
- maskStr, maskWidth, maskHeight, maskColorMap);
- delete maskColorMap;
-
- } else {
-
- //----- scale the mask image to the same size as the source image
-
- mat[0] = (SplashCoord)width;
- mat[1] = 0;
- mat[2] = 0;
- mat[3] = (SplashCoord)height;
- mat[4] = 0;
- mat[5] = 0;
- imgMaskData.imgStr = new ImageStream(maskStr, maskWidth, 1, 1);
- imgMaskData.imgStr->reset();
- imgMaskData.invert = maskInvert ? 0 : 1;
- imgMaskData.width = maskWidth;
- imgMaskData.height = maskHeight;
- imgMaskData.y = 0;
- maskBitmap = new SplashBitmap(width, height, 1, splashModeMono1, gFalse);
- maskSplash = new Splash(maskBitmap, gFalse);
- maskColor[0] = 0;
- maskSplash->clear(maskColor);
- maskColor[0] = 0xff;
- maskSplash->setFillPattern(new SplashSolidColor(maskColor));
- maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData,
- maskWidth, maskHeight, mat, gFalse);
- delete imgMaskData.imgStr;
- maskStr->close();
- delete maskSplash;
-
- //----- draw the source image
-
- ctm = state->getCTM();
- mat[0] = ctm[0];
- mat[1] = ctm[1];
- mat[2] = -ctm[2];
- mat[3] = -ctm[3];
- mat[4] = ctm[2] + ctm[4];
- mat[5] = ctm[3] + ctm[5];
-
- imgData.imgStr = new ImageStream(str, width,
- colorMap->getNumPixelComps(),
- colorMap->getBits());
- imgData.imgStr->reset();
- imgData.colorMap = colorMap;
- imgData.mask = maskBitmap;
- imgData.colorMode = colorMode;
- imgData.width = width;
- imgData.height = height;
- imgData.y = 0;
-
- // special case for one-channel (monochrome/gray/separation) images:
- // build a lookup table here
- imgData.lookup = NULL;
- if (colorMap->getNumPixelComps() == 1) {
- n = 1 << colorMap->getBits();
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- imgData.lookup = (SplashColorPtr)gmalloc(n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getGray(&pix, &gray);
- imgData.lookup[i] = colToByte(gray);
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getRGB(&pix, &rgb);
- imgData.lookup[3*i] = colToByte(rgb.r);
- imgData.lookup[3*i+1] = colToByte(rgb.g);
- imgData.lookup[3*i+2] = colToByte(rgb.b);
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getCMYK(&pix, &cmyk);
- imgData.lookup[4*i] = colToByte(cmyk.c);
- imgData.lookup[4*i+1] = colToByte(cmyk.m);
- imgData.lookup[4*i+2] = colToByte(cmyk.y);
- imgData.lookup[4*i+3] = colToByte(cmyk.k);
- }
- break;
-#endif
- }
- }
-
- if (colorMode == splashModeMono1) {
- srcMode = splashModeMono8;
- } else {
- srcMode = colorMode;
- }
- splash->drawImage(&maskedImageSrc, &imgData, srcMode, gTrue,
- width, height, mat);
-
- delete maskBitmap;
- gfree(imgData.lookup);
- delete imgData.imgStr;
- str->close();
- }
-}
-
-void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object * /*ref*/,
- Stream *str, int width, int height,
- GfxImageColorMap *colorMap,
- Stream *maskStr,
- int maskWidth, int maskHeight,
- GfxImageColorMap *maskColorMap) {
- double *ctm;
- SplashCoord mat[6];
- SplashOutImageData imgData;
- SplashOutImageData imgMaskData;
- SplashColorMode srcMode;
- SplashBitmap *maskBitmap;
- Splash *maskSplash;
- SplashColor maskColor;
- GfxGray gray;
- GfxRGB rgb;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- Guchar pix;
- int n, i;
-
- ctm = state->getCTM();
- mat[0] = ctm[0];
- mat[1] = ctm[1];
- mat[2] = -ctm[2];
- mat[3] = -ctm[3];
- mat[4] = ctm[2] + ctm[4];
- mat[5] = ctm[3] + ctm[5];
-
- //----- set up the soft mask
-
- imgMaskData.imgStr = new ImageStream(maskStr, maskWidth,
- maskColorMap->getNumPixelComps(),
- maskColorMap->getBits());
- imgMaskData.imgStr->reset();
- imgMaskData.colorMap = maskColorMap;
- imgMaskData.maskColors = NULL;
- imgMaskData.colorMode = splashModeMono8;
- imgMaskData.width = maskWidth;
- imgMaskData.height = maskHeight;
- imgMaskData.y = 0;
- n = 1 << maskColorMap->getBits();
- imgMaskData.lookup = (SplashColorPtr)gmalloc(n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- maskColorMap->getGray(&pix, &gray);
- imgMaskData.lookup[i] = colToByte(gray);
- }
- maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
- 1, splashModeMono8, gFalse);
- maskSplash = new Splash(maskBitmap, vectorAntialias);
- maskColor[0] = 0;
- maskSplash->clear(maskColor);
- maskSplash->drawImage(&imageSrc, &imgMaskData, splashModeMono8, gFalse,
- maskWidth, maskHeight, mat);
- delete imgMaskData.imgStr;
- maskStr->close();
- gfree(imgMaskData.lookup);
- delete maskSplash;
- splash->setSoftMask(maskBitmap);
-
- //----- draw the source image
-
- imgData.imgStr = new ImageStream(str, width,
- colorMap->getNumPixelComps(),
- colorMap->getBits());
- imgData.imgStr->reset();
- imgData.colorMap = colorMap;
- imgData.maskColors = NULL;
- imgData.colorMode = colorMode;
- imgData.width = width;
- imgData.height = height;
- imgData.y = 0;
-
- // special case for one-channel (monochrome/gray/separation) images:
- // build a lookup table here
- imgData.lookup = NULL;
- if (colorMap->getNumPixelComps() == 1) {
- n = 1 << colorMap->getBits();
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- imgData.lookup = (SplashColorPtr)gmalloc(n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getGray(&pix, &gray);
- imgData.lookup[i] = colToByte(gray);
- }
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getRGB(&pix, &rgb);
- imgData.lookup[3*i] = colToByte(rgb.r);
- imgData.lookup[3*i+1] = colToByte(rgb.g);
- imgData.lookup[3*i+2] = colToByte(rgb.b);
- }
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
- for (i = 0; i < n; ++i) {
- pix = (Guchar)i;
- colorMap->getCMYK(&pix, &cmyk);
- imgData.lookup[4*i] = colToByte(cmyk.c);
- imgData.lookup[4*i+1] = colToByte(cmyk.m);
- imgData.lookup[4*i+2] = colToByte(cmyk.y);
- imgData.lookup[4*i+3] = colToByte(cmyk.k);
- }
- break;
-#endif
- }
- }
-
- if (colorMode == splashModeMono1) {
- srcMode = splashModeMono8;
- } else {
- srcMode = colorMode;
- }
- splash->drawImage(&imageSrc, &imgData, srcMode, gFalse, width, height, mat);
-
- splash->setSoftMask(NULL);
- gfree(imgData.lookup);
- delete imgData.imgStr;
- str->close();
-}
-
-void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
- GfxColorSpace *blendingColorSpace,
- GBool isolated, GBool /*knockout*/,
- GBool /*forSoftMask*/) {
- SplashTransparencyGroup *transpGroup;
- SplashColor color;
- double xMin, yMin, xMax, yMax, x, y;
- int tx, ty, w, h;
-
- // transform the bbox
- state->transform(bbox[0], bbox[1], &x, &y);
- xMin = xMax = x;
- yMin = yMax = y;
- state->transform(bbox[0], bbox[3], &x, &y);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- state->transform(bbox[2], bbox[1], &x, &y);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- state->transform(bbox[2], bbox[3], &x, &y);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- tx = (int)floor(xMin);
- if (tx < 0) {
- tx = 0;
- } else if (tx > bitmap->getWidth()) {
- tx = bitmap->getWidth();
- }
- ty = (int)floor(yMin);
- if (ty < 0) {
- ty = 0;
- } else if (ty > bitmap->getHeight()) {
- ty = bitmap->getHeight();
- }
- w = (int)ceil(xMax) - tx + 1;
- if (tx + w > bitmap->getWidth()) {
- w = bitmap->getWidth() - tx;
- }
- if (w < 1) {
- w = 1;
- }
- h = (int)ceil(yMax) - ty + 1;
- if (ty + h > bitmap->getHeight()) {
- h = bitmap->getHeight() - ty;
- }
- if (h < 1) {
- h = 1;
- }
-
- // push a new stack entry
- transpGroup = new SplashTransparencyGroup();
- transpGroup->tx = tx;
- transpGroup->ty = ty;
- transpGroup->blendingColorSpace = blendingColorSpace;
- transpGroup->isolated = isolated;
- transpGroup->next = transpGroupStack;
- transpGroupStack = transpGroup;
-
- // save state
- transpGroup->origBitmap = bitmap;
- transpGroup->origSplash = splash;
-
- //~ this ignores the blendingColorSpace arg
-
- // create the temporary bitmap
- bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, gTrue,
- bitmapTopDown);
- splash = new Splash(bitmap, vectorAntialias,
- transpGroup->origSplash->getScreen());
- if (isolated) {
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- color[0] = 0;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- color[0] = color[1] = color[2] = 0;
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- color[0] = color[1] = color[2] = color[3] = 0;
- break;
-#endif
- default:
- // make gcc happy
- break;
- }
- splash->clear(color, 0);
- } else {
- splash->blitTransparent(transpGroup->origBitmap, tx, ty, 0, 0, w, h);
- splash->setInNonIsolatedGroup(transpGroup->origBitmap, tx, ty);
- }
- transpGroup->tBitmap = bitmap;
- state->shiftCTM(-tx, -ty);
- updateCTM(state, 0, 0, 0, 0, 0, 0);
-}
-
-void SplashOutputDev::endTransparencyGroup(GfxState *state) {
- double *ctm;
-
- // restore state
- delete splash;
- bitmap = transpGroupStack->origBitmap;
- splash = transpGroupStack->origSplash;
- ctm = state->getCTM();
- state->shiftCTM(transpGroupStack->tx, transpGroupStack->ty);
- updateCTM(state, 0, 0, 0, 0, 0, 0);
-}
-
-void SplashOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) {
- SplashBitmap *tBitmap;
- SplashTransparencyGroup *transpGroup;
- GBool isolated;
- int tx, ty;
-
- tx = transpGroupStack->tx;
- ty = transpGroupStack->ty;
- tBitmap = transpGroupStack->tBitmap;
- isolated = transpGroupStack->isolated;
-
- // paint the transparency group onto the parent bitmap
- // - the clip path was set in the parent's state)
- splash->composite(tBitmap, 0, 0, tx, ty,
- tBitmap->getWidth(), tBitmap->getHeight(),
- gFalse, !isolated);
-
- // pop the stack
- transpGroup = transpGroupStack;
- transpGroupStack = transpGroup->next;
- delete transpGroup;
-
- delete tBitmap;
-}
-
-void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/,
- GBool alpha, Function *transferFunc,
- GfxColor *backdropColor) {
- SplashBitmap *softMask, *tBitmap;
- Splash *tSplash;
- SplashTransparencyGroup *transpGroup;
- SplashColor color;
- SplashColorPtr p;
- GfxGray gray;
- GfxRGB rgb;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
- double lum, lum2;
- int tx, ty, x, y;
-
- tx = transpGroupStack->tx;
- ty = transpGroupStack->ty;
- tBitmap = transpGroupStack->tBitmap;
-
- // composite with backdrop color
- if (!alpha && colorMode != splashModeMono1) {
- //~ need to correctly handle the case where no blending color
- //~ space is given
- tSplash = new Splash(tBitmap, vectorAntialias,
- transpGroupStack->origSplash->getScreen());
- if (transpGroupStack->blendingColorSpace) {
- switch (colorMode) {
- case splashModeMono1:
- // transparency is not supported in mono1 mode
- break;
- case splashModeMono8:
- transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray);
- color[0] = colToByte(gray);
- tSplash->compositeBackground(color);
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- transpGroupStack->blendingColorSpace->getRGB(backdropColor, &rgb);
- color[0] = colToByte(rgb.r);
- color[1] = colToByte(rgb.g);
- color[2] = colToByte(rgb.b);
- tSplash->compositeBackground(color);
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- transpGroupStack->blendingColorSpace->getCMYK(backdropColor, &cmyk);
- color[0] = colToByte(cmyk.c);
- color[1] = colToByte(cmyk.m);
- color[2] = colToByte(cmyk.y);
- color[3] = colToByte(cmyk.k);
- tSplash->compositeBackground(color);
- break;
-#endif
- }
- delete tSplash;
- }
- }
-
- softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
- 1, splashModeMono8, gFalse);
- memset(softMask->getDataPtr(), 0,
- softMask->getRowSize() * softMask->getHeight());
- p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx;
- int xMax = tBitmap->getWidth();
- int yMax = tBitmap->getHeight();
- if (xMax + tx > bitmap->getWidth()) xMax = bitmap->getWidth() - tx;
- if (yMax + ty > bitmap->getHeight()) yMax = bitmap->getHeight() - ty;
- for (y = 0; y < yMax; ++y) {
- for (x = 0; x < xMax; ++x) {
- tBitmap->getPixel(x, y, color);
- if (alpha) {
- //~ unimplemented
- } else {
- // convert to luminosity
- switch (colorMode) {
- case splashModeMono1:
- case splashModeMono8:
- lum = color[0] / 255.0;
- break;
- case splashModeRGB8:
- case splashModeBGR8:
- lum = (0.3 / 255.0) * color[0] +
- (0.59 / 255.0) * color[1] +
- (0.11 / 255.0) * color[2];
- break;
-#if SPLASH_CMYK
- case splashModeCMYK8:
- lum = (1 - color[3] / 255.0)
- - (0.3 / 255.0) * color[0]
- - (0.59 / 255.0) * color[1]
- - (0.11 / 255.0) * color[2];
- if (lum < 0) {
- lum = 0;
- }
- break;
-#endif
- }
- if (transferFunc) {
- transferFunc->transform(&lum, &lum2);
- } else {
- lum2 = lum;
- }
- p[x] = (int)(lum2 * 255.0 + 0.5);
- }
- }
- p += softMask->getRowSize();
- }
- splash->setSoftMask(softMask);
-
- // pop the stack
- transpGroup = transpGroupStack;
- transpGroupStack = transpGroup->next;
- delete transpGroup;
-
- delete tBitmap;
-}
-
-void SplashOutputDev::clearSoftMask(GfxState * /*state*/) {
- splash->setSoftMask(NULL);
-}
-
-void SplashOutputDev::setPaperColor(SplashColorPtr paperColorA) {
- splashColorCopy(paperColor, paperColorA);
-}
-
-int SplashOutputDev::getBitmapWidth() {
- return bitmap->getWidth();
-}
-
-int SplashOutputDev::getBitmapHeight() {
- return bitmap->getHeight();
-}
-
-SplashBitmap *SplashOutputDev::takeBitmap() {
- SplashBitmap *ret;
-
- ret = bitmap;
- bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode,
- colorMode != splashModeMono1, bitmapTopDown);
- return ret;
-}
-
-void SplashOutputDev::getModRegion(int *xMin, int *yMin,
- int *xMax, int *yMax) {
- splash->getModRegion(xMin, yMin, xMax, yMax);
-}
-
-void SplashOutputDev::clearModRegion() {
- splash->clearModRegion();
-}
-
-void SplashOutputDev::setFillColor(int r, int g, int b) {
- GfxRGB rgb;
- GfxGray gray;
-#if SPLASH_CMYK
- GfxCMYK cmyk;
-#endif
-
- rgb.r = byteToCol(r);
- rgb.g = byteToCol(g);
- rgb.b = byteToCol(b);
- gray = (GfxColorComp)(0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b + 0.5);
- if (gray > gfxColorComp1) {
- gray = gfxColorComp1;
- }
-#if SPLASH_CMYK
- cmyk.c = gfxColorComp1 - rgb.r;
- cmyk.m = gfxColorComp1 - rgb.g;
- cmyk.y = gfxColorComp1 - rgb.b;
- cmyk.k = 0;
- splash->setFillPattern(getColor(gray, &rgb, &cmyk));
-#else
- splash->setFillPattern(getColor(gray, &rgb));
-#endif
-}
-
-SplashFont *SplashOutputDev::getFont(GString *name, double *textMatA) {
- DisplayFontParam *dfp;
- Ref ref;
- SplashOutFontFileID *id;
- SplashFontFile *fontFile;
- SplashFont *fontObj;
- FoFiTrueType *ff;
- Gushort *codeToGID;
- Unicode u;
- SplashCoord textMat[4];
- int cmap, i;
-
- for (i = 0; i < 16; ++i) {
- if (!name->cmp(splashOutSubstFonts[i].name)) {
- break;
- }
- }
- if (i == 16) {
- return NULL;
- }
- ref.num = i;
- ref.gen = -1;
- id = new SplashOutFontFileID(&ref);
-
- // check the font file cache
- if ((fontFile = fontEngine->getFontFile(id))) {
- delete id;
-
- // load the font file
- } else {
- dfp = globalParams->getDisplayFont(name);
- if (dfp && dfp->kind == displayFontT1) {
- SplashFontSrc *fontsrc = new SplashFontSrc;
- fontsrc->setFile(dfp->t1.fileName, gFalse);
- fontFile = fontEngine->loadType1Font(id, fontsrc, winAnsiEncoding);
- } else if (dfp && dfp->kind == displayFontTT) {
- if (!(ff = FoFiTrueType::load(dfp->tt.fileName->getCString()))) {
- return NULL;
- }
- for (cmap = 0; cmap < ff->getNumCmaps(); ++cmap) {
- if ((ff->getCmapPlatform(cmap) == 3 &&
- ff->getCmapEncoding(cmap) == 1) ||
- ff->getCmapPlatform(cmap) == 0) {
- break;
- }
- }
- if (cmap == ff->getNumCmaps()) {
- delete ff;
- return NULL;
- }
- codeToGID = (Gushort *)gmallocn(256, sizeof(Gushort));
- for (i = 0; i < 256; ++i) {
- codeToGID[i] = 0;
- if (winAnsiEncoding[i] &&
- (u = globalParams->mapNameToUnicode(winAnsiEncoding[i]))) {
- codeToGID[i] = ff->mapCodeToGID(cmap, u);
- }
- }
- delete ff;
- SplashFontSrc *fontsrc = new SplashFontSrc;
- fontsrc->setFile(dfp->tt.fileName->getCString(), gFalse);
- fontFile = fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, 256);
- } else {
- return NULL;
- }
- }
-
- // create the scaled font
- textMat[0] = (SplashCoord)textMatA[0];
- textMat[1] = (SplashCoord)textMatA[1];
- textMat[2] = (SplashCoord)textMatA[2];
- textMat[3] = (SplashCoord)textMatA[3];
- fontObj = fontEngine->getFont(fontFile, textMat, splash->getMatrix());
-
- return fontObj;
-}
-
-#if 1 //~tmp: turn off anti-aliasing temporarily
-GBool SplashOutputDev::getVectorAntialias() {
- return splash->getVectorAntialias();
-}
-
-void SplashOutputDev::setVectorAntialias(GBool vaa) {
- splash->setVectorAntialias(vaa);
-}
-#endif
diff --git a/kpdf/xpdf/xpdf/SplashOutputDev.cpp b/kpdf/xpdf/xpdf/SplashOutputDev.cpp
new file mode 100644
index 00000000..2de19e73
--- /dev/null
+++ b/kpdf/xpdf/xpdf/SplashOutputDev.cpp
@@ -0,0 +1,2851 @@
+//========================================================================
+//
+// SplashOutputDev.cpp
+//
+// Copyright 2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <string.h>
+#include <math.h>
+#include "gfile.h"
+#include "GlobalParams.h"
+#include "Error.h"
+#include "Object.h"
+#include "GfxFont.h"
+#include "Link.h"
+#include "CharCodeToUnicode.h"
+#include "FontEncodingTables.h"
+#include "FoFiTrueType.h"
+#include "SplashBitmap.h"
+#include "SplashGlyphBitmap.h"
+#include "SplashPattern.h"
+#include "SplashScreen.h"
+#include "SplashPath.h"
+#include "SplashState.h"
+#include "SplashErrorCodes.h"
+#include "SplashFontEngine.h"
+#include "SplashFont.h"
+#include "SplashFontFile.h"
+#include "SplashFontFileID.h"
+#include "Splash.h"
+#include "SplashOutputDev.h"
+
+#ifdef VMS
+#if (__VMS_VER < 70000000)
+extern "C" int unlink(char *filename);
+#endif
+#endif
+
+//------------------------------------------------------------------------
+
+// Divide a 16-bit value (in [0, 255*255]) by 255, returning an 8-bit result.
+static inline Guchar div255(int x) {
+ return (Guchar)((x + (x >> 8) + 0x80) >> 8);
+}
+
+//------------------------------------------------------------------------
+// Blend functions
+//------------------------------------------------------------------------
+
+static void splashOutBlendMultiply(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = (dest[i] * src[i]) / 255;
+ }
+}
+
+static void splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = dest[i] + src[i] - (dest[i] * src[i]) / 255;
+ }
+}
+
+static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = dest[i] < 0x80
+ ? (src[i] * 2 * dest[i]) / 255
+ : 255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255;
+ }
+}
+
+static void splashOutBlendDarken(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = dest[i] < src[i] ? dest[i] : src[i];
+ }
+}
+
+static void splashOutBlendLighten(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = dest[i] > src[i] ? dest[i] : src[i];
+ }
+}
+
+static void splashOutBlendColorDodge(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend,
+ SplashColorMode cm) {
+ int i, x;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ if (src[i] == 255) {
+ blend[i] = 255;
+ } else {
+ x = (dest[i] * 255) / (255 - src[i]);
+ blend[i] = x <= 255 ? x : 255;
+ }
+ }
+}
+
+static void splashOutBlendColorBurn(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i, x;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ if (src[i] == 0) {
+ blend[i] = 0;
+ } else {
+ x = ((255 - dest[i]) * 255) / src[i];
+ blend[i] = x <= 255 ? 255 - x : 0;
+ }
+ }
+}
+
+static void splashOutBlendHardLight(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = src[i] < 0x80
+ ? (dest[i] * 2 * src[i]) / 255
+ : 255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255;
+ }
+}
+
+static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i, x;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ if (src[i] < 0x80) {
+ blend[i] = dest[i] - (255 - 2 * src[i]) * dest[i] * (255 - dest[i]) /
+ (255 * 255);
+ } else {
+ if (dest[i] < 0x40) {
+ x = (((((16 * dest[i] - 12 * 255) * dest[i]) / 255)
+ + 4 * 255) * dest[i]) / 255;
+ } else {
+ x = (int)sqrt(255.0 * dest[i]);
+ }
+ blend[i] = dest[i] + (2 * src[i] - 255) * (x - dest[i]) / 255;
+ }
+ }
+}
+
+static void splashOutBlendDifference(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend,
+ SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = dest[i] < src[i] ? src[i] - dest[i] : dest[i] - src[i];
+ }
+}
+
+static void splashOutBlendExclusion(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int i;
+
+ for (i = 0; i < splashColorModeNComps[cm]; ++i) {
+ blend[i] = dest[i] + src[i] - (2 * dest[i] * src[i]) / 255;
+ }
+}
+
+static void cvtRGBToHSV(Guchar r, Guchar g, Guchar b, int *h, int *s, int *v) {
+ int cmax, cmid, cmin, x;
+
+ if (r >= g) {
+ if (g >= b) { x = 0; cmax = r; cmid = g; cmin = b; }
+ else if (b >= r) { x = 4; cmax = b; cmid = r; cmin = g; }
+ else { x = 5; cmax = r; cmid = b; cmin = g; }
+ } else {
+ if (r >= b) { x = 1; cmax = g; cmid = r; cmin = b; }
+ else if (g >= b) { x = 2; cmax = g; cmid = b; cmin = r; }
+ else { x = 3; cmax = b; cmid = g; cmin = r; }
+ }
+ if (cmax == cmin) {
+ *h = *s = 0;
+ } else {
+ *h = x * 60;
+ if (x & 1) {
+ *h += ((cmax - cmid) * 60) / (cmax - cmin);
+ } else {
+ *h += ((cmid - cmin) * 60) / (cmax - cmin);
+ }
+ *s = (255 * (cmax - cmin)) / cmax;
+ }
+ *v = cmax;
+}
+
+static void cvtHSVToRGB(int h, int s, int v, Guchar *r, Guchar *g, Guchar *b) {
+ int x, f, cmax, cmid, cmin;
+
+ if (s == 0) {
+ *r = *g = *b = v;
+ } else {
+ x = h / 60;
+ f = h % 60;
+ cmax = v;
+ if (x & 1) {
+ cmid = div255(v * 255 - ((s * f) / 60));
+ } else {
+ cmid = div255(v * (255 - ((s * (60 - f)) / 60)));
+ }
+ cmin = div255(v * (255 - s));
+ switch (x) {
+ case 0: *r = cmax; *g = cmid; *b = cmin; break;
+ case 1: *g = cmax; *r = cmid; *b = cmin; break;
+ case 2: *g = cmax; *b = cmid; *r = cmin; break;
+ case 3: *b = cmax; *g = cmid; *r = cmin; break;
+ case 4: *b = cmax; *r = cmid; *g = cmin; break;
+ case 5: *r = cmax; *b = cmid; *g = cmin; break;
+ }
+ }
+}
+
+static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int hs, ss, vs, hd, sd, vd;
+#if SPLASH_CMYK
+ Guchar r, g, b;
+#endif
+
+ switch (cm) {
+ case splashModeMono1:
+ case splashModeMono8:
+ blend[0] = dest[0];
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
+ cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
+ cvtHSVToRGB(hs, sd, vd, &blend[0], &blend[1], &blend[2]);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ //~ (0xff - ...) should be clipped
+ cvtRGBToHSV(0xff - (src[0] + src[3]),
+ 0xff - (src[1] + src[3]),
+ 0xff - (src[2] + src[3]), &hs, &ss, &vs);
+ cvtRGBToHSV(0xff - (dest[0] + dest[3]),
+ 0xff - (dest[1] + dest[3]),
+ 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
+ cvtHSVToRGB(hs, sd, vd, &r, &g, &b);
+ //~ should do black generation
+ blend[0] = 0xff - r;
+ blend[1] = 0xff - g;
+ blend[2] = 0xff - b;
+ blend[3] = 0;
+ break;
+#endif
+ }
+}
+
+static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend,
+ SplashColorMode cm) {
+ int hs, ss, vs, hd, sd, vd;
+#if SPLASH_CMYK
+ Guchar r, g, b;
+#endif
+
+ switch (cm) {
+ case splashModeMono1:
+ case splashModeMono8:
+ blend[0] = dest[0];
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
+ cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
+ cvtHSVToRGB(hd, ss, vd, &blend[0], &blend[1], &blend[2]);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ //~ (0xff - ...) should be clipped
+ cvtRGBToHSV(0xff - (src[0] + src[3]),
+ 0xff - (src[1] + src[3]),
+ 0xff - (src[2] + src[3]), &hs, &ss, &vs);
+ cvtRGBToHSV(0xff - (dest[0] + dest[3]),
+ 0xff - (dest[1] + dest[3]),
+ 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
+ cvtHSVToRGB(hd, ss, vd, &r, &g, &b);
+ //~ should do black generation
+ blend[0] = 0xff - r;
+ blend[1] = 0xff - g;
+ blend[2] = 0xff - b;
+ blend[3] = 0;
+ break;
+#endif
+ }
+}
+
+static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend, SplashColorMode cm) {
+ int hs, ss, vs, hd, sd, vd;
+#if SPLASH_CMYK
+ Guchar r, g, b;
+#endif
+
+ switch (cm) {
+ case splashModeMono1:
+ case splashModeMono8:
+ blend[0] = dest[0];
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
+ cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
+ cvtHSVToRGB(hs, ss, vd, &blend[0], &blend[1], &blend[2]);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ //~ (0xff - ...) should be clipped
+ cvtRGBToHSV(0xff - (src[0] + src[3]),
+ 0xff - (src[1] + src[3]),
+ 0xff - (src[2] + src[3]), &hs, &ss, &vs);
+ cvtRGBToHSV(0xff - (dest[0] + dest[3]),
+ 0xff - (dest[1] + dest[3]),
+ 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
+ cvtHSVToRGB(hs, ss, vd, &r, &g, &b);
+ //~ should do black generation
+ blend[0] = 0xff - r;
+ blend[1] = 0xff - g;
+ blend[2] = 0xff - b;
+ blend[3] = 0;
+ break;
+#endif
+ }
+}
+
+static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
+ SplashColorPtr blend,
+ SplashColorMode cm) {
+ int hs, ss, vs, hd, sd, vd;
+#if SPLASH_CMYK
+ Guchar r, g, b;
+#endif
+
+ switch (cm) {
+ case splashModeMono1:
+ case splashModeMono8:
+ blend[0] = dest[0];
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ cvtRGBToHSV(src[0], src[1], src[2], &hs, &ss, &vs);
+ cvtRGBToHSV(dest[0], dest[1], dest[2], &hd, &sd, &vd);
+ cvtHSVToRGB(hd, sd, vs, &blend[0], &blend[1], &blend[2]);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ //~ (0xff - ...) should be clipped
+ cvtRGBToHSV(0xff - (src[0] + src[3]),
+ 0xff - (src[1] + src[3]),
+ 0xff - (src[2] + src[3]), &hs, &ss, &vs);
+ cvtRGBToHSV(0xff - (dest[0] + dest[3]),
+ 0xff - (dest[1] + dest[3]),
+ 0xff - (dest[2] + dest[3]), &hd, &sd, &vd);
+ cvtHSVToRGB(hd, sd, vs, &r, &g, &b);
+ //~ should do black generation
+ blend[0] = 0xff - r;
+ blend[1] = 0xff - g;
+ blend[2] = 0xff - b;
+ blend[3] = 0;
+ break;
+#endif
+ }
+}
+
+// NB: This must match the GfxBlendMode enum defined in GfxState.h.
+SplashBlendFunc splashOutBlendFuncs[] = {
+ NULL,
+ &splashOutBlendMultiply,
+ &splashOutBlendScreen,
+ &splashOutBlendOverlay,
+ &splashOutBlendDarken,
+ &splashOutBlendLighten,
+ &splashOutBlendColorDodge,
+ &splashOutBlendColorBurn,
+ &splashOutBlendHardLight,
+ &splashOutBlendSoftLight,
+ &splashOutBlendDifference,
+ &splashOutBlendExclusion,
+ &splashOutBlendHue,
+ &splashOutBlendSaturation,
+ &splashOutBlendColor,
+ &splashOutBlendLuminosity
+};
+
+//------------------------------------------------------------------------
+// Font substitutions
+//------------------------------------------------------------------------
+
+struct SplashOutFontSubst {
+ char *name;
+ double mWidth;
+};
+
+// index: {symbolic:12, fixed:8, serif:4, sans-serif:0} + bold*2 + italic
+static SplashOutFontSubst splashOutSubstFonts[16] = {
+ {"Helvetica", 0.833},
+ {"Helvetica-Oblique", 0.833},
+ {"Helvetica-Bold", 0.889},
+ {"Helvetica-BoldOblique", 0.889},
+ {"Times-Roman", 0.788},
+ {"Times-Italic", 0.722},
+ {"Times-Bold", 0.833},
+ {"Times-BoldItalic", 0.778},
+ {"Courier", 0.600},
+ {"Courier-Oblique", 0.600},
+ {"Courier-Bold", 0.600},
+ {"Courier-BoldOblique", 0.600},
+ {"Symbol", 0.576},
+ {"Symbol", 0.576},
+ {"Symbol", 0.576},
+ {"Symbol", 0.576}
+};
+
+//------------------------------------------------------------------------
+// SplashOutFontFileID
+//------------------------------------------------------------------------
+
+class SplashOutFontFileID: public SplashFontFileID {
+public:
+
+ SplashOutFontFileID(Ref *rA) { r = *rA; substIdx = -1; }
+
+ ~SplashOutFontFileID() {}
+
+ GBool matches(SplashFontFileID *id) {
+ return ((SplashOutFontFileID *)id)->r.num == r.num &&
+ ((SplashOutFontFileID *)id)->r.gen == r.gen;
+ }
+
+ void setSubstIdx(int substIdxA) { substIdx = substIdxA; }
+ int getSubstIdx() { return substIdx; }
+
+private:
+
+ Ref r;
+ int substIdx;
+};
+
+//------------------------------------------------------------------------
+// T3FontCache
+//------------------------------------------------------------------------
+
+struct T3FontCacheTag {
+ Gushort code;
+ Gushort mru; // valid bit (0x8000) and MRU index
+};
+
+class T3FontCache {
+public:
+
+ T3FontCache(Ref *fontID, double m11A, double m12A,
+ double m21A, double m22A,
+ int glyphXA, int glyphYA, int glyphWA, int glyphHA,
+ GBool aa, GBool validBBoxA);
+ ~T3FontCache();
+ GBool matches(Ref *idA, double m11A, double m12A,
+ double m21A, double m22A)
+ { return fontID.num == idA->num && fontID.gen == idA->gen &&
+ m11 == m11A && m12 == m12A && m21 == m21A && m22 == m22A; }
+
+ Ref fontID; // PDF font ID
+ double m11, m12, m21, m22; // transform matrix
+ int glyphX, glyphY; // pixel offset of glyph bitmaps
+ int glyphW, glyphH; // size of glyph bitmaps, in pixels
+ GBool validBBox; // false if the bbox was [0 0 0 0]
+ int glyphSize; // size of glyph bitmaps, in bytes
+ int cacheSets; // number of sets in cache
+ int cacheAssoc; // cache associativity (glyphs per set)
+ Guchar *cacheData; // glyph pixmap cache
+ T3FontCacheTag *cacheTags; // cache tags, i.e., char codes
+};
+
+T3FontCache::T3FontCache(Ref *fontIDA, double m11A, double m12A,
+ double m21A, double m22A,
+ int glyphXA, int glyphYA, int glyphWA, int glyphHA,
+ GBool validBBoxA, GBool aa) {
+ int i;
+
+ fontID = *fontIDA;
+ m11 = m11A;
+ m12 = m12A;
+ m21 = m21A;
+ m22 = m22A;
+ glyphX = glyphXA;
+ glyphY = glyphYA;
+ glyphW = glyphWA;
+ glyphH = glyphHA;
+ validBBox = validBBoxA;
+ if (aa) {
+ glyphSize = glyphW * glyphH;
+ } else {
+ glyphSize = ((glyphW + 7) >> 3) * glyphH;
+ }
+ cacheAssoc = 8;
+ if (glyphSize <= 256) {
+ cacheSets = 8;
+ } else if (glyphSize <= 512) {
+ cacheSets = 4;
+ } else if (glyphSize <= 1024) {
+ cacheSets = 2;
+ } else {
+ cacheSets = 1;
+ }
+ cacheData = (Guchar *)gmallocn_checkoverflow(cacheSets * cacheAssoc, glyphSize);
+ if (cacheData != NULL)
+ {
+ cacheTags = (T3FontCacheTag *)gmallocn(cacheSets * cacheAssoc,
+ sizeof(T3FontCacheTag));
+ for (i = 0; i < cacheSets * cacheAssoc; ++i) {
+ cacheTags[i].mru = i & (cacheAssoc - 1);
+ }
+ }
+ else
+ {
+ cacheTags = NULL;
+ }
+}
+
+T3FontCache::~T3FontCache() {
+ gfree(cacheData);
+ gfree(cacheTags);
+}
+
+struct T3GlyphStack {
+ Gushort code; // character code
+
+ //----- cache info
+ T3FontCache *cache; // font cache for the current font
+ T3FontCacheTag *cacheTag; // pointer to cache tag for the glyph
+ Guchar *cacheData; // pointer to cache data for the glyph
+
+ //----- saved state
+ SplashBitmap *origBitmap;
+ Splash *origSplash;
+ double origCTM4, origCTM5;
+
+ T3GlyphStack *next; // next object on stack
+};
+
+//------------------------------------------------------------------------
+// SplashTransparencyGroup
+//------------------------------------------------------------------------
+
+struct SplashTransparencyGroup {
+ int tx, ty; // translation coordinates
+ SplashBitmap *tBitmap; // bitmap for transparency group
+ GfxColorSpace *blendingColorSpace;
+ GBool isolated;
+
+ //----- saved state
+ SplashBitmap *origBitmap;
+ Splash *origSplash;
+
+ SplashTransparencyGroup *next;
+};
+
+//------------------------------------------------------------------------
+// SplashOutputDev
+//------------------------------------------------------------------------
+
+SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA,
+ int bitmapRowPadA,
+ GBool reverseVideoA,
+ SplashColorPtr paperColorA,
+ GBool bitmapTopDownA,
+ GBool allowAntialiasA) {
+ colorMode = colorModeA;
+ bitmapRowPad = bitmapRowPadA;
+ bitmapTopDown = bitmapTopDownA;
+ allowAntialias = allowAntialiasA;
+ vectorAntialias = allowAntialias &&
+ globalParams->getVectorAntialias() &&
+ colorMode != splashModeMono1;
+ setupScreenParams(72.0, 72.0);
+ reverseVideo = reverseVideoA;
+ splashColorCopy(paperColor, paperColorA);
+
+ xref = NULL;
+
+ bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode,
+ colorMode != splashModeMono1, bitmapTopDown);
+ splash = new Splash(bitmap, vectorAntialias, &screenParams);
+ splash->clear(paperColor, 0);
+
+ fontEngine = NULL;
+
+ nT3Fonts = 0;
+ t3GlyphStack = NULL;
+
+ font = NULL;
+ needFontUpdate = gFalse;
+ textClipPath = NULL;
+
+ transpGroupStack = NULL;
+}
+
+void SplashOutputDev::setupScreenParams(double hDPI, double vDPI) {
+ screenParams.size = globalParams->getScreenSize();
+ screenParams.dotRadius = globalParams->getScreenDotRadius();
+ screenParams.gamma = (SplashCoord)globalParams->getScreenGamma();
+ screenParams.blackThreshold =
+ (SplashCoord)globalParams->getScreenBlackThreshold();
+ screenParams.whiteThreshold =
+ (SplashCoord)globalParams->getScreenWhiteThreshold();
+ switch (globalParams->getScreenType()) {
+ case screenDispersed:
+ screenParams.type = splashScreenDispersed;
+ if (screenParams.size < 0) {
+ screenParams.size = 4;
+ }
+ break;
+ case screenClustered:
+ screenParams.type = splashScreenClustered;
+ if (screenParams.size < 0) {
+ screenParams.size = 10;
+ }
+ break;
+ case screenStochasticClustered:
+ screenParams.type = splashScreenStochasticClustered;
+ if (screenParams.size < 0) {
+ screenParams.size = 100;
+ }
+ if (screenParams.dotRadius < 0) {
+ screenParams.dotRadius = 2;
+ }
+ break;
+ case screenUnset:
+ default:
+ // use clustered dithering for resolution >= 300 dpi
+ // (compare to 299.9 to avoid floating point issues)
+ if (hDPI > 299.9 && vDPI > 299.9) {
+ screenParams.type = splashScreenStochasticClustered;
+ if (screenParams.size < 0) {
+ screenParams.size = 100;
+ }
+ if (screenParams.dotRadius < 0) {
+ screenParams.dotRadius = 2;
+ }
+ } else {
+ screenParams.type = splashScreenDispersed;
+ if (screenParams.size < 0) {
+ screenParams.size = 4;
+ }
+ }
+ }
+}
+
+SplashOutputDev::~SplashOutputDev() {
+ int i;
+
+ for (i = 0; i < nT3Fonts; ++i) {
+ delete t3FontCache[i];
+ }
+ if (fontEngine) {
+ delete fontEngine;
+ }
+ if (splash) {
+ delete splash;
+ }
+ if (bitmap) {
+ delete bitmap;
+ }
+}
+
+void SplashOutputDev::startDoc(XRef *xrefA) {
+ int i;
+
+ xref = xrefA;
+ if (fontEngine) {
+ delete fontEngine;
+ }
+ fontEngine = new SplashFontEngine(
+#if HAVE_T1LIB_H
+ globalParams->getEnableT1lib(),
+#endif
+#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+ globalParams->getEnableFreeType(),
+#endif
+ allowAntialias &&
+ globalParams->getAntialias() &&
+ colorMode != splashModeMono1);
+ for (i = 0; i < nT3Fonts; ++i) {
+ delete t3FontCache[i];
+ }
+ nT3Fonts = 0;
+}
+
+void SplashOutputDev::startPage(int /*pageNum*/, GfxState *state) {
+ int w, h;
+ double *ctm;
+ SplashCoord mat[6];
+ SplashColor color;
+
+ if (state) {
+ setupScreenParams(state->getHDPI(), state->getVDPI());
+ w = (int)(state->getPageWidth() + 0.5);
+ if (w <= 0) {
+ w = 1;
+ }
+ h = (int)(state->getPageHeight() + 0.5);
+ if (h <= 0) {
+ h = 1;
+ }
+ } else {
+ w = h = 1;
+ }
+ if (splash) {
+ delete splash;
+ }
+ if (!bitmap || w != bitmap->getWidth() || h != bitmap->getHeight()) {
+ if (bitmap) {
+ delete bitmap;
+ }
+ bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode,
+ colorMode != splashModeMono1, bitmapTopDown);
+ }
+ splash = new Splash(bitmap, vectorAntialias, &screenParams);
+ if (state) {
+ ctm = state->getCTM();
+ mat[0] = (SplashCoord)ctm[0];
+ mat[1] = (SplashCoord)ctm[1];
+ mat[2] = (SplashCoord)ctm[2];
+ mat[3] = (SplashCoord)ctm[3];
+ mat[4] = (SplashCoord)ctm[4];
+ mat[5] = (SplashCoord)ctm[5];
+ splash->setMatrix(mat);
+ }
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ color[0] = 0;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ color[0] = color[1] = color[2] = 0;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ color[0] = color[1] = color[2] = color[3] = 0;
+ break;
+#endif
+ }
+ splash->setStrokePattern(new SplashSolidColor(color));
+ splash->setFillPattern(new SplashSolidColor(color));
+ splash->setLineCap(splashLineCapButt);
+ splash->setLineJoin(splashLineJoinMiter);
+ splash->setLineDash(NULL, 0, 0);
+ splash->setMiterLimit(10);
+ splash->setFlatness(1);
+ // the SA parameter supposedly defaults to false, but Acrobat
+ // apparently hardwires it to true
+ splash->setStrokeAdjust(globalParams->getStrokeAdjust());
+ splash->clear(paperColor, 0);
+}
+
+void SplashOutputDev::endPage() {
+ if (colorMode != splashModeMono1) {
+ splash->compositeBackground(paperColor);
+ }
+}
+
+void SplashOutputDev::saveState(GfxState * /*state*/) {
+ splash->saveState();
+}
+
+void SplashOutputDev::restoreState(GfxState * /*state*/) {
+ splash->restoreState();
+ needFontUpdate = gTrue;
+}
+
+void SplashOutputDev::updateAll(GfxState *state) {
+ updateLineDash(state);
+ updateLineJoin(state);
+ updateLineCap(state);
+ updateLineWidth(state);
+ updateFlatness(state);
+ updateMiterLimit(state);
+ updateStrokeAdjust(state);
+ updateFillColor(state);
+ updateStrokeColor(state);
+ needFontUpdate = gTrue;
+}
+
+void SplashOutputDev::updateCTM(GfxState *state, double /*m11*/, double /*m12*/,
+ double /*m21*/, double /*m22*/,
+ double /*m31*/, double /*m32*/) {
+ double *ctm;
+ SplashCoord mat[6];
+
+ ctm = state->getCTM();
+ mat[0] = (SplashCoord)ctm[0];
+ mat[1] = (SplashCoord)ctm[1];
+ mat[2] = (SplashCoord)ctm[2];
+ mat[3] = (SplashCoord)ctm[3];
+ mat[4] = (SplashCoord)ctm[4];
+ mat[5] = (SplashCoord)ctm[5];
+ splash->setMatrix(mat);
+}
+
+void SplashOutputDev::updateLineDash(GfxState *state) {
+ double *dashPattern;
+ int dashLength;
+ double dashStart;
+ SplashCoord dash[20];
+ int i;
+
+ state->getLineDash(&dashPattern, &dashLength, &dashStart);
+ if (dashLength > 20) {
+ dashLength = 20;
+ }
+ for (i = 0; i < dashLength; ++i) {
+ dash[i] = (SplashCoord)dashPattern[i];
+ if (dash[i] < 0) {
+ dash[i] = 0;
+ }
+ }
+ splash->setLineDash(dash, dashLength, (SplashCoord)dashStart);
+}
+
+void SplashOutputDev::updateFlatness(GfxState *state) {
+ splash->setFlatness(state->getFlatness());
+}
+
+void SplashOutputDev::updateLineJoin(GfxState *state) {
+ splash->setLineJoin(state->getLineJoin());
+}
+
+void SplashOutputDev::updateLineCap(GfxState *state) {
+ splash->setLineCap(state->getLineCap());
+}
+
+void SplashOutputDev::updateMiterLimit(GfxState *state) {
+ splash->setMiterLimit(state->getMiterLimit());
+}
+
+void SplashOutputDev::updateLineWidth(GfxState *state) {
+ splash->setLineWidth(state->getLineWidth());
+}
+
+void SplashOutputDev::updateStrokeAdjust(GfxState * /*state*/) {
+#if 0 // the SA parameter supposedly defaults to false, but Acrobat
+ // apparently hardwires it to true
+ splash->setStrokeAdjust(state->getStrokeAdjust());
+#endif
+}
+
+void SplashOutputDev::updateFillColor(GfxState *state) {
+ GfxGray gray;
+ GfxRGB rgb;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+
+ state->getFillGray(&gray);
+ state->getFillRGB(&rgb);
+#if SPLASH_CMYK
+ state->getFillCMYK(&cmyk);
+ splash->setFillPattern(getColor(gray, &rgb, &cmyk));
+#else
+ splash->setFillPattern(getColor(gray, &rgb));
+#endif
+}
+
+void SplashOutputDev::updateStrokeColor(GfxState *state) {
+ GfxGray gray;
+ GfxRGB rgb;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+
+ state->getStrokeGray(&gray);
+ state->getStrokeRGB(&rgb);
+#if SPLASH_CMYK
+ state->getStrokeCMYK(&cmyk);
+ splash->setStrokePattern(getColor(gray, &rgb, &cmyk));
+#else
+ splash->setStrokePattern(getColor(gray, &rgb));
+#endif
+}
+
+#if SPLASH_CMYK
+SplashPattern *SplashOutputDev::getColor(GfxGray gray, GfxRGB *rgb,
+ GfxCMYK *cmyk) {
+#else
+SplashPattern *SplashOutputDev::getColor(GfxGray gray, GfxRGB *rgb) {
+#endif
+ SplashPattern *pattern;
+ SplashColor color;
+ GfxColorComp r, g, b;
+
+ if (reverseVideo) {
+ gray = gfxColorComp1 - gray;
+ r = gfxColorComp1 - rgb->r;
+ g = gfxColorComp1 - rgb->g;
+ b = gfxColorComp1 - rgb->b;
+ } else {
+ r = rgb->r;
+ g = rgb->g;
+ b = rgb->b;
+ }
+
+ pattern = NULL; // make gcc happy
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ color[0] = colToByte(gray);
+ pattern = new SplashSolidColor(color);
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ color[0] = colToByte(r);
+ color[1] = colToByte(g);
+ color[2] = colToByte(b);
+ pattern = new SplashSolidColor(color);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ color[0] = colToByte(cmyk->c);
+ color[1] = colToByte(cmyk->m);
+ color[2] = colToByte(cmyk->y);
+ color[3] = colToByte(cmyk->k);
+ pattern = new SplashSolidColor(color);
+ break;
+#endif
+ }
+
+ return pattern;
+}
+
+void SplashOutputDev::updateBlendMode(GfxState *state) {
+ splash->setBlendFunc(splashOutBlendFuncs[state->getBlendMode()]);
+}
+
+void SplashOutputDev::updateFillOpacity(GfxState *state) {
+ splash->setFillAlpha((SplashCoord)state->getFillOpacity());
+}
+
+void SplashOutputDev::updateStrokeOpacity(GfxState *state) {
+ splash->setStrokeAlpha((SplashCoord)state->getStrokeOpacity());
+}
+
+void SplashOutputDev::updateFont(GfxState * /*state*/) {
+ needFontUpdate = gTrue;
+}
+
+void SplashOutputDev::doUpdateFont(GfxState *state) {
+ GfxFont *gfxFont;
+ GfxFontType fontType;
+ SplashOutFontFileID *id;
+ SplashFontFile *fontFile;
+ SplashFontSrc *fontsrc = NULL;
+ FoFiTrueType *ff;
+ Ref embRef;
+ Object refObj, strObj;
+ GString *fileName, *substName;
+ char *tmpBuf;
+ int tmpBufLen;
+ Gushort *codeToGID;
+ DisplayFontParam *dfp;
+ CharCodeToUnicode *ctu;
+ double *textMat;
+ double m11, m12, m21, m22, w1, w2, fontSize;
+ SplashCoord mat[4];
+ char *name;
+ Unicode uBuf[8];
+ int substIdx, n, code, cmap;
+ int faceIndex = 0;
+
+ needFontUpdate = gFalse;
+ font = NULL;
+ fileName = NULL;
+ tmpBuf = NULL;
+ substIdx = -1;
+ dfp = NULL;
+
+ if (!(gfxFont = state->getFont())) {
+ goto err1;
+ }
+ fontType = gfxFont->getType();
+ if (fontType == fontType3) {
+ goto err1;
+ }
+
+ // check the font file cache
+ id = new SplashOutFontFileID(gfxFont->getID());
+ if ((fontFile = fontEngine->getFontFile(id))) {
+ delete id;
+
+ } else {
+
+ // if there is an embedded font, write it to disk
+ if (gfxFont->getEmbeddedFontID(&embRef)) {
+ tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
+ if (! tmpBuf)
+ goto err2;
+
+ // if there is an external font file, use it
+ } else if (!(fileName = gfxFont->getExtFontFile())) {
+
+ // look for a display font mapping or a substitute font
+ if (gfxFont->isCIDFont()) {
+ if (((GfxCIDFont *)gfxFont)->getCollection()) {
+ dfp = globalParams->
+ getDisplayCIDFont(gfxFont->getName(),
+ ((GfxCIDFont *)gfxFont)->getCollection());
+ }
+ } else {
+ if (gfxFont->getName()) {
+ dfp = globalParams->getDisplayFont(gfxFont->getName());
+ }
+ if (!dfp) {
+ // 8-bit font substitution
+ if (gfxFont->isFixedWidth()) {
+ substIdx = 8;
+ } else if (gfxFont->isSerif()) {
+ substIdx = 4;
+ } else {
+ substIdx = 0;
+ }
+ if (gfxFont->isBold()) {
+ substIdx += 2;
+ }
+ if (gfxFont->isItalic()) {
+ substIdx += 1;
+ }
+ substName = new GString(splashOutSubstFonts[substIdx].name);
+ dfp = globalParams->getDisplayFont(substName);
+ delete substName;
+ id->setSubstIdx(substIdx);
+ }
+ }
+ if (!dfp) {
+ error(-1, "Couldn't find a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ switch (dfp->kind) {
+ case displayFontT1:
+ fileName = dfp->t1.fileName;
+ fontType = gfxFont->isCIDFont() ? fontCIDType0 : fontType1;
+ break;
+ case displayFontTT:
+ fileName = dfp->tt.fileName;
+ fontType = gfxFont->isCIDFont() ? fontCIDType2 : fontTrueType;
+ faceIndex = dfp->tt.faceIndex;
+ break;
+ }
+ }
+
+ fontsrc = new SplashFontSrc;
+ if (fileName)
+ fontsrc->setFile(fileName, gFalse);
+ else
+ fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
+
+ // load the font file
+ switch (fontType) {
+ case fontType1:
+ if (!(fontFile = fontEngine->loadType1Font(
+ id,
+ fontsrc,
+ ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontType1C:
+ if (!(fontFile = fontEngine->loadType1CFont(
+ id,
+ fontsrc,
+ ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontType1COT:
+ if (!(fontFile = fontEngine->loadOpenTypeT1CFont(
+ id,
+ fontsrc,
+ ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontTrueType:
+ case fontTrueTypeOT:
+ if (fileName)
+ ff = FoFiTrueType::load(fileName->getCString());
+ else
+ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ if (ff) {
+ codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+ n = 256;
+ delete ff;
+ } else {
+ codeToGID = NULL;
+ n = 0;
+ }
+ if (!(fontFile = fontEngine->loadTrueTypeFont(
+ id,
+ fontsrc,
+ codeToGID, n))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontCIDType0:
+ case fontCIDType0C:
+ if (!(fontFile = fontEngine->loadCIDFont(
+ id,
+ fontsrc))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontCIDType0COT:
+ if (!(fontFile = fontEngine->loadOpenTypeCFFFont(
+ id,
+ fontsrc))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontCIDType2:
+ case fontCIDType2OT:
+ codeToGID = NULL;
+ n = 0;
+ if (dfp) {
+ // create a CID-to-GID mapping, via Unicode
+ if ((ctu = ((GfxCIDFont *)gfxFont)->getToUnicode())) {
+ if (fileName)
+ ff = FoFiTrueType::load(fileName->getCString());
+ else
+ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ if (ff) {
+ // look for a Unicode cmap
+ for (cmap = 0; cmap < ff->getNumCmaps(); ++cmap) {
+ if ((ff->getCmapPlatform(cmap) == 3 &&
+ ff->getCmapEncoding(cmap) == 1) ||
+ ff->getCmapPlatform(cmap) == 0) {
+ break;
+ }
+ }
+ if (cmap < ff->getNumCmaps()) {
+ // map CID -> Unicode -> GID
+ n = ctu->getLength();
+ codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
+ for (code = 0; code < n; ++code) {
+ if (ctu->mapToUnicode(code, uBuf, 8) > 0) {
+ codeToGID[code] = ff->mapCodeToGID(cmap, uBuf[0]);
+ } else {
+ codeToGID[code] = 0;
+ }
+ }
+ }
+ delete ff;
+ }
+ ctu->decRefCnt();
+ } else {
+ error(-1, "Couldn't find a mapping to Unicode for font '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ }
+ } else {
+ if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
+ n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
+ codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
+ memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
+ n * sizeof(Gushort));
+ }
+ }
+ if (!(fontFile = fontEngine->loadTrueTypeFont(
+ id,
+ fontsrc,
+ codeToGID, n, faceIndex))) {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
+ goto err2;
+ }
+ break;
+ default:
+ // this shouldn't happen
+ goto err2;
+ }
+ }
+
+ // get the font matrix
+ textMat = state->getTextMat();
+ fontSize = state->getFontSize();
+ m11 = textMat[0] * fontSize * state->getHorizScaling();
+ m12 = textMat[1] * fontSize * state->getHorizScaling();
+ m21 = textMat[2] * fontSize;
+ m22 = textMat[3] * fontSize;
+
+ // for substituted fonts: adjust the font matrix -- compare the
+ // width of 'm' in the original font and the substituted font
+ substIdx = ((SplashOutFontFileID *)fontFile->getID())->getSubstIdx();
+ if (substIdx >= 0) {
+ for (code = 0; code < 256; ++code) {
+ if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
+ name[0] == 'm' && name[1] == '\0') {
+ break;
+ }
+ }
+ if (code < 256) {
+ w1 = ((Gfx8BitFont *)gfxFont)->getWidth(code);
+ w2 = splashOutSubstFonts[substIdx].mWidth;
+ if (!gfxFont->isSymbolic()) {
+ // if real font is substantially narrower than substituted
+ // font, reduce the font size accordingly
+ if (w1 > 0.01 && w1 < 0.9 * w2) {
+ w1 /= w2;
+ m11 *= w1;
+ m21 *= w1;
+ }
+ }
+ }
+ }
+
+ // create the scaled font
+ mat[0] = m11; mat[1] = m12;
+ mat[2] = m21; mat[3] = m22;
+ font = fontEngine->getFont(fontFile, mat, splash->getMatrix());
+
+ if (fontsrc && !fontsrc->isFile)
+ fontsrc->unref();
+
+ return;
+
+ err2:
+ delete id;
+ err1:
+ if (fontsrc && !fontsrc->isFile)
+ fontsrc->unref();
+ return;
+}
+
+void SplashOutputDev::stroke(GfxState *state) {
+ SplashPath *path;
+
+ if (state->getStrokeColorSpace()->isNonMarking()) {
+ return;
+ }
+ path = convertPath(state, state->getPath());
+ splash->stroke(path);
+ delete path;
+}
+
+void SplashOutputDev::fill(GfxState *state) {
+ SplashPath *path;
+
+ if (state->getFillColorSpace()->isNonMarking()) {
+ return;
+ }
+ path = convertPath(state, state->getPath());
+ splash->fill(path, gFalse);
+ delete path;
+}
+
+void SplashOutputDev::eoFill(GfxState *state) {
+ SplashPath *path;
+
+ if (state->getFillColorSpace()->isNonMarking()) {
+ return;
+ }
+ path = convertPath(state, state->getPath());
+ splash->fill(path, gTrue);
+ delete path;
+}
+
+void SplashOutputDev::clip(GfxState *state) {
+ SplashPath *path;
+
+ path = convertPath(state, state->getPath());
+ splash->clipToPath(path, gFalse);
+ delete path;
+}
+
+void SplashOutputDev::eoClip(GfxState *state) {
+ SplashPath *path;
+
+ path = convertPath(state, state->getPath());
+ splash->clipToPath(path, gTrue);
+ delete path;
+}
+
+void SplashOutputDev::clipToStrokePath(GfxState *state) {
+ SplashPath *path, *path2;
+
+ path = convertPath(state, state->getPath());
+ path2 = splash->makeStrokePath(path);
+ delete path;
+ splash->clipToPath(path2, gFalse);
+ delete path2;
+}
+
+SplashPath *SplashOutputDev::convertPath(GfxState * /*state*/, GfxPath *path) {
+ SplashPath *sPath;
+ GfxSubpath *subpath;
+ int i, j;
+
+ sPath = new SplashPath();
+ for (i = 0; i < path->getNumSubpaths(); ++i) {
+ subpath = path->getSubpath(i);
+ if (subpath->getNumPoints() > 0) {
+ sPath->moveTo((SplashCoord)subpath->getX(0),
+ (SplashCoord)subpath->getY(0));
+ j = 1;
+ while (j < subpath->getNumPoints()) {
+ if (subpath->getCurve(j)) {
+ sPath->curveTo((SplashCoord)subpath->getX(j),
+ (SplashCoord)subpath->getY(j),
+ (SplashCoord)subpath->getX(j+1),
+ (SplashCoord)subpath->getY(j+1),
+ (SplashCoord)subpath->getX(j+2),
+ (SplashCoord)subpath->getY(j+2));
+ j += 3;
+ } else {
+ sPath->lineTo((SplashCoord)subpath->getX(j),
+ (SplashCoord)subpath->getY(j));
+ ++j;
+ }
+ }
+ if (subpath->isClosed()) {
+ sPath->close();
+ }
+ }
+ }
+ return sPath;
+}
+
+void SplashOutputDev::drawChar(GfxState *state, double x, double y,
+ double /*dx*/, double /*dy*/,
+ double originX, double originY,
+ CharCode code, int /*nBytes*/,
+ Unicode * /*u*/, int /*uLen*/) {
+ SplashPath *path;
+ int render;
+
+ // check for invisible text -- this is used by Acrobat Capture
+ render = state->getRender();
+ if (render == 3) {
+ return;
+ }
+
+ if (needFontUpdate) {
+ doUpdateFont(state);
+ }
+ if (!font) {
+ return;
+ }
+
+ x -= originX;
+ y -= originY;
+
+ // fill
+ if (!(render & 1)) {
+ if (!state->getFillColorSpace()->isNonMarking()) {
+ splash->fillChar((SplashCoord)x, (SplashCoord)y, code, font);
+ }
+ }
+
+ // stroke
+ if ((render & 3) == 1 || (render & 3) == 2) {
+ if (!state->getStrokeColorSpace()->isNonMarking()) {
+ if ((path = font->getGlyphPath(code))) {
+ path->offset((SplashCoord)x, (SplashCoord)y);
+ splash->stroke(path);
+ delete path;
+ }
+ }
+ }
+
+ // clip
+ if (render & 4) {
+ if ((path = font->getGlyphPath(code))) {
+ path->offset((SplashCoord)x, (SplashCoord)y);
+ if (textClipPath) {
+ textClipPath->append(path);
+ delete path;
+ } else {
+ textClipPath = path;
+ }
+ }
+ }
+}
+
+GBool SplashOutputDev::beginType3Char(GfxState *state, double /*x*/, double /*y*/,
+ double /*dx*/, double /*dy*/,
+ CharCode code, Unicode * /*u*/, int /*uLen*/) {
+ GfxFont *gfxFont;
+ Ref *fontID;
+ double *ctm, *bbox;
+ T3FontCache *t3Font;
+ T3GlyphStack *t3gs;
+ GBool validBBox;
+ double x1, y1, xMin, yMin, xMax, yMax, xt, yt;
+ int i, j;
+
+ if (!(gfxFont = state->getFont())) {
+ return gFalse;
+ }
+ fontID = gfxFont->getID();
+ ctm = state->getCTM();
+ state->transform(0, 0, &xt, &yt);
+
+ // is it the first (MRU) font in the cache?
+ if (!(nT3Fonts > 0 &&
+ t3FontCache[0]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3]))) {
+
+ // is the font elsewhere in the cache?
+ for (i = 1; i < nT3Fonts; ++i) {
+ if (t3FontCache[i]->matches(fontID, ctm[0], ctm[1], ctm[2], ctm[3])) {
+ t3Font = t3FontCache[i];
+ for (j = i; j > 0; --j) {
+ t3FontCache[j] = t3FontCache[j - 1];
+ }
+ t3FontCache[0] = t3Font;
+ break;
+ }
+ }
+ if (i >= nT3Fonts) {
+
+ // create new entry in the font cache
+ if (nT3Fonts == splashOutT3FontCacheSize) {
+ delete t3FontCache[nT3Fonts - 1];
+ --nT3Fonts;
+ }
+ for (j = nT3Fonts; j > 0; --j) {
+ t3FontCache[j] = t3FontCache[j - 1];
+ }
+ ++nT3Fonts;
+ bbox = gfxFont->getFontBBox();
+ if (bbox[0] == 0 && bbox[1] == 0 && bbox[2] == 0 && bbox[3] == 0) {
+ // unspecified bounding box -- just take a guess
+ xMin = xt - 5;
+ xMax = xMin + 30;
+ yMax = yt + 15;
+ yMin = yMax - 45;
+ validBBox = gFalse;
+ } else {
+ state->transform(bbox[0], bbox[1], &x1, &y1);
+ xMin = xMax = x1;
+ yMin = yMax = y1;
+ state->transform(bbox[0], bbox[3], &x1, &y1);
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ state->transform(bbox[2], bbox[1], &x1, &y1);
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ state->transform(bbox[2], bbox[3], &x1, &y1);
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ validBBox = gTrue;
+ }
+ t3FontCache[0] = new T3FontCache(fontID, ctm[0], ctm[1], ctm[2], ctm[3],
+ (int)floor(xMin - xt),
+ (int)floor(yMin - yt),
+ (int)ceil(xMax) - (int)floor(xMin) + 3,
+ (int)ceil(yMax) - (int)floor(yMin) + 3,
+ validBBox,
+ colorMode != splashModeMono1);
+ }
+ }
+ t3Font = t3FontCache[0];
+
+ // is the glyph in the cache?
+ i = (code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
+ for (j = 0; j < t3Font->cacheAssoc; ++j) {
+ if (t3Font->cacheTags != NULL) {
+ if ((t3Font->cacheTags[i+j].mru & 0x8000) &&
+ t3Font->cacheTags[i+j].code == code) {
+ drawType3Glyph(t3Font, &t3Font->cacheTags[i+j],
+ t3Font->cacheData + (i+j) * t3Font->glyphSize);
+ return gTrue;
+ }
+ }
+ }
+
+ // push a new Type 3 glyph record
+ t3gs = new T3GlyphStack();
+ t3gs->next = t3GlyphStack;
+ t3GlyphStack = t3gs;
+ t3GlyphStack->code = code;
+ t3GlyphStack->cache = t3Font;
+ t3GlyphStack->cacheTag = NULL;
+ t3GlyphStack->cacheData = NULL;
+
+ return gFalse;
+}
+
+void SplashOutputDev::endType3Char(GfxState *state) {
+ T3GlyphStack *t3gs;
+ double *ctm;
+
+ if (t3GlyphStack->cacheTag) {
+ memcpy(t3GlyphStack->cacheData, bitmap->getDataPtr(),
+ t3GlyphStack->cache->glyphSize);
+ delete bitmap;
+ delete splash;
+ bitmap = t3GlyphStack->origBitmap;
+ splash = t3GlyphStack->origSplash;
+ ctm = state->getCTM();
+ state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
+ t3GlyphStack->origCTM4, t3GlyphStack->origCTM5);
+ updateCTM(state, 0, 0, 0, 0, 0, 0);
+ drawType3Glyph(t3GlyphStack->cache,
+ t3GlyphStack->cacheTag, t3GlyphStack->cacheData);
+ }
+ t3gs = t3GlyphStack;
+ t3GlyphStack = t3gs->next;
+ delete t3gs;
+}
+
+void SplashOutputDev::type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) {
+}
+
+void SplashOutputDev::type3D1(GfxState *state, double /*wx*/, double /*wy*/,
+ double llx, double lly, double urx, double ury) {
+ double *ctm;
+ T3FontCache *t3Font;
+ SplashColor color;
+ double xt, yt, xMin, xMax, yMin, yMax, x1, y1;
+ int i, j;
+
+ t3Font = t3GlyphStack->cache;
+
+ // check for a valid bbox
+ state->transform(0, 0, &xt, &yt);
+ state->transform(llx, lly, &x1, &y1);
+ xMin = xMax = x1;
+ yMin = yMax = y1;
+ state->transform(llx, ury, &x1, &y1);
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ state->transform(urx, lly, &x1, &y1);
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ state->transform(urx, ury, &x1, &y1);
+ if (x1 < xMin) {
+ xMin = x1;
+ } else if (x1 > xMax) {
+ xMax = x1;
+ }
+ if (y1 < yMin) {
+ yMin = y1;
+ } else if (y1 > yMax) {
+ yMax = y1;
+ }
+ if (xMin - xt < t3Font->glyphX ||
+ yMin - yt < t3Font->glyphY ||
+ xMax - xt > t3Font->glyphX + t3Font->glyphW ||
+ yMax - yt > t3Font->glyphY + t3Font->glyphH) {
+ if (t3Font->validBBox) {
+ error(-1, "Bad bounding box in Type 3 glyph");
+ }
+ return;
+ }
+
+ // allocate a cache entry
+ i = (t3GlyphStack->code & (t3Font->cacheSets - 1)) * t3Font->cacheAssoc;
+ for (j = 0; j < t3Font->cacheAssoc; ++j) {
+ if ((t3Font->cacheTags[i+j].mru & 0x7fff) == t3Font->cacheAssoc - 1) {
+ t3Font->cacheTags[i+j].mru = 0x8000;
+ t3Font->cacheTags[i+j].code = t3GlyphStack->code;
+ t3GlyphStack->cacheTag = &t3Font->cacheTags[i+j];
+ t3GlyphStack->cacheData = t3Font->cacheData + (i+j) * t3Font->glyphSize;
+ } else {
+ ++t3Font->cacheTags[i+j].mru;
+ }
+ }
+
+ // save state
+ t3GlyphStack->origBitmap = bitmap;
+ t3GlyphStack->origSplash = splash;
+ ctm = state->getCTM();
+ t3GlyphStack->origCTM4 = ctm[4];
+ t3GlyphStack->origCTM5 = ctm[5];
+
+ // create the temporary bitmap
+ if (colorMode == splashModeMono1) {
+ bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
+ splashModeMono1, gFalse);
+ splash = new Splash(bitmap, gFalse,
+ t3GlyphStack->origSplash->getScreen());
+ color[0] = 0;
+ splash->clear(color);
+ color[0] = 1;
+ } else {
+ bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
+ splashModeMono8, gFalse);
+ splash = new Splash(bitmap, vectorAntialias,
+ t3GlyphStack->origSplash->getScreen());
+ color[0] = 0x00;
+ splash->clear(color);
+ color[0] = 0xff;
+ }
+ splash->setFillPattern(new SplashSolidColor(color));
+ splash->setStrokePattern(new SplashSolidColor(color));
+ //~ this should copy other state from t3GlyphStack->origSplash?
+ state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
+ -t3Font->glyphX, -t3Font->glyphY);
+ updateCTM(state, 0, 0, 0, 0, 0, 0);
+}
+
+void SplashOutputDev::drawType3Glyph(T3FontCache *t3Font,
+ T3FontCacheTag * /*tag*/, Guchar *data) {
+ SplashGlyphBitmap glyph;
+
+ glyph.x = -t3Font->glyphX;
+ glyph.y = -t3Font->glyphY;
+ glyph.w = t3Font->glyphW;
+ glyph.h = t3Font->glyphH;
+ glyph.aa = colorMode != splashModeMono1;
+ glyph.data = data;
+ glyph.freeData = gFalse;
+ splash->fillGlyph(0, 0, &glyph);
+}
+
+void SplashOutputDev::endTextObject(GfxState * /*state*/) {
+ if (textClipPath) {
+ splash->clipToPath(textClipPath, gFalse);
+ delete textClipPath;
+ textClipPath = NULL;
+ }
+}
+
+struct SplashOutImageMaskData {
+ ImageStream *imgStr;
+ GBool invert;
+ int width, height, y;
+};
+
+GBool SplashOutputDev::imageMaskSrc(void *data, SplashColorPtr line) {
+ SplashOutImageMaskData *imgMaskData = (SplashOutImageMaskData *)data;
+ Guchar *p;
+ SplashColorPtr q;
+ int x;
+
+ if (imgMaskData->y == imgMaskData->height) {
+ return gFalse;
+ }
+ for (x = 0, p = imgMaskData->imgStr->getLine(), q = line;
+ x < imgMaskData->width;
+ ++x) {
+ *q++ = *p++ ^ imgMaskData->invert;
+ }
+ ++imgMaskData->y;
+ return gTrue;
+}
+
+void SplashOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *str,
+ int width, int height, GBool invert,
+ GBool inlineImg) {
+ double *ctm;
+ SplashCoord mat[6];
+ SplashOutImageMaskData imgMaskData;
+
+ if (state->getFillColorSpace()->isNonMarking()) {
+ return;
+ }
+
+ ctm = state->getCTM();
+ mat[0] = ctm[0];
+ mat[1] = ctm[1];
+ mat[2] = -ctm[2];
+ mat[3] = -ctm[3];
+ mat[4] = ctm[2] + ctm[4];
+ mat[5] = ctm[3] + ctm[5];
+
+ imgMaskData.imgStr = new ImageStream(str, width, 1, 1);
+ imgMaskData.imgStr->reset();
+ imgMaskData.invert = invert ? 0 : 1;
+ imgMaskData.width = width;
+ imgMaskData.height = height;
+ imgMaskData.y = 0;
+
+ splash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat,
+ t3GlyphStack != NULL);
+ if (inlineImg) {
+ while (imgMaskData.y < height) {
+ imgMaskData.imgStr->getLine();
+ ++imgMaskData.y;
+ }
+ }
+
+ delete imgMaskData.imgStr;
+ str->close();
+}
+
+struct SplashOutImageData {
+ ImageStream *imgStr;
+ GfxImageColorMap *colorMap;
+ SplashColorPtr lookup;
+ int *maskColors;
+ SplashColorMode colorMode;
+ int width, height, y;
+};
+
+GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
+ Guchar * /*alphaLine*/) {
+ SplashOutImageData *imgData = (SplashOutImageData *)data;
+ Guchar *p;
+ SplashColorPtr q, col;
+ GfxRGB rgb;
+ GfxGray gray;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ int nComps, x;
+
+ if (imgData->y == imgData->height) {
+ return gFalse;
+ }
+
+ nComps = imgData->colorMap->getNumPixelComps();
+
+ if (imgData->lookup) {
+ switch (imgData->colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+ x < imgData->width;
+ ++x, ++p) {
+ *q++ = imgData->lookup[*p];
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+ x < imgData->width;
+ ++x, ++p) {
+ col = &imgData->lookup[3 * *p];
+ *q++ = col[0];
+ *q++ = col[1];
+ *q++ = col[2];
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+ x < imgData->width;
+ ++x, ++p) {
+ col = &imgData->lookup[4 * *p];
+ *q++ = col[0];
+ *q++ = col[1];
+ *q++ = col[2];
+ *q++ = col[3];
+ }
+ break;
+#endif
+ }
+ } else {
+ switch (imgData->colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+ x < imgData->width;
+ ++x, p += nComps) {
+ imgData->colorMap->getGray(p, &gray);
+ *q++ = colToByte(gray);
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+ x < imgData->width;
+ ++x, p += nComps) {
+ imgData->colorMap->getRGB(p, &rgb);
+ *q++ = colToByte(rgb.r);
+ *q++ = colToByte(rgb.g);
+ *q++ = colToByte(rgb.b);
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+ x < imgData->width;
+ ++x, p += nComps) {
+ imgData->colorMap->getCMYK(p, &cmyk);
+ *q++ = colToByte(cmyk.c);
+ *q++ = colToByte(cmyk.m);
+ *q++ = colToByte(cmyk.y);
+ *q++ = colToByte(cmyk.k);
+ }
+ break;
+#endif
+ }
+ }
+
+ ++imgData->y;
+ return gTrue;
+}
+
+GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
+ Guchar *alphaLine) {
+ SplashOutImageData *imgData = (SplashOutImageData *)data;
+ Guchar *p, *aq;
+ SplashColorPtr q, col;
+ GfxRGB rgb;
+ GfxGray gray;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ Guchar alpha;
+ int nComps, x, i;
+
+ if (imgData->y == imgData->height) {
+ return gFalse;
+ }
+
+ nComps = imgData->colorMap->getNumPixelComps();
+
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine, aq = alphaLine;
+ x < imgData->width;
+ ++x, p += nComps) {
+ alpha = 0;
+ for (i = 0; i < nComps; ++i) {
+ if (p[i] < imgData->maskColors[2*i] ||
+ p[i] > imgData->maskColors[2*i+1]) {
+ alpha = 0xff;
+ break;
+ }
+ }
+ if (imgData->lookup) {
+ switch (imgData->colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ *q++ = imgData->lookup[*p];
+ *aq++ = alpha;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ col = &imgData->lookup[3 * *p];
+ *q++ = col[0];
+ *q++ = col[1];
+ *q++ = col[2];
+ *aq++ = alpha;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ col = &imgData->lookup[4 * *p];
+ *q++ = col[0];
+ *q++ = col[1];
+ *q++ = col[2];
+ *q++ = col[3];
+ *aq++ = alpha;
+ break;
+#endif
+ }
+ } else {
+ switch (imgData->colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ imgData->colorMap->getGray(p, &gray);
+ *q++ = colToByte(gray);
+ *aq++ = alpha;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ imgData->colorMap->getRGB(p, &rgb);
+ *q++ = colToByte(rgb.r);
+ *q++ = colToByte(rgb.g);
+ *q++ = colToByte(rgb.b);
+ *aq++ = alpha;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ imgData->colorMap->getCMYK(p, &cmyk);
+ *q++ = colToByte(cmyk.c);
+ *q++ = colToByte(cmyk.m);
+ *q++ = colToByte(cmyk.y);
+ *q++ = colToByte(cmyk.k);
+ *aq++ = alpha;
+ break;
+#endif
+ }
+ }
+ }
+
+ ++imgData->y;
+ return gTrue;
+}
+
+void SplashOutputDev::drawImage(GfxState *state, Object * /*ref*/, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap,
+ int *maskColors, GBool inlineImg) {
+ double *ctm;
+ SplashCoord mat[6];
+ SplashOutImageData imgData;
+ SplashColorMode srcMode;
+ SplashImageSource src;
+ GfxGray gray;
+ GfxRGB rgb;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ Guchar pix;
+ int n, i;
+
+ ctm = state->getCTM();
+ mat[0] = ctm[0];
+ mat[1] = ctm[1];
+ mat[2] = -ctm[2];
+ mat[3] = -ctm[3];
+ mat[4] = ctm[2] + ctm[4];
+ mat[5] = ctm[3] + ctm[5];
+
+ imgData.imgStr = new ImageStream(str, width,
+ colorMap->getNumPixelComps(),
+ colorMap->getBits());
+ imgData.imgStr->reset();
+ imgData.colorMap = colorMap;
+ imgData.maskColors = maskColors;
+ imgData.colorMode = colorMode;
+ imgData.width = width;
+ imgData.height = height;
+ imgData.y = 0;
+
+ // special case for one-channel (monochrome/gray/separation) images:
+ // build a lookup table here
+ imgData.lookup = NULL;
+ if (colorMap->getNumPixelComps() == 1) {
+ n = 1 << colorMap->getBits();
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ imgData.lookup = (SplashColorPtr)gmalloc(n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getGray(&pix, &gray);
+ imgData.lookup[i] = colToByte(gray);
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getRGB(&pix, &rgb);
+ imgData.lookup[3*i] = colToByte(rgb.r);
+ imgData.lookup[3*i+1] = colToByte(rgb.g);
+ imgData.lookup[3*i+2] = colToByte(rgb.b);
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getCMYK(&pix, &cmyk);
+ imgData.lookup[4*i] = colToByte(cmyk.c);
+ imgData.lookup[4*i+1] = colToByte(cmyk.m);
+ imgData.lookup[4*i+2] = colToByte(cmyk.y);
+ imgData.lookup[4*i+3] = colToByte(cmyk.k);
+ }
+ break;
+#endif
+ break;
+ }
+ }
+
+ if (colorMode == splashModeMono1) {
+ srcMode = splashModeMono8;
+ } else {
+ srcMode = colorMode;
+ }
+ src = maskColors ? &alphaImageSrc : &imageSrc;
+ splash->drawImage(src, &imgData, srcMode, maskColors ? gTrue : gFalse,
+ width, height, mat);
+ if (inlineImg) {
+ while (imgData.y < height) {
+ imgData.imgStr->getLine();
+ ++imgData.y;
+ }
+ }
+
+ gfree(imgData.lookup);
+ delete imgData.imgStr;
+ str->close();
+}
+
+struct SplashOutMaskedImageData {
+ ImageStream *imgStr;
+ GfxImageColorMap *colorMap;
+ SplashBitmap *mask;
+ SplashColorPtr lookup;
+ SplashColorMode colorMode;
+ int width, height, y;
+};
+
+GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
+ Guchar *alphaLine) {
+ SplashOutMaskedImageData *imgData = (SplashOutMaskedImageData *)data;
+ Guchar *p, *aq;
+ SplashColor maskColor;
+ SplashColorPtr q, col;
+ GfxRGB rgb;
+ GfxGray gray;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ Guchar alpha;
+ int nComps, x;
+
+ if (imgData->y == imgData->height) {
+ return gFalse;
+ }
+
+ nComps = imgData->colorMap->getNumPixelComps();
+
+ for (x = 0, p = imgData->imgStr->getLine(), q = colorLine, aq = alphaLine;
+ x < imgData->width;
+ ++x, p += nComps) {
+ imgData->mask->getPixel(x, imgData->y, maskColor);
+ alpha = maskColor[0] ? 0xff : 0x00;
+ if (imgData->lookup) {
+ switch (imgData->colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ *q++ = imgData->lookup[*p];
+ *aq++ = alpha;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ col = &imgData->lookup[3 * *p];
+ *q++ = col[0];
+ *q++ = col[1];
+ *q++ = col[2];
+ *aq++ = alpha;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ col = &imgData->lookup[4 * *p];
+ *q++ = col[0];
+ *q++ = col[1];
+ *q++ = col[2];
+ *q++ = col[3];
+ *aq++ = alpha;
+ break;
+#endif
+ }
+ } else {
+ switch (imgData->colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ imgData->colorMap->getGray(p, &gray);
+ *q++ = colToByte(gray);
+ *aq++ = alpha;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ imgData->colorMap->getRGB(p, &rgb);
+ *q++ = colToByte(rgb.r);
+ *q++ = colToByte(rgb.g);
+ *q++ = colToByte(rgb.b);
+ *aq++ = alpha;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ imgData->colorMap->getCMYK(p, &cmyk);
+ *q++ = colToByte(cmyk.c);
+ *q++ = colToByte(cmyk.m);
+ *q++ = colToByte(cmyk.y);
+ *q++ = colToByte(cmyk.k);
+ *aq++ = alpha;
+ break;
+#endif
+ }
+ }
+ }
+
+ ++imgData->y;
+ return gTrue;
+}
+
+void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
+ Stream *str, int width, int height,
+ GfxImageColorMap *colorMap,
+ Stream *maskStr, int maskWidth,
+ int maskHeight, GBool maskInvert) {
+ GfxImageColorMap *maskColorMap;
+ Object maskDecode, decodeLow, decodeHigh;
+ double *ctm;
+ SplashCoord mat[6];
+ SplashOutMaskedImageData imgData;
+ SplashOutImageMaskData imgMaskData;
+ SplashColorMode srcMode;
+ SplashBitmap *maskBitmap;
+ Splash *maskSplash;
+ SplashColor maskColor;
+ GfxGray gray;
+ GfxRGB rgb;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ Guchar pix;
+ int n, i;
+
+ // If the mask is higher resolution than the image, use
+ // drawSoftMaskedImage() instead.
+ if (maskWidth > width || maskHeight > height) {
+ decodeLow.initInt(maskInvert ? 0 : 1);
+ decodeHigh.initInt(maskInvert ? 1 : 0);
+ maskDecode.initArray(xref);
+ maskDecode.arrayAdd(&decodeLow);
+ maskDecode.arrayAdd(&decodeHigh);
+ maskColorMap = new GfxImageColorMap(1, &maskDecode,
+ new GfxDeviceGrayColorSpace());
+ maskDecode.free();
+ drawSoftMaskedImage(state, ref, str, width, height, colorMap,
+ maskStr, maskWidth, maskHeight, maskColorMap);
+ delete maskColorMap;
+
+ } else {
+
+ //----- scale the mask image to the same size as the source image
+
+ mat[0] = (SplashCoord)width;
+ mat[1] = 0;
+ mat[2] = 0;
+ mat[3] = (SplashCoord)height;
+ mat[4] = 0;
+ mat[5] = 0;
+ imgMaskData.imgStr = new ImageStream(maskStr, maskWidth, 1, 1);
+ imgMaskData.imgStr->reset();
+ imgMaskData.invert = maskInvert ? 0 : 1;
+ imgMaskData.width = maskWidth;
+ imgMaskData.height = maskHeight;
+ imgMaskData.y = 0;
+ maskBitmap = new SplashBitmap(width, height, 1, splashModeMono1, gFalse);
+ maskSplash = new Splash(maskBitmap, gFalse);
+ maskColor[0] = 0;
+ maskSplash->clear(maskColor);
+ maskColor[0] = 0xff;
+ maskSplash->setFillPattern(new SplashSolidColor(maskColor));
+ maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData,
+ maskWidth, maskHeight, mat, gFalse);
+ delete imgMaskData.imgStr;
+ maskStr->close();
+ delete maskSplash;
+
+ //----- draw the source image
+
+ ctm = state->getCTM();
+ mat[0] = ctm[0];
+ mat[1] = ctm[1];
+ mat[2] = -ctm[2];
+ mat[3] = -ctm[3];
+ mat[4] = ctm[2] + ctm[4];
+ mat[5] = ctm[3] + ctm[5];
+
+ imgData.imgStr = new ImageStream(str, width,
+ colorMap->getNumPixelComps(),
+ colorMap->getBits());
+ imgData.imgStr->reset();
+ imgData.colorMap = colorMap;
+ imgData.mask = maskBitmap;
+ imgData.colorMode = colorMode;
+ imgData.width = width;
+ imgData.height = height;
+ imgData.y = 0;
+
+ // special case for one-channel (monochrome/gray/separation) images:
+ // build a lookup table here
+ imgData.lookup = NULL;
+ if (colorMap->getNumPixelComps() == 1) {
+ n = 1 << colorMap->getBits();
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ imgData.lookup = (SplashColorPtr)gmalloc(n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getGray(&pix, &gray);
+ imgData.lookup[i] = colToByte(gray);
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getRGB(&pix, &rgb);
+ imgData.lookup[3*i] = colToByte(rgb.r);
+ imgData.lookup[3*i+1] = colToByte(rgb.g);
+ imgData.lookup[3*i+2] = colToByte(rgb.b);
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getCMYK(&pix, &cmyk);
+ imgData.lookup[4*i] = colToByte(cmyk.c);
+ imgData.lookup[4*i+1] = colToByte(cmyk.m);
+ imgData.lookup[4*i+2] = colToByte(cmyk.y);
+ imgData.lookup[4*i+3] = colToByte(cmyk.k);
+ }
+ break;
+#endif
+ }
+ }
+
+ if (colorMode == splashModeMono1) {
+ srcMode = splashModeMono8;
+ } else {
+ srcMode = colorMode;
+ }
+ splash->drawImage(&maskedImageSrc, &imgData, srcMode, gTrue,
+ width, height, mat);
+
+ delete maskBitmap;
+ gfree(imgData.lookup);
+ delete imgData.imgStr;
+ str->close();
+ }
+}
+
+void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object * /*ref*/,
+ Stream *str, int width, int height,
+ GfxImageColorMap *colorMap,
+ Stream *maskStr,
+ int maskWidth, int maskHeight,
+ GfxImageColorMap *maskColorMap) {
+ double *ctm;
+ SplashCoord mat[6];
+ SplashOutImageData imgData;
+ SplashOutImageData imgMaskData;
+ SplashColorMode srcMode;
+ SplashBitmap *maskBitmap;
+ Splash *maskSplash;
+ SplashColor maskColor;
+ GfxGray gray;
+ GfxRGB rgb;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ Guchar pix;
+ int n, i;
+
+ ctm = state->getCTM();
+ mat[0] = ctm[0];
+ mat[1] = ctm[1];
+ mat[2] = -ctm[2];
+ mat[3] = -ctm[3];
+ mat[4] = ctm[2] + ctm[4];
+ mat[5] = ctm[3] + ctm[5];
+
+ //----- set up the soft mask
+
+ imgMaskData.imgStr = new ImageStream(maskStr, maskWidth,
+ maskColorMap->getNumPixelComps(),
+ maskColorMap->getBits());
+ imgMaskData.imgStr->reset();
+ imgMaskData.colorMap = maskColorMap;
+ imgMaskData.maskColors = NULL;
+ imgMaskData.colorMode = splashModeMono8;
+ imgMaskData.width = maskWidth;
+ imgMaskData.height = maskHeight;
+ imgMaskData.y = 0;
+ n = 1 << maskColorMap->getBits();
+ imgMaskData.lookup = (SplashColorPtr)gmalloc(n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ maskColorMap->getGray(&pix, &gray);
+ imgMaskData.lookup[i] = colToByte(gray);
+ }
+ maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
+ 1, splashModeMono8, gFalse);
+ maskSplash = new Splash(maskBitmap, vectorAntialias);
+ maskColor[0] = 0;
+ maskSplash->clear(maskColor);
+ maskSplash->drawImage(&imageSrc, &imgMaskData, splashModeMono8, gFalse,
+ maskWidth, maskHeight, mat);
+ delete imgMaskData.imgStr;
+ maskStr->close();
+ gfree(imgMaskData.lookup);
+ delete maskSplash;
+ splash->setSoftMask(maskBitmap);
+
+ //----- draw the source image
+
+ imgData.imgStr = new ImageStream(str, width,
+ colorMap->getNumPixelComps(),
+ colorMap->getBits());
+ imgData.imgStr->reset();
+ imgData.colorMap = colorMap;
+ imgData.maskColors = NULL;
+ imgData.colorMode = colorMode;
+ imgData.width = width;
+ imgData.height = height;
+ imgData.y = 0;
+
+ // special case for one-channel (monochrome/gray/separation) images:
+ // build a lookup table here
+ imgData.lookup = NULL;
+ if (colorMap->getNumPixelComps() == 1) {
+ n = 1 << colorMap->getBits();
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ imgData.lookup = (SplashColorPtr)gmalloc(n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getGray(&pix, &gray);
+ imgData.lookup[i] = colToByte(gray);
+ }
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getRGB(&pix, &rgb);
+ imgData.lookup[3*i] = colToByte(rgb.r);
+ imgData.lookup[3*i+1] = colToByte(rgb.g);
+ imgData.lookup[3*i+2] = colToByte(rgb.b);
+ }
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
+ for (i = 0; i < n; ++i) {
+ pix = (Guchar)i;
+ colorMap->getCMYK(&pix, &cmyk);
+ imgData.lookup[4*i] = colToByte(cmyk.c);
+ imgData.lookup[4*i+1] = colToByte(cmyk.m);
+ imgData.lookup[4*i+2] = colToByte(cmyk.y);
+ imgData.lookup[4*i+3] = colToByte(cmyk.k);
+ }
+ break;
+#endif
+ }
+ }
+
+ if (colorMode == splashModeMono1) {
+ srcMode = splashModeMono8;
+ } else {
+ srcMode = colorMode;
+ }
+ splash->drawImage(&imageSrc, &imgData, srcMode, gFalse, width, height, mat);
+
+ splash->setSoftMask(NULL);
+ gfree(imgData.lookup);
+ delete imgData.imgStr;
+ str->close();
+}
+
+void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
+ GfxColorSpace *blendingColorSpace,
+ GBool isolated, GBool /*knockout*/,
+ GBool /*forSoftMask*/) {
+ SplashTransparencyGroup *transpGroup;
+ SplashColor color;
+ double xMin, yMin, xMax, yMax, x, y;
+ int tx, ty, w, h;
+
+ // transform the bbox
+ state->transform(bbox[0], bbox[1], &x, &y);
+ xMin = xMax = x;
+ yMin = yMax = y;
+ state->transform(bbox[0], bbox[3], &x, &y);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ state->transform(bbox[2], bbox[1], &x, &y);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ state->transform(bbox[2], bbox[3], &x, &y);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ tx = (int)floor(xMin);
+ if (tx < 0) {
+ tx = 0;
+ } else if (tx > bitmap->getWidth()) {
+ tx = bitmap->getWidth();
+ }
+ ty = (int)floor(yMin);
+ if (ty < 0) {
+ ty = 0;
+ } else if (ty > bitmap->getHeight()) {
+ ty = bitmap->getHeight();
+ }
+ w = (int)ceil(xMax) - tx + 1;
+ if (tx + w > bitmap->getWidth()) {
+ w = bitmap->getWidth() - tx;
+ }
+ if (w < 1) {
+ w = 1;
+ }
+ h = (int)ceil(yMax) - ty + 1;
+ if (ty + h > bitmap->getHeight()) {
+ h = bitmap->getHeight() - ty;
+ }
+ if (h < 1) {
+ h = 1;
+ }
+
+ // push a new stack entry
+ transpGroup = new SplashTransparencyGroup();
+ transpGroup->tx = tx;
+ transpGroup->ty = ty;
+ transpGroup->blendingColorSpace = blendingColorSpace;
+ transpGroup->isolated = isolated;
+ transpGroup->next = transpGroupStack;
+ transpGroupStack = transpGroup;
+
+ // save state
+ transpGroup->origBitmap = bitmap;
+ transpGroup->origSplash = splash;
+
+ //~ this ignores the blendingColorSpace arg
+
+ // create the temporary bitmap
+ bitmap = new SplashBitmap(w, h, bitmapRowPad, colorMode, gTrue,
+ bitmapTopDown);
+ splash = new Splash(bitmap, vectorAntialias,
+ transpGroup->origSplash->getScreen());
+ if (isolated) {
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ color[0] = 0;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ color[0] = color[1] = color[2] = 0;
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ color[0] = color[1] = color[2] = color[3] = 0;
+ break;
+#endif
+ default:
+ // make gcc happy
+ break;
+ }
+ splash->clear(color, 0);
+ } else {
+ splash->blitTransparent(transpGroup->origBitmap, tx, ty, 0, 0, w, h);
+ splash->setInNonIsolatedGroup(transpGroup->origBitmap, tx, ty);
+ }
+ transpGroup->tBitmap = bitmap;
+ state->shiftCTM(-tx, -ty);
+ updateCTM(state, 0, 0, 0, 0, 0, 0);
+}
+
+void SplashOutputDev::endTransparencyGroup(GfxState *state) {
+ double *ctm;
+
+ // restore state
+ delete splash;
+ bitmap = transpGroupStack->origBitmap;
+ splash = transpGroupStack->origSplash;
+ ctm = state->getCTM();
+ state->shiftCTM(transpGroupStack->tx, transpGroupStack->ty);
+ updateCTM(state, 0, 0, 0, 0, 0, 0);
+}
+
+void SplashOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) {
+ SplashBitmap *tBitmap;
+ SplashTransparencyGroup *transpGroup;
+ GBool isolated;
+ int tx, ty;
+
+ tx = transpGroupStack->tx;
+ ty = transpGroupStack->ty;
+ tBitmap = transpGroupStack->tBitmap;
+ isolated = transpGroupStack->isolated;
+
+ // paint the transparency group onto the parent bitmap
+ // - the clip path was set in the parent's state)
+ splash->composite(tBitmap, 0, 0, tx, ty,
+ tBitmap->getWidth(), tBitmap->getHeight(),
+ gFalse, !isolated);
+
+ // pop the stack
+ transpGroup = transpGroupStack;
+ transpGroupStack = transpGroup->next;
+ delete transpGroup;
+
+ delete tBitmap;
+}
+
+void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/,
+ GBool alpha, Function *transferFunc,
+ GfxColor *backdropColor) {
+ SplashBitmap *softMask, *tBitmap;
+ Splash *tSplash;
+ SplashTransparencyGroup *transpGroup;
+ SplashColor color;
+ SplashColorPtr p;
+ GfxGray gray;
+ GfxRGB rgb;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+ double lum, lum2;
+ int tx, ty, x, y;
+
+ tx = transpGroupStack->tx;
+ ty = transpGroupStack->ty;
+ tBitmap = transpGroupStack->tBitmap;
+
+ // composite with backdrop color
+ if (!alpha && colorMode != splashModeMono1) {
+ //~ need to correctly handle the case where no blending color
+ //~ space is given
+ tSplash = new Splash(tBitmap, vectorAntialias,
+ transpGroupStack->origSplash->getScreen());
+ if (transpGroupStack->blendingColorSpace) {
+ switch (colorMode) {
+ case splashModeMono1:
+ // transparency is not supported in mono1 mode
+ break;
+ case splashModeMono8:
+ transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray);
+ color[0] = colToByte(gray);
+ tSplash->compositeBackground(color);
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ transpGroupStack->blendingColorSpace->getRGB(backdropColor, &rgb);
+ color[0] = colToByte(rgb.r);
+ color[1] = colToByte(rgb.g);
+ color[2] = colToByte(rgb.b);
+ tSplash->compositeBackground(color);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ transpGroupStack->blendingColorSpace->getCMYK(backdropColor, &cmyk);
+ color[0] = colToByte(cmyk.c);
+ color[1] = colToByte(cmyk.m);
+ color[2] = colToByte(cmyk.y);
+ color[3] = colToByte(cmyk.k);
+ tSplash->compositeBackground(color);
+ break;
+#endif
+ }
+ delete tSplash;
+ }
+ }
+
+ softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
+ 1, splashModeMono8, gFalse);
+ memset(softMask->getDataPtr(), 0,
+ softMask->getRowSize() * softMask->getHeight());
+ p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx;
+ int xMax = tBitmap->getWidth();
+ int yMax = tBitmap->getHeight();
+ if (xMax + tx > bitmap->getWidth()) xMax = bitmap->getWidth() - tx;
+ if (yMax + ty > bitmap->getHeight()) yMax = bitmap->getHeight() - ty;
+ for (y = 0; y < yMax; ++y) {
+ for (x = 0; x < xMax; ++x) {
+ tBitmap->getPixel(x, y, color);
+ if (alpha) {
+ //~ unimplemented
+ } else {
+ // convert to luminosity
+ switch (colorMode) {
+ case splashModeMono1:
+ case splashModeMono8:
+ lum = color[0] / 255.0;
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ lum = (0.3 / 255.0) * color[0] +
+ (0.59 / 255.0) * color[1] +
+ (0.11 / 255.0) * color[2];
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ lum = (1 - color[3] / 255.0)
+ - (0.3 / 255.0) * color[0]
+ - (0.59 / 255.0) * color[1]
+ - (0.11 / 255.0) * color[2];
+ if (lum < 0) {
+ lum = 0;
+ }
+ break;
+#endif
+ }
+ if (transferFunc) {
+ transferFunc->transform(&lum, &lum2);
+ } else {
+ lum2 = lum;
+ }
+ p[x] = (int)(lum2 * 255.0 + 0.5);
+ }
+ }
+ p += softMask->getRowSize();
+ }
+ splash->setSoftMask(softMask);
+
+ // pop the stack
+ transpGroup = transpGroupStack;
+ transpGroupStack = transpGroup->next;
+ delete transpGroup;
+
+ delete tBitmap;
+}
+
+void SplashOutputDev::clearSoftMask(GfxState * /*state*/) {
+ splash->setSoftMask(NULL);
+}
+
+void SplashOutputDev::setPaperColor(SplashColorPtr paperColorA) {
+ splashColorCopy(paperColor, paperColorA);
+}
+
+int SplashOutputDev::getBitmapWidth() {
+ return bitmap->getWidth();
+}
+
+int SplashOutputDev::getBitmapHeight() {
+ return bitmap->getHeight();
+}
+
+SplashBitmap *SplashOutputDev::takeBitmap() {
+ SplashBitmap *ret;
+
+ ret = bitmap;
+ bitmap = new SplashBitmap(1, 1, bitmapRowPad, colorMode,
+ colorMode != splashModeMono1, bitmapTopDown);
+ return ret;
+}
+
+void SplashOutputDev::getModRegion(int *xMin, int *yMin,
+ int *xMax, int *yMax) {
+ splash->getModRegion(xMin, yMin, xMax, yMax);
+}
+
+void SplashOutputDev::clearModRegion() {
+ splash->clearModRegion();
+}
+
+void SplashOutputDev::setFillColor(int r, int g, int b) {
+ GfxRGB rgb;
+ GfxGray gray;
+#if SPLASH_CMYK
+ GfxCMYK cmyk;
+#endif
+
+ rgb.r = byteToCol(r);
+ rgb.g = byteToCol(g);
+ rgb.b = byteToCol(b);
+ gray = (GfxColorComp)(0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b + 0.5);
+ if (gray > gfxColorComp1) {
+ gray = gfxColorComp1;
+ }
+#if SPLASH_CMYK
+ cmyk.c = gfxColorComp1 - rgb.r;
+ cmyk.m = gfxColorComp1 - rgb.g;
+ cmyk.y = gfxColorComp1 - rgb.b;
+ cmyk.k = 0;
+ splash->setFillPattern(getColor(gray, &rgb, &cmyk));
+#else
+ splash->setFillPattern(getColor(gray, &rgb));
+#endif
+}
+
+SplashFont *SplashOutputDev::getFont(GString *name, double *textMatA) {
+ DisplayFontParam *dfp;
+ Ref ref;
+ SplashOutFontFileID *id;
+ SplashFontFile *fontFile;
+ SplashFont *fontObj;
+ FoFiTrueType *ff;
+ Gushort *codeToGID;
+ Unicode u;
+ SplashCoord textMat[4];
+ int cmap, i;
+
+ for (i = 0; i < 16; ++i) {
+ if (!name->cmp(splashOutSubstFonts[i].name)) {
+ break;
+ }
+ }
+ if (i == 16) {
+ return NULL;
+ }
+ ref.num = i;
+ ref.gen = -1;
+ id = new SplashOutFontFileID(&ref);
+
+ // check the font file cache
+ if ((fontFile = fontEngine->getFontFile(id))) {
+ delete id;
+
+ // load the font file
+ } else {
+ dfp = globalParams->getDisplayFont(name);
+ if (dfp && dfp->kind == displayFontT1) {
+ SplashFontSrc *fontsrc = new SplashFontSrc;
+ fontsrc->setFile(dfp->t1.fileName, gFalse);
+ fontFile = fontEngine->loadType1Font(id, fontsrc, winAnsiEncoding);
+ } else if (dfp && dfp->kind == displayFontTT) {
+ if (!(ff = FoFiTrueType::load(dfp->tt.fileName->getCString()))) {
+ return NULL;
+ }
+ for (cmap = 0; cmap < ff->getNumCmaps(); ++cmap) {
+ if ((ff->getCmapPlatform(cmap) == 3 &&
+ ff->getCmapEncoding(cmap) == 1) ||
+ ff->getCmapPlatform(cmap) == 0) {
+ break;
+ }
+ }
+ if (cmap == ff->getNumCmaps()) {
+ delete ff;
+ return NULL;
+ }
+ codeToGID = (Gushort *)gmallocn(256, sizeof(Gushort));
+ for (i = 0; i < 256; ++i) {
+ codeToGID[i] = 0;
+ if (winAnsiEncoding[i] &&
+ (u = globalParams->mapNameToUnicode(winAnsiEncoding[i]))) {
+ codeToGID[i] = ff->mapCodeToGID(cmap, u);
+ }
+ }
+ delete ff;
+ SplashFontSrc *fontsrc = new SplashFontSrc;
+ fontsrc->setFile(dfp->tt.fileName->getCString(), gFalse);
+ fontFile = fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, 256);
+ } else {
+ return NULL;
+ }
+ }
+
+ // create the scaled font
+ textMat[0] = (SplashCoord)textMatA[0];
+ textMat[1] = (SplashCoord)textMatA[1];
+ textMat[2] = (SplashCoord)textMatA[2];
+ textMat[3] = (SplashCoord)textMatA[3];
+ fontObj = fontEngine->getFont(fontFile, textMat, splash->getMatrix());
+
+ return fontObj;
+}
+
+#if 1 //~tmp: turn off anti-aliasing temporarily
+GBool SplashOutputDev::getVectorAntialias() {
+ return splash->getVectorAntialias();
+}
+
+void SplashOutputDev::setVectorAntialias(GBool vaa) {
+ splash->setVectorAntialias(vaa);
+}
+#endif
diff --git a/kpdf/xpdf/xpdf/Stream.cc b/kpdf/xpdf/xpdf/Stream.cc
deleted file mode 100644
index 2c1db5b4..00000000
--- a/kpdf/xpdf/xpdf/Stream.cc
+++ /dev/null
@@ -1,4698 +0,0 @@
-//========================================================================
-//
-// Stream.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <limits.h>
-#ifndef WIN32
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <ctype.h>
-#include "gmem.h"
-#include "gfile.h"
-#include "config.h"
-#include "Error.h"
-#include "Object.h"
-#include "Lexer.h"
-#include "GfxState.h"
-#include "Stream.h"
-#include "JBIG2Stream.h"
-#include "JPXStream.h"
-#include "Stream-CCITT.h"
-
-#ifdef __DJGPP__
-static GBool setDJSYSFLAGS = gFalse;
-#endif
-
-#ifdef VMS
-#ifdef __GNUC__
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
-#endif
-
-//------------------------------------------------------------------------
-// Stream (base class)
-//------------------------------------------------------------------------
-
-Stream::Stream() {
- ref = 1;
-}
-
-Stream::~Stream() {
-}
-
-void Stream::close() {
-}
-
-int Stream::getRawChar() {
- error(-1, "Internal: called getRawChar() on non-predictor stream");
- return EOF;
-}
-
-char *Stream::getLine(char *buf, int size) {
- int i;
- int c;
-
- if (lookChar() == EOF)
- return NULL;
- for (i = 0; i < size - 1; ++i) {
- c = getChar();
- if (c == EOF || c == '\n')
- break;
- if (c == '\r') {
- if ((c = lookChar()) == '\n')
- getChar();
- break;
- }
- buf[i] = c;
- }
- buf[i] = '\0';
- return buf;
-}
-
-GString *Stream::getPSFilter(int /*psLevel*/, char * /*indent*/) {
- return new GString();
-}
-
-Stream *Stream::addFilters(Object *dict) {
- Object obj, obj2;
- Object params, params2;
- Stream *str;
- int i;
-
- str = this;
- dict->dictLookup("Filter", &obj);
- if (obj.isNull()) {
- obj.free();
- dict->dictLookup("F", &obj);
- }
- dict->dictLookup("DecodeParms", &params);
- if (params.isNull()) {
- params.free();
- dict->dictLookup("DP", &params);
- }
- if (obj.isName()) {
- str = makeFilter(obj.getName(), str, &params);
- } else if (obj.isArray()) {
- for (i = 0; i < obj.arrayGetLength(); ++i) {
- obj.arrayGet(i, &obj2);
- if (params.isArray())
- params.arrayGet(i, &params2);
- else
- params2.initNull();
- if (obj2.isName()) {
- str = makeFilter(obj2.getName(), str, &params2);
- } else {
- error(getPos(), "Bad filter name");
- str = new EOFStream(str);
- }
- obj2.free();
- params2.free();
- }
- } else if (!obj.isNull()) {
- error(getPos(), "Bad 'Filter' attribute in stream");
- }
- obj.free();
- params.free();
-
- return str;
-}
-
-Stream *Stream::makeFilter(char *name, Stream *str, Object *params) {
- int pred; // parameters
- int colors;
- int bits;
- int early;
- int encoding;
- GBool endOfLine, byteAlign, endOfBlock, black;
- int columns, rows;
- int colorXform;
- Object globals, obj;
-
- if (!strcmp(name, "ASCIIHexDecode") || !strcmp(name, "AHx")) {
- str = new ASCIIHexStream(str);
- } else if (!strcmp(name, "ASCII85Decode") || !strcmp(name, "A85")) {
- str = new ASCII85Stream(str);
- } else if (!strcmp(name, "LZWDecode") || !strcmp(name, "LZW")) {
- pred = 1;
- columns = 1;
- colors = 1;
- bits = 8;
- early = 1;
- if (params->isDict()) {
- params->dictLookup("Predictor", &obj);
- if (obj.isInt())
- pred = obj.getInt();
- obj.free();
- params->dictLookup("Columns", &obj);
- if (obj.isInt())
- columns = obj.getInt();
- obj.free();
- params->dictLookup("Colors", &obj);
- if (obj.isInt())
- colors = obj.getInt();
- obj.free();
- params->dictLookup("BitsPerComponent", &obj);
- if (obj.isInt())
- bits = obj.getInt();
- obj.free();
- params->dictLookup("EarlyChange", &obj);
- if (obj.isInt())
- early = obj.getInt();
- obj.free();
- }
- str = new LZWStream(str, pred, columns, colors, bits, early);
- } else if (!strcmp(name, "RunLengthDecode") || !strcmp(name, "RL")) {
- str = new RunLengthStream(str);
- } else if (!strcmp(name, "CCITTFaxDecode") || !strcmp(name, "CCF")) {
- encoding = 0;
- endOfLine = gFalse;
- byteAlign = gFalse;
- columns = 1728;
- rows = 0;
- endOfBlock = gTrue;
- black = gFalse;
- if (params->isDict()) {
- params->dictLookup("K", &obj);
- if (obj.isInt()) {
- encoding = obj.getInt();
- }
- obj.free();
- params->dictLookup("EndOfLine", &obj);
- if (obj.isBool()) {
- endOfLine = obj.getBool();
- }
- obj.free();
- params->dictLookup("EncodedByteAlign", &obj);
- if (obj.isBool()) {
- byteAlign = obj.getBool();
- }
- obj.free();
- params->dictLookup("Columns", &obj);
- if (obj.isInt()) {
- columns = obj.getInt();
- }
- obj.free();
- params->dictLookup("Rows", &obj);
- if (obj.isInt()) {
- rows = obj.getInt();
- }
- obj.free();
- params->dictLookup("EndOfBlock", &obj);
- if (obj.isBool()) {
- endOfBlock = obj.getBool();
- }
- obj.free();
- params->dictLookup("BlackIs1", &obj);
- if (obj.isBool()) {
- black = obj.getBool();
- }
- obj.free();
- }
- str = new CCITTFaxStream(str, encoding, endOfLine, byteAlign,
- columns, rows, endOfBlock, black);
- } else if (!strcmp(name, "DCTDecode") || !strcmp(name, "DCT")) {
- colorXform = -1;
- if (params->isDict()) {
- if (params->dictLookup("ColorTransform", &obj)->isInt()) {
- colorXform = obj.getInt();
- }
- obj.free();
- }
- str = new DCTStream(str, colorXform);
- } else if (!strcmp(name, "FlateDecode") || !strcmp(name, "Fl")) {
- pred = 1;
- columns = 1;
- colors = 1;
- bits = 8;
- if (params->isDict()) {
- params->dictLookup("Predictor", &obj);
- if (obj.isInt())
- pred = obj.getInt();
- obj.free();
- params->dictLookup("Columns", &obj);
- if (obj.isInt())
- columns = obj.getInt();
- obj.free();
- params->dictLookup("Colors", &obj);
- if (obj.isInt())
- colors = obj.getInt();
- obj.free();
- params->dictLookup("BitsPerComponent", &obj);
- if (obj.isInt())
- bits = obj.getInt();
- obj.free();
- }
- str = new FlateStream(str, pred, columns, colors, bits);
- } else if (!strcmp(name, "JBIG2Decode")) {
- if (params->isDict()) {
- params->dictLookup("JBIG2Globals", &globals);
- }
- str = new JBIG2Stream(str, &globals);
- globals.free();
- } else if (!strcmp(name, "JPXDecode")) {
- str = new JPXStream(str);
- } else {
- error(getPos(), "Unknown filter '%s'", name);
- str = new EOFStream(str);
- }
- return str;
-}
-
-//------------------------------------------------------------------------
-// BaseStream
-//------------------------------------------------------------------------
-
-BaseStream::BaseStream(Object *dictA) {
- dict = *dictA;
-}
-
-BaseStream::~BaseStream() {
- dict.free();
-}
-
-//------------------------------------------------------------------------
-// FilterStream
-//------------------------------------------------------------------------
-
-FilterStream::FilterStream(Stream *strA) {
- str = strA;
-}
-
-FilterStream::~FilterStream() {
-}
-
-void FilterStream::close() {
- str->close();
-}
-
-void FilterStream::setPos(Guint /*pos*/, int /*dir*/) {
- error(-1, "Internal: called setPos() on FilterStream");
-}
-
-//------------------------------------------------------------------------
-// ImageStream
-//------------------------------------------------------------------------
-
-ImageStream::ImageStream(Stream *strA, int widthA, int nCompsA, int nBitsA) {
- int imgLineSize;
-
- str = strA;
- width = widthA;
- nComps = nCompsA;
- nBits = nBitsA;
-
- nVals = width * nComps;
- if (nBits == 1) {
- imgLineSize = (nVals + 7) & ~7;
- } else {
- imgLineSize = nVals;
- }
- if (width > INT_MAX / nComps) {
- // force a call to gmallocn(-1,...), which will throw an exception
- imgLineSize = -1;
- }
- imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar));
- imgIdx = nVals;
-}
-
-ImageStream::~ImageStream() {
- gfree(imgLine);
-}
-
-void ImageStream::reset() {
- str->reset();
-}
-
-GBool ImageStream::getPixel(Guchar *pix) {
- int i;
-
- if (imgIdx >= nVals) {
- getLine();
- imgIdx = 0;
- }
- for (i = 0; i < nComps; ++i) {
- pix[i] = imgLine[imgIdx++];
- }
- return gTrue;
-}
-
-Guchar *ImageStream::getLine() {
- Gulong buf, bitMask;
- int bits;
- int c;
- int i;
-
- if (nBits == 1) {
- for (i = 0; i < nVals; i += 8) {
- c = str->getChar();
- imgLine[i+0] = (Guchar)((c >> 7) & 1);
- imgLine[i+1] = (Guchar)((c >> 6) & 1);
- imgLine[i+2] = (Guchar)((c >> 5) & 1);
- imgLine[i+3] = (Guchar)((c >> 4) & 1);
- imgLine[i+4] = (Guchar)((c >> 3) & 1);
- imgLine[i+5] = (Guchar)((c >> 2) & 1);
- imgLine[i+6] = (Guchar)((c >> 1) & 1);
- imgLine[i+7] = (Guchar)(c & 1);
- }
- } else if (nBits == 8) {
- for (i = 0; i < nVals; ++i) {
- imgLine[i] = str->getChar();
- }
- } else {
- bitMask = (1 << nBits) - 1;
- buf = 0;
- bits = 0;
- for (i = 0; i < nVals; ++i) {
- if (bits < nBits) {
- buf = (buf << 8) | (str->getChar() & 0xff);
- bits += 8;
- }
- imgLine[i] = (Guchar)((buf >> (bits - nBits)) & bitMask);
- bits -= nBits;
- }
- }
- return imgLine;
-}
-
-void ImageStream::skipLine() {
- int n, i;
-
- n = (nVals * nBits + 7) >> 3;
- for (i = 0; i < n; ++i) {
- str->getChar();
- }
-}
-
-//------------------------------------------------------------------------
-// StreamPredictor
-//------------------------------------------------------------------------
-
-StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
- int widthA, int nCompsA, int nBitsA) {
- str = strA;
- predictor = predictorA;
- width = widthA;
- nComps = nCompsA;
- nBits = nBitsA;
- predLine = NULL;
- ok = gFalse;
-
- nVals = width * nComps;
- pixBytes = (nComps * nBits + 7) >> 3;
- rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
- if (width <= 0 || nComps <= 0 || nBits <= 0 ||
- nComps > gfxColorMaxComps || nBits > 16 ||
- width >= INT_MAX / nComps || // check for overflow in nVals
- nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
- return;
- }
- predLine = (Guchar *)gmalloc(rowBytes);
- memset(predLine, 0, rowBytes);
- predIdx = rowBytes;
-
- ok = gTrue;
-}
-
-StreamPredictor::~StreamPredictor() {
- gfree(predLine);
-}
-
-int StreamPredictor::lookChar() {
- if (predIdx >= rowBytes) {
- if (!getNextLine()) {
- return EOF;
- }
- }
- return predLine[predIdx];
-}
-
-int StreamPredictor::getChar() {
- if (predIdx >= rowBytes) {
- if (!getNextLine()) {
- return EOF;
- }
- }
- return predLine[predIdx++];
-}
-
-GBool StreamPredictor::getNextLine() {
- int curPred;
- Guchar upLeftBuf[gfxColorMaxComps * 2 + 1];
- int left, up, upLeft, p, pa, pb, pc;
- int c;
- Gulong inBuf, outBuf, bitMask;
- int inBits, outBits;
- int i, j, k, kk;
-
- // get PNG optimum predictor number
- if (predictor >= 10) {
- if ((curPred = str->getRawChar()) == EOF) {
- return gFalse;
- }
- curPred += 10;
- } else {
- curPred = predictor;
- }
-
- // read the raw line, apply PNG (byte) predictor
- memset(upLeftBuf, 0, pixBytes + 1);
- for (i = pixBytes; i < rowBytes; ++i) {
- for (j = pixBytes; j > 0; --j) {
- upLeftBuf[j] = upLeftBuf[j-1];
- }
- upLeftBuf[0] = predLine[i];
- if ((c = str->getRawChar()) == EOF) {
- if (i > pixBytes) {
- // this ought to return false, but some (broken) PDF files
- // contain truncated image data, and Adobe apparently reads the
- // last partial line
- break;
- }
- return gFalse;
- }
- switch (curPred) {
- case 11: // PNG sub
- predLine[i] = predLine[i - pixBytes] + (Guchar)c;
- break;
- case 12: // PNG up
- predLine[i] = predLine[i] + (Guchar)c;
- break;
- case 13: // PNG average
- predLine[i] = ((predLine[i - pixBytes] + predLine[i]) >> 1) +
- (Guchar)c;
- break;
- case 14: // PNG Paeth
- left = predLine[i - pixBytes];
- up = predLine[i];
- upLeft = upLeftBuf[pixBytes];
- p = left + up - upLeft;
- if ((pa = p - left) < 0)
- pa = -pa;
- if ((pb = p - up) < 0)
- pb = -pb;
- if ((pc = p - upLeft) < 0)
- pc = -pc;
- if (pa <= pb && pa <= pc)
- predLine[i] = left + (Guchar)c;
- else if (pb <= pc)
- predLine[i] = up + (Guchar)c;
- else
- predLine[i] = upLeft + (Guchar)c;
- break;
- case 10: // PNG none
- default: // no predictor or TIFF predictor
- predLine[i] = (Guchar)c;
- break;
- }
- }
-
- // apply TIFF (component) predictor
- if (predictor == 2) {
- if (nBits == 1) {
- inBuf = predLine[pixBytes - 1];
- for (i = pixBytes; i < rowBytes; i += 8) {
- // 1-bit add is just xor
- inBuf = (inBuf << 8) | predLine[i];
- predLine[i] ^= inBuf >> nComps;
- }
- } else if (nBits == 8) {
- for (i = pixBytes; i < rowBytes; ++i) {
- predLine[i] += predLine[i - nComps];
- }
- } else {
- memset(upLeftBuf, 0, nComps + 1);
- bitMask = (1 << nBits) - 1;
- inBuf = outBuf = 0;
- inBits = outBits = 0;
- j = k = pixBytes;
- for (i = 0; i < width; ++i) {
- for (kk = 0; kk < nComps; ++kk) {
- if (inBits < nBits) {
- inBuf = (inBuf << 8) | (predLine[j++] & 0xff);
- inBits += 8;
- }
- upLeftBuf[kk] = (Guchar)((upLeftBuf[kk] +
- (inBuf >> (inBits - nBits))) & bitMask);
- inBits -= nBits;
- outBuf = (outBuf << nBits) | upLeftBuf[kk];
- outBits += nBits;
- if (outBits >= 8) {
- predLine[k++] = (Guchar)(outBuf >> (outBits - 8));
- outBits -= 8;
- }
- }
- }
- if (outBits > 0) {
- predLine[k++] = (Guchar)((outBuf << (8 - outBits)) +
- (inBuf & ((1 << (8 - outBits)) - 1)));
- }
- }
- }
-
- // reset to start of line
- predIdx = pixBytes;
-
- return gTrue;
-}
-
-//------------------------------------------------------------------------
-// FileStream
-//------------------------------------------------------------------------
-
-FileStream::FileStream(FILE *fA, Guint startA, GBool limitedA,
- Guint lengthA, Object *dictA):
- BaseStream(dictA) {
- f = fA;
- start = startA;
- limited = limitedA;
- length = lengthA;
- bufPtr = bufEnd = buf;
- bufPos = start;
- savePos = 0;
- saved = gFalse;
-}
-
-FileStream::~FileStream() {
- close();
-}
-
-Stream *FileStream::makeSubStream(Guint startA, GBool limitedA,
- Guint lengthA, Object *dictA) {
- return new FileStream(f, startA, limitedA, lengthA, dictA);
-}
-
-void FileStream::reset() {
-#if HAVE_FSEEKO
- savePos = (Guint)ftello(f);
- fseeko(f, start, SEEK_SET);
-#elif HAVE_FSEEK64
- savePos = (Guint)ftell64(f);
- fseek64(f, start, SEEK_SET);
-#else
- savePos = (Guint)ftell(f);
- fseek(f, start, SEEK_SET);
-#endif
- saved = gTrue;
- bufPtr = bufEnd = buf;
- bufPos = start;
-}
-
-void FileStream::close() {
- if (saved) {
-#if HAVE_FSEEKO
- fseeko(f, savePos, SEEK_SET);
-#elif HAVE_FSEEK64
- fseek64(f, savePos, SEEK_SET);
-#else
- fseek(f, savePos, SEEK_SET);
-#endif
- saved = gFalse;
- }
-}
-
-GBool FileStream::fillBuf() {
- int n;
-
- bufPos += bufEnd - buf;
- bufPtr = bufEnd = buf;
- if (limited && bufPos >= start + length) {
- return gFalse;
- }
- if (limited && bufPos + fileStreamBufSize > start + length) {
- n = start + length - bufPos;
- } else {
- n = fileStreamBufSize;
- }
- n = fread(buf, 1, n, f);
- bufEnd = buf + n;
- if (bufPtr >= bufEnd) {
- return gFalse;
- }
- return gTrue;
-}
-
-void FileStream::setPos(Guint pos, int dir) {
- Guint size;
-
- if (dir >= 0) {
-#if HAVE_FSEEKO
- fseeko(f, pos, SEEK_SET);
-#elif HAVE_FSEEK64
- fseek64(f, pos, SEEK_SET);
-#else
- fseek(f, pos, SEEK_SET);
-#endif
- bufPos = pos;
- } else {
-#if HAVE_FSEEKO
- fseeko(f, 0, SEEK_END);
- size = (Guint)ftello(f);
-#elif HAVE_FSEEK64
- fseek64(f, 0, SEEK_END);
- size = (Guint)ftell64(f);
-#else
- fseek(f, 0, SEEK_END);
- size = (Guint)ftell(f);
-#endif
- if (pos > size)
- pos = (Guint)size;
-#ifdef __CYGWIN32__
- //~ work around a bug in cygwin's implementation of fseek
- rewind(f);
-#endif
-#if HAVE_FSEEKO
- fseeko(f, -(int)pos, SEEK_END);
- bufPos = (Guint)ftello(f);
-#elif HAVE_FSEEK64
- fseek64(f, -(int)pos, SEEK_END);
- bufPos = (Guint)ftell64(f);
-#else
- fseek(f, -(int)pos, SEEK_END);
- bufPos = (Guint)ftell(f);
-#endif
- }
- bufPtr = bufEnd = buf;
-}
-
-void FileStream::moveStart(int delta) {
- start += delta;
- bufPtr = bufEnd = buf;
- bufPos = start;
-}
-
-//------------------------------------------------------------------------
-// MemStream
-//------------------------------------------------------------------------
-
-MemStream::MemStream(char *bufA, Guint startA, Guint lengthA, Object *dictA):
- BaseStream(dictA) {
- buf = bufA;
- start = startA;
- length = lengthA;
- bufEnd = buf + start + length;
- bufPtr = buf + start;
- needFree = gFalse;
-}
-
-MemStream::~MemStream() {
- if (needFree) {
- gfree(buf);
- }
-}
-
-Stream *MemStream::makeSubStream(Guint startA, GBool limited,
- Guint lengthA, Object *dictA) {
- MemStream *subStr;
- Guint newLength;
-
- if (!limited || startA + lengthA > start + length) {
- newLength = start + length - startA;
- } else {
- newLength = lengthA;
- }
- subStr = new MemStream(buf, startA, newLength, dictA);
- return subStr;
-}
-
-void MemStream::reset() {
- bufPtr = buf + start;
-}
-
-void MemStream::close() {
-}
-
-void MemStream::setPos(Guint pos, int dir) {
- Guint i;
-
- if (dir >= 0) {
- i = pos;
- } else {
- i = start + length - pos;
- }
- if (i < start) {
- i = start;
- } else if (i > start + length) {
- i = start + length;
- }
- bufPtr = buf + i;
-}
-
-void MemStream::moveStart(int delta) {
- start += delta;
- length -= delta;
- bufPtr = buf + start;
-}
-
-//------------------------------------------------------------------------
-// EmbedStream
-//------------------------------------------------------------------------
-
-EmbedStream::EmbedStream(Stream *strA, Object *dictA,
- GBool limitedA, Guint lengthA):
- BaseStream(dictA) {
- str = strA;
- limited = limitedA;
- length = lengthA;
-}
-
-EmbedStream::~EmbedStream() {
-}
-
-Stream *EmbedStream::makeSubStream(Guint /*start*/, GBool /*limitedA*/,
- Guint /*lengthA*/, Object * /*dictA*/) {
- error(-1, "Internal: called makeSubStream() on EmbedStream");
- return NULL;
-}
-
-int EmbedStream::getChar() {
- if (limited && !length) {
- return EOF;
- }
- --length;
- return str->getChar();
-}
-
-int EmbedStream::lookChar() {
- if (limited && !length) {
- return EOF;
- }
- return str->lookChar();
-}
-
-void EmbedStream::setPos(Guint /*pos*/, int /*dir*/) {
- error(-1, "Internal: called setPos() on EmbedStream");
-}
-
-Guint EmbedStream::getStart() {
- error(-1, "Internal: called getStart() on EmbedStream");
- return 0;
-}
-
-void EmbedStream::moveStart(int /*delta*/) {
- error(-1, "Internal: called moveStart() on EmbedStream");
-}
-
-//------------------------------------------------------------------------
-// ASCIIHexStream
-//------------------------------------------------------------------------
-
-ASCIIHexStream::ASCIIHexStream(Stream *strA):
- FilterStream(strA) {
- buf = EOF;
- eof = gFalse;
-}
-
-ASCIIHexStream::~ASCIIHexStream() {
- delete str;
-}
-
-void ASCIIHexStream::reset() {
- str->reset();
- buf = EOF;
- eof = gFalse;
-}
-
-int ASCIIHexStream::lookChar() {
- int c1, c2, x;
-
- if (buf != EOF)
- return buf;
- if (eof) {
- buf = EOF;
- return EOF;
- }
- do {
- c1 = str->getChar();
- } while (isspace(c1));
- if (c1 == '>') {
- eof = gTrue;
- buf = EOF;
- return buf;
- }
- do {
- c2 = str->getChar();
- } while (isspace(c2));
- if (c2 == '>') {
- eof = gTrue;
- c2 = '0';
- }
- if (c1 >= '0' && c1 <= '9') {
- x = (c1 - '0') << 4;
- } else if (c1 >= 'A' && c1 <= 'F') {
- x = (c1 - 'A' + 10) << 4;
- } else if (c1 >= 'a' && c1 <= 'f') {
- x = (c1 - 'a' + 10) << 4;
- } else if (c1 == EOF) {
- eof = gTrue;
- x = 0;
- } else {
- error(getPos(), "Illegal character <%02x> in ASCIIHex stream", c1);
- x = 0;
- }
- if (c2 >= '0' && c2 <= '9') {
- x += c2 - '0';
- } else if (c2 >= 'A' && c2 <= 'F') {
- x += c2 - 'A' + 10;
- } else if (c2 >= 'a' && c2 <= 'f') {
- x += c2 - 'a' + 10;
- } else if (c2 == EOF) {
- eof = gTrue;
- x = 0;
- } else {
- error(getPos(), "Illegal character <%02x> in ASCIIHex stream", c2);
- }
- buf = x & 0xff;
- return buf;
-}
-
-GString *ASCIIHexStream::getPSFilter(int psLevel, char *indent) {
- GString *s;
-
- if (psLevel < 2) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("/ASCIIHexDecode filter\n");
- return s;
-}
-
-GBool ASCIIHexStream::isBinary(GBool /*last*/) {
- return str->isBinary(gFalse);
-}
-
-//------------------------------------------------------------------------
-// ASCII85Stream
-//------------------------------------------------------------------------
-
-ASCII85Stream::ASCII85Stream(Stream *strA):
- FilterStream(strA) {
- index = n = 0;
- eof = gFalse;
-}
-
-ASCII85Stream::~ASCII85Stream() {
- delete str;
-}
-
-void ASCII85Stream::reset() {
- str->reset();
- index = n = 0;
- eof = gFalse;
-}
-
-int ASCII85Stream::lookChar() {
- int k;
- Gulong t;
-
- if (index >= n) {
- if (eof)
- return EOF;
- index = 0;
- do {
- c[0] = str->getChar();
- } while (Lexer::isSpace(c[0]));
- if (c[0] == '~' || c[0] == EOF) {
- eof = gTrue;
- n = 0;
- return EOF;
- } else if (c[0] == 'z') {
- b[0] = b[1] = b[2] = b[3] = 0;
- n = 4;
- } else {
- for (k = 1; k < 5; ++k) {
- do {
- c[k] = str->getChar();
- } while (Lexer::isSpace(c[k]));
- if (c[k] == '~' || c[k] == EOF)
- break;
- }
- n = k - 1;
- if (k < 5 && (c[k] == '~' || c[k] == EOF)) {
- for (++k; k < 5; ++k)
- c[k] = 0x21 + 84;
- eof = gTrue;
- }
- t = 0;
- for (k = 0; k < 5; ++k)
- t = t * 85 + (c[k] - 0x21);
- for (k = 3; k >= 0; --k) {
- b[k] = (int)(t & 0xff);
- t >>= 8;
- }
- }
- }
- return b[index];
-}
-
-GString *ASCII85Stream::getPSFilter(int psLevel, char *indent) {
- GString *s;
-
- if (psLevel < 2) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("/ASCII85Decode filter\n");
- return s;
-}
-
-GBool ASCII85Stream::isBinary(GBool /*last*/) {
- return str->isBinary(gFalse);
-}
-
-//------------------------------------------------------------------------
-// LZWStream
-//------------------------------------------------------------------------
-
-LZWStream::LZWStream(Stream *strA, int predictor, int columns, int colors,
- int bits, int earlyA):
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
- if (!pred->isOk()) {
- delete pred;
- pred = NULL;
- }
- } else {
- pred = NULL;
- }
- early = earlyA;
- eof = gFalse;
- inputBits = 0;
- clearTable();
-}
-
-LZWStream::~LZWStream() {
- if (pred) {
- delete pred;
- }
- delete str;
-}
-
-int LZWStream::getChar() {
- if (pred) {
- return pred->getChar();
- }
- if (eof) {
- return EOF;
- }
- if (seqIndex >= seqLength) {
- if (!processNextCode()) {
- return EOF;
- }
- }
- return seqBuf[seqIndex++];
-}
-
-int LZWStream::lookChar() {
- if (pred) {
- return pred->lookChar();
- }
- if (eof) {
- return EOF;
- }
- if (seqIndex >= seqLength) {
- if (!processNextCode()) {
- return EOF;
- }
- }
- return seqBuf[seqIndex];
-}
-
-int LZWStream::getRawChar() {
- if (eof) {
- return EOF;
- }
- if (seqIndex >= seqLength) {
- if (!processNextCode()) {
- return EOF;
- }
- }
- return seqBuf[seqIndex++];
-}
-
-void LZWStream::reset() {
- str->reset();
- eof = gFalse;
- inputBits = 0;
- clearTable();
-}
-
-GBool LZWStream::processNextCode() {
- int code;
- int nextLength;
- int i, j;
-
- // check for EOF
- if (eof) {
- return gFalse;
- }
-
- // check for eod and clear-table codes
- start:
- code = getCode();
- if (code == EOF || code == 257) {
- eof = gTrue;
- return gFalse;
- }
- if (code == 256) {
- clearTable();
- goto start;
- }
- if (nextCode >= 4097) {
- error(getPos(), "Bad LZW stream - expected clear-table code");
- clearTable();
- }
-
- // process the next code
- nextLength = seqLength + 1;
- if (code < 256) {
- seqBuf[0] = code;
- seqLength = 1;
- } else if (code < nextCode) {
- seqLength = table[code].length;
- for (i = seqLength - 1, j = code; i > 0; --i) {
- seqBuf[i] = table[j].tail;
- j = table[j].head;
- }
- seqBuf[0] = j;
- } else if (code == nextCode) {
- seqBuf[seqLength] = newChar;
- ++seqLength;
- } else {
- error(getPos(), "Bad LZW stream - unexpected code");
- eof = gTrue;
- return gFalse;
- }
- newChar = seqBuf[0];
- if (first) {
- first = gFalse;
- } else {
- table[nextCode].length = nextLength;
- table[nextCode].head = prevCode;
- table[nextCode].tail = newChar;
- ++nextCode;
- if (nextCode + early == 512)
- nextBits = 10;
- else if (nextCode + early == 1024)
- nextBits = 11;
- else if (nextCode + early == 2048)
- nextBits = 12;
- }
- prevCode = code;
-
- // reset buffer
- seqIndex = 0;
-
- return gTrue;
-}
-
-void LZWStream::clearTable() {
- nextCode = 258;
- nextBits = 9;
- seqIndex = seqLength = 0;
- first = gTrue;
-}
-
-int LZWStream::getCode() {
- int c;
- int code;
-
- while (inputBits < nextBits) {
- if ((c = str->getChar()) == EOF)
- return EOF;
- inputBuf = (inputBuf << 8) | (c & 0xff);
- inputBits += 8;
- }
- code = (inputBuf >> (inputBits - nextBits)) & ((1 << nextBits) - 1);
- inputBits -= nextBits;
- return code;
-}
-
-GString *LZWStream::getPSFilter(int psLevel, char *indent) {
- GString *s;
-
- if (psLevel < 2 || pred) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("<< ");
- if (!early) {
- s->append("/EarlyChange 0 ");
- }
- s->append(">> /LZWDecode filter\n");
- return s;
-}
-
-GBool LZWStream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-//------------------------------------------------------------------------
-// RunLengthStream
-//------------------------------------------------------------------------
-
-RunLengthStream::RunLengthStream(Stream *strA):
- FilterStream(strA) {
- bufPtr = bufEnd = buf;
- eof = gFalse;
-}
-
-RunLengthStream::~RunLengthStream() {
- delete str;
-}
-
-void RunLengthStream::reset() {
- str->reset();
- bufPtr = bufEnd = buf;
- eof = gFalse;
-}
-
-GString *RunLengthStream::getPSFilter(int psLevel, char *indent) {
- GString *s;
-
- if (psLevel < 2) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("/RunLengthDecode filter\n");
- return s;
-}
-
-GBool RunLengthStream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-GBool RunLengthStream::fillBuf() {
- int c;
- int n, i;
-
- if (eof)
- return gFalse;
- c = str->getChar();
- if (c == 0x80 || c == EOF) {
- eof = gTrue;
- return gFalse;
- }
- if (c < 0x80) {
- n = c + 1;
- for (i = 0; i < n; ++i)
- buf[i] = (char)str->getChar();
- } else {
- n = 0x101 - c;
- c = str->getChar();
- for (i = 0; i < n; ++i)
- buf[i] = (char)c;
- }
- bufPtr = buf;
- bufEnd = buf + n;
- return gTrue;
-}
-
-//------------------------------------------------------------------------
-// CCITTFaxStream
-//------------------------------------------------------------------------
-
-CCITTFaxStream::CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA,
- GBool byteAlignA, int columnsA, int rowsA,
- GBool endOfBlockA, GBool blackA):
- FilterStream(strA) {
- encoding = encodingA;
- endOfLine = endOfLineA;
- byteAlign = byteAlignA;
- columns = columnsA;
- if (columns < 1) {
- columns = 1;
- } else if (columns > INT_MAX - 2) {
- columns = INT_MAX - 2;
- }
- rows = rowsA;
- endOfBlock = endOfBlockA;
- black = blackA;
- // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = columns
- // ---> max codingLine size = columns + 1
- // refLine has one extra guard entry at the end
- // ---> max refLine size = columns + 2
- codingLine = (int *)gmallocn_checkoverflow(columns + 1, sizeof(int));
- refLine = (int *)gmallocn_checkoverflow(columns + 2, sizeof(int));
-
- if (codingLine != NULL && refLine != NULL) {
- eof = gFalse;
- codingLine[0] = columns;
- } else {
- eof = gTrue;
- }
- row = 0;
- nextLine2D = encoding < 0;
- inputBits = 0;
- a0i = 0;
- outputBits = 0;
-
- buf = EOF;
-}
-
-CCITTFaxStream::~CCITTFaxStream() {
- delete str;
- gfree(refLine);
- gfree(codingLine);
-}
-
-void CCITTFaxStream::reset() {
- short code1;
-
- str->reset();
-
- if (codingLine != NULL && refLine != NULL) {
- eof = gFalse;
- codingLine[0] = columns;
- } else {
- eof = gTrue;
- }
- row = 0;
- nextLine2D = encoding < 0;
- inputBits = 0;
- a0i = 0;
- outputBits = 0;
- buf = EOF;
-
- // skip any initial zero bits and end-of-line marker, and get the 2D
- // encoding tag
- while ((code1 = lookBits(12)) == 0) {
- eatBits(1);
- }
- if (code1 == 0x001) {
- eatBits(12);
- }
- if (encoding > 0) {
- nextLine2D = !lookBits(1);
- eatBits(1);
- }
-}
-
-inline void CCITTFaxStream::addPixels(int a1, int blackPixels) {
- if (a1 > codingLine[a0i]) {
- if (a1 > columns) {
- error(getPos(), "CCITTFax row is wrong length (%d)", a1);
- err = gTrue;
- a1 = columns;
- }
- if ((a0i & 1) ^ blackPixels) {
- ++a0i;
- }
- codingLine[a0i] = a1;
- }
-}
-
-inline void CCITTFaxStream::addPixelsNeg(int a1, int blackPixels) {
- if (a1 > codingLine[a0i]) {
- if (a1 > columns) {
- error(getPos(), "CCITTFax row is wrong length (%d)", a1);
- err = gTrue;
- a1 = columns;
- }
- if ((a0i & 1) ^ blackPixels) {
- ++a0i;
- }
- codingLine[a0i] = a1;
- } else if (a1 < codingLine[a0i]) {
- if (a1 < 0) {
- error(getPos(), "Invalid CCITTFax code");
- err = gTrue;
- a1 = 0;
- }
- while (a0i > 0 && a1 <= codingLine[a0i - 1]) {
- --a0i;
- }
- codingLine[a0i] = a1;
- }
-}
-
-int CCITTFaxStream::lookChar() {
- short code1, code2, code3;
- int b1i, blackPixels, i, bits;
- GBool gotEOL;
-
- if (buf != EOF) {
- return buf;
- }
-
- // read the next row
- if (outputBits == 0) {
-
- // if at eof just return EOF
- if (eof) {
- return EOF;
- }
-
- err = gFalse;
-
- // 2-D encoding
- if (nextLine2D) {
- for (i = 0; codingLine[i] < columns; ++i) {
- refLine[i] = codingLine[i];
- }
- refLine[i++] = columns;
- refLine[i] = columns;
- codingLine[0] = 0;
- a0i = 0;
- b1i = 0;
- blackPixels = 0;
- // invariant:
- // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1]
- // <= columns
- // exception at left edge:
- // codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
- // exception at right edge:
- // refLine[b1i] = refLine[b1i+1] = columns is possible
- while (codingLine[a0i] < columns) {
- code1 = getTwoDimCode();
- switch (code1) {
- case twoDimPass:
- addPixels(refLine[b1i + 1], blackPixels);
- if (refLine[b1i + 1] < columns) {
- b1i += 2;
- }
- break;
- case twoDimHoriz:
- code1 = code2 = 0;
- if (blackPixels) {
- do {
- code1 += code3 = getBlackCode();
- } while (code3 >= 64);
- do {
- code2 += code3 = getWhiteCode();
- } while (code3 >= 64);
- } else {
- do {
- code1 += code3 = getWhiteCode();
- } while (code3 >= 64);
- do {
- code2 += code3 = getBlackCode();
- } while (code3 >= 64);
- }
- addPixels(codingLine[a0i] + code1, blackPixels);
- if (codingLine[a0i] < columns) {
- addPixels(codingLine[a0i] + code2, blackPixels ^ 1);
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- break;
- case twoDimVertR3:
- addPixels(refLine[b1i] + 3, blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertR2:
- addPixels(refLine[b1i] + 2, blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertR1:
- addPixels(refLine[b1i] + 1, blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case twoDimVert0:
- addPixels(refLine[b1i], blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- ++b1i;
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertL3:
- addPixelsNeg(refLine[b1i] - 3, blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- if (b1i > 0) {
- --b1i;
- } else {
- ++b1i;
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertL2:
- addPixelsNeg(refLine[b1i] - 2, blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- if (b1i > 0) {
- --b1i;
- } else {
- ++b1i;
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case twoDimVertL1:
- addPixelsNeg(refLine[b1i] - 1, blackPixels);
- blackPixels ^= 1;
- if (codingLine[a0i] < columns) {
- if (b1i > 0) {
- --b1i;
- } else {
- ++b1i;
- }
- while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
- b1i += 2;
- }
- }
- break;
- case EOF:
- addPixels(columns, 0);
- eof = gTrue;
- break;
- default:
- error(getPos(), "Bad 2D code %04x in CCITTFax stream", code1);
- addPixels(columns, 0);
- err = gTrue;
- break;
- }
- }
-
- // 1-D encoding
- } else {
- codingLine[0] = 0;
- a0i = 0;
- blackPixels = 0;
- while (codingLine[a0i] < columns) {
- code1 = 0;
- if (blackPixels) {
- do {
- code1 += code3 = getBlackCode();
- } while (code3 >= 64);
- } else {
- do {
- code1 += code3 = getWhiteCode();
- } while (code3 >= 64);
- }
- addPixels(codingLine[a0i] + code1, blackPixels);
- blackPixels ^= 1;
- }
- }
-
- // byte-align the row
- if (byteAlign) {
- inputBits &= ~7;
- }
-
- // check for end-of-line marker, skipping over any extra zero bits
- gotEOL = gFalse;
- if (!endOfBlock && row == rows - 1) {
- eof = gTrue;
- } else {
- code1 = lookBits(12);
- while (code1 == 0) {
- eatBits(1);
- code1 = lookBits(12);
- }
- if (code1 == 0x001) {
- eatBits(12);
- gotEOL = gTrue;
- } else if (code1 == EOF) {
- eof = gTrue;
- }
- }
-
- // get 2D encoding tag
- if (!eof && encoding > 0) {
- nextLine2D = !lookBits(1);
- eatBits(1);
- }
-
- // check for end-of-block marker
- if (endOfBlock && gotEOL) {
- code1 = lookBits(12);
- if (code1 == 0x001) {
- eatBits(12);
- if (encoding > 0) {
- lookBits(1);
- eatBits(1);
- }
- if (encoding >= 0) {
- for (i = 0; i < 4; ++i) {
- code1 = lookBits(12);
- if (code1 != 0x001) {
- error(getPos(), "Bad RTC code in CCITTFax stream");
- }
- eatBits(12);
- if (encoding > 0) {
- lookBits(1);
- eatBits(1);
- }
- }
- }
- eof = gTrue;
- }
-
- // look for an end-of-line marker after an error -- we only do
- // this if we know the stream contains end-of-line markers because
- // the "just plow on" technique tends to work better otherwise
- } else if (err && endOfLine) {
- while (1) {
- code1 = lookBits(13);
- if (code1 == EOF) {
- eof = gTrue;
- return EOF;
- }
- if ((code1 >> 1) == 0x001) {
- break;
- }
- eatBits(1);
- }
- eatBits(12);
- if (encoding > 0) {
- eatBits(1);
- nextLine2D = !(code1 & 1);
- }
- }
-
- // set up for output
- if (codingLine[0] > 0) {
- outputBits = codingLine[a0i = 0];
- } else {
- outputBits = codingLine[a0i = 1];
- }
-
- ++row;
- }
-
- // get a byte
- if (outputBits >= 8) {
- buf = (a0i & 1) ? 0x00 : 0xff;
- outputBits -= 8;
- if (outputBits == 0 && codingLine[a0i] < columns) {
- ++a0i;
- outputBits = codingLine[a0i] - codingLine[a0i - 1];
- }
- } else {
- bits = 8;
- buf = 0;
- do {
- if (outputBits > bits) {
- buf <<= bits;
- if (!(a0i & 1)) {
- buf |= 0xff >> (8 - bits);
- }
- outputBits -= bits;
- bits = 0;
- } else {
- buf <<= outputBits;
- if (!(a0i & 1)) {
- buf |= 0xff >> (8 - outputBits);
- }
- bits -= outputBits;
- outputBits = 0;
- if (codingLine[a0i] < columns) {
- ++a0i;
- outputBits = codingLine[a0i] - codingLine[a0i - 1];
- } else if (bits > 0) {
- buf <<= bits;
- bits = 0;
- }
- }
- } while (bits);
- }
- if (black) {
- buf ^= 0xff;
- }
- return buf;
-}
-
-short CCITTFaxStream::getTwoDimCode() {
- short code;
- CCITTCode *p;
- int n;
-
- code = 0; // make gcc happy
- if (endOfBlock) {
- code = lookBits(7);
- p = &twoDimTab1[code];
- if (p->bits > 0) {
- eatBits(p->bits);
- return p->n;
- }
- } else {
- for (n = 1; n <= 7; ++n) {
- code = lookBits(n);
- if (n < 7) {
- code <<= 7 - n;
- }
- p = &twoDimTab1[code];
- if (p->bits == n) {
- eatBits(n);
- return p->n;
- }
- }
- }
- error(getPos(), "Bad two dim code (%04x) in CCITTFax stream", code);
- return EOF;
-}
-
-short CCITTFaxStream::getWhiteCode() {
- short code;
- CCITTCode *p;
- int n;
-
- code = 0; // make gcc happy
- if (endOfBlock) {
- code = lookBits(12);
- if (code == EOF) {
- return 1;
- }
- if ((code >> 5) == 0) {
- p = &whiteTab1[code];
- } else {
- p = &whiteTab2[code >> 3];
- }
- if (p->bits > 0) {
- eatBits(p->bits);
- return p->n;
- }
- } else {
- for (n = 1; n <= 9; ++n) {
- code = lookBits(n);
- if (code == EOF) {
- return 1;
- }
- if (n < 9) {
- code <<= 9 - n;
- }
- p = &whiteTab2[code];
- if (p->bits == n) {
- eatBits(n);
- return p->n;
- }
- }
- for (n = 11; n <= 12; ++n) {
- code = lookBits(n);
- if (code == EOF) {
- return 1;
- }
- if (n < 12) {
- code <<= 12 - n;
- }
- p = &whiteTab1[code];
- if (p->bits == n) {
- eatBits(n);
- return p->n;
- }
- }
- }
- error(getPos(), "Bad white code (%04x) in CCITTFax stream", code);
- // eat a bit and return a positive number so that the caller doesn't
- // go into an infinite loop
- eatBits(1);
- return 1;
-}
-
-short CCITTFaxStream::getBlackCode() {
- short code;
- CCITTCode *p;
- int n;
-
- code = 0; // make gcc happy
- if (endOfBlock) {
- code = lookBits(13);
- if (code == EOF) {
- return 1;
- }
- if ((code >> 7) == 0) {
- p = &blackTab1[code];
- } else if ((code >> 9) == 0 && (code >> 7) != 0) {
- p = &blackTab2[(code >> 1) - 64];
- } else {
- p = &blackTab3[code >> 7];
- }
- if (p->bits > 0) {
- eatBits(p->bits);
- return p->n;
- }
- } else {
- for (n = 2; n <= 6; ++n) {
- code = lookBits(n);
- if (code == EOF) {
- return 1;
- }
- if (n < 6) {
- code <<= 6 - n;
- }
- p = &blackTab3[code];
- if (p->bits == n) {
- eatBits(n);
- return p->n;
- }
- }
- for (n = 7; n <= 12; ++n) {
- code = lookBits(n);
- if (code == EOF) {
- return 1;
- }
- if (n < 12) {
- code <<= 12 - n;
- }
- if (code >= 64) {
- p = &blackTab2[code - 64];
- if (p->bits == n) {
- eatBits(n);
- return p->n;
- }
- }
- }
- for (n = 10; n <= 13; ++n) {
- code = lookBits(n);
- if (code == EOF) {
- return 1;
- }
- if (n < 13) {
- code <<= 13 - n;
- }
- p = &blackTab1[code];
- if (p->bits == n) {
- eatBits(n);
- return p->n;
- }
- }
- }
- error(getPos(), "Bad black code (%04x) in CCITTFax stream", code);
- // eat a bit and return a positive number so that the caller doesn't
- // go into an infinite loop
- eatBits(1);
- return 1;
-}
-
-short CCITTFaxStream::lookBits(int n) {
- int c;
-
- while (inputBits < n) {
- if ((c = str->getChar()) == EOF) {
- if (inputBits == 0) {
- return EOF;
- }
- // near the end of the stream, the caller may ask for more bits
- // than are available, but there may still be a valid code in
- // however many bits are available -- we need to return correct
- // data in this case
- return (inputBuf << (n - inputBits)) & (0xffff >> (16 - n));
- }
- inputBuf = (inputBuf << 8) + c;
- inputBits += 8;
- }
- return (inputBuf >> (inputBits - n)) & (0xffff >> (16 - n));
-}
-
-GString *CCITTFaxStream::getPSFilter(int psLevel, char *indent) {
- GString *s;
- char s1[50];
-
- if (psLevel < 2) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("<< ");
- if (encoding != 0) {
- sprintf(s1, "/K %d ", encoding);
- s->append(s1);
- }
- if (endOfLine) {
- s->append("/EndOfLine true ");
- }
- if (byteAlign) {
- s->append("/EncodedByteAlign true ");
- }
- sprintf(s1, "/Columns %d ", columns);
- s->append(s1);
- if (rows != 0) {
- sprintf(s1, "/Rows %d ", rows);
- s->append(s1);
- }
- if (!endOfBlock) {
- s->append("/EndOfBlock false ");
- }
- if (black) {
- s->append("/BlackIs1 true ");
- }
- s->append(">> /CCITTFaxDecode filter\n");
- return s;
-}
-
-GBool CCITTFaxStream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-//------------------------------------------------------------------------
-// DCTStream
-//------------------------------------------------------------------------
-
-// IDCT constants (20.12 fixed point format)
-#define dctCos1 4017 // cos(pi/16)
-#define dctSin1 799 // sin(pi/16)
-#define dctCos3 3406 // cos(3*pi/16)
-#define dctSin3 2276 // sin(3*pi/16)
-#define dctCos6 1567 // cos(6*pi/16)
-#define dctSin6 3784 // sin(6*pi/16)
-#define dctSqrt2 5793 // sqrt(2)
-#define dctSqrt1d2 2896 // sqrt(2) / 2
-
-// color conversion parameters (16.16 fixed point format)
-#define dctCrToR 91881 // 1.4020
-#define dctCbToG -22553 // -0.3441363
-#define dctCrToG -46802 // -0.71413636
-#define dctCbToB 116130 // 1.772
-
-// clip [-256,511] --> [0,255]
-#define dctClipOffset 256
-static Guchar dctClip[768];
-static int dctClipInit = 0;
-
-// zig zag decode map
-static int dctZigZag[64] = {
- 0,
- 1, 8,
- 16, 9, 2,
- 3, 10, 17, 24,
- 32, 25, 18, 11, 4,
- 5, 12, 19, 26, 33, 40,
- 48, 41, 34, 27, 20, 13, 6,
- 7, 14, 21, 28, 35, 42, 49, 56,
- 57, 50, 43, 36, 29, 22, 15,
- 23, 30, 37, 44, 51, 58,
- 59, 52, 45, 38, 31,
- 39, 46, 53, 60,
- 61, 54, 47,
- 55, 62,
- 63
-};
-
-DCTStream::DCTStream(Stream *strA, GBool colorXformA):
- FilterStream(strA) {
- int i, j;
-
- colorXform = colorXformA;
- progressive = interleaved = gFalse;
- width = height = 0;
- mcuWidth = mcuHeight = 0;
- numComps = 0;
- comp = 0;
- x = y = dy = 0;
- for (i = 0; i < 4; ++i) {
- for (j = 0; j < 32; ++j) {
- rowBuf[i][j] = NULL;
- }
- frameBuf[i] = NULL;
- }
-
- if (!dctClipInit) {
- for (i = -256; i < 0; ++i)
- dctClip[dctClipOffset + i] = 0;
- for (i = 0; i < 256; ++i)
- dctClip[dctClipOffset + i] = i;
- for (i = 256; i < 512; ++i)
- dctClip[dctClipOffset + i] = 255;
- dctClipInit = 1;
- }
-}
-
-DCTStream::~DCTStream() {
- close();
- delete str;
-}
-
-void DCTStream::reset() {
- int i, j;
-
- str->reset();
-
- progressive = interleaved = gFalse;
- width = height = 0;
- numComps = 0;
- numQuantTables = 0;
- numDCHuffTables = 0;
- numACHuffTables = 0;
- gotJFIFMarker = gFalse;
- gotAdobeMarker = gFalse;
- restartInterval = 0;
-
- if (!readHeader()) {
- y = height;
- return;
- }
-
- // compute MCU size
- if (numComps == 1) {
- compInfo[0].hSample = compInfo[0].vSample = 1;
- }
- mcuWidth = compInfo[0].hSample;
- mcuHeight = compInfo[0].vSample;
- for (i = 1; i < numComps; ++i) {
- if (compInfo[i].hSample > mcuWidth) {
- mcuWidth = compInfo[i].hSample;
- }
- if (compInfo[i].vSample > mcuHeight) {
- mcuHeight = compInfo[i].vSample;
- }
- }
- mcuWidth *= 8;
- mcuHeight *= 8;
-
- // figure out color transform
- if (colorXform == -1) {
- if (numComps == 3) {
- if (gotJFIFMarker) {
- colorXform = 1;
- } else if (compInfo[0].id == 82 && compInfo[1].id == 71 &&
- compInfo[2].id == 66) { // ASCII "RGB"
- colorXform = 0;
- } else {
- colorXform = 1;
- }
- } else {
- colorXform = 0;
- }
- }
-
- if (progressive || !interleaved) {
-
- // allocate a buffer for the whole image
- bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
- bufHeight = ((height + mcuHeight - 1) / mcuHeight) * mcuHeight;
- if (bufWidth <= 0 || bufHeight <= 0 ||
- bufWidth > INT_MAX / bufWidth / (int)sizeof(int)) {
- error(getPos(), "Invalid image size in DCT stream");
- y = height;
- return;
- }
- for (i = 0; i < numComps; ++i) {
- frameBuf[i] = (int *)gmallocn(bufWidth * bufHeight, sizeof(int));
- memset(frameBuf[i], 0, bufWidth * bufHeight * sizeof(int));
- }
-
- // read the image data
- do {
- restartMarker = 0xd0;
- restart();
- readScan();
- } while (readHeader());
-
- // decode
- decodeImage();
-
- // initialize counters
- comp = 0;
- x = 0;
- y = 0;
-
- } else {
-
- // allocate a buffer for one row of MCUs
- bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
- for (i = 0; i < numComps; ++i) {
- for (j = 0; j < mcuHeight; ++j) {
- rowBuf[i][j] = (Guchar *)gmallocn(bufWidth, sizeof(Guchar));
- }
- }
-
- // initialize counters
- comp = 0;
- x = 0;
- y = 0;
- dy = mcuHeight;
-
- restartMarker = 0xd0;
- restart();
- }
-}
-
-void DCTStream::close() {
- int i, j;
-
- for (i = 0; i < 4; ++i) {
- for (j = 0; j < 32; ++j) {
- gfree(rowBuf[i][j]);
- rowBuf[i][j] = NULL;
- }
- gfree(frameBuf[i]);
- frameBuf[i] = NULL;
- }
- FilterStream::close();
-}
-
-int DCTStream::getChar() {
- int c;
-
- if (y >= height) {
- return EOF;
- }
- if (progressive || !interleaved) {
- c = frameBuf[comp][y * bufWidth + x];
- if (++comp == numComps) {
- comp = 0;
- if (++x == width) {
- x = 0;
- ++y;
- }
- }
- } else {
- if (dy >= mcuHeight) {
- if (!readMCURow()) {
- y = height;
- return EOF;
- }
- comp = 0;
- x = 0;
- dy = 0;
- }
- c = rowBuf[comp][dy][x];
- if (++comp == numComps) {
- comp = 0;
- if (++x == width) {
- x = 0;
- ++y;
- ++dy;
- if (y == height) {
- readTrailer();
- }
- }
- }
- }
- return c;
-}
-
-int DCTStream::lookChar() {
- if (y >= height) {
- return EOF;
- }
- if (progressive || !interleaved) {
- return frameBuf[comp][y * bufWidth + x];
- } else {
- if (dy >= mcuHeight) {
- if (!readMCURow()) {
- y = height;
- return EOF;
- }
- comp = 0;
- x = 0;
- dy = 0;
- }
- return rowBuf[comp][dy][x];
- }
-}
-
-void DCTStream::restart() {
- int i;
-
- inputBits = 0;
- restartCtr = restartInterval;
- for (i = 0; i < numComps; ++i) {
- compInfo[i].prevDC = 0;
- }
- eobRun = 0;
-}
-
-// Read one row of MCUs from a sequential JPEG stream.
-GBool DCTStream::readMCURow() {
- int data1[64];
- Guchar data2[64];
- Guchar *p1, *p2;
- int pY, pCb, pCr, pR, pG, pB;
- int h, v, horiz, vert, hSub, vSub;
- int x1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
- int c;
-
- for (x1 = 0; x1 < width; x1 += mcuWidth) {
-
- // deal with restart marker
- if (restartInterval > 0 && restartCtr == 0) {
- c = readMarker();
- if (c != restartMarker) {
- error(getPos(), "Bad DCT data: incorrect restart marker");
- return gFalse;
- }
- if (++restartMarker == 0xd8)
- restartMarker = 0xd0;
- restart();
- }
-
- // read one MCU
- for (cc = 0; cc < numComps; ++cc) {
- h = compInfo[cc].hSample;
- v = compInfo[cc].vSample;
- horiz = mcuWidth / h;
- vert = mcuHeight / v;
- hSub = horiz / 8;
- vSub = vert / 8;
- for (y2 = 0; y2 < mcuHeight; y2 += vert) {
- for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
- if (!readDataUnit(&dcHuffTables[scanInfo.dcHuffTable[cc]],
- &acHuffTables[scanInfo.acHuffTable[cc]],
- &compInfo[cc].prevDC,
- data1)) {
- return gFalse;
- }
- transformDataUnit(quantTables[compInfo[cc].quantTable],
- data1, data2);
- if (hSub == 1 && vSub == 1) {
- for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
- p1 = &rowBuf[cc][y2+y3][x1+x2];
- p1[0] = data2[i];
- p1[1] = data2[i+1];
- p1[2] = data2[i+2];
- p1[3] = data2[i+3];
- p1[4] = data2[i+4];
- p1[5] = data2[i+5];
- p1[6] = data2[i+6];
- p1[7] = data2[i+7];
- }
- } else if (hSub == 2 && vSub == 2) {
- for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
- p1 = &rowBuf[cc][y2+y3][x1+x2];
- p2 = &rowBuf[cc][y2+y3+1][x1+x2];
- p1[0] = p1[1] = p2[0] = p2[1] = data2[i];
- p1[2] = p1[3] = p2[2] = p2[3] = data2[i+1];
- p1[4] = p1[5] = p2[4] = p2[5] = data2[i+2];
- p1[6] = p1[7] = p2[6] = p2[7] = data2[i+3];
- p1[8] = p1[9] = p2[8] = p2[9] = data2[i+4];
- p1[10] = p1[11] = p2[10] = p2[11] = data2[i+5];
- p1[12] = p1[13] = p2[12] = p2[13] = data2[i+6];
- p1[14] = p1[15] = p2[14] = p2[15] = data2[i+7];
- }
- } else {
- i = 0;
- for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
- for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
- for (y5 = 0; y5 < vSub; ++y5)
- for (x5 = 0; x5 < hSub; ++x5)
- rowBuf[cc][y2+y4+y5][x1+x2+x4+x5] = data2[i];
- ++i;
- }
- }
- }
- }
- }
- }
- --restartCtr;
-
- // color space conversion
- if (colorXform) {
- // convert YCbCr to RGB
- if (numComps == 3) {
- for (y2 = 0; y2 < mcuHeight; ++y2) {
- for (x2 = 0; x2 < mcuWidth; ++x2) {
- pY = rowBuf[0][y2][x1+x2];
- pCb = rowBuf[1][y2][x1+x2] - 128;
- pCr = rowBuf[2][y2][x1+x2] - 128;
- pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
- rowBuf[0][y2][x1+x2] = dctClip[dctClipOffset + pR];
- pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
- rowBuf[1][y2][x1+x2] = dctClip[dctClipOffset + pG];
- pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
- rowBuf[2][y2][x1+x2] = dctClip[dctClipOffset + pB];
- }
- }
- // convert YCbCrK to CMYK (K is passed through unchanged)
- } else if (numComps == 4) {
- for (y2 = 0; y2 < mcuHeight; ++y2) {
- for (x2 = 0; x2 < mcuWidth; ++x2) {
- pY = rowBuf[0][y2][x1+x2];
- pCb = rowBuf[1][y2][x1+x2] - 128;
- pCr = rowBuf[2][y2][x1+x2] - 128;
- pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
- rowBuf[0][y2][x1+x2] = 255 - dctClip[dctClipOffset + pR];
- pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
- rowBuf[1][y2][x1+x2] = 255 - dctClip[dctClipOffset + pG];
- pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
- rowBuf[2][y2][x1+x2] = 255 - dctClip[dctClipOffset + pB];
- }
- }
- }
- }
- }
- return gTrue;
-}
-
-// Read one scan from a progressive or non-interleaved JPEG stream.
-void DCTStream::readScan() {
- int data[64];
- int x1, y1, dx1, dy1, x2, y2, y3, cc, i;
- int h, v, horiz, vert, vSub;
- int *p1;
- int c;
-
- if (scanInfo.numComps == 1) {
- for (cc = 0; cc < numComps; ++cc) {
- if (scanInfo.comp[cc]) {
- break;
- }
- }
- dx1 = mcuWidth / compInfo[cc].hSample;
- dy1 = mcuHeight / compInfo[cc].vSample;
- } else {
- dx1 = mcuWidth;
- dy1 = mcuHeight;
- }
-
- for (y1 = 0; y1 < height; y1 += dy1) {
- for (x1 = 0; x1 < width; x1 += dx1) {
-
- // deal with restart marker
- if (restartInterval > 0 && restartCtr == 0) {
- c = readMarker();
- if (c != restartMarker) {
- error(getPos(), "Bad DCT data: incorrect restart marker");
- return;
- }
- if (++restartMarker == 0xd8) {
- restartMarker = 0xd0;
- }
- restart();
- }
-
- // read one MCU
- for (cc = 0; cc < numComps; ++cc) {
- if (!scanInfo.comp[cc]) {
- continue;
- }
-
- h = compInfo[cc].hSample;
- v = compInfo[cc].vSample;
- horiz = mcuWidth / h;
- vert = mcuHeight / v;
- vSub = vert / 8;
- for (y2 = 0; y2 < dy1; y2 += vert) {
- for (x2 = 0; x2 < dx1; x2 += horiz) {
-
- // pull out the current values
- p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
- for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
- data[i] = p1[0];
- data[i+1] = p1[1];
- data[i+2] = p1[2];
- data[i+3] = p1[3];
- data[i+4] = p1[4];
- data[i+5] = p1[5];
- data[i+6] = p1[6];
- data[i+7] = p1[7];
- p1 += bufWidth * vSub;
- }
-
- // read one data unit
- if (progressive) {
- if (!readProgressiveDataUnit(
- &dcHuffTables[scanInfo.dcHuffTable[cc]],
- &acHuffTables[scanInfo.acHuffTable[cc]],
- &compInfo[cc].prevDC,
- data)) {
- return;
- }
- } else {
- if (!readDataUnit(&dcHuffTables[scanInfo.dcHuffTable[cc]],
- &acHuffTables[scanInfo.acHuffTable[cc]],
- &compInfo[cc].prevDC,
- data)) {
- return;
- }
- }
-
- // add the data unit into frameBuf
- p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
- for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
- p1[0] = data[i];
- p1[1] = data[i+1];
- p1[2] = data[i+2];
- p1[3] = data[i+3];
- p1[4] = data[i+4];
- p1[5] = data[i+5];
- p1[6] = data[i+6];
- p1[7] = data[i+7];
- p1 += bufWidth * vSub;
- }
- }
- }
- }
- --restartCtr;
- }
- }
-}
-
-// Read one data unit from a sequential JPEG stream.
-GBool DCTStream::readDataUnit(DCTHuffTable *dcHuffTable,
- DCTHuffTable *acHuffTable,
- int *prevDC, int data[64]) {
- int run, size, amp;
- int c;
- int i, j;
-
- if ((size = readHuffSym(dcHuffTable)) == 9999) {
- return gFalse;
- }
- if (size > 0) {
- if ((amp = readAmp(size)) == 9999) {
- return gFalse;
- }
- } else {
- amp = 0;
- }
- data[0] = *prevDC += amp;
- for (i = 1; i < 64; ++i) {
- data[i] = 0;
- }
- i = 1;
- while (i < 64) {
- run = 0;
- while ((c = readHuffSym(acHuffTable)) == 0xf0 && run < 0x30) {
- run += 0x10;
- }
- if (c == 9999) {
- return gFalse;
- }
- if (c == 0x00) {
- break;
- } else {
- run += (c >> 4) & 0x0f;
- size = c & 0x0f;
- amp = readAmp(size);
- if (amp == 9999) {
- return gFalse;
- }
- i += run;
- if (i < 64) {
- j = dctZigZag[i++];
- data[j] = amp;
- }
- }
- }
- return gTrue;
-}
-
-// Read one data unit from a sequential JPEG stream.
-GBool DCTStream::readProgressiveDataUnit(DCTHuffTable *dcHuffTable,
- DCTHuffTable *acHuffTable,
- int *prevDC, int data[64]) {
- int run, size, amp, bit, c;
- int i, j, k;
-
- // get the DC coefficient
- i = scanInfo.firstCoeff;
- if (i == 0) {
- if (scanInfo.ah == 0) {
- if ((size = readHuffSym(dcHuffTable)) == 9999) {
- return gFalse;
- }
- if (size > 0) {
- if ((amp = readAmp(size)) == 9999) {
- return gFalse;
- }
- } else {
- amp = 0;
- }
- data[0] += (*prevDC += amp) << scanInfo.al;
- } else {
- if ((bit = readBit()) == 9999) {
- return gFalse;
- }
- data[0] += bit << scanInfo.al;
- }
- ++i;
- }
- if (scanInfo.lastCoeff == 0) {
- return gTrue;
- }
-
- // check for an EOB run
- if (eobRun > 0) {
- while (i <= scanInfo.lastCoeff) {
- j = dctZigZag[i++];
- if (data[j] != 0) {
- if ((bit = readBit()) == EOF) {
- return gFalse;
- }
- if (bit) {
- data[j] += 1 << scanInfo.al;
- }
- }
- }
- --eobRun;
- return gTrue;
- }
-
- // read the AC coefficients
- while (i <= scanInfo.lastCoeff) {
- if ((c = readHuffSym(acHuffTable)) == 9999) {
- return gFalse;
- }
-
- // ZRL
- if (c == 0xf0) {
- k = 0;
- while (k < 16) {
- j = dctZigZag[i++];
- if (data[j] == 0) {
- ++k;
- } else {
- if ((bit = readBit()) == EOF) {
- return gFalse;
- }
- if (bit) {
- data[j] += 1 << scanInfo.al;
- }
- }
- }
-
- // EOB run
- } else if ((c & 0x0f) == 0x00) {
- j = c >> 4;
- eobRun = 0;
- for (k = 0; k < j; ++k) {
- if ((bit = readBit()) == EOF) {
- return gFalse;
- }
- eobRun = (eobRun << 1) | bit;
- }
- eobRun += 1 << j;
- while (i <= scanInfo.lastCoeff) {
- j = dctZigZag[i++];
- if (data[j] != 0) {
- if ((bit = readBit()) == EOF) {
- return gFalse;
- }
- if (bit) {
- data[j] += 1 << scanInfo.al;
- }
- }
- }
- --eobRun;
- break;
-
- // zero run and one AC coefficient
- } else {
- run = (c >> 4) & 0x0f;
- size = c & 0x0f;
- if ((amp = readAmp(size)) == 9999) {
- return gFalse;
- }
- k = 0;
- do {
- j = dctZigZag[i++];
- while (data[j] != 0) {
- if ((bit = readBit()) == EOF) {
- return gFalse;
- }
- if (bit) {
- data[j] += 1 << scanInfo.al;
- }
- j = dctZigZag[i++];
- }
- ++k;
- } while (k <= run);
- data[j] = amp << scanInfo.al;
- }
- }
-
- return gTrue;
-}
-
-// Decode a progressive JPEG image.
-void DCTStream::decodeImage() {
- int dataIn[64];
- Guchar dataOut[64];
- Gushort *quantTable;
- int pY, pCb, pCr, pR, pG, pB;
- int x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
- int h, v, horiz, vert, hSub, vSub;
- int *p0, *p1, *p2;
-
- for (y1 = 0; y1 < bufHeight; y1 += mcuHeight) {
- for (x1 = 0; x1 < bufWidth; x1 += mcuWidth) {
- for (cc = 0; cc < numComps; ++cc) {
- quantTable = quantTables[compInfo[cc].quantTable];
- h = compInfo[cc].hSample;
- v = compInfo[cc].vSample;
- horiz = mcuWidth / h;
- vert = mcuHeight / v;
- hSub = horiz / 8;
- vSub = vert / 8;
- for (y2 = 0; y2 < mcuHeight; y2 += vert) {
- for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
-
- // pull out the coded data unit
- p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
- for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
- dataIn[i] = p1[0];
- dataIn[i+1] = p1[1];
- dataIn[i+2] = p1[2];
- dataIn[i+3] = p1[3];
- dataIn[i+4] = p1[4];
- dataIn[i+5] = p1[5];
- dataIn[i+6] = p1[6];
- dataIn[i+7] = p1[7];
- p1 += bufWidth * vSub;
- }
-
- // transform
- transformDataUnit(quantTable, dataIn, dataOut);
-
- // store back into frameBuf, doing replication for
- // subsampled components
- p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
- if (hSub == 1 && vSub == 1) {
- for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
- p1[0] = dataOut[i] & 0xff;
- p1[1] = dataOut[i+1] & 0xff;
- p1[2] = dataOut[i+2] & 0xff;
- p1[3] = dataOut[i+3] & 0xff;
- p1[4] = dataOut[i+4] & 0xff;
- p1[5] = dataOut[i+5] & 0xff;
- p1[6] = dataOut[i+6] & 0xff;
- p1[7] = dataOut[i+7] & 0xff;
- p1 += bufWidth;
- }
- } else if (hSub == 2 && vSub == 2) {
- p2 = p1 + bufWidth;
- for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
- p1[0] = p1[1] = p2[0] = p2[1] = dataOut[i] & 0xff;
- p1[2] = p1[3] = p2[2] = p2[3] = dataOut[i+1] & 0xff;
- p1[4] = p1[5] = p2[4] = p2[5] = dataOut[i+2] & 0xff;
- p1[6] = p1[7] = p2[6] = p2[7] = dataOut[i+3] & 0xff;
- p1[8] = p1[9] = p2[8] = p2[9] = dataOut[i+4] & 0xff;
- p1[10] = p1[11] = p2[10] = p2[11] = dataOut[i+5] & 0xff;
- p1[12] = p1[13] = p2[12] = p2[13] = dataOut[i+6] & 0xff;
- p1[14] = p1[15] = p2[14] = p2[15] = dataOut[i+7] & 0xff;
- p1 += bufWidth * 2;
- p2 += bufWidth * 2;
- }
- } else {
- i = 0;
- for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
- for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
- p2 = p1 + x4;
- for (y5 = 0; y5 < vSub; ++y5) {
- for (x5 = 0; x5 < hSub; ++x5) {
- p2[x5] = dataOut[i] & 0xff;
- }
- p2 += bufWidth;
- }
- ++i;
- }
- p1 += bufWidth * vSub;
- }
- }
- }
- }
- }
-
- // color space conversion
- if (colorXform) {
- // convert YCbCr to RGB
- if (numComps == 3) {
- for (y2 = 0; y2 < mcuHeight; ++y2) {
- p0 = &frameBuf[0][(y1+y2) * bufWidth + x1];
- p1 = &frameBuf[1][(y1+y2) * bufWidth + x1];
- p2 = &frameBuf[2][(y1+y2) * bufWidth + x1];
- for (x2 = 0; x2 < mcuWidth; ++x2) {
- pY = *p0;
- pCb = *p1 - 128;
- pCr = *p2 - 128;
- pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
- *p0++ = dctClip[dctClipOffset + pR];
- pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
- 32768) >> 16;
- *p1++ = dctClip[dctClipOffset + pG];
- pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
- *p2++ = dctClip[dctClipOffset + pB];
- }
- }
- // convert YCbCrK to CMYK (K is passed through unchanged)
- } else if (numComps == 4) {
- for (y2 = 0; y2 < mcuHeight; ++y2) {
- p0 = &frameBuf[0][(y1+y2) * bufWidth + x1];
- p1 = &frameBuf[1][(y1+y2) * bufWidth + x1];
- p2 = &frameBuf[2][(y1+y2) * bufWidth + x1];
- for (x2 = 0; x2 < mcuWidth; ++x2) {
- pY = *p0;
- pCb = *p1 - 128;
- pCr = *p2 - 128;
- pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
- *p0++ = 255 - dctClip[dctClipOffset + pR];
- pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
- 32768) >> 16;
- *p1++ = 255 - dctClip[dctClipOffset + pG];
- pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
- *p2++ = 255 - dctClip[dctClipOffset + pB];
- }
- }
- }
- }
- }
- }
-}
-
-// Transform one data unit -- this performs the dequantization and
-// IDCT steps. This IDCT algorithm is taken from:
-// Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,
-// "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
-// IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,
-// 988-991.
-// The stage numbers mentioned in the comments refer to Figure 1 in this
-// paper.
-void DCTStream::transformDataUnit(Gushort *quantTable,
- int dataIn[64], Guchar dataOut[64]) {
- int v0, v1, v2, v3, v4, v5, v6, v7, t;
- int *p;
- int i;
-
- // dequant
- for (i = 0; i < 64; ++i) {
- dataIn[i] *= quantTable[i];
- }
-
- // inverse DCT on rows
- for (i = 0; i < 64; i += 8) {
- p = dataIn + i;
-
- // check for all-zero AC coefficients
- if (p[1] == 0 && p[2] == 0 && p[3] == 0 &&
- p[4] == 0 && p[5] == 0 && p[6] == 0 && p[7] == 0) {
- t = (dctSqrt2 * p[0] + 512) >> 10;
- p[0] = t;
- p[1] = t;
- p[2] = t;
- p[3] = t;
- p[4] = t;
- p[5] = t;
- p[6] = t;
- p[7] = t;
- continue;
- }
-
- // stage 4
- v0 = (dctSqrt2 * p[0] + 128) >> 8;
- v1 = (dctSqrt2 * p[4] + 128) >> 8;
- v2 = p[2];
- v3 = p[6];
- v4 = (dctSqrt1d2 * (p[1] - p[7]) + 128) >> 8;
- v7 = (dctSqrt1d2 * (p[1] + p[7]) + 128) >> 8;
- v5 = p[3] << 4;
- v6 = p[5] << 4;
-
- // stage 3
- t = (v0 - v1+ 1) >> 1;
- v0 = (v0 + v1 + 1) >> 1;
- v1 = t;
- t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8;
- v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8;
- v3 = t;
- t = (v4 - v6 + 1) >> 1;
- v4 = (v4 + v6 + 1) >> 1;
- v6 = t;
- t = (v7 + v5 + 1) >> 1;
- v5 = (v7 - v5 + 1) >> 1;
- v7 = t;
-
- // stage 2
- t = (v0 - v3 + 1) >> 1;
- v0 = (v0 + v3 + 1) >> 1;
- v3 = t;
- t = (v1 - v2 + 1) >> 1;
- v1 = (v1 + v2 + 1) >> 1;
- v2 = t;
- t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
- v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
- v7 = t;
- t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
- v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
- v6 = t;
-
- // stage 1
- p[0] = v0 + v7;
- p[7] = v0 - v7;
- p[1] = v1 + v6;
- p[6] = v1 - v6;
- p[2] = v2 + v5;
- p[5] = v2 - v5;
- p[3] = v3 + v4;
- p[4] = v3 - v4;
- }
-
- // inverse DCT on columns
- for (i = 0; i < 8; ++i) {
- p = dataIn + i;
-
- // check for all-zero AC coefficients
- if (p[1*8] == 0 && p[2*8] == 0 && p[3*8] == 0 &&
- p[4*8] == 0 && p[5*8] == 0 && p[6*8] == 0 && p[7*8] == 0) {
- t = (dctSqrt2 * dataIn[i+0] + 8192) >> 14;
- p[0*8] = t;
- p[1*8] = t;
- p[2*8] = t;
- p[3*8] = t;
- p[4*8] = t;
- p[5*8] = t;
- p[6*8] = t;
- p[7*8] = t;
- continue;
- }
-
- // stage 4
- v0 = (dctSqrt2 * p[0*8] + 2048) >> 12;
- v1 = (dctSqrt2 * p[4*8] + 2048) >> 12;
- v2 = p[2*8];
- v3 = p[6*8];
- v4 = (dctSqrt1d2 * (p[1*8] - p[7*8]) + 2048) >> 12;
- v7 = (dctSqrt1d2 * (p[1*8] + p[7*8]) + 2048) >> 12;
- v5 = p[3*8];
- v6 = p[5*8];
-
- // stage 3
- t = (v0 - v1 + 1) >> 1;
- v0 = (v0 + v1 + 1) >> 1;
- v1 = t;
- t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12;
- v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12;
- v3 = t;
- t = (v4 - v6 + 1) >> 1;
- v4 = (v4 + v6 + 1) >> 1;
- v6 = t;
- t = (v7 + v5 + 1) >> 1;
- v5 = (v7 - v5 + 1) >> 1;
- v7 = t;
-
- // stage 2
- t = (v0 - v3 + 1) >> 1;
- v0 = (v0 + v3 + 1) >> 1;
- v3 = t;
- t = (v1 - v2 + 1) >> 1;
- v1 = (v1 + v2 + 1) >> 1;
- v2 = t;
- t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
- v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
- v7 = t;
- t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
- v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
- v6 = t;
-
- // stage 1
- p[0*8] = v0 + v7;
- p[7*8] = v0 - v7;
- p[1*8] = v1 + v6;
- p[6*8] = v1 - v6;
- p[2*8] = v2 + v5;
- p[5*8] = v2 - v5;
- p[3*8] = v3 + v4;
- p[4*8] = v3 - v4;
- }
-
- // convert to 8-bit integers
- for (i = 0; i < 64; ++i) {
- dataOut[i] = dctClip[dctClipOffset + 128 + ((dataIn[i] + 8) >> 4)];
- }
-}
-
-int DCTStream::readHuffSym(DCTHuffTable *table) {
- Gushort code;
- int bit;
- int codeBits;
-
- code = 0;
- codeBits = 0;
- do {
- // add a bit to the code
- if ((bit = readBit()) == EOF)
- return 9999;
- code = (code << 1) + bit;
- ++codeBits;
-
- // look up code
- if (code - table->firstCode[codeBits] < table->numCodes[codeBits]) {
- code -= table->firstCode[codeBits];
- return table->sym[table->firstSym[codeBits] + code];
- }
- } while (codeBits < 16);
-
- error(getPos(), "Bad Huffman code in DCT stream");
- return 9999;
-}
-
-int DCTStream::readAmp(int size) {
- int amp, bit;
- int bits;
-
- amp = 0;
- for (bits = 0; bits < size; ++bits) {
- if ((bit = readBit()) == EOF)
- return 9999;
- amp = (amp << 1) + bit;
- }
- if (amp < (1 << (size - 1)))
- amp -= (1 << size) - 1;
- return amp;
-}
-
-int DCTStream::readBit() {
- int bit;
- int c, c2;
-
- if (inputBits == 0) {
- if ((c = str->getChar()) == EOF)
- return EOF;
- if (c == 0xff) {
- do {
- c2 = str->getChar();
- } while (c2 == 0xff);
- if (c2 != 0x00) {
- error(getPos(), "Bad DCT data: missing 00 after ff");
- return EOF;
- }
- }
- inputBuf = c;
- inputBits = 8;
- }
- bit = (inputBuf >> (inputBits - 1)) & 1;
- --inputBits;
- return bit;
-}
-
-GBool DCTStream::readHeader() {
- GBool doScan;
- int n;
- int c = 0;
- int i;
-
- // read headers
- doScan = gFalse;
- while (!doScan) {
- c = readMarker();
- switch (c) {
- case 0xc0: // SOF0 (sequential)
- case 0xc1: // SOF1 (extended sequential)
- if (!readBaselineSOF()) {
- return gFalse;
- }
- break;
- case 0xc2: // SOF2 (progressive)
- if (!readProgressiveSOF()) {
- return gFalse;
- }
- break;
- case 0xc4: // DHT
- if (!readHuffmanTables()) {
- return gFalse;
- }
- break;
- case 0xd8: // SOI
- break;
- case 0xd9: // EOI
- return gFalse;
- case 0xda: // SOS
- if (!readScanInfo()) {
- return gFalse;
- }
- doScan = gTrue;
- break;
- case 0xdb: // DQT
- if (!readQuantTables()) {
- return gFalse;
- }
- break;
- case 0xdd: // DRI
- if (!readRestartInterval()) {
- return gFalse;
- }
- break;
- case 0xe0: // APP0
- if (!readJFIFMarker()) {
- return gFalse;
- }
- break;
- case 0xee: // APP14
- if (!readAdobeMarker()) {
- return gFalse;
- }
- break;
- case EOF:
- error(getPos(), "Bad DCT header");
- return gFalse;
- default:
- // skip APPn / COM / etc.
- if (c >= 0xe0) {
- n = read16() - 2;
- for (i = 0; i < n; ++i) {
- str->getChar();
- }
- } else {
- error(getPos(), "Unknown DCT marker <%02x>", c);
- return gFalse;
- }
- break;
- }
- }
-
- return gTrue;
-}
-
-GBool DCTStream::readBaselineSOF() {
- int length;
- int prec;
- int i;
- int c;
-
- length = read16();
- prec = str->getChar();
- height = read16();
- width = read16();
- numComps = str->getChar();
- if (numComps <= 0 || numComps > 4) {
- error(getPos(), "Bad number of components in DCT stream");
- numComps = 0;
- return gFalse;
- }
- if (prec != 8) {
- error(getPos(), "Bad DCT precision %d", prec);
- return gFalse;
- }
- for (i = 0; i < numComps; ++i) {
- compInfo[i].id = str->getChar();
- c = str->getChar();
- compInfo[i].hSample = (c >> 4) & 0x0f;
- compInfo[i].vSample = c & 0x0f;
- compInfo[i].quantTable = str->getChar();
- }
- progressive = gFalse;
- return gTrue;
-}
-
-GBool DCTStream::readProgressiveSOF() {
- int length;
- int prec;
- int i;
- int c;
-
- length = read16();
- prec = str->getChar();
- height = read16();
- width = read16();
- numComps = str->getChar();
- if (numComps <= 0 || numComps > 4) {
- error(getPos(), "Bad number of components in DCT stream");
- numComps = 0;
- return gFalse;
- }
- if (prec != 8) {
- error(getPos(), "Bad DCT precision %d", prec);
- return gFalse;
- }
- for (i = 0; i < numComps; ++i) {
- compInfo[i].id = str->getChar();
- c = str->getChar();
- compInfo[i].hSample = (c >> 4) & 0x0f;
- compInfo[i].vSample = c & 0x0f;
- compInfo[i].quantTable = str->getChar();
- }
- progressive = gTrue;
- return gTrue;
-}
-
-GBool DCTStream::readScanInfo() {
- int length;
- int id, c;
- int i, j;
-
- length = read16() - 2;
- scanInfo.numComps = str->getChar();
- if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
- error(getPos(), "Bad number of components in DCT stream");
- scanInfo.numComps = 0;
- return gFalse;
- }
- --length;
- if (length != 2 * scanInfo.numComps + 3) {
- error(getPos(), "Bad DCT scan info block");
- return gFalse;
- }
- interleaved = scanInfo.numComps == numComps;
- for (j = 0; j < numComps; ++j) {
- scanInfo.comp[j] = gFalse;
- }
- for (i = 0; i < scanInfo.numComps; ++i) {
- id = str->getChar();
- // some (broken) DCT streams reuse ID numbers, but at least they
- // keep the components in order, so we check compInfo[i] first to
- // work around the problem
- if (id == compInfo[i].id) {
- j = i;
- } else {
- for (j = 0; j < numComps; ++j) {
- if (id == compInfo[j].id) {
- break;
- }
- }
- if (j == numComps) {
- error(getPos(), "Bad DCT component ID in scan info block");
- return gFalse;
- }
- }
- scanInfo.comp[j] = gTrue;
- c = str->getChar();
- scanInfo.dcHuffTable[j] = (c >> 4) & 0x0f;
- scanInfo.acHuffTable[j] = c & 0x0f;
- }
- scanInfo.firstCoeff = str->getChar();
- scanInfo.lastCoeff = str->getChar();
- if (scanInfo.firstCoeff < 0 || scanInfo.lastCoeff > 63 ||
- scanInfo.firstCoeff > scanInfo.lastCoeff) {
- error(getPos(), "Bad DCT coefficient numbers in scan info block");
- return gFalse;
- }
- c = str->getChar();
- scanInfo.ah = (c >> 4) & 0x0f;
- scanInfo.al = c & 0x0f;
- return gTrue;
-}
-
-GBool DCTStream::readQuantTables() {
- int length, prec, i, index;
-
- length = read16() - 2;
- while (length > 0) {
- index = str->getChar();
- prec = (index >> 4) & 0x0f;
- index &= 0x0f;
- if (prec > 1 || index >= 4) {
- error(getPos(), "Bad DCT quantization table");
- return gFalse;
- }
- if (index == numQuantTables) {
- numQuantTables = index + 1;
- }
- for (i = 0; i < 64; ++i) {
- if (prec) {
- quantTables[index][dctZigZag[i]] = read16();
- } else {
- quantTables[index][dctZigZag[i]] = str->getChar();
- }
- }
- if (prec) {
- length -= 129;
- } else {
- length -= 65;
- }
- }
- return gTrue;
-}
-
-GBool DCTStream::readHuffmanTables() {
- DCTHuffTable *tbl;
- int length;
- int index;
- Gushort code;
- Guchar sym;
- int i;
- int c;
-
- length = read16() - 2;
- while (length > 0) {
- index = str->getChar();
- --length;
- if ((index & 0x0f) >= 4) {
- error(getPos(), "Bad DCT Huffman table");
- return gFalse;
- }
- if (index & 0x10) {
- index &= 0x0f;
- if (index >= numACHuffTables)
- numACHuffTables = index+1;
- tbl = &acHuffTables[index];
- } else {
- index &= 0x0f;
- if (index >= numDCHuffTables)
- numDCHuffTables = index+1;
- tbl = &dcHuffTables[index];
- }
- sym = 0;
- code = 0;
- for (i = 1; i <= 16; ++i) {
- c = str->getChar();
- tbl->firstSym[i] = sym;
- tbl->firstCode[i] = code;
- tbl->numCodes[i] = c;
- sym += c;
- code = (code + c) << 1;
- }
- length -= 16;
- for (i = 0; i < sym; ++i)
- tbl->sym[i] = str->getChar();
- length -= sym;
- }
- return gTrue;
-}
-
-GBool DCTStream::readRestartInterval() {
- int length;
-
- length = read16();
- if (length != 4) {
- error(getPos(), "Bad DCT restart interval");
- return gFalse;
- }
- restartInterval = read16();
- return gTrue;
-}
-
-GBool DCTStream::readJFIFMarker() {
- int length, i;
- char buf[5];
- int c;
-
- length = read16();
- length -= 2;
- if (length >= 5) {
- for (i = 0; i < 5; ++i) {
- if ((c = str->getChar()) == EOF) {
- error(getPos(), "Bad DCT APP0 marker");
- return gFalse;
- }
- buf[i] = c;
- }
- length -= 5;
- if (!memcmp(buf, "JFIF\0", 5)) {
- gotJFIFMarker = gTrue;
- }
- }
- while (length > 0) {
- if (str->getChar() == EOF) {
- error(getPos(), "Bad DCT APP0 marker");
- return gFalse;
- }
- --length;
- }
- return gTrue;
-}
-
-GBool DCTStream::readAdobeMarker() {
- int length, i;
- char buf[12];
- int c;
-
- length = read16();
- if (length < 14) {
- goto err;
- }
- for (i = 0; i < 12; ++i) {
- if ((c = str->getChar()) == EOF) {
- goto err;
- }
- buf[i] = c;
- }
- if (strncmp(buf, "Adobe", 5)) {
- goto err;
- }
- colorXform = buf[11];
- gotAdobeMarker = gTrue;
- for (i = 14; i < length; ++i) {
- if (str->getChar() == EOF) {
- goto err;
- }
- }
- return gTrue;
-
- err:
- error(getPos(), "Bad DCT Adobe APP14 marker");
- return gFalse;
-}
-
-GBool DCTStream::readTrailer() {
- int c;
-
- c = readMarker();
- if (c != 0xd9) { // EOI
- error(getPos(), "Bad DCT trailer");
- return gFalse;
- }
- return gTrue;
-}
-
-int DCTStream::readMarker() {
- int c;
-
- do {
- do {
- c = str->getChar();
- } while (c != 0xff && c != EOF);
- do {
- c = str->getChar();
- } while (c == 0xff);
- } while (c == 0x00);
- return c;
-}
-
-int DCTStream::read16() {
- int c1, c2;
-
- if ((c1 = str->getChar()) == EOF)
- return EOF;
- if ((c2 = str->getChar()) == EOF)
- return EOF;
- return (c1 << 8) + c2;
-}
-
-GString *DCTStream::getPSFilter(int psLevel, char *indent) {
- GString *s;
-
- if (psLevel < 2) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("<< >> /DCTDecode filter\n");
- return s;
-}
-
-GBool DCTStream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-//------------------------------------------------------------------------
-// FlateStream
-//------------------------------------------------------------------------
-
-int FlateStream::codeLenCodeMap[flateMaxCodeLenCodes] = {
- 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
-};
-
-FlateDecode FlateStream::lengthDecode[flateMaxLitCodes-257] = {
- {0, 3},
- {0, 4},
- {0, 5},
- {0, 6},
- {0, 7},
- {0, 8},
- {0, 9},
- {0, 10},
- {1, 11},
- {1, 13},
- {1, 15},
- {1, 17},
- {2, 19},
- {2, 23},
- {2, 27},
- {2, 31},
- {3, 35},
- {3, 43},
- {3, 51},
- {3, 59},
- {4, 67},
- {4, 83},
- {4, 99},
- {4, 115},
- {5, 131},
- {5, 163},
- {5, 195},
- {5, 227},
- {0, 258},
- {0, 258},
- {0, 258}
-};
-
-FlateDecode FlateStream::distDecode[flateMaxDistCodes] = {
- { 0, 1},
- { 0, 2},
- { 0, 3},
- { 0, 4},
- { 1, 5},
- { 1, 7},
- { 2, 9},
- { 2, 13},
- { 3, 17},
- { 3, 25},
- { 4, 33},
- { 4, 49},
- { 5, 65},
- { 5, 97},
- { 6, 129},
- { 6, 193},
- { 7, 257},
- { 7, 385},
- { 8, 513},
- { 8, 769},
- { 9, 1025},
- { 9, 1537},
- {10, 2049},
- {10, 3073},
- {11, 4097},
- {11, 6145},
- {12, 8193},
- {12, 12289},
- {13, 16385},
- {13, 24577}
-};
-
-static FlateCode flateFixedLitCodeTabCodes[512] = {
- {7, 0x0100},
- {8, 0x0050},
- {8, 0x0010},
- {8, 0x0118},
- {7, 0x0110},
- {8, 0x0070},
- {8, 0x0030},
- {9, 0x00c0},
- {7, 0x0108},
- {8, 0x0060},
- {8, 0x0020},
- {9, 0x00a0},
- {8, 0x0000},
- {8, 0x0080},
- {8, 0x0040},
- {9, 0x00e0},
- {7, 0x0104},
- {8, 0x0058},
- {8, 0x0018},
- {9, 0x0090},
- {7, 0x0114},
- {8, 0x0078},
- {8, 0x0038},
- {9, 0x00d0},
- {7, 0x010c},
- {8, 0x0068},
- {8, 0x0028},
- {9, 0x00b0},
- {8, 0x0008},
- {8, 0x0088},
- {8, 0x0048},
- {9, 0x00f0},
- {7, 0x0102},
- {8, 0x0054},
- {8, 0x0014},
- {8, 0x011c},
- {7, 0x0112},
- {8, 0x0074},
- {8, 0x0034},
- {9, 0x00c8},
- {7, 0x010a},
- {8, 0x0064},
- {8, 0x0024},
- {9, 0x00a8},
- {8, 0x0004},
- {8, 0x0084},
- {8, 0x0044},
- {9, 0x00e8},
- {7, 0x0106},
- {8, 0x005c},
- {8, 0x001c},
- {9, 0x0098},
- {7, 0x0116},
- {8, 0x007c},
- {8, 0x003c},
- {9, 0x00d8},
- {7, 0x010e},
- {8, 0x006c},
- {8, 0x002c},
- {9, 0x00b8},
- {8, 0x000c},
- {8, 0x008c},
- {8, 0x004c},
- {9, 0x00f8},
- {7, 0x0101},
- {8, 0x0052},
- {8, 0x0012},
- {8, 0x011a},
- {7, 0x0111},
- {8, 0x0072},
- {8, 0x0032},
- {9, 0x00c4},
- {7, 0x0109},
- {8, 0x0062},
- {8, 0x0022},
- {9, 0x00a4},
- {8, 0x0002},
- {8, 0x0082},
- {8, 0x0042},
- {9, 0x00e4},
- {7, 0x0105},
- {8, 0x005a},
- {8, 0x001a},
- {9, 0x0094},
- {7, 0x0115},
- {8, 0x007a},
- {8, 0x003a},
- {9, 0x00d4},
- {7, 0x010d},
- {8, 0x006a},
- {8, 0x002a},
- {9, 0x00b4},
- {8, 0x000a},
- {8, 0x008a},
- {8, 0x004a},
- {9, 0x00f4},
- {7, 0x0103},
- {8, 0x0056},
- {8, 0x0016},
- {8, 0x011e},
- {7, 0x0113},
- {8, 0x0076},
- {8, 0x0036},
- {9, 0x00cc},
- {7, 0x010b},
- {8, 0x0066},
- {8, 0x0026},
- {9, 0x00ac},
- {8, 0x0006},
- {8, 0x0086},
- {8, 0x0046},
- {9, 0x00ec},
- {7, 0x0107},
- {8, 0x005e},
- {8, 0x001e},
- {9, 0x009c},
- {7, 0x0117},
- {8, 0x007e},
- {8, 0x003e},
- {9, 0x00dc},
- {7, 0x010f},
- {8, 0x006e},
- {8, 0x002e},
- {9, 0x00bc},
- {8, 0x000e},
- {8, 0x008e},
- {8, 0x004e},
- {9, 0x00fc},
- {7, 0x0100},
- {8, 0x0051},
- {8, 0x0011},
- {8, 0x0119},
- {7, 0x0110},
- {8, 0x0071},
- {8, 0x0031},
- {9, 0x00c2},
- {7, 0x0108},
- {8, 0x0061},
- {8, 0x0021},
- {9, 0x00a2},
- {8, 0x0001},
- {8, 0x0081},
- {8, 0x0041},
- {9, 0x00e2},
- {7, 0x0104},
- {8, 0x0059},
- {8, 0x0019},
- {9, 0x0092},
- {7, 0x0114},
- {8, 0x0079},
- {8, 0x0039},
- {9, 0x00d2},
- {7, 0x010c},
- {8, 0x0069},
- {8, 0x0029},
- {9, 0x00b2},
- {8, 0x0009},
- {8, 0x0089},
- {8, 0x0049},
- {9, 0x00f2},
- {7, 0x0102},
- {8, 0x0055},
- {8, 0x0015},
- {8, 0x011d},
- {7, 0x0112},
- {8, 0x0075},
- {8, 0x0035},
- {9, 0x00ca},
- {7, 0x010a},
- {8, 0x0065},
- {8, 0x0025},
- {9, 0x00aa},
- {8, 0x0005},
- {8, 0x0085},
- {8, 0x0045},
- {9, 0x00ea},
- {7, 0x0106},
- {8, 0x005d},
- {8, 0x001d},
- {9, 0x009a},
- {7, 0x0116},
- {8, 0x007d},
- {8, 0x003d},
- {9, 0x00da},
- {7, 0x010e},
- {8, 0x006d},
- {8, 0x002d},
- {9, 0x00ba},
- {8, 0x000d},
- {8, 0x008d},
- {8, 0x004d},
- {9, 0x00fa},
- {7, 0x0101},
- {8, 0x0053},
- {8, 0x0013},
- {8, 0x011b},
- {7, 0x0111},
- {8, 0x0073},
- {8, 0x0033},
- {9, 0x00c6},
- {7, 0x0109},
- {8, 0x0063},
- {8, 0x0023},
- {9, 0x00a6},
- {8, 0x0003},
- {8, 0x0083},
- {8, 0x0043},
- {9, 0x00e6},
- {7, 0x0105},
- {8, 0x005b},
- {8, 0x001b},
- {9, 0x0096},
- {7, 0x0115},
- {8, 0x007b},
- {8, 0x003b},
- {9, 0x00d6},
- {7, 0x010d},
- {8, 0x006b},
- {8, 0x002b},
- {9, 0x00b6},
- {8, 0x000b},
- {8, 0x008b},
- {8, 0x004b},
- {9, 0x00f6},
- {7, 0x0103},
- {8, 0x0057},
- {8, 0x0017},
- {8, 0x011f},
- {7, 0x0113},
- {8, 0x0077},
- {8, 0x0037},
- {9, 0x00ce},
- {7, 0x010b},
- {8, 0x0067},
- {8, 0x0027},
- {9, 0x00ae},
- {8, 0x0007},
- {8, 0x0087},
- {8, 0x0047},
- {9, 0x00ee},
- {7, 0x0107},
- {8, 0x005f},
- {8, 0x001f},
- {9, 0x009e},
- {7, 0x0117},
- {8, 0x007f},
- {8, 0x003f},
- {9, 0x00de},
- {7, 0x010f},
- {8, 0x006f},
- {8, 0x002f},
- {9, 0x00be},
- {8, 0x000f},
- {8, 0x008f},
- {8, 0x004f},
- {9, 0x00fe},
- {7, 0x0100},
- {8, 0x0050},
- {8, 0x0010},
- {8, 0x0118},
- {7, 0x0110},
- {8, 0x0070},
- {8, 0x0030},
- {9, 0x00c1},
- {7, 0x0108},
- {8, 0x0060},
- {8, 0x0020},
- {9, 0x00a1},
- {8, 0x0000},
- {8, 0x0080},
- {8, 0x0040},
- {9, 0x00e1},
- {7, 0x0104},
- {8, 0x0058},
- {8, 0x0018},
- {9, 0x0091},
- {7, 0x0114},
- {8, 0x0078},
- {8, 0x0038},
- {9, 0x00d1},
- {7, 0x010c},
- {8, 0x0068},
- {8, 0x0028},
- {9, 0x00b1},
- {8, 0x0008},
- {8, 0x0088},
- {8, 0x0048},
- {9, 0x00f1},
- {7, 0x0102},
- {8, 0x0054},
- {8, 0x0014},
- {8, 0x011c},
- {7, 0x0112},
- {8, 0x0074},
- {8, 0x0034},
- {9, 0x00c9},
- {7, 0x010a},
- {8, 0x0064},
- {8, 0x0024},
- {9, 0x00a9},
- {8, 0x0004},
- {8, 0x0084},
- {8, 0x0044},
- {9, 0x00e9},
- {7, 0x0106},
- {8, 0x005c},
- {8, 0x001c},
- {9, 0x0099},
- {7, 0x0116},
- {8, 0x007c},
- {8, 0x003c},
- {9, 0x00d9},
- {7, 0x010e},
- {8, 0x006c},
- {8, 0x002c},
- {9, 0x00b9},
- {8, 0x000c},
- {8, 0x008c},
- {8, 0x004c},
- {9, 0x00f9},
- {7, 0x0101},
- {8, 0x0052},
- {8, 0x0012},
- {8, 0x011a},
- {7, 0x0111},
- {8, 0x0072},
- {8, 0x0032},
- {9, 0x00c5},
- {7, 0x0109},
- {8, 0x0062},
- {8, 0x0022},
- {9, 0x00a5},
- {8, 0x0002},
- {8, 0x0082},
- {8, 0x0042},
- {9, 0x00e5},
- {7, 0x0105},
- {8, 0x005a},
- {8, 0x001a},
- {9, 0x0095},
- {7, 0x0115},
- {8, 0x007a},
- {8, 0x003a},
- {9, 0x00d5},
- {7, 0x010d},
- {8, 0x006a},
- {8, 0x002a},
- {9, 0x00b5},
- {8, 0x000a},
- {8, 0x008a},
- {8, 0x004a},
- {9, 0x00f5},
- {7, 0x0103},
- {8, 0x0056},
- {8, 0x0016},
- {8, 0x011e},
- {7, 0x0113},
- {8, 0x0076},
- {8, 0x0036},
- {9, 0x00cd},
- {7, 0x010b},
- {8, 0x0066},
- {8, 0x0026},
- {9, 0x00ad},
- {8, 0x0006},
- {8, 0x0086},
- {8, 0x0046},
- {9, 0x00ed},
- {7, 0x0107},
- {8, 0x005e},
- {8, 0x001e},
- {9, 0x009d},
- {7, 0x0117},
- {8, 0x007e},
- {8, 0x003e},
- {9, 0x00dd},
- {7, 0x010f},
- {8, 0x006e},
- {8, 0x002e},
- {9, 0x00bd},
- {8, 0x000e},
- {8, 0x008e},
- {8, 0x004e},
- {9, 0x00fd},
- {7, 0x0100},
- {8, 0x0051},
- {8, 0x0011},
- {8, 0x0119},
- {7, 0x0110},
- {8, 0x0071},
- {8, 0x0031},
- {9, 0x00c3},
- {7, 0x0108},
- {8, 0x0061},
- {8, 0x0021},
- {9, 0x00a3},
- {8, 0x0001},
- {8, 0x0081},
- {8, 0x0041},
- {9, 0x00e3},
- {7, 0x0104},
- {8, 0x0059},
- {8, 0x0019},
- {9, 0x0093},
- {7, 0x0114},
- {8, 0x0079},
- {8, 0x0039},
- {9, 0x00d3},
- {7, 0x010c},
- {8, 0x0069},
- {8, 0x0029},
- {9, 0x00b3},
- {8, 0x0009},
- {8, 0x0089},
- {8, 0x0049},
- {9, 0x00f3},
- {7, 0x0102},
- {8, 0x0055},
- {8, 0x0015},
- {8, 0x011d},
- {7, 0x0112},
- {8, 0x0075},
- {8, 0x0035},
- {9, 0x00cb},
- {7, 0x010a},
- {8, 0x0065},
- {8, 0x0025},
- {9, 0x00ab},
- {8, 0x0005},
- {8, 0x0085},
- {8, 0x0045},
- {9, 0x00eb},
- {7, 0x0106},
- {8, 0x005d},
- {8, 0x001d},
- {9, 0x009b},
- {7, 0x0116},
- {8, 0x007d},
- {8, 0x003d},
- {9, 0x00db},
- {7, 0x010e},
- {8, 0x006d},
- {8, 0x002d},
- {9, 0x00bb},
- {8, 0x000d},
- {8, 0x008d},
- {8, 0x004d},
- {9, 0x00fb},
- {7, 0x0101},
- {8, 0x0053},
- {8, 0x0013},
- {8, 0x011b},
- {7, 0x0111},
- {8, 0x0073},
- {8, 0x0033},
- {9, 0x00c7},
- {7, 0x0109},
- {8, 0x0063},
- {8, 0x0023},
- {9, 0x00a7},
- {8, 0x0003},
- {8, 0x0083},
- {8, 0x0043},
- {9, 0x00e7},
- {7, 0x0105},
- {8, 0x005b},
- {8, 0x001b},
- {9, 0x0097},
- {7, 0x0115},
- {8, 0x007b},
- {8, 0x003b},
- {9, 0x00d7},
- {7, 0x010d},
- {8, 0x006b},
- {8, 0x002b},
- {9, 0x00b7},
- {8, 0x000b},
- {8, 0x008b},
- {8, 0x004b},
- {9, 0x00f7},
- {7, 0x0103},
- {8, 0x0057},
- {8, 0x0017},
- {8, 0x011f},
- {7, 0x0113},
- {8, 0x0077},
- {8, 0x0037},
- {9, 0x00cf},
- {7, 0x010b},
- {8, 0x0067},
- {8, 0x0027},
- {9, 0x00af},
- {8, 0x0007},
- {8, 0x0087},
- {8, 0x0047},
- {9, 0x00ef},
- {7, 0x0107},
- {8, 0x005f},
- {8, 0x001f},
- {9, 0x009f},
- {7, 0x0117},
- {8, 0x007f},
- {8, 0x003f},
- {9, 0x00df},
- {7, 0x010f},
- {8, 0x006f},
- {8, 0x002f},
- {9, 0x00bf},
- {8, 0x000f},
- {8, 0x008f},
- {8, 0x004f},
- {9, 0x00ff}
-};
-
-FlateHuffmanTab FlateStream::fixedLitCodeTab = {
- flateFixedLitCodeTabCodes, 9
-};
-
-static FlateCode flateFixedDistCodeTabCodes[32] = {
- {5, 0x0000},
- {5, 0x0010},
- {5, 0x0008},
- {5, 0x0018},
- {5, 0x0004},
- {5, 0x0014},
- {5, 0x000c},
- {5, 0x001c},
- {5, 0x0002},
- {5, 0x0012},
- {5, 0x000a},
- {5, 0x001a},
- {5, 0x0006},
- {5, 0x0016},
- {5, 0x000e},
- {0, 0x0000},
- {5, 0x0001},
- {5, 0x0011},
- {5, 0x0009},
- {5, 0x0019},
- {5, 0x0005},
- {5, 0x0015},
- {5, 0x000d},
- {5, 0x001d},
- {5, 0x0003},
- {5, 0x0013},
- {5, 0x000b},
- {5, 0x001b},
- {5, 0x0007},
- {5, 0x0017},
- {5, 0x000f},
- {0, 0x0000}
-};
-
-FlateHuffmanTab FlateStream::fixedDistCodeTab = {
- flateFixedDistCodeTabCodes, 5
-};
-
-FlateStream::FlateStream(Stream *strA, int predictor, int columns,
- int colors, int bits):
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
- if (!pred->isOk()) {
- delete pred;
- pred = NULL;
- }
- } else {
- pred = NULL;
- }
- litCodeTab.codes = NULL;
- distCodeTab.codes = NULL;
- memset(buf, 0, flateWindow);
-}
-
-FlateStream::~FlateStream() {
- if (litCodeTab.codes != fixedLitCodeTab.codes) {
- gfree(litCodeTab.codes);
- }
- if (distCodeTab.codes != fixedDistCodeTab.codes) {
- gfree(distCodeTab.codes);
- }
- if (pred) {
- delete pred;
- }
- delete str;
-}
-
-void FlateStream::reset() {
- int cmf, flg;
-
- index = 0;
- remain = 0;
- codeBuf = 0;
- codeSize = 0;
- compressedBlock = gFalse;
- endOfBlock = gTrue;
- eof = gTrue;
-
- str->reset();
-
- // read header
- //~ need to look at window size?
- endOfBlock = eof = gTrue;
- cmf = str->getChar();
- flg = str->getChar();
- if (cmf == EOF || flg == EOF)
- return;
- if ((cmf & 0x0f) != 0x08) {
- error(getPos(), "Unknown compression method in flate stream");
- return;
- }
- if ((((cmf << 8) + flg) % 31) != 0) {
- error(getPos(), "Bad FCHECK in flate stream");
- return;
- }
- if (flg & 0x20) {
- error(getPos(), "FDICT bit set in flate stream");
- return;
- }
-
- eof = gFalse;
-}
-
-int FlateStream::getChar() {
- int c;
-
- if (pred) {
- return pred->getChar();
- }
- while (remain == 0) {
- if (endOfBlock && eof)
- return EOF;
- readSome();
- }
- c = buf[index];
- index = (index + 1) & flateMask;
- --remain;
- return c;
-}
-
-int FlateStream::lookChar() {
- int c;
-
- if (pred) {
- return pred->lookChar();
- }
- while (remain == 0) {
- if (endOfBlock && eof)
- return EOF;
- readSome();
- }
- c = buf[index];
- return c;
-}
-
-int FlateStream::getRawChar() {
- int c;
-
- while (remain == 0) {
- if (endOfBlock && eof)
- return EOF;
- readSome();
- }
- c = buf[index];
- index = (index + 1) & flateMask;
- --remain;
- return c;
-}
-
-GString *FlateStream::getPSFilter(int psLevel, char *indent) {
- GString *s;
-
- if (psLevel < 3 || pred) {
- return NULL;
- }
- if (!(s = str->getPSFilter(psLevel, indent))) {
- return NULL;
- }
- s->append(indent)->append("<< >> /FlateDecode filter\n");
- return s;
-}
-
-GBool FlateStream::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-void FlateStream::readSome() {
- int code1, code2;
- int len, dist;
- int i, j, k;
- int c;
-
- if (endOfBlock) {
- if (!startBlock())
- return;
- }
-
- if (compressedBlock) {
- if ((code1 = getHuffmanCodeWord(&litCodeTab)) == EOF)
- goto err;
- if (code1 < 256) {
- buf[index] = code1;
- remain = 1;
- } else if (code1 == 256) {
- endOfBlock = gTrue;
- remain = 0;
- } else {
- code1 -= 257;
- code2 = lengthDecode[code1].bits;
- if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
- goto err;
- len = lengthDecode[code1].first + code2;
- if ((code1 = getHuffmanCodeWord(&distCodeTab)) == EOF)
- goto err;
- code2 = distDecode[code1].bits;
- if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
- goto err;
- dist = distDecode[code1].first + code2;
- i = index;
- j = (index - dist) & flateMask;
- for (k = 0; k < len; ++k) {
- buf[i] = buf[j];
- i = (i + 1) & flateMask;
- j = (j + 1) & flateMask;
- }
- remain = len;
- }
-
- } else {
- len = (blockLen < flateWindow) ? blockLen : flateWindow;
- for (i = 0, j = index; i < len; ++i, j = (j + 1) & flateMask) {
- if ((c = str->getChar()) == EOF) {
- endOfBlock = eof = gTrue;
- break;
- }
- buf[j] = c & 0xff;
- }
- remain = i;
- blockLen -= len;
- if (blockLen == 0)
- endOfBlock = gTrue;
- }
-
- return;
-
-err:
- error(getPos(), "Unexpected end of file in flate stream");
- endOfBlock = eof = gTrue;
- remain = 0;
-}
-
-GBool FlateStream::startBlock() {
- int blockHdr;
- int c;
- int check;
-
- // free the code tables from the previous block
- if (litCodeTab.codes != fixedLitCodeTab.codes) {
- gfree(litCodeTab.codes);
- }
- litCodeTab.codes = NULL;
- if (distCodeTab.codes != fixedDistCodeTab.codes) {
- gfree(distCodeTab.codes);
- }
- distCodeTab.codes = NULL;
-
- // read block header
- blockHdr = getCodeWord(3);
- if (blockHdr & 1)
- eof = gTrue;
- blockHdr >>= 1;
-
- // uncompressed block
- if (blockHdr == 0) {
- compressedBlock = gFalse;
- if ((c = str->getChar()) == EOF)
- goto err;
- blockLen = c & 0xff;
- if ((c = str->getChar()) == EOF)
- goto err;
- blockLen |= (c & 0xff) << 8;
- if ((c = str->getChar()) == EOF)
- goto err;
- check = c & 0xff;
- if ((c = str->getChar()) == EOF)
- goto err;
- check |= (c & 0xff) << 8;
- if (check != (~blockLen & 0xffff))
- error(getPos(), "Bad uncompressed block length in flate stream");
- codeBuf = 0;
- codeSize = 0;
-
- // compressed block with fixed codes
- } else if (blockHdr == 1) {
- compressedBlock = gTrue;
- loadFixedCodes();
-
- // compressed block with dynamic codes
- } else if (blockHdr == 2) {
- compressedBlock = gTrue;
- if (!readDynamicCodes()) {
- goto err;
- }
-
- // unknown block type
- } else {
- goto err;
- }
-
- endOfBlock = gFalse;
- return gTrue;
-
-err:
- error(getPos(), "Bad block header in flate stream");
- endOfBlock = eof = gTrue;
- return gFalse;
-}
-
-void FlateStream::loadFixedCodes() {
- litCodeTab.codes = fixedLitCodeTab.codes;
- litCodeTab.maxLen = fixedLitCodeTab.maxLen;
- distCodeTab.codes = fixedDistCodeTab.codes;
- distCodeTab.maxLen = fixedDistCodeTab.maxLen;
-}
-
-GBool FlateStream::readDynamicCodes() {
- int numCodeLenCodes;
- int numLitCodes;
- int numDistCodes;
- int codeLenCodeLengths[flateMaxCodeLenCodes];
- FlateHuffmanTab codeLenCodeTab;
- int len, repeat, code;
- int i;
-
- codeLenCodeTab.codes = NULL;
-
- // read lengths
- if ((numLitCodes = getCodeWord(5)) == EOF) {
- goto err;
- }
- numLitCodes += 257;
- if ((numDistCodes = getCodeWord(5)) == EOF) {
- goto err;
- }
- numDistCodes += 1;
- if ((numCodeLenCodes = getCodeWord(4)) == EOF) {
- goto err;
- }
- numCodeLenCodes += 4;
- if (numLitCodes > flateMaxLitCodes ||
- numDistCodes > flateMaxDistCodes ||
- numCodeLenCodes > flateMaxCodeLenCodes) {
- goto err;
- }
-
- // build the code length code table
- for (i = 0; i < flateMaxCodeLenCodes; ++i) {
- codeLenCodeLengths[i] = 0;
- }
- for (i = 0; i < numCodeLenCodes; ++i) {
- if ((codeLenCodeLengths[codeLenCodeMap[i]] = getCodeWord(3)) == -1) {
- goto err;
- }
- }
- compHuffmanCodes(codeLenCodeLengths, flateMaxCodeLenCodes, &codeLenCodeTab);
-
- // build the literal and distance code tables
- len = 0;
- repeat = 0;
- i = 0;
- while (i < numLitCodes + numDistCodes) {
- if ((code = getHuffmanCodeWord(&codeLenCodeTab)) == EOF) {
- goto err;
- }
- if (code == 16) {
- if ((repeat = getCodeWord(2)) == EOF) {
- goto err;
- }
- repeat += 3;
- if (i + repeat > numLitCodes + numDistCodes) {
- goto err;
- }
- for (; repeat > 0; --repeat) {
- codeLengths[i++] = len;
- }
- } else if (code == 17) {
- if ((repeat = getCodeWord(3)) == EOF) {
- goto err;
- }
- repeat += 3;
- if (i + repeat > numLitCodes + numDistCodes) {
- goto err;
- }
- len = 0;
- for (; repeat > 0; --repeat) {
- codeLengths[i++] = 0;
- }
- } else if (code == 18) {
- if ((repeat = getCodeWord(7)) == EOF) {
- goto err;
- }
- repeat += 11;
- if (i + repeat > numLitCodes + numDistCodes) {
- goto err;
- }
- len = 0;
- for (; repeat > 0; --repeat) {
- codeLengths[i++] = 0;
- }
- } else {
- codeLengths[i++] = len = code;
- }
- }
- compHuffmanCodes(codeLengths, numLitCodes, &litCodeTab);
- compHuffmanCodes(codeLengths + numLitCodes, numDistCodes, &distCodeTab);
-
- gfree(codeLenCodeTab.codes);
- return gTrue;
-
-err:
- error(getPos(), "Bad dynamic code table in flate stream");
- gfree(codeLenCodeTab.codes);
- return gFalse;
-}
-
-// Convert an array <lengths> of <n> lengths, in value order, into a
-// Huffman code lookup table.
-void FlateStream::compHuffmanCodes(int *lengths, int n, FlateHuffmanTab *tab) {
- int tabSize, len, code, code2, skip, val, i, t;
-
- // find max code length
- tab->maxLen = 0;
- for (val = 0; val < n; ++val) {
- if (lengths[val] > tab->maxLen) {
- tab->maxLen = lengths[val];
- }
- }
-
- // allocate the table
- tabSize = 1 << tab->maxLen;
- tab->codes = (FlateCode *)gmallocn(tabSize, sizeof(FlateCode));
-
- // clear the table
- for (i = 0; i < tabSize; ++i) {
- tab->codes[i].len = 0;
- tab->codes[i].val = 0;
- }
-
- // build the table
- for (len = 1, code = 0, skip = 2;
- len <= tab->maxLen;
- ++len, code <<= 1, skip <<= 1) {
- for (val = 0; val < n; ++val) {
- if (lengths[val] == len) {
-
- // bit-reverse the code
- code2 = 0;
- t = code;
- for (i = 0; i < len; ++i) {
- code2 = (code2 << 1) | (t & 1);
- t >>= 1;
- }
-
- // fill in the table entries
- for (i = code2; i < tabSize; i += skip) {
- tab->codes[i].len = (Gushort)len;
- tab->codes[i].val = (Gushort)val;
- }
-
- ++code;
- }
- }
- }
-}
-
-int FlateStream::getHuffmanCodeWord(FlateHuffmanTab *tab) {
- FlateCode *code;
- int c;
-
- while (codeSize < tab->maxLen) {
- if ((c = str->getChar()) == EOF) {
- break;
- }
- codeBuf |= (c & 0xff) << codeSize;
- codeSize += 8;
- }
- code = &tab->codes[codeBuf & ((1 << tab->maxLen) - 1)];
- if (codeSize == 0 || codeSize < code->len || code->len == 0) {
- return EOF;
- }
- codeBuf >>= code->len;
- codeSize -= code->len;
- return (int)code->val;
-}
-
-int FlateStream::getCodeWord(int bits) {
- int c;
-
- while (codeSize < bits) {
- if ((c = str->getChar()) == EOF)
- return EOF;
- codeBuf |= (c & 0xff) << codeSize;
- codeSize += 8;
- }
- c = codeBuf & ((1 << bits) - 1);
- codeBuf >>= bits;
- codeSize -= bits;
- return c;
-}
-
-//------------------------------------------------------------------------
-// EOFStream
-//------------------------------------------------------------------------
-
-EOFStream::EOFStream(Stream *strA):
- FilterStream(strA) {
-}
-
-EOFStream::~EOFStream() {
- delete str;
-}
-
-//------------------------------------------------------------------------
-// FixedLengthEncoder
-//------------------------------------------------------------------------
-
-FixedLengthEncoder::FixedLengthEncoder(Stream *strA, int lengthA):
- FilterStream(strA) {
- length = lengthA;
- count = 0;
-}
-
-FixedLengthEncoder::~FixedLengthEncoder() {
- if (str->isEncoder())
- delete str;
-}
-
-void FixedLengthEncoder::reset() {
- str->reset();
- count = 0;
-}
-
-int FixedLengthEncoder::getChar() {
- if (length >= 0 && count >= length)
- return EOF;
- ++count;
- return str->getChar();
-}
-
-int FixedLengthEncoder::lookChar() {
- if (length >= 0 && count >= length)
- return EOF;
- return str->getChar();
-}
-
-GBool FixedLengthEncoder::isBinary(GBool /*last*/) {
- return str->isBinary(gTrue);
-}
-
-//------------------------------------------------------------------------
-// ASCIIHexEncoder
-//------------------------------------------------------------------------
-
-ASCIIHexEncoder::ASCIIHexEncoder(Stream *strA):
- FilterStream(strA) {
- bufPtr = bufEnd = buf;
- lineLen = 0;
- eof = gFalse;
-}
-
-ASCIIHexEncoder::~ASCIIHexEncoder() {
- if (str->isEncoder()) {
- delete str;
- }
-}
-
-void ASCIIHexEncoder::reset() {
- str->reset();
- bufPtr = bufEnd = buf;
- lineLen = 0;
- eof = gFalse;
-}
-
-GBool ASCIIHexEncoder::fillBuf() {
- static char *hex = "0123456789abcdef";
- int c;
-
- if (eof) {
- return gFalse;
- }
- bufPtr = bufEnd = buf;
- if ((c = str->getChar()) == EOF) {
- *bufEnd++ = '>';
- eof = gTrue;
- } else {
- if (lineLen >= 64) {
- *bufEnd++ = '\n';
- lineLen = 0;
- }
- *bufEnd++ = hex[(c >> 4) & 0x0f];
- *bufEnd++ = hex[c & 0x0f];
- lineLen += 2;
- }
- return gTrue;
-}
-
-//------------------------------------------------------------------------
-// ASCII85Encoder
-//------------------------------------------------------------------------
-
-ASCII85Encoder::ASCII85Encoder(Stream *strA):
- FilterStream(strA) {
- bufPtr = bufEnd = buf;
- lineLen = 0;
- eof = gFalse;
-}
-
-ASCII85Encoder::~ASCII85Encoder() {
- if (str->isEncoder())
- delete str;
-}
-
-void ASCII85Encoder::reset() {
- str->reset();
- bufPtr = bufEnd = buf;
- lineLen = 0;
- eof = gFalse;
-}
-
-GBool ASCII85Encoder::fillBuf() {
- Guint t;
- char buf1[5];
- int c0, c1, c2, c3;
- int n, i;
-
- if (eof) {
- return gFalse;
- }
- c0 = str->getChar();
- c1 = str->getChar();
- c2 = str->getChar();
- c3 = str->getChar();
- bufPtr = bufEnd = buf;
- if (c3 == EOF) {
- if (c0 == EOF) {
- n = 0;
- t = 0;
- } else {
- if (c1 == EOF) {
- n = 1;
- t = c0 << 24;
- } else if (c2 == EOF) {
- n = 2;
- t = (c0 << 24) | (c1 << 16);
- } else {
- n = 3;
- t = (c0 << 24) | (c1 << 16) | (c2 << 8);
- }
- for (i = 4; i >= 0; --i) {
- buf1[i] = (char)(t % 85 + 0x21);
- t /= 85;
- }
- for (i = 0; i <= n; ++i) {
- *bufEnd++ = buf1[i];
- if (++lineLen == 65) {
- *bufEnd++ = '\n';
- lineLen = 0;
- }
- }
- }
- *bufEnd++ = '~';
- *bufEnd++ = '>';
- eof = gTrue;
- } else {
- t = (c0 << 24) | (c1 << 16) | (c2 << 8) | c3;
- if (t == 0) {
- *bufEnd++ = 'z';
- if (++lineLen == 65) {
- *bufEnd++ = '\n';
- lineLen = 0;
- }
- } else {
- for (i = 4; i >= 0; --i) {
- buf1[i] = (char)(t % 85 + 0x21);
- t /= 85;
- }
- for (i = 0; i <= 4; ++i) {
- *bufEnd++ = buf1[i];
- if (++lineLen == 65) {
- *bufEnd++ = '\n';
- lineLen = 0;
- }
- }
- }
- }
- return gTrue;
-}
-
-//------------------------------------------------------------------------
-// RunLengthEncoder
-//------------------------------------------------------------------------
-
-RunLengthEncoder::RunLengthEncoder(Stream *strA):
- FilterStream(strA) {
- bufPtr = bufEnd = nextEnd = buf;
- eof = gFalse;
-}
-
-RunLengthEncoder::~RunLengthEncoder() {
- if (str->isEncoder())
- delete str;
-}
-
-void RunLengthEncoder::reset() {
- str->reset();
- bufPtr = bufEnd = nextEnd = buf;
- eof = gFalse;
-}
-
-//
-// When fillBuf finishes, buf[] looks like this:
-// +-----+--------------+-----------------+--
-// + tag | ... data ... | next 0, 1, or 2 |
-// +-----+--------------+-----------------+--
-// ^ ^ ^
-// bufPtr bufEnd nextEnd
-//
-GBool RunLengthEncoder::fillBuf() {
- int c, c1, c2;
- int n;
-
- // already hit EOF?
- if (eof)
- return gFalse;
-
- // grab two bytes
- if (nextEnd < bufEnd + 1) {
- if ((c1 = str->getChar()) == EOF) {
- eof = gTrue;
- return gFalse;
- }
- } else {
- c1 = bufEnd[0] & 0xff;
- }
- if (nextEnd < bufEnd + 2) {
- if ((c2 = str->getChar()) == EOF) {
- eof = gTrue;
- buf[0] = 0;
- buf[1] = c1;
- bufPtr = buf;
- bufEnd = &buf[2];
- return gTrue;
- }
- } else {
- c2 = bufEnd[1] & 0xff;
- }
-
- // check for repeat
- c = 0; // make gcc happy
- if (c1 == c2) {
- n = 2;
- while (n < 128 && (c = str->getChar()) == c1)
- ++n;
- buf[0] = (char)(257 - n);
- buf[1] = c1;
- bufEnd = &buf[2];
- if (c == EOF) {
- eof = gTrue;
- } else if (n < 128) {
- buf[2] = c;
- nextEnd = &buf[3];
- } else {
- nextEnd = bufEnd;
- }
-
- // get up to 128 chars
- } else {
- buf[1] = c1;
- buf[2] = c2;
- n = 2;
- while (n < 128) {
- if ((c = str->getChar()) == EOF) {
- eof = gTrue;
- break;
- }
- ++n;
- buf[n] = c;
- if (buf[n] == buf[n-1])
- break;
- }
- if (buf[n] == buf[n-1]) {
- buf[0] = (char)(n-2-1);
- bufEnd = &buf[n-1];
- nextEnd = &buf[n+1];
- } else {
- buf[0] = (char)(n-1);
- bufEnd = nextEnd = &buf[n+1];
- }
- }
- bufPtr = buf;
- return gTrue;
-}
diff --git a/kpdf/xpdf/xpdf/Stream.cpp b/kpdf/xpdf/xpdf/Stream.cpp
new file mode 100644
index 00000000..0d85a766
--- /dev/null
+++ b/kpdf/xpdf/xpdf/Stream.cpp
@@ -0,0 +1,4698 @@
+//========================================================================
+//
+// Stream.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <limits.h>
+#ifndef WIN32
+#include <unistd.h>
+#endif
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "gfile.h"
+#include "config.h"
+#include "Error.h"
+#include "Object.h"
+#include "Lexer.h"
+#include "GfxState.h"
+#include "Stream.h"
+#include "JBIG2Stream.h"
+#include "JPXStream.h"
+#include "Stream-CCITT.h"
+
+#ifdef __DJGPP__
+static GBool setDJSYSFLAGS = gFalse;
+#endif
+
+#ifdef VMS
+#ifdef __GNUC__
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif
+#endif
+
+//------------------------------------------------------------------------
+// Stream (base class)
+//------------------------------------------------------------------------
+
+Stream::Stream() {
+ ref = 1;
+}
+
+Stream::~Stream() {
+}
+
+void Stream::close() {
+}
+
+int Stream::getRawChar() {
+ error(-1, "Internal: called getRawChar() on non-predictor stream");
+ return EOF;
+}
+
+char *Stream::getLine(char *buf, int size) {
+ int i;
+ int c;
+
+ if (lookChar() == EOF)
+ return NULL;
+ for (i = 0; i < size - 1; ++i) {
+ c = getChar();
+ if (c == EOF || c == '\n')
+ break;
+ if (c == '\r') {
+ if ((c = lookChar()) == '\n')
+ getChar();
+ break;
+ }
+ buf[i] = c;
+ }
+ buf[i] = '\0';
+ return buf;
+}
+
+GString *Stream::getPSFilter(int /*psLevel*/, char * /*indent*/) {
+ return new GString();
+}
+
+Stream *Stream::addFilters(Object *dict) {
+ Object obj, obj2;
+ Object params, params2;
+ Stream *str;
+ int i;
+
+ str = this;
+ dict->dictLookup("Filter", &obj);
+ if (obj.isNull()) {
+ obj.free();
+ dict->dictLookup("F", &obj);
+ }
+ dict->dictLookup("DecodeParms", &params);
+ if (params.isNull()) {
+ params.free();
+ dict->dictLookup("DP", &params);
+ }
+ if (obj.isName()) {
+ str = makeFilter(obj.getName(), str, &params);
+ } else if (obj.isArray()) {
+ for (i = 0; i < obj.arrayGetLength(); ++i) {
+ obj.arrayGet(i, &obj2);
+ if (params.isArray())
+ params.arrayGet(i, &params2);
+ else
+ params2.initNull();
+ if (obj2.isName()) {
+ str = makeFilter(obj2.getName(), str, &params2);
+ } else {
+ error(getPos(), "Bad filter name");
+ str = new EOFStream(str);
+ }
+ obj2.free();
+ params2.free();
+ }
+ } else if (!obj.isNull()) {
+ error(getPos(), "Bad 'Filter' attribute in stream");
+ }
+ obj.free();
+ params.free();
+
+ return str;
+}
+
+Stream *Stream::makeFilter(char *name, Stream *str, Object *params) {
+ int pred; // parameters
+ int colors;
+ int bits;
+ int early;
+ int encoding;
+ GBool endOfLine, byteAlign, endOfBlock, black;
+ int columns, rows;
+ int colorXform;
+ Object globals, obj;
+
+ if (!strcmp(name, "ASCIIHexDecode") || !strcmp(name, "AHx")) {
+ str = new ASCIIHexStream(str);
+ } else if (!strcmp(name, "ASCII85Decode") || !strcmp(name, "A85")) {
+ str = new ASCII85Stream(str);
+ } else if (!strcmp(name, "LZWDecode") || !strcmp(name, "LZW")) {
+ pred = 1;
+ columns = 1;
+ colors = 1;
+ bits = 8;
+ early = 1;
+ if (params->isDict()) {
+ params->dictLookup("Predictor", &obj);
+ if (obj.isInt())
+ pred = obj.getInt();
+ obj.free();
+ params->dictLookup("Columns", &obj);
+ if (obj.isInt())
+ columns = obj.getInt();
+ obj.free();
+ params->dictLookup("Colors", &obj);
+ if (obj.isInt())
+ colors = obj.getInt();
+ obj.free();
+ params->dictLookup("BitsPerComponent", &obj);
+ if (obj.isInt())
+ bits = obj.getInt();
+ obj.free();
+ params->dictLookup("EarlyChange", &obj);
+ if (obj.isInt())
+ early = obj.getInt();
+ obj.free();
+ }
+ str = new LZWStream(str, pred, columns, colors, bits, early);
+ } else if (!strcmp(name, "RunLengthDecode") || !strcmp(name, "RL")) {
+ str = new RunLengthStream(str);
+ } else if (!strcmp(name, "CCITTFaxDecode") || !strcmp(name, "CCF")) {
+ encoding = 0;
+ endOfLine = gFalse;
+ byteAlign = gFalse;
+ columns = 1728;
+ rows = 0;
+ endOfBlock = gTrue;
+ black = gFalse;
+ if (params->isDict()) {
+ params->dictLookup("K", &obj);
+ if (obj.isInt()) {
+ encoding = obj.getInt();
+ }
+ obj.free();
+ params->dictLookup("EndOfLine", &obj);
+ if (obj.isBool()) {
+ endOfLine = obj.getBool();
+ }
+ obj.free();
+ params->dictLookup("EncodedByteAlign", &obj);
+ if (obj.isBool()) {
+ byteAlign = obj.getBool();
+ }
+ obj.free();
+ params->dictLookup("Columns", &obj);
+ if (obj.isInt()) {
+ columns = obj.getInt();
+ }
+ obj.free();
+ params->dictLookup("Rows", &obj);
+ if (obj.isInt()) {
+ rows = obj.getInt();
+ }
+ obj.free();
+ params->dictLookup("EndOfBlock", &obj);
+ if (obj.isBool()) {
+ endOfBlock = obj.getBool();
+ }
+ obj.free();
+ params->dictLookup("BlackIs1", &obj);
+ if (obj.isBool()) {
+ black = obj.getBool();
+ }
+ obj.free();
+ }
+ str = new CCITTFaxStream(str, encoding, endOfLine, byteAlign,
+ columns, rows, endOfBlock, black);
+ } else if (!strcmp(name, "DCTDecode") || !strcmp(name, "DCT")) {
+ colorXform = -1;
+ if (params->isDict()) {
+ if (params->dictLookup("ColorTransform", &obj)->isInt()) {
+ colorXform = obj.getInt();
+ }
+ obj.free();
+ }
+ str = new DCTStream(str, colorXform);
+ } else if (!strcmp(name, "FlateDecode") || !strcmp(name, "Fl")) {
+ pred = 1;
+ columns = 1;
+ colors = 1;
+ bits = 8;
+ if (params->isDict()) {
+ params->dictLookup("Predictor", &obj);
+ if (obj.isInt())
+ pred = obj.getInt();
+ obj.free();
+ params->dictLookup("Columns", &obj);
+ if (obj.isInt())
+ columns = obj.getInt();
+ obj.free();
+ params->dictLookup("Colors", &obj);
+ if (obj.isInt())
+ colors = obj.getInt();
+ obj.free();
+ params->dictLookup("BitsPerComponent", &obj);
+ if (obj.isInt())
+ bits = obj.getInt();
+ obj.free();
+ }
+ str = new FlateStream(str, pred, columns, colors, bits);
+ } else if (!strcmp(name, "JBIG2Decode")) {
+ if (params->isDict()) {
+ params->dictLookup("JBIG2Globals", &globals);
+ }
+ str = new JBIG2Stream(str, &globals);
+ globals.free();
+ } else if (!strcmp(name, "JPXDecode")) {
+ str = new JPXStream(str);
+ } else {
+ error(getPos(), "Unknown filter '%s'", name);
+ str = new EOFStream(str);
+ }
+ return str;
+}
+
+//------------------------------------------------------------------------
+// BaseStream
+//------------------------------------------------------------------------
+
+BaseStream::BaseStream(Object *dictA) {
+ dict = *dictA;
+}
+
+BaseStream::~BaseStream() {
+ dict.free();
+}
+
+//------------------------------------------------------------------------
+// FilterStream
+//------------------------------------------------------------------------
+
+FilterStream::FilterStream(Stream *strA) {
+ str = strA;
+}
+
+FilterStream::~FilterStream() {
+}
+
+void FilterStream::close() {
+ str->close();
+}
+
+void FilterStream::setPos(Guint /*pos*/, int /*dir*/) {
+ error(-1, "Internal: called setPos() on FilterStream");
+}
+
+//------------------------------------------------------------------------
+// ImageStream
+//------------------------------------------------------------------------
+
+ImageStream::ImageStream(Stream *strA, int widthA, int nCompsA, int nBitsA) {
+ int imgLineSize;
+
+ str = strA;
+ width = widthA;
+ nComps = nCompsA;
+ nBits = nBitsA;
+
+ nVals = width * nComps;
+ if (nBits == 1) {
+ imgLineSize = (nVals + 7) & ~7;
+ } else {
+ imgLineSize = nVals;
+ }
+ if (width > INT_MAX / nComps) {
+ // force a call to gmallocn(-1,...), which will throw an exception
+ imgLineSize = -1;
+ }
+ imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar));
+ imgIdx = nVals;
+}
+
+ImageStream::~ImageStream() {
+ gfree(imgLine);
+}
+
+void ImageStream::reset() {
+ str->reset();
+}
+
+GBool ImageStream::getPixel(Guchar *pix) {
+ int i;
+
+ if (imgIdx >= nVals) {
+ getLine();
+ imgIdx = 0;
+ }
+ for (i = 0; i < nComps; ++i) {
+ pix[i] = imgLine[imgIdx++];
+ }
+ return gTrue;
+}
+
+Guchar *ImageStream::getLine() {
+ Gulong buf, bitMask;
+ int bits;
+ int c;
+ int i;
+
+ if (nBits == 1) {
+ for (i = 0; i < nVals; i += 8) {
+ c = str->getChar();
+ imgLine[i+0] = (Guchar)((c >> 7) & 1);
+ imgLine[i+1] = (Guchar)((c >> 6) & 1);
+ imgLine[i+2] = (Guchar)((c >> 5) & 1);
+ imgLine[i+3] = (Guchar)((c >> 4) & 1);
+ imgLine[i+4] = (Guchar)((c >> 3) & 1);
+ imgLine[i+5] = (Guchar)((c >> 2) & 1);
+ imgLine[i+6] = (Guchar)((c >> 1) & 1);
+ imgLine[i+7] = (Guchar)(c & 1);
+ }
+ } else if (nBits == 8) {
+ for (i = 0; i < nVals; ++i) {
+ imgLine[i] = str->getChar();
+ }
+ } else {
+ bitMask = (1 << nBits) - 1;
+ buf = 0;
+ bits = 0;
+ for (i = 0; i < nVals; ++i) {
+ if (bits < nBits) {
+ buf = (buf << 8) | (str->getChar() & 0xff);
+ bits += 8;
+ }
+ imgLine[i] = (Guchar)((buf >> (bits - nBits)) & bitMask);
+ bits -= nBits;
+ }
+ }
+ return imgLine;
+}
+
+void ImageStream::skipLine() {
+ int n, i;
+
+ n = (nVals * nBits + 7) >> 3;
+ for (i = 0; i < n; ++i) {
+ str->getChar();
+ }
+}
+
+//------------------------------------------------------------------------
+// StreamPredictor
+//------------------------------------------------------------------------
+
+StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
+ int widthA, int nCompsA, int nBitsA) {
+ str = strA;
+ predictor = predictorA;
+ width = widthA;
+ nComps = nCompsA;
+ nBits = nBitsA;
+ predLine = NULL;
+ ok = gFalse;
+
+ nVals = width * nComps;
+ pixBytes = (nComps * nBits + 7) >> 3;
+ rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
+ if (width <= 0 || nComps <= 0 || nBits <= 0 ||
+ nComps > gfxColorMaxComps || nBits > 16 ||
+ width >= INT_MAX / nComps || // check for overflow in nVals
+ nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
+ return;
+ }
+ predLine = (Guchar *)gmalloc(rowBytes);
+ memset(predLine, 0, rowBytes);
+ predIdx = rowBytes;
+
+ ok = gTrue;
+}
+
+StreamPredictor::~StreamPredictor() {
+ gfree(predLine);
+}
+
+int StreamPredictor::lookChar() {
+ if (predIdx >= rowBytes) {
+ if (!getNextLine()) {
+ return EOF;
+ }
+ }
+ return predLine[predIdx];
+}
+
+int StreamPredictor::getChar() {
+ if (predIdx >= rowBytes) {
+ if (!getNextLine()) {
+ return EOF;
+ }
+ }
+ return predLine[predIdx++];
+}
+
+GBool StreamPredictor::getNextLine() {
+ int curPred;
+ Guchar upLeftBuf[gfxColorMaxComps * 2 + 1];
+ int left, up, upLeft, p, pa, pb, pc;
+ int c;
+ Gulong inBuf, outBuf, bitMask;
+ int inBits, outBits;
+ int i, j, k, kk;
+
+ // get PNG optimum predictor number
+ if (predictor >= 10) {
+ if ((curPred = str->getRawChar()) == EOF) {
+ return gFalse;
+ }
+ curPred += 10;
+ } else {
+ curPred = predictor;
+ }
+
+ // read the raw line, apply PNG (byte) predictor
+ memset(upLeftBuf, 0, pixBytes + 1);
+ for (i = pixBytes; i < rowBytes; ++i) {
+ for (j = pixBytes; j > 0; --j) {
+ upLeftBuf[j] = upLeftBuf[j-1];
+ }
+ upLeftBuf[0] = predLine[i];
+ if ((c = str->getRawChar()) == EOF) {
+ if (i > pixBytes) {
+ // this ought to return false, but some (broken) PDF files
+ // contain truncated image data, and Adobe apparently reads the
+ // last partial line
+ break;
+ }
+ return gFalse;
+ }
+ switch (curPred) {
+ case 11: // PNG sub
+ predLine[i] = predLine[i - pixBytes] + (Guchar)c;
+ break;
+ case 12: // PNG up
+ predLine[i] = predLine[i] + (Guchar)c;
+ break;
+ case 13: // PNG average
+ predLine[i] = ((predLine[i - pixBytes] + predLine[i]) >> 1) +
+ (Guchar)c;
+ break;
+ case 14: // PNG Paeth
+ left = predLine[i - pixBytes];
+ up = predLine[i];
+ upLeft = upLeftBuf[pixBytes];
+ p = left + up - upLeft;
+ if ((pa = p - left) < 0)
+ pa = -pa;
+ if ((pb = p - up) < 0)
+ pb = -pb;
+ if ((pc = p - upLeft) < 0)
+ pc = -pc;
+ if (pa <= pb && pa <= pc)
+ predLine[i] = left + (Guchar)c;
+ else if (pb <= pc)
+ predLine[i] = up + (Guchar)c;
+ else
+ predLine[i] = upLeft + (Guchar)c;
+ break;
+ case 10: // PNG none
+ default: // no predictor or TIFF predictor
+ predLine[i] = (Guchar)c;
+ break;
+ }
+ }
+
+ // apply TIFF (component) predictor
+ if (predictor == 2) {
+ if (nBits == 1) {
+ inBuf = predLine[pixBytes - 1];
+ for (i = pixBytes; i < rowBytes; i += 8) {
+ // 1-bit add is just xor
+ inBuf = (inBuf << 8) | predLine[i];
+ predLine[i] ^= inBuf >> nComps;
+ }
+ } else if (nBits == 8) {
+ for (i = pixBytes; i < rowBytes; ++i) {
+ predLine[i] += predLine[i - nComps];
+ }
+ } else {
+ memset(upLeftBuf, 0, nComps + 1);
+ bitMask = (1 << nBits) - 1;
+ inBuf = outBuf = 0;
+ inBits = outBits = 0;
+ j = k = pixBytes;
+ for (i = 0; i < width; ++i) {
+ for (kk = 0; kk < nComps; ++kk) {
+ if (inBits < nBits) {
+ inBuf = (inBuf << 8) | (predLine[j++] & 0xff);
+ inBits += 8;
+ }
+ upLeftBuf[kk] = (Guchar)((upLeftBuf[kk] +
+ (inBuf >> (inBits - nBits))) & bitMask);
+ inBits -= nBits;
+ outBuf = (outBuf << nBits) | upLeftBuf[kk];
+ outBits += nBits;
+ if (outBits >= 8) {
+ predLine[k++] = (Guchar)(outBuf >> (outBits - 8));
+ outBits -= 8;
+ }
+ }
+ }
+ if (outBits > 0) {
+ predLine[k++] = (Guchar)((outBuf << (8 - outBits)) +
+ (inBuf & ((1 << (8 - outBits)) - 1)));
+ }
+ }
+ }
+
+ // reset to start of line
+ predIdx = pixBytes;
+
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// FileStream
+//------------------------------------------------------------------------
+
+FileStream::FileStream(FILE *fA, Guint startA, GBool limitedA,
+ Guint lengthA, Object *dictA):
+ BaseStream(dictA) {
+ f = fA;
+ start = startA;
+ limited = limitedA;
+ length = lengthA;
+ bufPtr = bufEnd = buf;
+ bufPos = start;
+ savePos = 0;
+ saved = gFalse;
+}
+
+FileStream::~FileStream() {
+ close();
+}
+
+Stream *FileStream::makeSubStream(Guint startA, GBool limitedA,
+ Guint lengthA, Object *dictA) {
+ return new FileStream(f, startA, limitedA, lengthA, dictA);
+}
+
+void FileStream::reset() {
+#if HAVE_FSEEKO
+ savePos = (Guint)ftello(f);
+ fseeko(f, start, SEEK_SET);
+#elif HAVE_FSEEK64
+ savePos = (Guint)ftell64(f);
+ fseek64(f, start, SEEK_SET);
+#else
+ savePos = (Guint)ftell(f);
+ fseek(f, start, SEEK_SET);
+#endif
+ saved = gTrue;
+ bufPtr = bufEnd = buf;
+ bufPos = start;
+}
+
+void FileStream::close() {
+ if (saved) {
+#if HAVE_FSEEKO
+ fseeko(f, savePos, SEEK_SET);
+#elif HAVE_FSEEK64
+ fseek64(f, savePos, SEEK_SET);
+#else
+ fseek(f, savePos, SEEK_SET);
+#endif
+ saved = gFalse;
+ }
+}
+
+GBool FileStream::fillBuf() {
+ int n;
+
+ bufPos += bufEnd - buf;
+ bufPtr = bufEnd = buf;
+ if (limited && bufPos >= start + length) {
+ return gFalse;
+ }
+ if (limited && bufPos + fileStreamBufSize > start + length) {
+ n = start + length - bufPos;
+ } else {
+ n = fileStreamBufSize;
+ }
+ n = fread(buf, 1, n, f);
+ bufEnd = buf + n;
+ if (bufPtr >= bufEnd) {
+ return gFalse;
+ }
+ return gTrue;
+}
+
+void FileStream::setPos(Guint pos, int dir) {
+ Guint size;
+
+ if (dir >= 0) {
+#if HAVE_FSEEKO
+ fseeko(f, pos, SEEK_SET);
+#elif HAVE_FSEEK64
+ fseek64(f, pos, SEEK_SET);
+#else
+ fseek(f, pos, SEEK_SET);
+#endif
+ bufPos = pos;
+ } else {
+#if HAVE_FSEEKO
+ fseeko(f, 0, SEEK_END);
+ size = (Guint)ftello(f);
+#elif HAVE_FSEEK64
+ fseek64(f, 0, SEEK_END);
+ size = (Guint)ftell64(f);
+#else
+ fseek(f, 0, SEEK_END);
+ size = (Guint)ftell(f);
+#endif
+ if (pos > size)
+ pos = (Guint)size;
+#ifdef __CYGWIN32__
+ //~ work around a bug in cygwin's implementation of fseek
+ rewind(f);
+#endif
+#if HAVE_FSEEKO
+ fseeko(f, -(int)pos, SEEK_END);
+ bufPos = (Guint)ftello(f);
+#elif HAVE_FSEEK64
+ fseek64(f, -(int)pos, SEEK_END);
+ bufPos = (Guint)ftell64(f);
+#else
+ fseek(f, -(int)pos, SEEK_END);
+ bufPos = (Guint)ftell(f);
+#endif
+ }
+ bufPtr = bufEnd = buf;
+}
+
+void FileStream::moveStart(int delta) {
+ start += delta;
+ bufPtr = bufEnd = buf;
+ bufPos = start;
+}
+
+//------------------------------------------------------------------------
+// MemStream
+//------------------------------------------------------------------------
+
+MemStream::MemStream(char *bufA, Guint startA, Guint lengthA, Object *dictA):
+ BaseStream(dictA) {
+ buf = bufA;
+ start = startA;
+ length = lengthA;
+ bufEnd = buf + start + length;
+ bufPtr = buf + start;
+ needFree = gFalse;
+}
+
+MemStream::~MemStream() {
+ if (needFree) {
+ gfree(buf);
+ }
+}
+
+Stream *MemStream::makeSubStream(Guint startA, GBool limited,
+ Guint lengthA, Object *dictA) {
+ MemStream *subStr;
+ Guint newLength;
+
+ if (!limited || startA + lengthA > start + length) {
+ newLength = start + length - startA;
+ } else {
+ newLength = lengthA;
+ }
+ subStr = new MemStream(buf, startA, newLength, dictA);
+ return subStr;
+}
+
+void MemStream::reset() {
+ bufPtr = buf + start;
+}
+
+void MemStream::close() {
+}
+
+void MemStream::setPos(Guint pos, int dir) {
+ Guint i;
+
+ if (dir >= 0) {
+ i = pos;
+ } else {
+ i = start + length - pos;
+ }
+ if (i < start) {
+ i = start;
+ } else if (i > start + length) {
+ i = start + length;
+ }
+ bufPtr = buf + i;
+}
+
+void MemStream::moveStart(int delta) {
+ start += delta;
+ length -= delta;
+ bufPtr = buf + start;
+}
+
+//------------------------------------------------------------------------
+// EmbedStream
+//------------------------------------------------------------------------
+
+EmbedStream::EmbedStream(Stream *strA, Object *dictA,
+ GBool limitedA, Guint lengthA):
+ BaseStream(dictA) {
+ str = strA;
+ limited = limitedA;
+ length = lengthA;
+}
+
+EmbedStream::~EmbedStream() {
+}
+
+Stream *EmbedStream::makeSubStream(Guint /*start*/, GBool /*limitedA*/,
+ Guint /*lengthA*/, Object * /*dictA*/) {
+ error(-1, "Internal: called makeSubStream() on EmbedStream");
+ return NULL;
+}
+
+int EmbedStream::getChar() {
+ if (limited && !length) {
+ return EOF;
+ }
+ --length;
+ return str->getChar();
+}
+
+int EmbedStream::lookChar() {
+ if (limited && !length) {
+ return EOF;
+ }
+ return str->lookChar();
+}
+
+void EmbedStream::setPos(Guint /*pos*/, int /*dir*/) {
+ error(-1, "Internal: called setPos() on EmbedStream");
+}
+
+Guint EmbedStream::getStart() {
+ error(-1, "Internal: called getStart() on EmbedStream");
+ return 0;
+}
+
+void EmbedStream::moveStart(int /*delta*/) {
+ error(-1, "Internal: called moveStart() on EmbedStream");
+}
+
+//------------------------------------------------------------------------
+// ASCIIHexStream
+//------------------------------------------------------------------------
+
+ASCIIHexStream::ASCIIHexStream(Stream *strA):
+ FilterStream(strA) {
+ buf = EOF;
+ eof = gFalse;
+}
+
+ASCIIHexStream::~ASCIIHexStream() {
+ delete str;
+}
+
+void ASCIIHexStream::reset() {
+ str->reset();
+ buf = EOF;
+ eof = gFalse;
+}
+
+int ASCIIHexStream::lookChar() {
+ int c1, c2, x;
+
+ if (buf != EOF)
+ return buf;
+ if (eof) {
+ buf = EOF;
+ return EOF;
+ }
+ do {
+ c1 = str->getChar();
+ } while (isspace(c1));
+ if (c1 == '>') {
+ eof = gTrue;
+ buf = EOF;
+ return buf;
+ }
+ do {
+ c2 = str->getChar();
+ } while (isspace(c2));
+ if (c2 == '>') {
+ eof = gTrue;
+ c2 = '0';
+ }
+ if (c1 >= '0' && c1 <= '9') {
+ x = (c1 - '0') << 4;
+ } else if (c1 >= 'A' && c1 <= 'F') {
+ x = (c1 - 'A' + 10) << 4;
+ } else if (c1 >= 'a' && c1 <= 'f') {
+ x = (c1 - 'a' + 10) << 4;
+ } else if (c1 == EOF) {
+ eof = gTrue;
+ x = 0;
+ } else {
+ error(getPos(), "Illegal character <%02x> in ASCIIHex stream", c1);
+ x = 0;
+ }
+ if (c2 >= '0' && c2 <= '9') {
+ x += c2 - '0';
+ } else if (c2 >= 'A' && c2 <= 'F') {
+ x += c2 - 'A' + 10;
+ } else if (c2 >= 'a' && c2 <= 'f') {
+ x += c2 - 'a' + 10;
+ } else if (c2 == EOF) {
+ eof = gTrue;
+ x = 0;
+ } else {
+ error(getPos(), "Illegal character <%02x> in ASCIIHex stream", c2);
+ }
+ buf = x & 0xff;
+ return buf;
+}
+
+GString *ASCIIHexStream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+
+ if (psLevel < 2) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("/ASCIIHexDecode filter\n");
+ return s;
+}
+
+GBool ASCIIHexStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gFalse);
+}
+
+//------------------------------------------------------------------------
+// ASCII85Stream
+//------------------------------------------------------------------------
+
+ASCII85Stream::ASCII85Stream(Stream *strA):
+ FilterStream(strA) {
+ index = n = 0;
+ eof = gFalse;
+}
+
+ASCII85Stream::~ASCII85Stream() {
+ delete str;
+}
+
+void ASCII85Stream::reset() {
+ str->reset();
+ index = n = 0;
+ eof = gFalse;
+}
+
+int ASCII85Stream::lookChar() {
+ int k;
+ Gulong t;
+
+ if (index >= n) {
+ if (eof)
+ return EOF;
+ index = 0;
+ do {
+ c[0] = str->getChar();
+ } while (Lexer::isSpace(c[0]));
+ if (c[0] == '~' || c[0] == EOF) {
+ eof = gTrue;
+ n = 0;
+ return EOF;
+ } else if (c[0] == 'z') {
+ b[0] = b[1] = b[2] = b[3] = 0;
+ n = 4;
+ } else {
+ for (k = 1; k < 5; ++k) {
+ do {
+ c[k] = str->getChar();
+ } while (Lexer::isSpace(c[k]));
+ if (c[k] == '~' || c[k] == EOF)
+ break;
+ }
+ n = k - 1;
+ if (k < 5 && (c[k] == '~' || c[k] == EOF)) {
+ for (++k; k < 5; ++k)
+ c[k] = 0x21 + 84;
+ eof = gTrue;
+ }
+ t = 0;
+ for (k = 0; k < 5; ++k)
+ t = t * 85 + (c[k] - 0x21);
+ for (k = 3; k >= 0; --k) {
+ b[k] = (int)(t & 0xff);
+ t >>= 8;
+ }
+ }
+ }
+ return b[index];
+}
+
+GString *ASCII85Stream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+
+ if (psLevel < 2) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("/ASCII85Decode filter\n");
+ return s;
+}
+
+GBool ASCII85Stream::isBinary(GBool /*last*/) {
+ return str->isBinary(gFalse);
+}
+
+//------------------------------------------------------------------------
+// LZWStream
+//------------------------------------------------------------------------
+
+LZWStream::LZWStream(Stream *strA, int predictor, int columns, int colors,
+ int bits, int earlyA):
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
+ if (!pred->isOk()) {
+ delete pred;
+ pred = NULL;
+ }
+ } else {
+ pred = NULL;
+ }
+ early = earlyA;
+ eof = gFalse;
+ inputBits = 0;
+ clearTable();
+}
+
+LZWStream::~LZWStream() {
+ if (pred) {
+ delete pred;
+ }
+ delete str;
+}
+
+int LZWStream::getChar() {
+ if (pred) {
+ return pred->getChar();
+ }
+ if (eof) {
+ return EOF;
+ }
+ if (seqIndex >= seqLength) {
+ if (!processNextCode()) {
+ return EOF;
+ }
+ }
+ return seqBuf[seqIndex++];
+}
+
+int LZWStream::lookChar() {
+ if (pred) {
+ return pred->lookChar();
+ }
+ if (eof) {
+ return EOF;
+ }
+ if (seqIndex >= seqLength) {
+ if (!processNextCode()) {
+ return EOF;
+ }
+ }
+ return seqBuf[seqIndex];
+}
+
+int LZWStream::getRawChar() {
+ if (eof) {
+ return EOF;
+ }
+ if (seqIndex >= seqLength) {
+ if (!processNextCode()) {
+ return EOF;
+ }
+ }
+ return seqBuf[seqIndex++];
+}
+
+void LZWStream::reset() {
+ str->reset();
+ eof = gFalse;
+ inputBits = 0;
+ clearTable();
+}
+
+GBool LZWStream::processNextCode() {
+ int code;
+ int nextLength;
+ int i, j;
+
+ // check for EOF
+ if (eof) {
+ return gFalse;
+ }
+
+ // check for eod and clear-table codes
+ start:
+ code = getCode();
+ if (code == EOF || code == 257) {
+ eof = gTrue;
+ return gFalse;
+ }
+ if (code == 256) {
+ clearTable();
+ goto start;
+ }
+ if (nextCode >= 4097) {
+ error(getPos(), "Bad LZW stream - expected clear-table code");
+ clearTable();
+ }
+
+ // process the next code
+ nextLength = seqLength + 1;
+ if (code < 256) {
+ seqBuf[0] = code;
+ seqLength = 1;
+ } else if (code < nextCode) {
+ seqLength = table[code].length;
+ for (i = seqLength - 1, j = code; i > 0; --i) {
+ seqBuf[i] = table[j].tail;
+ j = table[j].head;
+ }
+ seqBuf[0] = j;
+ } else if (code == nextCode) {
+ seqBuf[seqLength] = newChar;
+ ++seqLength;
+ } else {
+ error(getPos(), "Bad LZW stream - unexpected code");
+ eof = gTrue;
+ return gFalse;
+ }
+ newChar = seqBuf[0];
+ if (first) {
+ first = gFalse;
+ } else {
+ table[nextCode].length = nextLength;
+ table[nextCode].head = prevCode;
+ table[nextCode].tail = newChar;
+ ++nextCode;
+ if (nextCode + early == 512)
+ nextBits = 10;
+ else if (nextCode + early == 1024)
+ nextBits = 11;
+ else if (nextCode + early == 2048)
+ nextBits = 12;
+ }
+ prevCode = code;
+
+ // reset buffer
+ seqIndex = 0;
+
+ return gTrue;
+}
+
+void LZWStream::clearTable() {
+ nextCode = 258;
+ nextBits = 9;
+ seqIndex = seqLength = 0;
+ first = gTrue;
+}
+
+int LZWStream::getCode() {
+ int c;
+ int code;
+
+ while (inputBits < nextBits) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ inputBuf = (inputBuf << 8) | (c & 0xff);
+ inputBits += 8;
+ }
+ code = (inputBuf >> (inputBits - nextBits)) & ((1 << nextBits) - 1);
+ inputBits -= nextBits;
+ return code;
+}
+
+GString *LZWStream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+
+ if (psLevel < 2 || pred) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("<< ");
+ if (!early) {
+ s->append("/EarlyChange 0 ");
+ }
+ s->append(">> /LZWDecode filter\n");
+ return s;
+}
+
+GBool LZWStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// RunLengthStream
+//------------------------------------------------------------------------
+
+RunLengthStream::RunLengthStream(Stream *strA):
+ FilterStream(strA) {
+ bufPtr = bufEnd = buf;
+ eof = gFalse;
+}
+
+RunLengthStream::~RunLengthStream() {
+ delete str;
+}
+
+void RunLengthStream::reset() {
+ str->reset();
+ bufPtr = bufEnd = buf;
+ eof = gFalse;
+}
+
+GString *RunLengthStream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+
+ if (psLevel < 2) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("/RunLengthDecode filter\n");
+ return s;
+}
+
+GBool RunLengthStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+GBool RunLengthStream::fillBuf() {
+ int c;
+ int n, i;
+
+ if (eof)
+ return gFalse;
+ c = str->getChar();
+ if (c == 0x80 || c == EOF) {
+ eof = gTrue;
+ return gFalse;
+ }
+ if (c < 0x80) {
+ n = c + 1;
+ for (i = 0; i < n; ++i)
+ buf[i] = (char)str->getChar();
+ } else {
+ n = 0x101 - c;
+ c = str->getChar();
+ for (i = 0; i < n; ++i)
+ buf[i] = (char)c;
+ }
+ bufPtr = buf;
+ bufEnd = buf + n;
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// CCITTFaxStream
+//------------------------------------------------------------------------
+
+CCITTFaxStream::CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA,
+ GBool byteAlignA, int columnsA, int rowsA,
+ GBool endOfBlockA, GBool blackA):
+ FilterStream(strA) {
+ encoding = encodingA;
+ endOfLine = endOfLineA;
+ byteAlign = byteAlignA;
+ columns = columnsA;
+ if (columns < 1) {
+ columns = 1;
+ } else if (columns > INT_MAX - 2) {
+ columns = INT_MAX - 2;
+ }
+ rows = rowsA;
+ endOfBlock = endOfBlockA;
+ black = blackA;
+ // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = columns
+ // ---> max codingLine size = columns + 1
+ // refLine has one extra guard entry at the end
+ // ---> max refLine size = columns + 2
+ codingLine = (int *)gmallocn_checkoverflow(columns + 1, sizeof(int));
+ refLine = (int *)gmallocn_checkoverflow(columns + 2, sizeof(int));
+
+ if (codingLine != NULL && refLine != NULL) {
+ eof = gFalse;
+ codingLine[0] = columns;
+ } else {
+ eof = gTrue;
+ }
+ row = 0;
+ nextLine2D = encoding < 0;
+ inputBits = 0;
+ a0i = 0;
+ outputBits = 0;
+
+ buf = EOF;
+}
+
+CCITTFaxStream::~CCITTFaxStream() {
+ delete str;
+ gfree(refLine);
+ gfree(codingLine);
+}
+
+void CCITTFaxStream::reset() {
+ short code1;
+
+ str->reset();
+
+ if (codingLine != NULL && refLine != NULL) {
+ eof = gFalse;
+ codingLine[0] = columns;
+ } else {
+ eof = gTrue;
+ }
+ row = 0;
+ nextLine2D = encoding < 0;
+ inputBits = 0;
+ a0i = 0;
+ outputBits = 0;
+ buf = EOF;
+
+ // skip any initial zero bits and end-of-line marker, and get the 2D
+ // encoding tag
+ while ((code1 = lookBits(12)) == 0) {
+ eatBits(1);
+ }
+ if (code1 == 0x001) {
+ eatBits(12);
+ }
+ if (encoding > 0) {
+ nextLine2D = !lookBits(1);
+ eatBits(1);
+ }
+}
+
+inline void CCITTFaxStream::addPixels(int a1, int blackPixels) {
+ if (a1 > codingLine[a0i]) {
+ if (a1 > columns) {
+ error(getPos(), "CCITTFax row is wrong length (%d)", a1);
+ err = gTrue;
+ a1 = columns;
+ }
+ if ((a0i & 1) ^ blackPixels) {
+ ++a0i;
+ }
+ codingLine[a0i] = a1;
+ }
+}
+
+inline void CCITTFaxStream::addPixelsNeg(int a1, int blackPixels) {
+ if (a1 > codingLine[a0i]) {
+ if (a1 > columns) {
+ error(getPos(), "CCITTFax row is wrong length (%d)", a1);
+ err = gTrue;
+ a1 = columns;
+ }
+ if ((a0i & 1) ^ blackPixels) {
+ ++a0i;
+ }
+ codingLine[a0i] = a1;
+ } else if (a1 < codingLine[a0i]) {
+ if (a1 < 0) {
+ error(getPos(), "Invalid CCITTFax code");
+ err = gTrue;
+ a1 = 0;
+ }
+ while (a0i > 0 && a1 <= codingLine[a0i - 1]) {
+ --a0i;
+ }
+ codingLine[a0i] = a1;
+ }
+}
+
+int CCITTFaxStream::lookChar() {
+ short code1, code2, code3;
+ int b1i, blackPixels, i, bits;
+ GBool gotEOL;
+
+ if (buf != EOF) {
+ return buf;
+ }
+
+ // read the next row
+ if (outputBits == 0) {
+
+ // if at eof just return EOF
+ if (eof) {
+ return EOF;
+ }
+
+ err = gFalse;
+
+ // 2-D encoding
+ if (nextLine2D) {
+ for (i = 0; codingLine[i] < columns; ++i) {
+ refLine[i] = codingLine[i];
+ }
+ refLine[i++] = columns;
+ refLine[i] = columns;
+ codingLine[0] = 0;
+ a0i = 0;
+ b1i = 0;
+ blackPixels = 0;
+ // invariant:
+ // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1]
+ // <= columns
+ // exception at left edge:
+ // codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
+ // exception at right edge:
+ // refLine[b1i] = refLine[b1i+1] = columns is possible
+ while (codingLine[a0i] < columns) {
+ code1 = getTwoDimCode();
+ switch (code1) {
+ case twoDimPass:
+ addPixels(refLine[b1i + 1], blackPixels);
+ if (refLine[b1i + 1] < columns) {
+ b1i += 2;
+ }
+ break;
+ case twoDimHoriz:
+ code1 = code2 = 0;
+ if (blackPixels) {
+ do {
+ code1 += code3 = getBlackCode();
+ } while (code3 >= 64);
+ do {
+ code2 += code3 = getWhiteCode();
+ } while (code3 >= 64);
+ } else {
+ do {
+ code1 += code3 = getWhiteCode();
+ } while (code3 >= 64);
+ do {
+ code2 += code3 = getBlackCode();
+ } while (code3 >= 64);
+ }
+ addPixels(codingLine[a0i] + code1, blackPixels);
+ if (codingLine[a0i] < columns) {
+ addPixels(codingLine[a0i] + code2, blackPixels ^ 1);
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ break;
+ case twoDimVertR3:
+ addPixels(refLine[b1i] + 3, blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertR2:
+ addPixels(refLine[b1i] + 2, blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertR1:
+ addPixels(refLine[b1i] + 1, blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVert0:
+ addPixels(refLine[b1i], blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ ++b1i;
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertL3:
+ addPixelsNeg(refLine[b1i] - 3, blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ if (b1i > 0) {
+ --b1i;
+ } else {
+ ++b1i;
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertL2:
+ addPixelsNeg(refLine[b1i] - 2, blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ if (b1i > 0) {
+ --b1i;
+ } else {
+ ++b1i;
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case twoDimVertL1:
+ addPixelsNeg(refLine[b1i] - 1, blackPixels);
+ blackPixels ^= 1;
+ if (codingLine[a0i] < columns) {
+ if (b1i > 0) {
+ --b1i;
+ } else {
+ ++b1i;
+ }
+ while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
+ b1i += 2;
+ }
+ }
+ break;
+ case EOF:
+ addPixels(columns, 0);
+ eof = gTrue;
+ break;
+ default:
+ error(getPos(), "Bad 2D code %04x in CCITTFax stream", code1);
+ addPixels(columns, 0);
+ err = gTrue;
+ break;
+ }
+ }
+
+ // 1-D encoding
+ } else {
+ codingLine[0] = 0;
+ a0i = 0;
+ blackPixels = 0;
+ while (codingLine[a0i] < columns) {
+ code1 = 0;
+ if (blackPixels) {
+ do {
+ code1 += code3 = getBlackCode();
+ } while (code3 >= 64);
+ } else {
+ do {
+ code1 += code3 = getWhiteCode();
+ } while (code3 >= 64);
+ }
+ addPixels(codingLine[a0i] + code1, blackPixels);
+ blackPixels ^= 1;
+ }
+ }
+
+ // byte-align the row
+ if (byteAlign) {
+ inputBits &= ~7;
+ }
+
+ // check for end-of-line marker, skipping over any extra zero bits
+ gotEOL = gFalse;
+ if (!endOfBlock && row == rows - 1) {
+ eof = gTrue;
+ } else {
+ code1 = lookBits(12);
+ while (code1 == 0) {
+ eatBits(1);
+ code1 = lookBits(12);
+ }
+ if (code1 == 0x001) {
+ eatBits(12);
+ gotEOL = gTrue;
+ } else if (code1 == EOF) {
+ eof = gTrue;
+ }
+ }
+
+ // get 2D encoding tag
+ if (!eof && encoding > 0) {
+ nextLine2D = !lookBits(1);
+ eatBits(1);
+ }
+
+ // check for end-of-block marker
+ if (endOfBlock && gotEOL) {
+ code1 = lookBits(12);
+ if (code1 == 0x001) {
+ eatBits(12);
+ if (encoding > 0) {
+ lookBits(1);
+ eatBits(1);
+ }
+ if (encoding >= 0) {
+ for (i = 0; i < 4; ++i) {
+ code1 = lookBits(12);
+ if (code1 != 0x001) {
+ error(getPos(), "Bad RTC code in CCITTFax stream");
+ }
+ eatBits(12);
+ if (encoding > 0) {
+ lookBits(1);
+ eatBits(1);
+ }
+ }
+ }
+ eof = gTrue;
+ }
+
+ // look for an end-of-line marker after an error -- we only do
+ // this if we know the stream contains end-of-line markers because
+ // the "just plow on" technique tends to work better otherwise
+ } else if (err && endOfLine) {
+ while (1) {
+ code1 = lookBits(13);
+ if (code1 == EOF) {
+ eof = gTrue;
+ return EOF;
+ }
+ if ((code1 >> 1) == 0x001) {
+ break;
+ }
+ eatBits(1);
+ }
+ eatBits(12);
+ if (encoding > 0) {
+ eatBits(1);
+ nextLine2D = !(code1 & 1);
+ }
+ }
+
+ // set up for output
+ if (codingLine[0] > 0) {
+ outputBits = codingLine[a0i = 0];
+ } else {
+ outputBits = codingLine[a0i = 1];
+ }
+
+ ++row;
+ }
+
+ // get a byte
+ if (outputBits >= 8) {
+ buf = (a0i & 1) ? 0x00 : 0xff;
+ outputBits -= 8;
+ if (outputBits == 0 && codingLine[a0i] < columns) {
+ ++a0i;
+ outputBits = codingLine[a0i] - codingLine[a0i - 1];
+ }
+ } else {
+ bits = 8;
+ buf = 0;
+ do {
+ if (outputBits > bits) {
+ buf <<= bits;
+ if (!(a0i & 1)) {
+ buf |= 0xff >> (8 - bits);
+ }
+ outputBits -= bits;
+ bits = 0;
+ } else {
+ buf <<= outputBits;
+ if (!(a0i & 1)) {
+ buf |= 0xff >> (8 - outputBits);
+ }
+ bits -= outputBits;
+ outputBits = 0;
+ if (codingLine[a0i] < columns) {
+ ++a0i;
+ outputBits = codingLine[a0i] - codingLine[a0i - 1];
+ } else if (bits > 0) {
+ buf <<= bits;
+ bits = 0;
+ }
+ }
+ } while (bits);
+ }
+ if (black) {
+ buf ^= 0xff;
+ }
+ return buf;
+}
+
+short CCITTFaxStream::getTwoDimCode() {
+ short code;
+ CCITTCode *p;
+ int n;
+
+ code = 0; // make gcc happy
+ if (endOfBlock) {
+ code = lookBits(7);
+ p = &twoDimTab1[code];
+ if (p->bits > 0) {
+ eatBits(p->bits);
+ return p->n;
+ }
+ } else {
+ for (n = 1; n <= 7; ++n) {
+ code = lookBits(n);
+ if (n < 7) {
+ code <<= 7 - n;
+ }
+ p = &twoDimTab1[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ error(getPos(), "Bad two dim code (%04x) in CCITTFax stream", code);
+ return EOF;
+}
+
+short CCITTFaxStream::getWhiteCode() {
+ short code;
+ CCITTCode *p;
+ int n;
+
+ code = 0; // make gcc happy
+ if (endOfBlock) {
+ code = lookBits(12);
+ if (code == EOF) {
+ return 1;
+ }
+ if ((code >> 5) == 0) {
+ p = &whiteTab1[code];
+ } else {
+ p = &whiteTab2[code >> 3];
+ }
+ if (p->bits > 0) {
+ eatBits(p->bits);
+ return p->n;
+ }
+ } else {
+ for (n = 1; n <= 9; ++n) {
+ code = lookBits(n);
+ if (code == EOF) {
+ return 1;
+ }
+ if (n < 9) {
+ code <<= 9 - n;
+ }
+ p = &whiteTab2[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ for (n = 11; n <= 12; ++n) {
+ code = lookBits(n);
+ if (code == EOF) {
+ return 1;
+ }
+ if (n < 12) {
+ code <<= 12 - n;
+ }
+ p = &whiteTab1[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ error(getPos(), "Bad white code (%04x) in CCITTFax stream", code);
+ // eat a bit and return a positive number so that the caller doesn't
+ // go into an infinite loop
+ eatBits(1);
+ return 1;
+}
+
+short CCITTFaxStream::getBlackCode() {
+ short code;
+ CCITTCode *p;
+ int n;
+
+ code = 0; // make gcc happy
+ if (endOfBlock) {
+ code = lookBits(13);
+ if (code == EOF) {
+ return 1;
+ }
+ if ((code >> 7) == 0) {
+ p = &blackTab1[code];
+ } else if ((code >> 9) == 0 && (code >> 7) != 0) {
+ p = &blackTab2[(code >> 1) - 64];
+ } else {
+ p = &blackTab3[code >> 7];
+ }
+ if (p->bits > 0) {
+ eatBits(p->bits);
+ return p->n;
+ }
+ } else {
+ for (n = 2; n <= 6; ++n) {
+ code = lookBits(n);
+ if (code == EOF) {
+ return 1;
+ }
+ if (n < 6) {
+ code <<= 6 - n;
+ }
+ p = &blackTab3[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ for (n = 7; n <= 12; ++n) {
+ code = lookBits(n);
+ if (code == EOF) {
+ return 1;
+ }
+ if (n < 12) {
+ code <<= 12 - n;
+ }
+ if (code >= 64) {
+ p = &blackTab2[code - 64];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ for (n = 10; n <= 13; ++n) {
+ code = lookBits(n);
+ if (code == EOF) {
+ return 1;
+ }
+ if (n < 13) {
+ code <<= 13 - n;
+ }
+ p = &blackTab1[code];
+ if (p->bits == n) {
+ eatBits(n);
+ return p->n;
+ }
+ }
+ }
+ error(getPos(), "Bad black code (%04x) in CCITTFax stream", code);
+ // eat a bit and return a positive number so that the caller doesn't
+ // go into an infinite loop
+ eatBits(1);
+ return 1;
+}
+
+short CCITTFaxStream::lookBits(int n) {
+ int c;
+
+ while (inputBits < n) {
+ if ((c = str->getChar()) == EOF) {
+ if (inputBits == 0) {
+ return EOF;
+ }
+ // near the end of the stream, the caller may ask for more bits
+ // than are available, but there may still be a valid code in
+ // however many bits are available -- we need to return correct
+ // data in this case
+ return (inputBuf << (n - inputBits)) & (0xffff >> (16 - n));
+ }
+ inputBuf = (inputBuf << 8) + c;
+ inputBits += 8;
+ }
+ return (inputBuf >> (inputBits - n)) & (0xffff >> (16 - n));
+}
+
+GString *CCITTFaxStream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+ char s1[50];
+
+ if (psLevel < 2) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("<< ");
+ if (encoding != 0) {
+ sprintf(s1, "/K %d ", encoding);
+ s->append(s1);
+ }
+ if (endOfLine) {
+ s->append("/EndOfLine true ");
+ }
+ if (byteAlign) {
+ s->append("/EncodedByteAlign true ");
+ }
+ sprintf(s1, "/Columns %d ", columns);
+ s->append(s1);
+ if (rows != 0) {
+ sprintf(s1, "/Rows %d ", rows);
+ s->append(s1);
+ }
+ if (!endOfBlock) {
+ s->append("/EndOfBlock false ");
+ }
+ if (black) {
+ s->append("/BlackIs1 true ");
+ }
+ s->append(">> /CCITTFaxDecode filter\n");
+ return s;
+}
+
+GBool CCITTFaxStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// DCTStream
+//------------------------------------------------------------------------
+
+// IDCT constants (20.12 fixed point format)
+#define dctCos1 4017 // cos(pi/16)
+#define dctSin1 799 // sin(pi/16)
+#define dctCos3 3406 // cos(3*pi/16)
+#define dctSin3 2276 // sin(3*pi/16)
+#define dctCos6 1567 // cos(6*pi/16)
+#define dctSin6 3784 // sin(6*pi/16)
+#define dctSqrt2 5793 // sqrt(2)
+#define dctSqrt1d2 2896 // sqrt(2) / 2
+
+// color conversion parameters (16.16 fixed point format)
+#define dctCrToR 91881 // 1.4020
+#define dctCbToG -22553 // -0.3441363
+#define dctCrToG -46802 // -0.71413636
+#define dctCbToB 116130 // 1.772
+
+// clip [-256,511] --> [0,255]
+#define dctClipOffset 256
+static Guchar dctClip[768];
+static int dctClipInit = 0;
+
+// zig zag decode map
+static int dctZigZag[64] = {
+ 0,
+ 1, 8,
+ 16, 9, 2,
+ 3, 10, 17, 24,
+ 32, 25, 18, 11, 4,
+ 5, 12, 19, 26, 33, 40,
+ 48, 41, 34, 27, 20, 13, 6,
+ 7, 14, 21, 28, 35, 42, 49, 56,
+ 57, 50, 43, 36, 29, 22, 15,
+ 23, 30, 37, 44, 51, 58,
+ 59, 52, 45, 38, 31,
+ 39, 46, 53, 60,
+ 61, 54, 47,
+ 55, 62,
+ 63
+};
+
+DCTStream::DCTStream(Stream *strA, GBool colorXformA):
+ FilterStream(strA) {
+ int i, j;
+
+ colorXform = colorXformA;
+ progressive = interleaved = gFalse;
+ width = height = 0;
+ mcuWidth = mcuHeight = 0;
+ numComps = 0;
+ comp = 0;
+ x = y = dy = 0;
+ for (i = 0; i < 4; ++i) {
+ for (j = 0; j < 32; ++j) {
+ rowBuf[i][j] = NULL;
+ }
+ frameBuf[i] = NULL;
+ }
+
+ if (!dctClipInit) {
+ for (i = -256; i < 0; ++i)
+ dctClip[dctClipOffset + i] = 0;
+ for (i = 0; i < 256; ++i)
+ dctClip[dctClipOffset + i] = i;
+ for (i = 256; i < 512; ++i)
+ dctClip[dctClipOffset + i] = 255;
+ dctClipInit = 1;
+ }
+}
+
+DCTStream::~DCTStream() {
+ close();
+ delete str;
+}
+
+void DCTStream::reset() {
+ int i, j;
+
+ str->reset();
+
+ progressive = interleaved = gFalse;
+ width = height = 0;
+ numComps = 0;
+ numQuantTables = 0;
+ numDCHuffTables = 0;
+ numACHuffTables = 0;
+ gotJFIFMarker = gFalse;
+ gotAdobeMarker = gFalse;
+ restartInterval = 0;
+
+ if (!readHeader()) {
+ y = height;
+ return;
+ }
+
+ // compute MCU size
+ if (numComps == 1) {
+ compInfo[0].hSample = compInfo[0].vSample = 1;
+ }
+ mcuWidth = compInfo[0].hSample;
+ mcuHeight = compInfo[0].vSample;
+ for (i = 1; i < numComps; ++i) {
+ if (compInfo[i].hSample > mcuWidth) {
+ mcuWidth = compInfo[i].hSample;
+ }
+ if (compInfo[i].vSample > mcuHeight) {
+ mcuHeight = compInfo[i].vSample;
+ }
+ }
+ mcuWidth *= 8;
+ mcuHeight *= 8;
+
+ // figure out color transform
+ if (colorXform == -1) {
+ if (numComps == 3) {
+ if (gotJFIFMarker) {
+ colorXform = 1;
+ } else if (compInfo[0].id == 82 && compInfo[1].id == 71 &&
+ compInfo[2].id == 66) { // ASCII "RGB"
+ colorXform = 0;
+ } else {
+ colorXform = 1;
+ }
+ } else {
+ colorXform = 0;
+ }
+ }
+
+ if (progressive || !interleaved) {
+
+ // allocate a buffer for the whole image
+ bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
+ bufHeight = ((height + mcuHeight - 1) / mcuHeight) * mcuHeight;
+ if (bufWidth <= 0 || bufHeight <= 0 ||
+ bufWidth > INT_MAX / bufWidth / (int)sizeof(int)) {
+ error(getPos(), "Invalid image size in DCT stream");
+ y = height;
+ return;
+ }
+ for (i = 0; i < numComps; ++i) {
+ frameBuf[i] = (int *)gmallocn(bufWidth * bufHeight, sizeof(int));
+ memset(frameBuf[i], 0, bufWidth * bufHeight * sizeof(int));
+ }
+
+ // read the image data
+ do {
+ restartMarker = 0xd0;
+ restart();
+ readScan();
+ } while (readHeader());
+
+ // decode
+ decodeImage();
+
+ // initialize counters
+ comp = 0;
+ x = 0;
+ y = 0;
+
+ } else {
+
+ // allocate a buffer for one row of MCUs
+ bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
+ for (i = 0; i < numComps; ++i) {
+ for (j = 0; j < mcuHeight; ++j) {
+ rowBuf[i][j] = (Guchar *)gmallocn(bufWidth, sizeof(Guchar));
+ }
+ }
+
+ // initialize counters
+ comp = 0;
+ x = 0;
+ y = 0;
+ dy = mcuHeight;
+
+ restartMarker = 0xd0;
+ restart();
+ }
+}
+
+void DCTStream::close() {
+ int i, j;
+
+ for (i = 0; i < 4; ++i) {
+ for (j = 0; j < 32; ++j) {
+ gfree(rowBuf[i][j]);
+ rowBuf[i][j] = NULL;
+ }
+ gfree(frameBuf[i]);
+ frameBuf[i] = NULL;
+ }
+ FilterStream::close();
+}
+
+int DCTStream::getChar() {
+ int c;
+
+ if (y >= height) {
+ return EOF;
+ }
+ if (progressive || !interleaved) {
+ c = frameBuf[comp][y * bufWidth + x];
+ if (++comp == numComps) {
+ comp = 0;
+ if (++x == width) {
+ x = 0;
+ ++y;
+ }
+ }
+ } else {
+ if (dy >= mcuHeight) {
+ if (!readMCURow()) {
+ y = height;
+ return EOF;
+ }
+ comp = 0;
+ x = 0;
+ dy = 0;
+ }
+ c = rowBuf[comp][dy][x];
+ if (++comp == numComps) {
+ comp = 0;
+ if (++x == width) {
+ x = 0;
+ ++y;
+ ++dy;
+ if (y == height) {
+ readTrailer();
+ }
+ }
+ }
+ }
+ return c;
+}
+
+int DCTStream::lookChar() {
+ if (y >= height) {
+ return EOF;
+ }
+ if (progressive || !interleaved) {
+ return frameBuf[comp][y * bufWidth + x];
+ } else {
+ if (dy >= mcuHeight) {
+ if (!readMCURow()) {
+ y = height;
+ return EOF;
+ }
+ comp = 0;
+ x = 0;
+ dy = 0;
+ }
+ return rowBuf[comp][dy][x];
+ }
+}
+
+void DCTStream::restart() {
+ int i;
+
+ inputBits = 0;
+ restartCtr = restartInterval;
+ for (i = 0; i < numComps; ++i) {
+ compInfo[i].prevDC = 0;
+ }
+ eobRun = 0;
+}
+
+// Read one row of MCUs from a sequential JPEG stream.
+GBool DCTStream::readMCURow() {
+ int data1[64];
+ Guchar data2[64];
+ Guchar *p1, *p2;
+ int pY, pCb, pCr, pR, pG, pB;
+ int h, v, horiz, vert, hSub, vSub;
+ int x1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
+ int c;
+
+ for (x1 = 0; x1 < width; x1 += mcuWidth) {
+
+ // deal with restart marker
+ if (restartInterval > 0 && restartCtr == 0) {
+ c = readMarker();
+ if (c != restartMarker) {
+ error(getPos(), "Bad DCT data: incorrect restart marker");
+ return gFalse;
+ }
+ if (++restartMarker == 0xd8)
+ restartMarker = 0xd0;
+ restart();
+ }
+
+ // read one MCU
+ for (cc = 0; cc < numComps; ++cc) {
+ h = compInfo[cc].hSample;
+ v = compInfo[cc].vSample;
+ horiz = mcuWidth / h;
+ vert = mcuHeight / v;
+ hSub = horiz / 8;
+ vSub = vert / 8;
+ for (y2 = 0; y2 < mcuHeight; y2 += vert) {
+ for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
+ if (!readDataUnit(&dcHuffTables[scanInfo.dcHuffTable[cc]],
+ &acHuffTables[scanInfo.acHuffTable[cc]],
+ &compInfo[cc].prevDC,
+ data1)) {
+ return gFalse;
+ }
+ transformDataUnit(quantTables[compInfo[cc].quantTable],
+ data1, data2);
+ if (hSub == 1 && vSub == 1) {
+ for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
+ p1 = &rowBuf[cc][y2+y3][x1+x2];
+ p1[0] = data2[i];
+ p1[1] = data2[i+1];
+ p1[2] = data2[i+2];
+ p1[3] = data2[i+3];
+ p1[4] = data2[i+4];
+ p1[5] = data2[i+5];
+ p1[6] = data2[i+6];
+ p1[7] = data2[i+7];
+ }
+ } else if (hSub == 2 && vSub == 2) {
+ for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
+ p1 = &rowBuf[cc][y2+y3][x1+x2];
+ p2 = &rowBuf[cc][y2+y3+1][x1+x2];
+ p1[0] = p1[1] = p2[0] = p2[1] = data2[i];
+ p1[2] = p1[3] = p2[2] = p2[3] = data2[i+1];
+ p1[4] = p1[5] = p2[4] = p2[5] = data2[i+2];
+ p1[6] = p1[7] = p2[6] = p2[7] = data2[i+3];
+ p1[8] = p1[9] = p2[8] = p2[9] = data2[i+4];
+ p1[10] = p1[11] = p2[10] = p2[11] = data2[i+5];
+ p1[12] = p1[13] = p2[12] = p2[13] = data2[i+6];
+ p1[14] = p1[15] = p2[14] = p2[15] = data2[i+7];
+ }
+ } else {
+ i = 0;
+ for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
+ for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
+ for (y5 = 0; y5 < vSub; ++y5)
+ for (x5 = 0; x5 < hSub; ++x5)
+ rowBuf[cc][y2+y4+y5][x1+x2+x4+x5] = data2[i];
+ ++i;
+ }
+ }
+ }
+ }
+ }
+ }
+ --restartCtr;
+
+ // color space conversion
+ if (colorXform) {
+ // convert YCbCr to RGB
+ if (numComps == 3) {
+ for (y2 = 0; y2 < mcuHeight; ++y2) {
+ for (x2 = 0; x2 < mcuWidth; ++x2) {
+ pY = rowBuf[0][y2][x1+x2];
+ pCb = rowBuf[1][y2][x1+x2] - 128;
+ pCr = rowBuf[2][y2][x1+x2] - 128;
+ pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
+ rowBuf[0][y2][x1+x2] = dctClip[dctClipOffset + pR];
+ pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
+ rowBuf[1][y2][x1+x2] = dctClip[dctClipOffset + pG];
+ pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
+ rowBuf[2][y2][x1+x2] = dctClip[dctClipOffset + pB];
+ }
+ }
+ // convert YCbCrK to CMYK (K is passed through unchanged)
+ } else if (numComps == 4) {
+ for (y2 = 0; y2 < mcuHeight; ++y2) {
+ for (x2 = 0; x2 < mcuWidth; ++x2) {
+ pY = rowBuf[0][y2][x1+x2];
+ pCb = rowBuf[1][y2][x1+x2] - 128;
+ pCr = rowBuf[2][y2][x1+x2] - 128;
+ pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
+ rowBuf[0][y2][x1+x2] = 255 - dctClip[dctClipOffset + pR];
+ pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
+ rowBuf[1][y2][x1+x2] = 255 - dctClip[dctClipOffset + pG];
+ pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
+ rowBuf[2][y2][x1+x2] = 255 - dctClip[dctClipOffset + pB];
+ }
+ }
+ }
+ }
+ }
+ return gTrue;
+}
+
+// Read one scan from a progressive or non-interleaved JPEG stream.
+void DCTStream::readScan() {
+ int data[64];
+ int x1, y1, dx1, dy1, x2, y2, y3, cc, i;
+ int h, v, horiz, vert, vSub;
+ int *p1;
+ int c;
+
+ if (scanInfo.numComps == 1) {
+ for (cc = 0; cc < numComps; ++cc) {
+ if (scanInfo.comp[cc]) {
+ break;
+ }
+ }
+ dx1 = mcuWidth / compInfo[cc].hSample;
+ dy1 = mcuHeight / compInfo[cc].vSample;
+ } else {
+ dx1 = mcuWidth;
+ dy1 = mcuHeight;
+ }
+
+ for (y1 = 0; y1 < height; y1 += dy1) {
+ for (x1 = 0; x1 < width; x1 += dx1) {
+
+ // deal with restart marker
+ if (restartInterval > 0 && restartCtr == 0) {
+ c = readMarker();
+ if (c != restartMarker) {
+ error(getPos(), "Bad DCT data: incorrect restart marker");
+ return;
+ }
+ if (++restartMarker == 0xd8) {
+ restartMarker = 0xd0;
+ }
+ restart();
+ }
+
+ // read one MCU
+ for (cc = 0; cc < numComps; ++cc) {
+ if (!scanInfo.comp[cc]) {
+ continue;
+ }
+
+ h = compInfo[cc].hSample;
+ v = compInfo[cc].vSample;
+ horiz = mcuWidth / h;
+ vert = mcuHeight / v;
+ vSub = vert / 8;
+ for (y2 = 0; y2 < dy1; y2 += vert) {
+ for (x2 = 0; x2 < dx1; x2 += horiz) {
+
+ // pull out the current values
+ p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
+ for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
+ data[i] = p1[0];
+ data[i+1] = p1[1];
+ data[i+2] = p1[2];
+ data[i+3] = p1[3];
+ data[i+4] = p1[4];
+ data[i+5] = p1[5];
+ data[i+6] = p1[6];
+ data[i+7] = p1[7];
+ p1 += bufWidth * vSub;
+ }
+
+ // read one data unit
+ if (progressive) {
+ if (!readProgressiveDataUnit(
+ &dcHuffTables[scanInfo.dcHuffTable[cc]],
+ &acHuffTables[scanInfo.acHuffTable[cc]],
+ &compInfo[cc].prevDC,
+ data)) {
+ return;
+ }
+ } else {
+ if (!readDataUnit(&dcHuffTables[scanInfo.dcHuffTable[cc]],
+ &acHuffTables[scanInfo.acHuffTable[cc]],
+ &compInfo[cc].prevDC,
+ data)) {
+ return;
+ }
+ }
+
+ // add the data unit into frameBuf
+ p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
+ for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
+ p1[0] = data[i];
+ p1[1] = data[i+1];
+ p1[2] = data[i+2];
+ p1[3] = data[i+3];
+ p1[4] = data[i+4];
+ p1[5] = data[i+5];
+ p1[6] = data[i+6];
+ p1[7] = data[i+7];
+ p1 += bufWidth * vSub;
+ }
+ }
+ }
+ }
+ --restartCtr;
+ }
+ }
+}
+
+// Read one data unit from a sequential JPEG stream.
+GBool DCTStream::readDataUnit(DCTHuffTable *dcHuffTable,
+ DCTHuffTable *acHuffTable,
+ int *prevDC, int data[64]) {
+ int run, size, amp;
+ int c;
+ int i, j;
+
+ if ((size = readHuffSym(dcHuffTable)) == 9999) {
+ return gFalse;
+ }
+ if (size > 0) {
+ if ((amp = readAmp(size)) == 9999) {
+ return gFalse;
+ }
+ } else {
+ amp = 0;
+ }
+ data[0] = *prevDC += amp;
+ for (i = 1; i < 64; ++i) {
+ data[i] = 0;
+ }
+ i = 1;
+ while (i < 64) {
+ run = 0;
+ while ((c = readHuffSym(acHuffTable)) == 0xf0 && run < 0x30) {
+ run += 0x10;
+ }
+ if (c == 9999) {
+ return gFalse;
+ }
+ if (c == 0x00) {
+ break;
+ } else {
+ run += (c >> 4) & 0x0f;
+ size = c & 0x0f;
+ amp = readAmp(size);
+ if (amp == 9999) {
+ return gFalse;
+ }
+ i += run;
+ if (i < 64) {
+ j = dctZigZag[i++];
+ data[j] = amp;
+ }
+ }
+ }
+ return gTrue;
+}
+
+// Read one data unit from a sequential JPEG stream.
+GBool DCTStream::readProgressiveDataUnit(DCTHuffTable *dcHuffTable,
+ DCTHuffTable *acHuffTable,
+ int *prevDC, int data[64]) {
+ int run, size, amp, bit, c;
+ int i, j, k;
+
+ // get the DC coefficient
+ i = scanInfo.firstCoeff;
+ if (i == 0) {
+ if (scanInfo.ah == 0) {
+ if ((size = readHuffSym(dcHuffTable)) == 9999) {
+ return gFalse;
+ }
+ if (size > 0) {
+ if ((amp = readAmp(size)) == 9999) {
+ return gFalse;
+ }
+ } else {
+ amp = 0;
+ }
+ data[0] += (*prevDC += amp) << scanInfo.al;
+ } else {
+ if ((bit = readBit()) == 9999) {
+ return gFalse;
+ }
+ data[0] += bit << scanInfo.al;
+ }
+ ++i;
+ }
+ if (scanInfo.lastCoeff == 0) {
+ return gTrue;
+ }
+
+ // check for an EOB run
+ if (eobRun > 0) {
+ while (i <= scanInfo.lastCoeff) {
+ j = dctZigZag[i++];
+ if (data[j] != 0) {
+ if ((bit = readBit()) == EOF) {
+ return gFalse;
+ }
+ if (bit) {
+ data[j] += 1 << scanInfo.al;
+ }
+ }
+ }
+ --eobRun;
+ return gTrue;
+ }
+
+ // read the AC coefficients
+ while (i <= scanInfo.lastCoeff) {
+ if ((c = readHuffSym(acHuffTable)) == 9999) {
+ return gFalse;
+ }
+
+ // ZRL
+ if (c == 0xf0) {
+ k = 0;
+ while (k < 16) {
+ j = dctZigZag[i++];
+ if (data[j] == 0) {
+ ++k;
+ } else {
+ if ((bit = readBit()) == EOF) {
+ return gFalse;
+ }
+ if (bit) {
+ data[j] += 1 << scanInfo.al;
+ }
+ }
+ }
+
+ // EOB run
+ } else if ((c & 0x0f) == 0x00) {
+ j = c >> 4;
+ eobRun = 0;
+ for (k = 0; k < j; ++k) {
+ if ((bit = readBit()) == EOF) {
+ return gFalse;
+ }
+ eobRun = (eobRun << 1) | bit;
+ }
+ eobRun += 1 << j;
+ while (i <= scanInfo.lastCoeff) {
+ j = dctZigZag[i++];
+ if (data[j] != 0) {
+ if ((bit = readBit()) == EOF) {
+ return gFalse;
+ }
+ if (bit) {
+ data[j] += 1 << scanInfo.al;
+ }
+ }
+ }
+ --eobRun;
+ break;
+
+ // zero run and one AC coefficient
+ } else {
+ run = (c >> 4) & 0x0f;
+ size = c & 0x0f;
+ if ((amp = readAmp(size)) == 9999) {
+ return gFalse;
+ }
+ k = 0;
+ do {
+ j = dctZigZag[i++];
+ while (data[j] != 0) {
+ if ((bit = readBit()) == EOF) {
+ return gFalse;
+ }
+ if (bit) {
+ data[j] += 1 << scanInfo.al;
+ }
+ j = dctZigZag[i++];
+ }
+ ++k;
+ } while (k <= run);
+ data[j] = amp << scanInfo.al;
+ }
+ }
+
+ return gTrue;
+}
+
+// Decode a progressive JPEG image.
+void DCTStream::decodeImage() {
+ int dataIn[64];
+ Guchar dataOut[64];
+ Gushort *quantTable;
+ int pY, pCb, pCr, pR, pG, pB;
+ int x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
+ int h, v, horiz, vert, hSub, vSub;
+ int *p0, *p1, *p2;
+
+ for (y1 = 0; y1 < bufHeight; y1 += mcuHeight) {
+ for (x1 = 0; x1 < bufWidth; x1 += mcuWidth) {
+ for (cc = 0; cc < numComps; ++cc) {
+ quantTable = quantTables[compInfo[cc].quantTable];
+ h = compInfo[cc].hSample;
+ v = compInfo[cc].vSample;
+ horiz = mcuWidth / h;
+ vert = mcuHeight / v;
+ hSub = horiz / 8;
+ vSub = vert / 8;
+ for (y2 = 0; y2 < mcuHeight; y2 += vert) {
+ for (x2 = 0; x2 < mcuWidth; x2 += horiz) {
+
+ // pull out the coded data unit
+ p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
+ for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
+ dataIn[i] = p1[0];
+ dataIn[i+1] = p1[1];
+ dataIn[i+2] = p1[2];
+ dataIn[i+3] = p1[3];
+ dataIn[i+4] = p1[4];
+ dataIn[i+5] = p1[5];
+ dataIn[i+6] = p1[6];
+ dataIn[i+7] = p1[7];
+ p1 += bufWidth * vSub;
+ }
+
+ // transform
+ transformDataUnit(quantTable, dataIn, dataOut);
+
+ // store back into frameBuf, doing replication for
+ // subsampled components
+ p1 = &frameBuf[cc][(y1+y2) * bufWidth + (x1+x2)];
+ if (hSub == 1 && vSub == 1) {
+ for (y3 = 0, i = 0; y3 < 8; ++y3, i += 8) {
+ p1[0] = dataOut[i] & 0xff;
+ p1[1] = dataOut[i+1] & 0xff;
+ p1[2] = dataOut[i+2] & 0xff;
+ p1[3] = dataOut[i+3] & 0xff;
+ p1[4] = dataOut[i+4] & 0xff;
+ p1[5] = dataOut[i+5] & 0xff;
+ p1[6] = dataOut[i+6] & 0xff;
+ p1[7] = dataOut[i+7] & 0xff;
+ p1 += bufWidth;
+ }
+ } else if (hSub == 2 && vSub == 2) {
+ p2 = p1 + bufWidth;
+ for (y3 = 0, i = 0; y3 < 16; y3 += 2, i += 8) {
+ p1[0] = p1[1] = p2[0] = p2[1] = dataOut[i] & 0xff;
+ p1[2] = p1[3] = p2[2] = p2[3] = dataOut[i+1] & 0xff;
+ p1[4] = p1[5] = p2[4] = p2[5] = dataOut[i+2] & 0xff;
+ p1[6] = p1[7] = p2[6] = p2[7] = dataOut[i+3] & 0xff;
+ p1[8] = p1[9] = p2[8] = p2[9] = dataOut[i+4] & 0xff;
+ p1[10] = p1[11] = p2[10] = p2[11] = dataOut[i+5] & 0xff;
+ p1[12] = p1[13] = p2[12] = p2[13] = dataOut[i+6] & 0xff;
+ p1[14] = p1[15] = p2[14] = p2[15] = dataOut[i+7] & 0xff;
+ p1 += bufWidth * 2;
+ p2 += bufWidth * 2;
+ }
+ } else {
+ i = 0;
+ for (y3 = 0, y4 = 0; y3 < 8; ++y3, y4 += vSub) {
+ for (x3 = 0, x4 = 0; x3 < 8; ++x3, x4 += hSub) {
+ p2 = p1 + x4;
+ for (y5 = 0; y5 < vSub; ++y5) {
+ for (x5 = 0; x5 < hSub; ++x5) {
+ p2[x5] = dataOut[i] & 0xff;
+ }
+ p2 += bufWidth;
+ }
+ ++i;
+ }
+ p1 += bufWidth * vSub;
+ }
+ }
+ }
+ }
+ }
+
+ // color space conversion
+ if (colorXform) {
+ // convert YCbCr to RGB
+ if (numComps == 3) {
+ for (y2 = 0; y2 < mcuHeight; ++y2) {
+ p0 = &frameBuf[0][(y1+y2) * bufWidth + x1];
+ p1 = &frameBuf[1][(y1+y2) * bufWidth + x1];
+ p2 = &frameBuf[2][(y1+y2) * bufWidth + x1];
+ for (x2 = 0; x2 < mcuWidth; ++x2) {
+ pY = *p0;
+ pCb = *p1 - 128;
+ pCr = *p2 - 128;
+ pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
+ *p0++ = dctClip[dctClipOffset + pR];
+ pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
+ 32768) >> 16;
+ *p1++ = dctClip[dctClipOffset + pG];
+ pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
+ *p2++ = dctClip[dctClipOffset + pB];
+ }
+ }
+ // convert YCbCrK to CMYK (K is passed through unchanged)
+ } else if (numComps == 4) {
+ for (y2 = 0; y2 < mcuHeight; ++y2) {
+ p0 = &frameBuf[0][(y1+y2) * bufWidth + x1];
+ p1 = &frameBuf[1][(y1+y2) * bufWidth + x1];
+ p2 = &frameBuf[2][(y1+y2) * bufWidth + x1];
+ for (x2 = 0; x2 < mcuWidth; ++x2) {
+ pY = *p0;
+ pCb = *p1 - 128;
+ pCr = *p2 - 128;
+ pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
+ *p0++ = 255 - dctClip[dctClipOffset + pR];
+ pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr +
+ 32768) >> 16;
+ *p1++ = 255 - dctClip[dctClipOffset + pG];
+ pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
+ *p2++ = 255 - dctClip[dctClipOffset + pB];
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// Transform one data unit -- this performs the dequantization and
+// IDCT steps. This IDCT algorithm is taken from:
+// Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,
+// "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
+// IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,
+// 988-991.
+// The stage numbers mentioned in the comments refer to Figure 1 in this
+// paper.
+void DCTStream::transformDataUnit(Gushort *quantTable,
+ int dataIn[64], Guchar dataOut[64]) {
+ int v0, v1, v2, v3, v4, v5, v6, v7, t;
+ int *p;
+ int i;
+
+ // dequant
+ for (i = 0; i < 64; ++i) {
+ dataIn[i] *= quantTable[i];
+ }
+
+ // inverse DCT on rows
+ for (i = 0; i < 64; i += 8) {
+ p = dataIn + i;
+
+ // check for all-zero AC coefficients
+ if (p[1] == 0 && p[2] == 0 && p[3] == 0 &&
+ p[4] == 0 && p[5] == 0 && p[6] == 0 && p[7] == 0) {
+ t = (dctSqrt2 * p[0] + 512) >> 10;
+ p[0] = t;
+ p[1] = t;
+ p[2] = t;
+ p[3] = t;
+ p[4] = t;
+ p[5] = t;
+ p[6] = t;
+ p[7] = t;
+ continue;
+ }
+
+ // stage 4
+ v0 = (dctSqrt2 * p[0] + 128) >> 8;
+ v1 = (dctSqrt2 * p[4] + 128) >> 8;
+ v2 = p[2];
+ v3 = p[6];
+ v4 = (dctSqrt1d2 * (p[1] - p[7]) + 128) >> 8;
+ v7 = (dctSqrt1d2 * (p[1] + p[7]) + 128) >> 8;
+ v5 = p[3] << 4;
+ v6 = p[5] << 4;
+
+ // stage 3
+ t = (v0 - v1+ 1) >> 1;
+ v0 = (v0 + v1 + 1) >> 1;
+ v1 = t;
+ t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8;
+ v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8;
+ v3 = t;
+ t = (v4 - v6 + 1) >> 1;
+ v4 = (v4 + v6 + 1) >> 1;
+ v6 = t;
+ t = (v7 + v5 + 1) >> 1;
+ v5 = (v7 - v5 + 1) >> 1;
+ v7 = t;
+
+ // stage 2
+ t = (v0 - v3 + 1) >> 1;
+ v0 = (v0 + v3 + 1) >> 1;
+ v3 = t;
+ t = (v1 - v2 + 1) >> 1;
+ v1 = (v1 + v2 + 1) >> 1;
+ v2 = t;
+ t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
+ v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
+ v7 = t;
+ t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
+ v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
+ v6 = t;
+
+ // stage 1
+ p[0] = v0 + v7;
+ p[7] = v0 - v7;
+ p[1] = v1 + v6;
+ p[6] = v1 - v6;
+ p[2] = v2 + v5;
+ p[5] = v2 - v5;
+ p[3] = v3 + v4;
+ p[4] = v3 - v4;
+ }
+
+ // inverse DCT on columns
+ for (i = 0; i < 8; ++i) {
+ p = dataIn + i;
+
+ // check for all-zero AC coefficients
+ if (p[1*8] == 0 && p[2*8] == 0 && p[3*8] == 0 &&
+ p[4*8] == 0 && p[5*8] == 0 && p[6*8] == 0 && p[7*8] == 0) {
+ t = (dctSqrt2 * dataIn[i+0] + 8192) >> 14;
+ p[0*8] = t;
+ p[1*8] = t;
+ p[2*8] = t;
+ p[3*8] = t;
+ p[4*8] = t;
+ p[5*8] = t;
+ p[6*8] = t;
+ p[7*8] = t;
+ continue;
+ }
+
+ // stage 4
+ v0 = (dctSqrt2 * p[0*8] + 2048) >> 12;
+ v1 = (dctSqrt2 * p[4*8] + 2048) >> 12;
+ v2 = p[2*8];
+ v3 = p[6*8];
+ v4 = (dctSqrt1d2 * (p[1*8] - p[7*8]) + 2048) >> 12;
+ v7 = (dctSqrt1d2 * (p[1*8] + p[7*8]) + 2048) >> 12;
+ v5 = p[3*8];
+ v6 = p[5*8];
+
+ // stage 3
+ t = (v0 - v1 + 1) >> 1;
+ v0 = (v0 + v1 + 1) >> 1;
+ v1 = t;
+ t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12;
+ v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12;
+ v3 = t;
+ t = (v4 - v6 + 1) >> 1;
+ v4 = (v4 + v6 + 1) >> 1;
+ v6 = t;
+ t = (v7 + v5 + 1) >> 1;
+ v5 = (v7 - v5 + 1) >> 1;
+ v7 = t;
+
+ // stage 2
+ t = (v0 - v3 + 1) >> 1;
+ v0 = (v0 + v3 + 1) >> 1;
+ v3 = t;
+ t = (v1 - v2 + 1) >> 1;
+ v1 = (v1 + v2 + 1) >> 1;
+ v2 = t;
+ t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
+ v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
+ v7 = t;
+ t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
+ v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
+ v6 = t;
+
+ // stage 1
+ p[0*8] = v0 + v7;
+ p[7*8] = v0 - v7;
+ p[1*8] = v1 + v6;
+ p[6*8] = v1 - v6;
+ p[2*8] = v2 + v5;
+ p[5*8] = v2 - v5;
+ p[3*8] = v3 + v4;
+ p[4*8] = v3 - v4;
+ }
+
+ // convert to 8-bit integers
+ for (i = 0; i < 64; ++i) {
+ dataOut[i] = dctClip[dctClipOffset + 128 + ((dataIn[i] + 8) >> 4)];
+ }
+}
+
+int DCTStream::readHuffSym(DCTHuffTable *table) {
+ Gushort code;
+ int bit;
+ int codeBits;
+
+ code = 0;
+ codeBits = 0;
+ do {
+ // add a bit to the code
+ if ((bit = readBit()) == EOF)
+ return 9999;
+ code = (code << 1) + bit;
+ ++codeBits;
+
+ // look up code
+ if (code - table->firstCode[codeBits] < table->numCodes[codeBits]) {
+ code -= table->firstCode[codeBits];
+ return table->sym[table->firstSym[codeBits] + code];
+ }
+ } while (codeBits < 16);
+
+ error(getPos(), "Bad Huffman code in DCT stream");
+ return 9999;
+}
+
+int DCTStream::readAmp(int size) {
+ int amp, bit;
+ int bits;
+
+ amp = 0;
+ for (bits = 0; bits < size; ++bits) {
+ if ((bit = readBit()) == EOF)
+ return 9999;
+ amp = (amp << 1) + bit;
+ }
+ if (amp < (1 << (size - 1)))
+ amp -= (1 << size) - 1;
+ return amp;
+}
+
+int DCTStream::readBit() {
+ int bit;
+ int c, c2;
+
+ if (inputBits == 0) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ if (c == 0xff) {
+ do {
+ c2 = str->getChar();
+ } while (c2 == 0xff);
+ if (c2 != 0x00) {
+ error(getPos(), "Bad DCT data: missing 00 after ff");
+ return EOF;
+ }
+ }
+ inputBuf = c;
+ inputBits = 8;
+ }
+ bit = (inputBuf >> (inputBits - 1)) & 1;
+ --inputBits;
+ return bit;
+}
+
+GBool DCTStream::readHeader() {
+ GBool doScan;
+ int n;
+ int c = 0;
+ int i;
+
+ // read headers
+ doScan = gFalse;
+ while (!doScan) {
+ c = readMarker();
+ switch (c) {
+ case 0xc0: // SOF0 (sequential)
+ case 0xc1: // SOF1 (extended sequential)
+ if (!readBaselineSOF()) {
+ return gFalse;
+ }
+ break;
+ case 0xc2: // SOF2 (progressive)
+ if (!readProgressiveSOF()) {
+ return gFalse;
+ }
+ break;
+ case 0xc4: // DHT
+ if (!readHuffmanTables()) {
+ return gFalse;
+ }
+ break;
+ case 0xd8: // SOI
+ break;
+ case 0xd9: // EOI
+ return gFalse;
+ case 0xda: // SOS
+ if (!readScanInfo()) {
+ return gFalse;
+ }
+ doScan = gTrue;
+ break;
+ case 0xdb: // DQT
+ if (!readQuantTables()) {
+ return gFalse;
+ }
+ break;
+ case 0xdd: // DRI
+ if (!readRestartInterval()) {
+ return gFalse;
+ }
+ break;
+ case 0xe0: // APP0
+ if (!readJFIFMarker()) {
+ return gFalse;
+ }
+ break;
+ case 0xee: // APP14
+ if (!readAdobeMarker()) {
+ return gFalse;
+ }
+ break;
+ case EOF:
+ error(getPos(), "Bad DCT header");
+ return gFalse;
+ default:
+ // skip APPn / COM / etc.
+ if (c >= 0xe0) {
+ n = read16() - 2;
+ for (i = 0; i < n; ++i) {
+ str->getChar();
+ }
+ } else {
+ error(getPos(), "Unknown DCT marker <%02x>", c);
+ return gFalse;
+ }
+ break;
+ }
+ }
+
+ return gTrue;
+}
+
+GBool DCTStream::readBaselineSOF() {
+ int length;
+ int prec;
+ int i;
+ int c;
+
+ length = read16();
+ prec = str->getChar();
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
+ if (numComps <= 0 || numComps > 4) {
+ error(getPos(), "Bad number of components in DCT stream");
+ numComps = 0;
+ return gFalse;
+ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+ }
+ for (i = 0; i < numComps; ++i) {
+ compInfo[i].id = str->getChar();
+ c = str->getChar();
+ compInfo[i].hSample = (c >> 4) & 0x0f;
+ compInfo[i].vSample = c & 0x0f;
+ compInfo[i].quantTable = str->getChar();
+ }
+ progressive = gFalse;
+ return gTrue;
+}
+
+GBool DCTStream::readProgressiveSOF() {
+ int length;
+ int prec;
+ int i;
+ int c;
+
+ length = read16();
+ prec = str->getChar();
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
+ if (numComps <= 0 || numComps > 4) {
+ error(getPos(), "Bad number of components in DCT stream");
+ numComps = 0;
+ return gFalse;
+ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+ }
+ for (i = 0; i < numComps; ++i) {
+ compInfo[i].id = str->getChar();
+ c = str->getChar();
+ compInfo[i].hSample = (c >> 4) & 0x0f;
+ compInfo[i].vSample = c & 0x0f;
+ compInfo[i].quantTable = str->getChar();
+ }
+ progressive = gTrue;
+ return gTrue;
+}
+
+GBool DCTStream::readScanInfo() {
+ int length;
+ int id, c;
+ int i, j;
+
+ length = read16() - 2;
+ scanInfo.numComps = str->getChar();
+ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
+ error(getPos(), "Bad number of components in DCT stream");
+ scanInfo.numComps = 0;
+ return gFalse;
+ }
+ --length;
+ if (length != 2 * scanInfo.numComps + 3) {
+ error(getPos(), "Bad DCT scan info block");
+ return gFalse;
+ }
+ interleaved = scanInfo.numComps == numComps;
+ for (j = 0; j < numComps; ++j) {
+ scanInfo.comp[j] = gFalse;
+ }
+ for (i = 0; i < scanInfo.numComps; ++i) {
+ id = str->getChar();
+ // some (broken) DCT streams reuse ID numbers, but at least they
+ // keep the components in order, so we check compInfo[i] first to
+ // work around the problem
+ if (id == compInfo[i].id) {
+ j = i;
+ } else {
+ for (j = 0; j < numComps; ++j) {
+ if (id == compInfo[j].id) {
+ break;
+ }
+ }
+ if (j == numComps) {
+ error(getPos(), "Bad DCT component ID in scan info block");
+ return gFalse;
+ }
+ }
+ scanInfo.comp[j] = gTrue;
+ c = str->getChar();
+ scanInfo.dcHuffTable[j] = (c >> 4) & 0x0f;
+ scanInfo.acHuffTable[j] = c & 0x0f;
+ }
+ scanInfo.firstCoeff = str->getChar();
+ scanInfo.lastCoeff = str->getChar();
+ if (scanInfo.firstCoeff < 0 || scanInfo.lastCoeff > 63 ||
+ scanInfo.firstCoeff > scanInfo.lastCoeff) {
+ error(getPos(), "Bad DCT coefficient numbers in scan info block");
+ return gFalse;
+ }
+ c = str->getChar();
+ scanInfo.ah = (c >> 4) & 0x0f;
+ scanInfo.al = c & 0x0f;
+ return gTrue;
+}
+
+GBool DCTStream::readQuantTables() {
+ int length, prec, i, index;
+
+ length = read16() - 2;
+ while (length > 0) {
+ index = str->getChar();
+ prec = (index >> 4) & 0x0f;
+ index &= 0x0f;
+ if (prec > 1 || index >= 4) {
+ error(getPos(), "Bad DCT quantization table");
+ return gFalse;
+ }
+ if (index == numQuantTables) {
+ numQuantTables = index + 1;
+ }
+ for (i = 0; i < 64; ++i) {
+ if (prec) {
+ quantTables[index][dctZigZag[i]] = read16();
+ } else {
+ quantTables[index][dctZigZag[i]] = str->getChar();
+ }
+ }
+ if (prec) {
+ length -= 129;
+ } else {
+ length -= 65;
+ }
+ }
+ return gTrue;
+}
+
+GBool DCTStream::readHuffmanTables() {
+ DCTHuffTable *tbl;
+ int length;
+ int index;
+ Gushort code;
+ Guchar sym;
+ int i;
+ int c;
+
+ length = read16() - 2;
+ while (length > 0) {
+ index = str->getChar();
+ --length;
+ if ((index & 0x0f) >= 4) {
+ error(getPos(), "Bad DCT Huffman table");
+ return gFalse;
+ }
+ if (index & 0x10) {
+ index &= 0x0f;
+ if (index >= numACHuffTables)
+ numACHuffTables = index+1;
+ tbl = &acHuffTables[index];
+ } else {
+ index &= 0x0f;
+ if (index >= numDCHuffTables)
+ numDCHuffTables = index+1;
+ tbl = &dcHuffTables[index];
+ }
+ sym = 0;
+ code = 0;
+ for (i = 1; i <= 16; ++i) {
+ c = str->getChar();
+ tbl->firstSym[i] = sym;
+ tbl->firstCode[i] = code;
+ tbl->numCodes[i] = c;
+ sym += c;
+ code = (code + c) << 1;
+ }
+ length -= 16;
+ for (i = 0; i < sym; ++i)
+ tbl->sym[i] = str->getChar();
+ length -= sym;
+ }
+ return gTrue;
+}
+
+GBool DCTStream::readRestartInterval() {
+ int length;
+
+ length = read16();
+ if (length != 4) {
+ error(getPos(), "Bad DCT restart interval");
+ return gFalse;
+ }
+ restartInterval = read16();
+ return gTrue;
+}
+
+GBool DCTStream::readJFIFMarker() {
+ int length, i;
+ char buf[5];
+ int c;
+
+ length = read16();
+ length -= 2;
+ if (length >= 5) {
+ for (i = 0; i < 5; ++i) {
+ if ((c = str->getChar()) == EOF) {
+ error(getPos(), "Bad DCT APP0 marker");
+ return gFalse;
+ }
+ buf[i] = c;
+ }
+ length -= 5;
+ if (!memcmp(buf, "JFIF\0", 5)) {
+ gotJFIFMarker = gTrue;
+ }
+ }
+ while (length > 0) {
+ if (str->getChar() == EOF) {
+ error(getPos(), "Bad DCT APP0 marker");
+ return gFalse;
+ }
+ --length;
+ }
+ return gTrue;
+}
+
+GBool DCTStream::readAdobeMarker() {
+ int length, i;
+ char buf[12];
+ int c;
+
+ length = read16();
+ if (length < 14) {
+ goto err;
+ }
+ for (i = 0; i < 12; ++i) {
+ if ((c = str->getChar()) == EOF) {
+ goto err;
+ }
+ buf[i] = c;
+ }
+ if (strncmp(buf, "Adobe", 5)) {
+ goto err;
+ }
+ colorXform = buf[11];
+ gotAdobeMarker = gTrue;
+ for (i = 14; i < length; ++i) {
+ if (str->getChar() == EOF) {
+ goto err;
+ }
+ }
+ return gTrue;
+
+ err:
+ error(getPos(), "Bad DCT Adobe APP14 marker");
+ return gFalse;
+}
+
+GBool DCTStream::readTrailer() {
+ int c;
+
+ c = readMarker();
+ if (c != 0xd9) { // EOI
+ error(getPos(), "Bad DCT trailer");
+ return gFalse;
+ }
+ return gTrue;
+}
+
+int DCTStream::readMarker() {
+ int c;
+
+ do {
+ do {
+ c = str->getChar();
+ } while (c != 0xff && c != EOF);
+ do {
+ c = str->getChar();
+ } while (c == 0xff);
+ } while (c == 0x00);
+ return c;
+}
+
+int DCTStream::read16() {
+ int c1, c2;
+
+ if ((c1 = str->getChar()) == EOF)
+ return EOF;
+ if ((c2 = str->getChar()) == EOF)
+ return EOF;
+ return (c1 << 8) + c2;
+}
+
+GString *DCTStream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+
+ if (psLevel < 2) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("<< >> /DCTDecode filter\n");
+ return s;
+}
+
+GBool DCTStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// FlateStream
+//------------------------------------------------------------------------
+
+int FlateStream::codeLenCodeMap[flateMaxCodeLenCodes] = {
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
+};
+
+FlateDecode FlateStream::lengthDecode[flateMaxLitCodes-257] = {
+ {0, 3},
+ {0, 4},
+ {0, 5},
+ {0, 6},
+ {0, 7},
+ {0, 8},
+ {0, 9},
+ {0, 10},
+ {1, 11},
+ {1, 13},
+ {1, 15},
+ {1, 17},
+ {2, 19},
+ {2, 23},
+ {2, 27},
+ {2, 31},
+ {3, 35},
+ {3, 43},
+ {3, 51},
+ {3, 59},
+ {4, 67},
+ {4, 83},
+ {4, 99},
+ {4, 115},
+ {5, 131},
+ {5, 163},
+ {5, 195},
+ {5, 227},
+ {0, 258},
+ {0, 258},
+ {0, 258}
+};
+
+FlateDecode FlateStream::distDecode[flateMaxDistCodes] = {
+ { 0, 1},
+ { 0, 2},
+ { 0, 3},
+ { 0, 4},
+ { 1, 5},
+ { 1, 7},
+ { 2, 9},
+ { 2, 13},
+ { 3, 17},
+ { 3, 25},
+ { 4, 33},
+ { 4, 49},
+ { 5, 65},
+ { 5, 97},
+ { 6, 129},
+ { 6, 193},
+ { 7, 257},
+ { 7, 385},
+ { 8, 513},
+ { 8, 769},
+ { 9, 1025},
+ { 9, 1537},
+ {10, 2049},
+ {10, 3073},
+ {11, 4097},
+ {11, 6145},
+ {12, 8193},
+ {12, 12289},
+ {13, 16385},
+ {13, 24577}
+};
+
+static FlateCode flateFixedLitCodeTabCodes[512] = {
+ {7, 0x0100},
+ {8, 0x0050},
+ {8, 0x0010},
+ {8, 0x0118},
+ {7, 0x0110},
+ {8, 0x0070},
+ {8, 0x0030},
+ {9, 0x00c0},
+ {7, 0x0108},
+ {8, 0x0060},
+ {8, 0x0020},
+ {9, 0x00a0},
+ {8, 0x0000},
+ {8, 0x0080},
+ {8, 0x0040},
+ {9, 0x00e0},
+ {7, 0x0104},
+ {8, 0x0058},
+ {8, 0x0018},
+ {9, 0x0090},
+ {7, 0x0114},
+ {8, 0x0078},
+ {8, 0x0038},
+ {9, 0x00d0},
+ {7, 0x010c},
+ {8, 0x0068},
+ {8, 0x0028},
+ {9, 0x00b0},
+ {8, 0x0008},
+ {8, 0x0088},
+ {8, 0x0048},
+ {9, 0x00f0},
+ {7, 0x0102},
+ {8, 0x0054},
+ {8, 0x0014},
+ {8, 0x011c},
+ {7, 0x0112},
+ {8, 0x0074},
+ {8, 0x0034},
+ {9, 0x00c8},
+ {7, 0x010a},
+ {8, 0x0064},
+ {8, 0x0024},
+ {9, 0x00a8},
+ {8, 0x0004},
+ {8, 0x0084},
+ {8, 0x0044},
+ {9, 0x00e8},
+ {7, 0x0106},
+ {8, 0x005c},
+ {8, 0x001c},
+ {9, 0x0098},
+ {7, 0x0116},
+ {8, 0x007c},
+ {8, 0x003c},
+ {9, 0x00d8},
+ {7, 0x010e},
+ {8, 0x006c},
+ {8, 0x002c},
+ {9, 0x00b8},
+ {8, 0x000c},
+ {8, 0x008c},
+ {8, 0x004c},
+ {9, 0x00f8},
+ {7, 0x0101},
+ {8, 0x0052},
+ {8, 0x0012},
+ {8, 0x011a},
+ {7, 0x0111},
+ {8, 0x0072},
+ {8, 0x0032},
+ {9, 0x00c4},
+ {7, 0x0109},
+ {8, 0x0062},
+ {8, 0x0022},
+ {9, 0x00a4},
+ {8, 0x0002},
+ {8, 0x0082},
+ {8, 0x0042},
+ {9, 0x00e4},
+ {7, 0x0105},
+ {8, 0x005a},
+ {8, 0x001a},
+ {9, 0x0094},
+ {7, 0x0115},
+ {8, 0x007a},
+ {8, 0x003a},
+ {9, 0x00d4},
+ {7, 0x010d},
+ {8, 0x006a},
+ {8, 0x002a},
+ {9, 0x00b4},
+ {8, 0x000a},
+ {8, 0x008a},
+ {8, 0x004a},
+ {9, 0x00f4},
+ {7, 0x0103},
+ {8, 0x0056},
+ {8, 0x0016},
+ {8, 0x011e},
+ {7, 0x0113},
+ {8, 0x0076},
+ {8, 0x0036},
+ {9, 0x00cc},
+ {7, 0x010b},
+ {8, 0x0066},
+ {8, 0x0026},
+ {9, 0x00ac},
+ {8, 0x0006},
+ {8, 0x0086},
+ {8, 0x0046},
+ {9, 0x00ec},
+ {7, 0x0107},
+ {8, 0x005e},
+ {8, 0x001e},
+ {9, 0x009c},
+ {7, 0x0117},
+ {8, 0x007e},
+ {8, 0x003e},
+ {9, 0x00dc},
+ {7, 0x010f},
+ {8, 0x006e},
+ {8, 0x002e},
+ {9, 0x00bc},
+ {8, 0x000e},
+ {8, 0x008e},
+ {8, 0x004e},
+ {9, 0x00fc},
+ {7, 0x0100},
+ {8, 0x0051},
+ {8, 0x0011},
+ {8, 0x0119},
+ {7, 0x0110},
+ {8, 0x0071},
+ {8, 0x0031},
+ {9, 0x00c2},
+ {7, 0x0108},
+ {8, 0x0061},
+ {8, 0x0021},
+ {9, 0x00a2},
+ {8, 0x0001},
+ {8, 0x0081},
+ {8, 0x0041},
+ {9, 0x00e2},
+ {7, 0x0104},
+ {8, 0x0059},
+ {8, 0x0019},
+ {9, 0x0092},
+ {7, 0x0114},
+ {8, 0x0079},
+ {8, 0x0039},
+ {9, 0x00d2},
+ {7, 0x010c},
+ {8, 0x0069},
+ {8, 0x0029},
+ {9, 0x00b2},
+ {8, 0x0009},
+ {8, 0x0089},
+ {8, 0x0049},
+ {9, 0x00f2},
+ {7, 0x0102},
+ {8, 0x0055},
+ {8, 0x0015},
+ {8, 0x011d},
+ {7, 0x0112},
+ {8, 0x0075},
+ {8, 0x0035},
+ {9, 0x00ca},
+ {7, 0x010a},
+ {8, 0x0065},
+ {8, 0x0025},
+ {9, 0x00aa},
+ {8, 0x0005},
+ {8, 0x0085},
+ {8, 0x0045},
+ {9, 0x00ea},
+ {7, 0x0106},
+ {8, 0x005d},
+ {8, 0x001d},
+ {9, 0x009a},
+ {7, 0x0116},
+ {8, 0x007d},
+ {8, 0x003d},
+ {9, 0x00da},
+ {7, 0x010e},
+ {8, 0x006d},
+ {8, 0x002d},
+ {9, 0x00ba},
+ {8, 0x000d},
+ {8, 0x008d},
+ {8, 0x004d},
+ {9, 0x00fa},
+ {7, 0x0101},
+ {8, 0x0053},
+ {8, 0x0013},
+ {8, 0x011b},
+ {7, 0x0111},
+ {8, 0x0073},
+ {8, 0x0033},
+ {9, 0x00c6},
+ {7, 0x0109},
+ {8, 0x0063},
+ {8, 0x0023},
+ {9, 0x00a6},
+ {8, 0x0003},
+ {8, 0x0083},
+ {8, 0x0043},
+ {9, 0x00e6},
+ {7, 0x0105},
+ {8, 0x005b},
+ {8, 0x001b},
+ {9, 0x0096},
+ {7, 0x0115},
+ {8, 0x007b},
+ {8, 0x003b},
+ {9, 0x00d6},
+ {7, 0x010d},
+ {8, 0x006b},
+ {8, 0x002b},
+ {9, 0x00b6},
+ {8, 0x000b},
+ {8, 0x008b},
+ {8, 0x004b},
+ {9, 0x00f6},
+ {7, 0x0103},
+ {8, 0x0057},
+ {8, 0x0017},
+ {8, 0x011f},
+ {7, 0x0113},
+ {8, 0x0077},
+ {8, 0x0037},
+ {9, 0x00ce},
+ {7, 0x010b},
+ {8, 0x0067},
+ {8, 0x0027},
+ {9, 0x00ae},
+ {8, 0x0007},
+ {8, 0x0087},
+ {8, 0x0047},
+ {9, 0x00ee},
+ {7, 0x0107},
+ {8, 0x005f},
+ {8, 0x001f},
+ {9, 0x009e},
+ {7, 0x0117},
+ {8, 0x007f},
+ {8, 0x003f},
+ {9, 0x00de},
+ {7, 0x010f},
+ {8, 0x006f},
+ {8, 0x002f},
+ {9, 0x00be},
+ {8, 0x000f},
+ {8, 0x008f},
+ {8, 0x004f},
+ {9, 0x00fe},
+ {7, 0x0100},
+ {8, 0x0050},
+ {8, 0x0010},
+ {8, 0x0118},
+ {7, 0x0110},
+ {8, 0x0070},
+ {8, 0x0030},
+ {9, 0x00c1},
+ {7, 0x0108},
+ {8, 0x0060},
+ {8, 0x0020},
+ {9, 0x00a1},
+ {8, 0x0000},
+ {8, 0x0080},
+ {8, 0x0040},
+ {9, 0x00e1},
+ {7, 0x0104},
+ {8, 0x0058},
+ {8, 0x0018},
+ {9, 0x0091},
+ {7, 0x0114},
+ {8, 0x0078},
+ {8, 0x0038},
+ {9, 0x00d1},
+ {7, 0x010c},
+ {8, 0x0068},
+ {8, 0x0028},
+ {9, 0x00b1},
+ {8, 0x0008},
+ {8, 0x0088},
+ {8, 0x0048},
+ {9, 0x00f1},
+ {7, 0x0102},
+ {8, 0x0054},
+ {8, 0x0014},
+ {8, 0x011c},
+ {7, 0x0112},
+ {8, 0x0074},
+ {8, 0x0034},
+ {9, 0x00c9},
+ {7, 0x010a},
+ {8, 0x0064},
+ {8, 0x0024},
+ {9, 0x00a9},
+ {8, 0x0004},
+ {8, 0x0084},
+ {8, 0x0044},
+ {9, 0x00e9},
+ {7, 0x0106},
+ {8, 0x005c},
+ {8, 0x001c},
+ {9, 0x0099},
+ {7, 0x0116},
+ {8, 0x007c},
+ {8, 0x003c},
+ {9, 0x00d9},
+ {7, 0x010e},
+ {8, 0x006c},
+ {8, 0x002c},
+ {9, 0x00b9},
+ {8, 0x000c},
+ {8, 0x008c},
+ {8, 0x004c},
+ {9, 0x00f9},
+ {7, 0x0101},
+ {8, 0x0052},
+ {8, 0x0012},
+ {8, 0x011a},
+ {7, 0x0111},
+ {8, 0x0072},
+ {8, 0x0032},
+ {9, 0x00c5},
+ {7, 0x0109},
+ {8, 0x0062},
+ {8, 0x0022},
+ {9, 0x00a5},
+ {8, 0x0002},
+ {8, 0x0082},
+ {8, 0x0042},
+ {9, 0x00e5},
+ {7, 0x0105},
+ {8, 0x005a},
+ {8, 0x001a},
+ {9, 0x0095},
+ {7, 0x0115},
+ {8, 0x007a},
+ {8, 0x003a},
+ {9, 0x00d5},
+ {7, 0x010d},
+ {8, 0x006a},
+ {8, 0x002a},
+ {9, 0x00b5},
+ {8, 0x000a},
+ {8, 0x008a},
+ {8, 0x004a},
+ {9, 0x00f5},
+ {7, 0x0103},
+ {8, 0x0056},
+ {8, 0x0016},
+ {8, 0x011e},
+ {7, 0x0113},
+ {8, 0x0076},
+ {8, 0x0036},
+ {9, 0x00cd},
+ {7, 0x010b},
+ {8, 0x0066},
+ {8, 0x0026},
+ {9, 0x00ad},
+ {8, 0x0006},
+ {8, 0x0086},
+ {8, 0x0046},
+ {9, 0x00ed},
+ {7, 0x0107},
+ {8, 0x005e},
+ {8, 0x001e},
+ {9, 0x009d},
+ {7, 0x0117},
+ {8, 0x007e},
+ {8, 0x003e},
+ {9, 0x00dd},
+ {7, 0x010f},
+ {8, 0x006e},
+ {8, 0x002e},
+ {9, 0x00bd},
+ {8, 0x000e},
+ {8, 0x008e},
+ {8, 0x004e},
+ {9, 0x00fd},
+ {7, 0x0100},
+ {8, 0x0051},
+ {8, 0x0011},
+ {8, 0x0119},
+ {7, 0x0110},
+ {8, 0x0071},
+ {8, 0x0031},
+ {9, 0x00c3},
+ {7, 0x0108},
+ {8, 0x0061},
+ {8, 0x0021},
+ {9, 0x00a3},
+ {8, 0x0001},
+ {8, 0x0081},
+ {8, 0x0041},
+ {9, 0x00e3},
+ {7, 0x0104},
+ {8, 0x0059},
+ {8, 0x0019},
+ {9, 0x0093},
+ {7, 0x0114},
+ {8, 0x0079},
+ {8, 0x0039},
+ {9, 0x00d3},
+ {7, 0x010c},
+ {8, 0x0069},
+ {8, 0x0029},
+ {9, 0x00b3},
+ {8, 0x0009},
+ {8, 0x0089},
+ {8, 0x0049},
+ {9, 0x00f3},
+ {7, 0x0102},
+ {8, 0x0055},
+ {8, 0x0015},
+ {8, 0x011d},
+ {7, 0x0112},
+ {8, 0x0075},
+ {8, 0x0035},
+ {9, 0x00cb},
+ {7, 0x010a},
+ {8, 0x0065},
+ {8, 0x0025},
+ {9, 0x00ab},
+ {8, 0x0005},
+ {8, 0x0085},
+ {8, 0x0045},
+ {9, 0x00eb},
+ {7, 0x0106},
+ {8, 0x005d},
+ {8, 0x001d},
+ {9, 0x009b},
+ {7, 0x0116},
+ {8, 0x007d},
+ {8, 0x003d},
+ {9, 0x00db},
+ {7, 0x010e},
+ {8, 0x006d},
+ {8, 0x002d},
+ {9, 0x00bb},
+ {8, 0x000d},
+ {8, 0x008d},
+ {8, 0x004d},
+ {9, 0x00fb},
+ {7, 0x0101},
+ {8, 0x0053},
+ {8, 0x0013},
+ {8, 0x011b},
+ {7, 0x0111},
+ {8, 0x0073},
+ {8, 0x0033},
+ {9, 0x00c7},
+ {7, 0x0109},
+ {8, 0x0063},
+ {8, 0x0023},
+ {9, 0x00a7},
+ {8, 0x0003},
+ {8, 0x0083},
+ {8, 0x0043},
+ {9, 0x00e7},
+ {7, 0x0105},
+ {8, 0x005b},
+ {8, 0x001b},
+ {9, 0x0097},
+ {7, 0x0115},
+ {8, 0x007b},
+ {8, 0x003b},
+ {9, 0x00d7},
+ {7, 0x010d},
+ {8, 0x006b},
+ {8, 0x002b},
+ {9, 0x00b7},
+ {8, 0x000b},
+ {8, 0x008b},
+ {8, 0x004b},
+ {9, 0x00f7},
+ {7, 0x0103},
+ {8, 0x0057},
+ {8, 0x0017},
+ {8, 0x011f},
+ {7, 0x0113},
+ {8, 0x0077},
+ {8, 0x0037},
+ {9, 0x00cf},
+ {7, 0x010b},
+ {8, 0x0067},
+ {8, 0x0027},
+ {9, 0x00af},
+ {8, 0x0007},
+ {8, 0x0087},
+ {8, 0x0047},
+ {9, 0x00ef},
+ {7, 0x0107},
+ {8, 0x005f},
+ {8, 0x001f},
+ {9, 0x009f},
+ {7, 0x0117},
+ {8, 0x007f},
+ {8, 0x003f},
+ {9, 0x00df},
+ {7, 0x010f},
+ {8, 0x006f},
+ {8, 0x002f},
+ {9, 0x00bf},
+ {8, 0x000f},
+ {8, 0x008f},
+ {8, 0x004f},
+ {9, 0x00ff}
+};
+
+FlateHuffmanTab FlateStream::fixedLitCodeTab = {
+ flateFixedLitCodeTabCodes, 9
+};
+
+static FlateCode flateFixedDistCodeTabCodes[32] = {
+ {5, 0x0000},
+ {5, 0x0010},
+ {5, 0x0008},
+ {5, 0x0018},
+ {5, 0x0004},
+ {5, 0x0014},
+ {5, 0x000c},
+ {5, 0x001c},
+ {5, 0x0002},
+ {5, 0x0012},
+ {5, 0x000a},
+ {5, 0x001a},
+ {5, 0x0006},
+ {5, 0x0016},
+ {5, 0x000e},
+ {0, 0x0000},
+ {5, 0x0001},
+ {5, 0x0011},
+ {5, 0x0009},
+ {5, 0x0019},
+ {5, 0x0005},
+ {5, 0x0015},
+ {5, 0x000d},
+ {5, 0x001d},
+ {5, 0x0003},
+ {5, 0x0013},
+ {5, 0x000b},
+ {5, 0x001b},
+ {5, 0x0007},
+ {5, 0x0017},
+ {5, 0x000f},
+ {0, 0x0000}
+};
+
+FlateHuffmanTab FlateStream::fixedDistCodeTab = {
+ flateFixedDistCodeTabCodes, 5
+};
+
+FlateStream::FlateStream(Stream *strA, int predictor, int columns,
+ int colors, int bits):
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
+ if (!pred->isOk()) {
+ delete pred;
+ pred = NULL;
+ }
+ } else {
+ pred = NULL;
+ }
+ litCodeTab.codes = NULL;
+ distCodeTab.codes = NULL;
+ memset(buf, 0, flateWindow);
+}
+
+FlateStream::~FlateStream() {
+ if (litCodeTab.codes != fixedLitCodeTab.codes) {
+ gfree(litCodeTab.codes);
+ }
+ if (distCodeTab.codes != fixedDistCodeTab.codes) {
+ gfree(distCodeTab.codes);
+ }
+ if (pred) {
+ delete pred;
+ }
+ delete str;
+}
+
+void FlateStream::reset() {
+ int cmf, flg;
+
+ index = 0;
+ remain = 0;
+ codeBuf = 0;
+ codeSize = 0;
+ compressedBlock = gFalse;
+ endOfBlock = gTrue;
+ eof = gTrue;
+
+ str->reset();
+
+ // read header
+ //~ need to look at window size?
+ endOfBlock = eof = gTrue;
+ cmf = str->getChar();
+ flg = str->getChar();
+ if (cmf == EOF || flg == EOF)
+ return;
+ if ((cmf & 0x0f) != 0x08) {
+ error(getPos(), "Unknown compression method in flate stream");
+ return;
+ }
+ if ((((cmf << 8) + flg) % 31) != 0) {
+ error(getPos(), "Bad FCHECK in flate stream");
+ return;
+ }
+ if (flg & 0x20) {
+ error(getPos(), "FDICT bit set in flate stream");
+ return;
+ }
+
+ eof = gFalse;
+}
+
+int FlateStream::getChar() {
+ int c;
+
+ if (pred) {
+ return pred->getChar();
+ }
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ index = (index + 1) & flateMask;
+ --remain;
+ return c;
+}
+
+int FlateStream::lookChar() {
+ int c;
+
+ if (pred) {
+ return pred->lookChar();
+ }
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ return c;
+}
+
+int FlateStream::getRawChar() {
+ int c;
+
+ while (remain == 0) {
+ if (endOfBlock && eof)
+ return EOF;
+ readSome();
+ }
+ c = buf[index];
+ index = (index + 1) & flateMask;
+ --remain;
+ return c;
+}
+
+GString *FlateStream::getPSFilter(int psLevel, char *indent) {
+ GString *s;
+
+ if (psLevel < 3 || pred) {
+ return NULL;
+ }
+ if (!(s = str->getPSFilter(psLevel, indent))) {
+ return NULL;
+ }
+ s->append(indent)->append("<< >> /FlateDecode filter\n");
+ return s;
+}
+
+GBool FlateStream::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+void FlateStream::readSome() {
+ int code1, code2;
+ int len, dist;
+ int i, j, k;
+ int c;
+
+ if (endOfBlock) {
+ if (!startBlock())
+ return;
+ }
+
+ if (compressedBlock) {
+ if ((code1 = getHuffmanCodeWord(&litCodeTab)) == EOF)
+ goto err;
+ if (code1 < 256) {
+ buf[index] = code1;
+ remain = 1;
+ } else if (code1 == 256) {
+ endOfBlock = gTrue;
+ remain = 0;
+ } else {
+ code1 -= 257;
+ code2 = lengthDecode[code1].bits;
+ if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
+ goto err;
+ len = lengthDecode[code1].first + code2;
+ if ((code1 = getHuffmanCodeWord(&distCodeTab)) == EOF)
+ goto err;
+ code2 = distDecode[code1].bits;
+ if (code2 > 0 && (code2 = getCodeWord(code2)) == EOF)
+ goto err;
+ dist = distDecode[code1].first + code2;
+ i = index;
+ j = (index - dist) & flateMask;
+ for (k = 0; k < len; ++k) {
+ buf[i] = buf[j];
+ i = (i + 1) & flateMask;
+ j = (j + 1) & flateMask;
+ }
+ remain = len;
+ }
+
+ } else {
+ len = (blockLen < flateWindow) ? blockLen : flateWindow;
+ for (i = 0, j = index; i < len; ++i, j = (j + 1) & flateMask) {
+ if ((c = str->getChar()) == EOF) {
+ endOfBlock = eof = gTrue;
+ break;
+ }
+ buf[j] = c & 0xff;
+ }
+ remain = i;
+ blockLen -= len;
+ if (blockLen == 0)
+ endOfBlock = gTrue;
+ }
+
+ return;
+
+err:
+ error(getPos(), "Unexpected end of file in flate stream");
+ endOfBlock = eof = gTrue;
+ remain = 0;
+}
+
+GBool FlateStream::startBlock() {
+ int blockHdr;
+ int c;
+ int check;
+
+ // free the code tables from the previous block
+ if (litCodeTab.codes != fixedLitCodeTab.codes) {
+ gfree(litCodeTab.codes);
+ }
+ litCodeTab.codes = NULL;
+ if (distCodeTab.codes != fixedDistCodeTab.codes) {
+ gfree(distCodeTab.codes);
+ }
+ distCodeTab.codes = NULL;
+
+ // read block header
+ blockHdr = getCodeWord(3);
+ if (blockHdr & 1)
+ eof = gTrue;
+ blockHdr >>= 1;
+
+ // uncompressed block
+ if (blockHdr == 0) {
+ compressedBlock = gFalse;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ blockLen = c & 0xff;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ blockLen |= (c & 0xff) << 8;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ check = c & 0xff;
+ if ((c = str->getChar()) == EOF)
+ goto err;
+ check |= (c & 0xff) << 8;
+ if (check != (~blockLen & 0xffff))
+ error(getPos(), "Bad uncompressed block length in flate stream");
+ codeBuf = 0;
+ codeSize = 0;
+
+ // compressed block with fixed codes
+ } else if (blockHdr == 1) {
+ compressedBlock = gTrue;
+ loadFixedCodes();
+
+ // compressed block with dynamic codes
+ } else if (blockHdr == 2) {
+ compressedBlock = gTrue;
+ if (!readDynamicCodes()) {
+ goto err;
+ }
+
+ // unknown block type
+ } else {
+ goto err;
+ }
+
+ endOfBlock = gFalse;
+ return gTrue;
+
+err:
+ error(getPos(), "Bad block header in flate stream");
+ endOfBlock = eof = gTrue;
+ return gFalse;
+}
+
+void FlateStream::loadFixedCodes() {
+ litCodeTab.codes = fixedLitCodeTab.codes;
+ litCodeTab.maxLen = fixedLitCodeTab.maxLen;
+ distCodeTab.codes = fixedDistCodeTab.codes;
+ distCodeTab.maxLen = fixedDistCodeTab.maxLen;
+}
+
+GBool FlateStream::readDynamicCodes() {
+ int numCodeLenCodes;
+ int numLitCodes;
+ int numDistCodes;
+ int codeLenCodeLengths[flateMaxCodeLenCodes];
+ FlateHuffmanTab codeLenCodeTab;
+ int len, repeat, code;
+ int i;
+
+ codeLenCodeTab.codes = NULL;
+
+ // read lengths
+ if ((numLitCodes = getCodeWord(5)) == EOF) {
+ goto err;
+ }
+ numLitCodes += 257;
+ if ((numDistCodes = getCodeWord(5)) == EOF) {
+ goto err;
+ }
+ numDistCodes += 1;
+ if ((numCodeLenCodes = getCodeWord(4)) == EOF) {
+ goto err;
+ }
+ numCodeLenCodes += 4;
+ if (numLitCodes > flateMaxLitCodes ||
+ numDistCodes > flateMaxDistCodes ||
+ numCodeLenCodes > flateMaxCodeLenCodes) {
+ goto err;
+ }
+
+ // build the code length code table
+ for (i = 0; i < flateMaxCodeLenCodes; ++i) {
+ codeLenCodeLengths[i] = 0;
+ }
+ for (i = 0; i < numCodeLenCodes; ++i) {
+ if ((codeLenCodeLengths[codeLenCodeMap[i]] = getCodeWord(3)) == -1) {
+ goto err;
+ }
+ }
+ compHuffmanCodes(codeLenCodeLengths, flateMaxCodeLenCodes, &codeLenCodeTab);
+
+ // build the literal and distance code tables
+ len = 0;
+ repeat = 0;
+ i = 0;
+ while (i < numLitCodes + numDistCodes) {
+ if ((code = getHuffmanCodeWord(&codeLenCodeTab)) == EOF) {
+ goto err;
+ }
+ if (code == 16) {
+ if ((repeat = getCodeWord(2)) == EOF) {
+ goto err;
+ }
+ repeat += 3;
+ if (i + repeat > numLitCodes + numDistCodes) {
+ goto err;
+ }
+ for (; repeat > 0; --repeat) {
+ codeLengths[i++] = len;
+ }
+ } else if (code == 17) {
+ if ((repeat = getCodeWord(3)) == EOF) {
+ goto err;
+ }
+ repeat += 3;
+ if (i + repeat > numLitCodes + numDistCodes) {
+ goto err;
+ }
+ len = 0;
+ for (; repeat > 0; --repeat) {
+ codeLengths[i++] = 0;
+ }
+ } else if (code == 18) {
+ if ((repeat = getCodeWord(7)) == EOF) {
+ goto err;
+ }
+ repeat += 11;
+ if (i + repeat > numLitCodes + numDistCodes) {
+ goto err;
+ }
+ len = 0;
+ for (; repeat > 0; --repeat) {
+ codeLengths[i++] = 0;
+ }
+ } else {
+ codeLengths[i++] = len = code;
+ }
+ }
+ compHuffmanCodes(codeLengths, numLitCodes, &litCodeTab);
+ compHuffmanCodes(codeLengths + numLitCodes, numDistCodes, &distCodeTab);
+
+ gfree(codeLenCodeTab.codes);
+ return gTrue;
+
+err:
+ error(getPos(), "Bad dynamic code table in flate stream");
+ gfree(codeLenCodeTab.codes);
+ return gFalse;
+}
+
+// Convert an array <lengths> of <n> lengths, in value order, into a
+// Huffman code lookup table.
+void FlateStream::compHuffmanCodes(int *lengths, int n, FlateHuffmanTab *tab) {
+ int tabSize, len, code, code2, skip, val, i, t;
+
+ // find max code length
+ tab->maxLen = 0;
+ for (val = 0; val < n; ++val) {
+ if (lengths[val] > tab->maxLen) {
+ tab->maxLen = lengths[val];
+ }
+ }
+
+ // allocate the table
+ tabSize = 1 << tab->maxLen;
+ tab->codes = (FlateCode *)gmallocn(tabSize, sizeof(FlateCode));
+
+ // clear the table
+ for (i = 0; i < tabSize; ++i) {
+ tab->codes[i].len = 0;
+ tab->codes[i].val = 0;
+ }
+
+ // build the table
+ for (len = 1, code = 0, skip = 2;
+ len <= tab->maxLen;
+ ++len, code <<= 1, skip <<= 1) {
+ for (val = 0; val < n; ++val) {
+ if (lengths[val] == len) {
+
+ // bit-reverse the code
+ code2 = 0;
+ t = code;
+ for (i = 0; i < len; ++i) {
+ code2 = (code2 << 1) | (t & 1);
+ t >>= 1;
+ }
+
+ // fill in the table entries
+ for (i = code2; i < tabSize; i += skip) {
+ tab->codes[i].len = (Gushort)len;
+ tab->codes[i].val = (Gushort)val;
+ }
+
+ ++code;
+ }
+ }
+ }
+}
+
+int FlateStream::getHuffmanCodeWord(FlateHuffmanTab *tab) {
+ FlateCode *code;
+ int c;
+
+ while (codeSize < tab->maxLen) {
+ if ((c = str->getChar()) == EOF) {
+ break;
+ }
+ codeBuf |= (c & 0xff) << codeSize;
+ codeSize += 8;
+ }
+ code = &tab->codes[codeBuf & ((1 << tab->maxLen) - 1)];
+ if (codeSize == 0 || codeSize < code->len || code->len == 0) {
+ return EOF;
+ }
+ codeBuf >>= code->len;
+ codeSize -= code->len;
+ return (int)code->val;
+}
+
+int FlateStream::getCodeWord(int bits) {
+ int c;
+
+ while (codeSize < bits) {
+ if ((c = str->getChar()) == EOF)
+ return EOF;
+ codeBuf |= (c & 0xff) << codeSize;
+ codeSize += 8;
+ }
+ c = codeBuf & ((1 << bits) - 1);
+ codeBuf >>= bits;
+ codeSize -= bits;
+ return c;
+}
+
+//------------------------------------------------------------------------
+// EOFStream
+//------------------------------------------------------------------------
+
+EOFStream::EOFStream(Stream *strA):
+ FilterStream(strA) {
+}
+
+EOFStream::~EOFStream() {
+ delete str;
+}
+
+//------------------------------------------------------------------------
+// FixedLengthEncoder
+//------------------------------------------------------------------------
+
+FixedLengthEncoder::FixedLengthEncoder(Stream *strA, int lengthA):
+ FilterStream(strA) {
+ length = lengthA;
+ count = 0;
+}
+
+FixedLengthEncoder::~FixedLengthEncoder() {
+ if (str->isEncoder())
+ delete str;
+}
+
+void FixedLengthEncoder::reset() {
+ str->reset();
+ count = 0;
+}
+
+int FixedLengthEncoder::getChar() {
+ if (length >= 0 && count >= length)
+ return EOF;
+ ++count;
+ return str->getChar();
+}
+
+int FixedLengthEncoder::lookChar() {
+ if (length >= 0 && count >= length)
+ return EOF;
+ return str->getChar();
+}
+
+GBool FixedLengthEncoder::isBinary(GBool /*last*/) {
+ return str->isBinary(gTrue);
+}
+
+//------------------------------------------------------------------------
+// ASCIIHexEncoder
+//------------------------------------------------------------------------
+
+ASCIIHexEncoder::ASCIIHexEncoder(Stream *strA):
+ FilterStream(strA) {
+ bufPtr = bufEnd = buf;
+ lineLen = 0;
+ eof = gFalse;
+}
+
+ASCIIHexEncoder::~ASCIIHexEncoder() {
+ if (str->isEncoder()) {
+ delete str;
+ }
+}
+
+void ASCIIHexEncoder::reset() {
+ str->reset();
+ bufPtr = bufEnd = buf;
+ lineLen = 0;
+ eof = gFalse;
+}
+
+GBool ASCIIHexEncoder::fillBuf() {
+ static char *hex = "0123456789abcdef";
+ int c;
+
+ if (eof) {
+ return gFalse;
+ }
+ bufPtr = bufEnd = buf;
+ if ((c = str->getChar()) == EOF) {
+ *bufEnd++ = '>';
+ eof = gTrue;
+ } else {
+ if (lineLen >= 64) {
+ *bufEnd++ = '\n';
+ lineLen = 0;
+ }
+ *bufEnd++ = hex[(c >> 4) & 0x0f];
+ *bufEnd++ = hex[c & 0x0f];
+ lineLen += 2;
+ }
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// ASCII85Encoder
+//------------------------------------------------------------------------
+
+ASCII85Encoder::ASCII85Encoder(Stream *strA):
+ FilterStream(strA) {
+ bufPtr = bufEnd = buf;
+ lineLen = 0;
+ eof = gFalse;
+}
+
+ASCII85Encoder::~ASCII85Encoder() {
+ if (str->isEncoder())
+ delete str;
+}
+
+void ASCII85Encoder::reset() {
+ str->reset();
+ bufPtr = bufEnd = buf;
+ lineLen = 0;
+ eof = gFalse;
+}
+
+GBool ASCII85Encoder::fillBuf() {
+ Guint t;
+ char buf1[5];
+ int c0, c1, c2, c3;
+ int n, i;
+
+ if (eof) {
+ return gFalse;
+ }
+ c0 = str->getChar();
+ c1 = str->getChar();
+ c2 = str->getChar();
+ c3 = str->getChar();
+ bufPtr = bufEnd = buf;
+ if (c3 == EOF) {
+ if (c0 == EOF) {
+ n = 0;
+ t = 0;
+ } else {
+ if (c1 == EOF) {
+ n = 1;
+ t = c0 << 24;
+ } else if (c2 == EOF) {
+ n = 2;
+ t = (c0 << 24) | (c1 << 16);
+ } else {
+ n = 3;
+ t = (c0 << 24) | (c1 << 16) | (c2 << 8);
+ }
+ for (i = 4; i >= 0; --i) {
+ buf1[i] = (char)(t % 85 + 0x21);
+ t /= 85;
+ }
+ for (i = 0; i <= n; ++i) {
+ *bufEnd++ = buf1[i];
+ if (++lineLen == 65) {
+ *bufEnd++ = '\n';
+ lineLen = 0;
+ }
+ }
+ }
+ *bufEnd++ = '~';
+ *bufEnd++ = '>';
+ eof = gTrue;
+ } else {
+ t = (c0 << 24) | (c1 << 16) | (c2 << 8) | c3;
+ if (t == 0) {
+ *bufEnd++ = 'z';
+ if (++lineLen == 65) {
+ *bufEnd++ = '\n';
+ lineLen = 0;
+ }
+ } else {
+ for (i = 4; i >= 0; --i) {
+ buf1[i] = (char)(t % 85 + 0x21);
+ t /= 85;
+ }
+ for (i = 0; i <= 4; ++i) {
+ *bufEnd++ = buf1[i];
+ if (++lineLen == 65) {
+ *bufEnd++ = '\n';
+ lineLen = 0;
+ }
+ }
+ }
+ }
+ return gTrue;
+}
+
+//------------------------------------------------------------------------
+// RunLengthEncoder
+//------------------------------------------------------------------------
+
+RunLengthEncoder::RunLengthEncoder(Stream *strA):
+ FilterStream(strA) {
+ bufPtr = bufEnd = nextEnd = buf;
+ eof = gFalse;
+}
+
+RunLengthEncoder::~RunLengthEncoder() {
+ if (str->isEncoder())
+ delete str;
+}
+
+void RunLengthEncoder::reset() {
+ str->reset();
+ bufPtr = bufEnd = nextEnd = buf;
+ eof = gFalse;
+}
+
+//
+// When fillBuf finishes, buf[] looks like this:
+// +-----+--------------+-----------------+--
+// + tag | ... data ... | next 0, 1, or 2 |
+// +-----+--------------+-----------------+--
+// ^ ^ ^
+// bufPtr bufEnd nextEnd
+//
+GBool RunLengthEncoder::fillBuf() {
+ int c, c1, c2;
+ int n;
+
+ // already hit EOF?
+ if (eof)
+ return gFalse;
+
+ // grab two bytes
+ if (nextEnd < bufEnd + 1) {
+ if ((c1 = str->getChar()) == EOF) {
+ eof = gTrue;
+ return gFalse;
+ }
+ } else {
+ c1 = bufEnd[0] & 0xff;
+ }
+ if (nextEnd < bufEnd + 2) {
+ if ((c2 = str->getChar()) == EOF) {
+ eof = gTrue;
+ buf[0] = 0;
+ buf[1] = c1;
+ bufPtr = buf;
+ bufEnd = &buf[2];
+ return gTrue;
+ }
+ } else {
+ c2 = bufEnd[1] & 0xff;
+ }
+
+ // check for repeat
+ c = 0; // make gcc happy
+ if (c1 == c2) {
+ n = 2;
+ while (n < 128 && (c = str->getChar()) == c1)
+ ++n;
+ buf[0] = (char)(257 - n);
+ buf[1] = c1;
+ bufEnd = &buf[2];
+ if (c == EOF) {
+ eof = gTrue;
+ } else if (n < 128) {
+ buf[2] = c;
+ nextEnd = &buf[3];
+ } else {
+ nextEnd = bufEnd;
+ }
+
+ // get up to 128 chars
+ } else {
+ buf[1] = c1;
+ buf[2] = c2;
+ n = 2;
+ while (n < 128) {
+ if ((c = str->getChar()) == EOF) {
+ eof = gTrue;
+ break;
+ }
+ ++n;
+ buf[n] = c;
+ if (buf[n] == buf[n-1])
+ break;
+ }
+ if (buf[n] == buf[n-1]) {
+ buf[0] = (char)(n-2-1);
+ bufEnd = &buf[n-1];
+ nextEnd = &buf[n+1];
+ } else {
+ buf[0] = (char)(n-1);
+ bufEnd = nextEnd = &buf[n+1];
+ }
+ }
+ bufPtr = buf;
+ return gTrue;
+}
diff --git a/kpdf/xpdf/xpdf/TextOutputDev.cc b/kpdf/xpdf/xpdf/TextOutputDev.cc
deleted file mode 100644
index d2bfaf63..00000000
--- a/kpdf/xpdf/xpdf/TextOutputDev.cc
+++ /dev/null
@@ -1,4090 +0,0 @@
-//========================================================================
-//
-// TextOutputDev.cc
-//
-// Copyright 1997-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <math.h>
-#include <ctype.h>
-#ifdef WIN32
-#include <fcntl.h> // for O_BINARY
-#include <io.h> // for setmode
-#endif
-#include "gmem.h"
-#include "GString.h"
-#include "GList.h"
-#include "config.h"
-#include "Error.h"
-#include "GlobalParams.h"
-#include "UnicodeMap.h"
-#include "UnicodeTypeTable.h"
-#include "GfxState.h"
-#include "Link.h"
-#include "TextOutputDev.h"
-
-#ifdef MACOS
-// needed for setting type/creator of MacOS files
-#include "ICSupport.h"
-#endif
-
-//------------------------------------------------------------------------
-// parameters
-//------------------------------------------------------------------------
-
-// Each bucket in a text pool includes baselines within a range of
-// this many points.
-#define textPoolStep 4
-
-// Inter-character space width which will cause addChar to start a new
-// word.
-#define minWordBreakSpace 0.1
-
-// Negative inter-character space width, i.e., overlap, which will
-// cause addChar to start a new word.
-#define minDupBreakOverlap 0.2
-
-// Max distance between baselines of two lines within a block, as a
-// fraction of the font size.
-#define maxLineSpacingDelta 1.5
-
-// Max difference in primary font sizes on two lines in the same
-// block. Delta1 is used when examining new lines above and below the
-// current block; delta2 is used when examining text that overlaps the
-// current block; delta3 is used when examining text to the left and
-// right of the current block.
-#define maxBlockFontSizeDelta1 0.05
-#define maxBlockFontSizeDelta2 0.6
-#define maxBlockFontSizeDelta3 0.2
-
-// Max difference in font sizes inside a word.
-#define maxWordFontSizeDelta 0.05
-
-// Maximum distance between baselines of two words on the same line,
-// e.g., distance between subscript or superscript and the primary
-// baseline, as a fraction of the font size.
-#define maxIntraLineDelta 0.5
-
-// Minimum inter-word spacing, as a fraction of the font size. (Only
-// used for raw ordering.)
-#define minWordSpacing 0.15
-
-// Maximum inter-word spacing, as a fraction of the font size.
-#define maxWordSpacing 1.5
-
-// Maximum horizontal spacing which will allow a word to be pulled
-// into a block.
-#define minColSpacing1 0.3
-
-// Minimum spacing between columns, as a fraction of the font size.
-#define minColSpacing2 1.0
-
-// Maximum vertical spacing between blocks within a flow, as a
-// multiple of the font size.
-#define maxBlockSpacing 2.5
-
-// Minimum spacing between characters within a word, as a fraction of
-// the font size.
-#define minCharSpacing -0.2
-
-// Maximum spacing between characters within a word, as a fraction of
-// the font size, when there is no obvious extra-wide character
-// spacing.
-#define maxCharSpacing 0.03
-
-// When extra-wide character spacing is detected, the inter-character
-// space threshold is set to the minimum inter-character space
-// multiplied by this constant.
-#define maxWideCharSpacingMul 1.3
-
-// Upper limit on spacing between characters in a word.
-#define maxWideCharSpacing 0.4
-
-// Max difference in primary,secondary coordinates (as a fraction of
-// the font size) allowed for duplicated text (fake boldface, drop
-// shadows) which is to be discarded.
-#define dupMaxPriDelta 0.1
-#define dupMaxSecDelta 0.2
-
-// Max width of underlines (in points).
-#define maxUnderlineWidth 3
-
-// Min distance between baseline and underline (in points).
-//~ this should be font-size-dependent
-#define minUnderlineGap -2
-
-// Max distance between baseline and underline (in points).
-//~ this should be font-size-dependent
-#define maxUnderlineGap 4
-
-// Max horizontal distance between edge of word and start of underline
-// (in points).
-//~ this should be font-size-dependent
-#define underlineSlack 1
-
-// Max distance between edge of text and edge of link border
-#define hyperlinkSlack 2
-
-//------------------------------------------------------------------------
-// TextUnderline
-//------------------------------------------------------------------------
-
-class TextUnderline {
-public:
-
- TextUnderline(double x0A, double y0A, double x1A, double y1A)
- { x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; horiz = y0 == y1; }
- ~TextUnderline() {}
-
- double x0, y0, x1, y1;
- GBool horiz;
-};
-
-//------------------------------------------------------------------------
-// TextLink
-//------------------------------------------------------------------------
-
-class TextLink {
-public:
-
- TextLink(int xMinA, int yMinA, int xMaxA, int yMaxA, Link *linkA)
- { xMin = xMinA; yMin = yMinA; xMax = xMaxA; yMax = yMaxA; link = linkA; }
- ~TextLink() {}
-
- int xMin, yMin, xMax, yMax;
- Link *link;
-};
-
-//------------------------------------------------------------------------
-// TextFontInfo
-//------------------------------------------------------------------------
-
-TextFontInfo::TextFontInfo(GfxState *state) {
- gfxFont = state->getFont();
-#if TEXTOUT_WORD_LIST
- fontName = (gfxFont && gfxFont->getOrigName())
- ? gfxFont->getOrigName()->copy()
- : (GString *)NULL;
- flags = gfxFont ? gfxFont->getFlags() : 0;
-#endif
-}
-
-TextFontInfo::~TextFontInfo() {
-#if TEXTOUT_WORD_LIST
- if (fontName) {
- delete fontName;
- }
-#endif
-}
-
-GBool TextFontInfo::matches(GfxState *state) {
- return state->getFont() == gfxFont;
-}
-
-//------------------------------------------------------------------------
-// TextWord
-//------------------------------------------------------------------------
-
-TextWord::TextWord(GfxState *state, int rotA, double x0, double y0,
- int charPosA, TextFontInfo *fontA, double fontSizeA) {
- GfxFont *gfxFont;
- double x, y, ascent, descent;
-
- rot = rotA;
- charPos = charPosA;
- charLen = 0;
- font = fontA;
- fontSize = fontSizeA;
- state->transform(x0, y0, &x, &y);
- if ((gfxFont = font->gfxFont)) {
- ascent = gfxFont->getAscent() * fontSize;
- descent = gfxFont->getDescent() * fontSize;
- } else {
- // this means that the PDF file draws text without a current font,
- // which should never happen
- ascent = 0.95 * fontSize;
- descent = -0.35 * fontSize;
- }
- switch (rot) {
- case 0:
- yMin = y - ascent;
- yMax = y - descent;
- if (yMin == yMax) {
- // this is a sanity check for a case that shouldn't happen -- but
- // if it does happen, we want to avoid dividing by zero later
- yMin = y;
- yMax = y + 1;
- }
- base = y;
- break;
- case 1:
- xMin = x + descent;
- xMax = x + ascent;
- if (xMin == xMax) {
- // this is a sanity check for a case that shouldn't happen -- but
- // if it does happen, we want to avoid dividing by zero later
- xMin = x;
- xMax = x + 1;
- }
- base = x;
- break;
- case 2:
- yMin = y + descent;
- yMax = y + ascent;
- if (yMin == yMax) {
- // this is a sanity check for a case that shouldn't happen -- but
- // if it does happen, we want to avoid dividing by zero later
- yMin = y;
- yMax = y + 1;
- }
- base = y;
- break;
- case 3:
- xMin = x - ascent;
- xMax = x - descent;
- if (xMin == xMax) {
- // this is a sanity check for a case that shouldn't happen -- but
- // if it does happen, we want to avoid dividing by zero later
- xMin = x;
- xMax = x + 1;
- }
- base = x;
- break;
- }
- text = NULL;
- edge = NULL;
- len = size = 0;
- spaceAfter = gFalse;
- next = NULL;
-
-#if TEXTOUT_WORD_LIST
- GfxRGB rgb;
-
- if ((state->getRender() & 3) == 1) {
- state->getStrokeRGB(&rgb);
- } else {
- state->getFillRGB(&rgb);
- }
- colorR = colToDbl(rgb.r);
- colorG = colToDbl(rgb.g);
- colorB = colToDbl(rgb.b);
-#endif
-
- underlined = gFalse;
- link = NULL;
-}
-
-TextWord::~TextWord() {
- gfree(text);
- gfree(edge);
-}
-
-void TextWord::addChar(GfxState * /*state*/, double x, double y,
- double dx, double dy, Unicode u) {
- if (len == size) {
- size += 16;
- text = (Unicode *)greallocn(text, size, sizeof(Unicode));
- edge = (double *)greallocn(edge, size + 1, sizeof(double));
- }
- text[len] = u;
- switch (rot) {
- case 0:
- if (len == 0) {
- xMin = x;
- }
- edge[len] = x;
- xMax = edge[len+1] = x + dx;
- break;
- case 1:
- if (len == 0) {
- yMin = y;
- }
- edge[len] = y;
- yMax = edge[len+1] = y + dy;
- break;
- case 2:
- if (len == 0) {
- xMax = x;
- }
- edge[len] = x;
- xMin = edge[len+1] = x + dx;
- break;
- case 3:
- if (len == 0) {
- yMax = y;
- }
- edge[len] = y;
- yMin = edge[len+1] = y + dy;
- break;
- }
- ++len;
-}
-
-void TextWord::merge(TextWord *word) {
- int i;
-
- if (word->xMin < xMin) {
- xMin = word->xMin;
- }
- if (word->yMin < yMin) {
- yMin = word->yMin;
- }
- if (word->xMax > xMax) {
- xMax = word->xMax;
- }
- if (word->yMax > yMax) {
- yMax = word->yMax;
- }
- if (len + word->len > size) {
- size = len + word->len;
- text = (Unicode *)greallocn(text, size, sizeof(Unicode));
- edge = (double *)greallocn(edge, size + 1, sizeof(double));
- }
- for (i = 0; i < word->len; ++i) {
- text[len + i] = word->text[i];
- edge[len + i] = word->edge[i];
- }
- edge[len + word->len] = word->edge[word->len];
- len += word->len;
- charLen += word->charLen;
-}
-
-inline int TextWord::primaryCmp(TextWord *word) {
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (rot) {
- case 0:
- cmp = xMin - word->xMin;
- break;
- case 1:
- cmp = yMin - word->yMin;
- break;
- case 2:
- cmp = word->xMax - xMax;
- break;
- case 3:
- cmp = word->yMax - yMax;
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-double TextWord::primaryDelta(TextWord *word) {
- double delta;
-
- delta = 0; // make gcc happy
- switch (rot) {
- case 0:
- delta = word->xMin - xMax;
- break;
- case 1:
- delta = word->yMin - yMax;
- break;
- case 2:
- delta = xMin - word->xMax;
- break;
- case 3:
- delta = yMin - word->yMax;
- break;
- }
- return delta;
-}
-
-int TextWord::cmpYX(const void *p1, const void *p2) {
- TextWord *word1 = *(TextWord **)p1;
- TextWord *word2 = *(TextWord **)p2;
- double cmp;
-
- cmp = word1->yMin - word2->yMin;
- if (cmp == 0) {
- cmp = word1->xMin - word2->xMin;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-#if TEXTOUT_WORD_LIST
-
-GString *TextWord::getText() {
- GString *s;
- UnicodeMap *uMap;
- char buf[8];
- int n, i;
-
- s = new GString();
- if (!(uMap = globalParams->getTextEncoding())) {
- return s;
- }
- for (i = 0; i < len; ++i) {
- n = uMap->mapUnicode(text[i], buf, sizeof(buf));
- s->append(buf, n);
- }
- uMap->decRefCnt();
- return s;
-}
-
-void TextWord::getCharBBox(int charIdx, double *xMinA, double *yMinA,
- double *xMaxA, double *yMaxA) {
- if (charIdx < 0 || charIdx >= len) {
- return;
- }
- switch (rot) {
- case 0:
- *xMinA = edge[charIdx];
- *xMaxA = edge[charIdx + 1];
- *yMinA = yMin;
- *yMaxA = yMax;
- break;
- case 1:
- *xMinA = xMin;
- *xMaxA = xMax;
- *yMinA = edge[charIdx];
- *yMaxA = edge[charIdx + 1];
- break;
- case 2:
- *xMinA = edge[charIdx + 1];
- *xMaxA = edge[charIdx];
- *yMinA = yMin;
- *yMaxA = yMax;
- break;
- case 3:
- *xMinA = xMin;
- *xMaxA = xMax;
- *yMinA = edge[charIdx + 1];
- *yMaxA = edge[charIdx];
- break;
- }
-}
-
-#endif // TEXTOUT_WORD_LIST
-
-//------------------------------------------------------------------------
-// TextPool
-//------------------------------------------------------------------------
-
-TextPool::TextPool() {
- minBaseIdx = 0;
- maxBaseIdx = -1;
- pool = NULL;
- cursor = NULL;
- cursorBaseIdx = -1;
-}
-
-TextPool::~TextPool() {
- int baseIdx;
- TextWord *word, *word2;
-
- for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) {
- for (word = pool[baseIdx - minBaseIdx]; word; word = word2) {
- word2 = word->next;
- delete word;
- }
- }
- gfree(pool);
-}
-
-int TextPool::getBaseIdx(double base) {
- int baseIdx;
-
- baseIdx = (int)(base / textPoolStep);
- if (baseIdx < minBaseIdx) {
- return minBaseIdx;
- }
- if (baseIdx > maxBaseIdx) {
- return maxBaseIdx;
- }
- return baseIdx;
-}
-
-void TextPool::addWord(TextWord *word) {
- TextWord **newPool;
- int wordBaseIdx, newMinBaseIdx, newMaxBaseIdx, baseIdx;
- TextWord *w0, *w1;
-
- // expand the array if needed
- wordBaseIdx = (int)(word->base / textPoolStep);
- if (minBaseIdx > maxBaseIdx) {
- minBaseIdx = wordBaseIdx - 128;
- maxBaseIdx = wordBaseIdx + 128;
- pool = (TextWord **)gmallocn(maxBaseIdx - minBaseIdx + 1,
- sizeof(TextWord *));
- for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) {
- pool[baseIdx - minBaseIdx] = NULL;
- }
- } else if (wordBaseIdx < minBaseIdx) {
- newMinBaseIdx = wordBaseIdx - 128;
- newPool = (TextWord **)gmallocn(maxBaseIdx - newMinBaseIdx + 1,
- sizeof(TextWord *));
- for (baseIdx = newMinBaseIdx; baseIdx < minBaseIdx; ++baseIdx) {
- newPool[baseIdx - newMinBaseIdx] = NULL;
- }
- memcpy(&newPool[minBaseIdx - newMinBaseIdx], pool,
- (maxBaseIdx - minBaseIdx + 1) * sizeof(TextWord *));
- gfree(pool);
- pool = newPool;
- minBaseIdx = newMinBaseIdx;
- } else if (wordBaseIdx > maxBaseIdx) {
- newMaxBaseIdx = wordBaseIdx + 128;
- pool = (TextWord **)greallocn(pool, newMaxBaseIdx - minBaseIdx + 1,
- sizeof(TextWord *));
- for (baseIdx = maxBaseIdx + 1; baseIdx <= newMaxBaseIdx; ++baseIdx) {
- pool[baseIdx - minBaseIdx] = NULL;
- }
- maxBaseIdx = newMaxBaseIdx;
- }
-
- // insert the new word
- if (cursor && wordBaseIdx == cursorBaseIdx &&
- word->primaryCmp(cursor) > 0) {
- w0 = cursor;
- w1 = cursor->next;
- } else {
- w0 = NULL;
- w1 = pool[wordBaseIdx - minBaseIdx];
- }
- for (; w1 && word->primaryCmp(w1) > 0; w0 = w1, w1 = w1->next) ;
- word->next = w1;
- if (w0) {
- w0->next = word;
- } else {
- pool[wordBaseIdx - minBaseIdx] = word;
- }
- cursor = word;
- cursorBaseIdx = wordBaseIdx;
-}
-
-//------------------------------------------------------------------------
-// TextLine
-//------------------------------------------------------------------------
-
-TextLine::TextLine(TextBlock *blkA, int rotA, double baseA) {
- blk = blkA;
- rot = rotA;
- xMin = yMin = 0;
- xMax = yMax = -1;
- base = baseA;
- words = lastWord = NULL;
- text = NULL;
- edge = NULL;
- col = NULL;
- len = 0;
- convertedLen = 0;
- hyphenated = gFalse;
- next = NULL;
-}
-
-TextLine::~TextLine() {
- TextWord *word;
-
- while (words) {
- word = words;
- words = words->next;
- delete word;
- }
- gfree(text);
- gfree(edge);
- gfree(col);
-}
-
-void TextLine::addWord(TextWord *word) {
- if (lastWord) {
- lastWord->next = word;
- } else {
- words = word;
- }
- lastWord = word;
-
- if (xMin > xMax) {
- xMin = word->xMin;
- xMax = word->xMax;
- yMin = word->yMin;
- yMax = word->yMax;
- } else {
- if (word->xMin < xMin) {
- xMin = word->xMin;
- }
- if (word->xMax > xMax) {
- xMax = word->xMax;
- }
- if (word->yMin < yMin) {
- yMin = word->yMin;
- }
- if (word->yMax > yMax) {
- yMax = word->yMax;
- }
- }
-}
-
-double TextLine::primaryDelta(TextLine *line) {
- double delta;
-
- delta = 0; // make gcc happy
- switch (rot) {
- case 0:
- delta = line->xMin - xMax;
- break;
- case 1:
- delta = line->yMin - yMax;
- break;
- case 2:
- delta = xMin - line->xMax;
- break;
- case 3:
- delta = yMin - line->yMax;
- break;
- }
- return delta;
-}
-
-int TextLine::primaryCmp(TextLine *line) {
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (rot) {
- case 0:
- cmp = xMin - line->xMin;
- break;
- case 1:
- cmp = yMin - line->yMin;
- break;
- case 2:
- cmp = line->xMax - xMax;
- break;
- case 3:
- cmp = line->yMax - yMax;
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextLine::secondaryCmp(TextLine *line) {
- double cmp;
-
- cmp = (rot == 0 || rot == 3) ? base - line->base : line->base - base;
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextLine::cmpYX(TextLine *line) {
- int cmp;
-
- if ((cmp = secondaryCmp(line))) {
- return cmp;
- }
- return primaryCmp(line);
-}
-
-int TextLine::cmpXY(const void *p1, const void *p2) {
- TextLine *line1 = *(TextLine **)p1;
- TextLine *line2 = *(TextLine **)p2;
- int cmp;
-
- if ((cmp = line1->primaryCmp(line2))) {
- return cmp;
- }
- return line1->secondaryCmp(line2);
-}
-
-void TextLine::coalesce(UnicodeMap *uMap) {
- TextWord *word0, *word1;
- double space, delta, minSpace;
- GBool isUnicode;
- char buf[8];
- int i, j;
-
- if (words->next) {
-
- // compute the inter-word space threshold
- if (words->len > 1 || words->next->len > 1) {
- minSpace = 0;
- } else {
- minSpace = words->primaryDelta(words->next);
- for (word0 = words->next, word1 = word0->next;
- word1 && minSpace > 0;
- word0 = word1, word1 = word0->next) {
- if (word1->len > 1) {
- minSpace = 0;
- }
- delta = word0->primaryDelta(word1);
- if (delta < minSpace) {
- minSpace = delta;
- }
- }
- }
- if (minSpace <= 0) {
- space = maxCharSpacing * words->fontSize;
- } else {
- space = maxWideCharSpacingMul * minSpace;
- if (space > maxWideCharSpacing * words->fontSize) {
- space = maxWideCharSpacing * words->fontSize;
- }
- }
-
- // merge words
- word0 = words;
- word1 = words->next;
- while (word1) {
- if (word0->primaryDelta(word1) >= space) {
- word0->spaceAfter = gTrue;
- word0 = word1;
- word1 = word1->next;
- } else if (word0->font == word1->font &&
- word0->underlined == word1->underlined &&
- fabs(word0->fontSize - word1->fontSize) <
- maxWordFontSizeDelta * words->fontSize &&
- word1->charPos == word0->charPos + word0->charLen) {
- word0->merge(word1);
- word0->next = word1->next;
- delete word1;
- word1 = word0->next;
- } else {
- word0 = word1;
- word1 = word1->next;
- }
- }
- }
-
- // build the line text
- isUnicode = uMap ? uMap->isUnicode() : gFalse;
- len = 0;
- for (word1 = words; word1; word1 = word1->next) {
- len += word1->len;
- if (word1->spaceAfter) {
- ++len;
- }
- }
- text = (Unicode *)gmallocn(len, sizeof(Unicode));
- edge = (double *)gmallocn(len + 1, sizeof(double));
- i = 0;
- for (word1 = words; word1; word1 = word1->next) {
- for (j = 0; j < word1->len; ++j) {
- text[i] = word1->text[j];
- edge[i] = word1->edge[j];
- ++i;
- }
- edge[i] = word1->edge[word1->len];
- if (word1->spaceAfter) {
- text[i] = (Unicode)0x0020;
- ++i;
- }
- }
-
- // compute convertedLen and set up the col array
- col = (int *)gmallocn(len + 1, sizeof(int));
- convertedLen = 0;
- for (i = 0; i < len; ++i) {
- col[i] = convertedLen;
- if (isUnicode) {
- ++convertedLen;
- } else if (uMap) {
- convertedLen += uMap->mapUnicode(text[i], buf, sizeof(buf));
- }
- }
- col[len] = convertedLen;
-
- // check for hyphen at end of line
- //~ need to check for other chars used as hyphens
- hyphenated = text[len - 1] == (Unicode)'-';
-}
-
-//------------------------------------------------------------------------
-// TextLineFrag
-//------------------------------------------------------------------------
-
-class TextLineFrag {
-public:
-
- TextLine *line; // the line object
- int start, len; // offset and length of this fragment
- // (in Unicode chars)
- double xMin, xMax; // bounding box coordinates
- double yMin, yMax;
- double base; // baseline virtual coordinate
- int col; // first column
-
- void init(TextLine *lineA, int startA, int lenA);
- void computeCoords(GBool oneRot);
-
- static int cmpYXPrimaryRot(const void *p1, const void *p2);
- static int cmpYXLineRot(const void *p1, const void *p2);
- static int cmpXYLineRot(const void *p1, const void *p2);
- static int cmpXYColumnPrimaryRot(const void *p1, const void *p2);
- static int cmpXYColumnLineRot(const void *p1, const void *p2);
-};
-
-void TextLineFrag::init(TextLine *lineA, int startA, int lenA) {
- line = lineA;
- start = startA;
- len = lenA;
- col = line->col[start];
-}
-
-void TextLineFrag::computeCoords(GBool oneRot) {
- TextBlock *blk;
- double d0, d1, d2, d3, d4;
-
- if (oneRot) {
-
- switch (line->rot) {
- case 0:
- xMin = line->edge[start];
- xMax = line->edge[start + len];
- yMin = line->yMin;
- yMax = line->yMax;
- break;
- case 1:
- xMin = line->xMin;
- xMax = line->xMax;
- yMin = line->edge[start];
- yMax = line->edge[start + len];
- break;
- case 2:
- xMin = line->edge[start + len];
- xMax = line->edge[start];
- yMin = line->yMin;
- yMax = line->yMax;
- break;
- case 3:
- xMin = line->xMin;
- xMax = line->xMax;
- yMin = line->edge[start + len];
- yMax = line->edge[start];
- break;
- }
- base = line->base;
-
- } else {
-
- if (line->rot == 0 && line->blk->page->primaryRot == 0) {
-
- xMin = line->edge[start];
- xMax = line->edge[start + len];
- yMin = line->yMin;
- yMax = line->yMax;
- base = line->base;
-
- } else {
-
- blk = line->blk;
- d0 = line->edge[start];
- d1 = line->edge[start + len];
- d2 = d3 = d4 = 0; // make gcc happy
-
- switch (line->rot) {
- case 0:
- d2 = line->yMin;
- d3 = line->yMax;
- d4 = line->base;
- d0 = (d0 - blk->xMin) / (blk->xMax - blk->xMin);
- d1 = (d1 - blk->xMin) / (blk->xMax - blk->xMin);
- d2 = (d2 - blk->yMin) / (blk->yMax - blk->yMin);
- d3 = (d3 - blk->yMin) / (blk->yMax - blk->yMin);
- d4 = (d4 - blk->yMin) / (blk->yMax - blk->yMin);
- break;
- case 1:
- d2 = line->xMax;
- d3 = line->xMin;
- d4 = line->base;
- d0 = (d0 - blk->yMin) / (blk->yMax - blk->yMin);
- d1 = (d1 - blk->yMin) / (blk->yMax - blk->yMin);
- d2 = (blk->xMax - d2) / (blk->xMax - blk->xMin);
- d3 = (blk->xMax - d3) / (blk->xMax - blk->xMin);
- d4 = (blk->xMax - d4) / (blk->xMax - blk->xMin);
- break;
- case 2:
- d2 = line->yMax;
- d3 = line->yMin;
- d4 = line->base;
- d0 = (blk->xMax - d0) / (blk->xMax - blk->xMin);
- d1 = (blk->xMax - d1) / (blk->xMax - blk->xMin);
- d2 = (blk->yMax - d2) / (blk->yMax - blk->yMin);
- d3 = (blk->yMax - d3) / (blk->yMax - blk->yMin);
- d4 = (blk->yMax - d4) / (blk->yMax - blk->yMin);
- break;
- case 3:
- d2 = line->xMin;
- d3 = line->xMax;
- d4 = line->base;
- d0 = (blk->yMax - d0) / (blk->yMax - blk->yMin);
- d1 = (blk->yMax - d1) / (blk->yMax - blk->yMin);
- d2 = (d2 - blk->xMin) / (blk->xMax - blk->xMin);
- d3 = (d3 - blk->xMin) / (blk->xMax - blk->xMin);
- d4 = (d4 - blk->xMin) / (blk->xMax - blk->xMin);
- break;
- }
-
- switch (line->blk->page->primaryRot) {
- case 0:
- xMin = blk->xMin + d0 * (blk->xMax - blk->xMin);
- xMax = blk->xMin + d1 * (blk->xMax - blk->xMin);
- yMin = blk->yMin + d2 * (blk->yMax - blk->yMin);
- yMax = blk->yMin + d3 * (blk->yMax - blk->yMin);
- base = blk->yMin + base * (blk->yMax - blk->yMin);
- break;
- case 1:
- xMin = blk->xMax - d3 * (blk->xMax - blk->xMin);
- xMax = blk->xMax - d2 * (blk->xMax - blk->xMin);
- yMin = blk->yMin + d0 * (blk->yMax - blk->yMin);
- yMax = blk->yMin + d1 * (blk->yMax - blk->yMin);
- base = blk->xMax - d4 * (blk->xMax - blk->xMin);
- break;
- case 2:
- xMin = blk->xMax - d1 * (blk->xMax - blk->xMin);
- xMax = blk->xMax - d0 * (blk->xMax - blk->xMin);
- yMin = blk->yMax - d3 * (blk->yMax - blk->yMin);
- yMax = blk->yMax - d2 * (blk->yMax - blk->yMin);
- base = blk->yMax - d4 * (blk->yMax - blk->yMin);
- break;
- case 3:
- xMin = blk->xMin + d2 * (blk->xMax - blk->xMin);
- xMax = blk->xMin + d3 * (blk->xMax - blk->xMin);
- yMin = blk->yMax - d1 * (blk->yMax - blk->yMin);
- yMax = blk->yMax - d0 * (blk->yMax - blk->yMin);
- base = blk->xMin + d4 * (blk->xMax - blk->xMin);
- break;
- }
-
- }
- }
-}
-
-int TextLineFrag::cmpYXPrimaryRot(const void *p1, const void *p2) {
- TextLineFrag *frag1 = (TextLineFrag *)p1;
- TextLineFrag *frag2 = (TextLineFrag *)p2;
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (frag1->line->blk->page->primaryRot) {
- case 0:
- if (fabs(cmp = frag1->yMin - frag2->yMin) < 0.01) {
- cmp = frag1->xMin - frag2->xMin;
- }
- break;
- case 1:
- if (fabs(cmp = frag2->xMax - frag1->xMax) < 0.01) {
- cmp = frag1->yMin - frag2->yMin;
- }
- break;
- case 2:
- if (fabs(cmp = frag2->yMin - frag1->yMin) < 0.01) {
- cmp = frag2->xMax - frag1->xMax;
- }
- break;
- case 3:
- if (fabs(cmp = frag1->xMax - frag2->xMax) < 0.01) {
- cmp = frag2->yMax - frag1->yMax;
- }
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextLineFrag::cmpYXLineRot(const void *p1, const void *p2) {
- TextLineFrag *frag1 = (TextLineFrag *)p1;
- TextLineFrag *frag2 = (TextLineFrag *)p2;
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (frag1->line->rot) {
- case 0:
- if ((cmp = frag1->yMin - frag2->yMin) == 0) {
- cmp = frag1->xMin - frag2->xMin;
- }
- break;
- case 1:
- if ((cmp = frag2->xMax - frag1->xMax) == 0) {
- cmp = frag1->yMin - frag2->yMin;
- }
- break;
- case 2:
- if ((cmp = frag2->yMin - frag1->yMin) == 0) {
- cmp = frag2->xMax - frag1->xMax;
- }
- break;
- case 3:
- if ((cmp = frag1->xMax - frag2->xMax) == 0) {
- cmp = frag2->yMax - frag1->yMax;
- }
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextLineFrag::cmpXYLineRot(const void *p1, const void *p2) {
- TextLineFrag *frag1 = (TextLineFrag *)p1;
- TextLineFrag *frag2 = (TextLineFrag *)p2;
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (frag1->line->rot) {
- case 0:
- if ((cmp = frag1->xMin - frag2->xMin) == 0) {
- cmp = frag1->yMin - frag2->yMin;
- }
- break;
- case 1:
- if ((cmp = frag1->yMin - frag2->yMin) == 0) {
- cmp = frag2->xMax - frag1->xMax;
- }
- break;
- case 2:
- if ((cmp = frag2->xMax - frag1->xMax) == 0) {
- cmp = frag2->yMin - frag1->yMin;
- }
- break;
- case 3:
- if ((cmp = frag2->yMax - frag1->yMax) == 0) {
- cmp = frag1->xMax - frag2->xMax;
- }
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextLineFrag::cmpXYColumnPrimaryRot(const void *p1, const void *p2) {
- TextLineFrag *frag1 = (TextLineFrag *)p1;
- TextLineFrag *frag2 = (TextLineFrag *)p2;
- double cmp;
-
- // if columns overlap, compare y values
- if (frag1->col < frag2->col + (frag2->line->col[frag2->start + frag2->len] -
- frag2->line->col[frag2->start]) &&
- frag2->col < frag1->col + (frag1->line->col[frag1->start + frag1->len] -
- frag1->line->col[frag1->start])) {
- cmp = 0; // make gcc happy
- switch (frag1->line->blk->page->primaryRot) {
- case 0: cmp = frag1->yMin - frag2->yMin; break;
- case 1: cmp = frag2->xMax - frag1->xMax; break;
- case 2: cmp = frag2->yMin - frag1->yMin; break;
- case 3: cmp = frag1->xMax - frag2->xMax; break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
- }
-
- // otherwise, compare starting column
- return frag1->col - frag2->col;
-}
-
-int TextLineFrag::cmpXYColumnLineRot(const void *p1, const void *p2) {
- TextLineFrag *frag1 = (TextLineFrag *)p1;
- TextLineFrag *frag2 = (TextLineFrag *)p2;
- double cmp;
-
- // if columns overlap, compare y values
- if (frag1->col < frag2->col + (frag2->line->col[frag2->start + frag2->len] -
- frag2->line->col[frag2->start]) &&
- frag2->col < frag1->col + (frag1->line->col[frag1->start + frag1->len] -
- frag1->line->col[frag1->start])) {
- cmp = 0; // make gcc happy
- switch (frag1->line->rot) {
- case 0: cmp = frag1->yMin - frag2->yMin; break;
- case 1: cmp = frag2->xMax - frag1->xMax; break;
- case 2: cmp = frag2->yMin - frag1->yMin; break;
- case 3: cmp = frag1->xMax - frag2->xMax; break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
- }
-
- // otherwise, compare starting column
- return frag1->col - frag2->col;
-}
-
-//------------------------------------------------------------------------
-// TextBlock
-//------------------------------------------------------------------------
-
-TextBlock::TextBlock(TextPage *pageA, int rotA) {
- page = pageA;
- rot = rotA;
- xMin = yMin = 0;
- xMax = yMax = -1;
- priMin = 0;
- priMax = page->pageWidth;
- pool = new TextPool();
- lines = NULL;
- curLine = NULL;
- next = NULL;
- stackNext = NULL;
-}
-
-TextBlock::~TextBlock() {
- TextLine *line;
-
- delete pool;
- while (lines) {
- line = lines;
- lines = lines->next;
- delete line;
- }
-}
-
-void TextBlock::addWord(TextWord *word) {
- pool->addWord(word);
- if (xMin > xMax) {
- xMin = word->xMin;
- xMax = word->xMax;
- yMin = word->yMin;
- yMax = word->yMax;
- } else {
- if (word->xMin < xMin) {
- xMin = word->xMin;
- }
- if (word->xMax > xMax) {
- xMax = word->xMax;
- }
- if (word->yMin < yMin) {
- yMin = word->yMin;
- }
- if (word->yMax > yMax) {
- yMax = word->yMax;
- }
- }
-}
-
-void TextBlock::coalesce(UnicodeMap *uMap) {
- TextWord *word0, *word1, *word2, *bestWord0, *bestWord1, *lastWord;
- TextLine *line, *line0, *line1;
- int poolMinBaseIdx, startBaseIdx, minBaseIdx, maxBaseIdx;
- int baseIdx, bestWordBaseIdx, idx0, idx1;
- double minBase, maxBase;
- double fontSize, delta, priDelta, secDelta;
- TextLine **lineArray;
- GBool found;
- int col1, col2;
- int i, j, k;
-
- // discard duplicated text (fake boldface, drop shadows)
- for (idx0 = pool->minBaseIdx; idx0 <= pool->maxBaseIdx; ++idx0) {
- word0 = pool->getPool(idx0);
- while (word0) {
- priDelta = dupMaxPriDelta * word0->fontSize;
- secDelta = dupMaxSecDelta * word0->fontSize;
- if (rot == 0 || rot == 3) {
- maxBaseIdx = pool->getBaseIdx(word0->base + secDelta);
- } else {
- maxBaseIdx = pool->getBaseIdx(word0->base - secDelta);
- }
- found = gFalse;
- word1 = word2 = NULL; // make gcc happy
- for (idx1 = idx0; idx1 <= maxBaseIdx; ++idx1) {
- if (idx1 == idx0) {
- word1 = word0;
- word2 = word0->next;
- } else {
- word1 = NULL;
- word2 = pool->getPool(idx1);
- }
- for (; word2; word1 = word2, word2 = word2->next) {
- if (word2->len == word0->len &&
- !memcmp(word2->text, word0->text,
- word0->len * sizeof(Unicode))) {
- switch (rot) {
- case 0:
- case 2:
- found = fabs(word0->xMin - word2->xMin) < priDelta &&
- fabs(word0->xMax - word2->xMax) < priDelta &&
- fabs(word0->yMin - word2->yMin) < secDelta &&
- fabs(word0->yMax - word2->yMax) < secDelta;
- break;
- case 1:
- case 3:
- found = fabs(word0->xMin - word2->xMin) < secDelta &&
- fabs(word0->xMax - word2->xMax) < secDelta &&
- fabs(word0->yMin - word2->yMin) < priDelta &&
- fabs(word0->yMax - word2->yMax) < priDelta;
- break;
- }
- }
- if (found) {
- break;
- }
- }
- if (found) {
- break;
- }
- }
- if (found) {
- if (word1) {
- word1->next = word2->next;
- } else {
- pool->setPool(idx1, word2->next);
- }
- delete word2;
- } else {
- word0 = word0->next;
- }
- }
- }
-
- // build the lines
- curLine = NULL;
- poolMinBaseIdx = pool->minBaseIdx;
- charCount = 0;
- nLines = 0;
- while (1) {
-
- // find the first non-empty line in the pool
- for (;
- poolMinBaseIdx <= pool->maxBaseIdx && !pool->getPool(poolMinBaseIdx);
- ++poolMinBaseIdx) ;
- if (poolMinBaseIdx > pool->maxBaseIdx) {
- break;
- }
-
- // look for the left-most word in the first four lines of the
- // pool -- this avoids starting with a superscript word
- startBaseIdx = poolMinBaseIdx;
- for (baseIdx = poolMinBaseIdx + 1;
- baseIdx < poolMinBaseIdx + 4 && baseIdx <= pool->maxBaseIdx;
- ++baseIdx) {
- if (!pool->getPool(baseIdx)) {
- continue;
- }
- if (pool->getPool(baseIdx)->primaryCmp(pool->getPool(startBaseIdx))
- < 0) {
- startBaseIdx = baseIdx;
- }
- }
-
- // create a new line
- word0 = pool->getPool(startBaseIdx);
- pool->setPool(startBaseIdx, word0->next);
- word0->next = NULL;
- line = new TextLine(this, word0->rot, word0->base);
- line->addWord(word0);
- lastWord = word0;
-
- // compute the search range
- fontSize = word0->fontSize;
- minBase = word0->base - maxIntraLineDelta * fontSize;
- maxBase = word0->base + maxIntraLineDelta * fontSize;
- minBaseIdx = pool->getBaseIdx(minBase);
- maxBaseIdx = pool->getBaseIdx(maxBase);
-
- // find the rest of the words in this line
- while (1) {
-
- // find the left-most word whose baseline is in the range for
- // this line
- bestWordBaseIdx = 0;
- bestWord0 = bestWord1 = NULL;
- for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) {
- for (word0 = NULL, word1 = pool->getPool(baseIdx);
- word1;
- word0 = word1, word1 = word1->next) {
- if (word1->base >= minBase &&
- word1->base <= maxBase &&
- (delta = lastWord->primaryDelta(word1)) >=
- minCharSpacing * fontSize) {
- if (delta < maxWordSpacing * fontSize &&
- (!bestWord1 || word1->primaryCmp(bestWord1) < 0)) {
- bestWordBaseIdx = baseIdx;
- bestWord0 = word0;
- bestWord1 = word1;
- }
- break;
- }
- }
- }
- if (!bestWord1) {
- break;
- }
-
- // remove it from the pool, and add it to the line
- if (bestWord0) {
- bestWord0->next = bestWord1->next;
- } else {
- pool->setPool(bestWordBaseIdx, bestWord1->next);
- }
- bestWord1->next = NULL;
- line->addWord(bestWord1);
- lastWord = bestWord1;
- }
-
- // add the line
- if (curLine && line->cmpYX(curLine) > 0) {
- line0 = curLine;
- line1 = curLine->next;
- } else {
- line0 = NULL;
- line1 = lines;
- }
- for (;
- line1 && line->cmpYX(line1) > 0;
- line0 = line1, line1 = line1->next) ;
- if (line0) {
- line0->next = line;
- } else {
- lines = line;
- }
- line->next = line1;
- curLine = line;
- line->coalesce(uMap);
- charCount += line->len;
- ++nLines;
- }
-
- // sort lines into xy order for column assignment
- lineArray = (TextLine **)gmallocn(nLines, sizeof(TextLine *));
- for (line = lines, i = 0; line; line = line->next, ++i) {
- lineArray[i] = line;
- }
- qsort(lineArray, nLines, sizeof(TextLine *), &TextLine::cmpXY);
-
- // column assignment
- nColumns = 0;
- for (i = 0; i < nLines; ++i) {
- line0 = lineArray[i];
- col1 = 0;
- for (j = 0; j < i; ++j) {
- line1 = lineArray[j];
- if (line1->primaryDelta(line0) >= 0) {
- col2 = line1->col[line1->len] + 1;
- } else {
- k = 0; // make gcc happy
- switch (rot) {
- case 0:
- for (k = 0;
- k < line1->len &&
- line0->xMin >= 0.5 * (line1->edge[k] + line1->edge[k+1]);
- ++k) ;
- break;
- case 1:
- for (k = 0;
- k < line1->len &&
- line0->yMin >= 0.5 * (line1->edge[k] + line1->edge[k+1]);
- ++k) ;
- break;
- case 2:
- for (k = 0;
- k < line1->len &&
- line0->xMax <= 0.5 * (line1->edge[k] + line1->edge[k+1]);
- ++k) ;
- break;
- case 3:
- for (k = 0;
- k < line1->len &&
- line0->yMax <= 0.5 * (line1->edge[k] + line1->edge[k+1]);
- ++k) ;
- break;
- }
- col2 = line1->col[k];
- }
- if (col2 > col1) {
- col1 = col2;
- }
- }
- for (k = 0; k <= line0->len; ++k) {
- line0->col[k] += col1;
- }
- if (line0->col[line0->len] > nColumns) {
- nColumns = line0->col[line0->len];
- }
- }
- gfree(lineArray);
-}
-
-void TextBlock::updatePriMinMax(TextBlock *blk) {
- double newPriMin, newPriMax;
- GBool gotPriMin, gotPriMax;
-
- gotPriMin = gotPriMax = gFalse;
- newPriMin = newPriMax = 0; // make gcc happy
- switch (page->primaryRot) {
- case 0:
- case 2:
- if (blk->yMin < yMax && blk->yMax > yMin) {
- if (blk->xMin < xMin) {
- newPriMin = blk->xMax;
- gotPriMin = gTrue;
- }
- if (blk->xMax > xMax) {
- newPriMax = blk->xMin;
- gotPriMax = gTrue;
- }
- }
- break;
- case 1:
- case 3:
- if (blk->xMin < xMax && blk->xMax > xMin) {
- if (blk->yMin < yMin) {
- newPriMin = blk->yMax;
- gotPriMin = gTrue;
- }
- if (blk->yMax > yMax) {
- newPriMax = blk->yMin;
- gotPriMax = gTrue;
- }
- }
- break;
- }
- if (gotPriMin) {
- if (newPriMin > xMin) {
- newPriMin = xMin;
- }
- if (newPriMin > priMin) {
- priMin = newPriMin;
- }
- }
- if (gotPriMax) {
- if (newPriMax < xMax) {
- newPriMax = xMax;
- }
- if (newPriMax < priMax) {
- priMax = newPriMax;
- }
- }
-}
-
-int TextBlock::cmpXYPrimaryRot(const void *p1, const void *p2) {
- TextBlock *blk1 = *(TextBlock **)p1;
- TextBlock *blk2 = *(TextBlock **)p2;
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (blk1->page->primaryRot) {
- case 0:
- if ((cmp = blk1->xMin - blk2->xMin) == 0) {
- cmp = blk1->yMin - blk2->yMin;
- }
- break;
- case 1:
- if ((cmp = blk1->yMin - blk2->yMin) == 0) {
- cmp = blk2->xMax - blk1->xMax;
- }
- break;
- case 2:
- if ((cmp = blk2->xMax - blk1->xMax) == 0) {
- cmp = blk2->yMin - blk1->yMin;
- }
- break;
- case 3:
- if ((cmp = blk2->yMax - blk1->yMax) == 0) {
- cmp = blk1->xMax - blk2->xMax;
- }
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextBlock::cmpYXPrimaryRot(const void *p1, const void *p2) {
- TextBlock *blk1 = *(TextBlock **)p1;
- TextBlock *blk2 = *(TextBlock **)p2;
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (blk1->page->primaryRot) {
- case 0:
- if ((cmp = blk1->yMin - blk2->yMin) == 0) {
- cmp = blk1->xMin - blk2->xMin;
- }
- break;
- case 1:
- if ((cmp = blk2->xMax - blk1->xMax) == 0) {
- cmp = blk1->yMin - blk2->yMin;
- }
- break;
- case 2:
- if ((cmp = blk2->yMin - blk1->yMin) == 0) {
- cmp = blk2->xMax - blk1->xMax;
- }
- break;
- case 3:
- if ((cmp = blk1->xMax - blk2->xMax) == 0) {
- cmp = blk2->yMax - blk1->yMax;
- }
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-int TextBlock::primaryCmp(TextBlock *blk) {
- double cmp;
-
- cmp = 0; // make gcc happy
- switch (rot) {
- case 0:
- cmp = xMin - blk->xMin;
- break;
- case 1:
- cmp = yMin - blk->yMin;
- break;
- case 2:
- cmp = blk->xMax - xMax;
- break;
- case 3:
- cmp = blk->yMax - yMax;
- break;
- }
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
-double TextBlock::secondaryDelta(TextBlock *blk) {
- double delta;
-
- delta = 0; // make gcc happy
- switch (rot) {
- case 0:
- delta = blk->yMin - yMax;
- break;
- case 1:
- delta = xMin - blk->xMax;
- break;
- case 2:
- delta = yMin - blk->yMax;
- break;
- case 3:
- delta = blk->xMin - xMax;
- break;
- }
- return delta;
-}
-
-GBool TextBlock::isBelow(TextBlock *blk) {
- GBool below;
-
- below = gFalse; // make gcc happy
- switch (page->primaryRot) {
- case 0:
- below = xMin >= blk->priMin && xMax <= blk->priMax &&
- yMin > blk->yMin;
- break;
- case 1:
- below = yMin >= blk->priMin && yMax <= blk->priMax &&
- xMax < blk->xMax;
- break;
- case 2:
- below = xMin >= blk->priMin && xMax <= blk->priMax &&
- yMax < blk->yMax;
- break;
- case 3:
- below = yMin >= blk->priMin && yMax <= blk->priMax &&
- xMin > blk->xMin;
- break;
- }
-
- return below;
-}
-
-//------------------------------------------------------------------------
-// TextFlow
-//------------------------------------------------------------------------
-
-TextFlow::TextFlow(TextPage *pageA, TextBlock *blk) {
- page = pageA;
- xMin = blk->xMin;
- xMax = blk->xMax;
- yMin = blk->yMin;
- yMax = blk->yMax;
- priMin = blk->priMin;
- priMax = blk->priMax;
- blocks = lastBlk = blk;
- next = NULL;
-}
-
-TextFlow::~TextFlow() {
- TextBlock *blk;
-
- while (blocks) {
- blk = blocks;
- blocks = blocks->next;
- delete blk;
- }
-}
-
-void TextFlow::addBlock(TextBlock *blk) {
- if (lastBlk) {
- lastBlk->next = blk;
- } else {
- blocks = blk;
- }
- lastBlk = blk;
- if (blk->xMin < xMin) {
- xMin = blk->xMin;
- }
- if (blk->xMax > xMax) {
- xMax = blk->xMax;
- }
- if (blk->yMin < yMin) {
- yMin = blk->yMin;
- }
- if (blk->yMax > yMax) {
- yMax = blk->yMax;
- }
-}
-
-GBool TextFlow::blockFits(TextBlock *blk, TextBlock * /*prevBlk*/) {
- GBool fits;
-
- // lower blocks must use smaller fonts
- if (blk->lines->words->fontSize > lastBlk->lines->words->fontSize) {
- return gFalse;
- }
-
- fits = gFalse; // make gcc happy
- switch (page->primaryRot) {
- case 0:
- fits = blk->xMin >= priMin && blk->xMax <= priMax;
- break;
- case 1:
- fits = blk->yMin >= priMin && blk->yMax <= priMax;
- break;
- case 2:
- fits = blk->xMin >= priMin && blk->xMax <= priMax;
- break;
- case 3:
- fits = blk->yMin >= priMin && blk->yMax <= priMax;
- break;
- }
- return fits;
-}
-
-#if TEXTOUT_WORD_LIST
-
-//------------------------------------------------------------------------
-// TextWordList
-//------------------------------------------------------------------------
-
-TextWordList::TextWordList(TextPage *text, GBool physLayout) {
- TextFlow *flow;
- TextBlock *blk;
- TextLine *line;
- TextWord *word;
- TextWord **wordArray;
- int nWords, i;
-
- words = new GList();
-
- if (text->rawOrder) {
- for (word = text->rawWords; word; word = word->next) {
- words->append(word);
- }
-
- } else if (physLayout) {
- // this is inefficient, but it's also the least useful of these
- // three cases
- nWords = 0;
- for (flow = text->flows; flow; flow = flow->next) {
- for (blk = flow->blocks; blk; blk = blk->next) {
- for (line = blk->lines; line; line = line->next) {
- for (word = line->words; word; word = word->next) {
- ++nWords;
- }
- }
- }
- }
- wordArray = (TextWord **)gmallocn(nWords, sizeof(TextWord *));
- i = 0;
- for (flow = text->flows; flow; flow = flow->next) {
- for (blk = flow->blocks; blk; blk = blk->next) {
- for (line = blk->lines; line; line = line->next) {
- for (word = line->words; word; word = word->next) {
- wordArray[i++] = word;
- }
- }
- }
- }
- qsort(wordArray, nWords, sizeof(TextWord *), &TextWord::cmpYX);
- for (i = 0; i < nWords; ++i) {
- words->append(wordArray[i]);
- }
- gfree(wordArray);
-
- } else {
- for (flow = text->flows; flow; flow = flow->next) {
- for (blk = flow->blocks; blk; blk = blk->next) {
- for (line = blk->lines; line; line = line->next) {
- for (word = line->words; word; word = word->next) {
- words->append(word);
- }
- }
- }
- }
- }
-}
-
-TextWordList::~TextWordList() {
- delete words;
-}
-
-int TextWordList::getLength() {
- return words->getLength();
-}
-
-TextWord *TextWordList::get(int idx) {
- if (idx < 0 || idx >= words->getLength()) {
- return NULL;
- }
- return (TextWord *)words->get(idx);
-}
-
-#endif // TEXTOUT_WORD_LIST
-
-//------------------------------------------------------------------------
-// TextPage
-//------------------------------------------------------------------------
-
-TextPage::TextPage(GBool rawOrderA) {
- int rot;
-
- rawOrder = rawOrderA;
- curWord = NULL;
- charPos = 0;
- curFont = NULL;
- curFontSize = 0;
- nest = 0;
- nTinyChars = 0;
- lastCharOverlap = gFalse;
- if (!rawOrder) {
- for (rot = 0; rot < 4; ++rot) {
- pools[rot] = new TextPool();
- }
- }
- flows = NULL;
- blocks = NULL;
- rawWords = NULL;
- rawLastWord = NULL;
- fonts = new GList();
- lastFindXMin = lastFindYMin = 0;
- haveLastFind = gFalse;
- underlines = new GList();
- links = new GList();
-}
-
-TextPage::~TextPage() {
- int rot;
-
- clear();
- if (!rawOrder) {
- for (rot = 0; rot < 4; ++rot) {
- delete pools[rot];
- }
- }
- delete fonts;
- deleteGList(underlines, TextUnderline);
- deleteGList(links, TextLink);
-}
-
-void TextPage::startPage(GfxState *state) {
- clear();
- if (state) {
- pageWidth = state->getPageWidth();
- pageHeight = state->getPageHeight();
- } else {
- pageWidth = pageHeight = 0;
- }
-}
-
-void TextPage::endPage() {
- if (curWord) {
- endWord();
- }
-}
-
-void TextPage::clear() {
- int rot;
- TextFlow *flow;
- TextWord *word;
-
- if (curWord) {
- delete curWord;
- curWord = NULL;
- }
- if (rawOrder) {
- while (rawWords) {
- word = rawWords;
- rawWords = rawWords->next;
- delete word;
- }
- } else {
- for (rot = 0; rot < 4; ++rot) {
- delete pools[rot];
- }
- while (flows) {
- flow = flows;
- flows = flows->next;
- delete flow;
- }
- gfree(blocks);
- }
- deleteGList(fonts, TextFontInfo);
-
- curWord = NULL;
- charPos = 0;
- curFont = NULL;
- curFontSize = 0;
- nest = 0;
- nTinyChars = 0;
- if (!rawOrder) {
- for (rot = 0; rot < 4; ++rot) {
- pools[rot] = new TextPool();
- }
- }
- flows = NULL;
- blocks = NULL;
- rawWords = NULL;
- rawLastWord = NULL;
- fonts = new GList();
-}
-
-void TextPage::updateFont(GfxState *state) {
- GfxFont *gfxFont;
- double *fm;
- char *name;
- int code, mCode, letterCode, anyCode;
- double w;
- int i;
-
- // get the font info object
- curFont = NULL;
- for (i = 0; i < fonts->getLength(); ++i) {
- curFont = (TextFontInfo *)fonts->get(i);
- if (curFont->matches(state)) {
- break;
- }
- curFont = NULL;
- }
- if (!curFont) {
- curFont = new TextFontInfo(state);
- fonts->append(curFont);
- }
-
- // adjust the font size
- gfxFont = state->getFont();
- curFontSize = state->getTransformedFontSize();
- if (gfxFont && gfxFont->getType() == fontType3) {
- // This is a hack which makes it possible to deal with some Type 3
- // fonts. The problem is that it's impossible to know what the
- // base coordinate system used in the font is without actually
- // rendering the font. This code tries to guess by looking at the
- // width of the character 'm' (which breaks if the font is a
- // subset that doesn't contain 'm').
- mCode = letterCode = anyCode = -1;
- for (code = 0; code < 256; ++code) {
- name = ((Gfx8BitFont *)gfxFont)->getCharName(code);
- if (name && name[0] == 'm' && name[1] == '\0') {
- mCode = code;
- }
- if (letterCode < 0 && name && name[1] == '\0' &&
- ((name[0] >= 'A' && name[0] <= 'Z') ||
- (name[0] >= 'a' && name[0] <= 'z'))) {
- letterCode = code;
- }
- if (anyCode < 0 && name &&
- ((Gfx8BitFont *)gfxFont)->getWidth(code) > 0) {
- anyCode = code;
- }
- }
- if (mCode >= 0 &&
- (w = ((Gfx8BitFont *)gfxFont)->getWidth(mCode)) > 0) {
- // 0.6 is a generic average 'm' width -- yes, this is a hack
- curFontSize *= w / 0.6;
- } else if (letterCode >= 0 &&
- (w = ((Gfx8BitFont *)gfxFont)->getWidth(letterCode)) > 0) {
- // even more of a hack: 0.5 is a generic letter width
- curFontSize *= w / 0.5;
- } else if (anyCode >= 0 &&
- (w = ((Gfx8BitFont *)gfxFont)->getWidth(anyCode)) > 0) {
- // better than nothing: 0.5 is a generic character width
- curFontSize *= w / 0.5;
- }
- fm = gfxFont->getFontMatrix();
- if (fm[0] != 0) {
- curFontSize *= fabs(fm[3] / fm[0]);
- }
- }
-}
-
-void TextPage::beginWord(GfxState *state, double x0, double y0) {
- double *fontm;
- double m[4], m2[4];
- int rot;
-
- // This check is needed because Type 3 characters can contain
- // text-drawing operations (when TextPage is being used via
- // {X,Win}SplashOutputDev rather than TextOutputDev).
- if (curWord) {
- ++nest;
- return;
- }
-
- // compute the rotation
- state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]);
- if (state->getFont()->getType() == fontType3) {
- fontm = state->getFont()->getFontMatrix();
- m2[0] = fontm[0] * m[0] + fontm[1] * m[2];
- m2[1] = fontm[0] * m[1] + fontm[1] * m[3];
- m2[2] = fontm[2] * m[0] + fontm[3] * m[2];
- m2[3] = fontm[2] * m[1] + fontm[3] * m[3];
- m[0] = m2[0];
- m[1] = m2[1];
- m[2] = m2[2];
- m[3] = m2[3];
- }
- if (fabs(m[0] * m[3]) > fabs(m[1] * m[2])) {
- rot = (m[3] < 0) ? 0 : 2;
- } else {
- rot = (m[2] > 0) ? 1 : 3;
- }
-
- curWord = new TextWord(state, rot, x0, y0, charPos, curFont, curFontSize);
-}
-
-void TextPage::addChar(GfxState *state, double x, double y,
- double dx, double dy,
- CharCode c, int nBytes, Unicode *u, int uLen) {
- double x1, y1, w1, h1, dx2, dy2, base, sp, delta;
- GBool overlap;
- int i;
-
- // subtract char and word spacing from the dx,dy values
- sp = state->getCharSpace();
- if (c == (CharCode)0x20) {
- sp += state->getWordSpace();
- }
- state->textTransformDelta(sp * state->getHorizScaling(), 0, &dx2, &dy2);
- dx -= dx2;
- dy -= dy2;
- state->transformDelta(dx, dy, &w1, &h1);
-
- // throw away chars that aren't inside the page bounds
- // (and also do a sanity check on the character size)
- state->transform(x, y, &x1, &y1);
- if (x1 + w1 < 0 || x1 > pageWidth ||
- y1 + h1 < 0 || y1 > pageHeight ||
- w1 > pageWidth || h1 > pageHeight) {
- charPos += nBytes;
- return;
- }
-
- // check the tiny chars limit
- if (!globalParams->getTextKeepTinyChars() &&
- fabs(w1) < 3 && fabs(h1) < 3) {
- if (++nTinyChars > 50000) {
- charPos += nBytes;
- return;
- }
- }
-
- // break words at space character
- if (uLen == 1 && u[0] == (Unicode)0x20) {
- if (curWord) {
- ++curWord->charLen;
- }
- charPos += nBytes;
- endWord();
- return;
- }
-
- // start a new word if:
- // (1) this character doesn't fall in the right place relative to
- // the end of the previous word (this places upper and lower
- // constraints on the position deltas along both the primary
- // and secondary axes), or
- // (2) this character overlaps the previous one (duplicated text), or
- // (3) the previous character was an overlap (we want each duplicated
- // character to be in a word by itself at this stage),
- // (4) the font size has changed
- if (curWord && curWord->len > 0) {
- base = sp = delta = 0; // make gcc happy
- switch (curWord->rot) {
- case 0:
- base = y1;
- sp = x1 - curWord->xMax;
- delta = x1 - curWord->edge[curWord->len - 1];
- break;
- case 1:
- base = x1;
- sp = y1 - curWord->yMax;
- delta = y1 - curWord->edge[curWord->len - 1];
- break;
- case 2:
- base = y1;
- sp = curWord->xMin - x1;
- delta = curWord->edge[curWord->len - 1] - x1;
- break;
- case 3:
- base = x1;
- sp = curWord->yMin - y1;
- delta = curWord->edge[curWord->len - 1] - y1;
- break;
- }
- overlap = fabs(delta) < dupMaxPriDelta * curWord->fontSize &&
- fabs(base - curWord->base) < dupMaxSecDelta * curWord->fontSize;
- if (overlap || lastCharOverlap ||
- sp < -minDupBreakOverlap * curWord->fontSize ||
- sp > minWordBreakSpace * curWord->fontSize ||
- fabs(base - curWord->base) > 0.5 ||
- curFontSize != curWord->fontSize) {
- endWord();
- }
- lastCharOverlap = overlap;
- } else {
- lastCharOverlap = gFalse;
- }
-
- if (uLen != 0) {
- // start a new word if needed
- if (!curWord) {
- beginWord(state, x, y);
- }
-
- // page rotation and/or transform matrices can cause text to be
- // drawn in reverse order -- in this case, swap the begin/end
- // coordinates and break text into individual chars
- if ((curWord->rot == 0 && w1 < 0) ||
- (curWord->rot == 1 && h1 < 0) ||
- (curWord->rot == 2 && w1 > 0) ||
- (curWord->rot == 3 && h1 > 0)) {
- endWord();
- beginWord(state, x + dx, y + dy);
- x1 += w1;
- y1 += h1;
- w1 = -w1;
- h1 = -h1;
- }
-
- // add the characters to the current word
- w1 /= uLen;
- h1 /= uLen;
- for (i = 0; i < uLen; ++i) {
- curWord->addChar(state, x1 + i*w1, y1 + i*h1, w1, h1, u[i]);
- }
- }
- if (curWord) {
- curWord->charLen += nBytes;
- }
- charPos += nBytes;
-}
-
-void TextPage::endWord() {
- // This check is needed because Type 3 characters can contain
- // text-drawing operations (when TextPage is being used via
- // {X,Win}SplashOutputDev rather than TextOutputDev).
- if (nest > 0) {
- --nest;
- return;
- }
-
- if (curWord) {
- addWord(curWord);
- curWord = NULL;
- }
-}
-
-void TextPage::addWord(TextWord *word) {
- // throw away zero-length words -- they don't have valid xMin/xMax
- // values, and they're useless anyway
- if (word->len == 0) {
- delete word;
- return;
- }
-
- if (rawOrder) {
- if (rawLastWord) {
- rawLastWord->next = word;
- } else {
- rawWords = word;
- }
- rawLastWord = word;
- } else {
- pools[word->rot]->addWord(word);
- }
-}
-
-void TextPage::addUnderline(double x0, double y0, double x1, double y1) {
- underlines->append(new TextUnderline(x0, y0, x1, y1));
-}
-
-void TextPage::addLink(int xMin, int yMin, int xMax, int yMax, Link *link) {
- links->append(new TextLink(xMin, yMin, xMax, yMax, link));
-}
-
-void TextPage::coalesce(GBool /*physLayout*/, GBool doHTML) {
- UnicodeMap *uMap;
- TextPool *pool;
- TextWord *word0, *word1, *word2;
- TextLine *line;
- TextBlock *blkList, *blkStack, *blk, *lastBlk, *blk0, *blk1;
- TextBlock **blkArray;
- TextFlow *flow, *lastFlow;
- TextUnderline *underline;
- TextLink *link;
- int rot, poolMinBaseIdx, baseIdx, startBaseIdx, endBaseIdx;
- double minBase, maxBase, newMinBase, newMaxBase;
- double fontSize, colSpace1, colSpace2, lineSpace, intraLineSpace, blkSpace;
- GBool found;
- int count[4];
- int lrCount;
- int firstBlkIdx, nBlocksLeft;
- int col1, col2;
- int i, j, n;
-
- if (rawOrder) {
- primaryRot = 0;
- primaryLR = gTrue;
- return;
- }
-
- uMap = globalParams->getTextEncoding();
- blkList = NULL;
- lastBlk = NULL;
- nBlocks = 0;
- primaryRot = -1;
-
-#if 0 // for debugging
- printf("*** initial words ***\n");
- for (rot = 0; rot < 4; ++rot) {
- pool = pools[rot];
- for (baseIdx = pool->minBaseIdx; baseIdx <= pool->maxBaseIdx; ++baseIdx) {
- for (word0 = pool->getPool(baseIdx); word0; word0 = word0->next) {
- printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f rot=%d link=%p '",
- word0->xMin, word0->xMax, word0->yMin, word0->yMax,
- word0->base, word0->fontSize, rot*90, word0->link);
- for (i = 0; i < word0->len; ++i) {
- fputc(word0->text[i] & 0xff, stdout);
- }
- printf("'\n");
- }
- }
- }
- printf("\n");
-#endif
-
-#if 0 //~ for debugging
- for (i = 0; i < underlines->getLength(); ++i) {
- underline = (TextUnderline *)underlines->get(i);
- printf("underline: x=%g..%g y=%g..%g horiz=%d\n",
- underline->x0, underline->x1, underline->y0, underline->y1,
- underline->horiz);
- }
-#endif
-
- if (doHTML) {
-
- //----- handle underlining
- for (i = 0; i < underlines->getLength(); ++i) {
- underline = (TextUnderline *)underlines->get(i);
- if (underline->horiz) {
- // rot = 0
- if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) {
- startBaseIdx = pools[0]->getBaseIdx(underline->y0 + minUnderlineGap);
- endBaseIdx = pools[0]->getBaseIdx(underline->y0 + maxUnderlineGap);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[0]->getPool(j); word0; word0 = word0->next) {
- //~ need to check the y value against the word baseline
- if (underline->x0 < word0->xMin + underlineSlack &&
- word0->xMax - underlineSlack < underline->x1) {
- word0->underlined = gTrue;
- }
- }
- }
- }
-
- // rot = 2
- if (pools[2]->minBaseIdx <= pools[2]->maxBaseIdx) {
- startBaseIdx = pools[2]->getBaseIdx(underline->y0 - maxUnderlineGap);
- endBaseIdx = pools[2]->getBaseIdx(underline->y0 - minUnderlineGap);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[2]->getPool(j); word0; word0 = word0->next) {
- if (underline->x0 < word0->xMin + underlineSlack &&
- word0->xMax - underlineSlack < underline->x1) {
- word0->underlined = gTrue;
- }
- }
- }
- }
- } else {
- // rot = 1
- if (pools[1]->minBaseIdx <= pools[1]->maxBaseIdx) {
- startBaseIdx = pools[1]->getBaseIdx(underline->x0 - maxUnderlineGap);
- endBaseIdx = pools[1]->getBaseIdx(underline->x0 - minUnderlineGap);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[1]->getPool(j); word0; word0 = word0->next) {
- if (underline->y0 < word0->yMin + underlineSlack &&
- word0->yMax - underlineSlack < underline->y1) {
- word0->underlined = gTrue;
- }
- }
- }
- }
-
- // rot = 3
- if (pools[3]->minBaseIdx <= pools[3]->maxBaseIdx) {
- startBaseIdx = pools[3]->getBaseIdx(underline->x0 + minUnderlineGap);
- endBaseIdx = pools[3]->getBaseIdx(underline->x0 + maxUnderlineGap);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[3]->getPool(j); word0; word0 = word0->next) {
- if (underline->y0 < word0->yMin + underlineSlack &&
- word0->yMax - underlineSlack < underline->y1) {
- word0->underlined = gTrue;
- }
- }
- }
- }
- }
- }
-
- //----- handle links
- for (i = 0; i < links->getLength(); ++i) {
- link = (TextLink *)links->get(i);
-
- // rot = 0
- if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) {
- startBaseIdx = pools[0]->getBaseIdx(link->yMin);
- endBaseIdx = pools[0]->getBaseIdx(link->yMax);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[0]->getPool(j); word0; word0 = word0->next) {
- if (link->xMin < word0->xMin + hyperlinkSlack &&
- word0->xMax - hyperlinkSlack < link->xMax &&
- link->yMin < word0->yMin + hyperlinkSlack &&
- word0->yMax - hyperlinkSlack < link->yMax) {
- word0->link = link->link;
- }
- }
- }
- }
-
- // rot = 2
- if (pools[2]->minBaseIdx <= pools[2]->maxBaseIdx) {
- startBaseIdx = pools[2]->getBaseIdx(link->yMin);
- endBaseIdx = pools[2]->getBaseIdx(link->yMax);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[2]->getPool(j); word0; word0 = word0->next) {
- if (link->xMin < word0->xMin + hyperlinkSlack &&
- word0->xMax - hyperlinkSlack < link->xMax &&
- link->yMin < word0->yMin + hyperlinkSlack &&
- word0->yMax - hyperlinkSlack < link->yMax) {
- word0->link = link->link;
- }
- }
- }
- }
-
- // rot = 1
- if (pools[1]->minBaseIdx <= pools[1]->maxBaseIdx) {
- startBaseIdx = pools[1]->getBaseIdx(link->xMin);
- endBaseIdx = pools[1]->getBaseIdx(link->xMax);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[1]->getPool(j); word0; word0 = word0->next) {
- if (link->yMin < word0->yMin + hyperlinkSlack &&
- word0->yMax - hyperlinkSlack < link->yMax &&
- link->xMin < word0->xMin + hyperlinkSlack &&
- word0->xMax - hyperlinkSlack < link->xMax) {
- word0->link = link->link;
- }
- }
- }
- }
-
- // rot = 3
- if (pools[3]->minBaseIdx <= pools[3]->maxBaseIdx) {
- startBaseIdx = pools[3]->getBaseIdx(link->xMin);
- endBaseIdx = pools[3]->getBaseIdx(link->xMax);
- for (j = startBaseIdx; j <= endBaseIdx; ++j) {
- for (word0 = pools[3]->getPool(j); word0; word0 = word0->next) {
- if (link->yMin < word0->yMin + hyperlinkSlack &&
- word0->yMax - hyperlinkSlack < link->yMax &&
- link->xMin < word0->xMin + hyperlinkSlack &&
- word0->xMax - hyperlinkSlack < link->xMax) {
- word0->link = link->link;
- }
- }
- }
- }
- }
- }
-
- //----- assemble the blocks
-
- //~ add an outer loop for writing mode (vertical text)
-
- // build blocks for each rotation value
- for (rot = 0; rot < 4; ++rot) {
- pool = pools[rot];
- poolMinBaseIdx = pool->minBaseIdx;
- count[rot] = 0;
-
- // add blocks until no more words are left
- while (1) {
-
- // find the first non-empty line in the pool
- for (;
- poolMinBaseIdx <= pool->maxBaseIdx &&
- !pool->getPool(poolMinBaseIdx);
- ++poolMinBaseIdx) ;
- if (poolMinBaseIdx > pool->maxBaseIdx) {
- break;
- }
-
- // look for the left-most word in the first four lines of the
- // pool -- this avoids starting with a superscript word
- startBaseIdx = poolMinBaseIdx;
- for (baseIdx = poolMinBaseIdx + 1;
- baseIdx < poolMinBaseIdx + 4 && baseIdx <= pool->maxBaseIdx;
- ++baseIdx) {
- if (!pool->getPool(baseIdx)) {
- continue;
- }
- if (pool->getPool(baseIdx)->primaryCmp(pool->getPool(startBaseIdx))
- < 0) {
- startBaseIdx = baseIdx;
- }
- }
-
- // create a new block
- word0 = pool->getPool(startBaseIdx);
- pool->setPool(startBaseIdx, word0->next);
- word0->next = NULL;
- blk = new TextBlock(this, rot);
- blk->addWord(word0);
-
- fontSize = word0->fontSize;
- minBase = maxBase = word0->base;
- colSpace1 = minColSpacing1 * fontSize;
- colSpace2 = minColSpacing2 * fontSize;
- lineSpace = maxLineSpacingDelta * fontSize;
- intraLineSpace = maxIntraLineDelta * fontSize;
-
- // add words to the block
- do {
- found = gFalse;
-
- // look for words on the line above the current top edge of
- // the block
- newMinBase = minBase;
- for (baseIdx = pool->getBaseIdx(minBase);
- baseIdx >= pool->getBaseIdx(minBase - lineSpace);
- --baseIdx) {
- word0 = NULL;
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base < minBase &&
- word1->base >= minBase - lineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMin < blk->xMax && word1->xMax > blk->xMin)
- : (word1->yMin < blk->yMax && word1->yMax > blk->yMin)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta1 * fontSize) {
- word2 = word1;
- if (word0) {
- word0->next = word1->next;
- } else {
- pool->setPool(baseIdx, word1->next);
- }
- word1 = word1->next;
- word2->next = NULL;
- blk->addWord(word2);
- found = gTrue;
- newMinBase = word2->base;
- } else {
- word0 = word1;
- word1 = word1->next;
- }
- }
- }
- minBase = newMinBase;
-
- // look for words on the line below the current bottom edge of
- // the block
- newMaxBase = maxBase;
- for (baseIdx = pool->getBaseIdx(maxBase);
- baseIdx <= pool->getBaseIdx(maxBase + lineSpace);
- ++baseIdx) {
- word0 = NULL;
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base > maxBase &&
- word1->base <= maxBase + lineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMin < blk->xMax && word1->xMax > blk->xMin)
- : (word1->yMin < blk->yMax && word1->yMax > blk->yMin)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta1 * fontSize) {
- word2 = word1;
- if (word0) {
- word0->next = word1->next;
- } else {
- pool->setPool(baseIdx, word1->next);
- }
- word1 = word1->next;
- word2->next = NULL;
- blk->addWord(word2);
- found = gTrue;
- newMaxBase = word2->base;
- } else {
- word0 = word1;
- word1 = word1->next;
- }
- }
- }
- maxBase = newMaxBase;
-
- // look for words that are on lines already in the block, and
- // that overlap the block horizontally
- for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
- baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
- ++baseIdx) {
- word0 = NULL;
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base >= minBase - intraLineSpace &&
- word1->base <= maxBase + intraLineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMin < blk->xMax + colSpace1 &&
- word1->xMax > blk->xMin - colSpace1)
- : (word1->yMin < blk->yMax + colSpace1 &&
- word1->yMax > blk->yMin - colSpace1)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta2 * fontSize) {
- word2 = word1;
- if (word0) {
- word0->next = word1->next;
- } else {
- pool->setPool(baseIdx, word1->next);
- }
- word1 = word1->next;
- word2->next = NULL;
- blk->addWord(word2);
- found = gTrue;
- } else {
- word0 = word1;
- word1 = word1->next;
- }
- }
- }
-
- // only check for outlying words (the next two chunks of code)
- // if we didn't find anything else
- if (found) {
- continue;
- }
-
- // scan down the left side of the block, looking for words
- // that are near (but not overlapping) the block; if there are
- // three or fewer, add them to the block
- n = 0;
- for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
- baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
- ++baseIdx) {
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base >= minBase - intraLineSpace &&
- word1->base <= maxBase + intraLineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMax <= blk->xMin &&
- word1->xMax > blk->xMin - colSpace2)
- : (word1->yMax <= blk->yMin &&
- word1->yMax > blk->yMin - colSpace2)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta3 * fontSize) {
- ++n;
- break;
- }
- word1 = word1->next;
- }
- }
- if (n > 0 && n <= 3) {
- for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
- baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
- ++baseIdx) {
- word0 = NULL;
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base >= minBase - intraLineSpace &&
- word1->base <= maxBase + intraLineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMax <= blk->xMin &&
- word1->xMax > blk->xMin - colSpace2)
- : (word1->yMax <= blk->yMin &&
- word1->yMax > blk->yMin - colSpace2)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta3 * fontSize) {
- word2 = word1;
- if (word0) {
- word0->next = word1->next;
- } else {
- pool->setPool(baseIdx, word1->next);
- }
- word1 = word1->next;
- word2->next = NULL;
- blk->addWord(word2);
- if (word2->base < minBase) {
- minBase = word2->base;
- } else if (word2->base > maxBase) {
- maxBase = word2->base;
- }
- found = gTrue;
- break;
- } else {
- word0 = word1;
- word1 = word1->next;
- }
- }
- }
- }
-
- // scan down the right side of the block, looking for words
- // that are near (but not overlapping) the block; if there are
- // three or fewer, add them to the block
- n = 0;
- for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
- baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
- ++baseIdx) {
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base >= minBase - intraLineSpace &&
- word1->base <= maxBase + intraLineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMin >= blk->xMax &&
- word1->xMin < blk->xMax + colSpace2)
- : (word1->yMin >= blk->yMax &&
- word1->yMin < blk->yMax + colSpace2)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta3 * fontSize) {
- ++n;
- break;
- }
- word1 = word1->next;
- }
- }
- if (n > 0 && n <= 3) {
- for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
- baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
- ++baseIdx) {
- word0 = NULL;
- word1 = pool->getPool(baseIdx);
- while (word1) {
- if (word1->base >= minBase - intraLineSpace &&
- word1->base <= maxBase + intraLineSpace &&
- ((rot == 0 || rot == 2)
- ? (word1->xMin >= blk->xMax &&
- word1->xMin < blk->xMax + colSpace2)
- : (word1->yMin >= blk->yMax &&
- word1->yMin < blk->yMax + colSpace2)) &&
- fabs(word1->fontSize - fontSize) <
- maxBlockFontSizeDelta3 * fontSize) {
- word2 = word1;
- if (word0) {
- word0->next = word1->next;
- } else {
- pool->setPool(baseIdx, word1->next);
- }
- word1 = word1->next;
- word2->next = NULL;
- blk->addWord(word2);
- if (word2->base < minBase) {
- minBase = word2->base;
- } else if (word2->base > maxBase) {
- maxBase = word2->base;
- }
- found = gTrue;
- break;
- } else {
- word0 = word1;
- word1 = word1->next;
- }
- }
- }
- }
-
- } while (found);
-
- //~ need to compute the primary writing mode (horiz/vert) in
- //~ addition to primary rotation
-
- // coalesce the block, and add it to the list
- blk->coalesce(uMap);
- if (lastBlk) {
- lastBlk->next = blk;
- } else {
- blkList = blk;
- }
- lastBlk = blk;
- count[rot] += blk->charCount;
- if (primaryRot < 0 || count[rot] > count[primaryRot]) {
- primaryRot = rot;
- }
- ++nBlocks;
- }
- }
-
-#if 0 // for debugging
- printf("*** rotation ***\n");
- for (rot = 0; rot < 4; ++rot) {
- printf(" %d: %6d\n", rot, count[rot]);
- }
- printf(" primary rot = %d\n", primaryRot);
- printf("\n");
-#endif
-
-#if 0 // for debugging
- printf("*** blocks ***\n");
- for (blk = blkList; blk; blk = blk->next) {
- printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f\n",
- blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax);
- for (line = blk->lines; line; line = line->next) {
- printf(" line: x=%.2f..%.2f y=%.2f..%.2f base=%.2f\n",
- line->xMin, line->xMax, line->yMin, line->yMax, line->base);
- for (word0 = line->words; word0; word0 = word0->next) {
- printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
- word0->xMin, word0->xMax, word0->yMin, word0->yMax,
- word0->base, word0->fontSize, word0->spaceAfter);
- for (i = 0; i < word0->len; ++i) {
- fputc(word0->text[i] & 0xff, stdout);
- }
- printf("'\n");
- }
- }
- }
- printf("\n");
-#endif
-
- // determine the primary direction
- lrCount = 0;
- for (blk = blkList; blk; blk = blk->next) {
- for (line = blk->lines; line; line = line->next) {
- for (word0 = line->words; word0; word0 = word0->next) {
- for (i = 0; i < word0->len; ++i) {
- if (unicodeTypeL(word0->text[i])) {
- ++lrCount;
- } else if (unicodeTypeR(word0->text[i])) {
- --lrCount;
- }
- }
- }
- }
- }
- primaryLR = lrCount >= 0;
-
-#if 0 // for debugging
- printf("*** direction ***\n");
- printf("lrCount = %d\n", lrCount);
- printf("primaryLR = %d\n", primaryLR);
-#endif
-
- //----- column assignment
-
- // sort blocks into xy order for column assignment
- blocks = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *));
- for (blk = blkList, i = 0; blk; blk = blk->next, ++i) {
- blocks[i] = blk;
- }
- qsort(blocks, nBlocks, sizeof(TextBlock *), &TextBlock::cmpXYPrimaryRot);
-
- // column assignment
- for (i = 0; i < nBlocks; ++i) {
- blk0 = blocks[i];
- col1 = 0;
- for (j = 0; j < i; ++j) {
- blk1 = blocks[j];
- col2 = 0; // make gcc happy
- switch (primaryRot) {
- case 0:
- if (blk0->xMin > blk1->xMax) {
- col2 = blk1->col + blk1->nColumns + 3;
- } else if (blk1->xMax == blk1->xMin) {
- col2 = blk1->col;
- } else {
- col2 = blk1->col + (int)(((blk0->xMin - blk1->xMin) /
- (blk1->xMax - blk1->xMin)) *
- blk1->nColumns);
- }
- break;
- case 1:
- if (blk0->yMin > blk1->yMax) {
- col2 = blk1->col + blk1->nColumns + 3;
- } else if (blk1->yMax == blk1->yMin) {
- col2 = blk1->col;
- } else {
- col2 = blk1->col + (int)(((blk0->yMin - blk1->yMin) /
- (blk1->yMax - blk1->yMin)) *
- blk1->nColumns);
- }
- break;
- case 2:
- if (blk0->xMax < blk1->xMin) {
- col2 = blk1->col + blk1->nColumns + 3;
- } else if (blk1->xMin == blk1->xMax) {
- col2 = blk1->col;
- } else {
- col2 = blk1->col + (int)(((blk0->xMax - blk1->xMax) /
- (blk1->xMin - blk1->xMax)) *
- blk1->nColumns);
- }
- break;
- case 3:
- if (blk0->yMax < blk1->yMin) {
- col2 = blk1->col + blk1->nColumns + 3;
- } else if (blk1->yMin == blk1->yMax) {
- col2 = blk1->col;
- } else {
- col2 = blk1->col + (int)(((blk0->yMax - blk1->yMax) /
- (blk1->yMin - blk1->yMax)) *
- blk1->nColumns);
- }
- break;
- }
- if (col2 > col1) {
- col1 = col2;
- }
- }
- blk0->col = col1;
- for (line = blk0->lines; line; line = line->next) {
- for (j = 0; j <= line->len; ++j) {
- line->col[j] += col1;
- }
- }
- }
-
-#if 0 // for debugging
- printf("*** blocks, after column assignment ***\n");
- for (blk = blkList; blk; blk = blk->next) {
- printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f col=%d nCols=%d\n",
- blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax, blk->col,
- blk->nColumns);
- for (line = blk->lines; line; line = line->next) {
- printf(" line:\n");
- for (word0 = line->words; word0; word0 = word0->next) {
- printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
- word0->xMin, word0->xMax, word0->yMin, word0->yMax,
- word0->base, word0->fontSize, word0->spaceAfter);
- for (i = 0; i < word0->len; ++i) {
- fputc(word0->text[i] & 0xff, stdout);
- }
- printf("'\n");
- }
- }
- }
- printf("\n");
-#endif
-
- //----- reading order sort
-
- // sort blocks into yx order (in preparation for reading order sort)
- qsort(blocks, nBlocks, sizeof(TextBlock *), &TextBlock::cmpYXPrimaryRot);
-
- // compute space on left and right sides of each block
- for (i = 0; i < nBlocks; ++i) {
- blk0 = blocks[i];
- for (j = 0; j < nBlocks; ++j) {
- blk1 = blocks[j];
- if (blk1 != blk0) {
- blk0->updatePriMinMax(blk1);
- }
- }
- }
-
-#if 0 // for debugging
- printf("*** blocks, after yx sort ***\n");
- for (i = 0; i < nBlocks; ++i) {
- blk = blocks[i];
- printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f space=%.2f..%.2f\n",
- blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax,
- blk->priMin, blk->priMax);
- for (line = blk->lines; line; line = line->next) {
- printf(" line:\n");
- for (word0 = line->words; word0; word0 = word0->next) {
- printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
- word0->xMin, word0->xMax, word0->yMin, word0->yMax,
- word0->base, word0->fontSize, word0->spaceAfter);
- for (j = 0; j < word0->len; ++j) {
- fputc(word0->text[j] & 0xff, stdout);
- }
- printf("'\n");
- }
- }
- }
- printf("\n");
-#endif
-
- // build the flows
- //~ this needs to be adjusted for writing mode (vertical text)
- //~ this also needs to account for right-to-left column ordering
- blkArray = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *));
- memcpy(blkArray, blocks, nBlocks * sizeof(TextBlock *));
- flows = lastFlow = NULL;
- firstBlkIdx = 0;
- nBlocksLeft = nBlocks;
- while (nBlocksLeft > 0) {
-
- // find the upper-left-most block
- for (; !blkArray[firstBlkIdx]; ++firstBlkIdx) ;
- i = firstBlkIdx;
- blk = blkArray[i];
- for (j = firstBlkIdx + 1; j < nBlocks; ++j) {
- blk1 = blkArray[j];
- if (blk1) {
- if (blk && blk->secondaryDelta(blk1) > 0) {
- break;
- }
- if (blk1->primaryCmp(blk) < 0) {
- i = j;
- blk = blk1;
- }
- }
- }
- blkArray[i] = NULL;
- --nBlocksLeft;
- blk->next = NULL;
-
- // create a new flow, starting with the upper-left-most block
- flow = new TextFlow(this, blk);
- if (lastFlow) {
- lastFlow->next = flow;
- } else {
- flows = flow;
- }
- lastFlow = flow;
- fontSize = blk->lines->words->fontSize;
-
- // push the upper-left-most block on the stack
- blk->stackNext = NULL;
- blkStack = blk;
-
- // find the other blocks in this flow
- while (blkStack) {
-
- // find the upper-left-most block under (but within
- // maxBlockSpacing of) the top block on the stack
- blkSpace = maxBlockSpacing * blkStack->lines->words->fontSize;
- blk = NULL;
- i = -1;
- for (j = firstBlkIdx; j < nBlocks; ++j) {
- blk1 = blkArray[j];
- if (blk1) {
- if (blkStack->secondaryDelta(blk1) > blkSpace) {
- break;
- }
- if (blk && blk->secondaryDelta(blk1) > 0) {
- break;
- }
- if (blk1->isBelow(blkStack) &&
- (!blk || blk1->primaryCmp(blk) < 0)) {
- i = j;
- blk = blk1;
- }
- }
- }
-
- // if a suitable block was found, add it to the flow and push it
- // onto the stack
- if (blk && flow->blockFits(blk, blkStack)) {
- blkArray[i] = NULL;
- --nBlocksLeft;
- blk->next = NULL;
- flow->addBlock(blk);
- fontSize = blk->lines->words->fontSize;
- blk->stackNext = blkStack;
- blkStack = blk;
-
- // otherwise (if there is no block under the top block or the
- // block is not suitable), pop the stack
- } else {
- blkStack = blkStack->stackNext;
- }
- }
- }
- gfree(blkArray);
-
-#if 0 // for debugging
- printf("*** flows ***\n");
- for (flow = flows; flow; flow = flow->next) {
- printf("flow: x=%.2f..%.2f y=%.2f..%.2f pri:%.2f..%.2f\n",
- flow->xMin, flow->xMax, flow->yMin, flow->yMax,
- flow->priMin, flow->priMax);
- for (blk = flow->blocks; blk; blk = blk->next) {
- printf(" block: rot=%d x=%.2f..%.2f y=%.2f..%.2f pri=%.2f..%.2f\n",
- blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax,
- blk->priMin, blk->priMax);
- for (line = blk->lines; line; line = line->next) {
- printf(" line:\n");
- for (word0 = line->words; word0; word0 = word0->next) {
- printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
- word0->xMin, word0->xMax, word0->yMin, word0->yMax,
- word0->base, word0->fontSize, word0->spaceAfter);
- for (i = 0; i < word0->len; ++i) {
- fputc(word0->text[i] & 0xff, stdout);
- }
- printf("'\n");
- }
- }
- }
- }
- printf("\n");
-#endif
-
- if (uMap) {
- uMap->decRefCnt();
- }
-}
-
-GBool TextPage::findText(Unicode *s, int len,
- GBool startAtTop, GBool stopAtBottom,
- GBool startAtLast, GBool stopAtLast,
- GBool caseSensitive, GBool backward,
- double *xMin, double *yMin,
- double *xMax, double *yMax) {
- TextBlock *blk;
- TextLine *line;
- Unicode *s2, *txt;
- Unicode *p;
- int txtSize, m, i, j, k;
- double xStart, yStart, xStop, yStop;
- double xMin0, yMin0, xMax0, yMax0;
- double xMin1, yMin1, xMax1, yMax1;
- GBool found;
-
- //~ needs to handle right-to-left text
-
- if (rawOrder) {
- return gFalse;
- }
-
- // convert the search string to uppercase
- if (!caseSensitive) {
- s2 = (Unicode *)gmallocn(len, sizeof(Unicode));
- for (i = 0; i < len; ++i) {
- s2[i] = unicodeToUpper(s[i]);
- }
- } else {
- s2 = s;
- }
-
- txt = NULL;
- txtSize = 0;
-
- xStart = yStart = xStop = yStop = 0;
- if (startAtLast && haveLastFind) {
- xStart = lastFindXMin;
- yStart = lastFindYMin;
- } else if (!startAtTop) {
- xStart = *xMin;
- yStart = *yMin;
- }
- if (stopAtLast && haveLastFind) {
- xStop = lastFindXMin;
- yStop = lastFindYMin;
- } else if (!stopAtBottom) {
- xStop = *xMax;
- yStop = *yMax;
- }
-
- found = gFalse;
- xMin0 = xMax0 = yMin0 = yMax0 = 0; // make gcc happy
- xMin1 = xMax1 = yMin1 = yMax1 = 0; // make gcc happy
-
- for (i = backward ? nBlocks - 1 : 0;
- backward ? i >= 0 : i < nBlocks;
- i += backward ? -1 : 1) {
- blk = blocks[i];
-
- // check: is the block above the top limit?
- if (!startAtTop && (backward ? blk->yMin > yStart : blk->yMax < yStart)) {
- continue;
- }
-
- // check: is the block below the bottom limit?
- if (!stopAtBottom && (backward ? blk->yMax < yStop : blk->yMin > yStop)) {
- break;
- }
-
- for (line = blk->lines; line; line = line->next) {
-
- // check: is the line above the top limit?
- if (!startAtTop &&
- (backward ? line->yMin > yStart : line->yMin < yStart)) {
- continue;
- }
-
- // check: is the line below the bottom limit?
- if (!stopAtBottom &&
- (backward ? line->yMin < yStop : line->yMin > yStop)) {
- continue;
- }
-
- // convert the line to uppercase
- m = line->len;
- if (!caseSensitive) {
- if (m > txtSize) {
- txt = (Unicode *)greallocn(txt, m, sizeof(Unicode));
- txtSize = m;
- }
- for (k = 0; k < m; ++k) {
- txt[k] = unicodeToUpper(line->text[k]);
- }
- } else {
- txt = line->text;
- }
-
- // search each position in this line
- j = backward ? m - len : 0;
- p = txt + j;
- while (backward ? j >= 0 : j <= m - len) {
-
- // compare the strings
- for (k = 0; k < len; ++k) {
- if (p[k] != s2[k]) {
- break;
- }
- }
-
- // found it
- if (k == len) {
- switch (line->rot) {
- case 0:
- xMin1 = line->edge[j];
- xMax1 = line->edge[j + len];
- yMin1 = line->yMin;
- yMax1 = line->yMax;
- break;
- case 1:
- xMin1 = line->xMin;
- xMax1 = line->xMax;
- yMin1 = line->edge[j];
- yMax1 = line->edge[j + len];
- break;
- case 2:
- xMin1 = line->edge[j + len];
- xMax1 = line->edge[j];
- yMin1 = line->yMin;
- yMax1 = line->yMax;
- break;
- case 3:
- xMin1 = line->xMin;
- xMax1 = line->xMax;
- yMin1 = line->edge[j + len];
- yMax1 = line->edge[j];
- break;
- }
- if (backward) {
- if ((startAtTop ||
- yMin1 < yStart || (yMin1 == yStart && xMin1 < xStart)) &&
- (stopAtBottom ||
- yMin1 > yStop || (yMin1 == yStop && xMin1 > xStop))) {
- if (!found ||
- yMin1 > yMin0 || (yMin1 == yMin0 && xMin1 > xMin0)) {
- xMin0 = xMin1;
- xMax0 = xMax1;
- yMin0 = yMin1;
- yMax0 = yMax1;
- found = gTrue;
- }
- }
- } else {
- if ((startAtTop ||
- yMin1 > yStart || (yMin1 == yStart && xMin1 > xStart)) &&
- (stopAtBottom ||
- yMin1 < yStop || (yMin1 == yStop && xMin1 < xStop))) {
- if (!found ||
- yMin1 < yMin0 || (yMin1 == yMin0 && xMin1 < xMin0)) {
- xMin0 = xMin1;
- xMax0 = xMax1;
- yMin0 = yMin1;
- yMax0 = yMax1;
- found = gTrue;
- }
- }
- }
- }
- if (backward) {
- --j;
- --p;
- } else {
- ++j;
- ++p;
- }
- }
- }
- }
-
- if (!caseSensitive) {
- gfree(s2);
- gfree(txt);
- }
-
- if (found) {
- *xMin = xMin0;
- *xMax = xMax0;
- *yMin = yMin0;
- *yMax = yMax0;
- lastFindXMin = xMin0;
- lastFindYMin = yMin0;
- haveLastFind = gTrue;
- return gTrue;
- }
-
- return gFalse;
-}
-
-GString *TextPage::getText(double xMin, double yMin,
- double xMax, double yMax) {
- GString *s;
- UnicodeMap *uMap;
- GBool isUnicode;
- TextBlock *blk;
- TextLine *line;
- TextLineFrag *frags;
- int nFrags, fragsSize;
- TextLineFrag *frag;
- char space[8], eol[16];
- int spaceLen, eolLen;
- int lastRot;
- double x, y, delta;
- int col, idx0, idx1, i, j;
- GBool multiLine, oneRot;
-
- s = new GString();
-
- if (rawOrder) {
- return s;
- }
-
- // get the output encoding
- if (!(uMap = globalParams->getTextEncoding())) {
- return s;
- }
- isUnicode = uMap->isUnicode();
- spaceLen = uMap->mapUnicode(0x20, space, sizeof(space));
- eolLen = 0; // make gcc happy
- switch (globalParams->getTextEOL()) {
- case eolUnix:
- eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol));
- break;
- case eolDOS:
- eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
- eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen);
- break;
- case eolMac:
- eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
- break;
- }
-
- //~ writing mode (horiz/vert)
-
- // collect the line fragments that are in the rectangle
- fragsSize = 256;
- frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag));
- nFrags = 0;
- lastRot = -1;
- oneRot = gTrue;
- for (i = 0; i < nBlocks; ++i) {
- blk = blocks[i];
- if (xMin < blk->xMax && blk->xMin < xMax &&
- yMin < blk->yMax && blk->yMin < yMax) {
- for (line = blk->lines; line; line = line->next) {
- if (xMin < line->xMax && line->xMin < xMax &&
- yMin < line->yMax && line->yMin < yMax) {
- idx0 = idx1 = -1;
- switch (line->rot) {
- case 0:
- y = 0.5 * (line->yMin + line->yMax);
- if (yMin < y && y < yMax) {
- j = 0;
- while (j < line->len) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) > xMin) {
- idx0 = j;
- break;
- }
- ++j;
- }
- j = line->len - 1;
- while (j >= 0) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) < xMax) {
- idx1 = j;
- break;
- }
- --j;
- }
- }
- break;
- case 1:
- x = 0.5 * (line->xMin + line->xMax);
- if (xMin < x && x < xMax) {
- j = 0;
- while (j < line->len) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) > yMin) {
- idx0 = j;
- break;
- }
- ++j;
- }
- j = line->len - 1;
- while (j >= 0) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) < yMax) {
- idx1 = j;
- break;
- }
- --j;
- }
- }
- break;
- case 2:
- y = 0.5 * (line->yMin + line->yMax);
- if (yMin < y && y < yMax) {
- j = 0;
- while (j < line->len) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) < xMax) {
- idx0 = j;
- break;
- }
- ++j;
- }
- j = line->len - 1;
- while (j >= 0) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) > xMin) {
- idx1 = j;
- break;
- }
- --j;
- }
- }
- break;
- case 3:
- x = 0.5 * (line->xMin + line->xMax);
- if (xMin < x && x < xMax) {
- j = 0;
- while (j < line->len) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) < yMax) {
- idx0 = j;
- break;
- }
- ++j;
- }
- j = line->len - 1;
- while (j >= 0) {
- if (0.5 * (line->edge[j] + line->edge[j+1]) > yMin) {
- idx1 = j;
- break;
- }
- --j;
- }
- }
- break;
- }
- if (idx0 >= 0 && idx1 >= 0) {
- if (nFrags == fragsSize) {
- fragsSize *= 2;
- frags = (TextLineFrag *)
- greallocn(frags, fragsSize, sizeof(TextLineFrag));
- }
- frags[nFrags].init(line, idx0, idx1 - idx0 + 1);
- ++nFrags;
- if (lastRot >= 0 && line->rot != lastRot) {
- oneRot = gFalse;
- }
- lastRot = line->rot;
- }
- }
- }
- }
- }
-
- // sort the fragments and generate the string
- if (nFrags > 0) {
-
- for (i = 0; i < nFrags; ++i) {
- frags[i].computeCoords(oneRot);
- }
- assignColumns(frags, nFrags, oneRot);
-
- // if all lines in the region have the same rotation, use it;
- // otherwise, use the page's primary rotation
- if (oneRot) {
- qsort(frags, nFrags, sizeof(TextLineFrag),
- &TextLineFrag::cmpYXLineRot);
- } else {
- qsort(frags, nFrags, sizeof(TextLineFrag),
- &TextLineFrag::cmpYXPrimaryRot);
- }
- i = 0;
- while (i < nFrags) {
- delta = maxIntraLineDelta * frags[i].line->words->fontSize;
- for (j = i+1;
- j < nFrags && fabs(frags[j].base - frags[i].base) < delta;
- ++j) ;
- qsort(frags + i, j - i, sizeof(TextLineFrag),
- oneRot ? &TextLineFrag::cmpXYColumnLineRot
- : &TextLineFrag::cmpXYColumnPrimaryRot);
- i = j;
- }
-
- col = 0;
- multiLine = gFalse;
- for (i = 0; i < nFrags; ++i) {
- frag = &frags[i];
-
- // insert a return
- if (frag->col < col ||
- (i > 0 && fabs(frag->base - frags[i-1].base) >
- maxIntraLineDelta * frags[i-1].line->words->fontSize)) {
- s->append(eol, eolLen);
- col = 0;
- multiLine = gTrue;
- }
-
- // column alignment
- for (; col < frag->col; ++col) {
- s->append(space, spaceLen);
- }
-
- // get the fragment text
- col += dumpFragment(frag->line->text + frag->start, frag->len, uMap, s);
- }
-
- if (multiLine) {
- s->append(eol, eolLen);
- }
- }
-
- gfree(frags);
- uMap->decRefCnt();
-
- return s;
-}
-
-GBool TextPage::findCharRange(int pos, int length,
- double *xMin, double *yMin,
- double *xMax, double *yMax) {
- TextBlock *blk;
- TextLine *line;
- TextWord *word;
- double xMin0, xMax0, yMin0, yMax0;
- double xMin1, xMax1, yMin1, yMax1;
- GBool first;
- int i, j0, j1;
-
- if (rawOrder) {
- return gFalse;
- }
-
- //~ this doesn't correctly handle:
- //~ - ranges split across multiple lines (the highlighted region
- //~ is the bounding box of all the parts of the range)
- //~ - cases where characters don't convert one-to-one into Unicode
- first = gTrue;
- xMin0 = xMax0 = yMin0 = yMax0 = 0; // make gcc happy
- xMin1 = xMax1 = yMin1 = yMax1 = 0; // make gcc happy
- for (i = 0; i < nBlocks; ++i) {
- blk = blocks[i];
- for (line = blk->lines; line; line = line->next) {
- for (word = line->words; word; word = word->next) {
- if (pos < word->charPos + word->charLen &&
- word->charPos < pos + length) {
- j0 = pos - word->charPos;
- if (j0 < 0) {
- j0 = 0;
- }
- j1 = pos + length - 1 - word->charPos;
- if (j1 >= word->len) {
- j1 = word->len - 1;
- }
- switch (line->rot) {
- case 0:
- xMin1 = word->edge[j0];
- xMax1 = word->edge[j1 + 1];
- yMin1 = word->yMin;
- yMax1 = word->yMax;
- break;
- case 1:
- xMin1 = word->xMin;
- xMax1 = word->xMax;
- yMin1 = word->edge[j0];
- yMax1 = word->edge[j1 + 1];
- break;
- case 2:
- xMin1 = word->edge[j1 + 1];
- xMax1 = word->edge[j0];
- yMin1 = word->yMin;
- yMax1 = word->yMax;
- break;
- case 3:
- xMin1 = word->xMin;
- xMax1 = word->xMax;
- yMin1 = word->edge[j1 + 1];
- yMax1 = word->edge[j0];
- break;
- }
- if (first || xMin1 < xMin0) {
- xMin0 = xMin1;
- }
- if (first || xMax1 > xMax0) {
- xMax0 = xMax1;
- }
- if (first || yMin1 < yMin0) {
- yMin0 = yMin1;
- }
- if (first || yMax1 > yMax0) {
- yMax0 = yMax1;
- }
- first = gFalse;
- }
- }
- }
- }
- if (!first) {
- *xMin = xMin0;
- *xMax = xMax0;
- *yMin = yMin0;
- *yMax = yMax0;
- return gTrue;
- }
- return gFalse;
-}
-
-void TextPage::dump(void *outputStream, TextOutputFunc outputFunc,
- GBool physLayout) {
- UnicodeMap *uMap;
- TextFlow *flow;
- TextBlock *blk;
- TextLine *line;
- TextLineFrag *frags;
- TextWord *word;
- int nFrags, fragsSize;
- TextLineFrag *frag;
- char space[8], eol[16], eop[8];
- int spaceLen, eolLen, eopLen;
- GBool pageBreaks;
- GString *s;
- double delta;
- int col, i, j, d, n;
-
- // get the output encoding
- if (!(uMap = globalParams->getTextEncoding())) {
- return;
- }
- spaceLen = uMap->mapUnicode(0x20, space, sizeof(space));
- eolLen = 0; // make gcc happy
- switch (globalParams->getTextEOL()) {
- case eolUnix:
- eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol));
- break;
- case eolDOS:
- eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
- eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen);
- break;
- case eolMac:
- eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
- break;
- }
- eopLen = uMap->mapUnicode(0x0c, eop, sizeof(eop));
- pageBreaks = globalParams->getTextPageBreaks();
-
- //~ writing mode (horiz/vert)
-
- // output the page in raw (content stream) order
- if (rawOrder) {
-
- for (word = rawWords; word; word = word->next) {
- s = new GString();
- dumpFragment(word->text, word->len, uMap, s);
- (*outputFunc)(outputStream, s->getCString(), s->getLength());
- delete s;
- if (word->next &&
- fabs(word->next->base - word->base) <
- maxIntraLineDelta * word->fontSize) {
- if (word->next->xMin > word->xMax + minWordSpacing * word->fontSize) {
- (*outputFunc)(outputStream, space, spaceLen);
- }
- } else {
- (*outputFunc)(outputStream, eol, eolLen);
- }
- }
-
- // output the page, maintaining the original physical layout
- } else if (physLayout) {
-
- // collect the line fragments for the page and sort them
- fragsSize = 256;
- frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag));
- nFrags = 0;
- for (i = 0; i < nBlocks; ++i) {
- blk = blocks[i];
- for (line = blk->lines; line; line = line->next) {
- if (nFrags == fragsSize) {
- fragsSize *= 2;
- frags = (TextLineFrag *)greallocn(frags,
- fragsSize, sizeof(TextLineFrag));
- }
- frags[nFrags].init(line, 0, line->len);
- frags[nFrags].computeCoords(gTrue);
- ++nFrags;
- }
- }
- qsort(frags, nFrags, sizeof(TextLineFrag), &TextLineFrag::cmpYXPrimaryRot);
- i = 0;
- while (i < nFrags) {
- delta = maxIntraLineDelta * frags[i].line->words->fontSize;
- for (j = i+1;
- j < nFrags && fabs(frags[j].base - frags[i].base) < delta;
- ++j) ;
- qsort(frags + i, j - i, sizeof(TextLineFrag),
- &TextLineFrag::cmpXYColumnPrimaryRot);
- i = j;
- }
-
-#if 0 // for debugging
- printf("*** line fragments ***\n");
- for (i = 0; i < nFrags; ++i) {
- frag = &frags[i];
- printf("frag: x=%.2f..%.2f y=%.2f..%.2f base=%.2f '",
- frag->xMin, frag->xMax, frag->yMin, frag->yMax, frag->base);
- for (n = 0; n < frag->len; ++n) {
- fputc(frag->line->text[frag->start + n] & 0xff, stdout);
- }
- printf("'\n");
- }
- printf("\n");
-#endif
-
- // generate output
- col = 0;
- for (i = 0; i < nFrags; ++i) {
- frag = &frags[i];
-
- // column alignment
- for (; col < frag->col; ++col) {
- (*outputFunc)(outputStream, space, spaceLen);
- }
-
- // print the line
- s = new GString();
- col += dumpFragment(frag->line->text + frag->start, frag->len, uMap, s);
- (*outputFunc)(outputStream, s->getCString(), s->getLength());
- delete s;
-
- // print one or more returns if necessary
- if (i == nFrags - 1 ||
- frags[i+1].col < col ||
- fabs(frags[i+1].base - frag->base) >
- maxIntraLineDelta * frag->line->words->fontSize) {
- if (i < nFrags - 1) {
- d = (int)((frags[i+1].base - frag->base) /
- frag->line->words->fontSize);
- if (d < 1) {
- d = 1;
- } else if (d > 5) {
- d = 5;
- }
- } else {
- d = 1;
- }
- for (; d > 0; --d) {
- (*outputFunc)(outputStream, eol, eolLen);
- }
- col = 0;
- }
- }
-
- gfree(frags);
-
- // output the page, "undoing" the layout
- } else {
- for (flow = flows; flow; flow = flow->next) {
- for (blk = flow->blocks; blk; blk = blk->next) {
- for (line = blk->lines; line; line = line->next) {
- n = line->len;
- if (line->hyphenated && (line->next || blk->next)) {
- --n;
- }
- s = new GString();
- dumpFragment(line->text, n, uMap, s);
- (*outputFunc)(outputStream, s->getCString(), s->getLength());
- delete s;
- if (!line->hyphenated) {
- if (line->next) {
- (*outputFunc)(outputStream, space, spaceLen);
- } else if (blk->next) {
- //~ this is a bit of a kludge - we should really do a more
- //~ intelligent determination of paragraphs
- if (blk->next->lines->words->fontSize ==
- blk->lines->words->fontSize) {
- (*outputFunc)(outputStream, space, spaceLen);
- } else {
- (*outputFunc)(outputStream, eol, eolLen);
- }
- }
- }
- }
- }
- (*outputFunc)(outputStream, eol, eolLen);
- (*outputFunc)(outputStream, eol, eolLen);
- }
- }
-
- // end of page
- if (pageBreaks) {
- (*outputFunc)(outputStream, eop, eopLen);
- }
-
- uMap->decRefCnt();
-}
-
-void TextPage::assignColumns(TextLineFrag *frags, int nFrags, GBool oneRot) {
- TextLineFrag *frag0, *frag1;
- int rot, col1, col2, i, j, k;
-
- // all text in the region has the same rotation -- recompute the
- // column numbers based only on the text in the region
- if (oneRot) {
- qsort(frags, nFrags, sizeof(TextLineFrag), &TextLineFrag::cmpXYLineRot);
- rot = frags[0].line->rot;
- for (i = 0; i < nFrags; ++i) {
- frag0 = &frags[i];
- col1 = 0;
- for (j = 0; j < i; ++j) {
- frag1 = &frags[j];
- col2 = 0; // make gcc happy
- switch (rot) {
- case 0:
- if (frag0->xMin >= frag1->xMax) {
- col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
- frag1->line->col[frag1->start]) + 1;
- } else {
- for (k = frag1->start;
- k < frag1->start + frag1->len &&
- frag0->xMin >= 0.5 * (frag1->line->edge[k] +
- frag1->line->edge[k+1]);
- ++k) ;
- col2 = frag1->col +
- frag1->line->col[k] - frag1->line->col[frag1->start];
- }
- break;
- case 1:
- if (frag0->yMin >= frag1->yMax) {
- col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
- frag1->line->col[frag1->start]) + 1;
- } else {
- for (k = frag1->start;
- k < frag1->start + frag1->len &&
- frag0->yMin >= 0.5 * (frag1->line->edge[k] +
- frag1->line->edge[k+1]);
- ++k) ;
- col2 = frag1->col +
- frag1->line->col[k] - frag1->line->col[frag1->start];
- }
- break;
- case 2:
- if (frag0->xMax <= frag1->xMin) {
- col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
- frag1->line->col[frag1->start]) + 1;
- } else {
- for (k = frag1->start;
- k < frag1->start + frag1->len &&
- frag0->xMax <= 0.5 * (frag1->line->edge[k] +
- frag1->line->edge[k+1]);
- ++k) ;
- col2 = frag1->col +
- frag1->line->col[k] - frag1->line->col[frag1->start];
- }
- break;
- case 3:
- if (frag0->yMax <= frag1->yMin) {
- col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
- frag1->line->col[frag1->start]) + 1;
- } else {
- for (k = frag1->start;
- k < frag1->start + frag1->len &&
- frag0->yMax <= 0.5 * (frag1->line->edge[k] +
- frag1->line->edge[k+1]);
- ++k) ;
- col2 = frag1->col +
- frag1->line->col[k] - frag1->line->col[frag1->start];
- }
- break;
- }
- if (col2 > col1) {
- col1 = col2;
- }
- }
- frag0->col = col1;
- }
-
- // the region includes text at different rotations -- use the
- // globally assigned column numbers, offset by the minimum column
- // number (i.e., shift everything over to column 0)
- } else {
- col1 = frags[0].col;
- for (i = 1; i < nFrags; ++i) {
- if (frags[i].col < col1) {
- col1 = frags[i].col;
- }
- }
- for (i = 0; i < nFrags; ++i) {
- frags[i].col -= col1;
- }
- }
-}
-
-int TextPage::dumpFragment(Unicode *text, int len, UnicodeMap *uMap,
- GString *s) {
- char lre[8], rle[8], popdf[8], buf[8];
- int lreLen, rleLen, popdfLen, n;
- int nCols, i, j, k;
-
- nCols = 0;
-
- if (uMap->isUnicode()) {
-
- lreLen = uMap->mapUnicode(0x202a, lre, sizeof(lre));
- rleLen = uMap->mapUnicode(0x202b, rle, sizeof(rle));
- popdfLen = uMap->mapUnicode(0x202c, popdf, sizeof(popdf));
-
- if (primaryLR) {
-
- i = 0;
- while (i < len) {
- // output a left-to-right section
- for (j = i; j < len && !unicodeTypeR(text[j]); ++j) ;
- for (k = i; k < j; ++k) {
- n = uMap->mapUnicode(text[k], buf, sizeof(buf));
- s->append(buf, n);
- ++nCols;
- }
- i = j;
- // output a right-to-left section
- for (j = i; j < len && !unicodeTypeL(text[j]); ++j) ;
- if (j > i) {
- s->append(rle, rleLen);
- for (k = j - 1; k >= i; --k) {
- n = uMap->mapUnicode(text[k], buf, sizeof(buf));
- s->append(buf, n);
- ++nCols;
- }
- s->append(popdf, popdfLen);
- i = j;
- }
- }
-
- } else {
-
- s->append(rle, rleLen);
- i = len - 1;
- while (i >= 0) {
- // output a right-to-left section
- for (j = i; j >= 0 && !unicodeTypeL(text[j]); --j) ;
- for (k = i; k > j; --k) {
- n = uMap->mapUnicode(text[k], buf, sizeof(buf));
- s->append(buf, n);
- ++nCols;
- }
- i = j;
- // output a left-to-right section
- for (j = i; j >= 0 && !unicodeTypeR(text[j]); --j) ;
- if (j < i) {
- s->append(lre, lreLen);
- for (k = j + 1; k <= i; ++k) {
- n = uMap->mapUnicode(text[k], buf, sizeof(buf));
- s->append(buf, n);
- ++nCols;
- }
- s->append(popdf, popdfLen);
- i = j;
- }
- }
- s->append(popdf, popdfLen);
-
- }
-
- } else {
- for (i = 0; i < len; ++i) {
- n = uMap->mapUnicode(text[i], buf, sizeof(buf));
- s->append(buf, n);
- nCols += n;
- }
- }
-
- return nCols;
-}
-
-#if TEXTOUT_WORD_LIST
-TextWordList *TextPage::makeWordList(GBool physLayout) {
- return new TextWordList(this, physLayout);
-}
-#endif
-
-//------------------------------------------------------------------------
-// TextOutputDev
-//------------------------------------------------------------------------
-
-static void TextOutputDev_outputToFile(void *stream, char *text, int len) {
- fwrite(text, 1, len, (FILE *)stream);
-}
-
-TextOutputDev::TextOutputDev(char *fileName, GBool physLayoutA,
- GBool rawOrderA, GBool append) {
- text = NULL;
- physLayout = physLayoutA;
- rawOrder = rawOrderA;
- doHTML = gFalse;
- ok = gTrue;
-
- // open file
- needClose = gFalse;
- if (fileName) {
- if (!strcmp(fileName, "-")) {
- outputStream = stdout;
-#ifdef WIN32
- // keep DOS from munging the end-of-line characters
- setmode(fileno(stdout), O_BINARY);
-#endif
- } else if ((outputStream = fopen(fileName, append ? "ab" : "wb"))) {
- needClose = gTrue;
- } else {
- error(-1, "Couldn't open text file '%s'", fileName);
- ok = gFalse;
- return;
- }
- outputFunc = &TextOutputDev_outputToFile;
- } else {
- outputStream = NULL;
- }
-
- // set up text object
- text = new TextPage(rawOrderA);
-}
-
-TextOutputDev::TextOutputDev(TextOutputFunc func, void *stream,
- GBool physLayoutA, GBool rawOrderA) {
- outputFunc = func;
- outputStream = stream;
- needClose = gFalse;
- physLayout = physLayoutA;
- rawOrder = rawOrderA;
- doHTML = gFalse;
- text = new TextPage(rawOrderA);
- ok = gTrue;
-}
-
-TextOutputDev::~TextOutputDev() {
- if (needClose) {
-#ifdef MACOS
- ICS_MapRefNumAndAssign((short)((FILE *)outputStream)->handle);
-#endif
- fclose((FILE *)outputStream);
- }
- if (text) {
- delete text;
- }
-}
-
-void TextOutputDev::startPage(int /*pageNum*/, GfxState *state) {
- text->startPage(state);
-}
-
-void TextOutputDev::endPage() {
- text->endPage();
- text->coalesce(physLayout, doHTML);
- if (outputStream) {
- text->dump(outputStream, outputFunc, physLayout);
- }
-}
-
-void TextOutputDev::updateFont(GfxState *state) {
- text->updateFont(state);
-}
-
-void TextOutputDev::beginString(GfxState * /*state*/, GString * /*s*/) {
-}
-
-void TextOutputDev::endString(GfxState * /*state*/) {
-}
-
-void TextOutputDev::drawChar(GfxState *state, double x, double y,
- double dx, double dy,
- double /*originX*/, double /*originY*/,
- CharCode c, int nBytes, Unicode *u, int uLen) {
- text->addChar(state, x, y, dx, dy, c, nBytes, u, uLen);
-}
-
-void TextOutputDev::stroke(GfxState *state) {
- GfxPath *path;
- GfxSubpath *subpath;
- double x[2], y[2];
-
- if (!doHTML) {
- return;
- }
- path = state->getPath();
- if (path->getNumSubpaths() != 1) {
- return;
- }
- subpath = path->getSubpath(0);
- if (subpath->getNumPoints() != 2) {
- return;
- }
- state->transform(subpath->getX(0), subpath->getY(0), &x[0], &y[0]);
- state->transform(subpath->getX(1), subpath->getY(1), &x[1], &y[1]);
-
- // look for a vertical or horizontal line
- if (x[0] == x[1] || y[0] == y[1]) {
- text->addUnderline(x[0], y[0], x[1], y[1]);
- }
-}
-
-void TextOutputDev::fill(GfxState *state) {
- GfxPath *path;
- GfxSubpath *subpath;
- double x[5], y[5];
- double rx0, ry0, rx1, ry1, t;
- int i;
-
- if (!doHTML) {
- return;
- }
- path = state->getPath();
- if (path->getNumSubpaths() != 1) {
- return;
- }
- subpath = path->getSubpath(0);
- if (subpath->getNumPoints() != 5) {
- return;
- }
- for (i = 0; i < 5; ++i) {
- if (subpath->getCurve(i)) {
- return;
- }
- state->transform(subpath->getX(i), subpath->getY(i), &x[i], &y[i]);
- }
-
- // look for a rectangle
- if (x[0] == x[1] && y[1] == y[2] && x[2] == x[3] && y[3] == y[4] &&
- x[0] == x[4] && y[0] == y[4]) {
- rx0 = x[0];
- ry0 = y[0];
- rx1 = x[2];
- ry1 = y[1];
- } else if (y[0] == y[1] && x[1] == x[2] && y[2] == y[3] && x[3] == x[4] &&
- x[0] == x[4] && y[0] == y[4]) {
- rx0 = x[0];
- ry0 = y[0];
- rx1 = x[1];
- ry1 = y[2];
- } else {
- return;
- }
- if (rx1 < rx0) {
- t = rx0;
- rx0 = rx1;
- rx1 = t;
- }
- if (ry1 < ry0) {
- t = ry0;
- ry0 = ry1;
- ry1 = t;
- }
-
- // skinny horizontal rectangle
- if (ry1 - ry0 < rx1 - rx0) {
- if (ry1 - ry0 < maxUnderlineWidth) {
- ry0 = 0.5 * (ry0 + ry1);
- text->addUnderline(rx0, ry0, rx1, ry0);
- }
-
- // skinny vertical rectangle
- } else {
- if (rx1 - rx0 < maxUnderlineWidth) {
- rx0 = 0.5 * (rx0 + rx1);
- text->addUnderline(rx0, ry0, rx0, ry1);
- }
- }
-}
-
-void TextOutputDev::eoFill(GfxState *state) {
- if (!doHTML) {
- return;
- }
- fill(state);
-}
-
-void TextOutputDev::processLink(Link *link, Catalog * /*catalog*/) {
- double x1, y1, x2, y2;
- int xMin, yMin, xMax, yMax, x, y;
-
- if (!doHTML) {
- return;
- }
- link->getRect(&x1, &y1, &x2, &y2);
- cvtUserToDev(x1, y1, &x, &y);
- xMin = xMax = x;
- yMin = yMax = y;
- cvtUserToDev(x1, y2, &x, &y);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- cvtUserToDev(x2, y1, &x, &y);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- cvtUserToDev(x2, y2, &x, &y);
- if (x < xMin) {
- xMin = x;
- } else if (x > xMax) {
- xMax = x;
- }
- if (y < yMin) {
- yMin = y;
- } else if (y > yMax) {
- yMax = y;
- }
- text->addLink(xMin, yMin, xMax, yMax, link);
-}
-
-GBool TextOutputDev::findText(Unicode *s, int len,
- GBool startAtTop, GBool stopAtBottom,
- GBool startAtLast, GBool stopAtLast,
- GBool caseSensitive, GBool backward,
- double *xMin, double *yMin,
- double *xMax, double *yMax) {
- return text->findText(s, len, startAtTop, stopAtBottom,
- startAtLast, stopAtLast, caseSensitive, backward,
- xMin, yMin, xMax, yMax);
-}
-
-GString *TextOutputDev::getText(double xMin, double yMin,
- double xMax, double yMax) {
- return text->getText(xMin, yMin, xMax, yMax);
-}
-
-GBool TextOutputDev::findCharRange(int pos, int length,
- double *xMin, double *yMin,
- double *xMax, double *yMax) {
- return text->findCharRange(pos, length, xMin, yMin, xMax, yMax);
-}
-
-#if TEXTOUT_WORD_LIST
-TextWordList *TextOutputDev::makeWordList() {
- return text->makeWordList(physLayout);
-}
-#endif
-
-TextPage *TextOutputDev::takeText() {
- TextPage *ret;
-
- ret = text;
- text = new TextPage(rawOrder);
- return ret;
-}
diff --git a/kpdf/xpdf/xpdf/TextOutputDev.cpp b/kpdf/xpdf/xpdf/TextOutputDev.cpp
new file mode 100644
index 00000000..3387a31a
--- /dev/null
+++ b/kpdf/xpdf/xpdf/TextOutputDev.cpp
@@ -0,0 +1,4090 @@
+//========================================================================
+//
+// TextOutputDev.cpp
+//
+// Copyright 1997-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <math.h>
+#include <ctype.h>
+#ifdef WIN32
+#include <fcntl.h> // for O_BINARY
+#include <io.h> // for setmode
+#endif
+#include "gmem.h"
+#include "GString.h"
+#include "GList.h"
+#include "config.h"
+#include "Error.h"
+#include "GlobalParams.h"
+#include "UnicodeMap.h"
+#include "UnicodeTypeTable.h"
+#include "GfxState.h"
+#include "Link.h"
+#include "TextOutputDev.h"
+
+#ifdef MACOS
+// needed for setting type/creator of MacOS files
+#include "ICSupport.h"
+#endif
+
+//------------------------------------------------------------------------
+// parameters
+//------------------------------------------------------------------------
+
+// Each bucket in a text pool includes baselines within a range of
+// this many points.
+#define textPoolStep 4
+
+// Inter-character space width which will cause addChar to start a new
+// word.
+#define minWordBreakSpace 0.1
+
+// Negative inter-character space width, i.e., overlap, which will
+// cause addChar to start a new word.
+#define minDupBreakOverlap 0.2
+
+// Max distance between baselines of two lines within a block, as a
+// fraction of the font size.
+#define maxLineSpacingDelta 1.5
+
+// Max difference in primary font sizes on two lines in the same
+// block. Delta1 is used when examining new lines above and below the
+// current block; delta2 is used when examining text that overlaps the
+// current block; delta3 is used when examining text to the left and
+// right of the current block.
+#define maxBlockFontSizeDelta1 0.05
+#define maxBlockFontSizeDelta2 0.6
+#define maxBlockFontSizeDelta3 0.2
+
+// Max difference in font sizes inside a word.
+#define maxWordFontSizeDelta 0.05
+
+// Maximum distance between baselines of two words on the same line,
+// e.g., distance between subscript or superscript and the primary
+// baseline, as a fraction of the font size.
+#define maxIntraLineDelta 0.5
+
+// Minimum inter-word spacing, as a fraction of the font size. (Only
+// used for raw ordering.)
+#define minWordSpacing 0.15
+
+// Maximum inter-word spacing, as a fraction of the font size.
+#define maxWordSpacing 1.5
+
+// Maximum horizontal spacing which will allow a word to be pulled
+// into a block.
+#define minColSpacing1 0.3
+
+// Minimum spacing between columns, as a fraction of the font size.
+#define minColSpacing2 1.0
+
+// Maximum vertical spacing between blocks within a flow, as a
+// multiple of the font size.
+#define maxBlockSpacing 2.5
+
+// Minimum spacing between characters within a word, as a fraction of
+// the font size.
+#define minCharSpacing -0.2
+
+// Maximum spacing between characters within a word, as a fraction of
+// the font size, when there is no obvious extra-wide character
+// spacing.
+#define maxCharSpacing 0.03
+
+// When extra-wide character spacing is detected, the inter-character
+// space threshold is set to the minimum inter-character space
+// multiplied by this constant.
+#define maxWideCharSpacingMul 1.3
+
+// Upper limit on spacing between characters in a word.
+#define maxWideCharSpacing 0.4
+
+// Max difference in primary,secondary coordinates (as a fraction of
+// the font size) allowed for duplicated text (fake boldface, drop
+// shadows) which is to be discarded.
+#define dupMaxPriDelta 0.1
+#define dupMaxSecDelta 0.2
+
+// Max width of underlines (in points).
+#define maxUnderlineWidth 3
+
+// Min distance between baseline and underline (in points).
+//~ this should be font-size-dependent
+#define minUnderlineGap -2
+
+// Max distance between baseline and underline (in points).
+//~ this should be font-size-dependent
+#define maxUnderlineGap 4
+
+// Max horizontal distance between edge of word and start of underline
+// (in points).
+//~ this should be font-size-dependent
+#define underlineSlack 1
+
+// Max distance between edge of text and edge of link border
+#define hyperlinkSlack 2
+
+//------------------------------------------------------------------------
+// TextUnderline
+//------------------------------------------------------------------------
+
+class TextUnderline {
+public:
+
+ TextUnderline(double x0A, double y0A, double x1A, double y1A)
+ { x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; horiz = y0 == y1; }
+ ~TextUnderline() {}
+
+ double x0, y0, x1, y1;
+ GBool horiz;
+};
+
+//------------------------------------------------------------------------
+// TextLink
+//------------------------------------------------------------------------
+
+class TextLink {
+public:
+
+ TextLink(int xMinA, int yMinA, int xMaxA, int yMaxA, Link *linkA)
+ { xMin = xMinA; yMin = yMinA; xMax = xMaxA; yMax = yMaxA; link = linkA; }
+ ~TextLink() {}
+
+ int xMin, yMin, xMax, yMax;
+ Link *link;
+};
+
+//------------------------------------------------------------------------
+// TextFontInfo
+//------------------------------------------------------------------------
+
+TextFontInfo::TextFontInfo(GfxState *state) {
+ gfxFont = state->getFont();
+#if TEXTOUT_WORD_LIST
+ fontName = (gfxFont && gfxFont->getOrigName())
+ ? gfxFont->getOrigName()->copy()
+ : (GString *)NULL;
+ flags = gfxFont ? gfxFont->getFlags() : 0;
+#endif
+}
+
+TextFontInfo::~TextFontInfo() {
+#if TEXTOUT_WORD_LIST
+ if (fontName) {
+ delete fontName;
+ }
+#endif
+}
+
+GBool TextFontInfo::matches(GfxState *state) {
+ return state->getFont() == gfxFont;
+}
+
+//------------------------------------------------------------------------
+// TextWord
+//------------------------------------------------------------------------
+
+TextWord::TextWord(GfxState *state, int rotA, double x0, double y0,
+ int charPosA, TextFontInfo *fontA, double fontSizeA) {
+ GfxFont *gfxFont;
+ double x, y, ascent, descent;
+
+ rot = rotA;
+ charPos = charPosA;
+ charLen = 0;
+ font = fontA;
+ fontSize = fontSizeA;
+ state->transform(x0, y0, &x, &y);
+ if ((gfxFont = font->gfxFont)) {
+ ascent = gfxFont->getAscent() * fontSize;
+ descent = gfxFont->getDescent() * fontSize;
+ } else {
+ // this means that the PDF file draws text without a current font,
+ // which should never happen
+ ascent = 0.95 * fontSize;
+ descent = -0.35 * fontSize;
+ }
+ switch (rot) {
+ case 0:
+ yMin = y - ascent;
+ yMax = y - descent;
+ if (yMin == yMax) {
+ // this is a sanity check for a case that shouldn't happen -- but
+ // if it does happen, we want to avoid dividing by zero later
+ yMin = y;
+ yMax = y + 1;
+ }
+ base = y;
+ break;
+ case 1:
+ xMin = x + descent;
+ xMax = x + ascent;
+ if (xMin == xMax) {
+ // this is a sanity check for a case that shouldn't happen -- but
+ // if it does happen, we want to avoid dividing by zero later
+ xMin = x;
+ xMax = x + 1;
+ }
+ base = x;
+ break;
+ case 2:
+ yMin = y + descent;
+ yMax = y + ascent;
+ if (yMin == yMax) {
+ // this is a sanity check for a case that shouldn't happen -- but
+ // if it does happen, we want to avoid dividing by zero later
+ yMin = y;
+ yMax = y + 1;
+ }
+ base = y;
+ break;
+ case 3:
+ xMin = x - ascent;
+ xMax = x - descent;
+ if (xMin == xMax) {
+ // this is a sanity check for a case that shouldn't happen -- but
+ // if it does happen, we want to avoid dividing by zero later
+ xMin = x;
+ xMax = x + 1;
+ }
+ base = x;
+ break;
+ }
+ text = NULL;
+ edge = NULL;
+ len = size = 0;
+ spaceAfter = gFalse;
+ next = NULL;
+
+#if TEXTOUT_WORD_LIST
+ GfxRGB rgb;
+
+ if ((state->getRender() & 3) == 1) {
+ state->getStrokeRGB(&rgb);
+ } else {
+ state->getFillRGB(&rgb);
+ }
+ colorR = colToDbl(rgb.r);
+ colorG = colToDbl(rgb.g);
+ colorB = colToDbl(rgb.b);
+#endif
+
+ underlined = gFalse;
+ link = NULL;
+}
+
+TextWord::~TextWord() {
+ gfree(text);
+ gfree(edge);
+}
+
+void TextWord::addChar(GfxState * /*state*/, double x, double y,
+ double dx, double dy, Unicode u) {
+ if (len == size) {
+ size += 16;
+ text = (Unicode *)greallocn(text, size, sizeof(Unicode));
+ edge = (double *)greallocn(edge, size + 1, sizeof(double));
+ }
+ text[len] = u;
+ switch (rot) {
+ case 0:
+ if (len == 0) {
+ xMin = x;
+ }
+ edge[len] = x;
+ xMax = edge[len+1] = x + dx;
+ break;
+ case 1:
+ if (len == 0) {
+ yMin = y;
+ }
+ edge[len] = y;
+ yMax = edge[len+1] = y + dy;
+ break;
+ case 2:
+ if (len == 0) {
+ xMax = x;
+ }
+ edge[len] = x;
+ xMin = edge[len+1] = x + dx;
+ break;
+ case 3:
+ if (len == 0) {
+ yMax = y;
+ }
+ edge[len] = y;
+ yMin = edge[len+1] = y + dy;
+ break;
+ }
+ ++len;
+}
+
+void TextWord::merge(TextWord *word) {
+ int i;
+
+ if (word->xMin < xMin) {
+ xMin = word->xMin;
+ }
+ if (word->yMin < yMin) {
+ yMin = word->yMin;
+ }
+ if (word->xMax > xMax) {
+ xMax = word->xMax;
+ }
+ if (word->yMax > yMax) {
+ yMax = word->yMax;
+ }
+ if (len + word->len > size) {
+ size = len + word->len;
+ text = (Unicode *)greallocn(text, size, sizeof(Unicode));
+ edge = (double *)greallocn(edge, size + 1, sizeof(double));
+ }
+ for (i = 0; i < word->len; ++i) {
+ text[len + i] = word->text[i];
+ edge[len + i] = word->edge[i];
+ }
+ edge[len + word->len] = word->edge[word->len];
+ len += word->len;
+ charLen += word->charLen;
+}
+
+inline int TextWord::primaryCmp(TextWord *word) {
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ cmp = xMin - word->xMin;
+ break;
+ case 1:
+ cmp = yMin - word->yMin;
+ break;
+ case 2:
+ cmp = word->xMax - xMax;
+ break;
+ case 3:
+ cmp = word->yMax - yMax;
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+double TextWord::primaryDelta(TextWord *word) {
+ double delta;
+
+ delta = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ delta = word->xMin - xMax;
+ break;
+ case 1:
+ delta = word->yMin - yMax;
+ break;
+ case 2:
+ delta = xMin - word->xMax;
+ break;
+ case 3:
+ delta = yMin - word->yMax;
+ break;
+ }
+ return delta;
+}
+
+int TextWord::cmpYX(const void *p1, const void *p2) {
+ TextWord *word1 = *(TextWord **)p1;
+ TextWord *word2 = *(TextWord **)p2;
+ double cmp;
+
+ cmp = word1->yMin - word2->yMin;
+ if (cmp == 0) {
+ cmp = word1->xMin - word2->xMin;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+#if TEXTOUT_WORD_LIST
+
+GString *TextWord::getText() {
+ GString *s;
+ UnicodeMap *uMap;
+ char buf[8];
+ int n, i;
+
+ s = new GString();
+ if (!(uMap = globalParams->getTextEncoding())) {
+ return s;
+ }
+ for (i = 0; i < len; ++i) {
+ n = uMap->mapUnicode(text[i], buf, sizeof(buf));
+ s->append(buf, n);
+ }
+ uMap->decRefCnt();
+ return s;
+}
+
+void TextWord::getCharBBox(int charIdx, double *xMinA, double *yMinA,
+ double *xMaxA, double *yMaxA) {
+ if (charIdx < 0 || charIdx >= len) {
+ return;
+ }
+ switch (rot) {
+ case 0:
+ *xMinA = edge[charIdx];
+ *xMaxA = edge[charIdx + 1];
+ *yMinA = yMin;
+ *yMaxA = yMax;
+ break;
+ case 1:
+ *xMinA = xMin;
+ *xMaxA = xMax;
+ *yMinA = edge[charIdx];
+ *yMaxA = edge[charIdx + 1];
+ break;
+ case 2:
+ *xMinA = edge[charIdx + 1];
+ *xMaxA = edge[charIdx];
+ *yMinA = yMin;
+ *yMaxA = yMax;
+ break;
+ case 3:
+ *xMinA = xMin;
+ *xMaxA = xMax;
+ *yMinA = edge[charIdx + 1];
+ *yMaxA = edge[charIdx];
+ break;
+ }
+}
+
+#endif // TEXTOUT_WORD_LIST
+
+//------------------------------------------------------------------------
+// TextPool
+//------------------------------------------------------------------------
+
+TextPool::TextPool() {
+ minBaseIdx = 0;
+ maxBaseIdx = -1;
+ pool = NULL;
+ cursor = NULL;
+ cursorBaseIdx = -1;
+}
+
+TextPool::~TextPool() {
+ int baseIdx;
+ TextWord *word, *word2;
+
+ for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) {
+ for (word = pool[baseIdx - minBaseIdx]; word; word = word2) {
+ word2 = word->next;
+ delete word;
+ }
+ }
+ gfree(pool);
+}
+
+int TextPool::getBaseIdx(double base) {
+ int baseIdx;
+
+ baseIdx = (int)(base / textPoolStep);
+ if (baseIdx < minBaseIdx) {
+ return minBaseIdx;
+ }
+ if (baseIdx > maxBaseIdx) {
+ return maxBaseIdx;
+ }
+ return baseIdx;
+}
+
+void TextPool::addWord(TextWord *word) {
+ TextWord **newPool;
+ int wordBaseIdx, newMinBaseIdx, newMaxBaseIdx, baseIdx;
+ TextWord *w0, *w1;
+
+ // expand the array if needed
+ wordBaseIdx = (int)(word->base / textPoolStep);
+ if (minBaseIdx > maxBaseIdx) {
+ minBaseIdx = wordBaseIdx - 128;
+ maxBaseIdx = wordBaseIdx + 128;
+ pool = (TextWord **)gmallocn(maxBaseIdx - minBaseIdx + 1,
+ sizeof(TextWord *));
+ for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) {
+ pool[baseIdx - minBaseIdx] = NULL;
+ }
+ } else if (wordBaseIdx < minBaseIdx) {
+ newMinBaseIdx = wordBaseIdx - 128;
+ newPool = (TextWord **)gmallocn(maxBaseIdx - newMinBaseIdx + 1,
+ sizeof(TextWord *));
+ for (baseIdx = newMinBaseIdx; baseIdx < minBaseIdx; ++baseIdx) {
+ newPool[baseIdx - newMinBaseIdx] = NULL;
+ }
+ memcpy(&newPool[minBaseIdx - newMinBaseIdx], pool,
+ (maxBaseIdx - minBaseIdx + 1) * sizeof(TextWord *));
+ gfree(pool);
+ pool = newPool;
+ minBaseIdx = newMinBaseIdx;
+ } else if (wordBaseIdx > maxBaseIdx) {
+ newMaxBaseIdx = wordBaseIdx + 128;
+ pool = (TextWord **)greallocn(pool, newMaxBaseIdx - minBaseIdx + 1,
+ sizeof(TextWord *));
+ for (baseIdx = maxBaseIdx + 1; baseIdx <= newMaxBaseIdx; ++baseIdx) {
+ pool[baseIdx - minBaseIdx] = NULL;
+ }
+ maxBaseIdx = newMaxBaseIdx;
+ }
+
+ // insert the new word
+ if (cursor && wordBaseIdx == cursorBaseIdx &&
+ word->primaryCmp(cursor) > 0) {
+ w0 = cursor;
+ w1 = cursor->next;
+ } else {
+ w0 = NULL;
+ w1 = pool[wordBaseIdx - minBaseIdx];
+ }
+ for (; w1 && word->primaryCmp(w1) > 0; w0 = w1, w1 = w1->next) ;
+ word->next = w1;
+ if (w0) {
+ w0->next = word;
+ } else {
+ pool[wordBaseIdx - minBaseIdx] = word;
+ }
+ cursor = word;
+ cursorBaseIdx = wordBaseIdx;
+}
+
+//------------------------------------------------------------------------
+// TextLine
+//------------------------------------------------------------------------
+
+TextLine::TextLine(TextBlock *blkA, int rotA, double baseA) {
+ blk = blkA;
+ rot = rotA;
+ xMin = yMin = 0;
+ xMax = yMax = -1;
+ base = baseA;
+ words = lastWord = NULL;
+ text = NULL;
+ edge = NULL;
+ col = NULL;
+ len = 0;
+ convertedLen = 0;
+ hyphenated = gFalse;
+ next = NULL;
+}
+
+TextLine::~TextLine() {
+ TextWord *word;
+
+ while (words) {
+ word = words;
+ words = words->next;
+ delete word;
+ }
+ gfree(text);
+ gfree(edge);
+ gfree(col);
+}
+
+void TextLine::addWord(TextWord *word) {
+ if (lastWord) {
+ lastWord->next = word;
+ } else {
+ words = word;
+ }
+ lastWord = word;
+
+ if (xMin > xMax) {
+ xMin = word->xMin;
+ xMax = word->xMax;
+ yMin = word->yMin;
+ yMax = word->yMax;
+ } else {
+ if (word->xMin < xMin) {
+ xMin = word->xMin;
+ }
+ if (word->xMax > xMax) {
+ xMax = word->xMax;
+ }
+ if (word->yMin < yMin) {
+ yMin = word->yMin;
+ }
+ if (word->yMax > yMax) {
+ yMax = word->yMax;
+ }
+ }
+}
+
+double TextLine::primaryDelta(TextLine *line) {
+ double delta;
+
+ delta = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ delta = line->xMin - xMax;
+ break;
+ case 1:
+ delta = line->yMin - yMax;
+ break;
+ case 2:
+ delta = xMin - line->xMax;
+ break;
+ case 3:
+ delta = yMin - line->yMax;
+ break;
+ }
+ return delta;
+}
+
+int TextLine::primaryCmp(TextLine *line) {
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ cmp = xMin - line->xMin;
+ break;
+ case 1:
+ cmp = yMin - line->yMin;
+ break;
+ case 2:
+ cmp = line->xMax - xMax;
+ break;
+ case 3:
+ cmp = line->yMax - yMax;
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextLine::secondaryCmp(TextLine *line) {
+ double cmp;
+
+ cmp = (rot == 0 || rot == 3) ? base - line->base : line->base - base;
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextLine::cmpYX(TextLine *line) {
+ int cmp;
+
+ if ((cmp = secondaryCmp(line))) {
+ return cmp;
+ }
+ return primaryCmp(line);
+}
+
+int TextLine::cmpXY(const void *p1, const void *p2) {
+ TextLine *line1 = *(TextLine **)p1;
+ TextLine *line2 = *(TextLine **)p2;
+ int cmp;
+
+ if ((cmp = line1->primaryCmp(line2))) {
+ return cmp;
+ }
+ return line1->secondaryCmp(line2);
+}
+
+void TextLine::coalesce(UnicodeMap *uMap) {
+ TextWord *word0, *word1;
+ double space, delta, minSpace;
+ GBool isUnicode;
+ char buf[8];
+ int i, j;
+
+ if (words->next) {
+
+ // compute the inter-word space threshold
+ if (words->len > 1 || words->next->len > 1) {
+ minSpace = 0;
+ } else {
+ minSpace = words->primaryDelta(words->next);
+ for (word0 = words->next, word1 = word0->next;
+ word1 && minSpace > 0;
+ word0 = word1, word1 = word0->next) {
+ if (word1->len > 1) {
+ minSpace = 0;
+ }
+ delta = word0->primaryDelta(word1);
+ if (delta < minSpace) {
+ minSpace = delta;
+ }
+ }
+ }
+ if (minSpace <= 0) {
+ space = maxCharSpacing * words->fontSize;
+ } else {
+ space = maxWideCharSpacingMul * minSpace;
+ if (space > maxWideCharSpacing * words->fontSize) {
+ space = maxWideCharSpacing * words->fontSize;
+ }
+ }
+
+ // merge words
+ word0 = words;
+ word1 = words->next;
+ while (word1) {
+ if (word0->primaryDelta(word1) >= space) {
+ word0->spaceAfter = gTrue;
+ word0 = word1;
+ word1 = word1->next;
+ } else if (word0->font == word1->font &&
+ word0->underlined == word1->underlined &&
+ fabs(word0->fontSize - word1->fontSize) <
+ maxWordFontSizeDelta * words->fontSize &&
+ word1->charPos == word0->charPos + word0->charLen) {
+ word0->merge(word1);
+ word0->next = word1->next;
+ delete word1;
+ word1 = word0->next;
+ } else {
+ word0 = word1;
+ word1 = word1->next;
+ }
+ }
+ }
+
+ // build the line text
+ isUnicode = uMap ? uMap->isUnicode() : gFalse;
+ len = 0;
+ for (word1 = words; word1; word1 = word1->next) {
+ len += word1->len;
+ if (word1->spaceAfter) {
+ ++len;
+ }
+ }
+ text = (Unicode *)gmallocn(len, sizeof(Unicode));
+ edge = (double *)gmallocn(len + 1, sizeof(double));
+ i = 0;
+ for (word1 = words; word1; word1 = word1->next) {
+ for (j = 0; j < word1->len; ++j) {
+ text[i] = word1->text[j];
+ edge[i] = word1->edge[j];
+ ++i;
+ }
+ edge[i] = word1->edge[word1->len];
+ if (word1->spaceAfter) {
+ text[i] = (Unicode)0x0020;
+ ++i;
+ }
+ }
+
+ // compute convertedLen and set up the col array
+ col = (int *)gmallocn(len + 1, sizeof(int));
+ convertedLen = 0;
+ for (i = 0; i < len; ++i) {
+ col[i] = convertedLen;
+ if (isUnicode) {
+ ++convertedLen;
+ } else if (uMap) {
+ convertedLen += uMap->mapUnicode(text[i], buf, sizeof(buf));
+ }
+ }
+ col[len] = convertedLen;
+
+ // check for hyphen at end of line
+ //~ need to check for other chars used as hyphens
+ hyphenated = text[len - 1] == (Unicode)'-';
+}
+
+//------------------------------------------------------------------------
+// TextLineFrag
+//------------------------------------------------------------------------
+
+class TextLineFrag {
+public:
+
+ TextLine *line; // the line object
+ int start, len; // offset and length of this fragment
+ // (in Unicode chars)
+ double xMin, xMax; // bounding box coordinates
+ double yMin, yMax;
+ double base; // baseline virtual coordinate
+ int col; // first column
+
+ void init(TextLine *lineA, int startA, int lenA);
+ void computeCoords(GBool oneRot);
+
+ static int cmpYXPrimaryRot(const void *p1, const void *p2);
+ static int cmpYXLineRot(const void *p1, const void *p2);
+ static int cmpXYLineRot(const void *p1, const void *p2);
+ static int cmpXYColumnPrimaryRot(const void *p1, const void *p2);
+ static int cmpXYColumnLineRot(const void *p1, const void *p2);
+};
+
+void TextLineFrag::init(TextLine *lineA, int startA, int lenA) {
+ line = lineA;
+ start = startA;
+ len = lenA;
+ col = line->col[start];
+}
+
+void TextLineFrag::computeCoords(GBool oneRot) {
+ TextBlock *blk;
+ double d0, d1, d2, d3, d4;
+
+ if (oneRot) {
+
+ switch (line->rot) {
+ case 0:
+ xMin = line->edge[start];
+ xMax = line->edge[start + len];
+ yMin = line->yMin;
+ yMax = line->yMax;
+ break;
+ case 1:
+ xMin = line->xMin;
+ xMax = line->xMax;
+ yMin = line->edge[start];
+ yMax = line->edge[start + len];
+ break;
+ case 2:
+ xMin = line->edge[start + len];
+ xMax = line->edge[start];
+ yMin = line->yMin;
+ yMax = line->yMax;
+ break;
+ case 3:
+ xMin = line->xMin;
+ xMax = line->xMax;
+ yMin = line->edge[start + len];
+ yMax = line->edge[start];
+ break;
+ }
+ base = line->base;
+
+ } else {
+
+ if (line->rot == 0 && line->blk->page->primaryRot == 0) {
+
+ xMin = line->edge[start];
+ xMax = line->edge[start + len];
+ yMin = line->yMin;
+ yMax = line->yMax;
+ base = line->base;
+
+ } else {
+
+ blk = line->blk;
+ d0 = line->edge[start];
+ d1 = line->edge[start + len];
+ d2 = d3 = d4 = 0; // make gcc happy
+
+ switch (line->rot) {
+ case 0:
+ d2 = line->yMin;
+ d3 = line->yMax;
+ d4 = line->base;
+ d0 = (d0 - blk->xMin) / (blk->xMax - blk->xMin);
+ d1 = (d1 - blk->xMin) / (blk->xMax - blk->xMin);
+ d2 = (d2 - blk->yMin) / (blk->yMax - blk->yMin);
+ d3 = (d3 - blk->yMin) / (blk->yMax - blk->yMin);
+ d4 = (d4 - blk->yMin) / (blk->yMax - blk->yMin);
+ break;
+ case 1:
+ d2 = line->xMax;
+ d3 = line->xMin;
+ d4 = line->base;
+ d0 = (d0 - blk->yMin) / (blk->yMax - blk->yMin);
+ d1 = (d1 - blk->yMin) / (blk->yMax - blk->yMin);
+ d2 = (blk->xMax - d2) / (blk->xMax - blk->xMin);
+ d3 = (blk->xMax - d3) / (blk->xMax - blk->xMin);
+ d4 = (blk->xMax - d4) / (blk->xMax - blk->xMin);
+ break;
+ case 2:
+ d2 = line->yMax;
+ d3 = line->yMin;
+ d4 = line->base;
+ d0 = (blk->xMax - d0) / (blk->xMax - blk->xMin);
+ d1 = (blk->xMax - d1) / (blk->xMax - blk->xMin);
+ d2 = (blk->yMax - d2) / (blk->yMax - blk->yMin);
+ d3 = (blk->yMax - d3) / (blk->yMax - blk->yMin);
+ d4 = (blk->yMax - d4) / (blk->yMax - blk->yMin);
+ break;
+ case 3:
+ d2 = line->xMin;
+ d3 = line->xMax;
+ d4 = line->base;
+ d0 = (blk->yMax - d0) / (blk->yMax - blk->yMin);
+ d1 = (blk->yMax - d1) / (blk->yMax - blk->yMin);
+ d2 = (d2 - blk->xMin) / (blk->xMax - blk->xMin);
+ d3 = (d3 - blk->xMin) / (blk->xMax - blk->xMin);
+ d4 = (d4 - blk->xMin) / (blk->xMax - blk->xMin);
+ break;
+ }
+
+ switch (line->blk->page->primaryRot) {
+ case 0:
+ xMin = blk->xMin + d0 * (blk->xMax - blk->xMin);
+ xMax = blk->xMin + d1 * (blk->xMax - blk->xMin);
+ yMin = blk->yMin + d2 * (blk->yMax - blk->yMin);
+ yMax = blk->yMin + d3 * (blk->yMax - blk->yMin);
+ base = blk->yMin + base * (blk->yMax - blk->yMin);
+ break;
+ case 1:
+ xMin = blk->xMax - d3 * (blk->xMax - blk->xMin);
+ xMax = blk->xMax - d2 * (blk->xMax - blk->xMin);
+ yMin = blk->yMin + d0 * (blk->yMax - blk->yMin);
+ yMax = blk->yMin + d1 * (blk->yMax - blk->yMin);
+ base = blk->xMax - d4 * (blk->xMax - blk->xMin);
+ break;
+ case 2:
+ xMin = blk->xMax - d1 * (blk->xMax - blk->xMin);
+ xMax = blk->xMax - d0 * (blk->xMax - blk->xMin);
+ yMin = blk->yMax - d3 * (blk->yMax - blk->yMin);
+ yMax = blk->yMax - d2 * (blk->yMax - blk->yMin);
+ base = blk->yMax - d4 * (blk->yMax - blk->yMin);
+ break;
+ case 3:
+ xMin = blk->xMin + d2 * (blk->xMax - blk->xMin);
+ xMax = blk->xMin + d3 * (blk->xMax - blk->xMin);
+ yMin = blk->yMax - d1 * (blk->yMax - blk->yMin);
+ yMax = blk->yMax - d0 * (blk->yMax - blk->yMin);
+ base = blk->xMin + d4 * (blk->xMax - blk->xMin);
+ break;
+ }
+
+ }
+ }
+}
+
+int TextLineFrag::cmpYXPrimaryRot(const void *p1, const void *p2) {
+ TextLineFrag *frag1 = (TextLineFrag *)p1;
+ TextLineFrag *frag2 = (TextLineFrag *)p2;
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (frag1->line->blk->page->primaryRot) {
+ case 0:
+ if (fabs(cmp = frag1->yMin - frag2->yMin) < 0.01) {
+ cmp = frag1->xMin - frag2->xMin;
+ }
+ break;
+ case 1:
+ if (fabs(cmp = frag2->xMax - frag1->xMax) < 0.01) {
+ cmp = frag1->yMin - frag2->yMin;
+ }
+ break;
+ case 2:
+ if (fabs(cmp = frag2->yMin - frag1->yMin) < 0.01) {
+ cmp = frag2->xMax - frag1->xMax;
+ }
+ break;
+ case 3:
+ if (fabs(cmp = frag1->xMax - frag2->xMax) < 0.01) {
+ cmp = frag2->yMax - frag1->yMax;
+ }
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextLineFrag::cmpYXLineRot(const void *p1, const void *p2) {
+ TextLineFrag *frag1 = (TextLineFrag *)p1;
+ TextLineFrag *frag2 = (TextLineFrag *)p2;
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (frag1->line->rot) {
+ case 0:
+ if ((cmp = frag1->yMin - frag2->yMin) == 0) {
+ cmp = frag1->xMin - frag2->xMin;
+ }
+ break;
+ case 1:
+ if ((cmp = frag2->xMax - frag1->xMax) == 0) {
+ cmp = frag1->yMin - frag2->yMin;
+ }
+ break;
+ case 2:
+ if ((cmp = frag2->yMin - frag1->yMin) == 0) {
+ cmp = frag2->xMax - frag1->xMax;
+ }
+ break;
+ case 3:
+ if ((cmp = frag1->xMax - frag2->xMax) == 0) {
+ cmp = frag2->yMax - frag1->yMax;
+ }
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextLineFrag::cmpXYLineRot(const void *p1, const void *p2) {
+ TextLineFrag *frag1 = (TextLineFrag *)p1;
+ TextLineFrag *frag2 = (TextLineFrag *)p2;
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (frag1->line->rot) {
+ case 0:
+ if ((cmp = frag1->xMin - frag2->xMin) == 0) {
+ cmp = frag1->yMin - frag2->yMin;
+ }
+ break;
+ case 1:
+ if ((cmp = frag1->yMin - frag2->yMin) == 0) {
+ cmp = frag2->xMax - frag1->xMax;
+ }
+ break;
+ case 2:
+ if ((cmp = frag2->xMax - frag1->xMax) == 0) {
+ cmp = frag2->yMin - frag1->yMin;
+ }
+ break;
+ case 3:
+ if ((cmp = frag2->yMax - frag1->yMax) == 0) {
+ cmp = frag1->xMax - frag2->xMax;
+ }
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextLineFrag::cmpXYColumnPrimaryRot(const void *p1, const void *p2) {
+ TextLineFrag *frag1 = (TextLineFrag *)p1;
+ TextLineFrag *frag2 = (TextLineFrag *)p2;
+ double cmp;
+
+ // if columns overlap, compare y values
+ if (frag1->col < frag2->col + (frag2->line->col[frag2->start + frag2->len] -
+ frag2->line->col[frag2->start]) &&
+ frag2->col < frag1->col + (frag1->line->col[frag1->start + frag1->len] -
+ frag1->line->col[frag1->start])) {
+ cmp = 0; // make gcc happy
+ switch (frag1->line->blk->page->primaryRot) {
+ case 0: cmp = frag1->yMin - frag2->yMin; break;
+ case 1: cmp = frag2->xMax - frag1->xMax; break;
+ case 2: cmp = frag2->yMin - frag1->yMin; break;
+ case 3: cmp = frag1->xMax - frag2->xMax; break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+ }
+
+ // otherwise, compare starting column
+ return frag1->col - frag2->col;
+}
+
+int TextLineFrag::cmpXYColumnLineRot(const void *p1, const void *p2) {
+ TextLineFrag *frag1 = (TextLineFrag *)p1;
+ TextLineFrag *frag2 = (TextLineFrag *)p2;
+ double cmp;
+
+ // if columns overlap, compare y values
+ if (frag1->col < frag2->col + (frag2->line->col[frag2->start + frag2->len] -
+ frag2->line->col[frag2->start]) &&
+ frag2->col < frag1->col + (frag1->line->col[frag1->start + frag1->len] -
+ frag1->line->col[frag1->start])) {
+ cmp = 0; // make gcc happy
+ switch (frag1->line->rot) {
+ case 0: cmp = frag1->yMin - frag2->yMin; break;
+ case 1: cmp = frag2->xMax - frag1->xMax; break;
+ case 2: cmp = frag2->yMin - frag1->yMin; break;
+ case 3: cmp = frag1->xMax - frag2->xMax; break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+ }
+
+ // otherwise, compare starting column
+ return frag1->col - frag2->col;
+}
+
+//------------------------------------------------------------------------
+// TextBlock
+//------------------------------------------------------------------------
+
+TextBlock::TextBlock(TextPage *pageA, int rotA) {
+ page = pageA;
+ rot = rotA;
+ xMin = yMin = 0;
+ xMax = yMax = -1;
+ priMin = 0;
+ priMax = page->pageWidth;
+ pool = new TextPool();
+ lines = NULL;
+ curLine = NULL;
+ next = NULL;
+ stackNext = NULL;
+}
+
+TextBlock::~TextBlock() {
+ TextLine *line;
+
+ delete pool;
+ while (lines) {
+ line = lines;
+ lines = lines->next;
+ delete line;
+ }
+}
+
+void TextBlock::addWord(TextWord *word) {
+ pool->addWord(word);
+ if (xMin > xMax) {
+ xMin = word->xMin;
+ xMax = word->xMax;
+ yMin = word->yMin;
+ yMax = word->yMax;
+ } else {
+ if (word->xMin < xMin) {
+ xMin = word->xMin;
+ }
+ if (word->xMax > xMax) {
+ xMax = word->xMax;
+ }
+ if (word->yMin < yMin) {
+ yMin = word->yMin;
+ }
+ if (word->yMax > yMax) {
+ yMax = word->yMax;
+ }
+ }
+}
+
+void TextBlock::coalesce(UnicodeMap *uMap) {
+ TextWord *word0, *word1, *word2, *bestWord0, *bestWord1, *lastWord;
+ TextLine *line, *line0, *line1;
+ int poolMinBaseIdx, startBaseIdx, minBaseIdx, maxBaseIdx;
+ int baseIdx, bestWordBaseIdx, idx0, idx1;
+ double minBase, maxBase;
+ double fontSize, delta, priDelta, secDelta;
+ TextLine **lineArray;
+ GBool found;
+ int col1, col2;
+ int i, j, k;
+
+ // discard duplicated text (fake boldface, drop shadows)
+ for (idx0 = pool->minBaseIdx; idx0 <= pool->maxBaseIdx; ++idx0) {
+ word0 = pool->getPool(idx0);
+ while (word0) {
+ priDelta = dupMaxPriDelta * word0->fontSize;
+ secDelta = dupMaxSecDelta * word0->fontSize;
+ if (rot == 0 || rot == 3) {
+ maxBaseIdx = pool->getBaseIdx(word0->base + secDelta);
+ } else {
+ maxBaseIdx = pool->getBaseIdx(word0->base - secDelta);
+ }
+ found = gFalse;
+ word1 = word2 = NULL; // make gcc happy
+ for (idx1 = idx0; idx1 <= maxBaseIdx; ++idx1) {
+ if (idx1 == idx0) {
+ word1 = word0;
+ word2 = word0->next;
+ } else {
+ word1 = NULL;
+ word2 = pool->getPool(idx1);
+ }
+ for (; word2; word1 = word2, word2 = word2->next) {
+ if (word2->len == word0->len &&
+ !memcmp(word2->text, word0->text,
+ word0->len * sizeof(Unicode))) {
+ switch (rot) {
+ case 0:
+ case 2:
+ found = fabs(word0->xMin - word2->xMin) < priDelta &&
+ fabs(word0->xMax - word2->xMax) < priDelta &&
+ fabs(word0->yMin - word2->yMin) < secDelta &&
+ fabs(word0->yMax - word2->yMax) < secDelta;
+ break;
+ case 1:
+ case 3:
+ found = fabs(word0->xMin - word2->xMin) < secDelta &&
+ fabs(word0->xMax - word2->xMax) < secDelta &&
+ fabs(word0->yMin - word2->yMin) < priDelta &&
+ fabs(word0->yMax - word2->yMax) < priDelta;
+ break;
+ }
+ }
+ if (found) {
+ break;
+ }
+ }
+ if (found) {
+ break;
+ }
+ }
+ if (found) {
+ if (word1) {
+ word1->next = word2->next;
+ } else {
+ pool->setPool(idx1, word2->next);
+ }
+ delete word2;
+ } else {
+ word0 = word0->next;
+ }
+ }
+ }
+
+ // build the lines
+ curLine = NULL;
+ poolMinBaseIdx = pool->minBaseIdx;
+ charCount = 0;
+ nLines = 0;
+ while (1) {
+
+ // find the first non-empty line in the pool
+ for (;
+ poolMinBaseIdx <= pool->maxBaseIdx && !pool->getPool(poolMinBaseIdx);
+ ++poolMinBaseIdx) ;
+ if (poolMinBaseIdx > pool->maxBaseIdx) {
+ break;
+ }
+
+ // look for the left-most word in the first four lines of the
+ // pool -- this avoids starting with a superscript word
+ startBaseIdx = poolMinBaseIdx;
+ for (baseIdx = poolMinBaseIdx + 1;
+ baseIdx < poolMinBaseIdx + 4 && baseIdx <= pool->maxBaseIdx;
+ ++baseIdx) {
+ if (!pool->getPool(baseIdx)) {
+ continue;
+ }
+ if (pool->getPool(baseIdx)->primaryCmp(pool->getPool(startBaseIdx))
+ < 0) {
+ startBaseIdx = baseIdx;
+ }
+ }
+
+ // create a new line
+ word0 = pool->getPool(startBaseIdx);
+ pool->setPool(startBaseIdx, word0->next);
+ word0->next = NULL;
+ line = new TextLine(this, word0->rot, word0->base);
+ line->addWord(word0);
+ lastWord = word0;
+
+ // compute the search range
+ fontSize = word0->fontSize;
+ minBase = word0->base - maxIntraLineDelta * fontSize;
+ maxBase = word0->base + maxIntraLineDelta * fontSize;
+ minBaseIdx = pool->getBaseIdx(minBase);
+ maxBaseIdx = pool->getBaseIdx(maxBase);
+
+ // find the rest of the words in this line
+ while (1) {
+
+ // find the left-most word whose baseline is in the range for
+ // this line
+ bestWordBaseIdx = 0;
+ bestWord0 = bestWord1 = NULL;
+ for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) {
+ for (word0 = NULL, word1 = pool->getPool(baseIdx);
+ word1;
+ word0 = word1, word1 = word1->next) {
+ if (word1->base >= minBase &&
+ word1->base <= maxBase &&
+ (delta = lastWord->primaryDelta(word1)) >=
+ minCharSpacing * fontSize) {
+ if (delta < maxWordSpacing * fontSize &&
+ (!bestWord1 || word1->primaryCmp(bestWord1) < 0)) {
+ bestWordBaseIdx = baseIdx;
+ bestWord0 = word0;
+ bestWord1 = word1;
+ }
+ break;
+ }
+ }
+ }
+ if (!bestWord1) {
+ break;
+ }
+
+ // remove it from the pool, and add it to the line
+ if (bestWord0) {
+ bestWord0->next = bestWord1->next;
+ } else {
+ pool->setPool(bestWordBaseIdx, bestWord1->next);
+ }
+ bestWord1->next = NULL;
+ line->addWord(bestWord1);
+ lastWord = bestWord1;
+ }
+
+ // add the line
+ if (curLine && line->cmpYX(curLine) > 0) {
+ line0 = curLine;
+ line1 = curLine->next;
+ } else {
+ line0 = NULL;
+ line1 = lines;
+ }
+ for (;
+ line1 && line->cmpYX(line1) > 0;
+ line0 = line1, line1 = line1->next) ;
+ if (line0) {
+ line0->next = line;
+ } else {
+ lines = line;
+ }
+ line->next = line1;
+ curLine = line;
+ line->coalesce(uMap);
+ charCount += line->len;
+ ++nLines;
+ }
+
+ // sort lines into xy order for column assignment
+ lineArray = (TextLine **)gmallocn(nLines, sizeof(TextLine *));
+ for (line = lines, i = 0; line; line = line->next, ++i) {
+ lineArray[i] = line;
+ }
+ qsort(lineArray, nLines, sizeof(TextLine *), &TextLine::cmpXY);
+
+ // column assignment
+ nColumns = 0;
+ for (i = 0; i < nLines; ++i) {
+ line0 = lineArray[i];
+ col1 = 0;
+ for (j = 0; j < i; ++j) {
+ line1 = lineArray[j];
+ if (line1->primaryDelta(line0) >= 0) {
+ col2 = line1->col[line1->len] + 1;
+ } else {
+ k = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ for (k = 0;
+ k < line1->len &&
+ line0->xMin >= 0.5 * (line1->edge[k] + line1->edge[k+1]);
+ ++k) ;
+ break;
+ case 1:
+ for (k = 0;
+ k < line1->len &&
+ line0->yMin >= 0.5 * (line1->edge[k] + line1->edge[k+1]);
+ ++k) ;
+ break;
+ case 2:
+ for (k = 0;
+ k < line1->len &&
+ line0->xMax <= 0.5 * (line1->edge[k] + line1->edge[k+1]);
+ ++k) ;
+ break;
+ case 3:
+ for (k = 0;
+ k < line1->len &&
+ line0->yMax <= 0.5 * (line1->edge[k] + line1->edge[k+1]);
+ ++k) ;
+ break;
+ }
+ col2 = line1->col[k];
+ }
+ if (col2 > col1) {
+ col1 = col2;
+ }
+ }
+ for (k = 0; k <= line0->len; ++k) {
+ line0->col[k] += col1;
+ }
+ if (line0->col[line0->len] > nColumns) {
+ nColumns = line0->col[line0->len];
+ }
+ }
+ gfree(lineArray);
+}
+
+void TextBlock::updatePriMinMax(TextBlock *blk) {
+ double newPriMin, newPriMax;
+ GBool gotPriMin, gotPriMax;
+
+ gotPriMin = gotPriMax = gFalse;
+ newPriMin = newPriMax = 0; // make gcc happy
+ switch (page->primaryRot) {
+ case 0:
+ case 2:
+ if (blk->yMin < yMax && blk->yMax > yMin) {
+ if (blk->xMin < xMin) {
+ newPriMin = blk->xMax;
+ gotPriMin = gTrue;
+ }
+ if (blk->xMax > xMax) {
+ newPriMax = blk->xMin;
+ gotPriMax = gTrue;
+ }
+ }
+ break;
+ case 1:
+ case 3:
+ if (blk->xMin < xMax && blk->xMax > xMin) {
+ if (blk->yMin < yMin) {
+ newPriMin = blk->yMax;
+ gotPriMin = gTrue;
+ }
+ if (blk->yMax > yMax) {
+ newPriMax = blk->yMin;
+ gotPriMax = gTrue;
+ }
+ }
+ break;
+ }
+ if (gotPriMin) {
+ if (newPriMin > xMin) {
+ newPriMin = xMin;
+ }
+ if (newPriMin > priMin) {
+ priMin = newPriMin;
+ }
+ }
+ if (gotPriMax) {
+ if (newPriMax < xMax) {
+ newPriMax = xMax;
+ }
+ if (newPriMax < priMax) {
+ priMax = newPriMax;
+ }
+ }
+}
+
+int TextBlock::cmpXYPrimaryRot(const void *p1, const void *p2) {
+ TextBlock *blk1 = *(TextBlock **)p1;
+ TextBlock *blk2 = *(TextBlock **)p2;
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (blk1->page->primaryRot) {
+ case 0:
+ if ((cmp = blk1->xMin - blk2->xMin) == 0) {
+ cmp = blk1->yMin - blk2->yMin;
+ }
+ break;
+ case 1:
+ if ((cmp = blk1->yMin - blk2->yMin) == 0) {
+ cmp = blk2->xMax - blk1->xMax;
+ }
+ break;
+ case 2:
+ if ((cmp = blk2->xMax - blk1->xMax) == 0) {
+ cmp = blk2->yMin - blk1->yMin;
+ }
+ break;
+ case 3:
+ if ((cmp = blk2->yMax - blk1->yMax) == 0) {
+ cmp = blk1->xMax - blk2->xMax;
+ }
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextBlock::cmpYXPrimaryRot(const void *p1, const void *p2) {
+ TextBlock *blk1 = *(TextBlock **)p1;
+ TextBlock *blk2 = *(TextBlock **)p2;
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (blk1->page->primaryRot) {
+ case 0:
+ if ((cmp = blk1->yMin - blk2->yMin) == 0) {
+ cmp = blk1->xMin - blk2->xMin;
+ }
+ break;
+ case 1:
+ if ((cmp = blk2->xMax - blk1->xMax) == 0) {
+ cmp = blk1->yMin - blk2->yMin;
+ }
+ break;
+ case 2:
+ if ((cmp = blk2->yMin - blk1->yMin) == 0) {
+ cmp = blk2->xMax - blk1->xMax;
+ }
+ break;
+ case 3:
+ if ((cmp = blk1->xMax - blk2->xMax) == 0) {
+ cmp = blk2->yMax - blk1->yMax;
+ }
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+int TextBlock::primaryCmp(TextBlock *blk) {
+ double cmp;
+
+ cmp = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ cmp = xMin - blk->xMin;
+ break;
+ case 1:
+ cmp = yMin - blk->yMin;
+ break;
+ case 2:
+ cmp = blk->xMax - xMax;
+ break;
+ case 3:
+ cmp = blk->yMax - yMax;
+ break;
+ }
+ return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+}
+
+double TextBlock::secondaryDelta(TextBlock *blk) {
+ double delta;
+
+ delta = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ delta = blk->yMin - yMax;
+ break;
+ case 1:
+ delta = xMin - blk->xMax;
+ break;
+ case 2:
+ delta = yMin - blk->yMax;
+ break;
+ case 3:
+ delta = blk->xMin - xMax;
+ break;
+ }
+ return delta;
+}
+
+GBool TextBlock::isBelow(TextBlock *blk) {
+ GBool below;
+
+ below = gFalse; // make gcc happy
+ switch (page->primaryRot) {
+ case 0:
+ below = xMin >= blk->priMin && xMax <= blk->priMax &&
+ yMin > blk->yMin;
+ break;
+ case 1:
+ below = yMin >= blk->priMin && yMax <= blk->priMax &&
+ xMax < blk->xMax;
+ break;
+ case 2:
+ below = xMin >= blk->priMin && xMax <= blk->priMax &&
+ yMax < blk->yMax;
+ break;
+ case 3:
+ below = yMin >= blk->priMin && yMax <= blk->priMax &&
+ xMin > blk->xMin;
+ break;
+ }
+
+ return below;
+}
+
+//------------------------------------------------------------------------
+// TextFlow
+//------------------------------------------------------------------------
+
+TextFlow::TextFlow(TextPage *pageA, TextBlock *blk) {
+ page = pageA;
+ xMin = blk->xMin;
+ xMax = blk->xMax;
+ yMin = blk->yMin;
+ yMax = blk->yMax;
+ priMin = blk->priMin;
+ priMax = blk->priMax;
+ blocks = lastBlk = blk;
+ next = NULL;
+}
+
+TextFlow::~TextFlow() {
+ TextBlock *blk;
+
+ while (blocks) {
+ blk = blocks;
+ blocks = blocks->next;
+ delete blk;
+ }
+}
+
+void TextFlow::addBlock(TextBlock *blk) {
+ if (lastBlk) {
+ lastBlk->next = blk;
+ } else {
+ blocks = blk;
+ }
+ lastBlk = blk;
+ if (blk->xMin < xMin) {
+ xMin = blk->xMin;
+ }
+ if (blk->xMax > xMax) {
+ xMax = blk->xMax;
+ }
+ if (blk->yMin < yMin) {
+ yMin = blk->yMin;
+ }
+ if (blk->yMax > yMax) {
+ yMax = blk->yMax;
+ }
+}
+
+GBool TextFlow::blockFits(TextBlock *blk, TextBlock * /*prevBlk*/) {
+ GBool fits;
+
+ // lower blocks must use smaller fonts
+ if (blk->lines->words->fontSize > lastBlk->lines->words->fontSize) {
+ return gFalse;
+ }
+
+ fits = gFalse; // make gcc happy
+ switch (page->primaryRot) {
+ case 0:
+ fits = blk->xMin >= priMin && blk->xMax <= priMax;
+ break;
+ case 1:
+ fits = blk->yMin >= priMin && blk->yMax <= priMax;
+ break;
+ case 2:
+ fits = blk->xMin >= priMin && blk->xMax <= priMax;
+ break;
+ case 3:
+ fits = blk->yMin >= priMin && blk->yMax <= priMax;
+ break;
+ }
+ return fits;
+}
+
+#if TEXTOUT_WORD_LIST
+
+//------------------------------------------------------------------------
+// TextWordList
+//------------------------------------------------------------------------
+
+TextWordList::TextWordList(TextPage *text, GBool physLayout) {
+ TextFlow *flow;
+ TextBlock *blk;
+ TextLine *line;
+ TextWord *word;
+ TextWord **wordArray;
+ int nWords, i;
+
+ words = new GList();
+
+ if (text->rawOrder) {
+ for (word = text->rawWords; word; word = word->next) {
+ words->append(word);
+ }
+
+ } else if (physLayout) {
+ // this is inefficient, but it's also the least useful of these
+ // three cases
+ nWords = 0;
+ for (flow = text->flows; flow; flow = flow->next) {
+ for (blk = flow->blocks; blk; blk = blk->next) {
+ for (line = blk->lines; line; line = line->next) {
+ for (word = line->words; word; word = word->next) {
+ ++nWords;
+ }
+ }
+ }
+ }
+ wordArray = (TextWord **)gmallocn(nWords, sizeof(TextWord *));
+ i = 0;
+ for (flow = text->flows; flow; flow = flow->next) {
+ for (blk = flow->blocks; blk; blk = blk->next) {
+ for (line = blk->lines; line; line = line->next) {
+ for (word = line->words; word; word = word->next) {
+ wordArray[i++] = word;
+ }
+ }
+ }
+ }
+ qsort(wordArray, nWords, sizeof(TextWord *), &TextWord::cmpYX);
+ for (i = 0; i < nWords; ++i) {
+ words->append(wordArray[i]);
+ }
+ gfree(wordArray);
+
+ } else {
+ for (flow = text->flows; flow; flow = flow->next) {
+ for (blk = flow->blocks; blk; blk = blk->next) {
+ for (line = blk->lines; line; line = line->next) {
+ for (word = line->words; word; word = word->next) {
+ words->append(word);
+ }
+ }
+ }
+ }
+ }
+}
+
+TextWordList::~TextWordList() {
+ delete words;
+}
+
+int TextWordList::getLength() {
+ return words->getLength();
+}
+
+TextWord *TextWordList::get(int idx) {
+ if (idx < 0 || idx >= words->getLength()) {
+ return NULL;
+ }
+ return (TextWord *)words->get(idx);
+}
+
+#endif // TEXTOUT_WORD_LIST
+
+//------------------------------------------------------------------------
+// TextPage
+//------------------------------------------------------------------------
+
+TextPage::TextPage(GBool rawOrderA) {
+ int rot;
+
+ rawOrder = rawOrderA;
+ curWord = NULL;
+ charPos = 0;
+ curFont = NULL;
+ curFontSize = 0;
+ nest = 0;
+ nTinyChars = 0;
+ lastCharOverlap = gFalse;
+ if (!rawOrder) {
+ for (rot = 0; rot < 4; ++rot) {
+ pools[rot] = new TextPool();
+ }
+ }
+ flows = NULL;
+ blocks = NULL;
+ rawWords = NULL;
+ rawLastWord = NULL;
+ fonts = new GList();
+ lastFindXMin = lastFindYMin = 0;
+ haveLastFind = gFalse;
+ underlines = new GList();
+ links = new GList();
+}
+
+TextPage::~TextPage() {
+ int rot;
+
+ clear();
+ if (!rawOrder) {
+ for (rot = 0; rot < 4; ++rot) {
+ delete pools[rot];
+ }
+ }
+ delete fonts;
+ deleteGList(underlines, TextUnderline);
+ deleteGList(links, TextLink);
+}
+
+void TextPage::startPage(GfxState *state) {
+ clear();
+ if (state) {
+ pageWidth = state->getPageWidth();
+ pageHeight = state->getPageHeight();
+ } else {
+ pageWidth = pageHeight = 0;
+ }
+}
+
+void TextPage::endPage() {
+ if (curWord) {
+ endWord();
+ }
+}
+
+void TextPage::clear() {
+ int rot;
+ TextFlow *flow;
+ TextWord *word;
+
+ if (curWord) {
+ delete curWord;
+ curWord = NULL;
+ }
+ if (rawOrder) {
+ while (rawWords) {
+ word = rawWords;
+ rawWords = rawWords->next;
+ delete word;
+ }
+ } else {
+ for (rot = 0; rot < 4; ++rot) {
+ delete pools[rot];
+ }
+ while (flows) {
+ flow = flows;
+ flows = flows->next;
+ delete flow;
+ }
+ gfree(blocks);
+ }
+ deleteGList(fonts, TextFontInfo);
+
+ curWord = NULL;
+ charPos = 0;
+ curFont = NULL;
+ curFontSize = 0;
+ nest = 0;
+ nTinyChars = 0;
+ if (!rawOrder) {
+ for (rot = 0; rot < 4; ++rot) {
+ pools[rot] = new TextPool();
+ }
+ }
+ flows = NULL;
+ blocks = NULL;
+ rawWords = NULL;
+ rawLastWord = NULL;
+ fonts = new GList();
+}
+
+void TextPage::updateFont(GfxState *state) {
+ GfxFont *gfxFont;
+ double *fm;
+ char *name;
+ int code, mCode, letterCode, anyCode;
+ double w;
+ int i;
+
+ // get the font info object
+ curFont = NULL;
+ for (i = 0; i < fonts->getLength(); ++i) {
+ curFont = (TextFontInfo *)fonts->get(i);
+ if (curFont->matches(state)) {
+ break;
+ }
+ curFont = NULL;
+ }
+ if (!curFont) {
+ curFont = new TextFontInfo(state);
+ fonts->append(curFont);
+ }
+
+ // adjust the font size
+ gfxFont = state->getFont();
+ curFontSize = state->getTransformedFontSize();
+ if (gfxFont && gfxFont->getType() == fontType3) {
+ // This is a hack which makes it possible to deal with some Type 3
+ // fonts. The problem is that it's impossible to know what the
+ // base coordinate system used in the font is without actually
+ // rendering the font. This code tries to guess by looking at the
+ // width of the character 'm' (which breaks if the font is a
+ // subset that doesn't contain 'm').
+ mCode = letterCode = anyCode = -1;
+ for (code = 0; code < 256; ++code) {
+ name = ((Gfx8BitFont *)gfxFont)->getCharName(code);
+ if (name && name[0] == 'm' && name[1] == '\0') {
+ mCode = code;
+ }
+ if (letterCode < 0 && name && name[1] == '\0' &&
+ ((name[0] >= 'A' && name[0] <= 'Z') ||
+ (name[0] >= 'a' && name[0] <= 'z'))) {
+ letterCode = code;
+ }
+ if (anyCode < 0 && name &&
+ ((Gfx8BitFont *)gfxFont)->getWidth(code) > 0) {
+ anyCode = code;
+ }
+ }
+ if (mCode >= 0 &&
+ (w = ((Gfx8BitFont *)gfxFont)->getWidth(mCode)) > 0) {
+ // 0.6 is a generic average 'm' width -- yes, this is a hack
+ curFontSize *= w / 0.6;
+ } else if (letterCode >= 0 &&
+ (w = ((Gfx8BitFont *)gfxFont)->getWidth(letterCode)) > 0) {
+ // even more of a hack: 0.5 is a generic letter width
+ curFontSize *= w / 0.5;
+ } else if (anyCode >= 0 &&
+ (w = ((Gfx8BitFont *)gfxFont)->getWidth(anyCode)) > 0) {
+ // better than nothing: 0.5 is a generic character width
+ curFontSize *= w / 0.5;
+ }
+ fm = gfxFont->getFontMatrix();
+ if (fm[0] != 0) {
+ curFontSize *= fabs(fm[3] / fm[0]);
+ }
+ }
+}
+
+void TextPage::beginWord(GfxState *state, double x0, double y0) {
+ double *fontm;
+ double m[4], m2[4];
+ int rot;
+
+ // This check is needed because Type 3 characters can contain
+ // text-drawing operations (when TextPage is being used via
+ // {X,Win}SplashOutputDev rather than TextOutputDev).
+ if (curWord) {
+ ++nest;
+ return;
+ }
+
+ // compute the rotation
+ state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]);
+ if (state->getFont()->getType() == fontType3) {
+ fontm = state->getFont()->getFontMatrix();
+ m2[0] = fontm[0] * m[0] + fontm[1] * m[2];
+ m2[1] = fontm[0] * m[1] + fontm[1] * m[3];
+ m2[2] = fontm[2] * m[0] + fontm[3] * m[2];
+ m2[3] = fontm[2] * m[1] + fontm[3] * m[3];
+ m[0] = m2[0];
+ m[1] = m2[1];
+ m[2] = m2[2];
+ m[3] = m2[3];
+ }
+ if (fabs(m[0] * m[3]) > fabs(m[1] * m[2])) {
+ rot = (m[3] < 0) ? 0 : 2;
+ } else {
+ rot = (m[2] > 0) ? 1 : 3;
+ }
+
+ curWord = new TextWord(state, rot, x0, y0, charPos, curFont, curFontSize);
+}
+
+void TextPage::addChar(GfxState *state, double x, double y,
+ double dx, double dy,
+ CharCode c, int nBytes, Unicode *u, int uLen) {
+ double x1, y1, w1, h1, dx2, dy2, base, sp, delta;
+ GBool overlap;
+ int i;
+
+ // subtract char and word spacing from the dx,dy values
+ sp = state->getCharSpace();
+ if (c == (CharCode)0x20) {
+ sp += state->getWordSpace();
+ }
+ state->textTransformDelta(sp * state->getHorizScaling(), 0, &dx2, &dy2);
+ dx -= dx2;
+ dy -= dy2;
+ state->transformDelta(dx, dy, &w1, &h1);
+
+ // throw away chars that aren't inside the page bounds
+ // (and also do a sanity check on the character size)
+ state->transform(x, y, &x1, &y1);
+ if (x1 + w1 < 0 || x1 > pageWidth ||
+ y1 + h1 < 0 || y1 > pageHeight ||
+ w1 > pageWidth || h1 > pageHeight) {
+ charPos += nBytes;
+ return;
+ }
+
+ // check the tiny chars limit
+ if (!globalParams->getTextKeepTinyChars() &&
+ fabs(w1) < 3 && fabs(h1) < 3) {
+ if (++nTinyChars > 50000) {
+ charPos += nBytes;
+ return;
+ }
+ }
+
+ // break words at space character
+ if (uLen == 1 && u[0] == (Unicode)0x20) {
+ if (curWord) {
+ ++curWord->charLen;
+ }
+ charPos += nBytes;
+ endWord();
+ return;
+ }
+
+ // start a new word if:
+ // (1) this character doesn't fall in the right place relative to
+ // the end of the previous word (this places upper and lower
+ // constraints on the position deltas along both the primary
+ // and secondary axes), or
+ // (2) this character overlaps the previous one (duplicated text), or
+ // (3) the previous character was an overlap (we want each duplicated
+ // character to be in a word by itself at this stage),
+ // (4) the font size has changed
+ if (curWord && curWord->len > 0) {
+ base = sp = delta = 0; // make gcc happy
+ switch (curWord->rot) {
+ case 0:
+ base = y1;
+ sp = x1 - curWord->xMax;
+ delta = x1 - curWord->edge[curWord->len - 1];
+ break;
+ case 1:
+ base = x1;
+ sp = y1 - curWord->yMax;
+ delta = y1 - curWord->edge[curWord->len - 1];
+ break;
+ case 2:
+ base = y1;
+ sp = curWord->xMin - x1;
+ delta = curWord->edge[curWord->len - 1] - x1;
+ break;
+ case 3:
+ base = x1;
+ sp = curWord->yMin - y1;
+ delta = curWord->edge[curWord->len - 1] - y1;
+ break;
+ }
+ overlap = fabs(delta) < dupMaxPriDelta * curWord->fontSize &&
+ fabs(base - curWord->base) < dupMaxSecDelta * curWord->fontSize;
+ if (overlap || lastCharOverlap ||
+ sp < -minDupBreakOverlap * curWord->fontSize ||
+ sp > minWordBreakSpace * curWord->fontSize ||
+ fabs(base - curWord->base) > 0.5 ||
+ curFontSize != curWord->fontSize) {
+ endWord();
+ }
+ lastCharOverlap = overlap;
+ } else {
+ lastCharOverlap = gFalse;
+ }
+
+ if (uLen != 0) {
+ // start a new word if needed
+ if (!curWord) {
+ beginWord(state, x, y);
+ }
+
+ // page rotation and/or transform matrices can cause text to be
+ // drawn in reverse order -- in this case, swap the begin/end
+ // coordinates and break text into individual chars
+ if ((curWord->rot == 0 && w1 < 0) ||
+ (curWord->rot == 1 && h1 < 0) ||
+ (curWord->rot == 2 && w1 > 0) ||
+ (curWord->rot == 3 && h1 > 0)) {
+ endWord();
+ beginWord(state, x + dx, y + dy);
+ x1 += w1;
+ y1 += h1;
+ w1 = -w1;
+ h1 = -h1;
+ }
+
+ // add the characters to the current word
+ w1 /= uLen;
+ h1 /= uLen;
+ for (i = 0; i < uLen; ++i) {
+ curWord->addChar(state, x1 + i*w1, y1 + i*h1, w1, h1, u[i]);
+ }
+ }
+ if (curWord) {
+ curWord->charLen += nBytes;
+ }
+ charPos += nBytes;
+}
+
+void TextPage::endWord() {
+ // This check is needed because Type 3 characters can contain
+ // text-drawing operations (when TextPage is being used via
+ // {X,Win}SplashOutputDev rather than TextOutputDev).
+ if (nest > 0) {
+ --nest;
+ return;
+ }
+
+ if (curWord) {
+ addWord(curWord);
+ curWord = NULL;
+ }
+}
+
+void TextPage::addWord(TextWord *word) {
+ // throw away zero-length words -- they don't have valid xMin/xMax
+ // values, and they're useless anyway
+ if (word->len == 0) {
+ delete word;
+ return;
+ }
+
+ if (rawOrder) {
+ if (rawLastWord) {
+ rawLastWord->next = word;
+ } else {
+ rawWords = word;
+ }
+ rawLastWord = word;
+ } else {
+ pools[word->rot]->addWord(word);
+ }
+}
+
+void TextPage::addUnderline(double x0, double y0, double x1, double y1) {
+ underlines->append(new TextUnderline(x0, y0, x1, y1));
+}
+
+void TextPage::addLink(int xMin, int yMin, int xMax, int yMax, Link *link) {
+ links->append(new TextLink(xMin, yMin, xMax, yMax, link));
+}
+
+void TextPage::coalesce(GBool /*physLayout*/, GBool doHTML) {
+ UnicodeMap *uMap;
+ TextPool *pool;
+ TextWord *word0, *word1, *word2;
+ TextLine *line;
+ TextBlock *blkList, *blkStack, *blk, *lastBlk, *blk0, *blk1;
+ TextBlock **blkArray;
+ TextFlow *flow, *lastFlow;
+ TextUnderline *underline;
+ TextLink *link;
+ int rot, poolMinBaseIdx, baseIdx, startBaseIdx, endBaseIdx;
+ double minBase, maxBase, newMinBase, newMaxBase;
+ double fontSize, colSpace1, colSpace2, lineSpace, intraLineSpace, blkSpace;
+ GBool found;
+ int count[4];
+ int lrCount;
+ int firstBlkIdx, nBlocksLeft;
+ int col1, col2;
+ int i, j, n;
+
+ if (rawOrder) {
+ primaryRot = 0;
+ primaryLR = gTrue;
+ return;
+ }
+
+ uMap = globalParams->getTextEncoding();
+ blkList = NULL;
+ lastBlk = NULL;
+ nBlocks = 0;
+ primaryRot = -1;
+
+#if 0 // for debugging
+ printf("*** initial words ***\n");
+ for (rot = 0; rot < 4; ++rot) {
+ pool = pools[rot];
+ for (baseIdx = pool->minBaseIdx; baseIdx <= pool->maxBaseIdx; ++baseIdx) {
+ for (word0 = pool->getPool(baseIdx); word0; word0 = word0->next) {
+ printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f rot=%d link=%p '",
+ word0->xMin, word0->xMax, word0->yMin, word0->yMax,
+ word0->base, word0->fontSize, rot*90, word0->link);
+ for (i = 0; i < word0->len; ++i) {
+ fputc(word0->text[i] & 0xff, stdout);
+ }
+ printf("'\n");
+ }
+ }
+ }
+ printf("\n");
+#endif
+
+#if 0 //~ for debugging
+ for (i = 0; i < underlines->getLength(); ++i) {
+ underline = (TextUnderline *)underlines->get(i);
+ printf("underline: x=%g..%g y=%g..%g horiz=%d\n",
+ underline->x0, underline->x1, underline->y0, underline->y1,
+ underline->horiz);
+ }
+#endif
+
+ if (doHTML) {
+
+ //----- handle underlining
+ for (i = 0; i < underlines->getLength(); ++i) {
+ underline = (TextUnderline *)underlines->get(i);
+ if (underline->horiz) {
+ // rot = 0
+ if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) {
+ startBaseIdx = pools[0]->getBaseIdx(underline->y0 + minUnderlineGap);
+ endBaseIdx = pools[0]->getBaseIdx(underline->y0 + maxUnderlineGap);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[0]->getPool(j); word0; word0 = word0->next) {
+ //~ need to check the y value against the word baseline
+ if (underline->x0 < word0->xMin + underlineSlack &&
+ word0->xMax - underlineSlack < underline->x1) {
+ word0->underlined = gTrue;
+ }
+ }
+ }
+ }
+
+ // rot = 2
+ if (pools[2]->minBaseIdx <= pools[2]->maxBaseIdx) {
+ startBaseIdx = pools[2]->getBaseIdx(underline->y0 - maxUnderlineGap);
+ endBaseIdx = pools[2]->getBaseIdx(underline->y0 - minUnderlineGap);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[2]->getPool(j); word0; word0 = word0->next) {
+ if (underline->x0 < word0->xMin + underlineSlack &&
+ word0->xMax - underlineSlack < underline->x1) {
+ word0->underlined = gTrue;
+ }
+ }
+ }
+ }
+ } else {
+ // rot = 1
+ if (pools[1]->minBaseIdx <= pools[1]->maxBaseIdx) {
+ startBaseIdx = pools[1]->getBaseIdx(underline->x0 - maxUnderlineGap);
+ endBaseIdx = pools[1]->getBaseIdx(underline->x0 - minUnderlineGap);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[1]->getPool(j); word0; word0 = word0->next) {
+ if (underline->y0 < word0->yMin + underlineSlack &&
+ word0->yMax - underlineSlack < underline->y1) {
+ word0->underlined = gTrue;
+ }
+ }
+ }
+ }
+
+ // rot = 3
+ if (pools[3]->minBaseIdx <= pools[3]->maxBaseIdx) {
+ startBaseIdx = pools[3]->getBaseIdx(underline->x0 + minUnderlineGap);
+ endBaseIdx = pools[3]->getBaseIdx(underline->x0 + maxUnderlineGap);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[3]->getPool(j); word0; word0 = word0->next) {
+ if (underline->y0 < word0->yMin + underlineSlack &&
+ word0->yMax - underlineSlack < underline->y1) {
+ word0->underlined = gTrue;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //----- handle links
+ for (i = 0; i < links->getLength(); ++i) {
+ link = (TextLink *)links->get(i);
+
+ // rot = 0
+ if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) {
+ startBaseIdx = pools[0]->getBaseIdx(link->yMin);
+ endBaseIdx = pools[0]->getBaseIdx(link->yMax);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[0]->getPool(j); word0; word0 = word0->next) {
+ if (link->xMin < word0->xMin + hyperlinkSlack &&
+ word0->xMax - hyperlinkSlack < link->xMax &&
+ link->yMin < word0->yMin + hyperlinkSlack &&
+ word0->yMax - hyperlinkSlack < link->yMax) {
+ word0->link = link->link;
+ }
+ }
+ }
+ }
+
+ // rot = 2
+ if (pools[2]->minBaseIdx <= pools[2]->maxBaseIdx) {
+ startBaseIdx = pools[2]->getBaseIdx(link->yMin);
+ endBaseIdx = pools[2]->getBaseIdx(link->yMax);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[2]->getPool(j); word0; word0 = word0->next) {
+ if (link->xMin < word0->xMin + hyperlinkSlack &&
+ word0->xMax - hyperlinkSlack < link->xMax &&
+ link->yMin < word0->yMin + hyperlinkSlack &&
+ word0->yMax - hyperlinkSlack < link->yMax) {
+ word0->link = link->link;
+ }
+ }
+ }
+ }
+
+ // rot = 1
+ if (pools[1]->minBaseIdx <= pools[1]->maxBaseIdx) {
+ startBaseIdx = pools[1]->getBaseIdx(link->xMin);
+ endBaseIdx = pools[1]->getBaseIdx(link->xMax);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[1]->getPool(j); word0; word0 = word0->next) {
+ if (link->yMin < word0->yMin + hyperlinkSlack &&
+ word0->yMax - hyperlinkSlack < link->yMax &&
+ link->xMin < word0->xMin + hyperlinkSlack &&
+ word0->xMax - hyperlinkSlack < link->xMax) {
+ word0->link = link->link;
+ }
+ }
+ }
+ }
+
+ // rot = 3
+ if (pools[3]->minBaseIdx <= pools[3]->maxBaseIdx) {
+ startBaseIdx = pools[3]->getBaseIdx(link->xMin);
+ endBaseIdx = pools[3]->getBaseIdx(link->xMax);
+ for (j = startBaseIdx; j <= endBaseIdx; ++j) {
+ for (word0 = pools[3]->getPool(j); word0; word0 = word0->next) {
+ if (link->yMin < word0->yMin + hyperlinkSlack &&
+ word0->yMax - hyperlinkSlack < link->yMax &&
+ link->xMin < word0->xMin + hyperlinkSlack &&
+ word0->xMax - hyperlinkSlack < link->xMax) {
+ word0->link = link->link;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //----- assemble the blocks
+
+ //~ add an outer loop for writing mode (vertical text)
+
+ // build blocks for each rotation value
+ for (rot = 0; rot < 4; ++rot) {
+ pool = pools[rot];
+ poolMinBaseIdx = pool->minBaseIdx;
+ count[rot] = 0;
+
+ // add blocks until no more words are left
+ while (1) {
+
+ // find the first non-empty line in the pool
+ for (;
+ poolMinBaseIdx <= pool->maxBaseIdx &&
+ !pool->getPool(poolMinBaseIdx);
+ ++poolMinBaseIdx) ;
+ if (poolMinBaseIdx > pool->maxBaseIdx) {
+ break;
+ }
+
+ // look for the left-most word in the first four lines of the
+ // pool -- this avoids starting with a superscript word
+ startBaseIdx = poolMinBaseIdx;
+ for (baseIdx = poolMinBaseIdx + 1;
+ baseIdx < poolMinBaseIdx + 4 && baseIdx <= pool->maxBaseIdx;
+ ++baseIdx) {
+ if (!pool->getPool(baseIdx)) {
+ continue;
+ }
+ if (pool->getPool(baseIdx)->primaryCmp(pool->getPool(startBaseIdx))
+ < 0) {
+ startBaseIdx = baseIdx;
+ }
+ }
+
+ // create a new block
+ word0 = pool->getPool(startBaseIdx);
+ pool->setPool(startBaseIdx, word0->next);
+ word0->next = NULL;
+ blk = new TextBlock(this, rot);
+ blk->addWord(word0);
+
+ fontSize = word0->fontSize;
+ minBase = maxBase = word0->base;
+ colSpace1 = minColSpacing1 * fontSize;
+ colSpace2 = minColSpacing2 * fontSize;
+ lineSpace = maxLineSpacingDelta * fontSize;
+ intraLineSpace = maxIntraLineDelta * fontSize;
+
+ // add words to the block
+ do {
+ found = gFalse;
+
+ // look for words on the line above the current top edge of
+ // the block
+ newMinBase = minBase;
+ for (baseIdx = pool->getBaseIdx(minBase);
+ baseIdx >= pool->getBaseIdx(minBase - lineSpace);
+ --baseIdx) {
+ word0 = NULL;
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base < minBase &&
+ word1->base >= minBase - lineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMin < blk->xMax && word1->xMax > blk->xMin)
+ : (word1->yMin < blk->yMax && word1->yMax > blk->yMin)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta1 * fontSize) {
+ word2 = word1;
+ if (word0) {
+ word0->next = word1->next;
+ } else {
+ pool->setPool(baseIdx, word1->next);
+ }
+ word1 = word1->next;
+ word2->next = NULL;
+ blk->addWord(word2);
+ found = gTrue;
+ newMinBase = word2->base;
+ } else {
+ word0 = word1;
+ word1 = word1->next;
+ }
+ }
+ }
+ minBase = newMinBase;
+
+ // look for words on the line below the current bottom edge of
+ // the block
+ newMaxBase = maxBase;
+ for (baseIdx = pool->getBaseIdx(maxBase);
+ baseIdx <= pool->getBaseIdx(maxBase + lineSpace);
+ ++baseIdx) {
+ word0 = NULL;
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base > maxBase &&
+ word1->base <= maxBase + lineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMin < blk->xMax && word1->xMax > blk->xMin)
+ : (word1->yMin < blk->yMax && word1->yMax > blk->yMin)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta1 * fontSize) {
+ word2 = word1;
+ if (word0) {
+ word0->next = word1->next;
+ } else {
+ pool->setPool(baseIdx, word1->next);
+ }
+ word1 = word1->next;
+ word2->next = NULL;
+ blk->addWord(word2);
+ found = gTrue;
+ newMaxBase = word2->base;
+ } else {
+ word0 = word1;
+ word1 = word1->next;
+ }
+ }
+ }
+ maxBase = newMaxBase;
+
+ // look for words that are on lines already in the block, and
+ // that overlap the block horizontally
+ for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
+ baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
+ ++baseIdx) {
+ word0 = NULL;
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base >= minBase - intraLineSpace &&
+ word1->base <= maxBase + intraLineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMin < blk->xMax + colSpace1 &&
+ word1->xMax > blk->xMin - colSpace1)
+ : (word1->yMin < blk->yMax + colSpace1 &&
+ word1->yMax > blk->yMin - colSpace1)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta2 * fontSize) {
+ word2 = word1;
+ if (word0) {
+ word0->next = word1->next;
+ } else {
+ pool->setPool(baseIdx, word1->next);
+ }
+ word1 = word1->next;
+ word2->next = NULL;
+ blk->addWord(word2);
+ found = gTrue;
+ } else {
+ word0 = word1;
+ word1 = word1->next;
+ }
+ }
+ }
+
+ // only check for outlying words (the next two chunks of code)
+ // if we didn't find anything else
+ if (found) {
+ continue;
+ }
+
+ // scan down the left side of the block, looking for words
+ // that are near (but not overlapping) the block; if there are
+ // three or fewer, add them to the block
+ n = 0;
+ for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
+ baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
+ ++baseIdx) {
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base >= minBase - intraLineSpace &&
+ word1->base <= maxBase + intraLineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMax <= blk->xMin &&
+ word1->xMax > blk->xMin - colSpace2)
+ : (word1->yMax <= blk->yMin &&
+ word1->yMax > blk->yMin - colSpace2)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta3 * fontSize) {
+ ++n;
+ break;
+ }
+ word1 = word1->next;
+ }
+ }
+ if (n > 0 && n <= 3) {
+ for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
+ baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
+ ++baseIdx) {
+ word0 = NULL;
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base >= minBase - intraLineSpace &&
+ word1->base <= maxBase + intraLineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMax <= blk->xMin &&
+ word1->xMax > blk->xMin - colSpace2)
+ : (word1->yMax <= blk->yMin &&
+ word1->yMax > blk->yMin - colSpace2)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta3 * fontSize) {
+ word2 = word1;
+ if (word0) {
+ word0->next = word1->next;
+ } else {
+ pool->setPool(baseIdx, word1->next);
+ }
+ word1 = word1->next;
+ word2->next = NULL;
+ blk->addWord(word2);
+ if (word2->base < minBase) {
+ minBase = word2->base;
+ } else if (word2->base > maxBase) {
+ maxBase = word2->base;
+ }
+ found = gTrue;
+ break;
+ } else {
+ word0 = word1;
+ word1 = word1->next;
+ }
+ }
+ }
+ }
+
+ // scan down the right side of the block, looking for words
+ // that are near (but not overlapping) the block; if there are
+ // three or fewer, add them to the block
+ n = 0;
+ for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
+ baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
+ ++baseIdx) {
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base >= minBase - intraLineSpace &&
+ word1->base <= maxBase + intraLineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMin >= blk->xMax &&
+ word1->xMin < blk->xMax + colSpace2)
+ : (word1->yMin >= blk->yMax &&
+ word1->yMin < blk->yMax + colSpace2)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta3 * fontSize) {
+ ++n;
+ break;
+ }
+ word1 = word1->next;
+ }
+ }
+ if (n > 0 && n <= 3) {
+ for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace);
+ baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace);
+ ++baseIdx) {
+ word0 = NULL;
+ word1 = pool->getPool(baseIdx);
+ while (word1) {
+ if (word1->base >= minBase - intraLineSpace &&
+ word1->base <= maxBase + intraLineSpace &&
+ ((rot == 0 || rot == 2)
+ ? (word1->xMin >= blk->xMax &&
+ word1->xMin < blk->xMax + colSpace2)
+ : (word1->yMin >= blk->yMax &&
+ word1->yMin < blk->yMax + colSpace2)) &&
+ fabs(word1->fontSize - fontSize) <
+ maxBlockFontSizeDelta3 * fontSize) {
+ word2 = word1;
+ if (word0) {
+ word0->next = word1->next;
+ } else {
+ pool->setPool(baseIdx, word1->next);
+ }
+ word1 = word1->next;
+ word2->next = NULL;
+ blk->addWord(word2);
+ if (word2->base < minBase) {
+ minBase = word2->base;
+ } else if (word2->base > maxBase) {
+ maxBase = word2->base;
+ }
+ found = gTrue;
+ break;
+ } else {
+ word0 = word1;
+ word1 = word1->next;
+ }
+ }
+ }
+ }
+
+ } while (found);
+
+ //~ need to compute the primary writing mode (horiz/vert) in
+ //~ addition to primary rotation
+
+ // coalesce the block, and add it to the list
+ blk->coalesce(uMap);
+ if (lastBlk) {
+ lastBlk->next = blk;
+ } else {
+ blkList = blk;
+ }
+ lastBlk = blk;
+ count[rot] += blk->charCount;
+ if (primaryRot < 0 || count[rot] > count[primaryRot]) {
+ primaryRot = rot;
+ }
+ ++nBlocks;
+ }
+ }
+
+#if 0 // for debugging
+ printf("*** rotation ***\n");
+ for (rot = 0; rot < 4; ++rot) {
+ printf(" %d: %6d\n", rot, count[rot]);
+ }
+ printf(" primary rot = %d\n", primaryRot);
+ printf("\n");
+#endif
+
+#if 0 // for debugging
+ printf("*** blocks ***\n");
+ for (blk = blkList; blk; blk = blk->next) {
+ printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f\n",
+ blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax);
+ for (line = blk->lines; line; line = line->next) {
+ printf(" line: x=%.2f..%.2f y=%.2f..%.2f base=%.2f\n",
+ line->xMin, line->xMax, line->yMin, line->yMax, line->base);
+ for (word0 = line->words; word0; word0 = word0->next) {
+ printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
+ word0->xMin, word0->xMax, word0->yMin, word0->yMax,
+ word0->base, word0->fontSize, word0->spaceAfter);
+ for (i = 0; i < word0->len; ++i) {
+ fputc(word0->text[i] & 0xff, stdout);
+ }
+ printf("'\n");
+ }
+ }
+ }
+ printf("\n");
+#endif
+
+ // determine the primary direction
+ lrCount = 0;
+ for (blk = blkList; blk; blk = blk->next) {
+ for (line = blk->lines; line; line = line->next) {
+ for (word0 = line->words; word0; word0 = word0->next) {
+ for (i = 0; i < word0->len; ++i) {
+ if (unicodeTypeL(word0->text[i])) {
+ ++lrCount;
+ } else if (unicodeTypeR(word0->text[i])) {
+ --lrCount;
+ }
+ }
+ }
+ }
+ }
+ primaryLR = lrCount >= 0;
+
+#if 0 // for debugging
+ printf("*** direction ***\n");
+ printf("lrCount = %d\n", lrCount);
+ printf("primaryLR = %d\n", primaryLR);
+#endif
+
+ //----- column assignment
+
+ // sort blocks into xy order for column assignment
+ blocks = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *));
+ for (blk = blkList, i = 0; blk; blk = blk->next, ++i) {
+ blocks[i] = blk;
+ }
+ qsort(blocks, nBlocks, sizeof(TextBlock *), &TextBlock::cmpXYPrimaryRot);
+
+ // column assignment
+ for (i = 0; i < nBlocks; ++i) {
+ blk0 = blocks[i];
+ col1 = 0;
+ for (j = 0; j < i; ++j) {
+ blk1 = blocks[j];
+ col2 = 0; // make gcc happy
+ switch (primaryRot) {
+ case 0:
+ if (blk0->xMin > blk1->xMax) {
+ col2 = blk1->col + blk1->nColumns + 3;
+ } else if (blk1->xMax == blk1->xMin) {
+ col2 = blk1->col;
+ } else {
+ col2 = blk1->col + (int)(((blk0->xMin - blk1->xMin) /
+ (blk1->xMax - blk1->xMin)) *
+ blk1->nColumns);
+ }
+ break;
+ case 1:
+ if (blk0->yMin > blk1->yMax) {
+ col2 = blk1->col + blk1->nColumns + 3;
+ } else if (blk1->yMax == blk1->yMin) {
+ col2 = blk1->col;
+ } else {
+ col2 = blk1->col + (int)(((blk0->yMin - blk1->yMin) /
+ (blk1->yMax - blk1->yMin)) *
+ blk1->nColumns);
+ }
+ break;
+ case 2:
+ if (blk0->xMax < blk1->xMin) {
+ col2 = blk1->col + blk1->nColumns + 3;
+ } else if (blk1->xMin == blk1->xMax) {
+ col2 = blk1->col;
+ } else {
+ col2 = blk1->col + (int)(((blk0->xMax - blk1->xMax) /
+ (blk1->xMin - blk1->xMax)) *
+ blk1->nColumns);
+ }
+ break;
+ case 3:
+ if (blk0->yMax < blk1->yMin) {
+ col2 = blk1->col + blk1->nColumns + 3;
+ } else if (blk1->yMin == blk1->yMax) {
+ col2 = blk1->col;
+ } else {
+ col2 = blk1->col + (int)(((blk0->yMax - blk1->yMax) /
+ (blk1->yMin - blk1->yMax)) *
+ blk1->nColumns);
+ }
+ break;
+ }
+ if (col2 > col1) {
+ col1 = col2;
+ }
+ }
+ blk0->col = col1;
+ for (line = blk0->lines; line; line = line->next) {
+ for (j = 0; j <= line->len; ++j) {
+ line->col[j] += col1;
+ }
+ }
+ }
+
+#if 0 // for debugging
+ printf("*** blocks, after column assignment ***\n");
+ for (blk = blkList; blk; blk = blk->next) {
+ printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f col=%d nCols=%d\n",
+ blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax, blk->col,
+ blk->nColumns);
+ for (line = blk->lines; line; line = line->next) {
+ printf(" line:\n");
+ for (word0 = line->words; word0; word0 = word0->next) {
+ printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
+ word0->xMin, word0->xMax, word0->yMin, word0->yMax,
+ word0->base, word0->fontSize, word0->spaceAfter);
+ for (i = 0; i < word0->len; ++i) {
+ fputc(word0->text[i] & 0xff, stdout);
+ }
+ printf("'\n");
+ }
+ }
+ }
+ printf("\n");
+#endif
+
+ //----- reading order sort
+
+ // sort blocks into yx order (in preparation for reading order sort)
+ qsort(blocks, nBlocks, sizeof(TextBlock *), &TextBlock::cmpYXPrimaryRot);
+
+ // compute space on left and right sides of each block
+ for (i = 0; i < nBlocks; ++i) {
+ blk0 = blocks[i];
+ for (j = 0; j < nBlocks; ++j) {
+ blk1 = blocks[j];
+ if (blk1 != blk0) {
+ blk0->updatePriMinMax(blk1);
+ }
+ }
+ }
+
+#if 0 // for debugging
+ printf("*** blocks, after yx sort ***\n");
+ for (i = 0; i < nBlocks; ++i) {
+ blk = blocks[i];
+ printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f space=%.2f..%.2f\n",
+ blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax,
+ blk->priMin, blk->priMax);
+ for (line = blk->lines; line; line = line->next) {
+ printf(" line:\n");
+ for (word0 = line->words; word0; word0 = word0->next) {
+ printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
+ word0->xMin, word0->xMax, word0->yMin, word0->yMax,
+ word0->base, word0->fontSize, word0->spaceAfter);
+ for (j = 0; j < word0->len; ++j) {
+ fputc(word0->text[j] & 0xff, stdout);
+ }
+ printf("'\n");
+ }
+ }
+ }
+ printf("\n");
+#endif
+
+ // build the flows
+ //~ this needs to be adjusted for writing mode (vertical text)
+ //~ this also needs to account for right-to-left column ordering
+ blkArray = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *));
+ memcpy(blkArray, blocks, nBlocks * sizeof(TextBlock *));
+ flows = lastFlow = NULL;
+ firstBlkIdx = 0;
+ nBlocksLeft = nBlocks;
+ while (nBlocksLeft > 0) {
+
+ // find the upper-left-most block
+ for (; !blkArray[firstBlkIdx]; ++firstBlkIdx) ;
+ i = firstBlkIdx;
+ blk = blkArray[i];
+ for (j = firstBlkIdx + 1; j < nBlocks; ++j) {
+ blk1 = blkArray[j];
+ if (blk1) {
+ if (blk && blk->secondaryDelta(blk1) > 0) {
+ break;
+ }
+ if (blk1->primaryCmp(blk) < 0) {
+ i = j;
+ blk = blk1;
+ }
+ }
+ }
+ blkArray[i] = NULL;
+ --nBlocksLeft;
+ blk->next = NULL;
+
+ // create a new flow, starting with the upper-left-most block
+ flow = new TextFlow(this, blk);
+ if (lastFlow) {
+ lastFlow->next = flow;
+ } else {
+ flows = flow;
+ }
+ lastFlow = flow;
+ fontSize = blk->lines->words->fontSize;
+
+ // push the upper-left-most block on the stack
+ blk->stackNext = NULL;
+ blkStack = blk;
+
+ // find the other blocks in this flow
+ while (blkStack) {
+
+ // find the upper-left-most block under (but within
+ // maxBlockSpacing of) the top block on the stack
+ blkSpace = maxBlockSpacing * blkStack->lines->words->fontSize;
+ blk = NULL;
+ i = -1;
+ for (j = firstBlkIdx; j < nBlocks; ++j) {
+ blk1 = blkArray[j];
+ if (blk1) {
+ if (blkStack->secondaryDelta(blk1) > blkSpace) {
+ break;
+ }
+ if (blk && blk->secondaryDelta(blk1) > 0) {
+ break;
+ }
+ if (blk1->isBelow(blkStack) &&
+ (!blk || blk1->primaryCmp(blk) < 0)) {
+ i = j;
+ blk = blk1;
+ }
+ }
+ }
+
+ // if a suitable block was found, add it to the flow and push it
+ // onto the stack
+ if (blk && flow->blockFits(blk, blkStack)) {
+ blkArray[i] = NULL;
+ --nBlocksLeft;
+ blk->next = NULL;
+ flow->addBlock(blk);
+ fontSize = blk->lines->words->fontSize;
+ blk->stackNext = blkStack;
+ blkStack = blk;
+
+ // otherwise (if there is no block under the top block or the
+ // block is not suitable), pop the stack
+ } else {
+ blkStack = blkStack->stackNext;
+ }
+ }
+ }
+ gfree(blkArray);
+
+#if 0 // for debugging
+ printf("*** flows ***\n");
+ for (flow = flows; flow; flow = flow->next) {
+ printf("flow: x=%.2f..%.2f y=%.2f..%.2f pri:%.2f..%.2f\n",
+ flow->xMin, flow->xMax, flow->yMin, flow->yMax,
+ flow->priMin, flow->priMax);
+ for (blk = flow->blocks; blk; blk = blk->next) {
+ printf(" block: rot=%d x=%.2f..%.2f y=%.2f..%.2f pri=%.2f..%.2f\n",
+ blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax,
+ blk->priMin, blk->priMax);
+ for (line = blk->lines; line; line = line->next) {
+ printf(" line:\n");
+ for (word0 = line->words; word0; word0 = word0->next) {
+ printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '",
+ word0->xMin, word0->xMax, word0->yMin, word0->yMax,
+ word0->base, word0->fontSize, word0->spaceAfter);
+ for (i = 0; i < word0->len; ++i) {
+ fputc(word0->text[i] & 0xff, stdout);
+ }
+ printf("'\n");
+ }
+ }
+ }
+ }
+ printf("\n");
+#endif
+
+ if (uMap) {
+ uMap->decRefCnt();
+ }
+}
+
+GBool TextPage::findText(Unicode *s, int len,
+ GBool startAtTop, GBool stopAtBottom,
+ GBool startAtLast, GBool stopAtLast,
+ GBool caseSensitive, GBool backward,
+ double *xMin, double *yMin,
+ double *xMax, double *yMax) {
+ TextBlock *blk;
+ TextLine *line;
+ Unicode *s2, *txt;
+ Unicode *p;
+ int txtSize, m, i, j, k;
+ double xStart, yStart, xStop, yStop;
+ double xMin0, yMin0, xMax0, yMax0;
+ double xMin1, yMin1, xMax1, yMax1;
+ GBool found;
+
+ //~ needs to handle right-to-left text
+
+ if (rawOrder) {
+ return gFalse;
+ }
+
+ // convert the search string to uppercase
+ if (!caseSensitive) {
+ s2 = (Unicode *)gmallocn(len, sizeof(Unicode));
+ for (i = 0; i < len; ++i) {
+ s2[i] = unicodeToUpper(s[i]);
+ }
+ } else {
+ s2 = s;
+ }
+
+ txt = NULL;
+ txtSize = 0;
+
+ xStart = yStart = xStop = yStop = 0;
+ if (startAtLast && haveLastFind) {
+ xStart = lastFindXMin;
+ yStart = lastFindYMin;
+ } else if (!startAtTop) {
+ xStart = *xMin;
+ yStart = *yMin;
+ }
+ if (stopAtLast && haveLastFind) {
+ xStop = lastFindXMin;
+ yStop = lastFindYMin;
+ } else if (!stopAtBottom) {
+ xStop = *xMax;
+ yStop = *yMax;
+ }
+
+ found = gFalse;
+ xMin0 = xMax0 = yMin0 = yMax0 = 0; // make gcc happy
+ xMin1 = xMax1 = yMin1 = yMax1 = 0; // make gcc happy
+
+ for (i = backward ? nBlocks - 1 : 0;
+ backward ? i >= 0 : i < nBlocks;
+ i += backward ? -1 : 1) {
+ blk = blocks[i];
+
+ // check: is the block above the top limit?
+ if (!startAtTop && (backward ? blk->yMin > yStart : blk->yMax < yStart)) {
+ continue;
+ }
+
+ // check: is the block below the bottom limit?
+ if (!stopAtBottom && (backward ? blk->yMax < yStop : blk->yMin > yStop)) {
+ break;
+ }
+
+ for (line = blk->lines; line; line = line->next) {
+
+ // check: is the line above the top limit?
+ if (!startAtTop &&
+ (backward ? line->yMin > yStart : line->yMin < yStart)) {
+ continue;
+ }
+
+ // check: is the line below the bottom limit?
+ if (!stopAtBottom &&
+ (backward ? line->yMin < yStop : line->yMin > yStop)) {
+ continue;
+ }
+
+ // convert the line to uppercase
+ m = line->len;
+ if (!caseSensitive) {
+ if (m > txtSize) {
+ txt = (Unicode *)greallocn(txt, m, sizeof(Unicode));
+ txtSize = m;
+ }
+ for (k = 0; k < m; ++k) {
+ txt[k] = unicodeToUpper(line->text[k]);
+ }
+ } else {
+ txt = line->text;
+ }
+
+ // search each position in this line
+ j = backward ? m - len : 0;
+ p = txt + j;
+ while (backward ? j >= 0 : j <= m - len) {
+
+ // compare the strings
+ for (k = 0; k < len; ++k) {
+ if (p[k] != s2[k]) {
+ break;
+ }
+ }
+
+ // found it
+ if (k == len) {
+ switch (line->rot) {
+ case 0:
+ xMin1 = line->edge[j];
+ xMax1 = line->edge[j + len];
+ yMin1 = line->yMin;
+ yMax1 = line->yMax;
+ break;
+ case 1:
+ xMin1 = line->xMin;
+ xMax1 = line->xMax;
+ yMin1 = line->edge[j];
+ yMax1 = line->edge[j + len];
+ break;
+ case 2:
+ xMin1 = line->edge[j + len];
+ xMax1 = line->edge[j];
+ yMin1 = line->yMin;
+ yMax1 = line->yMax;
+ break;
+ case 3:
+ xMin1 = line->xMin;
+ xMax1 = line->xMax;
+ yMin1 = line->edge[j + len];
+ yMax1 = line->edge[j];
+ break;
+ }
+ if (backward) {
+ if ((startAtTop ||
+ yMin1 < yStart || (yMin1 == yStart && xMin1 < xStart)) &&
+ (stopAtBottom ||
+ yMin1 > yStop || (yMin1 == yStop && xMin1 > xStop))) {
+ if (!found ||
+ yMin1 > yMin0 || (yMin1 == yMin0 && xMin1 > xMin0)) {
+ xMin0 = xMin1;
+ xMax0 = xMax1;
+ yMin0 = yMin1;
+ yMax0 = yMax1;
+ found = gTrue;
+ }
+ }
+ } else {
+ if ((startAtTop ||
+ yMin1 > yStart || (yMin1 == yStart && xMin1 > xStart)) &&
+ (stopAtBottom ||
+ yMin1 < yStop || (yMin1 == yStop && xMin1 < xStop))) {
+ if (!found ||
+ yMin1 < yMin0 || (yMin1 == yMin0 && xMin1 < xMin0)) {
+ xMin0 = xMin1;
+ xMax0 = xMax1;
+ yMin0 = yMin1;
+ yMax0 = yMax1;
+ found = gTrue;
+ }
+ }
+ }
+ }
+ if (backward) {
+ --j;
+ --p;
+ } else {
+ ++j;
+ ++p;
+ }
+ }
+ }
+ }
+
+ if (!caseSensitive) {
+ gfree(s2);
+ gfree(txt);
+ }
+
+ if (found) {
+ *xMin = xMin0;
+ *xMax = xMax0;
+ *yMin = yMin0;
+ *yMax = yMax0;
+ lastFindXMin = xMin0;
+ lastFindYMin = yMin0;
+ haveLastFind = gTrue;
+ return gTrue;
+ }
+
+ return gFalse;
+}
+
+GString *TextPage::getText(double xMin, double yMin,
+ double xMax, double yMax) {
+ GString *s;
+ UnicodeMap *uMap;
+ GBool isUnicode;
+ TextBlock *blk;
+ TextLine *line;
+ TextLineFrag *frags;
+ int nFrags, fragsSize;
+ TextLineFrag *frag;
+ char space[8], eol[16];
+ int spaceLen, eolLen;
+ int lastRot;
+ double x, y, delta;
+ int col, idx0, idx1, i, j;
+ GBool multiLine, oneRot;
+
+ s = new GString();
+
+ if (rawOrder) {
+ return s;
+ }
+
+ // get the output encoding
+ if (!(uMap = globalParams->getTextEncoding())) {
+ return s;
+ }
+ isUnicode = uMap->isUnicode();
+ spaceLen = uMap->mapUnicode(0x20, space, sizeof(space));
+ eolLen = 0; // make gcc happy
+ switch (globalParams->getTextEOL()) {
+ case eolUnix:
+ eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol));
+ break;
+ case eolDOS:
+ eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
+ eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen);
+ break;
+ case eolMac:
+ eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
+ break;
+ }
+
+ //~ writing mode (horiz/vert)
+
+ // collect the line fragments that are in the rectangle
+ fragsSize = 256;
+ frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag));
+ nFrags = 0;
+ lastRot = -1;
+ oneRot = gTrue;
+ for (i = 0; i < nBlocks; ++i) {
+ blk = blocks[i];
+ if (xMin < blk->xMax && blk->xMin < xMax &&
+ yMin < blk->yMax && blk->yMin < yMax) {
+ for (line = blk->lines; line; line = line->next) {
+ if (xMin < line->xMax && line->xMin < xMax &&
+ yMin < line->yMax && line->yMin < yMax) {
+ idx0 = idx1 = -1;
+ switch (line->rot) {
+ case 0:
+ y = 0.5 * (line->yMin + line->yMax);
+ if (yMin < y && y < yMax) {
+ j = 0;
+ while (j < line->len) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) > xMin) {
+ idx0 = j;
+ break;
+ }
+ ++j;
+ }
+ j = line->len - 1;
+ while (j >= 0) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) < xMax) {
+ idx1 = j;
+ break;
+ }
+ --j;
+ }
+ }
+ break;
+ case 1:
+ x = 0.5 * (line->xMin + line->xMax);
+ if (xMin < x && x < xMax) {
+ j = 0;
+ while (j < line->len) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) > yMin) {
+ idx0 = j;
+ break;
+ }
+ ++j;
+ }
+ j = line->len - 1;
+ while (j >= 0) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) < yMax) {
+ idx1 = j;
+ break;
+ }
+ --j;
+ }
+ }
+ break;
+ case 2:
+ y = 0.5 * (line->yMin + line->yMax);
+ if (yMin < y && y < yMax) {
+ j = 0;
+ while (j < line->len) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) < xMax) {
+ idx0 = j;
+ break;
+ }
+ ++j;
+ }
+ j = line->len - 1;
+ while (j >= 0) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) > xMin) {
+ idx1 = j;
+ break;
+ }
+ --j;
+ }
+ }
+ break;
+ case 3:
+ x = 0.5 * (line->xMin + line->xMax);
+ if (xMin < x && x < xMax) {
+ j = 0;
+ while (j < line->len) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) < yMax) {
+ idx0 = j;
+ break;
+ }
+ ++j;
+ }
+ j = line->len - 1;
+ while (j >= 0) {
+ if (0.5 * (line->edge[j] + line->edge[j+1]) > yMin) {
+ idx1 = j;
+ break;
+ }
+ --j;
+ }
+ }
+ break;
+ }
+ if (idx0 >= 0 && idx1 >= 0) {
+ if (nFrags == fragsSize) {
+ fragsSize *= 2;
+ frags = (TextLineFrag *)
+ greallocn(frags, fragsSize, sizeof(TextLineFrag));
+ }
+ frags[nFrags].init(line, idx0, idx1 - idx0 + 1);
+ ++nFrags;
+ if (lastRot >= 0 && line->rot != lastRot) {
+ oneRot = gFalse;
+ }
+ lastRot = line->rot;
+ }
+ }
+ }
+ }
+ }
+
+ // sort the fragments and generate the string
+ if (nFrags > 0) {
+
+ for (i = 0; i < nFrags; ++i) {
+ frags[i].computeCoords(oneRot);
+ }
+ assignColumns(frags, nFrags, oneRot);
+
+ // if all lines in the region have the same rotation, use it;
+ // otherwise, use the page's primary rotation
+ if (oneRot) {
+ qsort(frags, nFrags, sizeof(TextLineFrag),
+ &TextLineFrag::cmpYXLineRot);
+ } else {
+ qsort(frags, nFrags, sizeof(TextLineFrag),
+ &TextLineFrag::cmpYXPrimaryRot);
+ }
+ i = 0;
+ while (i < nFrags) {
+ delta = maxIntraLineDelta * frags[i].line->words->fontSize;
+ for (j = i+1;
+ j < nFrags && fabs(frags[j].base - frags[i].base) < delta;
+ ++j) ;
+ qsort(frags + i, j - i, sizeof(TextLineFrag),
+ oneRot ? &TextLineFrag::cmpXYColumnLineRot
+ : &TextLineFrag::cmpXYColumnPrimaryRot);
+ i = j;
+ }
+
+ col = 0;
+ multiLine = gFalse;
+ for (i = 0; i < nFrags; ++i) {
+ frag = &frags[i];
+
+ // insert a return
+ if (frag->col < col ||
+ (i > 0 && fabs(frag->base - frags[i-1].base) >
+ maxIntraLineDelta * frags[i-1].line->words->fontSize)) {
+ s->append(eol, eolLen);
+ col = 0;
+ multiLine = gTrue;
+ }
+
+ // column alignment
+ for (; col < frag->col; ++col) {
+ s->append(space, spaceLen);
+ }
+
+ // get the fragment text
+ col += dumpFragment(frag->line->text + frag->start, frag->len, uMap, s);
+ }
+
+ if (multiLine) {
+ s->append(eol, eolLen);
+ }
+ }
+
+ gfree(frags);
+ uMap->decRefCnt();
+
+ return s;
+}
+
+GBool TextPage::findCharRange(int pos, int length,
+ double *xMin, double *yMin,
+ double *xMax, double *yMax) {
+ TextBlock *blk;
+ TextLine *line;
+ TextWord *word;
+ double xMin0, xMax0, yMin0, yMax0;
+ double xMin1, xMax1, yMin1, yMax1;
+ GBool first;
+ int i, j0, j1;
+
+ if (rawOrder) {
+ return gFalse;
+ }
+
+ //~ this doesn't correctly handle:
+ //~ - ranges split across multiple lines (the highlighted region
+ //~ is the bounding box of all the parts of the range)
+ //~ - cases where characters don't convert one-to-one into Unicode
+ first = gTrue;
+ xMin0 = xMax0 = yMin0 = yMax0 = 0; // make gcc happy
+ xMin1 = xMax1 = yMin1 = yMax1 = 0; // make gcc happy
+ for (i = 0; i < nBlocks; ++i) {
+ blk = blocks[i];
+ for (line = blk->lines; line; line = line->next) {
+ for (word = line->words; word; word = word->next) {
+ if (pos < word->charPos + word->charLen &&
+ word->charPos < pos + length) {
+ j0 = pos - word->charPos;
+ if (j0 < 0) {
+ j0 = 0;
+ }
+ j1 = pos + length - 1 - word->charPos;
+ if (j1 >= word->len) {
+ j1 = word->len - 1;
+ }
+ switch (line->rot) {
+ case 0:
+ xMin1 = word->edge[j0];
+ xMax1 = word->edge[j1 + 1];
+ yMin1 = word->yMin;
+ yMax1 = word->yMax;
+ break;
+ case 1:
+ xMin1 = word->xMin;
+ xMax1 = word->xMax;
+ yMin1 = word->edge[j0];
+ yMax1 = word->edge[j1 + 1];
+ break;
+ case 2:
+ xMin1 = word->edge[j1 + 1];
+ xMax1 = word->edge[j0];
+ yMin1 = word->yMin;
+ yMax1 = word->yMax;
+ break;
+ case 3:
+ xMin1 = word->xMin;
+ xMax1 = word->xMax;
+ yMin1 = word->edge[j1 + 1];
+ yMax1 = word->edge[j0];
+ break;
+ }
+ if (first || xMin1 < xMin0) {
+ xMin0 = xMin1;
+ }
+ if (first || xMax1 > xMax0) {
+ xMax0 = xMax1;
+ }
+ if (first || yMin1 < yMin0) {
+ yMin0 = yMin1;
+ }
+ if (first || yMax1 > yMax0) {
+ yMax0 = yMax1;
+ }
+ first = gFalse;
+ }
+ }
+ }
+ }
+ if (!first) {
+ *xMin = xMin0;
+ *xMax = xMax0;
+ *yMin = yMin0;
+ *yMax = yMax0;
+ return gTrue;
+ }
+ return gFalse;
+}
+
+void TextPage::dump(void *outputStream, TextOutputFunc outputFunc,
+ GBool physLayout) {
+ UnicodeMap *uMap;
+ TextFlow *flow;
+ TextBlock *blk;
+ TextLine *line;
+ TextLineFrag *frags;
+ TextWord *word;
+ int nFrags, fragsSize;
+ TextLineFrag *frag;
+ char space[8], eol[16], eop[8];
+ int spaceLen, eolLen, eopLen;
+ GBool pageBreaks;
+ GString *s;
+ double delta;
+ int col, i, j, d, n;
+
+ // get the output encoding
+ if (!(uMap = globalParams->getTextEncoding())) {
+ return;
+ }
+ spaceLen = uMap->mapUnicode(0x20, space, sizeof(space));
+ eolLen = 0; // make gcc happy
+ switch (globalParams->getTextEOL()) {
+ case eolUnix:
+ eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol));
+ break;
+ case eolDOS:
+ eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
+ eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen);
+ break;
+ case eolMac:
+ eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
+ break;
+ }
+ eopLen = uMap->mapUnicode(0x0c, eop, sizeof(eop));
+ pageBreaks = globalParams->getTextPageBreaks();
+
+ //~ writing mode (horiz/vert)
+
+ // output the page in raw (content stream) order
+ if (rawOrder) {
+
+ for (word = rawWords; word; word = word->next) {
+ s = new GString();
+ dumpFragment(word->text, word->len, uMap, s);
+ (*outputFunc)(outputStream, s->getCString(), s->getLength());
+ delete s;
+ if (word->next &&
+ fabs(word->next->base - word->base) <
+ maxIntraLineDelta * word->fontSize) {
+ if (word->next->xMin > word->xMax + minWordSpacing * word->fontSize) {
+ (*outputFunc)(outputStream, space, spaceLen);
+ }
+ } else {
+ (*outputFunc)(outputStream, eol, eolLen);
+ }
+ }
+
+ // output the page, maintaining the original physical layout
+ } else if (physLayout) {
+
+ // collect the line fragments for the page and sort them
+ fragsSize = 256;
+ frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag));
+ nFrags = 0;
+ for (i = 0; i < nBlocks; ++i) {
+ blk = blocks[i];
+ for (line = blk->lines; line; line = line->next) {
+ if (nFrags == fragsSize) {
+ fragsSize *= 2;
+ frags = (TextLineFrag *)greallocn(frags,
+ fragsSize, sizeof(TextLineFrag));
+ }
+ frags[nFrags].init(line, 0, line->len);
+ frags[nFrags].computeCoords(gTrue);
+ ++nFrags;
+ }
+ }
+ qsort(frags, nFrags, sizeof(TextLineFrag), &TextLineFrag::cmpYXPrimaryRot);
+ i = 0;
+ while (i < nFrags) {
+ delta = maxIntraLineDelta * frags[i].line->words->fontSize;
+ for (j = i+1;
+ j < nFrags && fabs(frags[j].base - frags[i].base) < delta;
+ ++j) ;
+ qsort(frags + i, j - i, sizeof(TextLineFrag),
+ &TextLineFrag::cmpXYColumnPrimaryRot);
+ i = j;
+ }
+
+#if 0 // for debugging
+ printf("*** line fragments ***\n");
+ for (i = 0; i < nFrags; ++i) {
+ frag = &frags[i];
+ printf("frag: x=%.2f..%.2f y=%.2f..%.2f base=%.2f '",
+ frag->xMin, frag->xMax, frag->yMin, frag->yMax, frag->base);
+ for (n = 0; n < frag->len; ++n) {
+ fputc(frag->line->text[frag->start + n] & 0xff, stdout);
+ }
+ printf("'\n");
+ }
+ printf("\n");
+#endif
+
+ // generate output
+ col = 0;
+ for (i = 0; i < nFrags; ++i) {
+ frag = &frags[i];
+
+ // column alignment
+ for (; col < frag->col; ++col) {
+ (*outputFunc)(outputStream, space, spaceLen);
+ }
+
+ // print the line
+ s = new GString();
+ col += dumpFragment(frag->line->text + frag->start, frag->len, uMap, s);
+ (*outputFunc)(outputStream, s->getCString(), s->getLength());
+ delete s;
+
+ // print one or more returns if necessary
+ if (i == nFrags - 1 ||
+ frags[i+1].col < col ||
+ fabs(frags[i+1].base - frag->base) >
+ maxIntraLineDelta * frag->line->words->fontSize) {
+ if (i < nFrags - 1) {
+ d = (int)((frags[i+1].base - frag->base) /
+ frag->line->words->fontSize);
+ if (d < 1) {
+ d = 1;
+ } else if (d > 5) {
+ d = 5;
+ }
+ } else {
+ d = 1;
+ }
+ for (; d > 0; --d) {
+ (*outputFunc)(outputStream, eol, eolLen);
+ }
+ col = 0;
+ }
+ }
+
+ gfree(frags);
+
+ // output the page, "undoing" the layout
+ } else {
+ for (flow = flows; flow; flow = flow->next) {
+ for (blk = flow->blocks; blk; blk = blk->next) {
+ for (line = blk->lines; line; line = line->next) {
+ n = line->len;
+ if (line->hyphenated && (line->next || blk->next)) {
+ --n;
+ }
+ s = new GString();
+ dumpFragment(line->text, n, uMap, s);
+ (*outputFunc)(outputStream, s->getCString(), s->getLength());
+ delete s;
+ if (!line->hyphenated) {
+ if (line->next) {
+ (*outputFunc)(outputStream, space, spaceLen);
+ } else if (blk->next) {
+ //~ this is a bit of a kludge - we should really do a more
+ //~ intelligent determination of paragraphs
+ if (blk->next->lines->words->fontSize ==
+ blk->lines->words->fontSize) {
+ (*outputFunc)(outputStream, space, spaceLen);
+ } else {
+ (*outputFunc)(outputStream, eol, eolLen);
+ }
+ }
+ }
+ }
+ }
+ (*outputFunc)(outputStream, eol, eolLen);
+ (*outputFunc)(outputStream, eol, eolLen);
+ }
+ }
+
+ // end of page
+ if (pageBreaks) {
+ (*outputFunc)(outputStream, eop, eopLen);
+ }
+
+ uMap->decRefCnt();
+}
+
+void TextPage::assignColumns(TextLineFrag *frags, int nFrags, GBool oneRot) {
+ TextLineFrag *frag0, *frag1;
+ int rot, col1, col2, i, j, k;
+
+ // all text in the region has the same rotation -- recompute the
+ // column numbers based only on the text in the region
+ if (oneRot) {
+ qsort(frags, nFrags, sizeof(TextLineFrag), &TextLineFrag::cmpXYLineRot);
+ rot = frags[0].line->rot;
+ for (i = 0; i < nFrags; ++i) {
+ frag0 = &frags[i];
+ col1 = 0;
+ for (j = 0; j < i; ++j) {
+ frag1 = &frags[j];
+ col2 = 0; // make gcc happy
+ switch (rot) {
+ case 0:
+ if (frag0->xMin >= frag1->xMax) {
+ col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
+ frag1->line->col[frag1->start]) + 1;
+ } else {
+ for (k = frag1->start;
+ k < frag1->start + frag1->len &&
+ frag0->xMin >= 0.5 * (frag1->line->edge[k] +
+ frag1->line->edge[k+1]);
+ ++k) ;
+ col2 = frag1->col +
+ frag1->line->col[k] - frag1->line->col[frag1->start];
+ }
+ break;
+ case 1:
+ if (frag0->yMin >= frag1->yMax) {
+ col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
+ frag1->line->col[frag1->start]) + 1;
+ } else {
+ for (k = frag1->start;
+ k < frag1->start + frag1->len &&
+ frag0->yMin >= 0.5 * (frag1->line->edge[k] +
+ frag1->line->edge[k+1]);
+ ++k) ;
+ col2 = frag1->col +
+ frag1->line->col[k] - frag1->line->col[frag1->start];
+ }
+ break;
+ case 2:
+ if (frag0->xMax <= frag1->xMin) {
+ col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
+ frag1->line->col[frag1->start]) + 1;
+ } else {
+ for (k = frag1->start;
+ k < frag1->start + frag1->len &&
+ frag0->xMax <= 0.5 * (frag1->line->edge[k] +
+ frag1->line->edge[k+1]);
+ ++k) ;
+ col2 = frag1->col +
+ frag1->line->col[k] - frag1->line->col[frag1->start];
+ }
+ break;
+ case 3:
+ if (frag0->yMax <= frag1->yMin) {
+ col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] -
+ frag1->line->col[frag1->start]) + 1;
+ } else {
+ for (k = frag1->start;
+ k < frag1->start + frag1->len &&
+ frag0->yMax <= 0.5 * (frag1->line->edge[k] +
+ frag1->line->edge[k+1]);
+ ++k) ;
+ col2 = frag1->col +
+ frag1->line->col[k] - frag1->line->col[frag1->start];
+ }
+ break;
+ }
+ if (col2 > col1) {
+ col1 = col2;
+ }
+ }
+ frag0->col = col1;
+ }
+
+ // the region includes text at different rotations -- use the
+ // globally assigned column numbers, offset by the minimum column
+ // number (i.e., shift everything over to column 0)
+ } else {
+ col1 = frags[0].col;
+ for (i = 1; i < nFrags; ++i) {
+ if (frags[i].col < col1) {
+ col1 = frags[i].col;
+ }
+ }
+ for (i = 0; i < nFrags; ++i) {
+ frags[i].col -= col1;
+ }
+ }
+}
+
+int TextPage::dumpFragment(Unicode *text, int len, UnicodeMap *uMap,
+ GString *s) {
+ char lre[8], rle[8], popdf[8], buf[8];
+ int lreLen, rleLen, popdfLen, n;
+ int nCols, i, j, k;
+
+ nCols = 0;
+
+ if (uMap->isUnicode()) {
+
+ lreLen = uMap->mapUnicode(0x202a, lre, sizeof(lre));
+ rleLen = uMap->mapUnicode(0x202b, rle, sizeof(rle));
+ popdfLen = uMap->mapUnicode(0x202c, popdf, sizeof(popdf));
+
+ if (primaryLR) {
+
+ i = 0;
+ while (i < len) {
+ // output a left-to-right section
+ for (j = i; j < len && !unicodeTypeR(text[j]); ++j) ;
+ for (k = i; k < j; ++k) {
+ n = uMap->mapUnicode(text[k], buf, sizeof(buf));
+ s->append(buf, n);
+ ++nCols;
+ }
+ i = j;
+ // output a right-to-left section
+ for (j = i; j < len && !unicodeTypeL(text[j]); ++j) ;
+ if (j > i) {
+ s->append(rle, rleLen);
+ for (k = j - 1; k >= i; --k) {
+ n = uMap->mapUnicode(text[k], buf, sizeof(buf));
+ s->append(buf, n);
+ ++nCols;
+ }
+ s->append(popdf, popdfLen);
+ i = j;
+ }
+ }
+
+ } else {
+
+ s->append(rle, rleLen);
+ i = len - 1;
+ while (i >= 0) {
+ // output a right-to-left section
+ for (j = i; j >= 0 && !unicodeTypeL(text[j]); --j) ;
+ for (k = i; k > j; --k) {
+ n = uMap->mapUnicode(text[k], buf, sizeof(buf));
+ s->append(buf, n);
+ ++nCols;
+ }
+ i = j;
+ // output a left-to-right section
+ for (j = i; j >= 0 && !unicodeTypeR(text[j]); --j) ;
+ if (j < i) {
+ s->append(lre, lreLen);
+ for (k = j + 1; k <= i; ++k) {
+ n = uMap->mapUnicode(text[k], buf, sizeof(buf));
+ s->append(buf, n);
+ ++nCols;
+ }
+ s->append(popdf, popdfLen);
+ i = j;
+ }
+ }
+ s->append(popdf, popdfLen);
+
+ }
+
+ } else {
+ for (i = 0; i < len; ++i) {
+ n = uMap->mapUnicode(text[i], buf, sizeof(buf));
+ s->append(buf, n);
+ nCols += n;
+ }
+ }
+
+ return nCols;
+}
+
+#if TEXTOUT_WORD_LIST
+TextWordList *TextPage::makeWordList(GBool physLayout) {
+ return new TextWordList(this, physLayout);
+}
+#endif
+
+//------------------------------------------------------------------------
+// TextOutputDev
+//------------------------------------------------------------------------
+
+static void TextOutputDev_outputToFile(void *stream, char *text, int len) {
+ fwrite(text, 1, len, (FILE *)stream);
+}
+
+TextOutputDev::TextOutputDev(char *fileName, GBool physLayoutA,
+ GBool rawOrderA, GBool append) {
+ text = NULL;
+ physLayout = physLayoutA;
+ rawOrder = rawOrderA;
+ doHTML = gFalse;
+ ok = gTrue;
+
+ // open file
+ needClose = gFalse;
+ if (fileName) {
+ if (!strcmp(fileName, "-")) {
+ outputStream = stdout;
+#ifdef WIN32
+ // keep DOS from munging the end-of-line characters
+ setmode(fileno(stdout), O_BINARY);
+#endif
+ } else if ((outputStream = fopen(fileName, append ? "ab" : "wb"))) {
+ needClose = gTrue;
+ } else {
+ error(-1, "Couldn't open text file '%s'", fileName);
+ ok = gFalse;
+ return;
+ }
+ outputFunc = &TextOutputDev_outputToFile;
+ } else {
+ outputStream = NULL;
+ }
+
+ // set up text object
+ text = new TextPage(rawOrderA);
+}
+
+TextOutputDev::TextOutputDev(TextOutputFunc func, void *stream,
+ GBool physLayoutA, GBool rawOrderA) {
+ outputFunc = func;
+ outputStream = stream;
+ needClose = gFalse;
+ physLayout = physLayoutA;
+ rawOrder = rawOrderA;
+ doHTML = gFalse;
+ text = new TextPage(rawOrderA);
+ ok = gTrue;
+}
+
+TextOutputDev::~TextOutputDev() {
+ if (needClose) {
+#ifdef MACOS
+ ICS_MapRefNumAndAssign((short)((FILE *)outputStream)->handle);
+#endif
+ fclose((FILE *)outputStream);
+ }
+ if (text) {
+ delete text;
+ }
+}
+
+void TextOutputDev::startPage(int /*pageNum*/, GfxState *state) {
+ text->startPage(state);
+}
+
+void TextOutputDev::endPage() {
+ text->endPage();
+ text->coalesce(physLayout, doHTML);
+ if (outputStream) {
+ text->dump(outputStream, outputFunc, physLayout);
+ }
+}
+
+void TextOutputDev::updateFont(GfxState *state) {
+ text->updateFont(state);
+}
+
+void TextOutputDev::beginString(GfxState * /*state*/, GString * /*s*/) {
+}
+
+void TextOutputDev::endString(GfxState * /*state*/) {
+}
+
+void TextOutputDev::drawChar(GfxState *state, double x, double y,
+ double dx, double dy,
+ double /*originX*/, double /*originY*/,
+ CharCode c, int nBytes, Unicode *u, int uLen) {
+ text->addChar(state, x, y, dx, dy, c, nBytes, u, uLen);
+}
+
+void TextOutputDev::stroke(GfxState *state) {
+ GfxPath *path;
+ GfxSubpath *subpath;
+ double x[2], y[2];
+
+ if (!doHTML) {
+ return;
+ }
+ path = state->getPath();
+ if (path->getNumSubpaths() != 1) {
+ return;
+ }
+ subpath = path->getSubpath(0);
+ if (subpath->getNumPoints() != 2) {
+ return;
+ }
+ state->transform(subpath->getX(0), subpath->getY(0), &x[0], &y[0]);
+ state->transform(subpath->getX(1), subpath->getY(1), &x[1], &y[1]);
+
+ // look for a vertical or horizontal line
+ if (x[0] == x[1] || y[0] == y[1]) {
+ text->addUnderline(x[0], y[0], x[1], y[1]);
+ }
+}
+
+void TextOutputDev::fill(GfxState *state) {
+ GfxPath *path;
+ GfxSubpath *subpath;
+ double x[5], y[5];
+ double rx0, ry0, rx1, ry1, t;
+ int i;
+
+ if (!doHTML) {
+ return;
+ }
+ path = state->getPath();
+ if (path->getNumSubpaths() != 1) {
+ return;
+ }
+ subpath = path->getSubpath(0);
+ if (subpath->getNumPoints() != 5) {
+ return;
+ }
+ for (i = 0; i < 5; ++i) {
+ if (subpath->getCurve(i)) {
+ return;
+ }
+ state->transform(subpath->getX(i), subpath->getY(i), &x[i], &y[i]);
+ }
+
+ // look for a rectangle
+ if (x[0] == x[1] && y[1] == y[2] && x[2] == x[3] && y[3] == y[4] &&
+ x[0] == x[4] && y[0] == y[4]) {
+ rx0 = x[0];
+ ry0 = y[0];
+ rx1 = x[2];
+ ry1 = y[1];
+ } else if (y[0] == y[1] && x[1] == x[2] && y[2] == y[3] && x[3] == x[4] &&
+ x[0] == x[4] && y[0] == y[4]) {
+ rx0 = x[0];
+ ry0 = y[0];
+ rx1 = x[1];
+ ry1 = y[2];
+ } else {
+ return;
+ }
+ if (rx1 < rx0) {
+ t = rx0;
+ rx0 = rx1;
+ rx1 = t;
+ }
+ if (ry1 < ry0) {
+ t = ry0;
+ ry0 = ry1;
+ ry1 = t;
+ }
+
+ // skinny horizontal rectangle
+ if (ry1 - ry0 < rx1 - rx0) {
+ if (ry1 - ry0 < maxUnderlineWidth) {
+ ry0 = 0.5 * (ry0 + ry1);
+ text->addUnderline(rx0, ry0, rx1, ry0);
+ }
+
+ // skinny vertical rectangle
+ } else {
+ if (rx1 - rx0 < maxUnderlineWidth) {
+ rx0 = 0.5 * (rx0 + rx1);
+ text->addUnderline(rx0, ry0, rx0, ry1);
+ }
+ }
+}
+
+void TextOutputDev::eoFill(GfxState *state) {
+ if (!doHTML) {
+ return;
+ }
+ fill(state);
+}
+
+void TextOutputDev::processLink(Link *link, Catalog * /*catalog*/) {
+ double x1, y1, x2, y2;
+ int xMin, yMin, xMax, yMax, x, y;
+
+ if (!doHTML) {
+ return;
+ }
+ link->getRect(&x1, &y1, &x2, &y2);
+ cvtUserToDev(x1, y1, &x, &y);
+ xMin = xMax = x;
+ yMin = yMax = y;
+ cvtUserToDev(x1, y2, &x, &y);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ cvtUserToDev(x2, y1, &x, &y);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ cvtUserToDev(x2, y2, &x, &y);
+ if (x < xMin) {
+ xMin = x;
+ } else if (x > xMax) {
+ xMax = x;
+ }
+ if (y < yMin) {
+ yMin = y;
+ } else if (y > yMax) {
+ yMax = y;
+ }
+ text->addLink(xMin, yMin, xMax, yMax, link);
+}
+
+GBool TextOutputDev::findText(Unicode *s, int len,
+ GBool startAtTop, GBool stopAtBottom,
+ GBool startAtLast, GBool stopAtLast,
+ GBool caseSensitive, GBool backward,
+ double *xMin, double *yMin,
+ double *xMax, double *yMax) {
+ return text->findText(s, len, startAtTop, stopAtBottom,
+ startAtLast, stopAtLast, caseSensitive, backward,
+ xMin, yMin, xMax, yMax);
+}
+
+GString *TextOutputDev::getText(double xMin, double yMin,
+ double xMax, double yMax) {
+ return text->getText(xMin, yMin, xMax, yMax);
+}
+
+GBool TextOutputDev::findCharRange(int pos, int length,
+ double *xMin, double *yMin,
+ double *xMax, double *yMax) {
+ return text->findCharRange(pos, length, xMin, yMin, xMax, yMax);
+}
+
+#if TEXTOUT_WORD_LIST
+TextWordList *TextOutputDev::makeWordList() {
+ return text->makeWordList(physLayout);
+}
+#endif
+
+TextPage *TextOutputDev::takeText() {
+ TextPage *ret;
+
+ ret = text;
+ text = new TextPage(rawOrder);
+ return ret;
+}
diff --git a/kpdf/xpdf/xpdf/UnicodeMap.cc b/kpdf/xpdf/xpdf/UnicodeMap.cc
deleted file mode 100644
index 2b8cb1f7..00000000
--- a/kpdf/xpdf/xpdf/UnicodeMap.cc
+++ /dev/null
@@ -1,293 +0,0 @@
-//========================================================================
-//
-// UnicodeMap.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include "gmem.h"
-#include "gfile.h"
-#include "GString.h"
-#include "GList.h"
-#include "Error.h"
-#include "GlobalParams.h"
-#include "UnicodeMap.h"
-
-//------------------------------------------------------------------------
-
-#define maxExtCode 16
-
-struct UnicodeMapExt {
- Unicode u; // Unicode char
- char code[maxExtCode];
- Guint nBytes;
-};
-
-//------------------------------------------------------------------------
-
-UnicodeMap *UnicodeMap::parse(GString *encodingNameA) {
- FILE *f;
- UnicodeMap *map;
- UnicodeMapRange *range;
- UnicodeMapExt *eMap;
- int size, eMapsSize;
- char buf[256];
- int line, nBytes, i, x;
- char *tok1, *tok2, *tok3;
-
- if (!(f = globalParams->getUnicodeMapFile(encodingNameA))) {
- error(-1, "Couldn't find unicodeMap file for the '%s' encoding",
- encodingNameA->getCString());
- return NULL;
- }
-
- map = new UnicodeMap(encodingNameA->copy());
-
- size = 8;
- map->ranges = (UnicodeMapRange *)gmallocn(size, sizeof(UnicodeMapRange));
- eMapsSize = 0;
-
- line = 1;
- while (getLine(buf, sizeof(buf), f)) {
- if ((tok1 = strtok(buf, " \t\r\n")) &&
- (tok2 = strtok(NULL, " \t\r\n"))) {
- if (!(tok3 = strtok(NULL, " \t\r\n"))) {
- tok3 = tok2;
- tok2 = tok1;
- }
- nBytes = strlen(tok3) / 2;
- if (nBytes <= 4) {
- if (map->len == size) {
- size *= 2;
- map->ranges = (UnicodeMapRange *)
- greallocn(map->ranges, size, sizeof(UnicodeMapRange));
- }
- range = &map->ranges[map->len];
- sscanf(tok1, "%x", &range->start);
- sscanf(tok2, "%x", &range->end);
- sscanf(tok3, "%x", &range->code);
- range->nBytes = nBytes;
- ++map->len;
- } else if (tok2 == tok1) {
- if (map->eMapsLen == eMapsSize) {
- eMapsSize += 16;
- map->eMaps = (UnicodeMapExt *)
- greallocn(map->eMaps, eMapsSize, sizeof(UnicodeMapExt));
- }
- eMap = &map->eMaps[map->eMapsLen];
- sscanf(tok1, "%x", &eMap->u);
- for (i = 0; i < nBytes; ++i) {
- sscanf(tok3 + i*2, "%2x", &x);
- eMap->code[i] = (char)x;
- }
- eMap->nBytes = nBytes;
- ++map->eMapsLen;
- } else {
- error(-1, "Bad line (%d) in unicodeMap file for the '%s' encoding",
- line, encodingNameA->getCString());
- }
- } else {
- error(-1, "Bad line (%d) in unicodeMap file for the '%s' encoding",
- line, encodingNameA->getCString());
- }
- ++line;
- }
-
- fclose(f);
-
- return map;
-}
-
-UnicodeMap::UnicodeMap(GString *encodingNameA) {
- encodingName = encodingNameA;
- unicodeOut = gFalse;
- kind = unicodeMapUser;
- ranges = NULL;
- len = 0;
- eMaps = NULL;
- eMapsLen = 0;
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
- UnicodeMapRange *rangesA, int lenA) {
- encodingName = new GString(encodingNameA);
- unicodeOut = unicodeOutA;
- kind = unicodeMapResident;
- ranges = rangesA;
- len = lenA;
- eMaps = NULL;
- eMapsLen = 0;
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
- UnicodeMapFunc funcA) {
- encodingName = new GString(encodingNameA);
- unicodeOut = unicodeOutA;
- kind = unicodeMapFunc;
- func = funcA;
- eMaps = NULL;
- eMapsLen = 0;
- refCnt = 1;
-#if MULTITHREADED
- gInitMutex(&mutex);
-#endif
-}
-
-UnicodeMap::~UnicodeMap() {
- delete encodingName;
- if (kind == unicodeMapUser && ranges) {
- gfree(ranges);
- }
- if (eMaps) {
- gfree(eMaps);
- }
-#if MULTITHREADED
- gDestroyMutex(&mutex);
-#endif
-}
-
-void UnicodeMap::incRefCnt() {
-#if MULTITHREADED
- gLockMutex(&mutex);
-#endif
- ++refCnt;
-#if MULTITHREADED
- gUnlockMutex(&mutex);
-#endif
-}
-
-void UnicodeMap::decRefCnt() {
- GBool done;
-
-#if MULTITHREADED
- gLockMutex(&mutex);
-#endif
- done = --refCnt == 0;
-#if MULTITHREADED
- gUnlockMutex(&mutex);
-#endif
- if (done) {
- delete this;
- }
-}
-
-GBool UnicodeMap::match(GString *encodingNameA) {
- return !encodingName->cmp(encodingNameA);
-}
-
-int UnicodeMap::mapUnicode(Unicode u, char *buf, int bufSize) {
- int a, b, m, n, i, j;
- Guint code;
-
- if (kind == unicodeMapFunc) {
- return (*func)(u, buf, bufSize);
- }
-
- a = 0;
- b = len;
- if (u >= ranges[a].start) {
- // invariant: ranges[a].start <= u < ranges[b].start
- while (b - a > 1) {
- m = (a + b) / 2;
- if (u >= ranges[m].start) {
- a = m;
- } else if (u < ranges[m].start) {
- b = m;
- }
- }
- if (u <= ranges[a].end) {
- n = ranges[a].nBytes;
- if (n > bufSize) {
- return 0;
- }
- code = ranges[a].code + (u - ranges[a].start);
- for (i = n - 1; i >= 0; --i) {
- buf[i] = (char)(code & 0xff);
- code >>= 8;
- }
- return n;
- }
- }
-
- for (i = 0; i < eMapsLen; ++i) {
- if (eMaps[i].u == u) {
- n = eMaps[i].nBytes;
- for (j = 0; j < n; ++j) {
- buf[j] = eMaps[i].code[j];
- }
- return n;
- }
- }
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-UnicodeMapCache::UnicodeMapCache() {
- int i;
-
- for (i = 0; i < unicodeMapCacheSize; ++i) {
- cache[i] = NULL;
- }
-}
-
-UnicodeMapCache::~UnicodeMapCache() {
- int i;
-
- for (i = 0; i < unicodeMapCacheSize; ++i) {
- if (cache[i]) {
- cache[i]->decRefCnt();
- }
- }
-}
-
-UnicodeMap *UnicodeMapCache::getUnicodeMap(GString *encodingName) {
- UnicodeMap *map;
- int i, j;
-
- if (cache[0] && cache[0]->match(encodingName)) {
- cache[0]->incRefCnt();
- return cache[0];
- }
- for (i = 1; i < unicodeMapCacheSize; ++i) {
- if (cache[i] && cache[i]->match(encodingName)) {
- map = cache[i];
- for (j = i; j >= 1; --j) {
- cache[j] = cache[j - 1];
- }
- cache[0] = map;
- map->incRefCnt();
- return map;
- }
- }
- if ((map = UnicodeMap::parse(encodingName))) {
- if (cache[unicodeMapCacheSize - 1]) {
- cache[unicodeMapCacheSize - 1]->decRefCnt();
- }
- for (j = unicodeMapCacheSize - 1; j >= 1; --j) {
- cache[j] = cache[j - 1];
- }
- cache[0] = map;
- map->incRefCnt();
- return map;
- }
- return NULL;
-}
diff --git a/kpdf/xpdf/xpdf/UnicodeMap.cpp b/kpdf/xpdf/xpdf/UnicodeMap.cpp
new file mode 100644
index 00000000..f3d18715
--- /dev/null
+++ b/kpdf/xpdf/xpdf/UnicodeMap.cpp
@@ -0,0 +1,293 @@
+//========================================================================
+//
+// UnicodeMap.cpp
+//
+// Copyright 2001-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "gmem.h"
+#include "gfile.h"
+#include "GString.h"
+#include "GList.h"
+#include "Error.h"
+#include "GlobalParams.h"
+#include "UnicodeMap.h"
+
+//------------------------------------------------------------------------
+
+#define maxExtCode 16
+
+struct UnicodeMapExt {
+ Unicode u; // Unicode char
+ char code[maxExtCode];
+ Guint nBytes;
+};
+
+//------------------------------------------------------------------------
+
+UnicodeMap *UnicodeMap::parse(GString *encodingNameA) {
+ FILE *f;
+ UnicodeMap *map;
+ UnicodeMapRange *range;
+ UnicodeMapExt *eMap;
+ int size, eMapsSize;
+ char buf[256];
+ int line, nBytes, i, x;
+ char *tok1, *tok2, *tok3;
+
+ if (!(f = globalParams->getUnicodeMapFile(encodingNameA))) {
+ error(-1, "Couldn't find unicodeMap file for the '%s' encoding",
+ encodingNameA->getCString());
+ return NULL;
+ }
+
+ map = new UnicodeMap(encodingNameA->copy());
+
+ size = 8;
+ map->ranges = (UnicodeMapRange *)gmallocn(size, sizeof(UnicodeMapRange));
+ eMapsSize = 0;
+
+ line = 1;
+ while (getLine(buf, sizeof(buf), f)) {
+ if ((tok1 = strtok(buf, " \t\r\n")) &&
+ (tok2 = strtok(NULL, " \t\r\n"))) {
+ if (!(tok3 = strtok(NULL, " \t\r\n"))) {
+ tok3 = tok2;
+ tok2 = tok1;
+ }
+ nBytes = strlen(tok3) / 2;
+ if (nBytes <= 4) {
+ if (map->len == size) {
+ size *= 2;
+ map->ranges = (UnicodeMapRange *)
+ greallocn(map->ranges, size, sizeof(UnicodeMapRange));
+ }
+ range = &map->ranges[map->len];
+ sscanf(tok1, "%x", &range->start);
+ sscanf(tok2, "%x", &range->end);
+ sscanf(tok3, "%x", &range->code);
+ range->nBytes = nBytes;
+ ++map->len;
+ } else if (tok2 == tok1) {
+ if (map->eMapsLen == eMapsSize) {
+ eMapsSize += 16;
+ map->eMaps = (UnicodeMapExt *)
+ greallocn(map->eMaps, eMapsSize, sizeof(UnicodeMapExt));
+ }
+ eMap = &map->eMaps[map->eMapsLen];
+ sscanf(tok1, "%x", &eMap->u);
+ for (i = 0; i < nBytes; ++i) {
+ sscanf(tok3 + i*2, "%2x", &x);
+ eMap->code[i] = (char)x;
+ }
+ eMap->nBytes = nBytes;
+ ++map->eMapsLen;
+ } else {
+ error(-1, "Bad line (%d) in unicodeMap file for the '%s' encoding",
+ line, encodingNameA->getCString());
+ }
+ } else {
+ error(-1, "Bad line (%d) in unicodeMap file for the '%s' encoding",
+ line, encodingNameA->getCString());
+ }
+ ++line;
+ }
+
+ fclose(f);
+
+ return map;
+}
+
+UnicodeMap::UnicodeMap(GString *encodingNameA) {
+ encodingName = encodingNameA;
+ unicodeOut = gFalse;
+ kind = unicodeMapUser;
+ ranges = NULL;
+ len = 0;
+ eMaps = NULL;
+ eMapsLen = 0;
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+ UnicodeMapRange *rangesA, int lenA) {
+ encodingName = new GString(encodingNameA);
+ unicodeOut = unicodeOutA;
+ kind = unicodeMapResident;
+ ranges = rangesA;
+ len = lenA;
+ eMaps = NULL;
+ eMapsLen = 0;
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+ UnicodeMapFunc funcA) {
+ encodingName = new GString(encodingNameA);
+ unicodeOut = unicodeOutA;
+ kind = unicodeMapFunc;
+ func = funcA;
+ eMaps = NULL;
+ eMapsLen = 0;
+ refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
+}
+
+UnicodeMap::~UnicodeMap() {
+ delete encodingName;
+ if (kind == unicodeMapUser && ranges) {
+ gfree(ranges);
+ }
+ if (eMaps) {
+ gfree(eMaps);
+ }
+#if MULTITHREADED
+ gDestroyMutex(&mutex);
+#endif
+}
+
+void UnicodeMap::incRefCnt() {
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ ++refCnt;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+}
+
+void UnicodeMap::decRefCnt() {
+ GBool done;
+
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ done = --refCnt == 0;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+ if (done) {
+ delete this;
+ }
+}
+
+GBool UnicodeMap::match(GString *encodingNameA) {
+ return !encodingName->cmp(encodingNameA);
+}
+
+int UnicodeMap::mapUnicode(Unicode u, char *buf, int bufSize) {
+ int a, b, m, n, i, j;
+ Guint code;
+
+ if (kind == unicodeMapFunc) {
+ return (*func)(u, buf, bufSize);
+ }
+
+ a = 0;
+ b = len;
+ if (u >= ranges[a].start) {
+ // invariant: ranges[a].start <= u < ranges[b].start
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (u >= ranges[m].start) {
+ a = m;
+ } else if (u < ranges[m].start) {
+ b = m;
+ }
+ }
+ if (u <= ranges[a].end) {
+ n = ranges[a].nBytes;
+ if (n > bufSize) {
+ return 0;
+ }
+ code = ranges[a].code + (u - ranges[a].start);
+ for (i = n - 1; i >= 0; --i) {
+ buf[i] = (char)(code & 0xff);
+ code >>= 8;
+ }
+ return n;
+ }
+ }
+
+ for (i = 0; i < eMapsLen; ++i) {
+ if (eMaps[i].u == u) {
+ n = eMaps[i].nBytes;
+ for (j = 0; j < n; ++j) {
+ buf[j] = eMaps[i].code[j];
+ }
+ return n;
+ }
+ }
+
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+UnicodeMapCache::UnicodeMapCache() {
+ int i;
+
+ for (i = 0; i < unicodeMapCacheSize; ++i) {
+ cache[i] = NULL;
+ }
+}
+
+UnicodeMapCache::~UnicodeMapCache() {
+ int i;
+
+ for (i = 0; i < unicodeMapCacheSize; ++i) {
+ if (cache[i]) {
+ cache[i]->decRefCnt();
+ }
+ }
+}
+
+UnicodeMap *UnicodeMapCache::getUnicodeMap(GString *encodingName) {
+ UnicodeMap *map;
+ int i, j;
+
+ if (cache[0] && cache[0]->match(encodingName)) {
+ cache[0]->incRefCnt();
+ return cache[0];
+ }
+ for (i = 1; i < unicodeMapCacheSize; ++i) {
+ if (cache[i] && cache[i]->match(encodingName)) {
+ map = cache[i];
+ for (j = i; j >= 1; --j) {
+ cache[j] = cache[j - 1];
+ }
+ cache[0] = map;
+ map->incRefCnt();
+ return map;
+ }
+ }
+ if ((map = UnicodeMap::parse(encodingName))) {
+ if (cache[unicodeMapCacheSize - 1]) {
+ cache[unicodeMapCacheSize - 1]->decRefCnt();
+ }
+ for (j = unicodeMapCacheSize - 1; j >= 1; --j) {
+ cache[j] = cache[j - 1];
+ }
+ cache[0] = map;
+ map->incRefCnt();
+ return map;
+ }
+ return NULL;
+}
diff --git a/kpdf/xpdf/xpdf/UnicodeTypeTable.cc b/kpdf/xpdf/xpdf/UnicodeTypeTable.cc
deleted file mode 100644
index b8960403..00000000
--- a/kpdf/xpdf/xpdf/UnicodeTypeTable.cc
+++ /dev/null
@@ -1,949 +0,0 @@
-//========================================================================
-//
-// UnicodeTypeTable.cc
-//
-// Copyright 2004 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <stdlib.h>
-#include "CharTypes.h"
-#include "UnicodeTypeTable.h"
-
-struct UnicodeMapTableEntry {
- char *vector;
- char type;
-};
-
-struct UnicodeCaseTableVector {
- Unicode codes[256];
-};
-
-static UnicodeMapTableEntry typeTable[256] = {
- { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNLNNNNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL", 'X' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLNNNNNNNNNNNNNNLLNNNNNNNNNNNNNNLLLLLNNNNNNNNNLNNNNNNNNNNNNNNNNN", 'X' },
- { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLNNNNNNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRNRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' },
- { "RRRRNNNNNNNNNRNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNRNNNNNNNRRNNNNNNNRRNNNNNNNNNNRRRRRR", 'X' },
- { "RRRRRRRRRRRRRRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { NULL, 'N' },
- { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLNNNNLLLLLLLLLLLLLNNLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNLLLLLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLNNLLLLLLLNNNNN", 'X' },
- { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLNNNNNNNNNNNNNNNN", 'X' },
- { "NNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLNLNNNLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNNNNLLLLLLLNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNLNNNNNLNNLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLNLLNNNNNNNNNNNLLLLLLLNLNLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { "NNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLNNNNNLLLLLLNLLLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNLLLLLLLLLLLNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLNNNLLLLLLLLLLLLLNNN", 'X' },
- { "NNNNNNNNNNNNNNLRNNNNNNNNNNNNNNNNNNNNNNNNNNLRNLRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { "NNLNNNNLNNLLLLLLLLLLNLNNNLLLLLNNNNNNLNLNLNLLLLNLLLNLLLLLLLNNLLLLNNNNNLLLLLNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { NULL, 'N' },
- { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'L' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'N' },
- { NULL, 'N' },
- { "NNNNNLLLNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNNNNNNNLLLLLNNLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLL", 'X' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", 'X' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { NULL, 'L' },
- { "LLLLLLLLLLLLLLLLLLLLLLLLRRRRRRNRRRRRRRRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' },
- { NULL, 'R' },
- { "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' },
- { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' },
- { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLL", 'X' }
-};
-
-static UnicodeCaseTableVector caseTable00 = {{
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
- 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
- 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
- 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
- 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7,
- 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
-}};
-static UnicodeCaseTableVector caseTable01 = {{
- 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107,
- 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, 0x010f,
- 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117,
- 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, 0x011f,
- 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127,
- 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, 0x012f,
- 0x0130, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137,
- 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140,
- 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148,
- 0x0148, 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f,
- 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157,
- 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f,
- 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167,
- 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f,
- 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177,
- 0x00ff, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, 0x017e, 0x0073,
- 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188,
- 0x0188, 0x0256, 0x0257, 0x018c, 0x018c, 0x018d, 0x01dd, 0x0259,
- 0x025b, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268,
- 0x0199, 0x0199, 0x019a, 0x019b, 0x026f, 0x0272, 0x019e, 0x0275,
- 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x0280, 0x01a8,
- 0x01a8, 0x0283, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x0288, 0x01b0,
- 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x0292,
- 0x01b9, 0x01b9, 0x01ba, 0x01bb, 0x01bd, 0x01bd, 0x01be, 0x01bf,
- 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c6, 0x01c6, 0x01c6, 0x01c9,
- 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0,
- 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8,
- 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dc, 0x01dd, 0x01df, 0x01df,
- 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7,
- 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01ef,
- 0x01f0, 0x01f3, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x0195, 0x01bf,
- 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff
-}};
-static UnicodeCaseTableVector caseTable02 = {{
- 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207,
- 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f,
- 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217,
- 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f,
- 0x019e, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227,
- 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f,
- 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237,
- 0x0238, 0x0239, 0x023a, 0x023b, 0x023c, 0x023d, 0x023e, 0x023f,
- 0x0240, 0x0241, 0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247,
- 0x0248, 0x0249, 0x024a, 0x024b, 0x024c, 0x024d, 0x024e, 0x024f,
- 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257,
- 0x0258, 0x0259, 0x025a, 0x025b, 0x025c, 0x025d, 0x025e, 0x025f,
- 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267,
- 0x0268, 0x0269, 0x026a, 0x026b, 0x026c, 0x026d, 0x026e, 0x026f,
- 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277,
- 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x027d, 0x027e, 0x027f,
- 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287,
- 0x0288, 0x0289, 0x028a, 0x028b, 0x028c, 0x028d, 0x028e, 0x028f,
- 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297,
- 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f,
- 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7,
- 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af,
- 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7,
- 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf,
- 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7,
- 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf,
- 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7,
- 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df,
- 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7,
- 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef,
- 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7,
- 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff
-}};
-static UnicodeCaseTableVector caseTable03 = {{
- 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307,
- 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f,
- 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317,
- 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f,
- 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327,
- 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f,
- 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337,
- 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f,
- 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x03b9, 0x0346, 0x0347,
- 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f,
- 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357,
- 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f,
- 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367,
- 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f,
- 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377,
- 0x0378, 0x0379, 0x037a, 0x037b, 0x037c, 0x037d, 0x037e, 0x037f,
- 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x03ac, 0x0387,
- 0x03ad, 0x03ae, 0x03af, 0x038b, 0x03cc, 0x038d, 0x03cd, 0x03ce,
- 0x0390, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
- 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
- 0x03c0, 0x03c1, 0x03a2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
- 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03ac, 0x03ad, 0x03ae, 0x03af,
- 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
- 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
- 0x03c0, 0x03c1, 0x03c3, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
- 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x03cf,
- 0x03b2, 0x03b8, 0x03d2, 0x03d3, 0x03d4, 0x03c6, 0x03c0, 0x03d7,
- 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df,
- 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7,
- 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03ef,
- 0x03ba, 0x03c1, 0x03f2, 0x03f3, 0x03b8, 0x03b5, 0x03f6, 0x03f8,
- 0x03f8, 0x03f2, 0x03fb, 0x03fb, 0x03fc, 0x03fd, 0x03fe, 0x03ff
-}};
-static UnicodeCaseTableVector caseTable04 = {{
- 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
- 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
- 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
- 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
- 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467,
- 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f,
- 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477,
- 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f,
- 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487,
- 0x0488, 0x0489, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f,
- 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497,
- 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f,
- 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7,
- 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af,
- 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7,
- 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf,
- 0x04c0, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8,
- 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04cf,
- 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7,
- 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df,
- 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7,
- 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef,
- 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f6, 0x04f7,
- 0x04f9, 0x04f9, 0x04fa, 0x04fb, 0x04fc, 0x04fd, 0x04fe, 0x04ff
-}};
-static UnicodeCaseTableVector caseTable05 = {{
- 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507,
- 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, 0x050f,
- 0x0510, 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517,
- 0x0518, 0x0519, 0x051a, 0x051b, 0x051c, 0x051d, 0x051e, 0x051f,
- 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527,
- 0x0528, 0x0529, 0x052a, 0x052b, 0x052c, 0x052d, 0x052e, 0x052f,
- 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
- 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
- 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
- 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
- 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557,
- 0x0558, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f,
- 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
- 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
- 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
- 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
- 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587,
- 0x0588, 0x0589, 0x058a, 0x058b, 0x058c, 0x058d, 0x058e, 0x058f,
- 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597,
- 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f,
- 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7,
- 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af,
- 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7,
- 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf,
- 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7,
- 0x05c8, 0x05c9, 0x05ca, 0x05cb, 0x05cc, 0x05cd, 0x05ce, 0x05cf,
- 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
- 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
- 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
- 0x05e8, 0x05e9, 0x05ea, 0x05eb, 0x05ec, 0x05ed, 0x05ee, 0x05ef,
- 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x05f5, 0x05f6, 0x05f7,
- 0x05f8, 0x05f9, 0x05fa, 0x05fb, 0x05fc, 0x05fd, 0x05fe, 0x05ff
-}};
-static UnicodeCaseTableVector caseTable1e = {{
- 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07,
- 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17,
- 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27,
- 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37,
- 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47,
- 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57,
- 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67,
- 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77,
- 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87,
- 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e95, 0x1e96, 0x1e97,
- 0x1e98, 0x1e99, 0x1e9a, 0x1e61, 0x1e9c, 0x1e9d, 0x1e9e, 0x1e9f,
- 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9, 0x1efa, 0x1efb, 0x1efc, 0x1efd, 0x1efe, 0x1eff
-}};
-static UnicodeCaseTableVector caseTable1f = {{
- 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
- 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
- 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f16, 0x1f17,
- 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f1e, 0x1f1f,
- 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
- 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
- 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
- 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
- 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f46, 0x1f47,
- 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f4e, 0x1f4f,
- 0x1f50, 0x1f51, 0x1f52, 0x1f53, 0x1f54, 0x1f55, 0x1f56, 0x1f57,
- 0x1f58, 0x1f51, 0x1f5a, 0x1f53, 0x1f5c, 0x1f55, 0x1f5e, 0x1f57,
- 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
- 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
- 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1f76, 0x1f77,
- 0x1f78, 0x1f79, 0x1f7a, 0x1f7b, 0x1f7c, 0x1f7d, 0x1f7e, 0x1f7f,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7,
- 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0x1fbd, 0x03b9, 0x1fbf,
- 0x1fc0, 0x1fc1, 0x1fc2, 0x1fc3, 0x1fc4, 0x1fc5, 0x1fc6, 0x1fc7,
- 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0x1fcd, 0x1fce, 0x1fcf,
- 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5, 0x1fd6, 0x1fd7,
- 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x1fdc, 0x1fdd, 0x1fde, 0x1fdf,
- 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7,
- 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef,
- 0x1ff0, 0x1ff1, 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7,
- 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0x1ffd, 0x1ffe, 0x1fff
-}};
-static UnicodeCaseTableVector caseTable21 = {{
- 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107,
- 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f,
- 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117,
- 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f,
- 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03c9, 0x2127,
- 0x2128, 0x2129, 0x006b, 0x00e5, 0x212c, 0x212d, 0x212e, 0x212f,
- 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137,
- 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f,
- 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147,
- 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x214e, 0x214f,
- 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157,
- 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f,
- 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
- 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
- 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
- 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
- 0x2180, 0x2181, 0x2182, 0x2183, 0x2184, 0x2185, 0x2186, 0x2187,
- 0x2188, 0x2189, 0x218a, 0x218b, 0x218c, 0x218d, 0x218e, 0x218f,
- 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197,
- 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f,
- 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7,
- 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af,
- 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7,
- 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf,
- 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7,
- 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf,
- 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7,
- 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df,
- 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7,
- 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef,
- 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7,
- 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff
-}};
-static UnicodeCaseTableVector caseTable24 = {{
- 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407,
- 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f,
- 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417,
- 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f,
- 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427,
- 0x2428, 0x2429, 0x242a, 0x242b, 0x242c, 0x242d, 0x242e, 0x242f,
- 0x2430, 0x2431, 0x2432, 0x2433, 0x2434, 0x2435, 0x2436, 0x2437,
- 0x2438, 0x2439, 0x243a, 0x243b, 0x243c, 0x243d, 0x243e, 0x243f,
- 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447,
- 0x2448, 0x2449, 0x244a, 0x244b, 0x244c, 0x244d, 0x244e, 0x244f,
- 0x2450, 0x2451, 0x2452, 0x2453, 0x2454, 0x2455, 0x2456, 0x2457,
- 0x2458, 0x2459, 0x245a, 0x245b, 0x245c, 0x245d, 0x245e, 0x245f,
- 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
- 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f,
- 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477,
- 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f,
- 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487,
- 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f,
- 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497,
- 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f,
- 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7,
- 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af,
- 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24d0, 0x24d1,
- 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9,
- 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1,
- 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9,
- 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7,
- 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df,
- 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7,
- 0x24e8, 0x24e9, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef,
- 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7,
- 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff
-}};
-static UnicodeCaseTableVector caseTableff = {{
- 0xff00, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07,
- 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f,
- 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17,
- 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f,
- 0xff20, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
- 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
- 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
- 0xff58, 0xff59, 0xff5a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f,
- 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
- 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
- 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
- 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xff5e, 0xff5f,
- 0xff60, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67,
- 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
- 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77,
- 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
- 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87,
- 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f,
- 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97,
- 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f,
- 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7,
- 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf,
- 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7,
- 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0xffbf,
- 0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7,
- 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf,
- 0xffd0, 0xffd1, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7,
- 0xffd8, 0xffd9, 0xffda, 0xffdb, 0xffdc, 0xffdd, 0xffde, 0xffdf,
- 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0xffe7,
- 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0xffef,
- 0xfff0, 0xfff1, 0xfff2, 0xfff3, 0xfff4, 0xfff5, 0xfff6, 0xfff7,
- 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0xfffe, 0xffff
-}};
-static UnicodeCaseTableVector *caseTable[256] = {
- &caseTable00,
- &caseTable01,
- &caseTable02,
- &caseTable03,
- &caseTable04,
- &caseTable05,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- &caseTable1e,
- &caseTable1f,
- NULL,
- &caseTable21,
- NULL,
- NULL,
- &caseTable24,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- &caseTableff
-};
-
-static inline char getType(Unicode c) {
- int i;
- char type;
-
- if (c > 0xffff) {
- type = 'X';
- } else {
- i = (c >> 8) & 0xff;
- if ((type = typeTable[i].type) == 'X') {
- type = typeTable[i].vector[c & 0xff];
- }
- }
- return type;
-}
-
-GBool unicodeTypeL(Unicode c) {
- return getType(c) == 'L';
-}
-
-GBool unicodeTypeR(Unicode c) {
- return getType(c) == 'R';
-}
-
-Unicode unicodeToUpper(Unicode c) {
- int i;
-
- if (c > 0xffff) {
- return c;
- }
- i = (c >> 8) & 0xff;
- if (caseTable[i]) {
- return caseTable[i]->codes[c & 0xff];
- }
- return c;
-}
-
diff --git a/kpdf/xpdf/xpdf/UnicodeTypeTable.cpp b/kpdf/xpdf/xpdf/UnicodeTypeTable.cpp
new file mode 100644
index 00000000..39b9d842
--- /dev/null
+++ b/kpdf/xpdf/xpdf/UnicodeTypeTable.cpp
@@ -0,0 +1,949 @@
+//========================================================================
+//
+// UnicodeTypeTable.cpp
+//
+// Copyright 2004 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <stdlib.h>
+#include "CharTypes.h"
+#include "UnicodeTypeTable.h"
+
+struct UnicodeMapTableEntry {
+ char *vector;
+ char type;
+};
+
+struct UnicodeCaseTableVector {
+ Unicode codes[256];
+};
+
+static UnicodeMapTableEntry typeTable[256] = {
+ { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNLNNNNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL", 'X' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLNNNNNNNNNNNNNNLLNNNNNNNNNNNNNNLLLLLNNNNNNNNNLNNNNNNNNNNNNNNNNN", 'X' },
+ { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLNNNNNNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRNRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' },
+ { "RRRRNNNNNNNNNRNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNRNNNNNNNRRNNNNNNNRRNNNNNNNNNNRRRRRR", 'X' },
+ { "RRRRRRRRRRRRRRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { NULL, 'N' },
+ { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLNNNNLLLLLLLLLLLLLNNLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNLLLLLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLNNLLLLLLLNNNNN", 'X' },
+ { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLNNNNNNNNNNNNNNNN", 'X' },
+ { "NNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLNLNNNLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNNNNLLLLLLLNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNLNNNNNLNNLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLNLLNNNNNNNNNNNLLLLLLLNLNLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { "NNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLNNNNNLLLLLLNLLLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNLLLLLLLLLLLNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLNNNLLLLLLLLLLLLLNNN", 'X' },
+ { "NNNNNNNNNNNNNNLRNNNNNNNNNNNNNNNNNNNNNNNNNNLRNLRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { "NNLNNNNLNNLLLLLLLLLLNLNNNLLLLLNNNNNNLNLNLNLLLLNLLLNLLLLLLLNNLLLLNNNNNLLLLLNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { NULL, 'N' },
+ { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'L' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { NULL, 'N' },
+ { "NNNNNLLLNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNNNNNNNLLLLLNNLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLL", 'X' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", 'X' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { NULL, 'L' },
+ { "LLLLLLLLLLLLLLLLLLLLLLLLRRRRRRNRRRRRRRRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' },
+ { NULL, 'R' },
+ { "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' },
+ { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' },
+ { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLL", 'X' }
+};
+
+static UnicodeCaseTableVector caseTable00 = {{
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
+ 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
+ 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+ 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+ 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+ 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7,
+ 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7,
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
+}};
+static UnicodeCaseTableVector caseTable01 = {{
+ 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107,
+ 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, 0x010f,
+ 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117,
+ 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, 0x011f,
+ 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127,
+ 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, 0x012f,
+ 0x0130, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137,
+ 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140,
+ 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148,
+ 0x0148, 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f,
+ 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157,
+ 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f,
+ 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167,
+ 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f,
+ 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177,
+ 0x00ff, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, 0x017e, 0x0073,
+ 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188,
+ 0x0188, 0x0256, 0x0257, 0x018c, 0x018c, 0x018d, 0x01dd, 0x0259,
+ 0x025b, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268,
+ 0x0199, 0x0199, 0x019a, 0x019b, 0x026f, 0x0272, 0x019e, 0x0275,
+ 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x0280, 0x01a8,
+ 0x01a8, 0x0283, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x0288, 0x01b0,
+ 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x0292,
+ 0x01b9, 0x01b9, 0x01ba, 0x01bb, 0x01bd, 0x01bd, 0x01be, 0x01bf,
+ 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c6, 0x01c6, 0x01c6, 0x01c9,
+ 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0,
+ 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8,
+ 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dc, 0x01dd, 0x01df, 0x01df,
+ 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01ef,
+ 0x01f0, 0x01f3, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x0195, 0x01bf,
+ 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff
+}};
+static UnicodeCaseTableVector caseTable02 = {{
+ 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207,
+ 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f,
+ 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217,
+ 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f,
+ 0x019e, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227,
+ 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f,
+ 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237,
+ 0x0238, 0x0239, 0x023a, 0x023b, 0x023c, 0x023d, 0x023e, 0x023f,
+ 0x0240, 0x0241, 0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247,
+ 0x0248, 0x0249, 0x024a, 0x024b, 0x024c, 0x024d, 0x024e, 0x024f,
+ 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257,
+ 0x0258, 0x0259, 0x025a, 0x025b, 0x025c, 0x025d, 0x025e, 0x025f,
+ 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267,
+ 0x0268, 0x0269, 0x026a, 0x026b, 0x026c, 0x026d, 0x026e, 0x026f,
+ 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277,
+ 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x027d, 0x027e, 0x027f,
+ 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287,
+ 0x0288, 0x0289, 0x028a, 0x028b, 0x028c, 0x028d, 0x028e, 0x028f,
+ 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297,
+ 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f,
+ 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7,
+ 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af,
+ 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7,
+ 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf,
+ 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7,
+ 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf,
+ 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7,
+ 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df,
+ 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7,
+ 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef,
+ 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7,
+ 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff
+}};
+static UnicodeCaseTableVector caseTable03 = {{
+ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307,
+ 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f,
+ 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317,
+ 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f,
+ 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327,
+ 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f,
+ 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337,
+ 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f,
+ 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x03b9, 0x0346, 0x0347,
+ 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f,
+ 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357,
+ 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f,
+ 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367,
+ 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f,
+ 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377,
+ 0x0378, 0x0379, 0x037a, 0x037b, 0x037c, 0x037d, 0x037e, 0x037f,
+ 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x03ac, 0x0387,
+ 0x03ad, 0x03ae, 0x03af, 0x038b, 0x03cc, 0x038d, 0x03cd, 0x03ce,
+ 0x0390, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
+ 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
+ 0x03c0, 0x03c1, 0x03a2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
+ 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03ac, 0x03ad, 0x03ae, 0x03af,
+ 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
+ 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
+ 0x03c0, 0x03c1, 0x03c3, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
+ 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x03cf,
+ 0x03b2, 0x03b8, 0x03d2, 0x03d3, 0x03d4, 0x03c6, 0x03c0, 0x03d7,
+ 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df,
+ 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03ef,
+ 0x03ba, 0x03c1, 0x03f2, 0x03f3, 0x03b8, 0x03b5, 0x03f6, 0x03f8,
+ 0x03f8, 0x03f2, 0x03fb, 0x03fb, 0x03fc, 0x03fd, 0x03fe, 0x03ff
+}};
+static UnicodeCaseTableVector caseTable04 = {{
+ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
+ 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+ 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+ 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+ 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+ 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
+ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
+ 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
+ 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467,
+ 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f,
+ 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477,
+ 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f,
+ 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487,
+ 0x0488, 0x0489, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f,
+ 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497,
+ 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f,
+ 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af,
+ 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf,
+ 0x04c0, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8,
+ 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df,
+ 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f6, 0x04f7,
+ 0x04f9, 0x04f9, 0x04fa, 0x04fb, 0x04fc, 0x04fd, 0x04fe, 0x04ff
+}};
+static UnicodeCaseTableVector caseTable05 = {{
+ 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507,
+ 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, 0x050f,
+ 0x0510, 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517,
+ 0x0518, 0x0519, 0x051a, 0x051b, 0x051c, 0x051d, 0x051e, 0x051f,
+ 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527,
+ 0x0528, 0x0529, 0x052a, 0x052b, 0x052c, 0x052d, 0x052e, 0x052f,
+ 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
+ 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
+ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
+ 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
+ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557,
+ 0x0558, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f,
+ 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
+ 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
+ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
+ 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
+ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587,
+ 0x0588, 0x0589, 0x058a, 0x058b, 0x058c, 0x058d, 0x058e, 0x058f,
+ 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597,
+ 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f,
+ 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7,
+ 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af,
+ 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7,
+ 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf,
+ 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7,
+ 0x05c8, 0x05c9, 0x05ca, 0x05cb, 0x05cc, 0x05cd, 0x05ce, 0x05cf,
+ 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
+ 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
+ 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
+ 0x05e8, 0x05e9, 0x05ea, 0x05eb, 0x05ec, 0x05ed, 0x05ee, 0x05ef,
+ 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x05f5, 0x05f6, 0x05f7,
+ 0x05f8, 0x05f9, 0x05fa, 0x05fb, 0x05fc, 0x05fd, 0x05fe, 0x05ff
+}};
+static UnicodeCaseTableVector caseTable1e = {{
+ 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f,
+ 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17,
+ 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f,
+ 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27,
+ 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f,
+ 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37,
+ 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f,
+ 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47,
+ 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f,
+ 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57,
+ 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f,
+ 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67,
+ 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f,
+ 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77,
+ 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f,
+ 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87,
+ 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f,
+ 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e95, 0x1e96, 0x1e97,
+ 0x1e98, 0x1e99, 0x1e9a, 0x1e61, 0x1e9c, 0x1e9d, 0x1e9e, 0x1e9f,
+ 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7,
+ 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf,
+ 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7,
+ 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf,
+ 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7,
+ 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf,
+ 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7,
+ 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf,
+ 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7,
+ 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef,
+ 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7,
+ 0x1ef9, 0x1ef9, 0x1efa, 0x1efb, 0x1efc, 0x1efd, 0x1efe, 0x1eff
+}};
+static UnicodeCaseTableVector caseTable1f = {{
+ 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
+ 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
+ 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f16, 0x1f17,
+ 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f1e, 0x1f1f,
+ 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
+ 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
+ 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
+ 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
+ 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f46, 0x1f47,
+ 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f4e, 0x1f4f,
+ 0x1f50, 0x1f51, 0x1f52, 0x1f53, 0x1f54, 0x1f55, 0x1f56, 0x1f57,
+ 0x1f58, 0x1f51, 0x1f5a, 0x1f53, 0x1f5c, 0x1f55, 0x1f5e, 0x1f57,
+ 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
+ 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
+ 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1f76, 0x1f77,
+ 0x1f78, 0x1f79, 0x1f7a, 0x1f7b, 0x1f7c, 0x1f7d, 0x1f7e, 0x1f7f,
+ 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
+ 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
+ 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
+ 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
+ 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
+ 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
+ 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7,
+ 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0x1fbd, 0x03b9, 0x1fbf,
+ 0x1fc0, 0x1fc1, 0x1fc2, 0x1fc3, 0x1fc4, 0x1fc5, 0x1fc6, 0x1fc7,
+ 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0x1fcd, 0x1fce, 0x1fcf,
+ 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5, 0x1fd6, 0x1fd7,
+ 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x1fdc, 0x1fdd, 0x1fde, 0x1fdf,
+ 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7,
+ 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef,
+ 0x1ff0, 0x1ff1, 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7,
+ 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0x1ffd, 0x1ffe, 0x1fff
+}};
+static UnicodeCaseTableVector caseTable21 = {{
+ 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107,
+ 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f,
+ 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117,
+ 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f,
+ 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03c9, 0x2127,
+ 0x2128, 0x2129, 0x006b, 0x00e5, 0x212c, 0x212d, 0x212e, 0x212f,
+ 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137,
+ 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f,
+ 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147,
+ 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x214e, 0x214f,
+ 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157,
+ 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f,
+ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
+ 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
+ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
+ 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
+ 0x2180, 0x2181, 0x2182, 0x2183, 0x2184, 0x2185, 0x2186, 0x2187,
+ 0x2188, 0x2189, 0x218a, 0x218b, 0x218c, 0x218d, 0x218e, 0x218f,
+ 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197,
+ 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f,
+ 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7,
+ 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af,
+ 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7,
+ 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf,
+ 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7,
+ 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf,
+ 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7,
+ 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df,
+ 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7,
+ 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef,
+ 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7,
+ 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff
+}};
+static UnicodeCaseTableVector caseTable24 = {{
+ 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407,
+ 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f,
+ 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417,
+ 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f,
+ 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427,
+ 0x2428, 0x2429, 0x242a, 0x242b, 0x242c, 0x242d, 0x242e, 0x242f,
+ 0x2430, 0x2431, 0x2432, 0x2433, 0x2434, 0x2435, 0x2436, 0x2437,
+ 0x2438, 0x2439, 0x243a, 0x243b, 0x243c, 0x243d, 0x243e, 0x243f,
+ 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447,
+ 0x2448, 0x2449, 0x244a, 0x244b, 0x244c, 0x244d, 0x244e, 0x244f,
+ 0x2450, 0x2451, 0x2452, 0x2453, 0x2454, 0x2455, 0x2456, 0x2457,
+ 0x2458, 0x2459, 0x245a, 0x245b, 0x245c, 0x245d, 0x245e, 0x245f,
+ 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
+ 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f,
+ 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477,
+ 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f,
+ 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487,
+ 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f,
+ 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497,
+ 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f,
+ 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7,
+ 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af,
+ 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24d0, 0x24d1,
+ 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9,
+ 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1,
+ 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9,
+ 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7,
+ 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df,
+ 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7,
+ 0x24e8, 0x24e9, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef,
+ 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7,
+ 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff
+}};
+static UnicodeCaseTableVector caseTableff = {{
+ 0xff00, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07,
+ 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f,
+ 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17,
+ 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f,
+ 0xff20, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
+ 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
+ 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
+ 0xff58, 0xff59, 0xff5a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f,
+ 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
+ 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
+ 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
+ 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xff5e, 0xff5f,
+ 0xff60, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67,
+ 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
+ 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77,
+ 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
+ 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87,
+ 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f,
+ 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97,
+ 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f,
+ 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7,
+ 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf,
+ 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7,
+ 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0xffbf,
+ 0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7,
+ 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf,
+ 0xffd0, 0xffd1, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7,
+ 0xffd8, 0xffd9, 0xffda, 0xffdb, 0xffdc, 0xffdd, 0xffde, 0xffdf,
+ 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0xffe7,
+ 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0xffef,
+ 0xfff0, 0xfff1, 0xfff2, 0xfff3, 0xfff4, 0xfff5, 0xfff6, 0xfff7,
+ 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0xfffe, 0xffff
+}};
+static UnicodeCaseTableVector *caseTable[256] = {
+ &caseTable00,
+ &caseTable01,
+ &caseTable02,
+ &caseTable03,
+ &caseTable04,
+ &caseTable05,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &caseTable1e,
+ &caseTable1f,
+ NULL,
+ &caseTable21,
+ NULL,
+ NULL,
+ &caseTable24,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &caseTableff
+};
+
+static inline char getType(Unicode c) {
+ int i;
+ char type;
+
+ if (c > 0xffff) {
+ type = 'X';
+ } else {
+ i = (c >> 8) & 0xff;
+ if ((type = typeTable[i].type) == 'X') {
+ type = typeTable[i].vector[c & 0xff];
+ }
+ }
+ return type;
+}
+
+GBool unicodeTypeL(Unicode c) {
+ return getType(c) == 'L';
+}
+
+GBool unicodeTypeR(Unicode c) {
+ return getType(c) == 'R';
+}
+
+Unicode unicodeToUpper(Unicode c) {
+ int i;
+
+ if (c > 0xffff) {
+ return c;
+ }
+ i = (c >> 8) & 0xff;
+ if (caseTable[i]) {
+ return caseTable[i]->codes[c & 0xff];
+ }
+ return c;
+}
+
diff --git a/kpdf/xpdf/xpdf/XRef.cc b/kpdf/xpdf/xpdf/XRef.cc
deleted file mode 100644
index 2e0d1cef..00000000
--- a/kpdf/xpdf/xpdf/XRef.cc
+++ /dev/null
@@ -1,933 +0,0 @@
-//========================================================================
-//
-// XRef.cc
-//
-// Copyright 1996-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-#include <aconf.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include <ctype.h>
-#include "gmem.h"
-#include "Object.h"
-#include "Stream.h"
-#include "Lexer.h"
-#include "Parser.h"
-#include "Dict.h"
-#include "Error.h"
-#include "ErrorCodes.h"
-#include "XRef.h"
-
-//------------------------------------------------------------------------
-
-#define xrefSearchSize 1024 // read this many bytes at end of file
- // to look for 'startxref'
-
-//------------------------------------------------------------------------
-// Permission bits
-//------------------------------------------------------------------------
-
-#define permPrint (1<<2)
-#define permChange (1<<3)
-#define permCopy (1<<4)
-#define permNotes (1<<5)
-#define defPermFlags 0xfffc
-
-//------------------------------------------------------------------------
-// ObjectStream
-//------------------------------------------------------------------------
-
-class ObjectStream {
-public:
-
- // Create an object stream, using object number <objStrNum>,
- // generation 0.
- ObjectStream(XRef *xref, int objStrNumA);
-
- GBool isOk() { return ok; }
-
- ~ObjectStream();
-
- // Return the object number of this object stream.
- int getObjStrNum() { return objStrNum; }
-
- // Get the <objIdx>th object from this stream, which should be
- // object number <objNum>, generation 0.
- Object *getObject(int objIdx, int objNum, Object *obj);
-
-private:
-
- int objStrNum; // object number of the object stream
- int nObjects; // number of objects in the stream
- Object *objs; // the objects (length = nObjects)
- int *objNums; // the object numbers (length = nObjects)
- GBool ok;
-};
-
-ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
- Stream *str;
- Parser *parser;
- int *offsets;
- Object objStr, obj1, obj2;
- int first, i;
-
- objStrNum = objStrNumA;
- nObjects = 0;
- objs = NULL;
- objNums = NULL;
- ok = gFalse;
-
- if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
- goto err1;
- }
-
- if (!objStr.streamGetDict()->lookup("N", &obj1)->isInt()) {
- obj1.free();
- goto err1;
- }
- nObjects = obj1.getInt();
- obj1.free();
- if (nObjects <= 0) {
- goto err1;
- }
-
- if (!objStr.streamGetDict()->lookup("First", &obj1)->isInt()) {
- obj1.free();
- goto err1;
- }
- first = obj1.getInt();
- obj1.free();
- if (first < 0) {
- goto err1;
- }
-
- // this is an arbitrary limit to avoid integer overflow problems
- // in the 'new Object[nObjects]' call (Acrobat apparently limits
- // object streams to 100-200 objects)
- if (nObjects > 1000000) {
- error(-1, "Too many objects in an object stream");
- goto err1;
- }
- objs = new Object[nObjects];
- objNums = (int *)gmallocn(nObjects, sizeof(int));
- offsets = (int *)gmallocn(nObjects, sizeof(int));
-
- // parse the header: object numbers and offsets
- objStr.streamReset();
- obj1.initNull();
- str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first);
- parser = new Parser(xref, new Lexer(xref, str), gFalse);
- for (i = 0; i < nObjects; ++i) {
- parser->getObj(&obj1);
- parser->getObj(&obj2);
- if (!obj1.isInt() || !obj2.isInt()) {
- obj1.free();
- obj2.free();
- delete parser;
- gfree(offsets);
- goto err1;
- }
- objNums[i] = obj1.getInt();
- offsets[i] = obj2.getInt();
- obj1.free();
- obj2.free();
- if (objNums[i] < 0 || offsets[i] < 0 ||
- (i > 0 && offsets[i] < offsets[i-1])) {
- delete parser;
- gfree(offsets);
- goto err1;
- }
- }
- while (str->getChar() != EOF) ;
- delete parser;
-
- // skip to the first object - this shouldn't be necessary because
- // the First key is supposed to be equal to offsets[0], but just in
- // case...
- for (i = first; i < offsets[0]; ++i) {
- objStr.getStream()->getChar();
- }
-
- // parse the objects
- for (i = 0; i < nObjects; ++i) {
- obj1.initNull();
- if (i == nObjects - 1) {
- str = new EmbedStream(objStr.getStream(), &obj1, gFalse, 0);
- } else {
- str = new EmbedStream(objStr.getStream(), &obj1, gTrue,
- offsets[i+1] - offsets[i]);
- }
- parser = new Parser(xref, new Lexer(xref, str), gFalse);
- parser->getObj(&objs[i]);
- while (str->getChar() != EOF) ;
- delete parser;
- }
-
- gfree(offsets);
- ok = gTrue;
-
- err1:
- objStr.free();
-}
-
-ObjectStream::~ObjectStream() {
- int i;
-
- if (objs) {
- for (i = 0; i < nObjects; ++i) {
- objs[i].free();
- }
- delete[] objs;
- }
- gfree(objNums);
-}
-
-Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
- if (objIdx < 0 || objIdx >= nObjects || objNum != objNums[objIdx]) {
- return obj->initNull();
- }
- return objs[objIdx].copy(obj);
-}
-
-//------------------------------------------------------------------------
-// XRef
-//------------------------------------------------------------------------
-
-XRef::XRef(BaseStream *strA) {
- Guint pos;
- Object obj;
-
- ok = gTrue;
- errCode = errNone;
- size = 0;
- entries = NULL;
- streamEnds = NULL;
- streamEndsLen = 0;
- objStr = NULL;
-
- encrypted = gFalse;
- permFlags = defPermFlags;
- ownerPasswordOk = gFalse;
-
- // read the trailer
- str = strA;
- start = str->getStart();
- pos = getStartXref();
-
- // if there was a problem with the 'startxref' position, try to
- // reconstruct the xref table
- if (pos == 0) {
- if (!(ok = constructXRef())) {
- errCode = errDamaged;
- return;
- }
-
- // read the xref table
- } else {
- while (readXRef(&pos)) ;
-
- // if there was a problem with the xref table,
- // try to reconstruct it
- if (!ok) {
- if (!(ok = constructXRef())) {
- errCode = errDamaged;
- return;
- }
- }
- }
-
- // get the root dictionary (catalog) object
- trailerDict.dictLookupNF("Root", &obj);
- if (obj.isRef()) {
- rootNum = obj.getRefNum();
- rootGen = obj.getRefGen();
- obj.free();
- } else {
- obj.free();
- if (!(ok = constructXRef())) {
- errCode = errDamaged;
- return;
- }
- }
-
- // now set the trailer dictionary's xref pointer so we can fetch
- // indirect objects from it
- trailerDict.getDict()->setXRef(this);
-}
-
-XRef::~XRef() {
- gfree(entries);
- trailerDict.free();
- if (streamEnds) {
- gfree(streamEnds);
- }
- if (objStr) {
- delete objStr;
- }
-}
-
-// Read the 'startxref' position.
-Guint XRef::getStartXref() {
- char buf[xrefSearchSize+1];
- char *p;
- int c, n, i;
-
- // read last xrefSearchSize bytes
- str->setPos(xrefSearchSize, -1);
- for (n = 0; n < xrefSearchSize; ++n) {
- if ((c = str->getChar()) == EOF) {
- break;
- }
- buf[n] = c;
- }
- buf[n] = '\0';
-
- // find startxref
- for (i = n - 9; i >= 0; --i) {
- if (!strncmp(&buf[i], "startxref", 9)) {
- break;
- }
- }
- if (i < 0) {
- return 0;
- }
- for (p = &buf[i+9]; isspace(*p); ++p) ;
- lastXRefPos = strToUnsigned(p);
-
- return lastXRefPos;
-}
-
-// Read one xref table section. Also reads the associated trailer
-// dictionary, and returns the prev pointer (if any).
-GBool XRef::readXRef(Guint *pos) {
- Parser *parser;
- Object obj;
- GBool more;
-
- // start up a parser, parse one token
- obj.initNull();
- parser = new Parser(NULL,
- new Lexer(NULL,
- str->makeSubStream(start + *pos, gFalse, 0, &obj)),
- gTrue);
- parser->getObj(&obj);
-
- // parse an old-style xref table
- if (obj.isCmd("xref")) {
- obj.free();
- more = readXRefTable(parser, pos);
-
- // parse an xref stream
- } else if (obj.isInt()) {
- obj.free();
- if (!parser->getObj(&obj)->isInt()) {
- goto err1;
- }
- obj.free();
- if (!parser->getObj(&obj)->isCmd("obj")) {
- goto err1;
- }
- obj.free();
- if (!parser->getObj(&obj)->isStream()) {
- goto err1;
- }
- more = readXRefStream(obj.getStream(), pos);
- obj.free();
-
- } else {
- goto err1;
- }
-
- delete parser;
- return more;
-
- err1:
- obj.free();
- delete parser;
- ok = gFalse;
- return gFalse;
-}
-
-GBool XRef::readXRefTable(Parser *parser, Guint *pos) {
- XRefEntry entry;
- GBool more;
- Object obj, obj2;
- Guint pos2;
- int first, n, newSize, i;
-
- while (1) {
- parser->getObj(&obj);
- if (obj.isCmd("trailer")) {
- obj.free();
- break;
- }
- if (!obj.isInt()) {
- goto err1;
- }
- first = obj.getInt();
- obj.free();
- if (!parser->getObj(&obj)->isInt()) {
- goto err1;
- }
- n = obj.getInt();
- obj.free();
- if (first < 0 || n < 0 || first + n < 0) {
- goto err1;
- }
- if (first + n > size) {
- for (newSize = size ? 2 * size : 1024;
- first + n > newSize && newSize > 0;
- newSize <<= 1) ;
- if (newSize < 0) {
- goto err1;
- }
- entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
- entries[i].type = xrefEntryFree;
- }
- size = newSize;
- }
- for (i = first; i < first + n; ++i) {
- if (!parser->getObj(&obj)->isInt()) {
- goto err1;
- }
- entry.offset = (Guint)obj.getInt();
- obj.free();
- if (!parser->getObj(&obj)->isInt()) {
- goto err1;
- }
- entry.gen = obj.getInt();
- obj.free();
- parser->getObj(&obj);
- if (obj.isCmd("n")) {
- entry.type = xrefEntryUncompressed;
- } else if (obj.isCmd("f")) {
- entry.type = xrefEntryFree;
- } else {
- goto err1;
- }
- obj.free();
- if (entries[i].offset == 0xffffffff) {
- entries[i] = entry;
- // PDF files of patents from the IBM Intellectual Property
- // Network have a bug: the xref table claims to start at 1
- // instead of 0.
- if (i == 1 && first == 1 &&
- entries[1].offset == 0 && entries[1].gen == 65535 &&
- entries[1].type == xrefEntryFree) {
- i = first = 0;
- entries[0] = entries[1];
- entries[1].offset = 0xffffffff;
- }
- }
- }
- }
-
- // read the trailer dictionary
- if (!parser->getObj(&obj)->isDict()) {
- goto err1;
- }
-
- // get the 'Prev' pointer
- obj.getDict()->lookupNF("Prev", &obj2);
- if (obj2.isInt()) {
- *pos = (Guint)obj2.getInt();
- more = gTrue;
- } else if (obj2.isRef()) {
- // certain buggy PDF generators generate "/Prev NNN 0 R" instead
- // of "/Prev NNN"
- *pos = (Guint)obj2.getRefNum();
- more = gTrue;
- } else {
- more = gFalse;
- }
- obj2.free();
-
- // save the first trailer dictionary
- if (trailerDict.isNone()) {
- obj.copy(&trailerDict);
- }
-
- // check for an 'XRefStm' key
- if (obj.getDict()->lookup("XRefStm", &obj2)->isInt()) {
- pos2 = (Guint)obj2.getInt();
- readXRef(&pos2);
- if (!ok) {
- obj2.free();
- goto err1;
- }
- }
- obj2.free();
-
- obj.free();
- return more;
-
- err1:
- obj.free();
- ok = gFalse;
- return gFalse;
-}
-
-GBool XRef::readXRefStream(Stream *xrefStr, Guint *pos) {
- Dict *dict;
- int w[3];
- GBool more;
- Object obj, obj2, idx;
- int newSize, first, n, i;
-
- dict = xrefStr->getDict();
-
- if (!dict->lookupNF("Size", &obj)->isInt()) {
- goto err1;
- }
- newSize = obj.getInt();
- obj.free();
- if (newSize < 0) {
- goto err1;
- }
- if (newSize > size) {
- entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
- entries[i].type = xrefEntryFree;
- }
- size = newSize;
- }
-
- if (!dict->lookupNF("W", &obj)->isArray() ||
- obj.arrayGetLength() < 3) {
- goto err1;
- }
- for (i = 0; i < 3; ++i) {
- if (!obj.arrayGet(i, &obj2)->isInt()) {
- obj2.free();
- goto err1;
- }
- w[i] = obj2.getInt();
- obj2.free();
- if (w[i] < 0 || w[i] > 4) {
- goto err1;
- }
- }
- obj.free();
-
- xrefStr->reset();
- dict->lookupNF("Index", &idx);
- if (idx.isArray()) {
- for (i = 0; i+1 < idx.arrayGetLength(); i += 2) {
- if (!idx.arrayGet(i, &obj)->isInt()) {
- idx.free();
- goto err1;
- }
- first = obj.getInt();
- obj.free();
- if (!idx.arrayGet(i+1, &obj)->isInt()) {
- idx.free();
- goto err1;
- }
- n = obj.getInt();
- obj.free();
- if (first < 0 || n < 0 ||
- !readXRefStreamSection(xrefStr, w, first, n)) {
- idx.free();
- goto err0;
- }
- }
- } else {
- if (!readXRefStreamSection(xrefStr, w, 0, newSize)) {
- idx.free();
- goto err0;
- }
- }
- idx.free();
-
- dict->lookupNF("Prev", &obj);
- if (obj.isInt()) {
- *pos = (Guint)obj.getInt();
- more = gTrue;
- } else {
- more = gFalse;
- }
- obj.free();
- if (trailerDict.isNone()) {
- trailerDict.initDict(dict);
- }
-
- return more;
-
- err1:
- obj.free();
- err0:
- ok = gFalse;
- return gFalse;
-}
-
-GBool XRef::readXRefStreamSection(Stream *xrefStr, int *w, int first, int n) {
- Guint offset;
- int type, gen, c, newSize, i, j;
-
- if (first + n < 0) {
- return gFalse;
- }
- if (first + n > size) {
- for (newSize = size ? 2 * size : 1024;
- first + n > newSize && newSize > 0;
- newSize <<= 1) ;
- if (newSize < 0) {
- return gFalse;
- }
- entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
- entries[i].type = xrefEntryFree;
- }
- size = newSize;
- }
- for (i = first; i < first + n; ++i) {
- if (w[0] == 0) {
- type = 1;
- } else {
- for (type = 0, j = 0; j < w[0]; ++j) {
- if ((c = xrefStr->getChar()) == EOF) {
- return gFalse;
- }
- type = (type << 8) + c;
- }
- }
- for (offset = 0, j = 0; j < w[1]; ++j) {
- if ((c = xrefStr->getChar()) == EOF) {
- return gFalse;
- }
- offset = (offset << 8) + c;
- }
- for (gen = 0, j = 0; j < w[2]; ++j) {
- if ((c = xrefStr->getChar()) == EOF) {
- return gFalse;
- }
- gen = (gen << 8) + c;
- }
- if (entries[i].offset == 0xffffffff) {
- switch (type) {
- case 0:
- entries[i].offset = offset;
- entries[i].gen = gen;
- entries[i].type = xrefEntryFree;
- break;
- case 1:
- entries[i].offset = offset;
- entries[i].gen = gen;
- entries[i].type = xrefEntryUncompressed;
- break;
- case 2:
- entries[i].offset = offset;
- entries[i].gen = gen;
- entries[i].type = xrefEntryCompressed;
- break;
- default:
- return gFalse;
- }
- }
- }
-
- return gTrue;
-}
-
-// Attempt to construct an xref table for a damaged file.
-GBool XRef::constructXRef() {
- Parser *parser;
- Object newTrailerDict, obj;
- char buf[256];
- Guint pos;
- int num, gen;
- int newSize;
- int streamEndsSize;
- char *p;
- int i;
- GBool gotRoot;
-
- gfree(entries);
- size = 0;
- entries = NULL;
-
- error(-1, "PDF file is damaged - attempting to reconstruct xref table...");
- gotRoot = gFalse;
- streamEndsLen = streamEndsSize = 0;
-
- str->reset();
- while (1) {
- pos = str->getPos();
- if (!str->getLine(buf, 256)) {
- break;
- }
- p = buf;
-
- // skip whitespace
- while (*p && Lexer::isSpace(*p & 0xff)) ++p;
-
- // got trailer dictionary
- if (!strncmp(p, "trailer", 7)) {
- obj.initNull();
- parser = new Parser(NULL,
- new Lexer(NULL,
- str->makeSubStream(pos + 7, gFalse, 0, &obj)),
- gFalse);
- parser->getObj(&newTrailerDict);
- if (newTrailerDict.isDict()) {
- newTrailerDict.dictLookupNF("Root", &obj);
- if (obj.isRef()) {
- rootNum = obj.getRefNum();
- rootGen = obj.getRefGen();
- if (!trailerDict.isNone()) {
- trailerDict.free();
- }
- newTrailerDict.copy(&trailerDict);
- gotRoot = gTrue;
- }
- obj.free();
- }
- newTrailerDict.free();
- delete parser;
-
- // look for object
- } else if (isdigit(*p)) {
- num = atoi(p);
- if (num > 0) {
- do {
- ++p;
- } while (*p && isdigit(*p));
- if (isspace(*p)) {
- do {
- ++p;
- } while (*p && isspace(*p));
- if (isdigit(*p)) {
- gen = atoi(p);
- do {
- ++p;
- } while (*p && isdigit(*p));
- if (isspace(*p)) {
- do {
- ++p;
- } while (*p && isspace(*p));
- if (!strncmp(p, "obj", 3)) {
- if (num >= size) {
- newSize = (num + 1 + 255) & ~255;
- if (newSize < 0) {
- error(-1, "Bad object number");
- return gFalse;
- }
- entries = (XRefEntry *)
- greallocn(entries, newSize, sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
- entries[i].type = xrefEntryFree;
- }
- size = newSize;
- }
- if (entries[num].type == xrefEntryFree ||
- gen >= entries[num].gen) {
- entries[num].offset = pos - start;
- entries[num].gen = gen;
- entries[num].type = xrefEntryUncompressed;
- }
- }
- }
- }
- }
- }
-
- } else if (!strncmp(p, "endstream", 9)) {
- if (streamEndsLen == streamEndsSize) {
- streamEndsSize += 64;
- streamEnds = (Guint *)greallocn(streamEnds,
- streamEndsSize, sizeof(int));
- }
- streamEnds[streamEndsLen++] = pos;
- }
- }
-
- if (gotRoot)
- return gTrue;
-
- error(-1, "Couldn't find trailer dictionary");
- return gFalse;
-}
-
-void XRef::setEncryption(int permFlagsA, GBool ownerPasswordOkA,
- Guchar *fileKeyA, int keyLengthA, int encVersionA,
- CryptAlgorithm encAlgorithmA) {
- int i;
-
- encrypted = gTrue;
- permFlags = permFlagsA;
- ownerPasswordOk = ownerPasswordOkA;
- if (keyLengthA <= 16) {
- keyLength = keyLengthA;
- } else {
- keyLength = 16;
- }
- for (i = 0; i < keyLength; ++i) {
- fileKey[i] = fileKeyA[i];
- }
- encVersion = encVersionA;
- encAlgorithm = encAlgorithmA;
-}
-
-GBool XRef::okToPrint(GBool ignoreOwnerPW) {
- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint);
-}
-
-GBool XRef::okToChange(GBool ignoreOwnerPW) {
- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange);
-}
-
-GBool XRef::okToCopy(GBool ignoreOwnerPW) {
- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy);
-}
-
-GBool XRef::okToAddNotes(GBool ignoreOwnerPW) {
- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes);
-}
-
-Object *XRef::fetch(int num, int gen, Object *obj) {
- XRefEntry *e;
- Parser *parser;
- Object obj1, obj2, obj3;
-
- // check for bogus ref - this can happen in corrupted PDF files
- if (num < 0 || num >= size) {
- goto err;
- }
-
- e = &entries[num];
- switch (e->type) {
-
- case xrefEntryUncompressed:
- if (e->gen != gen) {
- goto err;
- }
- obj1.initNull();
- parser = new Parser(this,
- new Lexer(this,
- str->makeSubStream(start + e->offset, gFalse, 0, &obj1)),
- gTrue);
- parser->getObj(&obj1);
- parser->getObj(&obj2);
- parser->getObj(&obj3);
- if (!obj1.isInt() || obj1.getInt() != num ||
- !obj2.isInt() || obj2.getInt() != gen ||
- !obj3.isCmd("obj")) {
- obj1.free();
- obj2.free();
- obj3.free();
- delete parser;
- goto err;
- }
- parser->getObj(obj, encrypted ? fileKey : (Guchar *)NULL,
- encAlgorithm, keyLength, num, gen);
- obj1.free();
- obj2.free();
- obj3.free();
- delete parser;
- break;
-
- case xrefEntryCompressed:
- if (gen != 0) {
- goto err;
- }
- if (!objStr || objStr->getObjStrNum() != (int)e->offset) {
- if (objStr) {
- delete objStr;
- }
- objStr = new ObjectStream(this, e->offset);
- if (!objStr->isOk()) {
- delete objStr;
- objStr = NULL;
- goto err;
- }
- }
- objStr->getObject(e->gen, num, obj);
- break;
-
- default:
- goto err;
- }
-
- return obj;
-
- err:
- return obj->initNull();
-}
-
-Object *XRef::getDocInfo(Object *obj) {
- return trailerDict.dictLookup("Info", obj);
-}
-
-// Added for the pdftex project.
-Object *XRef::getDocInfoNF(Object *obj) {
- return trailerDict.dictLookupNF("Info", obj);
-}
-
-GBool XRef::getStreamEnd(Guint streamStart, Guint *streamEnd) {
- int a, b, m;
-
- if (streamEndsLen == 0 ||
- streamStart > streamEnds[streamEndsLen - 1]) {
- return gFalse;
- }
-
- a = -1;
- b = streamEndsLen - 1;
- // invariant: streamEnds[a] < streamStart <= streamEnds[b]
- while (b - a > 1) {
- m = (a + b) / 2;
- if (streamStart <= streamEnds[m]) {
- b = m;
- } else {
- a = m;
- }
- }
- *streamEnd = streamEnds[b];
- return gTrue;
-}
-
-int XRef::getNumEntry(Guint offset) const
-{
- if (size > 0)
- {
- int res = 0;
- Guint resOffset = entries[0].offset;
- XRefEntry e;
- for (int i = 1; i < size; ++i)
- {
- e = entries[i];
- if (e.offset < offset && e.offset >= resOffset)
- {
- res = i;
- resOffset = e.offset;
- }
- }
- return res;
- }
- else return -1;
-}
-
-Guint XRef::strToUnsigned(char *s) {
- Guint x;
- char *p;
- int i;
-
- x = 0;
- for (p = s, i = 0; *p && isdigit(*p) && i < 10; ++p, ++i) {
- x = 10 * x + (*p - '0');
- }
- return x;
-}
diff --git a/kpdf/xpdf/xpdf/XRef.cpp b/kpdf/xpdf/xpdf/XRef.cpp
new file mode 100644
index 00000000..06a1c4e1
--- /dev/null
+++ b/kpdf/xpdf/xpdf/XRef.cpp
@@ -0,0 +1,933 @@
+//========================================================================
+//
+// XRef.cpp
+//
+// Copyright 1996-2003 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <ctype.h>
+#include "gmem.h"
+#include "Object.h"
+#include "Stream.h"
+#include "Lexer.h"
+#include "Parser.h"
+#include "Dict.h"
+#include "Error.h"
+#include "ErrorCodes.h"
+#include "XRef.h"
+
+//------------------------------------------------------------------------
+
+#define xrefSearchSize 1024 // read this many bytes at end of file
+ // to look for 'startxref'
+
+//------------------------------------------------------------------------
+// Permission bits
+//------------------------------------------------------------------------
+
+#define permPrint (1<<2)
+#define permChange (1<<3)
+#define permCopy (1<<4)
+#define permNotes (1<<5)
+#define defPermFlags 0xfffc
+
+//------------------------------------------------------------------------
+// ObjectStream
+//------------------------------------------------------------------------
+
+class ObjectStream {
+public:
+
+ // Create an object stream, using object number <objStrNum>,
+ // generation 0.
+ ObjectStream(XRef *xref, int objStrNumA);
+
+ GBool isOk() { return ok; }
+
+ ~ObjectStream();
+
+ // Return the object number of this object stream.
+ int getObjStrNum() { return objStrNum; }
+
+ // Get the <objIdx>th object from this stream, which should be
+ // object number <objNum>, generation 0.
+ Object *getObject(int objIdx, int objNum, Object *obj);
+
+private:
+
+ int objStrNum; // object number of the object stream
+ int nObjects; // number of objects in the stream
+ Object *objs; // the objects (length = nObjects)
+ int *objNums; // the object numbers (length = nObjects)
+ GBool ok;
+};
+
+ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
+ Stream *str;
+ Parser *parser;
+ int *offsets;
+ Object objStr, obj1, obj2;
+ int first, i;
+
+ objStrNum = objStrNumA;
+ nObjects = 0;
+ objs = NULL;
+ objNums = NULL;
+ ok = gFalse;
+
+ if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
+ goto err1;
+ }
+
+ if (!objStr.streamGetDict()->lookup("N", &obj1)->isInt()) {
+ obj1.free();
+ goto err1;
+ }
+ nObjects = obj1.getInt();
+ obj1.free();
+ if (nObjects <= 0) {
+ goto err1;
+ }
+
+ if (!objStr.streamGetDict()->lookup("First", &obj1)->isInt()) {
+ obj1.free();
+ goto err1;
+ }
+ first = obj1.getInt();
+ obj1.free();
+ if (first < 0) {
+ goto err1;
+ }
+
+ // this is an arbitrary limit to avoid integer overflow problems
+ // in the 'new Object[nObjects]' call (Acrobat apparently limits
+ // object streams to 100-200 objects)
+ if (nObjects > 1000000) {
+ error(-1, "Too many objects in an object stream");
+ goto err1;
+ }
+ objs = new Object[nObjects];
+ objNums = (int *)gmallocn(nObjects, sizeof(int));
+ offsets = (int *)gmallocn(nObjects, sizeof(int));
+
+ // parse the header: object numbers and offsets
+ objStr.streamReset();
+ obj1.initNull();
+ str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first);
+ parser = new Parser(xref, new Lexer(xref, str), gFalse);
+ for (i = 0; i < nObjects; ++i) {
+ parser->getObj(&obj1);
+ parser->getObj(&obj2);
+ if (!obj1.isInt() || !obj2.isInt()) {
+ obj1.free();
+ obj2.free();
+ delete parser;
+ gfree(offsets);
+ goto err1;
+ }
+ objNums[i] = obj1.getInt();
+ offsets[i] = obj2.getInt();
+ obj1.free();
+ obj2.free();
+ if (objNums[i] < 0 || offsets[i] < 0 ||
+ (i > 0 && offsets[i] < offsets[i-1])) {
+ delete parser;
+ gfree(offsets);
+ goto err1;
+ }
+ }
+ while (str->getChar() != EOF) ;
+ delete parser;
+
+ // skip to the first object - this shouldn't be necessary because
+ // the First key is supposed to be equal to offsets[0], but just in
+ // case...
+ for (i = first; i < offsets[0]; ++i) {
+ objStr.getStream()->getChar();
+ }
+
+ // parse the objects
+ for (i = 0; i < nObjects; ++i) {
+ obj1.initNull();
+ if (i == nObjects - 1) {
+ str = new EmbedStream(objStr.getStream(), &obj1, gFalse, 0);
+ } else {
+ str = new EmbedStream(objStr.getStream(), &obj1, gTrue,
+ offsets[i+1] - offsets[i]);
+ }
+ parser = new Parser(xref, new Lexer(xref, str), gFalse);
+ parser->getObj(&objs[i]);
+ while (str->getChar() != EOF) ;
+ delete parser;
+ }
+
+ gfree(offsets);
+ ok = gTrue;
+
+ err1:
+ objStr.free();
+}
+
+ObjectStream::~ObjectStream() {
+ int i;
+
+ if (objs) {
+ for (i = 0; i < nObjects; ++i) {
+ objs[i].free();
+ }
+ delete[] objs;
+ }
+ gfree(objNums);
+}
+
+Object *ObjectStream::getObject(int objIdx, int objNum, Object *obj) {
+ if (objIdx < 0 || objIdx >= nObjects || objNum != objNums[objIdx]) {
+ return obj->initNull();
+ }
+ return objs[objIdx].copy(obj);
+}
+
+//------------------------------------------------------------------------
+// XRef
+//------------------------------------------------------------------------
+
+XRef::XRef(BaseStream *strA) {
+ Guint pos;
+ Object obj;
+
+ ok = gTrue;
+ errCode = errNone;
+ size = 0;
+ entries = NULL;
+ streamEnds = NULL;
+ streamEndsLen = 0;
+ objStr = NULL;
+
+ encrypted = gFalse;
+ permFlags = defPermFlags;
+ ownerPasswordOk = gFalse;
+
+ // read the trailer
+ str = strA;
+ start = str->getStart();
+ pos = getStartXref();
+
+ // if there was a problem with the 'startxref' position, try to
+ // reconstruct the xref table
+ if (pos == 0) {
+ if (!(ok = constructXRef())) {
+ errCode = errDamaged;
+ return;
+ }
+
+ // read the xref table
+ } else {
+ while (readXRef(&pos)) ;
+
+ // if there was a problem with the xref table,
+ // try to reconstruct it
+ if (!ok) {
+ if (!(ok = constructXRef())) {
+ errCode = errDamaged;
+ return;
+ }
+ }
+ }
+
+ // get the root dictionary (catalog) object
+ trailerDict.dictLookupNF("Root", &obj);
+ if (obj.isRef()) {
+ rootNum = obj.getRefNum();
+ rootGen = obj.getRefGen();
+ obj.free();
+ } else {
+ obj.free();
+ if (!(ok = constructXRef())) {
+ errCode = errDamaged;
+ return;
+ }
+ }
+
+ // now set the trailer dictionary's xref pointer so we can fetch
+ // indirect objects from it
+ trailerDict.getDict()->setXRef(this);
+}
+
+XRef::~XRef() {
+ gfree(entries);
+ trailerDict.free();
+ if (streamEnds) {
+ gfree(streamEnds);
+ }
+ if (objStr) {
+ delete objStr;
+ }
+}
+
+// Read the 'startxref' position.
+Guint XRef::getStartXref() {
+ char buf[xrefSearchSize+1];
+ char *p;
+ int c, n, i;
+
+ // read last xrefSearchSize bytes
+ str->setPos(xrefSearchSize, -1);
+ for (n = 0; n < xrefSearchSize; ++n) {
+ if ((c = str->getChar()) == EOF) {
+ break;
+ }
+ buf[n] = c;
+ }
+ buf[n] = '\0';
+
+ // find startxref
+ for (i = n - 9; i >= 0; --i) {
+ if (!strncmp(&buf[i], "startxref", 9)) {
+ break;
+ }
+ }
+ if (i < 0) {
+ return 0;
+ }
+ for (p = &buf[i+9]; isspace(*p); ++p) ;
+ lastXRefPos = strToUnsigned(p);
+
+ return lastXRefPos;
+}
+
+// Read one xref table section. Also reads the associated trailer
+// dictionary, and returns the prev pointer (if any).
+GBool XRef::readXRef(Guint *pos) {
+ Parser *parser;
+ Object obj;
+ GBool more;
+
+ // start up a parser, parse one token
+ obj.initNull();
+ parser = new Parser(NULL,
+ new Lexer(NULL,
+ str->makeSubStream(start + *pos, gFalse, 0, &obj)),
+ gTrue);
+ parser->getObj(&obj);
+
+ // parse an old-style xref table
+ if (obj.isCmd("xref")) {
+ obj.free();
+ more = readXRefTable(parser, pos);
+
+ // parse an xref stream
+ } else if (obj.isInt()) {
+ obj.free();
+ if (!parser->getObj(&obj)->isInt()) {
+ goto err1;
+ }
+ obj.free();
+ if (!parser->getObj(&obj)->isCmd("obj")) {
+ goto err1;
+ }
+ obj.free();
+ if (!parser->getObj(&obj)->isStream()) {
+ goto err1;
+ }
+ more = readXRefStream(obj.getStream(), pos);
+ obj.free();
+
+ } else {
+ goto err1;
+ }
+
+ delete parser;
+ return more;
+
+ err1:
+ obj.free();
+ delete parser;
+ ok = gFalse;
+ return gFalse;
+}
+
+GBool XRef::readXRefTable(Parser *parser, Guint *pos) {
+ XRefEntry entry;
+ GBool more;
+ Object obj, obj2;
+ Guint pos2;
+ int first, n, newSize, i;
+
+ while (1) {
+ parser->getObj(&obj);
+ if (obj.isCmd("trailer")) {
+ obj.free();
+ break;
+ }
+ if (!obj.isInt()) {
+ goto err1;
+ }
+ first = obj.getInt();
+ obj.free();
+ if (!parser->getObj(&obj)->isInt()) {
+ goto err1;
+ }
+ n = obj.getInt();
+ obj.free();
+ if (first < 0 || n < 0 || first + n < 0) {
+ goto err1;
+ }
+ if (first + n > size) {
+ for (newSize = size ? 2 * size : 1024;
+ first + n > newSize && newSize > 0;
+ newSize <<= 1) ;
+ if (newSize < 0) {
+ goto err1;
+ }
+ entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+ entries[i].type = xrefEntryFree;
+ }
+ size = newSize;
+ }
+ for (i = first; i < first + n; ++i) {
+ if (!parser->getObj(&obj)->isInt()) {
+ goto err1;
+ }
+ entry.offset = (Guint)obj.getInt();
+ obj.free();
+ if (!parser->getObj(&obj)->isInt()) {
+ goto err1;
+ }
+ entry.gen = obj.getInt();
+ obj.free();
+ parser->getObj(&obj);
+ if (obj.isCmd("n")) {
+ entry.type = xrefEntryUncompressed;
+ } else if (obj.isCmd("f")) {
+ entry.type = xrefEntryFree;
+ } else {
+ goto err1;
+ }
+ obj.free();
+ if (entries[i].offset == 0xffffffff) {
+ entries[i] = entry;
+ // PDF files of patents from the IBM Intellectual Property
+ // Network have a bug: the xref table claims to start at 1
+ // instead of 0.
+ if (i == 1 && first == 1 &&
+ entries[1].offset == 0 && entries[1].gen == 65535 &&
+ entries[1].type == xrefEntryFree) {
+ i = first = 0;
+ entries[0] = entries[1];
+ entries[1].offset = 0xffffffff;
+ }
+ }
+ }
+ }
+
+ // read the trailer dictionary
+ if (!parser->getObj(&obj)->isDict()) {
+ goto err1;
+ }
+
+ // get the 'Prev' pointer
+ obj.getDict()->lookupNF("Prev", &obj2);
+ if (obj2.isInt()) {
+ *pos = (Guint)obj2.getInt();
+ more = gTrue;
+ } else if (obj2.isRef()) {
+ // certain buggy PDF generators generate "/Prev NNN 0 R" instead
+ // of "/Prev NNN"
+ *pos = (Guint)obj2.getRefNum();
+ more = gTrue;
+ } else {
+ more = gFalse;
+ }
+ obj2.free();
+
+ // save the first trailer dictionary
+ if (trailerDict.isNone()) {
+ obj.copy(&trailerDict);
+ }
+
+ // check for an 'XRefStm' key
+ if (obj.getDict()->lookup("XRefStm", &obj2)->isInt()) {
+ pos2 = (Guint)obj2.getInt();
+ readXRef(&pos2);
+ if (!ok) {
+ obj2.free();
+ goto err1;
+ }
+ }
+ obj2.free();
+
+ obj.free();
+ return more;
+
+ err1:
+ obj.free();
+ ok = gFalse;
+ return gFalse;
+}
+
+GBool XRef::readXRefStream(Stream *xrefStr, Guint *pos) {
+ Dict *dict;
+ int w[3];
+ GBool more;
+ Object obj, obj2, idx;
+ int newSize, first, n, i;
+
+ dict = xrefStr->getDict();
+
+ if (!dict->lookupNF("Size", &obj)->isInt()) {
+ goto err1;
+ }
+ newSize = obj.getInt();
+ obj.free();
+ if (newSize < 0) {
+ goto err1;
+ }
+ if (newSize > size) {
+ entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+ entries[i].type = xrefEntryFree;
+ }
+ size = newSize;
+ }
+
+ if (!dict->lookupNF("W", &obj)->isArray() ||
+ obj.arrayGetLength() < 3) {
+ goto err1;
+ }
+ for (i = 0; i < 3; ++i) {
+ if (!obj.arrayGet(i, &obj2)->isInt()) {
+ obj2.free();
+ goto err1;
+ }
+ w[i] = obj2.getInt();
+ obj2.free();
+ if (w[i] < 0 || w[i] > 4) {
+ goto err1;
+ }
+ }
+ obj.free();
+
+ xrefStr->reset();
+ dict->lookupNF("Index", &idx);
+ if (idx.isArray()) {
+ for (i = 0; i+1 < idx.arrayGetLength(); i += 2) {
+ if (!idx.arrayGet(i, &obj)->isInt()) {
+ idx.free();
+ goto err1;
+ }
+ first = obj.getInt();
+ obj.free();
+ if (!idx.arrayGet(i+1, &obj)->isInt()) {
+ idx.free();
+ goto err1;
+ }
+ n = obj.getInt();
+ obj.free();
+ if (first < 0 || n < 0 ||
+ !readXRefStreamSection(xrefStr, w, first, n)) {
+ idx.free();
+ goto err0;
+ }
+ }
+ } else {
+ if (!readXRefStreamSection(xrefStr, w, 0, newSize)) {
+ idx.free();
+ goto err0;
+ }
+ }
+ idx.free();
+
+ dict->lookupNF("Prev", &obj);
+ if (obj.isInt()) {
+ *pos = (Guint)obj.getInt();
+ more = gTrue;
+ } else {
+ more = gFalse;
+ }
+ obj.free();
+ if (trailerDict.isNone()) {
+ trailerDict.initDict(dict);
+ }
+
+ return more;
+
+ err1:
+ obj.free();
+ err0:
+ ok = gFalse;
+ return gFalse;
+}
+
+GBool XRef::readXRefStreamSection(Stream *xrefStr, int *w, int first, int n) {
+ Guint offset;
+ int type, gen, c, newSize, i, j;
+
+ if (first + n < 0) {
+ return gFalse;
+ }
+ if (first + n > size) {
+ for (newSize = size ? 2 * size : 1024;
+ first + n > newSize && newSize > 0;
+ newSize <<= 1) ;
+ if (newSize < 0) {
+ return gFalse;
+ }
+ entries = (XRefEntry *)greallocn(entries, newSize, sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+ entries[i].type = xrefEntryFree;
+ }
+ size = newSize;
+ }
+ for (i = first; i < first + n; ++i) {
+ if (w[0] == 0) {
+ type = 1;
+ } else {
+ for (type = 0, j = 0; j < w[0]; ++j) {
+ if ((c = xrefStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ type = (type << 8) + c;
+ }
+ }
+ for (offset = 0, j = 0; j < w[1]; ++j) {
+ if ((c = xrefStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ offset = (offset << 8) + c;
+ }
+ for (gen = 0, j = 0; j < w[2]; ++j) {
+ if ((c = xrefStr->getChar()) == EOF) {
+ return gFalse;
+ }
+ gen = (gen << 8) + c;
+ }
+ if (entries[i].offset == 0xffffffff) {
+ switch (type) {
+ case 0:
+ entries[i].offset = offset;
+ entries[i].gen = gen;
+ entries[i].type = xrefEntryFree;
+ break;
+ case 1:
+ entries[i].offset = offset;
+ entries[i].gen = gen;
+ entries[i].type = xrefEntryUncompressed;
+ break;
+ case 2:
+ entries[i].offset = offset;
+ entries[i].gen = gen;
+ entries[i].type = xrefEntryCompressed;
+ break;
+ default:
+ return gFalse;
+ }
+ }
+ }
+
+ return gTrue;
+}
+
+// Attempt to construct an xref table for a damaged file.
+GBool XRef::constructXRef() {
+ Parser *parser;
+ Object newTrailerDict, obj;
+ char buf[256];
+ Guint pos;
+ int num, gen;
+ int newSize;
+ int streamEndsSize;
+ char *p;
+ int i;
+ GBool gotRoot;
+
+ gfree(entries);
+ size = 0;
+ entries = NULL;
+
+ error(-1, "PDF file is damaged - attempting to reconstruct xref table...");
+ gotRoot = gFalse;
+ streamEndsLen = streamEndsSize = 0;
+
+ str->reset();
+ while (1) {
+ pos = str->getPos();
+ if (!str->getLine(buf, 256)) {
+ break;
+ }
+ p = buf;
+
+ // skip whitespace
+ while (*p && Lexer::isSpace(*p & 0xff)) ++p;
+
+ // got trailer dictionary
+ if (!strncmp(p, "trailer", 7)) {
+ obj.initNull();
+ parser = new Parser(NULL,
+ new Lexer(NULL,
+ str->makeSubStream(pos + 7, gFalse, 0, &obj)),
+ gFalse);
+ parser->getObj(&newTrailerDict);
+ if (newTrailerDict.isDict()) {
+ newTrailerDict.dictLookupNF("Root", &obj);
+ if (obj.isRef()) {
+ rootNum = obj.getRefNum();
+ rootGen = obj.getRefGen();
+ if (!trailerDict.isNone()) {
+ trailerDict.free();
+ }
+ newTrailerDict.copy(&trailerDict);
+ gotRoot = gTrue;
+ }
+ obj.free();
+ }
+ newTrailerDict.free();
+ delete parser;
+
+ // look for object
+ } else if (isdigit(*p)) {
+ num = atoi(p);
+ if (num > 0) {
+ do {
+ ++p;
+ } while (*p && isdigit(*p));
+ if (isspace(*p)) {
+ do {
+ ++p;
+ } while (*p && isspace(*p));
+ if (isdigit(*p)) {
+ gen = atoi(p);
+ do {
+ ++p;
+ } while (*p && isdigit(*p));
+ if (isspace(*p)) {
+ do {
+ ++p;
+ } while (*p && isspace(*p));
+ if (!strncmp(p, "obj", 3)) {
+ if (num >= size) {
+ newSize = (num + 1 + 255) & ~255;
+ if (newSize < 0) {
+ error(-1, "Bad object number");
+ return gFalse;
+ }
+ entries = (XRefEntry *)
+ greallocn(entries, newSize, sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+ entries[i].type = xrefEntryFree;
+ }
+ size = newSize;
+ }
+ if (entries[num].type == xrefEntryFree ||
+ gen >= entries[num].gen) {
+ entries[num].offset = pos - start;
+ entries[num].gen = gen;
+ entries[num].type = xrefEntryUncompressed;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ } else if (!strncmp(p, "endstream", 9)) {
+ if (streamEndsLen == streamEndsSize) {
+ streamEndsSize += 64;
+ streamEnds = (Guint *)greallocn(streamEnds,
+ streamEndsSize, sizeof(int));
+ }
+ streamEnds[streamEndsLen++] = pos;
+ }
+ }
+
+ if (gotRoot)
+ return gTrue;
+
+ error(-1, "Couldn't find trailer dictionary");
+ return gFalse;
+}
+
+void XRef::setEncryption(int permFlagsA, GBool ownerPasswordOkA,
+ Guchar *fileKeyA, int keyLengthA, int encVersionA,
+ CryptAlgorithm encAlgorithmA) {
+ int i;
+
+ encrypted = gTrue;
+ permFlags = permFlagsA;
+ ownerPasswordOk = ownerPasswordOkA;
+ if (keyLengthA <= 16) {
+ keyLength = keyLengthA;
+ } else {
+ keyLength = 16;
+ }
+ for (i = 0; i < keyLength; ++i) {
+ fileKey[i] = fileKeyA[i];
+ }
+ encVersion = encVersionA;
+ encAlgorithm = encAlgorithmA;
+}
+
+GBool XRef::okToPrint(GBool ignoreOwnerPW) {
+ return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint);
+}
+
+GBool XRef::okToChange(GBool ignoreOwnerPW) {
+ return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange);
+}
+
+GBool XRef::okToCopy(GBool ignoreOwnerPW) {
+ return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy);
+}
+
+GBool XRef::okToAddNotes(GBool ignoreOwnerPW) {
+ return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes);
+}
+
+Object *XRef::fetch(int num, int gen, Object *obj) {
+ XRefEntry *e;
+ Parser *parser;
+ Object obj1, obj2, obj3;
+
+ // check for bogus ref - this can happen in corrupted PDF files
+ if (num < 0 || num >= size) {
+ goto err;
+ }
+
+ e = &entries[num];
+ switch (e->type) {
+
+ case xrefEntryUncompressed:
+ if (e->gen != gen) {
+ goto err;
+ }
+ obj1.initNull();
+ parser = new Parser(this,
+ new Lexer(this,
+ str->makeSubStream(start + e->offset, gFalse, 0, &obj1)),
+ gTrue);
+ parser->getObj(&obj1);
+ parser->getObj(&obj2);
+ parser->getObj(&obj3);
+ if (!obj1.isInt() || obj1.getInt() != num ||
+ !obj2.isInt() || obj2.getInt() != gen ||
+ !obj3.isCmd("obj")) {
+ obj1.free();
+ obj2.free();
+ obj3.free();
+ delete parser;
+ goto err;
+ }
+ parser->getObj(obj, encrypted ? fileKey : (Guchar *)NULL,
+ encAlgorithm, keyLength, num, gen);
+ obj1.free();
+ obj2.free();
+ obj3.free();
+ delete parser;
+ break;
+
+ case xrefEntryCompressed:
+ if (gen != 0) {
+ goto err;
+ }
+ if (!objStr || objStr->getObjStrNum() != (int)e->offset) {
+ if (objStr) {
+ delete objStr;
+ }
+ objStr = new ObjectStream(this, e->offset);
+ if (!objStr->isOk()) {
+ delete objStr;
+ objStr = NULL;
+ goto err;
+ }
+ }
+ objStr->getObject(e->gen, num, obj);
+ break;
+
+ default:
+ goto err;
+ }
+
+ return obj;
+
+ err:
+ return obj->initNull();
+}
+
+Object *XRef::getDocInfo(Object *obj) {
+ return trailerDict.dictLookup("Info", obj);
+}
+
+// Added for the pdftex project.
+Object *XRef::getDocInfoNF(Object *obj) {
+ return trailerDict.dictLookupNF("Info", obj);
+}
+
+GBool XRef::getStreamEnd(Guint streamStart, Guint *streamEnd) {
+ int a, b, m;
+
+ if (streamEndsLen == 0 ||
+ streamStart > streamEnds[streamEndsLen - 1]) {
+ return gFalse;
+ }
+
+ a = -1;
+ b = streamEndsLen - 1;
+ // invariant: streamEnds[a] < streamStart <= streamEnds[b]
+ while (b - a > 1) {
+ m = (a + b) / 2;
+ if (streamStart <= streamEnds[m]) {
+ b = m;
+ } else {
+ a = m;
+ }
+ }
+ *streamEnd = streamEnds[b];
+ return gTrue;
+}
+
+int XRef::getNumEntry(Guint offset) const
+{
+ if (size > 0)
+ {
+ int res = 0;
+ Guint resOffset = entries[0].offset;
+ XRefEntry e;
+ for (int i = 1; i < size; ++i)
+ {
+ e = entries[i];
+ if (e.offset < offset && e.offset >= resOffset)
+ {
+ res = i;
+ resOffset = e.offset;
+ }
+ }
+ return res;
+ }
+ else return -1;
+}
+
+Guint XRef::strToUnsigned(char *s) {
+ Guint x;
+ char *p;
+ int i;
+
+ x = 0;
+ for (p = s, i = 0; *p && isdigit(*p) && i < 10; ++p, ++i) {
+ x = 10 * x + (*p - '0');
+ }
+ return x;
+}
diff --git a/kpovmodeler/CMakeL10n.txt b/kpovmodeler/CMakeL10n.txt
index 084877a7..f85ad75d 100644
--- a/kpovmodeler/CMakeL10n.txt
+++ b/kpovmodeler/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kpovmodeler" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kpovmodeler.desktop/"
+ SOURCES kpovmodeler.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kpovmodeler/CMakeLists.txt b/kpovmodeler/CMakeLists.txt
index 1ab30fc0..b589117f 100644
--- a/kpovmodeler/CMakeLists.txt
+++ b/kpovmodeler/CMakeLists.txt
@@ -19,7 +19,7 @@ include_directories(
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
- ${GLU_INCLUDE_DIRS}
+ ${OPENGL_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
)
@@ -32,9 +32,7 @@ link_directories(
tde_install_icons( kpovmodeler_doc kpovmodeler )
-install( FILES
- kpovmodeler.desktop
- DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( kpovmodeler.desktop )
install( FILES
kpovmodelershell.rc kpovmodelerui.rc kpovmodelerbrowser.rc
@@ -114,14 +112,14 @@ tde_add_library( kpovmodeler SHARED AUTOMOC
pmlibraryiconview.cpp pmlibraryobjectsearch.cpp pmpluginmanager.cpp
pmpartiface.skel
VERSION 0.0.0
- LINK tdeparts-shared ${GLU_LIBRARIES} ${XMU_LIBRARIES}
+ LINK tdeparts-shared ${OPENGL_LIBRARIES} ${XMU_LIBRARIES} ${FREETYPE_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}
)
##### libkpovmodelerpart (module) ###############
-configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_dummy_cpp.cmake dummy.cpp COPYONLY )
+configure_file( ${TDE_CMAKE_TEMPLATES}/tde_dummy_cpp.cmake dummy.cpp COPYONLY )
tde_add_kpart( libkpovmodelerpart AUTOMOC
SOURCES dummy.cpp
diff --git a/kpovmodeler/ConfigureChecks.cmake b/kpovmodeler/ConfigureChecks.cmake
index f4fdd1c0..a55045d4 100644
--- a/kpovmodeler/ConfigureChecks.cmake
+++ b/kpovmodeler/ConfigureChecks.cmake
@@ -10,13 +10,14 @@
#################################################
# glu
-pkg_search_module( GLU glu )
-if( NOT GLU_FOUND )
+set( OpenGL_GL_PREFERENCE LEGACY )
+find_package( OpenGL )
+if( NOT OPENGL_FOUND )
check_include_file ( GL/glu.h HAVE_GLU )
if( NOT HAVE_GLU )
- tde_message_fatal( "glu is required, but was not found on your system" )
+ tde_message_fatal( "OpenGL (glu) is required, but was not found on your system" )
endif ( )
- set( GLU_LIBRARIES "-lGL -lGLU" )
+ set( OPENGL_LIBRARIES "-lGL -lGLU" )
endif( )
diff --git a/kpovmodeler/kpovmodeler.desktop b/kpovmodeler/kpovmodeler.desktop
index d22ca795..2f3d10a3 100644
--- a/kpovmodeler/kpovmodeler.desktop
+++ b/kpovmodeler/kpovmodeler.desktop
@@ -4,53 +4,7 @@ Exec=kpovmodeler -caption "%c" %i %m %f
Icon=kpovmodeler
MimeType=application/x-kpovmodeler;
Name=KPovModeler
-Name[eo]=KPovModelilo
-Name[es]=Modelador Povray
-Name[he]=מעצב Povray
-Name[nb]=KPov-modellerer
-Name[ne]=केडीई पोभ मोडेलर
-Name[nn]=KPov-modellering
-Name[sv]=Kpovmodeler
GenericName=Povray Modeler
-GenericName[ca]=Modelador Povray
-GenericName[cs]=Modelář Povray
-GenericName[cy]=Modelydd Povray
-GenericName[da]=Povray-modellering
-GenericName[de]=Povray-Modellierer
-GenericName[en_GB]=Povray Modeller
-GenericName[eo]=Povray-modelilo
-GenericName[es]=Modelador Povray
-GenericName[et]=Povray modelleerija
-GenericName[eu]=Povray modelatzailea
-GenericName[fa]=سازندۀ مدل Povray
-GenericName[fi]=Povray-mallintaja
-GenericName[fr]=Modeleur Povray
-GenericName[gl]=Modelador Povray
-GenericName[he]=מעצב Povray
-GenericName[hu]=Povray-modellező
-GenericName[is]=Povray hönnuður
-GenericName[it]=Modellatore per Povray
-GenericName[ja]=Povray モデラー
-GenericName[kk]=Povray үлгілеу
-GenericName[km]=កម្មវិធី​ធ្វើ​ម៉ូដែល Povray
-GenericName[ms]=Pemodel Povray
-GenericName[nb]=Povray-modellerer
-GenericName[nds]=Povray-Modellmaker
-GenericName[ne]=पोभ्रे मोडेलर
-GenericName[nn]=Povray-modellering
-GenericName[pl]=Modeler Povray
-GenericName[pt]=Modelador de Povray
-GenericName[pt_BR]=Modelador Povray
-GenericName[ro]=Modelator Povray
-GenericName[ru]=Редактор Povray
-GenericName[sl]=Modelirnik Povray
-GenericName[sr]=Моделар за Povray
-GenericName[sr@Latn]=Modelar za Povray
-GenericName[sv]=Modellering med Povray
-GenericName[ta]=பாவ்ரே மாடுல்லர்
-GenericName[tr]=Povray Modelleyici
-GenericName[zh_CN]=Povray 建模器
-GenericName[zh_HK]=Povray 建模器
Path=
X-TDE-ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart,Browser/View,KPovModeler/Document
Terminal=false
diff --git a/kpovmodeler/pm2dcontrolpoint.h b/kpovmodeler/pm2dcontrolpoint.h
index 40b26d85..b81328b9 100644
--- a/kpovmodeler/pm2dcontrolpoint.h
+++ b/kpovmodeler/pm2dcontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pm3dcontrolpoint.h b/kpovmodeler/pm3dcontrolpoint.h
index 3af82a28..e21be11f 100644
--- a/kpovmodeler/pm3dcontrolpoint.h
+++ b/kpovmodeler/pm3dcontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmactions.cpp b/kpovmodeler/pmactions.cpp
index 31ef2aac..3b1201c4 100644
--- a/kpovmodeler/pmactions.cpp
+++ b/kpovmodeler/pmactions.cpp
@@ -116,7 +116,7 @@ void PMComboAction::unplug( TQWidget *w )
// Use a toolbutton instead of a label so it is styled correctly.
-// copied from konq_actions.cc
+// copied from konq_actions.cpp
class PMToolBarLabel : public TQToolButton
{
public:
diff --git a/kpovmodeler/pmactions.h b/kpovmodeler/pmactions.h
index 7e4a4f68..68656d50 100644
--- a/kpovmodeler/pmactions.h
+++ b/kpovmodeler/pmactions.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmaddcommand.h b/kpovmodeler/pmaddcommand.h
index 97793d03..d84a495c 100644
--- a/kpovmodeler/pmaddcommand.h
+++ b/kpovmodeler/pmaddcommand.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmallcommands.h b/kpovmodeler/pmallcommands.h
index 014b5a04..b3a5fb25 100644
--- a/kpovmodeler/pmallcommands.h
+++ b/kpovmodeler/pmallcommands.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmalledits.h b/kpovmodeler/pmalledits.h
index e1ee4a5a..c237d337 100644
--- a/kpovmodeler/pmalledits.h
+++ b/kpovmodeler/pmalledits.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmallobjects.h b/kpovmodeler/pmallobjects.h
index 3a02107c..94e93538 100644
--- a/kpovmodeler/pmallobjects.h
+++ b/kpovmodeler/pmallobjects.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmbicubicpatch.h b/kpovmodeler/pmbicubicpatch.h
index d14f7821..b2fbe7f1 100644
--- a/kpovmodeler/pmbicubicpatch.h
+++ b/kpovmodeler/pmbicubicpatch.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmbicubicpatchedit.h b/kpovmodeler/pmbicubicpatchedit.h
index 36a564b5..dd503c9c 100644
--- a/kpovmodeler/pmbicubicpatchedit.h
+++ b/kpovmodeler/pmbicubicpatchedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblendmapmodifiers.h b/kpovmodeler/pmblendmapmodifiers.h
index ecf0bfed..9713e00f 100644
--- a/kpovmodeler/pmblendmapmodifiers.h
+++ b/kpovmodeler/pmblendmapmodifiers.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblendmapmodifiersedit.h b/kpovmodeler/pmblendmapmodifiersedit.h
index aa99913b..fceff4f9 100644
--- a/kpovmodeler/pmblendmapmodifiersedit.h
+++ b/kpovmodeler/pmblendmapmodifiersedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblob.h b/kpovmodeler/pmblob.h
index 2c764590..7dd049ca 100644
--- a/kpovmodeler/pmblob.h
+++ b/kpovmodeler/pmblob.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblobcylinder.h b/kpovmodeler/pmblobcylinder.h
index 1e9a10f1..0ea26f1a 100644
--- a/kpovmodeler/pmblobcylinder.h
+++ b/kpovmodeler/pmblobcylinder.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblobcylinderedit.h b/kpovmodeler/pmblobcylinderedit.h
index 35a8eff1..a9b126f0 100644
--- a/kpovmodeler/pmblobcylinderedit.h
+++ b/kpovmodeler/pmblobcylinderedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblobedit.h b/kpovmodeler/pmblobedit.h
index f7a3e72c..ee98e539 100644
--- a/kpovmodeler/pmblobedit.h
+++ b/kpovmodeler/pmblobedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmblobsphere.h b/kpovmodeler/pmblobsphere.h
index 0abe983e..59486152 100644
--- a/kpovmodeler/pmblobsphere.h
+++ b/kpovmodeler/pmblobsphere.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmboundedby.h b/kpovmodeler/pmboundedby.h
index 7c88a6aa..ed9f7cc7 100644
--- a/kpovmodeler/pmboundedby.h
+++ b/kpovmodeler/pmboundedby.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmboundedbyedit.h b/kpovmodeler/pmboundedbyedit.h
index a7b5b406..4b61b4aa 100644
--- a/kpovmodeler/pmboundedbyedit.h
+++ b/kpovmodeler/pmboundedbyedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmbox.h b/kpovmodeler/pmbox.h
index e6abcf75..cb019280 100644
--- a/kpovmodeler/pmbox.h
+++ b/kpovmodeler/pmbox.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmboxedit.h b/kpovmodeler/pmboxedit.h
index 6c09849b..6b1767da 100644
--- a/kpovmodeler/pmboxedit.h
+++ b/kpovmodeler/pmboxedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmbumpmap.h b/kpovmodeler/pmbumpmap.h
index ccdf5b98..f0a31f57 100644
--- a/kpovmodeler/pmbumpmap.h
+++ b/kpovmodeler/pmbumpmap.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmbumpmapedit.h b/kpovmodeler/pmbumpmapedit.h
index c68ec4f3..0e6d031d 100644
--- a/kpovmodeler/pmbumpmapedit.h
+++ b/kpovmodeler/pmbumpmapedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcamera.h b/kpovmodeler/pmcamera.h
index 7d385909..bbb0be36 100644
--- a/kpovmodeler/pmcamera.h
+++ b/kpovmodeler/pmcamera.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcameraedit.h b/kpovmodeler/pmcameraedit.h
index 1cc794d1..c125f486 100644
--- a/kpovmodeler/pmcameraedit.h
+++ b/kpovmodeler/pmcameraedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmclippedby.h b/kpovmodeler/pmclippedby.h
index 0e76e2cf..ce6a7440 100644
--- a/kpovmodeler/pmclippedby.h
+++ b/kpovmodeler/pmclippedby.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmclippedbyedit.h b/kpovmodeler/pmclippedbyedit.h
index ac9d8a4c..1b2bb6cb 100644
--- a/kpovmodeler/pmclippedbyedit.h
+++ b/kpovmodeler/pmclippedbyedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcolor.h b/kpovmodeler/pmcolor.h
index 61fd4c63..fec07729 100644
--- a/kpovmodeler/pmcolor.h
+++ b/kpovmodeler/pmcolor.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcoloredit.h b/kpovmodeler/pmcoloredit.h
index 3c501be6..414eda14 100644
--- a/kpovmodeler/pmcoloredit.h
+++ b/kpovmodeler/pmcoloredit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcommand.h b/kpovmodeler/pmcommand.h
index 5d32b9d4..baf38edf 100644
--- a/kpovmodeler/pmcommand.h
+++ b/kpovmodeler/pmcommand.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcommandmanager.h b/kpovmodeler/pmcommandmanager.h
index 841c3060..5685ad2c 100644
--- a/kpovmodeler/pmcommandmanager.h
+++ b/kpovmodeler/pmcommandmanager.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcomment.h b/kpovmodeler/pmcomment.h
index d435423d..022c28f1 100644
--- a/kpovmodeler/pmcomment.h
+++ b/kpovmodeler/pmcomment.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcommentedit.h b/kpovmodeler/pmcommentedit.h
index 5230c495..104160fe 100644
--- a/kpovmodeler/pmcommentedit.h
+++ b/kpovmodeler/pmcommentedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcompositeobject.h b/kpovmodeler/pmcompositeobject.h
index 350180db..2b7dd108 100644
--- a/kpovmodeler/pmcompositeobject.h
+++ b/kpovmodeler/pmcompositeobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcone.h b/kpovmodeler/pmcone.h
index c41f9325..110d4995 100644
--- a/kpovmodeler/pmcone.h
+++ b/kpovmodeler/pmcone.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmconeedit.h b/kpovmodeler/pmconeedit.h
index 2ec979ff..8bfc07d4 100644
--- a/kpovmodeler/pmconeedit.h
+++ b/kpovmodeler/pmconeedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcontrolpoint.h b/kpovmodeler/pmcontrolpoint.h
index a891bb9c..d21c654f 100644
--- a/kpovmodeler/pmcontrolpoint.h
+++ b/kpovmodeler/pmcontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcsg.h b/kpovmodeler/pmcsg.h
index 380bf0ef..0b07c98d 100644
--- a/kpovmodeler/pmcsg.h
+++ b/kpovmodeler/pmcsg.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcsgedit.h b/kpovmodeler/pmcsgedit.h
index bd8b315a..3600f0ff 100644
--- a/kpovmodeler/pmcsgedit.h
+++ b/kpovmodeler/pmcsgedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcylinder.h b/kpovmodeler/pmcylinder.h
index 1bd10901..f12b6e9b 100644
--- a/kpovmodeler/pmcylinder.h
+++ b/kpovmodeler/pmcylinder.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmcylinderedit.h b/kpovmodeler/pmcylinderedit.h
index 10d9a758..98bfdc98 100644
--- a/kpovmodeler/pmcylinderedit.h
+++ b/kpovmodeler/pmcylinderedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdatachangecommand.h b/kpovmodeler/pmdatachangecommand.h
index 878e0f4f..fc7df5a9 100644
--- a/kpovmodeler/pmdatachangecommand.h
+++ b/kpovmodeler/pmdatachangecommand.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdebug.h b/kpovmodeler/pmdebug.h
index 692bcd60..5bf84b18 100644
--- a/kpovmodeler/pmdebug.h
+++ b/kpovmodeler/pmdebug.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdeclare.h b/kpovmodeler/pmdeclare.h
index 89468bf4..b29fd844 100644
--- a/kpovmodeler/pmdeclare.h
+++ b/kpovmodeler/pmdeclare.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdeclareedit.h b/kpovmodeler/pmdeclareedit.h
index 70f18c39..260567a7 100644
--- a/kpovmodeler/pmdeclareedit.h
+++ b/kpovmodeler/pmdeclareedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdeletecommand.h b/kpovmodeler/pmdeletecommand.h
index d11cf348..ef042a9a 100644
--- a/kpovmodeler/pmdeletecommand.h
+++ b/kpovmodeler/pmdeletecommand.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdensity.h b/kpovmodeler/pmdensity.h
index b1502fe2..dea51201 100644
--- a/kpovmodeler/pmdensity.h
+++ b/kpovmodeler/pmdensity.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdensityedit.h b/kpovmodeler/pmdensityedit.h
index 561497d1..7fdb97d3 100644
--- a/kpovmodeler/pmdensityedit.h
+++ b/kpovmodeler/pmdensityedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdetailobject.h b/kpovmodeler/pmdetailobject.h
index 846ef8c0..122441e9 100644
--- a/kpovmodeler/pmdetailobject.h
+++ b/kpovmodeler/pmdetailobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdetailobjectedit.h b/kpovmodeler/pmdetailobjectedit.h
index d7410cf3..9f7137dd 100644
--- a/kpovmodeler/pmdetailobjectedit.h
+++ b/kpovmodeler/pmdetailobjectedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdialogeditbase.h b/kpovmodeler/pmdialogeditbase.h
index e7835740..4d7fb6f9 100644
--- a/kpovmodeler/pmdialogeditbase.h
+++ b/kpovmodeler/pmdialogeditbase.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdialogview.h b/kpovmodeler/pmdialogview.h
index baeaca94..b1ddb817 100644
--- a/kpovmodeler/pmdialogview.h
+++ b/kpovmodeler/pmdialogview.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdisc.h b/kpovmodeler/pmdisc.h
index 62201bcf..909bbeb9 100644
--- a/kpovmodeler/pmdisc.h
+++ b/kpovmodeler/pmdisc.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdiscedit.h b/kpovmodeler/pmdiscedit.h
index b4227bd1..64712799 100644
--- a/kpovmodeler/pmdiscedit.h
+++ b/kpovmodeler/pmdiscedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdistancecontrolpoint.h b/kpovmodeler/pmdistancecontrolpoint.h
index afc39fbd..f1dae25f 100644
--- a/kpovmodeler/pmdistancecontrolpoint.h
+++ b/kpovmodeler/pmdistancecontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmdocumentationmap.h b/kpovmodeler/pmdocumentationmap.h
index 6a982972..8588c6a0 100644
--- a/kpovmodeler/pmdocumentationmap.h
+++ b/kpovmodeler/pmdocumentationmap.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmenumproperty.h b/kpovmodeler/pmenumproperty.h
index 0de2efb3..73178609 100644
--- a/kpovmodeler/pmenumproperty.h
+++ b/kpovmodeler/pmenumproperty.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmerrordialog.h b/kpovmodeler/pmerrordialog.h
index 971ef114..c3871c6d 100644
--- a/kpovmodeler/pmerrordialog.h
+++ b/kpovmodeler/pmerrordialog.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmerrorflags.h b/kpovmodeler/pmerrorflags.h
index ce604c9b..ba39502a 100644
--- a/kpovmodeler/pmerrorflags.h
+++ b/kpovmodeler/pmerrorflags.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmface.h b/kpovmodeler/pmface.h
index a93a4636..105482d6 100644
--- a/kpovmodeler/pmface.h
+++ b/kpovmodeler/pmface.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmfactory.h b/kpovmodeler/pmfactory.h
index 77821f1b..6d8e83a4 100644
--- a/kpovmodeler/pmfactory.h
+++ b/kpovmodeler/pmfactory.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmfinish.h b/kpovmodeler/pmfinish.h
index c12f31b1..743e0000 100644
--- a/kpovmodeler/pmfinish.h
+++ b/kpovmodeler/pmfinish.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmfinishedit.h b/kpovmodeler/pmfinishedit.h
index 75605c51..efbb210f 100644
--- a/kpovmodeler/pmfinishedit.h
+++ b/kpovmodeler/pmfinishedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmfog.h b/kpovmodeler/pmfog.h
index fc6d7095..fc71d0cf 100644
--- a/kpovmodeler/pmfog.h
+++ b/kpovmodeler/pmfog.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmfogedit.h b/kpovmodeler/pmfogedit.h
index c6809ef7..1b299d0d 100644
--- a/kpovmodeler/pmfogedit.h
+++ b/kpovmodeler/pmfogedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmglobalphotons.h b/kpovmodeler/pmglobalphotons.h
index 549e6efc..dd453d58 100644
--- a/kpovmodeler/pmglobalphotons.h
+++ b/kpovmodeler/pmglobalphotons.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmglobalphotonsedit.h b/kpovmodeler/pmglobalphotonsedit.h
index d5e8c955..aea618fb 100644
--- a/kpovmodeler/pmglobalphotonsedit.h
+++ b/kpovmodeler/pmglobalphotonsedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmglobalsettings.h b/kpovmodeler/pmglobalsettings.h
index a95f86d7..fa856aa2 100644
--- a/kpovmodeler/pmglobalsettings.h
+++ b/kpovmodeler/pmglobalsettings.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmglobalsettingsedit.h b/kpovmodeler/pmglobalsettingsedit.h
index 938debad..27f3ad12 100644
--- a/kpovmodeler/pmglobalsettingsedit.h
+++ b/kpovmodeler/pmglobalsettingsedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmglview.h b/kpovmodeler/pmglview.h
index 1ecc9ad9..23054337 100644
--- a/kpovmodeler/pmglview.h
+++ b/kpovmodeler/pmglview.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmgraphicalobject.h b/kpovmodeler/pmgraphicalobject.h
index 399e351d..d067bc64 100644
--- a/kpovmodeler/pmgraphicalobject.h
+++ b/kpovmodeler/pmgraphicalobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmgraphicalobjectedit.h b/kpovmodeler/pmgraphicalobjectedit.h
index 9f216a2a..0ef15253 100644
--- a/kpovmodeler/pmgraphicalobjectedit.h
+++ b/kpovmodeler/pmgraphicalobjectedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmheightfield.h b/kpovmodeler/pmheightfield.h
index 443226ba..86f1a838 100644
--- a/kpovmodeler/pmheightfield.h
+++ b/kpovmodeler/pmheightfield.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmheightfieldedit.h b/kpovmodeler/pmheightfieldedit.h
index b719b607..126780e5 100644
--- a/kpovmodeler/pmheightfieldedit.h
+++ b/kpovmodeler/pmheightfieldedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmheightfieldroam.h b/kpovmodeler/pmheightfieldroam.h
index 3f21c630..bd224d58 100644
--- a/kpovmodeler/pmheightfieldroam.h
+++ b/kpovmodeler/pmheightfieldroam.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmimagemap.h b/kpovmodeler/pmimagemap.h
index 3a43d949..5ff47071 100644
--- a/kpovmodeler/pmimagemap.h
+++ b/kpovmodeler/pmimagemap.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmimagemapedit.h b/kpovmodeler/pmimagemapedit.h
index fc7ffada..8296feb8 100644
--- a/kpovmodeler/pmimagemapedit.h
+++ b/kpovmodeler/pmimagemapedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminserterrordialog.h b/kpovmodeler/pminserterrordialog.h
index a4aacd6c..7bdf7ecf 100644
--- a/kpovmodeler/pminserterrordialog.h
+++ b/kpovmodeler/pminserterrordialog.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminsertpopup.h b/kpovmodeler/pminsertpopup.h
index b9242611..552ae845 100644
--- a/kpovmodeler/pminsertpopup.h
+++ b/kpovmodeler/pminsertpopup.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminsertrulesystem.h b/kpovmodeler/pminsertrulesystem.h
index 80ecb525..d6d6142d 100644
--- a/kpovmodeler/pminsertrulesystem.h
+++ b/kpovmodeler/pminsertrulesystem.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminterior.h b/kpovmodeler/pminterior.h
index 8e3c9172..ea8a771d 100644
--- a/kpovmodeler/pminterior.h
+++ b/kpovmodeler/pminterior.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminterioredit.h b/kpovmodeler/pminterioredit.h
index f1940b0f..e4570906 100644
--- a/kpovmodeler/pminterioredit.h
+++ b/kpovmodeler/pminterioredit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminteriortexture.h b/kpovmodeler/pminteriortexture.h
index 0711b5c9..3a606228 100644
--- a/kpovmodeler/pminteriortexture.h
+++ b/kpovmodeler/pminteriortexture.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pminteriortextureedit.h b/kpovmodeler/pminteriortextureedit.h
index a9803145..8a5c2bbf 100644
--- a/kpovmodeler/pminteriortextureedit.h
+++ b/kpovmodeler/pminteriortextureedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmisosurface.h b/kpovmodeler/pmisosurface.h
index 2a2fb358..a9830b66 100644
--- a/kpovmodeler/pmisosurface.h
+++ b/kpovmodeler/pmisosurface.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmisosurfaceedit.h b/kpovmodeler/pmisosurfaceedit.h
index e6410d21..6a3ed07e 100644
--- a/kpovmodeler/pmisosurfaceedit.h
+++ b/kpovmodeler/pmisosurfaceedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmjuliafractal.h b/kpovmodeler/pmjuliafractal.h
index 1a113aa4..7f2eb0a5 100644
--- a/kpovmodeler/pmjuliafractal.h
+++ b/kpovmodeler/pmjuliafractal.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmjuliafractaledit.h b/kpovmodeler/pmjuliafractaledit.h
index 3d68fcdf..2b8371ee 100644
--- a/kpovmodeler/pmjuliafractaledit.h
+++ b/kpovmodeler/pmjuliafractaledit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlathe.h b/kpovmodeler/pmlathe.h
index 20fa55b3..93bb2024 100644
--- a/kpovmodeler/pmlathe.h
+++ b/kpovmodeler/pmlathe.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlatheedit.h b/kpovmodeler/pmlatheedit.h
index f86b55ee..6b19312e 100644
--- a/kpovmodeler/pmlatheedit.h
+++ b/kpovmodeler/pmlatheedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibrarybrowser.h b/kpovmodeler/pmlibrarybrowser.h
index b5e8fe7e..474a0233 100644
--- a/kpovmodeler/pmlibrarybrowser.h
+++ b/kpovmodeler/pmlibrarybrowser.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryentrypreview.h b/kpovmodeler/pmlibraryentrypreview.h
index a6e334ac..8f33b98c 100644
--- a/kpovmodeler/pmlibraryentrypreview.h
+++ b/kpovmodeler/pmlibraryentrypreview.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryhandle.h b/kpovmodeler/pmlibraryhandle.h
index 353b7b53..4a8da4e3 100644
--- a/kpovmodeler/pmlibraryhandle.h
+++ b/kpovmodeler/pmlibraryhandle.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryhandleedit.h b/kpovmodeler/pmlibraryhandleedit.h
index d17387d5..954fea94 100644
--- a/kpovmodeler/pmlibraryhandleedit.h
+++ b/kpovmodeler/pmlibraryhandleedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryiconview.cpp b/kpovmodeler/pmlibraryiconview.cpp
index 1f953225..fcaead42 100644
--- a/kpovmodeler/pmlibraryiconview.cpp
+++ b/kpovmodeler/pmlibraryiconview.cpp
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryiconview.h b/kpovmodeler/pmlibraryiconview.h
index 823fedcc..47e07e50 100644
--- a/kpovmodeler/pmlibraryiconview.h
+++ b/kpovmodeler/pmlibraryiconview.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibrarymanager.h b/kpovmodeler/pmlibrarymanager.h
index 6c2fe7bd..d3e0ac95 100644
--- a/kpovmodeler/pmlibrarymanager.h
+++ b/kpovmodeler/pmlibrarymanager.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryobject.cpp b/kpovmodeler/pmlibraryobject.cpp
index 95a7c29d..a1c1ff27 100644
--- a/kpovmodeler/pmlibraryobject.cpp
+++ b/kpovmodeler/pmlibraryobject.cpp
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryobject.h b/kpovmodeler/pmlibraryobject.h
index 070b5c99..633bbc85 100644
--- a/kpovmodeler/pmlibraryobject.h
+++ b/kpovmodeler/pmlibraryobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlibraryobjectsearch.h b/kpovmodeler/pmlibraryobjectsearch.h
index 35b29ed2..afbd06b0 100644
--- a/kpovmodeler/pmlibraryobjectsearch.h
+++ b/kpovmodeler/pmlibraryobjectsearch.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlight.h b/kpovmodeler/pmlight.h
index 4fafb2b0..6fbd5993 100644
--- a/kpovmodeler/pmlight.h
+++ b/kpovmodeler/pmlight.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlightedit.h b/kpovmodeler/pmlightedit.h
index 797e4e80..ebeff9ae 100644
--- a/kpovmodeler/pmlightedit.h
+++ b/kpovmodeler/pmlightedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlightgroup.h b/kpovmodeler/pmlightgroup.h
index 9fdf8d6b..4cb938a8 100644
--- a/kpovmodeler/pmlightgroup.h
+++ b/kpovmodeler/pmlightgroup.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlightgroupedit.h b/kpovmodeler/pmlightgroupedit.h
index a19fe083..1c329b82 100644
--- a/kpovmodeler/pmlightgroupedit.h
+++ b/kpovmodeler/pmlightgroupedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmline.h b/kpovmodeler/pmline.h
index c20b9355..bbd55a6a 100644
--- a/kpovmodeler/pmline.h
+++ b/kpovmodeler/pmline.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlineedits.h b/kpovmodeler/pmlineedits.h
index 8b210c0d..23c2896a 100644
--- a/kpovmodeler/pmlineedits.h
+++ b/kpovmodeler/pmlineedits.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlistpattern.h b/kpovmodeler/pmlistpattern.h
index 6716dadb..4e1b78f3 100644
--- a/kpovmodeler/pmlistpattern.h
+++ b/kpovmodeler/pmlistpattern.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlistpatternedit.h b/kpovmodeler/pmlistpatternedit.h
index cbade808..1c45d9d2 100644
--- a/kpovmodeler/pmlistpatternedit.h
+++ b/kpovmodeler/pmlistpatternedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmlookslike.h b/kpovmodeler/pmlookslike.h
index 4a191422..edebac4d 100644
--- a/kpovmodeler/pmlookslike.h
+++ b/kpovmodeler/pmlookslike.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmapmemento.h b/kpovmodeler/pmmapmemento.h
index 73dc8ce7..1f5631d5 100644
--- a/kpovmodeler/pmmapmemento.h
+++ b/kpovmodeler/pmmapmemento.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmaterial.h b/kpovmodeler/pmmaterial.h
index 7e790be4..cad65246 100644
--- a/kpovmodeler/pmmaterial.h
+++ b/kpovmodeler/pmmaterial.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmaterialedit.h b/kpovmodeler/pmmaterialedit.h
index 580a0663..fdd6c9ba 100644
--- a/kpovmodeler/pmmaterialedit.h
+++ b/kpovmodeler/pmmaterialedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmaterialmap.h b/kpovmodeler/pmmaterialmap.h
index 6377c7bd..06367c0c 100644
--- a/kpovmodeler/pmmaterialmap.h
+++ b/kpovmodeler/pmmaterialmap.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmaterialmapedit.h b/kpovmodeler/pmmaterialmapedit.h
index a39c9991..bd83c61e 100644
--- a/kpovmodeler/pmmaterialmapedit.h
+++ b/kpovmodeler/pmmaterialmapedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmath.h b/kpovmodeler/pmmath.h
index 520b8b6d..fcfb6e71 100644
--- a/kpovmodeler/pmmath.h
+++ b/kpovmodeler/pmmath.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmatrix.h b/kpovmodeler/pmmatrix.h
index a3691602..3471ab1c 100644
--- a/kpovmodeler/pmmatrix.h
+++ b/kpovmodeler/pmmatrix.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmedia.h b/kpovmodeler/pmmedia.h
index 4836bf37..77c287c5 100644
--- a/kpovmodeler/pmmedia.h
+++ b/kpovmodeler/pmmedia.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmediaedit.h b/kpovmodeler/pmmediaedit.h
index a55095b8..4a73ade3 100644
--- a/kpovmodeler/pmmediaedit.h
+++ b/kpovmodeler/pmmediaedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmemento.h b/kpovmodeler/pmmemento.h
index cdbab2d2..2041c0e1 100644
--- a/kpovmodeler/pmmemento.h
+++ b/kpovmodeler/pmmemento.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmesh.h b/kpovmodeler/pmmesh.h
index a6fe0089..8600454a 100644
--- a/kpovmodeler/pmmesh.h
+++ b/kpovmodeler/pmmesh.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmeshedit.h b/kpovmodeler/pmmeshedit.h
index f79ce651..681b32c2 100644
--- a/kpovmodeler/pmmeshedit.h
+++ b/kpovmodeler/pmmeshedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmessage.h b/kpovmodeler/pmmessage.h
index 86404104..973013ad 100644
--- a/kpovmodeler/pmmessage.h
+++ b/kpovmodeler/pmmessage.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmetaobject.h b/kpovmodeler/pmmetaobject.h
index 95822fc9..844053f9 100644
--- a/kpovmodeler/pmmetaobject.h
+++ b/kpovmodeler/pmmetaobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmmovecommand.h b/kpovmodeler/pmmovecommand.h
index 5aac246d..ab13dabb 100644
--- a/kpovmodeler/pmmovecommand.h
+++ b/kpovmodeler/pmmovecommand.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmnamedobject.h b/kpovmodeler/pmnamedobject.h
index 8b7b0b62..4ec4b6f8 100644
--- a/kpovmodeler/pmnamedobject.h
+++ b/kpovmodeler/pmnamedobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmnamedobjectedit.h b/kpovmodeler/pmnamedobjectedit.h
index 2877659f..12c4cbbc 100644
--- a/kpovmodeler/pmnamedobjectedit.h
+++ b/kpovmodeler/pmnamedobjectedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmnormal.h b/kpovmodeler/pmnormal.h
index c798d039..123f088e 100644
--- a/kpovmodeler/pmnormal.h
+++ b/kpovmodeler/pmnormal.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmnormaledit.h b/kpovmodeler/pmnormaledit.h
index 9092ad08..a3512c57 100644
--- a/kpovmodeler/pmnormaledit.h
+++ b/kpovmodeler/pmnormaledit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmobject.h b/kpovmodeler/pmobject.h
index 3f454ab5..4b19b13b 100644
--- a/kpovmodeler/pmobject.h
+++ b/kpovmodeler/pmobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmobjectaction.h b/kpovmodeler/pmobjectaction.h
index d270db9f..0a42b805 100644
--- a/kpovmodeler/pmobjectaction.h
+++ b/kpovmodeler/pmobjectaction.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmobjectdrag.h b/kpovmodeler/pmobjectdrag.h
index 4a6db4b9..175fcf97 100644
--- a/kpovmodeler/pmobjectdrag.h
+++ b/kpovmodeler/pmobjectdrag.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmobjectlink.h b/kpovmodeler/pmobjectlink.h
index 8ec7b474..3eb0c3e8 100644
--- a/kpovmodeler/pmobjectlink.h
+++ b/kpovmodeler/pmobjectlink.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmobjectlinkedit.h b/kpovmodeler/pmobjectlinkedit.h
index 1eb6a6c9..298933ba 100644
--- a/kpovmodeler/pmobjectlinkedit.h
+++ b/kpovmodeler/pmobjectlinkedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmobjectselect.h b/kpovmodeler/pmobjectselect.h
index 1f905ff8..8130f242 100644
--- a/kpovmodeler/pmobjectselect.h
+++ b/kpovmodeler/pmobjectselect.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmoutputdevice.h b/kpovmodeler/pmoutputdevice.h
index 41bad2e5..fa09bd67 100644
--- a/kpovmodeler/pmoutputdevice.h
+++ b/kpovmodeler/pmoutputdevice.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpalettevalue.h b/kpovmodeler/pmpalettevalue.h
index 44d443f4..b90f7076 100644
--- a/kpovmodeler/pmpalettevalue.h
+++ b/kpovmodeler/pmpalettevalue.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpalettevalueedit.h b/kpovmodeler/pmpalettevalueedit.h
index 19fdddeb..3dc897bf 100644
--- a/kpovmodeler/pmpalettevalueedit.h
+++ b/kpovmodeler/pmpalettevalueedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpalettevaluememento.h b/kpovmodeler/pmpalettevaluememento.h
index 8741b80c..75e0cc08 100644
--- a/kpovmodeler/pmpalettevaluememento.h
+++ b/kpovmodeler/pmpalettevaluememento.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmparser.h b/kpovmodeler/pmparser.h
index 6d75abe6..041c1f4f 100644
--- a/kpovmodeler/pmparser.h
+++ b/kpovmodeler/pmparser.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpart.h b/kpovmodeler/pmpart.h
index e8926874..d7ef0e56 100644
--- a/kpovmodeler/pmpart.h
+++ b/kpovmodeler/pmpart.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpartiface.h b/kpovmodeler/pmpartiface.h
index 744b85ca..4e860dd1 100644
--- a/kpovmodeler/pmpartiface.h
+++ b/kpovmodeler/pmpartiface.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpattern.h b/kpovmodeler/pmpattern.h
index 7dcf9cff..9afe93b8 100644
--- a/kpovmodeler/pmpattern.h
+++ b/kpovmodeler/pmpattern.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpatternedit.h b/kpovmodeler/pmpatternedit.h
index e76fe572..a1bc6117 100644
--- a/kpovmodeler/pmpatternedit.h
+++ b/kpovmodeler/pmpatternedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmphotons.h b/kpovmodeler/pmphotons.h
index a28041f5..58c92ede 100644
--- a/kpovmodeler/pmphotons.h
+++ b/kpovmodeler/pmphotons.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmphotonsedit.h b/kpovmodeler/pmphotonsedit.h
index cac0ae1c..1aecf472 100644
--- a/kpovmodeler/pmphotonsedit.h
+++ b/kpovmodeler/pmphotonsedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpigment.h b/kpovmodeler/pmpigment.h
index b520ad27..5c69abab 100644
--- a/kpovmodeler/pmpigment.h
+++ b/kpovmodeler/pmpigment.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpigmentedit.h b/kpovmodeler/pmpigmentedit.h
index 1a76c998..6340574b 100644
--- a/kpovmodeler/pmpigmentedit.h
+++ b/kpovmodeler/pmpigmentedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmplane.h b/kpovmodeler/pmplane.h
index d5321dd8..e4356fd0 100644
--- a/kpovmodeler/pmplane.h
+++ b/kpovmodeler/pmplane.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmplaneedit.h b/kpovmodeler/pmplaneedit.h
index 232cfbb1..55930745 100644
--- a/kpovmodeler/pmplaneedit.h
+++ b/kpovmodeler/pmplaneedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmplanenormalcontrolpoint.h b/kpovmodeler/pmplanenormalcontrolpoint.h
index ccff2000..590b520e 100644
--- a/kpovmodeler/pmplanenormalcontrolpoint.h
+++ b/kpovmodeler/pmplanenormalcontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpoint.h b/kpovmodeler/pmpoint.h
index 553358ab..45a89e4e 100644
--- a/kpovmodeler/pmpoint.h
+++ b/kpovmodeler/pmpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpolynom.h b/kpovmodeler/pmpolynom.h
index 65a9ad20..49070fef 100644
--- a/kpovmodeler/pmpolynom.h
+++ b/kpovmodeler/pmpolynom.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpolynomedit.h b/kpovmodeler/pmpolynomedit.h
index 36e67db1..ae4e4be4 100644
--- a/kpovmodeler/pmpolynomedit.h
+++ b/kpovmodeler/pmpolynomedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpolynomexponents.h b/kpovmodeler/pmpolynomexponents.h
index cd2b39b6..de410d0c 100644
--- a/kpovmodeler/pmpolynomexponents.h
+++ b/kpovmodeler/pmpolynomexponents.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpovraymatrix.h b/kpovmodeler/pmpovraymatrix.h
index c4e0d886..c0be489c 100644
--- a/kpovmodeler/pmpovraymatrix.h
+++ b/kpovmodeler/pmpovraymatrix.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpovraymatrixedit.h b/kpovmodeler/pmpovraymatrixedit.h
index b87a338a..23d636ad 100644
--- a/kpovmodeler/pmpovraymatrixedit.h
+++ b/kpovmodeler/pmpovraymatrixedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpovrayoutputwidget.h b/kpovmodeler/pmpovrayoutputwidget.h
index 7e4c3ffb..f8c693c8 100644
--- a/kpovmodeler/pmpovrayoutputwidget.h
+++ b/kpovmodeler/pmpovrayoutputwidget.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmpovrayparser.h b/kpovmodeler/pmpovrayparser.h
index 9ad714d2..b2c5d0bf 100644
--- a/kpovmodeler/pmpovrayparser.h
+++ b/kpovmodeler/pmpovrayparser.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmprism.h b/kpovmodeler/pmprism.h
index a22fb748..9389843c 100644
--- a/kpovmodeler/pmprism.h
+++ b/kpovmodeler/pmprism.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmprismedit.h b/kpovmodeler/pmprismedit.h
index e54ece6d..3b00524e 100644
--- a/kpovmodeler/pmprismedit.h
+++ b/kpovmodeler/pmprismedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmprismmemento.h b/kpovmodeler/pmprismmemento.h
index 13adf608..7a714d87 100644
--- a/kpovmodeler/pmprismmemento.h
+++ b/kpovmodeler/pmprismmemento.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmprojectedthrough.h b/kpovmodeler/pmprojectedthrough.h
index 4212097f..54eae507 100644
--- a/kpovmodeler/pmprojectedthrough.h
+++ b/kpovmodeler/pmprojectedthrough.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmprototypemanager.h b/kpovmodeler/pmprototypemanager.h
index bade9e29..a0ead7ae 100644
--- a/kpovmodeler/pmprototypemanager.h
+++ b/kpovmodeler/pmprototypemanager.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmquickcolor.h b/kpovmodeler/pmquickcolor.h
index 84a3afb5..cb92dcff 100644
--- a/kpovmodeler/pmquickcolor.h
+++ b/kpovmodeler/pmquickcolor.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmquickcoloredit.h b/kpovmodeler/pmquickcoloredit.h
index 2dca5a5f..16094a47 100644
--- a/kpovmodeler/pmquickcoloredit.h
+++ b/kpovmodeler/pmquickcoloredit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmradiosity.h b/kpovmodeler/pmradiosity.h
index c56ccec2..e6f0cff8 100644
--- a/kpovmodeler/pmradiosity.h
+++ b/kpovmodeler/pmradiosity.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmradiosityedit.h b/kpovmodeler/pmradiosityedit.h
index d360c4d8..8cdf8262 100644
--- a/kpovmodeler/pmradiosityedit.h
+++ b/kpovmodeler/pmradiosityedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrainbow.h b/kpovmodeler/pmrainbow.h
index 64dae5d7..de56dee8 100644
--- a/kpovmodeler/pmrainbow.h
+++ b/kpovmodeler/pmrainbow.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrainbowedit.h b/kpovmodeler/pmrainbowedit.h
index 35313545..7c2eacd6 100644
--- a/kpovmodeler/pmrainbowedit.h
+++ b/kpovmodeler/pmrainbowedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmraw.h b/kpovmodeler/pmraw.h
index 11c28ad2..1d23371f 100644
--- a/kpovmodeler/pmraw.h
+++ b/kpovmodeler/pmraw.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrawedit.h b/kpovmodeler/pmrawedit.h
index d4bbf5f0..73c6b5d5 100644
--- a/kpovmodeler/pmrawedit.h
+++ b/kpovmodeler/pmrawedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrecursiveobjectiterator.h b/kpovmodeler/pmrecursiveobjectiterator.h
index aafeaad3..d6a99783 100644
--- a/kpovmodeler/pmrecursiveobjectiterator.h
+++ b/kpovmodeler/pmrecursiveobjectiterator.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrendermanager.h b/kpovmodeler/pmrendermanager.h
index 8305de19..13ce8073 100644
--- a/kpovmodeler/pmrendermanager.h
+++ b/kpovmodeler/pmrendermanager.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrendermode.cpp b/kpovmodeler/pmrendermode.cpp
index b2a752f8..9da4f2ac 100644
--- a/kpovmodeler/pmrendermode.cpp
+++ b/kpovmodeler/pmrendermode.cpp
@@ -39,8 +39,6 @@ void PMRenderMode::init( )
m_quality = 9;
- m_radiosity = false;
-
m_antialiasing = false;
m_samplingMethod = AntialiasingNonRecursive;
m_antialiasThreshold = 0.3;
@@ -67,7 +65,6 @@ PMRenderMode::PMRenderMode( const TQDomElement& e )
m_startRow = hlp.doubleAttribute( "start_row", m_startRow );
m_endRow = hlp.doubleAttribute( "end_row", m_endRow );
m_quality = hlp.intAttribute( "quality", m_quality );
- m_radiosity = hlp.boolAttribute( "radiosity", m_radiosity );
m_antialiasing = hlp.boolAttribute( "antialiasing", m_antialiasing );
m_samplingMethod = hlp.intAttribute( "sampling_method", m_samplingMethod );
m_antialiasThreshold = hlp.doubleAttribute( "aa_threshold", m_antialiasThreshold );
@@ -88,7 +85,6 @@ void PMRenderMode::serialize( TQDomElement& e ) const
e.setAttribute( "start_column", m_startColumn );
e.setAttribute( "end_column", m_endColumn );
e.setAttribute( "quality", m_quality );
- e.setAttribute( "radiosity", m_radiosity );
e.setAttribute( "antialiasing", m_antialiasing );
e.setAttribute( "sampling_method", m_samplingMethod );
e.setAttribute( "aa_threshold", m_antialiasThreshold );
@@ -187,10 +183,6 @@ TQStringList PMRenderMode::commandLineSwitches( ) const
cl.append( tmp );
}
cl.append( TQString( "+Q%1" ).arg( m_quality ) );
- if( m_radiosity )
- cl.append( TQString( "+QR" ) );
- else
- cl.append( TQString( "-QR" ) );
if( m_antialiasing )
{
diff --git a/kpovmodeler/pmrendermode.h b/kpovmodeler/pmrendermode.h
index f4037906..aa819a7f 100644
--- a/kpovmodeler/pmrendermode.h
+++ b/kpovmodeler/pmrendermode.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
@@ -72,9 +71,6 @@ public:
void setQuality( int quality );
int quality( ) const { return m_quality; }
-
- void setRadiosity( bool on ) { m_radiosity = on; }
- bool radiosity( ) const { return m_radiosity; }
void setAntialiasing( bool on ) { m_antialiasing = on; }
bool antialiasing( ) const { return m_antialiasing; }
@@ -111,7 +107,6 @@ private:
double m_startRow, m_endRow, m_startColumn, m_endColumn;
int m_quality;
- bool m_radiosity;
bool m_antialiasing;
int m_samplingMethod;
double m_antialiasThreshold;
diff --git a/kpovmodeler/pmrendermodesdialog.cpp b/kpovmodeler/pmrendermodesdialog.cpp
index 1452e606..f81cb7ee 100644
--- a/kpovmodeler/pmrendermodesdialog.cpp
+++ b/kpovmodeler/pmrendermodesdialog.cpp
@@ -222,22 +222,21 @@ void PMRenderModesDialog::slotOk( )
TQSize PMRenderModeDialog::s_size = TQSize( 300, 200 );
-const int numQuality = 9;
+const int numQuality = 7;
const char* qualityString[numQuality] =
{
I18N_NOOP( "0, 1: Quick colors, full ambient lighting only" ),
I18N_NOOP( "2, 3: Show specified diffuse and ambient light" ),
I18N_NOOP( "4: Render shadows, but no extended lights" ),
I18N_NOOP( "5: Render shadows, including extended lights" ),
- I18N_NOOP( "6, 7: Compute texture patterns" ),
+ I18N_NOOP( "6, 7: Compute texture patterns, compute photons" ),
I18N_NOOP( "8: Compute reflected, refracted, and transmitted rays" ),
- I18N_NOOP( "9: Compute media" ),
- I18N_NOOP( "10: Compute radiosity but no media" ),
- I18N_NOOP( "11: Compute radiosity and media" )
+ I18N_NOOP( "9, 10, 11: Compute media, radiosity and subsurface light transport" )
+
};
-const int c_qualityToIndex[12] = { 0, 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 8 };
-const int c_indexToQuality[numQuality] = { 0, 2, 4, 5, 6, 8, 9, 10, 11 };
+const int c_qualityToIndex[12] = { 0, 0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 6 };
+const int c_indexToQuality[numQuality] = { 0, 2, 4, 5, 6, 8, 9};
PMRenderModeDialog::PMRenderModeDialog( PMRenderMode* mode, TQWidget* parent, const char* name )
: KDialogBase( parent, name, true, i18n( "Render Modes" ),
@@ -347,9 +346,6 @@ PMRenderModeDialog::PMRenderModeDialog( PMRenderMode* mode, TQWidget* parent, co
aaHelpLayout->addStretch( 1 );
- m_pRadiosityBox = new TQCheckBox( i18n( "Radiosity" ), tab );
- tabLayout->addWidget( m_pRadiosityBox );
-
tabLayout->addStretch( 1 );
// output options tab
@@ -380,7 +376,6 @@ PMRenderModeDialog::PMRenderModeDialog( PMRenderMode* mode, TQWidget* parent, co
connect( m_pStartColumnEdit, TQT_SIGNAL( dataChanged( ) ), TQT_SLOT( slotChanged( ) ) );
connect( m_pEndColumnEdit, TQT_SIGNAL( dataChanged( ) ), TQT_SLOT( slotChanged( ) ) );
connect( m_pQualityCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotActivated( int ) ) );
- connect( m_pRadiosityBox, TQT_SIGNAL( clicked( ) ), TQT_SLOT( slotChanged( ) ) );
connect( m_pAntialiasingBox, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotAntialiasingToggled( bool ) ) );
connect( m_pSamplingCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotActivated( int ) ) );
connect( m_pThresholdEdit, TQT_SIGNAL( dataChanged( ) ), TQT_SLOT( slotChanged( ) ) );
@@ -425,7 +420,6 @@ bool PMRenderModeDialog::saveChanges( )
m_pMode->setEndColumn( m_pEndColumnEdit->value( ) );
}
m_pMode->setQuality( indexToQuality( m_pQualityCombo->currentItem( ) ) );
- m_pMode->setRadiosity( m_pRadiosityBox->isChecked( ) );
m_pMode->setAntialiasing( m_pAntialiasingBox->isChecked( ) );
if( m_pAntialiasingBox->isChecked( ) )
{
@@ -509,7 +503,6 @@ void PMRenderModeDialog::displayMode( )
m_pStartColumnEdit->setValue( m_pMode->startColumn( ) );
m_pEndColumnEdit->setValue( m_pMode->endColumn( ) );
m_pQualityCombo->setCurrentItem( qualityToIndex( m_pMode->quality( ) ) );
- m_pRadiosityBox->setChecked( m_pMode->radiosity( ) );
m_pAntialiasingBox->setChecked( m_pMode->antialiasing( ) );
enableAntialiasing( m_pMode->antialiasing( ) );
m_pSamplingCombo->setCurrentItem( m_pMode->samplingMethod( ) );
diff --git a/kpovmodeler/pmrendermodesdialog.h b/kpovmodeler/pmrendermodesdialog.h
index 6688b01c..5adbefaf 100644
--- a/kpovmodeler/pmrendermodesdialog.h
+++ b/kpovmodeler/pmrendermodesdialog.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
@@ -165,7 +164,6 @@ private:
PMFloatEdit* m_pEndColumnEdit;
// quality
TQComboBox* m_pQualityCombo;
- TQCheckBox* m_pRadiosityBox;
TQCheckBox* m_pAntialiasingBox;
TQComboBox* m_pSamplingCombo;
PMFloatEdit* m_pThresholdEdit;
diff --git a/kpovmodeler/pmresourcelocator.h b/kpovmodeler/pmresourcelocator.h
index 1c016114..17414347 100644
--- a/kpovmodeler/pmresourcelocator.h
+++ b/kpovmodeler/pmresourcelocator.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrotate.h b/kpovmodeler/pmrotate.h
index 4ecc6d9a..de6701e2 100644
--- a/kpovmodeler/pmrotate.h
+++ b/kpovmodeler/pmrotate.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrotatecontrolpoint.h b/kpovmodeler/pmrotatecontrolpoint.h
index 1918eec4..79d3408c 100644
--- a/kpovmodeler/pmrotatecontrolpoint.h
+++ b/kpovmodeler/pmrotatecontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmrotateedit.h b/kpovmodeler/pmrotateedit.h
index 601b130f..14f18810 100644
--- a/kpovmodeler/pmrotateedit.h
+++ b/kpovmodeler/pmrotateedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmscale.h b/kpovmodeler/pmscale.h
index 72821041..d461edba 100644
--- a/kpovmodeler/pmscale.h
+++ b/kpovmodeler/pmscale.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmscalecontrolpoint.h b/kpovmodeler/pmscalecontrolpoint.h
index 5cb4a091..de1571b8 100644
--- a/kpovmodeler/pmscalecontrolpoint.h
+++ b/kpovmodeler/pmscalecontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmscaleedit.h b/kpovmodeler/pmscaleedit.h
index 763366e0..a16c337f 100644
--- a/kpovmodeler/pmscaleedit.h
+++ b/kpovmodeler/pmscaleedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmscanner.h b/kpovmodeler/pmscanner.h
index 43c8aef3..2a59fdf6 100644
--- a/kpovmodeler/pmscanner.h
+++ b/kpovmodeler/pmscanner.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmscene.h b/kpovmodeler/pmscene.h
index ed7cf227..ad6f16dd 100644
--- a/kpovmodeler/pmscene.h
+++ b/kpovmodeler/pmscene.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmserializer.h b/kpovmodeler/pmserializer.h
index 4c579364..6ba921df 100644
--- a/kpovmodeler/pmserializer.h
+++ b/kpovmodeler/pmserializer.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsettingsdialog.h b/kpovmodeler/pmsettingsdialog.h
index bc4a60da..1b2efa1a 100644
--- a/kpovmodeler/pmsettingsdialog.h
+++ b/kpovmodeler/pmsettingsdialog.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmshell.h b/kpovmodeler/pmshell.h
index 8e354706..c21a51ad 100644
--- a/kpovmodeler/pmshell.h
+++ b/kpovmodeler/pmshell.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmskysphere.h b/kpovmodeler/pmskysphere.h
index 116af543..1c2b3373 100644
--- a/kpovmodeler/pmskysphere.h
+++ b/kpovmodeler/pmskysphere.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmskysphereedit.h b/kpovmodeler/pmskysphereedit.h
index a6dc757e..758ffed2 100644
--- a/kpovmodeler/pmskysphereedit.h
+++ b/kpovmodeler/pmskysphereedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmslope.h b/kpovmodeler/pmslope.h
index eb860373..b0605c52 100644
--- a/kpovmodeler/pmslope.h
+++ b/kpovmodeler/pmslope.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmslopeedit.h b/kpovmodeler/pmslopeedit.h
index e20eae1b..137012b6 100644
--- a/kpovmodeler/pmslopeedit.h
+++ b/kpovmodeler/pmslopeedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsolidcolor.h b/kpovmodeler/pmsolidcolor.h
index 225a3a5b..b7c5053e 100644
--- a/kpovmodeler/pmsolidcolor.h
+++ b/kpovmodeler/pmsolidcolor.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsolidcoloredit.h b/kpovmodeler/pmsolidcoloredit.h
index a0f3091b..493dd42a 100644
--- a/kpovmodeler/pmsolidcoloredit.h
+++ b/kpovmodeler/pmsolidcoloredit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsolidobject.h b/kpovmodeler/pmsolidobject.h
index be2d2f5c..0eeba0fc 100644
--- a/kpovmodeler/pmsolidobject.h
+++ b/kpovmodeler/pmsolidobject.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsolidobjectedit.h b/kpovmodeler/pmsolidobjectedit.h
index b5e8439a..9be7514f 100644
--- a/kpovmodeler/pmsolidobjectedit.h
+++ b/kpovmodeler/pmsolidobjectedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsor.h b/kpovmodeler/pmsor.h
index 46db677e..62af1f05 100644
--- a/kpovmodeler/pmsor.h
+++ b/kpovmodeler/pmsor.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsorcontrolpoint.h b/kpovmodeler/pmsorcontrolpoint.h
index f25ddde5..7f34d256 100644
--- a/kpovmodeler/pmsorcontrolpoint.h
+++ b/kpovmodeler/pmsorcontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsoredit.h b/kpovmodeler/pmsoredit.h
index 8b54c08f..90ed8007 100644
--- a/kpovmodeler/pmsoredit.h
+++ b/kpovmodeler/pmsoredit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsorsegment.cpp b/kpovmodeler/pmsorsegment.cpp
index 966beb2b..7c651c50 100644
--- a/kpovmodeler/pmsorsegment.cpp
+++ b/kpovmodeler/pmsorsegment.cpp
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsorsegment.h b/kpovmodeler/pmsorsegment.h
index f0c5a2ea..40e61071 100644
--- a/kpovmodeler/pmsorsegment.h
+++ b/kpovmodeler/pmsorsegment.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsphere.h b/kpovmodeler/pmsphere.h
index 984bc6d6..9194e667 100644
--- a/kpovmodeler/pmsphere.h
+++ b/kpovmodeler/pmsphere.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
pmsphere.h - description
diff --git a/kpovmodeler/pmspheresweep.h b/kpovmodeler/pmspheresweep.h
index b28d69a5..5559fdfb 100644
--- a/kpovmodeler/pmspheresweep.h
+++ b/kpovmodeler/pmspheresweep.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmspheresweepedit.h b/kpovmodeler/pmspheresweepedit.h
index ba9bb50b..994211a9 100644
--- a/kpovmodeler/pmspheresweepedit.h
+++ b/kpovmodeler/pmspheresweepedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsplinememento.h b/kpovmodeler/pmsplinememento.h
index 4436e60c..95f175a6 100644
--- a/kpovmodeler/pmsplinememento.h
+++ b/kpovmodeler/pmsplinememento.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsplinesegment.cpp b/kpovmodeler/pmsplinesegment.cpp
index dbbc6b18..d62b9b2d 100644
--- a/kpovmodeler/pmsplinesegment.cpp
+++ b/kpovmodeler/pmsplinesegment.cpp
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsplinesegment.h b/kpovmodeler/pmsplinesegment.h
index c45b0a2e..5a12d03c 100644
--- a/kpovmodeler/pmsplinesegment.h
+++ b/kpovmodeler/pmsplinesegment.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsqe.h b/kpovmodeler/pmsqe.h
index acc4e030..57a70221 100644
--- a/kpovmodeler/pmsqe.h
+++ b/kpovmodeler/pmsqe.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsqeedit.h b/kpovmodeler/pmsqeedit.h
index 7d2db4e1..305ad862 100644
--- a/kpovmodeler/pmsqeedit.h
+++ b/kpovmodeler/pmsqeedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmsymboltable.h b/kpovmodeler/pmsymboltable.h
index 481a2916..8802a7d0 100644
--- a/kpovmodeler/pmsymboltable.h
+++ b/kpovmodeler/pmsymboltable.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtext.h b/kpovmodeler/pmtext.h
index 7ab4aff7..b9578b09 100644
--- a/kpovmodeler/pmtext.h
+++ b/kpovmodeler/pmtext.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtextedit.h b/kpovmodeler/pmtextedit.h
index 734f76ac..9b205159 100644
--- a/kpovmodeler/pmtextedit.h
+++ b/kpovmodeler/pmtextedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtexture.h b/kpovmodeler/pmtexture.h
index b2675b11..1c26000f 100644
--- a/kpovmodeler/pmtexture.h
+++ b/kpovmodeler/pmtexture.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtexturebase.h b/kpovmodeler/pmtexturebase.h
index a3ecdc0a..6e70ac85 100644
--- a/kpovmodeler/pmtexturebase.h
+++ b/kpovmodeler/pmtexturebase.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtexturebaseedit.h b/kpovmodeler/pmtexturebaseedit.h
index 653bcb56..6fe6c3ea 100644
--- a/kpovmodeler/pmtexturebaseedit.h
+++ b/kpovmodeler/pmtexturebaseedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtextureedit.h b/kpovmodeler/pmtextureedit.h
index 6252dc78..605dca39 100644
--- a/kpovmodeler/pmtextureedit.h
+++ b/kpovmodeler/pmtextureedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtexturemap.h b/kpovmodeler/pmtexturemap.h
index 6a7b020d..a1fffe75 100644
--- a/kpovmodeler/pmtexturemap.h
+++ b/kpovmodeler/pmtexturemap.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtexturemapedit.h b/kpovmodeler/pmtexturemapedit.h
index cc95816f..95b9d030 100644
--- a/kpovmodeler/pmtexturemapedit.h
+++ b/kpovmodeler/pmtexturemapedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtokens.h b/kpovmodeler/pmtokens.h
index 21b4b34b..a5b777d8 100644
--- a/kpovmodeler/pmtokens.h
+++ b/kpovmodeler/pmtokens.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtranslate.h b/kpovmodeler/pmtranslate.h
index d1272bf6..44c36c40 100644
--- a/kpovmodeler/pmtranslate.h
+++ b/kpovmodeler/pmtranslate.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtranslatecontrolpoint.h b/kpovmodeler/pmtranslatecontrolpoint.h
index 292e8a67..d2474f14 100644
--- a/kpovmodeler/pmtranslatecontrolpoint.h
+++ b/kpovmodeler/pmtranslatecontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtranslateedit.h b/kpovmodeler/pmtranslateedit.h
index 5795f6f7..376ac6c7 100644
--- a/kpovmodeler/pmtranslateedit.h
+++ b/kpovmodeler/pmtranslateedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtreeview.h b/kpovmodeler/pmtreeview.h
index a1ace80d..87764921 100644
--- a/kpovmodeler/pmtreeview.h
+++ b/kpovmodeler/pmtreeview.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtreeviewitem.h b/kpovmodeler/pmtreeviewitem.h
index 4ec2b44e..020775a8 100644
--- a/kpovmodeler/pmtreeviewitem.h
+++ b/kpovmodeler/pmtreeviewitem.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtriangle.h b/kpovmodeler/pmtriangle.h
index e2ef3026..d78c2e6c 100644
--- a/kpovmodeler/pmtriangle.h
+++ b/kpovmodeler/pmtriangle.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtriangleedit.h b/kpovmodeler/pmtriangleedit.h
index b584cbe7..86141872 100644
--- a/kpovmodeler/pmtriangleedit.h
+++ b/kpovmodeler/pmtriangleedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmtruetypecache.h b/kpovmodeler/pmtruetypecache.h
index 342597b0..c128f7f2 100644
--- a/kpovmodeler/pmtruetypecache.h
+++ b/kpovmodeler/pmtruetypecache.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmvalue.h b/kpovmodeler/pmvalue.h
index 3d2ecb02..628d6689 100644
--- a/kpovmodeler/pmvalue.h
+++ b/kpovmodeler/pmvalue.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmvariant.h b/kpovmodeler/pmvariant.h
index e6bcdee9..c4b0f33d 100644
--- a/kpovmodeler/pmvariant.h
+++ b/kpovmodeler/pmvariant.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmvector.h b/kpovmodeler/pmvector.h
index f5e885a5..c2238de8 100644
--- a/kpovmodeler/pmvector.h
+++ b/kpovmodeler/pmvector.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmvectorcontrolpoint.h b/kpovmodeler/pmvectorcontrolpoint.h
index 1aca3088..51a7b216 100644
--- a/kpovmodeler/pmvectorcontrolpoint.h
+++ b/kpovmodeler/pmvectorcontrolpoint.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmvectoredit.h b/kpovmodeler/pmvectoredit.h
index f68d8276..e970f7b1 100644
--- a/kpovmodeler/pmvectoredit.h
+++ b/kpovmodeler/pmvectoredit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmvectorlistedit.h b/kpovmodeler/pmvectorlistedit.h
index 3ba132d1..77b38d78 100644
--- a/kpovmodeler/pmvectorlistedit.h
+++ b/kpovmodeler/pmvectorlistedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmview.h b/kpovmodeler/pmview.h
index 72a9d98f..42a73597 100644
--- a/kpovmodeler/pmview.h
+++ b/kpovmodeler/pmview.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmviewlayoutmanager.h b/kpovmodeler/pmviewlayoutmanager.h
index bef34168..80c65e17 100644
--- a/kpovmodeler/pmviewlayoutmanager.h
+++ b/kpovmodeler/pmviewlayoutmanager.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmviewstructure.h b/kpovmodeler/pmviewstructure.h
index 5356466b..39b8829a 100644
--- a/kpovmodeler/pmviewstructure.h
+++ b/kpovmodeler/pmviewstructure.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmwarp.h b/kpovmodeler/pmwarp.h
index 6b50f498..903f0bee 100644
--- a/kpovmodeler/pmwarp.h
+++ b/kpovmodeler/pmwarp.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmwarpedit.h b/kpovmodeler/pmwarpedit.h
index 4f23d2bf..4761a32f 100644
--- a/kpovmodeler/pmwarpedit.h
+++ b/kpovmodeler/pmwarpedit.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmxmlhelper.h b/kpovmodeler/pmxmlhelper.h
index 87304fae..49763612 100644
--- a/kpovmodeler/pmxmlhelper.h
+++ b/kpovmodeler/pmxmlhelper.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kpovmodeler/pmxmlparser.h b/kpovmodeler/pmxmlparser.h
index 2ff8f351..4a1b105c 100644
--- a/kpovmodeler/pmxmlparser.h
+++ b/kpovmodeler/pmxmlparser.h
@@ -1,4 +1,3 @@
-//-*-C++-*-
/*
**************************************************************************
description
diff --git a/kruler/CMakeL10n.txt b/kruler/CMakeL10n.txt
index 33fb0701..1968bb92 100644
--- a/kruler/CMakeL10n.txt
+++ b/kruler/CMakeL10n.txt
@@ -1,3 +1,15 @@
##### create translation templates ##############
tde_l10n_create_template( "kruler" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kruler.desktop/"
+ SOURCES kruler.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kruler-eventsrc/"
+ SOURCES_DESKTOP eventsrc
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kruler/CMakeLists.txt b/kruler/CMakeLists.txt
index 9798b11e..36dde62b 100644
--- a/kruler/CMakeLists.txt
+++ b/kruler/CMakeLists.txt
@@ -25,9 +25,16 @@ link_directories(
#### other data #################################
-install( FILES kruler.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
-install( FILES eventsrc DESTINATION ${DATA_INSTALL_DIR}/kruler )
+tde_create_translated_desktop( kruler.desktop )
+
+tde_create_translated_desktop(
+ SOURCE eventsrc
+ DESTINATION ${DATA_INSTALL_DIR}/kruler
+ PO_DIR kruler-eventsrc
+)
+
install( FILES move.wav DESTINATION ${DATA_INSTALL_DIR}/kruler/sounds )
+
install( FILES uninstall.desktop DESTINATION ${APPS_INSTALL_DIR}/Graphics RENAME kruler.desktop )
diff --git a/kruler/eventsrc b/kruler/eventsrc
index 6daef301..53afae8d 100644
--- a/kruler/eventsrc
+++ b/kruler/eventsrc
@@ -1,192 +1,9 @@
[!Global!]
IconName=kruler
Comment=Screen Ruler
-Comment[af]=Kde Skerm Liniaal
-Comment[ar]=مسطرة شاشة
-Comment[az]=Ekran Xətkeşi
-Comment[bg]=Линийка за екрана
-Comment[bs]=ekranski linijar
-Comment[ca]=Regla de pantalla
-Comment[cs]=Obrazovkové pravítko
-Comment[cy]=Mesurydd Sgrîn
-Comment[da]=Skærmlineal
-Comment[de]=Bildschirmlineal
-Comment[el]=Χάρακας οθόνης του
-Comment[eo]=Ekranliniilo
-Comment[es]=Regla para la pantalla de
-Comment[et]=ekraani joonlaud
-Comment[eu]=pantaila erregela
-Comment[fa]=خط‌کش پردۀ
-Comment[fi]=Näytön mittaaja
-Comment[fr]=Règle d'écran pour
-Comment[ga]=Rialóir Scáileáin
-Comment[gl]=Regra de pantalla de
-Comment[he]=סרגל המסך של
-Comment[hi]=केडीई स्क्रीन रूलर
-Comment[hr]=ravnalo za ekran
-Comment[hu]=Képernyővonalzó
-Comment[is]=Reglustikan
-Comment[it]=Righello dello schermo
-Comment[ja]=スクリーン定規
-Comment[kk]=экран өлшегіші
-Comment[km]=បន្ទាត់​អេក្រង់
-Comment[ko]=용 화면 자
-Comment[lt]=ekrano liniuotė
-Comment[lv]=Ekrāna Mērjosla
-Comment[ms]=Pembaris Skrin
-Comment[mt]=Riga tal-Iskrin
-Comment[nb]=skjermlinjal
-Comment[nds]=Schirmlineaal
-Comment[ne]=केडीई पर्दा रूलर
-Comment[nl]=Schermliniaal
-Comment[nn]=Skjermlinjal
-Comment[nso]=Molaodi wa Pontsho ya
-Comment[pl]=Linijka ekranowa
-Comment[pt]=Régua do ecrã do
-Comment[pt_BR]=Régua da Tela do
-Comment[ro]=Riglă de ecran pentru
-Comment[ru]=Экранная линейка
-Comment[se]=šearbmalinjála
-Comment[sk]=pravítko obrazovky
-Comment[sl]=Zaslonsko ravnilo
-Comment[sr]=ов екрански лењир
-Comment[sr@Latn]=ov ekranski lenjir
-Comment[sv]=skärmlinjal
-Comment[ta]=கேடிஇ திரைக்கான அளவுக்கோல்
-Comment[tg]=Ҷадвали экрании
-Comment[th]=ไม้บรรทัดบนหน้าจอของ
-Comment[tr]=Ekran Cetveli
-Comment[uk]=Лінійка екрана
-Comment[uz]=ekran lineykasi
-Comment[uz@cyrillic]=экран линейкаси
-Comment[ven]=Muvhusi wa tshikirini tsha
-Comment[xh]=Umlawuli wekhusi le
-Comment[zh_CN]=屏幕标尺
-Comment[zh_HK]=螢幕尺規
-Comment[zh_TW]=螢幕尺規
-Comment[zu]=Umlawuli Wesikrini se
[cursormove]
Name=Moved by Cursor Keys
-Name[af]=Verskuif deur Plekaanduier Sleutels
-Name[ar]=تم تحريكها بمفاتيح الفأرة
-Name[az]=İstiqamət düymələri ilə hərəkət etdirildi
-Name[bg]=Преместване чрез клавиатурата
-Name[bs]=Pomjera se kursorskim tipkama
-Name[ca]=Mogut mitjançant les tecles de cursor
-Name[cs]=Přesunutý kurzorovými klávesami
-Name[cy]=Symudir gan y Bysellau Cyrchydd
-Name[da]=Flyttet med piletaster
-Name[de]=Durch Pfeiltasten verschoben
-Name[el]=Μετακινήθηκε από τα πλήκτρα κίνησης
-Name[eo]=Movata de la direktoklavoj
-Name[es]=Movido por las teclas del cursor
-Name[et]=Liigutati nooleklahve kasutades
-Name[eu]=Cursor Keys-ek mugitua
-Name[fa]=توسط کلیدهای مکان‌نما حرکت کرد
-Name[fi]=Siirrettiin kursorinäppäimillä
-Name[fr]=Déplacée par les touches fléchées
-Name[gl]=Mover coas teclas de cursor
-Name[he]=הזזה באמצעות מקשי החצים
-Name[hi]=संकेतक कुंजियों द्वारा खिसकता है
-Name[hr]=Pomaknuto tipkama za kretanje
-Name[hu]=A vonalzó elmozgatva a kurzorbillentyűkkel
-Name[is]=Fært með örvalyklum
-Name[it]=Spostato dai tasti cursore
-Name[ja]=カーソルキーで移動
-Name[kk]=Жебелі пернелерімен жылжыту
-Name[km]=បាន​ផ្លាស់ទី​ដោយ​គ្រាប់ចុច​ទស្សន៍​ទ្រនិច
-Name[ko]=방향 글쇠로 옮겼습니다
-Name[lt]=Judinama klaviatūros rodyklėmis
-Name[lv]=Pārvietots ar Kursora Taustiņiem
-Name[ms]=Dialih oleh Kekunci Kursor
-Name[mt]=Immexxi bil-buttuni tal-vleġeġ
-Name[nb]=Flyttet med piltaster
-Name[nds]=Mit Pieltasten verschaven
-Name[ne]=कर्सर कुञ्जीद्वारा सारिएको
-Name[nl]=Verplaatst met de cursortoetsen
-Name[nn]=Flytt med piltastane
-Name[nso]=Sutisa ke Ditobetswa tsa Cursor
-Name[pl]=Przesunięto klawiszami kursora
-Name[pt]=Movimentado com as Teclas de Cursor
-Name[pt_BR]=Movido pelas Teclas de Direção
-Name[ro]=Mutat cu tastele cursor
-Name[ru]=Передвижение стрелками
-Name[sk]=Presunutý kurzorovými klávesmi
-Name[sl]=Premaknjeno s smernimi tipkami
-Name[sr]=Померен курсорским тастерима
-Name[sr@Latn]=Pomeren kursorskim tasterima
-Name[sv]=Flyttade med piltangenteran
-Name[ta]=சுட்டி விசையால் நகர்த்தப்பட்டது
-Name[tg]=Ба ҳаракат даровардан бо аломати тира
-Name[th]=ย้ายด้วยปุ่มลูกศร
-Name[tr]=Yön tuşlarıyla hareket ettirildi
-Name[uk]=Пересунуто клавішами курсора
-Name[ven]=Tshimbidzhwa nga khii ya musevhe
-Name[xh]=Ishukunyiswa zizitshixo zesalathisi
-Name[zh_CN]=用光标键移动
-Name[zh_HK]=用游標鍵移動
-Name[zh_TW]=用游標鍵移動
-Name[zu]=Inyakaziswe Izikhiye Ze Cursor
Comment=The ruler has moved pixelwise using the cursor keys
-Comment[af]=Die liniaal het verskuif beeldelement-gewys te gebruik Die plekaanduier sleutels
-Comment[ar]=تم تحريك المسطرة بكسليا باستخدام مفاتيح الفأرة
-Comment[az]=Cədvəl piksel piksel istiqamət düymələri ilə hərəkət etdirildi
-Comment[bg]=Преместване чрез клавиатурата
-Comment[bs]=Linijar se pomjera u pixelima koristeći kursorske tipke
-Comment[ca]=La regla s'ha mogut píxel a píxel usant les tecles de cursor
-Comment[cs]=Pravítko bylo kurzorovými klávesami posunuto o několik bodů
-Comment[cy]=Mae'r mesurydd wedi symud o safbwynt picseli wrth ddefnyddio'r bysellau cyrchydd
-Comment[da]=Linealen er flyttet en pixel af gangen med piletasterne
-Comment[de]=Das Lineal wurde durch die Pfeiltasten um einige Pixel verschoben
-Comment[el]=Ο χάρακας μετακινήθηκε pixelwise με τη χρήση των πλήκτρων κίνησης
-Comment[eo]=La liniilo estas movita popunkte uzante la direktoklavojn
-Comment[es]=La regla se ha movido entre los pixels usando las teclas del cursor
-Comment[et]=Joonlauda liigutati pikselhaaval nooleklahve kasutades
-Comment[eu]=Erregela mugitu da kurtsore teklek eragina
-Comment[fa]=خط‌کش با استفاده از کلیدهای مکان‌نما در جهت تصویردانه حرکت کرده است.
-Comment[fi]=Mittanauha on liikkunut pikseleitä käyttämällä kursorinäppäimiä
-Comment[fr]=La règle s'est déplacée sous l'action des touches fléchées
-Comment[gl]=A regra moverá o «pixelwise» empregando as teclas de cursor
-Comment[he]=הסרגל הוזז באמצעות מקשי החצים
-Comment[hi]=संकेतक कुंजियों की मदद से रूसर पिक्सलवाइज़ खिसका
-Comment[hr]=Ravnalo je pomaknuto pomoću tipki za kretanje
-Comment[hu]=A vonalzó elmozgatva képpontonként a kurzorbillentyűkkel
-Comment[is]=Reglustikan hefur verið færð um e-a punkta með örvalyklunum
-Comment[it]=Il righello è stato spostato usando i tasti cursore
-Comment[ja]=定規がカーソルキーによってピクセル単位で移動しました
-Comment[kk]=Өлшегіш жебелі пернелер көмегімен пикселдеп жылжиды
-Comment[km]=បន្ទាត់​ត្រូវ​បាន​ផ្លាស់ទី​តាម​ភីកសែល ដោយ​ប្រើ​គ្រាប់ចុច​ទស្សន៍​ទ្រនិច
-Comment[ko]=방향 글쇠로 자대를 옮겼습니다
-Comment[lt]=Liniuote buvo paslinkta kelis taškus naudojant klaviatūros rodykles.
-Comment[lv]=Mērjosla pārvietota pikseļavirzienā izmantojot kursora taustiņus.
-Comment[ms]= Pembaris telah mengalih ikut piksel menggunakan kekunci kursor
-Comment[mt]=Ir-riga mxiet b'tikka waħda permezz tal-buttuni vleġeġ
-Comment[nb]=Linjalen ble flyttet punktvis ved bruk av piltastene
-Comment[nds]=Dat Lineaal warrt mit de Pieltasten pixelwies verschaven
-Comment[ne]=कर्सर कुञ्जी प्रयोग गरेर रूलर पिक्सेलअनुसार सारियो
-Comment[nl]=De liniaal is enkele pixels verplaatst via de cursortoetsen
-Comment[nn]=Linjalen vert flytta piksel for piksel med piltastane
-Comment[nso]=Molaodi o tsamaile ka mokgwa wa pixelwise a somisa ditobetswa tsa cursor
-Comment[pl]=Linijka przesunięta o zadaną ilość pikseli używając klawiszy kursora
-Comment[pt]=A régua foi movida com as teclas de cursor
-Comment[pt_BR]=A régua foi movida usando as teclas de direção
-Comment[ro]=Rigla a fost mutată cîţiva pixeli cu tastele cursor
-Comment[ru]=Линейка сдвигается попиксельно с помощью стрелок.
-Comment[sk]=Pravítko bolo kurzorovými klávesmi posunuté o niekoľko bodov
-Comment[sl]=Ravnilo se je premaknilo po točkah z uporabo smernih tipk
-Comment[sr]=Лењир се померио за пиксел помоћу курсорских тастера
-Comment[sr@Latn]=Lenjir se pomerio za piksel pomoću kursorskih tastera
-Comment[sv]=Linjalen har flyttats bildpunktsvis med piltangenterna
-Comment[ta]=சுட்டி விசைகளை பயன்படுத்தி படத்துணுக்கு மூலமாக வரை உருளை நகர்த்தப்பட்டது
-Comment[tg]=Ҷадвал бо ёрии аломати тира, пикселнокӣ ҳаракат мекунад.
-Comment[tr]=Cetvel piksel piksel yön tuşlarıyla hareket ettirildi
-Comment[uk]=Лінійка пересувається по пікселях за допомогою клавіш курсора
-Comment[ven]=Muvhusi o sudzulusa pixelwise a tshi khou shumisa khii ya Cursor
-Comment[xh]=Umlawuli ushukume jikelele kwipixel esebenzisa izitshixi zesalathisi
-Comment[zh_CN]=标尺已经用光标键按像素移动
-Comment[zh_HK]=使用游標鍵移動尺規單一個像
-Comment[zh_TW]=使用游標鍵移動尺規單一個像
-Comment[zu]=Umlawuli unyakazise jikelele kwipixel esebenzisa izikhiye ze cursor
default_sound=move.wav
default_presentation=1
diff --git a/kruler/kruler.desktop b/kruler/kruler.desktop
index 74092644..0a9c70b9 100644
--- a/kruler/kruler.desktop
+++ b/kruler/kruler.desktop
@@ -1,83 +1,6 @@
[Desktop Entry]
GenericName=Screen Ruler
-GenericName[af]=Skerm Liniaal
-GenericName[ar]=مسطرة الشاشة
-GenericName[bg]=Линийка за екрана
-GenericName[bs]=Ekranski linijar
-GenericName[ca]=Regla de pantalla
-GenericName[cs]=Obrazovkové pravítko
-GenericName[cy]=Mesurydd Sgrîn
-GenericName[da]=Skærmlineal
-GenericName[de]=Bildschirmlineal
-GenericName[el]=Χάρακας οθόνης
-GenericName[eo]=Ekranliniilo
-GenericName[es]=Regla para la pantalla
-GenericName[et]=Ekraani joonlaud
-GenericName[eu]=Pantaila erregela
-GenericName[fa]=خط‌کش پرده
-GenericName[fi]=Näytön mittaaja
-GenericName[fr]=Règle d'écran
-GenericName[gl]=Regra de pantalla
-GenericName[he]=סרגל מסך
-GenericName[hi]=स्क्रीन रूलर
-GenericName[hr]=Ravnalo
-GenericName[hu]=Képernyővonalzó
-GenericName[is]=Reglustika
-GenericName[it]=Righello per lo schermo
-GenericName[ja]=スクリーン定規
-GenericName[kk]=Экран өлшегіші
-GenericName[km]=បន្ទាត់​អេក្រង់
-GenericName[lt]=Ekrano liniuotė
-GenericName[lv]=Ekrāna Mērjosla
-GenericName[ms]=Pembaris Skrin
-GenericName[nb]=Skjermlinjal
-GenericName[nds]=Schirmlineaal
-GenericName[ne]=पर्दा रूलर
-GenericName[nl]=Schermliniaal
-GenericName[nn]=Skjermlinjal
-GenericName[pl]=Linijka ekranowa
-GenericName[pt]=Régua do Ecrã
-GenericName[pt_BR]=Régua da Tela
-GenericName[ro]=Riglă de ecran
-GenericName[ru]=Экранная линейка TDE
-GenericName[se]=Šearpmalinjála
-GenericName[sk]=Pravítko obrazovky
-GenericName[sl]=Zaslonsko ravnilo
-GenericName[sr]=Екрански лењир
-GenericName[sr@Latn]=Ekranski lenjir
-GenericName[sv]=Skärmlinjal
-GenericName[ta]=திரை உருளை
-GenericName[tg]=Ҷадвали экрании TDE
-GenericName[th]=ไม้บรรทัดสำหรับจอภาพ
-GenericName[tr]=Ekran Cetveli
-GenericName[uk]=Лінійка екрана
-GenericName[uz]=Ekran lineykasi
-GenericName[uz@cyrillic]=Экран линейкаси
-GenericName[ven]=Muvhusi wa Tshikirini
-GenericName[zh_CN]=屏幕标尺
-GenericName[zh_HK]=螢幕尺規
-GenericName[zh_TW]=螢幕尺規
-GenericName[zu]=Umlawuli Wesikrini
Name=KRuler
-Name[af]=K-lineaal
-Name[ar]=المسطرة (KRuler)
-Name[cy]=KMesurydd
-Name[eo]=Liniilo
-Name[hi]=के-रूलर
-Name[hr]=Ravnalo
-Name[is]=KReglustika
-Name[lv]=KRulers
-Name[ms]=KPembaris
-Name[ne]=केडीई रूलर
-Name[pl]=Linijka
-Name[pt_BR]=KRégua
-Name[ro]=Riglă
-Name[sv]=Kruler
-Name[ta]=கேவரை உருளை
-Name[th]=ไม้บรรทัด - K
-Name[ven]=Muvhusi wa K
-Name[zh_TW]=KRuler 尺規
-Name[zu]=KUmlawuli
X-DocPath=kruler/index.html
MimeType=
Exec=kruler %i %m
diff --git a/ksnapshot/CMakeL10n.txt b/ksnapshot/CMakeL10n.txt
index d472e741..6e40132a 100644
--- a/ksnapshot/CMakeL10n.txt
+++ b/ksnapshot/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "ksnapshot" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/ksnapshot.desktop/"
+ SOURCES ksnapshot.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/ksnapshot/CMakeLists.txt b/ksnapshot/CMakeLists.txt
index a9b0fcdd..93fc591b 100644
--- a/ksnapshot/CMakeLists.txt
+++ b/ksnapshot/CMakeLists.txt
@@ -31,7 +31,7 @@ link_directories(
##### other data ################################
tde_install_icons( ksnapshot )
-install( FILES ksnapshot.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( ksnapshot.desktop )
##### ksnapshot (executable) ####################
diff --git a/ksnapshot/ksnapshot.desktop b/ksnapshot/ksnapshot.desktop
index 7b7b3ae5..d5d33676 100644
--- a/ksnapshot/ksnapshot.desktop
+++ b/ksnapshot/ksnapshot.desktop
@@ -1,72 +1,7 @@
[Desktop Entry]
GenericName=Screen Capture Program
-GenericName[af]=Skerm Vang Program
-GenericName[ar]=برنامج تصوير الشاشة
-GenericName[bg]=Снимки на екрана
-GenericName[bs]=Program za "hvatanje" slike
-GenericName[ca]=Programa de captura de pantalla
-GenericName[cs]=Snímač obrazovky
-GenericName[cy]=Rhaglen Cipio'r Sgrîn
-GenericName[da]=Program til øjebliksbilleder
-GenericName[de]=Bildschirmfotos
-GenericName[el]=Πρόγραμμα σύλληψης οθόνης
-GenericName[eo]=Ekranfota programo
-GenericName[es]=Capturador de pantalla
-GenericName[et]=Töölaua pildistamine
-GenericName[eu]=Pantailari argazkiak ateratzeko programa
-GenericName[fa]=برنامۀ گیراندازی پرده
-GenericName[fi]=Ruudunkaappausohjelma
-GenericName[fr]=Logiciel de capture d'écran
-GenericName[ga]=Clár gabhála scáileáin
-GenericName[gl]=Progama para facer capturas de pantalla
-GenericName[he]=תוכנית לצילום המסך
-GenericName[hi]=स्क्रीन केप्चर प्रोग्राम
-GenericName[hr]=Program za snimanje zaslona
-GenericName[hu]=Képlopó
-GenericName[is]=Forrit sem grípur skjámyndir
-GenericName[it]=Scatta foto allo schermo
-GenericName[ja]=スクリーンキャプチャプログラム
-GenericName[kk]=Экраннан түсіріп алу бағдарламасы
-GenericName[km]=កម្មវិធី​ចាប់យក​អេក្រង់
-GenericName[lt]=Ekrano kopijos programa
-GenericName[lv]=Ekrāna Sagrābšanas Programma
-GenericName[ms]=Program Cekupan Skrin
-GenericName[mt]=Programm biex tieħu "ritratt" tal-iskrin
-GenericName[nb]=Skjermdumpprogram
-GenericName[nds]=Schirmfotos opnehmen
-GenericName[ne]=पर्दा समात्ने कार्यक्रम
-GenericName[nl]=Schermafdrukprogramma
-GenericName[nn]=Program for skjermbilete
-GenericName[nso]=Lenaneo lago Apesa Pontsho
-GenericName[pl]=Program do zrzutów ekranu
-GenericName[pt]=Programa de Captura do Ecrã
-GenericName[pt_BR]=Programa de Captura de Tela
-GenericName[ro]=Program de captură de ecran
-GenericName[ru]=Создание снимков экрана
-GenericName[rw]=Porogaramu Gufata Mugaragaza
-GenericName[se]=Šearbmagovvenprográmma
-GenericName[sk]=Zachytenie obrazovky
-GenericName[sl]=Program za zajem zaslona
-GenericName[sr]=Програм за снимање екрана
-GenericName[sr@Latn]=Program za snimanje ekrana
-GenericName[sv]=Ta en skärmdump
-GenericName[ta]=திரை கைப்பற்றும் நிரலி
-GenericName[tg]=Эҷоди суратҳои экран
-GenericName[th]=โปรแกรมจับภาพหน้าจอ
-GenericName[tr]=Ekran Yakalama Programı
-GenericName[uk]=Захоплювач екрана
-GenericName[uz]=Skrinshot olish dasturi
-GenericName[uz@cyrillic]=Скриншот олиш дастури
-GenericName[ven]=Mbekanya mushumo ino gavha tshikirini
-GenericName[wa]=Programe po fé des waitroûlêyes
-GenericName[xh]=Iinkcazelo Ezigcina Ikhusi
-GenericName[zh_CN]=屏幕截图程序
-GenericName[zh_HK]=螢幕擷取程式
-GenericName[zh_TW]=畫面擷取程式
-GenericName[zu]=Iprogremu Yokubamba Isikrini
Name=KSnapshot
-Name[hi]=के-स्नेपशॉट
Exec=ksnapshot -caption "%c" %i %m
Icon=ksnapshot
diff --git a/ksnapshot/ksnapshot.h b/ksnapshot/ksnapshot.h
index 5db7c0e6..1146a718 100644
--- a/ksnapshot/ksnapshot.h
+++ b/ksnapshot/ksnapshot.h
@@ -1,5 +1,3 @@
-// -*- c++ -*-
-
#ifndef KSNAPSHOT_H
#define KSNAPSHOT_H
#include "ksnapshotiface.h"
diff --git a/ksvg/CMakeL10n.txt b/ksvg/CMakeL10n.txt
index b585ce4a..3f52feae 100644
--- a/ksvg/CMakeL10n.txt
+++ b/ksvg/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_auto_add_subdirectories( )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/ksvg-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/ksvg/CMakeLists.txt b/ksvg/CMakeLists.txt
index 3f1c88bc..534cf56e 100644
--- a/ksvg/CMakeLists.txt
+++ b/ksvg/CMakeLists.txt
@@ -24,12 +24,13 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
+ ${ART_LIBRARY_DIRS}
)
##### ksvg (shared) #############################
-configure_file( ${CMAKE_SOURCE_DIR}/cmake/modules/template_dummy_cpp.cmake dummy.cpp COPYONLY )
+configure_file( ${TDE_CMAKE_TEMPLATES}/tde_dummy_cpp.cmake dummy.cpp COPYONLY )
tde_add_library( ksvg SHARED
SOURCES dummy.cpp
@@ -39,5 +40,6 @@ tde_add_library( ksvg SHARED
ksvgxrgbrender-static text2path-static ksvgart-static
LINK
tdehtml-shared ${LCMS_LIBRARY} ${ART_LIBRARIES} ${FRIBIDI_LIBRARIES}
+ ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}
)
diff --git a/ksvg/ConfigureChecks.cmake b/ksvg/ConfigureChecks.cmake
index e3c3893a..9c2622c8 100644
--- a/ksvg/ConfigureChecks.cmake
+++ b/ksvg/ConfigureChecks.cmake
@@ -53,12 +53,3 @@ else( )
tde_message_fatal( "fribidi is required, but was not found on your system" )
endif( )
-
-##### check for fontconfig ######################
-
-pkg_search_module( FONTCONFIG fontconfig )
-if( NOT FONTCONFIG_FOUND )
- message(FATAL_ERROR "\nfontconfig are required, but not found on your system" )
-endif( NOT FONTCONFIG_FOUND )
-set( HAVE_FONTCONFIG 1 CACHE INTERNAL "" FORCE )
-
diff --git a/ksvg/Makefile.am b/ksvg/Makefile.am
index 8dec4221..86429f96 100644
--- a/ksvg/Makefile.am
+++ b/ksvg/Makefile.am
@@ -1,7 +1,7 @@
SUBDIRS = dom impl core ecma . plugin test
lib_LTLIBRARIES = libksvg.la
-libksvg_la_SOURCES = dummy.cc
+libksvg_la_SOURCES = dummy.cpp
libksvg_la_METASOURCES = AUTO
libksvg_la_LDFLAGS = -version-info 0:1:0 -no-undefined $(all_libraries)
libksvg_la_LIBADD = dom/libksvgdom.la impl/libksvgdomimpl.la core/libksvgcore.la ecma/libksvgecma.la \
@@ -10,100 +10,100 @@ libksvg_la_LIBADD = dom/libksvgdom.la impl/libksvgdomimpl.la core/libksvgcore.l
INCLUDES = -I$(top_srcdir)/ksvg/dom -I$(top_srcdir)/ksvg/impl $(all_includes)
-dummy.cc:
- echo "" > dummy.cc
+dummy.cpp:
+ echo "" > dummy.cpp
# Make it easy for developers :)
hashtables:
cd $(srcdir); \
rm -f data/*lut* ; \
- ../../tdelibs/kjs/create_hash_table impl/SVGElementImpl.cc > data/SVGElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGSVGElementImpl.cc > data/SVGSVGElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGRectElementImpl.cc > data/SVGRectElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGLineElementImpl.cc > data/SVGLineElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGCircleElementImpl.cc > data/SVGCircleElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGImageElementImpl.cc > data/SVGImageElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGEllipseElementImpl.cc > data/SVGEllipseElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedPointsImpl.cc > data/SVGAnimatedPointsImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPointImpl.cc > data/SVGPointImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGRectImpl.cc > data/SVGRectImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGNumberImpl.cc > data/SVGNumberImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedAngleImpl.cc > data/SVGAnimatedAngleImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedRectImpl.cc > data/SVGAnimatedRectImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedNumberImpl.cc > data/SVGAnimatedNumberImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedNumberListImpl.cc > data/SVGAnimatedNumberListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedIntegerImpl.cc > data/SVGAnimatedIntegerImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedBooleanImpl.cc > data/SVGAnimatedBooleanImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedEnumerationImpl.cc > data/SVGAnimatedEnumerationImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedStringImpl.cc > data/SVGAnimatedStringImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedLengthImpl.cc > data/SVGAnimatedLengthImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedLengthListImpl.cc > data/SVGAnimatedLengthListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedPreserveAspectRatioImpl.cc > data/SVGAnimatedPreserveAspectRatioImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPreserveAspectRatioImpl.cc > data/SVGPreserveAspectRatioImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGLengthImpl.cc > data/SVGLengthImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGMatrixImpl.cc > data/SVGMatrixImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAngleImpl.cc > data/SVGAngleImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGLocatableImpl.cc > data/SVGLocatableImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTestsImpl.cc > data/SVGTestsImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGLangSpaceImpl.cc > data/SVGLangSpaceImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGExternalResourcesRequiredImpl.cc > data/SVGExternalResourcesRequiredImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGURIReferenceImpl.cc > data/SVGURIReferenceImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPaintImpl.cc > data/SVGPaintImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGColorImpl.cc > data/SVGColorImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGICCColorImpl.cc > data/SVGICCColorImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTextPositioningElementImpl.cc > data/SVGTextPositioningElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTextContentElementImpl.cc > data/SVGTextContentElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTransformImpl.cc > data/SVGTransformImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTransformableImpl.cc > data/SVGTransformableImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPointListImpl.cc > data/SVGPointListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGNumberListImpl.cc > data/SVGNumberListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGLengthListImpl.cc > data/SVGLengthListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGStringListImpl.cc > data/SVGStringListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedPathDataImpl.cc > data/SVGAnimatedPathDataImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegImpl.cc > data/SVGPathSegImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegArcImpl.cc > data/SVGPathSegArcImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegMovetoImpl.cc > data/SVGPathSegMovetoImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegLinetoImpl.cc > data/SVGPathSegLinetoImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegLinetoHorizontalImpl.cc > data/SVGPathSegLinetoHorizontalImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegLinetoVerticalImpl.cc > data/SVGPathSegLinetoVerticalImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoCubicImpl.cc > data/SVGPathSegCurvetoCubicImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoCubicSmoothImpl.cc > data/SVGPathSegCurvetoCubicSmoothImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoQuadraticImpl.cc > data/SVGPathSegCurvetoQuadraticImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoQuadraticSmoothImpl.cc > data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathElementImpl.cc > data/SVGPathElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPathSegListImpl.cc > data/SVGPathSegListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTransformListImpl.cc > data/SVGTransformListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedTransformListImpl.cc > data/SVGAnimatedTransformListImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAElementImpl.cc > data/SVGAElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGUseElementImpl.cc > data/SVGUseElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGDocumentImpl.cc > data/SVGDocumentImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGForeignObjectElementImpl.cc > data/SVGForeignObjectElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGScriptElementImpl.cc > data/SVGScriptElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGStyleElementImpl.cc > data/SVGStyleElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGZoomAndPanImpl.cc > data/SVGZoomAndPanImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGFitToViewBoxImpl.cc > data/SVGFitToViewBoxImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGStylableImpl.cc > data/SVGStylableImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGEventImpl.cc > data/SVGEventImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGEcma.cc > data/SVGEcma.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGMarkerElementImpl.cc > data/SVGMarkerElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGViewElementImpl.cc > data/SVGViewElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTextContentElementImpl.cc > data/SVGTextContentElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGClipPathElementImpl.cc > data/SVGClipPathElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGColorProfileElementImpl.cc > data/SVGColorProfileElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGPatternElementImpl.cc > data/SVGPatternElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGGradientElementImpl.cc > data/SVGGradientElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGLinearGradientElementImpl.cc > data/SVGLinearGradientElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGRadialGradientElementImpl.cc > data/SVGRadialGradientElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGStopElementImpl.cc > data/SVGStopElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGAnimationElementImpl.cc > data/SVGAnimationElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGCursorElementImpl.cc > data/SVGCursorElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGSymbolElementImpl.cc > data/SVGSymbolElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGMaskElementImpl.cc > data/SVGMaskElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGGlyphElementImpl.cc > data/SVGGlyphElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGMissingGlyphElementImpl.cc > data/SVGMissingGlyphElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGGlyphRefElementImpl.cc > data/SVGGlyphRefElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGTextPathElementImpl.cc > data/SVGTextPathElementImpl.lut.h; \
- ../../tdelibs/kjs/create_hash_table impl/SVGZoomEventImpl.cc > data/SVGZoomEventImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGElementImpl.cpp > data/SVGElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGSVGElementImpl.cpp > data/SVGSVGElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGRectElementImpl.cpp > data/SVGRectElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGLineElementImpl.cpp > data/SVGLineElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGCircleElementImpl.cpp > data/SVGCircleElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGImageElementImpl.cpp > data/SVGImageElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGEllipseElementImpl.cpp > data/SVGEllipseElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedPointsImpl.cpp > data/SVGAnimatedPointsImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPointImpl.cpp > data/SVGPointImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGRectImpl.cpp > data/SVGRectImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGNumberImpl.cpp > data/SVGNumberImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedAngleImpl.cpp > data/SVGAnimatedAngleImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedRectImpl.cpp > data/SVGAnimatedRectImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedNumberImpl.cpp > data/SVGAnimatedNumberImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedNumberListImpl.cpp > data/SVGAnimatedNumberListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedIntegerImpl.cpp > data/SVGAnimatedIntegerImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedBooleanImpl.cpp > data/SVGAnimatedBooleanImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedEnumerationImpl.cpp > data/SVGAnimatedEnumerationImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedStringImpl.cpp > data/SVGAnimatedStringImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedLengthImpl.cpp > data/SVGAnimatedLengthImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedLengthListImpl.cpp > data/SVGAnimatedLengthListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedPreserveAspectRatioImpl.cpp > data/SVGAnimatedPreserveAspectRatioImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPreserveAspectRatioImpl.cpp > data/SVGPreserveAspectRatioImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGLengthImpl.cpp > data/SVGLengthImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGMatrixImpl.cpp > data/SVGMatrixImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAngleImpl.cpp > data/SVGAngleImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGLocatableImpl.cpp > data/SVGLocatableImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTestsImpl.cpp > data/SVGTestsImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGLangSpaceImpl.cpp > data/SVGLangSpaceImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGExternalResourcesRequiredImpl.cpp > data/SVGExternalResourcesRequiredImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGURIReferenceImpl.cpp > data/SVGURIReferenceImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPaintImpl.cpp > data/SVGPaintImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGColorImpl.cpp > data/SVGColorImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGICCColorImpl.cpp > data/SVGICCColorImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTextPositioningElementImpl.cpp > data/SVGTextPositioningElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTextContentElementImpl.cpp > data/SVGTextContentElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTransformImpl.cpp > data/SVGTransformImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTransformableImpl.cpp > data/SVGTransformableImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPointListImpl.cpp > data/SVGPointListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGNumberListImpl.cpp > data/SVGNumberListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGLengthListImpl.cpp > data/SVGLengthListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGStringListImpl.cpp > data/SVGStringListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedPathDataImpl.cpp > data/SVGAnimatedPathDataImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegImpl.cpp > data/SVGPathSegImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegArcImpl.cpp > data/SVGPathSegArcImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegMovetoImpl.cpp > data/SVGPathSegMovetoImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegLinetoImpl.cpp > data/SVGPathSegLinetoImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegLinetoHorizontalImpl.cpp > data/SVGPathSegLinetoHorizontalImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegLinetoVerticalImpl.cpp > data/SVGPathSegLinetoVerticalImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoCubicImpl.cpp > data/SVGPathSegCurvetoCubicImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoCubicSmoothImpl.cpp > data/SVGPathSegCurvetoCubicSmoothImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoQuadraticImpl.cpp > data/SVGPathSegCurvetoQuadraticImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegCurvetoQuadraticSmoothImpl.cpp > data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathElementImpl.cpp > data/SVGPathElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPathSegListImpl.cpp > data/SVGPathSegListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTransformListImpl.cpp > data/SVGTransformListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimatedTransformListImpl.cpp > data/SVGAnimatedTransformListImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAElementImpl.cpp > data/SVGAElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGUseElementImpl.cpp > data/SVGUseElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGDocumentImpl.cpp > data/SVGDocumentImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGForeignObjectElementImpl.cpp > data/SVGForeignObjectElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGScriptElementImpl.cpp > data/SVGScriptElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGStyleElementImpl.cpp > data/SVGStyleElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGZoomAndPanImpl.cpp > data/SVGZoomAndPanImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGFitToViewBoxImpl.cpp > data/SVGFitToViewBoxImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGStylableImpl.cpp > data/SVGStylableImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGEventImpl.cpp > data/SVGEventImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGEcma.cpp > data/SVGEcma.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGMarkerElementImpl.cpp > data/SVGMarkerElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGViewElementImpl.cpp > data/SVGViewElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTextContentElementImpl.cpp > data/SVGTextContentElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGClipPathElementImpl.cpp > data/SVGClipPathElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGColorProfileElementImpl.cpp > data/SVGColorProfileElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGPatternElementImpl.cpp > data/SVGPatternElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGGradientElementImpl.cpp > data/SVGGradientElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGLinearGradientElementImpl.cpp > data/SVGLinearGradientElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGRadialGradientElementImpl.cpp > data/SVGRadialGradientElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGStopElementImpl.cpp > data/SVGStopElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGAnimationElementImpl.cpp > data/SVGAnimationElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGCursorElementImpl.cpp > data/SVGCursorElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGSymbolElementImpl.cpp > data/SVGSymbolElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGMaskElementImpl.cpp > data/SVGMaskElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGGlyphElementImpl.cpp > data/SVGGlyphElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGMissingGlyphElementImpl.cpp > data/SVGMissingGlyphElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGGlyphRefElementImpl.cpp > data/SVGGlyphRefElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGTextPathElementImpl.cpp > data/SVGTextPathElementImpl.lut.h; \
+ ../../tdelibs/kjs/create_hash_table impl/SVGZoomEventImpl.cpp > data/SVGZoomEventImpl.lut.h; \
../../tdelibs/kjs/create_hash_table ecma/ksvg_window.cpp > data/ksvg_window.lut.h;
generatedata:
diff --git a/ksvg/core/CMakeLists.txt b/ksvg/core/CMakeLists.txt
index 4f3136d2..3818acaf 100644
--- a/ksvg/core/CMakeLists.txt
+++ b/ksvg/core/CMakeLists.txt
@@ -35,15 +35,17 @@ install( FILES
##### other data ################################
-install( FILES
- ksvgrenderer.desktop
- DESTINATION ${SERVICETYPES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE ksvgrenderer.desktop
+ DESTINATION ${SERVICETYPES_INSTALL_DIR}
+ PO_DIR ksvg-desktops
+)
##### ksvgcore (static) #########################
tde_add_library( ksvgcore STATIC_PIC AUTOMOC
SOURCES
- KSVGLoader.cpp KSVGCanvas.cpp KSVGReader.cc KSVGTextChunk.cpp
+ KSVGLoader.cpp KSVGCanvas.cpp KSVGReader.cpp KSVGTextChunk.cpp
CanvasFactory.cpp CanvasItems.cpp KSVGHelper.cpp DocumentFactory.cpp
)
diff --git a/ksvg/core/CanvasFactory.cpp b/ksvg/core/CanvasFactory.cpp
index 8910f879..55610a2b 100644
--- a/ksvg/core/CanvasFactory.cpp
+++ b/ksvg/core/CanvasFactory.cpp
@@ -172,5 +172,3 @@ TQPtrList<CanvasInfo> CanvasFactory::canvasList()
{
return m_canvasList;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/CanvasFactory.h b/ksvg/core/CanvasFactory.h
index 24c59ba6..95614a34 100644
--- a/ksvg/core/CanvasFactory.h
+++ b/ksvg/core/CanvasFactory.h
@@ -65,5 +65,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/CanvasItem.h b/ksvg/core/CanvasItem.h
index 1c6b1e34..0288400f 100644
--- a/ksvg/core/CanvasItem.h
+++ b/ksvg/core/CanvasItem.h
@@ -150,5 +150,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/CanvasItems.cpp b/ksvg/core/CanvasItems.cpp
index 333f4608..cf605d9e 100644
--- a/ksvg/core/CanvasItems.cpp
+++ b/ksvg/core/CanvasItems.cpp
@@ -505,5 +505,3 @@ void MarkerHelper::doEndMarker(SVGShapeImpl *shape, SVGStylableImpl *style, doub
{
doMarker(shape, style, x, y, angle, style->getEndMarker());
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/CanvasItems.h b/ksvg/core/CanvasItems.h
index 9f5eed43..f9fe9762 100644
--- a/ksvg/core/CanvasItems.h
+++ b/ksvg/core/CanvasItems.h
@@ -129,5 +129,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/DocumentFactory.cpp b/ksvg/core/DocumentFactory.cpp
index 4ae743be..ea02163a 100644
--- a/ksvg/core/DocumentFactory.cpp
+++ b/ksvg/core/DocumentFactory.cpp
@@ -106,5 +106,3 @@ SVGDocumentImpl *DocumentFactory::requestDocumentImpl(bool bFit) const
return impl;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/DocumentFactory.h b/ksvg/core/DocumentFactory.h
index 6225b37d..ba6cf8bf 100644
--- a/ksvg/core/DocumentFactory.h
+++ b/ksvg/core/DocumentFactory.h
@@ -59,5 +59,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGCanvas.cpp b/ksvg/core/KSVGCanvas.cpp
index d6ae5b5b..39ad9a20 100644
--- a/ksvg/core/KSVGCanvas.cpp
+++ b/ksvg/core/KSVGCanvas.cpp
@@ -784,5 +784,3 @@ void KSVGCanvas::ChunkManager::clear()
{
m_chunks.clear();
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGCanvas.h b/ksvg/core/KSVGCanvas.h
index f923e207..70704ec1 100644
--- a/ksvg/core/KSVGCanvas.h
+++ b/ksvg/core/KSVGCanvas.h
@@ -30,6 +30,8 @@
#include <Converter.h>
+#include <CanvasItem.h>
+
namespace KSVG
{
@@ -49,8 +51,6 @@ class SVGPolygonElementImpl;
class SVGPolylineElementImpl;
class SVGClipPathElementImpl;
-class CanvasItem;
-class CanvasChunk;
class CanvasItemList;
class CanvasClipPath;
class CanvasPaintServer;
@@ -187,5 +187,3 @@ protected:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGHelper.cpp b/ksvg/core/KSVGHelper.cpp
index 86d111a6..94773855 100644
--- a/ksvg/core/KSVGHelper.cpp
+++ b/ksvg/core/KSVGHelper.cpp
@@ -88,5 +88,3 @@ int sRGBFromLinearRGB(int linearRGB8bit)
{
return KSVGHelper::sRGBFromLinearRGB(linearRGB8bit);
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGHelper.h b/ksvg/core/KSVGHelper.h
index fe68b77e..05f73ff2 100644
--- a/ksvg/core/KSVGHelper.h
+++ b/ksvg/core/KSVGHelper.h
@@ -140,5 +140,3 @@ int sRGBFromLinearRGB(int linearRGB8bit);
#endif // __cplusplus
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGLoader.cpp b/ksvg/core/KSVGLoader.cpp
index 01601999..f075d2ff 100644
--- a/ksvg/core/KSVGLoader.cpp
+++ b/ksvg/core/KSVGLoader.cpp
@@ -445,5 +445,3 @@ SVGElementImpl *KSVGLoader::getSVGFragment(::KURL url, SVGDocumentImpl *doc, con
return searcher.result();
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGLoader.h b/ksvg/core/KSVGLoader.h
index 69d61494..10cd19ac 100644
--- a/ksvg/core/KSVGLoader.h
+++ b/ksvg/core/KSVGLoader.h
@@ -89,5 +89,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGReader.cc b/ksvg/core/KSVGReader.cc
deleted file mode 100644
index 7a62bb74..00000000
--- a/ksvg/core/KSVGReader.cc
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <dom/dom_exception.h>
-#include <kdebug.h>
-#include <tdelocale.h>
-#include <tqmap.h>
-#include <ksimpleconfig.h>
-#include <KSVGCanvas.h>
-#include "KSVGReader.moc"
-#include "SVGSVGElementImpl.h"
-#include "SVGViewSpecImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGShapeImpl.h"
-#include "SVGLengthImpl.h"
-#include "SVGImageElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGUseElementImpl.h"
-
-namespace KSVG
-{
-
-class Helper
-{
-public:
- static Helper *self(KSVGReader *reader = 0);
-
- void destroy();
-
- void setFit(bool bFit = true) { m_bFit = bFit; }
- bool fit() { return m_bFit; }
-
- SVGDocumentImpl *doc() const { return m_reader->doc(); }
- KSVGCanvas *canvas() const { return m_reader->canvas(); }
-
- void addSVGElement(SVGSVGElementImpl *one, DOM::NodeImpl *two) { m_svgMap.insert(two, one); }
- SVGSVGElementImpl *nextSVGElement(SVGElementImpl *elem);
- SVGSVGElementImpl *nextSVGElement(DOM::Node elem);
- void setFinished(bool error, const TQString &errorDesc = "") { m_reader->setFinished(error, errorDesc); }
-
- // Error handling
- void setErrorDescription(const TQString &err) { m_errorDesc = err; }
- TQString errorDescription() { return m_errorDesc; }
- bool hasError() const { return !m_errorDesc.isEmpty(); }
-
- bool getURLMode() const { return m_getURLMode; }
- void setGetURLMode(bool mode) { m_getURLMode = mode; }
-
- TQString SVGFragmentId() const { return m_SVGFragmentId; }
- void setSVGFragmentId(const TQString &SVGFragmentId) { m_SVGFragmentId = SVGFragmentId; }
-
-protected:
- Helper(KSVGReader *reader);
-
-private:
- Helper();
- Helper(const Helper &rhs);
- Helper &operator=(const Helper &rhs);
-
- static Helper *m_instance;
- TQMap<DOM::NodeImpl *, SVGSVGElementImpl *> m_svgMap;
- KSVGReader *m_reader;
- bool m_bFit;
- bool m_getURLMode;
- TQString m_errorDesc;
- TQString m_SVGFragmentId;
-};
-
-class InputHandler : public TQXmlDefaultHandler
-{
-public:
- virtual bool startDocument();
- virtual bool endDocument();
- virtual bool startElement(const TQString &namespaceURI,
- const TQString &localName,
- const TQString &qName,
- const TQXmlAttributes &atts);
- virtual bool endElement(const TQString &namespaceURI,
- const TQString &localName,
- const TQString &qName);
- virtual bool characters(const TQString &ch);
- virtual bool warning(const TQXmlParseException &e);
- virtual bool error(const TQXmlParseException &e);
- virtual bool fatalError(const TQXmlParseException &e);
-
-private:
- DOM::Node *m_rootNode;
- DOM::Node *m_currentNode;
- DOM::Node m_parentNode;
-
- bool m_noRendering, m_progressive;
-};
-
-}
-
-using namespace KSVG;
-
-Helper *Helper::m_instance = 0;
-
-Helper::Helper(KSVGReader *reader)
-{
- m_reader = reader;
-}
-
-Helper *Helper::self(KSVGReader *reader)
-{
- if(m_instance && reader != 0)
- m_instance->m_reader = reader;
- if(!m_instance)
- {
- Q_ASSERT(reader != 0);
- m_instance = new Helper(reader);
- }
-
- return m_instance;
-}
-
-void Helper::destroy()
-{
- m_svgMap.clear();
-}
-
-SVGSVGElementImpl *Helper::nextSVGElement(SVGElementImpl *elem)
-{
- return nextSVGElement(*elem);
-}
-
-SVGSVGElementImpl *Helper::nextSVGElement(DOM::Node elem)
-{
- DOM::Node foundSVG;
- DOM::Node shape = elem.parentNode();
-
- for(; !shape.isNull(); shape = shape.parentNode())
- {
- if(reinterpret_cast<DOM::Element &>(shape).nodeName() == "svg")
- {
- foundSVG = shape;
- break;
- }
- }
-
- SVGSVGElementImpl *svg = m_svgMap[foundSVG.handle()];
- return svg;
-}
-
-bool InputHandler::startDocument()
-{
- m_rootNode = 0;
- m_currentNode = 0;
- m_noRendering = false;
-
- KSimpleConfig config("ksvgpluginrc");
- config.setGroup("Rendering");
- m_progressive = config.readBoolEntry("ProgressiveRendering", true);
-
- if(Helper::self()->canvas())
- Helper::self()->canvas()->setImmediateUpdate(m_progressive);
-
- return true;
-}
-
-bool InputHandler::endDocument()
-{
- Helper::self()->setFinished(false);
- if (Helper::self()->canvas())
- Helper::self()->canvas()->setImmediateUpdate(false);
-
- return true;
-}
-
-bool InputHandler::characters(const TQString &ch)
-{
- kdDebug(26001) << "InputHandler::characters, read " << ch << endl;
-
- if(ch.simplifyWhiteSpace().isEmpty())
- return true;
-
- TQString t = ch;
-
- SVGSVGElementImpl *root = Helper::self()->nextSVGElement(*m_currentNode);
- if(root)
- {
- SVGElementImpl *element = root->ownerDoc()->getElementFromHandle(m_currentNode->handle());
- SVGLangSpaceImpl *langSpace = dynamic_cast<SVGLangSpaceImpl *>(element);
-
- if(langSpace)
- t = langSpace->handleText(ch);
- }
-
- if(!t.isEmpty())
- {
- DOM::Text impl = static_cast<DOM::Document *>(Helper::self()->doc())->createTextNode(t);
- m_currentNode->appendChild(impl);
- }
-
- return true;
-}
-
-bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, const TQString &qName, const TQXmlAttributes &attrs)
-{
- kdDebug(26001) << "InputHandler::startElement, namespaceURI " << namespaceURI << " qName " << qName << endl;
-
- SVGElementImpl *newElement = 0;
- SVGSVGElementImpl *svg = 0;
-
- if(qName == "svg")
- {
- DOM::Element impl = static_cast<DOM::Document *>(Helper::self()->doc())->createElementNS(namespaceURI, qName);
- newElement = SVGDocumentImpl::createElement(qName, impl, Helper::self()->doc());
- svg = dynamic_cast<SVGSVGElementImpl *>(newElement);
-
- Helper::self()->addSVGElement(svg, impl.handle());
-
- // Need this before we can find our ownerSVGElement (AP)
- if(m_currentNode != 0)
- {
- m_currentNode->appendChild(*svg);
- }
- else
- {
- if(Helper::self()->fit())
- { // handle fitting of svg into small drawing area(thumb)
- // TODO : aspectratio? and what about svgs that dont provide width and height?
- if(attrs.value("viewBox").isEmpty())
- {
- SVGLengthImpl *width = SVGSVGElementImpl::createSVGLength();
- SVGLengthImpl *height = SVGSVGElementImpl::createSVGLength();
- width->setValueAsString(attrs.value("width"));
- height->setValueAsString(attrs.value("height"));
- TQString viewbox = TQString("0 0 %1 %2").arg(width->value()).arg(height->value());
- //kdDebug(26001) << "VIEWBOX : " << viewbox.latin1() << endl;
- // HACK
- // Does the existing attribute need to be deleted before appending the new attribute?
- const_cast<TQXmlAttributes&>(attrs).append("viewBox", TQString::null, "viewBox", viewbox);
- width->deref();
- height->deref();
- }
- // HACK
- // Does the existing attribute need to be deleted before appending the new attribute?
- const_cast<TQXmlAttributes&>(attrs).append("width", TQString::null, "width", TQString::number(Helper::self()->canvas()->width()));
- const_cast<TQXmlAttributes&>(attrs).append("height", TQString::null, "height", TQString::number(Helper::self()->canvas()->height()));
- }
-
- if(!Helper::self()->SVGFragmentId().isEmpty())
- {
- if(svg->currentView()->parseViewSpec(Helper::self()->SVGFragmentId()))
- {
- svg->setUseCurrentView(true);
- }
- }
- }
-
- if(m_rootNode == 0)
- {
- Helper::self()->doc()->appendChild(*svg);
- Helper::self()->doc()->setRootElement(svg);
-
- m_rootNode = svg;
- }
- }
- else
- {
- if(!m_rootNode && !Helper::self()->getURLMode())
- {
- Helper::self()->setErrorDescription(i18n("A legal svg document requires a <svg> root element"));
- return false;
- }
-
- DOM::Element impl = static_cast<DOM::Document *>(Helper::self()->doc())->createElementNS(namespaceURI, qName);
- newElement = SVGDocumentImpl::createElement(qName, impl, Helper::self()->doc());
-
- // m_currentNode == 0 if we are dynamically extending the dom (parsexml...)
- // and the file doesn't have a root element
- if(m_currentNode != 0)
- m_currentNode->appendChild(*newElement);
- else
- Helper::self()->doc()->appendChild(*newElement);
-
- // Special logics:
- if(qName == "switch" || qName == "pattern" || qName == "mask")
- m_noRendering = true;
- }
-
- newElement->setOwnerSVGElement(Helper::self()->nextSVGElement(newElement));
- newElement->setViewportElement(newElement->ownerSVGElement());
-
- newElement->setAttributes(attrs);
-
- if(svg && svg->ownerSVGElement() == 0)
- {
- SVGImageElementImpl *parentImage = Helper::self()->doc()->parentImage();
-
- if(parentImage)
- {
- // We're being displayed in a document via an 'image' element. Set
- // us up to fit into it's rectangle.
- parentImage->setupSVGElement(svg);
- }
- }
-
- SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(newElement);
-
- if(locatable)
- {
- // Set up the cached screenCTM
- SVGLocatableImpl *locatableParent = 0;
- DOM::Node parentNode = newElement->parentNode();
-
- if(!parentNode.isNull())
- {
- SVGElementImpl *parent = Helper::self()->doc()->getElementFromHandle(parentNode.handle());
-
- if(parent)
- locatableParent = dynamic_cast<SVGLocatableImpl *>(parent);
- }
-
- SVGMatrixImpl *parentMatrix = 0;
-
- if(locatableParent)
- parentMatrix = locatableParent->getScreenCTM();
- else
- parentMatrix = SVGSVGElementImpl::createSVGMatrix();
-
- locatable->updateCachedScreenCTM(parentMatrix);
- parentMatrix->deref();
- }
-
- m_currentNode = newElement;
- return !Helper::self()->hasError();
-}
-
-bool InputHandler::endElement(const TQString &, const TQString &, const TQString &qName)
-{
- kdDebug(26001) << "InputHandler::endElement, qName " << qName << endl;
-
- bool haveCanvas = Helper::self()->canvas();
-
- SVGSVGElementImpl *root = Helper::self()->nextSVGElement(*m_currentNode);
- SVGElementImpl *element = root ? root->ownerDoc()->getElementFromHandle(m_currentNode->handle()) : Helper::self()->doc()->getElementFromHandle(m_currentNode->handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
-
- if(qName != "script" && !m_noRendering && !Helper::self()->getURLMode())
- {
- if(!root)
- {
- if(haveCanvas)
- {
- if(!m_progressive)
- Helper::self()->canvas()->update();
-
- Helper::self()->canvas()->blit();
-
- TQValueList<SVGUseElementImpl *> forwardReferencingUseElements = Helper::self()->doc()->forwardReferencingUseElements();
-
- if(!forwardReferencingUseElements.isEmpty())
- {
- // Create the elements again now that we have parsed the whole document.
- TQValueList<SVGUseElementImpl *>::iterator it;
-
- Helper::self()->canvas()->setImmediateUpdate(false);
-
- for(it = forwardReferencingUseElements.begin(); it != forwardReferencingUseElements.end(); it++)
- (*it)->createItem(Helper::self()->canvas());
-
- // The newly created items will need to be moved into their correct z-order positions.
- Helper::self()->doc()->resortZIndicesOnFinishedLoading();
- }
- }
-
- return true; // we have reached the bottom
- }
-
- if(haveCanvas && (tests ? tests->ok() : true))
- {
- if((shape && !shape->isContainer()) || (!shape && element))
- element->createItem();
- }
- }
-
- // Special logics:
- if(qName == "switch" || qName == "pattern" || qName == "mask")
- {
- m_noRendering = false;
- bool ok = tests ? tests->ok() : true;
-
- if((haveCanvas && element && style && ok && style->getDisplay() && style->getVisible() && (qName == "pattern")) || (shape && shape->directRender()))
- element->createItem();
- }
-
- m_parentNode = m_currentNode->parentNode(); // this is needed since otherwise we get temporary vars
- m_currentNode = &m_parentNode;
-
- return true;
-}
-
-bool InputHandler::warning(const TQXmlParseException &e)
-{
- kdDebug(26001) << "[" << e.lineNumber() << ":" << e.columnNumber() << "]: WARNING: " << e.message() << endl;
- return true;
-}
-
-bool InputHandler::error(const TQXmlParseException &e)
-{
- kdDebug(26001) << "[" << e.lineNumber() << ":" << e.columnNumber() << "]: ERROR: " << e.message() << endl;
- return true;
-}
-
-bool InputHandler::fatalError(const TQXmlParseException &e)
-{
- TQString error;
-
- if(Helper::self()->hasError())
- {
- error = Helper::self()->errorDescription();
- Helper::self()->setErrorDescription(TQString());
- }
- else
- error = TQString("[%1:%2]: FATAL ERROR: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(e.message());
-
- kdDebug(26001) << "InputHandler::fatalError, " << error << endl;
-
- Helper::self()->setFinished(true, error);
- return true;
-}
-
-struct KSVGReader::Private
-{
- TQXmlSimpleReader *reader;
- InputHandler *inputHandler;
- SVGDocumentImpl *doc;
- KSVGCanvas *canvas;
-};
-
-KSVGReader::KSVGReader(SVGDocumentImpl *doc, KSVGCanvas *canvas, ParsingArgs args) : TQObject(), d(new Private)
-{
- d->doc = doc;
- d->canvas = canvas;
-
- d->reader = new TQXmlSimpleReader();
- d->inputHandler = new InputHandler();
-
- Helper::self(this);
- Helper::self()->setFit(args.fit);
- Helper::self()->setGetURLMode(args.getURLMode);
- Helper::self()->setSVGFragmentId(args.SVGFragmentId);
-
- d->reader->setContentHandler(d->inputHandler);
- d->reader->setErrorHandler(d->inputHandler);
-}
-
-KSVGReader::~KSVGReader()
-{
- Helper::self()->destroy();
-
- delete d->reader;
- delete d->inputHandler;
- delete d;
-}
-
-void KSVGReader::parse(TQXmlInputSource *source)
-{
- d->reader->parse(source);
-}
-
-void KSVGReader::finishParsing(bool, const TQString &errorDesc)
-{
- Helper::self()->setErrorDescription(errorDesc);
-}
-
-void KSVGReader::setFinished(bool error, const TQString &errorDesc)
-{
- kdDebug(26001) << "KSVGReader::setFinished" << endl;
- emit finished(error, errorDesc);
-}
-
-SVGDocumentImpl *KSVGReader::doc()
-{
- return d->doc;
-}
-
-KSVG::KSVGCanvas *KSVGReader::canvas()
-{
- return d->canvas;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGReader.cpp b/ksvg/core/KSVGReader.cpp
new file mode 100644
index 00000000..3fbbefd3
--- /dev/null
+++ b/ksvg/core/KSVGReader.cpp
@@ -0,0 +1,504 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <dom/dom_exception.h>
+#include <kdebug.h>
+#include <tdelocale.h>
+#include <tqmap.h>
+#include <ksimpleconfig.h>
+#include <KSVGCanvas.h>
+#include "KSVGReader.moc"
+#include "SVGSVGElementImpl.h"
+#include "SVGViewSpecImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGShapeImpl.h"
+#include "SVGLengthImpl.h"
+#include "SVGImageElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGUseElementImpl.h"
+
+namespace KSVG
+{
+
+class Helper
+{
+public:
+ static Helper *self(KSVGReader *reader = 0);
+
+ void destroy();
+
+ void setFit(bool bFit = true) { m_bFit = bFit; }
+ bool fit() { return m_bFit; }
+
+ SVGDocumentImpl *doc() const { return m_reader->doc(); }
+ KSVGCanvas *canvas() const { return m_reader->canvas(); }
+
+ void addSVGElement(SVGSVGElementImpl *one, DOM::NodeImpl *two) { m_svgMap.insert(two, one); }
+ SVGSVGElementImpl *nextSVGElement(SVGElementImpl *elem);
+ SVGSVGElementImpl *nextSVGElement(DOM::Node elem);
+ void setFinished(bool error, const TQString &errorDesc = "") { m_reader->setFinished(error, errorDesc); }
+
+ // Error handling
+ void setErrorDescription(const TQString &err) { m_errorDesc = err; }
+ TQString errorDescription() { return m_errorDesc; }
+ bool hasError() const { return !m_errorDesc.isEmpty(); }
+
+ bool getURLMode() const { return m_getURLMode; }
+ void setGetURLMode(bool mode) { m_getURLMode = mode; }
+
+ TQString SVGFragmentId() const { return m_SVGFragmentId; }
+ void setSVGFragmentId(const TQString &SVGFragmentId) { m_SVGFragmentId = SVGFragmentId; }
+
+protected:
+ Helper(KSVGReader *reader);
+
+private:
+ Helper();
+ Helper(const Helper &rhs);
+ Helper &operator=(const Helper &rhs);
+
+ static Helper *m_instance;
+ TQMap<DOM::NodeImpl *, SVGSVGElementImpl *> m_svgMap;
+ KSVGReader *m_reader;
+ bool m_bFit;
+ bool m_getURLMode;
+ TQString m_errorDesc;
+ TQString m_SVGFragmentId;
+};
+
+class InputHandler : public TQXmlDefaultHandler
+{
+public:
+ virtual bool startDocument();
+ virtual bool endDocument();
+ virtual bool startElement(const TQString &namespaceURI,
+ const TQString &localName,
+ const TQString &qName,
+ const TQXmlAttributes &atts);
+ virtual bool endElement(const TQString &namespaceURI,
+ const TQString &localName,
+ const TQString &qName);
+ virtual bool characters(const TQString &ch);
+ virtual bool warning(const TQXmlParseException &e);
+ virtual bool error(const TQXmlParseException &e);
+ virtual bool fatalError(const TQXmlParseException &e);
+
+private:
+ DOM::Node *m_rootNode;
+ DOM::Node *m_currentNode;
+ DOM::Node m_parentNode;
+
+ bool m_noRendering, m_progressive;
+};
+
+}
+
+using namespace KSVG;
+
+Helper *Helper::m_instance = 0;
+
+Helper::Helper(KSVGReader *reader)
+{
+ m_reader = reader;
+}
+
+Helper *Helper::self(KSVGReader *reader)
+{
+ if(m_instance && reader != 0)
+ m_instance->m_reader = reader;
+ if(!m_instance)
+ {
+ Q_ASSERT(reader != 0);
+ m_instance = new Helper(reader);
+ }
+
+ return m_instance;
+}
+
+void Helper::destroy()
+{
+ m_svgMap.clear();
+}
+
+SVGSVGElementImpl *Helper::nextSVGElement(SVGElementImpl *elem)
+{
+ return nextSVGElement(*elem);
+}
+
+SVGSVGElementImpl *Helper::nextSVGElement(DOM::Node elem)
+{
+ DOM::Node foundSVG;
+ DOM::Node shape = elem.parentNode();
+
+ for(; !shape.isNull(); shape = shape.parentNode())
+ {
+ if(reinterpret_cast<DOM::Element &>(shape).nodeName() == "svg")
+ {
+ foundSVG = shape;
+ break;
+ }
+ }
+
+ SVGSVGElementImpl *svg = m_svgMap[foundSVG.handle()];
+ return svg;
+}
+
+bool InputHandler::startDocument()
+{
+ m_rootNode = 0;
+ m_currentNode = 0;
+ m_noRendering = false;
+
+ KSimpleConfig config("ksvgpluginrc");
+ config.setGroup("Rendering");
+ m_progressive = config.readBoolEntry("ProgressiveRendering", true);
+
+ if(Helper::self()->canvas())
+ Helper::self()->canvas()->setImmediateUpdate(m_progressive);
+
+ return true;
+}
+
+bool InputHandler::endDocument()
+{
+ Helper::self()->setFinished(false);
+ if (Helper::self()->canvas())
+ Helper::self()->canvas()->setImmediateUpdate(false);
+
+ return true;
+}
+
+bool InputHandler::characters(const TQString &ch)
+{
+ kdDebug(26001) << "InputHandler::characters, read " << ch << endl;
+
+ if(ch.simplifyWhiteSpace().isEmpty())
+ return true;
+
+ TQString t = ch;
+
+ SVGSVGElementImpl *root = Helper::self()->nextSVGElement(*m_currentNode);
+ if(root)
+ {
+ SVGElementImpl *element = root->ownerDoc()->getElementFromHandle(m_currentNode->handle());
+ SVGLangSpaceImpl *langSpace = dynamic_cast<SVGLangSpaceImpl *>(element);
+
+ if(langSpace)
+ t = langSpace->handleText(ch);
+ }
+
+ if(!t.isEmpty())
+ {
+ DOM::Text impl = static_cast<DOM::Document *>(Helper::self()->doc())->createTextNode(t);
+ m_currentNode->appendChild(impl);
+ }
+
+ return true;
+}
+
+bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, const TQString &qName, const TQXmlAttributes &attrs)
+{
+ kdDebug(26001) << "InputHandler::startElement, namespaceURI " << namespaceURI << " qName " << qName << endl;
+
+ SVGElementImpl *newElement = 0;
+ SVGSVGElementImpl *svg = 0;
+
+ if(qName == "svg")
+ {
+ DOM::Element impl = static_cast<DOM::Document *>(Helper::self()->doc())->createElementNS(namespaceURI, qName);
+ newElement = SVGDocumentImpl::createElement(qName, impl, Helper::self()->doc());
+ svg = dynamic_cast<SVGSVGElementImpl *>(newElement);
+
+ Helper::self()->addSVGElement(svg, impl.handle());
+
+ // Need this before we can find our ownerSVGElement (AP)
+ if(m_currentNode != 0)
+ {
+ m_currentNode->appendChild(*svg);
+ }
+ else
+ {
+ if(Helper::self()->fit())
+ { // handle fitting of svg into small drawing area(thumb)
+ // TODO : aspectratio? and what about svgs that dont provide width and height?
+ if(attrs.value("viewBox").isEmpty())
+ {
+ SVGLengthImpl *width = SVGSVGElementImpl::createSVGLength();
+ SVGLengthImpl *height = SVGSVGElementImpl::createSVGLength();
+ width->setValueAsString(attrs.value("width"));
+ height->setValueAsString(attrs.value("height"));
+ TQString viewbox = TQString("0 0 %1 %2").arg(width->value()).arg(height->value());
+ //kdDebug(26001) << "VIEWBOX : " << viewbox.latin1() << endl;
+ // HACK
+ // Does the existing attribute need to be deleted before appending the new attribute?
+ const_cast<TQXmlAttributes&>(attrs).append("viewBox", TQString::null, "viewBox", viewbox);
+ width->deref();
+ height->deref();
+ }
+ // HACK
+ // Does the existing attribute need to be deleted before appending the new attribute?
+ const_cast<TQXmlAttributes&>(attrs).append("width", TQString::null, "width", TQString::number(Helper::self()->canvas()->width()));
+ const_cast<TQXmlAttributes&>(attrs).append("height", TQString::null, "height", TQString::number(Helper::self()->canvas()->height()));
+ }
+
+ if(!Helper::self()->SVGFragmentId().isEmpty())
+ {
+ if(svg->currentView()->parseViewSpec(Helper::self()->SVGFragmentId()))
+ {
+ svg->setUseCurrentView(true);
+ }
+ }
+ }
+
+ if(m_rootNode == 0)
+ {
+ Helper::self()->doc()->appendChild(*svg);
+ Helper::self()->doc()->setRootElement(svg);
+
+ m_rootNode = svg;
+ }
+ }
+ else
+ {
+ if(!m_rootNode && !Helper::self()->getURLMode())
+ {
+ Helper::self()->setErrorDescription(i18n("A legal svg document requires a <svg> root element"));
+ return false;
+ }
+
+ DOM::Element impl = static_cast<DOM::Document *>(Helper::self()->doc())->createElementNS(namespaceURI, qName);
+ newElement = SVGDocumentImpl::createElement(qName, impl, Helper::self()->doc());
+
+ // m_currentNode == 0 if we are dynamically extending the dom (parsexml...)
+ // and the file doesn't have a root element
+ if(m_currentNode != 0)
+ m_currentNode->appendChild(*newElement);
+ else
+ Helper::self()->doc()->appendChild(*newElement);
+
+ // Special logics:
+ if(qName == "switch" || qName == "pattern" || qName == "mask")
+ m_noRendering = true;
+ }
+
+ newElement->setOwnerSVGElement(Helper::self()->nextSVGElement(newElement));
+ newElement->setViewportElement(newElement->ownerSVGElement());
+
+ newElement->setAttributes(attrs);
+
+ if(svg && svg->ownerSVGElement() == 0)
+ {
+ SVGImageElementImpl *parentImage = Helper::self()->doc()->parentImage();
+
+ if(parentImage)
+ {
+ // We're being displayed in a document via an 'image' element. Set
+ // us up to fit into it's rectangle.
+ parentImage->setupSVGElement(svg);
+ }
+ }
+
+ SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(newElement);
+
+ if(locatable)
+ {
+ // Set up the cached screenCTM
+ SVGLocatableImpl *locatableParent = 0;
+ DOM::Node parentNode = newElement->parentNode();
+
+ if(!parentNode.isNull())
+ {
+ SVGElementImpl *parent = Helper::self()->doc()->getElementFromHandle(parentNode.handle());
+
+ if(parent)
+ locatableParent = dynamic_cast<SVGLocatableImpl *>(parent);
+ }
+
+ SVGMatrixImpl *parentMatrix = 0;
+
+ if(locatableParent)
+ parentMatrix = locatableParent->getScreenCTM();
+ else
+ parentMatrix = SVGSVGElementImpl::createSVGMatrix();
+
+ locatable->updateCachedScreenCTM(parentMatrix);
+ parentMatrix->deref();
+ }
+
+ m_currentNode = newElement;
+ return !Helper::self()->hasError();
+}
+
+bool InputHandler::endElement(const TQString &, const TQString &, const TQString &qName)
+{
+ kdDebug(26001) << "InputHandler::endElement, qName " << qName << endl;
+
+ bool haveCanvas = Helper::self()->canvas();
+
+ SVGSVGElementImpl *root = Helper::self()->nextSVGElement(*m_currentNode);
+ SVGElementImpl *element = root ? root->ownerDoc()->getElementFromHandle(m_currentNode->handle()) : Helper::self()->doc()->getElementFromHandle(m_currentNode->handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
+
+ if(qName != "script" && !m_noRendering && !Helper::self()->getURLMode())
+ {
+ if(!root)
+ {
+ if(haveCanvas)
+ {
+ if(!m_progressive)
+ Helper::self()->canvas()->update();
+
+ Helper::self()->canvas()->blit();
+
+ TQValueList<SVGUseElementImpl *> forwardReferencingUseElements = Helper::self()->doc()->forwardReferencingUseElements();
+
+ if(!forwardReferencingUseElements.isEmpty())
+ {
+ // Create the elements again now that we have parsed the whole document.
+ TQValueList<SVGUseElementImpl *>::iterator it;
+
+ Helper::self()->canvas()->setImmediateUpdate(false);
+
+ for(it = forwardReferencingUseElements.begin(); it != forwardReferencingUseElements.end(); it++)
+ (*it)->createItem(Helper::self()->canvas());
+
+ // The newly created items will need to be moved into their correct z-order positions.
+ Helper::self()->doc()->resortZIndicesOnFinishedLoading();
+ }
+ }
+
+ return true; // we have reached the bottom
+ }
+
+ if(haveCanvas && (tests ? tests->ok() : true))
+ {
+ if((shape && !shape->isContainer()) || (!shape && element))
+ element->createItem();
+ }
+ }
+
+ // Special logics:
+ if(qName == "switch" || qName == "pattern" || qName == "mask")
+ {
+ m_noRendering = false;
+ bool ok = tests ? tests->ok() : true;
+
+ if((haveCanvas && element && style && ok && style->getDisplay() && style->getVisible() && (qName == "pattern")) || (shape && shape->directRender()))
+ element->createItem();
+ }
+
+ m_parentNode = m_currentNode->parentNode(); // this is needed since otherwise we get temporary vars
+ m_currentNode = &m_parentNode;
+
+ return true;
+}
+
+bool InputHandler::warning(const TQXmlParseException &e)
+{
+ kdDebug(26001) << "[" << e.lineNumber() << ":" << e.columnNumber() << "]: WARNING: " << e.message() << endl;
+ return true;
+}
+
+bool InputHandler::error(const TQXmlParseException &e)
+{
+ kdDebug(26001) << "[" << e.lineNumber() << ":" << e.columnNumber() << "]: ERROR: " << e.message() << endl;
+ return true;
+}
+
+bool InputHandler::fatalError(const TQXmlParseException &e)
+{
+ TQString error;
+
+ if(Helper::self()->hasError())
+ {
+ error = Helper::self()->errorDescription();
+ Helper::self()->setErrorDescription(TQString());
+ }
+ else
+ error = TQString("[%1:%2]: FATAL ERROR: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(e.message());
+
+ kdDebug(26001) << "InputHandler::fatalError, " << error << endl;
+
+ Helper::self()->setFinished(true, error);
+ return true;
+}
+
+struct KSVGReader::Private
+{
+ TQXmlSimpleReader *reader;
+ InputHandler *inputHandler;
+ SVGDocumentImpl *doc;
+ KSVGCanvas *canvas;
+};
+
+KSVGReader::KSVGReader(SVGDocumentImpl *doc, KSVGCanvas *canvas, ParsingArgs args) : TQObject(), d(new Private)
+{
+ d->doc = doc;
+ d->canvas = canvas;
+
+ d->reader = new TQXmlSimpleReader();
+ d->inputHandler = new InputHandler();
+
+ Helper::self(this);
+ Helper::self()->setFit(args.fit);
+ Helper::self()->setGetURLMode(args.getURLMode);
+ Helper::self()->setSVGFragmentId(args.SVGFragmentId);
+
+ d->reader->setContentHandler(d->inputHandler);
+ d->reader->setErrorHandler(d->inputHandler);
+}
+
+KSVGReader::~KSVGReader()
+{
+ Helper::self()->destroy();
+
+ delete d->reader;
+ delete d->inputHandler;
+ delete d;
+}
+
+void KSVGReader::parse(TQXmlInputSource *source)
+{
+ d->reader->parse(source);
+}
+
+void KSVGReader::finishParsing(bool, const TQString &errorDesc)
+{
+ Helper::self()->setErrorDescription(errorDesc);
+}
+
+void KSVGReader::setFinished(bool error, const TQString &errorDesc)
+{
+ kdDebug(26001) << "KSVGReader::setFinished" << endl;
+ emit finished(error, errorDesc);
+}
+
+SVGDocumentImpl *KSVGReader::doc()
+{
+ return d->doc;
+}
+
+KSVG::KSVGCanvas *KSVGReader::canvas()
+{
+ return d->canvas;
+}
diff --git a/ksvg/core/KSVGTextChunk.cpp b/ksvg/core/KSVGTextChunk.cpp
index 4d8111e8..d2c07ce8 100644
--- a/ksvg/core/KSVGTextChunk.cpp
+++ b/ksvg/core/KSVGTextChunk.cpp
@@ -65,5 +65,3 @@ void KSVGTextChunk::addText(const TQString &text, SVGTextContentElementImpl *tex
m_text.append(text);
m_textElements.append(textElement);
}
-
-// vim:ts=4:noet
diff --git a/ksvg/core/KSVGTextChunk.h b/ksvg/core/KSVGTextChunk.h
index 21efa055..7c88c0a0 100644
--- a/ksvg/core/KSVGTextChunk.h
+++ b/ksvg/core/KSVGTextChunk.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/core/Makefile.am b/ksvg/core/Makefile.am
index e1867428..c511c165 100644
--- a/ksvg/core/Makefile.am
+++ b/ksvg/core/Makefile.am
@@ -1,6 +1,6 @@
noinst_LTLIBRARIES = libksvgcore.la
-libksvgcore_la_SOURCES = KSVGLoader.cpp KSVGCanvas.cpp KSVGReader.cc KSVGTextChunk.cpp CanvasFactory.cpp CanvasItems.cpp KSVGHelper.cpp DocumentFactory.cpp
+libksvgcore_la_SOURCES = KSVGLoader.cpp KSVGCanvas.cpp KSVGReader.cpp KSVGTextChunk.cpp CanvasFactory.cpp CanvasItems.cpp KSVGHelper.cpp DocumentFactory.cpp
libksvgcore_la_METASOURCES = AUTO
servicetypedir = $(kde_servicetypesdir)
diff --git a/ksvg/core/ksvgrenderer.desktop b/ksvg/core/ksvgrenderer.desktop
index 4523be4e..dea35948 100644
--- a/ksvg/core/ksvgrenderer.desktop
+++ b/ksvg/core/ksvgrenderer.desktop
@@ -3,54 +3,6 @@ Type=ServiceType
X-TDE-ServiceType=KSVG/Renderer
X-TDE-Derived=
Comment=KSVG Rendering Backend
-Comment[ar]=خلفية رسم KSVG
-Comment[bs]=KSVG renderiranje
-Comment[ca]=Representació en segon pla de KSVG
-Comment[cs]=Vykreslovací nástroj KSVG
-Comment[cy]=Ôl-wyneb Llunio KSVG
-Comment[da]=Underliggende program for KSVG-visning
-Comment[de]=KSVG-Darstellungsmodul
-Comment[el]=Σύστημα υποστήριξης αποτύπωσης του KSVG
-Comment[es]=Motor de procesado de KSVG
-Comment[et]=KSVG renderdamise taustarakendus
-Comment[eu]=KSVG errendatze programa
-Comment[fa]=پایانۀ پشتیبانی پرداخت KSVG
-Comment[fi]=KSVG-piirtäjän taustaohjelma
-Comment[fr]=Moteur de rendu KSVG
-Comment[ga]=Inneall Rindreála KSVG
-Comment[gl]=Backend de Renderizado KSVG
-Comment[he]=מנוע רינדור KSVG
-Comment[hi]=के-एसवीजी रेंडरिंग बैकएण्ड
-Comment[hu]=KSVG megjelenítőmotor
-Comment[is]=KSVG teiknari
-Comment[it]=Backend di KSVG per il rendering
-Comment[ja]=KSVG レンダリングバックエンド
-Comment[kk]=KSVG кескіндеу бағдарламасы
-Comment[km]=កម្មវិធី​សម្រាប់​បង្ហាញ KSVG
-Comment[lt]=KSVG atkūrimo programinė sąsaja
-Comment[ms]=Tepi Belakang Menrealisasi KSVG
-Comment[nb]=Modul for KSVG-tegning
-Comment[nds]=KSVG-Dorstellhölper
-Comment[ne]=KSVG रेन्डरिङ ब्याकइन्ड
-Comment[nl]=KSVG weergavecomponent
-Comment[nn]=Modul for KSVG-teikning
-Comment[pl]=Narzędzie do renderowania KSVG
-Comment[pt]=Infra-Estrutura de Desenho KSVG
-Comment[pt_BR]=Estrutura de Renderização do KSVG
-Comment[ro]=Motorul de randare KSVG
-Comment[ru]=Движок прорисовки KSVG
-Comment[sk]=Nástroj pre zobrazovanie KSVG
-Comment[sl]=Izrisovalnik KSVG
-Comment[sr]=KSVG-ов позадински систем за рендеровање
-Comment[sr@Latn]=KSVG-ov pozadinski sistem za renderovanje
-Comment[sv]=KSVG-uppritningsmodul
-Comment[ta]=KSVG வழங்கும் பின் அமைப்பு
-Comment[tg]=Лағжандаи тасовироти KSVG
-Comment[tr]=KSVG Tarama Arkayüzü
-Comment[uk]=Інтерфейс відтворення KSVG
-Comment[zh_CN]=KSVG 渲染后端
-Comment[zh_HK]=KSVG 合成後端
-Comment[zh_TW]=KSVG 上色後端介面
[PropertyDef::X-KSVG-InternalName]
Type=TQString
diff --git a/ksvg/data/SVGAElementImpl.lut.h b/ksvg/data/SVGAElementImpl.lut.h
index 2d303e23..b99a5c31 100644
--- a/ksvg/data/SVGAElementImpl.lut.h
+++ b/ksvg/data/SVGAElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAngleImpl.lut.h b/ksvg/data/SVGAngleImpl.lut.h
index ac8ea8ba..6e1b45d4 100644
--- a/ksvg/data/SVGAngleImpl.lut.h
+++ b/ksvg/data/SVGAngleImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAngleImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAngleImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedAngleImpl.lut.h b/ksvg/data/SVGAnimatedAngleImpl.lut.h
index 27d37f10..d98dd01e 100644
--- a/ksvg/data/SVGAnimatedAngleImpl.lut.h
+++ b/ksvg/data/SVGAnimatedAngleImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedAngleImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedAngleImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedBooleanImpl.lut.h b/ksvg/data/SVGAnimatedBooleanImpl.lut.h
index e0b612a9..67cd8a37 100644
--- a/ksvg/data/SVGAnimatedBooleanImpl.lut.h
+++ b/ksvg/data/SVGAnimatedBooleanImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedBooleanImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedBooleanImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedEnumerationImpl.lut.h b/ksvg/data/SVGAnimatedEnumerationImpl.lut.h
index 2c9c5bbb..227666e8 100644
--- a/ksvg/data/SVGAnimatedEnumerationImpl.lut.h
+++ b/ksvg/data/SVGAnimatedEnumerationImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedEnumerationImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedEnumerationImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedIntegerImpl.lut.h b/ksvg/data/SVGAnimatedIntegerImpl.lut.h
index 53f318f0..e769d35c 100644
--- a/ksvg/data/SVGAnimatedIntegerImpl.lut.h
+++ b/ksvg/data/SVGAnimatedIntegerImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedIntegerImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedIntegerImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedLengthImpl.lut.h b/ksvg/data/SVGAnimatedLengthImpl.lut.h
index 3de40716..28bbb642 100644
--- a/ksvg/data/SVGAnimatedLengthImpl.lut.h
+++ b/ksvg/data/SVGAnimatedLengthImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedLengthImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedLengthImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedLengthListImpl.lut.h b/ksvg/data/SVGAnimatedLengthListImpl.lut.h
index 25f317a1..dd28fc61 100644
--- a/ksvg/data/SVGAnimatedLengthListImpl.lut.h
+++ b/ksvg/data/SVGAnimatedLengthListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedLengthListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedLengthListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedNumberImpl.lut.h b/ksvg/data/SVGAnimatedNumberImpl.lut.h
index 68c935e0..15800017 100644
--- a/ksvg/data/SVGAnimatedNumberImpl.lut.h
+++ b/ksvg/data/SVGAnimatedNumberImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedNumberImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedNumberImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedNumberListImpl.lut.h b/ksvg/data/SVGAnimatedNumberListImpl.lut.h
index d10cdb39..77b1183a 100644
--- a/ksvg/data/SVGAnimatedNumberListImpl.lut.h
+++ b/ksvg/data/SVGAnimatedNumberListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedNumberListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedNumberListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedPathDataImpl.lut.h b/ksvg/data/SVGAnimatedPathDataImpl.lut.h
index 3bf7f4b3..76238d7a 100644
--- a/ksvg/data/SVGAnimatedPathDataImpl.lut.h
+++ b/ksvg/data/SVGAnimatedPathDataImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedPathDataImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedPathDataImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedPointsImpl.lut.h b/ksvg/data/SVGAnimatedPointsImpl.lut.h
index aa5c49c6..832ce16c 100644
--- a/ksvg/data/SVGAnimatedPointsImpl.lut.h
+++ b/ksvg/data/SVGAnimatedPointsImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedPointsImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedPointsImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedPreserveAspectRatioImpl.lut.h b/ksvg/data/SVGAnimatedPreserveAspectRatioImpl.lut.h
index e93eb180..6903faee 100644
--- a/ksvg/data/SVGAnimatedPreserveAspectRatioImpl.lut.h
+++ b/ksvg/data/SVGAnimatedPreserveAspectRatioImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedPreserveAspectRatioImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedPreserveAspectRatioImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedRectImpl.lut.h b/ksvg/data/SVGAnimatedRectImpl.lut.h
index 1f7c994c..30023f69 100644
--- a/ksvg/data/SVGAnimatedRectImpl.lut.h
+++ b/ksvg/data/SVGAnimatedRectImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedRectImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedRectImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedStringImpl.lut.h b/ksvg/data/SVGAnimatedStringImpl.lut.h
index 264a1681..9be92fca 100644
--- a/ksvg/data/SVGAnimatedStringImpl.lut.h
+++ b/ksvg/data/SVGAnimatedStringImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedStringImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedStringImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimatedTransformListImpl.lut.h b/ksvg/data/SVGAnimatedTransformListImpl.lut.h
index 29a9116c..50f01362 100644
--- a/ksvg/data/SVGAnimatedTransformListImpl.lut.h
+++ b/ksvg/data/SVGAnimatedTransformListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimatedTransformListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimatedTransformListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGAnimationElementImpl.lut.h b/ksvg/data/SVGAnimationElementImpl.lut.h
index 39504503..3f76ee3c 100644
--- a/ksvg/data/SVGAnimationElementImpl.lut.h
+++ b/ksvg/data/SVGAnimationElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGAnimationElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGAnimationElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGCircleElementImpl.lut.h b/ksvg/data/SVGCircleElementImpl.lut.h
index cd58c0ba..bd58769b 100644
--- a/ksvg/data/SVGCircleElementImpl.lut.h
+++ b/ksvg/data/SVGCircleElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGCircleElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGCircleElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGClipPathElementImpl.lut.h b/ksvg/data/SVGClipPathElementImpl.lut.h
index ffaf7566..35fab5da 100644
--- a/ksvg/data/SVGClipPathElementImpl.lut.h
+++ b/ksvg/data/SVGClipPathElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGClipPathElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGClipPathElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGColorImpl.lut.h b/ksvg/data/SVGColorImpl.lut.h
index c1f0ca4b..d32c4998 100644
--- a/ksvg/data/SVGColorImpl.lut.h
+++ b/ksvg/data/SVGColorImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGColorImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGColorImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGColorProfileElementImpl.lut.h b/ksvg/data/SVGColorProfileElementImpl.lut.h
index f686f347..552e8c51 100644
--- a/ksvg/data/SVGColorProfileElementImpl.lut.h
+++ b/ksvg/data/SVGColorProfileElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGColorProfileElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGColorProfileElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGCursorElementImpl.lut.h b/ksvg/data/SVGCursorElementImpl.lut.h
index 26df2ec6..dc5bad0b 100644
--- a/ksvg/data/SVGCursorElementImpl.lut.h
+++ b/ksvg/data/SVGCursorElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGCursorElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGCursorElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGDocumentImpl.lut.h b/ksvg/data/SVGDocumentImpl.lut.h
index 5cd3a1d8..43b03ec4 100644
--- a/ksvg/data/SVGDocumentImpl.lut.h
+++ b/ksvg/data/SVGDocumentImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGDocumentImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGDocumentImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGEcma.lut.h b/ksvg/data/SVGEcma.lut.h
index c4aad5da..cd7d75ef 100644
--- a/ksvg/data/SVGEcma.lut.h
+++ b/ksvg/data/SVGEcma.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGEcma.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGEcma.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGElementImpl.lut.h b/ksvg/data/SVGElementImpl.lut.h
index da976ae0..941c0040 100644
--- a/ksvg/data/SVGElementImpl.lut.h
+++ b/ksvg/data/SVGElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGEllipseElementImpl.lut.h b/ksvg/data/SVGEllipseElementImpl.lut.h
index d39018d9..9db9d2e5 100644
--- a/ksvg/data/SVGEllipseElementImpl.lut.h
+++ b/ksvg/data/SVGEllipseElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGEllipseElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGEllipseElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGEventImpl.lut.h b/ksvg/data/SVGEventImpl.lut.h
index e7192b72..63795ede 100644
--- a/ksvg/data/SVGEventImpl.lut.h
+++ b/ksvg/data/SVGEventImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGEventImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGEventImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGExternalResourcesRequiredImpl.lut.h b/ksvg/data/SVGExternalResourcesRequiredImpl.lut.h
index e952c4a1..12b53aa8 100644
--- a/ksvg/data/SVGExternalResourcesRequiredImpl.lut.h
+++ b/ksvg/data/SVGExternalResourcesRequiredImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGExternalResourcesRequiredImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGExternalResourcesRequiredImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGFitToViewBoxImpl.lut.h b/ksvg/data/SVGFitToViewBoxImpl.lut.h
index 04b34c2e..3e04ba29 100644
--- a/ksvg/data/SVGFitToViewBoxImpl.lut.h
+++ b/ksvg/data/SVGFitToViewBoxImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGFitToViewBoxImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGFitToViewBoxImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGForeignObjectElementImpl.lut.h b/ksvg/data/SVGForeignObjectElementImpl.lut.h
index 16273af9..8bc35092 100644
--- a/ksvg/data/SVGForeignObjectElementImpl.lut.h
+++ b/ksvg/data/SVGForeignObjectElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGForeignObjectElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGForeignObjectElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGGlyphElementImpl.lut.h b/ksvg/data/SVGGlyphElementImpl.lut.h
index 8300e1c8..742d426e 100644
--- a/ksvg/data/SVGGlyphElementImpl.lut.h
+++ b/ksvg/data/SVGGlyphElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGGlyphElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGGlyphElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGGlyphRefElementImpl.lut.h b/ksvg/data/SVGGlyphRefElementImpl.lut.h
index f5d55bf1..0d432e0b 100644
--- a/ksvg/data/SVGGlyphRefElementImpl.lut.h
+++ b/ksvg/data/SVGGlyphRefElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGGlyphRefElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGGlyphRefElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGGradientElementImpl.lut.h b/ksvg/data/SVGGradientElementImpl.lut.h
index 7b779406..7efbfa8b 100644
--- a/ksvg/data/SVGGradientElementImpl.lut.h
+++ b/ksvg/data/SVGGradientElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGGradientElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGGradientElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGICCColorImpl.lut.h b/ksvg/data/SVGICCColorImpl.lut.h
index 1a7064ad..3f4897fc 100644
--- a/ksvg/data/SVGICCColorImpl.lut.h
+++ b/ksvg/data/SVGICCColorImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGICCColorImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGICCColorImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGImageElementImpl.lut.h b/ksvg/data/SVGImageElementImpl.lut.h
index 25641ee9..76906102 100644
--- a/ksvg/data/SVGImageElementImpl.lut.h
+++ b/ksvg/data/SVGImageElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGImageElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGImageElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGLangSpaceImpl.lut.h b/ksvg/data/SVGLangSpaceImpl.lut.h
index 3f00372e..2d838dd3 100644
--- a/ksvg/data/SVGLangSpaceImpl.lut.h
+++ b/ksvg/data/SVGLangSpaceImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGLangSpaceImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGLangSpaceImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGLengthImpl.lut.h b/ksvg/data/SVGLengthImpl.lut.h
index a9f3bbc2..e097fdf8 100644
--- a/ksvg/data/SVGLengthImpl.lut.h
+++ b/ksvg/data/SVGLengthImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGLengthImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGLengthImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGLengthListImpl.lut.h b/ksvg/data/SVGLengthListImpl.lut.h
index fc7249d0..f55fb042 100644
--- a/ksvg/data/SVGLengthListImpl.lut.h
+++ b/ksvg/data/SVGLengthListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGLengthListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGLengthListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGLineElementImpl.lut.h b/ksvg/data/SVGLineElementImpl.lut.h
index 92dfd1a4..41ee7ef7 100644
--- a/ksvg/data/SVGLineElementImpl.lut.h
+++ b/ksvg/data/SVGLineElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGLineElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGLineElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGLinearGradientElementImpl.lut.h b/ksvg/data/SVGLinearGradientElementImpl.lut.h
index 65e4efba..16096835 100644
--- a/ksvg/data/SVGLinearGradientElementImpl.lut.h
+++ b/ksvg/data/SVGLinearGradientElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGLinearGradientElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGLinearGradientElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGLocatableImpl.lut.h b/ksvg/data/SVGLocatableImpl.lut.h
index ff489e1c..2c1a36fc 100644
--- a/ksvg/data/SVGLocatableImpl.lut.h
+++ b/ksvg/data/SVGLocatableImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGLocatableImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGLocatableImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGMarkerElementImpl.lut.h b/ksvg/data/SVGMarkerElementImpl.lut.h
index bc08f91d..2e679bab 100644
--- a/ksvg/data/SVGMarkerElementImpl.lut.h
+++ b/ksvg/data/SVGMarkerElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGMarkerElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGMarkerElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGMaskElementImpl.lut.h b/ksvg/data/SVGMaskElementImpl.lut.h
index 9957c71e..60aaa045 100644
--- a/ksvg/data/SVGMaskElementImpl.lut.h
+++ b/ksvg/data/SVGMaskElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGMaskElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGMaskElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGMatrixImpl.lut.h b/ksvg/data/SVGMatrixImpl.lut.h
index c4845b37..66588e56 100644
--- a/ksvg/data/SVGMatrixImpl.lut.h
+++ b/ksvg/data/SVGMatrixImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGMatrixImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGMatrixImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGNumberImpl.lut.h b/ksvg/data/SVGNumberImpl.lut.h
index 789150fe..9a7935c4 100644
--- a/ksvg/data/SVGNumberImpl.lut.h
+++ b/ksvg/data/SVGNumberImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGNumberImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGNumberImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGNumberListImpl.lut.h b/ksvg/data/SVGNumberListImpl.lut.h
index 4a9b715b..ca12b5f0 100644
--- a/ksvg/data/SVGNumberListImpl.lut.h
+++ b/ksvg/data/SVGNumberListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGNumberListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGNumberListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPaintImpl.lut.h b/ksvg/data/SVGPaintImpl.lut.h
index 0b2721e8..3b9b10fc 100644
--- a/ksvg/data/SVGPaintImpl.lut.h
+++ b/ksvg/data/SVGPaintImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPaintImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPaintImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathElementImpl.lut.h b/ksvg/data/SVGPathElementImpl.lut.h
index acb1300e..3a337893 100644
--- a/ksvg/data/SVGPathElementImpl.lut.h
+++ b/ksvg/data/SVGPathElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegArcImpl.lut.h b/ksvg/data/SVGPathSegArcImpl.lut.h
index 589b53e2..a4955d08 100644
--- a/ksvg/data/SVGPathSegArcImpl.lut.h
+++ b/ksvg/data/SVGPathSegArcImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegArcImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegArcImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegCurvetoCubicImpl.lut.h b/ksvg/data/SVGPathSegCurvetoCubicImpl.lut.h
index bf65567a..e61d4d1d 100644
--- a/ksvg/data/SVGPathSegCurvetoCubicImpl.lut.h
+++ b/ksvg/data/SVGPathSegCurvetoCubicImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegCurvetoCubicImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegCurvetoCubicImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegCurvetoCubicSmoothImpl.lut.h b/ksvg/data/SVGPathSegCurvetoCubicSmoothImpl.lut.h
index e7a6e880..3f3342df 100644
--- a/ksvg/data/SVGPathSegCurvetoCubicSmoothImpl.lut.h
+++ b/ksvg/data/SVGPathSegCurvetoCubicSmoothImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegCurvetoCubicSmoothImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegCurvetoCubicSmoothImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegCurvetoQuadraticImpl.lut.h b/ksvg/data/SVGPathSegCurvetoQuadraticImpl.lut.h
index ed6b4903..555a5307 100644
--- a/ksvg/data/SVGPathSegCurvetoQuadraticImpl.lut.h
+++ b/ksvg/data/SVGPathSegCurvetoQuadraticImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegCurvetoQuadraticImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegCurvetoQuadraticImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h b/ksvg/data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h
index 700ef0a0..33a53595 100644
--- a/ksvg/data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h
+++ b/ksvg/data/SVGPathSegCurvetoQuadraticSmoothImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegCurvetoQuadraticSmoothImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegCurvetoQuadraticSmoothImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegImpl.lut.h b/ksvg/data/SVGPathSegImpl.lut.h
index 237e1cb6..fceba663 100644
--- a/ksvg/data/SVGPathSegImpl.lut.h
+++ b/ksvg/data/SVGPathSegImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegLinetoHorizontalImpl.lut.h b/ksvg/data/SVGPathSegLinetoHorizontalImpl.lut.h
index 471f1b8f..2296650c 100644
--- a/ksvg/data/SVGPathSegLinetoHorizontalImpl.lut.h
+++ b/ksvg/data/SVGPathSegLinetoHorizontalImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegLinetoHorizontalImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegLinetoHorizontalImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegLinetoImpl.lut.h b/ksvg/data/SVGPathSegLinetoImpl.lut.h
index 482e1cd6..ab7616ae 100644
--- a/ksvg/data/SVGPathSegLinetoImpl.lut.h
+++ b/ksvg/data/SVGPathSegLinetoImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegLinetoImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegLinetoImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegLinetoVerticalImpl.lut.h b/ksvg/data/SVGPathSegLinetoVerticalImpl.lut.h
index 73c92d48..fa266b85 100644
--- a/ksvg/data/SVGPathSegLinetoVerticalImpl.lut.h
+++ b/ksvg/data/SVGPathSegLinetoVerticalImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegLinetoVerticalImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegLinetoVerticalImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegListImpl.lut.h b/ksvg/data/SVGPathSegListImpl.lut.h
index c0a16ee2..7ad127f3 100644
--- a/ksvg/data/SVGPathSegListImpl.lut.h
+++ b/ksvg/data/SVGPathSegListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPathSegMovetoImpl.lut.h b/ksvg/data/SVGPathSegMovetoImpl.lut.h
index bdefa143..74c86427 100644
--- a/ksvg/data/SVGPathSegMovetoImpl.lut.h
+++ b/ksvg/data/SVGPathSegMovetoImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPathSegMovetoImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPathSegMovetoImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPatternElementImpl.lut.h b/ksvg/data/SVGPatternElementImpl.lut.h
index c4a5958a..9413e41e 100644
--- a/ksvg/data/SVGPatternElementImpl.lut.h
+++ b/ksvg/data/SVGPatternElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPatternElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPatternElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPointImpl.lut.h b/ksvg/data/SVGPointImpl.lut.h
index c4b3c31d..98683b4a 100644
--- a/ksvg/data/SVGPointImpl.lut.h
+++ b/ksvg/data/SVGPointImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPointImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPointImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPointListImpl.lut.h b/ksvg/data/SVGPointListImpl.lut.h
index d693900a..f7506e36 100644
--- a/ksvg/data/SVGPointListImpl.lut.h
+++ b/ksvg/data/SVGPointListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPointListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPointListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGPreserveAspectRatioImpl.lut.h b/ksvg/data/SVGPreserveAspectRatioImpl.lut.h
index 944fe692..080a796a 100644
--- a/ksvg/data/SVGPreserveAspectRatioImpl.lut.h
+++ b/ksvg/data/SVGPreserveAspectRatioImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGPreserveAspectRatioImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGPreserveAspectRatioImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGRadialGradientElementImpl.lut.h b/ksvg/data/SVGRadialGradientElementImpl.lut.h
index 0cada147..dc927ea4 100644
--- a/ksvg/data/SVGRadialGradientElementImpl.lut.h
+++ b/ksvg/data/SVGRadialGradientElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGRadialGradientElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGRadialGradientElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGRectElementImpl.lut.h b/ksvg/data/SVGRectElementImpl.lut.h
index a20e808e..d0df0902 100644
--- a/ksvg/data/SVGRectElementImpl.lut.h
+++ b/ksvg/data/SVGRectElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGRectElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGRectElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGRectImpl.lut.h b/ksvg/data/SVGRectImpl.lut.h
index 9480824a..c92d6f59 100644
--- a/ksvg/data/SVGRectImpl.lut.h
+++ b/ksvg/data/SVGRectImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGRectImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGRectImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGSVGElementImpl.lut.h b/ksvg/data/SVGSVGElementImpl.lut.h
index 9666e6f9..a3774004 100644
--- a/ksvg/data/SVGSVGElementImpl.lut.h
+++ b/ksvg/data/SVGSVGElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGSVGElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGSVGElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGScriptElementImpl.lut.h b/ksvg/data/SVGScriptElementImpl.lut.h
index af7c480b..175d43a5 100644
--- a/ksvg/data/SVGScriptElementImpl.lut.h
+++ b/ksvg/data/SVGScriptElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGScriptElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGScriptElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGStopElementImpl.lut.h b/ksvg/data/SVGStopElementImpl.lut.h
index 9aa2ee3c..85f8467c 100644
--- a/ksvg/data/SVGStopElementImpl.lut.h
+++ b/ksvg/data/SVGStopElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGStopElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGStopElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGStringListImpl.lut.h b/ksvg/data/SVGStringListImpl.lut.h
index 84f734d6..a1e170d8 100644
--- a/ksvg/data/SVGStringListImpl.lut.h
+++ b/ksvg/data/SVGStringListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGStringListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGStringListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGStylableImpl.lut.h b/ksvg/data/SVGStylableImpl.lut.h
index 838001a7..4df9c0ed 100644
--- a/ksvg/data/SVGStylableImpl.lut.h
+++ b/ksvg/data/SVGStylableImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGStylableImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGStylableImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGStyleElementImpl.lut.h b/ksvg/data/SVGStyleElementImpl.lut.h
index 230402a9..2d06559a 100644
--- a/ksvg/data/SVGStyleElementImpl.lut.h
+++ b/ksvg/data/SVGStyleElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGStyleElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGStyleElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGSymbolElementImpl.lut.h b/ksvg/data/SVGSymbolElementImpl.lut.h
index 1b2b0888..b24274be 100644
--- a/ksvg/data/SVGSymbolElementImpl.lut.h
+++ b/ksvg/data/SVGSymbolElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGSymbolElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGSymbolElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTestsImpl.lut.h b/ksvg/data/SVGTestsImpl.lut.h
index 15bb4518..87bef91f 100644
--- a/ksvg/data/SVGTestsImpl.lut.h
+++ b/ksvg/data/SVGTestsImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTestsImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTestsImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTextContentElementImpl.lut.h b/ksvg/data/SVGTextContentElementImpl.lut.h
index a8710d9a..7a122dc7 100644
--- a/ksvg/data/SVGTextContentElementImpl.lut.h
+++ b/ksvg/data/SVGTextContentElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTextContentElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTextContentElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTextPathElementImpl.lut.h b/ksvg/data/SVGTextPathElementImpl.lut.h
index d9986d91..9ec2dd2c 100644
--- a/ksvg/data/SVGTextPathElementImpl.lut.h
+++ b/ksvg/data/SVGTextPathElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTextPathElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTextPathElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTextPositioningElementImpl.lut.h b/ksvg/data/SVGTextPositioningElementImpl.lut.h
index 77f6dae3..cf37e411 100644
--- a/ksvg/data/SVGTextPositioningElementImpl.lut.h
+++ b/ksvg/data/SVGTextPositioningElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTextPositioningElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTextPositioningElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTransformImpl.lut.h b/ksvg/data/SVGTransformImpl.lut.h
index 50a5c7dd..75c5659f 100644
--- a/ksvg/data/SVGTransformImpl.lut.h
+++ b/ksvg/data/SVGTransformImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTransformImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTransformImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTransformListImpl.lut.h b/ksvg/data/SVGTransformListImpl.lut.h
index 25af98e8..c7d2b7cd 100644
--- a/ksvg/data/SVGTransformListImpl.lut.h
+++ b/ksvg/data/SVGTransformListImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTransformListImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTransformListImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGTransformableImpl.lut.h b/ksvg/data/SVGTransformableImpl.lut.h
index 39dada09..f8573852 100644
--- a/ksvg/data/SVGTransformableImpl.lut.h
+++ b/ksvg/data/SVGTransformableImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGTransformableImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGTransformableImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGURIReferenceImpl.lut.h b/ksvg/data/SVGURIReferenceImpl.lut.h
index 7df7ccb4..053deb47 100644
--- a/ksvg/data/SVGURIReferenceImpl.lut.h
+++ b/ksvg/data/SVGURIReferenceImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGURIReferenceImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGURIReferenceImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGUseElementImpl.lut.h b/ksvg/data/SVGUseElementImpl.lut.h
index fe27d2b8..daad02bc 100644
--- a/ksvg/data/SVGUseElementImpl.lut.h
+++ b/ksvg/data/SVGUseElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGUseElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGUseElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGViewElementImpl.lut.h b/ksvg/data/SVGViewElementImpl.lut.h
index 2a40c677..666a4aa4 100644
--- a/ksvg/data/SVGViewElementImpl.lut.h
+++ b/ksvg/data/SVGViewElementImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGViewElementImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGViewElementImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGZoomAndPanImpl.lut.h b/ksvg/data/SVGZoomAndPanImpl.lut.h
index 80a647a6..71e3bba5 100644
--- a/ksvg/data/SVGZoomAndPanImpl.lut.h
+++ b/ksvg/data/SVGZoomAndPanImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGZoomAndPanImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGZoomAndPanImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/data/SVGZoomEventImpl.lut.h b/ksvg/data/SVGZoomEventImpl.lut.h
index 2b927ca3..29464130 100644
--- a/ksvg/data/SVGZoomEventImpl.lut.h
+++ b/ksvg/data/SVGZoomEventImpl.lut.h
@@ -1,4 +1,4 @@
-/* Automatically generated from impl/SVGZoomEventImpl.cc using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
+/* Automatically generated from impl/SVGZoomEventImpl.cpp using ../../tdelibs/kjs/create_hash_table. DO NOT EDIT ! */
using namespace KJS;
diff --git a/ksvg/dom/CMakeLists.txt b/ksvg/dom/CMakeLists.txt
index 8d6658e9..08f0ab03 100644
--- a/ksvg/dom/CMakeLists.txt
+++ b/ksvg/dom/CMakeLists.txt
@@ -76,50 +76,50 @@ install( FILES
tde_add_library( ksvgdom STATIC_PIC
SOURCES
- SVGLength.cc SVGAnimatedLength.cc SVGNumber.cc SVGAnimatedNumber.cc
- SVGPoint.cc SVGTSpanElement.cc SVGTRefElement.cc SVGAnimatedLengthList.cc
- SVGAnimatedNumberList.cc SVGTransformList.cc SVGAElement.cc
- SVGAnimatedTransformList.cc SVGRectElement.cc SVGCircleElement.cc
- SVGEllipseElement.cc SVGLineElement.cc SVGPolylineElement.cc
- SVGPolygonElement.cc SVGTextPositioningElement.cc SVGTextContentElement.cc
- SVGTextElement.cc SVGImageElement.cc SVGUseElement.cc SVGMatrix.cc
- SVGTransform.cc SVGPointList.cc SVGDocument.cc SVGAnimatedEnumeration.cc
- SVGDefsElement.cc SVGLocatable.cc SVGTransformable.cc SVGStylable.cc
- SVGGElement.cc SVGAngle.cc SVGAnimatedAngle.cc SVGColor.cc SVGPathElement.cc
- SVGPathSegList.cc SVGTests.cc SVGLangSpace.cc SVGStringList.cc SVGPathSeg.cc
- SVGPathSegClosePath.cc SVGPathSegMoveto.cc SVGPathSegLinetoHorizontal.cc
- SVGPathSegLinetoVertical.cc SVGPathSegLineto.cc SVGPathSegCurvetoCubic.cc
- SVGDescElement.cc SVGTitleElement.cc SVGExternalResourcesRequired.cc
- SVGAnimatedBoolean.cc SVGNumberList.cc SVGPathSegCurvetoCubicSmooth.cc
- SVGPathSegCurvetoQuadratic.cc SVGAnimatedRect.cc SVGAnimatedString.cc
- SVGPathSegCurvetoQuadraticSmooth.cc SVGPathSegArc.cc SVGURIReference.cc
- SVGAnimatedInteger.cc SVGLengthList.cc SVGSVGElement.cc SVGRect.cc
- SVGFitToViewBox.cc SVGAnimatedPreserveAspectRatio.cc SVGPreserveAspectRatio.cc
- SVGElement.cc SVGStyleElement.cc SVGClipPathElement.cc SVGMaskElement.cc
- SVGColorProfileElement.cc SVGColorProfileRule.cc SVGZoomAndPan.cc
- SVGScriptElement.cc SVGSwitchElement.cc SVGSymbolElement.cc
- SVGDefinitionSrcElement.cc SVGFontFaceElement.cc SVGFontFaceFormatElement.cc
- SVGFontFaceNameElement.cc SVGFontFaceSrcElement.cc SVGHKernElement.cc
- SVGMetadataElement.cc SVGVKernElement.cc SVGCursorElement.cc
- SVGForeignObjectElement.cc SVGFontFaceUriElement.cc SVGElementInstance.cc
- SVGElementInstanceList.cc SVGAnimatedPoints.cc SVGAnimatedPathData.cc
- SVGMarkerElement.cc SVGViewSpec.cc SVGViewElement.cc SVGFilterElement.cc
- SVGFilterPrimitiveStandardAttributes.cc SVGFEBlendElement.cc
- SVGFEColorMatrixElement.cc SVGFEComponentTransferElement.cc
- SVGComponentTransferFunctionElement.cc SVGFEFuncAElement.cc
- SVGFEFuncBElement.cc SVGFEFuncGElement.cc SVGFEFuncRElement.cc
- SVGFECompositeElement.cc SVGFEConvolveMatrixElement.cc SVGFEFloodElement.cc
- SVGFEGaussianBlurElement.cc SVGFEDiffuseLightingElement.cc
- SVGFEDistantLightElement.cc SVGFEPointLightElement.cc
- SVGFESpotLightElement.cc SVGFEDisplacementMapElement.cc SVGFEMergeElement.cc
- SVGFEMergeNodeElement.cc SVGFEImageElement.cc SVGFEMorphologyElement.cc
- SVGFEOffsetElement.cc SVGFESpecularLightingElement.cc SVGFETileElement.cc
- SVGFETurbulenceElement.cc SVGAnimationElement.cc SVGAnimateElement.cc
- SVGSetElement.cc SVGAnimateMotionElement.cc SVGAnimateColorElement.cc
- SVGAnimateTransformElement.cc SVGEvent.cc SVGZoomEvent.cc SVGICCColor.cc
- SVGCSSRule.cc SVGGradientElement.cc SVGRadialGradientElement.cc
- SVGLinearGradientElement.cc SVGStopElement.cc SVGPatternElement.cc
- SVGMPathElement.cc SVGFontElement.cc SVGAltGlyphElement.cc
- SVGGlyphRefElement.cc SVGAltGlyphDefElement.cc SVGGlyphElement.cc
- SVGMissingGlyphElement.cc SVGPaint.cc SVGTextPathElement.cc SVGWindow.cc
+ SVGLength.cpp SVGAnimatedLength.cpp SVGNumber.cpp SVGAnimatedNumber.cpp
+ SVGPoint.cpp SVGTSpanElement.cpp SVGTRefElement.cpp SVGAnimatedLengthList.cpp
+ SVGAnimatedNumberList.cpp SVGTransformList.cpp SVGAElement.cpp
+ SVGAnimatedTransformList.cpp SVGRectElement.cpp SVGCircleElement.cpp
+ SVGEllipseElement.cpp SVGLineElement.cpp SVGPolylineElement.cpp
+ SVGPolygonElement.cpp SVGTextPositioningElement.cpp SVGTextContentElement.cpp
+ SVGTextElement.cpp SVGImageElement.cpp SVGUseElement.cpp SVGMatrix.cpp
+ SVGTransform.cpp SVGPointList.cpp SVGDocument.cpp SVGAnimatedEnumeration.cpp
+ SVGDefsElement.cpp SVGLocatable.cpp SVGTransformable.cpp SVGStylable.cpp
+ SVGGElement.cpp SVGAngle.cpp SVGAnimatedAngle.cpp SVGColor.cpp SVGPathElement.cpp
+ SVGPathSegList.cpp SVGTests.cpp SVGLangSpace.cpp SVGStringList.cpp SVGPathSeg.cpp
+ SVGPathSegClosePath.cpp SVGPathSegMoveto.cpp SVGPathSegLinetoHorizontal.cpp
+ SVGPathSegLinetoVertical.cpp SVGPathSegLineto.cpp SVGPathSegCurvetoCubic.cpp
+ SVGDescElement.cpp SVGTitleElement.cpp SVGExternalResourcesRequired.cpp
+ SVGAnimatedBoolean.cpp SVGNumberList.cpp SVGPathSegCurvetoCubicSmooth.cpp
+ SVGPathSegCurvetoQuadratic.cpp SVGAnimatedRect.cpp SVGAnimatedString.cpp
+ SVGPathSegCurvetoQuadraticSmooth.cpp SVGPathSegArc.cpp SVGURIReference.cpp
+ SVGAnimatedInteger.cpp SVGLengthList.cpp SVGSVGElement.cpp SVGRect.cpp
+ SVGFitToViewBox.cpp SVGAnimatedPreserveAspectRatio.cpp SVGPreserveAspectRatio.cpp
+ SVGElement.cpp SVGStyleElement.cpp SVGClipPathElement.cpp SVGMaskElement.cpp
+ SVGColorProfileElement.cpp SVGColorProfileRule.cpp SVGZoomAndPan.cpp
+ SVGScriptElement.cpp SVGSwitchElement.cpp SVGSymbolElement.cpp
+ SVGDefinitionSrcElement.cpp SVGFontFaceElement.cpp SVGFontFaceFormatElement.cpp
+ SVGFontFaceNameElement.cpp SVGFontFaceSrcElement.cpp SVGHKernElement.cpp
+ SVGMetadataElement.cpp SVGVKernElement.cpp SVGCursorElement.cpp
+ SVGForeignObjectElement.cpp SVGFontFaceUriElement.cpp SVGElementInstance.cpp
+ SVGElementInstanceList.cpp SVGAnimatedPoints.cpp SVGAnimatedPathData.cpp
+ SVGMarkerElement.cpp SVGViewSpec.cpp SVGViewElement.cpp SVGFilterElement.cpp
+ SVGFilterPrimitiveStandardAttributes.cpp SVGFEBlendElement.cpp
+ SVGFEColorMatrixElement.cpp SVGFEComponentTransferElement.cpp
+ SVGComponentTransferFunctionElement.cpp SVGFEFuncAElement.cpp
+ SVGFEFuncBElement.cpp SVGFEFuncGElement.cpp SVGFEFuncRElement.cpp
+ SVGFECompositeElement.cpp SVGFEConvolveMatrixElement.cpp SVGFEFloodElement.cpp
+ SVGFEGaussianBlurElement.cpp SVGFEDiffuseLightingElement.cpp
+ SVGFEDistantLightElement.cpp SVGFEPointLightElement.cpp
+ SVGFESpotLightElement.cpp SVGFEDisplacementMapElement.cpp SVGFEMergeElement.cpp
+ SVGFEMergeNodeElement.cpp SVGFEImageElement.cpp SVGFEMorphologyElement.cpp
+ SVGFEOffsetElement.cpp SVGFESpecularLightingElement.cpp SVGFETileElement.cpp
+ SVGFETurbulenceElement.cpp SVGAnimationElement.cpp SVGAnimateElement.cpp
+ SVGSetElement.cpp SVGAnimateMotionElement.cpp SVGAnimateColorElement.cpp
+ SVGAnimateTransformElement.cpp SVGEvent.cpp SVGZoomEvent.cpp SVGICCColor.cpp
+ SVGCSSRule.cpp SVGGradientElement.cpp SVGRadialGradientElement.cpp
+ SVGLinearGradientElement.cpp SVGStopElement.cpp SVGPatternElement.cpp
+ SVGMPathElement.cpp SVGFontElement.cpp SVGAltGlyphElement.cpp
+ SVGGlyphRefElement.cpp SVGAltGlyphDefElement.cpp SVGGlyphElement.cpp
+ SVGMissingGlyphElement.cpp SVGPaint.cpp SVGTextPathElement.cpp SVGWindow.cpp
)
diff --git a/ksvg/dom/Makefile.am b/ksvg/dom/Makefile.am
index 9b6b1cf7..7c51c022 100644
--- a/ksvg/dom/Makefile.am
+++ b/ksvg/dom/Makefile.am
@@ -31,27 +31,27 @@ myinclude_HEADERS = SVGAElement.h SVGAltGlyphElement.h SVGAltGlyphDefElement.h S
SVGTitleElement.h SVGTransform.h SVGTransformList.h SVGTransformable.h SVGURIReference.h SVGUnitTypes.h \
SVGUseElement.h SVGVKernElement.h SVGViewElement.h SVGViewSpec.h SVGWindow.h SVGZoomAndPan.h SVGZoomEvent.h
-libksvgdom_la_SOURCES = SVGLength.cc SVGAnimatedLength.cc SVGNumber.cc SVGAnimatedNumber.cc SVGPoint.cc SVGTSpanElement.cc SVGTRefElement.cc \
- SVGAnimatedLengthList.cc SVGAnimatedNumberList.cc SVGTransformList.cc SVGAElement.cc SVGAnimatedTransformList.cc \
- SVGRectElement.cc SVGCircleElement.cc SVGEllipseElement.cc SVGLineElement.cc SVGPolylineElement.cc SVGPolygonElement.cc \
- SVGTextPositioningElement.cc SVGTextContentElement.cc SVGTextElement.cc SVGImageElement.cc SVGUseElement.cc \
- SVGMatrix.cc SVGTransform.cc SVGPointList.cc SVGDocument.cc SVGAnimatedEnumeration.cc SVGDefsElement.cc \
- SVGLocatable.cc SVGTransformable.cc SVGStylable.cc SVGGElement.cc SVGAngle.cc SVGAnimatedAngle.cc \
- SVGColor.cc SVGPathElement.cc SVGPathSegList.cc SVGTests.cc SVGLangSpace.cc SVGStringList.cc \
- SVGPathSeg.cc SVGPathSegClosePath.cc SVGPathSegMoveto.cc SVGPathSegLinetoHorizontal.cc SVGPathSegLinetoVertical.cc SVGPathSegLineto.cc \
- SVGPathSegCurvetoCubic.cc SVGDescElement.cc SVGTitleElement.cc SVGExternalResourcesRequired.cc SVGAnimatedBoolean.cc SVGNumberList.cc \
- SVGPathSegCurvetoCubicSmooth.cc SVGPathSegCurvetoQuadratic.cc SVGAnimatedRect.cc SVGAnimatedString.cc \
- SVGPathSegCurvetoQuadraticSmooth.cc SVGPathSegArc.cc SVGURIReference.cc SVGAnimatedInteger.cc SVGLengthList.cc \
- SVGSVGElement.cc SVGRect.cc SVGFitToViewBox.cc SVGAnimatedPreserveAspectRatio.cc SVGPreserveAspectRatio.cc SVGElement.cc \
- SVGStyleElement.cc SVGClipPathElement.cc SVGMaskElement.cc SVGColorProfileElement.cc SVGColorProfileRule.cc SVGZoomAndPan.cc SVGScriptElement.cc \
- SVGSwitchElement.cc SVGSymbolElement.cc \
- SVGDefinitionSrcElement.cc SVGFontFaceElement.cc SVGFontFaceFormatElement.cc SVGFontFaceNameElement.cc SVGFontFaceSrcElement.cc SVGHKernElement.cc SVGMetadataElement.cc SVGVKernElement.cc SVGCursorElement.cc SVGForeignObjectElement.cc SVGFontFaceUriElement.cc \
- SVGElementInstance.cc SVGElementInstanceList.cc SVGAnimatedPoints.cc SVGAnimatedPathData.cc SVGMarkerElement.cc SVGViewSpec.cc SVGViewElement.cc \
- SVGFilterElement.cc SVGFilterPrimitiveStandardAttributes.cc SVGFEBlendElement.cc SVGFEColorMatrixElement.cc SVGFEComponentTransferElement.cc SVGComponentTransferFunctionElement.cc SVGFEFuncAElement.cc SVGFEFuncBElement.cc SVGFEFuncGElement.cc SVGFEFuncRElement.cc SVGFECompositeElement.cc SVGFEConvolveMatrixElement.cc SVGFEFloodElement.cc SVGFEGaussianBlurElement.cc SVGFEDiffuseLightingElement.cc SVGFEDistantLightElement.cc SVGFEPointLightElement.cc SVGFESpotLightElement.cc SVGFEDisplacementMapElement.cc SVGFEMergeElement.cc SVGFEMergeNodeElement.cc SVGFEImageElement.cc SVGFEMorphologyElement.cc SVGFEOffsetElement.cc SVGFESpecularLightingElement.cc SVGFETileElement.cc SVGFETurbulenceElement.cc \
- SVGAnimationElement.cc SVGAnimateElement.cc SVGSetElement.cc SVGAnimateMotionElement.cc SVGAnimateColorElement.cc SVGAnimateTransformElement.cc \
- SVGEvent.cc SVGZoomEvent.cc SVGICCColor.cc SVGCSSRule.cc \
- SVGGradientElement.cc SVGRadialGradientElement.cc SVGLinearGradientElement.cc SVGStopElement.cc SVGPatternElement.cc SVGMPathElement.cc \
- SVGFontElement.cc SVGAltGlyphElement.cc SVGGlyphRefElement.cc SVGAltGlyphDefElement.cc SVGGlyphElement.cc SVGMissingGlyphElement.cc SVGPaint.cc SVGTextPathElement.cc SVGWindow.cc
+libksvgdom_la_SOURCES = SVGLength.cpp SVGAnimatedLength.cpp SVGNumber.cpp SVGAnimatedNumber.cpp SVGPoint.cpp SVGTSpanElement.cpp SVGTRefElement.cpp \
+ SVGAnimatedLengthList.cpp SVGAnimatedNumberList.cpp SVGTransformList.cpp SVGAElement.cpp SVGAnimatedTransformList.cpp \
+ SVGRectElement.cpp SVGCircleElement.cpp SVGEllipseElement.cpp SVGLineElement.cpp SVGPolylineElement.cpp SVGPolygonElement.cpp \
+ SVGTextPositioningElement.cpp SVGTextContentElement.cpp SVGTextElement.cpp SVGImageElement.cpp SVGUseElement.cpp \
+ SVGMatrix.cpp SVGTransform.cpp SVGPointList.cpp SVGDocument.cpp SVGAnimatedEnumeration.cpp SVGDefsElement.cpp \
+ SVGLocatable.cpp SVGTransformable.cpp SVGStylable.cpp SVGGElement.cpp SVGAngle.cpp SVGAnimatedAngle.cpp \
+ SVGColor.cpp SVGPathElement.cpp SVGPathSegList.cpp SVGTests.cpp SVGLangSpace.cpp SVGStringList.cpp \
+ SVGPathSeg.cpp SVGPathSegClosePath.cpp SVGPathSegMoveto.cpp SVGPathSegLinetoHorizontal.cpp SVGPathSegLinetoVertical.cpp SVGPathSegLineto.cpp \
+ SVGPathSegCurvetoCubic.cpp SVGDescElement.cpp SVGTitleElement.cpp SVGExternalResourcesRequired.cpp SVGAnimatedBoolean.cpp SVGNumberList.cpp \
+ SVGPathSegCurvetoCubicSmooth.cpp SVGPathSegCurvetoQuadratic.cpp SVGAnimatedRect.cpp SVGAnimatedString.cpp \
+ SVGPathSegCurvetoQuadraticSmooth.cpp SVGPathSegArc.cpp SVGURIReference.cpp SVGAnimatedInteger.cpp SVGLengthList.cpp \
+ SVGSVGElement.cpp SVGRect.cpp SVGFitToViewBox.cpp SVGAnimatedPreserveAspectRatio.cpp SVGPreserveAspectRatio.cpp SVGElement.cpp \
+ SVGStyleElement.cpp SVGClipPathElement.cpp SVGMaskElement.cpp SVGColorProfileElement.cpp SVGColorProfileRule.cpp SVGZoomAndPan.cpp SVGScriptElement.cpp \
+ SVGSwitchElement.cpp SVGSymbolElement.cpp \
+ SVGDefinitionSrcElement.cpp SVGFontFaceElement.cpp SVGFontFaceFormatElement.cpp SVGFontFaceNameElement.cpp SVGFontFaceSrcElement.cpp SVGHKernElement.cpp SVGMetadataElement.cpp SVGVKernElement.cpp SVGCursorElement.cpp SVGForeignObjectElement.cpp SVGFontFaceUriElement.cpp \
+ SVGElementInstance.cpp SVGElementInstanceList.cpp SVGAnimatedPoints.cpp SVGAnimatedPathData.cpp SVGMarkerElement.cpp SVGViewSpec.cpp SVGViewElement.cpp \
+ SVGFilterElement.cpp SVGFilterPrimitiveStandardAttributes.cpp SVGFEBlendElement.cpp SVGFEColorMatrixElement.cpp SVGFEComponentTransferElement.cpp SVGComponentTransferFunctionElement.cpp SVGFEFuncAElement.cpp SVGFEFuncBElement.cpp SVGFEFuncGElement.cpp SVGFEFuncRElement.cpp SVGFECompositeElement.cpp SVGFEConvolveMatrixElement.cpp SVGFEFloodElement.cpp SVGFEGaussianBlurElement.cpp SVGFEDiffuseLightingElement.cpp SVGFEDistantLightElement.cpp SVGFEPointLightElement.cpp SVGFESpotLightElement.cpp SVGFEDisplacementMapElement.cpp SVGFEMergeElement.cpp SVGFEMergeNodeElement.cpp SVGFEImageElement.cpp SVGFEMorphologyElement.cpp SVGFEOffsetElement.cpp SVGFESpecularLightingElement.cpp SVGFETileElement.cpp SVGFETurbulenceElement.cpp \
+ SVGAnimationElement.cpp SVGAnimateElement.cpp SVGSetElement.cpp SVGAnimateMotionElement.cpp SVGAnimateColorElement.cpp SVGAnimateTransformElement.cpp \
+ SVGEvent.cpp SVGZoomEvent.cpp SVGICCColor.cpp SVGCSSRule.cpp \
+ SVGGradientElement.cpp SVGRadialGradientElement.cpp SVGLinearGradientElement.cpp SVGStopElement.cpp SVGPatternElement.cpp SVGMPathElement.cpp \
+ SVGFontElement.cpp SVGAltGlyphElement.cpp SVGGlyphRefElement.cpp SVGAltGlyphDefElement.cpp SVGGlyphElement.cpp SVGMissingGlyphElement.cpp SVGPaint.cpp SVGTextPathElement.cpp SVGWindow.cpp
libksvgdom_la_METASOURCES = AUTO
diff --git a/ksvg/dom/SVGAElement.cc b/ksvg/dom/SVGAElement.cc
deleted file mode 100644
index a4d7d5b1..00000000
--- a/ksvg/dom/SVGAElement.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAElement.h"
-#include "SVGAElementImpl.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGAElement::SVGAElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGURIReference()
-{
- impl = 0;
-}
-
-SVGAElement::SVGAElement(const SVGAElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAElement &SVGAElement::operator=(const SVGAElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAElement::SVGAElement(SVGAElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAElement::~SVGAElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGAElement::target() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->target());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAElement.cpp b/ksvg/dom/SVGAElement.cpp
new file mode 100644
index 00000000..de7b1a20
--- /dev/null
+++ b/ksvg/dom/SVGAElement.cpp
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAElement.h"
+#include "SVGAElementImpl.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGAElement::SVGAElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGURIReference()
+{
+ impl = 0;
+}
+
+SVGAElement::SVGAElement(const SVGAElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAElement &SVGAElement::operator=(const SVGAElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAElement::SVGAElement(SVGAElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAElement::~SVGAElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGAElement::target() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->target());
+}
diff --git a/ksvg/dom/SVGAElement.h b/ksvg/dom/SVGAElement.h
index 98b0f54e..d74d2b05 100644
--- a/ksvg/dom/SVGAElement.h
+++ b/ksvg/dom/SVGAElement.h
@@ -61,4 +61,3 @@ private:
}
#endif
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAltGlyphDefElement.cc b/ksvg/dom/SVGAltGlyphDefElement.cc
deleted file mode 100644
index f150b982..00000000
--- a/ksvg/dom/SVGAltGlyphDefElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAltGlyphDefElement.h"
-#include "SVGAltGlyphDefElementImpl.h"
-
-using namespace KSVG;
-
-SVGAltGlyphDefElement::SVGAltGlyphDefElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGAltGlyphDefElement::SVGAltGlyphDefElement(const SVGAltGlyphDefElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAltGlyphDefElement &SVGAltGlyphDefElement::operator=(const SVGAltGlyphDefElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAltGlyphDefElement::SVGAltGlyphDefElement(SVGAltGlyphDefElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAltGlyphDefElement::~SVGAltGlyphDefElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAltGlyphDefElement.cpp b/ksvg/dom/SVGAltGlyphDefElement.cpp
new file mode 100644
index 00000000..caeddbd9
--- /dev/null
+++ b/ksvg/dom/SVGAltGlyphDefElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAltGlyphDefElement.h"
+#include "SVGAltGlyphDefElementImpl.h"
+
+using namespace KSVG;
+
+SVGAltGlyphDefElement::SVGAltGlyphDefElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGAltGlyphDefElement::SVGAltGlyphDefElement(const SVGAltGlyphDefElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAltGlyphDefElement &SVGAltGlyphDefElement::operator=(const SVGAltGlyphDefElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAltGlyphDefElement::SVGAltGlyphDefElement(SVGAltGlyphDefElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAltGlyphDefElement::~SVGAltGlyphDefElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGAltGlyphDefElement.h b/ksvg/dom/SVGAltGlyphDefElement.h
index c0672cf6..691c9a18 100644
--- a/ksvg/dom/SVGAltGlyphDefElement.h
+++ b/ksvg/dom/SVGAltGlyphDefElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAltGlyphElement.cc b/ksvg/dom/SVGAltGlyphElement.cc
deleted file mode 100644
index 33877a74..00000000
--- a/ksvg/dom/SVGAltGlyphElement.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAltGlyphElement.h"
-#include "SVGAltGlyphElementImpl.h"
-
-using namespace KSVG;
-
-SVGAltGlyphElement::SVGAltGlyphElement() : SVGTextPositioningElement(), SVGURIReference()
-{
- impl = 0;
-}
-
-SVGAltGlyphElement::SVGAltGlyphElement(const SVGAltGlyphElement &other) : SVGTextPositioningElement(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAltGlyphElement &SVGAltGlyphElement::operator=(const SVGAltGlyphElement &other)
-{
- SVGTextPositioningElement::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAltGlyphElement::SVGAltGlyphElement(SVGAltGlyphElementImpl *other) : SVGTextPositioningElement(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAltGlyphElement::~SVGAltGlyphElement()
-{
- if(impl)
- impl->deref();
-}
-
-DOM::DOMString SVGAltGlyphElement::format()
-{
- if(!impl) return DOM::DOMString();
- return impl->format();
-}
-
-DOM::DOMString SVGAltGlyphElement::glyphRef()
-{
- if(!impl) return DOM::DOMString();
- return impl->glyphRef();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAltGlyphElement.cpp b/ksvg/dom/SVGAltGlyphElement.cpp
new file mode 100644
index 00000000..c21d7623
--- /dev/null
+++ b/ksvg/dom/SVGAltGlyphElement.cpp
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAltGlyphElement.h"
+#include "SVGAltGlyphElementImpl.h"
+
+using namespace KSVG;
+
+SVGAltGlyphElement::SVGAltGlyphElement() : SVGTextPositioningElement(), SVGURIReference()
+{
+ impl = 0;
+}
+
+SVGAltGlyphElement::SVGAltGlyphElement(const SVGAltGlyphElement &other) : SVGTextPositioningElement(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAltGlyphElement &SVGAltGlyphElement::operator=(const SVGAltGlyphElement &other)
+{
+ SVGTextPositioningElement::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAltGlyphElement::SVGAltGlyphElement(SVGAltGlyphElementImpl *other) : SVGTextPositioningElement(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAltGlyphElement::~SVGAltGlyphElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+DOM::DOMString SVGAltGlyphElement::format()
+{
+ if(!impl) return DOM::DOMString();
+ return impl->format();
+}
+
+DOM::DOMString SVGAltGlyphElement::glyphRef()
+{
+ if(!impl) return DOM::DOMString();
+ return impl->glyphRef();
+}
diff --git a/ksvg/dom/SVGAltGlyphElement.h b/ksvg/dom/SVGAltGlyphElement.h
index 191c67fe..cff143aa 100644
--- a/ksvg/dom/SVGAltGlyphElement.h
+++ b/ksvg/dom/SVGAltGlyphElement.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAngle.cc b/ksvg/dom/SVGAngle.cc
deleted file mode 100644
index c3cb1fae..00000000
--- a/ksvg/dom/SVGAngle.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAngle.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-SVGAngle::SVGAngle()
-{
- impl = new SVGAngleImpl();
- impl->ref();
-}
-
-SVGAngle::SVGAngle(const SVGAngle &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAngle &SVGAngle::operator =(const SVGAngle &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAngle::SVGAngle(SVGAngleImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAngle::~SVGAngle()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned short SVGAngle::unitType() const
-{
- if(!impl) return SVG_ANGLETYPE_UNKNOWN;
- return impl->unitType();
-}
-
-void SVGAngle::setValue(float value)
-{
- if(impl)
- impl->setValue(value);
-}
-
-float SVGAngle::value() const
-{
- if(!impl) return -1;
- return impl->value();
-}
-
-void SVGAngle::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
-{
- if(impl)
- impl->setValueInSpecifiedUnits(valueInSpecifiedUnits);
-}
-
-float SVGAngle::valueInSpecifiedUnits() const
-{
- if(!impl) return -1;
- return impl->valueInSpecifiedUnits();
-}
-
-void SVGAngle::setValueAsString(const DOM::DOMString &valueAsString)
-{
- if(impl)
- impl->setValueAsString(valueAsString);
-}
-
-DOM::DOMString SVGAngle::valueAsString() const
-{
- if(!impl) return DOM::DOMString();
- return impl->valueAsString();
-}
-
-void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
-{
- if(impl)
- impl->newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
-}
-
-void SVGAngle::convertToSpecifiedUnits(unsigned short unitType)
-{
- if(impl)
- impl->convertToSpecifiedUnits(unitType);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAngle.cpp b/ksvg/dom/SVGAngle.cpp
new file mode 100644
index 00000000..bb1aac60
--- /dev/null
+++ b/ksvg/dom/SVGAngle.cpp
@@ -0,0 +1,118 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAngle.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+SVGAngle::SVGAngle()
+{
+ impl = new SVGAngleImpl();
+ impl->ref();
+}
+
+SVGAngle::SVGAngle(const SVGAngle &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAngle &SVGAngle::operator =(const SVGAngle &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAngle::SVGAngle(SVGAngleImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAngle::~SVGAngle()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned short SVGAngle::unitType() const
+{
+ if(!impl) return SVG_ANGLETYPE_UNKNOWN;
+ return impl->unitType();
+}
+
+void SVGAngle::setValue(float value)
+{
+ if(impl)
+ impl->setValue(value);
+}
+
+float SVGAngle::value() const
+{
+ if(!impl) return -1;
+ return impl->value();
+}
+
+void SVGAngle::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
+{
+ if(impl)
+ impl->setValueInSpecifiedUnits(valueInSpecifiedUnits);
+}
+
+float SVGAngle::valueInSpecifiedUnits() const
+{
+ if(!impl) return -1;
+ return impl->valueInSpecifiedUnits();
+}
+
+void SVGAngle::setValueAsString(const DOM::DOMString &valueAsString)
+{
+ if(impl)
+ impl->setValueAsString(valueAsString);
+}
+
+DOM::DOMString SVGAngle::valueAsString() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->valueAsString();
+}
+
+void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
+{
+ if(impl)
+ impl->newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+}
+
+void SVGAngle::convertToSpecifiedUnits(unsigned short unitType)
+{
+ if(impl)
+ impl->convertToSpecifiedUnits(unitType);
+}
diff --git a/ksvg/dom/SVGAngle.h b/ksvg/dom/SVGAngle.h
index 9e301660..0c6af82a 100644
--- a/ksvg/dom/SVGAngle.h
+++ b/ksvg/dom/SVGAngle.h
@@ -70,5 +70,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateColorElement.cc b/ksvg/dom/SVGAnimateColorElement.cc
deleted file mode 100644
index 0090513f..00000000
--- a/ksvg/dom/SVGAnimateColorElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimateColorElement.h"
-#include "SVGAnimateColorElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateColorElement::SVGAnimateColorElement() : SVGAnimationElement()
-{
- impl = 0;
-}
-
-SVGAnimateColorElement::SVGAnimateColorElement(const SVGAnimateColorElement &other) : SVGAnimationElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimateColorElement &SVGAnimateColorElement::operator=(const SVGAnimateColorElement &other)
-{
- SVGAnimationElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimateColorElement::SVGAnimateColorElement(SVGAnimateColorElementImpl *other) : SVGAnimationElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimateColorElement::~SVGAnimateColorElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateColorElement.cpp b/ksvg/dom/SVGAnimateColorElement.cpp
new file mode 100644
index 00000000..32a5f153
--- /dev/null
+++ b/ksvg/dom/SVGAnimateColorElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimateColorElement.h"
+#include "SVGAnimateColorElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateColorElement::SVGAnimateColorElement() : SVGAnimationElement()
+{
+ impl = 0;
+}
+
+SVGAnimateColorElement::SVGAnimateColorElement(const SVGAnimateColorElement &other) : SVGAnimationElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimateColorElement &SVGAnimateColorElement::operator=(const SVGAnimateColorElement &other)
+{
+ SVGAnimationElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimateColorElement::SVGAnimateColorElement(SVGAnimateColorElementImpl *other) : SVGAnimationElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimateColorElement::~SVGAnimateColorElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGAnimateColorElement.h b/ksvg/dom/SVGAnimateColorElement.h
index 3e5d1616..d6cab055 100644
--- a/ksvg/dom/SVGAnimateColorElement.h
+++ b/ksvg/dom/SVGAnimateColorElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateElement.cc b/ksvg/dom/SVGAnimateElement.cc
deleted file mode 100644
index b0b4503e..00000000
--- a/ksvg/dom/SVGAnimateElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimateElement.h"
-#include "SVGAnimateElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateElement::SVGAnimateElement() : SVGAnimationElement()
-{
- impl = 0;
-}
-
-SVGAnimateElement::SVGAnimateElement(const SVGAnimateElement &other) : SVGAnimationElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimateElement &SVGAnimateElement::operator=(const SVGAnimateElement &other)
-{
- SVGAnimationElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimateElement::SVGAnimateElement(SVGAnimateElementImpl *other) : SVGAnimationElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimateElement::~SVGAnimateElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateElement.cpp b/ksvg/dom/SVGAnimateElement.cpp
new file mode 100644
index 00000000..1370b93d
--- /dev/null
+++ b/ksvg/dom/SVGAnimateElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimateElement.h"
+#include "SVGAnimateElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateElement::SVGAnimateElement() : SVGAnimationElement()
+{
+ impl = 0;
+}
+
+SVGAnimateElement::SVGAnimateElement(const SVGAnimateElement &other) : SVGAnimationElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimateElement &SVGAnimateElement::operator=(const SVGAnimateElement &other)
+{
+ SVGAnimationElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimateElement::SVGAnimateElement(SVGAnimateElementImpl *other) : SVGAnimationElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimateElement::~SVGAnimateElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGAnimateElement.h b/ksvg/dom/SVGAnimateElement.h
index 5856f9b2..43924d63 100644
--- a/ksvg/dom/SVGAnimateElement.h
+++ b/ksvg/dom/SVGAnimateElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateMotionElement.cc b/ksvg/dom/SVGAnimateMotionElement.cc
deleted file mode 100644
index f2758fe3..00000000
--- a/ksvg/dom/SVGAnimateMotionElement.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimateMotionElement.h"
-#include "SVGAnimateMotionElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateMotionElement::SVGAnimateMotionElement() : SVGAnimationElement()
-{
- impl = 0;
-}
-
-SVGAnimateMotionElement::SVGAnimateMotionElement(const SVGAnimateMotionElement &other) : SVGAnimationElement(), impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimateMotionElement &SVGAnimateMotionElement::operator =(const SVGAnimateMotionElement &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimateMotionElement::SVGAnimateMotionElement(SVGAnimateMotionElementImpl *other) : SVGAnimationElement()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimateMotionElement::~SVGAnimateMotionElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateMotionElement.cpp b/ksvg/dom/SVGAnimateMotionElement.cpp
new file mode 100644
index 00000000..8b1b7d2c
--- /dev/null
+++ b/ksvg/dom/SVGAnimateMotionElement.cpp
@@ -0,0 +1,63 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimateMotionElement.h"
+#include "SVGAnimateMotionElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateMotionElement::SVGAnimateMotionElement() : SVGAnimationElement()
+{
+ impl = 0;
+}
+
+SVGAnimateMotionElement::SVGAnimateMotionElement(const SVGAnimateMotionElement &other) : SVGAnimationElement(), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimateMotionElement &SVGAnimateMotionElement::operator =(const SVGAnimateMotionElement &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimateMotionElement::SVGAnimateMotionElement(SVGAnimateMotionElementImpl *other) : SVGAnimationElement()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimateMotionElement::~SVGAnimateMotionElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGAnimateMotionElement.h b/ksvg/dom/SVGAnimateMotionElement.h
index 62b477b0..60ce9e5e 100644
--- a/ksvg/dom/SVGAnimateMotionElement.h
+++ b/ksvg/dom/SVGAnimateMotionElement.h
@@ -43,5 +43,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateTransformElement.cc b/ksvg/dom/SVGAnimateTransformElement.cc
deleted file mode 100644
index 91bbb9a3..00000000
--- a/ksvg/dom/SVGAnimateTransformElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimateTransformElement.h"
-#include "SVGAnimateTransformElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateTransformElement::SVGAnimateTransformElement() : SVGAnimationElement()
-{
- impl = 0;
-}
-
-SVGAnimateTransformElement::SVGAnimateTransformElement(const SVGAnimateTransformElement &other) : SVGAnimationElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimateTransformElement &SVGAnimateTransformElement::operator=(const SVGAnimateTransformElement &other)
-{
- SVGAnimationElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimateTransformElement::SVGAnimateTransformElement(SVGAnimateTransformElementImpl *other) : SVGAnimationElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimateTransformElement::~SVGAnimateTransformElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimateTransformElement.cpp b/ksvg/dom/SVGAnimateTransformElement.cpp
new file mode 100644
index 00000000..3bc6a04b
--- /dev/null
+++ b/ksvg/dom/SVGAnimateTransformElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimateTransformElement.h"
+#include "SVGAnimateTransformElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateTransformElement::SVGAnimateTransformElement() : SVGAnimationElement()
+{
+ impl = 0;
+}
+
+SVGAnimateTransformElement::SVGAnimateTransformElement(const SVGAnimateTransformElement &other) : SVGAnimationElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimateTransformElement &SVGAnimateTransformElement::operator=(const SVGAnimateTransformElement &other)
+{
+ SVGAnimationElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimateTransformElement::SVGAnimateTransformElement(SVGAnimateTransformElementImpl *other) : SVGAnimationElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimateTransformElement::~SVGAnimateTransformElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGAnimateTransformElement.h b/ksvg/dom/SVGAnimateTransformElement.h
index b6c1a5ad..1346174f 100644
--- a/ksvg/dom/SVGAnimateTransformElement.h
+++ b/ksvg/dom/SVGAnimateTransformElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedAngle.cc b/ksvg/dom/SVGAnimatedAngle.cc
deleted file mode 100644
index b8c4ff4d..00000000
--- a/ksvg/dom/SVGAnimatedAngle.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedAngle.h"
-#include "SVGAnimatedAngleImpl.h"
-#include "SVGAngle.h"
-
-using namespace KSVG;
-
-SVGAnimatedAngle::SVGAnimatedAngle()
-{
- impl = new SVGAnimatedAngleImpl();
- impl->ref();
-}
-
-SVGAnimatedAngle::SVGAnimatedAngle(const SVGAnimatedAngle &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedAngle &SVGAnimatedAngle::operator=(const SVGAnimatedAngle &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedAngle::SVGAnimatedAngle(SVGAnimatedAngleImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedAngle::~SVGAnimatedAngle()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAngle SVGAnimatedAngle::baseVal() const
-{
- if(!impl) return SVGAngle(0);
- return SVGAngle(impl->baseVal());
-}
-
-SVGAngle SVGAnimatedAngle::animVal() const
-{
- if(!impl) return SVGAngle(0);
- return SVGAngle(impl->animVal());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedAngle.cpp b/ksvg/dom/SVGAnimatedAngle.cpp
new file mode 100644
index 00000000..f602defe
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedAngle.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedAngle.h"
+#include "SVGAnimatedAngleImpl.h"
+#include "SVGAngle.h"
+
+using namespace KSVG;
+
+SVGAnimatedAngle::SVGAnimatedAngle()
+{
+ impl = new SVGAnimatedAngleImpl();
+ impl->ref();
+}
+
+SVGAnimatedAngle::SVGAnimatedAngle(const SVGAnimatedAngle &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedAngle &SVGAnimatedAngle::operator=(const SVGAnimatedAngle &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedAngle::SVGAnimatedAngle(SVGAnimatedAngleImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedAngle::~SVGAnimatedAngle()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAngle SVGAnimatedAngle::baseVal() const
+{
+ if(!impl) return SVGAngle(0);
+ return SVGAngle(impl->baseVal());
+}
+
+SVGAngle SVGAnimatedAngle::animVal() const
+{
+ if(!impl) return SVGAngle(0);
+ return SVGAngle(impl->animVal());
+}
diff --git a/ksvg/dom/SVGAnimatedAngle.h b/ksvg/dom/SVGAnimatedAngle.h
index 156b9c39..49fb9578 100644
--- a/ksvg/dom/SVGAnimatedAngle.h
+++ b/ksvg/dom/SVGAnimatedAngle.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedBoolean.cc b/ksvg/dom/SVGAnimatedBoolean.cc
deleted file mode 100644
index 40bb765b..00000000
--- a/ksvg/dom/SVGAnimatedBoolean.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedBoolean.h"
-#include "SVGAnimatedBooleanImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedBoolean::SVGAnimatedBoolean()
-{
- impl = new SVGAnimatedBooleanImpl();
- impl->ref();
-}
-
-SVGAnimatedBoolean::SVGAnimatedBoolean(const SVGAnimatedBoolean &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedBoolean &SVGAnimatedBoolean::operator=(const SVGAnimatedBoolean &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedBoolean::SVGAnimatedBoolean(SVGAnimatedBooleanImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedBoolean::~SVGAnimatedBoolean()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGAnimatedBoolean::setBaseVal(bool baseVal)
-{
- if(impl)
- impl->setBaseVal(baseVal);
-}
-
-bool SVGAnimatedBoolean::baseVal() const
-{
- if(!impl) return false;
- return impl->baseVal();
-}
-
-bool SVGAnimatedBoolean::animVal() const
-{
- if(!impl) return false;
- return impl->animVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedBoolean.cpp b/ksvg/dom/SVGAnimatedBoolean.cpp
new file mode 100644
index 00000000..29e24a67
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedBoolean.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedBoolean.h"
+#include "SVGAnimatedBooleanImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedBoolean::SVGAnimatedBoolean()
+{
+ impl = new SVGAnimatedBooleanImpl();
+ impl->ref();
+}
+
+SVGAnimatedBoolean::SVGAnimatedBoolean(const SVGAnimatedBoolean &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedBoolean &SVGAnimatedBoolean::operator=(const SVGAnimatedBoolean &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedBoolean::SVGAnimatedBoolean(SVGAnimatedBooleanImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedBoolean::~SVGAnimatedBoolean()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGAnimatedBoolean::setBaseVal(bool baseVal)
+{
+ if(impl)
+ impl->setBaseVal(baseVal);
+}
+
+bool SVGAnimatedBoolean::baseVal() const
+{
+ if(!impl) return false;
+ return impl->baseVal();
+}
+
+bool SVGAnimatedBoolean::animVal() const
+{
+ if(!impl) return false;
+ return impl->animVal();
+}
diff --git a/ksvg/dom/SVGAnimatedBoolean.h b/ksvg/dom/SVGAnimatedBoolean.h
index c223fa9a..07be80e1 100644
--- a/ksvg/dom/SVGAnimatedBoolean.h
+++ b/ksvg/dom/SVGAnimatedBoolean.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedEnumeration.cc b/ksvg/dom/SVGAnimatedEnumeration.cc
deleted file mode 100644
index 2e9610d4..00000000
--- a/ksvg/dom/SVGAnimatedEnumeration.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedEnumeration::SVGAnimatedEnumeration()
-{
- impl = new SVGAnimatedEnumerationImpl();
- impl->ref();
-}
-
-SVGAnimatedEnumeration::SVGAnimatedEnumeration(const SVGAnimatedEnumeration &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedEnumeration &SVGAnimatedEnumeration::operator=(const SVGAnimatedEnumeration &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedEnumeration::SVGAnimatedEnumeration(SVGAnimatedEnumerationImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedEnumeration::~SVGAnimatedEnumeration()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGAnimatedEnumeration::setBaseVal(unsigned short baseVal)
-{
- if(impl)
- impl->setBaseVal(baseVal);
-}
-
-unsigned short SVGAnimatedEnumeration::baseVal() const
-{
- if(!impl) return 0;
- return impl->baseVal();
-}
-
-unsigned short SVGAnimatedEnumeration::animVal() const
-{
- if(!impl) return 0;
- return impl->animVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedEnumeration.cpp b/ksvg/dom/SVGAnimatedEnumeration.cpp
new file mode 100644
index 00000000..061dc0df
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedEnumeration.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedEnumeration::SVGAnimatedEnumeration()
+{
+ impl = new SVGAnimatedEnumerationImpl();
+ impl->ref();
+}
+
+SVGAnimatedEnumeration::SVGAnimatedEnumeration(const SVGAnimatedEnumeration &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedEnumeration &SVGAnimatedEnumeration::operator=(const SVGAnimatedEnumeration &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedEnumeration::SVGAnimatedEnumeration(SVGAnimatedEnumerationImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedEnumeration::~SVGAnimatedEnumeration()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGAnimatedEnumeration::setBaseVal(unsigned short baseVal)
+{
+ if(impl)
+ impl->setBaseVal(baseVal);
+}
+
+unsigned short SVGAnimatedEnumeration::baseVal() const
+{
+ if(!impl) return 0;
+ return impl->baseVal();
+}
+
+unsigned short SVGAnimatedEnumeration::animVal() const
+{
+ if(!impl) return 0;
+ return impl->animVal();
+}
diff --git a/ksvg/dom/SVGAnimatedEnumeration.h b/ksvg/dom/SVGAnimatedEnumeration.h
index 79f75a67..33f74088 100644
--- a/ksvg/dom/SVGAnimatedEnumeration.h
+++ b/ksvg/dom/SVGAnimatedEnumeration.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedInteger.cc b/ksvg/dom/SVGAnimatedInteger.cc
deleted file mode 100644
index df5f9011..00000000
--- a/ksvg/dom/SVGAnimatedInteger.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedInteger.h"
-#include "SVGAnimatedIntegerImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedInteger::SVGAnimatedInteger()
-{
- impl = new SVGAnimatedIntegerImpl();
- impl->ref();
-}
-
-SVGAnimatedInteger::SVGAnimatedInteger(const SVGAnimatedInteger &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedInteger &SVGAnimatedInteger::operator=(const SVGAnimatedInteger &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedInteger::SVGAnimatedInteger(SVGAnimatedIntegerImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedInteger::~SVGAnimatedInteger()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGAnimatedInteger::setBaseVal(long baseVal)
-{
- if(impl)
- impl->setBaseVal(baseVal);
-}
-
-long SVGAnimatedInteger::baseVal() const
-{
- if(!impl) return -1;
- return impl->baseVal();
-}
-
-long SVGAnimatedInteger::animVal() const
-{
- if(!impl) return -1;
- return impl->animVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedInteger.cpp b/ksvg/dom/SVGAnimatedInteger.cpp
new file mode 100644
index 00000000..ab91c1cf
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedInteger.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedInteger.h"
+#include "SVGAnimatedIntegerImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedInteger::SVGAnimatedInteger()
+{
+ impl = new SVGAnimatedIntegerImpl();
+ impl->ref();
+}
+
+SVGAnimatedInteger::SVGAnimatedInteger(const SVGAnimatedInteger &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedInteger &SVGAnimatedInteger::operator=(const SVGAnimatedInteger &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedInteger::SVGAnimatedInteger(SVGAnimatedIntegerImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedInteger::~SVGAnimatedInteger()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGAnimatedInteger::setBaseVal(long baseVal)
+{
+ if(impl)
+ impl->setBaseVal(baseVal);
+}
+
+long SVGAnimatedInteger::baseVal() const
+{
+ if(!impl) return -1;
+ return impl->baseVal();
+}
+
+long SVGAnimatedInteger::animVal() const
+{
+ if(!impl) return -1;
+ return impl->animVal();
+}
diff --git a/ksvg/dom/SVGAnimatedInteger.h b/ksvg/dom/SVGAnimatedInteger.h
index 495cda75..d73af772 100644
--- a/ksvg/dom/SVGAnimatedInteger.h
+++ b/ksvg/dom/SVGAnimatedInteger.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedLength.cc b/ksvg/dom/SVGAnimatedLength.cc
deleted file mode 100644
index 50172f13..00000000
--- a/ksvg/dom/SVGAnimatedLength.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedLength.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGLength.h"
-
-using namespace KSVG;
-
-SVGAnimatedLength::SVGAnimatedLength()
-{
- impl = new SVGAnimatedLengthImpl();
- impl->ref();
-}
-
-SVGAnimatedLength::SVGAnimatedLength(const SVGAnimatedLength &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedLength &SVGAnimatedLength::operator=(const SVGAnimatedLength &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedLength::SVGAnimatedLength(SVGAnimatedLengthImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedLength::~SVGAnimatedLength()
-{
- if(impl)
- impl->deref();
-}
-
-SVGLength SVGAnimatedLength::baseVal() const
-{
- if(!impl) return SVGLength(0);
- return SVGLength(impl->baseVal());
-}
-
-SVGLength SVGAnimatedLength::animVal() const
-{
- if(!impl) return SVGLength(0);
- return SVGLength(impl->animVal());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedLength.cpp b/ksvg/dom/SVGAnimatedLength.cpp
new file mode 100644
index 00000000..4e1cb06b
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedLength.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGLength.h"
+
+using namespace KSVG;
+
+SVGAnimatedLength::SVGAnimatedLength()
+{
+ impl = new SVGAnimatedLengthImpl();
+ impl->ref();
+}
+
+SVGAnimatedLength::SVGAnimatedLength(const SVGAnimatedLength &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedLength &SVGAnimatedLength::operator=(const SVGAnimatedLength &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedLength::SVGAnimatedLength(SVGAnimatedLengthImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedLength::~SVGAnimatedLength()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGLength SVGAnimatedLength::baseVal() const
+{
+ if(!impl) return SVGLength(0);
+ return SVGLength(impl->baseVal());
+}
+
+SVGLength SVGAnimatedLength::animVal() const
+{
+ if(!impl) return SVGLength(0);
+ return SVGLength(impl->animVal());
+}
diff --git a/ksvg/dom/SVGAnimatedLength.h b/ksvg/dom/SVGAnimatedLength.h
index a59792e3..5e28a419 100644
--- a/ksvg/dom/SVGAnimatedLength.h
+++ b/ksvg/dom/SVGAnimatedLength.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedLengthList.cc b/ksvg/dom/SVGAnimatedLengthList.cc
deleted file mode 100644
index f1e9c001..00000000
--- a/ksvg/dom/SVGAnimatedLengthList.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Copyright (C) 2002 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedLengthList.h"
-#include "SVGAnimatedLengthListImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedLengthList::SVGAnimatedLengthList()
-{
- impl = new SVGAnimatedLengthListImpl();
- impl->ref();
-}
-
-SVGAnimatedLengthList::SVGAnimatedLengthList(const SVGAnimatedLengthList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedLengthList &SVGAnimatedLengthList::operator=(const SVGAnimatedLengthList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedLengthList::SVGAnimatedLengthList(SVGAnimatedLengthListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedLengthList::~SVGAnimatedLengthList()
-{
- if(impl)
- impl->deref();
-}
-
-SVGLengthList SVGAnimatedLengthList::baseVal() const
-{
- if(!impl) return 0;
- return impl->animVal();
-}
-
-SVGLengthList SVGAnimatedLengthList::animVal() const
-{
- if(!impl) return 0;
- return impl->baseVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedLengthList.cpp b/ksvg/dom/SVGAnimatedLengthList.cpp
new file mode 100644
index 00000000..2921c4b5
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedLengthList.cpp
@@ -0,0 +1,76 @@
+/*
+ Copyright (C) 2002 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedLengthList.h"
+#include "SVGAnimatedLengthListImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedLengthList::SVGAnimatedLengthList()
+{
+ impl = new SVGAnimatedLengthListImpl();
+ impl->ref();
+}
+
+SVGAnimatedLengthList::SVGAnimatedLengthList(const SVGAnimatedLengthList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedLengthList &SVGAnimatedLengthList::operator=(const SVGAnimatedLengthList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedLengthList::SVGAnimatedLengthList(SVGAnimatedLengthListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedLengthList::~SVGAnimatedLengthList()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGLengthList SVGAnimatedLengthList::baseVal() const
+{
+ if(!impl) return 0;
+ return impl->animVal();
+}
+
+SVGLengthList SVGAnimatedLengthList::animVal() const
+{
+ if(!impl) return 0;
+ return impl->baseVal();
+}
diff --git a/ksvg/dom/SVGAnimatedNumber.cc b/ksvg/dom/SVGAnimatedNumber.cc
deleted file mode 100644
index 9e801842..00000000
--- a/ksvg/dom/SVGAnimatedNumber.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedNumberImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedNumber::SVGAnimatedNumber()
-{
- impl = new SVGAnimatedNumberImpl();
- impl->ref();
-}
-
-SVGAnimatedNumber::SVGAnimatedNumber(const SVGAnimatedNumber &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedNumber &SVGAnimatedNumber::operator=(const SVGAnimatedNumber &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedNumber::SVGAnimatedNumber(SVGAnimatedNumberImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedNumber::~SVGAnimatedNumber()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGAnimatedNumber::setBaseVal(float baseVal)
-{
- if(impl)
- impl->setBaseVal(baseVal);
-}
-
-float SVGAnimatedNumber::baseVal() const
-{
- if(!impl) return -1;
- return impl->baseVal();
-}
-
-float SVGAnimatedNumber::animVal() const
-{
- if(!impl) return -1;
- return impl->animVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedNumber.cpp b/ksvg/dom/SVGAnimatedNumber.cpp
new file mode 100644
index 00000000..78dab4a6
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedNumber.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedNumberImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedNumber::SVGAnimatedNumber()
+{
+ impl = new SVGAnimatedNumberImpl();
+ impl->ref();
+}
+
+SVGAnimatedNumber::SVGAnimatedNumber(const SVGAnimatedNumber &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedNumber &SVGAnimatedNumber::operator=(const SVGAnimatedNumber &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedNumber::SVGAnimatedNumber(SVGAnimatedNumberImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedNumber::~SVGAnimatedNumber()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGAnimatedNumber::setBaseVal(float baseVal)
+{
+ if(impl)
+ impl->setBaseVal(baseVal);
+}
+
+float SVGAnimatedNumber::baseVal() const
+{
+ if(!impl) return -1;
+ return impl->baseVal();
+}
+
+float SVGAnimatedNumber::animVal() const
+{
+ if(!impl) return -1;
+ return impl->animVal();
+}
diff --git a/ksvg/dom/SVGAnimatedNumber.h b/ksvg/dom/SVGAnimatedNumber.h
index 8c3f1670..dbb2341a 100644
--- a/ksvg/dom/SVGAnimatedNumber.h
+++ b/ksvg/dom/SVGAnimatedNumber.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedNumberList.cc b/ksvg/dom/SVGAnimatedNumberList.cc
deleted file mode 100644
index 66881cac..00000000
--- a/ksvg/dom/SVGAnimatedNumberList.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Copyright (C) 2002 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberList.h"
-#include "SVGAnimatedNumberListImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedNumberList::SVGAnimatedNumberList()
-{
- impl = new SVGAnimatedNumberListImpl();
- impl->ref();
-}
-
-SVGAnimatedNumberList::SVGAnimatedNumberList(const SVGAnimatedNumberList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedNumberList &SVGAnimatedNumberList::operator=(const SVGAnimatedNumberList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedNumberList::SVGAnimatedNumberList(SVGAnimatedNumberListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedNumberList::~SVGAnimatedNumberList()
-{
- if(impl)
- impl->deref();
-}
-
-SVGNumberList SVGAnimatedNumberList::baseVal() const
-{
- if(!impl) return 0;
- return impl->animVal();
-}
-
-SVGNumberList SVGAnimatedNumberList::animVal() const
-{
- if(!impl) return 0;
- return impl->baseVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedNumberList.cpp b/ksvg/dom/SVGAnimatedNumberList.cpp
new file mode 100644
index 00000000..cf4fb8ae
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedNumberList.cpp
@@ -0,0 +1,76 @@
+/*
+ Copyright (C) 2002 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberList.h"
+#include "SVGAnimatedNumberListImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedNumberList::SVGAnimatedNumberList()
+{
+ impl = new SVGAnimatedNumberListImpl();
+ impl->ref();
+}
+
+SVGAnimatedNumberList::SVGAnimatedNumberList(const SVGAnimatedNumberList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedNumberList &SVGAnimatedNumberList::operator=(const SVGAnimatedNumberList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedNumberList::SVGAnimatedNumberList(SVGAnimatedNumberListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedNumberList::~SVGAnimatedNumberList()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGNumberList SVGAnimatedNumberList::baseVal() const
+{
+ if(!impl) return 0;
+ return impl->animVal();
+}
+
+SVGNumberList SVGAnimatedNumberList::animVal() const
+{
+ if(!impl) return 0;
+ return impl->baseVal();
+}
diff --git a/ksvg/dom/SVGAnimatedPathData.cc b/ksvg/dom/SVGAnimatedPathData.cc
deleted file mode 100644
index d332f567..00000000
--- a/ksvg/dom/SVGAnimatedPathData.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedPathData.h"
-#include "SVGAnimatedPathDataImpl.h"
-#include "SVGPathSegList.h"
-
-using namespace KSVG;
-
-SVGAnimatedPathData::SVGAnimatedPathData()
-{
- impl = new SVGAnimatedPathDataImpl();
- impl->ref();
-}
-
-SVGAnimatedPathData::SVGAnimatedPathData(const SVGAnimatedPathData &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedPathData &SVGAnimatedPathData::operator=(const SVGAnimatedPathData &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedPathData::SVGAnimatedPathData(SVGAnimatedPathDataImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedPathData::~SVGAnimatedPathData()
-{
- if(impl)
- impl->deref();
-}
-
-SVGPathSegList SVGAnimatedPathData::pathSegList() const
-{
- if(!impl) return SVGPathSegList(0);
- return SVGPathSegList(impl->pathSegList());
-}
-
-SVGPathSegList SVGAnimatedPathData::normalizedPathSegList() const
-{
- if(!impl) return SVGPathSegList(0);
- return SVGPathSegList(impl->normalizedPathSegList());
-}
-
-SVGPathSegList SVGAnimatedPathData::animatedPathSegList() const
-{
- if(!impl) return SVGPathSegList(0);
- return SVGPathSegList(impl->animatedPathSegList());
-}
-
-SVGPathSegList SVGAnimatedPathData::animatedNormalizedPathSegList() const
-{
- if(!impl) return SVGPathSegList(0);
- return SVGPathSegList(impl->animatedNormalizedPathSegList());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedPathData.cpp b/ksvg/dom/SVGAnimatedPathData.cpp
new file mode 100644
index 00000000..98b3c739
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedPathData.cpp
@@ -0,0 +1,89 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedPathData.h"
+#include "SVGAnimatedPathDataImpl.h"
+#include "SVGPathSegList.h"
+
+using namespace KSVG;
+
+SVGAnimatedPathData::SVGAnimatedPathData()
+{
+ impl = new SVGAnimatedPathDataImpl();
+ impl->ref();
+}
+
+SVGAnimatedPathData::SVGAnimatedPathData(const SVGAnimatedPathData &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedPathData &SVGAnimatedPathData::operator=(const SVGAnimatedPathData &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedPathData::SVGAnimatedPathData(SVGAnimatedPathDataImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedPathData::~SVGAnimatedPathData()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGPathSegList SVGAnimatedPathData::pathSegList() const
+{
+ if(!impl) return SVGPathSegList(0);
+ return SVGPathSegList(impl->pathSegList());
+}
+
+SVGPathSegList SVGAnimatedPathData::normalizedPathSegList() const
+{
+ if(!impl) return SVGPathSegList(0);
+ return SVGPathSegList(impl->normalizedPathSegList());
+}
+
+SVGPathSegList SVGAnimatedPathData::animatedPathSegList() const
+{
+ if(!impl) return SVGPathSegList(0);
+ return SVGPathSegList(impl->animatedPathSegList());
+}
+
+SVGPathSegList SVGAnimatedPathData::animatedNormalizedPathSegList() const
+{
+ if(!impl) return SVGPathSegList(0);
+ return SVGPathSegList(impl->animatedNormalizedPathSegList());
+}
diff --git a/ksvg/dom/SVGAnimatedPathData.h b/ksvg/dom/SVGAnimatedPathData.h
index 06ae2905..ff0ad2d6 100644
--- a/ksvg/dom/SVGAnimatedPathData.h
+++ b/ksvg/dom/SVGAnimatedPathData.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedPoints.cc b/ksvg/dom/SVGAnimatedPoints.cc
deleted file mode 100644
index cc4e999d..00000000
--- a/ksvg/dom/SVGAnimatedPoints.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedPoints.h"
-#include "SVGAnimatedPointsImpl.h"
-#include "SVGPointList.h"
-
-using namespace KSVG;
-
-SVGAnimatedPoints::SVGAnimatedPoints()
-{
- impl = new SVGAnimatedPointsImpl();
- impl->ref();
-}
-
-SVGAnimatedPoints::SVGAnimatedPoints(const SVGAnimatedPoints &other) : impl(0)
-{
- (*this) = other;;
-}
-
-SVGAnimatedPoints &SVGAnimatedPoints::operator=(const SVGAnimatedPoints &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedPoints::SVGAnimatedPoints(SVGAnimatedPointsImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedPoints::~SVGAnimatedPoints()
-{
- if(impl)
- impl->deref();
-}
-
-SVGPointList SVGAnimatedPoints::points() const
-{
- if(!impl) return SVGPointList(0);
- return SVGPointList(impl->points());
-}
-
-SVGPointList SVGAnimatedPoints::animatedPoints() const
-{
- if(!impl) return SVGPointList(0);
- return SVGPointList(impl->animatedPoints());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedPoints.cpp b/ksvg/dom/SVGAnimatedPoints.cpp
new file mode 100644
index 00000000..2b91f989
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedPoints.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedPoints.h"
+#include "SVGAnimatedPointsImpl.h"
+#include "SVGPointList.h"
+
+using namespace KSVG;
+
+SVGAnimatedPoints::SVGAnimatedPoints()
+{
+ impl = new SVGAnimatedPointsImpl();
+ impl->ref();
+}
+
+SVGAnimatedPoints::SVGAnimatedPoints(const SVGAnimatedPoints &other) : impl(0)
+{
+ (*this) = other;;
+}
+
+SVGAnimatedPoints &SVGAnimatedPoints::operator=(const SVGAnimatedPoints &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedPoints::SVGAnimatedPoints(SVGAnimatedPointsImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedPoints::~SVGAnimatedPoints()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGPointList SVGAnimatedPoints::points() const
+{
+ if(!impl) return SVGPointList(0);
+ return SVGPointList(impl->points());
+}
+
+SVGPointList SVGAnimatedPoints::animatedPoints() const
+{
+ if(!impl) return SVGPointList(0);
+ return SVGPointList(impl->animatedPoints());
+}
diff --git a/ksvg/dom/SVGAnimatedPoints.h b/ksvg/dom/SVGAnimatedPoints.h
index 3f035722..1ec1f38d 100644
--- a/ksvg/dom/SVGAnimatedPoints.h
+++ b/ksvg/dom/SVGAnimatedPoints.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedPreserveAspectRatio.cc b/ksvg/dom/SVGAnimatedPreserveAspectRatio.cc
deleted file mode 100644
index ed157028..00000000
--- a/ksvg/dom/SVGAnimatedPreserveAspectRatio.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedPreserveAspectRatio.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-#include "SVGPreserveAspectRatio.h"
-
-using namespace KSVG;
-
-SVGAnimatedPreserveAspectRatio::SVGAnimatedPreserveAspectRatio()
-{
- impl = new SVGAnimatedPreserveAspectRatioImpl();
- impl->ref();
-}
-
-SVGAnimatedPreserveAspectRatio::SVGAnimatedPreserveAspectRatio(const SVGAnimatedPreserveAspectRatio &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedPreserveAspectRatio &SVGAnimatedPreserveAspectRatio::operator=(const SVGAnimatedPreserveAspectRatio &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedPreserveAspectRatio::SVGAnimatedPreserveAspectRatio(SVGAnimatedPreserveAspectRatioImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedPreserveAspectRatio::~SVGAnimatedPreserveAspectRatio()
-{
- if(impl)
- impl->deref();
-}
-
-SVGPreserveAspectRatio SVGAnimatedPreserveAspectRatio::baseVal() const
-{
- if(!impl) return SVGPreserveAspectRatio(0);
- return SVGPreserveAspectRatio(impl->baseVal());
-}
-
-SVGPreserveAspectRatio SVGAnimatedPreserveAspectRatio::animVal() const
-{
- if(!impl) return SVGPreserveAspectRatio(0);
- return SVGPreserveAspectRatio(impl->animVal());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedPreserveAspectRatio.cpp b/ksvg/dom/SVGAnimatedPreserveAspectRatio.cpp
new file mode 100644
index 00000000..2f3d3e17
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedPreserveAspectRatio.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedPreserveAspectRatio.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+#include "SVGPreserveAspectRatio.h"
+
+using namespace KSVG;
+
+SVGAnimatedPreserveAspectRatio::SVGAnimatedPreserveAspectRatio()
+{
+ impl = new SVGAnimatedPreserveAspectRatioImpl();
+ impl->ref();
+}
+
+SVGAnimatedPreserveAspectRatio::SVGAnimatedPreserveAspectRatio(const SVGAnimatedPreserveAspectRatio &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedPreserveAspectRatio &SVGAnimatedPreserveAspectRatio::operator=(const SVGAnimatedPreserveAspectRatio &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedPreserveAspectRatio::SVGAnimatedPreserveAspectRatio(SVGAnimatedPreserveAspectRatioImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedPreserveAspectRatio::~SVGAnimatedPreserveAspectRatio()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGPreserveAspectRatio SVGAnimatedPreserveAspectRatio::baseVal() const
+{
+ if(!impl) return SVGPreserveAspectRatio(0);
+ return SVGPreserveAspectRatio(impl->baseVal());
+}
+
+SVGPreserveAspectRatio SVGAnimatedPreserveAspectRatio::animVal() const
+{
+ if(!impl) return SVGPreserveAspectRatio(0);
+ return SVGPreserveAspectRatio(impl->animVal());
+}
diff --git a/ksvg/dom/SVGAnimatedPreserveAspectRatio.h b/ksvg/dom/SVGAnimatedPreserveAspectRatio.h
index 4eea042f..9af119a2 100644
--- a/ksvg/dom/SVGAnimatedPreserveAspectRatio.h
+++ b/ksvg/dom/SVGAnimatedPreserveAspectRatio.h
@@ -49,4 +49,3 @@ private:
}
#endif
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedRect.cc b/ksvg/dom/SVGAnimatedRect.cc
deleted file mode 100644
index 2c315003..00000000
--- a/ksvg/dom/SVGAnimatedRect.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedRect.h"
-#include "SVGAnimatedRectImpl.h"
-#include "SVGRect.h"
-
-using namespace KSVG;
-
-SVGAnimatedRect::SVGAnimatedRect()
-{
- impl = new SVGAnimatedRectImpl();
- impl->ref();
-}
-
-SVGAnimatedRect::SVGAnimatedRect(const SVGAnimatedRect &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedRect &SVGAnimatedRect::operator=(const SVGAnimatedRect &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedRect::SVGAnimatedRect(SVGAnimatedRectImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedRect::~SVGAnimatedRect()
-{
- if(impl)
- impl->deref();
-}
-
-SVGRect SVGAnimatedRect::baseVal() const
-{
- if(!impl) return SVGRect(0);
- return SVGRect(impl->baseVal());
-}
-
-SVGRect SVGAnimatedRect::animVal() const
-{
- if(!impl) return SVGRect(0);
- return SVGRect(impl->animVal());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedRect.cpp b/ksvg/dom/SVGAnimatedRect.cpp
new file mode 100644
index 00000000..29cf0518
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedRect.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedRect.h"
+#include "SVGAnimatedRectImpl.h"
+#include "SVGRect.h"
+
+using namespace KSVG;
+
+SVGAnimatedRect::SVGAnimatedRect()
+{
+ impl = new SVGAnimatedRectImpl();
+ impl->ref();
+}
+
+SVGAnimatedRect::SVGAnimatedRect(const SVGAnimatedRect &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedRect &SVGAnimatedRect::operator=(const SVGAnimatedRect &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedRect::SVGAnimatedRect(SVGAnimatedRectImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedRect::~SVGAnimatedRect()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGRect SVGAnimatedRect::baseVal() const
+{
+ if(!impl) return SVGRect(0);
+ return SVGRect(impl->baseVal());
+}
+
+SVGRect SVGAnimatedRect::animVal() const
+{
+ if(!impl) return SVGRect(0);
+ return SVGRect(impl->animVal());
+}
diff --git a/ksvg/dom/SVGAnimatedRect.h b/ksvg/dom/SVGAnimatedRect.h
index c45a8f2d..29a6af3e 100644
--- a/ksvg/dom/SVGAnimatedRect.h
+++ b/ksvg/dom/SVGAnimatedRect.h
@@ -48,4 +48,3 @@ private:
}
#endif
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedString.cc b/ksvg/dom/SVGAnimatedString.cc
deleted file mode 100644
index 5d22f4ae..00000000
--- a/ksvg/dom/SVGAnimatedString.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-SVGAnimatedString::SVGAnimatedString()
-{
- impl = new SVGAnimatedStringImpl();
- impl->ref();
-}
-
-SVGAnimatedString::SVGAnimatedString(const SVGAnimatedString &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedString &SVGAnimatedString::operator=(const SVGAnimatedString &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedString::SVGAnimatedString(SVGAnimatedStringImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedString::~SVGAnimatedString()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGAnimatedString::setBaseVal(const DOM::DOMString &baseVal)
-{
- if(impl)
- impl->setBaseVal(baseVal);
-}
-
-DOM::DOMString SVGAnimatedString::baseVal() const
-{
- if(!impl) return DOM::DOMString();
- return impl->baseVal();
-}
-
-DOM::DOMString SVGAnimatedString::animVal() const
-{
- if(!impl) return DOM::DOMString();
- return impl->animVal();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedString.cpp b/ksvg/dom/SVGAnimatedString.cpp
new file mode 100644
index 00000000..ba69c6e1
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedString.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+SVGAnimatedString::SVGAnimatedString()
+{
+ impl = new SVGAnimatedStringImpl();
+ impl->ref();
+}
+
+SVGAnimatedString::SVGAnimatedString(const SVGAnimatedString &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedString &SVGAnimatedString::operator=(const SVGAnimatedString &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedString::SVGAnimatedString(SVGAnimatedStringImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedString::~SVGAnimatedString()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGAnimatedString::setBaseVal(const DOM::DOMString &baseVal)
+{
+ if(impl)
+ impl->setBaseVal(baseVal);
+}
+
+DOM::DOMString SVGAnimatedString::baseVal() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->baseVal();
+}
+
+DOM::DOMString SVGAnimatedString::animVal() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->animVal();
+}
diff --git a/ksvg/dom/SVGAnimatedString.h b/ksvg/dom/SVGAnimatedString.h
index f97bb5c8..db3e422c 100644
--- a/ksvg/dom/SVGAnimatedString.h
+++ b/ksvg/dom/SVGAnimatedString.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedTransformList.cc b/ksvg/dom/SVGAnimatedTransformList.cc
deleted file mode 100644
index a1eb43ca..00000000
--- a/ksvg/dom/SVGAnimatedTransformList.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedTransformList.h"
-#include "SVGAnimatedTransformListImpl.h"
-#include "SVGTransformList.h"
-
-using namespace KSVG;
-
-SVGAnimatedTransformList::SVGAnimatedTransformList()
-{
- impl = new SVGAnimatedTransformListImpl();
- impl->ref();
-}
-
-SVGAnimatedTransformList::SVGAnimatedTransformList(const SVGAnimatedTransformList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimatedTransformList &SVGAnimatedTransformList::operator=(const SVGAnimatedTransformList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimatedTransformList::SVGAnimatedTransformList(SVGAnimatedTransformListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimatedTransformList::~SVGAnimatedTransformList()
-{
- if(impl)
- impl->deref();
-}
-
-SVGTransformList SVGAnimatedTransformList::baseVal() const
-{
- if(!impl) return SVGTransformList(0);
- return SVGTransformList(impl->baseVal());
-}
-
-SVGTransformList SVGAnimatedTransformList::animVal() const
-{
- if(!impl) return SVGTransformList(0);
- return SVGTransformList(impl->animVal());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimatedTransformList.cpp b/ksvg/dom/SVGAnimatedTransformList.cpp
new file mode 100644
index 00000000..7a8cbe49
--- /dev/null
+++ b/ksvg/dom/SVGAnimatedTransformList.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedTransformList.h"
+#include "SVGAnimatedTransformListImpl.h"
+#include "SVGTransformList.h"
+
+using namespace KSVG;
+
+SVGAnimatedTransformList::SVGAnimatedTransformList()
+{
+ impl = new SVGAnimatedTransformListImpl();
+ impl->ref();
+}
+
+SVGAnimatedTransformList::SVGAnimatedTransformList(const SVGAnimatedTransformList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimatedTransformList &SVGAnimatedTransformList::operator=(const SVGAnimatedTransformList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimatedTransformList::SVGAnimatedTransformList(SVGAnimatedTransformListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimatedTransformList::~SVGAnimatedTransformList()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGTransformList SVGAnimatedTransformList::baseVal() const
+{
+ if(!impl) return SVGTransformList(0);
+ return SVGTransformList(impl->baseVal());
+}
+
+SVGTransformList SVGAnimatedTransformList::animVal() const
+{
+ if(!impl) return SVGTransformList(0);
+ return SVGTransformList(impl->animVal());
+}
diff --git a/ksvg/dom/SVGAnimatedTransformList.h b/ksvg/dom/SVGAnimatedTransformList.h
index 87a12d3b..5b12833c 100644
--- a/ksvg/dom/SVGAnimatedTransformList.h
+++ b/ksvg/dom/SVGAnimatedTransformList.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimationElement.cc b/ksvg/dom/SVGAnimationElement.cc
deleted file mode 100644
index 0d4014a7..00000000
--- a/ksvg/dom/SVGAnimationElement.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimationElement.h"
-#include "SVGAnimationElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimationElement::SVGAnimationElement() : SVGElement(), SVGTests(), SVGExternalResourcesRequired()
-{
- impl = 0;
-}
-
-SVGAnimationElement::SVGAnimationElement(const SVGAnimationElement &other) : SVGElement(other), SVGTests(other), SVGExternalResourcesRequired(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGAnimationElement &SVGAnimationElement::operator=(const SVGAnimationElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGAnimationElement::SVGAnimationElement(SVGAnimationElementImpl *other) : SVGElement(other), SVGTests(other), SVGExternalResourcesRequired(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGAnimationElement::~SVGAnimationElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGElement SVGAnimationElement::targetElement() const
-{
- if(!impl) return SVGElement(0);
- return SVGElement(impl->targetElement());
-}
-
-float SVGAnimationElement::getStartTime()
-{
- if(!impl) return -1;
- return impl->getStartTime();
-}
-
-float SVGAnimationElement::getCurrentTime()
-{
- if(!impl) return -1;
- return impl->getCurrentTime();
-}
-
-float SVGAnimationElement::getSimpleDuration()
-{
- if(!impl) return -1;
- return impl->getSimpleDuration();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGAnimationElement.cpp b/ksvg/dom/SVGAnimationElement.cpp
new file mode 100644
index 00000000..0cc1ce3b
--- /dev/null
+++ b/ksvg/dom/SVGAnimationElement.cpp
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimationElement.h"
+#include "SVGAnimationElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimationElement::SVGAnimationElement() : SVGElement(), SVGTests(), SVGExternalResourcesRequired()
+{
+ impl = 0;
+}
+
+SVGAnimationElement::SVGAnimationElement(const SVGAnimationElement &other) : SVGElement(other), SVGTests(other), SVGExternalResourcesRequired(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGAnimationElement &SVGAnimationElement::operator=(const SVGAnimationElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGAnimationElement::SVGAnimationElement(SVGAnimationElementImpl *other) : SVGElement(other), SVGTests(other), SVGExternalResourcesRequired(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGAnimationElement::~SVGAnimationElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGElement SVGAnimationElement::targetElement() const
+{
+ if(!impl) return SVGElement(0);
+ return SVGElement(impl->targetElement());
+}
+
+float SVGAnimationElement::getStartTime()
+{
+ if(!impl) return -1;
+ return impl->getStartTime();
+}
+
+float SVGAnimationElement::getCurrentTime()
+{
+ if(!impl) return -1;
+ return impl->getCurrentTime();
+}
+
+float SVGAnimationElement::getSimpleDuration()
+{
+ if(!impl) return -1;
+ return impl->getSimpleDuration();
+}
diff --git a/ksvg/dom/SVGAnimationElement.h b/ksvg/dom/SVGAnimationElement.h
index 2e4df665..bbf582c9 100644
--- a/ksvg/dom/SVGAnimationElement.h
+++ b/ksvg/dom/SVGAnimationElement.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGCSSRule.cc b/ksvg/dom/SVGCSSRule.cc
deleted file mode 100644
index cad5657e..00000000
--- a/ksvg/dom/SVGCSSRule.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGCSSRule.h"
-#include "SVGCSSRuleImpl.h"
-
-using namespace KSVG;
-
-SVGCSSRule::SVGCSSRule() //: css::CSSRule()
-{
- impl = new SVGCSSRuleImpl();
- impl->ref();
-}
-
-SVGCSSRule::SVGCSSRule(const SVGCSSRule &other) : /*css::CSSRule(),*/ impl(0)
-{
- (*this) = other;
-}
-
-SVGCSSRule &SVGCSSRule::operator=(const SVGCSSRule &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGCSSRule::SVGCSSRule(SVGCSSRuleImpl *other) //: css::CSSRule()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGCSSRule::~SVGCSSRule()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGCSSRule.cpp b/ksvg/dom/SVGCSSRule.cpp
new file mode 100644
index 00000000..0cb02c97
--- /dev/null
+++ b/ksvg/dom/SVGCSSRule.cpp
@@ -0,0 +1,64 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGCSSRule.h"
+#include "SVGCSSRuleImpl.h"
+
+using namespace KSVG;
+
+SVGCSSRule::SVGCSSRule() //: css::CSSRule()
+{
+ impl = new SVGCSSRuleImpl();
+ impl->ref();
+}
+
+SVGCSSRule::SVGCSSRule(const SVGCSSRule &other) : /*css::CSSRule(),*/ impl(0)
+{
+ (*this) = other;
+}
+
+SVGCSSRule &SVGCSSRule::operator=(const SVGCSSRule &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGCSSRule::SVGCSSRule(SVGCSSRuleImpl *other) //: css::CSSRule()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGCSSRule::~SVGCSSRule()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGCSSRule.h b/ksvg/dom/SVGCSSRule.h
index dc9e9360..ad0fcb63 100644
--- a/ksvg/dom/SVGCSSRule.h
+++ b/ksvg/dom/SVGCSSRule.h
@@ -47,5 +47,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGCircleElement.cc b/ksvg/dom/SVGCircleElement.cc
deleted file mode 100644
index 13875211..00000000
--- a/ksvg/dom/SVGCircleElement.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include "SVGCircleElement.h"
-#include "SVGCircleElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGCircleElement::SVGCircleElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGCircleElement::SVGCircleElement(const SVGCircleElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGCircleElement &SVGCircleElement::operator=(const SVGCircleElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGCircleElement::SVGCircleElement(SVGCircleElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGCircleElement::~SVGCircleElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGCircleElement::cx()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->cx());
-}
-
-SVGAnimatedLength SVGCircleElement::cy()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->cy());
-}
-
-SVGAnimatedLength SVGCircleElement::r()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->r());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGCircleElement.cpp b/ksvg/dom/SVGCircleElement.cpp
new file mode 100644
index 00000000..746160e6
--- /dev/null
+++ b/ksvg/dom/SVGCircleElement.cpp
@@ -0,0 +1,90 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "SVGCircleElement.h"
+#include "SVGCircleElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGCircleElement::SVGCircleElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGCircleElement::SVGCircleElement(const SVGCircleElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGCircleElement &SVGCircleElement::operator=(const SVGCircleElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGCircleElement::SVGCircleElement(SVGCircleElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGCircleElement::~SVGCircleElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGCircleElement::cx()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->cx());
+}
+
+SVGAnimatedLength SVGCircleElement::cy()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->cy());
+}
+
+SVGAnimatedLength SVGCircleElement::r()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->r());
+}
diff --git a/ksvg/dom/SVGCircleElement.h b/ksvg/dom/SVGCircleElement.h
index 65406a1c..2d4168f6 100644
--- a/ksvg/dom/SVGCircleElement.h
+++ b/ksvg/dom/SVGCircleElement.h
@@ -113,5 +113,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGClipPathElement.cc b/ksvg/dom/SVGClipPathElement.cc
deleted file mode 100644
index f0785efc..00000000
--- a/ksvg/dom/SVGClipPathElement.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGClipPathElement.h"
-#include "SVGClipPathElementImpl.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGClipPathElement::SVGClipPathElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGClipPathElement::SVGClipPathElement(const SVGClipPathElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- (*this) = other;
-}
-
-SVGClipPathElement &SVGClipPathElement::operator=(const SVGClipPathElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGClipPathElement::SVGClipPathElement(SVGClipPathElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGClipPathElement::~SVGClipPathElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedEnumeration SVGClipPathElement::clipPathUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->clipPathUnits());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGClipPathElement.cpp b/ksvg/dom/SVGClipPathElement.cpp
new file mode 100644
index 00000000..e6c66f7f
--- /dev/null
+++ b/ksvg/dom/SVGClipPathElement.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGClipPathElement.h"
+#include "SVGClipPathElementImpl.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGClipPathElement::SVGClipPathElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGClipPathElement::SVGClipPathElement(const SVGClipPathElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ (*this) = other;
+}
+
+SVGClipPathElement &SVGClipPathElement::operator=(const SVGClipPathElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGClipPathElement::SVGClipPathElement(SVGClipPathElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGClipPathElement::~SVGClipPathElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedEnumeration SVGClipPathElement::clipPathUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->clipPathUnits());
+}
diff --git a/ksvg/dom/SVGClipPathElement.h b/ksvg/dom/SVGClipPathElement.h
index 70cfe6bb..78e10138 100644
--- a/ksvg/dom/SVGClipPathElement.h
+++ b/ksvg/dom/SVGClipPathElement.h
@@ -61,5 +61,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGColor.cc b/ksvg/dom/SVGColor.cc
deleted file mode 100644
index e9294c5d..00000000
--- a/ksvg/dom/SVGColor.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGColor.h"
-#include "SVGICCColor.h"
-#include "SVGColorImpl.h"
-
-using namespace KSVG;
-
-SVGColor::SVGColor()
-{
- // FIXME: no icc color support...
- impl = new SVGColorImpl(0);
- impl->ref();
-}
-
-SVGColor::SVGColor(const SVGColor &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGColor &SVGColor::operator=(const SVGColor &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-
-}
-
-SVGColor::SVGColor(SVGColorImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGColor::~SVGColor()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned short SVGColor::colorType() const
-{
- if(!impl) return SVG_COLORTYPE_UNKNOWN;
- return impl->colorType();
-}
-
-DOM::RGBColor SVGColor::rgbColor() const
-{
- if(!impl) return DOM::RGBColor();
- return impl->rgbColor();
-}
-
-SVGICCColor SVGColor::iccColor() const
-{
- if(!impl) return SVGICCColor();
- return impl->iccColor();
-}
-
-void SVGColor::setRGBColor(const DOM::DOMString &rgbColor)
-{
- if(impl)
- impl->setRGBColor(rgbColor);
-}
-
-void SVGColor::setRGBColorICCColor(const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- if(impl)
- impl->setRGBColorICCColor(rgbColor, iccColor);
-}
-
-void SVGColor::setColor(unsigned short colorType, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- if(impl)
- impl->setColor(colorType, rgbColor, iccColor);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGColor.cpp b/ksvg/dom/SVGColor.cpp
new file mode 100644
index 00000000..2a7947ab
--- /dev/null
+++ b/ksvg/dom/SVGColor.cpp
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGColor.h"
+#include "SVGICCColor.h"
+#include "SVGColorImpl.h"
+
+using namespace KSVG;
+
+SVGColor::SVGColor()
+{
+ // FIXME: no icc color support...
+ impl = new SVGColorImpl(0);
+ impl->ref();
+}
+
+SVGColor::SVGColor(const SVGColor &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGColor &SVGColor::operator=(const SVGColor &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+
+}
+
+SVGColor::SVGColor(SVGColorImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGColor::~SVGColor()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned short SVGColor::colorType() const
+{
+ if(!impl) return SVG_COLORTYPE_UNKNOWN;
+ return impl->colorType();
+}
+
+DOM::RGBColor SVGColor::rgbColor() const
+{
+ if(!impl) return DOM::RGBColor();
+ return impl->rgbColor();
+}
+
+SVGICCColor SVGColor::iccColor() const
+{
+ if(!impl) return SVGICCColor();
+ return impl->iccColor();
+}
+
+void SVGColor::setRGBColor(const DOM::DOMString &rgbColor)
+{
+ if(impl)
+ impl->setRGBColor(rgbColor);
+}
+
+void SVGColor::setRGBColorICCColor(const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ if(impl)
+ impl->setRGBColorICCColor(rgbColor, iccColor);
+}
+
+void SVGColor::setColor(unsigned short colorType, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ if(impl)
+ impl->setColor(colorType, rgbColor, iccColor);
+}
diff --git a/ksvg/dom/SVGColor.h b/ksvg/dom/SVGColor.h
index 62147ed0..e1f227bd 100644
--- a/ksvg/dom/SVGColor.h
+++ b/ksvg/dom/SVGColor.h
@@ -65,5 +65,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGColorProfileElement.cc b/ksvg/dom/SVGColorProfileElement.cc
deleted file mode 100644
index 5acdb1a1..00000000
--- a/ksvg/dom/SVGColorProfileElement.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGColorProfileElement.h"
-#include "SVGColorProfileElementImpl.h"
-#include "SVGRenderingIntent.h"
-
-using namespace KSVG;
-
-SVGColorProfileElement::SVGColorProfileElement() : SVGElement(), SVGURIReference()
-{
- impl = 0;
-}
-
-SVGColorProfileElement::SVGColorProfileElement(const SVGColorProfileElement &other) : SVGElement(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGColorProfileElement &SVGColorProfileElement::operator=(const SVGColorProfileElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGColorProfileElement::SVGColorProfileElement(SVGColorProfileElementImpl *other) : SVGElement(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGColorProfileElement::~SVGColorProfileElement()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGColorProfileElement::setLocal(const DOM::DOMString &local)
-{
- if(impl)
- impl->setLocal(local);
-}
-
-DOM::DOMString SVGColorProfileElement::local() const
-{
- if(!impl) return DOM::DOMString();
- return impl->local();
-}
-
-void SVGColorProfileElement::setName(const DOM::DOMString &name)
-{
- if(impl)
- impl->setName(name);
-}
-
-DOM::DOMString SVGColorProfileElement::name() const
-{
- if(!impl) return DOM::DOMString();
- return impl->name();
-}
-
-void SVGColorProfileElement::setRenderingIntent(unsigned short renderingIntent)
-{
- if(impl)
- impl->setRenderingIntent(renderingIntent);
-}
-
-unsigned short SVGColorProfileElement::renderingIntent() const
-{
- if(!impl) return RENDERING_INTENT_UNKNOWN;
- return impl->renderingIntent();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGColorProfileElement.cpp b/ksvg/dom/SVGColorProfileElement.cpp
new file mode 100644
index 00000000..fa86f4f5
--- /dev/null
+++ b/ksvg/dom/SVGColorProfileElement.cpp
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGColorProfileElement.h"
+#include "SVGColorProfileElementImpl.h"
+#include "SVGRenderingIntent.h"
+
+using namespace KSVG;
+
+SVGColorProfileElement::SVGColorProfileElement() : SVGElement(), SVGURIReference()
+{
+ impl = 0;
+}
+
+SVGColorProfileElement::SVGColorProfileElement(const SVGColorProfileElement &other) : SVGElement(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGColorProfileElement &SVGColorProfileElement::operator=(const SVGColorProfileElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGColorProfileElement::SVGColorProfileElement(SVGColorProfileElementImpl *other) : SVGElement(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGColorProfileElement::~SVGColorProfileElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGColorProfileElement::setLocal(const DOM::DOMString &local)
+{
+ if(impl)
+ impl->setLocal(local);
+}
+
+DOM::DOMString SVGColorProfileElement::local() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->local();
+}
+
+void SVGColorProfileElement::setName(const DOM::DOMString &name)
+{
+ if(impl)
+ impl->setName(name);
+}
+
+DOM::DOMString SVGColorProfileElement::name() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->name();
+}
+
+void SVGColorProfileElement::setRenderingIntent(unsigned short renderingIntent)
+{
+ if(impl)
+ impl->setRenderingIntent(renderingIntent);
+}
+
+unsigned short SVGColorProfileElement::renderingIntent() const
+{
+ if(!impl) return RENDERING_INTENT_UNKNOWN;
+ return impl->renderingIntent();
+}
diff --git a/ksvg/dom/SVGColorProfileElement.h b/ksvg/dom/SVGColorProfileElement.h
index f7f3bd41..a445aba9 100644
--- a/ksvg/dom/SVGColorProfileElement.h
+++ b/ksvg/dom/SVGColorProfileElement.h
@@ -58,5 +58,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGColorProfileRule.cc b/ksvg/dom/SVGColorProfileRule.cc
deleted file mode 100644
index 8c4ecea7..00000000
--- a/ksvg/dom/SVGColorProfileRule.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGColorProfileRule.h"
-#include "SVGColorProfileRuleImpl.h"
-#include "SVGRenderingIntent.h"
-
-using namespace KSVG;
-
-SVGColorProfileRule::SVGColorProfileRule() : SVGCSSRule()
-{
- impl = new SVGColorProfileRuleImpl();
- impl->ref();
-}
-
-SVGColorProfileRule::SVGColorProfileRule(const SVGColorProfileRule &other) : SVGCSSRule(), impl(0)
-{
- (*this) = other;
-}
-
-SVGColorProfileRule &SVGColorProfileRule::operator=(const SVGColorProfileRule &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGColorProfileRule::SVGColorProfileRule(SVGColorProfileRuleImpl *other) : SVGCSSRule(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGColorProfileRule::~SVGColorProfileRule()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGColorProfileRule::setSrc(const DOM::DOMString &src)
-{
- if(impl)
- impl->setSrc(src);
-}
-
-DOM::DOMString SVGColorProfileRule::src() const
-{
- if(!impl) return DOM::DOMString();
- return impl->src();
-}
-
-void SVGColorProfileRule::setName(const DOM::DOMString &name)
-{
- if(impl)
- impl->setName(name);
-}
-
-DOM::DOMString SVGColorProfileRule::name() const
-{
- if(!impl) return DOM::DOMString();
- return impl->name();
-}
-
-void SVGColorProfileRule::setRenderingIntent(unsigned short renderingIntent)
-{
- if(impl)
- impl->setRenderingIntent(renderingIntent);
-}
-
-unsigned short SVGColorProfileRule::renderingIntent() const
-{
- if(!impl) return RENDERING_INTENT_UNKNOWN;
- return impl->renderingIntent();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGColorProfileRule.cpp b/ksvg/dom/SVGColorProfileRule.cpp
new file mode 100644
index 00000000..0a2da253
--- /dev/null
+++ b/ksvg/dom/SVGColorProfileRule.cpp
@@ -0,0 +1,101 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGColorProfileRule.h"
+#include "SVGColorProfileRuleImpl.h"
+#include "SVGRenderingIntent.h"
+
+using namespace KSVG;
+
+SVGColorProfileRule::SVGColorProfileRule() : SVGCSSRule()
+{
+ impl = new SVGColorProfileRuleImpl();
+ impl->ref();
+}
+
+SVGColorProfileRule::SVGColorProfileRule(const SVGColorProfileRule &other) : SVGCSSRule(), impl(0)
+{
+ (*this) = other;
+}
+
+SVGColorProfileRule &SVGColorProfileRule::operator=(const SVGColorProfileRule &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGColorProfileRule::SVGColorProfileRule(SVGColorProfileRuleImpl *other) : SVGCSSRule(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGColorProfileRule::~SVGColorProfileRule()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGColorProfileRule::setSrc(const DOM::DOMString &src)
+{
+ if(impl)
+ impl->setSrc(src);
+}
+
+DOM::DOMString SVGColorProfileRule::src() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->src();
+}
+
+void SVGColorProfileRule::setName(const DOM::DOMString &name)
+{
+ if(impl)
+ impl->setName(name);
+}
+
+DOM::DOMString SVGColorProfileRule::name() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->name();
+}
+
+void SVGColorProfileRule::setRenderingIntent(unsigned short renderingIntent)
+{
+ if(impl)
+ impl->setRenderingIntent(renderingIntent);
+}
+
+unsigned short SVGColorProfileRule::renderingIntent() const
+{
+ if(!impl) return RENDERING_INTENT_UNKNOWN;
+ return impl->renderingIntent();
+}
diff --git a/ksvg/dom/SVGColorProfileRule.h b/ksvg/dom/SVGColorProfileRule.h
index b99321ad..45f0ca62 100644
--- a/ksvg/dom/SVGColorProfileRule.h
+++ b/ksvg/dom/SVGColorProfileRule.h
@@ -53,5 +53,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGComponentTransferFunctionElement.cc b/ksvg/dom/SVGComponentTransferFunctionElement.cc
deleted file mode 100644
index 970da9ea..00000000
--- a/ksvg/dom/SVGComponentTransferFunctionElement.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGComponentTransferFunctionElement.h"
-#include "SVGComponentTransferFunctionElementImpl.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedNumberList.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const SVGComponentTransferFunctionElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGComponentTransferFunctionElement &SVGComponentTransferFunctionElement::operator =(const SVGComponentTransferFunctionElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(SVGComponentTransferFunctionElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGComponentTransferFunctionElement::~SVGComponentTransferFunctionElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedEnumeration SVGComponentTransferFunctionElement::type() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->type());
-}
-
-SVGAnimatedNumberList SVGComponentTransferFunctionElement::tableValues() const
-{
- if(!impl) return SVGAnimatedNumberList(0);
- return SVGAnimatedNumberList(impl->tableValues());
-}
-
-SVGAnimatedNumber SVGComponentTransferFunctionElement::slope() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->slope());
-}
-
-SVGAnimatedNumber SVGComponentTransferFunctionElement::intercept() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->intercept());
-}
-
-SVGAnimatedNumber SVGComponentTransferFunctionElement::amplitude() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->amplitude());
-}
-
-SVGAnimatedNumber SVGComponentTransferFunctionElement::exponent() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->exponent());
-}
-
-SVGAnimatedNumber SVGComponentTransferFunctionElement::offset() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->offset());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGComponentTransferFunctionElement.cpp b/ksvg/dom/SVGComponentTransferFunctionElement.cpp
new file mode 100644
index 00000000..66639416
--- /dev/null
+++ b/ksvg/dom/SVGComponentTransferFunctionElement.cpp
@@ -0,0 +1,110 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGComponentTransferFunctionElement.h"
+#include "SVGComponentTransferFunctionElementImpl.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedNumberList.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const SVGComponentTransferFunctionElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGComponentTransferFunctionElement &SVGComponentTransferFunctionElement::operator =(const SVGComponentTransferFunctionElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(SVGComponentTransferFunctionElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGComponentTransferFunctionElement::~SVGComponentTransferFunctionElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedEnumeration SVGComponentTransferFunctionElement::type() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->type());
+}
+
+SVGAnimatedNumberList SVGComponentTransferFunctionElement::tableValues() const
+{
+ if(!impl) return SVGAnimatedNumberList(0);
+ return SVGAnimatedNumberList(impl->tableValues());
+}
+
+SVGAnimatedNumber SVGComponentTransferFunctionElement::slope() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->slope());
+}
+
+SVGAnimatedNumber SVGComponentTransferFunctionElement::intercept() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->intercept());
+}
+
+SVGAnimatedNumber SVGComponentTransferFunctionElement::amplitude() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->amplitude());
+}
+
+SVGAnimatedNumber SVGComponentTransferFunctionElement::exponent() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->exponent());
+}
+
+SVGAnimatedNumber SVGComponentTransferFunctionElement::offset() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->offset());
+}
diff --git a/ksvg/dom/SVGComponentTransferFunctionElement.h b/ksvg/dom/SVGComponentTransferFunctionElement.h
index d9dd0080..96e91f03 100644
--- a/ksvg/dom/SVGComponentTransferFunctionElement.h
+++ b/ksvg/dom/SVGComponentTransferFunctionElement.h
@@ -67,5 +67,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGCursorElement.cc b/ksvg/dom/SVGCursorElement.cc
deleted file mode 100644
index 2eb3c0dc..00000000
--- a/ksvg/dom/SVGCursorElement.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGCursorElement.h"
-#include "SVGCursorElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGCursorElement::SVGCursorElement() : SVGElement(), SVGURIReference(), SVGTests(), SVGExternalResourcesRequired()
-{
- impl = 0;
-}
-
-SVGCursorElement::SVGCursorElement(const SVGCursorElement &other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGExternalResourcesRequired(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGCursorElement &SVGCursorElement::operator =(const SVGCursorElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGTests::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGCursorElement::SVGCursorElement(SVGCursorElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGExternalResourcesRequired(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGCursorElement::~SVGCursorElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGCursorElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGCursorElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGCursorElement.cpp b/ksvg/dom/SVGCursorElement.cpp
new file mode 100644
index 00000000..9b882405
--- /dev/null
+++ b/ksvg/dom/SVGCursorElement.cpp
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGCursorElement.h"
+#include "SVGCursorElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGCursorElement::SVGCursorElement() : SVGElement(), SVGURIReference(), SVGTests(), SVGExternalResourcesRequired()
+{
+ impl = 0;
+}
+
+SVGCursorElement::SVGCursorElement(const SVGCursorElement &other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGExternalResourcesRequired(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGCursorElement &SVGCursorElement::operator =(const SVGCursorElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGTests::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGCursorElement::SVGCursorElement(SVGCursorElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGExternalResourcesRequired(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGCursorElement::~SVGCursorElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGCursorElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGCursorElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
diff --git a/ksvg/dom/SVGCursorElement.h b/ksvg/dom/SVGCursorElement.h
index feb9b2b7..ae8cf8a7 100644
--- a/ksvg/dom/SVGCursorElement.h
+++ b/ksvg/dom/SVGCursorElement.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDefinitionSrcElement.cc b/ksvg/dom/SVGDefinitionSrcElement.cc
deleted file mode 100644
index 755b6b4f..00000000
--- a/ksvg/dom/SVGDefinitionSrcElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDefinitionSrcElement.h"
-#include "SVGDefinitionSrcElementImpl.h"
-
-using namespace KSVG;
-
-SVGDefinitionSrcElement::SVGDefinitionSrcElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGDefinitionSrcElement::SVGDefinitionSrcElement(const SVGDefinitionSrcElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGDefinitionSrcElement &SVGDefinitionSrcElement::operator =(const SVGDefinitionSrcElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGDefinitionSrcElement::SVGDefinitionSrcElement(SVGDefinitionSrcElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGDefinitionSrcElement::~SVGDefinitionSrcElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDefinitionSrcElement.cpp b/ksvg/dom/SVGDefinitionSrcElement.cpp
new file mode 100644
index 00000000..6a965215
--- /dev/null
+++ b/ksvg/dom/SVGDefinitionSrcElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDefinitionSrcElement.h"
+#include "SVGDefinitionSrcElementImpl.h"
+
+using namespace KSVG;
+
+SVGDefinitionSrcElement::SVGDefinitionSrcElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGDefinitionSrcElement::SVGDefinitionSrcElement(const SVGDefinitionSrcElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGDefinitionSrcElement &SVGDefinitionSrcElement::operator =(const SVGDefinitionSrcElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGDefinitionSrcElement::SVGDefinitionSrcElement(SVGDefinitionSrcElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGDefinitionSrcElement::~SVGDefinitionSrcElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGDefinitionSrcElement.h b/ksvg/dom/SVGDefinitionSrcElement.h
index fc1b7f52..7314a9cb 100644
--- a/ksvg/dom/SVGDefinitionSrcElement.h
+++ b/ksvg/dom/SVGDefinitionSrcElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDefsElement.cc b/ksvg/dom/SVGDefsElement.cc
deleted file mode 100644
index 67bb2baf..00000000
--- a/ksvg/dom/SVGDefsElement.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDefsElement.h"
-#include "SVGDefsElementImpl.h"
-
-using namespace KSVG;
-
-SVGDefsElement::SVGDefsElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGDefsElement::SVGDefsElement(const SVGDefsElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGDefsElement &SVGDefsElement::operator =(const SVGDefsElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGDefsElement::SVGDefsElement(SVGDefsElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGDefsElement::~SVGDefsElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDefsElement.cpp b/ksvg/dom/SVGDefsElement.cpp
new file mode 100644
index 00000000..9382286e
--- /dev/null
+++ b/ksvg/dom/SVGDefsElement.cpp
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDefsElement.h"
+#include "SVGDefsElementImpl.h"
+
+using namespace KSVG;
+
+SVGDefsElement::SVGDefsElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGDefsElement::SVGDefsElement(const SVGDefsElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGDefsElement &SVGDefsElement::operator =(const SVGDefsElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGDefsElement::SVGDefsElement(SVGDefsElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGDefsElement::~SVGDefsElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGDefsElement.h b/ksvg/dom/SVGDefsElement.h
index e1e7e0a5..306f83af 100644
--- a/ksvg/dom/SVGDefsElement.h
+++ b/ksvg/dom/SVGDefsElement.h
@@ -74,5 +74,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDescElement.cc b/ksvg/dom/SVGDescElement.cc
deleted file mode 100644
index 6eed0ed9..00000000
--- a/ksvg/dom/SVGDescElement.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDescElement.h"
-#include "SVGDescElementImpl.h"
-
-using namespace KSVG;
-
-SVGDescElement::SVGDescElement() : SVGElement(), SVGLangSpace(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGDescElement::SVGDescElement(const SVGDescElement &other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGDescElement &SVGDescElement::operator =(const SVGDescElement &other)
-{
- SVGElement::operator=(other);
- SVGLangSpace::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGDescElement::SVGDescElement(SVGDescElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGDescElement::~SVGDescElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDescElement.cpp b/ksvg/dom/SVGDescElement.cpp
new file mode 100644
index 00000000..35f77c76
--- /dev/null
+++ b/ksvg/dom/SVGDescElement.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDescElement.h"
+#include "SVGDescElementImpl.h"
+
+using namespace KSVG;
+
+SVGDescElement::SVGDescElement() : SVGElement(), SVGLangSpace(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGDescElement::SVGDescElement(const SVGDescElement &other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGDescElement &SVGDescElement::operator =(const SVGDescElement &other)
+{
+ SVGElement::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGDescElement::SVGDescElement(SVGDescElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGDescElement::~SVGDescElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGDescElement.h b/ksvg/dom/SVGDescElement.h
index 9a5b270f..5d239b19 100644
--- a/ksvg/dom/SVGDescElement.h
+++ b/ksvg/dom/SVGDescElement.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDocument.cc b/ksvg/dom/SVGDocument.cc
deleted file mode 100644
index 8734b8da..00000000
--- a/ksvg/dom/SVGDocument.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "ksvg_ecma.h"
-
-#include "SVGDocument.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElement.h"
-#include "SVGWindow.h"
-
-using namespace KSVG;
-
-SVGDocument::SVGDocument() : DOM::Document(*(new SVGDocumentImpl()))
-{
- impl = reinterpret_cast<SVGDocumentImpl *>(handle());
- impl->ref();
-}
-
-SVGDocument::SVGDocument(const SVGDocument &other) : DOM::Document(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGDocument &SVGDocument::operator=(const SVGDocument &other)
-{
- DOM::Document::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGDocument::SVGDocument(SVGDocumentImpl *other) : DOM::Document(other->handle())
-{
- impl = other;
-
- if(impl)
- impl->ref();
-}
-
-SVGDocument::~SVGDocument()
-{
- if(impl)
- impl->deref();
-}
-
-DOM::DOMString SVGDocument::title() const
-{
- if(!impl) return DOM::DOMString();
- return impl->title();
-}
-
-DOM::DOMString SVGDocument::referrer() const
-{
- if(!impl) return DOM::DOMString();
- return impl->referrer();
-}
-
-DOM::DOMString SVGDocument::domain() const
-{
- if(!impl) return DOM::DOMString();
- return impl->domain();
-}
-
-DOM::DOMString SVGDocument::URL() const
-{
- if(!impl) return DOM::DOMString();
- return impl->URL();
-}
-
-SVGWindow SVGDocument::window() const
-{
- if(!impl) return SVGWindow();
- return impl->window();
-}
-
-SVGSVGElement SVGDocument::rootElement() const
-{
- if(!impl) return SVGSVGElement(0);
- return SVGSVGElement(impl->rootElement());
-}
-
-SVGElement SVGDocument::createElement(const DOM::DOMString &tagName)
-{
- if(!impl) return SVGElement(0);
-
- DOM::Element impl = DOM::Document::createElement(tagName);
- return SVGElement(SVGDocumentImpl::createElement(tagName, impl));
-}
-
-SVGElement SVGDocument::createElementNS(const DOM::DOMString &namespaceURI, const DOM::DOMString &qualifiedName)
-{
- if(!impl) return SVGElement(0);
-
- DOM::Element impl = DOM::Document::createElementNS(namespaceURI, qualifiedName);
- return SVGElement(SVGDocumentImpl::createElement(qualifiedName, impl));
-}
-
-// Internal
-KJS::Object SVGDocument::globalJSObject()
-{
- if(!impl) return KJS::Object();
- return impl->ecmaEngine()->globalObject();
-}
-
-KJS::ExecState *SVGDocument::globalJSExec()
-{
- if(!impl) return 0;
- return impl->ecmaEngine()->globalExec();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGDocument.cpp b/ksvg/dom/SVGDocument.cpp
new file mode 100644
index 00000000..f9d46968
--- /dev/null
+++ b/ksvg/dom/SVGDocument.cpp
@@ -0,0 +1,136 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "ksvg_ecma.h"
+
+#include "SVGDocument.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElement.h"
+#include "SVGWindow.h"
+
+using namespace KSVG;
+
+SVGDocument::SVGDocument() : DOM::Document(*(new SVGDocumentImpl()))
+{
+ impl = reinterpret_cast<SVGDocumentImpl *>(handle());
+ impl->ref();
+}
+
+SVGDocument::SVGDocument(const SVGDocument &other) : DOM::Document(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGDocument &SVGDocument::operator=(const SVGDocument &other)
+{
+ DOM::Document::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGDocument::SVGDocument(SVGDocumentImpl *other) : DOM::Document(other->handle())
+{
+ impl = other;
+
+ if(impl)
+ impl->ref();
+}
+
+SVGDocument::~SVGDocument()
+{
+ if(impl)
+ impl->deref();
+}
+
+DOM::DOMString SVGDocument::title() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->title();
+}
+
+DOM::DOMString SVGDocument::referrer() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->referrer();
+}
+
+DOM::DOMString SVGDocument::domain() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->domain();
+}
+
+DOM::DOMString SVGDocument::URL() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->URL();
+}
+
+SVGWindow SVGDocument::window() const
+{
+ if(!impl) return SVGWindow();
+ return impl->window();
+}
+
+SVGSVGElement SVGDocument::rootElement() const
+{
+ if(!impl) return SVGSVGElement(0);
+ return SVGSVGElement(impl->rootElement());
+}
+
+SVGElement SVGDocument::createElement(const DOM::DOMString &tagName)
+{
+ if(!impl) return SVGElement(0);
+
+ DOM::Element impl = DOM::Document::createElement(tagName);
+ return SVGElement(SVGDocumentImpl::createElement(tagName, impl));
+}
+
+SVGElement SVGDocument::createElementNS(const DOM::DOMString &namespaceURI, const DOM::DOMString &qualifiedName)
+{
+ if(!impl) return SVGElement(0);
+
+ DOM::Element impl = DOM::Document::createElementNS(namespaceURI, qualifiedName);
+ return SVGElement(SVGDocumentImpl::createElement(qualifiedName, impl));
+}
+
+// Internal
+KJS::Object SVGDocument::globalJSObject()
+{
+ if(!impl) return KJS::Object();
+ return impl->ecmaEngine()->globalObject();
+}
+
+KJS::ExecState *SVGDocument::globalJSExec()
+{
+ if(!impl) return 0;
+ return impl->ecmaEngine()->globalExec();
+}
diff --git a/ksvg/dom/SVGDocument.h b/ksvg/dom/SVGDocument.h
index c3f5c7bd..22f8a9c0 100644
--- a/ksvg/dom/SVGDocument.h
+++ b/ksvg/dom/SVGDocument.h
@@ -66,5 +66,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGElement.cc b/ksvg/dom/SVGElement.cc
deleted file mode 100644
index 0edef368..00000000
--- a/ksvg/dom/SVGElement.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGSVGElement.h"
-#include "SVGElement.h"
-#include "SVGElementImpl.h"
-
-using namespace KSVG;
-
-// There is no way to create a SVGElement this way! Use SVGDocument.
-SVGElement::SVGElement() : DOM::Element()
-{
- impl = 0; // new SVGElementImpl(ownerDocument().createElement().handle());
-}
-
-SVGElement::SVGElement(const SVGElement &other) : DOM::Element(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGElement &SVGElement::operator=(const SVGElement &other)
-{
- // Baseclass assignement operators always first (Niko)
- DOM::Element::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGElement::SVGElement(SVGElementImpl *other) : DOM::Element(other->handle())
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGElement::~SVGElement()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGElement::setId(DOM::DOMString value)
-{
- if(impl)
- impl->setId(value);
-}
-
-DOM::DOMString SVGElement::id()
-{
- if(!impl) return DOM::DOMString();
- return impl->id();
-}
-
-void SVGElement::setXmlbase(DOM::DOMString value)
-{
- if(impl)
- impl->setXmlbase(value);
-}
-
-DOM::DOMString SVGElement::xmlbase()
-{
- if(!impl) return DOM::DOMString();
- return impl->xmlbase();
-}
-
-SVGSVGElement SVGElement::ownerSVGElement()
-{
- if(!impl) return SVGSVGElement(0);
- return impl->ownerSVGElement();
-}
-
-SVGElement SVGElement::viewportElement()
-{
- if(!impl) return SVGElement(0);
- return impl->viewportElement();
-}
-
-void SVGElement::setAttribute(const DOM::DOMString &name, const DOM::DOMString &value)
-{
- if(impl)
- impl->setAttributeInternal(name, value);
-}
-
-DOM::DOMString SVGElement::getAttribute(const DOM::DOMString &name)
-{
- if(!impl) return DOM::DOMString();
- return impl->getAttributeInternal(name);
-}
-
-bool SVGElement::hasAttribute(const DOM::DOMString &name)
-{
- if(!impl) return false;
- return impl->hasAttribute(name);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGElement.cpp b/ksvg/dom/SVGElement.cpp
new file mode 100644
index 00000000..e753bac3
--- /dev/null
+++ b/ksvg/dom/SVGElement.cpp
@@ -0,0 +1,122 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGSVGElement.h"
+#include "SVGElement.h"
+#include "SVGElementImpl.h"
+
+using namespace KSVG;
+
+// There is no way to create a SVGElement this way! Use SVGDocument.
+SVGElement::SVGElement() : DOM::Element()
+{
+ impl = 0; // new SVGElementImpl(ownerDocument().createElement().handle());
+}
+
+SVGElement::SVGElement(const SVGElement &other) : DOM::Element(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGElement &SVGElement::operator=(const SVGElement &other)
+{
+ // Baseclass assignement operators always first (Niko)
+ DOM::Element::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGElement::SVGElement(SVGElementImpl *other) : DOM::Element(other->handle())
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGElement::~SVGElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGElement::setId(DOM::DOMString value)
+{
+ if(impl)
+ impl->setId(value);
+}
+
+DOM::DOMString SVGElement::id()
+{
+ if(!impl) return DOM::DOMString();
+ return impl->id();
+}
+
+void SVGElement::setXmlbase(DOM::DOMString value)
+{
+ if(impl)
+ impl->setXmlbase(value);
+}
+
+DOM::DOMString SVGElement::xmlbase()
+{
+ if(!impl) return DOM::DOMString();
+ return impl->xmlbase();
+}
+
+SVGSVGElement SVGElement::ownerSVGElement()
+{
+ if(!impl) return SVGSVGElement(0);
+ return impl->ownerSVGElement();
+}
+
+SVGElement SVGElement::viewportElement()
+{
+ if(!impl) return SVGElement(0);
+ return impl->viewportElement();
+}
+
+void SVGElement::setAttribute(const DOM::DOMString &name, const DOM::DOMString &value)
+{
+ if(impl)
+ impl->setAttributeInternal(name, value);
+}
+
+DOM::DOMString SVGElement::getAttribute(const DOM::DOMString &name)
+{
+ if(!impl) return DOM::DOMString();
+ return impl->getAttributeInternal(name);
+}
+
+bool SVGElement::hasAttribute(const DOM::DOMString &name)
+{
+ if(!impl) return false;
+ return impl->hasAttribute(name);
+}
diff --git a/ksvg/dom/SVGElement.h b/ksvg/dom/SVGElement.h
index 12191b05..c14db03e 100644
--- a/ksvg/dom/SVGElement.h
+++ b/ksvg/dom/SVGElement.h
@@ -79,5 +79,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGElementInstance.cc b/ksvg/dom/SVGElementInstance.cc
deleted file mode 100644
index 9bc027c0..00000000
--- a/ksvg/dom/SVGElementInstance.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGElementInstance.h"
-#include "SVGElementInstanceImpl.h"
-#include "SVGElementInstanceList.h"
-#include "SVGElement.h"
-#include "SVGUseElement.h"
-
-using namespace KSVG;
-
-SVGElementInstance::SVGElementInstance()
-{
- impl = new SVGElementInstanceImpl();
- impl->ref();
-}
-
-SVGElementInstance::SVGElementInstance(const SVGElementInstance &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGElementInstance &SVGElementInstance::operator =(const SVGElementInstance &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGElementInstance::SVGElementInstance(SVGElementInstanceImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGElementInstance::~SVGElementInstance()
-{
- if(impl)
- impl->deref();
-}
-
-SVGElement SVGElementInstance::correspondingElement() const
-{
- if(!impl) return SVGElement(0);
- return SVGElement(impl->correspondingElement());
-}
-
-SVGUseElement SVGElementInstance::correspondingUseElement() const
-{
- if(!impl) return SVGUseElement(0);
- return SVGUseElement(impl->correspondingUseElement());
-}
-
-SVGElementInstance SVGElementInstance::parentNode() const
-{
- if(!impl) return SVGElementInstance(0);
- return SVGElementInstance(impl->parentNode());
-}
-
-SVGElementInstanceList SVGElementInstance::childNodes() const
-{
- if(!impl) return SVGElementInstanceList(0);
- return SVGElementInstanceList(impl->childNodes());
-}
-
-SVGElementInstance SVGElementInstance::firstChild() const
-{
- if(!impl) return SVGElementInstance(0);
- return SVGElementInstance(impl->firstChild());
-}
-
-SVGElementInstance SVGElementInstance::lastChild() const
-{
- if(!impl) return SVGElementInstance(0);
- return SVGElementInstance(impl->lastChild());
-}
-
-SVGElementInstance SVGElementInstance::previousSibling() const
-{
- if(!impl) return SVGElementInstance(0);
- return SVGElementInstance(impl->previousSibling());
-}
-
-SVGElementInstance SVGElementInstance::nextSibling() const
-{
- if(!impl) return SVGElementInstance(0);
- return SVGElementInstance(impl->nextSibling());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGElementInstance.cpp b/ksvg/dom/SVGElementInstance.cpp
new file mode 100644
index 00000000..6af2d11e
--- /dev/null
+++ b/ksvg/dom/SVGElementInstance.cpp
@@ -0,0 +1,115 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGElementInstance.h"
+#include "SVGElementInstanceImpl.h"
+#include "SVGElementInstanceList.h"
+#include "SVGElement.h"
+#include "SVGUseElement.h"
+
+using namespace KSVG;
+
+SVGElementInstance::SVGElementInstance()
+{
+ impl = new SVGElementInstanceImpl();
+ impl->ref();
+}
+
+SVGElementInstance::SVGElementInstance(const SVGElementInstance &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGElementInstance &SVGElementInstance::operator =(const SVGElementInstance &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGElementInstance::SVGElementInstance(SVGElementInstanceImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGElementInstance::~SVGElementInstance()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGElement SVGElementInstance::correspondingElement() const
+{
+ if(!impl) return SVGElement(0);
+ return SVGElement(impl->correspondingElement());
+}
+
+SVGUseElement SVGElementInstance::correspondingUseElement() const
+{
+ if(!impl) return SVGUseElement(0);
+ return SVGUseElement(impl->correspondingUseElement());
+}
+
+SVGElementInstance SVGElementInstance::parentNode() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return SVGElementInstance(impl->parentNode());
+}
+
+SVGElementInstanceList SVGElementInstance::childNodes() const
+{
+ if(!impl) return SVGElementInstanceList(0);
+ return SVGElementInstanceList(impl->childNodes());
+}
+
+SVGElementInstance SVGElementInstance::firstChild() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return SVGElementInstance(impl->firstChild());
+}
+
+SVGElementInstance SVGElementInstance::lastChild() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return SVGElementInstance(impl->lastChild());
+}
+
+SVGElementInstance SVGElementInstance::previousSibling() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return SVGElementInstance(impl->previousSibling());
+}
+
+SVGElementInstance SVGElementInstance::nextSibling() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return SVGElementInstance(impl->nextSibling());
+}
diff --git a/ksvg/dom/SVGElementInstance.h b/ksvg/dom/SVGElementInstance.h
index 51d81831..863e1040 100644
--- a/ksvg/dom/SVGElementInstance.h
+++ b/ksvg/dom/SVGElementInstance.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGElementInstanceList.cc b/ksvg/dom/SVGElementInstanceList.cc
deleted file mode 100644
index ccc99f37..00000000
--- a/ksvg/dom/SVGElementInstanceList.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGElementInstanceList.h"
-#include "SVGElementInstanceListImpl.h"
-#include "SVGElementInstance.h"
-
-using namespace KSVG;
-
-SVGElementInstanceList::SVGElementInstanceList()
-{
- impl = new SVGElementInstanceListImpl();
- impl->ref();
-}
-
-SVGElementInstanceList::SVGElementInstanceList(const SVGElementInstanceList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGElementInstanceList &SVGElementInstanceList::operator=(const SVGElementInstanceList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGElementInstanceList::SVGElementInstanceList(SVGElementInstanceListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGElementInstanceList::~SVGElementInstanceList()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned long SVGElementInstanceList::length() const
-{
- if(!impl) return 0;
- return impl->length();
-}
-
-SVGElementInstance SVGElementInstanceList::item(unsigned long index)
-{
- if(!impl) return SVGElementInstance(0);
- return SVGElementInstance(impl->item(index));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGElementInstanceList.cpp b/ksvg/dom/SVGElementInstanceList.cpp
new file mode 100644
index 00000000..6b4fd80e
--- /dev/null
+++ b/ksvg/dom/SVGElementInstanceList.cpp
@@ -0,0 +1,77 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGElementInstanceList.h"
+#include "SVGElementInstanceListImpl.h"
+#include "SVGElementInstance.h"
+
+using namespace KSVG;
+
+SVGElementInstanceList::SVGElementInstanceList()
+{
+ impl = new SVGElementInstanceListImpl();
+ impl->ref();
+}
+
+SVGElementInstanceList::SVGElementInstanceList(const SVGElementInstanceList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGElementInstanceList &SVGElementInstanceList::operator=(const SVGElementInstanceList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGElementInstanceList::SVGElementInstanceList(SVGElementInstanceListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGElementInstanceList::~SVGElementInstanceList()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned long SVGElementInstanceList::length() const
+{
+ if(!impl) return 0;
+ return impl->length();
+}
+
+SVGElementInstance SVGElementInstanceList::item(unsigned long index)
+{
+ if(!impl) return SVGElementInstance(0);
+ return SVGElementInstance(impl->item(index));
+}
diff --git a/ksvg/dom/SVGElementInstanceList.h b/ksvg/dom/SVGElementInstanceList.h
index 9beb40ed..96177749 100644
--- a/ksvg/dom/SVGElementInstanceList.h
+++ b/ksvg/dom/SVGElementInstanceList.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGEllipseElement.cc b/ksvg/dom/SVGEllipseElement.cc
deleted file mode 100644
index 2b744ccb..00000000
--- a/ksvg/dom/SVGEllipseElement.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include "SVGEllipseElement.h"
-#include "SVGEllipseElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGEllipseElement::SVGEllipseElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGEllipseElement::SVGEllipseElement(const SVGEllipseElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGEllipseElement &SVGEllipseElement::operator=(const SVGEllipseElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGEllipseElement::SVGEllipseElement(SVGEllipseElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGEllipseElement::~SVGEllipseElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGEllipseElement::cx()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->cx());
-}
-
-SVGAnimatedLength SVGEllipseElement::cy()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->cy());
-}
-
-SVGAnimatedLength SVGEllipseElement::rx()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->rx());
-}
-
-SVGAnimatedLength SVGEllipseElement::ry()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->ry());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGEllipseElement.cpp b/ksvg/dom/SVGEllipseElement.cpp
new file mode 100644
index 00000000..36d2449e
--- /dev/null
+++ b/ksvg/dom/SVGEllipseElement.cpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "SVGEllipseElement.h"
+#include "SVGEllipseElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGEllipseElement::SVGEllipseElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGEllipseElement::SVGEllipseElement(const SVGEllipseElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGEllipseElement &SVGEllipseElement::operator=(const SVGEllipseElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGEllipseElement::SVGEllipseElement(SVGEllipseElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGEllipseElement::~SVGEllipseElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGEllipseElement::cx()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->cx());
+}
+
+SVGAnimatedLength SVGEllipseElement::cy()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->cy());
+}
+
+SVGAnimatedLength SVGEllipseElement::rx()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->rx());
+}
+
+SVGAnimatedLength SVGEllipseElement::ry()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->ry());
+}
diff --git a/ksvg/dom/SVGEllipseElement.h b/ksvg/dom/SVGEllipseElement.h
index 78399779..97d612c0 100644
--- a/ksvg/dom/SVGEllipseElement.h
+++ b/ksvg/dom/SVGEllipseElement.h
@@ -127,5 +127,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGEvent.cc b/ksvg/dom/SVGEvent.cc
deleted file mode 100644
index 19fa6d27..00000000
--- a/ksvg/dom/SVGEvent.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGEvent.h"
-#include "SVGEventImpl.h"
-
-using namespace KSVG;
-
-SVGEvent::SVGEvent() : DOM::Event()
-{
- impl = 0;
-}
-
-SVGEvent::SVGEvent(const SVGEvent &other) : DOM::Event(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGEvent &SVGEvent::operator =(const SVGEvent &other)
-{
- DOM::Event::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGEvent::SVGEvent(SVGEventImpl *other) : DOM::Event()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGEvent::~SVGEvent()
-{
- if(impl)
- impl->deref();
-}
-
-SVGEvent::EventId SVGEvent::typeToId(DOM::DOMString type)
-{
- if(type == "DOMFocusIn")
- return DOMFOCUSIN_EVENT;
- else if(type == "DOMFocusOut")
- return DOMFOCUSOUT_EVENT;
- else if(type == "DOMActivate")
- return DOMACTIVATE_EVENT;
- else if(type == "click")
- return CLICK_EVENT;
- else if(type == "mousedown")
- return MOUSEDOWN_EVENT;
- else if(type == "mouseup")
- return MOUSEUP_EVENT;
- else if(type == "mouseover")
- return MOUSEOVER_EVENT;
- else if(type == "mousemove")
- return MOUSEMOVE_EVENT;
- else if(type == "mouseout")
- return MOUSEOUT_EVENT;
- else if(type == "DOMSubtreeModified")
- return DOMSUBTREEMODIFIED_EVENT;
- else if(type == "DOMNodeInserted")
- return DOMNODEINSERTED_EVENT;
- else if(type == "DOMNodeRemoved")
- return DOMNODEREMOVED_EVENT;
- else if(type == "DOMNodeRemovedFromDocument")
- return DOMNODEREMOVEDFROMDOCUMENT_EVENT;
- else if(type == "DOMNodeInsertedIntoDocument")
- return DOMNODEINSERTEDINTODOCUMENT_EVENT;
- else if(type == "DOMAttrModified")
- return DOMATTRMODIFIED_EVENT;
- else if(type == "DOMCharacterDataModified")
- return DOMCHARACTERDATAMODIFIED_EVENT;
- else if(type == "load")
- return LOAD_EVENT;
- else if(type == "unload")
- return UNLOAD_EVENT;
- else if(type == "abort")
- return ABORT_EVENT;
- else if(type == "error")
- return ERROR_EVENT;
- else if(type == "resize")
- return RESIZE_EVENT;
- else if(type == "scroll")
- return SCROLL_EVENT;
- else if(type == "zoom")
- return ZOOM_EVENT;
- else if(type == "keydown")
- return KEYDOWN_EVENT;
- else if(type == "keyup")
- return KEYUP_EVENT;
- else if(type == "keypress")
- return KEYPRESS_EVENT;
-
- return UNKNOWN_EVENT;
-}
-
-DOM::DOMString SVGEvent::idToType(EventId id)
-{
- switch(id)
- {
- case DOMFOCUSIN_EVENT:
- return "DOMFocusIn";
- case DOMFOCUSOUT_EVENT:
- return "DOMFocusOut";
- case DOMACTIVATE_EVENT:
- return "DOMActivate";
- case CLICK_EVENT:
- return "click";
- case MOUSEDOWN_EVENT:
- return "mousedown";
- case MOUSEUP_EVENT:
- return "mouseup";
- case MOUSEOVER_EVENT:
- return "mouseover";
- case MOUSEMOVE_EVENT:
- return "mousemove";
- case MOUSEOUT_EVENT:
- return "mouseout";
- case DOMSUBTREEMODIFIED_EVENT:
- return "DOMSubtreeModified";
- case DOMNODEINSERTED_EVENT:
- return "DOMNodeInserted";
- case DOMNODEREMOVED_EVENT:
- return "DOMNodeRemoved";
- case DOMNODEREMOVEDFROMDOCUMENT_EVENT:
- return "DOMNodeRemovedFromDocument";
- case DOMNODEINSERTEDINTODOCUMENT_EVENT:
- return "DOMNodeInsertedIntoDocument";
- case DOMATTRMODIFIED_EVENT:
- return "DOMAttrModified";
- case DOMCHARACTERDATAMODIFIED_EVENT:
- return "DOMCharacterDataModified";
- case LOAD_EVENT:
- return "load";
- case UNLOAD_EVENT:
- return "unload";
- case ABORT_EVENT:
- return "abort";
- case ERROR_EVENT:
- return "error";
- case RESIZE_EVENT:
- return "resize";
- case SCROLL_EVENT:
- return "scroll";
- case ZOOM_EVENT:
- return "zoom";
- case KEYDOWN_EVENT:
- return "keydown";
- case KEYUP_EVENT:
- return "keyup";
- case KEYPRESS_EVENT:
- return "keypress";
- default:
- return DOM::DOMString();
- break;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGEvent.cpp b/ksvg/dom/SVGEvent.cpp
new file mode 100644
index 00000000..67cc8ddf
--- /dev/null
+++ b/ksvg/dom/SVGEvent.cpp
@@ -0,0 +1,185 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGEvent.h"
+#include "SVGEventImpl.h"
+
+using namespace KSVG;
+
+SVGEvent::SVGEvent() : DOM::Event()
+{
+ impl = 0;
+}
+
+SVGEvent::SVGEvent(const SVGEvent &other) : DOM::Event(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGEvent &SVGEvent::operator =(const SVGEvent &other)
+{
+ DOM::Event::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGEvent::SVGEvent(SVGEventImpl *other) : DOM::Event()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGEvent::~SVGEvent()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGEvent::EventId SVGEvent::typeToId(DOM::DOMString type)
+{
+ if(type == "DOMFocusIn")
+ return DOMFOCUSIN_EVENT;
+ else if(type == "DOMFocusOut")
+ return DOMFOCUSOUT_EVENT;
+ else if(type == "DOMActivate")
+ return DOMACTIVATE_EVENT;
+ else if(type == "click")
+ return CLICK_EVENT;
+ else if(type == "mousedown")
+ return MOUSEDOWN_EVENT;
+ else if(type == "mouseup")
+ return MOUSEUP_EVENT;
+ else if(type == "mouseover")
+ return MOUSEOVER_EVENT;
+ else if(type == "mousemove")
+ return MOUSEMOVE_EVENT;
+ else if(type == "mouseout")
+ return MOUSEOUT_EVENT;
+ else if(type == "DOMSubtreeModified")
+ return DOMSUBTREEMODIFIED_EVENT;
+ else if(type == "DOMNodeInserted")
+ return DOMNODEINSERTED_EVENT;
+ else if(type == "DOMNodeRemoved")
+ return DOMNODEREMOVED_EVENT;
+ else if(type == "DOMNodeRemovedFromDocument")
+ return DOMNODEREMOVEDFROMDOCUMENT_EVENT;
+ else if(type == "DOMNodeInsertedIntoDocument")
+ return DOMNODEINSERTEDINTODOCUMENT_EVENT;
+ else if(type == "DOMAttrModified")
+ return DOMATTRMODIFIED_EVENT;
+ else if(type == "DOMCharacterDataModified")
+ return DOMCHARACTERDATAMODIFIED_EVENT;
+ else if(type == "load")
+ return LOAD_EVENT;
+ else if(type == "unload")
+ return UNLOAD_EVENT;
+ else if(type == "abort")
+ return ABORT_EVENT;
+ else if(type == "error")
+ return ERROR_EVENT;
+ else if(type == "resize")
+ return RESIZE_EVENT;
+ else if(type == "scroll")
+ return SCROLL_EVENT;
+ else if(type == "zoom")
+ return ZOOM_EVENT;
+ else if(type == "keydown")
+ return KEYDOWN_EVENT;
+ else if(type == "keyup")
+ return KEYUP_EVENT;
+ else if(type == "keypress")
+ return KEYPRESS_EVENT;
+
+ return UNKNOWN_EVENT;
+}
+
+DOM::DOMString SVGEvent::idToType(EventId id)
+{
+ switch(id)
+ {
+ case DOMFOCUSIN_EVENT:
+ return "DOMFocusIn";
+ case DOMFOCUSOUT_EVENT:
+ return "DOMFocusOut";
+ case DOMACTIVATE_EVENT:
+ return "DOMActivate";
+ case CLICK_EVENT:
+ return "click";
+ case MOUSEDOWN_EVENT:
+ return "mousedown";
+ case MOUSEUP_EVENT:
+ return "mouseup";
+ case MOUSEOVER_EVENT:
+ return "mouseover";
+ case MOUSEMOVE_EVENT:
+ return "mousemove";
+ case MOUSEOUT_EVENT:
+ return "mouseout";
+ case DOMSUBTREEMODIFIED_EVENT:
+ return "DOMSubtreeModified";
+ case DOMNODEINSERTED_EVENT:
+ return "DOMNodeInserted";
+ case DOMNODEREMOVED_EVENT:
+ return "DOMNodeRemoved";
+ case DOMNODEREMOVEDFROMDOCUMENT_EVENT:
+ return "DOMNodeRemovedFromDocument";
+ case DOMNODEINSERTEDINTODOCUMENT_EVENT:
+ return "DOMNodeInsertedIntoDocument";
+ case DOMATTRMODIFIED_EVENT:
+ return "DOMAttrModified";
+ case DOMCHARACTERDATAMODIFIED_EVENT:
+ return "DOMCharacterDataModified";
+ case LOAD_EVENT:
+ return "load";
+ case UNLOAD_EVENT:
+ return "unload";
+ case ABORT_EVENT:
+ return "abort";
+ case ERROR_EVENT:
+ return "error";
+ case RESIZE_EVENT:
+ return "resize";
+ case SCROLL_EVENT:
+ return "scroll";
+ case ZOOM_EVENT:
+ return "zoom";
+ case KEYDOWN_EVENT:
+ return "keydown";
+ case KEYUP_EVENT:
+ return "keyup";
+ case KEYPRESS_EVENT:
+ return "keypress";
+ default:
+ return DOM::DOMString();
+ break;
+ }
+}
diff --git a/ksvg/dom/SVGEvent.h b/ksvg/dom/SVGEvent.h
index 6aebf0aa..11b2d34a 100644
--- a/ksvg/dom/SVGEvent.h
+++ b/ksvg/dom/SVGEvent.h
@@ -91,5 +91,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGException.h b/ksvg/dom/SVGException.h
index dbbe7175..a4d26e4e 100644
--- a/ksvg/dom/SVGException.h
+++ b/ksvg/dom/SVGException.h
@@ -47,5 +47,3 @@ public:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGExternalResourcesRequired.cc b/ksvg/dom/SVGExternalResourcesRequired.cc
deleted file mode 100644
index 986bf564..00000000
--- a/ksvg/dom/SVGExternalResourcesRequired.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGExternalResourcesRequired.h"
-#include "SVGExternalResourcesRequiredImpl.h"
-#include "SVGAnimatedBoolean.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGExternalResourcesRequired::SVGExternalResourcesRequired()
-{
- impl = 0;
-}
-
-SVGExternalResourcesRequired::SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGExternalResourcesRequired &SVGExternalResourcesRequired::operator=(const SVGExternalResourcesRequired &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGExternalResourcesRequired::SVGExternalResourcesRequired(SVGExternalResourcesRequiredImpl *other)
-{
- impl = other;
-}
-
-SVGExternalResourcesRequired::~SVGExternalResourcesRequired()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-SVGAnimatedBoolean SVGExternalResourcesRequired::externalResourcesRequired() const
-{
- if(!impl) return SVGAnimatedBoolean(0);
- return SVGAnimatedBoolean(impl->externalResourcesRequired());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGExternalResourcesRequired.cpp b/ksvg/dom/SVGExternalResourcesRequired.cpp
new file mode 100644
index 00000000..189d72ee
--- /dev/null
+++ b/ksvg/dom/SVGExternalResourcesRequired.cpp
@@ -0,0 +1,63 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGExternalResourcesRequired.h"
+#include "SVGExternalResourcesRequiredImpl.h"
+#include "SVGAnimatedBoolean.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGExternalResourcesRequired::SVGExternalResourcesRequired()
+{
+ impl = 0;
+}
+
+SVGExternalResourcesRequired::SVGExternalResourcesRequired(const SVGExternalResourcesRequired &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGExternalResourcesRequired &SVGExternalResourcesRequired::operator=(const SVGExternalResourcesRequired &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGExternalResourcesRequired::SVGExternalResourcesRequired(SVGExternalResourcesRequiredImpl *other)
+{
+ impl = other;
+}
+
+SVGExternalResourcesRequired::~SVGExternalResourcesRequired()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+SVGAnimatedBoolean SVGExternalResourcesRequired::externalResourcesRequired() const
+{
+ if(!impl) return SVGAnimatedBoolean(0);
+ return SVGAnimatedBoolean(impl->externalResourcesRequired());
+}
diff --git a/ksvg/dom/SVGExternalResourcesRequired.h b/ksvg/dom/SVGExternalResourcesRequired.h
index e3668881..aa8f87a6 100644
--- a/ksvg/dom/SVGExternalResourcesRequired.h
+++ b/ksvg/dom/SVGExternalResourcesRequired.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEBlendElement.cc b/ksvg/dom/SVGFEBlendElement.cc
deleted file mode 100644
index c991d18c..00000000
--- a/ksvg/dom/SVGFEBlendElement.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEBlendElement.h"
-#include "SVGFEBlendElementImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGFEBlendElement::SVGFEBlendElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEBlendElement::SVGFEBlendElement(const SVGFEBlendElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEBlendElement &SVGFEBlendElement::operator =(const SVGFEBlendElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEBlendElement::SVGFEBlendElement(SVGFEBlendElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEBlendElement::~SVGFEBlendElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEBlendElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedString SVGFEBlendElement::in2() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in2());
-}
-
-SVGAnimatedEnumeration SVGFEBlendElement::mode() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->mode());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEBlendElement.cpp b/ksvg/dom/SVGFEBlendElement.cpp
new file mode 100644
index 00000000..f0fe7b8b
--- /dev/null
+++ b/ksvg/dom/SVGFEBlendElement.cpp
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEBlendElement.h"
+#include "SVGFEBlendElementImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGFEBlendElement::SVGFEBlendElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEBlendElement::SVGFEBlendElement(const SVGFEBlendElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEBlendElement &SVGFEBlendElement::operator =(const SVGFEBlendElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEBlendElement::SVGFEBlendElement(SVGFEBlendElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEBlendElement::~SVGFEBlendElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEBlendElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedString SVGFEBlendElement::in2() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in2());
+}
+
+SVGAnimatedEnumeration SVGFEBlendElement::mode() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->mode());
+}
diff --git a/ksvg/dom/SVGFEBlendElement.h b/ksvg/dom/SVGFEBlendElement.h
index 91c64b3f..86eea6c3 100644
--- a/ksvg/dom/SVGFEBlendElement.h
+++ b/ksvg/dom/SVGFEBlendElement.h
@@ -64,5 +64,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEColorMatrixElement.cc b/ksvg/dom/SVGFEColorMatrixElement.cc
deleted file mode 100644
index 1f77ac0e..00000000
--- a/ksvg/dom/SVGFEColorMatrixElement.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEColorMatrixElement.h"
-#include "SVGFEColorMatrixElementImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumberList.h"
-
-using namespace KSVG;
-
-SVGFEColorMatrixElement::SVGFEColorMatrixElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEColorMatrixElement::SVGFEColorMatrixElement(const SVGFEColorMatrixElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEColorMatrixElement &SVGFEColorMatrixElement::operator =(const SVGFEColorMatrixElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEColorMatrixElement::SVGFEColorMatrixElement(SVGFEColorMatrixElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEColorMatrixElement::~SVGFEColorMatrixElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEColorMatrixElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedEnumeration SVGFEColorMatrixElement::type() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->type());
-}
-
-SVGAnimatedNumberList SVGFEColorMatrixElement::values() const
-{
- if(!impl) return SVGAnimatedNumberList(0);
- return SVGAnimatedNumberList(impl->values());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEColorMatrixElement.cpp b/ksvg/dom/SVGFEColorMatrixElement.cpp
new file mode 100644
index 00000000..5c4c5104
--- /dev/null
+++ b/ksvg/dom/SVGFEColorMatrixElement.cpp
@@ -0,0 +1,87 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEColorMatrixElement.h"
+#include "SVGFEColorMatrixElementImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedNumberList.h"
+
+using namespace KSVG;
+
+SVGFEColorMatrixElement::SVGFEColorMatrixElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEColorMatrixElement::SVGFEColorMatrixElement(const SVGFEColorMatrixElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEColorMatrixElement &SVGFEColorMatrixElement::operator =(const SVGFEColorMatrixElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEColorMatrixElement::SVGFEColorMatrixElement(SVGFEColorMatrixElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEColorMatrixElement::~SVGFEColorMatrixElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEColorMatrixElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedEnumeration SVGFEColorMatrixElement::type() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->type());
+}
+
+SVGAnimatedNumberList SVGFEColorMatrixElement::values() const
+{
+ if(!impl) return SVGAnimatedNumberList(0);
+ return SVGAnimatedNumberList(impl->values());
+}
diff --git a/ksvg/dom/SVGFEColorMatrixElement.h b/ksvg/dom/SVGFEColorMatrixElement.h
index bbe51f16..6667369f 100644
--- a/ksvg/dom/SVGFEColorMatrixElement.h
+++ b/ksvg/dom/SVGFEColorMatrixElement.h
@@ -64,5 +64,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEComponentTransferElement.cc b/ksvg/dom/SVGFEComponentTransferElement.cc
deleted file mode 100644
index ea0d7490..00000000
--- a/ksvg/dom/SVGFEComponentTransferElement.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEComponentTransferElement.h"
-#include "SVGFEComponentTransferElementImpl.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGFEComponentTransferElement::SVGFEComponentTransferElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEComponentTransferElement::SVGFEComponentTransferElement(const SVGFEComponentTransferElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEComponentTransferElement &SVGFEComponentTransferElement::operator =(const SVGFEComponentTransferElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEComponentTransferElement::SVGFEComponentTransferElement(SVGFEComponentTransferElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEComponentTransferElement::~SVGFEComponentTransferElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEComponentTransferElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEComponentTransferElement.cpp b/ksvg/dom/SVGFEComponentTransferElement.cpp
new file mode 100644
index 00000000..bc96a48d
--- /dev/null
+++ b/ksvg/dom/SVGFEComponentTransferElement.cpp
@@ -0,0 +1,73 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEComponentTransferElement.h"
+#include "SVGFEComponentTransferElementImpl.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGFEComponentTransferElement::SVGFEComponentTransferElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEComponentTransferElement::SVGFEComponentTransferElement(const SVGFEComponentTransferElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEComponentTransferElement &SVGFEComponentTransferElement::operator =(const SVGFEComponentTransferElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEComponentTransferElement::SVGFEComponentTransferElement(SVGFEComponentTransferElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEComponentTransferElement::~SVGFEComponentTransferElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEComponentTransferElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
diff --git a/ksvg/dom/SVGFEComponentTransferElement.h b/ksvg/dom/SVGFEComponentTransferElement.h
index c387a4ca..bbf1c6b5 100644
--- a/ksvg/dom/SVGFEComponentTransferElement.h
+++ b/ksvg/dom/SVGFEComponentTransferElement.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFECompositeElement.cc b/ksvg/dom/SVGFECompositeElement.cc
deleted file mode 100644
index 61cf4352..00000000
--- a/ksvg/dom/SVGFECompositeElement.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFECompositeElement.h"
-#include "SVGFECompositeElementImpl.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGFECompositeElement::SVGFECompositeElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFECompositeElement::SVGFECompositeElement(const SVGFECompositeElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFECompositeElement &SVGFECompositeElement::operator =(const SVGFECompositeElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFECompositeElement::SVGFECompositeElement(SVGFECompositeElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFECompositeElement::~SVGFECompositeElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFECompositeElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedString SVGFECompositeElement::in2() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in2());
-}
-
-SVGAnimatedEnumeration SVGFECompositeElement::Operator() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->Operator());
-}
-
-SVGAnimatedNumber SVGFECompositeElement::k1() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->k1());
-}
-
-SVGAnimatedNumber SVGFECompositeElement::k2() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->k2());
-}
-
-SVGAnimatedNumber SVGFECompositeElement::k3() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->k3());
-}
-
-SVGAnimatedNumber SVGFECompositeElement::k4() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->k4());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFECompositeElement.cpp b/ksvg/dom/SVGFECompositeElement.cpp
new file mode 100644
index 00000000..b7ff69f5
--- /dev/null
+++ b/ksvg/dom/SVGFECompositeElement.cpp
@@ -0,0 +1,111 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFECompositeElement.h"
+#include "SVGFECompositeElementImpl.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGFECompositeElement::SVGFECompositeElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFECompositeElement::SVGFECompositeElement(const SVGFECompositeElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFECompositeElement &SVGFECompositeElement::operator =(const SVGFECompositeElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFECompositeElement::SVGFECompositeElement(SVGFECompositeElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFECompositeElement::~SVGFECompositeElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFECompositeElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedString SVGFECompositeElement::in2() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in2());
+}
+
+SVGAnimatedEnumeration SVGFECompositeElement::Operator() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->Operator());
+}
+
+SVGAnimatedNumber SVGFECompositeElement::k1() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->k1());
+}
+
+SVGAnimatedNumber SVGFECompositeElement::k2() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->k2());
+}
+
+SVGAnimatedNumber SVGFECompositeElement::k3() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->k3());
+}
+
+SVGAnimatedNumber SVGFECompositeElement::k4() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->k4());
+}
diff --git a/ksvg/dom/SVGFECompositeElement.h b/ksvg/dom/SVGFECompositeElement.h
index dcfa1817..376d8158 100644
--- a/ksvg/dom/SVGFECompositeElement.h
+++ b/ksvg/dom/SVGFECompositeElement.h
@@ -70,5 +70,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEConvolveMatrixElement.cc b/ksvg/dom/SVGFEConvolveMatrixElement.cc
deleted file mode 100644
index 5ecc292c..00000000
--- a/ksvg/dom/SVGFEConvolveMatrixElement.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEConvolveMatrixElement.h"
-#include "SVGFEConvolveMatrixElementImpl.h"
-#include "SVGAnimatedInteger.h"
-#include "SVGAnimatedNumberList.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedLength.h"
-#include "SVGAnimatedBoolean.h"
-
-using namespace KSVG;
-
-SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const SVGFEConvolveMatrixElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEConvolveMatrixElement &SVGFEConvolveMatrixElement::operator =(const SVGFEConvolveMatrixElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(SVGFEConvolveMatrixElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEConvolveMatrixElement::~SVGFEConvolveMatrixElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedInteger SVGFEConvolveMatrixElement::orderX() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->orderX());
-}
-
-SVGAnimatedInteger SVGFEConvolveMatrixElement::orderY() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->orderY());
-}
-
-SVGAnimatedNumberList SVGFEConvolveMatrixElement::kernelMatrix() const
-{
- if(!impl) return SVGAnimatedNumberList(0);
- return SVGAnimatedNumberList(impl->kernelMatrix());
-}
-
-SVGAnimatedNumber SVGFEConvolveMatrixElement::divisor() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->divisor());
-}
-
-SVGAnimatedNumber SVGFEConvolveMatrixElement::bias() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->bias());
-}
-
-SVGAnimatedInteger SVGFEConvolveMatrixElement::targetX() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->targetX());
-}
-
-SVGAnimatedInteger SVGFEConvolveMatrixElement::targetY() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->targetY());
-}
-
-SVGAnimatedEnumeration SVGFEConvolveMatrixElement::edgeMode() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->edgeMode());
-}
-
-SVGAnimatedLength SVGFEConvolveMatrixElement::kernelUnitLengthX() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->kernelUnitLengthX());
-}
-
-SVGAnimatedLength SVGFEConvolveMatrixElement::kernelUnitLengthY() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->kernelUnitLengthY());
-}
-
-SVGAnimatedBoolean SVGFEConvolveMatrixElement::preserveAlpha() const
-{
- if(!impl) return SVGAnimatedBoolean(0);
- return SVGAnimatedBoolean(impl->preserveAlpha());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEConvolveMatrixElement.cpp b/ksvg/dom/SVGFEConvolveMatrixElement.cpp
new file mode 100644
index 00000000..7f66b8b4
--- /dev/null
+++ b/ksvg/dom/SVGFEConvolveMatrixElement.cpp
@@ -0,0 +1,138 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEConvolveMatrixElement.h"
+#include "SVGFEConvolveMatrixElementImpl.h"
+#include "SVGAnimatedInteger.h"
+#include "SVGAnimatedNumberList.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedBoolean.h"
+
+using namespace KSVG;
+
+SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const SVGFEConvolveMatrixElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEConvolveMatrixElement &SVGFEConvolveMatrixElement::operator =(const SVGFEConvolveMatrixElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(SVGFEConvolveMatrixElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEConvolveMatrixElement::~SVGFEConvolveMatrixElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedInteger SVGFEConvolveMatrixElement::orderX() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->orderX());
+}
+
+SVGAnimatedInteger SVGFEConvolveMatrixElement::orderY() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->orderY());
+}
+
+SVGAnimatedNumberList SVGFEConvolveMatrixElement::kernelMatrix() const
+{
+ if(!impl) return SVGAnimatedNumberList(0);
+ return SVGAnimatedNumberList(impl->kernelMatrix());
+}
+
+SVGAnimatedNumber SVGFEConvolveMatrixElement::divisor() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->divisor());
+}
+
+SVGAnimatedNumber SVGFEConvolveMatrixElement::bias() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->bias());
+}
+
+SVGAnimatedInteger SVGFEConvolveMatrixElement::targetX() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->targetX());
+}
+
+SVGAnimatedInteger SVGFEConvolveMatrixElement::targetY() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->targetY());
+}
+
+SVGAnimatedEnumeration SVGFEConvolveMatrixElement::edgeMode() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->edgeMode());
+}
+
+SVGAnimatedLength SVGFEConvolveMatrixElement::kernelUnitLengthX() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->kernelUnitLengthX());
+}
+
+SVGAnimatedLength SVGFEConvolveMatrixElement::kernelUnitLengthY() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->kernelUnitLengthY());
+}
+
+SVGAnimatedBoolean SVGFEConvolveMatrixElement::preserveAlpha() const
+{
+ if(!impl) return SVGAnimatedBoolean(0);
+ return SVGAnimatedBoolean(impl->preserveAlpha());
+}
diff --git a/ksvg/dom/SVGFEConvolveMatrixElement.h b/ksvg/dom/SVGFEConvolveMatrixElement.h
index 88a7ed00..d2c6f67f 100644
--- a/ksvg/dom/SVGFEConvolveMatrixElement.h
+++ b/ksvg/dom/SVGFEConvolveMatrixElement.h
@@ -74,5 +74,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEDiffuseLightingElement.cc b/ksvg/dom/SVGFEDiffuseLightingElement.cc
deleted file mode 100644
index eba5935f..00000000
--- a/ksvg/dom/SVGFEDiffuseLightingElement.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEDiffuseLightingElement.h"
-#include "SVGFEDiffuseLightingElementImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedNumber.h"
-
-using namespace KSVG;
-
-SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const SVGFEDiffuseLightingElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEDiffuseLightingElement &SVGFEDiffuseLightingElement::operator =(const SVGFEDiffuseLightingElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(SVGFEDiffuseLightingElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEDiffuseLightingElement::~SVGFEDiffuseLightingElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEDiffuseLightingElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedNumber SVGFEDiffuseLightingElement::surfaceScale() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->surfaceScale());
-}
-
-SVGAnimatedNumber SVGFEDiffuseLightingElement::diffuseConstant() const
-{
- if(!impl) return SVGAnimatedNumber();
- return SVGAnimatedNumber(impl->diffuseConstant());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEDiffuseLightingElement.cpp b/ksvg/dom/SVGFEDiffuseLightingElement.cpp
new file mode 100644
index 00000000..6e084f25
--- /dev/null
+++ b/ksvg/dom/SVGFEDiffuseLightingElement.cpp
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEDiffuseLightingElement.h"
+#include "SVGFEDiffuseLightingElementImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedNumber.h"
+
+using namespace KSVG;
+
+SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const SVGFEDiffuseLightingElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEDiffuseLightingElement &SVGFEDiffuseLightingElement::operator =(const SVGFEDiffuseLightingElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(SVGFEDiffuseLightingElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEDiffuseLightingElement::~SVGFEDiffuseLightingElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEDiffuseLightingElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedNumber SVGFEDiffuseLightingElement::surfaceScale() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->surfaceScale());
+}
+
+SVGAnimatedNumber SVGFEDiffuseLightingElement::diffuseConstant() const
+{
+ if(!impl) return SVGAnimatedNumber();
+ return SVGAnimatedNumber(impl->diffuseConstant());
+}
diff --git a/ksvg/dom/SVGFEDiffuseLightingElement.h b/ksvg/dom/SVGFEDiffuseLightingElement.h
index 6356d996..2da2c572 100644
--- a/ksvg/dom/SVGFEDiffuseLightingElement.h
+++ b/ksvg/dom/SVGFEDiffuseLightingElement.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEDisplacementMapElement.cc b/ksvg/dom/SVGFEDisplacementMapElement.cc
deleted file mode 100644
index 7c41fd3e..00000000
--- a/ksvg/dom/SVGFEDisplacementMapElement.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEDisplacementMapElement.h"
-#include "SVGFEDisplacementMapElementImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGFEDisplacementMapElement::SVGFEDisplacementMapElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const SVGFEDisplacementMapElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEDisplacementMapElement &SVGFEDisplacementMapElement::operator =(const SVGFEDisplacementMapElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(SVGFEDisplacementMapElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEDisplacementMapElement::~SVGFEDisplacementMapElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEDisplacementMapElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedString SVGFEDisplacementMapElement::in2() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in2());
-}
-
-SVGAnimatedNumber SVGFEDisplacementMapElement::scale() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->scale());
-}
-
-SVGAnimatedEnumeration SVGFEDisplacementMapElement::xChannelSelector() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->xChannelSelector());
-}
-
-SVGAnimatedEnumeration SVGFEDisplacementMapElement::yChannelSelector() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->yChannelSelector());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEDisplacementMapElement.cpp b/ksvg/dom/SVGFEDisplacementMapElement.cpp
new file mode 100644
index 00000000..9bb4938e
--- /dev/null
+++ b/ksvg/dom/SVGFEDisplacementMapElement.cpp
@@ -0,0 +1,99 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEDisplacementMapElement.h"
+#include "SVGFEDisplacementMapElementImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGFEDisplacementMapElement::SVGFEDisplacementMapElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const SVGFEDisplacementMapElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEDisplacementMapElement &SVGFEDisplacementMapElement::operator =(const SVGFEDisplacementMapElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(SVGFEDisplacementMapElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEDisplacementMapElement::~SVGFEDisplacementMapElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEDisplacementMapElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedString SVGFEDisplacementMapElement::in2() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in2());
+}
+
+SVGAnimatedNumber SVGFEDisplacementMapElement::scale() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->scale());
+}
+
+SVGAnimatedEnumeration SVGFEDisplacementMapElement::xChannelSelector() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->xChannelSelector());
+}
+
+SVGAnimatedEnumeration SVGFEDisplacementMapElement::yChannelSelector() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->yChannelSelector());
+}
diff --git a/ksvg/dom/SVGFEDisplacementMapElement.h b/ksvg/dom/SVGFEDisplacementMapElement.h
index ee591ca4..1da3e439 100644
--- a/ksvg/dom/SVGFEDisplacementMapElement.h
+++ b/ksvg/dom/SVGFEDisplacementMapElement.h
@@ -65,5 +65,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEDistantLightElement.cc b/ksvg/dom/SVGFEDistantLightElement.cc
deleted file mode 100644
index 92371abc..00000000
--- a/ksvg/dom/SVGFEDistantLightElement.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEDistantLightElement.h"
-#include "SVGFEDistantLightElementImpl.h"
-#include "SVGAnimatedNumber.h"
-
-using namespace KSVG;
-
-SVGFEDistantLightElement::SVGFEDistantLightElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFEDistantLightElement::SVGFEDistantLightElement(const SVGFEDistantLightElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEDistantLightElement &SVGFEDistantLightElement::operator =(const SVGFEDistantLightElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEDistantLightElement::SVGFEDistantLightElement(SVGFEDistantLightElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEDistantLightElement::~SVGFEDistantLightElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedNumber SVGFEDistantLightElement::azimuth() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->azimuth());
-}
-
-SVGAnimatedNumber SVGFEDistantLightElement::elevation() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->elevation());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEDistantLightElement.cpp b/ksvg/dom/SVGFEDistantLightElement.cpp
new file mode 100644
index 00000000..5e5f4f30
--- /dev/null
+++ b/ksvg/dom/SVGFEDistantLightElement.cpp
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEDistantLightElement.h"
+#include "SVGFEDistantLightElementImpl.h"
+#include "SVGAnimatedNumber.h"
+
+using namespace KSVG;
+
+SVGFEDistantLightElement::SVGFEDistantLightElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFEDistantLightElement::SVGFEDistantLightElement(const SVGFEDistantLightElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEDistantLightElement &SVGFEDistantLightElement::operator =(const SVGFEDistantLightElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEDistantLightElement::SVGFEDistantLightElement(SVGFEDistantLightElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEDistantLightElement::~SVGFEDistantLightElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedNumber SVGFEDistantLightElement::azimuth() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->azimuth());
+}
+
+SVGAnimatedNumber SVGFEDistantLightElement::elevation() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->elevation());
+}
diff --git a/ksvg/dom/SVGFEDistantLightElement.h b/ksvg/dom/SVGFEDistantLightElement.h
index 4b2c926a..a5c7ac49 100644
--- a/ksvg/dom/SVGFEDistantLightElement.h
+++ b/ksvg/dom/SVGFEDistantLightElement.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFloodElement.cc b/ksvg/dom/SVGFEFloodElement.cc
deleted file mode 100644
index 7b0b320c..00000000
--- a/ksvg/dom/SVGFEFloodElement.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFloodElement.h"
-#include "SVGFEFloodElementImpl.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGFEFloodElement::SVGFEFloodElement() : SVGElement(), SVGStylable(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEFloodElement::SVGFEFloodElement(const SVGFEFloodElement &other) : SVGElement(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEFloodElement &SVGFEFloodElement::operator =(const SVGFEFloodElement &other)
-{
- SVGElement::operator=(other);
- SVGStylable::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEFloodElement::SVGFEFloodElement(SVGFEFloodElementImpl *other) : SVGElement(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEFloodElement::~SVGFEFloodElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEFloodElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFloodElement.cpp b/ksvg/dom/SVGFEFloodElement.cpp
new file mode 100644
index 00000000..0689cb10
--- /dev/null
+++ b/ksvg/dom/SVGFEFloodElement.cpp
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFloodElement.h"
+#include "SVGFEFloodElementImpl.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGFEFloodElement::SVGFEFloodElement() : SVGElement(), SVGStylable(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEFloodElement::SVGFEFloodElement(const SVGFEFloodElement &other) : SVGElement(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEFloodElement &SVGFEFloodElement::operator =(const SVGFEFloodElement &other)
+{
+ SVGElement::operator=(other);
+ SVGStylable::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEFloodElement::SVGFEFloodElement(SVGFEFloodElementImpl *other) : SVGElement(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEFloodElement::~SVGFEFloodElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEFloodElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
diff --git a/ksvg/dom/SVGFEFloodElement.h b/ksvg/dom/SVGFEFloodElement.h
index 401e056b..8c5b884a 100644
--- a/ksvg/dom/SVGFEFloodElement.h
+++ b/ksvg/dom/SVGFEFloodElement.h
@@ -53,5 +53,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncAElement.cc b/ksvg/dom/SVGFEFuncAElement.cc
deleted file mode 100644
index cd0e9f10..00000000
--- a/ksvg/dom/SVGFEFuncAElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncAElement.h"
-#include "SVGFEFuncAElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncAElement::SVGFEFuncAElement() : SVGComponentTransferFunctionElement()
-{
- impl = 0;
-}
-
-SVGFEFuncAElement::SVGFEFuncAElement(const SVGFEFuncAElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEFuncAElement &SVGFEFuncAElement::operator =(const SVGFEFuncAElement &other)
-{
- SVGComponentTransferFunctionElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEFuncAElement::SVGFEFuncAElement(SVGFEFuncAElementImpl *other) : SVGComponentTransferFunctionElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEFuncAElement::~SVGFEFuncAElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncAElement.cpp b/ksvg/dom/SVGFEFuncAElement.cpp
new file mode 100644
index 00000000..00db637e
--- /dev/null
+++ b/ksvg/dom/SVGFEFuncAElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncAElement.h"
+#include "SVGFEFuncAElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncAElement::SVGFEFuncAElement() : SVGComponentTransferFunctionElement()
+{
+ impl = 0;
+}
+
+SVGFEFuncAElement::SVGFEFuncAElement(const SVGFEFuncAElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEFuncAElement &SVGFEFuncAElement::operator =(const SVGFEFuncAElement &other)
+{
+ SVGComponentTransferFunctionElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEFuncAElement::SVGFEFuncAElement(SVGFEFuncAElementImpl *other) : SVGComponentTransferFunctionElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEFuncAElement::~SVGFEFuncAElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFEFuncAElement.h b/ksvg/dom/SVGFEFuncAElement.h
index 64287f27..d22f4405 100644
--- a/ksvg/dom/SVGFEFuncAElement.h
+++ b/ksvg/dom/SVGFEFuncAElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncBElement.cc b/ksvg/dom/SVGFEFuncBElement.cc
deleted file mode 100644
index 2cf0fdb0..00000000
--- a/ksvg/dom/SVGFEFuncBElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncBElement.h"
-#include "SVGFEFuncBElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncBElement::SVGFEFuncBElement() : SVGComponentTransferFunctionElement()
-{
- impl = 0;
-}
-
-SVGFEFuncBElement::SVGFEFuncBElement(const SVGFEFuncBElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEFuncBElement &SVGFEFuncBElement::operator =(const SVGFEFuncBElement &other)
-{
- SVGComponentTransferFunctionElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEFuncBElement::SVGFEFuncBElement(SVGFEFuncBElementImpl *other) : SVGComponentTransferFunctionElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEFuncBElement::~SVGFEFuncBElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncBElement.cpp b/ksvg/dom/SVGFEFuncBElement.cpp
new file mode 100644
index 00000000..01e060f3
--- /dev/null
+++ b/ksvg/dom/SVGFEFuncBElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncBElement.h"
+#include "SVGFEFuncBElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncBElement::SVGFEFuncBElement() : SVGComponentTransferFunctionElement()
+{
+ impl = 0;
+}
+
+SVGFEFuncBElement::SVGFEFuncBElement(const SVGFEFuncBElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEFuncBElement &SVGFEFuncBElement::operator =(const SVGFEFuncBElement &other)
+{
+ SVGComponentTransferFunctionElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEFuncBElement::SVGFEFuncBElement(SVGFEFuncBElementImpl *other) : SVGComponentTransferFunctionElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEFuncBElement::~SVGFEFuncBElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFEFuncBElement.h b/ksvg/dom/SVGFEFuncBElement.h
index 2eacbbc3..61c3437f 100644
--- a/ksvg/dom/SVGFEFuncBElement.h
+++ b/ksvg/dom/SVGFEFuncBElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncGElement.cc b/ksvg/dom/SVGFEFuncGElement.cc
deleted file mode 100644
index ef8fdfea..00000000
--- a/ksvg/dom/SVGFEFuncGElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncGElement.h"
-#include "SVGFEFuncGElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncGElement::SVGFEFuncGElement() : SVGComponentTransferFunctionElement()
-{
- impl = 0;
-}
-
-SVGFEFuncGElement::SVGFEFuncGElement(const SVGFEFuncGElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEFuncGElement &SVGFEFuncGElement::operator =(const SVGFEFuncGElement &other)
-{
- SVGComponentTransferFunctionElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEFuncGElement::SVGFEFuncGElement(SVGFEFuncGElementImpl *other) : SVGComponentTransferFunctionElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEFuncGElement::~SVGFEFuncGElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncGElement.cpp b/ksvg/dom/SVGFEFuncGElement.cpp
new file mode 100644
index 00000000..c4af7f36
--- /dev/null
+++ b/ksvg/dom/SVGFEFuncGElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncGElement.h"
+#include "SVGFEFuncGElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncGElement::SVGFEFuncGElement() : SVGComponentTransferFunctionElement()
+{
+ impl = 0;
+}
+
+SVGFEFuncGElement::SVGFEFuncGElement(const SVGFEFuncGElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEFuncGElement &SVGFEFuncGElement::operator =(const SVGFEFuncGElement &other)
+{
+ SVGComponentTransferFunctionElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEFuncGElement::SVGFEFuncGElement(SVGFEFuncGElementImpl *other) : SVGComponentTransferFunctionElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEFuncGElement::~SVGFEFuncGElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFEFuncGElement.h b/ksvg/dom/SVGFEFuncGElement.h
index 09c98195..1b257ad4 100644
--- a/ksvg/dom/SVGFEFuncGElement.h
+++ b/ksvg/dom/SVGFEFuncGElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncRElement.cc b/ksvg/dom/SVGFEFuncRElement.cc
deleted file mode 100644
index 2020e33c..00000000
--- a/ksvg/dom/SVGFEFuncRElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncRElement.h"
-#include "SVGFEFuncRElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncRElement::SVGFEFuncRElement() : SVGComponentTransferFunctionElement()
-{
- impl = 0;
-}
-
-SVGFEFuncRElement::SVGFEFuncRElement(const SVGFEFuncRElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEFuncRElement &SVGFEFuncRElement::operator =(const SVGFEFuncRElement &other)
-{
- SVGComponentTransferFunctionElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEFuncRElement::SVGFEFuncRElement(SVGFEFuncRElementImpl *other) : SVGComponentTransferFunctionElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEFuncRElement::~SVGFEFuncRElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEFuncRElement.cpp b/ksvg/dom/SVGFEFuncRElement.cpp
new file mode 100644
index 00000000..59b87ea2
--- /dev/null
+++ b/ksvg/dom/SVGFEFuncRElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncRElement.h"
+#include "SVGFEFuncRElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncRElement::SVGFEFuncRElement() : SVGComponentTransferFunctionElement()
+{
+ impl = 0;
+}
+
+SVGFEFuncRElement::SVGFEFuncRElement(const SVGFEFuncRElement &other) : SVGComponentTransferFunctionElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEFuncRElement &SVGFEFuncRElement::operator =(const SVGFEFuncRElement &other)
+{
+ SVGComponentTransferFunctionElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEFuncRElement::SVGFEFuncRElement(SVGFEFuncRElementImpl *other) : SVGComponentTransferFunctionElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEFuncRElement::~SVGFEFuncRElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFEFuncRElement.h b/ksvg/dom/SVGFEFuncRElement.h
index 1a58ef15..bbe0641f 100644
--- a/ksvg/dom/SVGFEFuncRElement.h
+++ b/ksvg/dom/SVGFEFuncRElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEGaussianBlurElement.cc b/ksvg/dom/SVGFEGaussianBlurElement.cc
deleted file mode 100644
index 2daaa8b8..00000000
--- a/ksvg/dom/SVGFEGaussianBlurElement.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEGaussianBlurElement.h"
-#include "SVGFEGaussianBlurElementImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedNumber.h"
-
-using namespace KSVG;
-
-SVGFEGaussianBlurElement::SVGFEGaussianBlurElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const SVGFEGaussianBlurElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEGaussianBlurElement &SVGFEGaussianBlurElement::operator =(const SVGFEGaussianBlurElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(SVGFEGaussianBlurElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEGaussianBlurElement::~SVGFEGaussianBlurElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEGaussianBlurElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedNumber SVGFEGaussianBlurElement::stdDeviationX() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->stdDeviationX());
-}
-
-SVGAnimatedNumber SVGFEGaussianBlurElement::stdDeviationY() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->stdDeviationY());
-}
-
-void SVGFEGaussianBlurElement::setStdDeviation(float stdDeviationX, float stdDeviationY)
-{
- if(impl)
- impl->setStdDeviation(stdDeviationX, stdDeviationY);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEGaussianBlurElement.cpp b/ksvg/dom/SVGFEGaussianBlurElement.cpp
new file mode 100644
index 00000000..b3b9d9f7
--- /dev/null
+++ b/ksvg/dom/SVGFEGaussianBlurElement.cpp
@@ -0,0 +1,92 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEGaussianBlurElement.h"
+#include "SVGFEGaussianBlurElementImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedNumber.h"
+
+using namespace KSVG;
+
+SVGFEGaussianBlurElement::SVGFEGaussianBlurElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const SVGFEGaussianBlurElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEGaussianBlurElement &SVGFEGaussianBlurElement::operator =(const SVGFEGaussianBlurElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(SVGFEGaussianBlurElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEGaussianBlurElement::~SVGFEGaussianBlurElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEGaussianBlurElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedNumber SVGFEGaussianBlurElement::stdDeviationX() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->stdDeviationX());
+}
+
+SVGAnimatedNumber SVGFEGaussianBlurElement::stdDeviationY() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->stdDeviationY());
+}
+
+void SVGFEGaussianBlurElement::setStdDeviation(float stdDeviationX, float stdDeviationY)
+{
+ if(impl)
+ impl->setStdDeviation(stdDeviationX, stdDeviationY);
+}
diff --git a/ksvg/dom/SVGFEGaussianBlurElement.h b/ksvg/dom/SVGFEGaussianBlurElement.h
index a920ea68..13e0422a 100644
--- a/ksvg/dom/SVGFEGaussianBlurElement.h
+++ b/ksvg/dom/SVGFEGaussianBlurElement.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEImageElement.cc b/ksvg/dom/SVGFEImageElement.cc
deleted file mode 100644
index 6781edb6..00000000
--- a/ksvg/dom/SVGFEImageElement.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEImageElement.h"
-#include "SVGFEImageElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEImageElement::SVGFEImageElement() : SVGElement(), SVGURIReference(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEImageElement::SVGFEImageElement(const SVGFEImageElement &other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEImageElement &SVGFEImageElement::operator =(const SVGFEImageElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEImageElement::SVGFEImageElement(SVGFEImageElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEImageElement::~SVGFEImageElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEImageElement.cpp b/ksvg/dom/SVGFEImageElement.cpp
new file mode 100644
index 00000000..d0708306
--- /dev/null
+++ b/ksvg/dom/SVGFEImageElement.cpp
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEImageElement.h"
+#include "SVGFEImageElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEImageElement::SVGFEImageElement() : SVGElement(), SVGURIReference(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEImageElement::SVGFEImageElement(const SVGFEImageElement &other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEImageElement &SVGFEImageElement::operator =(const SVGFEImageElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEImageElement::SVGFEImageElement(SVGFEImageElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEImageElement::~SVGFEImageElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFEImageElement.h b/ksvg/dom/SVGFEImageElement.h
index 2c8d5b38..c4298f76 100644
--- a/ksvg/dom/SVGFEImageElement.h
+++ b/ksvg/dom/SVGFEImageElement.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEMergeElement.cc b/ksvg/dom/SVGFEMergeElement.cc
deleted file mode 100644
index 8440cd53..00000000
--- a/ksvg/dom/SVGFEMergeElement.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEMergeElement.h"
-#include "SVGFEMergeElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEMergeElement::SVGFEMergeElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEMergeElement::SVGFEMergeElement(const SVGFEMergeElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEMergeElement &SVGFEMergeElement::operator =(const SVGFEMergeElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEMergeElement::SVGFEMergeElement(SVGFEMergeElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEMergeElement::~SVGFEMergeElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEMergeElement.cpp b/ksvg/dom/SVGFEMergeElement.cpp
new file mode 100644
index 00000000..7398bf9b
--- /dev/null
+++ b/ksvg/dom/SVGFEMergeElement.cpp
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEMergeElement.h"
+#include "SVGFEMergeElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEMergeElement::SVGFEMergeElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEMergeElement::SVGFEMergeElement(const SVGFEMergeElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEMergeElement &SVGFEMergeElement::operator =(const SVGFEMergeElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEMergeElement::SVGFEMergeElement(SVGFEMergeElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEMergeElement::~SVGFEMergeElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFEMergeElement.h b/ksvg/dom/SVGFEMergeElement.h
index 72e915ec..deea72ef 100644
--- a/ksvg/dom/SVGFEMergeElement.h
+++ b/ksvg/dom/SVGFEMergeElement.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEMergeNodeElement.cc b/ksvg/dom/SVGFEMergeNodeElement.cc
deleted file mode 100644
index 7abe70e7..00000000
--- a/ksvg/dom/SVGFEMergeNodeElement.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEMergeNodeElement.h"
-#include "SVGFEMergeNodeElementImpl.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGFEMergeNodeElement::SVGFEMergeNodeElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFEMergeNodeElement::SVGFEMergeNodeElement(const SVGFEMergeNodeElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEMergeNodeElement &SVGFEMergeNodeElement::operator =(const SVGFEMergeNodeElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEMergeNodeElement::SVGFEMergeNodeElement(SVGFEMergeNodeElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEMergeNodeElement::~SVGFEMergeNodeElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEMergeNodeElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEMergeNodeElement.cpp b/ksvg/dom/SVGFEMergeNodeElement.cpp
new file mode 100644
index 00000000..65d6b18d
--- /dev/null
+++ b/ksvg/dom/SVGFEMergeNodeElement.cpp
@@ -0,0 +1,72 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEMergeNodeElement.h"
+#include "SVGFEMergeNodeElementImpl.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGFEMergeNodeElement::SVGFEMergeNodeElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFEMergeNodeElement::SVGFEMergeNodeElement(const SVGFEMergeNodeElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEMergeNodeElement &SVGFEMergeNodeElement::operator =(const SVGFEMergeNodeElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEMergeNodeElement::SVGFEMergeNodeElement(SVGFEMergeNodeElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEMergeNodeElement::~SVGFEMergeNodeElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEMergeNodeElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
diff --git a/ksvg/dom/SVGFEMergeNodeElement.h b/ksvg/dom/SVGFEMergeNodeElement.h
index e9002f0c..e63b2b7e 100644
--- a/ksvg/dom/SVGFEMergeNodeElement.h
+++ b/ksvg/dom/SVGFEMergeNodeElement.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEMorphologyElement.cc b/ksvg/dom/SVGFEMorphologyElement.cc
deleted file mode 100644
index 293d86a8..00000000
--- a/ksvg/dom/SVGFEMorphologyElement.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEMorphologyElement.h"
-#include "SVGFEMorphologyElementImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGFEMorphologyElement::SVGFEMorphologyElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEMorphologyElement::SVGFEMorphologyElement(const SVGFEMorphologyElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEMorphologyElement &SVGFEMorphologyElement::operator =(const SVGFEMorphologyElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEMorphologyElement::SVGFEMorphologyElement(SVGFEMorphologyElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEMorphologyElement::~SVGFEMorphologyElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEMorphologyElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedEnumeration SVGFEMorphologyElement::Operator() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->Operator());
-}
-
-SVGAnimatedLength SVGFEMorphologyElement::radiusX() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->radiusX());
-}
-
-SVGAnimatedLength SVGFEMorphologyElement::radiusY() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->radiusY());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEMorphologyElement.cpp b/ksvg/dom/SVGFEMorphologyElement.cpp
new file mode 100644
index 00000000..e6f2543a
--- /dev/null
+++ b/ksvg/dom/SVGFEMorphologyElement.cpp
@@ -0,0 +1,93 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEMorphologyElement.h"
+#include "SVGFEMorphologyElementImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGFEMorphologyElement::SVGFEMorphologyElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEMorphologyElement::SVGFEMorphologyElement(const SVGFEMorphologyElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEMorphologyElement &SVGFEMorphologyElement::operator =(const SVGFEMorphologyElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEMorphologyElement::SVGFEMorphologyElement(SVGFEMorphologyElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEMorphologyElement::~SVGFEMorphologyElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEMorphologyElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedEnumeration SVGFEMorphologyElement::Operator() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->Operator());
+}
+
+SVGAnimatedLength SVGFEMorphologyElement::radiusX() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->radiusX());
+}
+
+SVGAnimatedLength SVGFEMorphologyElement::radiusY() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->radiusY());
+}
diff --git a/ksvg/dom/SVGFEMorphologyElement.h b/ksvg/dom/SVGFEMorphologyElement.h
index 7ca1b6a0..3274c9c6 100644
--- a/ksvg/dom/SVGFEMorphologyElement.h
+++ b/ksvg/dom/SVGFEMorphologyElement.h
@@ -63,5 +63,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEOffsetElement.cc b/ksvg/dom/SVGFEOffsetElement.cc
deleted file mode 100644
index f16ff5ed..00000000
--- a/ksvg/dom/SVGFEOffsetElement.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEOffsetElement.h"
-#include "SVGFEOffsetElementImpl.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGFEOffsetElement::SVGFEOffsetElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFEOffsetElement::SVGFEOffsetElement(const SVGFEOffsetElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEOffsetElement &SVGFEOffsetElement::operator =(const SVGFEOffsetElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEOffsetElement::SVGFEOffsetElement(SVGFEOffsetElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEOffsetElement::~SVGFEOffsetElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFEOffsetElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedNumber SVGFEOffsetElement::dx() const
-{
- if(!impl) return SVGAnimatedNumber(0); // FIXME
- return SVGAnimatedNumber(impl->dx());
-}
-
-SVGAnimatedNumber SVGFEOffsetElement::dy() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->dy());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEOffsetElement.cpp b/ksvg/dom/SVGFEOffsetElement.cpp
new file mode 100644
index 00000000..bd9a94fd
--- /dev/null
+++ b/ksvg/dom/SVGFEOffsetElement.cpp
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEOffsetElement.h"
+#include "SVGFEOffsetElementImpl.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGFEOffsetElement::SVGFEOffsetElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFEOffsetElement::SVGFEOffsetElement(const SVGFEOffsetElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEOffsetElement &SVGFEOffsetElement::operator =(const SVGFEOffsetElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEOffsetElement::SVGFEOffsetElement(SVGFEOffsetElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEOffsetElement::~SVGFEOffsetElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFEOffsetElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedNumber SVGFEOffsetElement::dx() const
+{
+ if(!impl) return SVGAnimatedNumber(0); // FIXME
+ return SVGAnimatedNumber(impl->dx());
+}
+
+SVGAnimatedNumber SVGFEOffsetElement::dy() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->dy());
+}
diff --git a/ksvg/dom/SVGFEOffsetElement.h b/ksvg/dom/SVGFEOffsetElement.h
index 62b63407..b5aa300e 100644
--- a/ksvg/dom/SVGFEOffsetElement.h
+++ b/ksvg/dom/SVGFEOffsetElement.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEPointLightElement.cc b/ksvg/dom/SVGFEPointLightElement.cc
deleted file mode 100644
index ce5e4635..00000000
--- a/ksvg/dom/SVGFEPointLightElement.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEPointLightElement.h"
-#include "SVGFEPointLightElementImpl.h"
-#include "SVGAnimatedNumber.h"
-
-using namespace KSVG;
-
-SVGFEPointLightElement::SVGFEPointLightElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFEPointLightElement::SVGFEPointLightElement(const SVGFEPointLightElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFEPointLightElement &SVGFEPointLightElement::operator =(const SVGFEPointLightElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFEPointLightElement::SVGFEPointLightElement(SVGFEPointLightElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFEPointLightElement::~SVGFEPointLightElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedNumber SVGFEPointLightElement::x() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->x());
-}
-
-SVGAnimatedNumber SVGFEPointLightElement::y() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->y());
-}
-
-SVGAnimatedNumber SVGFEPointLightElement::z() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->z());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFEPointLightElement.cpp b/ksvg/dom/SVGFEPointLightElement.cpp
new file mode 100644
index 00000000..99028920
--- /dev/null
+++ b/ksvg/dom/SVGFEPointLightElement.cpp
@@ -0,0 +1,84 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEPointLightElement.h"
+#include "SVGFEPointLightElementImpl.h"
+#include "SVGAnimatedNumber.h"
+
+using namespace KSVG;
+
+SVGFEPointLightElement::SVGFEPointLightElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFEPointLightElement::SVGFEPointLightElement(const SVGFEPointLightElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFEPointLightElement &SVGFEPointLightElement::operator =(const SVGFEPointLightElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFEPointLightElement::SVGFEPointLightElement(SVGFEPointLightElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFEPointLightElement::~SVGFEPointLightElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedNumber SVGFEPointLightElement::x() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->x());
+}
+
+SVGAnimatedNumber SVGFEPointLightElement::y() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->y());
+}
+
+SVGAnimatedNumber SVGFEPointLightElement::z() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->z());
+}
diff --git a/ksvg/dom/SVGFEPointLightElement.h b/ksvg/dom/SVGFEPointLightElement.h
index 1d029e00..879d9481 100644
--- a/ksvg/dom/SVGFEPointLightElement.h
+++ b/ksvg/dom/SVGFEPointLightElement.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFESpecularLightingElement.cc b/ksvg/dom/SVGFESpecularLightingElement.cc
deleted file mode 100644
index 924e1ce7..00000000
--- a/ksvg/dom/SVGFESpecularLightingElement.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFESpecularLightingElement.h"
-#include "SVGFESpecularLightingElementImpl.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGFESpecularLightingElement::SVGFESpecularLightingElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFESpecularLightingElement::SVGFESpecularLightingElement(const SVGFESpecularLightingElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFESpecularLightingElement &SVGFESpecularLightingElement::operator =(const SVGFESpecularLightingElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFESpecularLightingElement::SVGFESpecularLightingElement(SVGFESpecularLightingElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFESpecularLightingElement::~SVGFESpecularLightingElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFESpecularLightingElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-SVGAnimatedNumber SVGFESpecularLightingElement::surfaceScale() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->surfaceScale());
-}
-
-SVGAnimatedNumber SVGFESpecularLightingElement::specularConstant() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->specularConstant());
-}
-
-SVGAnimatedNumber SVGFESpecularLightingElement::specularExponent() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->specularExponent());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFESpecularLightingElement.cpp b/ksvg/dom/SVGFESpecularLightingElement.cpp
new file mode 100644
index 00000000..cd4785dc
--- /dev/null
+++ b/ksvg/dom/SVGFESpecularLightingElement.cpp
@@ -0,0 +1,92 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFESpecularLightingElement.h"
+#include "SVGFESpecularLightingElementImpl.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGFESpecularLightingElement::SVGFESpecularLightingElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFESpecularLightingElement::SVGFESpecularLightingElement(const SVGFESpecularLightingElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFESpecularLightingElement &SVGFESpecularLightingElement::operator =(const SVGFESpecularLightingElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFESpecularLightingElement::SVGFESpecularLightingElement(SVGFESpecularLightingElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFESpecularLightingElement::~SVGFESpecularLightingElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFESpecularLightingElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
+
+SVGAnimatedNumber SVGFESpecularLightingElement::surfaceScale() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->surfaceScale());
+}
+
+SVGAnimatedNumber SVGFESpecularLightingElement::specularConstant() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->specularConstant());
+}
+
+SVGAnimatedNumber SVGFESpecularLightingElement::specularExponent() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->specularExponent());
+}
diff --git a/ksvg/dom/SVGFESpecularLightingElement.h b/ksvg/dom/SVGFESpecularLightingElement.h
index 3566006c..3b4e3a1b 100644
--- a/ksvg/dom/SVGFESpecularLightingElement.h
+++ b/ksvg/dom/SVGFESpecularLightingElement.h
@@ -55,5 +55,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFESpotLightElement.cc b/ksvg/dom/SVGFESpotLightElement.cc
deleted file mode 100644
index 57dd498f..00000000
--- a/ksvg/dom/SVGFESpotLightElement.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFESpotLightElement.h"
-#include "SVGFESpotLightElementImpl.h"
-#include "SVGAnimatedNumber.h"
-
-using namespace KSVG;
-
-SVGFESpotLightElement::SVGFESpotLightElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFESpotLightElement::SVGFESpotLightElement(const SVGFESpotLightElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFESpotLightElement &SVGFESpotLightElement::operator =(const SVGFESpotLightElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFESpotLightElement::SVGFESpotLightElement(SVGFESpotLightElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFESpotLightElement::~SVGFESpotLightElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::x() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->x());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::y() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->y());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::z() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->z());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::pointsAtX() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->pointsAtX());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::pointsAtY() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->pointsAtY());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::pointsAtZ() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->pointsAtZ());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::specularExponent() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->specularExponent());
-}
-
-SVGAnimatedNumber SVGFESpotLightElement::limitingConeAngle() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->limitingConeAngle());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFESpotLightElement.cpp b/ksvg/dom/SVGFESpotLightElement.cpp
new file mode 100644
index 00000000..15353880
--- /dev/null
+++ b/ksvg/dom/SVGFESpotLightElement.cpp
@@ -0,0 +1,114 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFESpotLightElement.h"
+#include "SVGFESpotLightElementImpl.h"
+#include "SVGAnimatedNumber.h"
+
+using namespace KSVG;
+
+SVGFESpotLightElement::SVGFESpotLightElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFESpotLightElement::SVGFESpotLightElement(const SVGFESpotLightElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFESpotLightElement &SVGFESpotLightElement::operator =(const SVGFESpotLightElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFESpotLightElement::SVGFESpotLightElement(SVGFESpotLightElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFESpotLightElement::~SVGFESpotLightElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::x() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->x());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::y() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->y());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::z() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->z());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::pointsAtX() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->pointsAtX());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::pointsAtY() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->pointsAtY());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::pointsAtZ() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->pointsAtZ());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::specularExponent() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->specularExponent());
+}
+
+SVGAnimatedNumber SVGFESpotLightElement::limitingConeAngle() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->limitingConeAngle());
+}
diff --git a/ksvg/dom/SVGFESpotLightElement.h b/ksvg/dom/SVGFESpotLightElement.h
index 735a6428..40452b87 100644
--- a/ksvg/dom/SVGFESpotLightElement.h
+++ b/ksvg/dom/SVGFESpotLightElement.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFETileElement.cc b/ksvg/dom/SVGFETileElement.cc
deleted file mode 100644
index 01c7ffed..00000000
--- a/ksvg/dom/SVGFETileElement.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFETileElement.h"
-#include "SVGFETileElementImpl.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGFETileElement::SVGFETileElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFETileElement::SVGFETileElement(const SVGFETileElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFETileElement &SVGFETileElement::operator =(const SVGFETileElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFETileElement::SVGFETileElement(SVGFETileElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFETileElement::~SVGFETileElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedString SVGFETileElement::in1() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->in1());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFETileElement.cpp b/ksvg/dom/SVGFETileElement.cpp
new file mode 100644
index 00000000..d88a4f2a
--- /dev/null
+++ b/ksvg/dom/SVGFETileElement.cpp
@@ -0,0 +1,73 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFETileElement.h"
+#include "SVGFETileElementImpl.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGFETileElement::SVGFETileElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFETileElement::SVGFETileElement(const SVGFETileElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFETileElement &SVGFETileElement::operator =(const SVGFETileElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFETileElement::SVGFETileElement(SVGFETileElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFETileElement::~SVGFETileElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedString SVGFETileElement::in1() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->in1());
+}
diff --git a/ksvg/dom/SVGFETileElement.h b/ksvg/dom/SVGFETileElement.h
index cbf548b1..408baa02 100644
--- a/ksvg/dom/SVGFETileElement.h
+++ b/ksvg/dom/SVGFETileElement.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFETurbulenceElement.cc b/ksvg/dom/SVGFETurbulenceElement.cc
deleted file mode 100644
index 7d846e6b..00000000
--- a/ksvg/dom/SVGFETurbulenceElement.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFETurbulenceElement.h"
-#include "SVGFETurbulenceElementImpl.h"
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedNumber.h"
-#include "SVGAnimatedInteger.h"
-
-using namespace KSVG;
-
-SVGFETurbulenceElement::SVGFETurbulenceElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
-{
- impl = 0;
-}
-
-SVGFETurbulenceElement::SVGFETurbulenceElement(const SVGFETurbulenceElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFETurbulenceElement &SVGFETurbulenceElement::operator =(const SVGFETurbulenceElement &other)
-{
- SVGElement::operator=(other);
- SVGFilterPrimitiveStandardAttributes::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFETurbulenceElement::SVGFETurbulenceElement(SVGFETurbulenceElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFETurbulenceElement::~SVGFETurbulenceElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedNumber SVGFETurbulenceElement::baseFrequencyX() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->baseFrequencyX());
-}
-
-SVGAnimatedNumber SVGFETurbulenceElement::baseFrequencyY() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->baseFrequencyY());
-}
-
-SVGAnimatedInteger SVGFETurbulenceElement::numOctaves() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->numOctaves());
-}
-
-SVGAnimatedNumber SVGFETurbulenceElement::seed() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->seed());
-}
-
-SVGAnimatedEnumeration SVGFETurbulenceElement::stitchTiles() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->stitchTiles());
-}
-
-SVGAnimatedEnumeration SVGFETurbulenceElement::type() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->type());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFETurbulenceElement.cpp b/ksvg/dom/SVGFETurbulenceElement.cpp
new file mode 100644
index 00000000..2f4fd5b8
--- /dev/null
+++ b/ksvg/dom/SVGFETurbulenceElement.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFETurbulenceElement.h"
+#include "SVGFETurbulenceElementImpl.h"
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedNumber.h"
+#include "SVGAnimatedInteger.h"
+
+using namespace KSVG;
+
+SVGFETurbulenceElement::SVGFETurbulenceElement() : SVGElement(), SVGFilterPrimitiveStandardAttributes()
+{
+ impl = 0;
+}
+
+SVGFETurbulenceElement::SVGFETurbulenceElement(const SVGFETurbulenceElement &other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFETurbulenceElement &SVGFETurbulenceElement::operator =(const SVGFETurbulenceElement &other)
+{
+ SVGElement::operator=(other);
+ SVGFilterPrimitiveStandardAttributes::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFETurbulenceElement::SVGFETurbulenceElement(SVGFETurbulenceElementImpl *other) : SVGElement(other), SVGFilterPrimitiveStandardAttributes(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFETurbulenceElement::~SVGFETurbulenceElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedNumber SVGFETurbulenceElement::baseFrequencyX() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->baseFrequencyX());
+}
+
+SVGAnimatedNumber SVGFETurbulenceElement::baseFrequencyY() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->baseFrequencyY());
+}
+
+SVGAnimatedInteger SVGFETurbulenceElement::numOctaves() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->numOctaves());
+}
+
+SVGAnimatedNumber SVGFETurbulenceElement::seed() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->seed());
+}
+
+SVGAnimatedEnumeration SVGFETurbulenceElement::stitchTiles() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->stitchTiles());
+}
+
+SVGAnimatedEnumeration SVGFETurbulenceElement::type() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->type());
+}
diff --git a/ksvg/dom/SVGFETurbulenceElement.h b/ksvg/dom/SVGFETurbulenceElement.h
index 39b6050d..fb6b2856 100644
--- a/ksvg/dom/SVGFETurbulenceElement.h
+++ b/ksvg/dom/SVGFETurbulenceElement.h
@@ -67,5 +67,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFilterElement.cc b/ksvg/dom/SVGFilterElement.cc
deleted file mode 100644
index 3644a807..00000000
--- a/ksvg/dom/SVGFilterElement.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFilterElement.h"
-#include "SVGFilterElementImpl.h"
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedInteger.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGFilterElement::SVGFilterElement() : SVGElement(), SVGURIReference(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGUnitTypes()
-{
- impl = 0;
-}
-
-SVGFilterElement::SVGFilterElement(const SVGFilterElement &other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes(), impl(0)
-{
- (*this) = other;
-}
-
-SVGFilterElement &SVGFilterElement::operator =(const SVGFilterElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFilterElement::SVGFilterElement(SVGFilterElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFilterElement::~SVGFilterElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedEnumeration SVGFilterElement::filterUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->filterUnits());
-}
-
-SVGAnimatedEnumeration SVGFilterElement::primitiveUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->primitiveUnits());
-}
-
-SVGAnimatedLength SVGFilterElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGFilterElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGFilterElement::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGFilterElement::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-SVGAnimatedInteger SVGFilterElement::filterResX() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->filterResX());
-}
-
-SVGAnimatedInteger SVGFilterElement::filterResY() const
-{
- if(!impl) return SVGAnimatedInteger(0);
- return SVGAnimatedInteger(impl->filterResY());
-}
-
-void SVGFilterElement::setFilterRes(unsigned long filterResX, unsigned long filterResY)
-{
- if(impl)
- impl->setFilterRes(filterResX, filterResY);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFilterElement.cpp b/ksvg/dom/SVGFilterElement.cpp
new file mode 100644
index 00000000..f505252e
--- /dev/null
+++ b/ksvg/dom/SVGFilterElement.cpp
@@ -0,0 +1,126 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFilterElement.h"
+#include "SVGFilterElementImpl.h"
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedInteger.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGFilterElement::SVGFilterElement() : SVGElement(), SVGURIReference(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGUnitTypes()
+{
+ impl = 0;
+}
+
+SVGFilterElement::SVGFilterElement(const SVGFilterElement &other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes(), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFilterElement &SVGFilterElement::operator =(const SVGFilterElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFilterElement::SVGFilterElement(SVGFilterElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFilterElement::~SVGFilterElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedEnumeration SVGFilterElement::filterUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->filterUnits());
+}
+
+SVGAnimatedEnumeration SVGFilterElement::primitiveUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->primitiveUnits());
+}
+
+SVGAnimatedLength SVGFilterElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGFilterElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGFilterElement::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGFilterElement::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
+
+SVGAnimatedInteger SVGFilterElement::filterResX() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->filterResX());
+}
+
+SVGAnimatedInteger SVGFilterElement::filterResY() const
+{
+ if(!impl) return SVGAnimatedInteger(0);
+ return SVGAnimatedInteger(impl->filterResY());
+}
+
+void SVGFilterElement::setFilterRes(unsigned long filterResX, unsigned long filterResY)
+{
+ if(impl)
+ impl->setFilterRes(filterResX, filterResY);
+}
diff --git a/ksvg/dom/SVGFilterElement.h b/ksvg/dom/SVGFilterElement.h
index 82f67e5c..aa5690d6 100644
--- a/ksvg/dom/SVGFilterElement.h
+++ b/ksvg/dom/SVGFilterElement.h
@@ -70,5 +70,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFilterPrimitiveStandardAttributes.cc b/ksvg/dom/SVGFilterPrimitiveStandardAttributes.cc
deleted file mode 100644
index 05b2ef2a..00000000
--- a/ksvg/dom/SVGFilterPrimitiveStandardAttributes.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFilterPrimitiveStandardAttributes.h"
-#include "SVGFilterPrimitiveStandardAttributesImpl.h"
-#include "SVGAnimatedString.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes()
-{
- impl = new SVGFilterPrimitiveStandardAttributesImpl();
-}
-
-SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const SVGFilterPrimitiveStandardAttributes &other)
-{
- impl = other.impl;
-}
-
-SVGFilterPrimitiveStandardAttributes &SVGFilterPrimitiveStandardAttributes::operator=(const SVGFilterPrimitiveStandardAttributes &other)
-{
- if(impl == other.impl)
- return *this;
-
- delete impl;
- impl = other.impl;
-
- return *this;
-}
-
-SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(SVGFilterPrimitiveStandardAttributesImpl *other)
-{
- impl = other;
-}
-
-SVGFilterPrimitiveStandardAttributes::~SVGFilterPrimitiveStandardAttributes()
-{
-}
-
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-SVGAnimatedString SVGFilterPrimitiveStandardAttributes::result() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->result());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFilterPrimitiveStandardAttributes.cpp b/ksvg/dom/SVGFilterPrimitiveStandardAttributes.cpp
new file mode 100644
index 00000000..fd629054
--- /dev/null
+++ b/ksvg/dom/SVGFilterPrimitiveStandardAttributes.cpp
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFilterPrimitiveStandardAttributes.h"
+#include "SVGFilterPrimitiveStandardAttributesImpl.h"
+#include "SVGAnimatedString.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes()
+{
+ impl = new SVGFilterPrimitiveStandardAttributesImpl();
+}
+
+SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const SVGFilterPrimitiveStandardAttributes &other)
+{
+ impl = other.impl;
+}
+
+SVGFilterPrimitiveStandardAttributes &SVGFilterPrimitiveStandardAttributes::operator=(const SVGFilterPrimitiveStandardAttributes &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ delete impl;
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(SVGFilterPrimitiveStandardAttributesImpl *other)
+{
+ impl = other;
+}
+
+SVGFilterPrimitiveStandardAttributes::~SVGFilterPrimitiveStandardAttributes()
+{
+}
+
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGFilterPrimitiveStandardAttributes::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
+
+SVGAnimatedString SVGFilterPrimitiveStandardAttributes::result() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->result());
+}
diff --git a/ksvg/dom/SVGFilterPrimitiveStandardAttributes.h b/ksvg/dom/SVGFilterPrimitiveStandardAttributes.h
index 9d2c9894..102705d6 100644
--- a/ksvg/dom/SVGFilterPrimitiveStandardAttributes.h
+++ b/ksvg/dom/SVGFilterPrimitiveStandardAttributes.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFitToViewBox.cc b/ksvg/dom/SVGFitToViewBox.cc
deleted file mode 100644
index e0d576f0..00000000
--- a/ksvg/dom/SVGFitToViewBox.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFitToViewBox.h"
-#include "SVGFitToViewBoxImpl.h"
-#include "SVGAnimatedRect.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGFitToViewBox::SVGFitToViewBox()
-{
- impl = 0;
-}
-
-SVGFitToViewBox::SVGFitToViewBox(const SVGFitToViewBox &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGFitToViewBox &SVGFitToViewBox::operator=(const SVGFitToViewBox &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGFitToViewBox::SVGFitToViewBox(SVGFitToViewBoxImpl *other)
-{
- impl = other;
-}
-
-SVGFitToViewBox::~SVGFitToViewBox()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-SVGAnimatedRect SVGFitToViewBox::viewBox() const
-{
- if(!impl) return SVGAnimatedRect(0);
- return SVGAnimatedRect(impl->viewBox());
-}
-
-SVGAnimatedPreserveAspectRatio SVGFitToViewBox::preserveAspectRatio() const
-{
- if(!impl) return SVGAnimatedPreserveAspectRatio(0);
- return SVGAnimatedPreserveAspectRatio(impl->preserveAspectRatio());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFitToViewBox.cpp b/ksvg/dom/SVGFitToViewBox.cpp
new file mode 100644
index 00000000..4f54e2b4
--- /dev/null
+++ b/ksvg/dom/SVGFitToViewBox.cpp
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFitToViewBox.h"
+#include "SVGFitToViewBoxImpl.h"
+#include "SVGAnimatedRect.h"
+#include "SVGAnimatedPreserveAspectRatio.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGFitToViewBox::SVGFitToViewBox()
+{
+ impl = 0;
+}
+
+SVGFitToViewBox::SVGFitToViewBox(const SVGFitToViewBox &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGFitToViewBox &SVGFitToViewBox::operator=(const SVGFitToViewBox &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGFitToViewBox::SVGFitToViewBox(SVGFitToViewBoxImpl *other)
+{
+ impl = other;
+}
+
+SVGFitToViewBox::~SVGFitToViewBox()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+SVGAnimatedRect SVGFitToViewBox::viewBox() const
+{
+ if(!impl) return SVGAnimatedRect(0);
+ return SVGAnimatedRect(impl->viewBox());
+}
+
+SVGAnimatedPreserveAspectRatio SVGFitToViewBox::preserveAspectRatio() const
+{
+ if(!impl) return SVGAnimatedPreserveAspectRatio(0);
+ return SVGAnimatedPreserveAspectRatio(impl->preserveAspectRatio());
+}
diff --git a/ksvg/dom/SVGFitToViewBox.h b/ksvg/dom/SVGFitToViewBox.h
index 50778657..4517c843 100644
--- a/ksvg/dom/SVGFitToViewBox.h
+++ b/ksvg/dom/SVGFitToViewBox.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontElement.cc b/ksvg/dom/SVGFontElement.cc
deleted file mode 100644
index 5fae52ee..00000000
--- a/ksvg/dom/SVGFontElement.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontElement.h"
-#include "SVGFontElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontElement::SVGFontElement() : SVGElement(), SVGExternalResourcesRequired(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGFontElement::SVGFontElement(const SVGFontElement &other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFontElement &SVGFontElement::operator =(const SVGFontElement &other)
-{
- SVGElement::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFontElement::SVGFontElement(SVGFontElementImpl *other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFontElement::~SVGFontElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontElement.cpp b/ksvg/dom/SVGFontElement.cpp
new file mode 100644
index 00000000..30244c6f
--- /dev/null
+++ b/ksvg/dom/SVGFontElement.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontElement.h"
+#include "SVGFontElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontElement::SVGFontElement() : SVGElement(), SVGExternalResourcesRequired(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGFontElement::SVGFontElement(const SVGFontElement &other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFontElement &SVGFontElement::operator =(const SVGFontElement &other)
+{
+ SVGElement::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFontElement::SVGFontElement(SVGFontElementImpl *other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFontElement::~SVGFontElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFontElement.h b/ksvg/dom/SVGFontElement.h
index 9ecc36bf..353e4958 100644
--- a/ksvg/dom/SVGFontElement.h
+++ b/ksvg/dom/SVGFontElement.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceElement.cc b/ksvg/dom/SVGFontFaceElement.cc
deleted file mode 100644
index 6d542a04..00000000
--- a/ksvg/dom/SVGFontFaceElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceElement.h"
-#include "SVGFontFaceElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceElement::SVGFontFaceElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFontFaceElement::SVGFontFaceElement(const SVGFontFaceElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFontFaceElement &SVGFontFaceElement::operator =(const SVGFontFaceElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFontFaceElement::SVGFontFaceElement(SVGFontFaceElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFontFaceElement::~SVGFontFaceElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceElement.cpp b/ksvg/dom/SVGFontFaceElement.cpp
new file mode 100644
index 00000000..f5c7a12a
--- /dev/null
+++ b/ksvg/dom/SVGFontFaceElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceElement.h"
+#include "SVGFontFaceElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceElement::SVGFontFaceElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFontFaceElement::SVGFontFaceElement(const SVGFontFaceElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFontFaceElement &SVGFontFaceElement::operator =(const SVGFontFaceElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFontFaceElement::SVGFontFaceElement(SVGFontFaceElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFontFaceElement::~SVGFontFaceElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFontFaceElement.h b/ksvg/dom/SVGFontFaceElement.h
index f16d0eb2..713e1b08 100644
--- a/ksvg/dom/SVGFontFaceElement.h
+++ b/ksvg/dom/SVGFontFaceElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceFormatElement.cc b/ksvg/dom/SVGFontFaceFormatElement.cc
deleted file mode 100644
index a64c5fa8..00000000
--- a/ksvg/dom/SVGFontFaceFormatElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceFormatElement.h"
-#include "SVGFontFaceFormatElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceFormatElement::SVGFontFaceFormatElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFontFaceFormatElement::SVGFontFaceFormatElement(const SVGFontFaceFormatElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFontFaceFormatElement &SVGFontFaceFormatElement::operator =(const SVGFontFaceFormatElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFontFaceFormatElement::SVGFontFaceFormatElement(SVGFontFaceFormatElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFontFaceFormatElement::~SVGFontFaceFormatElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceFormatElement.cpp b/ksvg/dom/SVGFontFaceFormatElement.cpp
new file mode 100644
index 00000000..ede5a248
--- /dev/null
+++ b/ksvg/dom/SVGFontFaceFormatElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceFormatElement.h"
+#include "SVGFontFaceFormatElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceFormatElement::SVGFontFaceFormatElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFontFaceFormatElement::SVGFontFaceFormatElement(const SVGFontFaceFormatElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFontFaceFormatElement &SVGFontFaceFormatElement::operator =(const SVGFontFaceFormatElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFontFaceFormatElement::SVGFontFaceFormatElement(SVGFontFaceFormatElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFontFaceFormatElement::~SVGFontFaceFormatElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFontFaceFormatElement.h b/ksvg/dom/SVGFontFaceFormatElement.h
index 577cae35..52578729 100644
--- a/ksvg/dom/SVGFontFaceFormatElement.h
+++ b/ksvg/dom/SVGFontFaceFormatElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceNameElement.cc b/ksvg/dom/SVGFontFaceNameElement.cc
deleted file mode 100644
index e5160869..00000000
--- a/ksvg/dom/SVGFontFaceNameElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceNameElement.h"
-#include "SVGFontFaceNameElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceNameElement::SVGFontFaceNameElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFontFaceNameElement::SVGFontFaceNameElement(const SVGFontFaceNameElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFontFaceNameElement &SVGFontFaceNameElement::operator =(const SVGFontFaceNameElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFontFaceNameElement::SVGFontFaceNameElement(SVGFontFaceNameElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFontFaceNameElement::~SVGFontFaceNameElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceNameElement.cpp b/ksvg/dom/SVGFontFaceNameElement.cpp
new file mode 100644
index 00000000..ce2413fd
--- /dev/null
+++ b/ksvg/dom/SVGFontFaceNameElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceNameElement.h"
+#include "SVGFontFaceNameElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceNameElement::SVGFontFaceNameElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFontFaceNameElement::SVGFontFaceNameElement(const SVGFontFaceNameElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFontFaceNameElement &SVGFontFaceNameElement::operator =(const SVGFontFaceNameElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFontFaceNameElement::SVGFontFaceNameElement(SVGFontFaceNameElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFontFaceNameElement::~SVGFontFaceNameElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFontFaceNameElement.h b/ksvg/dom/SVGFontFaceNameElement.h
index b246e61d..3e799c2f 100644
--- a/ksvg/dom/SVGFontFaceNameElement.h
+++ b/ksvg/dom/SVGFontFaceNameElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceSrcElement.cc b/ksvg/dom/SVGFontFaceSrcElement.cc
deleted file mode 100644
index 8ecbbffa..00000000
--- a/ksvg/dom/SVGFontFaceSrcElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceSrcElement.h"
-#include "SVGFontFaceSrcElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceSrcElement::SVGFontFaceSrcElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFontFaceSrcElement::SVGFontFaceSrcElement(const SVGFontFaceSrcElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFontFaceSrcElement &SVGFontFaceSrcElement::operator =(const SVGFontFaceSrcElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFontFaceSrcElement::SVGFontFaceSrcElement(SVGFontFaceSrcElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFontFaceSrcElement::~SVGFontFaceSrcElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceSrcElement.cpp b/ksvg/dom/SVGFontFaceSrcElement.cpp
new file mode 100644
index 00000000..c34e7734
--- /dev/null
+++ b/ksvg/dom/SVGFontFaceSrcElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceSrcElement.h"
+#include "SVGFontFaceSrcElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceSrcElement::SVGFontFaceSrcElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFontFaceSrcElement::SVGFontFaceSrcElement(const SVGFontFaceSrcElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFontFaceSrcElement &SVGFontFaceSrcElement::operator =(const SVGFontFaceSrcElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFontFaceSrcElement::SVGFontFaceSrcElement(SVGFontFaceSrcElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFontFaceSrcElement::~SVGFontFaceSrcElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFontFaceSrcElement.h b/ksvg/dom/SVGFontFaceSrcElement.h
index 585971e0..ac41dc90 100644
--- a/ksvg/dom/SVGFontFaceSrcElement.h
+++ b/ksvg/dom/SVGFontFaceSrcElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceUriElement.cc b/ksvg/dom/SVGFontFaceUriElement.cc
deleted file mode 100644
index aafb392b..00000000
--- a/ksvg/dom/SVGFontFaceUriElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceUriElement.h"
-#include "SVGFontFaceUriElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceUriElement::SVGFontFaceUriElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGFontFaceUriElement::SVGFontFaceUriElement(const SVGFontFaceUriElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGFontFaceUriElement &SVGFontFaceUriElement::operator =(const SVGFontFaceUriElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGFontFaceUriElement::SVGFontFaceUriElement(SVGFontFaceUriElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGFontFaceUriElement::~SVGFontFaceUriElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGFontFaceUriElement.cpp b/ksvg/dom/SVGFontFaceUriElement.cpp
new file mode 100644
index 00000000..98a13d4d
--- /dev/null
+++ b/ksvg/dom/SVGFontFaceUriElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceUriElement.h"
+#include "SVGFontFaceUriElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceUriElement::SVGFontFaceUriElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGFontFaceUriElement::SVGFontFaceUriElement(const SVGFontFaceUriElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGFontFaceUriElement &SVGFontFaceUriElement::operator =(const SVGFontFaceUriElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGFontFaceUriElement::SVGFontFaceUriElement(SVGFontFaceUriElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGFontFaceUriElement::~SVGFontFaceUriElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGFontFaceUriElement.h b/ksvg/dom/SVGFontFaceUriElement.h
index c2dd6514..b18bd140 100644
--- a/ksvg/dom/SVGFontFaceUriElement.h
+++ b/ksvg/dom/SVGFontFaceUriElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGForeignObjectElement.cc b/ksvg/dom/SVGForeignObjectElement.cc
deleted file mode 100644
index e12a194a..00000000
--- a/ksvg/dom/SVGForeignObjectElement.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGForeignObjectElement.h"
-#include "SVGForeignObjectElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGForeignObjectElement::SVGForeignObjectElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGForeignObjectElement::SVGForeignObjectElement(const SVGForeignObjectElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- (*this) = other;
-}
-
-SVGForeignObjectElement &SVGForeignObjectElement::operator =(const SVGForeignObjectElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGForeignObjectElement::SVGForeignObjectElement(SVGForeignObjectElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGForeignObjectElement::~SVGForeignObjectElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGForeignObjectElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGForeignObjectElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGForeignObjectElement::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGForeignObjectElement::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGForeignObjectElement.cpp b/ksvg/dom/SVGForeignObjectElement.cpp
new file mode 100644
index 00000000..cd7ffad5
--- /dev/null
+++ b/ksvg/dom/SVGForeignObjectElement.cpp
@@ -0,0 +1,95 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGForeignObjectElement.h"
+#include "SVGForeignObjectElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGForeignObjectElement::SVGForeignObjectElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGForeignObjectElement::SVGForeignObjectElement(const SVGForeignObjectElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ (*this) = other;
+}
+
+SVGForeignObjectElement &SVGForeignObjectElement::operator =(const SVGForeignObjectElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGForeignObjectElement::SVGForeignObjectElement(SVGForeignObjectElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGForeignObjectElement::~SVGForeignObjectElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGForeignObjectElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGForeignObjectElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGForeignObjectElement::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGForeignObjectElement::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
diff --git a/ksvg/dom/SVGForeignObjectElement.h b/ksvg/dom/SVGForeignObjectElement.h
index 0d35019f..d1669511 100644
--- a/ksvg/dom/SVGForeignObjectElement.h
+++ b/ksvg/dom/SVGForeignObjectElement.h
@@ -62,5 +62,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGElement.cc b/ksvg/dom/SVGGElement.cc
deleted file mode 100644
index 272c7608..00000000
--- a/ksvg/dom/SVGGElement.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGElement.h"
-#include "SVGGElementImpl.h"
-
-using namespace KSVG;
-
-SVGGElement::SVGGElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGGElement::SVGGElement(const SVGGElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGGElement &SVGGElement::operator =(const SVGGElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGGElement::SVGGElement(SVGGElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGGElement::~SVGGElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGElement.cpp b/ksvg/dom/SVGGElement.cpp
new file mode 100644
index 00000000..6a6cfb96
--- /dev/null
+++ b/ksvg/dom/SVGGElement.cpp
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGElement.h"
+#include "SVGGElementImpl.h"
+
+using namespace KSVG;
+
+SVGGElement::SVGGElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGGElement::SVGGElement(const SVGGElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGGElement &SVGGElement::operator =(const SVGGElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGGElement::SVGGElement(SVGGElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGGElement::~SVGGElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGGElement.h b/ksvg/dom/SVGGElement.h
index 724bbadb..592a4550 100644
--- a/ksvg/dom/SVGGElement.h
+++ b/ksvg/dom/SVGGElement.h
@@ -79,5 +79,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGlyphElement.cc b/ksvg/dom/SVGGlyphElement.cc
deleted file mode 100644
index c852d44d..00000000
--- a/ksvg/dom/SVGGlyphElement.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGlyphElement.h"
-#include "SVGGlyphElementImpl.h"
-
-using namespace KSVG;
-
-SVGGlyphElement::SVGGlyphElement() : SVGElement(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGGlyphElement::SVGGlyphElement(const SVGGlyphElement &other) : SVGElement(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGGlyphElement &SVGGlyphElement::operator =(const SVGGlyphElement &other)
-{
- SVGElement::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGGlyphElement::SVGGlyphElement(SVGGlyphElementImpl *other) : SVGElement(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGGlyphElement::~SVGGlyphElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGlyphElement.cpp b/ksvg/dom/SVGGlyphElement.cpp
new file mode 100644
index 00000000..7f6f4ae4
--- /dev/null
+++ b/ksvg/dom/SVGGlyphElement.cpp
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGlyphElement.h"
+#include "SVGGlyphElementImpl.h"
+
+using namespace KSVG;
+
+SVGGlyphElement::SVGGlyphElement() : SVGElement(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGGlyphElement::SVGGlyphElement(const SVGGlyphElement &other) : SVGElement(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGGlyphElement &SVGGlyphElement::operator =(const SVGGlyphElement &other)
+{
+ SVGElement::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGGlyphElement::SVGGlyphElement(SVGGlyphElementImpl *other) : SVGElement(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGGlyphElement::~SVGGlyphElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGGlyphElement.h b/ksvg/dom/SVGGlyphElement.h
index c3d2237b..cd68a265 100644
--- a/ksvg/dom/SVGGlyphElement.h
+++ b/ksvg/dom/SVGGlyphElement.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGlyphRefElement.cc b/ksvg/dom/SVGGlyphRefElement.cc
deleted file mode 100644
index 85c4c39f..00000000
--- a/ksvg/dom/SVGGlyphRefElement.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGlyphRefElement.h"
-#include "SVGGlyphRefElementImpl.h"
-
-using namespace KSVG;
-
-SVGGlyphRefElement::SVGGlyphRefElement() : SVGElement(), SVGURIReference(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGGlyphRefElement::SVGGlyphRefElement(const SVGGlyphRefElement &other) : SVGElement(other), SVGURIReference(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGGlyphRefElement &SVGGlyphRefElement::operator =(const SVGGlyphRefElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGGlyphRefElement::SVGGlyphRefElement(SVGGlyphRefElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGGlyphRefElement::~SVGGlyphRefElement()
-{
- if(impl)
- impl->deref();
-}
-
-DOM::DOMString SVGGlyphRefElement::format()
-{
- if(!impl) return DOM::DOMString();
- return impl->format();
-}
-
-DOM::DOMString SVGGlyphRefElement::glyphRef()
-{
- if(!impl) return DOM::DOMString();
- return impl->glyphRef();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGlyphRefElement.cpp b/ksvg/dom/SVGGlyphRefElement.cpp
new file mode 100644
index 00000000..5b1f8deb
--- /dev/null
+++ b/ksvg/dom/SVGGlyphRefElement.cpp
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGlyphRefElement.h"
+#include "SVGGlyphRefElementImpl.h"
+
+using namespace KSVG;
+
+SVGGlyphRefElement::SVGGlyphRefElement() : SVGElement(), SVGURIReference(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGGlyphRefElement::SVGGlyphRefElement(const SVGGlyphRefElement &other) : SVGElement(other), SVGURIReference(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGGlyphRefElement &SVGGlyphRefElement::operator =(const SVGGlyphRefElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGGlyphRefElement::SVGGlyphRefElement(SVGGlyphRefElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGGlyphRefElement::~SVGGlyphRefElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+DOM::DOMString SVGGlyphRefElement::format()
+{
+ if(!impl) return DOM::DOMString();
+ return impl->format();
+}
+
+DOM::DOMString SVGGlyphRefElement::glyphRef()
+{
+ if(!impl) return DOM::DOMString();
+ return impl->glyphRef();
+}
diff --git a/ksvg/dom/SVGGlyphRefElement.h b/ksvg/dom/SVGGlyphRefElement.h
index 29e91e57..2b56c8eb 100644
--- a/ksvg/dom/SVGGlyphRefElement.h
+++ b/ksvg/dom/SVGGlyphRefElement.h
@@ -53,5 +53,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGradientElement.cc b/ksvg/dom/SVGGradientElement.cc
deleted file mode 100644
index 2afb305e..00000000
--- a/ksvg/dom/SVGGradientElement.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGradientElement.h"
-#include "SVGGradientElementImpl.h"
-#include "SVGAnimatedTransformList.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGGradientElement::SVGGradientElement() : SVGElement(), SVGURIReference(), SVGExternalResourcesRequired(), SVGStylable(), SVGUnitTypes()
-{
- impl = 0;
-}
-
-SVGGradientElement::SVGGradientElement(const SVGGradientElement &other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGGradientElement &SVGGradientElement::operator =(const SVGGradientElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGGradientElement::SVGGradientElement(SVGGradientElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes()
-{
- impl = other;
-}
-
-SVGGradientElement::~SVGGradientElement()
-{
-}
-
-SVGAnimatedEnumeration SVGGradientElement::gradientUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->gradientUnits());
-}
-
-SVGAnimatedTransformList SVGGradientElement::gradientTransform() const
-{
- if(!impl) return SVGAnimatedTransformList(0);
- return SVGAnimatedTransformList(impl->gradientTransform());
-}
-
-SVGAnimatedEnumeration SVGGradientElement::spreadMethod() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->spreadMethod());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGGradientElement.cpp b/ksvg/dom/SVGGradientElement.cpp
new file mode 100644
index 00000000..895b6d8e
--- /dev/null
+++ b/ksvg/dom/SVGGradientElement.cpp
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGradientElement.h"
+#include "SVGGradientElementImpl.h"
+#include "SVGAnimatedTransformList.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGGradientElement::SVGGradientElement() : SVGElement(), SVGURIReference(), SVGExternalResourcesRequired(), SVGStylable(), SVGUnitTypes()
+{
+ impl = 0;
+}
+
+SVGGradientElement::SVGGradientElement(const SVGGradientElement &other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGGradientElement &SVGGradientElement::operator =(const SVGGradientElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGGradientElement::SVGGradientElement(SVGGradientElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes()
+{
+ impl = other;
+}
+
+SVGGradientElement::~SVGGradientElement()
+{
+}
+
+SVGAnimatedEnumeration SVGGradientElement::gradientUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->gradientUnits());
+}
+
+SVGAnimatedTransformList SVGGradientElement::gradientTransform() const
+{
+ if(!impl) return SVGAnimatedTransformList(0);
+ return SVGAnimatedTransformList(impl->gradientTransform());
+}
+
+SVGAnimatedEnumeration SVGGradientElement::spreadMethod() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->spreadMethod());
+}
diff --git a/ksvg/dom/SVGGradientElement.h b/ksvg/dom/SVGGradientElement.h
index cff47ad8..14ef432c 100644
--- a/ksvg/dom/SVGGradientElement.h
+++ b/ksvg/dom/SVGGradientElement.h
@@ -67,5 +67,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGHKernElement.cc b/ksvg/dom/SVGHKernElement.cc
deleted file mode 100644
index db46aa63..00000000
--- a/ksvg/dom/SVGHKernElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGHKernElement.h"
-#include "SVGHKernElementImpl.h"
-
-using namespace KSVG;
-
-SVGHKernElement::SVGHKernElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGHKernElement::SVGHKernElement(const SVGHKernElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGHKernElement &SVGHKernElement::operator =(const SVGHKernElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGHKernElement::SVGHKernElement(SVGHKernElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGHKernElement::~SVGHKernElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGHKernElement.cpp b/ksvg/dom/SVGHKernElement.cpp
new file mode 100644
index 00000000..ca8d32bf
--- /dev/null
+++ b/ksvg/dom/SVGHKernElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGHKernElement.h"
+#include "SVGHKernElementImpl.h"
+
+using namespace KSVG;
+
+SVGHKernElement::SVGHKernElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGHKernElement::SVGHKernElement(const SVGHKernElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGHKernElement &SVGHKernElement::operator =(const SVGHKernElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGHKernElement::SVGHKernElement(SVGHKernElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGHKernElement::~SVGHKernElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGHKernElement.h b/ksvg/dom/SVGHKernElement.h
index 42890727..93c38c37 100644
--- a/ksvg/dom/SVGHKernElement.h
+++ b/ksvg/dom/SVGHKernElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGICCColor.cc b/ksvg/dom/SVGICCColor.cc
deleted file mode 100644
index 6b21f3fb..00000000
--- a/ksvg/dom/SVGICCColor.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGICCColor.h"
-#include "SVGICCColorImpl.h"
-#include "SVGNumberList.h"
-
-using namespace KSVG;
-
-SVGICCColor::SVGICCColor()
-{
- impl = new SVGICCColorImpl();
- impl->ref();
-}
-
-SVGICCColor::SVGICCColor(const SVGICCColor &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGICCColor &SVGICCColor::operator =(const SVGICCColor &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGICCColor::SVGICCColor(SVGICCColorImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGICCColor::~SVGICCColor()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGICCColor::setColorProfile(const DOM::DOMString &colorProfile)
-{
- if(impl)
- impl->setColorProfile(colorProfile);
-}
-
-DOM::DOMString SVGICCColor::colorProfile() const
-{
- if(!impl) return DOM::DOMString();
- return DOM::DOMString(impl->colorProfile());
-}
-
-SVGNumberList SVGICCColor::colors() const
-{
- if(!impl) return SVGNumberList(0);
- return SVGNumberList(impl->colors());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGICCColor.cpp b/ksvg/dom/SVGICCColor.cpp
new file mode 100644
index 00000000..3baef1c1
--- /dev/null
+++ b/ksvg/dom/SVGICCColor.cpp
@@ -0,0 +1,83 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGICCColor.h"
+#include "SVGICCColorImpl.h"
+#include "SVGNumberList.h"
+
+using namespace KSVG;
+
+SVGICCColor::SVGICCColor()
+{
+ impl = new SVGICCColorImpl();
+ impl->ref();
+}
+
+SVGICCColor::SVGICCColor(const SVGICCColor &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGICCColor &SVGICCColor::operator =(const SVGICCColor &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGICCColor::SVGICCColor(SVGICCColorImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGICCColor::~SVGICCColor()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGICCColor::setColorProfile(const DOM::DOMString &colorProfile)
+{
+ if(impl)
+ impl->setColorProfile(colorProfile);
+}
+
+DOM::DOMString SVGICCColor::colorProfile() const
+{
+ if(!impl) return DOM::DOMString();
+ return DOM::DOMString(impl->colorProfile());
+}
+
+SVGNumberList SVGICCColor::colors() const
+{
+ if(!impl) return SVGNumberList(0);
+ return SVGNumberList(impl->colors());
+}
diff --git a/ksvg/dom/SVGICCColor.h b/ksvg/dom/SVGICCColor.h
index 628feda9..aee9eaa5 100644
--- a/ksvg/dom/SVGICCColor.h
+++ b/ksvg/dom/SVGICCColor.h
@@ -52,5 +52,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGImageElement.cc b/ksvg/dom/SVGImageElement.cc
deleted file mode 100644
index 9d9374fa..00000000
--- a/ksvg/dom/SVGImageElement.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include "SVGImageElement.h"
-#include "SVGImageElementImpl.h"
-#include "SVGAnimatedLength.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
-
-using namespace KSVG;
-
-SVGImageElement::SVGImageElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGURIReference()
-{
- impl = 0;
-}
-
-SVGImageElement::SVGImageElement(const SVGImageElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGImageElement &SVGImageElement::operator=(const SVGImageElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGImageElement::SVGImageElement(SVGImageElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGImageElement::~SVGImageElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGImageElement::x()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGImageElement::y()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGImageElement::width()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGImageElement::height()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-SVGAnimatedPreserveAspectRatio SVGImageElement::preserveAspectRatio() const
-{
- if(!impl) return SVGAnimatedPreserveAspectRatio(0);
- return SVGAnimatedPreserveAspectRatio(impl->preserveAspectRatio());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGImageElement.cpp b/ksvg/dom/SVGImageElement.cpp
new file mode 100644
index 00000000..2981abef
--- /dev/null
+++ b/ksvg/dom/SVGImageElement.cpp
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "SVGImageElement.h"
+#include "SVGImageElementImpl.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPreserveAspectRatio.h"
+
+using namespace KSVG;
+
+SVGImageElement::SVGImageElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGURIReference()
+{
+ impl = 0;
+}
+
+SVGImageElement::SVGImageElement(const SVGImageElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGImageElement &SVGImageElement::operator=(const SVGImageElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGImageElement::SVGImageElement(SVGImageElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGImageElement::~SVGImageElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGImageElement::x()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGImageElement::y()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGImageElement::width()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGImageElement::height()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
+
+SVGAnimatedPreserveAspectRatio SVGImageElement::preserveAspectRatio() const
+{
+ if(!impl) return SVGAnimatedPreserveAspectRatio(0);
+ return SVGAnimatedPreserveAspectRatio(impl->preserveAspectRatio());
+}
diff --git a/ksvg/dom/SVGImageElement.h b/ksvg/dom/SVGImageElement.h
index c6487fed..08ff14c9 100644
--- a/ksvg/dom/SVGImageElement.h
+++ b/ksvg/dom/SVGImageElement.h
@@ -66,5 +66,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLangSpace.cc b/ksvg/dom/SVGLangSpace.cc
deleted file mode 100644
index 2373e648..00000000
--- a/ksvg/dom/SVGLangSpace.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGLangSpace.h"
-#include "SVGLangSpaceImpl.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGLangSpace::SVGLangSpace()
-{
- impl = 0;
-}
-
-SVGLangSpace::SVGLangSpace(const SVGLangSpace &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGLangSpace &SVGLangSpace::operator=(const SVGLangSpace &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGLangSpace::SVGLangSpace(SVGLangSpaceImpl *other)
-{
- impl = other;
-}
-
-SVGLangSpace::~SVGLangSpace()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-void SVGLangSpace::setXmllang(const DOM::DOMString &xmllang)
-{
- if(impl)
- impl->setXmllang(xmllang);
-}
-
-DOM::DOMString SVGLangSpace::xmllang() const
-{
- if(!impl) return DOM::DOMString();
- return impl->xmllang();
-}
-
-void SVGLangSpace::setXmlspace(const DOM::DOMString &xmlspace)
-{
- if(impl)
- impl->setXmlspace(xmlspace);
-}
-
-DOM::DOMString SVGLangSpace::xmlspace() const
-{
- if(!impl) return DOM::DOMString();
- return impl->xmlspace();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLangSpace.cpp b/ksvg/dom/SVGLangSpace.cpp
new file mode 100644
index 00000000..dc4e0cb3
--- /dev/null
+++ b/ksvg/dom/SVGLangSpace.cpp
@@ -0,0 +1,80 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGLangSpace.h"
+#include "SVGLangSpaceImpl.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGLangSpace::SVGLangSpace()
+{
+ impl = 0;
+}
+
+SVGLangSpace::SVGLangSpace(const SVGLangSpace &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGLangSpace &SVGLangSpace::operator=(const SVGLangSpace &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGLangSpace::SVGLangSpace(SVGLangSpaceImpl *other)
+{
+ impl = other;
+}
+
+SVGLangSpace::~SVGLangSpace()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+void SVGLangSpace::setXmllang(const DOM::DOMString &xmllang)
+{
+ if(impl)
+ impl->setXmllang(xmllang);
+}
+
+DOM::DOMString SVGLangSpace::xmllang() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->xmllang();
+}
+
+void SVGLangSpace::setXmlspace(const DOM::DOMString &xmlspace)
+{
+ if(impl)
+ impl->setXmlspace(xmlspace);
+}
+
+DOM::DOMString SVGLangSpace::xmlspace() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->xmlspace();
+}
diff --git a/ksvg/dom/SVGLangSpace.h b/ksvg/dom/SVGLangSpace.h
index 391e625d..6a6e6a89 100644
--- a/ksvg/dom/SVGLangSpace.h
+++ b/ksvg/dom/SVGLangSpace.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLength.cc b/ksvg/dom/SVGLength.cc
deleted file mode 100644
index bb2db73f..00000000
--- a/ksvg/dom/SVGLength.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <dom/dom_string.h>
-#include "SVGLength.h"
-#include "SVGShapeImpl.h"
-#include "SVGLengthImpl.h"
-
-using namespace KSVG;
-
-SVGLength::SVGLength()
-{
- impl = new SVGLengthImpl();
- impl->ref();
-}
-
-SVGLength::SVGLength(const SVGLength &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGLength &SVGLength::operator =(const SVGLength &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGLength::SVGLength(SVGLengthImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGLength::~SVGLength()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned short SVGLength::unitType() const
-{
- if(!impl) return SVG_LENGTHTYPE_UNKNOWN;
- return impl->unitType();
-}
-
-void SVGLength::setValue(float value)
-{
- if(impl)
- {
- impl->setValue(value);
-
- // Automatic updating of the shape if any value is changed, imagine:
- // SVGCircleElement c; [...] c.r().baseVal().setValue(150);
- if(impl->context() && dynamic_cast<SVGShapeImpl *>(impl->context()))
- dynamic_cast<SVGShapeImpl *>(impl->context())->update(UPDATE_TRANSFORM, 0, 0);
- }
-}
-
-float SVGLength::value() const
-{
- if(!impl) return -1;
- return impl->value();
-}
-
-void SVGLength::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
-{
- if(impl)
- impl->setValueInSpecifiedUnits(valueInSpecifiedUnits);
-}
-
-float SVGLength::valueInSpecifiedUnits() const
-{
- if(!impl) return -1;
- return impl->valueInSpecifiedUnits();
-}
-
-void SVGLength::setValueAsString(const DOM::DOMString &valueAsString)
-{
- if(impl)
- impl->setValueAsString(valueAsString);
-}
-
-DOM::DOMString SVGLength::valueAsString() const
-{
- if(!impl) return DOM::DOMString();
- return impl->valueAsString();
-}
-
-void SVGLength::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
-{
- if(impl)
- impl->newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
-}
-
-void SVGLength::convertToSpecifiedUnits(unsigned short unitType)
-{
- if(impl)
- impl->convertToSpecifiedUnits(unitType);
-}
-
-SVGLength::operator float()
-{
- if(!impl) return -1;
- return impl->valueInSpecifiedUnits();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLength.cpp b/ksvg/dom/SVGLength.cpp
new file mode 100644
index 00000000..7d55252a
--- /dev/null
+++ b/ksvg/dom/SVGLength.cpp
@@ -0,0 +1,133 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <dom/dom_string.h>
+#include "SVGLength.h"
+#include "SVGShapeImpl.h"
+#include "SVGLengthImpl.h"
+
+using namespace KSVG;
+
+SVGLength::SVGLength()
+{
+ impl = new SVGLengthImpl();
+ impl->ref();
+}
+
+SVGLength::SVGLength(const SVGLength &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGLength &SVGLength::operator =(const SVGLength &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGLength::SVGLength(SVGLengthImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGLength::~SVGLength()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned short SVGLength::unitType() const
+{
+ if(!impl) return SVG_LENGTHTYPE_UNKNOWN;
+ return impl->unitType();
+}
+
+void SVGLength::setValue(float value)
+{
+ if(impl)
+ {
+ impl->setValue(value);
+
+ // Automatic updating of the shape if any value is changed, imagine:
+ // SVGCircleElement c; [...] c.r().baseVal().setValue(150);
+ if(impl->context() && dynamic_cast<SVGShapeImpl *>(impl->context()))
+ dynamic_cast<SVGShapeImpl *>(impl->context())->update(UPDATE_TRANSFORM, 0, 0);
+ }
+}
+
+float SVGLength::value() const
+{
+ if(!impl) return -1;
+ return impl->value();
+}
+
+void SVGLength::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
+{
+ if(impl)
+ impl->setValueInSpecifiedUnits(valueInSpecifiedUnits);
+}
+
+float SVGLength::valueInSpecifiedUnits() const
+{
+ if(!impl) return -1;
+ return impl->valueInSpecifiedUnits();
+}
+
+void SVGLength::setValueAsString(const DOM::DOMString &valueAsString)
+{
+ if(impl)
+ impl->setValueAsString(valueAsString);
+}
+
+DOM::DOMString SVGLength::valueAsString() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->valueAsString();
+}
+
+void SVGLength::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
+{
+ if(impl)
+ impl->newValueSpecifiedUnits(unitType, valueInSpecifiedUnits);
+}
+
+void SVGLength::convertToSpecifiedUnits(unsigned short unitType)
+{
+ if(impl)
+ impl->convertToSpecifiedUnits(unitType);
+}
+
+SVGLength::operator float()
+{
+ if(!impl) return -1;
+ return impl->valueInSpecifiedUnits();
+}
diff --git a/ksvg/dom/SVGLength.h b/ksvg/dom/SVGLength.h
index 1f0bbdae..cb249759 100644
--- a/ksvg/dom/SVGLength.h
+++ b/ksvg/dom/SVGLength.h
@@ -77,5 +77,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLengthList.cc b/ksvg/dom/SVGLengthList.cc
deleted file mode 100644
index c308019b..00000000
--- a/ksvg/dom/SVGLengthList.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGLengthList.h"
-#include "SVGLengthListImpl.h"
-#include "SVGLength.h"
-
-using namespace KSVG;
-
-SVGLengthList::SVGLengthList()
-{
- impl = new SVGLengthListImpl();
- impl->ref();
-}
-
-SVGLengthList::SVGLengthList(const SVGLengthList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGLengthList &SVGLengthList::operator=(const SVGLengthList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGLengthList::SVGLengthList(SVGLengthListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGLengthList::~SVGLengthList()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned long SVGLengthList::numberOfItems() const
-{
- if(!impl) return 0;
- return impl->numberOfItems();
-}
-
-void SVGLengthList::clear()
-{
- if(impl)
- impl->clear();
-}
-
-SVGLength *SVGLengthList::initialize(SVGLength *newItem)
-{
- if(!impl) return new SVGLength(0);
- return new SVGLength(impl->initialize(newItem->handle()));
-}
-
-SVGLength *SVGLengthList::getItem(unsigned long index)
-{
- if(!impl) return new SVGLength(0);
- return new SVGLength(impl->getItem(index));
-}
-
-SVGLength *SVGLengthList::insertItemBefore(SVGLength *newItem, unsigned long index)
-{
- if(!impl) return new SVGLength(0);
- return new SVGLength(impl->insertItemBefore(newItem->handle(), index));
-}
-
-SVGLength *SVGLengthList::replaceItem(SVGLength *newItem, unsigned long index)
-{
- if(!impl) return new SVGLength(0);
- return new SVGLength(impl->replaceItem(newItem->handle(), index));
-}
-
-SVGLength *SVGLengthList::removeItem(unsigned long index)
-{
- if(!impl) return new SVGLength(0);
- return new SVGLength(impl->removeItem(index));
-}
-
-SVGLength *SVGLengthList::appendItem(SVGLength *newItem)
-{
- if(!impl) return new SVGLength(0);
- return new SVGLength(impl->appendItem(newItem->handle()));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLengthList.cpp b/ksvg/dom/SVGLengthList.cpp
new file mode 100644
index 00000000..30f59d70
--- /dev/null
+++ b/ksvg/dom/SVGLengthList.cpp
@@ -0,0 +1,113 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGLengthList.h"
+#include "SVGLengthListImpl.h"
+#include "SVGLength.h"
+
+using namespace KSVG;
+
+SVGLengthList::SVGLengthList()
+{
+ impl = new SVGLengthListImpl();
+ impl->ref();
+}
+
+SVGLengthList::SVGLengthList(const SVGLengthList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGLengthList &SVGLengthList::operator=(const SVGLengthList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGLengthList::SVGLengthList(SVGLengthListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGLengthList::~SVGLengthList()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned long SVGLengthList::numberOfItems() const
+{
+ if(!impl) return 0;
+ return impl->numberOfItems();
+}
+
+void SVGLengthList::clear()
+{
+ if(impl)
+ impl->clear();
+}
+
+SVGLength *SVGLengthList::initialize(SVGLength *newItem)
+{
+ if(!impl) return new SVGLength(0);
+ return new SVGLength(impl->initialize(newItem->handle()));
+}
+
+SVGLength *SVGLengthList::getItem(unsigned long index)
+{
+ if(!impl) return new SVGLength(0);
+ return new SVGLength(impl->getItem(index));
+}
+
+SVGLength *SVGLengthList::insertItemBefore(SVGLength *newItem, unsigned long index)
+{
+ if(!impl) return new SVGLength(0);
+ return new SVGLength(impl->insertItemBefore(newItem->handle(), index));
+}
+
+SVGLength *SVGLengthList::replaceItem(SVGLength *newItem, unsigned long index)
+{
+ if(!impl) return new SVGLength(0);
+ return new SVGLength(impl->replaceItem(newItem->handle(), index));
+}
+
+SVGLength *SVGLengthList::removeItem(unsigned long index)
+{
+ if(!impl) return new SVGLength(0);
+ return new SVGLength(impl->removeItem(index));
+}
+
+SVGLength *SVGLengthList::appendItem(SVGLength *newItem)
+{
+ if(!impl) return new SVGLength(0);
+ return new SVGLength(impl->appendItem(newItem->handle()));
+}
diff --git a/ksvg/dom/SVGLengthList.h b/ksvg/dom/SVGLengthList.h
index bf4ab633..4a699c7d 100644
--- a/ksvg/dom/SVGLengthList.h
+++ b/ksvg/dom/SVGLengthList.h
@@ -55,5 +55,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLineElement.cc b/ksvg/dom/SVGLineElement.cc
deleted file mode 100644
index 583c3fe3..00000000
--- a/ksvg/dom/SVGLineElement.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include "SVGLineElement.h"
-#include "SVGLineElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGLineElement::SVGLineElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGLineElement::SVGLineElement(const SVGLineElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGLineElement &SVGLineElement::operator=(const SVGLineElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGLineElement::SVGLineElement(SVGLineElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGLineElement::~SVGLineElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGLineElement::x1()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x1());
-}
-
-SVGAnimatedLength SVGLineElement::y1()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y1());
-}
-
-SVGAnimatedLength SVGLineElement::x2()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x2());
-}
-
-SVGAnimatedLength SVGLineElement::y2()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y2());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLineElement.cpp b/ksvg/dom/SVGLineElement.cpp
new file mode 100644
index 00000000..918734ea
--- /dev/null
+++ b/ksvg/dom/SVGLineElement.cpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "SVGLineElement.h"
+#include "SVGLineElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGLineElement::SVGLineElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGLineElement::SVGLineElement(const SVGLineElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGLineElement &SVGLineElement::operator=(const SVGLineElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGLineElement::SVGLineElement(SVGLineElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGLineElement::~SVGLineElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGLineElement::x1()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x1());
+}
+
+SVGAnimatedLength SVGLineElement::y1()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y1());
+}
+
+SVGAnimatedLength SVGLineElement::x2()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x2());
+}
+
+SVGAnimatedLength SVGLineElement::y2()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y2());
+}
diff --git a/ksvg/dom/SVGLineElement.h b/ksvg/dom/SVGLineElement.h
index b08a78ba..2649f81e 100644
--- a/ksvg/dom/SVGLineElement.h
+++ b/ksvg/dom/SVGLineElement.h
@@ -122,5 +122,3 @@ private:
}
#endif
-
-//vim:ts=4:noet
diff --git a/ksvg/dom/SVGLinearGradientElement.cc b/ksvg/dom/SVGLinearGradientElement.cc
deleted file mode 100644
index b3936dc4..00000000
--- a/ksvg/dom/SVGLinearGradientElement.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGLinearGradientElement.h"
-#include "SVGLinearGradientElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGLinearGradientElement::SVGLinearGradientElement() : SVGGradientElement()
-{
- impl = 0;
-}
-
-SVGLinearGradientElement::SVGLinearGradientElement(const SVGLinearGradientElement &other) : SVGGradientElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGLinearGradientElement &SVGLinearGradientElement::operator =(const SVGLinearGradientElement &other)
-{
- SVGGradientElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGLinearGradientElement::SVGLinearGradientElement(SVGLinearGradientElementImpl *other) : SVGGradientElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGLinearGradientElement::~SVGLinearGradientElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGLinearGradientElement::x1() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x1());
-}
-
-SVGAnimatedLength SVGLinearGradientElement::y1() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y1());
-}
-
-SVGAnimatedLength SVGLinearGradientElement::x2() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x2());
-}
-
-SVGAnimatedLength SVGLinearGradientElement::y2() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y2());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLinearGradientElement.cpp b/ksvg/dom/SVGLinearGradientElement.cpp
new file mode 100644
index 00000000..41c076dc
--- /dev/null
+++ b/ksvg/dom/SVGLinearGradientElement.cpp
@@ -0,0 +1,90 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGLinearGradientElement.h"
+#include "SVGLinearGradientElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGLinearGradientElement::SVGLinearGradientElement() : SVGGradientElement()
+{
+ impl = 0;
+}
+
+SVGLinearGradientElement::SVGLinearGradientElement(const SVGLinearGradientElement &other) : SVGGradientElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGLinearGradientElement &SVGLinearGradientElement::operator =(const SVGLinearGradientElement &other)
+{
+ SVGGradientElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGLinearGradientElement::SVGLinearGradientElement(SVGLinearGradientElementImpl *other) : SVGGradientElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGLinearGradientElement::~SVGLinearGradientElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGLinearGradientElement::x1() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x1());
+}
+
+SVGAnimatedLength SVGLinearGradientElement::y1() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y1());
+}
+
+SVGAnimatedLength SVGLinearGradientElement::x2() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x2());
+}
+
+SVGAnimatedLength SVGLinearGradientElement::y2() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y2());
+}
diff --git a/ksvg/dom/SVGLinearGradientElement.h b/ksvg/dom/SVGLinearGradientElement.h
index fe60df89..c6bd5e89 100644
--- a/ksvg/dom/SVGLinearGradientElement.h
+++ b/ksvg/dom/SVGLinearGradientElement.h
@@ -136,6 +136,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
-
diff --git a/ksvg/dom/SVGLocatable.cc b/ksvg/dom/SVGLocatable.cc
deleted file mode 100644
index 62a89e2e..00000000
--- a/ksvg/dom/SVGLocatable.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGLocatable.h"
-#include "SVGLocatableImpl.h"
-#include "SVGElement.h"
-#include "SVGRect.h"
-#include "SVGMatrix.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGLocatable::SVGLocatable()
-{
- impl = 0;
-}
-
-SVGLocatable::SVGLocatable(const SVGLocatable &other)
-{
- (*this) = other;
-}
-
-SVGLocatable &SVGLocatable::operator=(const SVGLocatable &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGLocatable::SVGLocatable(SVGLocatableImpl *other)
-{
- impl = other;
-}
-
-SVGLocatable::~SVGLocatable()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-SVGElement SVGLocatable::nearestViewportElement() const
-{
- if(!impl) return SVGElement(0);
- return impl->nearestViewportElement();
-}
-
-SVGElement SVGLocatable::farthestViewportElement() const
-{
- if(!impl) return SVGElement(0);
- return impl->farthestViewportElement();
-}
-
-SVGRect SVGLocatable::getBBox()
-{
- if(!impl) return SVGRect(0);
- return SVGRect(impl->getBBox()); // TODO: Check correctness
-}
-
-SVGMatrix SVGLocatable::getCTM()
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->getCTM());
-}
-
-SVGMatrix SVGLocatable::getScreenCTM()
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->getScreenCTM());
-}
-
-SVGMatrix SVGLocatable::getTransformToElement(const SVGElement &element)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->getTransformToElement(element.handle()));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGLocatable.cpp b/ksvg/dom/SVGLocatable.cpp
new file mode 100644
index 00000000..43a9aac7
--- /dev/null
+++ b/ksvg/dom/SVGLocatable.cpp
@@ -0,0 +1,95 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGLocatable.h"
+#include "SVGLocatableImpl.h"
+#include "SVGElement.h"
+#include "SVGRect.h"
+#include "SVGMatrix.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGLocatable::SVGLocatable()
+{
+ impl = 0;
+}
+
+SVGLocatable::SVGLocatable(const SVGLocatable &other)
+{
+ (*this) = other;
+}
+
+SVGLocatable &SVGLocatable::operator=(const SVGLocatable &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGLocatable::SVGLocatable(SVGLocatableImpl *other)
+{
+ impl = other;
+}
+
+SVGLocatable::~SVGLocatable()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+SVGElement SVGLocatable::nearestViewportElement() const
+{
+ if(!impl) return SVGElement(0);
+ return impl->nearestViewportElement();
+}
+
+SVGElement SVGLocatable::farthestViewportElement() const
+{
+ if(!impl) return SVGElement(0);
+ return impl->farthestViewportElement();
+}
+
+SVGRect SVGLocatable::getBBox()
+{
+ if(!impl) return SVGRect(0);
+ return SVGRect(impl->getBBox()); // TODO: Check correctness
+}
+
+SVGMatrix SVGLocatable::getCTM()
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->getCTM());
+}
+
+SVGMatrix SVGLocatable::getScreenCTM()
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->getScreenCTM());
+}
+
+SVGMatrix SVGLocatable::getTransformToElement(const SVGElement &element)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->getTransformToElement(element.handle()));
+}
diff --git a/ksvg/dom/SVGLocatable.h b/ksvg/dom/SVGLocatable.h
index ecb93adc..eb6adef8 100644
--- a/ksvg/dom/SVGLocatable.h
+++ b/ksvg/dom/SVGLocatable.h
@@ -118,5 +118,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMPathElement.cc b/ksvg/dom/SVGMPathElement.cc
deleted file mode 100644
index 6d7a36e4..00000000
--- a/ksvg/dom/SVGMPathElement.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMPathElement.h"
-#include "SVGMPathElementImpl.h"
-
-using namespace KSVG;
-
-SVGMPathElement::SVGMPathElement() : SVGElement(), SVGURIReference(), SVGExternalResourcesRequired()
-{
- impl = 0;
-}
-
-SVGMPathElement::SVGMPathElement(const SVGMPathElement &other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGMPathElement &SVGMPathElement::operator =(const SVGMPathElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGMPathElement::SVGMPathElement(SVGMPathElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGMPathElement::~SVGMPathElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMPathElement.cpp b/ksvg/dom/SVGMPathElement.cpp
new file mode 100644
index 00000000..cb725260
--- /dev/null
+++ b/ksvg/dom/SVGMPathElement.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMPathElement.h"
+#include "SVGMPathElementImpl.h"
+
+using namespace KSVG;
+
+SVGMPathElement::SVGMPathElement() : SVGElement(), SVGURIReference(), SVGExternalResourcesRequired()
+{
+ impl = 0;
+}
+
+SVGMPathElement::SVGMPathElement(const SVGMPathElement &other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGMPathElement &SVGMPathElement::operator =(const SVGMPathElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGMPathElement::SVGMPathElement(SVGMPathElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGMPathElement::~SVGMPathElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGMPathElement.h b/ksvg/dom/SVGMPathElement.h
index e972e7ca..b303cdd5 100644
--- a/ksvg/dom/SVGMPathElement.h
+++ b/ksvg/dom/SVGMPathElement.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMarkerElement.cc b/ksvg/dom/SVGMarkerElement.cc
deleted file mode 100644
index 7d7551da..00000000
--- a/ksvg/dom/SVGMarkerElement.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMarkerElement.h"
-#include "SVGMarkerElementImpl.h"
-#include "SVGAnimatedLength.h"
-#include "SVGAnimatedAngle.h"
-#include "SVGAngle.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGMarkerElement::SVGMarkerElement() : SVGElement(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFitToViewBox()
-{
- impl = 0;
-}
-
-SVGMarkerElement::SVGMarkerElement(const SVGMarkerElement &other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGMarkerElement &SVGMarkerElement::operator =(const SVGMarkerElement &other)
-{
- SVGElement::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGFitToViewBox::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGMarkerElement::SVGMarkerElement(SVGMarkerElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGMarkerElement::~SVGMarkerElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGMarkerElement::refX() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->refX());
-}
-
-SVGAnimatedLength SVGMarkerElement::refY() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->refY());
-}
-
-SVGAnimatedEnumeration SVGMarkerElement::markerUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->markerUnits());
-}
-
-SVGAnimatedLength SVGMarkerElement::markerWidth() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->markerWidth());
-}
-
-SVGAnimatedLength SVGMarkerElement::markerHeight() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->markerHeight());
-}
-
-SVGAnimatedEnumeration SVGMarkerElement::orientType() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->orientType());
-}
-
-SVGAnimatedAngle SVGMarkerElement::orientAngle() const
-{
- if(!impl) return SVGAnimatedAngle(0);
- return SVGAnimatedAngle(impl->orientAngle());
-}
-
-void SVGMarkerElement::setOrientToAuto()
-{
- if(impl)
- impl->setOrientToAuto();
-}
-
-void SVGMarkerElement::setOrientToAngle(const SVGAngle &angle)
-{
- if(impl)
- impl->setOrientToAngle(angle.handle());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMarkerElement.cpp b/ksvg/dom/SVGMarkerElement.cpp
new file mode 100644
index 00000000..de59227d
--- /dev/null
+++ b/ksvg/dom/SVGMarkerElement.cpp
@@ -0,0 +1,127 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMarkerElement.h"
+#include "SVGMarkerElementImpl.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedAngle.h"
+#include "SVGAngle.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGMarkerElement::SVGMarkerElement() : SVGElement(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFitToViewBox()
+{
+ impl = 0;
+}
+
+SVGMarkerElement::SVGMarkerElement(const SVGMarkerElement &other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGMarkerElement &SVGMarkerElement::operator =(const SVGMarkerElement &other)
+{
+ SVGElement::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGFitToViewBox::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGMarkerElement::SVGMarkerElement(SVGMarkerElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGMarkerElement::~SVGMarkerElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGMarkerElement::refX() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->refX());
+}
+
+SVGAnimatedLength SVGMarkerElement::refY() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->refY());
+}
+
+SVGAnimatedEnumeration SVGMarkerElement::markerUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->markerUnits());
+}
+
+SVGAnimatedLength SVGMarkerElement::markerWidth() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->markerWidth());
+}
+
+SVGAnimatedLength SVGMarkerElement::markerHeight() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->markerHeight());
+}
+
+SVGAnimatedEnumeration SVGMarkerElement::orientType() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->orientType());
+}
+
+SVGAnimatedAngle SVGMarkerElement::orientAngle() const
+{
+ if(!impl) return SVGAnimatedAngle(0);
+ return SVGAnimatedAngle(impl->orientAngle());
+}
+
+void SVGMarkerElement::setOrientToAuto()
+{
+ if(impl)
+ impl->setOrientToAuto();
+}
+
+void SVGMarkerElement::setOrientToAngle(const SVGAngle &angle)
+{
+ if(impl)
+ impl->setOrientToAngle(angle.handle());
+}
diff --git a/ksvg/dom/SVGMarkerElement.h b/ksvg/dom/SVGMarkerElement.h
index d2f54904..257148f3 100644
--- a/ksvg/dom/SVGMarkerElement.h
+++ b/ksvg/dom/SVGMarkerElement.h
@@ -83,5 +83,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMaskElement.cc b/ksvg/dom/SVGMaskElement.cc
deleted file mode 100644
index c4513adc..00000000
--- a/ksvg/dom/SVGMaskElement.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMaskElement.h"
-#include "SVGMaskElementImpl.h"
-#include "SVGAnimatedLength.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGMaskElement::SVGMaskElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGUnitTypes()
-{
- impl = 0;
-}
-
-SVGMaskElement::SVGMaskElement(const SVGMaskElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes(), impl(0)
-{
- (*this) = other;
-}
-
-SVGMaskElement &SVGMaskElement::operator =(const SVGMaskElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGMaskElement::SVGMaskElement(SVGMaskElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGMaskElement::~SVGMaskElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedEnumeration SVGMaskElement::maskUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->maskUnits());
-}
-
-SVGAnimatedEnumeration SVGMaskElement::maskContentUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->maskContentUnits());
-}
-
-SVGAnimatedLength SVGMaskElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGMaskElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGMaskElement::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGMaskElement::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMaskElement.cpp b/ksvg/dom/SVGMaskElement.cpp
new file mode 100644
index 00000000..7e1f9cee
--- /dev/null
+++ b/ksvg/dom/SVGMaskElement.cpp
@@ -0,0 +1,107 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMaskElement.h"
+#include "SVGMaskElementImpl.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGMaskElement::SVGMaskElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGUnitTypes()
+{
+ impl = 0;
+}
+
+SVGMaskElement::SVGMaskElement(const SVGMaskElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes(), impl(0)
+{
+ (*this) = other;
+}
+
+SVGMaskElement &SVGMaskElement::operator =(const SVGMaskElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGMaskElement::SVGMaskElement(SVGMaskElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGUnitTypes()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGMaskElement::~SVGMaskElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedEnumeration SVGMaskElement::maskUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->maskUnits());
+}
+
+SVGAnimatedEnumeration SVGMaskElement::maskContentUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->maskContentUnits());
+}
+
+SVGAnimatedLength SVGMaskElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGMaskElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGMaskElement::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGMaskElement::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
diff --git a/ksvg/dom/SVGMaskElement.h b/ksvg/dom/SVGMaskElement.h
index 6a8e26a4..35e81bef 100644
--- a/ksvg/dom/SVGMaskElement.h
+++ b/ksvg/dom/SVGMaskElement.h
@@ -65,5 +65,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMatrix.cc b/ksvg/dom/SVGMatrix.cc
deleted file mode 100644
index 30eeda56..00000000
--- a/ksvg/dom/SVGMatrix.cc
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMatrixImpl.h"
-#include "SVGMatrix.h"
-
-using namespace KSVG;
-
-SVGMatrix::SVGMatrix()
-{
- impl = new SVGMatrixImpl();
- impl->ref();
-}
-
-SVGMatrix::SVGMatrix(double a, double b, double c, double d, double e, double f)
-{
- impl = new SVGMatrixImpl(a, b, c, d, e, f);
- impl->ref();
-}
-
-SVGMatrix::SVGMatrix(const SVGMatrix &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGMatrix &SVGMatrix::operator=(const SVGMatrix &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGMatrix::SVGMatrix(SVGMatrixImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGMatrix::~SVGMatrix()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGMatrix::setA(const double &a)
-{
- if(impl)
- impl->setA(a);
-}
-
-double SVGMatrix::a() const
-{
- if(!impl) return -1;
- return impl->a();
-}
-
-void SVGMatrix::setB(const double &b)
-{
- if(impl)
- impl->setB(b);
-}
-
-double SVGMatrix::b() const
-{
- if(!impl) return -1;
- return impl->b();
-}
-
-void SVGMatrix::setC(const double &c)
-{
- if(impl)
- impl->setC(c);
-}
-
-double SVGMatrix::c() const
-{
- if(!impl) return -1;
- return impl->c();
-}
-
-void SVGMatrix::setD(const double &d)
-{
- if(impl)
- impl->setD(d);
-}
-
-double SVGMatrix::d() const
-{
- if(!impl) return -1;
- return impl->d();
-}
-
-void SVGMatrix::setE(const double &e)
-{
- if(impl)
- impl->setE(e);
-}
-
-double SVGMatrix::e() const
-{
- if(!impl) return -1;
- return impl->e();
-}
-
-void SVGMatrix::setF(const double &f)
-{
- if(impl)
- impl->setF(f);
-}
-
-double SVGMatrix::f() const
-{
- if(!impl) return -1;
- return impl->f();
-}
-
-SVGMatrix SVGMatrix::multiply(SVGMatrix &secondMatrix)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->multiply(secondMatrix.handle()));
-}
-
-SVGMatrix SVGMatrix::inverse()
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->inverse());
-}
-
-SVGMatrix SVGMatrix::translate(const double &x, const double &y)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->translate(x, y));
-}
-
-SVGMatrix SVGMatrix::scale(const double &scaleFactor)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->scale(scaleFactor));
-}
-
-SVGMatrix SVGMatrix::scaleNonUniform(const double &scaleFactorX, const double &scaleFactorY)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->scaleNonUniform(scaleFactorX, scaleFactorY));
-}
-
-SVGMatrix SVGMatrix::rotate(const double &angle)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->rotate(angle));
-}
-
-SVGMatrix SVGMatrix::rotateFromVector(const double &x, const double &y)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->rotateFromVector(x, y));
-}
-
-SVGMatrix SVGMatrix::flipX()
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->flipX());
-}
-
-SVGMatrix SVGMatrix::flipY()
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->flipY());
-}
-
-SVGMatrix SVGMatrix::skewX(const double &angle)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->skewX(angle));
-}
-
-SVGMatrix SVGMatrix::skewY(const double &angle)
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->skewY(angle));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMatrix.cpp b/ksvg/dom/SVGMatrix.cpp
new file mode 100644
index 00000000..e5e8c6db
--- /dev/null
+++ b/ksvg/dom/SVGMatrix.cpp
@@ -0,0 +1,208 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMatrixImpl.h"
+#include "SVGMatrix.h"
+
+using namespace KSVG;
+
+SVGMatrix::SVGMatrix()
+{
+ impl = new SVGMatrixImpl();
+ impl->ref();
+}
+
+SVGMatrix::SVGMatrix(double a, double b, double c, double d, double e, double f)
+{
+ impl = new SVGMatrixImpl(a, b, c, d, e, f);
+ impl->ref();
+}
+
+SVGMatrix::SVGMatrix(const SVGMatrix &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGMatrix &SVGMatrix::operator=(const SVGMatrix &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGMatrix::SVGMatrix(SVGMatrixImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGMatrix::~SVGMatrix()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGMatrix::setA(const double &a)
+{
+ if(impl)
+ impl->setA(a);
+}
+
+double SVGMatrix::a() const
+{
+ if(!impl) return -1;
+ return impl->a();
+}
+
+void SVGMatrix::setB(const double &b)
+{
+ if(impl)
+ impl->setB(b);
+}
+
+double SVGMatrix::b() const
+{
+ if(!impl) return -1;
+ return impl->b();
+}
+
+void SVGMatrix::setC(const double &c)
+{
+ if(impl)
+ impl->setC(c);
+}
+
+double SVGMatrix::c() const
+{
+ if(!impl) return -1;
+ return impl->c();
+}
+
+void SVGMatrix::setD(const double &d)
+{
+ if(impl)
+ impl->setD(d);
+}
+
+double SVGMatrix::d() const
+{
+ if(!impl) return -1;
+ return impl->d();
+}
+
+void SVGMatrix::setE(const double &e)
+{
+ if(impl)
+ impl->setE(e);
+}
+
+double SVGMatrix::e() const
+{
+ if(!impl) return -1;
+ return impl->e();
+}
+
+void SVGMatrix::setF(const double &f)
+{
+ if(impl)
+ impl->setF(f);
+}
+
+double SVGMatrix::f() const
+{
+ if(!impl) return -1;
+ return impl->f();
+}
+
+SVGMatrix SVGMatrix::multiply(SVGMatrix &secondMatrix)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->multiply(secondMatrix.handle()));
+}
+
+SVGMatrix SVGMatrix::inverse()
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->inverse());
+}
+
+SVGMatrix SVGMatrix::translate(const double &x, const double &y)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->translate(x, y));
+}
+
+SVGMatrix SVGMatrix::scale(const double &scaleFactor)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->scale(scaleFactor));
+}
+
+SVGMatrix SVGMatrix::scaleNonUniform(const double &scaleFactorX, const double &scaleFactorY)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->scaleNonUniform(scaleFactorX, scaleFactorY));
+}
+
+SVGMatrix SVGMatrix::rotate(const double &angle)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->rotate(angle));
+}
+
+SVGMatrix SVGMatrix::rotateFromVector(const double &x, const double &y)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->rotateFromVector(x, y));
+}
+
+SVGMatrix SVGMatrix::flipX()
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->flipX());
+}
+
+SVGMatrix SVGMatrix::flipY()
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->flipY());
+}
+
+SVGMatrix SVGMatrix::skewX(const double &angle)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->skewX(angle));
+}
+
+SVGMatrix SVGMatrix::skewY(const double &angle)
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->skewY(angle));
+}
diff --git a/ksvg/dom/SVGMatrix.h b/ksvg/dom/SVGMatrix.h
index caf2b9a8..580ae00e 100644
--- a/ksvg/dom/SVGMatrix.h
+++ b/ksvg/dom/SVGMatrix.h
@@ -75,5 +75,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMetadataElement.cc b/ksvg/dom/SVGMetadataElement.cc
deleted file mode 100644
index e874e95c..00000000
--- a/ksvg/dom/SVGMetadataElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMetadataElement.h"
-#include "SVGMetadataElementImpl.h"
-
-using namespace KSVG;
-
-SVGMetadataElement::SVGMetadataElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGMetadataElement::SVGMetadataElement(const SVGMetadataElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGMetadataElement &SVGMetadataElement::operator =(const SVGMetadataElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGMetadataElement::SVGMetadataElement(SVGMetadataElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGMetadataElement::~SVGMetadataElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMetadataElement.cpp b/ksvg/dom/SVGMetadataElement.cpp
new file mode 100644
index 00000000..11a4820c
--- /dev/null
+++ b/ksvg/dom/SVGMetadataElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMetadataElement.h"
+#include "SVGMetadataElementImpl.h"
+
+using namespace KSVG;
+
+SVGMetadataElement::SVGMetadataElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGMetadataElement::SVGMetadataElement(const SVGMetadataElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGMetadataElement &SVGMetadataElement::operator =(const SVGMetadataElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGMetadataElement::SVGMetadataElement(SVGMetadataElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGMetadataElement::~SVGMetadataElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGMetadataElement.h b/ksvg/dom/SVGMetadataElement.h
index 703e48a6..51525792 100644
--- a/ksvg/dom/SVGMetadataElement.h
+++ b/ksvg/dom/SVGMetadataElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMissingGlyphElement.cc b/ksvg/dom/SVGMissingGlyphElement.cc
deleted file mode 100644
index d9bff554..00000000
--- a/ksvg/dom/SVGMissingGlyphElement.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMissingGlyphElement.h"
-#include "SVGMissingGlyphElementImpl.h"
-
-using namespace KSVG;
-
-SVGMissingGlyphElement::SVGMissingGlyphElement() : SVGElement(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGMissingGlyphElement::SVGMissingGlyphElement(const SVGMissingGlyphElement &other) : SVGElement(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGMissingGlyphElement &SVGMissingGlyphElement::operator =(const SVGMissingGlyphElement &other)
-{
- SVGElement::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGMissingGlyphElement::SVGMissingGlyphElement(SVGMissingGlyphElementImpl *other) : SVGElement(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGMissingGlyphElement::~SVGMissingGlyphElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGMissingGlyphElement.cpp b/ksvg/dom/SVGMissingGlyphElement.cpp
new file mode 100644
index 00000000..e4d5bd79
--- /dev/null
+++ b/ksvg/dom/SVGMissingGlyphElement.cpp
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMissingGlyphElement.h"
+#include "SVGMissingGlyphElementImpl.h"
+
+using namespace KSVG;
+
+SVGMissingGlyphElement::SVGMissingGlyphElement() : SVGElement(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGMissingGlyphElement::SVGMissingGlyphElement(const SVGMissingGlyphElement &other) : SVGElement(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGMissingGlyphElement &SVGMissingGlyphElement::operator =(const SVGMissingGlyphElement &other)
+{
+ SVGElement::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGMissingGlyphElement::SVGMissingGlyphElement(SVGMissingGlyphElementImpl *other) : SVGElement(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGMissingGlyphElement::~SVGMissingGlyphElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGMissingGlyphElement.h b/ksvg/dom/SVGMissingGlyphElement.h
index 5b7e6f62..9c5d4abc 100644
--- a/ksvg/dom/SVGMissingGlyphElement.h
+++ b/ksvg/dom/SVGMissingGlyphElement.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGNumber.cc b/ksvg/dom/SVGNumber.cc
deleted file mode 100644
index 81208987..00000000
--- a/ksvg/dom/SVGNumber.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGNumber.h"
-#include "SVGNumberImpl.h"
-
-using namespace KSVG;
-
-SVGNumber::SVGNumber()
-{
- impl = new SVGNumberImpl();
- impl->ref();
-}
-
-SVGNumber::SVGNumber(const SVGNumber &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGNumber &SVGNumber::operator=(const SVGNumber &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGNumber::SVGNumber(SVGNumberImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGNumber::~SVGNumber()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGNumber::setValue(float value)
-{
- if(impl)
- impl->setValue(value);
-}
-
-float SVGNumber::value() const
-{
- if(!impl) return -1;
- return impl->value();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGNumber.cpp b/ksvg/dom/SVGNumber.cpp
new file mode 100644
index 00000000..9230acb2
--- /dev/null
+++ b/ksvg/dom/SVGNumber.cpp
@@ -0,0 +1,76 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGNumber.h"
+#include "SVGNumberImpl.h"
+
+using namespace KSVG;
+
+SVGNumber::SVGNumber()
+{
+ impl = new SVGNumberImpl();
+ impl->ref();
+}
+
+SVGNumber::SVGNumber(const SVGNumber &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGNumber &SVGNumber::operator=(const SVGNumber &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGNumber::SVGNumber(SVGNumberImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGNumber::~SVGNumber()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGNumber::setValue(float value)
+{
+ if(impl)
+ impl->setValue(value);
+}
+
+float SVGNumber::value() const
+{
+ if(!impl) return -1;
+ return impl->value();
+}
diff --git a/ksvg/dom/SVGNumber.h b/ksvg/dom/SVGNumber.h
index d3efbe42..6a92b574 100644
--- a/ksvg/dom/SVGNumber.h
+++ b/ksvg/dom/SVGNumber.h
@@ -47,5 +47,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGNumberList.cc b/ksvg/dom/SVGNumberList.cc
deleted file mode 100644
index 92adec50..00000000
--- a/ksvg/dom/SVGNumberList.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGNumberList.h"
-#include "SVGNumberListImpl.h"
-#include "SVGNumber.h"
-
-using namespace KSVG;
-
-SVGNumberList::SVGNumberList()
-{
- impl = new SVGNumberListImpl();
- impl->ref();
-}
-
-SVGNumberList::SVGNumberList(const SVGNumberList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGNumberList &SVGNumberList::operator=(const SVGNumberList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGNumberList::SVGNumberList(SVGNumberListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGNumberList::~SVGNumberList()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned long SVGNumberList::numberOfItems() const
-{
- if(!impl) return 0;
- return impl->numberOfItems();
-}
-
-void SVGNumberList::clear()
-{
- if(impl)
- impl->clear();
-}
-
-SVGNumber *SVGNumberList::initialize(SVGNumber *newItem)
-{
- if(!impl) return new SVGNumber(0);
- return new SVGNumber(impl->initialize(newItem->handle()));
-}
-
-SVGNumber *SVGNumberList::getItem(unsigned long index)
-{
- if(!impl) return new SVGNumber(0);
- return new SVGNumber(impl->getItem(index));
-}
-
-SVGNumber *SVGNumberList::insertItemBefore(SVGNumber *newItem, unsigned long index)
-{
- if(!impl) return new SVGNumber(0);
- return new SVGNumber(impl->insertItemBefore(newItem->handle(), index));
-}
-
-SVGNumber *SVGNumberList::replaceItem(SVGNumber *newItem, unsigned long index)
-{
- if(!impl) return new SVGNumber(0);
- return new SVGNumber(impl->replaceItem(newItem->handle(), index));
-}
-
-SVGNumber *SVGNumberList::removeItem(unsigned long index)
-{
- if(!impl) return new SVGNumber(0);
- return new SVGNumber(impl->removeItem(index));
-}
-
-SVGNumber *SVGNumberList::appendItem(SVGNumber *newItem)
-{
- if(!impl) return new SVGNumber(0);
- return new SVGNumber(impl->appendItem(newItem->handle()));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGNumberList.cpp b/ksvg/dom/SVGNumberList.cpp
new file mode 100644
index 00000000..f0587a6e
--- /dev/null
+++ b/ksvg/dom/SVGNumberList.cpp
@@ -0,0 +1,113 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGNumberList.h"
+#include "SVGNumberListImpl.h"
+#include "SVGNumber.h"
+
+using namespace KSVG;
+
+SVGNumberList::SVGNumberList()
+{
+ impl = new SVGNumberListImpl();
+ impl->ref();
+}
+
+SVGNumberList::SVGNumberList(const SVGNumberList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGNumberList &SVGNumberList::operator=(const SVGNumberList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGNumberList::SVGNumberList(SVGNumberListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGNumberList::~SVGNumberList()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned long SVGNumberList::numberOfItems() const
+{
+ if(!impl) return 0;
+ return impl->numberOfItems();
+}
+
+void SVGNumberList::clear()
+{
+ if(impl)
+ impl->clear();
+}
+
+SVGNumber *SVGNumberList::initialize(SVGNumber *newItem)
+{
+ if(!impl) return new SVGNumber(0);
+ return new SVGNumber(impl->initialize(newItem->handle()));
+}
+
+SVGNumber *SVGNumberList::getItem(unsigned long index)
+{
+ if(!impl) return new SVGNumber(0);
+ return new SVGNumber(impl->getItem(index));
+}
+
+SVGNumber *SVGNumberList::insertItemBefore(SVGNumber *newItem, unsigned long index)
+{
+ if(!impl) return new SVGNumber(0);
+ return new SVGNumber(impl->insertItemBefore(newItem->handle(), index));
+}
+
+SVGNumber *SVGNumberList::replaceItem(SVGNumber *newItem, unsigned long index)
+{
+ if(!impl) return new SVGNumber(0);
+ return new SVGNumber(impl->replaceItem(newItem->handle(), index));
+}
+
+SVGNumber *SVGNumberList::removeItem(unsigned long index)
+{
+ if(!impl) return new SVGNumber(0);
+ return new SVGNumber(impl->removeItem(index));
+}
+
+SVGNumber *SVGNumberList::appendItem(SVGNumber *newItem)
+{
+ if(!impl) return new SVGNumber(0);
+ return new SVGNumber(impl->appendItem(newItem->handle()));
+}
diff --git a/ksvg/dom/SVGNumberList.h b/ksvg/dom/SVGNumberList.h
index 920574d7..78ef3367 100644
--- a/ksvg/dom/SVGNumberList.h
+++ b/ksvg/dom/SVGNumberList.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPaint.cc b/ksvg/dom/SVGPaint.cc
deleted file mode 100644
index 7e7051d5..00000000
--- a/ksvg/dom/SVGPaint.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPaint.h"
-#include "SVGPaintImpl.h"
-
-using namespace KSVG;
-
-SVGPaint::SVGPaint() : SVGColor()
-{
- // FIXME: no icc color support...
- impl = new SVGPaintImpl(0);
- impl->ref();
-}
-
-SVGPaint::SVGPaint(const SVGPaint &other) : SVGColor(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGPaint &SVGPaint::operator =(const SVGPaint &other)
-{
- SVGColor::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGPaint::SVGPaint(SVGPaintImpl *other) : SVGColor(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGPaint::~SVGPaint()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned short SVGPaint::paintType() const
-{
- if(!impl) return SVG_PAINTTYPE_UNKNOWN;
- return impl->paintType();
-}
-
-DOM::DOMString SVGPaint::uri() const
-{
- if(!impl) return DOM::DOMString();
- return impl->uri();
-}
-
-void SVGPaint::setUri(const DOM::DOMString &uri)
-{
- if(impl)
- impl->setUri(uri);
-}
-
-void SVGPaint::setPaint(unsigned short paintType, const DOM::DOMString &uri, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- if(impl)
- impl->setPaint(paintType, uri, rgbColor, iccColor);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPaint.cpp b/ksvg/dom/SVGPaint.cpp
new file mode 100644
index 00000000..f8df586b
--- /dev/null
+++ b/ksvg/dom/SVGPaint.cpp
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPaint.h"
+#include "SVGPaintImpl.h"
+
+using namespace KSVG;
+
+SVGPaint::SVGPaint() : SVGColor()
+{
+ // FIXME: no icc color support...
+ impl = new SVGPaintImpl(0);
+ impl->ref();
+}
+
+SVGPaint::SVGPaint(const SVGPaint &other) : SVGColor(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGPaint &SVGPaint::operator =(const SVGPaint &other)
+{
+ SVGColor::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGPaint::SVGPaint(SVGPaintImpl *other) : SVGColor(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGPaint::~SVGPaint()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned short SVGPaint::paintType() const
+{
+ if(!impl) return SVG_PAINTTYPE_UNKNOWN;
+ return impl->paintType();
+}
+
+DOM::DOMString SVGPaint::uri() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->uri();
+}
+
+void SVGPaint::setUri(const DOM::DOMString &uri)
+{
+ if(impl)
+ impl->setUri(uri);
+}
+
+void SVGPaint::setPaint(unsigned short paintType, const DOM::DOMString &uri, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ if(impl)
+ impl->setPaint(paintType, uri, rgbColor, iccColor);
+}
diff --git a/ksvg/dom/SVGPaint.h b/ksvg/dom/SVGPaint.h
index 84f331fb..8a6c6c59 100644
--- a/ksvg/dom/SVGPaint.h
+++ b/ksvg/dom/SVGPaint.h
@@ -66,5 +66,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathElement.cc b/ksvg/dom/SVGPathElement.cc
deleted file mode 100644
index 1153cf65..00000000
--- a/ksvg/dom/SVGPathElement.cc
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathElement.h"
-#include "SVGPathElementImpl.h"
-#include "SVGPoint.h"
-#include "SVGPathSegClosePath.h"
-#include "SVGPathSegLineto.h"
-#include "SVGPathSegLinetoHorizontal.h"
-#include "SVGPathSegLinetoVertical.h"
-#include "SVGPathSegMoveto.h"
-#include "SVGPathSegArc.h"
-#include "SVGPathSegCurvetoCubic.h"
-#include "SVGPathSegCurvetoCubicSmooth.h"
-#include "SVGPathSegCurvetoQuadratic.h"
-#include "SVGPathSegCurvetoQuadraticSmooth.h"
-
-using namespace KSVG;
-
-SVGPathElement::SVGPathElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGAnimatedPathData()
-{
- impl = 0;
-}
-
-SVGPathElement::SVGPathElement(const SVGPathElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGAnimatedPathData(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGPathElement &SVGPathElement::operator=(const SVGPathElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGPathElement::SVGPathElement(SVGPathElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGAnimatedPathData(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGPathElement::~SVGPathElement()
-{
- if(impl)
- impl->deref();
-}
-
-/*
-SVGAnimatedNumber SVGPathElement::pathLength() const
-{
- return m_pathLength;
-}
-*/
-
-float SVGPathElement::getTotalLength()
-{
- return impl->getTotalLength();
-}
-
-SVGPoint SVGPathElement::getPointAtLength(float distance)
-{
- return SVGPoint(impl->getPointAtLength(distance));
-}
-
-unsigned long SVGPathElement::getPathSegAtLength(float distance)
-{
- return impl->getPathSegAtLength(distance);
-}
-
-SVGPathSegClosePath SVGPathElement::createSVGPathSegClosePath()
-{
- return impl->createSVGPathSegClosePath();
-}
-
-SVGPathSegMovetoAbs SVGPathElement::createSVGPathSegMovetoAbs(float x,float y)
-{
- return impl->createSVGPathSegMovetoAbs(x, y);;
-}
-
-SVGPathSegMovetoRel SVGPathElement::createSVGPathSegMovetoRel(float x,float y)
-{
- return impl->createSVGPathSegMovetoRel(x, y);
-}
-
-SVGPathSegLinetoAbs SVGPathElement::createSVGPathSegLinetoAbs(float x,float y)
-{
- return impl->createSVGPathSegLinetoAbs(x, y);
-}
-
-SVGPathSegLinetoRel SVGPathElement::createSVGPathSegLinetoRel(float x,float y)
-{
- return impl->createSVGPathSegLinetoRel(x, y);
-}
-
-SVGPathSegCurvetoCubicAbs SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x,float y,float x1,float y1,float x2,float y2)
-{
- return impl->createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
-}
-
-SVGPathSegCurvetoCubicRel SVGPathElement::createSVGPathSegCurvetoCubicRel(float x,float y,float x1,float y1,float x2,float y2)
-{
- return impl->createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
-}
-
-SVGPathSegCurvetoQuadraticAbs SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x,float y,float x1,float y1)
-{
- return impl->createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
-}
-
-SVGPathSegCurvetoQuadraticRel SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x,float y,float x1,float y1)
-{
- return impl->createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
-}
-
-SVGPathSegArcAbs SVGPathElement::createSVGPathSegArcAbs(float x,float y,float r1,float r2,float angle,bool largeArcFlag,bool sweepFlag)
-{
- return impl->createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
-}
-
-SVGPathSegArcRel SVGPathElement::createSVGPathSegArcRel(float x,float y,float r1,float r2,float angle,bool largeArcFlag,bool sweepFlag)
-{
- return impl->createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
-}
-
-SVGPathSegLinetoHorizontalAbs SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x)
-{
- return impl->createSVGPathSegLinetoHorizontalAbs(x);
-}
-
-SVGPathSegLinetoHorizontalRel SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x)
-{
- return impl->createSVGPathSegLinetoHorizontalRel(x);
-}
-
-SVGPathSegLinetoVerticalAbs SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y)
-{
- return impl->createSVGPathSegLinetoVerticalAbs(y);
-}
-
-SVGPathSegLinetoVerticalRel SVGPathElement::createSVGPathSegLinetoVerticalRel(float y)
-{
- return impl->createSVGPathSegLinetoVerticalRel(y);
-}
-
-SVGPathSegCurvetoCubicSmoothAbs SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x,float y,float x2,float y2)
-{
- return impl->createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);;
-}
-
-SVGPathSegCurvetoCubicSmoothRel SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x,float y,float x2,float y2)
-{
- return impl->createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
-}
-
-SVGPathSegCurvetoQuadraticSmoothAbs SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x,float y)
-{
- return impl->createSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
-}
-
-SVGPathSegCurvetoQuadraticSmoothRel SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x,float y)
-{
- return impl->createSVGPathSegCurvetoQuadraticSmoothRel(x, y);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathElement.cpp b/ksvg/dom/SVGPathElement.cpp
new file mode 100644
index 00000000..d3610f47
--- /dev/null
+++ b/ksvg/dom/SVGPathElement.cpp
@@ -0,0 +1,198 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathElement.h"
+#include "SVGPathElementImpl.h"
+#include "SVGPoint.h"
+#include "SVGPathSegClosePath.h"
+#include "SVGPathSegLineto.h"
+#include "SVGPathSegLinetoHorizontal.h"
+#include "SVGPathSegLinetoVertical.h"
+#include "SVGPathSegMoveto.h"
+#include "SVGPathSegArc.h"
+#include "SVGPathSegCurvetoCubic.h"
+#include "SVGPathSegCurvetoCubicSmooth.h"
+#include "SVGPathSegCurvetoQuadratic.h"
+#include "SVGPathSegCurvetoQuadraticSmooth.h"
+
+using namespace KSVG;
+
+SVGPathElement::SVGPathElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGAnimatedPathData()
+{
+ impl = 0;
+}
+
+SVGPathElement::SVGPathElement(const SVGPathElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGAnimatedPathData(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGPathElement &SVGPathElement::operator=(const SVGPathElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGPathElement::SVGPathElement(SVGPathElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGAnimatedPathData(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGPathElement::~SVGPathElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+/*
+SVGAnimatedNumber SVGPathElement::pathLength() const
+{
+ return m_pathLength;
+}
+*/
+
+float SVGPathElement::getTotalLength()
+{
+ return impl->getTotalLength();
+}
+
+SVGPoint SVGPathElement::getPointAtLength(float distance)
+{
+ return SVGPoint(impl->getPointAtLength(distance));
+}
+
+unsigned long SVGPathElement::getPathSegAtLength(float distance)
+{
+ return impl->getPathSegAtLength(distance);
+}
+
+SVGPathSegClosePath SVGPathElement::createSVGPathSegClosePath()
+{
+ return impl->createSVGPathSegClosePath();
+}
+
+SVGPathSegMovetoAbs SVGPathElement::createSVGPathSegMovetoAbs(float x,float y)
+{
+ return impl->createSVGPathSegMovetoAbs(x, y);;
+}
+
+SVGPathSegMovetoRel SVGPathElement::createSVGPathSegMovetoRel(float x,float y)
+{
+ return impl->createSVGPathSegMovetoRel(x, y);
+}
+
+SVGPathSegLinetoAbs SVGPathElement::createSVGPathSegLinetoAbs(float x,float y)
+{
+ return impl->createSVGPathSegLinetoAbs(x, y);
+}
+
+SVGPathSegLinetoRel SVGPathElement::createSVGPathSegLinetoRel(float x,float y)
+{
+ return impl->createSVGPathSegLinetoRel(x, y);
+}
+
+SVGPathSegCurvetoCubicAbs SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x,float y,float x1,float y1,float x2,float y2)
+{
+ return impl->createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2);
+}
+
+SVGPathSegCurvetoCubicRel SVGPathElement::createSVGPathSegCurvetoCubicRel(float x,float y,float x1,float y1,float x2,float y2)
+{
+ return impl->createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2);
+}
+
+SVGPathSegCurvetoQuadraticAbs SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x,float y,float x1,float y1)
+{
+ return impl->createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1);
+}
+
+SVGPathSegCurvetoQuadraticRel SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x,float y,float x1,float y1)
+{
+ return impl->createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1);
+}
+
+SVGPathSegArcAbs SVGPathElement::createSVGPathSegArcAbs(float x,float y,float r1,float r2,float angle,bool largeArcFlag,bool sweepFlag)
+{
+ return impl->createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+}
+
+SVGPathSegArcRel SVGPathElement::createSVGPathSegArcRel(float x,float y,float r1,float r2,float angle,bool largeArcFlag,bool sweepFlag)
+{
+ return impl->createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+}
+
+SVGPathSegLinetoHorizontalAbs SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x)
+{
+ return impl->createSVGPathSegLinetoHorizontalAbs(x);
+}
+
+SVGPathSegLinetoHorizontalRel SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x)
+{
+ return impl->createSVGPathSegLinetoHorizontalRel(x);
+}
+
+SVGPathSegLinetoVerticalAbs SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y)
+{
+ return impl->createSVGPathSegLinetoVerticalAbs(y);
+}
+
+SVGPathSegLinetoVerticalRel SVGPathElement::createSVGPathSegLinetoVerticalRel(float y)
+{
+ return impl->createSVGPathSegLinetoVerticalRel(y);
+}
+
+SVGPathSegCurvetoCubicSmoothAbs SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x,float y,float x2,float y2)
+{
+ return impl->createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2);;
+}
+
+SVGPathSegCurvetoCubicSmoothRel SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x,float y,float x2,float y2)
+{
+ return impl->createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2);
+}
+
+SVGPathSegCurvetoQuadraticSmoothAbs SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x,float y)
+{
+ return impl->createSVGPathSegCurvetoQuadraticSmoothAbs(x, y);
+}
+
+SVGPathSegCurvetoQuadraticSmoothRel SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x,float y)
+{
+ return impl->createSVGPathSegCurvetoQuadraticSmoothRel(x, y);
+}
diff --git a/ksvg/dom/SVGPathElement.h b/ksvg/dom/SVGPathElement.h
index fa4cb379..8d64f1a1 100644
--- a/ksvg/dom/SVGPathElement.h
+++ b/ksvg/dom/SVGPathElement.h
@@ -103,5 +103,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSeg.cc b/ksvg/dom/SVGPathSeg.cc
deleted file mode 100644
index 3fc31148..00000000
--- a/ksvg/dom/SVGPathSeg.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSeg.h"
-#include "SVGPathSegImpl.h"
-
-using namespace KSVG;
-
-SVGPathSeg::SVGPathSeg()
-{
- impl = new SVGPathSegImpl();
-}
-
-SVGPathSeg::SVGPathSeg(const SVGPathSeg &other)
-{
- impl = other.impl;
-}
-
-SVGPathSeg &SVGPathSeg::operator=(const SVGPathSeg &other)
-{
- if(impl == other.impl)
- return *this;
-
- delete impl;
- impl = other.impl;
-
- return *this;
-}
-
-SVGPathSeg::SVGPathSeg(SVGPathSegImpl *other)
-{
- impl = other;
-}
-
-SVGPathSeg::~SVGPathSeg()
-{
- delete impl;
-}
-
-unsigned short SVGPathSeg::pathSegType() const
-{
- if(!impl) return PATHSEG_UNKNOWN;
- return impl->pathSegType();
-}
-
-DOM::DOMString SVGPathSeg::pathSegTypeAsLetter() const
-{
- if(!impl) return DOM::DOMString("");
- return impl->pathSegTypeAsLetter();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSeg.cpp b/ksvg/dom/SVGPathSeg.cpp
new file mode 100644
index 00000000..7b912e11
--- /dev/null
+++ b/ksvg/dom/SVGPathSeg.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSeg.h"
+#include "SVGPathSegImpl.h"
+
+using namespace KSVG;
+
+SVGPathSeg::SVGPathSeg()
+{
+ impl = new SVGPathSegImpl();
+}
+
+SVGPathSeg::SVGPathSeg(const SVGPathSeg &other)
+{
+ impl = other.impl;
+}
+
+SVGPathSeg &SVGPathSeg::operator=(const SVGPathSeg &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ delete impl;
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGPathSeg::SVGPathSeg(SVGPathSegImpl *other)
+{
+ impl = other;
+}
+
+SVGPathSeg::~SVGPathSeg()
+{
+ delete impl;
+}
+
+unsigned short SVGPathSeg::pathSegType() const
+{
+ if(!impl) return PATHSEG_UNKNOWN;
+ return impl->pathSegType();
+}
+
+DOM::DOMString SVGPathSeg::pathSegTypeAsLetter() const
+{
+ if(!impl) return DOM::DOMString("");
+ return impl->pathSegTypeAsLetter();
+}
diff --git a/ksvg/dom/SVGPathSeg.h b/ksvg/dom/SVGPathSeg.h
index f82e3c80..8058cd02 100644
--- a/ksvg/dom/SVGPathSeg.h
+++ b/ksvg/dom/SVGPathSeg.h
@@ -72,5 +72,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegArc.cc b/ksvg/dom/SVGPathSegArc.cc
deleted file mode 100644
index 078137ab..00000000
--- a/ksvg/dom/SVGPathSegArc.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegArc.h"
-#include "SVGPathSegArcImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegArcAbs::SVGPathSegArcAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegArcAbsImpl();
-}
-
-SVGPathSegArcAbs::SVGPathSegArcAbs(const SVGPathSegArcAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegArcAbs::SVGPathSegArcAbs(SVGPathSegArcAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegArcAbs::~SVGPathSegArcAbs()
-{
- delete impl;
-}
-
-void SVGPathSegArcAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegArcAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegArcAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegArcAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegArcAbs::setR1(const float &r1)
-{
- if(impl)
- impl->setR1(r1);
-}
-
-float SVGPathSegArcAbs::r1() const
-{
- if(!impl) return -1;
- return impl->r1();
-}
-
-void SVGPathSegArcAbs::setR2(const float &r2)
-{
- if(impl)
- impl->setR2(r2);
-}
-
-float SVGPathSegArcAbs::r2() const
-{
- if(!impl) return -1;
- return impl->r2();
-}
-
-void SVGPathSegArcAbs::setAngle(const float &angle)
-{
- if(impl)
- impl->setAngle(angle);
-}
-
-float SVGPathSegArcAbs::angle() const
-{
- if(!impl) return -1;
- return impl->angle();
-}
-
-void SVGPathSegArcAbs::setLargeArcFlag(bool largeArcFlag)
-{
- if(impl)
- impl->setLargeArcFlag(largeArcFlag);
-}
-
-bool SVGPathSegArcAbs::largeArcFlag() const
-{
- if(!impl) return false;
- return impl->largeArcFlag();
-}
-
-void SVGPathSegArcAbs::setSweepFlag(bool sweepFlag)
-{
- if(impl)
- impl->setSweepFlag(sweepFlag);
-}
-
-bool SVGPathSegArcAbs::sweepFlag() const
-{
- if(!impl) return false;
- return impl->sweepFlag();
-}
-
-
-
-
-
-SVGPathSegArcRel::SVGPathSegArcRel() : SVGPathSeg()
-{
- impl = new SVGPathSegArcRelImpl();
-}
-
-SVGPathSegArcRel::SVGPathSegArcRel(const SVGPathSegArcRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegArcRel::SVGPathSegArcRel(SVGPathSegArcRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegArcRel::~SVGPathSegArcRel()
-{
- delete impl;
-}
-
-void SVGPathSegArcRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegArcRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegArcRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegArcRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegArcRel::setR1(const float &r1)
-{
- if(impl)
- impl->setR1(r1);
-}
-
-float SVGPathSegArcRel::r1() const
-{
- if(!impl) return -1;
- return impl->r1();
-}
-
-void SVGPathSegArcRel::setR2(const float &r2)
-{
- if(impl)
- impl->setR2(r2);
-}
-
-float SVGPathSegArcRel::r2() const
-{
- if(!impl) return -1;
- return impl->r2();
-}
-
-void SVGPathSegArcRel::setAngle(const float &angle)
-{
- if(impl)
- impl->setAngle(angle);
-}
-
-float SVGPathSegArcRel::angle() const
-{
- if(!impl) return -1;
- return impl->angle();
-}
-
-void SVGPathSegArcRel::setLargeArcFlag(bool largeArcFlag)
-{
- if(impl)
- impl->setLargeArcFlag(largeArcFlag);
-}
-
-bool SVGPathSegArcRel::largeArcFlag() const
-{
- if(!impl) return false;
- return impl->largeArcFlag();
-}
-
-void SVGPathSegArcRel::setSweepFlag(bool sweepFlag)
-{
- if(impl)
- impl->setSweepFlag(sweepFlag);
-}
-
-bool SVGPathSegArcRel::sweepFlag() const
-{
- if(!impl) return false;
- return impl->sweepFlag();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegArc.cpp b/ksvg/dom/SVGPathSegArc.cpp
new file mode 100644
index 00000000..9e775ff8
--- /dev/null
+++ b/ksvg/dom/SVGPathSegArc.cpp
@@ -0,0 +1,236 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegArc.h"
+#include "SVGPathSegArcImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegArcAbs::SVGPathSegArcAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegArcAbsImpl();
+}
+
+SVGPathSegArcAbs::SVGPathSegArcAbs(const SVGPathSegArcAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegArcAbs::SVGPathSegArcAbs(SVGPathSegArcAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegArcAbs::~SVGPathSegArcAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegArcAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegArcAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegArcAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegArcAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegArcAbs::setR1(const float &r1)
+{
+ if(impl)
+ impl->setR1(r1);
+}
+
+float SVGPathSegArcAbs::r1() const
+{
+ if(!impl) return -1;
+ return impl->r1();
+}
+
+void SVGPathSegArcAbs::setR2(const float &r2)
+{
+ if(impl)
+ impl->setR2(r2);
+}
+
+float SVGPathSegArcAbs::r2() const
+{
+ if(!impl) return -1;
+ return impl->r2();
+}
+
+void SVGPathSegArcAbs::setAngle(const float &angle)
+{
+ if(impl)
+ impl->setAngle(angle);
+}
+
+float SVGPathSegArcAbs::angle() const
+{
+ if(!impl) return -1;
+ return impl->angle();
+}
+
+void SVGPathSegArcAbs::setLargeArcFlag(bool largeArcFlag)
+{
+ if(impl)
+ impl->setLargeArcFlag(largeArcFlag);
+}
+
+bool SVGPathSegArcAbs::largeArcFlag() const
+{
+ if(!impl) return false;
+ return impl->largeArcFlag();
+}
+
+void SVGPathSegArcAbs::setSweepFlag(bool sweepFlag)
+{
+ if(impl)
+ impl->setSweepFlag(sweepFlag);
+}
+
+bool SVGPathSegArcAbs::sweepFlag() const
+{
+ if(!impl) return false;
+ return impl->sweepFlag();
+}
+
+
+
+
+
+SVGPathSegArcRel::SVGPathSegArcRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegArcRelImpl();
+}
+
+SVGPathSegArcRel::SVGPathSegArcRel(const SVGPathSegArcRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegArcRel::SVGPathSegArcRel(SVGPathSegArcRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegArcRel::~SVGPathSegArcRel()
+{
+ delete impl;
+}
+
+void SVGPathSegArcRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegArcRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegArcRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegArcRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegArcRel::setR1(const float &r1)
+{
+ if(impl)
+ impl->setR1(r1);
+}
+
+float SVGPathSegArcRel::r1() const
+{
+ if(!impl) return -1;
+ return impl->r1();
+}
+
+void SVGPathSegArcRel::setR2(const float &r2)
+{
+ if(impl)
+ impl->setR2(r2);
+}
+
+float SVGPathSegArcRel::r2() const
+{
+ if(!impl) return -1;
+ return impl->r2();
+}
+
+void SVGPathSegArcRel::setAngle(const float &angle)
+{
+ if(impl)
+ impl->setAngle(angle);
+}
+
+float SVGPathSegArcRel::angle() const
+{
+ if(!impl) return -1;
+ return impl->angle();
+}
+
+void SVGPathSegArcRel::setLargeArcFlag(bool largeArcFlag)
+{
+ if(impl)
+ impl->setLargeArcFlag(largeArcFlag);
+}
+
+bool SVGPathSegArcRel::largeArcFlag() const
+{
+ if(!impl) return false;
+ return impl->largeArcFlag();
+}
+
+void SVGPathSegArcRel::setSweepFlag(bool sweepFlag)
+{
+ if(impl)
+ impl->setSweepFlag(sweepFlag);
+}
+
+bool SVGPathSegArcRel::sweepFlag() const
+{
+ if(!impl) return false;
+ return impl->sweepFlag();
+}
diff --git a/ksvg/dom/SVGPathSegArc.h b/ksvg/dom/SVGPathSegArc.h
index e9b83786..5f78fba4 100644
--- a/ksvg/dom/SVGPathSegArc.h
+++ b/ksvg/dom/SVGPathSegArc.h
@@ -105,5 +105,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegClosePath.cc b/ksvg/dom/SVGPathSegClosePath.cc
deleted file mode 100644
index d9f33877..00000000
--- a/ksvg/dom/SVGPathSegClosePath.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegClosePath.h"
-#include "SVGPathSegClosePathImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegClosePath::SVGPathSegClosePath() : SVGPathSeg()
-{
- impl = new SVGPathSegClosePathImpl();
-}
-
-SVGPathSegClosePath::SVGPathSegClosePath(const SVGPathSegClosePath &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegClosePath::SVGPathSegClosePath(SVGPathSegClosePathImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegClosePath::~SVGPathSegClosePath()
-{
- delete impl;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegClosePath.cpp b/ksvg/dom/SVGPathSegClosePath.cpp
new file mode 100644
index 00000000..af7dc302
--- /dev/null
+++ b/ksvg/dom/SVGPathSegClosePath.cpp
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegClosePath.h"
+#include "SVGPathSegClosePathImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegClosePath::SVGPathSegClosePath() : SVGPathSeg()
+{
+ impl = new SVGPathSegClosePathImpl();
+}
+
+SVGPathSegClosePath::SVGPathSegClosePath(const SVGPathSegClosePath &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegClosePath::SVGPathSegClosePath(SVGPathSegClosePathImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegClosePath::~SVGPathSegClosePath()
+{
+ delete impl;
+}
diff --git a/ksvg/dom/SVGPathSegClosePath.h b/ksvg/dom/SVGPathSegClosePath.h
index a7f32021..b7d27ce4 100644
--- a/ksvg/dom/SVGPathSegClosePath.h
+++ b/ksvg/dom/SVGPathSegClosePath.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoCubic.cc b/ksvg/dom/SVGPathSegCurvetoCubic.cc
deleted file mode 100644
index bee9ce00..00000000
--- a/ksvg/dom/SVGPathSegCurvetoCubic.cc
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegCurvetoCubic.h"
-#include "SVGPathSegCurvetoCubicImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoCubicAbsImpl();
-}
-
-SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs(const SVGPathSegCurvetoCubicAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs(SVGPathSegCurvetoCubicAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoCubicAbs::~SVGPathSegCurvetoCubicAbs()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoCubicAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoCubicAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoCubicAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoCubicAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegCurvetoCubicAbs::setX1(const float &x1)
-{
- if(impl)
- impl->setX1(x1);
-}
-
-float SVGPathSegCurvetoCubicAbs::x1() const
-{
- if(!impl) return -1;
- return impl->x1();
-}
-
-void SVGPathSegCurvetoCubicAbs::setY1(const float &y1)
-{
- if(impl)
- impl->setY1(y1);
-}
-
-float SVGPathSegCurvetoCubicAbs::y1() const
-{
- if(!impl) return -1;
- return impl->y1();
-}
-
-void SVGPathSegCurvetoCubicAbs::setX2(const float &x2)
-{
- if(impl)
- impl->setX2(x2);
-}
-
-float SVGPathSegCurvetoCubicAbs::x2() const
-{
- if(!impl) return -1;
- return impl->x2();
-}
-
-void SVGPathSegCurvetoCubicAbs::setY2(const float &y2)
-{
- if(impl)
- impl->setY2(y2);
-}
-
-float SVGPathSegCurvetoCubicAbs::y2() const
-{
- if(!impl) return -1;
- return impl->y2();
-}
-
-
-
-
-
-SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoCubicRelImpl();
-}
-
-SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel(const SVGPathSegCurvetoCubicRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel(SVGPathSegCurvetoCubicRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoCubicRel::~SVGPathSegCurvetoCubicRel()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoCubicRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoCubicRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoCubicRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoCubicRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegCurvetoCubicRel::setX1(const float &x1)
-{
- if(impl)
- impl->setX1(x1);
-}
-
-float SVGPathSegCurvetoCubicRel::x1() const
-{
- if(!impl) return -1;
- return impl->x1();
-}
-
-void SVGPathSegCurvetoCubicRel::setY1(const float &y1)
-{
- if(impl)
- impl->setY1(y1);
-}
-
-float SVGPathSegCurvetoCubicRel::y1() const
-{
- if(!impl) return -1;
- return impl->y1();
-}
-
-void SVGPathSegCurvetoCubicRel::setX2(const float &x2)
-{
- if(impl)
- impl->setX2(x2);
-}
-
-float SVGPathSegCurvetoCubicRel::x2() const
-{
- if(!impl) return -1;
- return impl->x2();
-}
-
-void SVGPathSegCurvetoCubicRel::setY2(const float &y2)
-{
- if(impl)
- impl->setY2(y2);
-}
-
-float SVGPathSegCurvetoCubicRel::y2() const
-{
- if(!impl) return -1;
- return impl->y2();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoCubic.cpp b/ksvg/dom/SVGPathSegCurvetoCubic.cpp
new file mode 100644
index 00000000..02313de9
--- /dev/null
+++ b/ksvg/dom/SVGPathSegCurvetoCubic.cpp
@@ -0,0 +1,212 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegCurvetoCubic.h"
+#include "SVGPathSegCurvetoCubicImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoCubicAbsImpl();
+}
+
+SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs(const SVGPathSegCurvetoCubicAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs(SVGPathSegCurvetoCubicAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoCubicAbs::~SVGPathSegCurvetoCubicAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoCubicAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoCubicAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoCubicAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoCubicAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegCurvetoCubicAbs::setX1(const float &x1)
+{
+ if(impl)
+ impl->setX1(x1);
+}
+
+float SVGPathSegCurvetoCubicAbs::x1() const
+{
+ if(!impl) return -1;
+ return impl->x1();
+}
+
+void SVGPathSegCurvetoCubicAbs::setY1(const float &y1)
+{
+ if(impl)
+ impl->setY1(y1);
+}
+
+float SVGPathSegCurvetoCubicAbs::y1() const
+{
+ if(!impl) return -1;
+ return impl->y1();
+}
+
+void SVGPathSegCurvetoCubicAbs::setX2(const float &x2)
+{
+ if(impl)
+ impl->setX2(x2);
+}
+
+float SVGPathSegCurvetoCubicAbs::x2() const
+{
+ if(!impl) return -1;
+ return impl->x2();
+}
+
+void SVGPathSegCurvetoCubicAbs::setY2(const float &y2)
+{
+ if(impl)
+ impl->setY2(y2);
+}
+
+float SVGPathSegCurvetoCubicAbs::y2() const
+{
+ if(!impl) return -1;
+ return impl->y2();
+}
+
+
+
+
+
+SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoCubicRelImpl();
+}
+
+SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel(const SVGPathSegCurvetoCubicRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel(SVGPathSegCurvetoCubicRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoCubicRel::~SVGPathSegCurvetoCubicRel()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoCubicRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoCubicRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoCubicRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoCubicRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegCurvetoCubicRel::setX1(const float &x1)
+{
+ if(impl)
+ impl->setX1(x1);
+}
+
+float SVGPathSegCurvetoCubicRel::x1() const
+{
+ if(!impl) return -1;
+ return impl->x1();
+}
+
+void SVGPathSegCurvetoCubicRel::setY1(const float &y1)
+{
+ if(impl)
+ impl->setY1(y1);
+}
+
+float SVGPathSegCurvetoCubicRel::y1() const
+{
+ if(!impl) return -1;
+ return impl->y1();
+}
+
+void SVGPathSegCurvetoCubicRel::setX2(const float &x2)
+{
+ if(impl)
+ impl->setX2(x2);
+}
+
+float SVGPathSegCurvetoCubicRel::x2() const
+{
+ if(!impl) return -1;
+ return impl->x2();
+}
+
+void SVGPathSegCurvetoCubicRel::setY2(const float &y2)
+{
+ if(impl)
+ impl->setY2(y2);
+}
+
+float SVGPathSegCurvetoCubicRel::y2() const
+{
+ if(!impl) return -1;
+ return impl->y2();
+}
diff --git a/ksvg/dom/SVGPathSegCurvetoCubic.h b/ksvg/dom/SVGPathSegCurvetoCubic.h
index 99fde23e..41b3bdf4 100644
--- a/ksvg/dom/SVGPathSegCurvetoCubic.h
+++ b/ksvg/dom/SVGPathSegCurvetoCubic.h
@@ -99,5 +99,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoCubicSmooth.cc b/ksvg/dom/SVGPathSegCurvetoCubicSmooth.cc
deleted file mode 100644
index 5bb9df25..00000000
--- a/ksvg/dom/SVGPathSegCurvetoCubicSmooth.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegCurvetoCubicSmooth.h"
-#include "SVGPathSegCurvetoCubicSmoothImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoCubicSmoothAbsImpl();
-}
-
-SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs(const SVGPathSegCurvetoCubicSmoothAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs(SVGPathSegCurvetoCubicSmoothAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoCubicSmoothAbs::~SVGPathSegCurvetoCubicSmoothAbs()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoCubicSmoothAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoCubicSmoothAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoCubicSmoothAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoCubicSmoothAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegCurvetoCubicSmoothAbs::setX2(const float &x2)
-{
- if(impl)
- impl->setX2(x2);
-}
-
-float SVGPathSegCurvetoCubicSmoothAbs::x2() const
-{
- if(!impl) return -1;
- return impl->x2();
-}
-
-void SVGPathSegCurvetoCubicSmoothAbs::setY2(const float &y2)
-{
- if(impl)
- impl->setY2(y2);
-}
-
-float SVGPathSegCurvetoCubicSmoothAbs::y2() const
-{
- if(!impl) return -1;
- return impl->y2();
-}
-
-
-
-
-
-SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoCubicSmoothRelImpl();
-}
-
-SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel(const SVGPathSegCurvetoCubicSmoothRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel(SVGPathSegCurvetoCubicSmoothRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoCubicSmoothRel::~SVGPathSegCurvetoCubicSmoothRel()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoCubicSmoothRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoCubicSmoothRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoCubicSmoothRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoCubicSmoothRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegCurvetoCubicSmoothRel::setX2(const float &x2)
-{
- if(impl)
- impl->setX2(x2);
-}
-
-float SVGPathSegCurvetoCubicSmoothRel::x2() const
-{
- if(!impl) return -1;
- return impl->x2();
-}
-
-void SVGPathSegCurvetoCubicSmoothRel::setY2(const float &y2)
-{
- if(impl)
- impl->setY2(y2);
-}
-
-float SVGPathSegCurvetoCubicSmoothRel::y2() const
-{
- if(!impl) return -1;
- return impl->y2();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoCubicSmooth.cpp b/ksvg/dom/SVGPathSegCurvetoCubicSmooth.cpp
new file mode 100644
index 00000000..a8fabdf3
--- /dev/null
+++ b/ksvg/dom/SVGPathSegCurvetoCubicSmooth.cpp
@@ -0,0 +1,164 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegCurvetoCubicSmooth.h"
+#include "SVGPathSegCurvetoCubicSmoothImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoCubicSmoothAbsImpl();
+}
+
+SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs(const SVGPathSegCurvetoCubicSmoothAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs(SVGPathSegCurvetoCubicSmoothAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoCubicSmoothAbs::~SVGPathSegCurvetoCubicSmoothAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoCubicSmoothAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoCubicSmoothAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoCubicSmoothAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoCubicSmoothAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegCurvetoCubicSmoothAbs::setX2(const float &x2)
+{
+ if(impl)
+ impl->setX2(x2);
+}
+
+float SVGPathSegCurvetoCubicSmoothAbs::x2() const
+{
+ if(!impl) return -1;
+ return impl->x2();
+}
+
+void SVGPathSegCurvetoCubicSmoothAbs::setY2(const float &y2)
+{
+ if(impl)
+ impl->setY2(y2);
+}
+
+float SVGPathSegCurvetoCubicSmoothAbs::y2() const
+{
+ if(!impl) return -1;
+ return impl->y2();
+}
+
+
+
+
+
+SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoCubicSmoothRelImpl();
+}
+
+SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel(const SVGPathSegCurvetoCubicSmoothRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel(SVGPathSegCurvetoCubicSmoothRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoCubicSmoothRel::~SVGPathSegCurvetoCubicSmoothRel()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoCubicSmoothRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoCubicSmoothRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoCubicSmoothRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoCubicSmoothRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegCurvetoCubicSmoothRel::setX2(const float &x2)
+{
+ if(impl)
+ impl->setX2(x2);
+}
+
+float SVGPathSegCurvetoCubicSmoothRel::x2() const
+{
+ if(!impl) return -1;
+ return impl->x2();
+}
+
+void SVGPathSegCurvetoCubicSmoothRel::setY2(const float &y2)
+{
+ if(impl)
+ impl->setY2(y2);
+}
+
+float SVGPathSegCurvetoCubicSmoothRel::y2() const
+{
+ if(!impl) return -1;
+ return impl->y2();
+}
diff --git a/ksvg/dom/SVGPathSegCurvetoCubicSmooth.h b/ksvg/dom/SVGPathSegCurvetoCubicSmooth.h
index 444e54f0..2148e919 100644
--- a/ksvg/dom/SVGPathSegCurvetoCubicSmooth.h
+++ b/ksvg/dom/SVGPathSegCurvetoCubicSmooth.h
@@ -87,5 +87,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoQuadratic.cc b/ksvg/dom/SVGPathSegCurvetoQuadratic.cc
deleted file mode 100644
index 7792db31..00000000
--- a/ksvg/dom/SVGPathSegCurvetoQuadratic.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegCurvetoQuadratic.h"
-#include "SVGPathSegCurvetoQuadraticImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoQuadraticAbsImpl();
-}
-
-SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs(const SVGPathSegCurvetoQuadraticAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs(SVGPathSegCurvetoQuadraticAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoQuadraticAbs::~SVGPathSegCurvetoQuadraticAbs()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoQuadraticAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoQuadraticAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoQuadraticAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoQuadraticAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegCurvetoQuadraticAbs::setX1(const float &x1)
-{
- if(impl)
- impl->setX1(x1);
-}
-
-float SVGPathSegCurvetoQuadraticAbs::x1() const
-{
- if(!impl) return -1;
- return impl->x1();
-}
-
-void SVGPathSegCurvetoQuadraticAbs::setY1(const float &y1)
-{
- if(impl)
- impl->setY1(y1);
-}
-
-float SVGPathSegCurvetoQuadraticAbs::y1() const
-{
- if(!impl) return -1;
- return impl->y1();
-}
-
-
-
-
-
-SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoQuadraticRelImpl();
-}
-
-SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel(const SVGPathSegCurvetoQuadraticRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel(SVGPathSegCurvetoQuadraticRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoQuadraticRel::~SVGPathSegCurvetoQuadraticRel()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoQuadraticRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoQuadraticRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoQuadraticRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoQuadraticRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGPathSegCurvetoQuadraticRel::setX1(const float &x1)
-{
- if(impl)
- impl->setX1(x1);
-}
-
-float SVGPathSegCurvetoQuadraticRel::x1() const
-{
- if(!impl) return -1;
- return impl->x1();
-}
-
-void SVGPathSegCurvetoQuadraticRel::setY1(const float &y1)
-{
- if(impl)
- impl->setY1(y1);
-}
-
-float SVGPathSegCurvetoQuadraticRel::y1() const
-{
- if(!impl) return -1;
- return impl->y1();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoQuadratic.cpp b/ksvg/dom/SVGPathSegCurvetoQuadratic.cpp
new file mode 100644
index 00000000..8f83bcf2
--- /dev/null
+++ b/ksvg/dom/SVGPathSegCurvetoQuadratic.cpp
@@ -0,0 +1,164 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegCurvetoQuadratic.h"
+#include "SVGPathSegCurvetoQuadraticImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoQuadraticAbsImpl();
+}
+
+SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs(const SVGPathSegCurvetoQuadraticAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs(SVGPathSegCurvetoQuadraticAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoQuadraticAbs::~SVGPathSegCurvetoQuadraticAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoQuadraticAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoQuadraticAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoQuadraticAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoQuadraticAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegCurvetoQuadraticAbs::setX1(const float &x1)
+{
+ if(impl)
+ impl->setX1(x1);
+}
+
+float SVGPathSegCurvetoQuadraticAbs::x1() const
+{
+ if(!impl) return -1;
+ return impl->x1();
+}
+
+void SVGPathSegCurvetoQuadraticAbs::setY1(const float &y1)
+{
+ if(impl)
+ impl->setY1(y1);
+}
+
+float SVGPathSegCurvetoQuadraticAbs::y1() const
+{
+ if(!impl) return -1;
+ return impl->y1();
+}
+
+
+
+
+
+SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoQuadraticRelImpl();
+}
+
+SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel(const SVGPathSegCurvetoQuadraticRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel(SVGPathSegCurvetoQuadraticRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoQuadraticRel::~SVGPathSegCurvetoQuadraticRel()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoQuadraticRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoQuadraticRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoQuadraticRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoQuadraticRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGPathSegCurvetoQuadraticRel::setX1(const float &x1)
+{
+ if(impl)
+ impl->setX1(x1);
+}
+
+float SVGPathSegCurvetoQuadraticRel::x1() const
+{
+ if(!impl) return -1;
+ return impl->x1();
+}
+
+void SVGPathSegCurvetoQuadraticRel::setY1(const float &y1)
+{
+ if(impl)
+ impl->setY1(y1);
+}
+
+float SVGPathSegCurvetoQuadraticRel::y1() const
+{
+ if(!impl) return -1;
+ return impl->y1();
+}
diff --git a/ksvg/dom/SVGPathSegCurvetoQuadratic.h b/ksvg/dom/SVGPathSegCurvetoQuadratic.h
index 68bb3364..bcad9d20 100644
--- a/ksvg/dom/SVGPathSegCurvetoQuadratic.h
+++ b/ksvg/dom/SVGPathSegCurvetoQuadratic.h
@@ -87,5 +87,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cc b/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cc
deleted file mode 100644
index 35a841c8..00000000
--- a/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegCurvetoQuadraticSmooth.h"
-#include "SVGPathSegCurvetoQuadraticSmoothImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoQuadraticSmoothAbsImpl();
-}
-
-SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathSegCurvetoQuadraticSmoothAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs(SVGPathSegCurvetoQuadraticSmoothAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoQuadraticSmoothAbs::~SVGPathSegCurvetoQuadraticSmoothAbs()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoQuadraticSmoothAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoQuadraticSmoothAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-
-
-
-
-SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel() : SVGPathSeg()
-{
- impl = new SVGPathSegCurvetoQuadraticSmoothRelImpl();
-}
-
-SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathSegCurvetoQuadraticSmoothRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel(SVGPathSegCurvetoQuadraticSmoothRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegCurvetoQuadraticSmoothRel::~SVGPathSegCurvetoQuadraticSmoothRel()
-{
- delete impl;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegCurvetoQuadraticSmoothRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegCurvetoQuadraticSmoothRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cpp b/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cpp
new file mode 100644
index 00000000..d0a52205
--- /dev/null
+++ b/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.cpp
@@ -0,0 +1,116 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegCurvetoQuadraticSmooth.h"
+#include "SVGPathSegCurvetoQuadraticSmoothImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoQuadraticSmoothAbsImpl();
+}
+
+SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathSegCurvetoQuadraticSmoothAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs(SVGPathSegCurvetoQuadraticSmoothAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoQuadraticSmoothAbs::~SVGPathSegCurvetoQuadraticSmoothAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoQuadraticSmoothAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoQuadraticSmoothAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+
+
+
+
+SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegCurvetoQuadraticSmoothRelImpl();
+}
+
+SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathSegCurvetoQuadraticSmoothRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel(SVGPathSegCurvetoQuadraticSmoothRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegCurvetoQuadraticSmoothRel::~SVGPathSegCurvetoQuadraticSmoothRel()
+{
+ delete impl;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegCurvetoQuadraticSmoothRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegCurvetoQuadraticSmoothRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
diff --git a/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.h b/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.h
index e5a2782f..4632eeaf 100644
--- a/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.h
+++ b/ksvg/dom/SVGPathSegCurvetoQuadraticSmooth.h
@@ -75,5 +75,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegLineto.cc b/ksvg/dom/SVGPathSegLineto.cc
deleted file mode 100644
index faabb04e..00000000
--- a/ksvg/dom/SVGPathSegLineto.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegLineto.h"
-#include "SVGPathSegLinetoImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegLinetoAbs::SVGPathSegLinetoAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegLinetoAbsImpl();
-}
-
-SVGPathSegLinetoAbs::SVGPathSegLinetoAbs(const SVGPathSegLinetoAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegLinetoAbs::SVGPathSegLinetoAbs(SVGPathSegLinetoAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegLinetoAbs::~SVGPathSegLinetoAbs()
-{
- delete impl;
-}
-
-void SVGPathSegLinetoAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegLinetoAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegLinetoAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegLinetoAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-
-
-
-
-SVGPathSegLinetoRel::SVGPathSegLinetoRel() : SVGPathSeg()
-{
- impl = new SVGPathSegLinetoRelImpl();
-}
-
-SVGPathSegLinetoRel::SVGPathSegLinetoRel(const SVGPathSegLinetoRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegLinetoRel::SVGPathSegLinetoRel(SVGPathSegLinetoRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegLinetoRel::~SVGPathSegLinetoRel()
-{
- delete impl;
-}
-
-void SVGPathSegLinetoRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegLinetoRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegLinetoRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegLinetoRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegLineto.cpp b/ksvg/dom/SVGPathSegLineto.cpp
new file mode 100644
index 00000000..d4ef6399
--- /dev/null
+++ b/ksvg/dom/SVGPathSegLineto.cpp
@@ -0,0 +1,116 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegLineto.h"
+#include "SVGPathSegLinetoImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegLinetoAbs::SVGPathSegLinetoAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegLinetoAbsImpl();
+}
+
+SVGPathSegLinetoAbs::SVGPathSegLinetoAbs(const SVGPathSegLinetoAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegLinetoAbs::SVGPathSegLinetoAbs(SVGPathSegLinetoAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegLinetoAbs::~SVGPathSegLinetoAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegLinetoAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegLinetoAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegLinetoAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegLinetoAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+
+
+
+
+SVGPathSegLinetoRel::SVGPathSegLinetoRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegLinetoRelImpl();
+}
+
+SVGPathSegLinetoRel::SVGPathSegLinetoRel(const SVGPathSegLinetoRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegLinetoRel::SVGPathSegLinetoRel(SVGPathSegLinetoRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegLinetoRel::~SVGPathSegLinetoRel()
+{
+ delete impl;
+}
+
+void SVGPathSegLinetoRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegLinetoRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegLinetoRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegLinetoRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
diff --git a/ksvg/dom/SVGPathSegLineto.h b/ksvg/dom/SVGPathSegLineto.h
index df1b9862..b2200b0f 100644
--- a/ksvg/dom/SVGPathSegLineto.h
+++ b/ksvg/dom/SVGPathSegLineto.h
@@ -75,5 +75,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegLinetoHorizontal.cc b/ksvg/dom/SVGPathSegLinetoHorizontal.cc
deleted file mode 100644
index 22af4e40..00000000
--- a/ksvg/dom/SVGPathSegLinetoHorizontal.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegLinetoHorizontal.h"
-#include "SVGPathSegLinetoHorizontalImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegLinetoHorizontalAbsImpl();
-}
-
-SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs(const SVGPathSegLinetoHorizontalAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs(SVGPathSegLinetoHorizontalAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegLinetoHorizontalAbs::~SVGPathSegLinetoHorizontalAbs()
-{
- delete impl;
-}
-
-void SVGPathSegLinetoHorizontalAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegLinetoHorizontalAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-
-
-
-
-SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel() : SVGPathSeg()
-{
- impl = new SVGPathSegLinetoHorizontalRelImpl();
-}
-
-SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel(const SVGPathSegLinetoHorizontalRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel(SVGPathSegLinetoHorizontalRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegLinetoHorizontalRel::~SVGPathSegLinetoHorizontalRel()
-{
- delete impl;
-}
-
-void SVGPathSegLinetoHorizontalRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegLinetoHorizontalRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegLinetoHorizontal.cpp b/ksvg/dom/SVGPathSegLinetoHorizontal.cpp
new file mode 100644
index 00000000..e42b0337
--- /dev/null
+++ b/ksvg/dom/SVGPathSegLinetoHorizontal.cpp
@@ -0,0 +1,92 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegLinetoHorizontal.h"
+#include "SVGPathSegLinetoHorizontalImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegLinetoHorizontalAbsImpl();
+}
+
+SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs(const SVGPathSegLinetoHorizontalAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs(SVGPathSegLinetoHorizontalAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegLinetoHorizontalAbs::~SVGPathSegLinetoHorizontalAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegLinetoHorizontalAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegLinetoHorizontalAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+
+
+
+
+SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegLinetoHorizontalRelImpl();
+}
+
+SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel(const SVGPathSegLinetoHorizontalRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel(SVGPathSegLinetoHorizontalRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegLinetoHorizontalRel::~SVGPathSegLinetoHorizontalRel()
+{
+ delete impl;
+}
+
+void SVGPathSegLinetoHorizontalRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegLinetoHorizontalRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
diff --git a/ksvg/dom/SVGPathSegLinetoHorizontal.h b/ksvg/dom/SVGPathSegLinetoHorizontal.h
index 51edd6ff..2ad9ec05 100644
--- a/ksvg/dom/SVGPathSegLinetoHorizontal.h
+++ b/ksvg/dom/SVGPathSegLinetoHorizontal.h
@@ -69,5 +69,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegLinetoVertical.cc b/ksvg/dom/SVGPathSegLinetoVertical.cc
deleted file mode 100644
index 86e0c33e..00000000
--- a/ksvg/dom/SVGPathSegLinetoVertical.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegLinetoVertical.h"
-#include "SVGPathSegLinetoVerticalImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegLinetoVerticalAbsImpl();
-}
-
-SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs(const SVGPathSegLinetoVerticalAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs(SVGPathSegLinetoVerticalAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegLinetoVerticalAbs::~SVGPathSegLinetoVerticalAbs()
-{
- delete impl;
-}
-
-void SVGPathSegLinetoVerticalAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegLinetoVerticalAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-
-
-
-
-SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel() : SVGPathSeg()
-{
- impl = new SVGPathSegLinetoVerticalRelImpl();
-}
-
-SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel(const SVGPathSegLinetoVerticalRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel(SVGPathSegLinetoVerticalRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegLinetoVerticalRel::~SVGPathSegLinetoVerticalRel()
-{
- delete impl;
-}
-
-void SVGPathSegLinetoVerticalRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegLinetoVerticalRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegLinetoVertical.cpp b/ksvg/dom/SVGPathSegLinetoVertical.cpp
new file mode 100644
index 00000000..b271f5cc
--- /dev/null
+++ b/ksvg/dom/SVGPathSegLinetoVertical.cpp
@@ -0,0 +1,92 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegLinetoVertical.h"
+#include "SVGPathSegLinetoVerticalImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegLinetoVerticalAbsImpl();
+}
+
+SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs(const SVGPathSegLinetoVerticalAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs(SVGPathSegLinetoVerticalAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegLinetoVerticalAbs::~SVGPathSegLinetoVerticalAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegLinetoVerticalAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegLinetoVerticalAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+
+
+
+
+SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegLinetoVerticalRelImpl();
+}
+
+SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel(const SVGPathSegLinetoVerticalRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel(SVGPathSegLinetoVerticalRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegLinetoVerticalRel::~SVGPathSegLinetoVerticalRel()
+{
+ delete impl;
+}
+
+void SVGPathSegLinetoVerticalRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegLinetoVerticalRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
diff --git a/ksvg/dom/SVGPathSegLinetoVertical.h b/ksvg/dom/SVGPathSegLinetoVertical.h
index 05e516a7..fbb357a7 100644
--- a/ksvg/dom/SVGPathSegLinetoVertical.h
+++ b/ksvg/dom/SVGPathSegLinetoVertical.h
@@ -69,5 +69,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegList.cc b/ksvg/dom/SVGPathSegList.cc
deleted file mode 100644
index e653adc6..00000000
--- a/ksvg/dom/SVGPathSegList.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegList.h"
-#include "SVGPathSegListImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegList::SVGPathSegList()
-{
- impl = new SVGPathSegListImpl();
- impl->ref();
-}
-
-SVGPathSegList::SVGPathSegList(const SVGPathSegList &other)
-{
- (*this) = other;
-}
-
-SVGPathSegList &SVGPathSegList::operator=(const SVGPathSegList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGPathSegList::SVGPathSegList(SVGPathSegListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGPathSegList::~SVGPathSegList()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned long SVGPathSegList::numberOfItems() const
-{
- if(!impl) return 0;
- return impl->numberOfItems();
-}
-
-void SVGPathSegList::clear()
-{
- if(impl)
- impl->clear();
-}
-
-SVGPathSeg *SVGPathSegList::initialize(SVGPathSeg *newItem)
-{
- if(!impl) return new SVGPathSeg(0);
- return new SVGPathSeg(impl->initialize(newItem->handle()));
-}
-
-SVGPathSeg *SVGPathSegList::getItem(unsigned long index)
-{
- if(!impl) return new SVGPathSeg(0);
- return new SVGPathSeg(impl->getItem(index));
-}
-
-SVGPathSeg *SVGPathSegList::insertItemBefore(SVGPathSeg *newItem, unsigned long index)
-{
- if(!impl) return new SVGPathSeg(0);
- return new SVGPathSeg(impl->insertItemBefore(newItem->handle(), index));
-}
-
-SVGPathSeg *SVGPathSegList::replaceItem(SVGPathSeg *newItem, unsigned long index)
-{
- if(!impl) return new SVGPathSeg(0);
- return new SVGPathSeg(impl->replaceItem(newItem->handle(), index));
-}
-
-SVGPathSeg *SVGPathSegList::removeItem(unsigned long index)
-{
- if(!impl) return new SVGPathSeg(0);
- return new SVGPathSeg(impl->removeItem(index));
-}
-
-SVGPathSeg *SVGPathSegList::appendItem(SVGPathSeg *newItem)
-{
- if(!impl) return new SVGPathSeg(0);
- return new SVGPathSeg(impl->appendItem(newItem->handle()));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegList.cpp b/ksvg/dom/SVGPathSegList.cpp
new file mode 100644
index 00000000..24d255bc
--- /dev/null
+++ b/ksvg/dom/SVGPathSegList.cpp
@@ -0,0 +1,112 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegList.h"
+#include "SVGPathSegListImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegList::SVGPathSegList()
+{
+ impl = new SVGPathSegListImpl();
+ impl->ref();
+}
+
+SVGPathSegList::SVGPathSegList(const SVGPathSegList &other)
+{
+ (*this) = other;
+}
+
+SVGPathSegList &SVGPathSegList::operator=(const SVGPathSegList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGPathSegList::SVGPathSegList(SVGPathSegListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGPathSegList::~SVGPathSegList()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned long SVGPathSegList::numberOfItems() const
+{
+ if(!impl) return 0;
+ return impl->numberOfItems();
+}
+
+void SVGPathSegList::clear()
+{
+ if(impl)
+ impl->clear();
+}
+
+SVGPathSeg *SVGPathSegList::initialize(SVGPathSeg *newItem)
+{
+ if(!impl) return new SVGPathSeg(0);
+ return new SVGPathSeg(impl->initialize(newItem->handle()));
+}
+
+SVGPathSeg *SVGPathSegList::getItem(unsigned long index)
+{
+ if(!impl) return new SVGPathSeg(0);
+ return new SVGPathSeg(impl->getItem(index));
+}
+
+SVGPathSeg *SVGPathSegList::insertItemBefore(SVGPathSeg *newItem, unsigned long index)
+{
+ if(!impl) return new SVGPathSeg(0);
+ return new SVGPathSeg(impl->insertItemBefore(newItem->handle(), index));
+}
+
+SVGPathSeg *SVGPathSegList::replaceItem(SVGPathSeg *newItem, unsigned long index)
+{
+ if(!impl) return new SVGPathSeg(0);
+ return new SVGPathSeg(impl->replaceItem(newItem->handle(), index));
+}
+
+SVGPathSeg *SVGPathSegList::removeItem(unsigned long index)
+{
+ if(!impl) return new SVGPathSeg(0);
+ return new SVGPathSeg(impl->removeItem(index));
+}
+
+SVGPathSeg *SVGPathSegList::appendItem(SVGPathSeg *newItem)
+{
+ if(!impl) return new SVGPathSeg(0);
+ return new SVGPathSeg(impl->appendItem(newItem->handle()));
+}
diff --git a/ksvg/dom/SVGPathSegList.h b/ksvg/dom/SVGPathSegList.h
index b9feca72..326d0f16 100644
--- a/ksvg/dom/SVGPathSegList.h
+++ b/ksvg/dom/SVGPathSegList.h
@@ -55,5 +55,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegMoveto.cc b/ksvg/dom/SVGPathSegMoveto.cc
deleted file mode 100644
index c5a1dac0..00000000
--- a/ksvg/dom/SVGPathSegMoveto.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegMoveto.h"
-#include "SVGPathSegMovetoImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegMovetoAbs::SVGPathSegMovetoAbs() : SVGPathSeg()
-{
- impl = new SVGPathSegMovetoAbsImpl();
-}
-
-SVGPathSegMovetoAbs::SVGPathSegMovetoAbs(const SVGPathSegMovetoAbs &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegMovetoAbs::SVGPathSegMovetoAbs(SVGPathSegMovetoAbsImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegMovetoAbs::~SVGPathSegMovetoAbs()
-{
- delete impl;
-}
-
-void SVGPathSegMovetoAbs::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegMovetoAbs::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegMovetoAbs::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegMovetoAbs::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-
-
-
-
-SVGPathSegMovetoRel::SVGPathSegMovetoRel() : SVGPathSeg()
-{
- impl = new SVGPathSegMovetoRelImpl();
-}
-
-SVGPathSegMovetoRel::SVGPathSegMovetoRel(const SVGPathSegMovetoRel &other) : SVGPathSeg(other)
-{
- impl = other.impl;
-}
-
-SVGPathSegMovetoRel::SVGPathSegMovetoRel(SVGPathSegMovetoRelImpl *other) : SVGPathSeg(other)
-{
- impl = other;
-}
-
-SVGPathSegMovetoRel::~SVGPathSegMovetoRel()
-{
- delete impl;
-}
-
-void SVGPathSegMovetoRel::setX(const float &x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPathSegMovetoRel::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPathSegMovetoRel::setY(const float &y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPathSegMovetoRel::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPathSegMoveto.cpp b/ksvg/dom/SVGPathSegMoveto.cpp
new file mode 100644
index 00000000..f32f6f55
--- /dev/null
+++ b/ksvg/dom/SVGPathSegMoveto.cpp
@@ -0,0 +1,116 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegMoveto.h"
+#include "SVGPathSegMovetoImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegMovetoAbs::SVGPathSegMovetoAbs() : SVGPathSeg()
+{
+ impl = new SVGPathSegMovetoAbsImpl();
+}
+
+SVGPathSegMovetoAbs::SVGPathSegMovetoAbs(const SVGPathSegMovetoAbs &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegMovetoAbs::SVGPathSegMovetoAbs(SVGPathSegMovetoAbsImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegMovetoAbs::~SVGPathSegMovetoAbs()
+{
+ delete impl;
+}
+
+void SVGPathSegMovetoAbs::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegMovetoAbs::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegMovetoAbs::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegMovetoAbs::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+
+
+
+
+SVGPathSegMovetoRel::SVGPathSegMovetoRel() : SVGPathSeg()
+{
+ impl = new SVGPathSegMovetoRelImpl();
+}
+
+SVGPathSegMovetoRel::SVGPathSegMovetoRel(const SVGPathSegMovetoRel &other) : SVGPathSeg(other)
+{
+ impl = other.impl;
+}
+
+SVGPathSegMovetoRel::SVGPathSegMovetoRel(SVGPathSegMovetoRelImpl *other) : SVGPathSeg(other)
+{
+ impl = other;
+}
+
+SVGPathSegMovetoRel::~SVGPathSegMovetoRel()
+{
+ delete impl;
+}
+
+void SVGPathSegMovetoRel::setX(const float &x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPathSegMovetoRel::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPathSegMovetoRel::setY(const float &y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPathSegMovetoRel::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
diff --git a/ksvg/dom/SVGPathSegMoveto.h b/ksvg/dom/SVGPathSegMoveto.h
index 874443c3..8eb6fb1b 100644
--- a/ksvg/dom/SVGPathSegMoveto.h
+++ b/ksvg/dom/SVGPathSegMoveto.h
@@ -75,5 +75,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPatternElement.cc b/ksvg/dom/SVGPatternElement.cc
deleted file mode 100644
index fc387a97..00000000
--- a/ksvg/dom/SVGPatternElement.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPatternElement.h"
-#include "SVGPatternElementImpl.h"
-#include "SVGAnimatedTransformList.h"
-#include "SVGAnimatedLength.h"
-#include "SVGAnimatedEnumeration.h"
-
-using namespace KSVG;
-
-SVGPatternElement::SVGPatternElement() : SVGElement(), SVGURIReference(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFitToViewBox(), SVGUnitTypes()
-{
- impl = 0;
-}
-
-SVGPatternElement::SVGPatternElement(const SVGPatternElement &other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), SVGUnitTypes(), impl(0)
-{
- (*this) = other;
-}
-
-SVGPatternElement &SVGPatternElement::operator =(const SVGPatternElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGFitToViewBox::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGPatternElement::SVGPatternElement(SVGPatternElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), SVGUnitTypes()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGPatternElement::~SVGPatternElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedEnumeration SVGPatternElement::patternUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->patternUnits());
-}
-
-SVGAnimatedEnumeration SVGPatternElement::patternContentUnits() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->patternContentUnits());
-}
-
-SVGAnimatedTransformList SVGPatternElement::patternTransform() const
-{
- if(!impl) return SVGAnimatedTransformList(0);
- return SVGAnimatedTransformList(impl->patternTransform());
-}
-
-SVGAnimatedLength SVGPatternElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGPatternElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGPatternElement::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGPatternElement::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPatternElement.cpp b/ksvg/dom/SVGPatternElement.cpp
new file mode 100644
index 00000000..8dcc86f8
--- /dev/null
+++ b/ksvg/dom/SVGPatternElement.cpp
@@ -0,0 +1,115 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPatternElement.h"
+#include "SVGPatternElementImpl.h"
+#include "SVGAnimatedTransformList.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedEnumeration.h"
+
+using namespace KSVG;
+
+SVGPatternElement::SVGPatternElement() : SVGElement(), SVGURIReference(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFitToViewBox(), SVGUnitTypes()
+{
+ impl = 0;
+}
+
+SVGPatternElement::SVGPatternElement(const SVGPatternElement &other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), SVGUnitTypes(), impl(0)
+{
+ (*this) = other;
+}
+
+SVGPatternElement &SVGPatternElement::operator =(const SVGPatternElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGFitToViewBox::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGPatternElement::SVGPatternElement(SVGPatternElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), SVGUnitTypes()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGPatternElement::~SVGPatternElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedEnumeration SVGPatternElement::patternUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->patternUnits());
+}
+
+SVGAnimatedEnumeration SVGPatternElement::patternContentUnits() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->patternContentUnits());
+}
+
+SVGAnimatedTransformList SVGPatternElement::patternTransform() const
+{
+ if(!impl) return SVGAnimatedTransformList(0);
+ return SVGAnimatedTransformList(impl->patternTransform());
+}
+
+SVGAnimatedLength SVGPatternElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGPatternElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGPatternElement::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGPatternElement::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
diff --git a/ksvg/dom/SVGPatternElement.h b/ksvg/dom/SVGPatternElement.h
index 9caf5c14..27850c65 100644
--- a/ksvg/dom/SVGPatternElement.h
+++ b/ksvg/dom/SVGPatternElement.h
@@ -184,5 +184,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPoint.cc b/ksvg/dom/SVGPoint.cc
deleted file mode 100644
index ac194e7e..00000000
--- a/ksvg/dom/SVGPoint.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPoint.h"
-#include "SVGMatrix.h"
-#include "SVGPointImpl.h"
-
-using namespace KSVG;
-
-SVGPoint::SVGPoint()
-{
- impl = new SVGPointImpl();
- impl->ref();
-}
-
-SVGPoint::SVGPoint(const SVGPoint &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGPoint &SVGPoint::operator=(const SVGPoint &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGPoint::SVGPoint(SVGPointImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGPoint::~SVGPoint()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGPoint::setX(float x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGPoint::x()
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGPoint::setY(float y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGPoint::y()
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-SVGPoint SVGPoint::matrixTransform(SVGMatrix &matrix)
-{
- if(!impl) return SVGPoint(0);
- return SVGPoint(impl->matrixTransform(*matrix.handle()));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPoint.cpp b/ksvg/dom/SVGPoint.cpp
new file mode 100644
index 00000000..c385c904
--- /dev/null
+++ b/ksvg/dom/SVGPoint.cpp
@@ -0,0 +1,95 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPoint.h"
+#include "SVGMatrix.h"
+#include "SVGPointImpl.h"
+
+using namespace KSVG;
+
+SVGPoint::SVGPoint()
+{
+ impl = new SVGPointImpl();
+ impl->ref();
+}
+
+SVGPoint::SVGPoint(const SVGPoint &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGPoint &SVGPoint::operator=(const SVGPoint &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGPoint::SVGPoint(SVGPointImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGPoint::~SVGPoint()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGPoint::setX(float x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGPoint::x()
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGPoint::setY(float y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGPoint::y()
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+SVGPoint SVGPoint::matrixTransform(SVGMatrix &matrix)
+{
+ if(!impl) return SVGPoint(0);
+ return SVGPoint(impl->matrixTransform(*matrix.handle()));
+}
diff --git a/ksvg/dom/SVGPoint.h b/ksvg/dom/SVGPoint.h
index 84b38e86..05726a90 100644
--- a/ksvg/dom/SVGPoint.h
+++ b/ksvg/dom/SVGPoint.h
@@ -53,5 +53,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPointList.cc b/ksvg/dom/SVGPointList.cpp
index 963b1c60..963b1c60 100644
--- a/ksvg/dom/SVGPointList.cc
+++ b/ksvg/dom/SVGPointList.cpp
diff --git a/ksvg/dom/SVGPolygonElement.cc b/ksvg/dom/SVGPolygonElement.cpp
index 043c19df..043c19df 100644
--- a/ksvg/dom/SVGPolygonElement.cc
+++ b/ksvg/dom/SVGPolygonElement.cpp
diff --git a/ksvg/dom/SVGPolygonElement.h b/ksvg/dom/SVGPolygonElement.h
index 526e9815..40da921b 100644
--- a/ksvg/dom/SVGPolygonElement.h
+++ b/ksvg/dom/SVGPolygonElement.h
@@ -102,5 +102,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPolylineElement.cc b/ksvg/dom/SVGPolylineElement.cpp
index 789c5847..789c5847 100644
--- a/ksvg/dom/SVGPolylineElement.cc
+++ b/ksvg/dom/SVGPolylineElement.cpp
diff --git a/ksvg/dom/SVGPolylineElement.h b/ksvg/dom/SVGPolylineElement.h
index 35e948f7..41d62dae 100644
--- a/ksvg/dom/SVGPolylineElement.h
+++ b/ksvg/dom/SVGPolylineElement.h
@@ -102,5 +102,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPreserveAspectRatio.cc b/ksvg/dom/SVGPreserveAspectRatio.cc
deleted file mode 100644
index f86ca1b4..00000000
--- a/ksvg/dom/SVGPreserveAspectRatio.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPreserveAspectRatio.h"
-#include "SVGPreserveAspectRatioImpl.h"
-
-using namespace KSVG;
-
-SVGPreserveAspectRatio::SVGPreserveAspectRatio()
-{
- impl = new SVGPreserveAspectRatioImpl();
-}
-
-SVGPreserveAspectRatio::SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)
-{
- impl = other.impl;
-}
-
-SVGPreserveAspectRatio &SVGPreserveAspectRatio::operator=(const SVGPreserveAspectRatio &other)
-{
- if(impl == other.impl)
- return *this;
-
- delete impl;
- impl = other.impl;
-
- return *this;
-}
-
-SVGPreserveAspectRatio::SVGPreserveAspectRatio(SVGPreserveAspectRatioImpl *other)
-{
- impl = other;
-}
-
-SVGPreserveAspectRatio::~SVGPreserveAspectRatio()
-{
- delete impl;
-}
-
-void SVGPreserveAspectRatio::setAlign(unsigned short align)
-{
- if(impl)
- impl->setAlign(align);
-}
-
-unsigned short SVGPreserveAspectRatio::align() const
-{
- if(!impl) return SVG_PRESERVEASPECTRATIO_UNKNOWN;
- return impl->align();
-}
-
-void SVGPreserveAspectRatio::setMeetOrSlice(unsigned short meetOrSlice)
-{
- if(impl)
- impl->setMeetOrSlice(meetOrSlice);
-}
-
-unsigned short SVGPreserveAspectRatio::meetOrSlice() const
-{
- if(!impl) return SVG_MEETORSLICE_UNKNOWN;
- return impl->meetOrSlice();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGPreserveAspectRatio.cpp b/ksvg/dom/SVGPreserveAspectRatio.cpp
new file mode 100644
index 00000000..51f6e32b
--- /dev/null
+++ b/ksvg/dom/SVGPreserveAspectRatio.cpp
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPreserveAspectRatio.h"
+#include "SVGPreserveAspectRatioImpl.h"
+
+using namespace KSVG;
+
+SVGPreserveAspectRatio::SVGPreserveAspectRatio()
+{
+ impl = new SVGPreserveAspectRatioImpl();
+}
+
+SVGPreserveAspectRatio::SVGPreserveAspectRatio(const SVGPreserveAspectRatio &other)
+{
+ impl = other.impl;
+}
+
+SVGPreserveAspectRatio &SVGPreserveAspectRatio::operator=(const SVGPreserveAspectRatio &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ delete impl;
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGPreserveAspectRatio::SVGPreserveAspectRatio(SVGPreserveAspectRatioImpl *other)
+{
+ impl = other;
+}
+
+SVGPreserveAspectRatio::~SVGPreserveAspectRatio()
+{
+ delete impl;
+}
+
+void SVGPreserveAspectRatio::setAlign(unsigned short align)
+{
+ if(impl)
+ impl->setAlign(align);
+}
+
+unsigned short SVGPreserveAspectRatio::align() const
+{
+ if(!impl) return SVG_PRESERVEASPECTRATIO_UNKNOWN;
+ return impl->align();
+}
+
+void SVGPreserveAspectRatio::setMeetOrSlice(unsigned short meetOrSlice)
+{
+ if(impl)
+ impl->setMeetOrSlice(meetOrSlice);
+}
+
+unsigned short SVGPreserveAspectRatio::meetOrSlice() const
+{
+ if(!impl) return SVG_MEETORSLICE_UNKNOWN;
+ return impl->meetOrSlice();
+}
diff --git a/ksvg/dom/SVGPreserveAspectRatio.h b/ksvg/dom/SVGPreserveAspectRatio.h
index 3c1a4823..2b1bb51a 100644
--- a/ksvg/dom/SVGPreserveAspectRatio.h
+++ b/ksvg/dom/SVGPreserveAspectRatio.h
@@ -72,5 +72,3 @@ protected:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRadialGradientElement.cc b/ksvg/dom/SVGRadialGradientElement.cc
deleted file mode 100644
index 02f3d5f2..00000000
--- a/ksvg/dom/SVGRadialGradientElement.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGRadialGradientElement.h"
-#include "SVGRadialGradientElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGRadialGradientElement::SVGRadialGradientElement() : SVGGradientElement()
-{
- impl = 0;
-}
-
-SVGRadialGradientElement::SVGRadialGradientElement(const SVGRadialGradientElement &other) : SVGGradientElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGRadialGradientElement &SVGRadialGradientElement::operator =(const SVGRadialGradientElement &other)
-{
- SVGGradientElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGRadialGradientElement::SVGRadialGradientElement(SVGRadialGradientElementImpl *other) : SVGGradientElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGRadialGradientElement::~SVGRadialGradientElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGRadialGradientElement::cx() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->cx());
-}
-
-SVGAnimatedLength SVGRadialGradientElement::cy() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->cy());
-}
-
-SVGAnimatedLength SVGRadialGradientElement::r() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->r());
-}
-
-SVGAnimatedLength SVGRadialGradientElement::fx() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->fx());
-}
-
-SVGAnimatedLength SVGRadialGradientElement::fy() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->fy());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRadialGradientElement.cpp b/ksvg/dom/SVGRadialGradientElement.cpp
new file mode 100644
index 00000000..0e71d846
--- /dev/null
+++ b/ksvg/dom/SVGRadialGradientElement.cpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGRadialGradientElement.h"
+#include "SVGRadialGradientElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGRadialGradientElement::SVGRadialGradientElement() : SVGGradientElement()
+{
+ impl = 0;
+}
+
+SVGRadialGradientElement::SVGRadialGradientElement(const SVGRadialGradientElement &other) : SVGGradientElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGRadialGradientElement &SVGRadialGradientElement::operator =(const SVGRadialGradientElement &other)
+{
+ SVGGradientElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGRadialGradientElement::SVGRadialGradientElement(SVGRadialGradientElementImpl *other) : SVGGradientElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGRadialGradientElement::~SVGRadialGradientElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGRadialGradientElement::cx() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->cx());
+}
+
+SVGAnimatedLength SVGRadialGradientElement::cy() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->cy());
+}
+
+SVGAnimatedLength SVGRadialGradientElement::r() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->r());
+}
+
+SVGAnimatedLength SVGRadialGradientElement::fx() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->fx());
+}
+
+SVGAnimatedLength SVGRadialGradientElement::fy() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->fy());
+}
diff --git a/ksvg/dom/SVGRadialGradientElement.h b/ksvg/dom/SVGRadialGradientElement.h
index c60a00ed..3595c7f4 100644
--- a/ksvg/dom/SVGRadialGradientElement.h
+++ b/ksvg/dom/SVGRadialGradientElement.h
@@ -53,5 +53,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRect.cc b/ksvg/dom/SVGRect.cc
deleted file mode 100644
index 39ba48a4..00000000
--- a/ksvg/dom/SVGRect.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGRect.h"
-#include "SVGRectImpl.h"
-
-using namespace KSVG;
-
-SVGRect::SVGRect()
-{
- impl = new SVGRectImpl();
- impl->ref();
-}
-
-SVGRect::SVGRect(const SVGRect &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGRect &SVGRect::operator=(const SVGRect &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGRect::SVGRect(SVGRectImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGRect::~SVGRect()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGRect::setX(float x)
-{
- if(impl)
- impl->setX(x);
-}
-
-float SVGRect::x() const
-{
- if(!impl) return -1;
- return impl->x();
-}
-
-void SVGRect::setY(float y)
-{
- if(impl)
- impl->setY(y);
-}
-
-float SVGRect::y() const
-{
- if(!impl) return -1;
- return impl->y();
-}
-
-void SVGRect::setWidth(float width)
-{
- if(impl)
- impl->setWidth(width);
-}
-
-float SVGRect::width() const
-{
- if(!impl) return -1;
- return impl->width();
-}
-
-void SVGRect::setHeight(float height)
-{
- if(impl)
- impl->setHeight(height);
-}
-
-float SVGRect::height() const
-{
- if(!impl) return -1;
- return impl->height();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRect.cpp b/ksvg/dom/SVGRect.cpp
new file mode 100644
index 00000000..35a4d550
--- /dev/null
+++ b/ksvg/dom/SVGRect.cpp
@@ -0,0 +1,112 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGRect.h"
+#include "SVGRectImpl.h"
+
+using namespace KSVG;
+
+SVGRect::SVGRect()
+{
+ impl = new SVGRectImpl();
+ impl->ref();
+}
+
+SVGRect::SVGRect(const SVGRect &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGRect &SVGRect::operator=(const SVGRect &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGRect::SVGRect(SVGRectImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGRect::~SVGRect()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGRect::setX(float x)
+{
+ if(impl)
+ impl->setX(x);
+}
+
+float SVGRect::x() const
+{
+ if(!impl) return -1;
+ return impl->x();
+}
+
+void SVGRect::setY(float y)
+{
+ if(impl)
+ impl->setY(y);
+}
+
+float SVGRect::y() const
+{
+ if(!impl) return -1;
+ return impl->y();
+}
+
+void SVGRect::setWidth(float width)
+{
+ if(impl)
+ impl->setWidth(width);
+}
+
+float SVGRect::width() const
+{
+ if(!impl) return -1;
+ return impl->width();
+}
+
+void SVGRect::setHeight(float height)
+{
+ if(impl)
+ impl->setHeight(height);
+}
+
+float SVGRect::height() const
+{
+ if(!impl) return -1;
+ return impl->height();
+}
diff --git a/ksvg/dom/SVGRect.h b/ksvg/dom/SVGRect.h
index e9be6849..fda33275 100644
--- a/ksvg/dom/SVGRect.h
+++ b/ksvg/dom/SVGRect.h
@@ -83,5 +83,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRectElement.cc b/ksvg/dom/SVGRectElement.cc
deleted file mode 100644
index ef4038d4..00000000
--- a/ksvg/dom/SVGRectElement.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGRectElement.h"
-#include "SVGRectElementImpl.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGRectElement::SVGRectElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGRectElement::SVGRectElement(const SVGRectElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGRectElement &SVGRectElement::operator=(const SVGRectElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGRectElement::SVGRectElement(SVGRectElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGRectElement::~SVGRectElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGRectElement::x()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGRectElement::y()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGRectElement::width()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGRectElement::height()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-SVGAnimatedLength SVGRectElement::rx()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->rx());
-}
-
-SVGAnimatedLength SVGRectElement::ry()
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->ry());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRectElement.cpp b/ksvg/dom/SVGRectElement.cpp
new file mode 100644
index 00000000..51af0272
--- /dev/null
+++ b/ksvg/dom/SVGRectElement.cpp
@@ -0,0 +1,107 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGRectElement.h"
+#include "SVGRectElementImpl.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGRectElement::SVGRectElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGRectElement::SVGRectElement(const SVGRectElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGRectElement &SVGRectElement::operator=(const SVGRectElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGRectElement::SVGRectElement(SVGRectElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGRectElement::~SVGRectElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGRectElement::x()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGRectElement::y()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGRectElement::width()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGRectElement::height()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
+
+SVGAnimatedLength SVGRectElement::rx()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->rx());
+}
+
+SVGAnimatedLength SVGRectElement::ry()
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->ry());
+}
diff --git a/ksvg/dom/SVGRectElement.h b/ksvg/dom/SVGRectElement.h
index 0e3a01ed..92d2861d 100644
--- a/ksvg/dom/SVGRectElement.h
+++ b/ksvg/dom/SVGRectElement.h
@@ -169,5 +169,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGRenderingIntent.h b/ksvg/dom/SVGRenderingIntent.h
index 5293f92b..7701b6a5 100644
--- a/ksvg/dom/SVGRenderingIntent.h
+++ b/ksvg/dom/SVGRenderingIntent.h
@@ -37,5 +37,3 @@ enum
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSVGElement.cc b/ksvg/dom/SVGSVGElement.cc
deleted file mode 100644
index 204de90c..00000000
--- a/ksvg/dom/SVGSVGElement.cc
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGRect.h"
-#include "SVGSVGElement.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedLength.h"
-#include "SVGPoint.h"
-#include "SVGNumber.h"
-#include "SVGAngle.h"
-#include "SVGMatrix.h"
-#include "SVGLength.h"
-#include "SVGRect.h"
-#include "SVGTransform.h"
-#include "SVGViewSpec.h"
-#include <kdebug.h>
-
-using namespace KSVG;
-
-SVGSVGElement::SVGSVGElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGLocatable(), SVGFitToViewBox(), SVGZoomAndPan()
-{
- impl = 0;
-}
-
-SVGSVGElement::SVGSVGElement(const SVGSVGElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGLocatable(other), SVGFitToViewBox(other), SVGZoomAndPan(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGSVGElement &SVGSVGElement::operator=(const SVGSVGElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGLocatable::operator=(other);
- SVGFitToViewBox::operator=(other);
- SVGZoomAndPan::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGSVGElement::SVGSVGElement(SVGSVGElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGLocatable(other), SVGFitToViewBox(other), SVGZoomAndPan(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGSVGElement::~SVGSVGElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGSVGElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->x());
-}
-
-SVGAnimatedLength SVGSVGElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->y());
-}
-
-SVGAnimatedLength SVGSVGElement::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->width());
-}
-
-SVGAnimatedLength SVGSVGElement::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->height());
-}
-
-void SVGSVGElement::setContentScriptType(const DOM::DOMString &contentScriptType)
-{
- if(impl)
- setContentScriptType(contentScriptType);
-}
-
-DOM::DOMString SVGSVGElement::contentScriptType() const
-{
- if(!impl) return DOM::DOMString();
- return impl->contentScriptType();
-}
-
-void SVGSVGElement::setContentStyleType(const DOM::DOMString &contentStyleType)
-{
- if(impl)
- setContentStyleType(contentStyleType);
-}
-
-DOM::DOMString SVGSVGElement::contentStyleType() const
-{
- if(!impl) return DOM::DOMString();
- return impl->contentStyleType();
-}
-
-SVGRect SVGSVGElement::viewport() const
-{
- if(!impl) return SVGRect(0);
- return SVGRect(impl->viewport());
-}
-
-float SVGSVGElement::pixelUnitToMillimeterX() const
-{
- if(!impl) return -1;
- return impl->pixelUnitToMillimeterX();
-}
-
-float SVGSVGElement::pixelUnitToMillimeterY() const
-{
- if(!impl) return -1;
- return impl->pixelUnitToMillimeterY();
-}
-
-float SVGSVGElement::screenPixelToMillimeterX() const
-{
- if(!impl) return -1;
- return impl->screenPixelToMillimeterX();
-}
-
-float SVGSVGElement::screenPixelToMillimeterY() const
-{
- if(!impl) return -1;
- return impl->screenPixelToMillimeterY();
-}
-
-void SVGSVGElement::setUseCurrentView(bool useCurrentView)
-{
- if(impl)
- impl->setUseCurrentView(useCurrentView);
-}
-
-bool SVGSVGElement::useCurrentView() const
-{
- if(!impl) return false;
- return impl->useCurrentView();
-}
-
-SVGViewSpec SVGSVGElement::currentView() const
-{
- if(!impl) return SVGViewSpec(0);
- return impl->currentView();
-}
-
-void SVGSVGElement::setCurrentScale(float currentScale)
-{
- if(impl)
- impl->setCurrentScale(currentScale);
-}
-
-float SVGSVGElement::currentScale() const
-{
- if(!impl) return -1;
- return impl->currentScale();
-}
-
-SVGPoint SVGSVGElement::currentTranslate() const
-{
- if(!impl) return SVGPoint(0);
- return SVGSafeCreator<SVGPoint, SVGPointImpl>::create(impl->currentTranslate());
-}
-
-unsigned long SVGSVGElement::suspendRedraw(unsigned long time)
-{
- if(!impl) return 0;
- return impl->suspendRedraw(time);
-}
-
-void SVGSVGElement::unsuspendRedraw(unsigned long id)
-{
- if(impl)
- impl->unsuspendRedraw(id);
-}
-
-void SVGSVGElement::unsuspendRedrawAll()
-{
- if(impl)
- impl->unsuspendRedrawAll();
-}
-
-void SVGSVGElement::forceRedraw()
-{
- if(impl)
- impl->forceRedraw();
-}
-
-void SVGSVGElement::pauseAnimations()
-{
- if(impl)
- impl->pauseAnimations();
-}
-
-void SVGSVGElement::unpauseAnimations()
-{
- if(impl)
- impl->unpauseAnimations();
-}
-
-bool SVGSVGElement::animationsPaused()
-{
- if(!impl) return false;
- return impl->animationsPaused();
-}
-
-float SVGSVGElement::getCurrentTime()
-{
- if(!impl) return -1;
- return impl->getCurrentTime();
-}
-
-void SVGSVGElement::setCurrentTime(float time)
-{
- if(impl)
- impl->setCurrentTime(time);
-}
-
-DOM::NodeList SVGSVGElement::getIntersectionList(const SVGRect &rect,const SVGElement &referenceElement)
-{
- if(!impl) return DOM::NodeList();
- return impl->getIntersectionList(rect.handle(), referenceElement.handle());
-}
-
-DOM::NodeList SVGSVGElement::getEnclosureList(const SVGRect &rect,const SVGElement &referenceElement)
-{
- if(!impl) return DOM::NodeList();
- return impl->getEnclosureList(rect.handle(), referenceElement.handle());
-}
-
-bool SVGSVGElement::checkIntersection(const SVGElement &element,const SVGRect &rect)
-{
- if(!impl) return false;
- return impl->checkIntersection(element.handle(), rect.handle());
-}
-
-bool SVGSVGElement::checkEnclosure(const SVGElement &element,const SVGRect &rect)
-{
- if(!impl) return false;
- return impl->checkEnclosure(element.handle(), rect.handle());
-}
-
-void SVGSVGElement::deSelectAll()
-{
- if(impl)
- impl->deSelectAll();
-}
-
-SVGNumber SVGSVGElement::createSVGNumber()
-{
- if(!impl) return SVGNumber(0);
- return SVGSafeCreator<SVGNumber, SVGNumberImpl>::create(impl->createSVGNumber());
-}
-
-SVGLength SVGSVGElement::createSVGLength()
-{
- if(!impl) return SVGLength(0);
- return SVGSafeCreator<SVGLength, SVGLengthImpl>::create(impl->createSVGLength());
-}
-
-SVGAngle SVGSVGElement::createSVGAngle()
-{
- if(!impl) return SVGAngle(0);
- return SVGSafeCreator<SVGAngle, SVGAngleImpl>::create(impl->createSVGAngle());
-}
-
-SVGPoint SVGSVGElement::createSVGPoint()
-{
- if(!impl) return SVGPoint(0);
- return SVGSafeCreator<SVGPoint, SVGPointImpl>::create(impl->createSVGPoint());
-}
-
-SVGMatrix SVGSVGElement::createSVGMatrix()
-{
- if(!impl) return SVGMatrix(0);
- return SVGSafeCreator<SVGMatrix, SVGMatrixImpl>::create(impl->createSVGMatrix());
-}
-
-SVGRect SVGSVGElement::createSVGRect()
-{
- if(!impl) return SVGRect(0);
- return SVGSafeCreator<SVGRect, SVGRectImpl>::create(impl->createSVGRect());
-}
-
-SVGTransform SVGSVGElement::createSVGTransform()
-{
- if(!impl) return SVGTransform(0);
- return SVGSafeCreator<SVGTransform, SVGTransformImpl>::create(impl->createSVGTransform());
-}
-
-SVGTransform SVGSVGElement::createSVGTransformFromMatrix(const SVGMatrix &matrix)
-{
- if(!impl) return SVGTransform(0);
- return SVGSafeCreator<SVGTransform, SVGTransformImpl>::create(impl->createSVGTransformFromMatrix(matrix.handle()));
-}
-
-SVGElement SVGSVGElement::getElementById(const DOM::DOMString &elementId)
-{
- if(!impl) return SVGElement(0);
- return SVGSafeCreator<SVGElement, SVGElementImpl>::create(impl->getElementById(elementId));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSVGElement.cpp b/ksvg/dom/SVGSVGElement.cpp
new file mode 100644
index 00000000..5f19c508
--- /dev/null
+++ b/ksvg/dom/SVGSVGElement.cpp
@@ -0,0 +1,335 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGRect.h"
+#include "SVGSVGElement.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedLength.h"
+#include "SVGPoint.h"
+#include "SVGNumber.h"
+#include "SVGAngle.h"
+#include "SVGMatrix.h"
+#include "SVGLength.h"
+#include "SVGRect.h"
+#include "SVGTransform.h"
+#include "SVGViewSpec.h"
+#include <kdebug.h>
+
+using namespace KSVG;
+
+SVGSVGElement::SVGSVGElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGLocatable(), SVGFitToViewBox(), SVGZoomAndPan()
+{
+ impl = 0;
+}
+
+SVGSVGElement::SVGSVGElement(const SVGSVGElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGLocatable(other), SVGFitToViewBox(other), SVGZoomAndPan(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGSVGElement &SVGSVGElement::operator=(const SVGSVGElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGLocatable::operator=(other);
+ SVGFitToViewBox::operator=(other);
+ SVGZoomAndPan::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGSVGElement::SVGSVGElement(SVGSVGElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGLocatable(other), SVGFitToViewBox(other), SVGZoomAndPan(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGSVGElement::~SVGSVGElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGSVGElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->x());
+}
+
+SVGAnimatedLength SVGSVGElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->y());
+}
+
+SVGAnimatedLength SVGSVGElement::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->width());
+}
+
+SVGAnimatedLength SVGSVGElement::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGSafeCreator<SVGAnimatedLength, SVGAnimatedLengthImpl>::create(impl->height());
+}
+
+void SVGSVGElement::setContentScriptType(const DOM::DOMString &contentScriptType)
+{
+ if(impl)
+ setContentScriptType(contentScriptType);
+}
+
+DOM::DOMString SVGSVGElement::contentScriptType() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->contentScriptType();
+}
+
+void SVGSVGElement::setContentStyleType(const DOM::DOMString &contentStyleType)
+{
+ if(impl)
+ setContentStyleType(contentStyleType);
+}
+
+DOM::DOMString SVGSVGElement::contentStyleType() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->contentStyleType();
+}
+
+SVGRect SVGSVGElement::viewport() const
+{
+ if(!impl) return SVGRect(0);
+ return SVGRect(impl->viewport());
+}
+
+float SVGSVGElement::pixelUnitToMillimeterX() const
+{
+ if(!impl) return -1;
+ return impl->pixelUnitToMillimeterX();
+}
+
+float SVGSVGElement::pixelUnitToMillimeterY() const
+{
+ if(!impl) return -1;
+ return impl->pixelUnitToMillimeterY();
+}
+
+float SVGSVGElement::screenPixelToMillimeterX() const
+{
+ if(!impl) return -1;
+ return impl->screenPixelToMillimeterX();
+}
+
+float SVGSVGElement::screenPixelToMillimeterY() const
+{
+ if(!impl) return -1;
+ return impl->screenPixelToMillimeterY();
+}
+
+void SVGSVGElement::setUseCurrentView(bool useCurrentView)
+{
+ if(impl)
+ impl->setUseCurrentView(useCurrentView);
+}
+
+bool SVGSVGElement::useCurrentView() const
+{
+ if(!impl) return false;
+ return impl->useCurrentView();
+}
+
+SVGViewSpec SVGSVGElement::currentView() const
+{
+ if(!impl) return SVGViewSpec(0);
+ return impl->currentView();
+}
+
+void SVGSVGElement::setCurrentScale(float currentScale)
+{
+ if(impl)
+ impl->setCurrentScale(currentScale);
+}
+
+float SVGSVGElement::currentScale() const
+{
+ if(!impl) return -1;
+ return impl->currentScale();
+}
+
+SVGPoint SVGSVGElement::currentTranslate() const
+{
+ if(!impl) return SVGPoint(0);
+ return SVGSafeCreator<SVGPoint, SVGPointImpl>::create(impl->currentTranslate());
+}
+
+unsigned long SVGSVGElement::suspendRedraw(unsigned long time)
+{
+ if(!impl) return 0;
+ return impl->suspendRedraw(time);
+}
+
+void SVGSVGElement::unsuspendRedraw(unsigned long id)
+{
+ if(impl)
+ impl->unsuspendRedraw(id);
+}
+
+void SVGSVGElement::unsuspendRedrawAll()
+{
+ if(impl)
+ impl->unsuspendRedrawAll();
+}
+
+void SVGSVGElement::forceRedraw()
+{
+ if(impl)
+ impl->forceRedraw();
+}
+
+void SVGSVGElement::pauseAnimations()
+{
+ if(impl)
+ impl->pauseAnimations();
+}
+
+void SVGSVGElement::unpauseAnimations()
+{
+ if(impl)
+ impl->unpauseAnimations();
+}
+
+bool SVGSVGElement::animationsPaused()
+{
+ if(!impl) return false;
+ return impl->animationsPaused();
+}
+
+float SVGSVGElement::getCurrentTime()
+{
+ if(!impl) return -1;
+ return impl->getCurrentTime();
+}
+
+void SVGSVGElement::setCurrentTime(float time)
+{
+ if(impl)
+ impl->setCurrentTime(time);
+}
+
+DOM::NodeList SVGSVGElement::getIntersectionList(const SVGRect &rect,const SVGElement &referenceElement)
+{
+ if(!impl) return DOM::NodeList();
+ return impl->getIntersectionList(rect.handle(), referenceElement.handle());
+}
+
+DOM::NodeList SVGSVGElement::getEnclosureList(const SVGRect &rect,const SVGElement &referenceElement)
+{
+ if(!impl) return DOM::NodeList();
+ return impl->getEnclosureList(rect.handle(), referenceElement.handle());
+}
+
+bool SVGSVGElement::checkIntersection(const SVGElement &element,const SVGRect &rect)
+{
+ if(!impl) return false;
+ return impl->checkIntersection(element.handle(), rect.handle());
+}
+
+bool SVGSVGElement::checkEnclosure(const SVGElement &element,const SVGRect &rect)
+{
+ if(!impl) return false;
+ return impl->checkEnclosure(element.handle(), rect.handle());
+}
+
+void SVGSVGElement::deSelectAll()
+{
+ if(impl)
+ impl->deSelectAll();
+}
+
+SVGNumber SVGSVGElement::createSVGNumber()
+{
+ if(!impl) return SVGNumber(0);
+ return SVGSafeCreator<SVGNumber, SVGNumberImpl>::create(impl->createSVGNumber());
+}
+
+SVGLength SVGSVGElement::createSVGLength()
+{
+ if(!impl) return SVGLength(0);
+ return SVGSafeCreator<SVGLength, SVGLengthImpl>::create(impl->createSVGLength());
+}
+
+SVGAngle SVGSVGElement::createSVGAngle()
+{
+ if(!impl) return SVGAngle(0);
+ return SVGSafeCreator<SVGAngle, SVGAngleImpl>::create(impl->createSVGAngle());
+}
+
+SVGPoint SVGSVGElement::createSVGPoint()
+{
+ if(!impl) return SVGPoint(0);
+ return SVGSafeCreator<SVGPoint, SVGPointImpl>::create(impl->createSVGPoint());
+}
+
+SVGMatrix SVGSVGElement::createSVGMatrix()
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGSafeCreator<SVGMatrix, SVGMatrixImpl>::create(impl->createSVGMatrix());
+}
+
+SVGRect SVGSVGElement::createSVGRect()
+{
+ if(!impl) return SVGRect(0);
+ return SVGSafeCreator<SVGRect, SVGRectImpl>::create(impl->createSVGRect());
+}
+
+SVGTransform SVGSVGElement::createSVGTransform()
+{
+ if(!impl) return SVGTransform(0);
+ return SVGSafeCreator<SVGTransform, SVGTransformImpl>::create(impl->createSVGTransform());
+}
+
+SVGTransform SVGSVGElement::createSVGTransformFromMatrix(const SVGMatrix &matrix)
+{
+ if(!impl) return SVGTransform(0);
+ return SVGSafeCreator<SVGTransform, SVGTransformImpl>::create(impl->createSVGTransformFromMatrix(matrix.handle()));
+}
+
+SVGElement SVGSVGElement::getElementById(const DOM::DOMString &elementId)
+{
+ if(!impl) return SVGElement(0);
+ return SVGSafeCreator<SVGElement, SVGElementImpl>::create(impl->getElementById(elementId));
+}
diff --git a/ksvg/dom/SVGSVGElement.h b/ksvg/dom/SVGSVGElement.h
index 59621e2e..2b80de2e 100644
--- a/ksvg/dom/SVGSVGElement.h
+++ b/ksvg/dom/SVGSVGElement.h
@@ -577,5 +577,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGScriptElement.cc b/ksvg/dom/SVGScriptElement.cc
deleted file mode 100644
index f599a273..00000000
--- a/ksvg/dom/SVGScriptElement.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGScriptElement.h"
-#include "SVGScriptElementImpl.h"
-
-using namespace KSVG;
-
-SVGScriptElement::SVGScriptElement() : SVGElement(), SVGURIReference(), SVGExternalResourcesRequired()
-{
- impl = 0;
-}
-
-SVGScriptElement::SVGScriptElement(const SVGScriptElement &other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGScriptElement &SVGScriptElement::operator =(const SVGScriptElement &other)
-{
- SVGElement::operator=(other);
- SVGURIReference::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGScriptElement::SVGScriptElement(SVGScriptElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGScriptElement::~SVGScriptElement()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGScriptElement::setType(const DOM::DOMString &type)
-{
- if(impl)
- impl->setType(type);
-}
-
-DOM::DOMString SVGScriptElement::type() const
-{
- if(!impl) return DOM::DOMString();
- return impl->type();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGScriptElement.cpp b/ksvg/dom/SVGScriptElement.cpp
new file mode 100644
index 00000000..48974905
--- /dev/null
+++ b/ksvg/dom/SVGScriptElement.cpp
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGScriptElement.h"
+#include "SVGScriptElementImpl.h"
+
+using namespace KSVG;
+
+SVGScriptElement::SVGScriptElement() : SVGElement(), SVGURIReference(), SVGExternalResourcesRequired()
+{
+ impl = 0;
+}
+
+SVGScriptElement::SVGScriptElement(const SVGScriptElement &other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGScriptElement &SVGScriptElement::operator =(const SVGScriptElement &other)
+{
+ SVGElement::operator=(other);
+ SVGURIReference::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGScriptElement::SVGScriptElement(SVGScriptElementImpl *other) : SVGElement(other), SVGURIReference(other), SVGExternalResourcesRequired(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGScriptElement::~SVGScriptElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGScriptElement::setType(const DOM::DOMString &type)
+{
+ if(impl)
+ impl->setType(type);
+}
+
+DOM::DOMString SVGScriptElement::type() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->type();
+}
diff --git a/ksvg/dom/SVGScriptElement.h b/ksvg/dom/SVGScriptElement.h
index aae1d79b..f4a99bce 100644
--- a/ksvg/dom/SVGScriptElement.h
+++ b/ksvg/dom/SVGScriptElement.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSetElement.cc b/ksvg/dom/SVGSetElement.cc
deleted file mode 100644
index 7a47c993..00000000
--- a/ksvg/dom/SVGSetElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGSetElement.h"
-#include "SVGSetElementImpl.h"
-
-using namespace KSVG;
-
-SVGSetElement::SVGSetElement() : SVGAnimationElement()
-{
- impl = 0;
-}
-
-SVGSetElement::SVGSetElement(const SVGSetElement &other) : SVGAnimationElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGSetElement &SVGSetElement::operator =(const SVGSetElement &other)
-{
- SVGAnimationElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGSetElement::SVGSetElement(SVGSetElementImpl *other) : SVGAnimationElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGSetElement::~SVGSetElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSetElement.cpp b/ksvg/dom/SVGSetElement.cpp
new file mode 100644
index 00000000..9dff9064
--- /dev/null
+++ b/ksvg/dom/SVGSetElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGSetElement.h"
+#include "SVGSetElementImpl.h"
+
+using namespace KSVG;
+
+SVGSetElement::SVGSetElement() : SVGAnimationElement()
+{
+ impl = 0;
+}
+
+SVGSetElement::SVGSetElement(const SVGSetElement &other) : SVGAnimationElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGSetElement &SVGSetElement::operator =(const SVGSetElement &other)
+{
+ SVGAnimationElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGSetElement::SVGSetElement(SVGSetElementImpl *other) : SVGAnimationElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGSetElement::~SVGSetElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGSetElement.h b/ksvg/dom/SVGSetElement.h
index f65a8704..e141f1fc 100644
--- a/ksvg/dom/SVGSetElement.h
+++ b/ksvg/dom/SVGSetElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStopElement.cc b/ksvg/dom/SVGStopElement.cc
deleted file mode 100644
index a9db9a56..00000000
--- a/ksvg/dom/SVGStopElement.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGStopElement.h"
-#include "SVGStopElementImpl.h"
-#include "SVGAnimatedNumber.h"
-
-using namespace KSVG;
-
-SVGStopElement::SVGStopElement() : SVGElement(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGStopElement::SVGStopElement(const SVGStopElement &other) : SVGElement(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGStopElement &SVGStopElement::operator =(const SVGStopElement &other)
-{
- SVGElement::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGStopElement::SVGStopElement(SVGStopElementImpl *other) : SVGElement(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGStopElement::~SVGStopElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedNumber SVGStopElement::offset() const
-{
- if(!impl) return SVGAnimatedNumber(0);
- return SVGAnimatedNumber(impl->offset());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStopElement.cpp b/ksvg/dom/SVGStopElement.cpp
new file mode 100644
index 00000000..1288a49e
--- /dev/null
+++ b/ksvg/dom/SVGStopElement.cpp
@@ -0,0 +1,73 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGStopElement.h"
+#include "SVGStopElementImpl.h"
+#include "SVGAnimatedNumber.h"
+
+using namespace KSVG;
+
+SVGStopElement::SVGStopElement() : SVGElement(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGStopElement::SVGStopElement(const SVGStopElement &other) : SVGElement(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGStopElement &SVGStopElement::operator =(const SVGStopElement &other)
+{
+ SVGElement::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGStopElement::SVGStopElement(SVGStopElementImpl *other) : SVGElement(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGStopElement::~SVGStopElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedNumber SVGStopElement::offset() const
+{
+ if(!impl) return SVGAnimatedNumber(0);
+ return SVGAnimatedNumber(impl->offset());
+}
diff --git a/ksvg/dom/SVGStopElement.h b/ksvg/dom/SVGStopElement.h
index 3002e0cf..be3bdd7e 100644
--- a/ksvg/dom/SVGStopElement.h
+++ b/ksvg/dom/SVGStopElement.h
@@ -77,5 +77,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStringList.cc b/ksvg/dom/SVGStringList.cc
deleted file mode 100644
index c7700e06..00000000
--- a/ksvg/dom/SVGStringList.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <dom/dom_string.h>
-#include "SVGStringList.h"
-#include "SVGStringListImpl.h"
-
-using namespace KSVG;
-
-SVGStringList::SVGStringList()
-{
- impl = new SVGStringListImpl();
- impl->ref();
-}
-
-SVGStringList::SVGStringList(const SVGStringList &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGStringList &SVGStringList::operator=(const SVGStringList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGStringList::SVGStringList(SVGStringListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGStringList::~SVGStringList()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned long SVGStringList::numberOfItems() const
-{
- if(!impl) return 0;
- return impl->numberOfItems();
-}
-
-void SVGStringList::clear()
-{
- if(impl)
- impl->clear();
-}
-
-DOM::DOMString *SVGStringList::initialize(DOM::DOMString *newItem)
-{
- if(!impl) return new DOM::DOMString();
- return impl->initialize(new SharedString(newItem));
-}
-
-DOM::DOMString *SVGStringList::getItem(unsigned long index)
-{
- if(!impl) return new DOM::DOMString();
- return impl->getItem(index);
-}
-
-DOM::DOMString *SVGStringList::insertItemBefore(DOM::DOMString *newItem, unsigned long index)
-{
- if(!impl) return new DOM::DOMString();
- return impl->insertItemBefore(new SharedString(newItem), index);
-}
-
-DOM::DOMString *SVGStringList::replaceItem(DOM::DOMString *newItem, unsigned long index)
-{
- if(!impl) return new DOM::DOMString();
- return impl->replaceItem(new SharedString(newItem), index);
-}
-
-DOM::DOMString *SVGStringList::removeItem(unsigned long index)
-{
- if(!impl) return new DOM::DOMString();
- return impl->removeItem(index);
-}
-
-DOM::DOMString *SVGStringList::appendItem(DOM::DOMString *newItem)
-{
- if(!impl) return new DOM::DOMString();
- return impl->appendItem(new SharedString(newItem));
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStringList.cpp b/ksvg/dom/SVGStringList.cpp
new file mode 100644
index 00000000..de9527f3
--- /dev/null
+++ b/ksvg/dom/SVGStringList.cpp
@@ -0,0 +1,113 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <dom/dom_string.h>
+#include "SVGStringList.h"
+#include "SVGStringListImpl.h"
+
+using namespace KSVG;
+
+SVGStringList::SVGStringList()
+{
+ impl = new SVGStringListImpl();
+ impl->ref();
+}
+
+SVGStringList::SVGStringList(const SVGStringList &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGStringList &SVGStringList::operator=(const SVGStringList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGStringList::SVGStringList(SVGStringListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGStringList::~SVGStringList()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned long SVGStringList::numberOfItems() const
+{
+ if(!impl) return 0;
+ return impl->numberOfItems();
+}
+
+void SVGStringList::clear()
+{
+ if(impl)
+ impl->clear();
+}
+
+DOM::DOMString *SVGStringList::initialize(DOM::DOMString *newItem)
+{
+ if(!impl) return new DOM::DOMString();
+ return impl->initialize(new SharedString(newItem));
+}
+
+DOM::DOMString *SVGStringList::getItem(unsigned long index)
+{
+ if(!impl) return new DOM::DOMString();
+ return impl->getItem(index);
+}
+
+DOM::DOMString *SVGStringList::insertItemBefore(DOM::DOMString *newItem, unsigned long index)
+{
+ if(!impl) return new DOM::DOMString();
+ return impl->insertItemBefore(new SharedString(newItem), index);
+}
+
+DOM::DOMString *SVGStringList::replaceItem(DOM::DOMString *newItem, unsigned long index)
+{
+ if(!impl) return new DOM::DOMString();
+ return impl->replaceItem(new SharedString(newItem), index);
+}
+
+DOM::DOMString *SVGStringList::removeItem(unsigned long index)
+{
+ if(!impl) return new DOM::DOMString();
+ return impl->removeItem(index);
+}
+
+DOM::DOMString *SVGStringList::appendItem(DOM::DOMString *newItem)
+{
+ if(!impl) return new DOM::DOMString();
+ return impl->appendItem(new SharedString(newItem));
+}
diff --git a/ksvg/dom/SVGStringList.h b/ksvg/dom/SVGStringList.h
index 477273a6..82df1b0b 100644
--- a/ksvg/dom/SVGStringList.h
+++ b/ksvg/dom/SVGStringList.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStylable.cc b/ksvg/dom/SVGStylable.cc
deleted file mode 100644
index 14136d7d..00000000
--- a/ksvg/dom/SVGStylable.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGStylable.h"
-#include "SVGStylableImpl.h"
-#include <kdebug.h>
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGStylable::SVGStylable()
-{
- impl = 0;
-}
-
-SVGStylable::SVGStylable(const SVGStylable &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGStylable &SVGStylable::operator=(const SVGStylable &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGStylable::SVGStylable(SVGStylableImpl *other)
-{
- impl = other;
-}
-
-SVGStylable::~SVGStylable()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-/*
-SVGAnimatedString SVGStylable::className() const
-{
- return impl->className();
-}
-
-css::CSSStyleDeclaration SVGStylable::style() const
-{
- return impl->style();
-}
-
-css::CSSValue SVGStylable::getPresentationAttribute(const DOMString &name)
-{
- return impl->getPresentationAttribute(name);
-}
-*/
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStylable.cpp b/ksvg/dom/SVGStylable.cpp
new file mode 100644
index 00000000..9092c981
--- /dev/null
+++ b/ksvg/dom/SVGStylable.cpp
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGStylable.h"
+#include "SVGStylableImpl.h"
+#include <kdebug.h>
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGStylable::SVGStylable()
+{
+ impl = 0;
+}
+
+SVGStylable::SVGStylable(const SVGStylable &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGStylable &SVGStylable::operator=(const SVGStylable &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGStylable::SVGStylable(SVGStylableImpl *other)
+{
+ impl = other;
+}
+
+SVGStylable::~SVGStylable()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+/*
+SVGAnimatedString SVGStylable::className() const
+{
+ return impl->className();
+}
+
+css::CSSStyleDeclaration SVGStylable::style() const
+{
+ return impl->style();
+}
+
+css::CSSValue SVGStylable::getPresentationAttribute(const DOMString &name)
+{
+ return impl->getPresentationAttribute(name);
+}
+*/
diff --git a/ksvg/dom/SVGStylable.h b/ksvg/dom/SVGStylable.h
index 2fb3cf11..e6d32c14 100644
--- a/ksvg/dom/SVGStylable.h
+++ b/ksvg/dom/SVGStylable.h
@@ -51,6 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
-
diff --git a/ksvg/dom/SVGStyleElement.cc b/ksvg/dom/SVGStyleElement.cc
deleted file mode 100644
index 8cf02024..00000000
--- a/ksvg/dom/SVGStyleElement.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGStyleElement.h"
-#include "SVGStyleElementImpl.h"
-
-using namespace KSVG;
-
-SVGStyleElement::SVGStyleElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGStyleElement::SVGStyleElement(const SVGStyleElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGStyleElement &SVGStyleElement::operator =(const SVGStyleElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGStyleElement::SVGStyleElement(SVGStyleElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGStyleElement::~SVGStyleElement()
-{
- if(impl)
- impl->deref();
-}
-
-void SVGStyleElement::setXmlspace(const DOM::DOMString &xmlspace)
-{
- if(impl)
- impl->setXmlspace(xmlspace);
-}
-
-DOM::DOMString SVGStyleElement::xmlspace() const
-{
- if(!impl) return DOM::DOMString();
- return impl->xmlspace();
-}
-
-void SVGStyleElement::setType(const DOM::DOMString &type)
-{
- if(impl)
- impl->setType(type);
-}
-
-DOM::DOMString SVGStyleElement::type() const
-{
- if(!impl) return DOM::DOMString();
- return impl->type();
-}
-
-void SVGStyleElement::setMedia(const DOM::DOMString &media)
-{
- if(impl)
- impl->setMedia(media);
-}
-
-DOM::DOMString SVGStyleElement::media() const
-{
- if(!impl) return DOM::DOMString();
- return impl->media();
-}
-
-void SVGStyleElement::setTitle(const DOM::DOMString &title)
-{
- if(impl)
- impl->setTitle(title);
-}
-
-DOM::DOMString SVGStyleElement::title() const
-{
- if(!impl) return DOM::DOMString();
- return impl->title();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGStyleElement.cpp b/ksvg/dom/SVGStyleElement.cpp
new file mode 100644
index 00000000..7e734336
--- /dev/null
+++ b/ksvg/dom/SVGStyleElement.cpp
@@ -0,0 +1,113 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGStyleElement.h"
+#include "SVGStyleElementImpl.h"
+
+using namespace KSVG;
+
+SVGStyleElement::SVGStyleElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGStyleElement::SVGStyleElement(const SVGStyleElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGStyleElement &SVGStyleElement::operator =(const SVGStyleElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGStyleElement::SVGStyleElement(SVGStyleElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGStyleElement::~SVGStyleElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+void SVGStyleElement::setXmlspace(const DOM::DOMString &xmlspace)
+{
+ if(impl)
+ impl->setXmlspace(xmlspace);
+}
+
+DOM::DOMString SVGStyleElement::xmlspace() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->xmlspace();
+}
+
+void SVGStyleElement::setType(const DOM::DOMString &type)
+{
+ if(impl)
+ impl->setType(type);
+}
+
+DOM::DOMString SVGStyleElement::type() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->type();
+}
+
+void SVGStyleElement::setMedia(const DOM::DOMString &media)
+{
+ if(impl)
+ impl->setMedia(media);
+}
+
+DOM::DOMString SVGStyleElement::media() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->media();
+}
+
+void SVGStyleElement::setTitle(const DOM::DOMString &title)
+{
+ if(impl)
+ impl->setTitle(title);
+}
+
+DOM::DOMString SVGStyleElement::title() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->title();
+}
diff --git a/ksvg/dom/SVGStyleElement.h b/ksvg/dom/SVGStyleElement.h
index 2a1c63b8..b9eb1ec9 100644
--- a/ksvg/dom/SVGStyleElement.h
+++ b/ksvg/dom/SVGStyleElement.h
@@ -59,5 +59,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSwitchElement.cc b/ksvg/dom/SVGSwitchElement.cc
deleted file mode 100644
index 2c4a8701..00000000
--- a/ksvg/dom/SVGSwitchElement.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGSwitchElement.h"
-#include "SVGSwitchElementImpl.h"
-
-using namespace KSVG;
-
-SVGSwitchElement::SVGSwitchElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
-{
- impl = 0;
-}
-
-SVGSwitchElement::SVGSwitchElement(const SVGSwitchElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGSwitchElement &SVGSwitchElement::operator =(const SVGSwitchElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGSwitchElement::SVGSwitchElement(SVGSwitchElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGSwitchElement::~SVGSwitchElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSwitchElement.cpp b/ksvg/dom/SVGSwitchElement.cpp
new file mode 100644
index 00000000..ecaa2a1c
--- /dev/null
+++ b/ksvg/dom/SVGSwitchElement.cpp
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGSwitchElement.h"
+#include "SVGSwitchElementImpl.h"
+
+using namespace KSVG;
+
+SVGSwitchElement::SVGSwitchElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable()
+{
+ impl = 0;
+}
+
+SVGSwitchElement::SVGSwitchElement(const SVGSwitchElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGSwitchElement &SVGSwitchElement::operator =(const SVGSwitchElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGSwitchElement::SVGSwitchElement(SVGSwitchElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGSwitchElement::~SVGSwitchElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGSwitchElement.h b/ksvg/dom/SVGSwitchElement.h
index a4f8819d..3ee55084 100644
--- a/ksvg/dom/SVGSwitchElement.h
+++ b/ksvg/dom/SVGSwitchElement.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSymbolElement.cc b/ksvg/dom/SVGSymbolElement.cc
deleted file mode 100644
index d83947a5..00000000
--- a/ksvg/dom/SVGSymbolElement.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGSymbolElement.h"
-#include "SVGSymbolElementImpl.h"
-
-using namespace KSVG;
-
-SVGSymbolElement::SVGSymbolElement() : SVGElement(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFitToViewBox()
-{
- impl = 0;
-}
-
-SVGSymbolElement::SVGSymbolElement(const SVGSymbolElement &other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGSymbolElement &SVGSymbolElement::operator =(const SVGSymbolElement &other)
-{
- SVGElement::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGFitToViewBox::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGSymbolElement::SVGSymbolElement(SVGSymbolElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGSymbolElement::~SVGSymbolElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGSymbolElement.cpp b/ksvg/dom/SVGSymbolElement.cpp
new file mode 100644
index 00000000..9b8d89f5
--- /dev/null
+++ b/ksvg/dom/SVGSymbolElement.cpp
@@ -0,0 +1,69 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGSymbolElement.h"
+#include "SVGSymbolElementImpl.h"
+
+using namespace KSVG;
+
+SVGSymbolElement::SVGSymbolElement() : SVGElement(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGFitToViewBox()
+{
+ impl = 0;
+}
+
+SVGSymbolElement::SVGSymbolElement(const SVGSymbolElement &other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGSymbolElement &SVGSymbolElement::operator =(const SVGSymbolElement &other)
+{
+ SVGElement::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGFitToViewBox::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGSymbolElement::SVGSymbolElement(SVGSymbolElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGFitToViewBox(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGSymbolElement::~SVGSymbolElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGSymbolElement.h b/ksvg/dom/SVGSymbolElement.h
index 8d02987e..e6a774d5 100644
--- a/ksvg/dom/SVGSymbolElement.h
+++ b/ksvg/dom/SVGSymbolElement.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTRefElement.cc b/ksvg/dom/SVGTRefElement.cc
deleted file mode 100644
index 4faa18ec..00000000
--- a/ksvg/dom/SVGTRefElement.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTRefElement.h"
-#include "SVGTRefElementImpl.h"
-
-using namespace KSVG;
-
-SVGTRefElement::SVGTRefElement() : SVGTextPositioningElement(), SVGURIReference()
-{
- impl = 0;
-}
-
-SVGTRefElement::SVGTRefElement(const SVGTRefElement &other) : SVGTextPositioningElement(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGTRefElement &SVGTRefElement::operator =(const SVGTRefElement &other)
-{
- SVGTextPositioningElement::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGTRefElement::SVGTRefElement(SVGTRefElementImpl *other) : SVGTextPositioningElement(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGTRefElement::~SVGTRefElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTRefElement.cpp b/ksvg/dom/SVGTRefElement.cpp
new file mode 100644
index 00000000..f987e3aa
--- /dev/null
+++ b/ksvg/dom/SVGTRefElement.cpp
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTRefElement.h"
+#include "SVGTRefElementImpl.h"
+
+using namespace KSVG;
+
+SVGTRefElement::SVGTRefElement() : SVGTextPositioningElement(), SVGURIReference()
+{
+ impl = 0;
+}
+
+SVGTRefElement::SVGTRefElement(const SVGTRefElement &other) : SVGTextPositioningElement(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGTRefElement &SVGTRefElement::operator =(const SVGTRefElement &other)
+{
+ SVGTextPositioningElement::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGTRefElement::SVGTRefElement(SVGTRefElementImpl *other) : SVGTextPositioningElement(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGTRefElement::~SVGTRefElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGTRefElement.h b/ksvg/dom/SVGTRefElement.h
index 5585f1d7..67cdaee6 100644
--- a/ksvg/dom/SVGTRefElement.h
+++ b/ksvg/dom/SVGTRefElement.h
@@ -48,5 +48,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTSpanElement.cc b/ksvg/dom/SVGTSpanElement.cc
deleted file mode 100644
index fc43309c..00000000
--- a/ksvg/dom/SVGTSpanElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTSpanElement.h"
-#include "SVGTSpanElementImpl.h"
-
-using namespace KSVG;
-
-SVGTSpanElement::SVGTSpanElement() : SVGTextPositioningElement()
-{
- impl = 0;
-}
-
-SVGTSpanElement::SVGTSpanElement(const SVGTSpanElement &other) : SVGTextPositioningElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGTSpanElement &SVGTSpanElement::operator =(const SVGTSpanElement &other)
-{
- SVGTextPositioningElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGTSpanElement::SVGTSpanElement(SVGTSpanElementImpl *other) : SVGTextPositioningElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGTSpanElement::~SVGTSpanElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTSpanElement.cpp b/ksvg/dom/SVGTSpanElement.cpp
new file mode 100644
index 00000000..6a2cf66c
--- /dev/null
+++ b/ksvg/dom/SVGTSpanElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTSpanElement.h"
+#include "SVGTSpanElementImpl.h"
+
+using namespace KSVG;
+
+SVGTSpanElement::SVGTSpanElement() : SVGTextPositioningElement()
+{
+ impl = 0;
+}
+
+SVGTSpanElement::SVGTSpanElement(const SVGTSpanElement &other) : SVGTextPositioningElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGTSpanElement &SVGTSpanElement::operator =(const SVGTSpanElement &other)
+{
+ SVGTextPositioningElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGTSpanElement::SVGTSpanElement(SVGTSpanElementImpl *other) : SVGTextPositioningElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGTSpanElement::~SVGTSpanElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGTSpanElement.h b/ksvg/dom/SVGTSpanElement.h
index 8fac655b..7759732b 100644
--- a/ksvg/dom/SVGTSpanElement.h
+++ b/ksvg/dom/SVGTSpanElement.h
@@ -66,5 +66,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTests.cc b/ksvg/dom/SVGTests.cc
deleted file mode 100644
index 9c3063b1..00000000
--- a/ksvg/dom/SVGTests.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTests.h"
-#include "SVGTestsImpl.h"
-#include "SVGStringList.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGTests::SVGTests()
-{
- impl = 0;
-}
-
-SVGTests::SVGTests(const SVGTests &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGTests &SVGTests::operator=(const SVGTests &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGTests::SVGTests(SVGTestsImpl *other)
-{
- impl = other;
-}
-
-SVGTests::~SVGTests()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-SVGStringList SVGTests::requiredFeatures() const
-{
- if(!impl) return SVGStringList(0);
- return SVGStringList(impl->requiredFeatures());
-}
-
-SVGStringList SVGTests::requiredExtensions() const
-{
- if(!impl) return SVGStringList(0);
- return SVGStringList(impl->requiredExtensions());
-}
-
-SVGStringList SVGTests::systemLanguage() const
-{
- if(!impl) return SVGStringList(0);
- return SVGStringList(impl->systemLanguage());
-}
-
-bool SVGTests::hasExtension(const DOM::DOMString &extension)
-{
- if(!impl) return false;
- return impl->hasExtension(extension);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTests.cpp b/ksvg/dom/SVGTests.cpp
new file mode 100644
index 00000000..145da6af
--- /dev/null
+++ b/ksvg/dom/SVGTests.cpp
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTests.h"
+#include "SVGTestsImpl.h"
+#include "SVGStringList.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGTests::SVGTests()
+{
+ impl = 0;
+}
+
+SVGTests::SVGTests(const SVGTests &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGTests &SVGTests::operator=(const SVGTests &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGTests::SVGTests(SVGTestsImpl *other)
+{
+ impl = other;
+}
+
+SVGTests::~SVGTests()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+SVGStringList SVGTests::requiredFeatures() const
+{
+ if(!impl) return SVGStringList(0);
+ return SVGStringList(impl->requiredFeatures());
+}
+
+SVGStringList SVGTests::requiredExtensions() const
+{
+ if(!impl) return SVGStringList(0);
+ return SVGStringList(impl->requiredExtensions());
+}
+
+SVGStringList SVGTests::systemLanguage() const
+{
+ if(!impl) return SVGStringList(0);
+ return SVGStringList(impl->systemLanguage());
+}
+
+bool SVGTests::hasExtension(const DOM::DOMString &extension)
+{
+ if(!impl) return false;
+ return impl->hasExtension(extension);
+}
diff --git a/ksvg/dom/SVGTests.h b/ksvg/dom/SVGTests.h
index 729b0efc..2254adf5 100644
--- a/ksvg/dom/SVGTests.h
+++ b/ksvg/dom/SVGTests.h
@@ -55,5 +55,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTextContentElement.cc b/ksvg/dom/SVGTextContentElement.cpp
index f40d23b6..f40d23b6 100644
--- a/ksvg/dom/SVGTextContentElement.cc
+++ b/ksvg/dom/SVGTextContentElement.cpp
diff --git a/ksvg/dom/SVGTextElement.cc b/ksvg/dom/SVGTextElement.cpp
index b80a148a..b80a148a 100644
--- a/ksvg/dom/SVGTextElement.cc
+++ b/ksvg/dom/SVGTextElement.cpp
diff --git a/ksvg/dom/SVGTextPathElement.cc b/ksvg/dom/SVGTextPathElement.cc
deleted file mode 100644
index 1cb6b833..00000000
--- a/ksvg/dom/SVGTextPathElement.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTextPathElement.h"
-#include "SVGTextPathElementImpl.h"
-#include "SVGAnimatedEnumeration.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGTextPathElement::SVGTextPathElement() : SVGTextContentElement(), SVGURIReference()
-{
- impl = new SVGTextPathElementImpl(0);
- impl->ref();
-}
-
-SVGTextPathElement::SVGTextPathElement(const SVGTextPathElement &other) : SVGTextContentElement(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGTextPathElement &SVGTextPathElement::operator =(const SVGTextPathElement &other)
-{
- SVGTextContentElement::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGTextPathElement::SVGTextPathElement(SVGTextPathElementImpl *other) : SVGTextContentElement(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGTextPathElement::~SVGTextPathElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGTextPathElement::startOffset() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->startOffset());
-}
-
-SVGAnimatedEnumeration SVGTextPathElement::method() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->method());
-}
-
-SVGAnimatedEnumeration SVGTextPathElement::spacing() const
-{
- if(!impl) return SVGAnimatedEnumeration(0);
- return SVGAnimatedEnumeration(impl->spacing());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTextPathElement.cpp b/ksvg/dom/SVGTextPathElement.cpp
new file mode 100644
index 00000000..09d26e20
--- /dev/null
+++ b/ksvg/dom/SVGTextPathElement.cpp
@@ -0,0 +1,87 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTextPathElement.h"
+#include "SVGTextPathElementImpl.h"
+#include "SVGAnimatedEnumeration.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGTextPathElement::SVGTextPathElement() : SVGTextContentElement(), SVGURIReference()
+{
+ impl = new SVGTextPathElementImpl(0);
+ impl->ref();
+}
+
+SVGTextPathElement::SVGTextPathElement(const SVGTextPathElement &other) : SVGTextContentElement(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGTextPathElement &SVGTextPathElement::operator =(const SVGTextPathElement &other)
+{
+ SVGTextContentElement::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGTextPathElement::SVGTextPathElement(SVGTextPathElementImpl *other) : SVGTextContentElement(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGTextPathElement::~SVGTextPathElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGTextPathElement::startOffset() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->startOffset());
+}
+
+SVGAnimatedEnumeration SVGTextPathElement::method() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->method());
+}
+
+SVGAnimatedEnumeration SVGTextPathElement::spacing() const
+{
+ if(!impl) return SVGAnimatedEnumeration(0);
+ return SVGAnimatedEnumeration(impl->spacing());
+}
diff --git a/ksvg/dom/SVGTextPathElement.h b/ksvg/dom/SVGTextPathElement.h
index 69c7fe79..d43ba495 100644
--- a/ksvg/dom/SVGTextPathElement.h
+++ b/ksvg/dom/SVGTextPathElement.h
@@ -66,5 +66,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTextPositioningElement.cc b/ksvg/dom/SVGTextPositioningElement.cpp
index 6ce7d346..6ce7d346 100644
--- a/ksvg/dom/SVGTextPositioningElement.cc
+++ b/ksvg/dom/SVGTextPositioningElement.cpp
diff --git a/ksvg/dom/SVGTitleElement.cc b/ksvg/dom/SVGTitleElement.cc
deleted file mode 100644
index f319c126..00000000
--- a/ksvg/dom/SVGTitleElement.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTitleElement.h"
-#include "SVGTitleElementImpl.h"
-
-using namespace KSVG;
-
-SVGTitleElement::SVGTitleElement() : SVGElement(), SVGLangSpace(), SVGStylable()
-{
- impl = 0;
-}
-
-SVGTitleElement::SVGTitleElement(const SVGTitleElement &other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGTitleElement &SVGTitleElement::operator =(const SVGTitleElement &other)
-{
- SVGElement::operator=(other);
- SVGLangSpace::operator=(other);
- SVGStylable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGTitleElement::SVGTitleElement(SVGTitleElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGTitleElement::~SVGTitleElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTitleElement.cpp b/ksvg/dom/SVGTitleElement.cpp
new file mode 100644
index 00000000..9c301d10
--- /dev/null
+++ b/ksvg/dom/SVGTitleElement.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTitleElement.h"
+#include "SVGTitleElementImpl.h"
+
+using namespace KSVG;
+
+SVGTitleElement::SVGTitleElement() : SVGElement(), SVGLangSpace(), SVGStylable()
+{
+ impl = 0;
+}
+
+SVGTitleElement::SVGTitleElement(const SVGTitleElement &other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGTitleElement &SVGTitleElement::operator =(const SVGTitleElement &other)
+{
+ SVGElement::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGStylable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGTitleElement::SVGTitleElement(SVGTitleElementImpl *other) : SVGElement(other), SVGLangSpace(other), SVGStylable(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGTitleElement::~SVGTitleElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGTitleElement.h b/ksvg/dom/SVGTitleElement.h
index 95f26272..400e694a 100644
--- a/ksvg/dom/SVGTitleElement.h
+++ b/ksvg/dom/SVGTitleElement.h
@@ -50,5 +50,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTransform.cc b/ksvg/dom/SVGTransform.cc
deleted file mode 100644
index df660678..00000000
--- a/ksvg/dom/SVGTransform.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTransformImpl.h"
-#include "SVGTransform.h"
-#include "SVGMatrix.h"
-
-using namespace KSVG;
-
-SVGTransform::SVGTransform()
-{
- impl = new SVGTransformImpl();
- impl->ref();
-}
-
-SVGTransform::SVGTransform(const SVGTransform &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGTransform &SVGTransform::operator=(const SVGTransform &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGTransform::SVGTransform(SVGTransformImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGTransform::~SVGTransform()
-{
-}
-
-unsigned short SVGTransform::type() const
-{
- if(!impl) return SVG_TRANSFORM_UNKNOWN;
- return impl->type();
-}
-
-SVGMatrix SVGTransform::matrix() const
-{
- if(!impl) return SVGMatrix(0);
- return SVGMatrix(impl->matrix());
-}
-
-double SVGTransform::angle() const
-{
- if(!impl) return -1;
- return impl->angle();
-}
-
-void SVGTransform::setMatrix(SVGMatrix matrix)
-{
- if(impl)
- impl->setMatrix(matrix.handle());
-}
-
-void SVGTransform::setTranslate(double tx, double ty)
-{
- if(impl)
- impl->setTranslate(tx, ty);
-}
-
-void SVGTransform::setScale(double sx, double sy)
-{
- if(impl)
- impl->setScale(sx, sy);
-}
-
-void SVGTransform::setRotate(double angle, double cx, double cy)
-{
- if(impl)
- impl->setRotate(angle, cx, cy);
-}
-
-void SVGTransform::setSkewX(double angle)
-{
- if(impl)
- impl->setSkewX(angle);
-}
-
-void SVGTransform::setSkewY(double angle)
-{
- if(impl)
- impl->setSkewY(angle);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTransform.cpp b/ksvg/dom/SVGTransform.cpp
new file mode 100644
index 00000000..a8bbe4db
--- /dev/null
+++ b/ksvg/dom/SVGTransform.cpp
@@ -0,0 +1,117 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTransformImpl.h"
+#include "SVGTransform.h"
+#include "SVGMatrix.h"
+
+using namespace KSVG;
+
+SVGTransform::SVGTransform()
+{
+ impl = new SVGTransformImpl();
+ impl->ref();
+}
+
+SVGTransform::SVGTransform(const SVGTransform &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGTransform &SVGTransform::operator=(const SVGTransform &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGTransform::SVGTransform(SVGTransformImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGTransform::~SVGTransform()
+{
+}
+
+unsigned short SVGTransform::type() const
+{
+ if(!impl) return SVG_TRANSFORM_UNKNOWN;
+ return impl->type();
+}
+
+SVGMatrix SVGTransform::matrix() const
+{
+ if(!impl) return SVGMatrix(0);
+ return SVGMatrix(impl->matrix());
+}
+
+double SVGTransform::angle() const
+{
+ if(!impl) return -1;
+ return impl->angle();
+}
+
+void SVGTransform::setMatrix(SVGMatrix matrix)
+{
+ if(impl)
+ impl->setMatrix(matrix.handle());
+}
+
+void SVGTransform::setTranslate(double tx, double ty)
+{
+ if(impl)
+ impl->setTranslate(tx, ty);
+}
+
+void SVGTransform::setScale(double sx, double sy)
+{
+ if(impl)
+ impl->setScale(sx, sy);
+}
+
+void SVGTransform::setRotate(double angle, double cx, double cy)
+{
+ if(impl)
+ impl->setRotate(angle, cx, cy);
+}
+
+void SVGTransform::setSkewX(double angle)
+{
+ if(impl)
+ impl->setSkewX(angle);
+}
+
+void SVGTransform::setSkewY(double angle)
+{
+ if(impl)
+ impl->setSkewY(angle);
+}
diff --git a/ksvg/dom/SVGTransform.h b/ksvg/dom/SVGTransform.h
index b7ca927f..1aa8e02a 100644
--- a/ksvg/dom/SVGTransform.h
+++ b/ksvg/dom/SVGTransform.h
@@ -67,5 +67,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTransformList.cc b/ksvg/dom/SVGTransformList.cc
deleted file mode 100644
index 541db510..00000000
--- a/ksvg/dom/SVGTransformList.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTransformList.h"
-#include "SVGTransformListImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGMatrix.h"
-#include "SVGTransform.h"
-
-using namespace KSVG;
-
-SVGTransformList::SVGTransformList()
-{
- impl = new SVGTransformListImpl();
- impl->ref();
-}
-
-SVGTransformList::SVGTransformList(const SVGTransformList &other)
-{
- (*this) = other;
-}
-
-SVGTransformList &SVGTransformList::operator=(const SVGTransformList &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGTransformList::SVGTransformList(SVGTransformListImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGTransformList::~SVGTransformList()
-{
- if(impl)
- impl->deref();
-}
-
-unsigned long SVGTransformList::numberOfItems() const
-{
- if(!impl) return 0;
- return impl->numberOfItems();
-}
-
-void SVGTransformList::clear()
-{
- if(impl)
- impl->clear();
-}
-
-SVGTransform *SVGTransformList::initialize(SVGTransform *newItem)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(impl->initialize(newItem->handle()));
-}
-
-SVGTransform *SVGTransformList::getItem(unsigned long index)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(impl->getItem(index));
-}
-
-SVGTransform *SVGTransformList::insertItemBefore(SVGTransform *newItem, unsigned long index)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(impl->insertItemBefore(newItem->handle(), index));
-}
-
-SVGTransform *SVGTransformList::replaceItem(SVGTransform *newItem, unsigned long index)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(impl->replaceItem(newItem->handle(), index));
-}
-
-SVGTransform *SVGTransformList::removeItem(unsigned long index)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(impl->removeItem(index));
-}
-
-SVGTransform *SVGTransformList::appendItem(SVGTransform *newItem)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(impl->appendItem(newItem->handle()));
-}
-
-SVGTransform *SVGTransformList::createSVGTransformFromMatrix(SVGMatrix &matrix)
-{
- if(!impl) return new SVGTransform(0);
- return new SVGTransform(SVGSVGElementImpl::createSVGTransformFromMatrix(matrix.handle()));
-}
-
-SVGTransform *SVGTransformList::consolidate()
-{
- if(!impl || impl->numberOfItems()==0) return 0;
- return new SVGTransform(impl->consolidate());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTransformList.cpp b/ksvg/dom/SVGTransformList.cpp
new file mode 100644
index 00000000..d363aef6
--- /dev/null
+++ b/ksvg/dom/SVGTransformList.cpp
@@ -0,0 +1,127 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTransformList.h"
+#include "SVGTransformListImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGMatrix.h"
+#include "SVGTransform.h"
+
+using namespace KSVG;
+
+SVGTransformList::SVGTransformList()
+{
+ impl = new SVGTransformListImpl();
+ impl->ref();
+}
+
+SVGTransformList::SVGTransformList(const SVGTransformList &other)
+{
+ (*this) = other;
+}
+
+SVGTransformList &SVGTransformList::operator=(const SVGTransformList &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGTransformList::SVGTransformList(SVGTransformListImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGTransformList::~SVGTransformList()
+{
+ if(impl)
+ impl->deref();
+}
+
+unsigned long SVGTransformList::numberOfItems() const
+{
+ if(!impl) return 0;
+ return impl->numberOfItems();
+}
+
+void SVGTransformList::clear()
+{
+ if(impl)
+ impl->clear();
+}
+
+SVGTransform *SVGTransformList::initialize(SVGTransform *newItem)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(impl->initialize(newItem->handle()));
+}
+
+SVGTransform *SVGTransformList::getItem(unsigned long index)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(impl->getItem(index));
+}
+
+SVGTransform *SVGTransformList::insertItemBefore(SVGTransform *newItem, unsigned long index)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(impl->insertItemBefore(newItem->handle(), index));
+}
+
+SVGTransform *SVGTransformList::replaceItem(SVGTransform *newItem, unsigned long index)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(impl->replaceItem(newItem->handle(), index));
+}
+
+SVGTransform *SVGTransformList::removeItem(unsigned long index)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(impl->removeItem(index));
+}
+
+SVGTransform *SVGTransformList::appendItem(SVGTransform *newItem)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(impl->appendItem(newItem->handle()));
+}
+
+SVGTransform *SVGTransformList::createSVGTransformFromMatrix(SVGMatrix &matrix)
+{
+ if(!impl) return new SVGTransform(0);
+ return new SVGTransform(SVGSVGElementImpl::createSVGTransformFromMatrix(matrix.handle()));
+}
+
+SVGTransform *SVGTransformList::consolidate()
+{
+ if(!impl || impl->numberOfItems()==0) return 0;
+ return new SVGTransform(impl->consolidate());
+}
diff --git a/ksvg/dom/SVGTransformList.h b/ksvg/dom/SVGTransformList.h
index 8d448718..6b3c9640 100644
--- a/ksvg/dom/SVGTransformList.h
+++ b/ksvg/dom/SVGTransformList.h
@@ -59,5 +59,3 @@ private:
}
#endif
-// vim:ts=4:noet
-
diff --git a/ksvg/dom/SVGTransformable.cc b/ksvg/dom/SVGTransformable.cc
deleted file mode 100644
index 64530d39..00000000
--- a/ksvg/dom/SVGTransformable.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGTransformable.h"
-#include "SVGTransformableImpl.h"
-#include "SVGAnimatedTransformList.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGTransformable::SVGTransformable() : SVGLocatable()
-{
- impl = 0;
-}
-
-SVGTransformable::SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)
-{
- (*this) = other;
-}
-
-SVGTransformable &SVGTransformable::operator=(const SVGTransformable &other)
-{
- SVGLocatable::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGTransformable::SVGTransformable(SVGTransformableImpl *other) : SVGLocatable(other)
-{
- impl = other;
-}
-
-SVGTransformable::~SVGTransformable()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-SVGAnimatedTransformList SVGTransformable::transform()
-{
- if(!impl) return SVGAnimatedTransformList(0);
- return SVGAnimatedTransformList(impl->transform());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGTransformable.cpp b/ksvg/dom/SVGTransformable.cpp
new file mode 100644
index 00000000..3c2d22f6
--- /dev/null
+++ b/ksvg/dom/SVGTransformable.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGTransformable.h"
+#include "SVGTransformableImpl.h"
+#include "SVGAnimatedTransformList.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGTransformable::SVGTransformable() : SVGLocatable()
+{
+ impl = 0;
+}
+
+SVGTransformable::SVGTransformable(const SVGTransformable &other) : SVGLocatable(other)
+{
+ (*this) = other;
+}
+
+SVGTransformable &SVGTransformable::operator=(const SVGTransformable &other)
+{
+ SVGLocatable::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGTransformable::SVGTransformable(SVGTransformableImpl *other) : SVGLocatable(other)
+{
+ impl = other;
+}
+
+SVGTransformable::~SVGTransformable()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+SVGAnimatedTransformList SVGTransformable::transform()
+{
+ if(!impl) return SVGAnimatedTransformList(0);
+ return SVGAnimatedTransformList(impl->transform());
+}
diff --git a/ksvg/dom/SVGTransformable.h b/ksvg/dom/SVGTransformable.h
index 54bf0a40..71ff12c1 100644
--- a/ksvg/dom/SVGTransformable.h
+++ b/ksvg/dom/SVGTransformable.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGURIReference.cc b/ksvg/dom/SVGURIReference.cc
deleted file mode 100644
index e872e9d6..00000000
--- a/ksvg/dom/SVGURIReference.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGURIReference.h"
-#include "SVGURIReferenceImpl.h"
-#include "SVGAnimatedString.h"
-
-using namespace KSVG;
-
-SVGURIReference::SVGURIReference()
-{
- impl = new SVGURIReferenceImpl();
-}
-
-SVGURIReference::SVGURIReference(const SVGURIReference &other)
-{
- impl = other.impl;
-}
-
-SVGURIReference &SVGURIReference::operator=(const SVGURIReference &other)
-{
- if(impl == other.impl)
- return *this;
-
- delete impl;
- impl = other.impl;
-
- return *this;
-}
-
-SVGURIReference::SVGURIReference(SVGURIReferenceImpl *other)
-{
- impl = other;
-}
-
-SVGURIReference::~SVGURIReference()
-{
-}
-
-SVGAnimatedString SVGURIReference::href() const
-{
- if(!impl) return SVGAnimatedString(0);
- return SVGAnimatedString(impl->href());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGURIReference.cpp b/ksvg/dom/SVGURIReference.cpp
new file mode 100644
index 00000000..85658aa4
--- /dev/null
+++ b/ksvg/dom/SVGURIReference.cpp
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGURIReference.h"
+#include "SVGURIReferenceImpl.h"
+#include "SVGAnimatedString.h"
+
+using namespace KSVG;
+
+SVGURIReference::SVGURIReference()
+{
+ impl = new SVGURIReferenceImpl();
+}
+
+SVGURIReference::SVGURIReference(const SVGURIReference &other)
+{
+ impl = other.impl;
+}
+
+SVGURIReference &SVGURIReference::operator=(const SVGURIReference &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ delete impl;
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGURIReference::SVGURIReference(SVGURIReferenceImpl *other)
+{
+ impl = other;
+}
+
+SVGURIReference::~SVGURIReference()
+{
+}
+
+SVGAnimatedString SVGURIReference::href() const
+{
+ if(!impl) return SVGAnimatedString(0);
+ return SVGAnimatedString(impl->href());
+}
diff --git a/ksvg/dom/SVGURIReference.h b/ksvg/dom/SVGURIReference.h
index 571cd2b2..f9dd4c48 100644
--- a/ksvg/dom/SVGURIReference.h
+++ b/ksvg/dom/SVGURIReference.h
@@ -49,5 +49,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGUnitTypes.h b/ksvg/dom/SVGUnitTypes.h
index 76079af2..6726e944 100644
--- a/ksvg/dom/SVGUnitTypes.h
+++ b/ksvg/dom/SVGUnitTypes.h
@@ -37,5 +37,3 @@ struct SVGUnitTypes
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGUseElement.cc b/ksvg/dom/SVGUseElement.cc
deleted file mode 100644
index 8cd8ef26..00000000
--- a/ksvg/dom/SVGUseElement.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGUseElement.h"
-#include "SVGUseElementImpl.h"
-#include "SVGElementInstance.h"
-#include "SVGAnimatedLength.h"
-
-using namespace KSVG;
-
-SVGUseElement::SVGUseElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGURIReference()
-{
- impl = 0;
-}
-
-SVGUseElement::SVGUseElement(const SVGUseElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGUseElement &SVGUseElement::operator =(const SVGUseElement &other)
-{
- SVGElement::operator=(other);
- SVGTests::operator=(other);
- SVGLangSpace::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGStylable::operator=(other);
- SVGTransformable::operator=(other);
- SVGURIReference::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGUseElement::SVGUseElement(SVGUseElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGUseElement::~SVGUseElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGAnimatedLength SVGUseElement::x() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->x());
-}
-
-SVGAnimatedLength SVGUseElement::y() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->y());
-}
-
-SVGAnimatedLength SVGUseElement::width() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->width());
-}
-
-SVGAnimatedLength SVGUseElement::height() const
-{
- if(!impl) return SVGAnimatedLength(0);
- return SVGAnimatedLength(impl->height());
-}
-
-SVGElementInstance SVGUseElement::instanceRoot() const
-{
- if(!impl) return SVGElementInstance(0);
- return impl->instanceRoot();
-}
-
-SVGElementInstance SVGUseElement::animatedInstanceRoot() const
-{
- if(!impl) return SVGElementInstance(0);
- return impl->animatedInstanceRoot();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGUseElement.cpp b/ksvg/dom/SVGUseElement.cpp
new file mode 100644
index 00000000..e74e05e8
--- /dev/null
+++ b/ksvg/dom/SVGUseElement.cpp
@@ -0,0 +1,109 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGUseElement.h"
+#include "SVGUseElementImpl.h"
+#include "SVGElementInstance.h"
+#include "SVGAnimatedLength.h"
+
+using namespace KSVG;
+
+SVGUseElement::SVGUseElement() : SVGElement(), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGStylable(), SVGTransformable(), SVGURIReference()
+{
+ impl = 0;
+}
+
+SVGUseElement::SVGUseElement(const SVGUseElement &other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGUseElement &SVGUseElement::operator =(const SVGUseElement &other)
+{
+ SVGElement::operator=(other);
+ SVGTests::operator=(other);
+ SVGLangSpace::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGStylable::operator=(other);
+ SVGTransformable::operator=(other);
+ SVGURIReference::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGUseElement::SVGUseElement(SVGUseElementImpl *other) : SVGElement(other), SVGTests(other), SVGLangSpace(other), SVGExternalResourcesRequired(other), SVGStylable(other), SVGTransformable(other), SVGURIReference(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGUseElement::~SVGUseElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGAnimatedLength SVGUseElement::x() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->x());
+}
+
+SVGAnimatedLength SVGUseElement::y() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->y());
+}
+
+SVGAnimatedLength SVGUseElement::width() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->width());
+}
+
+SVGAnimatedLength SVGUseElement::height() const
+{
+ if(!impl) return SVGAnimatedLength(0);
+ return SVGAnimatedLength(impl->height());
+}
+
+SVGElementInstance SVGUseElement::instanceRoot() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return impl->instanceRoot();
+}
+
+SVGElementInstance SVGUseElement::animatedInstanceRoot() const
+{
+ if(!impl) return SVGElementInstance(0);
+ return impl->animatedInstanceRoot();
+}
diff --git a/ksvg/dom/SVGUseElement.h b/ksvg/dom/SVGUseElement.h
index fb494abb..f80ceb8f 100644
--- a/ksvg/dom/SVGUseElement.h
+++ b/ksvg/dom/SVGUseElement.h
@@ -67,5 +67,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGVKernElement.cc b/ksvg/dom/SVGVKernElement.cc
deleted file mode 100644
index ad6dbee5..00000000
--- a/ksvg/dom/SVGVKernElement.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGVKernElement.h"
-#include "SVGVKernElementImpl.h"
-
-using namespace KSVG;
-
-SVGVKernElement::SVGVKernElement() : SVGElement()
-{
- impl = 0;
-}
-
-SVGVKernElement::SVGVKernElement(const SVGVKernElement &other) : SVGElement(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGVKernElement &SVGVKernElement::operator =(const SVGVKernElement &other)
-{
- SVGElement::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGVKernElement::SVGVKernElement(SVGVKernElementImpl *other) : SVGElement(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGVKernElement::~SVGVKernElement()
-{
- if(impl)
- impl->deref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGVKernElement.cpp b/ksvg/dom/SVGVKernElement.cpp
new file mode 100644
index 00000000..7a52b933
--- /dev/null
+++ b/ksvg/dom/SVGVKernElement.cpp
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGVKernElement.h"
+#include "SVGVKernElementImpl.h"
+
+using namespace KSVG;
+
+SVGVKernElement::SVGVKernElement() : SVGElement()
+{
+ impl = 0;
+}
+
+SVGVKernElement::SVGVKernElement(const SVGVKernElement &other) : SVGElement(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGVKernElement &SVGVKernElement::operator =(const SVGVKernElement &other)
+{
+ SVGElement::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGVKernElement::SVGVKernElement(SVGVKernElementImpl *other) : SVGElement(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGVKernElement::~SVGVKernElement()
+{
+ if(impl)
+ impl->deref();
+}
diff --git a/ksvg/dom/SVGVKernElement.h b/ksvg/dom/SVGVKernElement.h
index 6649ab1a..3ee782ee 100644
--- a/ksvg/dom/SVGVKernElement.h
+++ b/ksvg/dom/SVGVKernElement.h
@@ -46,5 +46,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGViewElement.cc b/ksvg/dom/SVGViewElement.cc
deleted file mode 100644
index 040d6966..00000000
--- a/ksvg/dom/SVGViewElement.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGViewElement.h"
-#include "SVGViewElementImpl.h"
-#include "SVGStringList.h"
-
-using namespace KSVG;
-
-SVGViewElement::SVGViewElement() : SVGElement(), SVGExternalResourcesRequired(), SVGFitToViewBox(), SVGZoomAndPan()
-{
- impl = 0;
-}
-
-SVGViewElement::SVGViewElement(const SVGViewElement &other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGFitToViewBox(other), SVGZoomAndPan(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGViewElement &SVGViewElement::operator =(const SVGViewElement &other)
-{
- SVGElement::operator=(other);
- SVGExternalResourcesRequired::operator=(other);
- SVGFitToViewBox::operator=(other);
- SVGZoomAndPan::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGViewElement::SVGViewElement(SVGViewElementImpl *other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGFitToViewBox(other), SVGZoomAndPan(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGViewElement::~SVGViewElement()
-{
- if(impl)
- impl->deref();
-}
-
-SVGStringList SVGViewElement::viewTarget() const
-{
- if(!impl) return SVGStringList(0);
- return SVGStringList(impl->viewTarget());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGViewElement.cpp b/ksvg/dom/SVGViewElement.cpp
new file mode 100644
index 00000000..0214be20
--- /dev/null
+++ b/ksvg/dom/SVGViewElement.cpp
@@ -0,0 +1,75 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGViewElement.h"
+#include "SVGViewElementImpl.h"
+#include "SVGStringList.h"
+
+using namespace KSVG;
+
+SVGViewElement::SVGViewElement() : SVGElement(), SVGExternalResourcesRequired(), SVGFitToViewBox(), SVGZoomAndPan()
+{
+ impl = 0;
+}
+
+SVGViewElement::SVGViewElement(const SVGViewElement &other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGFitToViewBox(other), SVGZoomAndPan(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGViewElement &SVGViewElement::operator =(const SVGViewElement &other)
+{
+ SVGElement::operator=(other);
+ SVGExternalResourcesRequired::operator=(other);
+ SVGFitToViewBox::operator=(other);
+ SVGZoomAndPan::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGViewElement::SVGViewElement(SVGViewElementImpl *other) : SVGElement(other), SVGExternalResourcesRequired(other), SVGFitToViewBox(other), SVGZoomAndPan(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGViewElement::~SVGViewElement()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGStringList SVGViewElement::viewTarget() const
+{
+ if(!impl) return SVGStringList(0);
+ return SVGStringList(impl->viewTarget());
+}
diff --git a/ksvg/dom/SVGViewElement.h b/ksvg/dom/SVGViewElement.h
index fccedbc8..95c1991e 100644
--- a/ksvg/dom/SVGViewElement.h
+++ b/ksvg/dom/SVGViewElement.h
@@ -55,5 +55,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGViewSpec.cc b/ksvg/dom/SVGViewSpec.cc
deleted file mode 100644
index a01f7b86..00000000
--- a/ksvg/dom/SVGViewSpec.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGViewSpec.h"
-#include "SVGViewSpecImpl.h"
-#include "SVGElement.h"
-#include "SVGTransformList.h"
-
-using namespace KSVG;
-
-SVGViewSpec::SVGViewSpec() : SVGZoomAndPan(), SVGFitToViewBox()
-{
- impl = new SVGViewSpecImpl();
- impl->ref();
-}
-
-SVGViewSpec::SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGViewSpec &SVGViewSpec::operator =(const SVGViewSpec &other)
-{
- SVGZoomAndPan::operator=(other);
- SVGFitToViewBox::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGViewSpec::SVGViewSpec(SVGViewSpecImpl *other) : SVGZoomAndPan(other), SVGFitToViewBox(other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGViewSpec::~SVGViewSpec()
-{
- if(impl)
- impl->deref();
-}
-
-SVGTransformList SVGViewSpec::transform() const
-{
- if(!impl) return SVGTransformList(0);
- return SVGTransformList(impl->transform());
-}
-
-SVGElement SVGViewSpec::viewTarget() const
-{
- if(!impl) return SVGElement(0);
- return SVGElement(impl->viewTarget());
-}
-
-DOM::DOMString SVGViewSpec::viewBoxString() const
-{
- if(!impl) return DOM::DOMString();
- return impl->viewBoxString();
-}
-
-DOM::DOMString SVGViewSpec::preserveAspectRatioString() const
-{
- if(!impl) return DOM::DOMString();
- return impl->preserveAspectRatioString();
-}
-
-DOM::DOMString SVGViewSpec::transformString() const
-{
- if(!impl) return DOM::DOMString();
- return impl->transformString();
-}
-
-DOM::DOMString SVGViewSpec::viewTargetString() const
-{
- if(!impl) return DOM::DOMString();
- return impl->viewTargetString();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGViewSpec.cpp b/ksvg/dom/SVGViewSpec.cpp
new file mode 100644
index 00000000..c7877736
--- /dev/null
+++ b/ksvg/dom/SVGViewSpec.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGViewSpec.h"
+#include "SVGViewSpecImpl.h"
+#include "SVGElement.h"
+#include "SVGTransformList.h"
+
+using namespace KSVG;
+
+SVGViewSpec::SVGViewSpec() : SVGZoomAndPan(), SVGFitToViewBox()
+{
+ impl = new SVGViewSpecImpl();
+ impl->ref();
+}
+
+SVGViewSpec::SVGViewSpec(const SVGViewSpec &other) : SVGZoomAndPan(other), SVGFitToViewBox(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGViewSpec &SVGViewSpec::operator =(const SVGViewSpec &other)
+{
+ SVGZoomAndPan::operator=(other);
+ SVGFitToViewBox::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGViewSpec::SVGViewSpec(SVGViewSpecImpl *other) : SVGZoomAndPan(other), SVGFitToViewBox(other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGViewSpec::~SVGViewSpec()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGTransformList SVGViewSpec::transform() const
+{
+ if(!impl) return SVGTransformList(0);
+ return SVGTransformList(impl->transform());
+}
+
+SVGElement SVGViewSpec::viewTarget() const
+{
+ if(!impl) return SVGElement(0);
+ return SVGElement(impl->viewTarget());
+}
+
+DOM::DOMString SVGViewSpec::viewBoxString() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->viewBoxString();
+}
+
+DOM::DOMString SVGViewSpec::preserveAspectRatioString() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->preserveAspectRatioString();
+}
+
+DOM::DOMString SVGViewSpec::transformString() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->transformString();
+}
+
+DOM::DOMString SVGViewSpec::viewTargetString() const
+{
+ if(!impl) return DOM::DOMString();
+ return impl->viewTargetString();
+}
diff --git a/ksvg/dom/SVGViewSpec.h b/ksvg/dom/SVGViewSpec.h
index c1c7ef8e..fb26d7fa 100644
--- a/ksvg/dom/SVGViewSpec.h
+++ b/ksvg/dom/SVGViewSpec.h
@@ -59,5 +59,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGWindow.cc b/ksvg/dom/SVGWindow.cc
deleted file mode 100644
index 9f0fedaf..00000000
--- a/ksvg/dom/SVGWindow.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGWindow.h"
-#include "SVGWindowImpl.h"
-#include "SVGDocument.h"
-
-using namespace KSVG;
-
-SVGWindow::SVGWindow()
-{
- impl = new SVGWindowImpl();
- impl->ref();
-}
-
-SVGWindow::SVGWindow(const SVGWindow &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGWindow &SVGWindow::operator =(const SVGWindow &other)
-{
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGWindow::SVGWindow(SVGWindowImpl *other)
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGWindow::~SVGWindow()
-{
- if(impl)
- impl->deref();
-}
-
-/*StyleSheet SVGWindow::defaultStyleSheet() const
-{
- if(!impl) return ; // FIXME
- return impl->defaultStyleSheet();
-}*/
-
-SVGDocument SVGWindow::document() const
-{
- if(!impl) return SVGDocument(0); // FIXME
- return impl->document();
-}
-
-DOM::Event SVGWindow::evt() const
-{
- if(!impl) return DOM::Event(); // FIXME
- return impl->evt();
-}
-
-long SVGWindow::innerHeight() const
-{
- if(!impl) return 0; // FIXME
- return impl->innerHeight();
-}
-
-long SVGWindow::innerWidth() const
-{
- if(!impl) return 0; // FIXME
- return impl->innerWidth();
-}
-
-void SVGWindow::setSrc(const DOM::DOMString &src)
-{
- if(impl)
- impl->setSrc(src);
-}
-
-DOM::DOMString SVGWindow::src() const
-{
- if(!impl) return DOM::DOMString(); // FIXME
- return impl->src();
-}
-
-void SVGWindow::clearInterval(long interval)
-{
- if(impl)
- impl->clearInterval(interval);
-}
-
-void SVGWindow::clearTimeout(long timeout)
-{
- if(impl)
- impl->clearTimeout(timeout);
-}
-
-void SVGWindow::getURL(const DOM::DOMString &uri, const DOM::EventListener &callback)
-{
- if(impl)
- impl->getURL(uri, callback);
-}
-
-/*DocumentFragment SVGWindow::parseXML(const DOM::DOMString &source, const Document &document)
-{
- if(!impl) return ; // FIXME
- return impl->parseXML(source, document);
-}*/
-
-void SVGWindow::postURL(const DOM::DOMString &uri, const DOM::DOMString &data, const DOM::EventListener &callback, const DOM::DOMString &mimeType, const DOM::DOMString &contentEncoding)
-{
- if(impl)
- impl->postURL(uri, data, callback, mimeType, contentEncoding);
-}
-
-DOM::DOMString SVGWindow::printNode(const DOM::Node &node)
-{
- if(!impl) return DOM::DOMString(); // FIXME
- return impl->printNode(node);
-}
-
-long SVGWindow::setInterval(const DOM::DOMString &code, const long &delay)
-{
- if(!impl) return 0; // FIXME
- return impl->setInterval(code, delay);
-}
-
-long SVGWindow::setTimeout(const DOM::DOMString &code, const long &delay)
-{
- if(!impl) return 0; // FIXME
- return impl->setTimeout(code, delay);
-}
-
-void SVGWindow::alert(const DOM::DOMString &message)
-{
- if(impl)
- impl->alert(message);
-}
-
-bool SVGWindow::confirm(const DOM::DOMString &message)
-{
- if(!impl) return false; // FIXME
- return impl->confirm(message);
-}
-
-DOM::DOMString SVGWindow::prompt(const DOM::DOMString &message, const DOM::DOMString &_default)
-{
- if(!impl) return DOM::DOMString(); // FIXME
- return impl->prompt(message, _default);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGWindow.cpp b/ksvg/dom/SVGWindow.cpp
new file mode 100644
index 00000000..22a8dcc0
--- /dev/null
+++ b/ksvg/dom/SVGWindow.cpp
@@ -0,0 +1,173 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGWindow.h"
+#include "SVGWindowImpl.h"
+#include "SVGDocument.h"
+
+using namespace KSVG;
+
+SVGWindow::SVGWindow()
+{
+ impl = new SVGWindowImpl();
+ impl->ref();
+}
+
+SVGWindow::SVGWindow(const SVGWindow &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGWindow &SVGWindow::operator =(const SVGWindow &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGWindow::SVGWindow(SVGWindowImpl *other)
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGWindow::~SVGWindow()
+{
+ if(impl)
+ impl->deref();
+}
+
+/*StyleSheet SVGWindow::defaultStyleSheet() const
+{
+ if(!impl) return ; // FIXME
+ return impl->defaultStyleSheet();
+}*/
+
+SVGDocument SVGWindow::document() const
+{
+ if(!impl) return SVGDocument(0); // FIXME
+ return impl->document();
+}
+
+DOM::Event SVGWindow::evt() const
+{
+ if(!impl) return DOM::Event(); // FIXME
+ return impl->evt();
+}
+
+long SVGWindow::innerHeight() const
+{
+ if(!impl) return 0; // FIXME
+ return impl->innerHeight();
+}
+
+long SVGWindow::innerWidth() const
+{
+ if(!impl) return 0; // FIXME
+ return impl->innerWidth();
+}
+
+void SVGWindow::setSrc(const DOM::DOMString &src)
+{
+ if(impl)
+ impl->setSrc(src);
+}
+
+DOM::DOMString SVGWindow::src() const
+{
+ if(!impl) return DOM::DOMString(); // FIXME
+ return impl->src();
+}
+
+void SVGWindow::clearInterval(long interval)
+{
+ if(impl)
+ impl->clearInterval(interval);
+}
+
+void SVGWindow::clearTimeout(long timeout)
+{
+ if(impl)
+ impl->clearTimeout(timeout);
+}
+
+void SVGWindow::getURL(const DOM::DOMString &uri, const DOM::EventListener &callback)
+{
+ if(impl)
+ impl->getURL(uri, callback);
+}
+
+/*DocumentFragment SVGWindow::parseXML(const DOM::DOMString &source, const Document &document)
+{
+ if(!impl) return ; // FIXME
+ return impl->parseXML(source, document);
+}*/
+
+void SVGWindow::postURL(const DOM::DOMString &uri, const DOM::DOMString &data, const DOM::EventListener &callback, const DOM::DOMString &mimeType, const DOM::DOMString &contentEncoding)
+{
+ if(impl)
+ impl->postURL(uri, data, callback, mimeType, contentEncoding);
+}
+
+DOM::DOMString SVGWindow::printNode(const DOM::Node &node)
+{
+ if(!impl) return DOM::DOMString(); // FIXME
+ return impl->printNode(node);
+}
+
+long SVGWindow::setInterval(const DOM::DOMString &code, const long &delay)
+{
+ if(!impl) return 0; // FIXME
+ return impl->setInterval(code, delay);
+}
+
+long SVGWindow::setTimeout(const DOM::DOMString &code, const long &delay)
+{
+ if(!impl) return 0; // FIXME
+ return impl->setTimeout(code, delay);
+}
+
+void SVGWindow::alert(const DOM::DOMString &message)
+{
+ if(impl)
+ impl->alert(message);
+}
+
+bool SVGWindow::confirm(const DOM::DOMString &message)
+{
+ if(!impl) return false; // FIXME
+ return impl->confirm(message);
+}
+
+DOM::DOMString SVGWindow::prompt(const DOM::DOMString &message, const DOM::DOMString &_default)
+{
+ if(!impl) return DOM::DOMString(); // FIXME
+ return impl->prompt(message, _default);
+}
diff --git a/ksvg/dom/SVGWindow.h b/ksvg/dom/SVGWindow.h
index 2389286f..2e5c82b8 100644
--- a/ksvg/dom/SVGWindow.h
+++ b/ksvg/dom/SVGWindow.h
@@ -123,5 +123,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGZoomAndPan.cc b/ksvg/dom/SVGZoomAndPan.cc
deleted file mode 100644
index a65284f1..00000000
--- a/ksvg/dom/SVGZoomAndPan.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGZoomAndPan.h"
-#include "SVGZoomAndPanImpl.h"
-
-using namespace KSVG;
-
-// This class can't be constructed seperately.
-SVGZoomAndPan::SVGZoomAndPan()
-{
- impl = 0;
-}
-
-SVGZoomAndPan::SVGZoomAndPan(const SVGZoomAndPan &other) : impl(0)
-{
- (*this) = other;
-}
-
-SVGZoomAndPan &SVGZoomAndPan::operator=(const SVGZoomAndPan &other)
-{
- if(impl == other.impl)
- return *this;
-
- impl = other.impl;
-
- return *this;
-}
-
-SVGZoomAndPan::SVGZoomAndPan(SVGZoomAndPanImpl *other)
-{
- impl = other;
-}
-
-SVGZoomAndPan::~SVGZoomAndPan()
-{
- // We are not allowed to delete 'impl' as it's not refcounted.
- // delete impl;
-}
-
-void SVGZoomAndPan::setZoomAndPan(unsigned short zoomAndPan)
-{
- if(impl)
- impl->setZoomAndPan(zoomAndPan);
-}
-
-unsigned short SVGZoomAndPan::zoomAndPan() const
-{
- if(!impl) return SVG_ZOOMANDPAN_UNKNOWN;
- return impl->zoomAndPan();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGZoomAndPan.cpp b/ksvg/dom/SVGZoomAndPan.cpp
new file mode 100644
index 00000000..a8a0bf04
--- /dev/null
+++ b/ksvg/dom/SVGZoomAndPan.cpp
@@ -0,0 +1,68 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGZoomAndPan.h"
+#include "SVGZoomAndPanImpl.h"
+
+using namespace KSVG;
+
+// This class can't be constructed seperately.
+SVGZoomAndPan::SVGZoomAndPan()
+{
+ impl = 0;
+}
+
+SVGZoomAndPan::SVGZoomAndPan(const SVGZoomAndPan &other) : impl(0)
+{
+ (*this) = other;
+}
+
+SVGZoomAndPan &SVGZoomAndPan::operator=(const SVGZoomAndPan &other)
+{
+ if(impl == other.impl)
+ return *this;
+
+ impl = other.impl;
+
+ return *this;
+}
+
+SVGZoomAndPan::SVGZoomAndPan(SVGZoomAndPanImpl *other)
+{
+ impl = other;
+}
+
+SVGZoomAndPan::~SVGZoomAndPan()
+{
+ // We are not allowed to delete 'impl' as it's not refcounted.
+ // delete impl;
+}
+
+void SVGZoomAndPan::setZoomAndPan(unsigned short zoomAndPan)
+{
+ if(impl)
+ impl->setZoomAndPan(zoomAndPan);
+}
+
+unsigned short SVGZoomAndPan::zoomAndPan() const
+{
+ if(!impl) return SVG_ZOOMANDPAN_UNKNOWN;
+ return impl->zoomAndPan();
+}
diff --git a/ksvg/dom/SVGZoomAndPan.h b/ksvg/dom/SVGZoomAndPan.h
index 0a1cdf19..18343c85 100644
--- a/ksvg/dom/SVGZoomAndPan.h
+++ b/ksvg/dom/SVGZoomAndPan.h
@@ -56,5 +56,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGZoomEvent.cc b/ksvg/dom/SVGZoomEvent.cc
deleted file mode 100644
index bc73a438..00000000
--- a/ksvg/dom/SVGZoomEvent.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGZoomEvent.h"
-#include "SVGZoomEventImpl.h"
-#include "SVGRect.h"
-#include "SVGPoint.h"
-
-using namespace KSVG;
-
-SVGZoomEvent::SVGZoomEvent() : DOM::UIEvent()
-{
- impl = 0;
-}
-
-SVGZoomEvent::SVGZoomEvent(const SVGZoomEvent &other) : DOM::UIEvent(other), impl(0)
-{
- (*this) = other;
-}
-
-SVGZoomEvent &SVGZoomEvent::operator =(const SVGZoomEvent &other)
-{
- DOM::UIEvent::operator=(other);
-
- if(impl == other.impl)
- return *this;
-
- if(impl)
- impl->deref();
-
- impl = other.impl;
-
- if(impl)
- impl->ref();
-
- return *this;
-}
-
-SVGZoomEvent::SVGZoomEvent(SVGZoomEventImpl *other) : DOM::UIEvent()
-{
- impl = other;
- if(impl)
- impl->ref();
-}
-
-SVGZoomEvent::~SVGZoomEvent()
-{
- if(impl)
- impl->deref();
-}
-
-SVGRect SVGZoomEvent::zoomRectScreen() const
-{
- if(!impl) return SVGRect(0);
- return SVGRect(impl->zoomRectScreen());
-}
-
-float SVGZoomEvent::previousScale() const
-{
- if(!impl) return -1;
- return impl->previousScale();
-}
-
-SVGPoint SVGZoomEvent::previousTranslate() const
-{
- if(!impl) return SVGPoint(0);
- return SVGPoint(impl->previousTranslate());
-}
-
-float SVGZoomEvent::newScale() const
-{
- if(!impl) return -1;
- return impl->newScale();
-}
-
-SVGPoint SVGZoomEvent::newTranslate() const
-{
- if(!impl) return SVGPoint(0);
- return SVGPoint(impl->newTranslate());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/dom/SVGZoomEvent.cpp b/ksvg/dom/SVGZoomEvent.cpp
new file mode 100644
index 00000000..cf3cd8d6
--- /dev/null
+++ b/ksvg/dom/SVGZoomEvent.cpp
@@ -0,0 +1,97 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGZoomEvent.h"
+#include "SVGZoomEventImpl.h"
+#include "SVGRect.h"
+#include "SVGPoint.h"
+
+using namespace KSVG;
+
+SVGZoomEvent::SVGZoomEvent() : DOM::UIEvent()
+{
+ impl = 0;
+}
+
+SVGZoomEvent::SVGZoomEvent(const SVGZoomEvent &other) : DOM::UIEvent(other), impl(0)
+{
+ (*this) = other;
+}
+
+SVGZoomEvent &SVGZoomEvent::operator =(const SVGZoomEvent &other)
+{
+ DOM::UIEvent::operator=(other);
+
+ if(impl == other.impl)
+ return *this;
+
+ if(impl)
+ impl->deref();
+
+ impl = other.impl;
+
+ if(impl)
+ impl->ref();
+
+ return *this;
+}
+
+SVGZoomEvent::SVGZoomEvent(SVGZoomEventImpl *other) : DOM::UIEvent()
+{
+ impl = other;
+ if(impl)
+ impl->ref();
+}
+
+SVGZoomEvent::~SVGZoomEvent()
+{
+ if(impl)
+ impl->deref();
+}
+
+SVGRect SVGZoomEvent::zoomRectScreen() const
+{
+ if(!impl) return SVGRect(0);
+ return SVGRect(impl->zoomRectScreen());
+}
+
+float SVGZoomEvent::previousScale() const
+{
+ if(!impl) return -1;
+ return impl->previousScale();
+}
+
+SVGPoint SVGZoomEvent::previousTranslate() const
+{
+ if(!impl) return SVGPoint(0);
+ return SVGPoint(impl->previousTranslate());
+}
+
+float SVGZoomEvent::newScale() const
+{
+ if(!impl) return -1;
+ return impl->newScale();
+}
+
+SVGPoint SVGZoomEvent::newTranslate() const
+{
+ if(!impl) return SVGPoint(0);
+ return SVGPoint(impl->newTranslate());
+}
diff --git a/ksvg/dom/SVGZoomEvent.h b/ksvg/dom/SVGZoomEvent.h
index f759e9bd..30dbdef4 100644
--- a/ksvg/dom/SVGZoomEvent.h
+++ b/ksvg/dom/SVGZoomEvent.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_cacheimpl.h b/ksvg/ecma/ksvg_cacheimpl.h
index 1140f1b4..4f8891c6 100644
--- a/ksvg/ecma/ksvg_cacheimpl.h
+++ b/ksvg/ecma/ksvg_cacheimpl.h
@@ -61,5 +61,3 @@ inline KJS::Object cacheGlobalBridge(KJS::ExecState *exec, const KJS::Identifier
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_ecma.cpp b/ksvg/ecma/ksvg_ecma.cpp
index aa2af84b..7e2b5fc9 100644
--- a/ksvg/ecma/ksvg_ecma.cpp
+++ b/ksvg/ecma/ksvg_ecma.cpp
@@ -332,5 +332,3 @@ TQVariant KSVG::valueToVariant(ExecState *exec, const Value &val)
return res;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_ecma.h b/ksvg/ecma/ksvg_ecma.h
index ab58f67a..1706bb68 100644
--- a/ksvg/ecma/ksvg_ecma.h
+++ b/ksvg/ecma/ksvg_ecma.h
@@ -110,5 +110,3 @@ private:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_ecmaeventlistener.cpp b/ksvg/ecma/ksvg_ecmaeventlistener.cpp
index 2dd81131..4a02fd04 100644
--- a/ksvg/ecma/ksvg_ecmaeventlistener.cpp
+++ b/ksvg/ecma/ksvg_ecmaeventlistener.cpp
@@ -95,5 +95,3 @@ DOM::DOMString KSVGEcmaEventListener::eventListenerType()
{
return "KSVGEcmaEventListener - " + m_type;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_ecmaeventlistener.h b/ksvg/ecma/ksvg_ecmaeventlistener.h
index ee80c212..3aa85978 100644
--- a/ksvg/ecma/ksvg_ecmaeventlistener.h
+++ b/ksvg/ecma/ksvg_ecmaeventlistener.h
@@ -50,5 +50,3 @@ private:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_helper.cpp b/ksvg/ecma/ksvg_helper.cpp
index 24f05101..d7b32e64 100644
--- a/ksvg/ecma/ksvg_helper.cpp
+++ b/ksvg/ecma/ksvg_helper.cpp
@@ -64,5 +64,3 @@ TQString KJS::Identifier::qstring() const
{
return TQString((TQChar*) data(), size());
}
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_lookup.h b/ksvg/ecma/ksvg_lookup.h
index 11c41462..9280366b 100644
--- a/ksvg/ecma/ksvg_lookup.h
+++ b/ksvg/ecma/ksvg_lookup.h
@@ -314,5 +314,3 @@ namespace KSVG
#define KSVG_CHECK_THIS(ClassName) KSVG_CHECK(ClassName, thisObj)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_scriptinterpreter.cpp b/ksvg/ecma/ksvg_scriptinterpreter.cpp
index b5b9e6dd..7ed91c5f 100644
--- a/ksvg/ecma/ksvg_scriptinterpreter.cpp
+++ b/ksvg/ecma/ksvg_scriptinterpreter.cpp
@@ -88,5 +88,3 @@ void KSVGScriptInterpreter::setAttributeSetMode(bool temp)
{
m_attributeSetMode = temp;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/ecma/ksvg_scriptinterpreter.h b/ksvg/ecma/ksvg_scriptinterpreter.h
index e3f7cc42..b0970731 100644
--- a/ksvg/ecma/ksvg_scriptinterpreter.h
+++ b/ksvg/ecma/ksvg_scriptinterpreter.h
@@ -67,5 +67,3 @@ private:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/CMakeLists.txt b/ksvg/impl/CMakeLists.txt
index 8b44c254..82980a01 100644
--- a/ksvg/impl/CMakeLists.txt
+++ b/ksvg/impl/CMakeLists.txt
@@ -30,63 +30,64 @@ include_directories(
tde_add_library( ksvgdomimpl STATIC_PIC AUTOMOC
SOURCES
- SVGLengthImpl.cc SVGNumberImpl.cc SVGPointImpl.cc SVGTransformImpl.cc
- SVGMatrixImpl.cc SVGRectImpl.cc SVGAngleImpl.cc SVGAnimatedLengthImpl.cc
- SVGAnimatedNumberImpl.cc SVGAnimatedIntegerImpl.cc SVGAnimatedBooleanImpl.cc
- SVGAnimatedEnumerationImpl.cc SVGAnimatedPreserveAspectRatioImpl.cc
- SVGAnimatedRectImpl.cc SVGAnimatedAngleImpl.cc SVGAnimatedPathDataImpl.cc
- SVGAnimatedStringImpl.cc SVGLengthListImpl.cc SVGNumberListImpl.cc
- SVGPointListImpl.cc SVGTransformListImpl.cc SVGStringListImpl.cc
- SVGPathSegListImpl.cc SVGElementInstanceListImpl.cc
- SVGAnimatedLengthListImpl.cc SVGAnimatedNumberListImpl.cc
- SVGAnimatedPointsImpl.cc SVGAnimatedTransformListImpl.cc
- SVGShapeImpl.cc SVGContainerImpl.cc SVGBBoxTarget.cc SVGHelperImpl.cc
- SVGStylableImpl.cc SVGTransformableImpl.cc SVGTestsImpl.cc SVGLangSpaceImpl.cc
- SVGExternalResourcesRequiredImpl.cc SVGLocatableImpl.cc SVGFitToViewBoxImpl.cc
- SVGPreserveAspectRatioImpl.cc SVGZoomAndPanImpl.cc SVGViewSpecImpl.cc
- SVGElementImpl.cc SVGElementInstanceImpl.cc SVGDocumentImpl.cc
- SVGSVGElementImpl.cc SVGWindowImpl.cc SVGDefsElementImpl.cc
- SVGUseElementImpl.cc SVGDescElementImpl.cc SVGTitleElementImpl.cc
- SVGGElementImpl.cc SVGSwitchElementImpl.cc SVGSymbolElementImpl.cc
- SVGImageElementImpl.cc SVGURIReferenceImpl.cc SVGStyleElementImpl.cc
- SVGCSSRuleImpl.cc SVGPathElementImpl.cc SVGPathSegImpl.cc
- SVGPathSegClosePathImpl.cc SVGPathSegArcImpl.cc SVGPathSegMovetoImpl.cc
- SVGPathSegCurvetoQuadraticImpl.cc SVGPathSegCurvetoQuadraticSmoothImpl.cc
- SVGPathSegCurvetoCubicImpl.cc SVGPathSegCurvetoCubicSmoothImpl.cc
- SVGPathSegLinetoImpl.cc SVGPathSegLinetoHorizontalImpl.cc
- SVGPathSegLinetoVerticalImpl.cc SVGRectElementImpl.cc SVGCircleElementImpl.cc
- SVGEllipseElementImpl.cc SVGLineElementImpl.cc SVGPolyElementImpl.cc
- SVGPolylineElementImpl.cc SVGPolygonElementImpl.cc SVGTextElementImpl.cc
- SVGTSpanElementImpl.cc SVGTRefElementImpl.cc SVGTextPositioningElementImpl.cc
- SVGTextContentElementImpl.cc SVGTextPathElementImpl.cc SVGPaintImpl.cc
- SVGMarkerElementImpl.cc SVGColorImpl.cc SVGICCColorImpl.cc
- SVGColorProfileElementImpl.cc SVGColorProfileRuleImpl.cc SVGPaintServerImpl.cc
- SVGGradientElementImpl.cc SVGStopElementImpl.cc SVGLinearGradientElementImpl.cc
- SVGRadialGradientElementImpl.cc SVGPatternElementImpl.cc
- SVGClipPathElementImpl.cc SVGMaskElementImpl.cc SVGFilterElementImpl.cc
- SVGFilterPrimitiveStandardAttributesImpl.cc SVGFEBlendElementImpl.cc
- SVGFEColorMatrixElementImpl.cc SVGFEComponentTransferElementImpl.cc
- SVGComponentTransferFunctionElementImpl.cc SVGFEFuncAElementImpl.cc
- SVGFEFuncBElementImpl.cc SVGFEFuncGElementImpl.cc SVGFEFuncRElementImpl.cc
- SVGFECompositeElementImpl.cc SVGFEConvolveMatrixElementImpl.cc
- SVGFEFloodElementImpl.cc SVGFEGaussianBlurElementImpl.cc
- SVGFEDiffuseLightingElementImpl.cc SVGFEDistantLightElementImpl.cc
- SVGFEPointLightElementImpl.cc SVGFESpotLightElementImpl.cc
- SVGFEDisplacementMapElementImpl.cc SVGFEMergeElementImpl.cc
- SVGFEMergeNodeElementImpl.cc SVGFEImageElementImpl.cc
- SVGFEMorphologyElementImpl.cc SVGFEOffsetElementImpl.cc
- SVGFESpecularLightingElementImpl.cc SVGFETileElementImpl.cc
- SVGFETurbulenceElementImpl.cc SVGCursorElementImpl.cc
- SVGAElementImpl.cc SVGViewElementImpl.cc SVGScriptElementImpl.cc
- SVGEventImpl.cc SVGZoomEventImpl.cc SVGEcma.cc generateddata.cpp
- SVGAnimationElementImpl.cc SVGAnimateElementImpl.cc SVGSetElementImpl.cc
- SVGAnimateMotionElementImpl.cc SVGAnimateColorElementImpl.cc
- SVGAnimateTransformElementImpl.cc SVGMPathElementImpl.cc SVGTimeScheduler.cc
- SVGFontElementImpl.cc SVGAltGlyphElementImpl.cc SVGAltGlyphDefElementImpl.cc
- SVGGlyphRefElementImpl.cc SVGGlyphElementImpl.cc SVGMissingGlyphElementImpl.cc
- SVGFontFaceElementImpl.cc SVGFontFaceFormatElementImpl.cc
- SVGFontFaceNameElementImpl.cc SVGFontFaceSrcElementImpl.cc
- SVGFontFaceUriElementImpl.cc SVGDefinitionSrcElementImpl.cc
- SVGHKernElementImpl.cc SVGVKernElementImpl.cc SVGMetadataElementImpl.cc
- SVGForeignObjectElementImpl.cc svgpathparser.cc
+ SVGLengthImpl.cpp SVGNumberImpl.cpp SVGPointImpl.cpp SVGTransformImpl.cpp
+ SVGMatrixImpl.cpp SVGRectImpl.cpp SVGAngleImpl.cpp SVGAnimatedLengthImpl.cpp
+ SVGAnimatedNumberImpl.cpp SVGAnimatedIntegerImpl.cpp SVGAnimatedBooleanImpl.cpp
+ SVGAnimatedEnumerationImpl.cpp SVGAnimatedPreserveAspectRatioImpl.cpp
+ SVGAnimatedRectImpl.cpp SVGAnimatedAngleImpl.cpp SVGAnimatedPathDataImpl.cpp
+ SVGAnimatedStringImpl.cpp SVGLengthListImpl.cpp SVGNumberListImpl.cpp
+ SVGPointListImpl.cpp SVGTransformListImpl.cpp SVGStringListImpl.cpp
+ SVGPathSegListImpl.cpp SVGElementInstanceListImpl.cpp
+ SVGAnimatedLengthListImpl.cpp SVGAnimatedNumberListImpl.cpp
+ SVGAnimatedPointsImpl.cpp SVGAnimatedTransformListImpl.cpp
+ SVGShapeImpl.cpp SVGContainerImpl.cpp SVGBBoxTarget.cpp SVGHelperImpl.cpp
+ SVGStylableImpl.cpp SVGTransformableImpl.cpp SVGTestsImpl.cpp SVGLangSpaceImpl.cpp
+ SVGExternalResourcesRequiredImpl.cpp SVGLocatableImpl.cpp SVGFitToViewBoxImpl.cpp
+ SVGPreserveAspectRatioImpl.cpp SVGZoomAndPanImpl.cpp SVGViewSpecImpl.cpp
+ SVGElementImpl.cpp SVGElementInstanceImpl.cpp SVGDocumentImpl.cpp
+ SVGSVGElementImpl.cpp SVGWindowImpl.cpp SVGDefsElementImpl.cpp
+ SVGUseElementImpl.cpp SVGDescElementImpl.cpp SVGTitleElementImpl.cpp
+ SVGGElementImpl.cpp SVGSwitchElementImpl.cpp SVGSymbolElementImpl.cpp
+ SVGImageElementImpl.cpp SVGURIReferenceImpl.cpp SVGStyleElementImpl.cpp
+ SVGCSSRuleImpl.cpp SVGPathElementImpl.cpp SVGPathSegImpl.cpp
+ SVGPathSegClosePathImpl.cpp SVGPathSegArcImpl.cpp SVGPathSegMovetoImpl.cpp
+ SVGPathSegCurvetoQuadraticImpl.cpp SVGPathSegCurvetoQuadraticSmoothImpl.cpp
+ SVGPathSegCurvetoCubicImpl.cpp SVGPathSegCurvetoCubicSmoothImpl.cpp
+ SVGPathSegLinetoImpl.cpp SVGPathSegLinetoHorizontalImpl.cpp
+ SVGPathSegLinetoVerticalImpl.cpp SVGRectElementImpl.cpp SVGCircleElementImpl.cpp
+ SVGEllipseElementImpl.cpp SVGLineElementImpl.cpp SVGPolyElementImpl.cpp
+ SVGPolylineElementImpl.cpp SVGPolygonElementImpl.cpp SVGTextElementImpl.cpp
+ SVGTSpanElementImpl.cpp SVGTRefElementImpl.cpp SVGTextPositioningElementImpl.cpp
+ SVGTextContentElementImpl.cpp SVGTextPathElementImpl.cpp SVGPaintImpl.cpp
+ SVGMarkerElementImpl.cpp SVGColorImpl.cpp SVGICCColorImpl.cpp
+ SVGColorProfileElementImpl.cpp SVGColorProfileRuleImpl.cpp SVGPaintServerImpl.cpp
+ SVGGradientElementImpl.cpp SVGStopElementImpl.cpp SVGLinearGradientElementImpl.cpp
+ SVGRadialGradientElementImpl.cpp SVGPatternElementImpl.cpp
+ SVGClipPathElementImpl.cpp SVGMaskElementImpl.cpp SVGFilterElementImpl.cpp
+ SVGFilterPrimitiveStandardAttributesImpl.cpp SVGFEBlendElementImpl.cpp
+ SVGFEColorMatrixElementImpl.cpp SVGFEComponentTransferElementImpl.cpp
+ SVGComponentTransferFunctionElementImpl.cpp SVGFEFuncAElementImpl.cpp
+ SVGFEFuncBElementImpl.cpp SVGFEFuncGElementImpl.cpp SVGFEFuncRElementImpl.cpp
+ SVGFECompositeElementImpl.cpp SVGFEConvolveMatrixElementImpl.cpp
+ SVGFEFloodElementImpl.cpp SVGFEGaussianBlurElementImpl.cpp
+ SVGFEDiffuseLightingElementImpl.cpp SVGFEDistantLightElementImpl.cpp
+ SVGFEPointLightElementImpl.cpp SVGFESpotLightElementImpl.cpp
+ SVGFEDisplacementMapElementImpl.cpp SVGFEMergeElementImpl.cpp
+ SVGFEMergeNodeElementImpl.cpp SVGFEImageElementImpl.cpp
+ SVGFEMorphologyElementImpl.cpp SVGFEOffsetElementImpl.cpp
+ SVGFESpecularLightingElementImpl.cpp SVGFETileElementImpl.cpp
+ SVGFETurbulenceElementImpl.cpp SVGCursorElementImpl.cpp
+ SVGAElementImpl.cpp SVGViewElementImpl.cpp SVGScriptElementImpl.cpp
+ SVGEventImpl.cpp SVGZoomEventImpl.cpp SVGEcma.cpp generateddata.cpp
+ SVGAnimationElementImpl.cpp SVGAnimateElementImpl.cpp SVGSetElementImpl.cpp
+ SVGAnimateMotionElementImpl.cpp SVGAnimateColorElementImpl.cpp
+ SVGAnimateTransformElementImpl.cpp SVGMPathElementImpl.cpp SVGTimeScheduler.cpp
+ SVGFontElementImpl.cpp SVGAltGlyphElementImpl.cpp SVGAltGlyphDefElementImpl.cpp
+ SVGGlyphRefElementImpl.cpp SVGGlyphElementImpl.cpp SVGMissingGlyphElementImpl.cpp
+ SVGFontFaceElementImpl.cpp SVGFontFaceFormatElementImpl.cpp
+ SVGFontFaceNameElementImpl.cpp SVGFontFaceSrcElementImpl.cpp
+ SVGFontFaceUriElementImpl.cpp SVGDefinitionSrcElementImpl.cpp
+ SVGHKernElementImpl.cpp SVGVKernElementImpl.cpp SVGMetadataElementImpl.cpp
+ SVGForeignObjectElementImpl.cpp svgpathparser.cpp
+ LINK kjs-shared
)
diff --git a/ksvg/impl/Makefile.am b/ksvg/impl/Makefile.am
index 24e40d67..8509022f 100644
--- a/ksvg/impl/Makefile.am
+++ b/ksvg/impl/Makefile.am
@@ -29,87 +29,87 @@ KDE_OPTIONS = nofinal
KDE_CXXFLAGS = $(USE_EXCEPTIONS)
libksvgdomimpl_la_SOURCES = \
-SVGLengthImpl.cc SVGNumberImpl.cc SVGPointImpl.cc SVGTransformImpl.cc \
-SVGMatrixImpl.cc SVGRectImpl.cc SVGAngleImpl.cc \
+SVGLengthImpl.cpp SVGNumberImpl.cpp SVGPointImpl.cpp SVGTransformImpl.cpp \
+SVGMatrixImpl.cpp SVGRectImpl.cpp SVGAngleImpl.cpp \
\
-SVGAnimatedLengthImpl.cc SVGAnimatedNumberImpl.cc SVGAnimatedIntegerImpl.cc \
-SVGAnimatedBooleanImpl.cc SVGAnimatedEnumerationImpl.cc SVGAnimatedPreserveAspectRatioImpl.cc \
-SVGAnimatedRectImpl.cc SVGAnimatedAngleImpl.cc SVGAnimatedPathDataImpl.cc SVGAnimatedStringImpl.cc \
+SVGAnimatedLengthImpl.cpp SVGAnimatedNumberImpl.cpp SVGAnimatedIntegerImpl.cpp \
+SVGAnimatedBooleanImpl.cpp SVGAnimatedEnumerationImpl.cpp SVGAnimatedPreserveAspectRatioImpl.cpp \
+SVGAnimatedRectImpl.cpp SVGAnimatedAngleImpl.cpp SVGAnimatedPathDataImpl.cpp SVGAnimatedStringImpl.cpp \
\
-SVGLengthListImpl.cc SVGNumberListImpl.cc SVGPointListImpl.cc SVGTransformListImpl.cc \
-SVGStringListImpl.cc SVGPathSegListImpl.cc SVGElementInstanceListImpl.cc \
+SVGLengthListImpl.cpp SVGNumberListImpl.cpp SVGPointListImpl.cpp SVGTransformListImpl.cpp \
+SVGStringListImpl.cpp SVGPathSegListImpl.cpp SVGElementInstanceListImpl.cpp \
\
-SVGAnimatedLengthListImpl.cc SVGAnimatedNumberListImpl.cc \
-SVGAnimatedPointsImpl.cc SVGAnimatedTransformListImpl.cc \
+SVGAnimatedLengthListImpl.cpp SVGAnimatedNumberListImpl.cpp \
+SVGAnimatedPointsImpl.cpp SVGAnimatedTransformListImpl.cpp \
\
-SVGShapeImpl.cc SVGContainerImpl.cc SVGBBoxTarget.cc SVGHelperImpl.cc \
-SVGStylableImpl.cc SVGTransformableImpl.cc SVGTestsImpl.cc SVGLangSpaceImpl.cc \
-SVGExternalResourcesRequiredImpl.cc SVGLocatableImpl.cc SVGFitToViewBoxImpl.cc \
-SVGPreserveAspectRatioImpl.cc SVGZoomAndPanImpl.cc SVGViewSpecImpl.cc \
+SVGShapeImpl.cpp SVGContainerImpl.cpp SVGBBoxTarget.cpp SVGHelperImpl.cpp \
+SVGStylableImpl.cpp SVGTransformableImpl.cpp SVGTestsImpl.cpp SVGLangSpaceImpl.cpp \
+SVGExternalResourcesRequiredImpl.cpp SVGLocatableImpl.cpp SVGFitToViewBoxImpl.cpp \
+SVGPreserveAspectRatioImpl.cpp SVGZoomAndPanImpl.cpp SVGViewSpecImpl.cpp \
\
-SVGElementImpl.cc SVGElementInstanceImpl.cc \
-SVGDocumentImpl.cc SVGSVGElementImpl.cc SVGWindowImpl.cc \
-SVGDefsElementImpl.cc SVGUseElementImpl.cc \
-SVGDescElementImpl.cc SVGTitleElementImpl.cc \
-SVGGElementImpl.cc SVGSwitchElementImpl.cc \
-SVGSymbolElementImpl.cc SVGImageElementImpl.cc \
-SVGURIReferenceImpl.cc \
+SVGElementImpl.cpp SVGElementInstanceImpl.cpp \
+SVGDocumentImpl.cpp SVGSVGElementImpl.cpp SVGWindowImpl.cpp \
+SVGDefsElementImpl.cpp SVGUseElementImpl.cpp \
+SVGDescElementImpl.cpp SVGTitleElementImpl.cpp \
+SVGGElementImpl.cpp SVGSwitchElementImpl.cpp \
+SVGSymbolElementImpl.cpp SVGImageElementImpl.cpp \
+SVGURIReferenceImpl.cpp \
\
-SVGStyleElementImpl.cc SVGCSSRuleImpl.cc \
+SVGStyleElementImpl.cpp SVGCSSRuleImpl.cpp \
\
-SVGPathElementImpl.cc SVGPathSegImpl.cc SVGPathSegClosePathImpl.cc SVGPathSegArcImpl.cc \
-SVGPathSegMovetoImpl.cc SVGPathSegCurvetoQuadraticImpl.cc SVGPathSegCurvetoQuadraticSmoothImpl.cc \
-SVGPathSegCurvetoCubicImpl.cc SVGPathSegCurvetoCubicSmoothImpl.cc SVGPathSegLinetoImpl.cc \
-SVGPathSegLinetoHorizontalImpl.cc SVGPathSegLinetoVerticalImpl.cc \
+SVGPathElementImpl.cpp SVGPathSegImpl.cpp SVGPathSegClosePathImpl.cpp SVGPathSegArcImpl.cpp \
+SVGPathSegMovetoImpl.cpp SVGPathSegCurvetoQuadraticImpl.cpp SVGPathSegCurvetoQuadraticSmoothImpl.cpp \
+SVGPathSegCurvetoCubicImpl.cpp SVGPathSegCurvetoCubicSmoothImpl.cpp SVGPathSegLinetoImpl.cpp \
+SVGPathSegLinetoHorizontalImpl.cpp SVGPathSegLinetoVerticalImpl.cpp \
\
-SVGRectElementImpl.cc SVGCircleElementImpl.cc SVGEllipseElementImpl.cc SVGLineElementImpl.cc \
-SVGPolyElementImpl.cc SVGPolylineElementImpl.cc SVGPolygonElementImpl.cc \
+SVGRectElementImpl.cpp SVGCircleElementImpl.cpp SVGEllipseElementImpl.cpp SVGLineElementImpl.cpp \
+SVGPolyElementImpl.cpp SVGPolylineElementImpl.cpp SVGPolygonElementImpl.cpp \
\
-SVGTextElementImpl.cc SVGTSpanElementImpl.cc SVGTRefElementImpl.cc \
-SVGTextPositioningElementImpl.cc SVGTextContentElementImpl.cc SVGTextPathElementImpl.cc \
+SVGTextElementImpl.cpp SVGTSpanElementImpl.cpp SVGTRefElementImpl.cpp \
+SVGTextPositioningElementImpl.cpp SVGTextContentElementImpl.cpp SVGTextPathElementImpl.cpp \
\
-SVGPaintImpl.cc SVGMarkerElementImpl.cc \
+SVGPaintImpl.cpp SVGMarkerElementImpl.cpp \
\
-SVGColorImpl.cc SVGICCColorImpl.cc SVGColorProfileElementImpl.cc SVGColorProfileRuleImpl.cc \
+SVGColorImpl.cpp SVGICCColorImpl.cpp SVGColorProfileElementImpl.cpp SVGColorProfileRuleImpl.cpp \
\
-SVGPaintServerImpl.cc SVGGradientElementImpl.cc SVGStopElementImpl.cc \
-SVGLinearGradientElementImpl.cc SVGRadialGradientElementImpl.cc SVGPatternElementImpl.cc \
+SVGPaintServerImpl.cpp SVGGradientElementImpl.cpp SVGStopElementImpl.cpp \
+SVGLinearGradientElementImpl.cpp SVGRadialGradientElementImpl.cpp SVGPatternElementImpl.cpp \
\
-SVGClipPathElementImpl.cc SVGMaskElementImpl.cc \
+SVGClipPathElementImpl.cpp SVGMaskElementImpl.cpp \
\
-SVGFilterElementImpl.cc SVGFilterPrimitiveStandardAttributesImpl.cc \
-SVGFEBlendElementImpl.cc SVGFEColorMatrixElementImpl.cc \
-SVGFEComponentTransferElementImpl.cc SVGComponentTransferFunctionElementImpl.cc \
-SVGFEFuncAElementImpl.cc SVGFEFuncBElementImpl.cc SVGFEFuncGElementImpl.cc \
-SVGFEFuncRElementImpl.cc SVGFECompositeElementImpl.cc SVGFEConvolveMatrixElementImpl.cc \
-SVGFEFloodElementImpl.cc SVGFEGaussianBlurElementImpl.cc SVGFEDiffuseLightingElementImpl.cc \
-SVGFEDistantLightElementImpl.cc SVGFEPointLightElementImpl.cc SVGFESpotLightElementImpl.cc \
-SVGFEDisplacementMapElementImpl.cc SVGFEMergeElementImpl.cc SVGFEMergeNodeElementImpl.cc \
-SVGFEImageElementImpl.cc SVGFEMorphologyElementImpl.cc SVGFEOffsetElementImpl.cc \
-SVGFESpecularLightingElementImpl.cc SVGFETileElementImpl.cc SVGFETurbulenceElementImpl.cc \
+SVGFilterElementImpl.cpp SVGFilterPrimitiveStandardAttributesImpl.cpp \
+SVGFEBlendElementImpl.cpp SVGFEColorMatrixElementImpl.cpp \
+SVGFEComponentTransferElementImpl.cpp SVGComponentTransferFunctionElementImpl.cpp \
+SVGFEFuncAElementImpl.cpp SVGFEFuncBElementImpl.cpp SVGFEFuncGElementImpl.cpp \
+SVGFEFuncRElementImpl.cpp SVGFECompositeElementImpl.cpp SVGFEConvolveMatrixElementImpl.cpp \
+SVGFEFloodElementImpl.cpp SVGFEGaussianBlurElementImpl.cpp SVGFEDiffuseLightingElementImpl.cpp \
+SVGFEDistantLightElementImpl.cpp SVGFEPointLightElementImpl.cpp SVGFESpotLightElementImpl.cpp \
+SVGFEDisplacementMapElementImpl.cpp SVGFEMergeElementImpl.cpp SVGFEMergeNodeElementImpl.cpp \
+SVGFEImageElementImpl.cpp SVGFEMorphologyElementImpl.cpp SVGFEOffsetElementImpl.cpp \
+SVGFESpecularLightingElementImpl.cpp SVGFETileElementImpl.cpp SVGFETurbulenceElementImpl.cpp \
\
-SVGCursorElementImpl.cc \
+SVGCursorElementImpl.cpp \
\
-SVGAElementImpl.cc SVGViewElementImpl.cc \
+SVGAElementImpl.cpp SVGViewElementImpl.cpp \
\
-SVGScriptElementImpl.cc SVGEventImpl.cc SVGZoomEventImpl.cc \
-SVGEcma.cc generateddata.cpp \
+SVGScriptElementImpl.cpp SVGEventImpl.cpp SVGZoomEventImpl.cpp \
+SVGEcma.cpp generateddata.cpp \
\
-SVGAnimationElementImpl.cc SVGAnimateElementImpl.cc SVGSetElementImpl.cc \
-SVGAnimateMotionElementImpl.cc SVGAnimateColorElementImpl.cc \
-SVGAnimateTransformElementImpl.cc SVGMPathElementImpl.cc SVGTimeScheduler.cc \
+SVGAnimationElementImpl.cpp SVGAnimateElementImpl.cpp SVGSetElementImpl.cpp \
+SVGAnimateMotionElementImpl.cpp SVGAnimateColorElementImpl.cpp \
+SVGAnimateTransformElementImpl.cpp SVGMPathElementImpl.cpp SVGTimeScheduler.cpp \
\
-SVGFontElementImpl.cc SVGAltGlyphElementImpl.cc SVGAltGlyphDefElementImpl.cc \
-SVGGlyphRefElementImpl.cc SVGGlyphElementImpl.cc SVGMissingGlyphElementImpl.cc \
-SVGFontFaceElementImpl.cc SVGFontFaceFormatElementImpl.cc SVGFontFaceNameElementImpl.cc \
-SVGFontFaceSrcElementImpl.cc SVGFontFaceUriElementImpl.cc SVGDefinitionSrcElementImpl.cc \
-SVGHKernElementImpl.cc SVGVKernElementImpl.cc \
+SVGFontElementImpl.cpp SVGAltGlyphElementImpl.cpp SVGAltGlyphDefElementImpl.cpp \
+SVGGlyphRefElementImpl.cpp SVGGlyphElementImpl.cpp SVGMissingGlyphElementImpl.cpp \
+SVGFontFaceElementImpl.cpp SVGFontFaceFormatElementImpl.cpp SVGFontFaceNameElementImpl.cpp \
+SVGFontFaceSrcElementImpl.cpp SVGFontFaceUriElementImpl.cpp SVGDefinitionSrcElementImpl.cpp \
+SVGHKernElementImpl.cpp SVGVKernElementImpl.cpp \
\
-SVGMetadataElementImpl.cc \
+SVGMetadataElementImpl.cpp \
\
-SVGForeignObjectElementImpl.cc \
+SVGForeignObjectElementImpl.cpp \
\
-svgpathparser.cc
+svgpathparser.cpp
libksvgdomimpl_la_METASOURCES = AUTO
diff --git a/ksvg/impl/SVGAElementImpl.cc b/ksvg/impl/SVGAElementImpl.cc
deleted file mode 100644
index db5342b2..00000000
--- a/ksvg/impl/SVGAElementImpl.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAElementImpl::SVGAElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_target = new SVGAnimatedStringImpl();
- m_target->ref();
-}
-
-SVGAElementImpl::~SVGAElementImpl()
-{
- if(m_target)
- m_target->deref();
-}
-
-/*
-@namespace KSVG
-@begin SVGAElementImpl::s_hashTable 2
- target SVGAElementImpl::Target DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Target:
- return m_target->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Target:
- {
- if(m_target)
- m_target->deref();
-
- SVGAnimatedStringImpl *temp = new SVGAnimatedStringImpl();
- temp->ref();
- temp->setBaseVal(value.toString(exec).string());
- setTarget(temp);
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGAElementImpl::setTarget(SVGAnimatedStringImpl *target)
-{
- m_target = target;
-}
-
-SVGAnimatedStringImpl *SVGAElementImpl::target() const
-{
- return m_target;
-}
-
-SVGAElementImpl *SVGAElementImpl::getLink(SVGElementImpl *sourceElem)
-{
- for(DOM::Node node = *sourceElem; !node.isNull(); node = node.parentNode())
- {
- SVGElementImpl *elem = sourceElem->ownerDoc()->getElementFromHandle(node.handle());
- if(elem)
- {
- SVGAElementImpl *link = dynamic_cast<SVGAElementImpl *>(elem);
- if(link)
- return link;
- }
- }
-
- return 0;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAElementImpl.cpp b/ksvg/impl/SVGAElementImpl.cpp
new file mode 100644
index 00000000..0885f254
--- /dev/null
+++ b/ksvg/impl/SVGAElementImpl.cpp
@@ -0,0 +1,115 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAElementImpl::SVGAElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_target = new SVGAnimatedStringImpl();
+ m_target->ref();
+}
+
+SVGAElementImpl::~SVGAElementImpl()
+{
+ if(m_target)
+ m_target->deref();
+}
+
+/*
+@namespace KSVG
+@begin SVGAElementImpl::s_hashTable 2
+ target SVGAElementImpl::Target DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Target:
+ return m_target->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Target:
+ {
+ if(m_target)
+ m_target->deref();
+
+ SVGAnimatedStringImpl *temp = new SVGAnimatedStringImpl();
+ temp->ref();
+ temp->setBaseVal(value.toString(exec).string());
+ setTarget(temp);
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGAElementImpl::setTarget(SVGAnimatedStringImpl *target)
+{
+ m_target = target;
+}
+
+SVGAnimatedStringImpl *SVGAElementImpl::target() const
+{
+ return m_target;
+}
+
+SVGAElementImpl *SVGAElementImpl::getLink(SVGElementImpl *sourceElem)
+{
+ for(DOM::Node node = *sourceElem; !node.isNull(); node = node.parentNode())
+ {
+ SVGElementImpl *elem = sourceElem->ownerDoc()->getElementFromHandle(node.handle());
+ if(elem)
+ {
+ SVGAElementImpl *link = dynamic_cast<SVGAElementImpl *>(elem);
+ if(link)
+ return link;
+ }
+ }
+
+ return 0;
+}
diff --git a/ksvg/impl/SVGAElementImpl.h b/ksvg/impl/SVGAElementImpl.h
index 2da4c3d4..a5fd2483 100644
--- a/ksvg/impl/SVGAElementImpl.h
+++ b/ksvg/impl/SVGAElementImpl.h
@@ -76,4 +76,3 @@ KSVG_REGISTER_ELEMENT(SVGAElementImpl, "a")
}
#endif
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAltGlyphDefElementImpl.cc b/ksvg/impl/SVGAltGlyphDefElementImpl.cc
deleted file mode 100644
index 2a0b5fe9..00000000
--- a/ksvg/impl/SVGAltGlyphDefElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAltGlyphDefElementImpl.h"
-
-using namespace KSVG;
-
-SVGAltGlyphDefElementImpl::SVGAltGlyphDefElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGAltGlyphDefElementImpl::~SVGAltGlyphDefElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAltGlyphDefElementImpl.cpp b/ksvg/impl/SVGAltGlyphDefElementImpl.cpp
new file mode 100644
index 00000000..6c60d72c
--- /dev/null
+++ b/ksvg/impl/SVGAltGlyphDefElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAltGlyphDefElementImpl.h"
+
+using namespace KSVG;
+
+SVGAltGlyphDefElementImpl::SVGAltGlyphDefElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGAltGlyphDefElementImpl::~SVGAltGlyphDefElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGAltGlyphDefElementImpl.h b/ksvg/impl/SVGAltGlyphDefElementImpl.h
index cc1c92f4..4a6b154a 100644
--- a/ksvg/impl/SVGAltGlyphDefElementImpl.h
+++ b/ksvg/impl/SVGAltGlyphDefElementImpl.h
@@ -45,5 +45,3 @@ KSVG_REGISTER_ELEMENT(SVGAltGlyphDefElementImpl, "altGlyphDef")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAltGlyphElementImpl.cc b/ksvg/impl/SVGAltGlyphElementImpl.cc
deleted file mode 100644
index d426bd74..00000000
--- a/ksvg/impl/SVGAltGlyphElementImpl.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGSVGElementImpl.h"
-#include "SVGAltGlyphElementImpl.h"
-
-using namespace KSVG;
-
-SVGAltGlyphElementImpl::SVGAltGlyphElementImpl(DOM::ElementImpl *impl) : SVGTSpanElementImpl(impl), SVGURIReferenceImpl()
-{
-}
-
-SVGAltGlyphElementImpl::~SVGAltGlyphElementImpl()
-{
-}
-
-void SVGAltGlyphElementImpl::setAttributes()
-{
- SVGTSpanElementImpl::setAttributes();
-}
-
-DOM::DOMString SVGAltGlyphElementImpl::format()
-{
- return "";
-}
-
-DOM::DOMString SVGAltGlyphElementImpl::glyphRef()
-{
- return "";
-}
-
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAltGlyphElementImpl.cpp b/ksvg/impl/SVGAltGlyphElementImpl.cpp
new file mode 100644
index 00000000..724fa50c
--- /dev/null
+++ b/ksvg/impl/SVGAltGlyphElementImpl.cpp
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGSVGElementImpl.h"
+#include "SVGAltGlyphElementImpl.h"
+
+using namespace KSVG;
+
+SVGAltGlyphElementImpl::SVGAltGlyphElementImpl(DOM::ElementImpl *impl) : SVGTSpanElementImpl(impl), SVGURIReferenceImpl()
+{
+}
+
+SVGAltGlyphElementImpl::~SVGAltGlyphElementImpl()
+{
+}
+
+void SVGAltGlyphElementImpl::setAttributes()
+{
+ SVGTSpanElementImpl::setAttributes();
+}
+
+DOM::DOMString SVGAltGlyphElementImpl::format()
+{
+ return "";
+}
+
+DOM::DOMString SVGAltGlyphElementImpl::glyphRef()
+{
+ return "";
+}
diff --git a/ksvg/impl/SVGAltGlyphElementImpl.h b/ksvg/impl/SVGAltGlyphElementImpl.h
index 8dcfe479..6b695036 100644
--- a/ksvg/impl/SVGAltGlyphElementImpl.h
+++ b/ksvg/impl/SVGAltGlyphElementImpl.h
@@ -51,5 +51,3 @@ KSVG_REGISTER_ELEMENT(SVGAltGlyphElementImpl, "altGlyph")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAngleImpl.cc b/ksvg/impl/SVGAngleImpl.cc
deleted file mode 100644
index 26e70b1b..00000000
--- a/ksvg/impl/SVGAngleImpl.cc
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAngle.h"
-
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAngleImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-const double deg2rad = 0.017453292519943295769; // pi/180
-const double deg2grad = 400.0 / 360.0;
-const double rad2grad = deg2grad / deg2rad;
-
-SVGAngleImpl::SVGAngleImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_unitType = SVG_ANGLETYPE_UNKNOWN;
- m_valueInSpecifiedUnits = 0;
- m_value = 0;
-}
-
-SVGAngleImpl::~SVGAngleImpl()
-{
-}
-
-unsigned short SVGAngleImpl::unitType() const
-{
- return m_unitType;
-}
-
-void SVGAngleImpl::setValue(float value)
-{
- m_value = value;
-}
-
-float SVGAngleImpl::value() const
-{
- return m_value;
-}
-
-// calc m_value
-void SVGAngleImpl::calculate()
-{
- if(m_unitType == SVG_ANGLETYPE_GRAD)
- m_value = m_valueInSpecifiedUnits / deg2grad;
- else if(m_unitType == SVG_ANGLETYPE_RAD)
- m_value = m_valueInSpecifiedUnits / deg2rad;
- else if(m_unitType == SVG_ANGLETYPE_UNSPECIFIED || m_unitType == SVG_ANGLETYPE_DEG)
- m_value = m_valueInSpecifiedUnits;
-}
-
-void SVGAngleImpl::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
-{
- m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- calculate();
-}
-
-float SVGAngleImpl::valueInSpecifiedUnits() const
-{
- return m_valueInSpecifiedUnits;
-}
-
-void SVGAngleImpl::setValueAsString(const DOM::DOMString &valueAsString)
-{
- m_valueAsString = valueAsString;
-
- TQString s = valueAsString.string();
-
- bool bOK;
- m_valueInSpecifiedUnits = s.toFloat(&bOK);
- m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
-
- if(!bOK)
- {
- if(s.endsWith("deg"))
- m_unitType = SVG_ANGLETYPE_DEG;
- else if(s.endsWith("grad"))
- m_unitType = SVG_ANGLETYPE_GRAD;
- else if(s.endsWith("rad"))
- m_unitType = SVG_ANGLETYPE_RAD;
- }
-
- calculate();
-}
-
-DOM::DOMString SVGAngleImpl::valueAsString() const
-{
- m_valueAsString.string().setNum(m_valueInSpecifiedUnits);
-
- switch(m_unitType)
- {
- case SVG_ANGLETYPE_UNSPECIFIED:
- case SVG_ANGLETYPE_DEG:
- m_valueAsString.string() += "deg";
- break;
- case SVG_ANGLETYPE_RAD:
- m_valueAsString.string() += "rad";
- break;
- case SVG_ANGLETYPE_GRAD:
- m_valueAsString.string() += "grad";
- break;
- }
-
- return m_valueAsString;
-}
-
-void SVGAngleImpl::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
-{
- m_unitType = unitType;
- m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- calculate();
-}
-
-void SVGAngleImpl::convertToSpecifiedUnits(unsigned short unitType)
-{
- if(m_unitType == unitType)
- return;
-
- if(m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_RAD)
- m_valueInSpecifiedUnits *= deg2rad;
- else if(m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_RAD)
- m_valueInSpecifiedUnits /= rad2grad;
- else if(m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_GRAD)
- m_valueInSpecifiedUnits *= deg2grad;
- else if(m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_GRAD)
- m_valueInSpecifiedUnits *= rad2grad;
- else if(m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_DEG)
- m_valueInSpecifiedUnits /= deg2rad;
- else if(m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_DEG)
- m_valueInSpecifiedUnits /= deg2grad;
-
- m_unitType = unitType;
-}
-
-// Helpers
-double SVGAngleImpl::todeg(double rad)
-{
- return rad / deg2rad;
-}
-
-double SVGAngleImpl::torad(double deg)
-{
- return deg * deg2rad;
-}
-
-double SVGAngleImpl::shortestArcBisector(double angle1, double angle2)
-{
- double bisector = (angle1 + angle2) / 2;
-
- if(fabs(angle1 - angle2) > 180)
- bisector += 180;
-
- return bisector;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAngleImpl::s_hashTable 5
- value SVGAngleImpl::Value DontDelete
- valueInSpecifiedUnits SVGAngleImpl::ValueInSpecifiedUnits DontDelete
- valueAsString SVGAngleImpl::ValueAsString DontDelete
- unitType SVGAngleImpl::UnitType DontDelete
-@end
-@namespace KSVG
-@begin SVGAngleImplProto::s_hashTable 3
- convertToSpecifiedUnits SVGAngleImpl::ConvertToSpecifiedUnits DontDelete|Function 1
- newValueSpecifiedUnits SVGAngleImpl::NewValueSpecifiedUnits DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGAngle", SVGAngleImplProto, SVGAngleImplProtoFunc)
-
-Value SVGAngleImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Value:
- return Number(value());
- case ValueInSpecifiedUnits:
- return Number(valueInSpecifiedUnits());
- case ValueAsString:
- return String(valueAsString().string());
- case UnitType:
- return Number(unitType());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAngleImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case Value:
- setValue(value.toNumber(exec));
- break;
- case ValueInSpecifiedUnits:
- setValueInSpecifiedUnits(value.toNumber(exec));
- break;
- case ValueAsString:
- setValueAsString(value.toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGAngleImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGAngleImpl)
-
- switch(id)
- {
- case SVGAngleImpl::ConvertToSpecifiedUnits:
- obj->convertToSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)));
- break;
- case SVGAngleImpl::NewValueSpecifiedUnits:
- obj->newValueSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)), args[1].toNumber(exec));
- break;
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-/*
-@namespace KSVG
-@begin SVGAngleImplConstructor::s_hashTable 7
- SVG_ANGLETYPE_UNKNOWN KSVG::SVG_ANGLETYPE_UNKNOWN DontDelete|ReadOnly
- SVG_ANGLETYPE_UNSPECIFIED KSVG::SVG_ANGLETYPE_UNSPECIFIED DontDelete|ReadOnly
- SVG_ANGLETYPE_RAD KSVG::SVG_ANGLETYPE_RAD DontDelete|ReadOnly
- SVG_ANGLETYPE_DEG KSVG::SVG_ANGLETYPE_DEG DontDelete|ReadOnly
- SVG_ANGLETYPE_GRAD KSVG::SVG_ANGLETYPE_GRAD DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAngleImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGAngleImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGAngleImplConstructor>(exec, "[[svgangle.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAngleImpl.cpp b/ksvg/impl/SVGAngleImpl.cpp
new file mode 100644
index 00000000..b69d95e8
--- /dev/null
+++ b/ksvg/impl/SVGAngleImpl.cpp
@@ -0,0 +1,275 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAngle.h"
+
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAngleImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+const double deg2rad = 0.017453292519943295769; // pi/180
+const double deg2grad = 400.0 / 360.0;
+const double rad2grad = deg2grad / deg2rad;
+
+SVGAngleImpl::SVGAngleImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_unitType = SVG_ANGLETYPE_UNKNOWN;
+ m_valueInSpecifiedUnits = 0;
+ m_value = 0;
+}
+
+SVGAngleImpl::~SVGAngleImpl()
+{
+}
+
+unsigned short SVGAngleImpl::unitType() const
+{
+ return m_unitType;
+}
+
+void SVGAngleImpl::setValue(float value)
+{
+ m_value = value;
+}
+
+float SVGAngleImpl::value() const
+{
+ return m_value;
+}
+
+// calc m_value
+void SVGAngleImpl::calculate()
+{
+ if(m_unitType == SVG_ANGLETYPE_GRAD)
+ m_value = m_valueInSpecifiedUnits / deg2grad;
+ else if(m_unitType == SVG_ANGLETYPE_RAD)
+ m_value = m_valueInSpecifiedUnits / deg2rad;
+ else if(m_unitType == SVG_ANGLETYPE_UNSPECIFIED || m_unitType == SVG_ANGLETYPE_DEG)
+ m_value = m_valueInSpecifiedUnits;
+}
+
+void SVGAngleImpl::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
+{
+ m_valueInSpecifiedUnits = valueInSpecifiedUnits;
+ calculate();
+}
+
+float SVGAngleImpl::valueInSpecifiedUnits() const
+{
+ return m_valueInSpecifiedUnits;
+}
+
+void SVGAngleImpl::setValueAsString(const DOM::DOMString &valueAsString)
+{
+ m_valueAsString = valueAsString;
+
+ TQString s = valueAsString.string();
+
+ bool bOK;
+ m_valueInSpecifiedUnits = s.toFloat(&bOK);
+ m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
+
+ if(!bOK)
+ {
+ if(s.endsWith("deg"))
+ m_unitType = SVG_ANGLETYPE_DEG;
+ else if(s.endsWith("grad"))
+ m_unitType = SVG_ANGLETYPE_GRAD;
+ else if(s.endsWith("rad"))
+ m_unitType = SVG_ANGLETYPE_RAD;
+ }
+
+ calculate();
+}
+
+DOM::DOMString SVGAngleImpl::valueAsString() const
+{
+ m_valueAsString.string().setNum(m_valueInSpecifiedUnits);
+
+ switch(m_unitType)
+ {
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_DEG:
+ m_valueAsString.string() += "deg";
+ break;
+ case SVG_ANGLETYPE_RAD:
+ m_valueAsString.string() += "rad";
+ break;
+ case SVG_ANGLETYPE_GRAD:
+ m_valueAsString.string() += "grad";
+ break;
+ }
+
+ return m_valueAsString;
+}
+
+void SVGAngleImpl::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
+{
+ m_unitType = unitType;
+ m_valueInSpecifiedUnits = valueInSpecifiedUnits;
+ calculate();
+}
+
+void SVGAngleImpl::convertToSpecifiedUnits(unsigned short unitType)
+{
+ if(m_unitType == unitType)
+ return;
+
+ if(m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_RAD)
+ m_valueInSpecifiedUnits *= deg2rad;
+ else if(m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_RAD)
+ m_valueInSpecifiedUnits /= rad2grad;
+ else if(m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_GRAD)
+ m_valueInSpecifiedUnits *= deg2grad;
+ else if(m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_GRAD)
+ m_valueInSpecifiedUnits *= rad2grad;
+ else if(m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_DEG)
+ m_valueInSpecifiedUnits /= deg2rad;
+ else if(m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_DEG)
+ m_valueInSpecifiedUnits /= deg2grad;
+
+ m_unitType = unitType;
+}
+
+// Helpers
+double SVGAngleImpl::todeg(double rad)
+{
+ return rad / deg2rad;
+}
+
+double SVGAngleImpl::torad(double deg)
+{
+ return deg * deg2rad;
+}
+
+double SVGAngleImpl::shortestArcBisector(double angle1, double angle2)
+{
+ double bisector = (angle1 + angle2) / 2;
+
+ if(fabs(angle1 - angle2) > 180)
+ bisector += 180;
+
+ return bisector;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAngleImpl::s_hashTable 5
+ value SVGAngleImpl::Value DontDelete
+ valueInSpecifiedUnits SVGAngleImpl::ValueInSpecifiedUnits DontDelete
+ valueAsString SVGAngleImpl::ValueAsString DontDelete
+ unitType SVGAngleImpl::UnitType DontDelete
+@end
+@namespace KSVG
+@begin SVGAngleImplProto::s_hashTable 3
+ convertToSpecifiedUnits SVGAngleImpl::ConvertToSpecifiedUnits DontDelete|Function 1
+ newValueSpecifiedUnits SVGAngleImpl::NewValueSpecifiedUnits DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGAngle", SVGAngleImplProto, SVGAngleImplProtoFunc)
+
+Value SVGAngleImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Value:
+ return Number(value());
+ case ValueInSpecifiedUnits:
+ return Number(valueInSpecifiedUnits());
+ case ValueAsString:
+ return String(valueAsString().string());
+ case UnitType:
+ return Number(unitType());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAngleImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case Value:
+ setValue(value.toNumber(exec));
+ break;
+ case ValueInSpecifiedUnits:
+ setValueInSpecifiedUnits(value.toNumber(exec));
+ break;
+ case ValueAsString:
+ setValueAsString(value.toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGAngleImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGAngleImpl)
+
+ switch(id)
+ {
+ case SVGAngleImpl::ConvertToSpecifiedUnits:
+ obj->convertToSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)));
+ break;
+ case SVGAngleImpl::NewValueSpecifiedUnits:
+ obj->newValueSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)), args[1].toNumber(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+/*
+@namespace KSVG
+@begin SVGAngleImplConstructor::s_hashTable 7
+ SVG_ANGLETYPE_UNKNOWN KSVG::SVG_ANGLETYPE_UNKNOWN DontDelete|ReadOnly
+ SVG_ANGLETYPE_UNSPECIFIED KSVG::SVG_ANGLETYPE_UNSPECIFIED DontDelete|ReadOnly
+ SVG_ANGLETYPE_RAD KSVG::SVG_ANGLETYPE_RAD DontDelete|ReadOnly
+ SVG_ANGLETYPE_DEG KSVG::SVG_ANGLETYPE_DEG DontDelete|ReadOnly
+ SVG_ANGLETYPE_GRAD KSVG::SVG_ANGLETYPE_GRAD DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAngleImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGAngleImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGAngleImplConstructor>(exec, "[[svgangle.constructor]]");
+}
diff --git a/ksvg/impl/SVGAngleImpl.h b/ksvg/impl/SVGAngleImpl.h
index d3c656de..d5c8d60b 100644
--- a/ksvg/impl/SVGAngleImpl.h
+++ b/ksvg/impl/SVGAngleImpl.h
@@ -98,5 +98,3 @@ KSVG_DEFINE_PROTOTYPE(SVGAngleImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGAngleImplProtoFunc, SVGAngleImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateColorElementImpl.cc b/ksvg/impl/SVGAnimateColorElementImpl.cc
deleted file mode 100644
index 55d71e40..00000000
--- a/ksvg/impl/SVGAnimateColorElementImpl.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-
-#include <kdebug.h>
-
-#include "SVGColorImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGStylableImpl.h"
-#include "SVGAnimateColorElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateColorElementImpl::SVGAnimateColorElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
-{
- m_fromColor = new SVGColorImpl(this);
- m_fromColor->ref();
-
- m_toColor = new SVGColorImpl(this);
- m_toColor->ref();
-}
-
-SVGAnimateColorElementImpl::~SVGAnimateColorElementImpl()
-{
- m_fromColor->deref();
- m_toColor->deref();
-}
-
-/*
- * Outstanding issues
- * - 'values' support
- * - 'by' support
- */
-
-void SVGAnimateColorElementImpl::setAttributes()
-{
- SVGAnimationElementImpl::setAttributes();
-
- SVGStylableImpl::setColor(getFrom(), m_fromColor);
- SVGStylableImpl::setColor(getTo(), m_toColor);
-
- ownerDoc()->timeScheduler()->addTimer(this, int(getStartTime() * 1000.0));
-}
-
-void SVGAnimateColorElementImpl::handleTimerEvent()
-{
- if(!m_connected)
- {
- double duration = getSimpleDuration() * 1000.0;
- double dinterval = SVGTimeScheduler::staticTimerInterval;
-
- m_step = 0;
- m_steps = (int) rint(duration / dinterval);
-
- m_connected = true;
- ownerDoc()->timeScheduler()->connectIntervalTimer(this);
- }
- else
- {
- TQColor fromColor(m_fromColor->rgbColor().color());
- TQColor toColor(m_toColor->rgbColor().color());
-
- int red = (int) rint(((toColor.red() - fromColor.red()) / static_cast<double>(m_steps)) * m_step + fromColor.red());
- int green = (int) rint(((toColor.green() - fromColor.green()) / static_cast<double>(m_steps)) * m_step + fromColor.green());
- int blue = (int) rint(((toColor.blue() - fromColor.blue()) / static_cast<double>(m_steps)) * m_step + fromColor.blue());
-
- TQString color = "rgb(" + TQString::number(red) + "," + TQString::number(green) + "," + TQString::number(blue) + ")";
- applyAttribute(getAttributeName(), color);
- }
-
- if(m_step < m_steps)
- m_step++;
- else
- {
- ownerDoc()->timeScheduler()->disconnectIntervalTimer(this);
- m_connected = false;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateColorElementImpl.cpp b/ksvg/impl/SVGAnimateColorElementImpl.cpp
new file mode 100644
index 00000000..0d2f0ff7
--- /dev/null
+++ b/ksvg/impl/SVGAnimateColorElementImpl.cpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+
+#include <kdebug.h>
+
+#include "SVGColorImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGStylableImpl.h"
+#include "SVGAnimateColorElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateColorElementImpl::SVGAnimateColorElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
+{
+ m_fromColor = new SVGColorImpl(this);
+ m_fromColor->ref();
+
+ m_toColor = new SVGColorImpl(this);
+ m_toColor->ref();
+}
+
+SVGAnimateColorElementImpl::~SVGAnimateColorElementImpl()
+{
+ m_fromColor->deref();
+ m_toColor->deref();
+}
+
+/*
+ * Outstanding issues
+ * - 'values' support
+ * - 'by' support
+ */
+
+void SVGAnimateColorElementImpl::setAttributes()
+{
+ SVGAnimationElementImpl::setAttributes();
+
+ SVGStylableImpl::setColor(getFrom(), m_fromColor);
+ SVGStylableImpl::setColor(getTo(), m_toColor);
+
+ ownerDoc()->timeScheduler()->addTimer(this, int(getStartTime() * 1000.0));
+}
+
+void SVGAnimateColorElementImpl::handleTimerEvent()
+{
+ if(!m_connected)
+ {
+ double duration = getSimpleDuration() * 1000.0;
+ double dinterval = SVGTimeScheduler::staticTimerInterval;
+
+ m_step = 0;
+ m_steps = (int) rint(duration / dinterval);
+
+ m_connected = true;
+ ownerDoc()->timeScheduler()->connectIntervalTimer(this);
+ }
+ else
+ {
+ TQColor fromColor(m_fromColor->rgbColor().color());
+ TQColor toColor(m_toColor->rgbColor().color());
+
+ int red = (int) rint(((toColor.red() - fromColor.red()) / static_cast<double>(m_steps)) * m_step + fromColor.red());
+ int green = (int) rint(((toColor.green() - fromColor.green()) / static_cast<double>(m_steps)) * m_step + fromColor.green());
+ int blue = (int) rint(((toColor.blue() - fromColor.blue()) / static_cast<double>(m_steps)) * m_step + fromColor.blue());
+
+ TQString color = "rgb(" + TQString::number(red) + "," + TQString::number(green) + "," + TQString::number(blue) + ")";
+ applyAttribute(getAttributeName(), color);
+ }
+
+ if(m_step < m_steps)
+ m_step++;
+ else
+ {
+ ownerDoc()->timeScheduler()->disconnectIntervalTimer(this);
+ m_connected = false;
+ }
+}
diff --git a/ksvg/impl/SVGAnimateColorElementImpl.h b/ksvg/impl/SVGAnimateColorElementImpl.h
index 5e6fc24d..e83679ab 100644
--- a/ksvg/impl/SVGAnimateColorElementImpl.h
+++ b/ksvg/impl/SVGAnimateColorElementImpl.h
@@ -56,5 +56,3 @@ KSVG_REGISTER_ELEMENT(SVGAnimateColorElementImpl, "animateColor")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateElementImpl.cc b/ksvg/impl/SVGAnimateElementImpl.cc
deleted file mode 100644
index ccf8565d..00000000
--- a/ksvg/impl/SVGAnimateElementImpl.cc
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGDocumentImpl.h"
-#include "SVGAnimateElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateElementImpl::SVGAnimateElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
-{
- m_animVal = 0.0;
- m_addStep = 0.0;
-}
-
-SVGAnimateElementImpl::~SVGAnimateElementImpl()
-{
-}
-
-void SVGAnimateElementImpl::setAttributes()
-{
- SVGAnimationElementImpl::setAttributes();
-
- ownerDoc()->timeScheduler()->addTimer(this, int(getStartTime() * 1000.0));
-}
-
-void SVGAnimateElementImpl::handleTimerEvent()
-{
- if(!m_connected)
- {
- double duration = getSimpleDuration() * 1000.0;
- double dinterval = SVGTimeScheduler::staticTimerInterval;
-
- m_step = 0;
- m_steps = (int) rint(duration / dinterval);
-
- double to = 0, from = 0;
- if(getTo().isEmpty())
- to = targetElement()->getAttribute(getAttributeName()).string().toDouble();
- else
- to = getTo().toDouble();
-
- if(getFrom().isEmpty())
- from = targetElement()->getAttribute(getAttributeName()).string().toDouble();
- else
- from = getFrom().toDouble();
-
- // 'by' support
- if(!getBy().isEmpty())
- {
- m_animVal = from;
- m_addStep = getBy().toDouble() / m_steps;
- }
- else
- {
- m_animVal = from;
- m_addStep = (to - m_animVal) / m_steps;
- }
-
- m_connected = true;
- ownerDoc()->timeScheduler()->connectIntervalTimer(this);
- }
- else
- {
- m_animVal += m_addStep;
- applyAttribute(getAttributeName(), TQString::number(m_animVal));
- }
-
- if(m_step < m_steps)
- m_step++;
- else
- {
- ownerDoc()->timeScheduler()->disconnectIntervalTimer(this);
- m_connected = false;
- if(m_fill == REMOVE)
- applyAttribute(getAttributeName(), targetElement()->getAttribute(getAttributeName()).string());
- }
-
-#if 0
- m_attributeTimer = addTimer(interval() * 1000, false);
-
-
- /*
- m_steps = (getSimpleDuration() * 1000) / SVGAnimationElementImpl::timerTime;
- m_step = 0;
-
- if(m_additive == "sum" && m_times == 1 && !needCombine)
- {
- float add;
-
- SVGLengthImpl *temp = new SVGLengthImpl();
- temp->ref();
- temp->setValueAsString(targetElement()->getAttribute(m_attributeName).string());
- add = temp->value();
- temp->deref();
-
- m_from += add;
- m_newFrom += add;
- m_to += add;
- m_newTo += add;
-
- m_additiveAdded = add;
- }
-
- m_addStep = (m_to - m_from) / m_steps;
- m_attributeTimer = addTimer(SVGAnimationElementImpl::timerTime, false);*/
- }
- else
- {
-/* m_from += m_addStep;
-
- if(m_additive == "replace" && needCombine)
- needCombine = false;
-
- applyAttribute(m_attributeName, TQString::number(m_from), needCombine);
-
- m_step++;
-
- if(m_step == m_steps)
- {
- removeTimer(m_attributeTimer);
-
- if(getRepeatDuration() == "indefinite" || getRepeatCount() == "indefinite")
- {
- m_times++;
- m_firstEvent = true;
-
- if(m_accumulate != "sum")
- {
- m_from = m_newFrom;
- m_to = m_newTo;
- }
- else
- {
- m_from += (m_newFrom - m_additiveAdded) / 2;
- m_to += (m_newTo - m_additiveAdded) / 2;
- }
-
- m_addStep = 0;
- m_attributeTimer = 0;
-
- addTimer(1);
- }
- else if(!getRepeatCount().isEmpty())
- {
- if(m_times <= getRepeatCount().toInt())
- {
- m_times++;
- m_firstEvent = true;
-
- if(m_accumulate != "sum")
- {
- m_from = m_newFrom;
- m_to = m_newTo;
- }
- else
- {
- m_from += (m_newFrom - m_additiveAdded) / 2;
- m_to += (m_newTo - m_additiveAdded) / 2;
- }
-
- m_addStep = 0;
- m_attributeTimer = 0;
-
- addTimer(1);
- }
- }
- }*/
- }
-#endif // 0
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateElementImpl.cpp b/ksvg/impl/SVGAnimateElementImpl.cpp
new file mode 100644
index 00000000..a67a9837
--- /dev/null
+++ b/ksvg/impl/SVGAnimateElementImpl.cpp
@@ -0,0 +1,189 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGDocumentImpl.h"
+#include "SVGAnimateElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateElementImpl::SVGAnimateElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
+{
+ m_animVal = 0.0;
+ m_addStep = 0.0;
+}
+
+SVGAnimateElementImpl::~SVGAnimateElementImpl()
+{
+}
+
+void SVGAnimateElementImpl::setAttributes()
+{
+ SVGAnimationElementImpl::setAttributes();
+
+ ownerDoc()->timeScheduler()->addTimer(this, int(getStartTime() * 1000.0));
+}
+
+void SVGAnimateElementImpl::handleTimerEvent()
+{
+ if(!m_connected)
+ {
+ double duration = getSimpleDuration() * 1000.0;
+ double dinterval = SVGTimeScheduler::staticTimerInterval;
+
+ m_step = 0;
+ m_steps = (int) rint(duration / dinterval);
+
+ double to = 0, from = 0;
+ if(getTo().isEmpty())
+ to = targetElement()->getAttribute(getAttributeName()).string().toDouble();
+ else
+ to = getTo().toDouble();
+
+ if(getFrom().isEmpty())
+ from = targetElement()->getAttribute(getAttributeName()).string().toDouble();
+ else
+ from = getFrom().toDouble();
+
+ // 'by' support
+ if(!getBy().isEmpty())
+ {
+ m_animVal = from;
+ m_addStep = getBy().toDouble() / m_steps;
+ }
+ else
+ {
+ m_animVal = from;
+ m_addStep = (to - m_animVal) / m_steps;
+ }
+
+ m_connected = true;
+ ownerDoc()->timeScheduler()->connectIntervalTimer(this);
+ }
+ else
+ {
+ m_animVal += m_addStep;
+ applyAttribute(getAttributeName(), TQString::number(m_animVal));
+ }
+
+ if(m_step < m_steps)
+ m_step++;
+ else
+ {
+ ownerDoc()->timeScheduler()->disconnectIntervalTimer(this);
+ m_connected = false;
+ if(m_fill == REMOVE)
+ applyAttribute(getAttributeName(), targetElement()->getAttribute(getAttributeName()).string());
+ }
+
+#if 0
+ m_attributeTimer = addTimer(interval() * 1000, false);
+
+
+ /*
+ m_steps = (getSimpleDuration() * 1000) / SVGAnimationElementImpl::timerTime;
+ m_step = 0;
+
+ if(m_additive == "sum" && m_times == 1 && !needCombine)
+ {
+ float add;
+
+ SVGLengthImpl *temp = new SVGLengthImpl();
+ temp->ref();
+ temp->setValueAsString(targetElement()->getAttribute(m_attributeName).string());
+ add = temp->value();
+ temp->deref();
+
+ m_from += add;
+ m_newFrom += add;
+ m_to += add;
+ m_newTo += add;
+
+ m_additiveAdded = add;
+ }
+
+ m_addStep = (m_to - m_from) / m_steps;
+ m_attributeTimer = addTimer(SVGAnimationElementImpl::timerTime, false);*/
+ }
+ else
+ {
+/* m_from += m_addStep;
+
+ if(m_additive == "replace" && needCombine)
+ needCombine = false;
+
+ applyAttribute(m_attributeName, TQString::number(m_from), needCombine);
+
+ m_step++;
+
+ if(m_step == m_steps)
+ {
+ removeTimer(m_attributeTimer);
+
+ if(getRepeatDuration() == "indefinite" || getRepeatCount() == "indefinite")
+ {
+ m_times++;
+ m_firstEvent = true;
+
+ if(m_accumulate != "sum")
+ {
+ m_from = m_newFrom;
+ m_to = m_newTo;
+ }
+ else
+ {
+ m_from += (m_newFrom - m_additiveAdded) / 2;
+ m_to += (m_newTo - m_additiveAdded) / 2;
+ }
+
+ m_addStep = 0;
+ m_attributeTimer = 0;
+
+ addTimer(1);
+ }
+ else if(!getRepeatCount().isEmpty())
+ {
+ if(m_times <= getRepeatCount().toInt())
+ {
+ m_times++;
+ m_firstEvent = true;
+
+ if(m_accumulate != "sum")
+ {
+ m_from = m_newFrom;
+ m_to = m_newTo;
+ }
+ else
+ {
+ m_from += (m_newFrom - m_additiveAdded) / 2;
+ m_to += (m_newTo - m_additiveAdded) / 2;
+ }
+
+ m_addStep = 0;
+ m_attributeTimer = 0;
+
+ addTimer(1);
+ }
+ }
+ }*/
+ }
+#endif // 0
+}
diff --git a/ksvg/impl/SVGAnimateElementImpl.h b/ksvg/impl/SVGAnimateElementImpl.h
index 7418f7b1..2e889b80 100644
--- a/ksvg/impl/SVGAnimateElementImpl.h
+++ b/ksvg/impl/SVGAnimateElementImpl.h
@@ -55,5 +55,3 @@ KSVG_REGISTER_ELEMENT(SVGAnimateElementImpl, "animate")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateMotionElementImpl.cc b/ksvg/impl/SVGAnimateMotionElementImpl.cc
deleted file mode 100644
index fe816769..00000000
--- a/ksvg/impl/SVGAnimateMotionElementImpl.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-// TODO: CLEANUP
-
-#include <dom/dom_doc.h>
-#include "SVGDocumentImpl.h"
-#include "SVGPathElementImpl.h"
-#include "SVGAnimateMotionElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateMotionElementImpl::SVGAnimateMotionElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
-{
-}
-
-SVGAnimateMotionElementImpl::~SVGAnimateMotionElementImpl()
-{
-}
-
-void SVGAnimateMotionElementImpl::setAttributes()
-{
- SVGAnimationElementImpl::setAttributes();
-
-/*
- // TODO: rotate..
-
- DOM::DOMString _path = getAttribute("path");
- if(!_path.isNull())
- {
- if(m_path)
- m_path->deref();
-
- m_path = new SVGPathElementImpl(reinterpret_cast<DOM::ElementImpl *>(static_cast<DOM::Document *>(ownerDoc())->createElement("path").handle()));
- m_path->setOwnerDoc(ownerDoc());
- m_path->setAttribute("d", _path);
- m_path->setAttributes();
- }
-
- addTimer(int(getStartTime() * 1000));*/
-}
-
-//void SVGAnimateMotionElementImpl::prerender(KSVGPainter *p)
-//{
-// SVGAnimationElementImpl::prerender(p);
-
-/* if(!m_pathArray)
- {
- bool temp;
- m_pathArray = m_path->preparePath(&temp, p->worldMatrix());
- }*/
-//}
-
-void SVGAnimateMotionElementImpl::handleTimerEvent(bool /*needCombine*/)
-{
-/* if(m_firstEvent)
- {
- m_firstEvent = false;
-
- m_steps = (int) (getSimpleDuration() * 1000) / interval();
- m_step = 0;
-
- m_motionTimer = addTimer(interval() * 1000, false);
- }
- else
- {
- m_step++;
-
- if(m_step <= m_pathArray->count() - 1)
- {
- TQPoint p = m_pathArray->point(m_step - 50);
- applyAttribute("x", TQString::number(p.x()));
- applyAttribute("y", TQString::number(p.y()));
- kdDebug() << " X " << p.x() << " Y " << p.y() << " (" << m_pathArray->count() << "; " << m_step << ")" <<endl;
- }
-
- if(m_step == m_steps)
- {
- // TODO: repeat
- removeTimer(m_motionTimer);
- }
- }*/
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateMotionElementImpl.cpp b/ksvg/impl/SVGAnimateMotionElementImpl.cpp
new file mode 100644
index 00000000..3de6bab2
--- /dev/null
+++ b/ksvg/impl/SVGAnimateMotionElementImpl.cpp
@@ -0,0 +1,100 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+// TODO: CLEANUP
+
+#include <dom/dom_doc.h>
+#include "SVGDocumentImpl.h"
+#include "SVGPathElementImpl.h"
+#include "SVGAnimateMotionElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateMotionElementImpl::SVGAnimateMotionElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
+{
+}
+
+SVGAnimateMotionElementImpl::~SVGAnimateMotionElementImpl()
+{
+}
+
+void SVGAnimateMotionElementImpl::setAttributes()
+{
+ SVGAnimationElementImpl::setAttributes();
+
+/*
+ // TODO: rotate..
+
+ DOM::DOMString _path = getAttribute("path");
+ if(!_path.isNull())
+ {
+ if(m_path)
+ m_path->deref();
+
+ m_path = new SVGPathElementImpl(reinterpret_cast<DOM::ElementImpl *>(static_cast<DOM::Document *>(ownerDoc())->createElement("path").handle()));
+ m_path->setOwnerDoc(ownerDoc());
+ m_path->setAttribute("d", _path);
+ m_path->setAttributes();
+ }
+
+ addTimer(int(getStartTime() * 1000));*/
+}
+
+//void SVGAnimateMotionElementImpl::prerender(KSVGPainter *p)
+//{
+// SVGAnimationElementImpl::prerender(p);
+
+/* if(!m_pathArray)
+ {
+ bool temp;
+ m_pathArray = m_path->preparePath(&temp, p->worldMatrix());
+ }*/
+//}
+
+void SVGAnimateMotionElementImpl::handleTimerEvent(bool /*needCombine*/)
+{
+/* if(m_firstEvent)
+ {
+ m_firstEvent = false;
+
+ m_steps = (int) (getSimpleDuration() * 1000) / interval();
+ m_step = 0;
+
+ m_motionTimer = addTimer(interval() * 1000, false);
+ }
+ else
+ {
+ m_step++;
+
+ if(m_step <= m_pathArray->count() - 1)
+ {
+ TQPoint p = m_pathArray->point(m_step - 50);
+ applyAttribute("x", TQString::number(p.x()));
+ applyAttribute("y", TQString::number(p.y()));
+ kdDebug() << " X " << p.x() << " Y " << p.y() << " (" << m_pathArray->count() << "; " << m_step << ")" <<endl;
+ }
+
+ if(m_step == m_steps)
+ {
+ // TODO: repeat
+ removeTimer(m_motionTimer);
+ }
+ }*/
+}
diff --git a/ksvg/impl/SVGAnimateMotionElementImpl.h b/ksvg/impl/SVGAnimateMotionElementImpl.h
index fed4c550..1404d39e 100644
--- a/ksvg/impl/SVGAnimateMotionElementImpl.h
+++ b/ksvg/impl/SVGAnimateMotionElementImpl.h
@@ -52,5 +52,3 @@ KSVG_REGISTER_ELEMENT(SVGAnimateMotionElementImpl, "animateMotion")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateTransformElementImpl.cc b/ksvg/impl/SVGAnimateTransformElementImpl.cc
deleted file mode 100644
index cf3922f8..00000000
--- a/ksvg/impl/SVGAnimateTransformElementImpl.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <tqstringlist.h>
-
-#include "SVGLengthImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-#include "SVGAnimateTransformElementImpl.h"
-
-using namespace KSVG;
-
-SVGAnimateTransformElementImpl::SVGAnimateTransformElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
-{
- m_firstEvent = true;
- m_setAttributes = false;
-
- m_rotateX = -1;
- m_rotateY = -1;
- m_times = 1;
- m_from = 0;
- m_to = 0;
-
- m_addStep = 0;
-}
-
-SVGAnimateTransformElementImpl::~SVGAnimateTransformElementImpl()
-{
-}
-
-void SVGAnimateTransformElementImpl::setAttributes()
-{
- if(m_setAttributes)
- return;
-
- m_setAttributes = true;
-
- SVGAnimationElementImpl::setAttributes();
-
- /*
- // TODO: much :)
-
- DOM::DOMString _type = getAttribute("type");
- if(!_type.isNull())
- m_type = _type.string().lower();
-
- DOM::DOMString _from = getAttribute("from");
- if(!_from.isNull())
- {
- if(m_type != "rotate")
- {
- SVGLengthImpl *temp = SVGSVGElementImpl::createSVGLength();
- temp->setValueAsString(_from.string());
-
- m_from = temp->value();
-
- temp->deref();
- }
- else
- {
- SVGTransformListImpl *list = new SVGTransformListImpl();
- list->ref();
-
- SVGHelperImpl::parseTransformAttribute(list, m_type + "(" + _from.string() + ")");
-
- m_from = list->getFirst()->angle();
-
- TQStringList stringList = TQStringList::split(' ', list->getFirst()->toString());
- m_rotateX = stringList[1].toInt();
- m_rotateY = stringList[2].mid(0, stringList[2].length() - 1).toInt();
-
- list->deref();
- }
-
- m_newFrom = m_from;
- m_addStep = m_from;
- }
-
- DOM::DOMString _to = getAttribute("to");
- if(!_to.isNull())
- {
- if(m_type != "rotate")
- {
- SVGLengthImpl *temp = SVGSVGElementImpl::createSVGLength();
- temp->setValueAsString(_to.string());
-
- m_to = temp->value();
-
- temp->deref();
- }
- else
- {
- SVGTransformListImpl *list = new SVGTransformListImpl();
- list->ref();
-
- SVGHelperImpl::parseTransformAttribute(list, m_type + "(" + _to.string() + ")");
-
- m_to = list->getFirst()->angle();
-
- list->deref();
- }
-
- m_newTo = m_to;
- }
-
- // TODO: values + rotate including cx + cy
- DOM::DOMString _values = getAttribute("values");
- if(!_values.isNull())
- {
- TQString test = _values.string();
-
- if(test.contains(";"))
- {
- SVGLengthImpl *temp = SVGSVGElementImpl::createSVGLength();
-
- TQStringList list = TQStringList::split(';', test);
- temp->setValueAsString(list[0]);
- m_from = temp->value();
- temp->setValueAsString(list[1]);
- m_to = temp->value();
-
- m_newFrom = m_from;
- m_newTo = m_to;
- m_addStep = m_from;
-
- temp->deref();
- }
- }
-
- if(getStartTime() != -1)
- addTimer(int(getStartTime() * 1000));
- else
- addTimer(1);
- */
-}
-
-void SVGAnimateTransformElementImpl::handleTimerEvent(bool)
-{ /*
- if(m_firstEvent)
- {
- m_firstEvent = false;
-
- m_steps = (int) (getSimpleDuration() * 1000) / interval();
- m_step = 0;
-
- m_addStep = (m_to - m_from) / m_steps;
-
- m_transformTimer = addTimer(interval() * 1000, false);
- }
- else
- {
- m_from += m_addStep;
-
- SVGTransformImpl *transform = SVGSVGElementImpl::createSVGTransform();
-
- if(m_type == "rotate")
- {
- int x = 0, y = 0;
-
- if(m_rotateX != -1)
- x = m_rotateX;
-
- if(m_rotateY != -1)
- y = m_rotateY;
-
- transform->setRotate(m_from, x, y);
- }
- else if(m_type == "scale")
- transform->setScale(m_from, m_from);
- else if(m_type == "skewx")
- transform->setSkewX(m_from);
- else if(m_type == "skewy")
- transform->setSkewY(m_from);
-
- TQString trans = transform->toString();
- TQString last = trans;
-
- if(targetElement()->hasAttribute("transform"))
- {
- trans += " " + targetElement()->getAttribute("transform").string();
-
- if(!m_lastTransform.isEmpty())
- {
- int pos = trans.find(m_lastTransform);
-
- TQString extract;
- extract += trans.mid(0, pos);
- extract += trans.mid(pos + m_lastTransform.length() + 1, trans.length());
-
- trans = extract;
- }
- }
-
- m_lastTransform = last;
-
- transform->deref();
-
- applyAttribute("transform", trans);
-
- m_step++;
-
- if(m_step == m_steps)
- {
- removeTimer(m_transformTimer);
-
- if(getRepeatDuration() == "indefinite" || getRepeatCount() == "indefinite")
- {
- m_firstEvent = true;
- m_from = m_newFrom;
- m_to = m_newTo;
-
- m_addStep = 0;
- m_transformTimer = 0;
-
- addTimer(1);
- }
- else if(!getRepeatCount().isEmpty())
- {
- if(m_times <= getRepeatCount().toInt())
- {
- m_times++;
- m_firstEvent = true;
- m_from = m_newFrom;
- m_to = m_newTo;
-
- m_addStep = 0;
- m_transformTimer = 0;
-
- addTimer(1);
- }
- }
- }
- }
- */
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimateTransformElementImpl.cpp b/ksvg/impl/SVGAnimateTransformElementImpl.cpp
new file mode 100644
index 00000000..3eae35dd
--- /dev/null
+++ b/ksvg/impl/SVGAnimateTransformElementImpl.cpp
@@ -0,0 +1,255 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <tqstringlist.h>
+
+#include "SVGLengthImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+#include "SVGAnimateTransformElementImpl.h"
+
+using namespace KSVG;
+
+SVGAnimateTransformElementImpl::SVGAnimateTransformElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
+{
+ m_firstEvent = true;
+ m_setAttributes = false;
+
+ m_rotateX = -1;
+ m_rotateY = -1;
+ m_times = 1;
+ m_from = 0;
+ m_to = 0;
+
+ m_addStep = 0;
+}
+
+SVGAnimateTransformElementImpl::~SVGAnimateTransformElementImpl()
+{
+}
+
+void SVGAnimateTransformElementImpl::setAttributes()
+{
+ if(m_setAttributes)
+ return;
+
+ m_setAttributes = true;
+
+ SVGAnimationElementImpl::setAttributes();
+
+ /*
+ // TODO: much :)
+
+ DOM::DOMString _type = getAttribute("type");
+ if(!_type.isNull())
+ m_type = _type.string().lower();
+
+ DOM::DOMString _from = getAttribute("from");
+ if(!_from.isNull())
+ {
+ if(m_type != "rotate")
+ {
+ SVGLengthImpl *temp = SVGSVGElementImpl::createSVGLength();
+ temp->setValueAsString(_from.string());
+
+ m_from = temp->value();
+
+ temp->deref();
+ }
+ else
+ {
+ SVGTransformListImpl *list = new SVGTransformListImpl();
+ list->ref();
+
+ SVGHelperImpl::parseTransformAttribute(list, m_type + "(" + _from.string() + ")");
+
+ m_from = list->getFirst()->angle();
+
+ TQStringList stringList = TQStringList::split(' ', list->getFirst()->toString());
+ m_rotateX = stringList[1].toInt();
+ m_rotateY = stringList[2].mid(0, stringList[2].length() - 1).toInt();
+
+ list->deref();
+ }
+
+ m_newFrom = m_from;
+ m_addStep = m_from;
+ }
+
+ DOM::DOMString _to = getAttribute("to");
+ if(!_to.isNull())
+ {
+ if(m_type != "rotate")
+ {
+ SVGLengthImpl *temp = SVGSVGElementImpl::createSVGLength();
+ temp->setValueAsString(_to.string());
+
+ m_to = temp->value();
+
+ temp->deref();
+ }
+ else
+ {
+ SVGTransformListImpl *list = new SVGTransformListImpl();
+ list->ref();
+
+ SVGHelperImpl::parseTransformAttribute(list, m_type + "(" + _to.string() + ")");
+
+ m_to = list->getFirst()->angle();
+
+ list->deref();
+ }
+
+ m_newTo = m_to;
+ }
+
+ // TODO: values + rotate including cx + cy
+ DOM::DOMString _values = getAttribute("values");
+ if(!_values.isNull())
+ {
+ TQString test = _values.string();
+
+ if(test.contains(";"))
+ {
+ SVGLengthImpl *temp = SVGSVGElementImpl::createSVGLength();
+
+ TQStringList list = TQStringList::split(';', test);
+ temp->setValueAsString(list[0]);
+ m_from = temp->value();
+ temp->setValueAsString(list[1]);
+ m_to = temp->value();
+
+ m_newFrom = m_from;
+ m_newTo = m_to;
+ m_addStep = m_from;
+
+ temp->deref();
+ }
+ }
+
+ if(getStartTime() != -1)
+ addTimer(int(getStartTime() * 1000));
+ else
+ addTimer(1);
+ */
+}
+
+void SVGAnimateTransformElementImpl::handleTimerEvent(bool)
+{ /*
+ if(m_firstEvent)
+ {
+ m_firstEvent = false;
+
+ m_steps = (int) (getSimpleDuration() * 1000) / interval();
+ m_step = 0;
+
+ m_addStep = (m_to - m_from) / m_steps;
+
+ m_transformTimer = addTimer(interval() * 1000, false);
+ }
+ else
+ {
+ m_from += m_addStep;
+
+ SVGTransformImpl *transform = SVGSVGElementImpl::createSVGTransform();
+
+ if(m_type == "rotate")
+ {
+ int x = 0, y = 0;
+
+ if(m_rotateX != -1)
+ x = m_rotateX;
+
+ if(m_rotateY != -1)
+ y = m_rotateY;
+
+ transform->setRotate(m_from, x, y);
+ }
+ else if(m_type == "scale")
+ transform->setScale(m_from, m_from);
+ else if(m_type == "skewx")
+ transform->setSkewX(m_from);
+ else if(m_type == "skewy")
+ transform->setSkewY(m_from);
+
+ TQString trans = transform->toString();
+ TQString last = trans;
+
+ if(targetElement()->hasAttribute("transform"))
+ {
+ trans += " " + targetElement()->getAttribute("transform").string();
+
+ if(!m_lastTransform.isEmpty())
+ {
+ int pos = trans.find(m_lastTransform);
+
+ TQString extract;
+ extract += trans.mid(0, pos);
+ extract += trans.mid(pos + m_lastTransform.length() + 1, trans.length());
+
+ trans = extract;
+ }
+ }
+
+ m_lastTransform = last;
+
+ transform->deref();
+
+ applyAttribute("transform", trans);
+
+ m_step++;
+
+ if(m_step == m_steps)
+ {
+ removeTimer(m_transformTimer);
+
+ if(getRepeatDuration() == "indefinite" || getRepeatCount() == "indefinite")
+ {
+ m_firstEvent = true;
+ m_from = m_newFrom;
+ m_to = m_newTo;
+
+ m_addStep = 0;
+ m_transformTimer = 0;
+
+ addTimer(1);
+ }
+ else if(!getRepeatCount().isEmpty())
+ {
+ if(m_times <= getRepeatCount().toInt())
+ {
+ m_times++;
+ m_firstEvent = true;
+ m_from = m_newFrom;
+ m_to = m_newTo;
+
+ m_addStep = 0;
+ m_transformTimer = 0;
+
+ addTimer(1);
+ }
+ }
+ }
+ }
+ */
+}
diff --git a/ksvg/impl/SVGAnimateTransformElementImpl.h b/ksvg/impl/SVGAnimateTransformElementImpl.h
index ddd73989..e0d6d1a2 100644
--- a/ksvg/impl/SVGAnimateTransformElementImpl.h
+++ b/ksvg/impl/SVGAnimateTransformElementImpl.h
@@ -70,5 +70,3 @@ KSVG_REGISTER_ELEMENT(SVGAnimateTransformElementImpl, "animateTransform")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedAngleImpl.cc b/ksvg/impl/SVGAnimatedAngleImpl.cc
deleted file mode 100644
index 63f0c000..00000000
--- a/ksvg/impl/SVGAnimatedAngleImpl.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAngleImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedAngleImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedAngleImpl::SVGAnimatedAngleImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_baseVal = SVGSVGElementImpl::createSVGAngle();
- m_animVal = SVGSVGElementImpl::createSVGAngle();
-}
-
-SVGAnimatedAngleImpl::~SVGAnimatedAngleImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGAngleImpl *SVGAnimatedAngleImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGAngleImpl *SVGAnimatedAngleImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedAngleImpl::s_hashTable 3
- baseVal SVGAnimatedAngleImpl::BaseVal DontDelete|ReadOnly
- animVal SVGAnimatedAngleImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedAngleImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedAngleImpl.cpp b/ksvg/impl/SVGAnimatedAngleImpl.cpp
new file mode 100644
index 00000000..41429847
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedAngleImpl.cpp
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAngleImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedAngleImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedAngleImpl::SVGAnimatedAngleImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_baseVal = SVGSVGElementImpl::createSVGAngle();
+ m_animVal = SVGSVGElementImpl::createSVGAngle();
+}
+
+SVGAnimatedAngleImpl::~SVGAnimatedAngleImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGAngleImpl *SVGAnimatedAngleImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGAngleImpl *SVGAnimatedAngleImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedAngleImpl::s_hashTable 3
+ baseVal SVGAnimatedAngleImpl::BaseVal DontDelete|ReadOnly
+ animVal SVGAnimatedAngleImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedAngleImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedAngleImpl.h b/ksvg/impl/SVGAnimatedAngleImpl.h
index f6617ce6..05304340 100644
--- a/ksvg/impl/SVGAnimatedAngleImpl.h
+++ b/ksvg/impl/SVGAnimatedAngleImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedBooleanImpl.cc b/ksvg/impl/SVGAnimatedBooleanImpl.cc
deleted file mode 100644
index d30fa5ef..00000000
--- a/ksvg/impl/SVGAnimatedBooleanImpl.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedBooleanImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedBooleanImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedBooleanImpl::SVGAnimatedBooleanImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_baseVal = false;
- m_animVal = false;
-}
-
-SVGAnimatedBooleanImpl::~SVGAnimatedBooleanImpl()
-{
-}
-
-void SVGAnimatedBooleanImpl::setBaseVal(bool baseVal)
-{
- m_baseVal = baseVal;
-}
-
-bool SVGAnimatedBooleanImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-bool SVGAnimatedBooleanImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedBooleanImpl::s_hashTable 3
- baseVal SVGAnimatedBooleanImpl::BaseVal DontDelete
- animVal SVGAnimatedBooleanImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedBooleanImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return Number(baseVal());
- case AnimVal:
- return Number(animVal());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAnimatedBooleanImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case BaseVal:
- setBaseVal(value.toBoolean(exec));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedBooleanImpl.cpp b/ksvg/impl/SVGAnimatedBooleanImpl.cpp
new file mode 100644
index 00000000..f60b6a04
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedBooleanImpl.cpp
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedBooleanImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedBooleanImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedBooleanImpl::SVGAnimatedBooleanImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_baseVal = false;
+ m_animVal = false;
+}
+
+SVGAnimatedBooleanImpl::~SVGAnimatedBooleanImpl()
+{
+}
+
+void SVGAnimatedBooleanImpl::setBaseVal(bool baseVal)
+{
+ m_baseVal = baseVal;
+}
+
+bool SVGAnimatedBooleanImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+bool SVGAnimatedBooleanImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedBooleanImpl::s_hashTable 3
+ baseVal SVGAnimatedBooleanImpl::BaseVal DontDelete
+ animVal SVGAnimatedBooleanImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedBooleanImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return Number(baseVal());
+ case AnimVal:
+ return Number(animVal());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAnimatedBooleanImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case BaseVal:
+ setBaseVal(value.toBoolean(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedBooleanImpl.h b/ksvg/impl/SVGAnimatedBooleanImpl.h
index 9e31792e..1c1b64e4 100644
--- a/ksvg/impl/SVGAnimatedBooleanImpl.h
+++ b/ksvg/impl/SVGAnimatedBooleanImpl.h
@@ -60,5 +60,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedEnumerationImpl.cc b/ksvg/impl/SVGAnimatedEnumerationImpl.cc
deleted file mode 100644
index f619f231..00000000
--- a/ksvg/impl/SVGAnimatedEnumerationImpl.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedEnumerationImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedEnumerationImpl::SVGAnimatedEnumerationImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_baseVal = 0;
- m_animVal = 0;
-}
-
-SVGAnimatedEnumerationImpl::~SVGAnimatedEnumerationImpl()
-{
-}
-
-void SVGAnimatedEnumerationImpl::setBaseVal(unsigned short baseVal)
-{
- m_baseVal = baseVal;
-}
-
-unsigned short SVGAnimatedEnumerationImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-unsigned short SVGAnimatedEnumerationImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedEnumerationImpl::s_hashTable 3
- baseVal SVGAnimatedEnumerationImpl::BaseVal DontDelete
- animVal SVGAnimatedEnumerationImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedEnumerationImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return Number(baseVal());
- case AnimVal:
- return Number(animVal());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAnimatedEnumerationImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case BaseVal:
- setBaseVal(static_cast<unsigned short>(value.toNumber(exec)));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedEnumerationImpl.cpp b/ksvg/impl/SVGAnimatedEnumerationImpl.cpp
new file mode 100644
index 00000000..11e769ba
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedEnumerationImpl.cpp
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedEnumerationImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedEnumerationImpl::SVGAnimatedEnumerationImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_baseVal = 0;
+ m_animVal = 0;
+}
+
+SVGAnimatedEnumerationImpl::~SVGAnimatedEnumerationImpl()
+{
+}
+
+void SVGAnimatedEnumerationImpl::setBaseVal(unsigned short baseVal)
+{
+ m_baseVal = baseVal;
+}
+
+unsigned short SVGAnimatedEnumerationImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+unsigned short SVGAnimatedEnumerationImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedEnumerationImpl::s_hashTable 3
+ baseVal SVGAnimatedEnumerationImpl::BaseVal DontDelete
+ animVal SVGAnimatedEnumerationImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedEnumerationImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return Number(baseVal());
+ case AnimVal:
+ return Number(animVal());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAnimatedEnumerationImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case BaseVal:
+ setBaseVal(static_cast<unsigned short>(value.toNumber(exec)));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedEnumerationImpl.h b/ksvg/impl/SVGAnimatedEnumerationImpl.h
index ae4638f4..40db1c53 100644
--- a/ksvg/impl/SVGAnimatedEnumerationImpl.h
+++ b/ksvg/impl/SVGAnimatedEnumerationImpl.h
@@ -60,5 +60,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedIntegerImpl.cc b/ksvg/impl/SVGAnimatedIntegerImpl.cc
deleted file mode 100644
index 8bf08a87..00000000
--- a/ksvg/impl/SVGAnimatedIntegerImpl.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedIntegerImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedIntegerImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedIntegerImpl::SVGAnimatedIntegerImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_baseVal = 0;
- m_animVal = 0;
-}
-
-SVGAnimatedIntegerImpl::~SVGAnimatedIntegerImpl()
-{
-}
-
-void SVGAnimatedIntegerImpl::setBaseVal(long baseVal)
-{
- m_baseVal = baseVal;
-}
-
-long SVGAnimatedIntegerImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-long SVGAnimatedIntegerImpl::animVal() const
-{
- return m_animVal;
-}
-
-/*
-@namespace KSVG
-@begin SVGAnimatedIntegerImpl::s_hashTable 3
- baseVal SVGAnimatedIntegerImpl::BaseVal DontDelete
- animVal SVGAnimatedIntegerImpl::AnimVal DontDelete
-@end
-*/
-
-Value SVGAnimatedIntegerImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return Number(baseVal());
- case AnimVal:
- return Number(animVal());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
- return KJS::Undefined();
-}
-
-void SVGAnimatedIntegerImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case BaseVal:
- setBaseVal(value.toInteger(exec));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedIntegerImpl.cpp b/ksvg/impl/SVGAnimatedIntegerImpl.cpp
new file mode 100644
index 00000000..00999e0e
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedIntegerImpl.cpp
@@ -0,0 +1,89 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedIntegerImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedIntegerImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedIntegerImpl::SVGAnimatedIntegerImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_baseVal = 0;
+ m_animVal = 0;
+}
+
+SVGAnimatedIntegerImpl::~SVGAnimatedIntegerImpl()
+{
+}
+
+void SVGAnimatedIntegerImpl::setBaseVal(long baseVal)
+{
+ m_baseVal = baseVal;
+}
+
+long SVGAnimatedIntegerImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+long SVGAnimatedIntegerImpl::animVal() const
+{
+ return m_animVal;
+}
+
+/*
+@namespace KSVG
+@begin SVGAnimatedIntegerImpl::s_hashTable 3
+ baseVal SVGAnimatedIntegerImpl::BaseVal DontDelete
+ animVal SVGAnimatedIntegerImpl::AnimVal DontDelete
+@end
+*/
+
+Value SVGAnimatedIntegerImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return Number(baseVal());
+ case AnimVal:
+ return Number(animVal());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+ return KJS::Undefined();
+}
+
+void SVGAnimatedIntegerImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case BaseVal:
+ setBaseVal(value.toInteger(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedIntegerImpl.h b/ksvg/impl/SVGAnimatedIntegerImpl.h
index 8ad7ad88..d47c2a5b 100644
--- a/ksvg/impl/SVGAnimatedIntegerImpl.h
+++ b/ksvg/impl/SVGAnimatedIntegerImpl.h
@@ -60,5 +60,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedLengthImpl.cc b/ksvg/impl/SVGAnimatedLengthImpl.cc
deleted file mode 100644
index 25176965..00000000
--- a/ksvg/impl/SVGAnimatedLengthImpl.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedLengthImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedLengthImpl::SVGAnimatedLengthImpl(LengthMode mode, SVGElementImpl *object) : DOM::DomShared()
-{
- m_baseVal = new SVGLengthImpl(mode, object);
- m_baseVal->ref();
-
- m_animVal = new SVGLengthImpl(mode, object);
- m_animVal->ref();
-}
-
-SVGAnimatedLengthImpl::SVGAnimatedLengthImpl(const SVGAnimatedLengthImpl &other) : DOM::DomShared()
-{
- (*this) = other;
-}
-
-SVGAnimatedLengthImpl::~SVGAnimatedLengthImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGAnimatedLengthImpl &SVGAnimatedLengthImpl::operator=(const SVGAnimatedLengthImpl &other)
-{
- *m_baseVal = *(other.m_baseVal);
- *m_animVal = *(other.m_animVal);
-
- return *this;
-}
-
-SVGLengthImpl *SVGAnimatedLengthImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGLengthImpl *SVGAnimatedLengthImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedLengthImpl::s_hashTable 3
- baseVal SVGAnimatedLengthImpl::BaseVal DontDelete|ReadOnly
- animVal SVGAnimatedLengthImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedLengthImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedLengthImpl.cpp b/ksvg/impl/SVGAnimatedLengthImpl.cpp
new file mode 100644
index 00000000..1dead454
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedLengthImpl.cpp
@@ -0,0 +1,94 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedLengthImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedLengthImpl::SVGAnimatedLengthImpl(LengthMode mode, SVGElementImpl *object) : DOM::DomShared()
+{
+ m_baseVal = new SVGLengthImpl(mode, object);
+ m_baseVal->ref();
+
+ m_animVal = new SVGLengthImpl(mode, object);
+ m_animVal->ref();
+}
+
+SVGAnimatedLengthImpl::SVGAnimatedLengthImpl(const SVGAnimatedLengthImpl &other) : DOM::DomShared()
+{
+ (*this) = other;
+}
+
+SVGAnimatedLengthImpl::~SVGAnimatedLengthImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGAnimatedLengthImpl &SVGAnimatedLengthImpl::operator=(const SVGAnimatedLengthImpl &other)
+{
+ *m_baseVal = *(other.m_baseVal);
+ *m_animVal = *(other.m_animVal);
+
+ return *this;
+}
+
+SVGLengthImpl *SVGAnimatedLengthImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGLengthImpl *SVGAnimatedLengthImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedLengthImpl::s_hashTable 3
+ baseVal SVGAnimatedLengthImpl::BaseVal DontDelete|ReadOnly
+ animVal SVGAnimatedLengthImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedLengthImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedLengthImpl.h b/ksvg/impl/SVGAnimatedLengthImpl.h
index 80f473db..a553229d 100644
--- a/ksvg/impl/SVGAnimatedLengthImpl.h
+++ b/ksvg/impl/SVGAnimatedLengthImpl.h
@@ -61,5 +61,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedLengthListImpl.cc b/ksvg/impl/SVGAnimatedLengthListImpl.cc
deleted file mode 100644
index 296fa1ea..00000000
--- a/ksvg/impl/SVGAnimatedLengthListImpl.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedLengthListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedLengthListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedLengthListImpl::SVGAnimatedLengthListImpl() : DOM::DomShared()
-{
- m_baseVal = new SVGLengthListImpl();
- m_baseVal->ref();
-
- m_animVal = new SVGLengthListImpl();
- m_animVal->ref();
-}
-
-SVGAnimatedLengthListImpl::SVGAnimatedLengthListImpl(const SVGAnimatedLengthListImpl &other) : DOM::DomShared()
-{
- (*this) = other;
-}
-
-SVGAnimatedLengthListImpl::~SVGAnimatedLengthListImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGAnimatedLengthListImpl &SVGAnimatedLengthListImpl::operator=(const SVGAnimatedLengthListImpl &other)
-{
- *m_baseVal = *(other.m_baseVal);
- *m_animVal = *(other.m_animVal);
-
- return *this;
-}
-
-SVGLengthListImpl *SVGAnimatedLengthListImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGLengthListImpl *SVGAnimatedLengthListImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedLengthListImpl::s_hashTable 3
- baseVal SVGAnimatedLengthListImpl::BaseVal DontDelete|ReadOnly
- animVal SVGAnimatedLengthListImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedLengthListImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedLengthListImpl.cpp b/ksvg/impl/SVGAnimatedLengthListImpl.cpp
new file mode 100644
index 00000000..cd603f27
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedLengthListImpl.cpp
@@ -0,0 +1,93 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedLengthListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedLengthListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedLengthListImpl::SVGAnimatedLengthListImpl() : DOM::DomShared()
+{
+ m_baseVal = new SVGLengthListImpl();
+ m_baseVal->ref();
+
+ m_animVal = new SVGLengthListImpl();
+ m_animVal->ref();
+}
+
+SVGAnimatedLengthListImpl::SVGAnimatedLengthListImpl(const SVGAnimatedLengthListImpl &other) : DOM::DomShared()
+{
+ (*this) = other;
+}
+
+SVGAnimatedLengthListImpl::~SVGAnimatedLengthListImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGAnimatedLengthListImpl &SVGAnimatedLengthListImpl::operator=(const SVGAnimatedLengthListImpl &other)
+{
+ *m_baseVal = *(other.m_baseVal);
+ *m_animVal = *(other.m_animVal);
+
+ return *this;
+}
+
+SVGLengthListImpl *SVGAnimatedLengthListImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGLengthListImpl *SVGAnimatedLengthListImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedLengthListImpl::s_hashTable 3
+ baseVal SVGAnimatedLengthListImpl::BaseVal DontDelete|ReadOnly
+ animVal SVGAnimatedLengthListImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedLengthListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedNumberImpl.cc b/ksvg/impl/SVGAnimatedNumberImpl.cc
deleted file mode 100644
index 2937c233..00000000
--- a/ksvg/impl/SVGAnimatedNumberImpl.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedNumberImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedNumberImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedNumberImpl::SVGAnimatedNumberImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_baseVal = 0;
- m_animVal = 0;
-}
-
-SVGAnimatedNumberImpl::~SVGAnimatedNumberImpl()
-{
-}
-
-void SVGAnimatedNumberImpl::setBaseVal(float baseVal)
-{
- m_baseVal = baseVal;
-}
-
-float SVGAnimatedNumberImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-float SVGAnimatedNumberImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedNumberImpl::s_hashTable 3
- baseVal SVGAnimatedNumberImpl::BaseVal DontDelete
- animVal SVGAnimatedNumberImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedNumberImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return Number(baseVal());
- case AnimVal:
- return Number(animVal());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-
- return Undefined();
-}
-
-void SVGAnimatedNumberImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case BaseVal:
- setBaseVal(value.toNumber(exec));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedNumberImpl.cpp b/ksvg/impl/SVGAnimatedNumberImpl.cpp
new file mode 100644
index 00000000..890d1895
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedNumberImpl.cpp
@@ -0,0 +1,92 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedNumberImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedNumberImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedNumberImpl::SVGAnimatedNumberImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_baseVal = 0;
+ m_animVal = 0;
+}
+
+SVGAnimatedNumberImpl::~SVGAnimatedNumberImpl()
+{
+}
+
+void SVGAnimatedNumberImpl::setBaseVal(float baseVal)
+{
+ m_baseVal = baseVal;
+}
+
+float SVGAnimatedNumberImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+float SVGAnimatedNumberImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedNumberImpl::s_hashTable 3
+ baseVal SVGAnimatedNumberImpl::BaseVal DontDelete
+ animVal SVGAnimatedNumberImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedNumberImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return Number(baseVal());
+ case AnimVal:
+ return Number(animVal());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+
+ return Undefined();
+}
+
+void SVGAnimatedNumberImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case BaseVal:
+ setBaseVal(value.toNumber(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedNumberImpl.h b/ksvg/impl/SVGAnimatedNumberImpl.h
index 81c9217b..a4d672b7 100644
--- a/ksvg/impl/SVGAnimatedNumberImpl.h
+++ b/ksvg/impl/SVGAnimatedNumberImpl.h
@@ -60,4 +60,3 @@ public:
}
#endif
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedNumberListImpl.cc b/ksvg/impl/SVGAnimatedNumberListImpl.cc
deleted file mode 100644
index d6ff44e0..00000000
--- a/ksvg/impl/SVGAnimatedNumberListImpl.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedNumberListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedNumberListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedNumberListImpl::SVGAnimatedNumberListImpl() : DOM::DomShared()
-{
- m_baseVal = new SVGNumberListImpl();
- m_baseVal->ref();
-
- m_animVal = new SVGNumberListImpl();
- m_animVal->ref();
-}
-
-SVGAnimatedNumberListImpl::~SVGAnimatedNumberListImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGNumberListImpl *SVGAnimatedNumberListImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGNumberListImpl *SVGAnimatedNumberListImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedNumberListImpl::s_hashTable 3
- baseVal SVGAnimatedNumberListImpl::BaseVal DontDelete|ReadOnly
- animVal SVGAnimatedNumberListImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedNumberListImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedNumberListImpl.cpp b/ksvg/impl/SVGAnimatedNumberListImpl.cpp
new file mode 100644
index 00000000..b04b31c0
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedNumberListImpl.cpp
@@ -0,0 +1,80 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedNumberListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedNumberListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedNumberListImpl::SVGAnimatedNumberListImpl() : DOM::DomShared()
+{
+ m_baseVal = new SVGNumberListImpl();
+ m_baseVal->ref();
+
+ m_animVal = new SVGNumberListImpl();
+ m_animVal->ref();
+}
+
+SVGAnimatedNumberListImpl::~SVGAnimatedNumberListImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGNumberListImpl *SVGAnimatedNumberListImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGNumberListImpl *SVGAnimatedNumberListImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedNumberListImpl::s_hashTable 3
+ baseVal SVGAnimatedNumberListImpl::BaseVal DontDelete|ReadOnly
+ animVal SVGAnimatedNumberListImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedNumberListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedPathDataImpl.cc b/ksvg/impl/SVGAnimatedPathDataImpl.cc
deleted file mode 100644
index 2b9ebf4c..00000000
--- a/ksvg/impl/SVGAnimatedPathDataImpl.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegListImpl.h"
-#include "SVGAnimatedPathDataImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedPathDataImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedPathDataImpl::SVGAnimatedPathDataImpl() : DOM::DomShared()
-{
- m_pathSegList = new SVGPathSegListImpl();
- m_pathSegList->ref();
-
- m_normalizedPathSegList = new SVGPathSegListImpl();
- m_normalizedPathSegList->ref();
-
- m_animatedPathSegList = new SVGPathSegListImpl();
- m_animatedPathSegList->ref();
-
- m_animatedNormalizedPathSegList = new SVGPathSegListImpl();
- m_animatedNormalizedPathSegList->ref();
-}
-
-SVGAnimatedPathDataImpl::~SVGAnimatedPathDataImpl()
-{
- if(m_pathSegList)
- m_pathSegList->deref();
- if(m_normalizedPathSegList)
- m_normalizedPathSegList->deref();
- if(m_animatedPathSegList)
- m_animatedPathSegList->deref();
- if(m_animatedNormalizedPathSegList)
- m_animatedNormalizedPathSegList->deref();
-}
-
-SVGPathSegListImpl *SVGAnimatedPathDataImpl::pathSegList() const
-{
- return m_pathSegList;
-}
-
-SVGPathSegListImpl *SVGAnimatedPathDataImpl::normalizedPathSegList() const
-{
- return m_normalizedPathSegList;
-}
-
-SVGPathSegListImpl *SVGAnimatedPathDataImpl::animatedPathSegList() const
-{
- return m_animatedPathSegList;
-}
-
-SVGPathSegListImpl *SVGAnimatedPathDataImpl::animatedNormalizedPathSegList() const
-{
- return m_animatedNormalizedPathSegList;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedPathDataImpl::s_hashTable 5
- pathSegList SVGAnimatedPathDataImpl::PathSegList DontDelete|ReadOnly
- normalizedPathSegList SVGAnimatedPathDataImpl::NormalizedPathSegList DontDelete|ReadOnly
- animatedPathSegList SVGAnimatedPathDataImpl::AnimatedPathSegList DontDelete|ReadOnly
- animatedNormalizedPathSegList SVGAnimatedPathDataImpl::AnimatedNormalizedPathSegList DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedPathDataImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case PathSegList:
- return pathSegList()->cache(exec);
- case NormalizedPathSegList:
- return normalizedPathSegList()->cache(exec);
- case AnimatedPathSegList:
- return animatedPathSegList()->cache(exec);
- case AnimatedNormalizedPathSegList:
- return animatedNormalizedPathSegList()->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
-}
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedPathDataImpl.cpp b/ksvg/impl/SVGAnimatedPathDataImpl.cpp
new file mode 100644
index 00000000..d0d7faae
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedPathDataImpl.cpp
@@ -0,0 +1,106 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegListImpl.h"
+#include "SVGAnimatedPathDataImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedPathDataImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedPathDataImpl::SVGAnimatedPathDataImpl() : DOM::DomShared()
+{
+ m_pathSegList = new SVGPathSegListImpl();
+ m_pathSegList->ref();
+
+ m_normalizedPathSegList = new SVGPathSegListImpl();
+ m_normalizedPathSegList->ref();
+
+ m_animatedPathSegList = new SVGPathSegListImpl();
+ m_animatedPathSegList->ref();
+
+ m_animatedNormalizedPathSegList = new SVGPathSegListImpl();
+ m_animatedNormalizedPathSegList->ref();
+}
+
+SVGAnimatedPathDataImpl::~SVGAnimatedPathDataImpl()
+{
+ if(m_pathSegList)
+ m_pathSegList->deref();
+ if(m_normalizedPathSegList)
+ m_normalizedPathSegList->deref();
+ if(m_animatedPathSegList)
+ m_animatedPathSegList->deref();
+ if(m_animatedNormalizedPathSegList)
+ m_animatedNormalizedPathSegList->deref();
+}
+
+SVGPathSegListImpl *SVGAnimatedPathDataImpl::pathSegList() const
+{
+ return m_pathSegList;
+}
+
+SVGPathSegListImpl *SVGAnimatedPathDataImpl::normalizedPathSegList() const
+{
+ return m_normalizedPathSegList;
+}
+
+SVGPathSegListImpl *SVGAnimatedPathDataImpl::animatedPathSegList() const
+{
+ return m_animatedPathSegList;
+}
+
+SVGPathSegListImpl *SVGAnimatedPathDataImpl::animatedNormalizedPathSegList() const
+{
+ return m_animatedNormalizedPathSegList;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedPathDataImpl::s_hashTable 5
+ pathSegList SVGAnimatedPathDataImpl::PathSegList DontDelete|ReadOnly
+ normalizedPathSegList SVGAnimatedPathDataImpl::NormalizedPathSegList DontDelete|ReadOnly
+ animatedPathSegList SVGAnimatedPathDataImpl::AnimatedPathSegList DontDelete|ReadOnly
+ animatedNormalizedPathSegList SVGAnimatedPathDataImpl::AnimatedNormalizedPathSegList DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedPathDataImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case PathSegList:
+ return pathSegList()->cache(exec);
+ case NormalizedPathSegList:
+ return normalizedPathSegList()->cache(exec);
+ case AnimatedPathSegList:
+ return animatedPathSegList()->cache(exec);
+ case AnimatedNormalizedPathSegList:
+ return animatedNormalizedPathSegList()->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+}
+}
diff --git a/ksvg/impl/SVGAnimatedPathDataImpl.h b/ksvg/impl/SVGAnimatedPathDataImpl.h
index 2af1f893..5a01b68b 100644
--- a/ksvg/impl/SVGAnimatedPathDataImpl.h
+++ b/ksvg/impl/SVGAnimatedPathDataImpl.h
@@ -63,5 +63,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedPointsImpl.cc b/ksvg/impl/SVGAnimatedPointsImpl.cc
deleted file mode 100644
index 852d90e0..00000000
--- a/ksvg/impl/SVGAnimatedPointsImpl.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqstringlist.h>
-
-#include "CanvasItem.h"
-#include "SVGPointListImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedPointsImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedPointsImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGAnimatedPointsImpl::SVGAnimatedPointsImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_points = new SVGPointListImpl();
- m_points->ref();
-
- m_animatedPoints = new SVGPointListImpl();
- m_animatedPoints->ref();
-}
-
-SVGAnimatedPointsImpl::~SVGAnimatedPointsImpl()
-{
- if(m_points)
- m_points->deref();
- if(m_animatedPoints)
- m_animatedPoints->deref();
-}
-
-SVGPointListImpl *SVGAnimatedPointsImpl::points() const
-{
- return m_points;
-}
-
-SVGPointListImpl *SVGAnimatedPointsImpl::animatedPoints() const
-{
- return m_animatedPoints;
-}
-
-void SVGAnimatedPointsImpl::parsePoints(TQString _points, SVGPointListImpl *points)
-{
- if(_points.isEmpty())
- return;
-
- _points = _points.simplifyWhiteSpace();
-
- if(_points.contains(",,") || _points.contains(", ,"))
- return;
-
- _points.replace(',', ' ');
- _points.replace('\r', TQString());
- _points.replace('\n', TQString());
-
- _points = _points.simplifyWhiteSpace();
-
- TQStringList pointList = TQStringList::split(' ', _points);
- for(TQStringList::Iterator it = pointList.begin(); it != pointList.end(); it++)
- {
- SVGPointImpl *point = SVGSVGElementImpl::createSVGPoint();
- point->setX((*(it++)).toFloat());
- point->setY((*it).toFloat());
-
- points->appendItem(point);
- }
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedPointsImpl::s_hashTable 3
- points SVGAnimatedPointsImpl::Points DontDelete|ReadOnly
- animatedPoints SVGAnimatedPointsImpl::AnimatedPoints DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedPointsImpl::getValueProperty(ExecState *exec, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Points: // TODO: We need a pointList->toText function, quite trivial
-// if(!attributeMode)
- return points()->cache(exec);
- case AnimatedPoints:
- return animatedPoints()->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAnimatedPointsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Points:
- parsePoints(value.toString(exec).qstring(), m_points);
- break;
- case AnimatedPoints:
- parsePoints(value.toString(exec).qstring(), m_animatedPoints);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedPointsImpl.cpp b/ksvg/impl/SVGAnimatedPointsImpl.cpp
new file mode 100644
index 00000000..22246286
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedPointsImpl.cpp
@@ -0,0 +1,137 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqstringlist.h>
+
+#include "CanvasItem.h"
+#include "SVGPointListImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedPointsImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedPointsImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGAnimatedPointsImpl::SVGAnimatedPointsImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_points = new SVGPointListImpl();
+ m_points->ref();
+
+ m_animatedPoints = new SVGPointListImpl();
+ m_animatedPoints->ref();
+}
+
+SVGAnimatedPointsImpl::~SVGAnimatedPointsImpl()
+{
+ if(m_points)
+ m_points->deref();
+ if(m_animatedPoints)
+ m_animatedPoints->deref();
+}
+
+SVGPointListImpl *SVGAnimatedPointsImpl::points() const
+{
+ return m_points;
+}
+
+SVGPointListImpl *SVGAnimatedPointsImpl::animatedPoints() const
+{
+ return m_animatedPoints;
+}
+
+void SVGAnimatedPointsImpl::parsePoints(TQString _points, SVGPointListImpl *points)
+{
+ if(_points.isEmpty())
+ return;
+
+ _points = _points.simplifyWhiteSpace();
+
+ if(_points.contains(",,") || _points.contains(", ,"))
+ return;
+
+ _points.replace(',', ' ');
+ _points.replace('\r', TQString());
+ _points.replace('\n', TQString());
+
+ _points = _points.simplifyWhiteSpace();
+
+ TQStringList pointList = TQStringList::split(' ', _points);
+ for(TQStringList::Iterator it = pointList.begin(); it != pointList.end(); it++)
+ {
+ SVGPointImpl *point = SVGSVGElementImpl::createSVGPoint();
+ point->setX((*(it++)).toFloat());
+ point->setY((*it).toFloat());
+
+ points->appendItem(point);
+ }
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedPointsImpl::s_hashTable 3
+ points SVGAnimatedPointsImpl::Points DontDelete|ReadOnly
+ animatedPoints SVGAnimatedPointsImpl::AnimatedPoints DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedPointsImpl::getValueProperty(ExecState *exec, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Points: // TODO: We need a pointList->toText function, quite trivial
+// if(!attributeMode)
+ return points()->cache(exec);
+ case AnimatedPoints:
+ return animatedPoints()->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAnimatedPointsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Points:
+ parsePoints(value.toString(exec).qstring(), m_points);
+ break;
+ case AnimatedPoints:
+ parsePoints(value.toString(exec).qstring(), m_animatedPoints);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedPointsImpl.h b/ksvg/impl/SVGAnimatedPointsImpl.h
index 9c4c88d7..cbe13e38 100644
--- a/ksvg/impl/SVGAnimatedPointsImpl.h
+++ b/ksvg/impl/SVGAnimatedPointsImpl.h
@@ -63,5 +63,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cc b/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cc
deleted file mode 100644
index 166b987f..00000000
--- a/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPreserveAspectRatioImpl.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedPreserveAspectRatioImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedPreserveAspectRatioImpl::SVGAnimatedPreserveAspectRatioImpl() : DOM::DomShared()
-{
- m_baseVal = new SVGPreserveAspectRatioImpl();
- m_baseVal->ref();
-
- m_animVal = new SVGPreserveAspectRatioImpl();
- m_animVal->ref();
-}
-
-SVGAnimatedPreserveAspectRatioImpl::~SVGAnimatedPreserveAspectRatioImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGPreserveAspectRatioImpl *SVGAnimatedPreserveAspectRatioImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGPreserveAspectRatioImpl *SVGAnimatedPreserveAspectRatioImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedPreserveAspectRatioImpl::s_hashTable 3
- baseVal SVGAnimatedPreserveAspectRatioImpl::BaseVal DontDelete|ReadOnly
- animVal SVGAnimatedPreserveAspectRatioImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedPreserveAspectRatioImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cpp b/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cpp
new file mode 100644
index 00000000..24ab74a5
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.cpp
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPreserveAspectRatioImpl.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedPreserveAspectRatioImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedPreserveAspectRatioImpl::SVGAnimatedPreserveAspectRatioImpl() : DOM::DomShared()
+{
+ m_baseVal = new SVGPreserveAspectRatioImpl();
+ m_baseVal->ref();
+
+ m_animVal = new SVGPreserveAspectRatioImpl();
+ m_animVal->ref();
+}
+
+SVGAnimatedPreserveAspectRatioImpl::~SVGAnimatedPreserveAspectRatioImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGPreserveAspectRatioImpl *SVGAnimatedPreserveAspectRatioImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGPreserveAspectRatioImpl *SVGAnimatedPreserveAspectRatioImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedPreserveAspectRatioImpl::s_hashTable 3
+ baseVal SVGAnimatedPreserveAspectRatioImpl::BaseVal DontDelete|ReadOnly
+ animVal SVGAnimatedPreserveAspectRatioImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedPreserveAspectRatioImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.h b/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.h
index 30fb7c87..32d48556 100644
--- a/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.h
+++ b/ksvg/impl/SVGAnimatedPreserveAspectRatioImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedRectImpl.cc b/ksvg/impl/SVGAnimatedRectImpl.cc
deleted file mode 100644
index 4ba7a50d..00000000
--- a/ksvg/impl/SVGAnimatedRectImpl.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGRectImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedRectImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedRectImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedRectImpl::SVGAnimatedRectImpl() : DOM::DomShared()
-{
- m_baseVal = SVGSVGElementImpl::createSVGRect();
- m_animVal = SVGSVGElementImpl::createSVGRect();
-}
-
-SVGAnimatedRectImpl::~SVGAnimatedRectImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGRectImpl *SVGAnimatedRectImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGRectImpl *SVGAnimatedRectImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedRectImpl::s_hashTable 3
- baseVal SVGAnimatedRectImpl::BaseVal DontDelete
- animVal SVGAnimatedRectImpl::AnimVal DontDelete
-@end
-*/
-
-Value SVGAnimatedRectImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedRectImpl.cpp b/ksvg/impl/SVGAnimatedRectImpl.cpp
new file mode 100644
index 00000000..62a35e1e
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedRectImpl.cpp
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGRectImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedRectImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedRectImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedRectImpl::SVGAnimatedRectImpl() : DOM::DomShared()
+{
+ m_baseVal = SVGSVGElementImpl::createSVGRect();
+ m_animVal = SVGSVGElementImpl::createSVGRect();
+}
+
+SVGAnimatedRectImpl::~SVGAnimatedRectImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGRectImpl *SVGAnimatedRectImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGRectImpl *SVGAnimatedRectImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedRectImpl::s_hashTable 3
+ baseVal SVGAnimatedRectImpl::BaseVal DontDelete
+ animVal SVGAnimatedRectImpl::AnimVal DontDelete
+@end
+*/
+
+Value SVGAnimatedRectImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedRectImpl.h b/ksvg/impl/SVGAnimatedRectImpl.h
index 0619505d..f314d381 100644
--- a/ksvg/impl/SVGAnimatedRectImpl.h
+++ b/ksvg/impl/SVGAnimatedRectImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedStringImpl.cc b/ksvg/impl/SVGAnimatedStringImpl.cc
deleted file mode 100644
index 1ce4f00b..00000000
--- a/ksvg/impl/SVGAnimatedStringImpl.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedStringImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedStringImpl::SVGAnimatedStringImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGAnimatedStringImpl::~SVGAnimatedStringImpl()
-{
-}
-
-void SVGAnimatedStringImpl::setBaseVal(const DOM::DOMString &baseVal)
-{
- m_baseVal = baseVal;
-}
-
-DOM::DOMString SVGAnimatedStringImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-DOM::DOMString SVGAnimatedStringImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedStringImpl::s_hashTable 3
- baseVal SVGAnimatedStringImpl::BaseVal DontDelete
- animVal SVGAnimatedStringImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedStringImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return String(baseVal().string());
- case AnimVal:
- return String(animVal().string());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAnimatedStringImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case BaseVal:
- setBaseVal(value.toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedStringImpl.cpp b/ksvg/impl/SVGAnimatedStringImpl.cpp
new file mode 100644
index 00000000..90b58d83
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedStringImpl.cpp
@@ -0,0 +1,88 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedStringImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedStringImpl::SVGAnimatedStringImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGAnimatedStringImpl::~SVGAnimatedStringImpl()
+{
+}
+
+void SVGAnimatedStringImpl::setBaseVal(const DOM::DOMString &baseVal)
+{
+ m_baseVal = baseVal;
+}
+
+DOM::DOMString SVGAnimatedStringImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+DOM::DOMString SVGAnimatedStringImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedStringImpl::s_hashTable 3
+ baseVal SVGAnimatedStringImpl::BaseVal DontDelete
+ animVal SVGAnimatedStringImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedStringImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return String(baseVal().string());
+ case AnimVal:
+ return String(animVal().string());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAnimatedStringImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case BaseVal:
+ setBaseVal(value.toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedStringImpl.h b/ksvg/impl/SVGAnimatedStringImpl.h
index cc15f7e2..387dc617 100644
--- a/ksvg/impl/SVGAnimatedStringImpl.h
+++ b/ksvg/impl/SVGAnimatedStringImpl.h
@@ -61,5 +61,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedTransformListImpl.cc b/ksvg/impl/SVGAnimatedTransformListImpl.cc
deleted file mode 100644
index 2e3b5536..00000000
--- a/ksvg/impl/SVGAnimatedTransformListImpl.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGTransformListImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimatedTransformListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGAnimatedTransformListImpl::SVGAnimatedTransformListImpl() : DOM::DomShared()
-{
- m_baseVal = new SVGTransformListImpl();
- m_baseVal->ref();
-
- m_animVal = new SVGTransformListImpl();
- m_animVal->ref();
-}
-
-SVGAnimatedTransformListImpl::~SVGAnimatedTransformListImpl()
-{
- if(m_baseVal)
- m_baseVal->deref();
- if(m_animVal)
- m_animVal->deref();
-}
-
-SVGTransformListImpl *SVGAnimatedTransformListImpl::baseVal() const
-{
- return m_baseVal;
-}
-
-SVGTransformListImpl *SVGAnimatedTransformListImpl::animVal() const
-{
- return m_animVal;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGAnimatedTransformListImpl::s_hashTable 3
- baseVal SVGAnimatedTransformListImpl::BaseVal DontDelete|ReadOnly
- animVal SVGAnimatedTransformListImpl::AnimVal DontDelete|ReadOnly
-@end
-*/
-
-Value SVGAnimatedTransformListImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case BaseVal:
- return m_baseVal->cache(exec);
- case AnimVal:
- return m_animVal->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimatedTransformListImpl.cpp b/ksvg/impl/SVGAnimatedTransformListImpl.cpp
new file mode 100644
index 00000000..6c191c06
--- /dev/null
+++ b/ksvg/impl/SVGAnimatedTransformListImpl.cpp
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGTransformListImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimatedTransformListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGAnimatedTransformListImpl::SVGAnimatedTransformListImpl() : DOM::DomShared()
+{
+ m_baseVal = new SVGTransformListImpl();
+ m_baseVal->ref();
+
+ m_animVal = new SVGTransformListImpl();
+ m_animVal->ref();
+}
+
+SVGAnimatedTransformListImpl::~SVGAnimatedTransformListImpl()
+{
+ if(m_baseVal)
+ m_baseVal->deref();
+ if(m_animVal)
+ m_animVal->deref();
+}
+
+SVGTransformListImpl *SVGAnimatedTransformListImpl::baseVal() const
+{
+ return m_baseVal;
+}
+
+SVGTransformListImpl *SVGAnimatedTransformListImpl::animVal() const
+{
+ return m_animVal;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGAnimatedTransformListImpl::s_hashTable 3
+ baseVal SVGAnimatedTransformListImpl::BaseVal DontDelete|ReadOnly
+ animVal SVGAnimatedTransformListImpl::AnimVal DontDelete|ReadOnly
+@end
+*/
+
+Value SVGAnimatedTransformListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case BaseVal:
+ return m_baseVal->cache(exec);
+ case AnimVal:
+ return m_animVal->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGAnimatedTransformListImpl.h b/ksvg/impl/SVGAnimatedTransformListImpl.h
index dc4be7e1..0db06e72 100644
--- a/ksvg/impl/SVGAnimatedTransformListImpl.h
+++ b/ksvg/impl/SVGAnimatedTransformListImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimationElementImpl.cc b/ksvg/impl/SVGAnimationElementImpl.cc
deleted file mode 100644
index 9fbab696..00000000
--- a/ksvg/impl/SVGAnimationElementImpl.cc
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-
-#include <kdebug.h>
-
-#include <tqtimer.h>
-
-#include "CanvasItem.h"
-#include "SVGHelperImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGStringListImpl.h"
-#include "SVGURIReferenceImpl.h"
-#include "SVGAnimationElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGAnimationElementImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGAnimationElementImpl::SVGAnimationElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGTestsImpl(), SVGExternalResourcesRequiredImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_connected = false;
- m_targetElement = 0;
-
- m_values = new SVGStringListImpl();
- m_keyTimes= new SVGStringListImpl();
- m_keySplines = new SVGStringListImpl();
-
- m_fill = REMOVE;
- m_additive = REPLACE;
- m_accumulate = ACCUMULATE_NONE;
-}
-
-SVGAnimationElementImpl::~SVGAnimationElementImpl()
-{
- if(m_targetElement)
- m_targetElement->deref();
-}
-
-SVGElementImpl *SVGAnimationElementImpl::targetElement() const
-{
- if(!m_targetElement)
- {
- SVGAnimationElementImpl *modify = const_cast<SVGAnimationElementImpl *>(this);
- if(!m_href.isEmpty())
- modify->setTargetElement(ownerDoc()->getElementByIdRecursive(ownerSVGElement(), SVGURIReferenceImpl::getTarget(m_href)));
- else if(!parentNode().isNull())
- modify->setTargetElement(ownerDoc()->getElementFromHandle(parentNode().handle()));
- }
-
- return m_targetElement;
-}
-
-double SVGAnimationElementImpl::parseClockValue(const TQString &data) const
-{
- TQString parse = data.stripWhiteSpace();
- TQString debugOutput = "parseClockValue(" + parse + ") -> ";
-
- if(parse == "indefinite") // Saves some time...
- return -1;
-
- double result;
-
- int doublePointOne = parse.find(':');
- int doublePointTwo = parse.find(':', doublePointOne + 1);
-
- if(doublePointOne != -1 && doublePointTwo != -1) // Spec: "Full clock values"
- {
- unsigned int hours = parse.mid(0, 2).toUInt();
- unsigned int minutes = parse.mid(3, 2).toUInt();
- unsigned int seconds = parse.mid(6, 2).toUInt();
- unsigned int milliseconds = 0;
-
- result = (3600 * hours) + (60 * minutes) + seconds;
-
- if(parse.find('.') != -1)
- {
- TQString temp = parse.mid(9, 2);
- milliseconds = temp.toUInt();
- result += (milliseconds * (1 / pow(10.0, temp.length())));
- }
- }
- else if(doublePointOne != -1 && doublePointTwo == -1) // Spec: "Partial clock values"
- {
- unsigned int minutes = parse.mid(0, 2).toUInt();
- unsigned int seconds = parse.mid(3, 2).toUInt();
- unsigned int milliseconds = 0;
-
- result = (60 * minutes) + seconds;
-
- if(parse.find('.') != -1)
- {
- TQString temp = parse.mid(6, 2);
- milliseconds = temp.toUInt();
- result += (milliseconds * (1 / pow(10.0, temp.length())));
- }
- }
- else // Spec: "Timecount values"
- {
- int dotPosition = parse.find('.');
-
- if(parse.endsWith("h"))
- {
- if(dotPosition == -1)
- result = parse.mid(0, parse.length() - 1).toUInt() * 3600;
- else
- {
- result = parse.mid(0, dotPosition).toUInt() * 3600;
- TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 2);
- result += (3600.0 * temp.toUInt()) * (1 / pow(10.0, temp.length()));
- }
- }
- else if(parse.endsWith("min"))
- {
- if(dotPosition == -1)
- result = parse.mid(0, parse.length() - 3).toUInt() * 60;
- else
- {
- result = parse.mid(0, dotPosition).toUInt() * 60;
- TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 4);
- result += (60.0 * temp.toUInt()) * (1 / pow(10.0, temp.length()));
- }
- }
- else if(parse.endsWith("ms"))
- {
- if(dotPosition == -1)
- result = parse.mid(0, parse.length() - 2).toUInt() / 1000.0;
- else
- {
- result = parse.mid(0, dotPosition).toUInt() / 1000.0;
- TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 3);
- result += (temp.toUInt() / 1000.0) * (1 / pow(10.0, temp.length()));
- }
- }
- else if(parse.endsWith("s"))
- {
- if(dotPosition == -1)
- result = parse.mid(0, parse.length() - 1).toUInt();
- else
- {
- result = parse.mid(0, dotPosition).toUInt();
- TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 2);
- result += temp.toUInt() * (1 / pow(10.0, temp.length()));
- }
- }
- else
- result = parse.toDouble();
- }
-
- kdDebug() << debugOutput << result << endl;
- return result;
-}
-
-/*
-@namespace KSVG
-@begin SVGAnimationElementImpl::s_hashTable 23
- targetElement SVGAnimationElementImpl::TargetElement DontDelete|ReadOnly
- href SVGAnimationElementImpl::Href DontDelete|ReadOnly
- additive SVGAnimationElementImpl::Additive DontDelete|ReadOnly
- accumulate SVGAnimationElementImpl::Accumulate DontDelete|ReadOnly
- attributeName SVGAnimationElementImpl::AttributeName DontDelete|ReadOnly
- attributeType SVGAnimationElementImpl::AttributeType DontDelete|ReadOnly
- calcMode SVGAnimationElementImpl::CalcMode DontDelete|ReadOnly
- values SVGAnimationElementImpl::Values DontDelete|ReadOnly
- keyTimes SVGAnimationElementImpl::KeyTimes DontDelete|ReadOnly
- keySplines SVGAnimationElementImpl::KeySplines DontDelete|ReadOnly
- from SVGAnimationElementImpl::From DontDelete|ReadOnly
- to SVGAnimationElementImpl::To DontDelete|ReadOnly
- by SVGAnimationElementImpl::By DontDelete|ReadOnly
- begin SVGAnimationElementImpl::Begin DontDelete|ReadOnly
- dur SVGAnimationElementImpl::Dur DontDelete|ReadOnly
- end SVGAnimationElementImpl::End DontDelete|ReadOnly
- min SVGAnimationElementImpl::Min DontDelete|ReadOnly
- max SVGAnimationElementImpl::Max DontDelete|ReadOnly
- restart SVGAnimationElementImpl::Restart DontDelete|ReadOnly
- repeatCount SVGAnimationElementImpl::RepeatCount DontDelete|ReadOnly
- repeatDur SVGAnimationElementImpl::RepeatDur DontDelete|ReadOnly
- fill SVGAnimationElementImpl::Fill DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGAnimationElementImplProto::s_hashTable 5
- getStartTime SVGAnimationElementImpl::GetStartTime DontDelete|Function 0
- getCurrentTime SVGAnimationElementImpl::GetCurrentTime DontDelete|Function 0
- getSimpleDuration SVGAnimationElementImpl::GetSimpleDuration DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGAnimationElement",SVGAnimationElementImplProto,SVGAnimationElementImplProtoFunc)
-
-Value SVGAnimationElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case TargetElement:
- return m_targetElement->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGAnimationElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- TQString val = value.toString(exec).qstring();
- switch(token)
- {
- case Href:
- m_href = val;
- break;
- case Additive:
- m_additive = (val == "sum") ? SUM : REPLACE;
- break;
- case Accumulate:
- m_accumulate = (val == "sum") ? ACCUMULATE_SUM : ACCUMULATE_NONE;
- break;
- case AttributeName:
- m_attributeName = val;
- break;
- case AttributeType:
- if(val == "css")
- m_attributeType = CSS;
- else if(val == "xml")
- m_attributeType = XML;
- else
- m_attributeType = AUTO;
- break;
- case CalcMode: // FIXME: See spec for default values!!!
- if(val == "discrete")
- m_calcMode = DISCRETE;
- else if(val == "linear")
- m_calcMode = LINEAR;
- else if(val == "spline")
- m_calcMode = SPLINE;
- else if(val == "paced")
- m_calcMode = PACED;
- break;
- case Values:
- SVGHelperImpl::parseSemicolonSeperatedList(m_values, val);
- break;
- case KeyTimes:
- SVGHelperImpl::parseSemicolonSeperatedList(m_keyTimes, val);
- break;
- case KeySplines:
- SVGHelperImpl::parseSemicolonSeperatedList(m_keySplines, val);
- break;
- case From:
- m_from = val;
- break;
- case To:
- m_to = val;
- break;
- case By:
- m_by = val;
- break;
- case Begin:
- case End:
- {
- // Create list
- SVGStringListImpl *temp = new SVGStringListImpl();
- temp->ref();
-
- // Feed data into list
- SVGHelperImpl::parseSemicolonSeperatedList(temp, val);
-
- // Parse data
- for(unsigned int i = 0; i < temp->numberOfItems(); i++)
- {
- TQString current = temp->getItem(i)->string();
-
- if(current.startsWith("accessKey"))
- {
- // Register keyDownEventListener for the character
- TQString character = current.mid(current.length() - 2, 1);
-
- kdDebug() << "ACCESSKEY CHARACTER " << character << endl;
- }
- else if(current.startsWith("wallclock"))
- {
- int firstBrace = current.find("(");
- int secondBrace = current.find(")");
-
- TQString wallclockValue = current.mid(firstBrace + 1, secondBrace - firstBrace - 2);
-
- kdDebug() << "WALLCLOCK VALUE " << wallclockValue << endl;
- }
- else if(current.contains("."))
- {
- int dotPosition = current.find(".");
-
- TQString element = current.mid(0, dotPosition);
- TQString clockValue;
-
- if(current.contains("begin"))
- clockValue = current.mid(dotPosition + 6);
- else if(current.contains("end"))
- clockValue = current.mid(dotPosition + 4);
- else if(current.contains("repeat"))
- clockValue = current.mid(dotPosition + 7);
- else // DOM2 Event Reference
- {
- int plusMinusPosition = -1;
-
- if(current.contains("+"))
- plusMinusPosition = current.find("+");
- else if(current.contains("-"))
- plusMinusPosition = current.find("-");
-
- TQString event = current.mid(dotPosition + 1, plusMinusPosition - dotPosition - 1);
-
- clockValue = current.mid(dotPosition + event.length() + 1);
- kdDebug() << "EVENT " << event << endl;
- }
-
- kdDebug() << "ELEMENT " << element << " CLOCKVALUE " << clockValue << endl;
- }
- else
- {
- if(token == Begin)
- m_begin = parseClockValue(current);
- else
- m_end = parseClockValue(current);
- }
- }
-
- temp->deref();
-
- break;
- }
- case Dur:
- m_duration = parseClockValue(val);
- break;
-// case Min:
-// case Max:
- case Restart:
- if(val == "whenNotActive")
- m_restart = WHENNOTACTIVE;
- else if(val == "never")
- m_restart = NEVER;
- else
- m_restart = ALWAYS;
- break;
- case RepeatCount:
- m_repeatCount = val;
- break;
- case RepeatDur:
- m_repeatDur = val;
- break;
- case Fill:
- m_fill = (val == "freeze") ? FREEZE : REMOVE;
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGAnimationElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
-{
- KSVG_CHECK_THIS(SVGAnimationElementImpl)
-
- switch(id)
- {
- case SVGAnimationElementImpl::GetStartTime:
- return Number(obj->getStartTime());
- case SVGAnimationElementImpl::GetCurrentTime:
- return Number(obj->getCurrentTime());
- case SVGAnimationElementImpl::GetSimpleDuration:
- return Number(obj->getSimpleDuration());
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-void SVGAnimationElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: Default value is "replace"
- if(KSVG_TOKEN_NOT_PARSED(Additive))
- KSVG_SET_ALT_ATTRIBUTE(Additive, "replace")
-
- // Spec: Default value is "none"
- if(KSVG_TOKEN_NOT_PARSED(Accumulate))
- KSVG_SET_ALT_ATTRIBUTE(Accumulate, "none")
-
- // Spec: Default value is "always"
- if(KSVG_TOKEN_NOT_PARSED(Restart))
- KSVG_SET_ALT_ATTRIBUTE(Restart, "always")
-}
-
-void SVGAnimationElementImpl::setTargetElement(SVGElementImpl *target)
-{
- if(m_targetElement)
- m_targetElement->deref();
-
- m_targetElement = target;
- m_targetElement->ref();
-}
-
-void SVGAnimationElementImpl::applyAttribute(const TQString &name, const TQString &value)
-{
- SVGElementImpl *target = targetElement();
- if(!target)
- {
- kdDebug() << k_funcinfo << " name: " << name << " value: " << value << " NO TARGET ELEMENT!" << endl;
- return;
- }
-
- // The only two cases I can imagine, where combining is needed (Niko)
- bool combine = (name == "style" || name == "transform");
-
- if(!combine)
- target->setAttributeInternal(name, value);
- else
- {
- kdDebug() << "TODO COMBINE: " << value << " NAME " << name << endl;
- }
-}
-
-double SVGAnimationElementImpl::getStartTime() const
-{
- return m_begin;
-}
-
-double SVGAnimationElementImpl::getCurrentTime() const
-{
- return 0.0;
-}
-
-double SVGAnimationElementImpl::getSimpleDuration() const
-{
- return m_duration;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGAnimationElementImpl.cpp b/ksvg/impl/SVGAnimationElementImpl.cpp
new file mode 100644
index 00000000..b87a9829
--- /dev/null
+++ b/ksvg/impl/SVGAnimationElementImpl.cpp
@@ -0,0 +1,463 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+
+#include <kdebug.h>
+
+#include <tqtimer.h>
+
+#include "CanvasItem.h"
+#include "SVGHelperImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGStringListImpl.h"
+#include "SVGURIReferenceImpl.h"
+#include "SVGAnimationElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGAnimationElementImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGAnimationElementImpl::SVGAnimationElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGTestsImpl(), SVGExternalResourcesRequiredImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_connected = false;
+ m_targetElement = 0;
+
+ m_values = new SVGStringListImpl();
+ m_keyTimes= new SVGStringListImpl();
+ m_keySplines = new SVGStringListImpl();
+
+ m_fill = REMOVE;
+ m_additive = REPLACE;
+ m_accumulate = ACCUMULATE_NONE;
+}
+
+SVGAnimationElementImpl::~SVGAnimationElementImpl()
+{
+ if(m_targetElement)
+ m_targetElement->deref();
+}
+
+SVGElementImpl *SVGAnimationElementImpl::targetElement() const
+{
+ if(!m_targetElement)
+ {
+ SVGAnimationElementImpl *modify = const_cast<SVGAnimationElementImpl *>(this);
+ if(!m_href.isEmpty())
+ modify->setTargetElement(ownerDoc()->getElementByIdRecursive(ownerSVGElement(), SVGURIReferenceImpl::getTarget(m_href)));
+ else if(!parentNode().isNull())
+ modify->setTargetElement(ownerDoc()->getElementFromHandle(parentNode().handle()));
+ }
+
+ return m_targetElement;
+}
+
+double SVGAnimationElementImpl::parseClockValue(const TQString &data) const
+{
+ TQString parse = data.stripWhiteSpace();
+ TQString debugOutput = "parseClockValue(" + parse + ") -> ";
+
+ if(parse == "indefinite") // Saves some time...
+ return -1;
+
+ double result;
+
+ int doublePointOne = parse.find(':');
+ int doublePointTwo = parse.find(':', doublePointOne + 1);
+
+ if(doublePointOne != -1 && doublePointTwo != -1) // Spec: "Full clock values"
+ {
+ unsigned int hours = parse.mid(0, 2).toUInt();
+ unsigned int minutes = parse.mid(3, 2).toUInt();
+ unsigned int seconds = parse.mid(6, 2).toUInt();
+ unsigned int milliseconds = 0;
+
+ result = (3600 * hours) + (60 * minutes) + seconds;
+
+ if(parse.find('.') != -1)
+ {
+ TQString temp = parse.mid(9, 2);
+ milliseconds = temp.toUInt();
+ result += (milliseconds * (1 / pow(10.0, temp.length())));
+ }
+ }
+ else if(doublePointOne != -1 && doublePointTwo == -1) // Spec: "Partial clock values"
+ {
+ unsigned int minutes = parse.mid(0, 2).toUInt();
+ unsigned int seconds = parse.mid(3, 2).toUInt();
+ unsigned int milliseconds = 0;
+
+ result = (60 * minutes) + seconds;
+
+ if(parse.find('.') != -1)
+ {
+ TQString temp = parse.mid(6, 2);
+ milliseconds = temp.toUInt();
+ result += (milliseconds * (1 / pow(10.0, temp.length())));
+ }
+ }
+ else // Spec: "Timecount values"
+ {
+ int dotPosition = parse.find('.');
+
+ if(parse.endsWith("h"))
+ {
+ if(dotPosition == -1)
+ result = parse.mid(0, parse.length() - 1).toUInt() * 3600;
+ else
+ {
+ result = parse.mid(0, dotPosition).toUInt() * 3600;
+ TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 2);
+ result += (3600.0 * temp.toUInt()) * (1 / pow(10.0, temp.length()));
+ }
+ }
+ else if(parse.endsWith("min"))
+ {
+ if(dotPosition == -1)
+ result = parse.mid(0, parse.length() - 3).toUInt() * 60;
+ else
+ {
+ result = parse.mid(0, dotPosition).toUInt() * 60;
+ TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 4);
+ result += (60.0 * temp.toUInt()) * (1 / pow(10.0, temp.length()));
+ }
+ }
+ else if(parse.endsWith("ms"))
+ {
+ if(dotPosition == -1)
+ result = parse.mid(0, parse.length() - 2).toUInt() / 1000.0;
+ else
+ {
+ result = parse.mid(0, dotPosition).toUInt() / 1000.0;
+ TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 3);
+ result += (temp.toUInt() / 1000.0) * (1 / pow(10.0, temp.length()));
+ }
+ }
+ else if(parse.endsWith("s"))
+ {
+ if(dotPosition == -1)
+ result = parse.mid(0, parse.length() - 1).toUInt();
+ else
+ {
+ result = parse.mid(0, dotPosition).toUInt();
+ TQString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 2);
+ result += temp.toUInt() * (1 / pow(10.0, temp.length()));
+ }
+ }
+ else
+ result = parse.toDouble();
+ }
+
+ kdDebug() << debugOutput << result << endl;
+ return result;
+}
+
+/*
+@namespace KSVG
+@begin SVGAnimationElementImpl::s_hashTable 23
+ targetElement SVGAnimationElementImpl::TargetElement DontDelete|ReadOnly
+ href SVGAnimationElementImpl::Href DontDelete|ReadOnly
+ additive SVGAnimationElementImpl::Additive DontDelete|ReadOnly
+ accumulate SVGAnimationElementImpl::Accumulate DontDelete|ReadOnly
+ attributeName SVGAnimationElementImpl::AttributeName DontDelete|ReadOnly
+ attributeType SVGAnimationElementImpl::AttributeType DontDelete|ReadOnly
+ calcMode SVGAnimationElementImpl::CalcMode DontDelete|ReadOnly
+ values SVGAnimationElementImpl::Values DontDelete|ReadOnly
+ keyTimes SVGAnimationElementImpl::KeyTimes DontDelete|ReadOnly
+ keySplines SVGAnimationElementImpl::KeySplines DontDelete|ReadOnly
+ from SVGAnimationElementImpl::From DontDelete|ReadOnly
+ to SVGAnimationElementImpl::To DontDelete|ReadOnly
+ by SVGAnimationElementImpl::By DontDelete|ReadOnly
+ begin SVGAnimationElementImpl::Begin DontDelete|ReadOnly
+ dur SVGAnimationElementImpl::Dur DontDelete|ReadOnly
+ end SVGAnimationElementImpl::End DontDelete|ReadOnly
+ min SVGAnimationElementImpl::Min DontDelete|ReadOnly
+ max SVGAnimationElementImpl::Max DontDelete|ReadOnly
+ restart SVGAnimationElementImpl::Restart DontDelete|ReadOnly
+ repeatCount SVGAnimationElementImpl::RepeatCount DontDelete|ReadOnly
+ repeatDur SVGAnimationElementImpl::RepeatDur DontDelete|ReadOnly
+ fill SVGAnimationElementImpl::Fill DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGAnimationElementImplProto::s_hashTable 5
+ getStartTime SVGAnimationElementImpl::GetStartTime DontDelete|Function 0
+ getCurrentTime SVGAnimationElementImpl::GetCurrentTime DontDelete|Function 0
+ getSimpleDuration SVGAnimationElementImpl::GetSimpleDuration DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGAnimationElement",SVGAnimationElementImplProto,SVGAnimationElementImplProtoFunc)
+
+Value SVGAnimationElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case TargetElement:
+ return m_targetElement->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGAnimationElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ TQString val = value.toString(exec).qstring();
+ switch(token)
+ {
+ case Href:
+ m_href = val;
+ break;
+ case Additive:
+ m_additive = (val == "sum") ? SUM : REPLACE;
+ break;
+ case Accumulate:
+ m_accumulate = (val == "sum") ? ACCUMULATE_SUM : ACCUMULATE_NONE;
+ break;
+ case AttributeName:
+ m_attributeName = val;
+ break;
+ case AttributeType:
+ if(val == "css")
+ m_attributeType = CSS;
+ else if(val == "xml")
+ m_attributeType = XML;
+ else
+ m_attributeType = AUTO;
+ break;
+ case CalcMode: // FIXME: See spec for default values!!!
+ if(val == "discrete")
+ m_calcMode = DISCRETE;
+ else if(val == "linear")
+ m_calcMode = LINEAR;
+ else if(val == "spline")
+ m_calcMode = SPLINE;
+ else if(val == "paced")
+ m_calcMode = PACED;
+ break;
+ case Values:
+ SVGHelperImpl::parseSemicolonSeperatedList(m_values, val);
+ break;
+ case KeyTimes:
+ SVGHelperImpl::parseSemicolonSeperatedList(m_keyTimes, val);
+ break;
+ case KeySplines:
+ SVGHelperImpl::parseSemicolonSeperatedList(m_keySplines, val);
+ break;
+ case From:
+ m_from = val;
+ break;
+ case To:
+ m_to = val;
+ break;
+ case By:
+ m_by = val;
+ break;
+ case Begin:
+ case End:
+ {
+ // Create list
+ SVGStringListImpl *temp = new SVGStringListImpl();
+ temp->ref();
+
+ // Feed data into list
+ SVGHelperImpl::parseSemicolonSeperatedList(temp, val);
+
+ // Parse data
+ for(unsigned int i = 0; i < temp->numberOfItems(); i++)
+ {
+ TQString current = temp->getItem(i)->string();
+
+ if(current.startsWith("accessKey"))
+ {
+ // Register keyDownEventListener for the character
+ TQString character = current.mid(current.length() - 2, 1);
+
+ kdDebug() << "ACCESSKEY CHARACTER " << character << endl;
+ }
+ else if(current.startsWith("wallclock"))
+ {
+ int firstBrace = current.find("(");
+ int secondBrace = current.find(")");
+
+ TQString wallclockValue = current.mid(firstBrace + 1, secondBrace - firstBrace - 2);
+
+ kdDebug() << "WALLCLOCK VALUE " << wallclockValue << endl;
+ }
+ else if(current.contains("."))
+ {
+ int dotPosition = current.find(".");
+
+ TQString element = current.mid(0, dotPosition);
+ TQString clockValue;
+
+ if(current.contains("begin"))
+ clockValue = current.mid(dotPosition + 6);
+ else if(current.contains("end"))
+ clockValue = current.mid(dotPosition + 4);
+ else if(current.contains("repeat"))
+ clockValue = current.mid(dotPosition + 7);
+ else // DOM2 Event Reference
+ {
+ int plusMinusPosition = -1;
+
+ if(current.contains("+"))
+ plusMinusPosition = current.find("+");
+ else if(current.contains("-"))
+ plusMinusPosition = current.find("-");
+
+ TQString event = current.mid(dotPosition + 1, plusMinusPosition - dotPosition - 1);
+
+ clockValue = current.mid(dotPosition + event.length() + 1);
+ kdDebug() << "EVENT " << event << endl;
+ }
+
+ kdDebug() << "ELEMENT " << element << " CLOCKVALUE " << clockValue << endl;
+ }
+ else
+ {
+ if(token == Begin)
+ m_begin = parseClockValue(current);
+ else
+ m_end = parseClockValue(current);
+ }
+ }
+
+ temp->deref();
+
+ break;
+ }
+ case Dur:
+ m_duration = parseClockValue(val);
+ break;
+// case Min:
+// case Max:
+ case Restart:
+ if(val == "whenNotActive")
+ m_restart = WHENNOTACTIVE;
+ else if(val == "never")
+ m_restart = NEVER;
+ else
+ m_restart = ALWAYS;
+ break;
+ case RepeatCount:
+ m_repeatCount = val;
+ break;
+ case RepeatDur:
+ m_repeatDur = val;
+ break;
+ case Fill:
+ m_fill = (val == "freeze") ? FREEZE : REMOVE;
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGAnimationElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
+{
+ KSVG_CHECK_THIS(SVGAnimationElementImpl)
+
+ switch(id)
+ {
+ case SVGAnimationElementImpl::GetStartTime:
+ return Number(obj->getStartTime());
+ case SVGAnimationElementImpl::GetCurrentTime:
+ return Number(obj->getCurrentTime());
+ case SVGAnimationElementImpl::GetSimpleDuration:
+ return Number(obj->getSimpleDuration());
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+void SVGAnimationElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: Default value is "replace"
+ if(KSVG_TOKEN_NOT_PARSED(Additive))
+ KSVG_SET_ALT_ATTRIBUTE(Additive, "replace")
+
+ // Spec: Default value is "none"
+ if(KSVG_TOKEN_NOT_PARSED(Accumulate))
+ KSVG_SET_ALT_ATTRIBUTE(Accumulate, "none")
+
+ // Spec: Default value is "always"
+ if(KSVG_TOKEN_NOT_PARSED(Restart))
+ KSVG_SET_ALT_ATTRIBUTE(Restart, "always")
+}
+
+void SVGAnimationElementImpl::setTargetElement(SVGElementImpl *target)
+{
+ if(m_targetElement)
+ m_targetElement->deref();
+
+ m_targetElement = target;
+ m_targetElement->ref();
+}
+
+void SVGAnimationElementImpl::applyAttribute(const TQString &name, const TQString &value)
+{
+ SVGElementImpl *target = targetElement();
+ if(!target)
+ {
+ kdDebug() << k_funcinfo << " name: " << name << " value: " << value << " NO TARGET ELEMENT!" << endl;
+ return;
+ }
+
+ // The only two cases I can imagine, where combining is needed (Niko)
+ bool combine = (name == "style" || name == "transform");
+
+ if(!combine)
+ target->setAttributeInternal(name, value);
+ else
+ {
+ kdDebug() << "TODO COMBINE: " << value << " NAME " << name << endl;
+ }
+}
+
+double SVGAnimationElementImpl::getStartTime() const
+{
+ return m_begin;
+}
+
+double SVGAnimationElementImpl::getCurrentTime() const
+{
+ return 0.0;
+}
+
+double SVGAnimationElementImpl::getSimpleDuration() const
+{
+ return m_duration;
+}
diff --git a/ksvg/impl/SVGAnimationElementImpl.h b/ksvg/impl/SVGAnimationElementImpl.h
index 7a42a77e..8b57356c 100644
--- a/ksvg/impl/SVGAnimationElementImpl.h
+++ b/ksvg/impl/SVGAnimationElementImpl.h
@@ -145,5 +145,3 @@ KSVG_DEFINE_PROTOTYPE(SVGAnimationElementImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGAnimationElementImplProtoFunc, SVGAnimationElementImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGBBoxTarget.cc b/ksvg/impl/SVGBBoxTarget.cc
deleted file mode 100644
index fcef164e..00000000
--- a/ksvg/impl/SVGBBoxTarget.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <dom/dom_misc.h>
-
-#include "SVGShapeImpl.h"
-#include "SVGBBoxTarget.h"
-
-using namespace KSVG;
-
-SVGBBoxTarget::SVGBBoxTarget()
-{
- m_target = 0;
-}
-
-SVGBBoxTarget::~SVGBBoxTarget()
-{
- if(m_target)
- dynamic_cast<DOM::DomShared *>(m_target)->deref();
-}
-
-SVGShapeImpl *SVGBBoxTarget::getBBoxTarget() const
-{
- return m_target;
-}
-
-void SVGBBoxTarget::setBBoxTarget(SVGShapeImpl *target)
-{
- if(m_target)
- dynamic_cast<DOM::DomShared *>(m_target)->deref();
-
- m_target = target;
-
- if(m_target)
- dynamic_cast<DOM::DomShared *>(m_target)->ref();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGBBoxTarget.cpp b/ksvg/impl/SVGBBoxTarget.cpp
new file mode 100644
index 00000000..7d690373
--- /dev/null
+++ b/ksvg/impl/SVGBBoxTarget.cpp
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <dom/dom_misc.h>
+
+#include "SVGShapeImpl.h"
+#include "SVGBBoxTarget.h"
+
+using namespace KSVG;
+
+SVGBBoxTarget::SVGBBoxTarget()
+{
+ m_target = 0;
+}
+
+SVGBBoxTarget::~SVGBBoxTarget()
+{
+ if(m_target)
+ dynamic_cast<DOM::DomShared *>(m_target)->deref();
+}
+
+SVGShapeImpl *SVGBBoxTarget::getBBoxTarget() const
+{
+ return m_target;
+}
+
+void SVGBBoxTarget::setBBoxTarget(SVGShapeImpl *target)
+{
+ if(m_target)
+ dynamic_cast<DOM::DomShared *>(m_target)->deref();
+
+ m_target = target;
+
+ if(m_target)
+ dynamic_cast<DOM::DomShared *>(m_target)->ref();
+}
diff --git a/ksvg/impl/SVGBBoxTarget.h b/ksvg/impl/SVGBBoxTarget.h
index 03de657d..2e7606ac 100644
--- a/ksvg/impl/SVGBBoxTarget.h
+++ b/ksvg/impl/SVGBBoxTarget.h
@@ -41,5 +41,3 @@ protected:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGCSSRuleImpl.cc b/ksvg/impl/SVGCSSRuleImpl.cc
deleted file mode 100644
index 991487e3..00000000
--- a/ksvg/impl/SVGCSSRuleImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGCSSRuleImpl.h"
-
-using namespace KSVG;
-
-SVGCSSRuleImpl::SVGCSSRuleImpl() : DOM::DomShared()//, css::CSSRule()
-{
-}
-
-SVGCSSRuleImpl::~SVGCSSRuleImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGCSSRuleImpl.cpp b/ksvg/impl/SVGCSSRuleImpl.cpp
new file mode 100644
index 00000000..250ed687
--- /dev/null
+++ b/ksvg/impl/SVGCSSRuleImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGCSSRuleImpl.h"
+
+using namespace KSVG;
+
+SVGCSSRuleImpl::SVGCSSRuleImpl() : DOM::DomShared()//, css::CSSRule()
+{
+}
+
+SVGCSSRuleImpl::~SVGCSSRuleImpl()
+{
+}
diff --git a/ksvg/impl/SVGCSSRuleImpl.h b/ksvg/impl/SVGCSSRuleImpl.h
index 03ab4e8b..082ad81b 100644
--- a/ksvg/impl/SVGCSSRuleImpl.h
+++ b/ksvg/impl/SVGCSSRuleImpl.h
@@ -38,5 +38,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGCircleElementImpl.cc b/ksvg/impl/SVGCircleElementImpl.cc
deleted file mode 100644
index 7ad3f13a..00000000
--- a/ksvg/impl/SVGCircleElementImpl.cc
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include <tdelocale.h>
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-#include "SVGRectImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGCircleElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-
-using namespace KSVG;
-
-#include "SVGCircleElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGCircleElementImpl::SVGCircleElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_cx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_cx->ref();
- m_cx->baseVal()->setValueAsString("-1");
-
- m_cy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_cy->ref();
- m_cy->baseVal()->setValueAsString("-1");
-
- m_r = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, this);
- m_r->ref();
- m_r->baseVal()->setValueAsString("-1");
-}
-
-SVGCircleElementImpl::~SVGCircleElementImpl()
-{
- if(m_cx)
- m_cx->deref();
- if(m_cy)
- m_cy->deref();
- if(m_r)
- m_r->deref();
-}
-
-SVGAnimatedLengthImpl *SVGCircleElementImpl::cx()
-{
- return m_cx;
-}
-
-SVGAnimatedLengthImpl *SVGCircleElementImpl::cy()
-{
- return m_cy;
-}
-
-SVGAnimatedLengthImpl *SVGCircleElementImpl::r()
-{
- return m_r;
-}
-
-/*
-@namespace KSVG
-@begin SVGCircleElementImpl::s_hashTable 5
- cx SVGCircleElementImpl::Cx DontDelete|ReadOnly
- cy SVGCircleElementImpl::Cy DontDelete|ReadOnly
- r SVGCircleElementImpl::R DontDelete|ReadOnly
-@end
-*/
-
-Value SVGCircleElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Cx:
- if(!attributeMode)
- return m_cx->cache(exec);
- else
- return Number(m_cx->baseVal()->value());
- case Cy:
- if(!attributeMode)
- return m_cy->cache(exec);
- else
- return Number(m_cy->baseVal()->value());
- case R:
- if(!attributeMode)
- return m_r->cache(exec);
- else
- return Number(m_r->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGCircleElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Cx:
- cx()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Cy:
- cy()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case R:
- r()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(r()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute r of element <circle> is illegal"));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGCircleElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_cx->baseVal()->value() - m_r->baseVal()->value());
- ret->setY(m_cy->baseVal()->value() - m_r->baseVal()->value());
- ret->setWidth(m_r->baseVal()->value() * 2.0);
- ret->setHeight(m_r->baseVal()->value() * 2.0);
- return ret;
-}
-
-void SVGCircleElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Cx))
- KSVG_SET_ALT_ATTRIBUTE(Cx, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Cy))
- KSVG_SET_ALT_ATTRIBUTE(Cy, "0")
-}
-
-void SVGCircleElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createCircle(this);
- c->insert(m_item);
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGCircleElementImpl.cpp b/ksvg/impl/SVGCircleElementImpl.cpp
new file mode 100644
index 00000000..b50f2661
--- /dev/null
+++ b/ksvg/impl/SVGCircleElementImpl.cpp
@@ -0,0 +1,176 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include <tdelocale.h>
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+#include "SVGRectImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGCircleElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+
+using namespace KSVG;
+
+#include "SVGCircleElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGCircleElementImpl::SVGCircleElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_cx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_cx->ref();
+ m_cx->baseVal()->setValueAsString("-1");
+
+ m_cy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_cy->ref();
+ m_cy->baseVal()->setValueAsString("-1");
+
+ m_r = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, this);
+ m_r->ref();
+ m_r->baseVal()->setValueAsString("-1");
+}
+
+SVGCircleElementImpl::~SVGCircleElementImpl()
+{
+ if(m_cx)
+ m_cx->deref();
+ if(m_cy)
+ m_cy->deref();
+ if(m_r)
+ m_r->deref();
+}
+
+SVGAnimatedLengthImpl *SVGCircleElementImpl::cx()
+{
+ return m_cx;
+}
+
+SVGAnimatedLengthImpl *SVGCircleElementImpl::cy()
+{
+ return m_cy;
+}
+
+SVGAnimatedLengthImpl *SVGCircleElementImpl::r()
+{
+ return m_r;
+}
+
+/*
+@namespace KSVG
+@begin SVGCircleElementImpl::s_hashTable 5
+ cx SVGCircleElementImpl::Cx DontDelete|ReadOnly
+ cy SVGCircleElementImpl::Cy DontDelete|ReadOnly
+ r SVGCircleElementImpl::R DontDelete|ReadOnly
+@end
+*/
+
+Value SVGCircleElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Cx:
+ if(!attributeMode)
+ return m_cx->cache(exec);
+ else
+ return Number(m_cx->baseVal()->value());
+ case Cy:
+ if(!attributeMode)
+ return m_cy->cache(exec);
+ else
+ return Number(m_cy->baseVal()->value());
+ case R:
+ if(!attributeMode)
+ return m_r->cache(exec);
+ else
+ return Number(m_r->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGCircleElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Cx:
+ cx()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Cy:
+ cy()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case R:
+ r()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(r()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute r of element <circle> is illegal"));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGCircleElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_cx->baseVal()->value() - m_r->baseVal()->value());
+ ret->setY(m_cy->baseVal()->value() - m_r->baseVal()->value());
+ ret->setWidth(m_r->baseVal()->value() * 2.0);
+ ret->setHeight(m_r->baseVal()->value() * 2.0);
+ return ret;
+}
+
+void SVGCircleElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Cx))
+ KSVG_SET_ALT_ATTRIBUTE(Cx, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Cy))
+ KSVG_SET_ALT_ATTRIBUTE(Cy, "0")
+}
+
+void SVGCircleElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createCircle(this);
+ c->insert(m_item);
+ }
+}
diff --git a/ksvg/impl/SVGCircleElementImpl.h b/ksvg/impl/SVGCircleElementImpl.h
index 29e0df3f..1bb009a4 100644
--- a/ksvg/impl/SVGCircleElementImpl.h
+++ b/ksvg/impl/SVGCircleElementImpl.h
@@ -80,5 +80,3 @@ KSVG_REGISTER_ELEMENT(SVGCircleElementImpl, "circle")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGClipPathElementImpl.cc b/ksvg/impl/SVGClipPathElementImpl.cc
deleted file mode 100644
index 87b4d4ac..00000000
--- a/ksvg/impl/SVGClipPathElementImpl.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGClipPathElement.h"
-#include "SVGClipPathElementImpl.h"
-#include "KSVGCanvas.h"
-#include "SVGDocumentImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-#include "SVGClipPathElementImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGClipPathElementImpl::SVGClipPathElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl(), SVGBBoxTarget()
-{
- KSVG_EMPTY_FLAGS
-
- m_clipPathUnits = new SVGAnimatedEnumerationImpl();
- m_clipPathUnits->ref();
- m_clipPathUnits->setBaseVal(SVGClipPathElement::SVG_UNIT_TYPE_UNKNOWN);
-}
-
-SVGClipPathElementImpl::~SVGClipPathElementImpl()
-{
- if(m_clipPathUnits)
- m_clipPathUnits->deref();
-}
-
-SVGAnimatedEnumerationImpl *SVGClipPathElementImpl::clipPathUnits() const
-{
- return m_clipPathUnits;
-}
-
-/*
-@namespace KSVG
-@begin SVGClipPathElementImpl::s_hashTable 2
- clipPathUnits SVGClipPathElementImpl::ClipPathUnits DontDelete|ReadOnly
-@end
-*/
-
-Value SVGClipPathElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case ClipPathUnits:
- return m_clipPathUnits->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGClipPathElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case ClipPathUnits:
- if(value.toString(exec).qstring() == "objectBoundingBox")
- m_clipPathUnits->setBaseVal(SVGClipPathElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
- else
- m_clipPathUnits->setBaseVal(SVGClipPathElement::SVG_UNIT_TYPE_USERSPACEONUSE);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGClipPathElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if attribute not specified, use userSpaceOnUse
- if(KSVG_TOKEN_NOT_PARSED(ClipPathUnits))
- KSVG_SET_ALT_ATTRIBUTE(ClipPathUnits, "userSpaceOnUse")
-
- if(!m_item)
- m_item = ownerDoc()->canvas()->createClipPath(this);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGClipPathElementImpl.cpp b/ksvg/impl/SVGClipPathElementImpl.cpp
new file mode 100644
index 00000000..03512a41
--- /dev/null
+++ b/ksvg/impl/SVGClipPathElementImpl.cpp
@@ -0,0 +1,102 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGClipPathElement.h"
+#include "SVGClipPathElementImpl.h"
+#include "KSVGCanvas.h"
+#include "SVGDocumentImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+#include "SVGClipPathElementImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGClipPathElementImpl::SVGClipPathElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl(), SVGBBoxTarget()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_clipPathUnits = new SVGAnimatedEnumerationImpl();
+ m_clipPathUnits->ref();
+ m_clipPathUnits->setBaseVal(SVGClipPathElement::SVG_UNIT_TYPE_UNKNOWN);
+}
+
+SVGClipPathElementImpl::~SVGClipPathElementImpl()
+{
+ if(m_clipPathUnits)
+ m_clipPathUnits->deref();
+}
+
+SVGAnimatedEnumerationImpl *SVGClipPathElementImpl::clipPathUnits() const
+{
+ return m_clipPathUnits;
+}
+
+/*
+@namespace KSVG
+@begin SVGClipPathElementImpl::s_hashTable 2
+ clipPathUnits SVGClipPathElementImpl::ClipPathUnits DontDelete|ReadOnly
+@end
+*/
+
+Value SVGClipPathElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case ClipPathUnits:
+ return m_clipPathUnits->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGClipPathElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case ClipPathUnits:
+ if(value.toString(exec).qstring() == "objectBoundingBox")
+ m_clipPathUnits->setBaseVal(SVGClipPathElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+ else
+ m_clipPathUnits->setBaseVal(SVGClipPathElement::SVG_UNIT_TYPE_USERSPACEONUSE);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGClipPathElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if attribute not specified, use userSpaceOnUse
+ if(KSVG_TOKEN_NOT_PARSED(ClipPathUnits))
+ KSVG_SET_ALT_ATTRIBUTE(ClipPathUnits, "userSpaceOnUse")
+
+ if(!m_item)
+ m_item = ownerDoc()->canvas()->createClipPath(this);
+}
diff --git a/ksvg/impl/SVGClipPathElementImpl.h b/ksvg/impl/SVGClipPathElementImpl.h
index 1e1879a9..9a7429d1 100644
--- a/ksvg/impl/SVGClipPathElementImpl.h
+++ b/ksvg/impl/SVGClipPathElementImpl.h
@@ -76,5 +76,3 @@ KSVG_REGISTER_ELEMENT(SVGClipPathElementImpl, "clipPath")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGColorImpl.cc b/ksvg/impl/SVGColorImpl.cc
deleted file mode 100644
index 799c43ec..00000000
--- a/ksvg/impl/SVGColorImpl.cc
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqstringlist.h>
-
-#include "SVGColor.h"
-
-#include "SVGColorImpl.h"
-#include "SVGNumberImpl.h"
-#include "SVGICCColorImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGNumberListImpl.h"
-#include "SVGURIReferenceImpl.h"
-#include "SVGColorProfileElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGColorImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-SVGColorImpl::SVGColorImpl(SVGElementImpl *object) : m_object(object)
-{
- m_colorType = SVG_COLORTYPE_UNKNOWN;
- m_iccColor = 0;
-}
-
-SVGColorImpl::SVGColorImpl(const SVGColorImpl &other) : DOM::DomShared()
-{
- (*this) = other;
-}
-
-SVGColorImpl::~SVGColorImpl()
-{
- if(m_iccColor)
- m_iccColor->deref();
-}
-
-SVGColorImpl &SVGColorImpl::operator=(const SVGColorImpl &other)
-{
- m_colorType = other.m_colorType;
- m_rgbColor = other.m_rgbColor;
-
- if(m_iccColor && other.m_iccColor)
- *m_iccColor = *(other.m_iccColor);
-
- return *this;
-}
-
-unsigned short SVGColorImpl::colorType() const
-{
- return m_colorType;
-}
-
-DOM::RGBColor SVGColorImpl::rgbColor() const
-{
- return m_rgbColor;
-}
-
-SVGICCColorImpl *SVGColorImpl::iccColor() const
-{
- return m_iccColor;
-}
-
-void SVGColorImpl::setRGBColor(TQColor color)
-{
- m_colorType = SVG_COLORTYPE_RGBCOLOR;
- m_rgbColor = DOM::RGBColor(color.rgb());
-}
-
-void SVGColorImpl::setRGBColor(int r, int g, int b)
-{
- m_colorType = SVG_COLORTYPE_RGBCOLOR;
- m_rgbColor = DOM::RGBColor(TQColor(r, g, b).rgb());
-}
-
-void SVGColorImpl::setRGBColor(const DOM::DOMString &rgbColor)
-{
- if(rgbColor == "aliceblue")
- setRGBColor(240, 248, 255);
- else if(rgbColor == "antiquewhite")
- setRGBColor(250, 235, 215);
- else if(rgbColor == "aqua")
- setRGBColor(0, 255, 255);
- else if(rgbColor == "aquamarine")
- setRGBColor(127, 255, 212);
- else if(rgbColor == "azure")
- setRGBColor(240, 255, 255);
- else if(rgbColor == "beige")
- setRGBColor(245, 245, 220);
- else if(rgbColor == "bisque")
- setRGBColor(255, 228, 196);
- else if(rgbColor == "black")
- setRGBColor(0, 0, 0);
- else if(rgbColor == "blanchedalmond")
- setRGBColor(255, 235, 205);
- else if(rgbColor == "blue")
- setRGBColor(0, 0, 255);
- else if(rgbColor == "blueviolet")
- setRGBColor(138, 43, 226);
- else if(rgbColor == "brown")
- setRGBColor(165, 42, 42);
- else if(rgbColor == "burlywood")
- setRGBColor(222, 184, 135);
- else if(rgbColor == "cadetblue")
- setRGBColor(95, 158, 160);
- else if(rgbColor == "chartreuse")
- setRGBColor(127, 255, 0);
- else if(rgbColor == "chocolate")
- setRGBColor(210, 105, 30);
- else if(rgbColor == "coral")
- setRGBColor(255, 127, 80);
- else if(rgbColor == "cornflowerblue")
- setRGBColor(100, 149, 237);
- else if(rgbColor == "cornsilk")
- setRGBColor(255, 248, 220);
- else if(rgbColor == "crimson")
- setRGBColor(220, 20, 60);
- else if(rgbColor == "cyan")
- setRGBColor(0, 255, 255);
- else if(rgbColor == "darkblue")
- setRGBColor(0, 0, 139);
- else if(rgbColor == "darkcyan")
- setRGBColor(0, 139, 139);
- else if(rgbColor == "darkgoldenrod")
- setRGBColor(184, 134, 11);
- else if(rgbColor == "darkgray")
- setRGBColor(169, 169, 169);
- else if(rgbColor == "darkgrey")
- setRGBColor(169, 169, 169);
- else if(rgbColor == "darkgreen")
- setRGBColor(0, 100, 0);
- else if(rgbColor == "darkkhaki")
- setRGBColor(189, 183, 107);
- else if(rgbColor == "darkmagenta")
- setRGBColor(139, 0, 139);
- else if(rgbColor == "darkolivegreen")
- setRGBColor(85, 107, 47);
- else if(rgbColor == "darkorange")
- setRGBColor(255, 140, 0);
- else if(rgbColor == "darkorchid")
- setRGBColor(153, 50, 204);
- else if(rgbColor == "darkred")
- setRGBColor(139, 0, 0);
- else if(rgbColor == "darksalmon")
- setRGBColor(233, 150, 122);
- else if(rgbColor == "darkseagreen")
- setRGBColor(143, 188, 143);
- else if(rgbColor == "darkslateblue")
- setRGBColor(72, 61, 139);
- else if(rgbColor == "darkslategray")
- setRGBColor(47, 79, 79);
- else if(rgbColor == "darkslategrey")
- setRGBColor(47, 79, 79);
- else if(rgbColor == "darkturquoise")
- setRGBColor(0, 206, 209);
- else if(rgbColor == "darkviolet")
- setRGBColor(148, 0, 211);
- else if(rgbColor == "deeppink")
- setRGBColor(255, 20, 147);
- else if(rgbColor == "deepskyblue")
- setRGBColor(0, 191, 255);
- else if(rgbColor == "dimgray")
- setRGBColor(105, 105, 105);
- else if(rgbColor == "dimgrey")
- setRGBColor(105, 105, 105);
- else if(rgbColor == "dodgerblue")
- setRGBColor(30, 144, 255);
- else if(rgbColor == "firebrick")
- setRGBColor(178, 34, 34);
- else if(rgbColor == "floralwhite")
- setRGBColor(255, 250, 240);
- else if(rgbColor == "forestgreen")
- setRGBColor(34, 139, 34);
- else if(rgbColor == "fuchsia")
- setRGBColor(255, 0, 255);
- else if(rgbColor == "gainsboro")
- setRGBColor(220, 220, 220);
- else if(rgbColor == "ghostwhite")
- setRGBColor(248, 248, 255);
- else if(rgbColor == "gold")
- setRGBColor(255, 215, 0);
- else if(rgbColor == "goldenrod")
- setRGBColor(218, 165, 32);
- else if(rgbColor == "gray")
- setRGBColor(128, 128, 128);
- else if(rgbColor == "grey")
- setRGBColor(128, 128, 128);
- else if(rgbColor == "green")
- setRGBColor(0, 128, 0);
- else if(rgbColor == "greenyellow")
- setRGBColor(173, 255, 47);
- else if(rgbColor == "honeydew")
- setRGBColor(240, 255, 240);
- else if(rgbColor == "hotpink")
- setRGBColor(255, 105, 180);
- else if(rgbColor == "indianred")
- setRGBColor(205, 92, 92);
- else if(rgbColor == "indigo")
- setRGBColor(75, 0, 130);
- else if(rgbColor == "ivory")
- setRGBColor(255, 255, 240);
- else if(rgbColor == "khaki")
- setRGBColor(240, 230, 140);
- else if(rgbColor == "lavender")
- setRGBColor(230, 230, 250);
- else if(rgbColor == "lavenderblush")
- setRGBColor(255, 240, 245);
- else if(rgbColor == "lawngreen")
- setRGBColor(124, 252, 0);
- else if(rgbColor == "lemonchiffon")
- setRGBColor(255, 250, 205);
- else if(rgbColor == "lightblue")
- setRGBColor(173, 216, 230);
- else if(rgbColor == "lightcoral")
- setRGBColor(240, 128, 128);
- else if(rgbColor == "lightcyan")
- setRGBColor(224, 255, 255);
- else if(rgbColor == "lightgoldenrodyellow")
- setRGBColor(250, 250, 210);
- else if(rgbColor == "lightgray")
- setRGBColor(211, 211, 211);
- else if(rgbColor == "lightgrey")
- setRGBColor(211, 211, 211);
- else if(rgbColor == "lightgreen")
- setRGBColor(144, 238, 144);
- else if(rgbColor == "lightpink")
- setRGBColor(255, 182, 193);
- else if(rgbColor == "lightsalmon")
- setRGBColor(255, 160, 122);
- else if(rgbColor == "lightseagreen")
- setRGBColor(32, 178, 170);
- else if(rgbColor == "lightskyblue")
- setRGBColor(135, 206, 250);
- else if(rgbColor == "lightslategray")
- setRGBColor(119, 136, 153);
- else if(rgbColor == "lightslategrey")
- setRGBColor(119, 136, 153);
- else if(rgbColor == "lightsteelblue")
- setRGBColor(176, 196, 222);
- else if(rgbColor == "lightyellow")
- setRGBColor(255, 255, 224);
- else if(rgbColor == "lime")
- setRGBColor(0, 255, 0);
- else if(rgbColor == "limegreen")
- setRGBColor(50, 205, 50);
- else if(rgbColor == "linen")
- setRGBColor(250, 240, 230);
- else if(rgbColor == "magenta")
- setRGBColor(255, 0, 255);
- else if(rgbColor == "maroon")
- setRGBColor(128, 0, 0);
- else if(rgbColor == "mediumaquamarine")
- setRGBColor(102, 205, 170);
- else if(rgbColor == "mediumblue")
- setRGBColor(0, 0, 205);
- else if(rgbColor == "mediumorchid")
- setRGBColor(186, 85, 211);
- else if(rgbColor == "mediumpurple")
- setRGBColor(147, 112, 219);
- else if(rgbColor == "mediumseagreen")
- setRGBColor(60, 179, 113);
- else if(rgbColor == "mediumslateblue")
- setRGBColor(123, 104, 238);
- else if(rgbColor == "mediumspringgreen")
- setRGBColor(0, 250, 154);
- else if(rgbColor == "mediumturquoise")
- setRGBColor(72, 209, 204);
- else if(rgbColor == "mediumvioletred")
- setRGBColor(199, 21, 133);
- else if(rgbColor == "midnightblue")
- setRGBColor(25, 25, 112);
- else if(rgbColor == "mintcream")
- setRGBColor(245, 255, 250);
- else if(rgbColor == "mistyrose")
- setRGBColor(255, 228, 225);
- else if(rgbColor == "moccasin")
- setRGBColor(255, 228, 181);
- else if(rgbColor == "navajowhite")
- setRGBColor(255, 222, 173);
- else if(rgbColor == "navy")
- setRGBColor(0, 0, 128);
- else if(rgbColor == "oldlace")
- setRGBColor(253, 245, 230);
- else if(rgbColor == "olive")
- setRGBColor(128, 128, 0);
- else if(rgbColor == "olivedrab")
- setRGBColor(107, 142, 35);
- else if(rgbColor == "orange")
- setRGBColor(255, 165, 0);
- else if(rgbColor == "orangered")
- setRGBColor(255, 69, 0);
- else if(rgbColor == "orchid")
- setRGBColor(218, 112, 214);
- else if(rgbColor == "palegoldenrod")
- setRGBColor(238, 232, 170);
- else if(rgbColor == "palegreen")
- setRGBColor(152, 251, 152);
- else if(rgbColor == "paleturquoise")
- setRGBColor(175, 238, 238);
- else if(rgbColor == "palevioletred")
- setRGBColor(219, 112, 147);
- else if(rgbColor == "papayawhip")
- setRGBColor(255, 239, 213);
- else if(rgbColor == "peachpuff")
- setRGBColor(255, 218, 185);
- else if(rgbColor == "peru")
- setRGBColor(205, 133, 63);
- else if(rgbColor == "pink")
- setRGBColor(255, 192, 203);
- else if(rgbColor == "plum")
- setRGBColor(221, 160, 221);
- else if(rgbColor == "powderblue")
- setRGBColor(176, 224, 230);
- else if(rgbColor == "purple")
- setRGBColor(128, 0, 128);
- else if(rgbColor == "red")
- setRGBColor(255, 0, 0);
- else if(rgbColor == "rosybrown")
- setRGBColor(188, 143, 143);
- else if(rgbColor == "royalblue")
- setRGBColor(65, 105, 225);
- else if(rgbColor == "saddlebrown")
- setRGBColor(139, 69, 19);
- else if(rgbColor == "salmon")
- setRGBColor(250, 128, 114);
- else if(rgbColor == "sandybrown")
- setRGBColor(244, 164, 96);
- else if(rgbColor == "seagreen")
- setRGBColor(46, 139, 87);
- else if(rgbColor == "seashell")
- setRGBColor(255, 245, 238);
- else if(rgbColor == "sienna")
- setRGBColor(160, 82, 45);
- else if(rgbColor == "silver")
- setRGBColor(192, 192, 192);
- else if(rgbColor == "skyblue")
- setRGBColor(135, 206, 235);
- else if(rgbColor == "slateblue")
- setRGBColor(106, 90, 205);
- else if(rgbColor == "slategray")
- setRGBColor(112, 128, 144);
- else if(rgbColor == "slategrey")
- setRGBColor(112, 128, 144);
- else if(rgbColor == "snow")
- setRGBColor(255, 250, 250);
- else if(rgbColor == "springgreen")
- setRGBColor(0, 255, 127);
- else if(rgbColor == "steelblue")
- setRGBColor(70, 130, 180);
- else if(rgbColor == "tan")
- setRGBColor(210, 180, 140);
- else if(rgbColor == "teal")
- setRGBColor(0, 128, 128);
- else if(rgbColor == "thistle")
- setRGBColor(216, 191, 216);
- else if(rgbColor == "tomato")
- setRGBColor(255, 99, 71);
- else if(rgbColor == "turquoise")
- setRGBColor(64, 224, 208);
- else if(rgbColor == "violet")
- setRGBColor(238, 130, 238);
- else if(rgbColor == "wheat")
- setRGBColor(245, 222, 179);
- else if(rgbColor == "white")
- setRGBColor(255, 255, 255);
- else if(rgbColor == "whitesmoke")
- setRGBColor(245, 245, 245);
- else if(rgbColor == "yellow")
- setRGBColor(255, 255, 0);
- else if(rgbColor == "yellowgreen")
- setRGBColor(154, 205, 50);
-}
-
-void SVGColorImpl::setRGBColorICCColor(const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- TQColor color;
-
- TQString content = iccColor.string().right(iccColor.string().length() - 10);
- TQString iccTarget = content.mid(0, content.find(','));
-
- TQStringList colors = TQStringList::split(',', content);
- TQString r = colors[1];
- TQString g = colors[2];
- TQString b = colors[3].left(colors[3].length() - 1);
-
- iccTarget = SVGURIReferenceImpl::getTarget(iccTarget);
-
- SVGColorProfileElementImpl *handle = 0;
- if(m_object)
- handle = static_cast<SVGColorProfileElementImpl *>(dynamic_cast<SVGElementImpl *>(m_object)->ownerDoc()->rootElement()->getElementById(iccTarget));
-
- if(iccTarget.isEmpty() || !handle)
- {
- color.setNamedColor(rgbColor.string().stripWhiteSpace());
- setRGBColor(color);
- }
- else
- {
- color.setRgb(handle->correctPixel(r.toFloat() * 257, g.toFloat() * 257, b.toFloat() * 257));
- setRGBColor(color);
-
- m_colorType = SVG_COLORTYPE_RGBCOLOR_ICCCOLOR;
-
- if(!m_iccColor)
- {
- m_iccColor = new SVGICCColorImpl();
- m_iccColor->ref();
- }
-
- m_iccColor->setColorProfile(DOM::DOMString(content));
-
- SVGNumberImpl *rnumber = SVGSVGElementImpl::createSVGNumber();
- rnumber->setValue(r.toFloat());
-
- SVGNumberImpl *gnumber = SVGSVGElementImpl::createSVGNumber();
- gnumber->setValue(g.toFloat());
-
- SVGNumberImpl *bnumber = SVGSVGElementImpl::createSVGNumber();
- bnumber->setValue(b.toFloat());
-
- m_iccColor->colors()->clear();
- m_iccColor->colors()->appendItem(bnumber);
- m_iccColor->colors()->appendItem(gnumber);
- m_iccColor->colors()->appendItem(rnumber);
- }
-}
-
-void SVGColorImpl::setColor(unsigned short colorType, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- m_colorType = colorType;
-
- if(m_colorType == SVG_COLORTYPE_UNKNOWN || m_colorType == SVG_COLORTYPE_CURRENTCOLOR)
- return;
-
- setRGBColorICCColor(rgbColor, iccColor);
-}
-
-// Ecma stuff
-/*
-@namespace KSVG
-@begin SVGColorImpl::s_hashTable 5
- colorType SVGColorImpl::ColorType DontDelete|ReadOnly
- RGBColor SVGColorImpl::RGBColor DontDelete|ReadOnly
- ICCColor SVGColorImpl::ICCColor DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGColorImplProto::s_hashTable 5
- setRGBColor SVGColorImpl::SetRGBColor DontDelete|Function 1
- setRGBColorICCColor SVGColorImpl::SetRGBColorICCColor DontDelete|Function 2
- setColor SVGColorImpl::SetColor DontDelete|Function 3
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGColor", SVGColorImplProto, SVGColorImplProtoFunc)
-
-Value SVGColorImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case ColorType:
- return Number(colorType());
-#ifdef __GNUC__
-#warning FIXME bridge stuff
-#endif
- case RGBColor:
- return Undefined();
- case ICCColor:
- return m_iccColor->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGColorImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGColorImpl)
-
- switch(id)
- {
- case SVGColorImpl::SetRGBColor:
- obj->setRGBColor(args[0].toString(exec).string());
- break;
- case SVGColorImpl::SetRGBColorICCColor:
- obj->setRGBColorICCColor(args[0].toString(exec).string(), args[1].toString(exec).string());
- break;
- case SVGColorImpl::SetColor:
- obj->setColor(static_cast<unsigned short>(args[0].toNumber(exec)), args[1].toString(exec).string(), args[2].toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-/*
-@namespace KSVG
-@begin SVGColorImplConstructor::s_hashTable 5
- SVG_COLORTYPE_UNKNOWN KSVG::SVG_COLORTYPE_UNKNOWN DontDelete|ReadOnly
- SVG_COLORTYPE_RGBCOLOR KSVG::SVG_COLORTYPE_RGBCOLOR DontDelete|ReadOnly
- SVG_COLORTYPE_RGBCOLOR_ICCCOLOR KSVG::SVG_COLORTYPE_RGBCOLOR_ICCCOLOR DontDelete|ReadOnly
- SVG_COLORTYPE_CURRENTCOLOR KSVG::SVG_COLORTYPE_CURRENTCOLOR DontDelete|ReadOnly
-@end
-*/
-
-Value SVGColorImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGColorImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGColorImplConstructor>(exec, "[[svgcolor.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGColorImpl.cpp b/ksvg/impl/SVGColorImpl.cpp
new file mode 100644
index 00000000..c5c44bcc
--- /dev/null
+++ b/ksvg/impl/SVGColorImpl.cpp
@@ -0,0 +1,538 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqstringlist.h>
+
+#include "SVGColor.h"
+
+#include "SVGColorImpl.h"
+#include "SVGNumberImpl.h"
+#include "SVGICCColorImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGNumberListImpl.h"
+#include "SVGURIReferenceImpl.h"
+#include "SVGColorProfileElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGColorImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+SVGColorImpl::SVGColorImpl(SVGElementImpl *object) : m_object(object)
+{
+ m_colorType = SVG_COLORTYPE_UNKNOWN;
+ m_iccColor = 0;
+}
+
+SVGColorImpl::SVGColorImpl(const SVGColorImpl &other) : DOM::DomShared()
+{
+ (*this) = other;
+}
+
+SVGColorImpl::~SVGColorImpl()
+{
+ if(m_iccColor)
+ m_iccColor->deref();
+}
+
+SVGColorImpl &SVGColorImpl::operator=(const SVGColorImpl &other)
+{
+ m_colorType = other.m_colorType;
+ m_rgbColor = other.m_rgbColor;
+
+ if(m_iccColor && other.m_iccColor)
+ *m_iccColor = *(other.m_iccColor);
+
+ return *this;
+}
+
+unsigned short SVGColorImpl::colorType() const
+{
+ return m_colorType;
+}
+
+DOM::RGBColor SVGColorImpl::rgbColor() const
+{
+ return m_rgbColor;
+}
+
+SVGICCColorImpl *SVGColorImpl::iccColor() const
+{
+ return m_iccColor;
+}
+
+void SVGColorImpl::setRGBColor(TQColor color)
+{
+ m_colorType = SVG_COLORTYPE_RGBCOLOR;
+ m_rgbColor = DOM::RGBColor(color.rgb());
+}
+
+void SVGColorImpl::setRGBColor(int r, int g, int b)
+{
+ m_colorType = SVG_COLORTYPE_RGBCOLOR;
+ m_rgbColor = DOM::RGBColor(TQColor(r, g, b).rgb());
+}
+
+void SVGColorImpl::setRGBColor(const DOM::DOMString &rgbColor)
+{
+ if(rgbColor == "aliceblue")
+ setRGBColor(240, 248, 255);
+ else if(rgbColor == "antiquewhite")
+ setRGBColor(250, 235, 215);
+ else if(rgbColor == "aqua")
+ setRGBColor(0, 255, 255);
+ else if(rgbColor == "aquamarine")
+ setRGBColor(127, 255, 212);
+ else if(rgbColor == "azure")
+ setRGBColor(240, 255, 255);
+ else if(rgbColor == "beige")
+ setRGBColor(245, 245, 220);
+ else if(rgbColor == "bisque")
+ setRGBColor(255, 228, 196);
+ else if(rgbColor == "black")
+ setRGBColor(0, 0, 0);
+ else if(rgbColor == "blanchedalmond")
+ setRGBColor(255, 235, 205);
+ else if(rgbColor == "blue")
+ setRGBColor(0, 0, 255);
+ else if(rgbColor == "blueviolet")
+ setRGBColor(138, 43, 226);
+ else if(rgbColor == "brown")
+ setRGBColor(165, 42, 42);
+ else if(rgbColor == "burlywood")
+ setRGBColor(222, 184, 135);
+ else if(rgbColor == "cadetblue")
+ setRGBColor(95, 158, 160);
+ else if(rgbColor == "chartreuse")
+ setRGBColor(127, 255, 0);
+ else if(rgbColor == "chocolate")
+ setRGBColor(210, 105, 30);
+ else if(rgbColor == "coral")
+ setRGBColor(255, 127, 80);
+ else if(rgbColor == "cornflowerblue")
+ setRGBColor(100, 149, 237);
+ else if(rgbColor == "cornsilk")
+ setRGBColor(255, 248, 220);
+ else if(rgbColor == "crimson")
+ setRGBColor(220, 20, 60);
+ else if(rgbColor == "cyan")
+ setRGBColor(0, 255, 255);
+ else if(rgbColor == "darkblue")
+ setRGBColor(0, 0, 139);
+ else if(rgbColor == "darkcyan")
+ setRGBColor(0, 139, 139);
+ else if(rgbColor == "darkgoldenrod")
+ setRGBColor(184, 134, 11);
+ else if(rgbColor == "darkgray")
+ setRGBColor(169, 169, 169);
+ else if(rgbColor == "darkgrey")
+ setRGBColor(169, 169, 169);
+ else if(rgbColor == "darkgreen")
+ setRGBColor(0, 100, 0);
+ else if(rgbColor == "darkkhaki")
+ setRGBColor(189, 183, 107);
+ else if(rgbColor == "darkmagenta")
+ setRGBColor(139, 0, 139);
+ else if(rgbColor == "darkolivegreen")
+ setRGBColor(85, 107, 47);
+ else if(rgbColor == "darkorange")
+ setRGBColor(255, 140, 0);
+ else if(rgbColor == "darkorchid")
+ setRGBColor(153, 50, 204);
+ else if(rgbColor == "darkred")
+ setRGBColor(139, 0, 0);
+ else if(rgbColor == "darksalmon")
+ setRGBColor(233, 150, 122);
+ else if(rgbColor == "darkseagreen")
+ setRGBColor(143, 188, 143);
+ else if(rgbColor == "darkslateblue")
+ setRGBColor(72, 61, 139);
+ else if(rgbColor == "darkslategray")
+ setRGBColor(47, 79, 79);
+ else if(rgbColor == "darkslategrey")
+ setRGBColor(47, 79, 79);
+ else if(rgbColor == "darkturquoise")
+ setRGBColor(0, 206, 209);
+ else if(rgbColor == "darkviolet")
+ setRGBColor(148, 0, 211);
+ else if(rgbColor == "deeppink")
+ setRGBColor(255, 20, 147);
+ else if(rgbColor == "deepskyblue")
+ setRGBColor(0, 191, 255);
+ else if(rgbColor == "dimgray")
+ setRGBColor(105, 105, 105);
+ else if(rgbColor == "dimgrey")
+ setRGBColor(105, 105, 105);
+ else if(rgbColor == "dodgerblue")
+ setRGBColor(30, 144, 255);
+ else if(rgbColor == "firebrick")
+ setRGBColor(178, 34, 34);
+ else if(rgbColor == "floralwhite")
+ setRGBColor(255, 250, 240);
+ else if(rgbColor == "forestgreen")
+ setRGBColor(34, 139, 34);
+ else if(rgbColor == "fuchsia")
+ setRGBColor(255, 0, 255);
+ else if(rgbColor == "gainsboro")
+ setRGBColor(220, 220, 220);
+ else if(rgbColor == "ghostwhite")
+ setRGBColor(248, 248, 255);
+ else if(rgbColor == "gold")
+ setRGBColor(255, 215, 0);
+ else if(rgbColor == "goldenrod")
+ setRGBColor(218, 165, 32);
+ else if(rgbColor == "gray")
+ setRGBColor(128, 128, 128);
+ else if(rgbColor == "grey")
+ setRGBColor(128, 128, 128);
+ else if(rgbColor == "green")
+ setRGBColor(0, 128, 0);
+ else if(rgbColor == "greenyellow")
+ setRGBColor(173, 255, 47);
+ else if(rgbColor == "honeydew")
+ setRGBColor(240, 255, 240);
+ else if(rgbColor == "hotpink")
+ setRGBColor(255, 105, 180);
+ else if(rgbColor == "indianred")
+ setRGBColor(205, 92, 92);
+ else if(rgbColor == "indigo")
+ setRGBColor(75, 0, 130);
+ else if(rgbColor == "ivory")
+ setRGBColor(255, 255, 240);
+ else if(rgbColor == "khaki")
+ setRGBColor(240, 230, 140);
+ else if(rgbColor == "lavender")
+ setRGBColor(230, 230, 250);
+ else if(rgbColor == "lavenderblush")
+ setRGBColor(255, 240, 245);
+ else if(rgbColor == "lawngreen")
+ setRGBColor(124, 252, 0);
+ else if(rgbColor == "lemonchiffon")
+ setRGBColor(255, 250, 205);
+ else if(rgbColor == "lightblue")
+ setRGBColor(173, 216, 230);
+ else if(rgbColor == "lightcoral")
+ setRGBColor(240, 128, 128);
+ else if(rgbColor == "lightcyan")
+ setRGBColor(224, 255, 255);
+ else if(rgbColor == "lightgoldenrodyellow")
+ setRGBColor(250, 250, 210);
+ else if(rgbColor == "lightgray")
+ setRGBColor(211, 211, 211);
+ else if(rgbColor == "lightgrey")
+ setRGBColor(211, 211, 211);
+ else if(rgbColor == "lightgreen")
+ setRGBColor(144, 238, 144);
+ else if(rgbColor == "lightpink")
+ setRGBColor(255, 182, 193);
+ else if(rgbColor == "lightsalmon")
+ setRGBColor(255, 160, 122);
+ else if(rgbColor == "lightseagreen")
+ setRGBColor(32, 178, 170);
+ else if(rgbColor == "lightskyblue")
+ setRGBColor(135, 206, 250);
+ else if(rgbColor == "lightslategray")
+ setRGBColor(119, 136, 153);
+ else if(rgbColor == "lightslategrey")
+ setRGBColor(119, 136, 153);
+ else if(rgbColor == "lightsteelblue")
+ setRGBColor(176, 196, 222);
+ else if(rgbColor == "lightyellow")
+ setRGBColor(255, 255, 224);
+ else if(rgbColor == "lime")
+ setRGBColor(0, 255, 0);
+ else if(rgbColor == "limegreen")
+ setRGBColor(50, 205, 50);
+ else if(rgbColor == "linen")
+ setRGBColor(250, 240, 230);
+ else if(rgbColor == "magenta")
+ setRGBColor(255, 0, 255);
+ else if(rgbColor == "maroon")
+ setRGBColor(128, 0, 0);
+ else if(rgbColor == "mediumaquamarine")
+ setRGBColor(102, 205, 170);
+ else if(rgbColor == "mediumblue")
+ setRGBColor(0, 0, 205);
+ else if(rgbColor == "mediumorchid")
+ setRGBColor(186, 85, 211);
+ else if(rgbColor == "mediumpurple")
+ setRGBColor(147, 112, 219);
+ else if(rgbColor == "mediumseagreen")
+ setRGBColor(60, 179, 113);
+ else if(rgbColor == "mediumslateblue")
+ setRGBColor(123, 104, 238);
+ else if(rgbColor == "mediumspringgreen")
+ setRGBColor(0, 250, 154);
+ else if(rgbColor == "mediumturquoise")
+ setRGBColor(72, 209, 204);
+ else if(rgbColor == "mediumvioletred")
+ setRGBColor(199, 21, 133);
+ else if(rgbColor == "midnightblue")
+ setRGBColor(25, 25, 112);
+ else if(rgbColor == "mintcream")
+ setRGBColor(245, 255, 250);
+ else if(rgbColor == "mistyrose")
+ setRGBColor(255, 228, 225);
+ else if(rgbColor == "moccasin")
+ setRGBColor(255, 228, 181);
+ else if(rgbColor == "navajowhite")
+ setRGBColor(255, 222, 173);
+ else if(rgbColor == "navy")
+ setRGBColor(0, 0, 128);
+ else if(rgbColor == "oldlace")
+ setRGBColor(253, 245, 230);
+ else if(rgbColor == "olive")
+ setRGBColor(128, 128, 0);
+ else if(rgbColor == "olivedrab")
+ setRGBColor(107, 142, 35);
+ else if(rgbColor == "orange")
+ setRGBColor(255, 165, 0);
+ else if(rgbColor == "orangered")
+ setRGBColor(255, 69, 0);
+ else if(rgbColor == "orchid")
+ setRGBColor(218, 112, 214);
+ else if(rgbColor == "palegoldenrod")
+ setRGBColor(238, 232, 170);
+ else if(rgbColor == "palegreen")
+ setRGBColor(152, 251, 152);
+ else if(rgbColor == "paleturquoise")
+ setRGBColor(175, 238, 238);
+ else if(rgbColor == "palevioletred")
+ setRGBColor(219, 112, 147);
+ else if(rgbColor == "papayawhip")
+ setRGBColor(255, 239, 213);
+ else if(rgbColor == "peachpuff")
+ setRGBColor(255, 218, 185);
+ else if(rgbColor == "peru")
+ setRGBColor(205, 133, 63);
+ else if(rgbColor == "pink")
+ setRGBColor(255, 192, 203);
+ else if(rgbColor == "plum")
+ setRGBColor(221, 160, 221);
+ else if(rgbColor == "powderblue")
+ setRGBColor(176, 224, 230);
+ else if(rgbColor == "purple")
+ setRGBColor(128, 0, 128);
+ else if(rgbColor == "red")
+ setRGBColor(255, 0, 0);
+ else if(rgbColor == "rosybrown")
+ setRGBColor(188, 143, 143);
+ else if(rgbColor == "royalblue")
+ setRGBColor(65, 105, 225);
+ else if(rgbColor == "saddlebrown")
+ setRGBColor(139, 69, 19);
+ else if(rgbColor == "salmon")
+ setRGBColor(250, 128, 114);
+ else if(rgbColor == "sandybrown")
+ setRGBColor(244, 164, 96);
+ else if(rgbColor == "seagreen")
+ setRGBColor(46, 139, 87);
+ else if(rgbColor == "seashell")
+ setRGBColor(255, 245, 238);
+ else if(rgbColor == "sienna")
+ setRGBColor(160, 82, 45);
+ else if(rgbColor == "silver")
+ setRGBColor(192, 192, 192);
+ else if(rgbColor == "skyblue")
+ setRGBColor(135, 206, 235);
+ else if(rgbColor == "slateblue")
+ setRGBColor(106, 90, 205);
+ else if(rgbColor == "slategray")
+ setRGBColor(112, 128, 144);
+ else if(rgbColor == "slategrey")
+ setRGBColor(112, 128, 144);
+ else if(rgbColor == "snow")
+ setRGBColor(255, 250, 250);
+ else if(rgbColor == "springgreen")
+ setRGBColor(0, 255, 127);
+ else if(rgbColor == "steelblue")
+ setRGBColor(70, 130, 180);
+ else if(rgbColor == "tan")
+ setRGBColor(210, 180, 140);
+ else if(rgbColor == "teal")
+ setRGBColor(0, 128, 128);
+ else if(rgbColor == "thistle")
+ setRGBColor(216, 191, 216);
+ else if(rgbColor == "tomato")
+ setRGBColor(255, 99, 71);
+ else if(rgbColor == "turquoise")
+ setRGBColor(64, 224, 208);
+ else if(rgbColor == "violet")
+ setRGBColor(238, 130, 238);
+ else if(rgbColor == "wheat")
+ setRGBColor(245, 222, 179);
+ else if(rgbColor == "white")
+ setRGBColor(255, 255, 255);
+ else if(rgbColor == "whitesmoke")
+ setRGBColor(245, 245, 245);
+ else if(rgbColor == "yellow")
+ setRGBColor(255, 255, 0);
+ else if(rgbColor == "yellowgreen")
+ setRGBColor(154, 205, 50);
+}
+
+void SVGColorImpl::setRGBColorICCColor(const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ TQColor color;
+
+ TQString content = iccColor.string().right(iccColor.string().length() - 10);
+ TQString iccTarget = content.mid(0, content.find(','));
+
+ TQStringList colors = TQStringList::split(',', content);
+ TQString r = colors[1];
+ TQString g = colors[2];
+ TQString b = colors[3].left(colors[3].length() - 1);
+
+ iccTarget = SVGURIReferenceImpl::getTarget(iccTarget);
+
+ SVGColorProfileElementImpl *handle = 0;
+ if(m_object)
+ handle = static_cast<SVGColorProfileElementImpl *>(dynamic_cast<SVGElementImpl *>(m_object)->ownerDoc()->rootElement()->getElementById(iccTarget));
+
+ if(iccTarget.isEmpty() || !handle)
+ {
+ color.setNamedColor(rgbColor.string().stripWhiteSpace());
+ setRGBColor(color);
+ }
+ else
+ {
+ color.setRgb(handle->correctPixel(r.toFloat() * 257, g.toFloat() * 257, b.toFloat() * 257));
+ setRGBColor(color);
+
+ m_colorType = SVG_COLORTYPE_RGBCOLOR_ICCCOLOR;
+
+ if(!m_iccColor)
+ {
+ m_iccColor = new SVGICCColorImpl();
+ m_iccColor->ref();
+ }
+
+ m_iccColor->setColorProfile(DOM::DOMString(content));
+
+ SVGNumberImpl *rnumber = SVGSVGElementImpl::createSVGNumber();
+ rnumber->setValue(r.toFloat());
+
+ SVGNumberImpl *gnumber = SVGSVGElementImpl::createSVGNumber();
+ gnumber->setValue(g.toFloat());
+
+ SVGNumberImpl *bnumber = SVGSVGElementImpl::createSVGNumber();
+ bnumber->setValue(b.toFloat());
+
+ m_iccColor->colors()->clear();
+ m_iccColor->colors()->appendItem(bnumber);
+ m_iccColor->colors()->appendItem(gnumber);
+ m_iccColor->colors()->appendItem(rnumber);
+ }
+}
+
+void SVGColorImpl::setColor(unsigned short colorType, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ m_colorType = colorType;
+
+ if(m_colorType == SVG_COLORTYPE_UNKNOWN || m_colorType == SVG_COLORTYPE_CURRENTCOLOR)
+ return;
+
+ setRGBColorICCColor(rgbColor, iccColor);
+}
+
+// Ecma stuff
+/*
+@namespace KSVG
+@begin SVGColorImpl::s_hashTable 5
+ colorType SVGColorImpl::ColorType DontDelete|ReadOnly
+ RGBColor SVGColorImpl::RGBColor DontDelete|ReadOnly
+ ICCColor SVGColorImpl::ICCColor DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGColorImplProto::s_hashTable 5
+ setRGBColor SVGColorImpl::SetRGBColor DontDelete|Function 1
+ setRGBColorICCColor SVGColorImpl::SetRGBColorICCColor DontDelete|Function 2
+ setColor SVGColorImpl::SetColor DontDelete|Function 3
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGColor", SVGColorImplProto, SVGColorImplProtoFunc)
+
+Value SVGColorImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case ColorType:
+ return Number(colorType());
+#ifdef __GNUC__
+#warning FIXME bridge stuff
+#endif
+ case RGBColor:
+ return Undefined();
+ case ICCColor:
+ return m_iccColor->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGColorImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGColorImpl)
+
+ switch(id)
+ {
+ case SVGColorImpl::SetRGBColor:
+ obj->setRGBColor(args[0].toString(exec).string());
+ break;
+ case SVGColorImpl::SetRGBColorICCColor:
+ obj->setRGBColorICCColor(args[0].toString(exec).string(), args[1].toString(exec).string());
+ break;
+ case SVGColorImpl::SetColor:
+ obj->setColor(static_cast<unsigned short>(args[0].toNumber(exec)), args[1].toString(exec).string(), args[2].toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+/*
+@namespace KSVG
+@begin SVGColorImplConstructor::s_hashTable 5
+ SVG_COLORTYPE_UNKNOWN KSVG::SVG_COLORTYPE_UNKNOWN DontDelete|ReadOnly
+ SVG_COLORTYPE_RGBCOLOR KSVG::SVG_COLORTYPE_RGBCOLOR DontDelete|ReadOnly
+ SVG_COLORTYPE_RGBCOLOR_ICCCOLOR KSVG::SVG_COLORTYPE_RGBCOLOR_ICCCOLOR DontDelete|ReadOnly
+ SVG_COLORTYPE_CURRENTCOLOR KSVG::SVG_COLORTYPE_CURRENTCOLOR DontDelete|ReadOnly
+@end
+*/
+
+Value SVGColorImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGColorImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGColorImplConstructor>(exec, "[[svgcolor.constructor]]");
+}
diff --git a/ksvg/impl/SVGColorImpl.h b/ksvg/impl/SVGColorImpl.h
index abefd069..1f1595f5 100644
--- a/ksvg/impl/SVGColorImpl.h
+++ b/ksvg/impl/SVGColorImpl.h
@@ -90,5 +90,3 @@ KSVG_DEFINE_PROTOTYPE(SVGColorImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGColorImplProtoFunc, SVGColorImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGColorProfileElementImpl.cc b/ksvg/impl/SVGColorProfileElementImpl.cc
deleted file mode 100644
index f59e7c23..00000000
--- a/ksvg/impl/SVGColorProfileElementImpl.cc
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kurl.h>
-#include <kdebug.h>
-#include <tdeio/netaccess.h>
-
-#include <tqimage.h>
-
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-
-#include "SVGRenderingIntent.h"
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGColorProfileElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGColorProfileElementImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGColorProfileElementImpl::SVGColorProfileElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_loaded = false;
-
- // Spec: Default value 'auto', if not overwritten later
- m_renderingIntent = RENDERING_INTENT_AUTO;
-}
-
-SVGColorProfileElementImpl::~SVGColorProfileElementImpl()
-{
- if(m_loaded)
- closeColorProfile();
-}
-
-/*
-@namespace KSVG
-@begin SVGColorProfileElementImpl::s_hashTable 5
- name SVGColorProfileElementImpl::Name DontDelete|ReadOnly
- href SVGColorProfileElementImpl::Href DontDelete|ReadOnly
- rendering-intent SVGColorProfileElementImpl::RenderingIntent DontDelete|ReadOnly
-@end
-*/
-
-Value SVGColorProfileElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Name:
- return String(m_name);
- case Href:
- return href()->cache(exec);
- case RenderingIntent:
- return Number(m_renderingIntent);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGColorProfileElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Name:
- m_name = value.toString(exec).string();
- ownerDoc()->rootElement()->addToIdMap(m_name.string(), this);
- break;
- case Href:
- href()->setBaseVal(value.toString(exec).string());
- break;
- case RenderingIntent:
- {
- TQString compare = value.toString(exec).qstring().lower();
-
- if(compare == "perceptual")
- m_renderingIntent = RENDERING_INTENT_PERCEPTUAL;
- else if(compare == "relative-colorimetric")
- m_renderingIntent = RENDERING_INTENT_RELATIVE_COLORIMETRIC;
- else if(compare == "saturation")
- m_renderingIntent = RENDERING_INTENT_SATURATION;
- else if(compare == "absolute-colorimetric")
- m_renderingIntent = RENDERING_INTENT_ABSOLUTE_COLORIMETRIC;
- else
- m_renderingIntent = RENDERING_INTENT_AUTO;
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGColorProfileElementImpl::setLocal(const DOM::DOMString &local)
-{
- m_local = local;
-}
-
-DOM::DOMString SVGColorProfileElementImpl::local() const
-{
- return m_local;
-}
-
-void SVGColorProfileElementImpl::setName(const DOM::DOMString &name)
-{
- m_name = name;
-}
-
-DOM::DOMString SVGColorProfileElementImpl::name() const
-{
- return m_name;
-}
-
-void SVGColorProfileElementImpl::setRenderingIntent(unsigned short renderingIntent)
-{
- m_renderingIntent = renderingIntent;
-}
-
-unsigned short SVGColorProfileElementImpl::renderingIntent() const
-{
- return m_renderingIntent;
-}
-
-bool SVGColorProfileElementImpl::canLoad()
-{
- TQString open;
- bool temp;
- return canLoad(false, temp, open, true);
-}
-
-bool SVGColorProfileElementImpl::canLoad(bool remote, bool &tempFile, TQString &open, bool verbose)
-{
- KURL file;
-
- if(!KURL::isRelativeURL(href()->baseVal().string()))
- file = KURL(href()->baseVal().string());
- else
- file = KURL(ownerDoc()->baseUrl(), href()->baseVal().string());
-
- if(file.path().isEmpty())
- {
- if(verbose)
- kdDebug() << "Couldn't load color profile " << file.path() << "!" << endl;
-
- return false;
- }
-
- if(file.isLocalFile())
- {
- open = file.path();
-
- if(!TQFile::exists(open))
- {
- if(verbose)
- kdDebug() << "Couldn't load color profile " << file.path() << "! It does not exist." << endl;
-
- return false;
- }
- }
- else
- {
- if(remote)
- {
- if(TDEIO::NetAccess::download(file, open, 0))
- tempFile = true;
- }
- }
-
- return true;
-}
-
-bool SVGColorProfileElementImpl::loadColorProfile()
-{
- TQString open;
- bool tempFile = false;
-
- if(!canLoad(true, tempFile, open, false))
- return false;
-
- m_hInput = cmsOpenProfileFromFile(open.latin1(), "r");
- m_hOutput = cmsCreate_sRGBProfile();
-
- unsigned int dwIn = BYTES_SH(2) | CHANNELS_SH(cmsChannelsOf(m_inputColorSpace));
- unsigned int dwOut = BYTES_SH(2) | CHANNELS_SH(cmsChannelsOf(m_outputColorSpace));
-
- if(m_renderingIntent != RENDERING_INTENT_AUTO)
- m_hTrans = cmsCreateTransform(m_hInput, dwIn, m_hOutput, dwOut, m_renderingIntent - 2, cmsFLAGS_NOOPTIMIZE);
- else
- m_hTrans = cmsCreateTransform(m_hInput, dwIn, m_hOutput, dwOut, cmsGetHeaderRenderingIntent(m_hInput), cmsFLAGS_NOOPTIMIZE);
-
- m_inputColorSpace = cmsGetColorSpace(m_hInput);
- m_outputColorSpace = cmsGetColorSpace(m_hOutput);
- m_loaded = true;
-
- if(tempFile)
- TDEIO::NetAccess::removeTempFile(open);
-
- return true;
-}
-
-void SVGColorProfileElementImpl::closeColorProfile()
-{
- cmsDeleteTransform(m_hTrans);
- cmsCloseProfile(m_hInput);
-}
-
-TQRgb SVGColorProfileElementImpl::correctPixel(float r, float g, float b)
-{
- if(!m_loaded)
- {
- if(!loadColorProfile())
- return tqRgb(0, 0, 0);
- }
-
- unsigned short input[cmsMAXCHANNELS], output[cmsMAXCHANNELS];
-
- input[0] = ((unsigned int) r) * 257;
- input[1] = ((unsigned int) g) * 257;
- input[2] = ((unsigned int) b) * 257;
-
- cmsDoTransform(m_hTrans, input, output, 1);
-
- if(m_outputColorSpace == cmsSigRgbData)
- return tqRgb(output[0] / 257, output[1] / 257, output[2] / 257);
-
- return tqRgb(0, 0, 0);
-}
-
-TQImage *SVGColorProfileElementImpl::correctImage(TQImage *input)
-{
- if(!canLoad())
- return input;
-
- for(int y = 0; y < input->height(); y++)
- {
- for(int x = 0; x < input->width(); x++)
- {
- TQRgb pixel = input->pixel(x, y);
- input->setPixel(x, y, correctPixel(tqRed(pixel), tqGreen(pixel), tqBlue(pixel)));
- }
- }
-
- return input;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGColorProfileElementImpl.cpp b/ksvg/impl/SVGColorProfileElementImpl.cpp
new file mode 100644
index 00000000..89770494
--- /dev/null
+++ b/ksvg/impl/SVGColorProfileElementImpl.cpp
@@ -0,0 +1,269 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kurl.h>
+#include <kdebug.h>
+#include <tdeio/netaccess.h>
+
+#include <tqimage.h>
+
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+
+#include "SVGRenderingIntent.h"
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGColorProfileElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGColorProfileElementImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGColorProfileElementImpl::SVGColorProfileElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_loaded = false;
+
+ // Spec: Default value 'auto', if not overwritten later
+ m_renderingIntent = RENDERING_INTENT_AUTO;
+}
+
+SVGColorProfileElementImpl::~SVGColorProfileElementImpl()
+{
+ if(m_loaded)
+ closeColorProfile();
+}
+
+/*
+@namespace KSVG
+@begin SVGColorProfileElementImpl::s_hashTable 5
+ name SVGColorProfileElementImpl::Name DontDelete|ReadOnly
+ href SVGColorProfileElementImpl::Href DontDelete|ReadOnly
+ rendering-intent SVGColorProfileElementImpl::RenderingIntent DontDelete|ReadOnly
+@end
+*/
+
+Value SVGColorProfileElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Name:
+ return String(m_name);
+ case Href:
+ return href()->cache(exec);
+ case RenderingIntent:
+ return Number(m_renderingIntent);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGColorProfileElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Name:
+ m_name = value.toString(exec).string();
+ ownerDoc()->rootElement()->addToIdMap(m_name.string(), this);
+ break;
+ case Href:
+ href()->setBaseVal(value.toString(exec).string());
+ break;
+ case RenderingIntent:
+ {
+ TQString compare = value.toString(exec).qstring().lower();
+
+ if(compare == "perceptual")
+ m_renderingIntent = RENDERING_INTENT_PERCEPTUAL;
+ else if(compare == "relative-colorimetric")
+ m_renderingIntent = RENDERING_INTENT_RELATIVE_COLORIMETRIC;
+ else if(compare == "saturation")
+ m_renderingIntent = RENDERING_INTENT_SATURATION;
+ else if(compare == "absolute-colorimetric")
+ m_renderingIntent = RENDERING_INTENT_ABSOLUTE_COLORIMETRIC;
+ else
+ m_renderingIntent = RENDERING_INTENT_AUTO;
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGColorProfileElementImpl::setLocal(const DOM::DOMString &local)
+{
+ m_local = local;
+}
+
+DOM::DOMString SVGColorProfileElementImpl::local() const
+{
+ return m_local;
+}
+
+void SVGColorProfileElementImpl::setName(const DOM::DOMString &name)
+{
+ m_name = name;
+}
+
+DOM::DOMString SVGColorProfileElementImpl::name() const
+{
+ return m_name;
+}
+
+void SVGColorProfileElementImpl::setRenderingIntent(unsigned short renderingIntent)
+{
+ m_renderingIntent = renderingIntent;
+}
+
+unsigned short SVGColorProfileElementImpl::renderingIntent() const
+{
+ return m_renderingIntent;
+}
+
+bool SVGColorProfileElementImpl::canLoad()
+{
+ TQString open;
+ bool temp;
+ return canLoad(false, temp, open, true);
+}
+
+bool SVGColorProfileElementImpl::canLoad(bool remote, bool &tempFile, TQString &open, bool verbose)
+{
+ KURL file;
+
+ if(!KURL::isRelativeURL(href()->baseVal().string()))
+ file = KURL(href()->baseVal().string());
+ else
+ file = KURL(ownerDoc()->baseUrl(), href()->baseVal().string());
+
+ if(file.path().isEmpty())
+ {
+ if(verbose)
+ kdDebug() << "Couldn't load color profile " << file.path() << "!" << endl;
+
+ return false;
+ }
+
+ if(file.isLocalFile())
+ {
+ open = file.path();
+
+ if(!TQFile::exists(open))
+ {
+ if(verbose)
+ kdDebug() << "Couldn't load color profile " << file.path() << "! It does not exist." << endl;
+
+ return false;
+ }
+ }
+ else
+ {
+ if(remote)
+ {
+ if(TDEIO::NetAccess::download(file, open, 0))
+ tempFile = true;
+ }
+ }
+
+ return true;
+}
+
+bool SVGColorProfileElementImpl::loadColorProfile()
+{
+ TQString open;
+ bool tempFile = false;
+
+ if(!canLoad(true, tempFile, open, false))
+ return false;
+
+ m_hInput = cmsOpenProfileFromFile(open.latin1(), "r");
+ m_hOutput = cmsCreate_sRGBProfile();
+
+ unsigned int dwIn = BYTES_SH(2) | CHANNELS_SH(cmsChannelsOf(m_inputColorSpace));
+ unsigned int dwOut = BYTES_SH(2) | CHANNELS_SH(cmsChannelsOf(m_outputColorSpace));
+
+ if(m_renderingIntent != RENDERING_INTENT_AUTO)
+ m_hTrans = cmsCreateTransform(m_hInput, dwIn, m_hOutput, dwOut, m_renderingIntent - 2, cmsFLAGS_NOOPTIMIZE);
+ else
+ m_hTrans = cmsCreateTransform(m_hInput, dwIn, m_hOutput, dwOut, cmsGetHeaderRenderingIntent(m_hInput), cmsFLAGS_NOOPTIMIZE);
+
+ m_inputColorSpace = cmsGetColorSpace(m_hInput);
+ m_outputColorSpace = cmsGetColorSpace(m_hOutput);
+ m_loaded = true;
+
+ if(tempFile)
+ TDEIO::NetAccess::removeTempFile(open);
+
+ return true;
+}
+
+void SVGColorProfileElementImpl::closeColorProfile()
+{
+ cmsDeleteTransform(m_hTrans);
+ cmsCloseProfile(m_hInput);
+}
+
+TQRgb SVGColorProfileElementImpl::correctPixel(float r, float g, float b)
+{
+ if(!m_loaded)
+ {
+ if(!loadColorProfile())
+ return tqRgb(0, 0, 0);
+ }
+
+ unsigned short input[cmsMAXCHANNELS], output[cmsMAXCHANNELS];
+
+ input[0] = ((unsigned int) r) * 257;
+ input[1] = ((unsigned int) g) * 257;
+ input[2] = ((unsigned int) b) * 257;
+
+ cmsDoTransform(m_hTrans, input, output, 1);
+
+ if(m_outputColorSpace == cmsSigRgbData)
+ return tqRgb(output[0] / 257, output[1] / 257, output[2] / 257);
+
+ return tqRgb(0, 0, 0);
+}
+
+TQImage *SVGColorProfileElementImpl::correctImage(TQImage *input)
+{
+ if(!canLoad())
+ return input;
+
+ for(int y = 0; y < input->height(); y++)
+ {
+ for(int x = 0; x < input->width(); x++)
+ {
+ TQRgb pixel = input->pixel(x, y);
+ input->setPixel(x, y, correctPixel(tqRed(pixel), tqGreen(pixel), tqBlue(pixel)));
+ }
+ }
+
+ return input;
+}
diff --git a/ksvg/impl/SVGColorProfileElementImpl.h b/ksvg/impl/SVGColorProfileElementImpl.h
index 7c4f884f..7c656eb4 100644
--- a/ksvg/impl/SVGColorProfileElementImpl.h
+++ b/ksvg/impl/SVGColorProfileElementImpl.h
@@ -105,5 +105,3 @@ KSVG_REGISTER_ELEMENT(SVGColorProfileElementImpl, "color-profile")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGColorProfileRuleImpl.cc b/ksvg/impl/SVGColorProfileRuleImpl.cc
deleted file mode 100644
index 3cfca560..00000000
--- a/ksvg/impl/SVGColorProfileRuleImpl.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGColorProfileRuleImpl.h"
-
-using namespace KSVG;
-
-SVGColorProfileRuleImpl::SVGColorProfileRuleImpl() : SVGCSSRuleImpl()
-{
-}
-
-SVGColorProfileRuleImpl::~SVGColorProfileRuleImpl()
-{
-}
-
-void SVGColorProfileRuleImpl::setSrc(const DOM::DOMString &src)
-{
- m_src = src;
-}
-
-DOM::DOMString SVGColorProfileRuleImpl::src() const
-{
- return m_src;
-}
-
-void SVGColorProfileRuleImpl::setName(const DOM::DOMString &name)
-{
- m_name = name;
-}
-
-DOM::DOMString SVGColorProfileRuleImpl::name() const
-{
- return m_name;
-}
-
-void SVGColorProfileRuleImpl::setRenderingIntent(unsigned short renderingIntent)
-{
- m_renderingIntent = renderingIntent;
-}
-
-unsigned short SVGColorProfileRuleImpl::renderingIntent() const
-{
- return m_renderingIntent;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGColorProfileRuleImpl.cpp b/ksvg/impl/SVGColorProfileRuleImpl.cpp
new file mode 100644
index 00000000..74fffb47
--- /dev/null
+++ b/ksvg/impl/SVGColorProfileRuleImpl.cpp
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGColorProfileRuleImpl.h"
+
+using namespace KSVG;
+
+SVGColorProfileRuleImpl::SVGColorProfileRuleImpl() : SVGCSSRuleImpl()
+{
+}
+
+SVGColorProfileRuleImpl::~SVGColorProfileRuleImpl()
+{
+}
+
+void SVGColorProfileRuleImpl::setSrc(const DOM::DOMString &src)
+{
+ m_src = src;
+}
+
+DOM::DOMString SVGColorProfileRuleImpl::src() const
+{
+ return m_src;
+}
+
+void SVGColorProfileRuleImpl::setName(const DOM::DOMString &name)
+{
+ m_name = name;
+}
+
+DOM::DOMString SVGColorProfileRuleImpl::name() const
+{
+ return m_name;
+}
+
+void SVGColorProfileRuleImpl::setRenderingIntent(unsigned short renderingIntent)
+{
+ m_renderingIntent = renderingIntent;
+}
+
+unsigned short SVGColorProfileRuleImpl::renderingIntent() const
+{
+ return m_renderingIntent;
+}
diff --git a/ksvg/impl/SVGColorProfileRuleImpl.h b/ksvg/impl/SVGColorProfileRuleImpl.h
index 976a76a8..7ba38a13 100644
--- a/ksvg/impl/SVGColorProfileRuleImpl.h
+++ b/ksvg/impl/SVGColorProfileRuleImpl.h
@@ -54,5 +54,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGComponentTransferFunctionElementImpl.cc b/ksvg/impl/SVGComponentTransferFunctionElementImpl.cc
deleted file mode 100644
index 0db14aae..00000000
--- a/ksvg/impl/SVGComponentTransferFunctionElementImpl.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGAnimatedNumberListImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGComponentTransferFunctionElementImpl.h"
-
-using namespace KSVG;
-
-SVGComponentTransferFunctionElementImpl::SVGComponentTransferFunctionElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- m_type = new SVGAnimatedEnumerationImpl();
- m_type->ref();
-
- m_tableValues = new SVGAnimatedNumberListImpl();
- m_tableValues->ref();
-
- m_slope = new SVGAnimatedNumberImpl();
- m_slope->ref();
-
- m_intercept = new SVGAnimatedNumberImpl();
- m_intercept->ref();
-
- m_amplitude = new SVGAnimatedNumberImpl();
- m_amplitude->ref();
-
- m_exponent = new SVGAnimatedNumberImpl();
- m_exponent->ref();
-
- m_offset = new SVGAnimatedNumberImpl();
- m_offset->ref();
-}
-
-SVGComponentTransferFunctionElementImpl::~SVGComponentTransferFunctionElementImpl()
-{
- if(m_type)
- m_type->deref();
- if(m_tableValues)
- m_tableValues->deref();
- if(m_slope)
- m_slope->deref();
- if(m_intercept)
- m_intercept->deref();
- if(m_amplitude)
- m_amplitude->deref();
- if(m_exponent)
- m_exponent->deref();
- if(m_offset)
- m_offset->deref();
-}
-
-SVGAnimatedEnumerationImpl *SVGComponentTransferFunctionElementImpl::type() const
-{
- return m_type;
-}
-
-SVGAnimatedNumberListImpl *SVGComponentTransferFunctionElementImpl::tableValues() const
-{
- return m_tableValues;
-}
-
-SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::slope() const
-{
- return m_slope;
-}
-
-SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::intercept() const
-{
- return m_intercept;
-}
-
-SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::amplitude() const
-{
- return m_amplitude;
-}
-
-SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::exponent() const
-{
- return m_exponent;
-}
-
-SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::offset() const
-{
- return m_offset;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGComponentTransferFunctionElementImpl.cpp b/ksvg/impl/SVGComponentTransferFunctionElementImpl.cpp
new file mode 100644
index 00000000..9407b2a6
--- /dev/null
+++ b/ksvg/impl/SVGComponentTransferFunctionElementImpl.cpp
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGAnimatedNumberListImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGComponentTransferFunctionElementImpl.h"
+
+using namespace KSVG;
+
+SVGComponentTransferFunctionElementImpl::SVGComponentTransferFunctionElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ m_type = new SVGAnimatedEnumerationImpl();
+ m_type->ref();
+
+ m_tableValues = new SVGAnimatedNumberListImpl();
+ m_tableValues->ref();
+
+ m_slope = new SVGAnimatedNumberImpl();
+ m_slope->ref();
+
+ m_intercept = new SVGAnimatedNumberImpl();
+ m_intercept->ref();
+
+ m_amplitude = new SVGAnimatedNumberImpl();
+ m_amplitude->ref();
+
+ m_exponent = new SVGAnimatedNumberImpl();
+ m_exponent->ref();
+
+ m_offset = new SVGAnimatedNumberImpl();
+ m_offset->ref();
+}
+
+SVGComponentTransferFunctionElementImpl::~SVGComponentTransferFunctionElementImpl()
+{
+ if(m_type)
+ m_type->deref();
+ if(m_tableValues)
+ m_tableValues->deref();
+ if(m_slope)
+ m_slope->deref();
+ if(m_intercept)
+ m_intercept->deref();
+ if(m_amplitude)
+ m_amplitude->deref();
+ if(m_exponent)
+ m_exponent->deref();
+ if(m_offset)
+ m_offset->deref();
+}
+
+SVGAnimatedEnumerationImpl *SVGComponentTransferFunctionElementImpl::type() const
+{
+ return m_type;
+}
+
+SVGAnimatedNumberListImpl *SVGComponentTransferFunctionElementImpl::tableValues() const
+{
+ return m_tableValues;
+}
+
+SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::slope() const
+{
+ return m_slope;
+}
+
+SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::intercept() const
+{
+ return m_intercept;
+}
+
+SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::amplitude() const
+{
+ return m_amplitude;
+}
+
+SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::exponent() const
+{
+ return m_exponent;
+}
+
+SVGAnimatedNumberImpl *SVGComponentTransferFunctionElementImpl::offset() const
+{
+ return m_offset;
+}
diff --git a/ksvg/impl/SVGComponentTransferFunctionElementImpl.h b/ksvg/impl/SVGComponentTransferFunctionElementImpl.h
index e277d462..5ead0a0b 100644
--- a/ksvg/impl/SVGComponentTransferFunctionElementImpl.h
+++ b/ksvg/impl/SVGComponentTransferFunctionElementImpl.h
@@ -62,5 +62,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGContainerImpl.cc b/ksvg/impl/SVGContainerImpl.cc
deleted file mode 100644
index e4a7c0db..00000000
--- a/ksvg/impl/SVGContainerImpl.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGRectImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGContainerImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "kdebug.h"
-
-using namespace KSVG;
-
-SVGContainerImpl::SVGContainerImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl)
-{
-}
-
-SVGContainerImpl::~SVGContainerImpl()
-{
-}
-
-SVGRectImpl *SVGContainerImpl::getBBox()
-{
- // just get the union of the children bboxes
- TQRect rect;
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *elem = ownerDoc()->getElementFromHandle(node.handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(elem);
- SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(elem);
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(elem);
-
- bool ok = tests ? tests->ok() : true;
-
- if(shape && style && ok && style->getVisible() && style->getDisplay())
- {
- SVGRectImpl *current = shape->getBBox();
- rect = rect.unite(current->qrect());
- current->deref();
- }
- }
-
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- *ret = rect;
- return ret;
-}
-
-void SVGContainerImpl::createItem(KSVGCanvas *c)
-{
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *elem = ownerDoc()->getElementFromHandle(node.handle());
- if(elem)
- elem->createItem(c);
- }
-}
-
-void SVGContainerImpl::removeItem(KSVGCanvas *c)
-{
- SVGShapeImpl::removeItem(c);
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *elem = ownerDoc()->getElementFromHandle(node.handle());
- if(elem)
- elem->removeItem(c);
- }
-}
-
-void SVGContainerImpl::update(CanvasItemUpdate reason, int param1, int param2)
-{
- SVGShapeImpl::update(reason, param1, param2);
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
- if(shape)
- shape->update(reason, param1, param2);
- }
-}
-
-void SVGContainerImpl::invalidate(KSVGCanvas *c, bool recalc)
-{
- SVGShapeImpl::invalidate(c, recalc);
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
- if(shape)
- shape->invalidate(c, recalc);
- }
-}
-
-void SVGContainerImpl::setReferenced(bool referenced)
-{
- SVGShapeImpl::setReferenced(referenced);
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
- if(shape)
- shape->setReferenced(referenced);
- }
-}
-
-void SVGContainerImpl::draw()
-{
- SVGShapeImpl::draw();
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
- if(shape)
- shape->draw();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGContainerImpl.cpp b/ksvg/impl/SVGContainerImpl.cpp
new file mode 100644
index 00000000..efaf62e8
--- /dev/null
+++ b/ksvg/impl/SVGContainerImpl.cpp
@@ -0,0 +1,133 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGRectImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGContainerImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "kdebug.h"
+
+using namespace KSVG;
+
+SVGContainerImpl::SVGContainerImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl)
+{
+}
+
+SVGContainerImpl::~SVGContainerImpl()
+{
+}
+
+SVGRectImpl *SVGContainerImpl::getBBox()
+{
+ // just get the union of the children bboxes
+ TQRect rect;
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *elem = ownerDoc()->getElementFromHandle(node.handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(elem);
+ SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(elem);
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(elem);
+
+ bool ok = tests ? tests->ok() : true;
+
+ if(shape && style && ok && style->getVisible() && style->getDisplay())
+ {
+ SVGRectImpl *current = shape->getBBox();
+ rect = rect.unite(current->qrect());
+ current->deref();
+ }
+ }
+
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ *ret = rect;
+ return ret;
+}
+
+void SVGContainerImpl::createItem(KSVGCanvas *c)
+{
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *elem = ownerDoc()->getElementFromHandle(node.handle());
+ if(elem)
+ elem->createItem(c);
+ }
+}
+
+void SVGContainerImpl::removeItem(KSVGCanvas *c)
+{
+ SVGShapeImpl::removeItem(c);
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *elem = ownerDoc()->getElementFromHandle(node.handle());
+ if(elem)
+ elem->removeItem(c);
+ }
+}
+
+void SVGContainerImpl::update(CanvasItemUpdate reason, int param1, int param2)
+{
+ SVGShapeImpl::update(reason, param1, param2);
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
+ if(shape)
+ shape->update(reason, param1, param2);
+ }
+}
+
+void SVGContainerImpl::invalidate(KSVGCanvas *c, bool recalc)
+{
+ SVGShapeImpl::invalidate(c, recalc);
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
+ if(shape)
+ shape->invalidate(c, recalc);
+ }
+}
+
+void SVGContainerImpl::setReferenced(bool referenced)
+{
+ SVGShapeImpl::setReferenced(referenced);
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
+ if(shape)
+ shape->setReferenced(referenced);
+ }
+}
+
+void SVGContainerImpl::draw()
+{
+ SVGShapeImpl::draw();
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
+ if(shape)
+ shape->draw();
+ }
+}
diff --git a/ksvg/impl/SVGContainerImpl.h b/ksvg/impl/SVGContainerImpl.h
index 353a6154..b4ad6e9b 100644
--- a/ksvg/impl/SVGContainerImpl.h
+++ b/ksvg/impl/SVGContainerImpl.h
@@ -54,5 +54,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGCursorElementImpl.cc b/ksvg/impl/SVGCursorElementImpl.cc
deleted file mode 100644
index 331f8826..00000000
--- a/ksvg/impl/SVGCursorElementImpl.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGCursorElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-
-using namespace KSVG;
-
-#include "SVGCursorElementImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGCursorElementImpl::SVGCursorElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGExternalResourcesRequiredImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl();
- m_y->ref();
-}
-
-SVGCursorElementImpl::~SVGCursorElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
-}
-
-SVGAnimatedLengthImpl *SVGCursorElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGCursorElementImpl::y() const
-{
- return m_y;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGCursorElementImpl::s_hashTable 3
- x SVGCursorElementImpl::X DontDelete|ReadOnly
- y SVGCursorElementImpl::Y DontDelete|ReadOnly
-@end
-*/
-
-Value SVGCursorElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case X:
- return m_x->cache(exec);
- case Y:
- return m_y->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGCursorElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X:
- x()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Y:
- y()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGCursorElementImpl.cpp b/ksvg/impl/SVGCursorElementImpl.cpp
new file mode 100644
index 00000000..a83afd73
--- /dev/null
+++ b/ksvg/impl/SVGCursorElementImpl.cpp
@@ -0,0 +1,102 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGCursorElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+
+using namespace KSVG;
+
+#include "SVGCursorElementImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGCursorElementImpl::SVGCursorElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGExternalResourcesRequiredImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl();
+ m_y->ref();
+}
+
+SVGCursorElementImpl::~SVGCursorElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+}
+
+SVGAnimatedLengthImpl *SVGCursorElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGCursorElementImpl::y() const
+{
+ return m_y;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGCursorElementImpl::s_hashTable 3
+ x SVGCursorElementImpl::X DontDelete|ReadOnly
+ y SVGCursorElementImpl::Y DontDelete|ReadOnly
+@end
+*/
+
+Value SVGCursorElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return m_x->cache(exec);
+ case Y:
+ return m_y->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGCursorElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X:
+ x()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Y:
+ y()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGCursorElementImpl.h b/ksvg/impl/SVGCursorElementImpl.h
index a063acd0..4a37d7aa 100644
--- a/ksvg/impl/SVGCursorElementImpl.h
+++ b/ksvg/impl/SVGCursorElementImpl.h
@@ -65,5 +65,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDefinitionSrcElementImpl.cc b/ksvg/impl/SVGDefinitionSrcElementImpl.cc
deleted file mode 100644
index cf5d764c..00000000
--- a/ksvg/impl/SVGDefinitionSrcElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDefinitionSrcElementImpl.h"
-
-using namespace KSVG;
-
-SVGDefinitionSrcElementImpl::SVGDefinitionSrcElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGDefinitionSrcElementImpl::~SVGDefinitionSrcElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDefinitionSrcElementImpl.cpp b/ksvg/impl/SVGDefinitionSrcElementImpl.cpp
new file mode 100644
index 00000000..fdd5b159
--- /dev/null
+++ b/ksvg/impl/SVGDefinitionSrcElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDefinitionSrcElementImpl.h"
+
+using namespace KSVG;
+
+SVGDefinitionSrcElementImpl::SVGDefinitionSrcElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGDefinitionSrcElementImpl::~SVGDefinitionSrcElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGDefinitionSrcElementImpl.h b/ksvg/impl/SVGDefinitionSrcElementImpl.h
index 65fb359c..0cca880f 100644
--- a/ksvg/impl/SVGDefinitionSrcElementImpl.h
+++ b/ksvg/impl/SVGDefinitionSrcElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDefsElementImpl.cc b/ksvg/impl/SVGDefsElementImpl.cc
deleted file mode 100644
index e5d7d398..00000000
--- a/ksvg/impl/SVGDefsElementImpl.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDefsElementImpl.h"
-
-using namespace KSVG;
-
-SVGDefsElementImpl::SVGDefsElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- m_display = false; // implicit display=none
-}
-
-SVGDefsElementImpl::~SVGDefsElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDefsElementImpl.cpp b/ksvg/impl/SVGDefsElementImpl.cpp
new file mode 100644
index 00000000..f388e482
--- /dev/null
+++ b/ksvg/impl/SVGDefsElementImpl.cpp
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDefsElementImpl.h"
+
+using namespace KSVG;
+
+SVGDefsElementImpl::SVGDefsElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ m_display = false; // implicit display=none
+}
+
+SVGDefsElementImpl::~SVGDefsElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGDefsElementImpl.h b/ksvg/impl/SVGDefsElementImpl.h
index e32f0dc9..2b584e14 100644
--- a/ksvg/impl/SVGDefsElementImpl.h
+++ b/ksvg/impl/SVGDefsElementImpl.h
@@ -57,5 +57,3 @@ KSVG_REGISTER_ELEMENT(SVGDefsElementImpl, "defs")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDescElementImpl.cc b/ksvg/impl/SVGDescElementImpl.cc
deleted file mode 100644
index cb0958dd..00000000
--- a/ksvg/impl/SVGDescElementImpl.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDocumentImpl.h"
-#include "SVGDescElementImpl.h"
-
-using namespace KSVG;
-
-SVGDescElementImpl::SVGDescElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGLangSpaceImpl(), SVGStylableImpl(this)
-{
-}
-
-SVGDescElementImpl::~SVGDescElementImpl()
-{
-}
-
-void SVGDescElementImpl::createItem(KSVGCanvas *)
-{
- emit ownerDoc()->gotDescription(collectText());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDescElementImpl.cpp b/ksvg/impl/SVGDescElementImpl.cpp
new file mode 100644
index 00000000..9d8ceef2
--- /dev/null
+++ b/ksvg/impl/SVGDescElementImpl.cpp
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDocumentImpl.h"
+#include "SVGDescElementImpl.h"
+
+using namespace KSVG;
+
+SVGDescElementImpl::SVGDescElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGLangSpaceImpl(), SVGStylableImpl(this)
+{
+}
+
+SVGDescElementImpl::~SVGDescElementImpl()
+{
+}
+
+void SVGDescElementImpl::createItem(KSVGCanvas *)
+{
+ emit ownerDoc()->gotDescription(collectText());
+}
diff --git a/ksvg/impl/SVGDescElementImpl.h b/ksvg/impl/SVGDescElementImpl.h
index c8136eb6..f7ff5ae1 100644
--- a/ksvg/impl/SVGDescElementImpl.h
+++ b/ksvg/impl/SVGDescElementImpl.h
@@ -51,5 +51,3 @@ KSVG_REGISTER_ELEMENT(SVGDescElementImpl, "desc")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDocumentImpl.cc b/ksvg/impl/SVGDocumentImpl.cc
deleted file mode 100644
index c2b412f3..00000000
--- a/ksvg/impl/SVGDocumentImpl.cc
+++ /dev/null
@@ -1,705 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#define USE_VALGRIND 0
-
-#if USE_VALGRIND
-#include <valgrind/calltree.h>
-#endif
-
-#include "SVGEvent.h"
-#include "SVGMatrixImpl.h"
-#include "SVGWindowImpl.h"
-#include "SVGElementImpl.h"
-#include "SVGDocumentImpl.moc"
-#include "SVGSVGElementImpl.h"
-#include "SVGImageElementImpl.h"
-#include "SVGScriptElementImpl.h"
-#include "SVGTitleElementImpl.h"
-#include "SVGAnimationElementImpl.h"
-
-#include "KSVGReader.h"
-#include "KSVGLoader.h"
-#include "KSVGCanvas.h"
-#include "CanvasItem.h"
-
-#include <tqpaintdevicemetrics.h>
-
-using namespace KSVG;
-
-#include "SVGDocumentImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-// A sequence of prime numbers that sets the m_elemDict's hash table size as the
-// number of elements in the dictionary passes each level. This keeps the lookup
-// performance high as the number of elements grows. See the TQDict documentation.
-unsigned int SVGDocumentImpl::elemDictHashSizes [] =
-{
- 101,
- 211,
- 401,
- 809,
- 1601,
- 3203,
- 6421,
- 12809,
- 25601,
- 51203,
- 102407,
- 204803,
- 409609,
- 819229
-};
-
-const int SVGDocumentImpl::numElemDictHashSizes = sizeof(elemDictHashSizes) / sizeof(elemDictHashSizes[0]);
-
-SVGDocumentImpl::SVGDocumentImpl(bool anim, bool fit, SVGImageElementImpl *parentImage) : TQObject(), DOM::DomShared(), DOM::Document(), SVGDOMNodeBridge(static_cast<DOM::Node>(*this))
-{
- m_animations = anim;
-
- m_reader = 0;
- m_loader = 0;
- m_canvas = 0;
- m_rootElement = 0;
- m_lastTarget = 0;
- m_window = 0;
-
- m_elemDictHashSizeIndex = 0;
- m_elemDict.resize(elemDictHashSizes[m_elemDictHashSizeIndex]);
-
- m_timeScheduler = new SVGTimeScheduler(this);
- m_ecmaEngine = new KSVGEcma(this);
- m_ecmaEngine->setup();
-
- m_finishedParsing = false;
- m_finishedLoading = false;
- m_resortZIndicesOnFinishedLoading = false;
- m_fit = fit;
-
- m_parentImage = parentImage;
- if(m_parentImage)
- m_parentImage->ref();
-}
-
-SVGDocumentImpl::~SVGDocumentImpl()
-{
- if(rootElement() && rootElement()->hasEventListener(SVGEvent::UNLOAD_EVENT, true))
- rootElement()->dispatchEvent(SVGEvent::UNLOAD_EVENT, false, false);
-
- TQPtrList<SVGShapeImpl> killList;
-
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(getElementFromHandle(node.handle()));
- if(shape)
- killList.append(shape);
- }
-
- SVGShapeImpl *rend = 0;
- for(rend = killList.first(); rend; rend = killList.next())
- delete rend;
-
- delete m_timeScheduler;
- delete m_ecmaEngine;
- delete m_reader;
- delete m_loader;
-
- if(m_window)
- m_window->deref();
-
- if(m_parentImage)
- m_parentImage->deref();
-}
-
-SVGWindowImpl *SVGDocumentImpl::window()
-{
- if(!m_window)
- {
- m_window = new SVGWindowImpl(const_cast<SVGDocumentImpl *>(this));
- m_window->ref();
- }
-
- return m_window;
-}
-
-float SVGDocumentImpl::screenPixelsPerMillimeterX() const
-{
- if(canvas() && canvas()->drawWindow())
- {
- TQPaintDeviceMetrics metrics(canvas()->drawWindow());
- return float(metrics.width()) / float(metrics.widthMM());
- }
- else
- return 90.0;
-}
-
-float SVGDocumentImpl::screenPixelsPerMillimeterY() const
-{
- if(canvas() && canvas()->drawWindow())
- {
- TQPaintDeviceMetrics metrics(canvas()->drawWindow());
- return float(metrics.height()) / float(metrics.heightMM());
- }
- else
- return 90.0;
-}
-
-DOM::DOMString SVGDocumentImpl::title() const
-{
- DOM::Node n;
- for(n = rootElement()->firstChild(); !n.isNull(); n = n.nextSibling())
- {
- SVGElementImpl *elem = getElementFromHandle(n.handle());
- if(dynamic_cast<SVGTitleElementImpl *>(elem))
- return elem->collectText();
- }
- return "";
-}
-
-DOM::DOMString SVGDocumentImpl::referrer() const
-{
- return m_referrer;
-}
-
-DOM::DOMString SVGDocumentImpl::domain() const
-{
- return m_baseURL.host();
-}
-
-DOM::DOMString SVGDocumentImpl::URL() const
-{
- return m_baseURL.prettyURL();
-}
-
-void SVGDocumentImpl::setReferrer(const DOM::DOMString &referrer)
-{
- // TODO : better may be to request for referrer instead of storing it
- m_referrer = referrer;
-}
-
-void SVGDocumentImpl::setRootElement(SVGSVGElementImpl *elem)
-{
- m_rootElement = elem;
-}
-
-SVGSVGElementImpl *SVGDocumentImpl::rootElement() const
-{
- return m_rootElement;
-}
-
-SVGElementImpl *SVGDocumentImpl::createElement(const DOM::DOMString &name, DOM::Element impl, SVGDocumentImpl *doc)
-{
- DOM::ElementImpl *handle = reinterpret_cast<DOM::ElementImpl *>(impl.handle());
- SVGElementImpl *element = SVGElementImpl::Factory::self()->create(std::string(name.string().latin1()), handle);
-
- if(!element)
- element = new SVGElementImpl(handle);
-
- element->setOwnerDoc(doc);
- element->ref();
- return element;
-}
-
-bool SVGDocumentImpl::open(const ::KURL &url)
-{
- if(!url.prettyURL().isEmpty())
- {
- m_baseURL = url;
-
- if(!m_loader)
- m_loader = new KSVGLoader();
-
- connect(m_loader, TQT_SIGNAL(gotResult(TQIODevice *)), this, TQT_SLOT(slotSVGContent(TQIODevice *)));
- m_loader->getSVGContent(url);
- }
- else
- return false;
-
- return true;
-}
-
-void SVGDocumentImpl::slotSVGContent(TQIODevice *dev)
-{
- TQXmlInputSource *inputSource = new TQXmlInputSource(dev);
-
- if(m_reader)
- delete m_reader;
-
- KSVGReader::ParsingArgs args;
- args.fit = m_fit;
- args.getURLMode = false;
-
- TQString url = m_baseURL.prettyURL();
- int pos = url.find('#'); // url can become like this.svg#svgView(viewBox(63,226,74,74)), get part after '#'
- if(pos > -1)
- args.SVGFragmentId = url.mid(pos + 1);
-
- m_reader = new KSVGReader(this, m_canvas, args);
- connect(m_reader, TQT_SIGNAL(finished(bool, const TQString &)), this, TQT_SLOT(slotFinishedParsing(bool, const TQString &)));
- m_t.start();
-
-#if USE_VALGRIND
- CALLTREE_ZERO_STATS();
-#endif
-
- m_reader->parse(inputSource);
- delete dev;
-}
-
-void SVGDocumentImpl::parseSVG(TQXmlInputSource *inputSource, bool getURLMode)
-{
- if(m_reader)
- delete m_reader;
-
- KSVGReader::ParsingArgs args;
- args.fit = m_fit;
- args.getURLMode = getURLMode;
- m_reader = new KSVGReader(this, 0, args);
- connect(m_reader, TQT_SIGNAL(finished(bool, const TQString &)), this, TQT_SLOT(slotFinishedParsing(bool, const TQString &)));
-
-#if USE_VALGRIND
- CALLTREE_ZERO_STATS();
-#endif
-
- m_reader->parse(inputSource);
-}
-
-void SVGDocumentImpl::finishParsing(bool error, const TQString &errorDesc)
-{
- if(m_reader)
- m_reader->finishParsing(error, errorDesc);
-}
-
-void SVGDocumentImpl::slotFinishedParsing(bool error, const TQString &errorDesc)
-{
- kdDebug(26000) << k_funcinfo << "total time : " << m_t.elapsed() << endl;
-
-#if USE_VALGRIND
- CALLTREE_DUMP_STATS();
-#endif
-
- if(m_animations)
- m_timeScheduler->startAnimations();
-
- if(m_canvas && !error && rootElement())
- executeScripts();
-
- m_finishedParsing = true;
-
- emit finishedParsing(error, errorDesc);
- if(!error)
- emit finishedRendering();
-
- checkFinishedLoading();
-}
-
-void SVGDocumentImpl::newImageJob(SVGImageElementImpl *image)
-{
- kdDebug(26002) << "SVGDocumentImpl::newImageJob, " << image << endl;
- m_loader->newImageJob(image, m_baseURL);
-}
-
-void SVGDocumentImpl::notifyImageLoading(SVGImageElementImpl *image)
-{
- m_imagesLoading.append(image);
-}
-
-void SVGDocumentImpl::notifyImageLoaded(SVGImageElementImpl *image)
-{
- m_imagesLoading.remove(image);
-
- if(m_imagesLoading.isEmpty())
- checkFinishedLoading();
-}
-
-void SVGDocumentImpl::checkFinishedLoading()
-{
- if(m_finishedParsing && m_imagesLoading.isEmpty())
- {
- m_finishedLoading = true;
-
- if(m_resortZIndicesOnFinishedLoading)
- {
- // Only resort if we're the 'outermost' document, i.e. we're not an svg image
- // inside another document. We could resort as each image finishes loading, but it
- // slows down the parsing phase.
- if(m_parentImage == 0 && m_canvas && m_rootElement)
- {
- m_canvas->setElementItemZIndexRecursive(m_rootElement, 0);
- m_canvas->update();
- }
- }
-
- emit finishedLoading();
- }
-}
-
-void SVGDocumentImpl::addForwardReferencingUseElement(SVGUseElementImpl *use)
-{
- if(!m_forwardReferencingUseElements.contains(use))
- m_forwardReferencingUseElements.append(use);
-}
-
-void SVGDocumentImpl::slotPaint()
-{
- rerender();
-}
-
-void SVGDocumentImpl::rerender()
-{
- m_canvas->update();
- emit finishedRendering();
-}
-
-void SVGDocumentImpl::attach(KSVG::KSVGCanvas *c)
-{
- m_canvas = c;
-}
-
-void SVGDocumentImpl::detach()
-{
- m_canvas = 0;
-}
-
-KSVG::KSVGCanvas *SVGDocumentImpl::canvas() const
-{
- return m_canvas;
-}
-
-void SVGDocumentImpl::syncCachedMatrices()
-{
- if(rootElement())
- {
- SVGMatrixImpl *parentMatrix = SVGSVGElementImpl::createSVGMatrix();
- rootElement()->checkCachedScreenCTM(parentMatrix);
- parentMatrix->deref();
- }
-}
-
-void SVGDocumentImpl::executeScriptsRecursive(DOM::Node start)
-{
- DOM::Node node = start.firstChild();
-
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = getElementFromHandle(node.handle());
-
- SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(element);
- if(container)
- executeScriptsRecursive(node);
-
- SVGScriptElementImpl *script = dynamic_cast<SVGScriptElementImpl *>(element);
-
- if(script)
- script->executeScript(DOM::Node());
- }
-}
-
-bool SVGDocumentImpl::executeScriptsRecursiveCheck(DOM::Node start)
-{
- bool test = true;
-
- DOM::Node node = start.firstChild();
-
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = getElementFromHandle(node.handle());
-
- SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(element);
- if(container)
- {
- if(!executeScriptsRecursiveCheck(node))
- return false;
- }
-
- SVGScriptElementImpl *script = dynamic_cast<SVGScriptElementImpl *>(element);
-
- if(script)
- {
- if(!script->canExecuteScript())
- {
- test = false;
- break;
- }
- }
- }
-
- return test;
-}
-
-void SVGDocumentImpl::executeScripts()
-{
- bool test = executeScriptsRecursiveCheck(*rootElement());
-
- if(!test)
- TQTimer::singleShot(50, this, TQT_SLOT(executeScripts()));
- else
- {
- executeScriptsRecursive(*rootElement());
-
- // mop: only rerender if an loadevent has been found
- if(dispatchRecursiveEvent(SVGEvent::LOAD_EVENT, lastChild()))
- m_canvas->update();
- }
-}
-
-// Dispatches a non-cancelable, non-bubbles event to every child
-bool SVGDocumentImpl::dispatchRecursiveEvent(SVGEvent::EventId id, DOM::Node start)
-{
- bool eventExecuted = false;
-
- // Iterate the tree, backwards, and dispatch the event to every child
- DOM::Node node = start;
- for(; !node.isNull(); node = node.previousSibling())
- {
- SVGElementImpl *element = getElementFromHandle(node.handle());
-
- if(element && element->hasChildNodes())
- {
- // Dispatch to all children
- eventExecuted = dispatchRecursiveEvent(id, element->lastChild()) ? true : eventExecuted;
-
- // Dispatch, locally
- if(element->hasEventListener(id, true))
- {
- element->dispatchEvent(id, false, false);
- eventExecuted = true;
- }
- }
- else if(element && element->hasEventListener(id, true))
- {
- element->dispatchEvent(id, false, false);
- eventExecuted = true;
- }
- }
-
- return eventExecuted;
-}
-
-SVGEventListener *SVGDocumentImpl::createEventListener(DOM::DOMString type)
-{
- return m_ecmaEngine->createEventListener(type);
-}
-
-SVGElementImpl *SVGDocumentImpl::recursiveSearch(DOM::Node start, const DOM::DOMString &id)
-{
- DOM::Node node = start.firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *test = getElementFromHandle(node.handle());
-
- // Look in containers
- SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(test);
- if(container)
- {
- SVGElementImpl *found = recursiveSearch(node, id);
- if(found)
- return found;
- }
-
- // Look in SVGSVGElementImpl's
- SVGSVGElementImpl *svgtest = dynamic_cast<SVGSVGElementImpl *>(test);
- if(svgtest)
- {
- SVGElementImpl *element = svgtest->getElementById(id);
- if(element)
- return element;
- }
- }
-
- return 0;
-}
-
-/*
-@namespace KSVG
-@begin SVGDocumentImpl::s_hashTable 9
- title SVGDocumentImpl::Title DontDelete|ReadOnly
- referrer SVGDocumentImpl::Referrer DontDelete|ReadOnly
- domain SVGDocumentImpl::Domain DontDelete|ReadOnly
- URL SVGDocumentImpl::Url DontDelete|ReadOnly
- doctype SVGDocumentImpl::DocType DontDelete|ReadOnly
- implementation SVGDocumentImpl::Implementation DontDelete|ReadOnly
- rootElement SVGDocumentImpl::RootElement DontDelete|ReadOnly
- documentElement SVGDocumentImpl::DocumentElement DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGDocumentImplProto::s_hashTable 7
- createTextNode SVGDocumentImpl::CreateTextNode DontDelete|Function 1
- createElement SVGDocumentImpl::CreateElement DontDelete|Function 1
- createElementNS SVGDocumentImpl::CreateElementNS DontDelete|Function 2
- getElementById SVGDocumentImpl::GetElementById DontDelete|Function 1
- getElementsByTagName SVGDocumentImpl::GetElementsByTagName DontDelete|Function 1
- getElementsByTagNameNS SVGDocumentImpl::GetElementsByTagNameNS DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGDocument", SVGDocumentImplProto, SVGDocumentImplProtoFunc)
-
-Value SVGDocumentImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Title:
- return String(title().string());
- case Referrer:
- return String(referrer().string());
- case Domain:
- return String(domain().string());
- case Url:
- return String(URL().string());
- case DocType:
- return getDOMNode(exec, doctype());
- case Implementation:
- return (new SVGDOMDOMImplementationBridge(implementation()))->cache(exec);
- case RootElement:
- case DocumentElement:
- return m_rootElement->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGDocumentImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDocumentImpl)
-
- switch(id)
- {
- case SVGDocumentImpl::CreateTextNode:
- return getDOMNode(exec, obj->createTextNode(args[0].toString(exec).string()));
- case SVGDocumentImpl::CreateElement:
- case SVGDocumentImpl::CreateElementNS:
- {
- SVGElementImpl *newElement = 0;
-
- if(id == SVGDocumentImpl::CreateElement)
- newElement = obj->createElement(args[0].toString(exec).qstring(), static_cast<DOM::Document *>(obj)->createElement(args[0].toString(exec).string()), obj);
- else if(id == SVGDocumentImpl::CreateElementNS)
- newElement = obj->createElement(args[1].toString(exec).qstring(), static_cast<DOM::Document *>(obj)->createElementNS(args[0].toString(exec).string(), args[1].toString(exec).string()), obj);
-
- newElement->setOwnerSVGElement(obj->rootElement()); // FIXME: Correct in all situations?
- newElement->setViewportElement(obj->rootElement());
- newElement->setAttributes();
-
- return getDOMNode(exec, *newElement);
- }
- case SVGDocumentImpl::GetElementById:
- {
- Value ret;
-
- SVGElementImpl *element = obj->rootElement()->getElementById(args[0].toString(exec).string());
-
- if(element)
- ret = getDOMNode(exec, *element);
- else
- {
- element = obj->recursiveSearch(*obj, args[0].toString(exec).string());
- if(!element)
- return Null();
-
- ret = getDOMNode(exec, *element);
- }
-
- return ret;
- }
- case SVGDocumentImpl::GetElementsByTagName:
- return (new SVGDOMNodeListBridge(obj->getElementsByTagName(args[0].toString(exec).string())))->cache(exec);
- case SVGDocumentImpl::GetElementsByTagNameNS:
- return (new SVGDOMNodeListBridge(obj->getElementsByTagNameNS(args[0].toString(exec).string(), args[1].toString(exec).string())))->cache(exec);
- default:
- break;
- }
-
- return KJS::Undefined();
-}
-
-SVGElementImpl *SVGDocumentImpl::getElementFromHandle(DOM::NodeImpl *handle) const
-{
- return m_elemDict[handle];
-}
-
-void SVGDocumentImpl::addToElemDict(DOM::NodeImpl *handle, SVGElementImpl *obj)
-{
- m_elemDict.insert(handle, obj);
-
- if(m_elemDict.count()>m_elemDict.size() && m_elemDictHashSizeIndex<numElemDictHashSizes-1)
- {
- // Increase the hash table size to maintain good lookup speed.
- m_elemDictHashSizeIndex++;
- m_elemDict.resize(elemDictHashSizes[m_elemDictHashSizeIndex]);
- }
-}
-
-void SVGDocumentImpl::removeFromElemDict(DOM::NodeImpl *handle)
-{
- m_elemDict.remove(handle);
-}
-
-SVGDocumentImpl *SVGDocumentImpl::getDocumentFromHandle(DOM::NodeImpl *handle) const
-{
- return m_documentDict[handle];
-}
-
-void SVGDocumentImpl::addToDocumentDict(DOM::NodeImpl *handle, SVGDocumentImpl *obj)
-{
- m_documentDict.insert(handle, obj);
-}
-
-SVGElementImpl *SVGDocumentImpl::getElementByIdRecursive(SVGSVGElementImpl *start, const DOM::DOMString &elementId, bool dontSearch)
-{
- SVGElementImpl *element = 0;
-
- // #1 Look in passed SVGSVGElementImpl
- if(start)
- {
- element = start->getElementById(elementId);
-
- if(element)
- return element;
- }
-
- // #2 Search in all child SVGSVGElementImpl's
- element = recursiveSearch(*this, elementId);
-
- if(element)
- return element;
-
- // #3 Search in other documents
- if(!dontSearch)
- {
- TQPtrDictIterator<SVGDocumentImpl> it(m_documentDict);
- for(; it.current(); ++it)
- {
- SVGElementImpl *temp = it.current()->getElementByIdRecursive(0, elementId, true);
- if(temp)
- return temp;
- }
- }
-
- return element;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGDocumentImpl.cpp b/ksvg/impl/SVGDocumentImpl.cpp
new file mode 100644
index 00000000..ce6de16e
--- /dev/null
+++ b/ksvg/impl/SVGDocumentImpl.cpp
@@ -0,0 +1,703 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#define USE_VALGRIND 0
+
+#if USE_VALGRIND
+#include <valgrind/calltree.h>
+#endif
+
+#include "SVGEvent.h"
+#include "SVGMatrixImpl.h"
+#include "SVGWindowImpl.h"
+#include "SVGElementImpl.h"
+#include "SVGDocumentImpl.moc"
+#include "SVGSVGElementImpl.h"
+#include "SVGImageElementImpl.h"
+#include "SVGScriptElementImpl.h"
+#include "SVGTitleElementImpl.h"
+#include "SVGAnimationElementImpl.h"
+
+#include "KSVGReader.h"
+#include "KSVGLoader.h"
+#include "KSVGCanvas.h"
+#include "CanvasItem.h"
+
+#include <tqpaintdevicemetrics.h>
+
+using namespace KSVG;
+
+#include "SVGDocumentImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+// A sequence of prime numbers that sets the m_elemDict's hash table size as the
+// number of elements in the dictionary passes each level. This keeps the lookup
+// performance high as the number of elements grows. See the TQDict documentation.
+unsigned int SVGDocumentImpl::elemDictHashSizes [] =
+{
+ 101,
+ 211,
+ 401,
+ 809,
+ 1601,
+ 3203,
+ 6421,
+ 12809,
+ 25601,
+ 51203,
+ 102407,
+ 204803,
+ 409609,
+ 819229
+};
+
+const int SVGDocumentImpl::numElemDictHashSizes = sizeof(elemDictHashSizes) / sizeof(elemDictHashSizes[0]);
+
+SVGDocumentImpl::SVGDocumentImpl(bool anim, bool fit, SVGImageElementImpl *parentImage) : TQObject(), DOM::DomShared(), DOM::Document(), SVGDOMNodeBridge(static_cast<DOM::Node>(*this))
+{
+ m_animations = anim;
+
+ m_reader = 0;
+ m_loader = 0;
+ m_canvas = 0;
+ m_rootElement = 0;
+ m_lastTarget = 0;
+ m_window = 0;
+
+ m_elemDictHashSizeIndex = 0;
+ m_elemDict.resize(elemDictHashSizes[m_elemDictHashSizeIndex]);
+
+ m_timeScheduler = new SVGTimeScheduler(this);
+ m_ecmaEngine = new KSVGEcma(this);
+ m_ecmaEngine->setup();
+
+ m_finishedParsing = false;
+ m_finishedLoading = false;
+ m_resortZIndicesOnFinishedLoading = false;
+ m_fit = fit;
+
+ m_parentImage = parentImage;
+ if(m_parentImage)
+ m_parentImage->ref();
+}
+
+SVGDocumentImpl::~SVGDocumentImpl()
+{
+ if(rootElement() && rootElement()->hasEventListener(SVGEvent::UNLOAD_EVENT, true))
+ rootElement()->dispatchEvent(SVGEvent::UNLOAD_EVENT, false, false);
+
+ TQPtrList<SVGShapeImpl> killList;
+
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(getElementFromHandle(node.handle()));
+ if(shape)
+ killList.append(shape);
+ }
+
+ SVGShapeImpl *rend = 0;
+ for(rend = killList.first(); rend; rend = killList.next())
+ delete rend;
+
+ delete m_timeScheduler;
+ delete m_ecmaEngine;
+ delete m_reader;
+ delete m_loader;
+
+ if(m_window)
+ m_window->deref();
+
+ if(m_parentImage)
+ m_parentImage->deref();
+}
+
+SVGWindowImpl *SVGDocumentImpl::window()
+{
+ if(!m_window)
+ {
+ m_window = new SVGWindowImpl(const_cast<SVGDocumentImpl *>(this));
+ m_window->ref();
+ }
+
+ return m_window;
+}
+
+float SVGDocumentImpl::screenPixelsPerMillimeterX() const
+{
+ if(canvas() && canvas()->drawWindow())
+ {
+ TQPaintDeviceMetrics metrics(canvas()->drawWindow());
+ return float(metrics.width()) / float(metrics.widthMM());
+ }
+ else
+ return 90.0;
+}
+
+float SVGDocumentImpl::screenPixelsPerMillimeterY() const
+{
+ if(canvas() && canvas()->drawWindow())
+ {
+ TQPaintDeviceMetrics metrics(canvas()->drawWindow());
+ return float(metrics.height()) / float(metrics.heightMM());
+ }
+ else
+ return 90.0;
+}
+
+DOM::DOMString SVGDocumentImpl::title() const
+{
+ DOM::Node n;
+ for(n = rootElement()->firstChild(); !n.isNull(); n = n.nextSibling())
+ {
+ SVGElementImpl *elem = getElementFromHandle(n.handle());
+ if(dynamic_cast<SVGTitleElementImpl *>(elem))
+ return elem->collectText();
+ }
+ return "";
+}
+
+DOM::DOMString SVGDocumentImpl::referrer() const
+{
+ return m_referrer;
+}
+
+DOM::DOMString SVGDocumentImpl::domain() const
+{
+ return m_baseURL.host();
+}
+
+DOM::DOMString SVGDocumentImpl::URL() const
+{
+ return m_baseURL.prettyURL();
+}
+
+void SVGDocumentImpl::setReferrer(const DOM::DOMString &referrer)
+{
+ // TODO : better may be to request for referrer instead of storing it
+ m_referrer = referrer;
+}
+
+void SVGDocumentImpl::setRootElement(SVGSVGElementImpl *elem)
+{
+ m_rootElement = elem;
+}
+
+SVGSVGElementImpl *SVGDocumentImpl::rootElement() const
+{
+ return m_rootElement;
+}
+
+SVGElementImpl *SVGDocumentImpl::createElement(const DOM::DOMString &name, DOM::Element impl, SVGDocumentImpl *doc)
+{
+ DOM::ElementImpl *handle = reinterpret_cast<DOM::ElementImpl *>(impl.handle());
+ SVGElementImpl *element = SVGElementImpl::Factory::self()->create(std::string(name.string().latin1()), handle);
+
+ if(!element)
+ element = new SVGElementImpl(handle);
+
+ element->setOwnerDoc(doc);
+ element->ref();
+ return element;
+}
+
+bool SVGDocumentImpl::open(const ::KURL &url)
+{
+ if(!url.prettyURL().isEmpty())
+ {
+ m_baseURL = url;
+
+ if(!m_loader)
+ m_loader = new KSVGLoader();
+
+ connect(m_loader, TQT_SIGNAL(gotResult(TQIODevice *)), this, TQT_SLOT(slotSVGContent(TQIODevice *)));
+ m_loader->getSVGContent(url);
+ }
+ else
+ return false;
+
+ return true;
+}
+
+void SVGDocumentImpl::slotSVGContent(TQIODevice *dev)
+{
+ TQXmlInputSource *inputSource = new TQXmlInputSource(dev);
+
+ if(m_reader)
+ delete m_reader;
+
+ KSVGReader::ParsingArgs args;
+ args.fit = m_fit;
+ args.getURLMode = false;
+
+ TQString url = m_baseURL.prettyURL();
+ int pos = url.find('#'); // url can become like this.svg#svgView(viewBox(63,226,74,74)), get part after '#'
+ if(pos > -1)
+ args.SVGFragmentId = url.mid(pos + 1);
+
+ m_reader = new KSVGReader(this, m_canvas, args);
+ connect(m_reader, TQT_SIGNAL(finished(bool, const TQString &)), this, TQT_SLOT(slotFinishedParsing(bool, const TQString &)));
+ m_t.start();
+
+#if USE_VALGRIND
+ CALLTREE_ZERO_STATS();
+#endif
+
+ m_reader->parse(inputSource);
+ delete dev;
+}
+
+void SVGDocumentImpl::parseSVG(TQXmlInputSource *inputSource, bool getURLMode)
+{
+ if(m_reader)
+ delete m_reader;
+
+ KSVGReader::ParsingArgs args;
+ args.fit = m_fit;
+ args.getURLMode = getURLMode;
+ m_reader = new KSVGReader(this, 0, args);
+ connect(m_reader, TQT_SIGNAL(finished(bool, const TQString &)), this, TQT_SLOT(slotFinishedParsing(bool, const TQString &)));
+
+#if USE_VALGRIND
+ CALLTREE_ZERO_STATS();
+#endif
+
+ m_reader->parse(inputSource);
+}
+
+void SVGDocumentImpl::finishParsing(bool error, const TQString &errorDesc)
+{
+ if(m_reader)
+ m_reader->finishParsing(error, errorDesc);
+}
+
+void SVGDocumentImpl::slotFinishedParsing(bool error, const TQString &errorDesc)
+{
+ kdDebug(26000) << k_funcinfo << "total time : " << m_t.elapsed() << endl;
+
+#if USE_VALGRIND
+ CALLTREE_DUMP_STATS();
+#endif
+
+ if(m_animations)
+ m_timeScheduler->startAnimations();
+
+ if(m_canvas && !error && rootElement())
+ executeScripts();
+
+ m_finishedParsing = true;
+
+ emit finishedParsing(error, errorDesc);
+ if(!error)
+ emit finishedRendering();
+
+ checkFinishedLoading();
+}
+
+void SVGDocumentImpl::newImageJob(SVGImageElementImpl *image)
+{
+ kdDebug(26002) << "SVGDocumentImpl::newImageJob, " << image << endl;
+ m_loader->newImageJob(image, m_baseURL);
+}
+
+void SVGDocumentImpl::notifyImageLoading(SVGImageElementImpl *image)
+{
+ m_imagesLoading.append(image);
+}
+
+void SVGDocumentImpl::notifyImageLoaded(SVGImageElementImpl *image)
+{
+ m_imagesLoading.remove(image);
+
+ if(m_imagesLoading.isEmpty())
+ checkFinishedLoading();
+}
+
+void SVGDocumentImpl::checkFinishedLoading()
+{
+ if(m_finishedParsing && m_imagesLoading.isEmpty())
+ {
+ m_finishedLoading = true;
+
+ if(m_resortZIndicesOnFinishedLoading)
+ {
+ // Only resort if we're the 'outermost' document, i.e. we're not an svg image
+ // inside another document. We could resort as each image finishes loading, but it
+ // slows down the parsing phase.
+ if(m_parentImage == 0 && m_canvas && m_rootElement)
+ {
+ m_canvas->setElementItemZIndexRecursive(m_rootElement, 0);
+ m_canvas->update();
+ }
+ }
+
+ emit finishedLoading();
+ }
+}
+
+void SVGDocumentImpl::addForwardReferencingUseElement(SVGUseElementImpl *use)
+{
+ if(!m_forwardReferencingUseElements.contains(use))
+ m_forwardReferencingUseElements.append(use);
+}
+
+void SVGDocumentImpl::slotPaint()
+{
+ rerender();
+}
+
+void SVGDocumentImpl::rerender()
+{
+ m_canvas->update();
+ emit finishedRendering();
+}
+
+void SVGDocumentImpl::attach(KSVG::KSVGCanvas *c)
+{
+ m_canvas = c;
+}
+
+void SVGDocumentImpl::detach()
+{
+ m_canvas = 0;
+}
+
+KSVG::KSVGCanvas *SVGDocumentImpl::canvas() const
+{
+ return m_canvas;
+}
+
+void SVGDocumentImpl::syncCachedMatrices()
+{
+ if(rootElement())
+ {
+ SVGMatrixImpl *parentMatrix = SVGSVGElementImpl::createSVGMatrix();
+ rootElement()->checkCachedScreenCTM(parentMatrix);
+ parentMatrix->deref();
+ }
+}
+
+void SVGDocumentImpl::executeScriptsRecursive(DOM::Node start)
+{
+ DOM::Node node = start.firstChild();
+
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = getElementFromHandle(node.handle());
+
+ SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(element);
+ if(container)
+ executeScriptsRecursive(node);
+
+ SVGScriptElementImpl *script = dynamic_cast<SVGScriptElementImpl *>(element);
+
+ if(script)
+ script->executeScript(DOM::Node());
+ }
+}
+
+bool SVGDocumentImpl::executeScriptsRecursiveCheck(DOM::Node start)
+{
+ bool test = true;
+
+ DOM::Node node = start.firstChild();
+
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = getElementFromHandle(node.handle());
+
+ SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(element);
+ if(container)
+ {
+ if(!executeScriptsRecursiveCheck(node))
+ return false;
+ }
+
+ SVGScriptElementImpl *script = dynamic_cast<SVGScriptElementImpl *>(element);
+
+ if(script)
+ {
+ if(!script->canExecuteScript())
+ {
+ test = false;
+ break;
+ }
+ }
+ }
+
+ return test;
+}
+
+void SVGDocumentImpl::executeScripts()
+{
+ bool test = executeScriptsRecursiveCheck(*rootElement());
+
+ if(!test)
+ TQTimer::singleShot(50, this, TQT_SLOT(executeScripts()));
+ else
+ {
+ executeScriptsRecursive(*rootElement());
+
+ // mop: only rerender if an loadevent has been found
+ if(dispatchRecursiveEvent(SVGEvent::LOAD_EVENT, lastChild()))
+ m_canvas->update();
+ }
+}
+
+// Dispatches a non-cancelable, non-bubbles event to every child
+bool SVGDocumentImpl::dispatchRecursiveEvent(SVGEvent::EventId id, DOM::Node start)
+{
+ bool eventExecuted = false;
+
+ // Iterate the tree, backwards, and dispatch the event to every child
+ DOM::Node node = start;
+ for(; !node.isNull(); node = node.previousSibling())
+ {
+ SVGElementImpl *element = getElementFromHandle(node.handle());
+
+ if(element && element->hasChildNodes())
+ {
+ // Dispatch to all children
+ eventExecuted = dispatchRecursiveEvent(id, element->lastChild()) ? true : eventExecuted;
+
+ // Dispatch, locally
+ if(element->hasEventListener(id, true))
+ {
+ element->dispatchEvent(id, false, false);
+ eventExecuted = true;
+ }
+ }
+ else if(element && element->hasEventListener(id, true))
+ {
+ element->dispatchEvent(id, false, false);
+ eventExecuted = true;
+ }
+ }
+
+ return eventExecuted;
+}
+
+SVGEventListener *SVGDocumentImpl::createEventListener(DOM::DOMString type)
+{
+ return m_ecmaEngine->createEventListener(type);
+}
+
+SVGElementImpl *SVGDocumentImpl::recursiveSearch(DOM::Node start, const DOM::DOMString &id)
+{
+ DOM::Node node = start.firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *test = getElementFromHandle(node.handle());
+
+ // Look in containers
+ SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(test);
+ if(container)
+ {
+ SVGElementImpl *found = recursiveSearch(node, id);
+ if(found)
+ return found;
+ }
+
+ // Look in SVGSVGElementImpl's
+ SVGSVGElementImpl *svgtest = dynamic_cast<SVGSVGElementImpl *>(test);
+ if(svgtest)
+ {
+ SVGElementImpl *element = svgtest->getElementById(id);
+ if(element)
+ return element;
+ }
+ }
+
+ return 0;
+}
+
+/*
+@namespace KSVG
+@begin SVGDocumentImpl::s_hashTable 9
+ title SVGDocumentImpl::Title DontDelete|ReadOnly
+ referrer SVGDocumentImpl::Referrer DontDelete|ReadOnly
+ domain SVGDocumentImpl::Domain DontDelete|ReadOnly
+ URL SVGDocumentImpl::Url DontDelete|ReadOnly
+ doctype SVGDocumentImpl::DocType DontDelete|ReadOnly
+ implementation SVGDocumentImpl::Implementation DontDelete|ReadOnly
+ rootElement SVGDocumentImpl::RootElement DontDelete|ReadOnly
+ documentElement SVGDocumentImpl::DocumentElement DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGDocumentImplProto::s_hashTable 7
+ createTextNode SVGDocumentImpl::CreateTextNode DontDelete|Function 1
+ createElement SVGDocumentImpl::CreateElement DontDelete|Function 1
+ createElementNS SVGDocumentImpl::CreateElementNS DontDelete|Function 2
+ getElementById SVGDocumentImpl::GetElementById DontDelete|Function 1
+ getElementsByTagName SVGDocumentImpl::GetElementsByTagName DontDelete|Function 1
+ getElementsByTagNameNS SVGDocumentImpl::GetElementsByTagNameNS DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGDocument", SVGDocumentImplProto, SVGDocumentImplProtoFunc)
+
+Value SVGDocumentImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Title:
+ return String(title().string());
+ case Referrer:
+ return String(referrer().string());
+ case Domain:
+ return String(domain().string());
+ case Url:
+ return String(URL().string());
+ case DocType:
+ return getDOMNode(exec, doctype());
+ case Implementation:
+ return (new SVGDOMDOMImplementationBridge(implementation()))->cache(exec);
+ case RootElement:
+ case DocumentElement:
+ return m_rootElement->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGDocumentImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDocumentImpl)
+
+ switch(id)
+ {
+ case SVGDocumentImpl::CreateTextNode:
+ return getDOMNode(exec, obj->createTextNode(args[0].toString(exec).string()));
+ case SVGDocumentImpl::CreateElement:
+ case SVGDocumentImpl::CreateElementNS:
+ {
+ SVGElementImpl *newElement = 0;
+
+ if(id == SVGDocumentImpl::CreateElement)
+ newElement = obj->createElement(args[0].toString(exec).qstring(), static_cast<DOM::Document *>(obj)->createElement(args[0].toString(exec).string()), obj);
+ else if(id == SVGDocumentImpl::CreateElementNS)
+ newElement = obj->createElement(args[1].toString(exec).qstring(), static_cast<DOM::Document *>(obj)->createElementNS(args[0].toString(exec).string(), args[1].toString(exec).string()), obj);
+
+ newElement->setOwnerSVGElement(obj->rootElement()); // FIXME: Correct in all situations?
+ newElement->setViewportElement(obj->rootElement());
+ newElement->setAttributes();
+
+ return getDOMNode(exec, *newElement);
+ }
+ case SVGDocumentImpl::GetElementById:
+ {
+ Value ret;
+
+ SVGElementImpl *element = obj->rootElement()->getElementById(args[0].toString(exec).string());
+
+ if(element)
+ ret = getDOMNode(exec, *element);
+ else
+ {
+ element = obj->recursiveSearch(*obj, args[0].toString(exec).string());
+ if(!element)
+ return Null();
+
+ ret = getDOMNode(exec, *element);
+ }
+
+ return ret;
+ }
+ case SVGDocumentImpl::GetElementsByTagName:
+ return (new SVGDOMNodeListBridge(obj->getElementsByTagName(args[0].toString(exec).string())))->cache(exec);
+ case SVGDocumentImpl::GetElementsByTagNameNS:
+ return (new SVGDOMNodeListBridge(obj->getElementsByTagNameNS(args[0].toString(exec).string(), args[1].toString(exec).string())))->cache(exec);
+ default:
+ break;
+ }
+
+ return KJS::Undefined();
+}
+
+SVGElementImpl *SVGDocumentImpl::getElementFromHandle(DOM::NodeImpl *handle) const
+{
+ return m_elemDict[handle];
+}
+
+void SVGDocumentImpl::addToElemDict(DOM::NodeImpl *handle, SVGElementImpl *obj)
+{
+ m_elemDict.insert(handle, obj);
+
+ if(m_elemDict.count()>m_elemDict.size() && m_elemDictHashSizeIndex<numElemDictHashSizes-1)
+ {
+ // Increase the hash table size to maintain good lookup speed.
+ m_elemDictHashSizeIndex++;
+ m_elemDict.resize(elemDictHashSizes[m_elemDictHashSizeIndex]);
+ }
+}
+
+void SVGDocumentImpl::removeFromElemDict(DOM::NodeImpl *handle)
+{
+ m_elemDict.remove(handle);
+}
+
+SVGDocumentImpl *SVGDocumentImpl::getDocumentFromHandle(DOM::NodeImpl *handle) const
+{
+ return m_documentDict[handle];
+}
+
+void SVGDocumentImpl::addToDocumentDict(DOM::NodeImpl *handle, SVGDocumentImpl *obj)
+{
+ m_documentDict.insert(handle, obj);
+}
+
+SVGElementImpl *SVGDocumentImpl::getElementByIdRecursive(SVGSVGElementImpl *start, const DOM::DOMString &elementId, bool dontSearch)
+{
+ SVGElementImpl *element = 0;
+
+ // #1 Look in passed SVGSVGElementImpl
+ if(start)
+ {
+ element = start->getElementById(elementId);
+
+ if(element)
+ return element;
+ }
+
+ // #2 Search in all child SVGSVGElementImpl's
+ element = recursiveSearch(*this, elementId);
+
+ if(element)
+ return element;
+
+ // #3 Search in other documents
+ if(!dontSearch)
+ {
+ TQPtrDictIterator<SVGDocumentImpl> it(m_documentDict);
+ for(; it.current(); ++it)
+ {
+ SVGElementImpl *temp = it.current()->getElementByIdRecursive(0, elementId, true);
+ if(temp)
+ return temp;
+ }
+ }
+
+ return element;
+}
diff --git a/ksvg/impl/SVGDocumentImpl.h b/ksvg/impl/SVGDocumentImpl.h
index 6280bd51..e9d12a0d 100644
--- a/ksvg/impl/SVGDocumentImpl.h
+++ b/ksvg/impl/SVGDocumentImpl.h
@@ -242,5 +242,3 @@ KSVG_DEFINE_PROTOTYPE(SVGDocumentImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGDocumentImplProtoFunc, SVGDocumentImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGEcma.cc b/ksvg/impl/SVGEcma.cc
deleted file mode 100644
index 87eca6e0..00000000
--- a/ksvg/impl/SVGEcma.cc
+++ /dev/null
@@ -1,844 +0,0 @@
-/*
- Copyright (C) 2002-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <typeinfo>
-
-#include <kdebug.h>
-
-#include <dom/dom_exception.h>
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-#include "SVGEcma.h"
-#include "SVGShapeImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGEcma.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_ecmaeventlistener.h"
-#include "ksvg_window.h"
-#include "ksvg_ecma.h"
-
-// SVGDOMNodeBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMNodeBridge::s_hashTable 17
- nodeName SVGDOMNodeBridge::NodeName DontDelete|ReadOnly
- nodeValue SVGDOMNodeBridge::NodeValue DontDelete
- nodeType SVGDOMNodeBridge::NodeType DontDelete|ReadOnly
- parentNode SVGDOMNodeBridge::ParentNode DontDelete|ReadOnly
- childNodes SVGDOMNodeBridge::ChildNodes DontDelete|ReadOnly
- firstChild SVGDOMNodeBridge::FirstChild DontDelete|ReadOnly
- lastChild SVGDOMNodeBridge::LastChild DontDelete|ReadOnly
- previousSibling SVGDOMNodeBridge::PreviousSibling DontDelete|ReadOnly
- nextSibling SVGDOMNodeBridge::NextSibling DontDelete|ReadOnly
- attributes SVGDOMNodeBridge::Attributes DontDelete|ReadOnly
- namespaceURI SVGDOMNodeBridge::NamespaceURI DontDelete|ReadOnly
- prefix SVGDOMNodeBridge::Prefix DontDelete
- localName SVGDOMNodeBridge::LocalName DontDelete|ReadOnly
- ownerDocument SVGDOMNodeBridge::OwnerDocument DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGDOMNodeBridgeProto::s_hashTable 29
- insertBefore SVGDOMNodeBridge::InsertBefore DontDelete|Function 2
- replaceChild SVGDOMNodeBridge::ReplaceChild DontDelete|Function 2
- removeChild SVGDOMNodeBridge::RemoveChild DontDelete|Function 1
- appendChild SVGDOMNodeBridge::AppendChild DontDelete|Function 1
- hasAttributes SVGDOMNodeBridge::HasAttributes DontDelete|Function 0
- hasChildNodes SVGDOMNodeBridge::HasChildNodes DontDelete|Function 0
- cloneNode SVGDOMNodeBridge::CloneNode DontDelete|Function 1
- normalize SVGDOMNodeBridge::Normalize DontDelete|Function 0
- isSupported SVGDOMNodeBridge::IsSupported DontDelete|Function 2
- addEventListener SVGDOMNodeBridge::AddEventListener DontDelete|Function 3
- removeEventListener SVGDOMNodeBridge::RemoveEventListener DontDelete|Function 3
- contains SVGDOMNodeBridge::Contains DontDelete|Function 1
- getNodeName SVGDOMNodeBridge::GetNodeName DontDelete|Function 0
- getNodeValue SVGDOMNodeBridge::GetNodeValue DontDelete|Function 0
- getNodeType SVGDOMNodeBridge::GetNodeType DontDelete|Function 0
- getParentNode SVGDOMNodeBridge::GetParentNode DontDelete|Function 0
- getChildNodes SVGDOMNodeBridge::GetChildNodes DontDelete|Function 0
- getFirstChild SVGDOMNodeBridge::GetFirstChild DontDelete|Function 0
- getLastChild SVGDOMNodeBridge::GetLastChild DontDelete|Function 0
- getPreviousSibling SVGDOMNodeBridge::GetPreviousSibling DontDelete|Function 0
- getNextSibling SVGDOMNodeBridge::GetNextSibling DontDelete|Function 0
- getAttributes SVGDOMNodeBridge::GetAttributes DontDelete|Function 0
- getNamespaceURI SVGDOMNodeBridge::GetNamespaceURI DontDelete|Function 0
- getPrefix SVGDOMNodeBridge::GetPrefix DontDelete|Function 0
- getLocalName SVGDOMNodeBridge::GetLocalName DontDelete|Function 0
- getOwnerDocument SVGDOMNodeBridge::GetOwnerDocument DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("DOMNode", SVGDOMNodeBridgeProto, SVGDOMNodeBridgeProtoFunc)
-
-Value SVGDOMNodeBridge::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case NodeName:
- return getString(m_impl.nodeName());
- case NodeValue:
- return getString(m_impl.nodeValue());
- case NodeType:
- return Number(m_impl.nodeType());
- case ParentNode:
- return getDOMNode(exec, m_impl.parentNode());
- case ChildNodes:
- return (new SVGDOMNodeListBridge(m_impl.childNodes()))->cache(exec);
- case FirstChild:
- return getDOMNode(exec, m_impl.firstChild());
- case LastChild:
- return getDOMNode(exec, m_impl.lastChild());
- case PreviousSibling:
- return getDOMNode(exec, m_impl.previousSibling());
- case NextSibling:
- return getDOMNode(exec, m_impl.nextSibling());
-// case Attributes: // TODO
- case NamespaceURI:
- return getString(m_impl.namespaceURI());
- case Prefix:
- return getString(m_impl.prefix());
- case LocalName:
- return getString(m_impl.localName());
- case OwnerDocument:
- return getDOMNode(exec, m_impl.ownerDocument());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGDOMNodeBridge::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case NodeValue:
- m_impl.setNodeValue(value.toString(exec).string());
- break;
- case Prefix:
- m_impl.setPrefix(value.toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// Special variantion to update the <text> element,
-// triggered by one of the child nodes
-void updateTextItem(ExecState *exec, const DOM::Node node)
-{
- DOM::Node parent;
- while(!(parent = node.parentNode()).isNull())
- {
- DOM::DOMString name = parent.nodeName();
- if(name == "text" || name == "tspan" || name == "tref")
- {
- SVGHelperImpl::updateItem(exec, parent);
- break;
- }
- }
-}
-
-// Remove item from canvas
-void removeItem(ExecState *exec, DOM::Node &node)
-{
- // Get document
- SVGDocumentImpl *doc = KSVG::Window::retrieveActive(exec)->doc();
-
- // Update canvas
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(node.handle()));
- if(shape && shape->item())
- doc->canvas()->removeItem(shape->item());
-}
-
-// parseXML + getURL() need all these 5 functions to work properly
-void correctHandles(SVGElementImpl *main, DOM::Node &node)
-{
- DOM::Element old(node.handle());
- DOM::Element *replace = static_cast<DOM::Element *>(main->ownerDoc()->getElementFromHandle(node.handle()));
-
- if(replace && node.nodeType() == DOM::Node::ELEMENT_NODE)
- *replace = old;
-
- if(node.hasChildNodes())
- {
- for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
- correctHandles(main, iterate);
- }
-}
-
-void integrateTree(SVGElementImpl *main, DOM::Node &node, DOM::Node &newNode, SVGElementImpl *obj, SVGDocumentImpl *doc)
-{
- if(!obj)
- return;
-
- // Add to global element dicts
- doc->addToElemDict(newNode.handle(), obj);
- doc->addToElemDict(node.handle(), obj);
-
- if(node.hasChildNodes())
- {
- DOM::Node iterate2 = newNode.firstChild();
- for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
- {
- integrateTree(main, iterate, iterate2, obj->ownerDoc()->getElementFromHandle(iterate2.handle()), doc);
- iterate2 = iterate2.nextSibling();
- }
- }
-}
-
-void correctDocument(SVGElementImpl *main, DOM::Node &node, SVGElementImpl *obj, SVGDocumentImpl *doc)
-{
- if(!obj)
- return;
-
- // Correct document
- obj->setOwnerDoc(main->ownerDoc());
-
- // Correct rootElement
- if(!obj->ownerSVGElement())
- obj->setOwnerSVGElement(main->ownerSVGElement());
-
- // Correct viewportElement
- if(!obj->viewportElement())
- obj->setViewportElement(main->viewportElement());
-
- // Properly (re-)register events in the current active document
- obj->setupEventListeners(main->ownerDoc(), doc);
-
- if(node.hasChildNodes())
- {
- for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
- correctDocument(main, iterate, doc->getElementFromHandle(iterate.handle()), doc);
- }
-}
-
-void registerAdditional(ExecState *exec, SVGDocumentImpl *doc, DOM::Node node)
-{
- // Register ID in rootElement!
- SVGElementImpl *resultElement = doc->getElementFromHandle(node.handle());
- if(resultElement && resultElement->hasAttribute("id"))
- doc->rootElement()->addToIdMap(resultElement->getAttribute("id").string(), resultElement);
-
- if(node.hasChildNodes())
- {
- for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
- registerAdditional(exec, doc, iterate);
- }
-}
-
-Value appendHelper(ExecState *exec, DOM::Node node, DOM::Node newNode)
-{
- // This is quite tricky code by me (Niko)
- // Don't even try to modify it.
- if(!(node.ownerDocument() == newNode.ownerDocument()))
- {
- // Get document
- SVGDocumentImpl *doc = KSVG::Window::retrieveActive(exec)->doc();
-
- // Detect ownerDoc() of newNode
- SVGDocumentImpl *newDoc = doc->getDocumentFromHandle(newNode.ownerDocument().handle());
-
- // Get some SVGElementImpl's
- SVGElementImpl *nodeElement = doc->getElementFromHandle(node.handle());
- SVGElementImpl *newNodeElement = newDoc->getElementFromHandle(newNode.handle());
-
- // Import node into document
- DOM::Node result = doc->importNode(newNode, true);
-
- // Associate the imported node 'result' with the
- // 'newNodeElement' which belongs to 'newDoc'
- integrateTree(nodeElement, result, newNode, newNodeElement, doc);
-
- // Correct handles in SVG* elements
- correctHandles(nodeElement, result);
-
- // Correct ownerDoc() etc..
- correctDocument(nodeElement, newNode, newNodeElement, newDoc);
-
- // Register ID in global map
- registerAdditional(exec, doc, result);
-
- // Recalc style
- newNodeElement->setAttributes();
-
- // Append + create + update element
- Value retVal = getDOMNode(exec, node.appendChild(result));
-
- doc->syncCachedMatrices();
- newNodeElement->createItem(doc->canvas());
- SVGHelperImpl::updateItem(exec, *newNodeElement);
-
- return retVal;
- }
- else
- {
- Value retVal = getDOMNode(exec, node.appendChild(newNode));
-
- // Get document
- SVGDocumentImpl *doc = KSVG::Window::retrieveActive(exec)->doc();
- doc->syncCachedMatrices();
-
- // Get some SVGElementImpl's
- SVGElementImpl *nodeElement = doc->getElementFromHandle(newNode.handle());
- // TODO : extra check needed to see if the new elements parent is already appended
- // in the doc. Not really nice, should be some other way? (Rob)
- if(nodeElement && !nodeElement->parentNode().parentNode().isNull())
- {
- nodeElement->setAttributes(true);
- nodeElement->createItem();
- SVGHelperImpl::updateItem(exec, newNode);
- }
-
- return retVal;
- }
-}
-
-Value SVGDOMNodeBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDOMNodeBridge)
- DOM::Node node = obj->impl();
-
- switch(id)
- {
- case SVGDOMNodeBridge::InsertBefore:
- {
- DOM::Node newChild = toNode(args[0]);
- DOM::Node beforeChild = toNode(args[1]);
- Value retVal = getDOMNode(exec, node.insertBefore(newChild, beforeChild));
-
- // Get document
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
-
- // Get some SVGElementImpl's
- SVGShapeImpl *newShape = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(newChild.handle()));
- SVGElementImpl *newElement = doc->getElementFromHandle(newChild.handle());
- SVGShapeImpl *beforeElement = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(beforeChild.handle()));
- if(newShape && beforeElement && beforeElement->item())
- {
- int z = beforeElement->item()->zIndex();
- newElement->createItem();
- doc->canvas()->insert(newShape->item(), z);
- }
- SVGHelperImpl::updateItem(exec, newChild);
-
- return retVal;
- }
- case SVGDOMNodeBridge::ReplaceChild:
- {
- DOM::Node newChild = toNode(args[0]);
- Value retVal = getDOMNode(exec, node.replaceChild(newChild, toNode(args[1])));
- SVGHelperImpl::updateItem(exec, newChild);
- return retVal;
- }
- case SVGDOMNodeBridge::RemoveChild:
- {
- DOM::Node remove = toNode(args[0]);
- if(remove.isNull())
- return Undefined();
-
- // New removeChild logic:
- // - remove from DOM tree
- // - delete element (also deletes it's child element's)
- removeItem(exec, remove);
- Value retVal = getDOMNode(exec, node.removeChild(remove));
- return retVal;
- }
- case SVGDOMNodeBridge::AppendChild:
- return appendHelper(exec, node, toNode(args[0]));
- case SVGDOMNodeBridge::HasAttributes:
- {
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(node.handle());
-
- if(!element)
- return Undefined();
-
- return Boolean(element->hasAttributes());
- }
- case SVGDOMNodeBridge::HasChildNodes:
- return Boolean(node.hasChildNodes());
- case SVGDOMNodeBridge::CloneNode:
- {
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(node.handle());
- SVGElementImpl *newElement = element->cloneNode(args[0].toBoolean(exec));
-
- return getDOMNode(exec, *newElement);
- }
- case SVGDOMNodeBridge::Normalize:
- {
- node.normalize();
- return Undefined();
- }
- case SVGDOMNodeBridge::IsSupported:
- return Boolean(node.isSupported(args[0].toString(exec).string(), args[1].toString(exec).string()));
- case SVGDOMNodeBridge::AddEventListener:
- {
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(node.handle());
-
- if(element)
- {
- SVGEvent::EventId eventId = SVGEvent::typeToId(args[0].toString(exec).string());
- if(eventId != SVGEvent::UNKNOWN_EVENT)
- element->setEventListener(eventId, new KSVGEcmaEventListener(Object::dynamicCast(args[1]), TQString(), doc->ecmaEngine()));
- }
- return Undefined();
- }
- case SVGDOMNodeBridge::RemoveEventListener:
- {
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(node.handle());
-
- if(element)
- {
- SVGEvent::EventId eventId = SVGEvent::typeToId(args[0].toString(exec).string());
- if(eventId != SVGEvent::UNKNOWN_EVENT)
- element->removeEventListener((int) eventId);
- }
- return Undefined();
- }
-// case SVGDOMNodeBridge::Contains: // TODO
- case SVGDOMNodeBridge::GetNodeName:
- return getString(node.nodeName());
- case SVGDOMNodeBridge::GetNodeValue:
- return getString(node.nodeValue());
- case SVGDOMNodeBridge::GetNodeType:
- return Number(node.nodeType());
- case SVGDOMNodeBridge::GetParentNode:
- return getDOMNode(exec, node.parentNode());
- case SVGDOMNodeBridge::GetChildNodes:
- return (new SVGDOMNodeListBridge(node.childNodes()))->cache(exec);
- case SVGDOMNodeBridge::GetFirstChild:
- return getDOMNode(exec, node.firstChild());
- case SVGDOMNodeBridge::GetLastChild:
- return getDOMNode(exec, node.lastChild());
- case SVGDOMNodeBridge::GetPreviousSibling:
- return getDOMNode(exec, node.previousSibling());
- case SVGDOMNodeBridge::GetNextSibling:
- return getDOMNode(exec, node.nextSibling());
-// case SVGDOMNodeBridge::GetAttributes: // TODO
- case SVGDOMNodeBridge::GetNamespaceURI:
- return getString(node.namespaceURI());
- case SVGDOMNodeBridge::GetPrefix:
- return getString(node.prefix());
- case SVGDOMNodeBridge::GetLocalName:
- return getString(node.localName());
- case SVGDOMNodeBridge::GetOwnerDocument:
- return getDOMNode(exec, node.ownerDocument());
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// SVGDOMElementBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMElementBridge::s_hashTable 2
- tagName SVGDOMElementBridge::TagName DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGDOMElementBridgeProto::s_hashTable 17
- getAttribute SVGDOMElementBridge::GetAttribute DontDelete|Function 1
- setAttribute SVGDOMElementBridge::SetAttribute DontDelete|Function 2
- removeAttribute SVGDOMElementBridge::RemoveAttribute DontDelete|Function 1
- getAttributeNode SVGDOMElementBridge::GetAttributeNode DontDelete|Function 1
- setAttributeNode SVGDOMElementBridge::SetAttributeNode DontDelete|Function 2
- removeAttributeNode SVGDOMElementBridge::RemoveAttributeNode DontDelete|Function 1
- getElementsByTagName SVGDOMElementBridge::GetElementsByTagName DontDelete|Function 1
- hasAttribute SVGDOMElementBridge::HasAttribute DontDelete|Function 1
- getAttributeNS SVGDOMElementBridge::GetAttributeNS DontDelete|Function 2
- setAttributeNS SVGDOMElementBridge::SetAttributeNS DontDelete|Function 3
- removeAttributeNS SVGDOMElementBridge::RemoveAttributeNS DontDelete|Function 2
- getAttributeNodeNS SVGDOMElementBridge::GetAttributeNodeNS DontDelete|Function 2
- setAttributeNodeNS SVGDOMElementBridge::SetAttributeNodeNS DontDelete|Function 1
- getElementByTagNameNS SVGDOMElementBridge::GetElementsByTagNameNS DontDelete|Function 2
- hasAttributeNS SVGDOMElementBridge::HasAttributeNS DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("DOMElement", SVGDOMElementBridgeProto, SVGDOMElementBridgeProtoFunc)
-
-Value SVGDOMElementBridge::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case TagName:
- return getString(m_impl.tagName());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGDOMElementBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDOMElementBridge)
- DOM::Element elem = obj->impl();
-
- switch(id)
- {
- case SVGDOMElementBridge::GetAttribute:
- {
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
- if(element)
- return String(element->getAttribute(args[0].toString(exec).string()));
- else
- return Undefined();
- }
- case SVGDOMElementBridge::SetAttribute:
- {
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
- if(element)
- {
- element->setAttribute(args[0].toString(exec).string(), args[1].toString(exec).string());
- element->setAttributeInternal(args[0].toString(exec).string(), args[1].toString(exec).string());
-
- SVGHelperImpl::updateItem(exec, elem);
- }
-
- return Undefined();
- }
- case SVGDOMElementBridge::RemoveAttribute:
- {
- elem.removeAttribute(args[0].toString(exec).string());
- return Undefined();
- }
- case SVGDOMElementBridge::GetAttributeNode:
- return getDOMNode(exec, elem.getAttributeNode(args[0].toString(exec).string()));
- case SVGDOMElementBridge::SetAttributeNode: // TODO: Correct?
- return getDOMNode(exec, elem.setAttributeNode(toNode(args[0])));
- case SVGDOMElementBridge::RemoveAttributeNode: // TODO: Correct?
- return getDOMNode(exec, elem.removeAttributeNode(toNode(args[0])));
- case SVGDOMElementBridge::GetElementsByTagName:
- return (new SVGDOMNodeListBridge(elem.getElementsByTagName(args[0].toString(exec).string())))->cache(exec);
- case SVGDOMElementBridge::GetAttributeNS:
- {
- // This just skips NS! (Rob)
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
- if(element)
- return String(element->getAttribute(args[1].toString(exec).string()));
- else
- return Undefined();
- }
- case SVGDOMElementBridge::SetAttributeNS:
- {
- // For now, we strip the NS part (Rob)
- DOM::DOMString attr = args[1].toString(exec).string();
- int pos = attr.string().find(':');
- if(pos > -1)
- attr = attr.string().mid(pos + 1);
-
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
- SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
- if(element)
- {
- element->setAttribute(attr.string(), args[2].toString(exec).string());
- element->setAttributeInternal(attr.string(), args[2].toString(exec).string());
-
- SVGHelperImpl::updateItem(exec, *element);
- }
-
- return Undefined();
- }
- case SVGDOMElementBridge::RemoveAttributeNS:
- {
- elem.removeAttributeNS(args[0].toString(exec).string(), args[1].toString(exec).string());
- return Undefined();
- }
- case SVGDOMElementBridge::GetAttributeNodeNS:
- return getDOMNode(exec, elem.getAttributeNodeNS(args[0].toString(exec).string(), args[1].toString(exec).string()));
- case SVGDOMElementBridge::SetAttributeNodeNS: // TODO: Correct?
- return getDOMNode(exec, elem.setAttributeNodeNS(toNode(args[0])));
- case SVGDOMElementBridge::GetElementsByTagNameNS:
- return (new SVGDOMNodeListBridge(elem.getElementsByTagNameNS(args[0].toString(exec).string(), args[1].toString(exec).string())))->cache(exec);
- case SVGDOMElementBridge::HasAttribute:
- return Boolean(elem.hasAttribute(args[0].toString(exec).string()));
- case SVGDOMElementBridge::HasAttributeNS:
- return Boolean(elem.hasAttributeNS(args[0].toString(exec).string(), args[1].toString(exec).string()));
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-
-// SVGDOMNodeListBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMNodeListBridge::s_hashTable 2
- length SVGDOMNodeListBridge::Length DontDelete
-@end
-@namespace KSVG
-@begin SVGDOMNodeListBridgeProto::s_hashTable 3
- getLength SVGDOMNodeListBridge::GetLength DontDelete|Function 0
- item SVGDOMNodeListBridge::Item DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("DOMNodeList", SVGDOMNodeListBridgeProto, SVGDOMNodeListBridgeProtoFunc)
-
-Value SVGDOMNodeListBridge::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Length:
- return Number(m_impl.length());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGDOMNodeListBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDOMNodeListBridge)
- DOM::NodeList nodeList = obj->impl();
-
- switch(id)
- {
- case SVGDOMNodeListBridge::GetLength:
- return Number(nodeList.length());
- case SVGDOMNodeListBridge::Item:
- return getDOMNode(exec, nodeList.item((unsigned long)args[0].toNumber(exec)));
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// SVGDOMCharacterDataBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMCharacterDataBridge::s_hashTable 3
- data SVGDOMCharacterDataBridge::Data DontDelete
- length SVGDOMCharacterDataBridge::Length DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGDOMCharacterDataBridgeProto::s_hashTable 11
- getData SVGDOMCharacterDataBridge::GetData DontDelete|Function 0
- setData SVGDOMCharacterDataBridge::SetData DontDelete|Function 1
- getLength SVGDOMCharacterDataBridge::GetLength DontDelete|Function 0
- substringData SVGDOMCharacterDataBridge::SubstringData DontDelete|Function 2
- appendData SVGDOMCharacterDataBridge::AppendData DontDelete|Function 1
- insertData SVGDOMCharacterDataBridge::InsertData DontDelete|Function 2
- deleteData SVGDOMCharacterDataBridge::DeleteData DontDelete|Function 2
- replaceData SVGDOMCharacterDataBridge::ReplaceData DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("DOMCharacterData", SVGDOMCharacterDataBridgeProto, SVGDOMCharacterDataBridgeProtoFunc)
-
-Value SVGDOMCharacterDataBridge::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Data:
- return String(m_impl.data());
- case Length:
- return Number(m_impl.length());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGDOMCharacterDataBridge::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case Data:
- m_impl.setData(value.toString(exec).string());
- updateTextItem(exec, m_impl);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGDOMCharacterDataBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDOMCharacterDataBridge)
- DOM::CharacterData node = obj->impl();
-
- switch(id)
- {
- case SVGDOMCharacterDataBridge::GetData:
- return String(node.data());
- case SVGDOMCharacterDataBridge::SetData:
- node.setData(args[0].toString(exec).string());
- updateTextItem(exec, node);
- return Undefined();
- case SVGDOMCharacterDataBridge::GetLength:
- return Number(node.length());
- case SVGDOMCharacterDataBridge::SubstringData:
- {
- DOM::DOMString ret = node.substringData(args[0].toInteger(exec), args[1].toInteger(exec));
- updateTextItem(exec, node);
- return String(ret);
- }
- case SVGDOMCharacterDataBridge::AppendData:
- node.appendData(args[0].toString(exec).string());
- updateTextItem(exec, node);
- return Undefined();
- case SVGDOMCharacterDataBridge::InsertData:
- node.insertData(args[0].toInteger(exec), args[1].toString(exec).string());
- updateTextItem(exec, node);
- return Undefined();
- case SVGDOMCharacterDataBridge::DeleteData:
- node.deleteData(args[0].toInteger(exec), args[1].toInteger(exec));
- updateTextItem(exec, node);
- return Undefined();
- case SVGDOMCharacterDataBridge::ReplaceData:
- node.replaceData(args[0].toInteger(exec), args[1].toInteger(exec), args[2].toString(exec).string());
- updateTextItem(exec, node);
- return Undefined();
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// SVGDOMTextBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMTextBridge::s_hashTable 2
- dummy SVGDOMTextBridge::Dummy DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGDOMTextBridgeProto::s_hashTable 2
- splitText SVGDOMTextBridge::SplitText DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("DOMText", SVGDOMTextBridgeProto, SVGDOMTextBridgeProtoFunc)
-
-Value SVGDOMTextBridge::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGDOMTextBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDOMTextBridge)
- DOM::Text node = obj->impl();
-
- switch(id)
- {
- case SVGDOMTextBridge::SplitText:
- return getDOMNode(exec, node.splitText(args[0].toInteger(exec)));
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// SVGDOMDOMImplementationBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMDOMImplementationBridge::s_hashTable 2
- dummy SVGDOMDOMImplementationBridge::Dummy DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGDOMDOMImplementationBridgeProto::s_hashTable 2
- hasFeature SVGDOMDOMImplementationBridge::HasFeature DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("DOMDOMImplementation", SVGDOMDOMImplementationBridgeProto, SVGDOMDOMImplementationBridgeProtoFunc)
-
-Value SVGDOMDOMImplementationBridge::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGDOMDOMImplementationBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGDOMDOMImplementationBridge)
- DOM::DOMImplementation node = obj->impl();
-
- switch(id)
- {
- case SVGDOMDOMImplementationBridge::HasFeature:
- return Boolean(node.hasFeature(args[0].toString(exec).string(), args[1].toString(exec).string()));
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// SVGDOMDocumentFragmentBridge
-
-/*
-@namespace KSVG
-@begin SVGDOMDocumentFragmentBridge::s_hashTable 2
- dummy SVGDOMDocumentFragmentBridge::Dummy DontDelete|ReadOnly
-@end
-*/
-
-Value SVGDOMDocumentFragmentBridge::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGEcma.cpp b/ksvg/impl/SVGEcma.cpp
new file mode 100644
index 00000000..5036f591
--- /dev/null
+++ b/ksvg/impl/SVGEcma.cpp
@@ -0,0 +1,842 @@
+/*
+ Copyright (C) 2002-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <typeinfo>
+
+#include <kdebug.h>
+
+#include <dom/dom_exception.h>
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+#include "SVGEcma.h"
+#include "SVGShapeImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGEcma.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_ecmaeventlistener.h"
+#include "ksvg_window.h"
+#include "ksvg_ecma.h"
+
+// SVGDOMNodeBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMNodeBridge::s_hashTable 17
+ nodeName SVGDOMNodeBridge::NodeName DontDelete|ReadOnly
+ nodeValue SVGDOMNodeBridge::NodeValue DontDelete
+ nodeType SVGDOMNodeBridge::NodeType DontDelete|ReadOnly
+ parentNode SVGDOMNodeBridge::ParentNode DontDelete|ReadOnly
+ childNodes SVGDOMNodeBridge::ChildNodes DontDelete|ReadOnly
+ firstChild SVGDOMNodeBridge::FirstChild DontDelete|ReadOnly
+ lastChild SVGDOMNodeBridge::LastChild DontDelete|ReadOnly
+ previousSibling SVGDOMNodeBridge::PreviousSibling DontDelete|ReadOnly
+ nextSibling SVGDOMNodeBridge::NextSibling DontDelete|ReadOnly
+ attributes SVGDOMNodeBridge::Attributes DontDelete|ReadOnly
+ namespaceURI SVGDOMNodeBridge::NamespaceURI DontDelete|ReadOnly
+ prefix SVGDOMNodeBridge::Prefix DontDelete
+ localName SVGDOMNodeBridge::LocalName DontDelete|ReadOnly
+ ownerDocument SVGDOMNodeBridge::OwnerDocument DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGDOMNodeBridgeProto::s_hashTable 29
+ insertBefore SVGDOMNodeBridge::InsertBefore DontDelete|Function 2
+ replaceChild SVGDOMNodeBridge::ReplaceChild DontDelete|Function 2
+ removeChild SVGDOMNodeBridge::RemoveChild DontDelete|Function 1
+ appendChild SVGDOMNodeBridge::AppendChild DontDelete|Function 1
+ hasAttributes SVGDOMNodeBridge::HasAttributes DontDelete|Function 0
+ hasChildNodes SVGDOMNodeBridge::HasChildNodes DontDelete|Function 0
+ cloneNode SVGDOMNodeBridge::CloneNode DontDelete|Function 1
+ normalize SVGDOMNodeBridge::Normalize DontDelete|Function 0
+ isSupported SVGDOMNodeBridge::IsSupported DontDelete|Function 2
+ addEventListener SVGDOMNodeBridge::AddEventListener DontDelete|Function 3
+ removeEventListener SVGDOMNodeBridge::RemoveEventListener DontDelete|Function 3
+ contains SVGDOMNodeBridge::Contains DontDelete|Function 1
+ getNodeName SVGDOMNodeBridge::GetNodeName DontDelete|Function 0
+ getNodeValue SVGDOMNodeBridge::GetNodeValue DontDelete|Function 0
+ getNodeType SVGDOMNodeBridge::GetNodeType DontDelete|Function 0
+ getParentNode SVGDOMNodeBridge::GetParentNode DontDelete|Function 0
+ getChildNodes SVGDOMNodeBridge::GetChildNodes DontDelete|Function 0
+ getFirstChild SVGDOMNodeBridge::GetFirstChild DontDelete|Function 0
+ getLastChild SVGDOMNodeBridge::GetLastChild DontDelete|Function 0
+ getPreviousSibling SVGDOMNodeBridge::GetPreviousSibling DontDelete|Function 0
+ getNextSibling SVGDOMNodeBridge::GetNextSibling DontDelete|Function 0
+ getAttributes SVGDOMNodeBridge::GetAttributes DontDelete|Function 0
+ getNamespaceURI SVGDOMNodeBridge::GetNamespaceURI DontDelete|Function 0
+ getPrefix SVGDOMNodeBridge::GetPrefix DontDelete|Function 0
+ getLocalName SVGDOMNodeBridge::GetLocalName DontDelete|Function 0
+ getOwnerDocument SVGDOMNodeBridge::GetOwnerDocument DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("DOMNode", SVGDOMNodeBridgeProto, SVGDOMNodeBridgeProtoFunc)
+
+Value SVGDOMNodeBridge::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case NodeName:
+ return getString(m_impl.nodeName());
+ case NodeValue:
+ return getString(m_impl.nodeValue());
+ case NodeType:
+ return Number(m_impl.nodeType());
+ case ParentNode:
+ return getDOMNode(exec, m_impl.parentNode());
+ case ChildNodes:
+ return (new SVGDOMNodeListBridge(m_impl.childNodes()))->cache(exec);
+ case FirstChild:
+ return getDOMNode(exec, m_impl.firstChild());
+ case LastChild:
+ return getDOMNode(exec, m_impl.lastChild());
+ case PreviousSibling:
+ return getDOMNode(exec, m_impl.previousSibling());
+ case NextSibling:
+ return getDOMNode(exec, m_impl.nextSibling());
+// case Attributes: // TODO
+ case NamespaceURI:
+ return getString(m_impl.namespaceURI());
+ case Prefix:
+ return getString(m_impl.prefix());
+ case LocalName:
+ return getString(m_impl.localName());
+ case OwnerDocument:
+ return getDOMNode(exec, m_impl.ownerDocument());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGDOMNodeBridge::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case NodeValue:
+ m_impl.setNodeValue(value.toString(exec).string());
+ break;
+ case Prefix:
+ m_impl.setPrefix(value.toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+// Special variantion to update the <text> element,
+// triggered by one of the child nodes
+void updateTextItem(ExecState *exec, const DOM::Node node)
+{
+ DOM::Node parent;
+ while(!(parent = node.parentNode()).isNull())
+ {
+ DOM::DOMString name = parent.nodeName();
+ if(name == "text" || name == "tspan" || name == "tref")
+ {
+ SVGHelperImpl::updateItem(exec, parent);
+ break;
+ }
+ }
+}
+
+// Remove item from canvas
+void removeItem(ExecState *exec, DOM::Node &node)
+{
+ // Get document
+ SVGDocumentImpl *doc = KSVG::Window::retrieveActive(exec)->doc();
+
+ // Update canvas
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(node.handle()));
+ if(shape && shape->item())
+ doc->canvas()->removeItem(shape->item());
+}
+
+// parseXML + getURL() need all these 5 functions to work properly
+void correctHandles(SVGElementImpl *main, DOM::Node &node)
+{
+ DOM::Element old(node.handle());
+ DOM::Element *replace = static_cast<DOM::Element *>(main->ownerDoc()->getElementFromHandle(node.handle()));
+
+ if(replace && node.nodeType() == DOM::Node::ELEMENT_NODE)
+ *replace = old;
+
+ if(node.hasChildNodes())
+ {
+ for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
+ correctHandles(main, iterate);
+ }
+}
+
+void integrateTree(SVGElementImpl *main, DOM::Node &node, DOM::Node &newNode, SVGElementImpl *obj, SVGDocumentImpl *doc)
+{
+ if(!obj)
+ return;
+
+ // Add to global element dicts
+ doc->addToElemDict(newNode.handle(), obj);
+ doc->addToElemDict(node.handle(), obj);
+
+ if(node.hasChildNodes())
+ {
+ DOM::Node iterate2 = newNode.firstChild();
+ for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
+ {
+ integrateTree(main, iterate, iterate2, obj->ownerDoc()->getElementFromHandle(iterate2.handle()), doc);
+ iterate2 = iterate2.nextSibling();
+ }
+ }
+}
+
+void correctDocument(SVGElementImpl *main, DOM::Node &node, SVGElementImpl *obj, SVGDocumentImpl *doc)
+{
+ if(!obj)
+ return;
+
+ // Correct document
+ obj->setOwnerDoc(main->ownerDoc());
+
+ // Correct rootElement
+ if(!obj->ownerSVGElement())
+ obj->setOwnerSVGElement(main->ownerSVGElement());
+
+ // Correct viewportElement
+ if(!obj->viewportElement())
+ obj->setViewportElement(main->viewportElement());
+
+ // Properly (re-)register events in the current active document
+ obj->setupEventListeners(main->ownerDoc(), doc);
+
+ if(node.hasChildNodes())
+ {
+ for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
+ correctDocument(main, iterate, doc->getElementFromHandle(iterate.handle()), doc);
+ }
+}
+
+void registerAdditional(ExecState *exec, SVGDocumentImpl *doc, DOM::Node node)
+{
+ // Register ID in rootElement!
+ SVGElementImpl *resultElement = doc->getElementFromHandle(node.handle());
+ if(resultElement && resultElement->hasAttribute("id"))
+ doc->rootElement()->addToIdMap(resultElement->getAttribute("id").string(), resultElement);
+
+ if(node.hasChildNodes())
+ {
+ for(DOM::Node iterate = node.firstChild(); !iterate.isNull(); iterate = iterate.nextSibling())
+ registerAdditional(exec, doc, iterate);
+ }
+}
+
+Value appendHelper(ExecState *exec, DOM::Node node, DOM::Node newNode)
+{
+ // This is quite tricky code by me (Niko)
+ // Don't even try to modify it.
+ if(!(node.ownerDocument() == newNode.ownerDocument()))
+ {
+ // Get document
+ SVGDocumentImpl *doc = KSVG::Window::retrieveActive(exec)->doc();
+
+ // Detect ownerDoc() of newNode
+ SVGDocumentImpl *newDoc = doc->getDocumentFromHandle(newNode.ownerDocument().handle());
+
+ // Get some SVGElementImpl's
+ SVGElementImpl *nodeElement = doc->getElementFromHandle(node.handle());
+ SVGElementImpl *newNodeElement = newDoc->getElementFromHandle(newNode.handle());
+
+ // Import node into document
+ DOM::Node result = doc->importNode(newNode, true);
+
+ // Associate the imported node 'result' with the
+ // 'newNodeElement' which belongs to 'newDoc'
+ integrateTree(nodeElement, result, newNode, newNodeElement, doc);
+
+ // Correct handles in SVG* elements
+ correctHandles(nodeElement, result);
+
+ // Correct ownerDoc() etc..
+ correctDocument(nodeElement, newNode, newNodeElement, newDoc);
+
+ // Register ID in global map
+ registerAdditional(exec, doc, result);
+
+ // Recalc style
+ newNodeElement->setAttributes();
+
+ // Append + create + update element
+ Value retVal = getDOMNode(exec, node.appendChild(result));
+
+ doc->syncCachedMatrices();
+ newNodeElement->createItem(doc->canvas());
+ SVGHelperImpl::updateItem(exec, *newNodeElement);
+
+ return retVal;
+ }
+ else
+ {
+ Value retVal = getDOMNode(exec, node.appendChild(newNode));
+
+ // Get document
+ SVGDocumentImpl *doc = KSVG::Window::retrieveActive(exec)->doc();
+ doc->syncCachedMatrices();
+
+ // Get some SVGElementImpl's
+ SVGElementImpl *nodeElement = doc->getElementFromHandle(newNode.handle());
+ // TODO : extra check needed to see if the new elements parent is already appended
+ // in the doc. Not really nice, should be some other way? (Rob)
+ if(nodeElement && !nodeElement->parentNode().parentNode().isNull())
+ {
+ nodeElement->setAttributes(true);
+ nodeElement->createItem();
+ SVGHelperImpl::updateItem(exec, newNode);
+ }
+
+ return retVal;
+ }
+}
+
+Value SVGDOMNodeBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDOMNodeBridge)
+ DOM::Node node = obj->impl();
+
+ switch(id)
+ {
+ case SVGDOMNodeBridge::InsertBefore:
+ {
+ DOM::Node newChild = toNode(args[0]);
+ DOM::Node beforeChild = toNode(args[1]);
+ Value retVal = getDOMNode(exec, node.insertBefore(newChild, beforeChild));
+
+ // Get document
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+
+ // Get some SVGElementImpl's
+ SVGShapeImpl *newShape = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(newChild.handle()));
+ SVGElementImpl *newElement = doc->getElementFromHandle(newChild.handle());
+ SVGShapeImpl *beforeElement = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(beforeChild.handle()));
+ if(newShape && beforeElement && beforeElement->item())
+ {
+ int z = beforeElement->item()->zIndex();
+ newElement->createItem();
+ doc->canvas()->insert(newShape->item(), z);
+ }
+ SVGHelperImpl::updateItem(exec, newChild);
+
+ return retVal;
+ }
+ case SVGDOMNodeBridge::ReplaceChild:
+ {
+ DOM::Node newChild = toNode(args[0]);
+ Value retVal = getDOMNode(exec, node.replaceChild(newChild, toNode(args[1])));
+ SVGHelperImpl::updateItem(exec, newChild);
+ return retVal;
+ }
+ case SVGDOMNodeBridge::RemoveChild:
+ {
+ DOM::Node remove = toNode(args[0]);
+ if(remove.isNull())
+ return Undefined();
+
+ // New removeChild logic:
+ // - remove from DOM tree
+ // - delete element (also deletes it's child element's)
+ removeItem(exec, remove);
+ Value retVal = getDOMNode(exec, node.removeChild(remove));
+ return retVal;
+ }
+ case SVGDOMNodeBridge::AppendChild:
+ return appendHelper(exec, node, toNode(args[0]));
+ case SVGDOMNodeBridge::HasAttributes:
+ {
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(node.handle());
+
+ if(!element)
+ return Undefined();
+
+ return Boolean(element->hasAttributes());
+ }
+ case SVGDOMNodeBridge::HasChildNodes:
+ return Boolean(node.hasChildNodes());
+ case SVGDOMNodeBridge::CloneNode:
+ {
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(node.handle());
+ SVGElementImpl *newElement = element->cloneNode(args[0].toBoolean(exec));
+
+ return getDOMNode(exec, *newElement);
+ }
+ case SVGDOMNodeBridge::Normalize:
+ {
+ node.normalize();
+ return Undefined();
+ }
+ case SVGDOMNodeBridge::IsSupported:
+ return Boolean(node.isSupported(args[0].toString(exec).string(), args[1].toString(exec).string()));
+ case SVGDOMNodeBridge::AddEventListener:
+ {
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(node.handle());
+
+ if(element)
+ {
+ SVGEvent::EventId eventId = SVGEvent::typeToId(args[0].toString(exec).string());
+ if(eventId != SVGEvent::UNKNOWN_EVENT)
+ element->setEventListener(eventId, new KSVGEcmaEventListener(Object::dynamicCast(args[1]), TQString(), doc->ecmaEngine()));
+ }
+ return Undefined();
+ }
+ case SVGDOMNodeBridge::RemoveEventListener:
+ {
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(node.handle());
+
+ if(element)
+ {
+ SVGEvent::EventId eventId = SVGEvent::typeToId(args[0].toString(exec).string());
+ if(eventId != SVGEvent::UNKNOWN_EVENT)
+ element->removeEventListener((int) eventId);
+ }
+ return Undefined();
+ }
+// case SVGDOMNodeBridge::Contains: // TODO
+ case SVGDOMNodeBridge::GetNodeName:
+ return getString(node.nodeName());
+ case SVGDOMNodeBridge::GetNodeValue:
+ return getString(node.nodeValue());
+ case SVGDOMNodeBridge::GetNodeType:
+ return Number(node.nodeType());
+ case SVGDOMNodeBridge::GetParentNode:
+ return getDOMNode(exec, node.parentNode());
+ case SVGDOMNodeBridge::GetChildNodes:
+ return (new SVGDOMNodeListBridge(node.childNodes()))->cache(exec);
+ case SVGDOMNodeBridge::GetFirstChild:
+ return getDOMNode(exec, node.firstChild());
+ case SVGDOMNodeBridge::GetLastChild:
+ return getDOMNode(exec, node.lastChild());
+ case SVGDOMNodeBridge::GetPreviousSibling:
+ return getDOMNode(exec, node.previousSibling());
+ case SVGDOMNodeBridge::GetNextSibling:
+ return getDOMNode(exec, node.nextSibling());
+// case SVGDOMNodeBridge::GetAttributes: // TODO
+ case SVGDOMNodeBridge::GetNamespaceURI:
+ return getString(node.namespaceURI());
+ case SVGDOMNodeBridge::GetPrefix:
+ return getString(node.prefix());
+ case SVGDOMNodeBridge::GetLocalName:
+ return getString(node.localName());
+ case SVGDOMNodeBridge::GetOwnerDocument:
+ return getDOMNode(exec, node.ownerDocument());
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+// SVGDOMElementBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMElementBridge::s_hashTable 2
+ tagName SVGDOMElementBridge::TagName DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGDOMElementBridgeProto::s_hashTable 17
+ getAttribute SVGDOMElementBridge::GetAttribute DontDelete|Function 1
+ setAttribute SVGDOMElementBridge::SetAttribute DontDelete|Function 2
+ removeAttribute SVGDOMElementBridge::RemoveAttribute DontDelete|Function 1
+ getAttributeNode SVGDOMElementBridge::GetAttributeNode DontDelete|Function 1
+ setAttributeNode SVGDOMElementBridge::SetAttributeNode DontDelete|Function 2
+ removeAttributeNode SVGDOMElementBridge::RemoveAttributeNode DontDelete|Function 1
+ getElementsByTagName SVGDOMElementBridge::GetElementsByTagName DontDelete|Function 1
+ hasAttribute SVGDOMElementBridge::HasAttribute DontDelete|Function 1
+ getAttributeNS SVGDOMElementBridge::GetAttributeNS DontDelete|Function 2
+ setAttributeNS SVGDOMElementBridge::SetAttributeNS DontDelete|Function 3
+ removeAttributeNS SVGDOMElementBridge::RemoveAttributeNS DontDelete|Function 2
+ getAttributeNodeNS SVGDOMElementBridge::GetAttributeNodeNS DontDelete|Function 2
+ setAttributeNodeNS SVGDOMElementBridge::SetAttributeNodeNS DontDelete|Function 1
+ getElementByTagNameNS SVGDOMElementBridge::GetElementsByTagNameNS DontDelete|Function 2
+ hasAttributeNS SVGDOMElementBridge::HasAttributeNS DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("DOMElement", SVGDOMElementBridgeProto, SVGDOMElementBridgeProtoFunc)
+
+Value SVGDOMElementBridge::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case TagName:
+ return getString(m_impl.tagName());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGDOMElementBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDOMElementBridge)
+ DOM::Element elem = obj->impl();
+
+ switch(id)
+ {
+ case SVGDOMElementBridge::GetAttribute:
+ {
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
+ if(element)
+ return String(element->getAttribute(args[0].toString(exec).string()));
+ else
+ return Undefined();
+ }
+ case SVGDOMElementBridge::SetAttribute:
+ {
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
+ if(element)
+ {
+ element->setAttribute(args[0].toString(exec).string(), args[1].toString(exec).string());
+ element->setAttributeInternal(args[0].toString(exec).string(), args[1].toString(exec).string());
+
+ SVGHelperImpl::updateItem(exec, elem);
+ }
+
+ return Undefined();
+ }
+ case SVGDOMElementBridge::RemoveAttribute:
+ {
+ elem.removeAttribute(args[0].toString(exec).string());
+ return Undefined();
+ }
+ case SVGDOMElementBridge::GetAttributeNode:
+ return getDOMNode(exec, elem.getAttributeNode(args[0].toString(exec).string()));
+ case SVGDOMElementBridge::SetAttributeNode: // TODO: Correct?
+ return getDOMNode(exec, elem.setAttributeNode(toNode(args[0])));
+ case SVGDOMElementBridge::RemoveAttributeNode: // TODO: Correct?
+ return getDOMNode(exec, elem.removeAttributeNode(toNode(args[0])));
+ case SVGDOMElementBridge::GetElementsByTagName:
+ return (new SVGDOMNodeListBridge(elem.getElementsByTagName(args[0].toString(exec).string())))->cache(exec);
+ case SVGDOMElementBridge::GetAttributeNS:
+ {
+ // This just skips NS! (Rob)
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
+ if(element)
+ return String(element->getAttribute(args[1].toString(exec).string()));
+ else
+ return Undefined();
+ }
+ case SVGDOMElementBridge::SetAttributeNS:
+ {
+ // For now, we strip the NS part (Rob)
+ DOM::DOMString attr = args[1].toString(exec).string();
+ int pos = attr.string().find(':');
+ if(pos > -1)
+ attr = attr.string().mid(pos + 1);
+
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+ SVGElementImpl *element = doc->getElementFromHandle(elem.handle());
+ if(element)
+ {
+ element->setAttribute(attr.string(), args[2].toString(exec).string());
+ element->setAttributeInternal(attr.string(), args[2].toString(exec).string());
+
+ SVGHelperImpl::updateItem(exec, *element);
+ }
+
+ return Undefined();
+ }
+ case SVGDOMElementBridge::RemoveAttributeNS:
+ {
+ elem.removeAttributeNS(args[0].toString(exec).string(), args[1].toString(exec).string());
+ return Undefined();
+ }
+ case SVGDOMElementBridge::GetAttributeNodeNS:
+ return getDOMNode(exec, elem.getAttributeNodeNS(args[0].toString(exec).string(), args[1].toString(exec).string()));
+ case SVGDOMElementBridge::SetAttributeNodeNS: // TODO: Correct?
+ return getDOMNode(exec, elem.setAttributeNodeNS(toNode(args[0])));
+ case SVGDOMElementBridge::GetElementsByTagNameNS:
+ return (new SVGDOMNodeListBridge(elem.getElementsByTagNameNS(args[0].toString(exec).string(), args[1].toString(exec).string())))->cache(exec);
+ case SVGDOMElementBridge::HasAttribute:
+ return Boolean(elem.hasAttribute(args[0].toString(exec).string()));
+ case SVGDOMElementBridge::HasAttributeNS:
+ return Boolean(elem.hasAttributeNS(args[0].toString(exec).string(), args[1].toString(exec).string()));
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+
+// SVGDOMNodeListBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMNodeListBridge::s_hashTable 2
+ length SVGDOMNodeListBridge::Length DontDelete
+@end
+@namespace KSVG
+@begin SVGDOMNodeListBridgeProto::s_hashTable 3
+ getLength SVGDOMNodeListBridge::GetLength DontDelete|Function 0
+ item SVGDOMNodeListBridge::Item DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("DOMNodeList", SVGDOMNodeListBridgeProto, SVGDOMNodeListBridgeProtoFunc)
+
+Value SVGDOMNodeListBridge::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Length:
+ return Number(m_impl.length());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGDOMNodeListBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDOMNodeListBridge)
+ DOM::NodeList nodeList = obj->impl();
+
+ switch(id)
+ {
+ case SVGDOMNodeListBridge::GetLength:
+ return Number(nodeList.length());
+ case SVGDOMNodeListBridge::Item:
+ return getDOMNode(exec, nodeList.item((unsigned long)args[0].toNumber(exec)));
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+// SVGDOMCharacterDataBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMCharacterDataBridge::s_hashTable 3
+ data SVGDOMCharacterDataBridge::Data DontDelete
+ length SVGDOMCharacterDataBridge::Length DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGDOMCharacterDataBridgeProto::s_hashTable 11
+ getData SVGDOMCharacterDataBridge::GetData DontDelete|Function 0
+ setData SVGDOMCharacterDataBridge::SetData DontDelete|Function 1
+ getLength SVGDOMCharacterDataBridge::GetLength DontDelete|Function 0
+ substringData SVGDOMCharacterDataBridge::SubstringData DontDelete|Function 2
+ appendData SVGDOMCharacterDataBridge::AppendData DontDelete|Function 1
+ insertData SVGDOMCharacterDataBridge::InsertData DontDelete|Function 2
+ deleteData SVGDOMCharacterDataBridge::DeleteData DontDelete|Function 2
+ replaceData SVGDOMCharacterDataBridge::ReplaceData DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("DOMCharacterData", SVGDOMCharacterDataBridgeProto, SVGDOMCharacterDataBridgeProtoFunc)
+
+Value SVGDOMCharacterDataBridge::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Data:
+ return String(m_impl.data());
+ case Length:
+ return Number(m_impl.length());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGDOMCharacterDataBridge::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case Data:
+ m_impl.setData(value.toString(exec).string());
+ updateTextItem(exec, m_impl);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGDOMCharacterDataBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDOMCharacterDataBridge)
+ DOM::CharacterData node = obj->impl();
+
+ switch(id)
+ {
+ case SVGDOMCharacterDataBridge::GetData:
+ return String(node.data());
+ case SVGDOMCharacterDataBridge::SetData:
+ node.setData(args[0].toString(exec).string());
+ updateTextItem(exec, node);
+ return Undefined();
+ case SVGDOMCharacterDataBridge::GetLength:
+ return Number(node.length());
+ case SVGDOMCharacterDataBridge::SubstringData:
+ {
+ DOM::DOMString ret = node.substringData(args[0].toInteger(exec), args[1].toInteger(exec));
+ updateTextItem(exec, node);
+ return String(ret);
+ }
+ case SVGDOMCharacterDataBridge::AppendData:
+ node.appendData(args[0].toString(exec).string());
+ updateTextItem(exec, node);
+ return Undefined();
+ case SVGDOMCharacterDataBridge::InsertData:
+ node.insertData(args[0].toInteger(exec), args[1].toString(exec).string());
+ updateTextItem(exec, node);
+ return Undefined();
+ case SVGDOMCharacterDataBridge::DeleteData:
+ node.deleteData(args[0].toInteger(exec), args[1].toInteger(exec));
+ updateTextItem(exec, node);
+ return Undefined();
+ case SVGDOMCharacterDataBridge::ReplaceData:
+ node.replaceData(args[0].toInteger(exec), args[1].toInteger(exec), args[2].toString(exec).string());
+ updateTextItem(exec, node);
+ return Undefined();
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+// SVGDOMTextBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMTextBridge::s_hashTable 2
+ dummy SVGDOMTextBridge::Dummy DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGDOMTextBridgeProto::s_hashTable 2
+ splitText SVGDOMTextBridge::SplitText DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("DOMText", SVGDOMTextBridgeProto, SVGDOMTextBridgeProtoFunc)
+
+Value SVGDOMTextBridge::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGDOMTextBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDOMTextBridge)
+ DOM::Text node = obj->impl();
+
+ switch(id)
+ {
+ case SVGDOMTextBridge::SplitText:
+ return getDOMNode(exec, node.splitText(args[0].toInteger(exec)));
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+// SVGDOMDOMImplementationBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMDOMImplementationBridge::s_hashTable 2
+ dummy SVGDOMDOMImplementationBridge::Dummy DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGDOMDOMImplementationBridgeProto::s_hashTable 2
+ hasFeature SVGDOMDOMImplementationBridge::HasFeature DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("DOMDOMImplementation", SVGDOMDOMImplementationBridgeProto, SVGDOMDOMImplementationBridgeProtoFunc)
+
+Value SVGDOMDOMImplementationBridge::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGDOMDOMImplementationBridgeProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGDOMDOMImplementationBridge)
+ DOM::DOMImplementation node = obj->impl();
+
+ switch(id)
+ {
+ case SVGDOMDOMImplementationBridge::HasFeature:
+ return Boolean(node.hasFeature(args[0].toString(exec).string(), args[1].toString(exec).string()));
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+// SVGDOMDocumentFragmentBridge
+
+/*
+@namespace KSVG
+@begin SVGDOMDocumentFragmentBridge::s_hashTable 2
+ dummy SVGDOMDocumentFragmentBridge::Dummy DontDelete|ReadOnly
+@end
+*/
+
+Value SVGDOMDocumentFragmentBridge::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGEcma.h b/ksvg/impl/SVGEcma.h
index adf1ec85..4bc2d2e6 100644
--- a/ksvg/impl/SVGEcma.h
+++ b/ksvg/impl/SVGEcma.h
@@ -246,5 +246,3 @@ KSVG_DEFINE_PROTOTYPE(SVGDOMDOMImplementationBridgeProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGDOMDOMImplementationBridgeProtoFunc, SVGDOMDOMImplementationBridge)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGElementImpl.cc b/ksvg/impl/SVGElementImpl.cc
deleted file mode 100644
index fe013f0a..00000000
--- a/ksvg/impl/SVGElementImpl.cc
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <tqxml.h>
-
-#include <kdebug.h>
-
-#include "SVGEvent.h"
-#include "SVGEventImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_ecma.h"
-
-SVGElementImpl::Factory *SVGElementImpl::Factory::m_instance = 0;
-
-SVGElementImpl::SVGElementImpl(DOM::ElementImpl *impl) : DOM::DomShared(), DOM::Element(impl), SVGDOMElementBridge(static_cast<DOM::Element>(*this))
-{
- KSVG_EMPTY_FLAGS
-
- m_ownerSVGElement = 0;
- m_viewportElement = 0;
- m_ownerDoc = 0;
-
- m_mouseOver = false;
- m_focus = false;
-
- m_eventListeners.setAutoDelete(true);
- m_attributes.setAutoDelete(true);
-}
-
-SVGElementImpl::~SVGElementImpl()
-{
- if(m_ownerSVGElement)
- m_ownerSVGElement->deref();
-}
-
-void SVGElementImpl::setEventListener(int id, SVGEventListener *listener)
-{
- if(listener)
- listener->ref();
-
- removeEventListener(id);
-
- if(listener)
- {
- SVGRegisteredEventListener *rl = new SVGRegisteredEventListener(static_cast<SVGEvent::EventId>(id), listener, false);
- m_eventListeners.append(rl);
-
- listener->deref();
- }
-}
-
-int SVGElementImpl::getEventListeners(bool local)
-{
- int events = 0;
-
- TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
- for(; it.current(); ++it)
- events |= (1 << it.current()->id);
-
- if(local)
- return events;
-
- for(DOM::Node node = parentNode(); !node.isNull(); node = node.parentNode())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
-
- if(element)
- {
- TQPtrListIterator<SVGRegisteredEventListener> it(element->m_eventListeners);
- for(; it.current(); ++it)
- events |= (1 << it.current()->id);
- }
- }
-
- return events;
-}
-
-void SVGElementImpl::setupEventListeners(SVGDocumentImpl *doc, SVGDocumentImpl *newDoc)
-{
- if(!doc || !newDoc)
- return;
-
- // Changes the document where the eventlisteners are registered
- // Needed for parseXML'ed elements with events, their listeners
- // are created in the temporary document fragment and need to be
- // registered in the main document (Niko)
- TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
- for(; it.current(); ++it)
- {
- SVGRegisteredEventListener *current = it.current();
-
- TQString valueOfCurrent = newDoc->ecmaEngine()->valueOfEventListener(current->listener);
- setEventListener(current->id, doc->createEventListener(valueOfCurrent));
- }
-}
-
-bool SVGElementImpl::hasEventListener(int id, bool local)
-{
- // First check if we have the listener, locally
- TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
- for(; it.current(); ++it)
- {
- if(it.current()->id == id)
- return true;
- }
-
- // We have no local listeners, if we are just interessted
- // in those listeners, then return now...
- if(local)
- return false;
-
- // Check every parent element
- for(DOM::Node node = parentNode(); !node.isNull(); node = node.parentNode())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
-
- if(element)
- {
- TQPtrListIterator<SVGRegisteredEventListener> it(element->m_eventListeners);
- for(; it.current(); ++it)
- {
- if(it.current()->id == id)
- return true;
- }
- }
- }
-
- return false;
-}
-
-void SVGElementImpl::removeEventListener(int id)
-{
- TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
- for(; it.current(); ++it)
- {
- if(it.current()->id == id)
- {
- m_eventListeners.removeRef(it.current());
- break;
- }
- }
-}
-
-void SVGElementImpl::handleLocalEvents(SVGEventImpl *evt, bool useCapture)
-{
- TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
- for(; it.current(); ++it)
- {
- if(it.current()->id == evt->id() && it.current()->useCapture == useCapture)
- {
- it.current()->listener->handleEvent(evt);
- break;
- }
- }
-}
-
-void SVGElementImpl::defaultEventHandler(SVGEventImpl *)
-{
-}
-
-/*
-@namespace KSVG
-@begin SVGElementImpl::s_hashTable 23
- id SVGElementImpl::ElementId DontDelete
- ownerSVGElement SVGElementImpl::OwnerSvgElement DontDelete|ReadOnly
- viewportElement SVGElementImpl::ViewportElement DontDelete|ReadOnly
- xmlbase SVGElementImpl::XmlBase DontDelete
- base SVGElementImpl::XmlBase DontDelete
- onmouseup SVGElementImpl::OnMouseUp DontDelete
- onmousedown SVGElementImpl::OnMouseDown DontDelete
- onmousemove SVGElementImpl::OnMouseMove DontDelete
- onmouseover SVGElementImpl::OnMouseOver DontDelete
- onmouseout SVGElementImpl::OnMouseOut DontDelete
- onclick SVGElementImpl::OnClick DontDelete
- onmouseclick SVGElementImpl::OnClick DontDelete
- onactivate SVGElementImpl::OnActivate DontDelete
- onkeydown SVGElementImpl::OnKeyDown DontDelete
- onkeyup SVGElementImpl::OnKeyUp DontDelete
- onkeypress SVGElementImpl::OnKeyPress DontDelete
- onload SVGElementImpl::OnLoad DontDelete
- onfocusin SVGElementImpl::OnFocusIn DontDelete
- onfocusout SVGElementImpl::OnFocusOut DontDelete
- onerror SVGElementImpl::OnError DontDelete
- onabort SVGElementImpl::OnAbort DontDelete
-@end
-@namespace KSVG
-@begin SVGElementImplProto::s_hashTable 5
- getStyle SVGElementImpl::GetStyle DontDelete|Function 0
- setProperty SVGElementImpl::SetProperty DontDelete|Function 2
- getPropertyValue SVGElementImpl::GetPropertyValue DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGElement", SVGElementImplProto, SVGElementImplProtoFunc)
-
-Value SVGElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case ElementId:
- return String(id().string());
- case XmlBase:
- return String(xmlbase().string());
- case OwnerSvgElement:
- return getDOMNode(exec, *ownerSVGElement());
- case ViewportElement:
- return getDOMNode(exec, *viewportElement());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case ElementId:
- setId(value.toString(exec).string());
- break;
- case XmlBase:
- setXmlbase(value.toString(exec).string());
- break;
- case OnMouseUp:
- setEventListener(SVGEvent::MOUSEUP_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnMouseDown:
- setEventListener(SVGEvent::MOUSEDOWN_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnMouseMove:
- setEventListener(SVGEvent::MOUSEMOVE_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnMouseOver:
- setEventListener(SVGEvent::MOUSEOVER_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnMouseOut:
- setEventListener(SVGEvent::MOUSEOUT_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnClick:
- setEventListener(SVGEvent::CLICK_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnActivate:
- setEventListener(SVGEvent::DOMACTIVATE_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnKeyDown:
- setEventListener(SVGEvent::KEYDOWN_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnKeyUp:
- setEventListener(SVGEvent::KEYUP_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnKeyPress:
- setEventListener(SVGEvent::KEYPRESS_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnLoad:
- setEventListener(SVGEvent::LOAD_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnFocusIn:
- setEventListener(SVGEvent::DOMFOCUSIN_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnFocusOut:
- setEventListener(SVGEvent::DOMFOCUSOUT_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnError:
- setEventListener(SVGEvent::ERROR_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- case OnAbort:
- setEventListener(SVGEvent::ABORT_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
- break;
- default:
- kdWarning() << k_funcinfo << "unhandled token " << token << endl;
- }
-}
-
-Value SVGElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGElementImpl)
-
- switch(id)
- {
- case SVGElementImpl::GetStyle:
- return obj->cache(exec);
- case SVGElementImpl::SetProperty:
- {
- DOM::DOMString attribute = args[0].toString(exec).qstring().lower();
- DOM::DOMString value = args[1].toString(exec).qstring();
- obj->setAttribute(attribute, value);
- break;
- }
- case SVGElementImpl::GetPropertyValue:
- return String(obj->getAttribute(args[0].toString(exec).qstring()));
- default:
- break;
- }
-
- return Undefined();
-}
-
-TQDict<DOM::DOMString> &SVGElementImpl::attributes()
-{
- return m_attributes;
-}
-
-// tdehtml overrides
-void SVGElementImpl::setAttribute(const DOM::DOMString &name, const DOM::DOMString &value)
-{
- m_attributes.replace(name.string(), new DOM::DOMString(value));
-}
-
-// Changes internal value. This will have no effect on getAttribute().
-void SVGElementImpl::setAttributeInternal(const DOM::DOMString &name, const DOM::DOMString &value)
-{
- ExecState *exec = ownerDoc()->ecmaEngine()->globalExec();
-
- static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeSetMode(true);
- bridge(exec)->put(exec, Identifier(UString(name)), String(value), KJS::Internal);
- static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeSetMode(false);
-}
-
-// This gets the actual attribute as set in the svg source
-DOM::DOMString SVGElementImpl::getAttribute(const DOM::DOMString &name) const
-{
- DOM::DOMString *result = m_attributes[name.string()];
- if(result)
- return *result;
- else
- return DOM::DOMString();
-}
-
-// This gets the internal, real-time value. This means it can return a default value
-// for an attribute even if its not explicitly set in the svg source.
-DOM::DOMString SVGElementImpl::getAttributeInternal(const DOM::DOMString &name)
-{
- ExecState *exec = ownerDoc()->ecmaEngine()->globalExec();
-
- DOM::DOMString retVal;
-
- static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeGetMode(true);
- retVal = bridge(exec)->get(exec, Identifier(UString(name))).toString(exec).string();
- static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeGetMode(false);
-
- return retVal;
-}
-
-bool SVGElementImpl::hasAttribute(const DOM::DOMString &name)
-{
- return m_attributes.find(name.string()) != 0;
-}
-
-bool SVGElementImpl::hasAttributes()
-{
- return m_attributes.count() > 0;
-}
-
-void SVGElementImpl::setApplyAttribute(const TQString &name, const TQString &value)
-{
- if(hasAttribute(name))
- {
- TQString cur = getAttribute(name).string();
- cur = cur.simplifyWhiteSpace();
-
- if(!cur.endsWith(";"))
- cur += "; ";
-
- cur += value;
-
- setAttribute(name, cur);
- }
- else
- setAttribute(name, value);
-}
-
-void SVGElementImpl::setId(DOM::DOMString id)
-{
- setAttribute("id", id);
-
- if(ownerDoc() && ownerDoc()->rootElement() && !id.isEmpty())
- ownerDoc()->rootElement()->addToIdMap(id.string(), this);
- else if(m_ownerSVGElement && !id.isEmpty())
- m_ownerSVGElement->addToIdMap(id.string(), this);
-}
-
-DOM::DOMString SVGElementImpl::id() const
-{
- return getAttribute("id");
-}
-
-void SVGElementImpl::setXmlbase(DOM::DOMString xmlbase)
-{
- setAttribute("xml:base", xmlbase);
-}
-
-DOM::DOMString SVGElementImpl::xmlbase() const
-{
- return getAttribute("xml:base");
-}
-
-void SVGElementImpl::setOwnerSVGElement(SVGSVGElementImpl *owner)
-{
- if(m_ownerSVGElement)
- m_ownerSVGElement->deref();
-
- m_ownerSVGElement = owner;
-
- if(m_ownerSVGElement)
- m_ownerSVGElement->ref();
-}
-
-void SVGElementImpl::setViewportElement(SVGElementImpl *viewport)
-{
- if(m_viewportElement)
- m_viewportElement->deref();
-
- m_viewportElement = viewport;
-
- if(m_viewportElement)
- m_viewportElement->ref();
-}
-
-SVGSVGElementImpl *SVGElementImpl::ownerSVGElement() const
-{
- return m_ownerSVGElement;
-}
-
-SVGElementImpl *SVGElementImpl::viewportElement() const
-{
- return m_viewportElement;
-}
-
-void SVGElementImpl::setAttributes(const TQXmlAttributes &attrs)
-{
- for(int i = 0; i < attrs.length(); i++)
- {
- setAttribute(attrs.localName(i), attrs.value(i));
- setAttributeInternal(attrs.localName(i), attrs.value(i));
- }
-
- setAttributes();
-}
-
-void SVGElementImpl::setAttributes()
-{
- // Finalize style
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
-
- if(style)
- style->processStyle();
-}
-
-void SVGElementImpl::setAttributes(bool deep)
-{
- // Finalize style
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
-
- if(style)
- style->processStyle();
-
- if(deep)
- {
- if(hasChildNodes())
- {
- DOM::Node n;
- for(n = firstChild(); !n.isNull(); n = n.nextSibling())
- {
- SVGElementImpl *elem = ownerDoc()->getElementFromHandle(n.handle());
- if(elem)
- elem->setAttributes(true);
- }
- }
- }
-}
-
-bool SVGElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &a, SVGMouseEventImpl *mev)
-{
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(this);
- if(shape)
- return shape->prepareMouseEvent(p, a, mev);
-
- return false;
-}
-
-bool SVGElementImpl::dispatchEvent(int id, bool canBubbleArg, bool cancelableArg)
-{
- SVGEventImpl *evt = new SVGEventImpl(static_cast<SVGEvent::EventId>(id), canBubbleArg, cancelableArg);
-
- evt->ref();
- bool ret = dispatchEvent(evt, true);
- evt->deref();
-
- return ret;
-}
-
-bool SVGElementImpl::dispatchEvent(SVGEventImpl *evt, bool tempEvent)
-{
- evt->setTarget(this);
-
- // Find out, where to send to -> collect parent nodes
- TQPtrList<SVGElementImpl> nodeChain;
-
- for(DOM::Element e = *this; !e.isNull(); e = e.parentNode())
- nodeChain.prepend(ownerDoc()->getElementFromHandle(e.handle()));
-
- // Trigger any capturing event handlers on our way down
- evt->setEventPhase(DOM::Event::CAPTURING_PHASE);
-
- TQPtrListIterator<SVGElementImpl> it(nodeChain);
- for(; it.current() && it.current() != this && !evt->propagationStopped(); ++it)
- {
- evt->setCurrentTarget(it.current());
-
- if(it.current())
- it.current()->handleLocalEvents(evt, true);
- }
-
- // Dispatch to the actual target node
- it.toLast();
- if(!evt->propagationStopped())
- {
- evt->setEventPhase(DOM::Event::AT_TARGET);
- evt->setCurrentTarget(it.current());
-
- if(it.current())
- it.current()->handleLocalEvents(evt, false);
- }
-
- --it;
-
- // Bubble up again
- if(evt->bubbles())
- {
- evt->setEventPhase(DOM::Event::BUBBLING_PHASE);
- for(; it.current() && !evt->propagationStopped(); --it)
- {
- evt->setCurrentTarget(it.current());
-
- if(it.current())
- it.current()->handleLocalEvents(evt, false);
- }
- }
-
- evt->setCurrentTarget(0);
- evt->setEventPhase(0); // I guess this is correct, the spec does not seem to say
- // anything about the default event handler phase.
-
- if(evt->bubbles())
- {
- // now we call all default event handlers (this is not part of DOM - it is internal to ksvg)
- it.toLast();
- for(; it.current() && !evt->propagationStopped() && !evt->defaultPrevented() && !evt->defaultHandled(); --it)
- it.current()->defaultEventHandler(evt);
- }
-
- // If tempEvent is true, this means that the DOM implementation will not be storing a reference to the event, i.e.
- // there is no way to retrieve it from javascript if a script does not already have a reference to it in a variable.
- // So there is no need for the interpreter to keep the event in its cache
- if(tempEvent)
- ownerDoc()->ecmaEngine()->finishedWithEvent(evt);
-
- return !evt->defaultPrevented(); // ### what if defaultPrevented was called before dispatchEvent?
-}
-
-bool SVGElementImpl::dispatchKeyEvent(TQKeyEvent *ke)
-{
- DOM::AbstractView temp;
-
- SVGEvent::EventId evtId = SVGEvent::UNKNOWN_EVENT;
-
- if(ke->type() == TQEvent::KeyRelease && !ke->isAutoRepeat())
- evtId = SVGEvent::KEYUP_EVENT;
- else if(ke->isAutoRepeat())
- evtId = SVGEvent::KEYPRESS_EVENT;
- else if(ke->type() == TQEvent::KeyPress)
- evtId = SVGEvent::KEYDOWN_EVENT;
-
- if(evtId == SVGEvent::KEYUP_EVENT && hasEventListener(SVGEvent::DOMACTIVATE_EVENT, false))
- dispatchEvent(SVGEvent::DOMACTIVATE_EVENT, true, true);
-
- if(!hasEventListener(evtId, false))
- return false;
-
- SVGEventImpl *evt = new SVGKeyEventImpl(ke, temp, evtId);
-
- evt->ref();
- bool ret = dispatchEvent(evt, true);
- evt->deref();
-
- // Rerender now! Once! (Niko)
- ownerDoc()->rerender();
-
- return ret;
-}
-
-bool SVGElementImpl::dispatchMouseEvent(int id, bool canBubbleArg, bool cancelableArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, unsigned short buttonArg, SVGElementImpl *relatedTargetArg)
-{
- DOM::AbstractView temp;
-
- SVGEventImpl *evt = new SVGMouseEventImpl(static_cast<SVGEvent::EventId>(id),
- canBubbleArg, cancelableArg, temp, detailArg,
- screenXArg, screenYArg,
- clientXArg, clientYArg,
- ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg,
- buttonArg, relatedTargetArg);
-
- evt->ref();
- bool ret = dispatchEvent(evt, true);
- evt->deref();
-
- return ret;
-}
-
-void SVGElementImpl::setOwnerDoc(SVGDocumentImpl *doc)
-{
- if(m_ownerDoc)
- m_ownerDoc->removeFromElemDict(handle());
-
- m_ownerDoc = doc;
-
- if(m_ownerDoc)
- m_ownerDoc->addToElemDict(handle(), this);
-}
-
-SVGDocumentImpl *SVGElementImpl::ownerDoc() const
-{
- return m_ownerDoc;
-}
-
-SVGElementImpl *SVGElementImpl::cloneNode(bool deep)
-{
- DOM::Element impl = static_cast<DOM::Document *>(ownerDoc())->createElementNS("", tagName());
- SVGElementImpl *newElement = SVGDocumentImpl::createElement(tagName(), impl.cloneNode(false), ownerDoc());
- newElement->setOwnerSVGElement(ownerSVGElement());
- newElement->setViewportElement(viewportElement());
-
- SVGHelperImpl::copyAttributes(this, newElement);
-
- // Recalc style
- //newElement->setAttributes();
-
- if(deep)
- cloneChildNodes(newElement);
-
- return newElement;
-}
-
-void SVGElementImpl::cloneChildNodes(SVGElementImpl *clone)
-{
- DOM::Node n;
- for(n = firstChild(); !n.isNull(); n = n.nextSibling())
- {
- SVGElementImpl *elem = ownerDoc()->getElementFromHandle(n.handle());
- if(elem)
- clone->appendChild(*elem->cloneNode(true));
- else if(n.nodeType() == DOM::Node::TEXT_NODE)
- clone->appendChild(n.cloneNode(true));
- }
-}
-
-void SVGElementImpl::gotError(const TQString &errorDesc)
-{
- if(ownerDoc())
- {
- ownerDoc()->finishParsing(true, errorDesc);
- if(hasEventListener(SVGEvent::ERROR_EVENT, true))
- dispatchEvent(SVGEvent::ERROR_EVENT, false, false);
- }
-}
-
-TQString SVGElementImpl::collectText()
-{
- TQString text;
-
- if(hasChildNodes())
- {
- DOM::Node node = firstChild();
-
- for(; !node.isNull(); node = node.nextSibling())
- {
- if(node.nodeType() == DOM::Node::TEXT_NODE)
- {
- DOM::Text textNode = node;
- text += textNode.data().string();
- }
- }
- }
-
- return text;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGElementImpl.cpp b/ksvg/impl/SVGElementImpl.cpp
new file mode 100644
index 00000000..523c5807
--- /dev/null
+++ b/ksvg/impl/SVGElementImpl.cpp
@@ -0,0 +1,711 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <tqxml.h>
+
+#include <kdebug.h>
+
+#include "SVGEvent.h"
+#include "SVGEventImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_ecma.h"
+
+SVGElementImpl::Factory *SVGElementImpl::Factory::m_instance = 0;
+
+SVGElementImpl::SVGElementImpl(DOM::ElementImpl *impl) : DOM::DomShared(), DOM::Element(impl), SVGDOMElementBridge(static_cast<DOM::Element>(*this))
+{
+ KSVG_EMPTY_FLAGS
+
+ m_ownerSVGElement = 0;
+ m_viewportElement = 0;
+ m_ownerDoc = 0;
+
+ m_mouseOver = false;
+ m_focus = false;
+
+ m_eventListeners.setAutoDelete(true);
+ m_attributes.setAutoDelete(true);
+}
+
+SVGElementImpl::~SVGElementImpl()
+{
+ if(m_ownerSVGElement)
+ m_ownerSVGElement->deref();
+}
+
+void SVGElementImpl::setEventListener(int id, SVGEventListener *listener)
+{
+ if(listener)
+ listener->ref();
+
+ removeEventListener(id);
+
+ if(listener)
+ {
+ SVGRegisteredEventListener *rl = new SVGRegisteredEventListener(static_cast<SVGEvent::EventId>(id), listener, false);
+ m_eventListeners.append(rl);
+
+ listener->deref();
+ }
+}
+
+int SVGElementImpl::getEventListeners(bool local)
+{
+ int events = 0;
+
+ TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
+ for(; it.current(); ++it)
+ events |= (1 << it.current()->id);
+
+ if(local)
+ return events;
+
+ for(DOM::Node node = parentNode(); !node.isNull(); node = node.parentNode())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+
+ if(element)
+ {
+ TQPtrListIterator<SVGRegisteredEventListener> it(element->m_eventListeners);
+ for(; it.current(); ++it)
+ events |= (1 << it.current()->id);
+ }
+ }
+
+ return events;
+}
+
+void SVGElementImpl::setupEventListeners(SVGDocumentImpl *doc, SVGDocumentImpl *newDoc)
+{
+ if(!doc || !newDoc)
+ return;
+
+ // Changes the document where the eventlisteners are registered
+ // Needed for parseXML'ed elements with events, their listeners
+ // are created in the temporary document fragment and need to be
+ // registered in the main document (Niko)
+ TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
+ for(; it.current(); ++it)
+ {
+ SVGRegisteredEventListener *current = it.current();
+
+ TQString valueOfCurrent = newDoc->ecmaEngine()->valueOfEventListener(current->listener);
+ setEventListener(current->id, doc->createEventListener(valueOfCurrent));
+ }
+}
+
+bool SVGElementImpl::hasEventListener(int id, bool local)
+{
+ // First check if we have the listener, locally
+ TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
+ for(; it.current(); ++it)
+ {
+ if(it.current()->id == id)
+ return true;
+ }
+
+ // We have no local listeners, if we are just interessted
+ // in those listeners, then return now...
+ if(local)
+ return false;
+
+ // Check every parent element
+ for(DOM::Node node = parentNode(); !node.isNull(); node = node.parentNode())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+
+ if(element)
+ {
+ TQPtrListIterator<SVGRegisteredEventListener> it(element->m_eventListeners);
+ for(; it.current(); ++it)
+ {
+ if(it.current()->id == id)
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void SVGElementImpl::removeEventListener(int id)
+{
+ TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
+ for(; it.current(); ++it)
+ {
+ if(it.current()->id == id)
+ {
+ m_eventListeners.removeRef(it.current());
+ break;
+ }
+ }
+}
+
+void SVGElementImpl::handleLocalEvents(SVGEventImpl *evt, bool useCapture)
+{
+ TQPtrListIterator<SVGRegisteredEventListener> it(m_eventListeners);
+ for(; it.current(); ++it)
+ {
+ if(it.current()->id == evt->id() && it.current()->useCapture == useCapture)
+ {
+ it.current()->listener->handleEvent(evt);
+ break;
+ }
+ }
+}
+
+void SVGElementImpl::defaultEventHandler(SVGEventImpl *)
+{
+}
+
+/*
+@namespace KSVG
+@begin SVGElementImpl::s_hashTable 23
+ id SVGElementImpl::ElementId DontDelete
+ ownerSVGElement SVGElementImpl::OwnerSvgElement DontDelete|ReadOnly
+ viewportElement SVGElementImpl::ViewportElement DontDelete|ReadOnly
+ xmlbase SVGElementImpl::XmlBase DontDelete
+ base SVGElementImpl::XmlBase DontDelete
+ onmouseup SVGElementImpl::OnMouseUp DontDelete
+ onmousedown SVGElementImpl::OnMouseDown DontDelete
+ onmousemove SVGElementImpl::OnMouseMove DontDelete
+ onmouseover SVGElementImpl::OnMouseOver DontDelete
+ onmouseout SVGElementImpl::OnMouseOut DontDelete
+ onclick SVGElementImpl::OnClick DontDelete
+ onmouseclick SVGElementImpl::OnClick DontDelete
+ onactivate SVGElementImpl::OnActivate DontDelete
+ onkeydown SVGElementImpl::OnKeyDown DontDelete
+ onkeyup SVGElementImpl::OnKeyUp DontDelete
+ onkeypress SVGElementImpl::OnKeyPress DontDelete
+ onload SVGElementImpl::OnLoad DontDelete
+ onfocusin SVGElementImpl::OnFocusIn DontDelete
+ onfocusout SVGElementImpl::OnFocusOut DontDelete
+ onerror SVGElementImpl::OnError DontDelete
+ onabort SVGElementImpl::OnAbort DontDelete
+@end
+@namespace KSVG
+@begin SVGElementImplProto::s_hashTable 5
+ getStyle SVGElementImpl::GetStyle DontDelete|Function 0
+ setProperty SVGElementImpl::SetProperty DontDelete|Function 2
+ getPropertyValue SVGElementImpl::GetPropertyValue DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGElement", SVGElementImplProto, SVGElementImplProtoFunc)
+
+Value SVGElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case ElementId:
+ return String(id().string());
+ case XmlBase:
+ return String(xmlbase().string());
+ case OwnerSvgElement:
+ return getDOMNode(exec, *ownerSVGElement());
+ case ViewportElement:
+ return getDOMNode(exec, *viewportElement());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case ElementId:
+ setId(value.toString(exec).string());
+ break;
+ case XmlBase:
+ setXmlbase(value.toString(exec).string());
+ break;
+ case OnMouseUp:
+ setEventListener(SVGEvent::MOUSEUP_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnMouseDown:
+ setEventListener(SVGEvent::MOUSEDOWN_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnMouseMove:
+ setEventListener(SVGEvent::MOUSEMOVE_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnMouseOver:
+ setEventListener(SVGEvent::MOUSEOVER_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnMouseOut:
+ setEventListener(SVGEvent::MOUSEOUT_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnClick:
+ setEventListener(SVGEvent::CLICK_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnActivate:
+ setEventListener(SVGEvent::DOMACTIVATE_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnKeyDown:
+ setEventListener(SVGEvent::KEYDOWN_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnKeyUp:
+ setEventListener(SVGEvent::KEYUP_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnKeyPress:
+ setEventListener(SVGEvent::KEYPRESS_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnLoad:
+ setEventListener(SVGEvent::LOAD_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnFocusIn:
+ setEventListener(SVGEvent::DOMFOCUSIN_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnFocusOut:
+ setEventListener(SVGEvent::DOMFOCUSOUT_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnError:
+ setEventListener(SVGEvent::ERROR_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ case OnAbort:
+ setEventListener(SVGEvent::ABORT_EVENT, m_ownerDoc->createEventListener(value.toString(exec).string()));
+ break;
+ default:
+ kdWarning() << k_funcinfo << "unhandled token " << token << endl;
+ }
+}
+
+Value SVGElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGElementImpl)
+
+ switch(id)
+ {
+ case SVGElementImpl::GetStyle:
+ return obj->cache(exec);
+ case SVGElementImpl::SetProperty:
+ {
+ DOM::DOMString attribute = args[0].toString(exec).qstring().lower();
+ DOM::DOMString value = args[1].toString(exec).qstring();
+ obj->setAttribute(attribute, value);
+ break;
+ }
+ case SVGElementImpl::GetPropertyValue:
+ return String(obj->getAttribute(args[0].toString(exec).qstring()));
+ default:
+ break;
+ }
+
+ return Undefined();
+}
+
+TQDict<DOM::DOMString> &SVGElementImpl::attributes()
+{
+ return m_attributes;
+}
+
+// tdehtml overrides
+void SVGElementImpl::setAttribute(const DOM::DOMString &name, const DOM::DOMString &value)
+{
+ m_attributes.replace(name.string(), new DOM::DOMString(value));
+}
+
+// Changes internal value. This will have no effect on getAttribute().
+void SVGElementImpl::setAttributeInternal(const DOM::DOMString &name, const DOM::DOMString &value)
+{
+ ExecState *exec = ownerDoc()->ecmaEngine()->globalExec();
+
+ static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeSetMode(true);
+ bridge(exec)->put(exec, Identifier(UString(name)), String(value), KJS::Internal);
+ static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeSetMode(false);
+}
+
+// This gets the actual attribute as set in the svg source
+DOM::DOMString SVGElementImpl::getAttribute(const DOM::DOMString &name) const
+{
+ DOM::DOMString *result = m_attributes[name.string()];
+ if(result)
+ return *result;
+ else
+ return DOM::DOMString();
+}
+
+// This gets the internal, real-time value. This means it can return a default value
+// for an attribute even if its not explicitly set in the svg source.
+DOM::DOMString SVGElementImpl::getAttributeInternal(const DOM::DOMString &name)
+{
+ ExecState *exec = ownerDoc()->ecmaEngine()->globalExec();
+
+ DOM::DOMString retVal;
+
+ static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeGetMode(true);
+ retVal = bridge(exec)->get(exec, Identifier(UString(name))).toString(exec).string();
+ static_cast<KSVGScriptInterpreter *>(exec->interpreter())->setAttributeGetMode(false);
+
+ return retVal;
+}
+
+bool SVGElementImpl::hasAttribute(const DOM::DOMString &name)
+{
+ return m_attributes.find(name.string()) != 0;
+}
+
+bool SVGElementImpl::hasAttributes()
+{
+ return m_attributes.count() > 0;
+}
+
+void SVGElementImpl::setApplyAttribute(const TQString &name, const TQString &value)
+{
+ if(hasAttribute(name))
+ {
+ TQString cur = getAttribute(name).string();
+ cur = cur.simplifyWhiteSpace();
+
+ if(!cur.endsWith(";"))
+ cur += "; ";
+
+ cur += value;
+
+ setAttribute(name, cur);
+ }
+ else
+ setAttribute(name, value);
+}
+
+void SVGElementImpl::setId(DOM::DOMString id)
+{
+ setAttribute("id", id);
+
+ if(ownerDoc() && ownerDoc()->rootElement() && !id.isEmpty())
+ ownerDoc()->rootElement()->addToIdMap(id.string(), this);
+ else if(m_ownerSVGElement && !id.isEmpty())
+ m_ownerSVGElement->addToIdMap(id.string(), this);
+}
+
+DOM::DOMString SVGElementImpl::id() const
+{
+ return getAttribute("id");
+}
+
+void SVGElementImpl::setXmlbase(DOM::DOMString xmlbase)
+{
+ setAttribute("xml:base", xmlbase);
+}
+
+DOM::DOMString SVGElementImpl::xmlbase() const
+{
+ return getAttribute("xml:base");
+}
+
+void SVGElementImpl::setOwnerSVGElement(SVGSVGElementImpl *owner)
+{
+ if(m_ownerSVGElement)
+ m_ownerSVGElement->deref();
+
+ m_ownerSVGElement = owner;
+
+ if(m_ownerSVGElement)
+ m_ownerSVGElement->ref();
+}
+
+void SVGElementImpl::setViewportElement(SVGElementImpl *viewport)
+{
+ if(m_viewportElement)
+ m_viewportElement->deref();
+
+ m_viewportElement = viewport;
+
+ if(m_viewportElement)
+ m_viewportElement->ref();
+}
+
+SVGSVGElementImpl *SVGElementImpl::ownerSVGElement() const
+{
+ return m_ownerSVGElement;
+}
+
+SVGElementImpl *SVGElementImpl::viewportElement() const
+{
+ return m_viewportElement;
+}
+
+void SVGElementImpl::setAttributes(const TQXmlAttributes &attrs)
+{
+ for(int i = 0; i < attrs.length(); i++)
+ {
+ setAttribute(attrs.localName(i), attrs.value(i));
+ setAttributeInternal(attrs.localName(i), attrs.value(i));
+ }
+
+ setAttributes();
+}
+
+void SVGElementImpl::setAttributes()
+{
+ // Finalize style
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
+
+ if(style)
+ style->processStyle();
+}
+
+void SVGElementImpl::setAttributes(bool deep)
+{
+ // Finalize style
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
+
+ if(style)
+ style->processStyle();
+
+ if(deep)
+ {
+ if(hasChildNodes())
+ {
+ DOM::Node n;
+ for(n = firstChild(); !n.isNull(); n = n.nextSibling())
+ {
+ SVGElementImpl *elem = ownerDoc()->getElementFromHandle(n.handle());
+ if(elem)
+ elem->setAttributes(true);
+ }
+ }
+ }
+}
+
+bool SVGElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &a, SVGMouseEventImpl *mev)
+{
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(this);
+ if(shape)
+ return shape->prepareMouseEvent(p, a, mev);
+
+ return false;
+}
+
+bool SVGElementImpl::dispatchEvent(int id, bool canBubbleArg, bool cancelableArg)
+{
+ SVGEventImpl *evt = new SVGEventImpl(static_cast<SVGEvent::EventId>(id), canBubbleArg, cancelableArg);
+
+ evt->ref();
+ bool ret = dispatchEvent(evt, true);
+ evt->deref();
+
+ return ret;
+}
+
+bool SVGElementImpl::dispatchEvent(SVGEventImpl *evt, bool tempEvent)
+{
+ evt->setTarget(this);
+
+ // Find out, where to send to -> collect parent nodes
+ TQPtrList<SVGElementImpl> nodeChain;
+
+ for(DOM::Element e = *this; !e.isNull(); e = e.parentNode())
+ nodeChain.prepend(ownerDoc()->getElementFromHandle(e.handle()));
+
+ // Trigger any capturing event handlers on our way down
+ evt->setEventPhase(DOM::Event::CAPTURING_PHASE);
+
+ TQPtrListIterator<SVGElementImpl> it(nodeChain);
+ for(; it.current() && it.current() != this && !evt->propagationStopped(); ++it)
+ {
+ evt->setCurrentTarget(it.current());
+
+ if(it.current())
+ it.current()->handleLocalEvents(evt, true);
+ }
+
+ // Dispatch to the actual target node
+ it.toLast();
+ if(!evt->propagationStopped())
+ {
+ evt->setEventPhase(DOM::Event::AT_TARGET);
+ evt->setCurrentTarget(it.current());
+
+ if(it.current())
+ it.current()->handleLocalEvents(evt, false);
+ }
+
+ --it;
+
+ // Bubble up again
+ if(evt->bubbles())
+ {
+ evt->setEventPhase(DOM::Event::BUBBLING_PHASE);
+ for(; it.current() && !evt->propagationStopped(); --it)
+ {
+ evt->setCurrentTarget(it.current());
+
+ if(it.current())
+ it.current()->handleLocalEvents(evt, false);
+ }
+ }
+
+ evt->setCurrentTarget(0);
+ evt->setEventPhase(0); // I guess this is correct, the spec does not seem to say
+ // anything about the default event handler phase.
+
+ if(evt->bubbles())
+ {
+ // now we call all default event handlers (this is not part of DOM - it is internal to ksvg)
+ it.toLast();
+ for(; it.current() && !evt->propagationStopped() && !evt->defaultPrevented() && !evt->defaultHandled(); --it)
+ it.current()->defaultEventHandler(evt);
+ }
+
+ // If tempEvent is true, this means that the DOM implementation will not be storing a reference to the event, i.e.
+ // there is no way to retrieve it from javascript if a script does not already have a reference to it in a variable.
+ // So there is no need for the interpreter to keep the event in its cache
+ if(tempEvent)
+ ownerDoc()->ecmaEngine()->finishedWithEvent(evt);
+
+ return !evt->defaultPrevented(); // ### what if defaultPrevented was called before dispatchEvent?
+}
+
+bool SVGElementImpl::dispatchKeyEvent(TQKeyEvent *ke)
+{
+ DOM::AbstractView temp;
+
+ SVGEvent::EventId evtId = SVGEvent::UNKNOWN_EVENT;
+
+ if(ke->type() == TQEvent::KeyRelease && !ke->isAutoRepeat())
+ evtId = SVGEvent::KEYUP_EVENT;
+ else if(ke->isAutoRepeat())
+ evtId = SVGEvent::KEYPRESS_EVENT;
+ else if(ke->type() == TQEvent::KeyPress)
+ evtId = SVGEvent::KEYDOWN_EVENT;
+
+ if(evtId == SVGEvent::KEYUP_EVENT && hasEventListener(SVGEvent::DOMACTIVATE_EVENT, false))
+ dispatchEvent(SVGEvent::DOMACTIVATE_EVENT, true, true);
+
+ if(!hasEventListener(evtId, false))
+ return false;
+
+ SVGEventImpl *evt = new SVGKeyEventImpl(ke, temp, evtId);
+
+ evt->ref();
+ bool ret = dispatchEvent(evt, true);
+ evt->deref();
+
+ // Rerender now! Once! (Niko)
+ ownerDoc()->rerender();
+
+ return ret;
+}
+
+bool SVGElementImpl::dispatchMouseEvent(int id, bool canBubbleArg, bool cancelableArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, unsigned short buttonArg, SVGElementImpl *relatedTargetArg)
+{
+ DOM::AbstractView temp;
+
+ SVGEventImpl *evt = new SVGMouseEventImpl(static_cast<SVGEvent::EventId>(id),
+ canBubbleArg, cancelableArg, temp, detailArg,
+ screenXArg, screenYArg,
+ clientXArg, clientYArg,
+ ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg,
+ buttonArg, relatedTargetArg);
+
+ evt->ref();
+ bool ret = dispatchEvent(evt, true);
+ evt->deref();
+
+ return ret;
+}
+
+void SVGElementImpl::setOwnerDoc(SVGDocumentImpl *doc)
+{
+ if(m_ownerDoc)
+ m_ownerDoc->removeFromElemDict(handle());
+
+ m_ownerDoc = doc;
+
+ if(m_ownerDoc)
+ m_ownerDoc->addToElemDict(handle(), this);
+}
+
+SVGDocumentImpl *SVGElementImpl::ownerDoc() const
+{
+ return m_ownerDoc;
+}
+
+SVGElementImpl *SVGElementImpl::cloneNode(bool deep)
+{
+ DOM::Element impl = static_cast<DOM::Document *>(ownerDoc())->createElementNS("", tagName());
+ SVGElementImpl *newElement = SVGDocumentImpl::createElement(tagName(), impl.cloneNode(false), ownerDoc());
+ newElement->setOwnerSVGElement(ownerSVGElement());
+ newElement->setViewportElement(viewportElement());
+
+ SVGHelperImpl::copyAttributes(this, newElement);
+
+ // Recalc style
+ //newElement->setAttributes();
+
+ if(deep)
+ cloneChildNodes(newElement);
+
+ return newElement;
+}
+
+void SVGElementImpl::cloneChildNodes(SVGElementImpl *clone)
+{
+ DOM::Node n;
+ for(n = firstChild(); !n.isNull(); n = n.nextSibling())
+ {
+ SVGElementImpl *elem = ownerDoc()->getElementFromHandle(n.handle());
+ if(elem)
+ clone->appendChild(*elem->cloneNode(true));
+ else if(n.nodeType() == DOM::Node::TEXT_NODE)
+ clone->appendChild(n.cloneNode(true));
+ }
+}
+
+void SVGElementImpl::gotError(const TQString &errorDesc)
+{
+ if(ownerDoc())
+ {
+ ownerDoc()->finishParsing(true, errorDesc);
+ if(hasEventListener(SVGEvent::ERROR_EVENT, true))
+ dispatchEvent(SVGEvent::ERROR_EVENT, false, false);
+ }
+}
+
+TQString SVGElementImpl::collectText()
+{
+ TQString text;
+
+ if(hasChildNodes())
+ {
+ DOM::Node node = firstChild();
+
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ if(node.nodeType() == DOM::Node::TEXT_NODE)
+ {
+ DOM::Text textNode = node;
+ text += textNode.data().string();
+ }
+ }
+ }
+
+ return text;
+}
diff --git a/ksvg/impl/SVGElementImpl.h b/ksvg/impl/SVGElementImpl.h
index 011b8b4b..c2623d18 100644
--- a/ksvg/impl/SVGElementImpl.h
+++ b/ksvg/impl/SVGElementImpl.h
@@ -225,5 +225,3 @@ KSVG_DEFINE_PROTOTYPE(SVGElementImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGElementImplProtoFunc, SVGElementImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGElementInstanceImpl.cc b/ksvg/impl/SVGElementInstanceImpl.cc
deleted file mode 100644
index 97cd28a2..00000000
--- a/ksvg/impl/SVGElementInstanceImpl.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGElementImpl.h"
-#include "SVGUseElementImpl.h"
-#include "SVGElementInstanceImpl.h"
-#include "SVGElementInstanceListImpl.h"
-
-using namespace KSVG;
-
-SVGElementInstanceImpl::SVGElementInstanceImpl()//FIXME : events::EventTarget()
-{
- m_correspondingElement = 0;
- m_correspondingUseElement = 0;
- m_parentNode = 0;
- m_childNodes = 0;
- m_firstChild = 0;
- m_lastChild = 0;
- m_previousSibling = 0;
- m_nextSibling = 0;
-}
-
-SVGElementInstanceImpl::~SVGElementInstanceImpl()
-{
- if(m_correspondingElement)
- m_correspondingElement->deref();
- if(m_correspondingUseElement)
- m_correspondingUseElement->deref();
- if(m_parentNode)
- m_parentNode->deref();
- if(m_childNodes)
- m_childNodes->deref();
- if(m_firstChild)
- m_firstChild->deref();
- if(m_lastChild)
- m_lastChild->deref();
- if(m_previousSibling)
- m_previousSibling->deref();
- if(m_nextSibling)
- m_nextSibling->deref();
-}
-
-void SVGElementInstanceImpl::setCorrespondingElement(SVGElementImpl *corresponding)
-{
- m_correspondingElement = corresponding;
-
- if(m_correspondingElement)
- m_correspondingElement->ref();
-}
-
-SVGElementImpl *SVGElementInstanceImpl::correspondingElement() const
-{
- return m_correspondingElement;
-}
-
-SVGUseElementImpl *SVGElementInstanceImpl::correspondingUseElement() const
-{
- return m_correspondingUseElement;
-}
-
-SVGElementInstanceImpl *SVGElementInstanceImpl::parentNode() const
-{
- return m_parentNode;
-}
-
-SVGElementInstanceListImpl *SVGElementInstanceImpl::childNodes() const
-{
- return m_childNodes;
-}
-
-SVGElementInstanceImpl *SVGElementInstanceImpl::firstChild() const
-{
- return m_firstChild;
-}
-
-SVGElementInstanceImpl *SVGElementInstanceImpl::lastChild() const
-{
- return m_lastChild;
-}
-
-SVGElementInstanceImpl *SVGElementInstanceImpl::previousSibling() const
-{
- return m_previousSibling;
-}
-
-SVGElementInstanceImpl *SVGElementInstanceImpl::nextSibling() const
-{
- return m_nextSibling;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGElementInstanceImpl.cpp b/ksvg/impl/SVGElementInstanceImpl.cpp
new file mode 100644
index 00000000..bd1fc58d
--- /dev/null
+++ b/ksvg/impl/SVGElementInstanceImpl.cpp
@@ -0,0 +1,106 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGElementImpl.h"
+#include "SVGUseElementImpl.h"
+#include "SVGElementInstanceImpl.h"
+#include "SVGElementInstanceListImpl.h"
+
+using namespace KSVG;
+
+SVGElementInstanceImpl::SVGElementInstanceImpl()//FIXME : events::EventTarget()
+{
+ m_correspondingElement = 0;
+ m_correspondingUseElement = 0;
+ m_parentNode = 0;
+ m_childNodes = 0;
+ m_firstChild = 0;
+ m_lastChild = 0;
+ m_previousSibling = 0;
+ m_nextSibling = 0;
+}
+
+SVGElementInstanceImpl::~SVGElementInstanceImpl()
+{
+ if(m_correspondingElement)
+ m_correspondingElement->deref();
+ if(m_correspondingUseElement)
+ m_correspondingUseElement->deref();
+ if(m_parentNode)
+ m_parentNode->deref();
+ if(m_childNodes)
+ m_childNodes->deref();
+ if(m_firstChild)
+ m_firstChild->deref();
+ if(m_lastChild)
+ m_lastChild->deref();
+ if(m_previousSibling)
+ m_previousSibling->deref();
+ if(m_nextSibling)
+ m_nextSibling->deref();
+}
+
+void SVGElementInstanceImpl::setCorrespondingElement(SVGElementImpl *corresponding)
+{
+ m_correspondingElement = corresponding;
+
+ if(m_correspondingElement)
+ m_correspondingElement->ref();
+}
+
+SVGElementImpl *SVGElementInstanceImpl::correspondingElement() const
+{
+ return m_correspondingElement;
+}
+
+SVGUseElementImpl *SVGElementInstanceImpl::correspondingUseElement() const
+{
+ return m_correspondingUseElement;
+}
+
+SVGElementInstanceImpl *SVGElementInstanceImpl::parentNode() const
+{
+ return m_parentNode;
+}
+
+SVGElementInstanceListImpl *SVGElementInstanceImpl::childNodes() const
+{
+ return m_childNodes;
+}
+
+SVGElementInstanceImpl *SVGElementInstanceImpl::firstChild() const
+{
+ return m_firstChild;
+}
+
+SVGElementInstanceImpl *SVGElementInstanceImpl::lastChild() const
+{
+ return m_lastChild;
+}
+
+SVGElementInstanceImpl *SVGElementInstanceImpl::previousSibling() const
+{
+ return m_previousSibling;
+}
+
+SVGElementInstanceImpl *SVGElementInstanceImpl::nextSibling() const
+{
+ return m_nextSibling;
+}
diff --git a/ksvg/impl/SVGElementInstanceImpl.h b/ksvg/impl/SVGElementInstanceImpl.h
index d9f3afae..1be6a0e6 100644
--- a/ksvg/impl/SVGElementInstanceImpl.h
+++ b/ksvg/impl/SVGElementInstanceImpl.h
@@ -66,5 +66,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGElementInstanceListImpl.cc b/ksvg/impl/SVGElementInstanceListImpl.cc
deleted file mode 100644
index 187255ab..00000000
--- a/ksvg/impl/SVGElementInstanceListImpl.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGElementInstanceImpl.h"
-#include "SVGElementInstanceListImpl.h"
-
-using namespace KSVG;
-
-SVGElementInstanceListImpl::SVGElementInstanceListImpl()
-{
-}
-
-SVGElementInstanceListImpl::~SVGElementInstanceListImpl()
-{
-}
-
-unsigned long SVGElementInstanceListImpl::length() const
-{
- return m_length;
-}
-
-SVGElementInstanceImpl *SVGElementInstanceListImpl::item(unsigned long /*index*/)
-{
- return 0;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGElementInstanceListImpl.cpp b/ksvg/impl/SVGElementInstanceListImpl.cpp
new file mode 100644
index 00000000..c0748008
--- /dev/null
+++ b/ksvg/impl/SVGElementInstanceListImpl.cpp
@@ -0,0 +1,42 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGElementInstanceImpl.h"
+#include "SVGElementInstanceListImpl.h"
+
+using namespace KSVG;
+
+SVGElementInstanceListImpl::SVGElementInstanceListImpl()
+{
+}
+
+SVGElementInstanceListImpl::~SVGElementInstanceListImpl()
+{
+}
+
+unsigned long SVGElementInstanceListImpl::length() const
+{
+ return m_length;
+}
+
+SVGElementInstanceImpl *SVGElementInstanceListImpl::item(unsigned long /*index*/)
+{
+ return 0;
+}
diff --git a/ksvg/impl/SVGElementInstanceListImpl.h b/ksvg/impl/SVGElementInstanceListImpl.h
index c9ac0dd2..313af1e3 100644
--- a/ksvg/impl/SVGElementInstanceListImpl.h
+++ b/ksvg/impl/SVGElementInstanceListImpl.h
@@ -45,5 +45,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGEllipseElementImpl.cc b/ksvg/impl/SVGEllipseElementImpl.cc
deleted file mode 100644
index 76b050a5..00000000
--- a/ksvg/impl/SVGEllipseElementImpl.cc
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include <tdelocale.h>
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-#include "SVGRectImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGEllipseElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-
-using namespace KSVG;
-
-#include "SVGEllipseElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGEllipseElementImpl::SVGEllipseElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_cx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_cx->ref();
- m_cx->baseVal()->setValueAsString("-1");
-
- m_cy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_cy->ref();
- m_cy->baseVal()->setValueAsString("-1");
-
- m_rx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_rx->ref();
- m_rx->baseVal()->setValueAsString("-1");
-
- m_ry = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_ry->ref();
- m_ry->baseVal()->setValueAsString("-1");
-}
-
-SVGEllipseElementImpl::~SVGEllipseElementImpl()
-{
- if(m_cx)
- m_cx->deref();
- if(m_cy)
- m_cy->deref();
- if(m_rx)
- m_rx->deref();
- if(m_ry)
- m_ry->deref();
-}
-
-SVGAnimatedLengthImpl *SVGEllipseElementImpl::cx()
-{
- return m_cx;
-}
-
-SVGAnimatedLengthImpl *SVGEllipseElementImpl::cy()
-{
- return m_cy;
-}
-
-SVGAnimatedLengthImpl *SVGEllipseElementImpl::rx()
-{
- return m_rx;
-}
-
-SVGAnimatedLengthImpl *SVGEllipseElementImpl::ry()
-{
- return m_ry;
-}
-
-/*
-@namespace KSVG
-@begin SVGEllipseElementImpl::s_hashTable 5
- cx SVGEllipseElementImpl::Cx DontDelete|ReadOnly
- cy SVGEllipseElementImpl::Cy DontDelete|ReadOnly
- rx SVGEllipseElementImpl::Rx DontDelete|ReadOnly
- ry SVGEllipseElementImpl::Ry DontDelete|ReadOnly
-@end
-*/
-
-Value SVGEllipseElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Cx:
- if(!attributeMode)
- return m_cx->cache(exec);
- else
- return Number(m_cx->baseVal()->value());
- case Cy:
- if(!attributeMode)
- return m_cy->cache(exec);
- else
- return Number(m_cy->baseVal()->value());
- case Rx:
- if(!attributeMode)
- return m_rx->cache(exec);
- else
- return Number(m_rx->baseVal()->value());
- case Ry:
- if(!attributeMode)
- return m_ry->cache(exec);
- else
- return Number(m_ry->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGEllipseElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Cx:
- cx()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Cy:
- cy()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Rx:
- rx()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(rx()->baseVal()->value() < 0) // A negative value is an error
- gotError("Negative value for attribute rx of element <ellipse> is illegal");
- break;
- case Ry:
- ry()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(ry()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute ry of element <ellipse> is illegal"));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGEllipseElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_cx->baseVal()->value() - m_rx->baseVal()->value());
- ret->setY(m_cy->baseVal()->value() - m_ry->baseVal()->value());
- ret->setWidth(m_rx->baseVal()->value() * 2.0);
- ret->setHeight(m_ry->baseVal()->value() * 2.0);
- return ret;
-}
-
-void SVGEllipseElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Cx))
- KSVG_SET_ALT_ATTRIBUTE(Cx, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Cy))
- KSVG_SET_ALT_ATTRIBUTE(Cy, "0")
-}
-
-void SVGEllipseElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createEllipse(this);
- c->insert(m_item);
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGEllipseElementImpl.cpp b/ksvg/impl/SVGEllipseElementImpl.cpp
new file mode 100644
index 00000000..1487d79b
--- /dev/null
+++ b/ksvg/impl/SVGEllipseElementImpl.cpp
@@ -0,0 +1,198 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include <tdelocale.h>
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+#include "SVGRectImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGEllipseElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+
+using namespace KSVG;
+
+#include "SVGEllipseElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGEllipseElementImpl::SVGEllipseElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_cx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_cx->ref();
+ m_cx->baseVal()->setValueAsString("-1");
+
+ m_cy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_cy->ref();
+ m_cy->baseVal()->setValueAsString("-1");
+
+ m_rx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_rx->ref();
+ m_rx->baseVal()->setValueAsString("-1");
+
+ m_ry = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_ry->ref();
+ m_ry->baseVal()->setValueAsString("-1");
+}
+
+SVGEllipseElementImpl::~SVGEllipseElementImpl()
+{
+ if(m_cx)
+ m_cx->deref();
+ if(m_cy)
+ m_cy->deref();
+ if(m_rx)
+ m_rx->deref();
+ if(m_ry)
+ m_ry->deref();
+}
+
+SVGAnimatedLengthImpl *SVGEllipseElementImpl::cx()
+{
+ return m_cx;
+}
+
+SVGAnimatedLengthImpl *SVGEllipseElementImpl::cy()
+{
+ return m_cy;
+}
+
+SVGAnimatedLengthImpl *SVGEllipseElementImpl::rx()
+{
+ return m_rx;
+}
+
+SVGAnimatedLengthImpl *SVGEllipseElementImpl::ry()
+{
+ return m_ry;
+}
+
+/*
+@namespace KSVG
+@begin SVGEllipseElementImpl::s_hashTable 5
+ cx SVGEllipseElementImpl::Cx DontDelete|ReadOnly
+ cy SVGEllipseElementImpl::Cy DontDelete|ReadOnly
+ rx SVGEllipseElementImpl::Rx DontDelete|ReadOnly
+ ry SVGEllipseElementImpl::Ry DontDelete|ReadOnly
+@end
+*/
+
+Value SVGEllipseElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Cx:
+ if(!attributeMode)
+ return m_cx->cache(exec);
+ else
+ return Number(m_cx->baseVal()->value());
+ case Cy:
+ if(!attributeMode)
+ return m_cy->cache(exec);
+ else
+ return Number(m_cy->baseVal()->value());
+ case Rx:
+ if(!attributeMode)
+ return m_rx->cache(exec);
+ else
+ return Number(m_rx->baseVal()->value());
+ case Ry:
+ if(!attributeMode)
+ return m_ry->cache(exec);
+ else
+ return Number(m_ry->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGEllipseElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Cx:
+ cx()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Cy:
+ cy()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Rx:
+ rx()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(rx()->baseVal()->value() < 0) // A negative value is an error
+ gotError("Negative value for attribute rx of element <ellipse> is illegal");
+ break;
+ case Ry:
+ ry()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(ry()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute ry of element <ellipse> is illegal"));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGEllipseElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_cx->baseVal()->value() - m_rx->baseVal()->value());
+ ret->setY(m_cy->baseVal()->value() - m_ry->baseVal()->value());
+ ret->setWidth(m_rx->baseVal()->value() * 2.0);
+ ret->setHeight(m_ry->baseVal()->value() * 2.0);
+ return ret;
+}
+
+void SVGEllipseElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Cx))
+ KSVG_SET_ALT_ATTRIBUTE(Cx, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Cy))
+ KSVG_SET_ALT_ATTRIBUTE(Cy, "0")
+}
+
+void SVGEllipseElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createEllipse(this);
+ c->insert(m_item);
+ }
+}
diff --git a/ksvg/impl/SVGEllipseElementImpl.h b/ksvg/impl/SVGEllipseElementImpl.h
index 131098ba..8803ebc5 100644
--- a/ksvg/impl/SVGEllipseElementImpl.h
+++ b/ksvg/impl/SVGEllipseElementImpl.h
@@ -82,5 +82,3 @@ KSVG_REGISTER_ELEMENT(SVGEllipseElementImpl, "ellipse")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGEventImpl.cc b/ksvg/impl/SVGEventImpl.cc
deleted file mode 100644
index b5b79fc9..00000000
--- a/ksvg/impl/SVGEventImpl.cc
+++ /dev/null
@@ -1,992 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- Additional copyright:
- (C) 2001 Peter Kelly <pmk@post.com>
- (C) 2001 Tobias Anton <anton@stud.fbi.fh-darmstadt.de>
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDocumentImpl.h"
-#include "SVGEventImpl.h"
-
-#include <kdebug.h>
-
-using namespace KSVG;
-
-#include "ksvg_scriptinterpreter.h"
-#include "SVGEventImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGEventImpl::SVGEventImpl()
-{
- m_canBubble = false;
- m_cancelable = false;
-
- m_propagationStopped = false;
- m_defaultPrevented = false;
- m_id = SVGEvent::UNKNOWN_EVENT;
- m_eventPhase = 0;
- m_createTime = TQDateTime::currentDateTime();
- m_defaultHandled = false;
-
- m_target = 0;
- m_currentTarget = 0;
-}
-
-SVGEventImpl::SVGEventImpl(SVGEvent::EventId _id, bool canBubbleArg, bool cancelableArg)
-{
- DOM::DOMString t = SVGEvent::idToType(_id);
- m_type = t.implementation();
-
- m_canBubble = canBubbleArg;
- m_cancelable = cancelableArg;
-
- m_propagationStopped = false;
- m_defaultPrevented = false;
- m_id = _id;
- m_eventPhase = 0;
- m_createTime = TQDateTime::currentDateTime();
- m_defaultHandled = false;
-
- m_target = 0;
- m_currentTarget = 0;
-}
-
-SVGEventImpl::~SVGEventImpl()
-{
-}
-
-DOM::DOMString SVGEventImpl::type() const
-{
- return m_type;
-}
-
-SVGElementImpl *SVGEventImpl::target() const
-{
- return m_target;
-}
-
-void SVGEventImpl::setTarget(SVGElementImpl *_target)
-{
- m_target = _target;
-}
-
-SVGElementImpl *SVGEventImpl::currentTarget() const
-{
- return m_currentTarget;
-}
-
-void SVGEventImpl::setCurrentTarget(SVGElementImpl *_currentTarget)
-{
- m_currentTarget = _currentTarget;
-}
-
-unsigned short SVGEventImpl::eventPhase() const
-{
- return m_eventPhase;
-}
-
-void SVGEventImpl::setEventPhase(unsigned short _eventPhase)
-{
- m_eventPhase = _eventPhase;
-}
-
-bool SVGEventImpl::bubbles() const
-{
- return m_canBubble;
-}
-
-bool SVGEventImpl::cancelable() const
-{
- return m_cancelable;
-}
-
-DOM::DOMTimeStamp SVGEventImpl::timeStamp()
-{
- TQDateTime epoch(TQDate(1970, 1, 1), TQTime(0, 0));
-
- // ### kjs does not yet support long long (?) so the value wraps around
- return epoch.secsTo(m_createTime) * 1000 + m_createTime.time().msec();
-}
-
-void SVGEventImpl::stopPropagation()
-{
- m_propagationStopped = true;
-}
-
-void SVGEventImpl::preventDefault()
-{
- if(m_cancelable)
- m_defaultPrevented = true;
-}
-
-void SVGEventImpl::initEvent(const DOM::DOMString &eventTypeArg, bool canBubbleArg, bool cancelableArg)
-{
- // ### ensure this is not called after we have been dispatched (also for subclasses)
- m_type = eventTypeArg.implementation();
- m_id = SVGEvent::typeToId(eventTypeArg);
-
- m_canBubble = canBubbleArg;
- m_cancelable = cancelableArg;
-}
-
-void SVGEventImpl::setDefaultHandled()
-{
- m_defaultHandled = true;
-}
-
-/*
-@namespace KSVG
-@begin SVGEventImpl::s_hashTable 11
- type SVGEventImpl::Type DontDelete|ReadOnly
- target SVGEventImpl::Target DontDelete|ReadOnly
- currentTarget SVGEventImpl::CurrentTarget DontDelete|ReadOnly
- eventPhase SVGEventImpl::EventPhase DontDelete|ReadOnly
- bubbles SVGEventImpl::Bubbles DontDelete|ReadOnly
- cancelable SVGEventImpl::Cancelable DontDelete|ReadOnly
- timeStamp SVGEventImpl::TimeStamp DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGEventImplProto::s_hashTable 13
- getType SVGEventImpl::GetType DontDelete|Function 0
- getTarget SVGEventImpl::GetTarget DontDelete|Function 0
- getCurrentTarget SVGEventImpl::GetCurrentTarget DontDelete|Function 0
- getCurrentNode SVGEventImpl::GetCurrentNode DontDelete|Function 0
- getEventphase SVGEventImpl::GetEventPhase DontDelete|Function 0
- getBubbles SVGEventImpl::GetBubbles DontDelete|Function 0
- getCancelable SVGEventImpl::GetCancelable DontDelete|Function 0
- getTimeStamp SVGEventImpl::GetTimeStamp DontDelete|Function 0
- stopPropagation SVGEventImpl::StopPropagation DontDelete|Function 0
- preventDefault SVGEventImpl::PreventDefault DontDelete|Function 0
- initEvent SVGEventImpl::InitEvent DontDelete|Function 3
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGEvent", SVGEventImplProto, SVGEventImplProtoFunc)
-
-Value SVGEventImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Type:
- return String(type());
- case Target:
- return getDOMNode(exec, *target());
- case CurrentTarget:
- return getDOMNode(exec, *currentTarget());
- case EventPhase:
- return Number(eventPhase());
- case Bubbles:
- return Boolean(bubbles());
- case Cancelable:
- return Boolean(cancelable());
-// case TimeStamp: // TODO
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-Value SVGEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGEventImpl)
-
- switch(id)
- {
- case SVGEventImpl::GetType:
- return String(obj->type());
- case SVGEventImpl::GetTarget:
- return getDOMNode(exec, *obj->target());
- case SVGEventImpl::GetCurrentTarget:
- case SVGEventImpl::GetCurrentNode:
- return getDOMNode(exec, *obj->currentTarget());
- case SVGEventImpl::GetEventPhase:
- return Number(obj->eventPhase());
- case SVGEventImpl::GetBubbles:
- return Boolean(obj->bubbles());
- case SVGEventImpl::GetCancelable:
- return Boolean(obj->cancelable());
-// case SVGEventImpl::GetTimeStamp: // TODO
- case SVGEventImpl::StopPropagation:
- {
- obj->stopPropagation();
- return Undefined();
- }
- case SVGEventImpl::PreventDefault:
- {
- obj->preventDefault();
- return Undefined();
- }
- case SVGEventImpl::InitEvent:
- {
- obj->initEvent(args[0].toString(exec).string(), args[1].toBoolean(exec), args[2].toBoolean(exec));
- return Undefined();
- }
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-
-
-
-
-SVGUIEventImpl::SVGUIEventImpl() : SVGEventImpl()
-{
- m_detail = 0;
-}
-
-SVGUIEventImpl::SVGUIEventImpl(SVGEvent::EventId _id, bool canBubbleArg, bool cancelableArg, DOM::AbstractView &viewArg, long detailArg)
-: SVGEventImpl(_id, canBubbleArg, cancelableArg)
-{
- m_view = viewArg;
- m_detail = detailArg;
-}
-
-SVGUIEventImpl::~SVGUIEventImpl()
-{
-}
-
-DOM::AbstractView SVGUIEventImpl::view() const
-{
- return m_view;
-}
-
-long SVGUIEventImpl::detail() const
-{
- return m_detail;
-}
-
-void SVGUIEventImpl::initUIEvent(const DOM::DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const DOM::AbstractView &viewArg,
- long detailArg)
-{
- SVGEventImpl::initEvent(typeArg, canBubbleArg, cancelableArg);
-
- m_view = viewArg;
- m_detail = detailArg;
-}
-
-/*
-@namespace KSVG
-@begin SVGUIEventImpl::s_hashTable 3
- view SVGUIEventImpl::View DontDelete|ReadOnly
- detail SVGUIEventImpl::Detail DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGUIEventImplProto::s_hashTable 5
- getView SVGUIEventImpl::GetView DontDelete|Function 0
- getDetail SVGUIEventImpl::GetDetail DontDelete|Function 0
- initUIEvent SVGUIEventImpl::InitUIEvent DontDelete|Function 5
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGUIEvent", SVGUIEventImplProto, SVGUIEventImplProtoFunc)
-
-Value SVGUIEventImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
-// case View: // TODO
- case Detail:
- return Number(detail());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-Value SVGUIEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
-{
- KSVG_CHECK_THIS(SVGUIEventImpl)
-
- switch(id)
- {
-// case SVGUIEventImpl::GetView: // TODO
- case SVGUIEventImpl::GetDetail:
- return Number(obj->detail());
-// case SVGUIEventImpl::InitUIEvent: // TODO
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-SVGKeyEventImpl::SVGKeyEventImpl() : SVGUIEventImpl()
-{
- qKeyEvent = 0;
-}
-
-SVGKeyEventImpl::SVGKeyEventImpl(TQKeyEvent *key, DOM::AbstractView &view, SVGEvent::EventId _id) : SVGUIEventImpl(_id, true, true, view, 0)
-{
- qKeyEvent = new TQKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->isAutoRepeat(), key->count());
-
- // Events are supposed to be accepted by default in TQt!
- // This line made TQLineEdit's keyevents be ignored, so they were sent to the tdehtmlview
- // (and e.g. space would make it scroll down)
- //qKeyEvent->ignore();
-
- m_detail = key->count();
-
- m_numPad = false;
- m_keyVal = 0;
- m_virtKeyVal = DOM_VK_UNDEFINED;
- m_inputGenerated = true;
-
- switch(key->key())
- {
- case TQt::Key_Enter:
- m_numPad = true;
- /* fall through */
- case TQt::Key_Return:
- m_virtKeyVal = DOM_VK_ENTER;
- break;
- case TQt::Key_NumLock:
- m_numPad = true;
- m_virtKeyVal = DOM_VK_NUM_LOCK;
- break;
- case TQt::Key_Alt:
- m_virtKeyVal = DOM_VK_RIGHT_ALT;
- // ### DOM_VK_LEFT_ALT;
- break;
- case TQt::Key_Control:
- m_virtKeyVal = DOM_VK_LEFT_CONTROL;
- // ### DOM_VK_RIGHT_CONTROL
- break;
- case TQt::Key_Shift:
- m_virtKeyVal = DOM_VK_LEFT_SHIFT;
- // ### DOM_VK_RIGHT_SHIFT
- break;
- case TQt::Key_Meta:
- m_virtKeyVal = DOM_VK_LEFT_META;
- // ### DOM_VK_RIGHT_META
- break;
- case TQt::Key_CapsLock:
- m_virtKeyVal = DOM_VK_CAPS_LOCK;
- break;
- case TQt::Key_Delete:
- m_virtKeyVal = DOM_VK_DELETE;
- break;
- case TQt::Key_End:
- m_virtKeyVal = DOM_VK_END;
- break;
- case TQt::Key_Escape:
- m_virtKeyVal = DOM_VK_ESCAPE;
- break;
- case TQt::Key_Home:
- m_virtKeyVal = DOM_VK_HOME;
- break;
- case TQt::Key_Insert:
- m_virtKeyVal = DOM_VK_INSERT;
- break;
- case TQt::Key_Pause:
- m_virtKeyVal = DOM_VK_PAUSE;
- break;
- case TQt::Key_Print:
- m_virtKeyVal = DOM_VK_PRINTSCREEN;
- break;
- case TQt::Key_ScrollLock:
- m_virtKeyVal = DOM_VK_SCROLL_LOCK;
- break;
- case TQt::Key_Left:
- m_virtKeyVal = DOM_VK_LEFT;
- break;
- case TQt::Key_Right:
- m_virtKeyVal = DOM_VK_RIGHT;
- break;
- case TQt::Key_Up:
- m_virtKeyVal = DOM_VK_UP;
- break;
- case TQt::Key_Down:
- m_virtKeyVal = DOM_VK_DOWN;
- break;
- case TQt::Key_Next:
- m_virtKeyVal = DOM_VK_PAGE_DOWN;
- break;
- case TQt::Key_Prior:
- m_virtKeyVal = DOM_VK_PAGE_UP;
- break;
- case TQt::Key_F1:
- m_virtKeyVal = DOM_VK_F1;
- break;
- case TQt::Key_F2:
- m_virtKeyVal = DOM_VK_F2;
- break;
- case TQt::Key_F3:
- m_virtKeyVal = DOM_VK_F3;
- break;
- case TQt::Key_F4:
- m_virtKeyVal = DOM_VK_F4;
- break;
- case TQt::Key_F5:
- m_virtKeyVal = DOM_VK_F5;
- break;
- case TQt::Key_F6:
- m_virtKeyVal = DOM_VK_F6;
- break;
- case TQt::Key_F7:
- m_virtKeyVal = DOM_VK_F7;
- break;
- case TQt::Key_F8:
- m_virtKeyVal = DOM_VK_F8;
- break;
- case TQt::Key_F9:
- m_virtKeyVal = DOM_VK_F9;
- break;
- case TQt::Key_F10:
- m_virtKeyVal = DOM_VK_F10;
- break;
- case TQt::Key_F11:
- m_virtKeyVal = DOM_VK_F11;
- break;
- case TQt::Key_F12:
- m_virtKeyVal = DOM_VK_F12;
- break;
- case TQt::Key_F13:
- m_virtKeyVal = DOM_VK_F13;
- break;
- case TQt::Key_F14:
- m_virtKeyVal = DOM_VK_F14;
- break;
- case TQt::Key_F15:
- m_virtKeyVal = DOM_VK_F15;
- break;
- case TQt::Key_F16:
- m_virtKeyVal = DOM_VK_F16;
- break;
- case TQt::Key_F17:
- m_virtKeyVal = DOM_VK_F17;
- break;
- case TQt::Key_F18:
- m_virtKeyVal = DOM_VK_F18;
- break;
- case TQt::Key_F19:
- m_virtKeyVal = DOM_VK_F19;
- break;
- case TQt::Key_F20:
- m_virtKeyVal = DOM_VK_F20;
- break;
- case TQt::Key_F21:
- m_virtKeyVal = DOM_VK_F21;
- break;
- case TQt::Key_F22:
- m_virtKeyVal = DOM_VK_F22;
- break;
- case TQt::Key_F23:
- m_virtKeyVal = DOM_VK_F23;
- break;
- case TQt::Key_F24:
- m_virtKeyVal = DOM_VK_F24;
- break;
- default:
- m_virtKeyVal = DOM_VK_UNDEFINED;
- break;
- }
-
- // m_keyVal should contain the unicode value
- // of the pressed key if available.
- if (!key->text().isNull())
- m_keyVal = TQString(key->text()).unicode()[0];
-
- // m_numPad = ???
-
- // key->state returns enum ButtonState, which is ShiftButton, ControlButton and AltButton or'ed together.
- m_modifier = key->state();
-
- // key->text() returns the unicode sequence as a TQString
- m_outputString = DOM::DOMString(key->text());
-}
-
-SVGKeyEventImpl::SVGKeyEventImpl(SVGEvent::EventId _id,
- bool canBubbleArg,
- bool cancelableArg,
- DOM::AbstractView &viewArg,
- unsigned short detailArg,
- DOM::DOMString &outputStringArg,
- unsigned long keyValArg,
- unsigned long virtKeyValArg,
- bool inputGeneratedArg,
- bool numPadArg)
-: SVGUIEventImpl(_id, canBubbleArg, cancelableArg, viewArg, detailArg)
-{
- qKeyEvent = 0;
- m_keyVal = keyValArg;
- m_virtKeyVal = virtKeyValArg;
- m_inputGenerated = inputGeneratedArg;
- m_outputString = outputStringArg;
- m_numPad = numPadArg;
- m_modifier = 0;
-}
-
-SVGKeyEventImpl::~SVGKeyEventImpl()
-{
- delete qKeyEvent;
-}
-
-bool SVGKeyEventImpl::checkModifier(unsigned long modifierArg)
-{
- return ((m_modifier && modifierArg) == modifierArg);
-}
-
-void SVGKeyEventImpl::initKeyEvent(DOM::DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const DOM::AbstractView &viewArg,
- long detailArg,
- DOM::DOMString &outputStringArg,
- unsigned long keyValArg,
- unsigned long virtKeyValArg,
- bool inputGeneratedArg,
- bool numPadArg)
-{
- SVGUIEventImpl::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
-
- m_outputString = outputStringArg;
- m_keyVal = keyValArg;
- m_virtKeyVal = virtKeyValArg;
- m_inputGenerated = inputGeneratedArg;
- m_numPad = numPadArg;
-}
-
-void SVGKeyEventImpl::initModifier(unsigned long modifierArg, bool valueArg)
-{
- if(valueArg)
- m_modifier |= modifierArg;
- else
- m_modifier &= (modifierArg ^ 0xFFFFFFFF);
-}
-
-bool SVGKeyEventImpl::inputGenerated() const
-{
- return m_inputGenerated;
-}
-
-unsigned long SVGKeyEventImpl::keyVal() const
-{
- return m_keyVal;
-}
-
-DOM::DOMString SVGKeyEventImpl::outputString() const
-{
- return m_outputString;
-}
-
-/*
-@namespace KSVG
-@begin SVGKeyEventImpl::s_hashTable 7
- keyVal SVGKeyEventImpl::KeyVal DontDelete|ReadOnly
- keyCode SVGKeyEventImpl::KeyVal DontDelete|ReadOnly
- charCode SVGKeyEventImpl::KeyVal DontDelete|ReadOnly
- outputString SVGKeyEventImpl::OutputString DontDelete|ReadOnly
- virtKeyVal SVGKeyEventImpl::VirtKeyVal DontDelete|ReadOnly
-# todo visibleOutputGenerated numPad
-@end
-@namespace KSVG
-@begin SVGKeyEventImplProto::s_hashTable 7
- checkModifier SVGKeyEventImpl::CheckModifier DontDelete|Function 1
- getKeyCode SVGKeyEventImpl::GetKeyVal DontDelete|Function 0
- getCharCode SVGKeyEventImpl::GetKeyVal DontDelete|Function 0
- getKeyVal SVGKeyEventImpl::GetKeyVal DontDelete|Function 0
- getCharCode SVGKeyEventImpl::GetCharCode DontDelete|Function 0
-# todo initModifier
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGKeyEvent", SVGKeyEventImplProto, SVGKeyEventImplProtoFunc)
-
-Value SVGKeyEventImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case KeyVal:
- return Number(keyVal());
- case VirtKeyVal:
- return Number(virtKeyVal());
- case OutputString:
- return String(outputString());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGKeyEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGKeyEventImpl)
-
- switch(id)
- {
- case SVGKeyEventImpl::CheckModifier:
- return Boolean((static_cast<KSVGBridge<SVGKeyEventImpl> *>(static_cast<ObjectImp *>(thisObj.imp()))->impl())->checkModifier(args[0].toUInt32(exec)));
- case SVGKeyEventImpl::GetKeyVal:
- case SVGKeyEventImpl::GetCharCode:
- return Number((static_cast<KSVGBridge<SVGKeyEventImpl> *>(static_cast<ObjectImp *>(thisObj.imp()))->impl())->keyVal());
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-
-
-// -----------------------------------------------------------------------------
-
-SVGMouseEventImpl::SVGMouseEventImpl() : SVGUIEventImpl()
-{
- m_screenX = 0;
- m_screenY = 0;
- m_clientX = 0;
- m_clientY = 0;
- m_ctrlKey = false;
- m_altKey = false;
- m_shiftKey = false;
- m_metaKey = false;
- m_button = 0;
-}
-
-SVGMouseEventImpl::SVGMouseEventImpl(SVGEvent::EventId _id,
- bool canBubbleArg,
- bool cancelableArg,
- DOM::AbstractView &viewArg,
- long detailArg,
- long screenXArg,
- long screenYArg,
- long clientXArg,
- long clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- SVGElementImpl *relatedTargetArg)
-: SVGUIEventImpl(_id, canBubbleArg, cancelableArg, viewArg, detailArg)
-{
- m_screenX = screenXArg;
- m_screenY = screenYArg;
- m_clientX = clientXArg;
- m_clientY = clientYArg;
- m_ctrlKey = ctrlKeyArg;
- m_altKey = altKeyArg;
- m_shiftKey = shiftKeyArg;
- m_metaKey = metaKeyArg;
- m_button = buttonArg;
- m_relatedTarget = relatedTargetArg;
-}
-
-SVGMouseEventImpl::~SVGMouseEventImpl()
-{
-}
-
-long SVGMouseEventImpl::screenX() const
-{
- return m_screenX;
-}
-
-long SVGMouseEventImpl::screenY() const
-{
- return m_screenY;
-}
-
-long SVGMouseEventImpl::clientX() const
-{
- return m_clientX;
-}
-
-long SVGMouseEventImpl::clientY() const
-{
- return m_clientY;
-}
-
-bool SVGMouseEventImpl::ctrlKey() const
-{
- return m_ctrlKey;
-}
-
-bool SVGMouseEventImpl::shiftKey() const
-{
- return m_shiftKey;
-}
-
-bool SVGMouseEventImpl::altKey() const
-{
- return m_altKey;
-}
-
-bool SVGMouseEventImpl::metaKey() const
-{
- return m_metaKey;
-}
-
-unsigned short SVGMouseEventImpl::button() const
-{
- return m_button;
-}
-
-SVGElementImpl *SVGMouseEventImpl::relatedTarget() const
-{
- return m_relatedTarget;
-}
-
-DOM::DOMString SVGMouseEventImpl::url() const
-{
- return m_url;
-}
-
-void SVGMouseEventImpl::setURL(DOM::DOMString url)
-{
- m_url = url;
-}
-
-void SVGMouseEventImpl::initMouseEvent(const DOM::DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const DOM::AbstractView &viewArg,
- long detailArg,
- long screenXArg,
- long screenYArg,
- long clientXArg,
- long clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- SVGElementImpl *relatedTargetArg)
-{
- SVGUIEventImpl::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
-
- m_screenX = screenXArg;
- m_screenY = screenYArg;
- m_clientX = clientXArg;
- m_clientY = clientYArg;
- m_ctrlKey = ctrlKeyArg;
- m_altKey = altKeyArg;
- m_shiftKey = shiftKeyArg;
- m_metaKey = metaKeyArg;
- m_button = buttonArg;
- m_relatedTarget = relatedTargetArg;
-}
-
-/*
-@namespace KSVG
-@begin SVGMouseEventImpl::s_hashTable 11
- screenX SVGMouseEventImpl::ScreenX DontDelete|ReadOnly
- screenY SVGMouseEventImpl::ScreenY DontDelete|ReadOnly
- clientX SVGMouseEventImpl::ClientX DontDelete|ReadOnly
- clientY SVGMouseEventImpl::ClientY DontDelete|ReadOnly
- ctrlKey SVGMouseEventImpl::CtrlKey DontDelete|ReadOnly
- shiftKey SVGMouseEventImpl::ShiftKey DontDelete|ReadOnly
- altKey SVGMouseEventImpl::AltKey DontDelete|ReadOnly
- metaKey SVGMouseEventImpl::MetaKey DontDelete|ReadOnly
- button SVGMouseEventImpl::Button DontDelete|ReadOnly
- relatedTarget SVGMouseEventImpl::RelatedTarget DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGMouseEventImplProto::s_hashTable 13
- getScreenX SVGMouseEventImpl::GetScreenX DontDelete|Function 0
- getScreenY SVGMouseEventImpl::GetScreenY DontDelete|Function 0
- getClientX SVGMouseEventImpl::GetClientX DontDelete|Function 0
- getClientY SVGMouseEventImpl::GetClientY DontDelete|Function 0
- getCtrlKey SVGMouseEventImpl::GetCtrlKey DontDelete|Function 0
- getShiftKey SVGMouseEventImpl::GetShiftKey DontDelete|Function 0
- getAltKey SVGMouseEventImpl::GetAltKey DontDelete|Function 0
- getMetaKey SVGMouseEventImpl::GetMetaKey DontDelete|Function 0
- getButton SVGMouseEventImpl::GetButton DontDelete|Function 0
- getRelatedTarget SVGMouseEventImpl::GetRelatedTarget DontDelete|Function 0
- initMouseEvent SVGMouseEventImpl::InitMouseEvent DontDelete|Function 15
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGMouseEvent", SVGMouseEventImplProto, SVGMouseEventImplProtoFunc)
-
-Value SVGMouseEventImpl::getValueProperty(ExecState *exec, int token) const
-{
- kdDebug(26004) << k_funcinfo << endl;
- switch(token)
- {
- case ScreenX:
- return Number(screenX());
- case ScreenY:
- return Number(screenY());
- case ClientX:
- return Number(clientX());
- case ClientY:
- return Number(clientY());
- case CtrlKey:
- return Number(ctrlKey());
- case ShiftKey:
- return Number(shiftKey());
- case AltKey:
- return Number(altKey());
- case MetaKey:
- return Number(metaKey());
- case Button:
- return Number(button());
- case RelatedTarget:
- return getDOMNode(exec, *relatedTarget());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-Value SVGMouseEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
-{
- kdDebug(26004) << k_funcinfo << endl;
- KSVG_CHECK_THIS(SVGMouseEventImpl)
-
- switch(id)
- {
- case SVGMouseEventImpl::GetScreenX:
- return Number(obj->screenX());
- case SVGMouseEventImpl::GetScreenY:
- return Number(obj->screenY());
- case SVGMouseEventImpl::GetClientX:
- return Number(obj->clientX());
- case SVGMouseEventImpl::GetClientY:
- return Number(obj->clientY());
- case SVGMouseEventImpl::GetCtrlKey:
- return Number(obj->ctrlKey());
- case SVGMouseEventImpl::GetShiftKey:
- return Number(obj->shiftKey());
- case SVGMouseEventImpl::GetAltKey:
- return Number(obj->altKey());
- case SVGMouseEventImpl::GetMetaKey:
- return Number(obj->metaKey());
- case SVGMouseEventImpl::GetButton:
- return Number(obj->button());
- case SVGMouseEventImpl::GetRelatedTarget:
- return getDOMNode(exec, *obj->relatedTarget());
-// case SVGMouseEventImpl::InitMouseEvent: // TODO
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-
-
-
-SVGMutationEventImpl::SVGMutationEventImpl() : SVGEventImpl()
-{
- m_attrChange = 0;
-}
-
-SVGMutationEventImpl::SVGMutationEventImpl(SVGEvent::EventId _id,
- bool canBubbleArg,
- bool cancelableArg,
- SVGElementImpl *relatedNodeArg,
- const DOM::DOMString &prevValueArg,
- const DOM::DOMString &newValueArg,
- const DOM::DOMString &attrNameArg,
- unsigned short attrChangeArg)
-: SVGEventImpl(_id, canBubbleArg, cancelableArg)
-{
- m_relatedNode = relatedNodeArg;
- m_prevValue = prevValueArg.implementation();
- m_newValue = newValueArg.implementation();
- m_attrName = attrNameArg.implementation();
- m_attrChange = attrChangeArg;
-}
-
-SVGMutationEventImpl::~SVGMutationEventImpl()
-{
-}
-
-SVGElementImpl *SVGMutationEventImpl::relatedNode() const
-{
- return m_relatedNode;
-}
-
-DOM::DOMString SVGMutationEventImpl::prevValue() const
-{
- return m_prevValue;
-}
-
-DOM::DOMString SVGMutationEventImpl::newValue() const
-{
- return m_newValue;
-}
-
-DOM::DOMString SVGMutationEventImpl::attrName() const
-{
- return m_attrName;
-}
-
-unsigned short SVGMutationEventImpl::attrChange() const
-{
- return m_attrChange;
-}
-
-void SVGMutationEventImpl::initMutationEvent(const DOM::DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- SVGElementImpl *relatedNodeArg,
- const DOM::DOMString &prevValueArg,
- const DOM::DOMString &newValueArg,
- const DOM::DOMString &attrNameArg,
- unsigned short attrChangeArg)
-{
- SVGEventImpl::initEvent(typeArg, canBubbleArg, cancelableArg);
-
- m_relatedNode = relatedNodeArg;
- m_prevValue = prevValueArg.implementation();
- m_newValue = newValueArg.implementation();
- m_attrName = attrNameArg.implementation();
- m_attrChange = attrChangeArg;
-}
-
-
-
-
-
-SVGRegisteredEventListener::SVGRegisteredEventListener(SVGEvent::EventId _id, SVGEventListener *_listener, bool _useCapture)
-{
- id = _id;
- listener = _listener;
- useCapture = _useCapture;
-
- listener->ref();
-}
-
-SVGRegisteredEventListener::~SVGRegisteredEventListener()
-{
- listener->deref();
-}
-
-bool SVGRegisteredEventListener::operator==(const SVGRegisteredEventListener &other)
-{
- return (id == other.id &&
- listener == other.listener &&
- useCapture == other.useCapture);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGEventImpl.cpp b/ksvg/impl/SVGEventImpl.cpp
new file mode 100644
index 00000000..9ff61abc
--- /dev/null
+++ b/ksvg/impl/SVGEventImpl.cpp
@@ -0,0 +1,990 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ Additional copyright:
+ (C) 2001 Peter Kelly <pmk@post.com>
+ (C) 2001 Tobias Anton <anton@stud.fbi.fh-darmstadt.de>
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDocumentImpl.h"
+#include "SVGEventImpl.h"
+
+#include <kdebug.h>
+
+using namespace KSVG;
+
+#include "ksvg_scriptinterpreter.h"
+#include "SVGEventImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGEventImpl::SVGEventImpl()
+{
+ m_canBubble = false;
+ m_cancelable = false;
+
+ m_propagationStopped = false;
+ m_defaultPrevented = false;
+ m_id = SVGEvent::UNKNOWN_EVENT;
+ m_eventPhase = 0;
+ m_createTime = TQDateTime::currentDateTime();
+ m_defaultHandled = false;
+
+ m_target = 0;
+ m_currentTarget = 0;
+}
+
+SVGEventImpl::SVGEventImpl(SVGEvent::EventId _id, bool canBubbleArg, bool cancelableArg)
+{
+ DOM::DOMString t = SVGEvent::idToType(_id);
+ m_type = t.implementation();
+
+ m_canBubble = canBubbleArg;
+ m_cancelable = cancelableArg;
+
+ m_propagationStopped = false;
+ m_defaultPrevented = false;
+ m_id = _id;
+ m_eventPhase = 0;
+ m_createTime = TQDateTime::currentDateTime();
+ m_defaultHandled = false;
+
+ m_target = 0;
+ m_currentTarget = 0;
+}
+
+SVGEventImpl::~SVGEventImpl()
+{
+}
+
+DOM::DOMString SVGEventImpl::type() const
+{
+ return m_type;
+}
+
+SVGElementImpl *SVGEventImpl::target() const
+{
+ return m_target;
+}
+
+void SVGEventImpl::setTarget(SVGElementImpl *_target)
+{
+ m_target = _target;
+}
+
+SVGElementImpl *SVGEventImpl::currentTarget() const
+{
+ return m_currentTarget;
+}
+
+void SVGEventImpl::setCurrentTarget(SVGElementImpl *_currentTarget)
+{
+ m_currentTarget = _currentTarget;
+}
+
+unsigned short SVGEventImpl::eventPhase() const
+{
+ return m_eventPhase;
+}
+
+void SVGEventImpl::setEventPhase(unsigned short _eventPhase)
+{
+ m_eventPhase = _eventPhase;
+}
+
+bool SVGEventImpl::bubbles() const
+{
+ return m_canBubble;
+}
+
+bool SVGEventImpl::cancelable() const
+{
+ return m_cancelable;
+}
+
+DOM::DOMTimeStamp SVGEventImpl::timeStamp()
+{
+ TQDateTime epoch(TQDate(1970, 1, 1), TQTime(0, 0));
+
+ // ### kjs does not yet support long long (?) so the value wraps around
+ return epoch.secsTo(m_createTime) * 1000 + m_createTime.time().msec();
+}
+
+void SVGEventImpl::stopPropagation()
+{
+ m_propagationStopped = true;
+}
+
+void SVGEventImpl::preventDefault()
+{
+ if(m_cancelable)
+ m_defaultPrevented = true;
+}
+
+void SVGEventImpl::initEvent(const DOM::DOMString &eventTypeArg, bool canBubbleArg, bool cancelableArg)
+{
+ // ### ensure this is not called after we have been dispatched (also for subclasses)
+ m_type = eventTypeArg.implementation();
+ m_id = SVGEvent::typeToId(eventTypeArg);
+
+ m_canBubble = canBubbleArg;
+ m_cancelable = cancelableArg;
+}
+
+void SVGEventImpl::setDefaultHandled()
+{
+ m_defaultHandled = true;
+}
+
+/*
+@namespace KSVG
+@begin SVGEventImpl::s_hashTable 11
+ type SVGEventImpl::Type DontDelete|ReadOnly
+ target SVGEventImpl::Target DontDelete|ReadOnly
+ currentTarget SVGEventImpl::CurrentTarget DontDelete|ReadOnly
+ eventPhase SVGEventImpl::EventPhase DontDelete|ReadOnly
+ bubbles SVGEventImpl::Bubbles DontDelete|ReadOnly
+ cancelable SVGEventImpl::Cancelable DontDelete|ReadOnly
+ timeStamp SVGEventImpl::TimeStamp DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGEventImplProto::s_hashTable 13
+ getType SVGEventImpl::GetType DontDelete|Function 0
+ getTarget SVGEventImpl::GetTarget DontDelete|Function 0
+ getCurrentTarget SVGEventImpl::GetCurrentTarget DontDelete|Function 0
+ getCurrentNode SVGEventImpl::GetCurrentNode DontDelete|Function 0
+ getEventphase SVGEventImpl::GetEventPhase DontDelete|Function 0
+ getBubbles SVGEventImpl::GetBubbles DontDelete|Function 0
+ getCancelable SVGEventImpl::GetCancelable DontDelete|Function 0
+ getTimeStamp SVGEventImpl::GetTimeStamp DontDelete|Function 0
+ stopPropagation SVGEventImpl::StopPropagation DontDelete|Function 0
+ preventDefault SVGEventImpl::PreventDefault DontDelete|Function 0
+ initEvent SVGEventImpl::InitEvent DontDelete|Function 3
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGEvent", SVGEventImplProto, SVGEventImplProtoFunc)
+
+Value SVGEventImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Type:
+ return String(type());
+ case Target:
+ return getDOMNode(exec, *target());
+ case CurrentTarget:
+ return getDOMNode(exec, *currentTarget());
+ case EventPhase:
+ return Number(eventPhase());
+ case Bubbles:
+ return Boolean(bubbles());
+ case Cancelable:
+ return Boolean(cancelable());
+// case TimeStamp: // TODO
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+Value SVGEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGEventImpl)
+
+ switch(id)
+ {
+ case SVGEventImpl::GetType:
+ return String(obj->type());
+ case SVGEventImpl::GetTarget:
+ return getDOMNode(exec, *obj->target());
+ case SVGEventImpl::GetCurrentTarget:
+ case SVGEventImpl::GetCurrentNode:
+ return getDOMNode(exec, *obj->currentTarget());
+ case SVGEventImpl::GetEventPhase:
+ return Number(obj->eventPhase());
+ case SVGEventImpl::GetBubbles:
+ return Boolean(obj->bubbles());
+ case SVGEventImpl::GetCancelable:
+ return Boolean(obj->cancelable());
+// case SVGEventImpl::GetTimeStamp: // TODO
+ case SVGEventImpl::StopPropagation:
+ {
+ obj->stopPropagation();
+ return Undefined();
+ }
+ case SVGEventImpl::PreventDefault:
+ {
+ obj->preventDefault();
+ return Undefined();
+ }
+ case SVGEventImpl::InitEvent:
+ {
+ obj->initEvent(args[0].toString(exec).string(), args[1].toBoolean(exec), args[2].toBoolean(exec));
+ return Undefined();
+ }
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+
+
+
+
+SVGUIEventImpl::SVGUIEventImpl() : SVGEventImpl()
+{
+ m_detail = 0;
+}
+
+SVGUIEventImpl::SVGUIEventImpl(SVGEvent::EventId _id, bool canBubbleArg, bool cancelableArg, DOM::AbstractView &viewArg, long detailArg)
+: SVGEventImpl(_id, canBubbleArg, cancelableArg)
+{
+ m_view = viewArg;
+ m_detail = detailArg;
+}
+
+SVGUIEventImpl::~SVGUIEventImpl()
+{
+}
+
+DOM::AbstractView SVGUIEventImpl::view() const
+{
+ return m_view;
+}
+
+long SVGUIEventImpl::detail() const
+{
+ return m_detail;
+}
+
+void SVGUIEventImpl::initUIEvent(const DOM::DOMString &typeArg,
+ bool canBubbleArg,
+ bool cancelableArg,
+ const DOM::AbstractView &viewArg,
+ long detailArg)
+{
+ SVGEventImpl::initEvent(typeArg, canBubbleArg, cancelableArg);
+
+ m_view = viewArg;
+ m_detail = detailArg;
+}
+
+/*
+@namespace KSVG
+@begin SVGUIEventImpl::s_hashTable 3
+ view SVGUIEventImpl::View DontDelete|ReadOnly
+ detail SVGUIEventImpl::Detail DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGUIEventImplProto::s_hashTable 5
+ getView SVGUIEventImpl::GetView DontDelete|Function 0
+ getDetail SVGUIEventImpl::GetDetail DontDelete|Function 0
+ initUIEvent SVGUIEventImpl::InitUIEvent DontDelete|Function 5
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGUIEvent", SVGUIEventImplProto, SVGUIEventImplProtoFunc)
+
+Value SVGUIEventImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+// case View: // TODO
+ case Detail:
+ return Number(detail());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+Value SVGUIEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
+{
+ KSVG_CHECK_THIS(SVGUIEventImpl)
+
+ switch(id)
+ {
+// case SVGUIEventImpl::GetView: // TODO
+ case SVGUIEventImpl::GetDetail:
+ return Number(obj->detail());
+// case SVGUIEventImpl::InitUIEvent: // TODO
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+SVGKeyEventImpl::SVGKeyEventImpl() : SVGUIEventImpl()
+{
+ qKeyEvent = 0;
+}
+
+SVGKeyEventImpl::SVGKeyEventImpl(TQKeyEvent *key, DOM::AbstractView &view, SVGEvent::EventId _id) : SVGUIEventImpl(_id, true, true, view, 0)
+{
+ qKeyEvent = new TQKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->isAutoRepeat(), key->count());
+
+ // Events are supposed to be accepted by default in TQt!
+ // This line made TQLineEdit's keyevents be ignored, so they were sent to the tdehtmlview
+ // (and e.g. space would make it scroll down)
+ //qKeyEvent->ignore();
+
+ m_detail = key->count();
+
+ m_numPad = false;
+ m_keyVal = 0;
+ m_virtKeyVal = DOM_VK_UNDEFINED;
+ m_inputGenerated = true;
+
+ switch(key->key())
+ {
+ case TQt::Key_Enter:
+ m_numPad = true;
+ /* fall through */
+ case TQt::Key_Return:
+ m_virtKeyVal = DOM_VK_ENTER;
+ break;
+ case TQt::Key_NumLock:
+ m_numPad = true;
+ m_virtKeyVal = DOM_VK_NUM_LOCK;
+ break;
+ case TQt::Key_Alt:
+ m_virtKeyVal = DOM_VK_RIGHT_ALT;
+ // ### DOM_VK_LEFT_ALT;
+ break;
+ case TQt::Key_Control:
+ m_virtKeyVal = DOM_VK_LEFT_CONTROL;
+ // ### DOM_VK_RIGHT_CONTROL
+ break;
+ case TQt::Key_Shift:
+ m_virtKeyVal = DOM_VK_LEFT_SHIFT;
+ // ### DOM_VK_RIGHT_SHIFT
+ break;
+ case TQt::Key_Meta:
+ m_virtKeyVal = DOM_VK_LEFT_META;
+ // ### DOM_VK_RIGHT_META
+ break;
+ case TQt::Key_CapsLock:
+ m_virtKeyVal = DOM_VK_CAPS_LOCK;
+ break;
+ case TQt::Key_Delete:
+ m_virtKeyVal = DOM_VK_DELETE;
+ break;
+ case TQt::Key_End:
+ m_virtKeyVal = DOM_VK_END;
+ break;
+ case TQt::Key_Escape:
+ m_virtKeyVal = DOM_VK_ESCAPE;
+ break;
+ case TQt::Key_Home:
+ m_virtKeyVal = DOM_VK_HOME;
+ break;
+ case TQt::Key_Insert:
+ m_virtKeyVal = DOM_VK_INSERT;
+ break;
+ case TQt::Key_Pause:
+ m_virtKeyVal = DOM_VK_PAUSE;
+ break;
+ case TQt::Key_Print:
+ m_virtKeyVal = DOM_VK_PRINTSCREEN;
+ break;
+ case TQt::Key_ScrollLock:
+ m_virtKeyVal = DOM_VK_SCROLL_LOCK;
+ break;
+ case TQt::Key_Left:
+ m_virtKeyVal = DOM_VK_LEFT;
+ break;
+ case TQt::Key_Right:
+ m_virtKeyVal = DOM_VK_RIGHT;
+ break;
+ case TQt::Key_Up:
+ m_virtKeyVal = DOM_VK_UP;
+ break;
+ case TQt::Key_Down:
+ m_virtKeyVal = DOM_VK_DOWN;
+ break;
+ case TQt::Key_Next:
+ m_virtKeyVal = DOM_VK_PAGE_DOWN;
+ break;
+ case TQt::Key_Prior:
+ m_virtKeyVal = DOM_VK_PAGE_UP;
+ break;
+ case TQt::Key_F1:
+ m_virtKeyVal = DOM_VK_F1;
+ break;
+ case TQt::Key_F2:
+ m_virtKeyVal = DOM_VK_F2;
+ break;
+ case TQt::Key_F3:
+ m_virtKeyVal = DOM_VK_F3;
+ break;
+ case TQt::Key_F4:
+ m_virtKeyVal = DOM_VK_F4;
+ break;
+ case TQt::Key_F5:
+ m_virtKeyVal = DOM_VK_F5;
+ break;
+ case TQt::Key_F6:
+ m_virtKeyVal = DOM_VK_F6;
+ break;
+ case TQt::Key_F7:
+ m_virtKeyVal = DOM_VK_F7;
+ break;
+ case TQt::Key_F8:
+ m_virtKeyVal = DOM_VK_F8;
+ break;
+ case TQt::Key_F9:
+ m_virtKeyVal = DOM_VK_F9;
+ break;
+ case TQt::Key_F10:
+ m_virtKeyVal = DOM_VK_F10;
+ break;
+ case TQt::Key_F11:
+ m_virtKeyVal = DOM_VK_F11;
+ break;
+ case TQt::Key_F12:
+ m_virtKeyVal = DOM_VK_F12;
+ break;
+ case TQt::Key_F13:
+ m_virtKeyVal = DOM_VK_F13;
+ break;
+ case TQt::Key_F14:
+ m_virtKeyVal = DOM_VK_F14;
+ break;
+ case TQt::Key_F15:
+ m_virtKeyVal = DOM_VK_F15;
+ break;
+ case TQt::Key_F16:
+ m_virtKeyVal = DOM_VK_F16;
+ break;
+ case TQt::Key_F17:
+ m_virtKeyVal = DOM_VK_F17;
+ break;
+ case TQt::Key_F18:
+ m_virtKeyVal = DOM_VK_F18;
+ break;
+ case TQt::Key_F19:
+ m_virtKeyVal = DOM_VK_F19;
+ break;
+ case TQt::Key_F20:
+ m_virtKeyVal = DOM_VK_F20;
+ break;
+ case TQt::Key_F21:
+ m_virtKeyVal = DOM_VK_F21;
+ break;
+ case TQt::Key_F22:
+ m_virtKeyVal = DOM_VK_F22;
+ break;
+ case TQt::Key_F23:
+ m_virtKeyVal = DOM_VK_F23;
+ break;
+ case TQt::Key_F24:
+ m_virtKeyVal = DOM_VK_F24;
+ break;
+ default:
+ m_virtKeyVal = DOM_VK_UNDEFINED;
+ break;
+ }
+
+ // m_keyVal should contain the unicode value
+ // of the pressed key if available.
+ if (!key->text().isNull())
+ m_keyVal = TQString(key->text()).unicode()[0];
+
+ // m_numPad = ???
+
+ // key->state returns enum ButtonState, which is ShiftButton, ControlButton and AltButton or'ed together.
+ m_modifier = key->state();
+
+ // key->text() returns the unicode sequence as a TQString
+ m_outputString = DOM::DOMString(key->text());
+}
+
+SVGKeyEventImpl::SVGKeyEventImpl(SVGEvent::EventId _id,
+ bool canBubbleArg,
+ bool cancelableArg,
+ DOM::AbstractView &viewArg,
+ unsigned short detailArg,
+ DOM::DOMString &outputStringArg,
+ unsigned long keyValArg,
+ unsigned long virtKeyValArg,
+ bool inputGeneratedArg,
+ bool numPadArg)
+: SVGUIEventImpl(_id, canBubbleArg, cancelableArg, viewArg, detailArg)
+{
+ qKeyEvent = 0;
+ m_keyVal = keyValArg;
+ m_virtKeyVal = virtKeyValArg;
+ m_inputGenerated = inputGeneratedArg;
+ m_outputString = outputStringArg;
+ m_numPad = numPadArg;
+ m_modifier = 0;
+}
+
+SVGKeyEventImpl::~SVGKeyEventImpl()
+{
+ delete qKeyEvent;
+}
+
+bool SVGKeyEventImpl::checkModifier(unsigned long modifierArg)
+{
+ return ((m_modifier && modifierArg) == modifierArg);
+}
+
+void SVGKeyEventImpl::initKeyEvent(DOM::DOMString &typeArg,
+ bool canBubbleArg,
+ bool cancelableArg,
+ const DOM::AbstractView &viewArg,
+ long detailArg,
+ DOM::DOMString &outputStringArg,
+ unsigned long keyValArg,
+ unsigned long virtKeyValArg,
+ bool inputGeneratedArg,
+ bool numPadArg)
+{
+ SVGUIEventImpl::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
+
+ m_outputString = outputStringArg;
+ m_keyVal = keyValArg;
+ m_virtKeyVal = virtKeyValArg;
+ m_inputGenerated = inputGeneratedArg;
+ m_numPad = numPadArg;
+}
+
+void SVGKeyEventImpl::initModifier(unsigned long modifierArg, bool valueArg)
+{
+ if(valueArg)
+ m_modifier |= modifierArg;
+ else
+ m_modifier &= (modifierArg ^ 0xFFFFFFFF);
+}
+
+bool SVGKeyEventImpl::inputGenerated() const
+{
+ return m_inputGenerated;
+}
+
+unsigned long SVGKeyEventImpl::keyVal() const
+{
+ return m_keyVal;
+}
+
+DOM::DOMString SVGKeyEventImpl::outputString() const
+{
+ return m_outputString;
+}
+
+/*
+@namespace KSVG
+@begin SVGKeyEventImpl::s_hashTable 7
+ keyVal SVGKeyEventImpl::KeyVal DontDelete|ReadOnly
+ keyCode SVGKeyEventImpl::KeyVal DontDelete|ReadOnly
+ charCode SVGKeyEventImpl::KeyVal DontDelete|ReadOnly
+ outputString SVGKeyEventImpl::OutputString DontDelete|ReadOnly
+ virtKeyVal SVGKeyEventImpl::VirtKeyVal DontDelete|ReadOnly
+# todo visibleOutputGenerated numPad
+@end
+@namespace KSVG
+@begin SVGKeyEventImplProto::s_hashTable 7
+ checkModifier SVGKeyEventImpl::CheckModifier DontDelete|Function 1
+ getKeyCode SVGKeyEventImpl::GetKeyVal DontDelete|Function 0
+ getCharCode SVGKeyEventImpl::GetKeyVal DontDelete|Function 0
+ getKeyVal SVGKeyEventImpl::GetKeyVal DontDelete|Function 0
+ getCharCode SVGKeyEventImpl::GetCharCode DontDelete|Function 0
+# todo initModifier
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGKeyEvent", SVGKeyEventImplProto, SVGKeyEventImplProtoFunc)
+
+Value SVGKeyEventImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case KeyVal:
+ return Number(keyVal());
+ case VirtKeyVal:
+ return Number(virtKeyVal());
+ case OutputString:
+ return String(outputString());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGKeyEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGKeyEventImpl)
+
+ switch(id)
+ {
+ case SVGKeyEventImpl::CheckModifier:
+ return Boolean((static_cast<KSVGBridge<SVGKeyEventImpl> *>(static_cast<ObjectImp *>(thisObj.imp()))->impl())->checkModifier(args[0].toUInt32(exec)));
+ case SVGKeyEventImpl::GetKeyVal:
+ case SVGKeyEventImpl::GetCharCode:
+ return Number((static_cast<KSVGBridge<SVGKeyEventImpl> *>(static_cast<ObjectImp *>(thisObj.imp()))->impl())->keyVal());
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+
+
+// -----------------------------------------------------------------------------
+
+SVGMouseEventImpl::SVGMouseEventImpl() : SVGUIEventImpl()
+{
+ m_screenX = 0;
+ m_screenY = 0;
+ m_clientX = 0;
+ m_clientY = 0;
+ m_ctrlKey = false;
+ m_altKey = false;
+ m_shiftKey = false;
+ m_metaKey = false;
+ m_button = 0;
+}
+
+SVGMouseEventImpl::SVGMouseEventImpl(SVGEvent::EventId _id,
+ bool canBubbleArg,
+ bool cancelableArg,
+ DOM::AbstractView &viewArg,
+ long detailArg,
+ long screenXArg,
+ long screenYArg,
+ long clientXArg,
+ long clientYArg,
+ bool ctrlKeyArg,
+ bool altKeyArg,
+ bool shiftKeyArg,
+ bool metaKeyArg,
+ unsigned short buttonArg,
+ SVGElementImpl *relatedTargetArg)
+: SVGUIEventImpl(_id, canBubbleArg, cancelableArg, viewArg, detailArg)
+{
+ m_screenX = screenXArg;
+ m_screenY = screenYArg;
+ m_clientX = clientXArg;
+ m_clientY = clientYArg;
+ m_ctrlKey = ctrlKeyArg;
+ m_altKey = altKeyArg;
+ m_shiftKey = shiftKeyArg;
+ m_metaKey = metaKeyArg;
+ m_button = buttonArg;
+ m_relatedTarget = relatedTargetArg;
+}
+
+SVGMouseEventImpl::~SVGMouseEventImpl()
+{
+}
+
+long SVGMouseEventImpl::screenX() const
+{
+ return m_screenX;
+}
+
+long SVGMouseEventImpl::screenY() const
+{
+ return m_screenY;
+}
+
+long SVGMouseEventImpl::clientX() const
+{
+ return m_clientX;
+}
+
+long SVGMouseEventImpl::clientY() const
+{
+ return m_clientY;
+}
+
+bool SVGMouseEventImpl::ctrlKey() const
+{
+ return m_ctrlKey;
+}
+
+bool SVGMouseEventImpl::shiftKey() const
+{
+ return m_shiftKey;
+}
+
+bool SVGMouseEventImpl::altKey() const
+{
+ return m_altKey;
+}
+
+bool SVGMouseEventImpl::metaKey() const
+{
+ return m_metaKey;
+}
+
+unsigned short SVGMouseEventImpl::button() const
+{
+ return m_button;
+}
+
+SVGElementImpl *SVGMouseEventImpl::relatedTarget() const
+{
+ return m_relatedTarget;
+}
+
+DOM::DOMString SVGMouseEventImpl::url() const
+{
+ return m_url;
+}
+
+void SVGMouseEventImpl::setURL(DOM::DOMString url)
+{
+ m_url = url;
+}
+
+void SVGMouseEventImpl::initMouseEvent(const DOM::DOMString &typeArg,
+ bool canBubbleArg,
+ bool cancelableArg,
+ const DOM::AbstractView &viewArg,
+ long detailArg,
+ long screenXArg,
+ long screenYArg,
+ long clientXArg,
+ long clientYArg,
+ bool ctrlKeyArg,
+ bool altKeyArg,
+ bool shiftKeyArg,
+ bool metaKeyArg,
+ unsigned short buttonArg,
+ SVGElementImpl *relatedTargetArg)
+{
+ SVGUIEventImpl::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
+
+ m_screenX = screenXArg;
+ m_screenY = screenYArg;
+ m_clientX = clientXArg;
+ m_clientY = clientYArg;
+ m_ctrlKey = ctrlKeyArg;
+ m_altKey = altKeyArg;
+ m_shiftKey = shiftKeyArg;
+ m_metaKey = metaKeyArg;
+ m_button = buttonArg;
+ m_relatedTarget = relatedTargetArg;
+}
+
+/*
+@namespace KSVG
+@begin SVGMouseEventImpl::s_hashTable 11
+ screenX SVGMouseEventImpl::ScreenX DontDelete|ReadOnly
+ screenY SVGMouseEventImpl::ScreenY DontDelete|ReadOnly
+ clientX SVGMouseEventImpl::ClientX DontDelete|ReadOnly
+ clientY SVGMouseEventImpl::ClientY DontDelete|ReadOnly
+ ctrlKey SVGMouseEventImpl::CtrlKey DontDelete|ReadOnly
+ shiftKey SVGMouseEventImpl::ShiftKey DontDelete|ReadOnly
+ altKey SVGMouseEventImpl::AltKey DontDelete|ReadOnly
+ metaKey SVGMouseEventImpl::MetaKey DontDelete|ReadOnly
+ button SVGMouseEventImpl::Button DontDelete|ReadOnly
+ relatedTarget SVGMouseEventImpl::RelatedTarget DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGMouseEventImplProto::s_hashTable 13
+ getScreenX SVGMouseEventImpl::GetScreenX DontDelete|Function 0
+ getScreenY SVGMouseEventImpl::GetScreenY DontDelete|Function 0
+ getClientX SVGMouseEventImpl::GetClientX DontDelete|Function 0
+ getClientY SVGMouseEventImpl::GetClientY DontDelete|Function 0
+ getCtrlKey SVGMouseEventImpl::GetCtrlKey DontDelete|Function 0
+ getShiftKey SVGMouseEventImpl::GetShiftKey DontDelete|Function 0
+ getAltKey SVGMouseEventImpl::GetAltKey DontDelete|Function 0
+ getMetaKey SVGMouseEventImpl::GetMetaKey DontDelete|Function 0
+ getButton SVGMouseEventImpl::GetButton DontDelete|Function 0
+ getRelatedTarget SVGMouseEventImpl::GetRelatedTarget DontDelete|Function 0
+ initMouseEvent SVGMouseEventImpl::InitMouseEvent DontDelete|Function 15
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGMouseEvent", SVGMouseEventImplProto, SVGMouseEventImplProtoFunc)
+
+Value SVGMouseEventImpl::getValueProperty(ExecState *exec, int token) const
+{
+ kdDebug(26004) << k_funcinfo << endl;
+ switch(token)
+ {
+ case ScreenX:
+ return Number(screenX());
+ case ScreenY:
+ return Number(screenY());
+ case ClientX:
+ return Number(clientX());
+ case ClientY:
+ return Number(clientY());
+ case CtrlKey:
+ return Number(ctrlKey());
+ case ShiftKey:
+ return Number(shiftKey());
+ case AltKey:
+ return Number(altKey());
+ case MetaKey:
+ return Number(metaKey());
+ case Button:
+ return Number(button());
+ case RelatedTarget:
+ return getDOMNode(exec, *relatedTarget());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+Value SVGMouseEventImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
+{
+ kdDebug(26004) << k_funcinfo << endl;
+ KSVG_CHECK_THIS(SVGMouseEventImpl)
+
+ switch(id)
+ {
+ case SVGMouseEventImpl::GetScreenX:
+ return Number(obj->screenX());
+ case SVGMouseEventImpl::GetScreenY:
+ return Number(obj->screenY());
+ case SVGMouseEventImpl::GetClientX:
+ return Number(obj->clientX());
+ case SVGMouseEventImpl::GetClientY:
+ return Number(obj->clientY());
+ case SVGMouseEventImpl::GetCtrlKey:
+ return Number(obj->ctrlKey());
+ case SVGMouseEventImpl::GetShiftKey:
+ return Number(obj->shiftKey());
+ case SVGMouseEventImpl::GetAltKey:
+ return Number(obj->altKey());
+ case SVGMouseEventImpl::GetMetaKey:
+ return Number(obj->metaKey());
+ case SVGMouseEventImpl::GetButton:
+ return Number(obj->button());
+ case SVGMouseEventImpl::GetRelatedTarget:
+ return getDOMNode(exec, *obj->relatedTarget());
+// case SVGMouseEventImpl::InitMouseEvent: // TODO
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+
+
+
+SVGMutationEventImpl::SVGMutationEventImpl() : SVGEventImpl()
+{
+ m_attrChange = 0;
+}
+
+SVGMutationEventImpl::SVGMutationEventImpl(SVGEvent::EventId _id,
+ bool canBubbleArg,
+ bool cancelableArg,
+ SVGElementImpl *relatedNodeArg,
+ const DOM::DOMString &prevValueArg,
+ const DOM::DOMString &newValueArg,
+ const DOM::DOMString &attrNameArg,
+ unsigned short attrChangeArg)
+: SVGEventImpl(_id, canBubbleArg, cancelableArg)
+{
+ m_relatedNode = relatedNodeArg;
+ m_prevValue = prevValueArg.implementation();
+ m_newValue = newValueArg.implementation();
+ m_attrName = attrNameArg.implementation();
+ m_attrChange = attrChangeArg;
+}
+
+SVGMutationEventImpl::~SVGMutationEventImpl()
+{
+}
+
+SVGElementImpl *SVGMutationEventImpl::relatedNode() const
+{
+ return m_relatedNode;
+}
+
+DOM::DOMString SVGMutationEventImpl::prevValue() const
+{
+ return m_prevValue;
+}
+
+DOM::DOMString SVGMutationEventImpl::newValue() const
+{
+ return m_newValue;
+}
+
+DOM::DOMString SVGMutationEventImpl::attrName() const
+{
+ return m_attrName;
+}
+
+unsigned short SVGMutationEventImpl::attrChange() const
+{
+ return m_attrChange;
+}
+
+void SVGMutationEventImpl::initMutationEvent(const DOM::DOMString &typeArg,
+ bool canBubbleArg,
+ bool cancelableArg,
+ SVGElementImpl *relatedNodeArg,
+ const DOM::DOMString &prevValueArg,
+ const DOM::DOMString &newValueArg,
+ const DOM::DOMString &attrNameArg,
+ unsigned short attrChangeArg)
+{
+ SVGEventImpl::initEvent(typeArg, canBubbleArg, cancelableArg);
+
+ m_relatedNode = relatedNodeArg;
+ m_prevValue = prevValueArg.implementation();
+ m_newValue = newValueArg.implementation();
+ m_attrName = attrNameArg.implementation();
+ m_attrChange = attrChangeArg;
+}
+
+
+
+
+
+SVGRegisteredEventListener::SVGRegisteredEventListener(SVGEvent::EventId _id, SVGEventListener *_listener, bool _useCapture)
+{
+ id = _id;
+ listener = _listener;
+ useCapture = _useCapture;
+
+ listener->ref();
+}
+
+SVGRegisteredEventListener::~SVGRegisteredEventListener()
+{
+ listener->deref();
+}
+
+bool SVGRegisteredEventListener::operator==(const SVGRegisteredEventListener &other)
+{
+ return (id == other.id &&
+ listener == other.listener &&
+ useCapture == other.useCapture);
+}
diff --git a/ksvg/impl/SVGEventImpl.h b/ksvg/impl/SVGEventImpl.h
index 2c70c0d2..8ae0ad11 100644
--- a/ksvg/impl/SVGEventImpl.h
+++ b/ksvg/impl/SVGEventImpl.h
@@ -464,5 +464,3 @@ KSVG_DEFINE_PROTOTYPE(SVGKeyEventImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGKeyEventImplProtoFunc, SVGKeyEventImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGExternalResourcesRequiredImpl.cc b/ksvg/impl/SVGExternalResourcesRequiredImpl.cc
deleted file mode 100644
index 90fd9141..00000000
--- a/ksvg/impl/SVGExternalResourcesRequiredImpl.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGAnimatedBooleanImpl.h"
-#include "SVGExternalResourcesRequiredImpl.h"
-
-using namespace KSVG;
-
-#include "SVGExternalResourcesRequiredImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGExternalResourcesRequiredImpl::SVGExternalResourcesRequiredImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_externalResourcesRequired = new SVGAnimatedBooleanImpl();
- m_externalResourcesRequired->ref();
-}
-
-SVGExternalResourcesRequiredImpl::~SVGExternalResourcesRequiredImpl()
-{
- if(m_externalResourcesRequired)
- m_externalResourcesRequired->deref();
-}
-
-SVGAnimatedBooleanImpl *SVGExternalResourcesRequiredImpl::externalResourcesRequired() const
-{
- return m_externalResourcesRequired;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGExternalResourcesRequiredImpl::s_hashTable 2
- externalResourcesRequired SVGExternalResourcesRequiredImpl::ExternalResourcesRequired DontDelete|ReadOnly
-@end
-*/
-
-Value SVGExternalResourcesRequiredImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case ExternalResourcesRequired:
- return m_externalResourcesRequired->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGExternalResourcesRequiredImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
- switch(token)
- {
- case ExternalResourcesRequired:
- m_externalResourcesRequired->setBaseVal(value.toBoolean(exec));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGExternalResourcesRequiredImpl.cpp b/ksvg/impl/SVGExternalResourcesRequiredImpl.cpp
new file mode 100644
index 00000000..0303a75b
--- /dev/null
+++ b/ksvg/impl/SVGExternalResourcesRequiredImpl.cpp
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGAnimatedBooleanImpl.h"
+#include "SVGExternalResourcesRequiredImpl.h"
+
+using namespace KSVG;
+
+#include "SVGExternalResourcesRequiredImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGExternalResourcesRequiredImpl::SVGExternalResourcesRequiredImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_externalResourcesRequired = new SVGAnimatedBooleanImpl();
+ m_externalResourcesRequired->ref();
+}
+
+SVGExternalResourcesRequiredImpl::~SVGExternalResourcesRequiredImpl()
+{
+ if(m_externalResourcesRequired)
+ m_externalResourcesRequired->deref();
+}
+
+SVGAnimatedBooleanImpl *SVGExternalResourcesRequiredImpl::externalResourcesRequired() const
+{
+ return m_externalResourcesRequired;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGExternalResourcesRequiredImpl::s_hashTable 2
+ externalResourcesRequired SVGExternalResourcesRequiredImpl::ExternalResourcesRequired DontDelete|ReadOnly
+@end
+*/
+
+Value SVGExternalResourcesRequiredImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case ExternalResourcesRequired:
+ return m_externalResourcesRequired->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGExternalResourcesRequiredImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+ switch(token)
+ {
+ case ExternalResourcesRequired:
+ m_externalResourcesRequired->setBaseVal(value.toBoolean(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGExternalResourcesRequiredImpl.h b/ksvg/impl/SVGExternalResourcesRequiredImpl.h
index 9c5b93eb..6427552b 100644
--- a/ksvg/impl/SVGExternalResourcesRequiredImpl.h
+++ b/ksvg/impl/SVGExternalResourcesRequiredImpl.h
@@ -55,5 +55,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEBlendElementImpl.cc b/ksvg/impl/SVGFEBlendElementImpl.cc
deleted file mode 100644
index 8b29cad5..00000000
--- a/ksvg/impl/SVGFEBlendElementImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEBlendElementImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-SVGFEBlendElementImpl::SVGFEBlendElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_in2 = new SVGAnimatedStringImpl();
- m_in2->ref();
-
- m_mode = new SVGAnimatedEnumerationImpl();
- m_mode->ref();
-}
-
-SVGFEBlendElementImpl::~SVGFEBlendElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_in2)
- m_in2->deref();
- if(m_mode)
- m_mode->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEBlendElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedStringImpl *SVGFEBlendElementImpl::in2() const
-{
- return m_in2;
-}
-
-SVGAnimatedEnumerationImpl *SVGFEBlendElementImpl::mode() const
-{
- return m_mode;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEBlendElementImpl.cpp b/ksvg/impl/SVGFEBlendElementImpl.cpp
new file mode 100644
index 00000000..cec9cb88
--- /dev/null
+++ b/ksvg/impl/SVGFEBlendElementImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEBlendElementImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+SVGFEBlendElementImpl::SVGFEBlendElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_in2 = new SVGAnimatedStringImpl();
+ m_in2->ref();
+
+ m_mode = new SVGAnimatedEnumerationImpl();
+ m_mode->ref();
+}
+
+SVGFEBlendElementImpl::~SVGFEBlendElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_in2)
+ m_in2->deref();
+ if(m_mode)
+ m_mode->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEBlendElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedStringImpl *SVGFEBlendElementImpl::in2() const
+{
+ return m_in2;
+}
+
+SVGAnimatedEnumerationImpl *SVGFEBlendElementImpl::mode() const
+{
+ return m_mode;
+}
diff --git a/ksvg/impl/SVGFEBlendElementImpl.h b/ksvg/impl/SVGFEBlendElementImpl.h
index 36aab059..4c6c065e 100644
--- a/ksvg/impl/SVGFEBlendElementImpl.h
+++ b/ksvg/impl/SVGFEBlendElementImpl.h
@@ -55,5 +55,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEColorMatrixElementImpl.cc b/ksvg/impl/SVGFEColorMatrixElementImpl.cc
deleted file mode 100644
index 14c68a56..00000000
--- a/ksvg/impl/SVGFEColorMatrixElementImpl.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedNumberListImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGFEColorMatrixElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEColorMatrixElementImpl::SVGFEColorMatrixElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_type = new SVGAnimatedEnumerationImpl();
- m_type->ref();
-
- m_values = new SVGAnimatedNumberListImpl();
- m_values->ref();
-}
-
-SVGFEColorMatrixElementImpl::~SVGFEColorMatrixElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_type)
- m_type->deref();
- if(m_values)
- m_values->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEColorMatrixElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedEnumerationImpl *SVGFEColorMatrixElementImpl::type() const
-{
- return m_type;
-}
-
-SVGAnimatedNumberListImpl *SVGFEColorMatrixElementImpl::values() const
-{
- return m_values;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEColorMatrixElementImpl.cpp b/ksvg/impl/SVGFEColorMatrixElementImpl.cpp
new file mode 100644
index 00000000..0bd0c542
--- /dev/null
+++ b/ksvg/impl/SVGFEColorMatrixElementImpl.cpp
@@ -0,0 +1,63 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberListImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGFEColorMatrixElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEColorMatrixElementImpl::SVGFEColorMatrixElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_type = new SVGAnimatedEnumerationImpl();
+ m_type->ref();
+
+ m_values = new SVGAnimatedNumberListImpl();
+ m_values->ref();
+}
+
+SVGFEColorMatrixElementImpl::~SVGFEColorMatrixElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_type)
+ m_type->deref();
+ if(m_values)
+ m_values->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEColorMatrixElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedEnumerationImpl *SVGFEColorMatrixElementImpl::type() const
+{
+ return m_type;
+}
+
+SVGAnimatedNumberListImpl *SVGFEColorMatrixElementImpl::values() const
+{
+ return m_values;
+}
diff --git a/ksvg/impl/SVGFEColorMatrixElementImpl.h b/ksvg/impl/SVGFEColorMatrixElementImpl.h
index b637690b..fec601f3 100644
--- a/ksvg/impl/SVGFEColorMatrixElementImpl.h
+++ b/ksvg/impl/SVGFEColorMatrixElementImpl.h
@@ -56,5 +56,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEComponentTransferElementImpl.cc b/ksvg/impl/SVGFEComponentTransferElementImpl.cc
deleted file mode 100644
index 71ee4629..00000000
--- a/ksvg/impl/SVGFEComponentTransferElementImpl.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGFEComponentTransferElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEComponentTransferElementImpl::SVGFEComponentTransferElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-}
-
-SVGFEComponentTransferElementImpl::~SVGFEComponentTransferElementImpl()
-{
- if(m_in1)
- m_in1->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEComponentTransferElementImpl::in1() const
-{
- return m_in1;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEComponentTransferElementImpl.cpp b/ksvg/impl/SVGFEComponentTransferElementImpl.cpp
new file mode 100644
index 00000000..cdc4a053
--- /dev/null
+++ b/ksvg/impl/SVGFEComponentTransferElementImpl.cpp
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGFEComponentTransferElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEComponentTransferElementImpl::SVGFEComponentTransferElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+}
+
+SVGFEComponentTransferElementImpl::~SVGFEComponentTransferElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEComponentTransferElementImpl::in1() const
+{
+ return m_in1;
+}
diff --git a/ksvg/impl/SVGFEComponentTransferElementImpl.h b/ksvg/impl/SVGFEComponentTransferElementImpl.h
index 21c0fd88..ed0abb66 100644
--- a/ksvg/impl/SVGFEComponentTransferElementImpl.h
+++ b/ksvg/impl/SVGFEComponentTransferElementImpl.h
@@ -50,5 +50,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFECompositeElementImpl.cc b/ksvg/impl/SVGFECompositeElementImpl.cc
deleted file mode 100644
index e8b91b95..00000000
--- a/ksvg/impl/SVGFECompositeElementImpl.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGFECompositeElementImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-SVGFECompositeElementImpl::SVGFECompositeElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_in2 = new SVGAnimatedStringImpl();
- m_in2->ref();
-
- m_operator = new SVGAnimatedEnumerationImpl();
- m_operator->ref();
-
- m_k1 = new SVGAnimatedNumberImpl();
- m_k1->ref();
-
- m_k2 = new SVGAnimatedNumberImpl();
- m_k2->ref();
-
- m_k3 = new SVGAnimatedNumberImpl();
- m_k3->ref();
-
- m_k4 = new SVGAnimatedNumberImpl();
- m_k4->ref();
-}
-
-SVGFECompositeElementImpl::~SVGFECompositeElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_in2)
- m_in2->deref();
- if(m_operator)
- m_operator->deref();
- if(m_k1)
- m_k1->deref();
- if(m_k2)
- m_k2->deref();
- if(m_k3)
- m_k3->deref();
- if(m_k4)
- m_k4->deref();
-}
-
-SVGAnimatedStringImpl *SVGFECompositeElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedStringImpl *SVGFECompositeElementImpl::in2() const
-{
- return m_in2;
-}
-
-SVGAnimatedEnumerationImpl *SVGFECompositeElementImpl::Operator() const
-{
- return m_operator;
-}
-
-SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k1() const
-{
- return m_k1;
-}
-
-SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k2() const
-{
- return m_k2;
-}
-
-SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k3() const
-{
- return m_k3;
-}
-
-SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k4() const
-{
- return m_k4;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFECompositeElementImpl.cpp b/ksvg/impl/SVGFECompositeElementImpl.cpp
new file mode 100644
index 00000000..0ddaed6e
--- /dev/null
+++ b/ksvg/impl/SVGFECompositeElementImpl.cpp
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGFECompositeElementImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+SVGFECompositeElementImpl::SVGFECompositeElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_in2 = new SVGAnimatedStringImpl();
+ m_in2->ref();
+
+ m_operator = new SVGAnimatedEnumerationImpl();
+ m_operator->ref();
+
+ m_k1 = new SVGAnimatedNumberImpl();
+ m_k1->ref();
+
+ m_k2 = new SVGAnimatedNumberImpl();
+ m_k2->ref();
+
+ m_k3 = new SVGAnimatedNumberImpl();
+ m_k3->ref();
+
+ m_k4 = new SVGAnimatedNumberImpl();
+ m_k4->ref();
+}
+
+SVGFECompositeElementImpl::~SVGFECompositeElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_in2)
+ m_in2->deref();
+ if(m_operator)
+ m_operator->deref();
+ if(m_k1)
+ m_k1->deref();
+ if(m_k2)
+ m_k2->deref();
+ if(m_k3)
+ m_k3->deref();
+ if(m_k4)
+ m_k4->deref();
+}
+
+SVGAnimatedStringImpl *SVGFECompositeElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedStringImpl *SVGFECompositeElementImpl::in2() const
+{
+ return m_in2;
+}
+
+SVGAnimatedEnumerationImpl *SVGFECompositeElementImpl::Operator() const
+{
+ return m_operator;
+}
+
+SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k1() const
+{
+ return m_k1;
+}
+
+SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k2() const
+{
+ return m_k2;
+}
+
+SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k3() const
+{
+ return m_k3;
+}
+
+SVGAnimatedNumberImpl *SVGFECompositeElementImpl::k4() const
+{
+ return m_k4;
+}
diff --git a/ksvg/impl/SVGFECompositeElementImpl.h b/ksvg/impl/SVGFECompositeElementImpl.h
index 10796ec1..6351d606 100644
--- a/ksvg/impl/SVGFECompositeElementImpl.h
+++ b/ksvg/impl/SVGFECompositeElementImpl.h
@@ -64,5 +64,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEConvolveMatrixElementImpl.cc b/ksvg/impl/SVGFEConvolveMatrixElementImpl.cc
deleted file mode 100644
index 88eb00ee..00000000
--- a/ksvg/impl/SVGFEConvolveMatrixElementImpl.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedIntegerImpl.h"
-#include "SVGAnimatedBooleanImpl.h"
-#include "SVGAnimatedIntegerImpl.h"
-#include "SVGAnimatedNumberListImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGFEConvolveMatrixElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEConvolveMatrixElementImpl::SVGFEConvolveMatrixElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_orderX = new SVGAnimatedIntegerImpl();
- m_orderX->ref();
-
- m_orderY = new SVGAnimatedIntegerImpl();
- m_orderY->ref();
-
- m_kernelMatrix = new SVGAnimatedNumberListImpl();
- m_kernelMatrix->ref();
-
- m_divisor = new SVGAnimatedNumberImpl();
- m_divisor->ref();
-
- m_bias = new SVGAnimatedNumberImpl();
- m_bias->ref();
-
- m_targetX = new SVGAnimatedIntegerImpl();
- m_targetX->ref();
-
- m_targetY = new SVGAnimatedIntegerImpl();
- m_targetY->ref();
-
- m_edgeMode = new SVGAnimatedEnumerationImpl();
- m_edgeMode->ref();
-
- m_kernelUnitLengthX = new SVGAnimatedLengthImpl();
- m_kernelUnitLengthX->ref();
-
- m_kernelUnitLengthY = new SVGAnimatedLengthImpl();
- m_kernelUnitLengthY->ref();
-
- m_preserveAlpha = new SVGAnimatedBooleanImpl();
- m_preserveAlpha->ref();
-}
-
-SVGFEConvolveMatrixElementImpl::~SVGFEConvolveMatrixElementImpl()
-{
- if(m_orderX)
- m_orderX->deref();
- if(m_orderY)
- m_orderY->deref();
- if(m_kernelMatrix)
- m_kernelMatrix->deref();
- if(m_divisor)
- m_divisor->deref();
- if(m_bias)
- m_bias->deref();
- if(m_targetX)
- m_targetX->deref();
- if(m_targetY)
- m_targetY->deref();
- if(m_edgeMode)
- m_edgeMode->deref();
- if(m_kernelUnitLengthX)
- m_kernelUnitLengthX->deref();
- if(m_kernelUnitLengthY)
- m_kernelUnitLengthY->deref();
- if(m_preserveAlpha)
- m_preserveAlpha->deref();
-}
-
-SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::orderX() const
-{
- return m_orderX;
-}
-
-SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::orderY() const
-{
- return m_orderY;
-}
-
-SVGAnimatedNumberListImpl *SVGFEConvolveMatrixElementImpl::kernelMatrix() const
-{
- return m_kernelMatrix;
-}
-
-SVGAnimatedNumberImpl *SVGFEConvolveMatrixElementImpl::divisor() const
-{
- return m_divisor;
-}
-
-SVGAnimatedNumberImpl *SVGFEConvolveMatrixElementImpl::bias() const
-{
- return m_bias;
-}
-
-SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::targetX() const
-{
- return m_targetX;
-}
-
-SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::targetY() const
-{
- return m_targetY;
-}
-
-SVGAnimatedEnumerationImpl *SVGFEConvolveMatrixElementImpl::edgeMode() const
-{
- return m_edgeMode;
-}
-
-SVGAnimatedLengthImpl *SVGFEConvolveMatrixElementImpl::kernelUnitLengthX() const
-{
- return m_kernelUnitLengthX;
-}
-
-SVGAnimatedLengthImpl *SVGFEConvolveMatrixElementImpl::kernelUnitLengthY() const
-{
- return m_kernelUnitLengthY;
-}
-
-SVGAnimatedBooleanImpl *SVGFEConvolveMatrixElementImpl::preserveAlpha() const
-{
- return m_preserveAlpha;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEConvolveMatrixElementImpl.cpp b/ksvg/impl/SVGFEConvolveMatrixElementImpl.cpp
new file mode 100644
index 00000000..4888eed7
--- /dev/null
+++ b/ksvg/impl/SVGFEConvolveMatrixElementImpl.cpp
@@ -0,0 +1,147 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedIntegerImpl.h"
+#include "SVGAnimatedBooleanImpl.h"
+#include "SVGAnimatedIntegerImpl.h"
+#include "SVGAnimatedNumberListImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGFEConvolveMatrixElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEConvolveMatrixElementImpl::SVGFEConvolveMatrixElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_orderX = new SVGAnimatedIntegerImpl();
+ m_orderX->ref();
+
+ m_orderY = new SVGAnimatedIntegerImpl();
+ m_orderY->ref();
+
+ m_kernelMatrix = new SVGAnimatedNumberListImpl();
+ m_kernelMatrix->ref();
+
+ m_divisor = new SVGAnimatedNumberImpl();
+ m_divisor->ref();
+
+ m_bias = new SVGAnimatedNumberImpl();
+ m_bias->ref();
+
+ m_targetX = new SVGAnimatedIntegerImpl();
+ m_targetX->ref();
+
+ m_targetY = new SVGAnimatedIntegerImpl();
+ m_targetY->ref();
+
+ m_edgeMode = new SVGAnimatedEnumerationImpl();
+ m_edgeMode->ref();
+
+ m_kernelUnitLengthX = new SVGAnimatedLengthImpl();
+ m_kernelUnitLengthX->ref();
+
+ m_kernelUnitLengthY = new SVGAnimatedLengthImpl();
+ m_kernelUnitLengthY->ref();
+
+ m_preserveAlpha = new SVGAnimatedBooleanImpl();
+ m_preserveAlpha->ref();
+}
+
+SVGFEConvolveMatrixElementImpl::~SVGFEConvolveMatrixElementImpl()
+{
+ if(m_orderX)
+ m_orderX->deref();
+ if(m_orderY)
+ m_orderY->deref();
+ if(m_kernelMatrix)
+ m_kernelMatrix->deref();
+ if(m_divisor)
+ m_divisor->deref();
+ if(m_bias)
+ m_bias->deref();
+ if(m_targetX)
+ m_targetX->deref();
+ if(m_targetY)
+ m_targetY->deref();
+ if(m_edgeMode)
+ m_edgeMode->deref();
+ if(m_kernelUnitLengthX)
+ m_kernelUnitLengthX->deref();
+ if(m_kernelUnitLengthY)
+ m_kernelUnitLengthY->deref();
+ if(m_preserveAlpha)
+ m_preserveAlpha->deref();
+}
+
+SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::orderX() const
+{
+ return m_orderX;
+}
+
+SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::orderY() const
+{
+ return m_orderY;
+}
+
+SVGAnimatedNumberListImpl *SVGFEConvolveMatrixElementImpl::kernelMatrix() const
+{
+ return m_kernelMatrix;
+}
+
+SVGAnimatedNumberImpl *SVGFEConvolveMatrixElementImpl::divisor() const
+{
+ return m_divisor;
+}
+
+SVGAnimatedNumberImpl *SVGFEConvolveMatrixElementImpl::bias() const
+{
+ return m_bias;
+}
+
+SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::targetX() const
+{
+ return m_targetX;
+}
+
+SVGAnimatedIntegerImpl *SVGFEConvolveMatrixElementImpl::targetY() const
+{
+ return m_targetY;
+}
+
+SVGAnimatedEnumerationImpl *SVGFEConvolveMatrixElementImpl::edgeMode() const
+{
+ return m_edgeMode;
+}
+
+SVGAnimatedLengthImpl *SVGFEConvolveMatrixElementImpl::kernelUnitLengthX() const
+{
+ return m_kernelUnitLengthX;
+}
+
+SVGAnimatedLengthImpl *SVGFEConvolveMatrixElementImpl::kernelUnitLengthY() const
+{
+ return m_kernelUnitLengthY;
+}
+
+SVGAnimatedBooleanImpl *SVGFEConvolveMatrixElementImpl::preserveAlpha() const
+{
+ return m_preserveAlpha;
+}
diff --git a/ksvg/impl/SVGFEConvolveMatrixElementImpl.h b/ksvg/impl/SVGFEConvolveMatrixElementImpl.h
index e26518d5..fed30da7 100644
--- a/ksvg/impl/SVGFEConvolveMatrixElementImpl.h
+++ b/ksvg/impl/SVGFEConvolveMatrixElementImpl.h
@@ -76,5 +76,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEDiffuseLightingElementImpl.cc b/ksvg/impl/SVGFEDiffuseLightingElementImpl.cc
deleted file mode 100644
index 0b5c2565..00000000
--- a/ksvg/impl/SVGFEDiffuseLightingElementImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFEDiffuseLightingElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEDiffuseLightingElementImpl::SVGFEDiffuseLightingElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_surfaceScale = new SVGAnimatedNumberImpl();
- m_surfaceScale->ref();
-
- m_diffuseConstant = new SVGAnimatedNumberImpl();
- m_diffuseConstant->ref();
-}
-
-SVGFEDiffuseLightingElementImpl::~SVGFEDiffuseLightingElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_surfaceScale)
- m_surfaceScale->deref();
- if(m_diffuseConstant)
- m_diffuseConstant->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEDiffuseLightingElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedNumberImpl *SVGFEDiffuseLightingElementImpl::surfaceScale() const
-{
- return m_surfaceScale;
-}
-
-SVGAnimatedNumberImpl *SVGFEDiffuseLightingElementImpl::diffuseConstant() const
-{
- return m_diffuseConstant;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEDiffuseLightingElementImpl.cpp b/ksvg/impl/SVGFEDiffuseLightingElementImpl.cpp
new file mode 100644
index 00000000..151b02bf
--- /dev/null
+++ b/ksvg/impl/SVGFEDiffuseLightingElementImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFEDiffuseLightingElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEDiffuseLightingElementImpl::SVGFEDiffuseLightingElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_surfaceScale = new SVGAnimatedNumberImpl();
+ m_surfaceScale->ref();
+
+ m_diffuseConstant = new SVGAnimatedNumberImpl();
+ m_diffuseConstant->ref();
+}
+
+SVGFEDiffuseLightingElementImpl::~SVGFEDiffuseLightingElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_surfaceScale)
+ m_surfaceScale->deref();
+ if(m_diffuseConstant)
+ m_diffuseConstant->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEDiffuseLightingElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedNumberImpl *SVGFEDiffuseLightingElementImpl::surfaceScale() const
+{
+ return m_surfaceScale;
+}
+
+SVGAnimatedNumberImpl *SVGFEDiffuseLightingElementImpl::diffuseConstant() const
+{
+ return m_diffuseConstant;
+}
diff --git a/ksvg/impl/SVGFEDiffuseLightingElementImpl.h b/ksvg/impl/SVGFEDiffuseLightingElementImpl.h
index 0be4f7f1..f5cdd22f 100644
--- a/ksvg/impl/SVGFEDiffuseLightingElementImpl.h
+++ b/ksvg/impl/SVGFEDiffuseLightingElementImpl.h
@@ -55,5 +55,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEDisplacementMapElementImpl.cc b/ksvg/impl/SVGFEDisplacementMapElementImpl.cc
deleted file mode 100644
index 92665ec7..00000000
--- a/ksvg/impl/SVGFEDisplacementMapElementImpl.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGFEDisplacementMapElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEDisplacementMapElementImpl::SVGFEDisplacementMapElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_in2 = new SVGAnimatedStringImpl();
- m_in2->ref();
-
- m_scale = new SVGAnimatedNumberImpl();
- m_scale->ref();
-
- m_xChannelSelector = new SVGAnimatedEnumerationImpl();
- m_xChannelSelector->ref();
-
- m_yChannelSelector = new SVGAnimatedEnumerationImpl();
- m_yChannelSelector->ref();
-}
-
-SVGFEDisplacementMapElementImpl::~SVGFEDisplacementMapElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_in2)
- m_in2->deref();
- if(m_scale)
- m_scale->deref();
- if(m_xChannelSelector)
- m_xChannelSelector->deref();
- if(m_yChannelSelector)
- m_yChannelSelector->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEDisplacementMapElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedStringImpl *SVGFEDisplacementMapElementImpl::in2() const
-{
- return m_in2;
-}
-
-SVGAnimatedNumberImpl *SVGFEDisplacementMapElementImpl::scale() const
-{
- return m_scale;
-}
-
-SVGAnimatedEnumerationImpl *SVGFEDisplacementMapElementImpl::xChannelSelector() const
-{
- return m_xChannelSelector;
-}
-
-SVGAnimatedEnumerationImpl *SVGFEDisplacementMapElementImpl::yChannelSelector() const
-{
- return m_yChannelSelector;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEDisplacementMapElementImpl.cpp b/ksvg/impl/SVGFEDisplacementMapElementImpl.cpp
new file mode 100644
index 00000000..6bdd9aea
--- /dev/null
+++ b/ksvg/impl/SVGFEDisplacementMapElementImpl.cpp
@@ -0,0 +1,83 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGFEDisplacementMapElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEDisplacementMapElementImpl::SVGFEDisplacementMapElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_in2 = new SVGAnimatedStringImpl();
+ m_in2->ref();
+
+ m_scale = new SVGAnimatedNumberImpl();
+ m_scale->ref();
+
+ m_xChannelSelector = new SVGAnimatedEnumerationImpl();
+ m_xChannelSelector->ref();
+
+ m_yChannelSelector = new SVGAnimatedEnumerationImpl();
+ m_yChannelSelector->ref();
+}
+
+SVGFEDisplacementMapElementImpl::~SVGFEDisplacementMapElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_in2)
+ m_in2->deref();
+ if(m_scale)
+ m_scale->deref();
+ if(m_xChannelSelector)
+ m_xChannelSelector->deref();
+ if(m_yChannelSelector)
+ m_yChannelSelector->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEDisplacementMapElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedStringImpl *SVGFEDisplacementMapElementImpl::in2() const
+{
+ return m_in2;
+}
+
+SVGAnimatedNumberImpl *SVGFEDisplacementMapElementImpl::scale() const
+{
+ return m_scale;
+}
+
+SVGAnimatedEnumerationImpl *SVGFEDisplacementMapElementImpl::xChannelSelector() const
+{
+ return m_xChannelSelector;
+}
+
+SVGAnimatedEnumerationImpl *SVGFEDisplacementMapElementImpl::yChannelSelector() const
+{
+ return m_yChannelSelector;
+}
diff --git a/ksvg/impl/SVGFEDisplacementMapElementImpl.h b/ksvg/impl/SVGFEDisplacementMapElementImpl.h
index 3774b6cc..22235064 100644
--- a/ksvg/impl/SVGFEDisplacementMapElementImpl.h
+++ b/ksvg/impl/SVGFEDisplacementMapElementImpl.h
@@ -60,5 +60,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEDistantLightElementImpl.cc b/ksvg/impl/SVGFEDistantLightElementImpl.cc
deleted file mode 100644
index b40885e0..00000000
--- a/ksvg/impl/SVGFEDistantLightElementImpl.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFEDistantLightElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEDistantLightElementImpl::SVGFEDistantLightElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- m_azimuth = new SVGAnimatedNumberImpl();
- m_azimuth->ref();
-
- m_elevation = new SVGAnimatedNumberImpl();
- m_elevation->ref();
-}
-
-SVGFEDistantLightElementImpl::~SVGFEDistantLightElementImpl()
-{
- if(m_azimuth)
- m_azimuth->deref();
- if(m_elevation)
- m_elevation->deref();
-}
-
-SVGAnimatedNumberImpl *SVGFEDistantLightElementImpl::azimuth() const
-{
- return m_azimuth;
-}
-
-SVGAnimatedNumberImpl *SVGFEDistantLightElementImpl::elevation() const
-{
- return m_elevation;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEDistantLightElementImpl.cpp b/ksvg/impl/SVGFEDistantLightElementImpl.cpp
new file mode 100644
index 00000000..f9556ab1
--- /dev/null
+++ b/ksvg/impl/SVGFEDistantLightElementImpl.cpp
@@ -0,0 +1,51 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFEDistantLightElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEDistantLightElementImpl::SVGFEDistantLightElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ m_azimuth = new SVGAnimatedNumberImpl();
+ m_azimuth->ref();
+
+ m_elevation = new SVGAnimatedNumberImpl();
+ m_elevation->ref();
+}
+
+SVGFEDistantLightElementImpl::~SVGFEDistantLightElementImpl()
+{
+ if(m_azimuth)
+ m_azimuth->deref();
+ if(m_elevation)
+ m_elevation->deref();
+}
+
+SVGAnimatedNumberImpl *SVGFEDistantLightElementImpl::azimuth() const
+{
+ return m_azimuth;
+}
+
+SVGAnimatedNumberImpl *SVGFEDistantLightElementImpl::elevation() const
+{
+ return m_elevation;
+}
diff --git a/ksvg/impl/SVGFEDistantLightElementImpl.h b/ksvg/impl/SVGFEDistantLightElementImpl.h
index 4d995a44..ed864e31 100644
--- a/ksvg/impl/SVGFEDistantLightElementImpl.h
+++ b/ksvg/impl/SVGFEDistantLightElementImpl.h
@@ -50,5 +50,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFloodElementImpl.cc b/ksvg/impl/SVGFEFloodElementImpl.cc
deleted file mode 100644
index 7cbecafd..00000000
--- a/ksvg/impl/SVGFEFloodElementImpl.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFloodElementImpl.h"
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-SVGFEFloodElementImpl::SVGFEFloodElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-}
-
-SVGFEFloodElementImpl::~SVGFEFloodElementImpl()
-{
- if(m_in1)
- m_in1->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEFloodElementImpl::in1() const
-{
- return m_in1;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFloodElementImpl.cpp b/ksvg/impl/SVGFEFloodElementImpl.cpp
new file mode 100644
index 00000000..15d74945
--- /dev/null
+++ b/ksvg/impl/SVGFEFloodElementImpl.cpp
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFloodElementImpl.h"
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+SVGFEFloodElementImpl::SVGFEFloodElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+}
+
+SVGFEFloodElementImpl::~SVGFEFloodElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEFloodElementImpl::in1() const
+{
+ return m_in1;
+}
diff --git a/ksvg/impl/SVGFEFloodElementImpl.h b/ksvg/impl/SVGFEFloodElementImpl.h
index 858959a9..a7654abe 100644
--- a/ksvg/impl/SVGFEFloodElementImpl.h
+++ b/ksvg/impl/SVGFEFloodElementImpl.h
@@ -52,5 +52,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncAElementImpl.cc b/ksvg/impl/SVGFEFuncAElementImpl.cc
deleted file mode 100644
index c7a535fa..00000000
--- a/ksvg/impl/SVGFEFuncAElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncAElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncAElementImpl::SVGFEFuncAElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
-{
-}
-
-SVGFEFuncAElementImpl::~SVGFEFuncAElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncAElementImpl.cpp b/ksvg/impl/SVGFEFuncAElementImpl.cpp
new file mode 100644
index 00000000..7afec020
--- /dev/null
+++ b/ksvg/impl/SVGFEFuncAElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncAElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncAElementImpl::SVGFEFuncAElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
+{
+}
+
+SVGFEFuncAElementImpl::~SVGFEFuncAElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFEFuncAElementImpl.h b/ksvg/impl/SVGFEFuncAElementImpl.h
index 7999c7e2..2afbcfa2 100644
--- a/ksvg/impl/SVGFEFuncAElementImpl.h
+++ b/ksvg/impl/SVGFEFuncAElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncBElementImpl.cc b/ksvg/impl/SVGFEFuncBElementImpl.cc
deleted file mode 100644
index 4b0bbf71..00000000
--- a/ksvg/impl/SVGFEFuncBElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncBElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncBElementImpl::SVGFEFuncBElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
-{
-}
-
-SVGFEFuncBElementImpl::~SVGFEFuncBElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncBElementImpl.cpp b/ksvg/impl/SVGFEFuncBElementImpl.cpp
new file mode 100644
index 00000000..4c38afb6
--- /dev/null
+++ b/ksvg/impl/SVGFEFuncBElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncBElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncBElementImpl::SVGFEFuncBElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
+{
+}
+
+SVGFEFuncBElementImpl::~SVGFEFuncBElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFEFuncBElementImpl.h b/ksvg/impl/SVGFEFuncBElementImpl.h
index 7236debb..bb5944f1 100644
--- a/ksvg/impl/SVGFEFuncBElementImpl.h
+++ b/ksvg/impl/SVGFEFuncBElementImpl.h
@@ -41,5 +41,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncGElementImpl.cc b/ksvg/impl/SVGFEFuncGElementImpl.cc
deleted file mode 100644
index 8a60fbee..00000000
--- a/ksvg/impl/SVGFEFuncGElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncGElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncGElementImpl::SVGFEFuncGElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
-{
-}
-
-SVGFEFuncGElementImpl::~SVGFEFuncGElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncGElementImpl.cpp b/ksvg/impl/SVGFEFuncGElementImpl.cpp
new file mode 100644
index 00000000..67712b9b
--- /dev/null
+++ b/ksvg/impl/SVGFEFuncGElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncGElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncGElementImpl::SVGFEFuncGElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
+{
+}
+
+SVGFEFuncGElementImpl::~SVGFEFuncGElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFEFuncGElementImpl.h b/ksvg/impl/SVGFEFuncGElementImpl.h
index 44baec8d..1fbf6d88 100644
--- a/ksvg/impl/SVGFEFuncGElementImpl.h
+++ b/ksvg/impl/SVGFEFuncGElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncRElementImpl.cc b/ksvg/impl/SVGFEFuncRElementImpl.cc
deleted file mode 100644
index fe1b2d44..00000000
--- a/ksvg/impl/SVGFEFuncRElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEFuncRElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEFuncRElementImpl::SVGFEFuncRElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
-{
-}
-
-SVGFEFuncRElementImpl::~SVGFEFuncRElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEFuncRElementImpl.cpp b/ksvg/impl/SVGFEFuncRElementImpl.cpp
new file mode 100644
index 00000000..703eae13
--- /dev/null
+++ b/ksvg/impl/SVGFEFuncRElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEFuncRElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEFuncRElementImpl::SVGFEFuncRElementImpl(DOM::ElementImpl *impl) : SVGComponentTransferFunctionElementImpl(impl)
+{
+}
+
+SVGFEFuncRElementImpl::~SVGFEFuncRElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFEFuncRElementImpl.h b/ksvg/impl/SVGFEFuncRElementImpl.h
index 17aa7812..33b9a63e 100644
--- a/ksvg/impl/SVGFEFuncRElementImpl.h
+++ b/ksvg/impl/SVGFEFuncRElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEGaussianBlurElementImpl.cc b/ksvg/impl/SVGFEGaussianBlurElementImpl.cc
deleted file mode 100644
index bcc2e0bf..00000000
--- a/ksvg/impl/SVGFEGaussianBlurElementImpl.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFEGaussianBlurElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEGaussianBlurElementImpl::SVGFEGaussianBlurElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_stdDeviationX = new SVGAnimatedNumberImpl();
- m_stdDeviationX->ref();
-
- m_stdDeviationY = new SVGAnimatedNumberImpl();
- m_stdDeviationY->ref();
-}
-
-SVGFEGaussianBlurElementImpl::~SVGFEGaussianBlurElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_stdDeviationX)
- m_stdDeviationX->deref();
- if(m_stdDeviationY)
- m_stdDeviationY->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEGaussianBlurElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedNumberImpl *SVGFEGaussianBlurElementImpl::stdDeviationX() const
-{
- return m_stdDeviationX;
-}
-
-SVGAnimatedNumberImpl *SVGFEGaussianBlurElementImpl::stdDeviationY() const
-{
- return m_stdDeviationY;
-}
-
-void SVGFEGaussianBlurElementImpl::setStdDeviation(float /*stdDeviationX*/, float /*stdDeviationY*/)
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEGaussianBlurElementImpl.cpp b/ksvg/impl/SVGFEGaussianBlurElementImpl.cpp
new file mode 100644
index 00000000..1c10d564
--- /dev/null
+++ b/ksvg/impl/SVGFEGaussianBlurElementImpl.cpp
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFEGaussianBlurElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEGaussianBlurElementImpl::SVGFEGaussianBlurElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_stdDeviationX = new SVGAnimatedNumberImpl();
+ m_stdDeviationX->ref();
+
+ m_stdDeviationY = new SVGAnimatedNumberImpl();
+ m_stdDeviationY->ref();
+}
+
+SVGFEGaussianBlurElementImpl::~SVGFEGaussianBlurElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_stdDeviationX)
+ m_stdDeviationX->deref();
+ if(m_stdDeviationY)
+ m_stdDeviationY->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEGaussianBlurElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedNumberImpl *SVGFEGaussianBlurElementImpl::stdDeviationX() const
+{
+ return m_stdDeviationX;
+}
+
+SVGAnimatedNumberImpl *SVGFEGaussianBlurElementImpl::stdDeviationY() const
+{
+ return m_stdDeviationY;
+}
+
+void SVGFEGaussianBlurElementImpl::setStdDeviation(float /*stdDeviationX*/, float /*stdDeviationY*/)
+{
+}
diff --git a/ksvg/impl/SVGFEGaussianBlurElementImpl.h b/ksvg/impl/SVGFEGaussianBlurElementImpl.h
index 97707edb..48b660ce 100644
--- a/ksvg/impl/SVGFEGaussianBlurElementImpl.h
+++ b/ksvg/impl/SVGFEGaussianBlurElementImpl.h
@@ -56,5 +56,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEImageElementImpl.cc b/ksvg/impl/SVGFEImageElementImpl.cc
deleted file mode 100644
index f41e482d..00000000
--- a/ksvg/impl/SVGFEImageElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEImageElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEImageElementImpl::SVGFEImageElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGFilterPrimitiveStandardAttributesImpl()
-{
-}
-
-SVGFEImageElementImpl::~SVGFEImageElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEImageElementImpl.cpp b/ksvg/impl/SVGFEImageElementImpl.cpp
new file mode 100644
index 00000000..4bcd64ed
--- /dev/null
+++ b/ksvg/impl/SVGFEImageElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEImageElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEImageElementImpl::SVGFEImageElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGFilterPrimitiveStandardAttributesImpl()
+{
+}
+
+SVGFEImageElementImpl::~SVGFEImageElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFEImageElementImpl.h b/ksvg/impl/SVGFEImageElementImpl.h
index 3d03e77d..69cdfd26 100644
--- a/ksvg/impl/SVGFEImageElementImpl.h
+++ b/ksvg/impl/SVGFEImageElementImpl.h
@@ -52,5 +52,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEMergeElementImpl.cc b/ksvg/impl/SVGFEMergeElementImpl.cc
deleted file mode 100644
index 6eca907a..00000000
--- a/ksvg/impl/SVGFEMergeElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFEMergeElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEMergeElementImpl::SVGFEMergeElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
-}
-
-SVGFEMergeElementImpl::~SVGFEMergeElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEMergeElementImpl.cpp b/ksvg/impl/SVGFEMergeElementImpl.cpp
new file mode 100644
index 00000000..fb188bae
--- /dev/null
+++ b/ksvg/impl/SVGFEMergeElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFEMergeElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEMergeElementImpl::SVGFEMergeElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+}
+
+SVGFEMergeElementImpl::~SVGFEMergeElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFEMergeElementImpl.h b/ksvg/impl/SVGFEMergeElementImpl.h
index f4b6aaaf..af509fc1 100644
--- a/ksvg/impl/SVGFEMergeElementImpl.h
+++ b/ksvg/impl/SVGFEMergeElementImpl.h
@@ -44,5 +44,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEMergeNodeElementImpl.cc b/ksvg/impl/SVGFEMergeNodeElementImpl.cc
deleted file mode 100644
index 1191df3b..00000000
--- a/ksvg/impl/SVGFEMergeNodeElementImpl.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGFEMergeNodeElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEMergeNodeElementImpl::SVGFEMergeNodeElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-}
-
-SVGFEMergeNodeElementImpl::~SVGFEMergeNodeElementImpl()
-{
- if(m_in1)
- m_in1->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEMergeNodeElementImpl::in1() const
-{
- return m_in1;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEMergeNodeElementImpl.cpp b/ksvg/impl/SVGFEMergeNodeElementImpl.cpp
new file mode 100644
index 00000000..13f6eefe
--- /dev/null
+++ b/ksvg/impl/SVGFEMergeNodeElementImpl.cpp
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGFEMergeNodeElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEMergeNodeElementImpl::SVGFEMergeNodeElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+}
+
+SVGFEMergeNodeElementImpl::~SVGFEMergeNodeElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEMergeNodeElementImpl::in1() const
+{
+ return m_in1;
+}
diff --git a/ksvg/impl/SVGFEMergeNodeElementImpl.h b/ksvg/impl/SVGFEMergeNodeElementImpl.h
index 5b380757..ced0947b 100644
--- a/ksvg/impl/SVGFEMergeNodeElementImpl.h
+++ b/ksvg/impl/SVGFEMergeNodeElementImpl.h
@@ -48,5 +48,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEMorphologyElementImpl.cc b/ksvg/impl/SVGFEMorphologyElementImpl.cc
deleted file mode 100644
index e7f1a100..00000000
--- a/ksvg/impl/SVGFEMorphologyElementImpl.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGFEMorphologyElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEMorphologyElementImpl::SVGFEMorphologyElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_operator = new SVGAnimatedEnumerationImpl();
- m_operator->ref();
-
- m_radiusX = new SVGAnimatedLengthImpl();
- m_radiusX->ref();
-
- m_radiusY = new SVGAnimatedLengthImpl();
- m_radiusY->ref();
-}
-
-SVGFEMorphologyElementImpl::~SVGFEMorphologyElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_operator)
- m_operator->deref();
- if(m_radiusX)
- m_radiusX->deref();
- if(m_radiusY)
- m_radiusY->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEMorphologyElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedEnumerationImpl *SVGFEMorphologyElementImpl::Operator() const
-{
- return m_operator;
-}
-
-SVGAnimatedLengthImpl *SVGFEMorphologyElementImpl::radiusX() const
-{
- return m_radiusX;
-}
-
-SVGAnimatedLengthImpl *SVGFEMorphologyElementImpl::radiusY() const
-{
- return m_radiusY;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEMorphologyElementImpl.cpp b/ksvg/impl/SVGFEMorphologyElementImpl.cpp
new file mode 100644
index 00000000..373d0b08
--- /dev/null
+++ b/ksvg/impl/SVGFEMorphologyElementImpl.cpp
@@ -0,0 +1,73 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGFEMorphologyElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEMorphologyElementImpl::SVGFEMorphologyElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_operator = new SVGAnimatedEnumerationImpl();
+ m_operator->ref();
+
+ m_radiusX = new SVGAnimatedLengthImpl();
+ m_radiusX->ref();
+
+ m_radiusY = new SVGAnimatedLengthImpl();
+ m_radiusY->ref();
+}
+
+SVGFEMorphologyElementImpl::~SVGFEMorphologyElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_operator)
+ m_operator->deref();
+ if(m_radiusX)
+ m_radiusX->deref();
+ if(m_radiusY)
+ m_radiusY->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEMorphologyElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedEnumerationImpl *SVGFEMorphologyElementImpl::Operator() const
+{
+ return m_operator;
+}
+
+SVGAnimatedLengthImpl *SVGFEMorphologyElementImpl::radiusX() const
+{
+ return m_radiusX;
+}
+
+SVGAnimatedLengthImpl *SVGFEMorphologyElementImpl::radiusY() const
+{
+ return m_radiusY;
+}
diff --git a/ksvg/impl/SVGFEMorphologyElementImpl.h b/ksvg/impl/SVGFEMorphologyElementImpl.h
index 7941e772..1838cb19 100644
--- a/ksvg/impl/SVGFEMorphologyElementImpl.h
+++ b/ksvg/impl/SVGFEMorphologyElementImpl.h
@@ -58,5 +58,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEOffsetElementImpl.cc b/ksvg/impl/SVGFEOffsetElementImpl.cc
deleted file mode 100644
index 8c8bfbeb..00000000
--- a/ksvg/impl/SVGFEOffsetElementImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFEOffsetElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEOffsetElementImpl::SVGFEOffsetElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_dx = new SVGAnimatedNumberImpl();
- m_dx->ref();
-
- m_dy = new SVGAnimatedNumberImpl();
- m_dy->ref();
-}
-
-SVGFEOffsetElementImpl::~SVGFEOffsetElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_dx)
- m_dx->deref();
- if(m_dy)
- m_dy->deref();
-}
-
-SVGAnimatedStringImpl *SVGFEOffsetElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedNumberImpl *SVGFEOffsetElementImpl::dx() const
-{
- return m_dx;
-}
-
-SVGAnimatedNumberImpl *SVGFEOffsetElementImpl::dy() const
-{
- return m_dy;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEOffsetElementImpl.cpp b/ksvg/impl/SVGFEOffsetElementImpl.cpp
new file mode 100644
index 00000000..b402fbc0
--- /dev/null
+++ b/ksvg/impl/SVGFEOffsetElementImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFEOffsetElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEOffsetElementImpl::SVGFEOffsetElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_dx = new SVGAnimatedNumberImpl();
+ m_dx->ref();
+
+ m_dy = new SVGAnimatedNumberImpl();
+ m_dy->ref();
+}
+
+SVGFEOffsetElementImpl::~SVGFEOffsetElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_dx)
+ m_dx->deref();
+ if(m_dy)
+ m_dy->deref();
+}
+
+SVGAnimatedStringImpl *SVGFEOffsetElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedNumberImpl *SVGFEOffsetElementImpl::dx() const
+{
+ return m_dx;
+}
+
+SVGAnimatedNumberImpl *SVGFEOffsetElementImpl::dy() const
+{
+ return m_dy;
+}
diff --git a/ksvg/impl/SVGFEOffsetElementImpl.h b/ksvg/impl/SVGFEOffsetElementImpl.h
index e8c3448a..e72cf29f 100644
--- a/ksvg/impl/SVGFEOffsetElementImpl.h
+++ b/ksvg/impl/SVGFEOffsetElementImpl.h
@@ -55,5 +55,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEPointLightElementImpl.cc b/ksvg/impl/SVGFEPointLightElementImpl.cc
deleted file mode 100644
index ad95d20a..00000000
--- a/ksvg/impl/SVGFEPointLightElementImpl.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFEPointLightElementImpl.h"
-
-using namespace KSVG;
-
-SVGFEPointLightElementImpl::SVGFEPointLightElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- m_x = new SVGAnimatedNumberImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedNumberImpl();
- m_y->ref();
-
- m_z = new SVGAnimatedNumberImpl();
- m_z->ref();
-}
-
-SVGFEPointLightElementImpl::~SVGFEPointLightElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_z)
- m_z->deref();
-}
-
-SVGAnimatedNumberImpl *SVGFEPointLightElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedNumberImpl *SVGFEPointLightElementImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedNumberImpl *SVGFEPointLightElementImpl::z() const
-{
- return m_z;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFEPointLightElementImpl.cpp b/ksvg/impl/SVGFEPointLightElementImpl.cpp
new file mode 100644
index 00000000..1a705f43
--- /dev/null
+++ b/ksvg/impl/SVGFEPointLightElementImpl.cpp
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFEPointLightElementImpl.h"
+
+using namespace KSVG;
+
+SVGFEPointLightElementImpl::SVGFEPointLightElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ m_x = new SVGAnimatedNumberImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedNumberImpl();
+ m_y->ref();
+
+ m_z = new SVGAnimatedNumberImpl();
+ m_z->ref();
+}
+
+SVGFEPointLightElementImpl::~SVGFEPointLightElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_z)
+ m_z->deref();
+}
+
+SVGAnimatedNumberImpl *SVGFEPointLightElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedNumberImpl *SVGFEPointLightElementImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedNumberImpl *SVGFEPointLightElementImpl::z() const
+{
+ return m_z;
+}
diff --git a/ksvg/impl/SVGFEPointLightElementImpl.h b/ksvg/impl/SVGFEPointLightElementImpl.h
index 6d66c98b..60f50c63 100644
--- a/ksvg/impl/SVGFEPointLightElementImpl.h
+++ b/ksvg/impl/SVGFEPointLightElementImpl.h
@@ -52,5 +52,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFESpecularLightingElementImpl.cc b/ksvg/impl/SVGFESpecularLightingElementImpl.cc
deleted file mode 100644
index 9974e146..00000000
--- a/ksvg/impl/SVGFESpecularLightingElementImpl.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFESpecularLightingElementImpl.h"
-
-using namespace KSVG;
-
-SVGFESpecularLightingElementImpl::SVGFESpecularLightingElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-
- m_surfaceScale = new SVGAnimatedNumberImpl();
- m_surfaceScale->ref();
-
- m_specularConstant = new SVGAnimatedNumberImpl();
- m_specularConstant->ref();
-
- m_specularExponent = new SVGAnimatedNumberImpl();
- m_specularExponent->ref();
-}
-
-SVGFESpecularLightingElementImpl::~SVGFESpecularLightingElementImpl()
-{
- if(m_in1)
- m_in1->deref();
- if(m_surfaceScale)
- m_surfaceScale->deref();
- if(m_specularConstant)
- m_specularConstant->deref();
- if(m_specularExponent)
- m_specularExponent->deref();
-}
-
-SVGAnimatedStringImpl *SVGFESpecularLightingElementImpl::in1() const
-{
- return m_in1;
-}
-
-SVGAnimatedNumberImpl *SVGFESpecularLightingElementImpl::surfaceScale() const
-{
- return m_surfaceScale;
-}
-
-SVGAnimatedNumberImpl *SVGFESpecularLightingElementImpl::specularConstant() const
-{
- return m_specularConstant;
-}
-
-SVGAnimatedNumberImpl *SVGFESpecularLightingElementImpl::specularExponent() const
-{
- return m_specularExponent;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFESpecularLightingElementImpl.cpp b/ksvg/impl/SVGFESpecularLightingElementImpl.cpp
new file mode 100644
index 00000000..188dc0bd
--- /dev/null
+++ b/ksvg/impl/SVGFESpecularLightingElementImpl.cpp
@@ -0,0 +1,72 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFESpecularLightingElementImpl.h"
+
+using namespace KSVG;
+
+SVGFESpecularLightingElementImpl::SVGFESpecularLightingElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+
+ m_surfaceScale = new SVGAnimatedNumberImpl();
+ m_surfaceScale->ref();
+
+ m_specularConstant = new SVGAnimatedNumberImpl();
+ m_specularConstant->ref();
+
+ m_specularExponent = new SVGAnimatedNumberImpl();
+ m_specularExponent->ref();
+}
+
+SVGFESpecularLightingElementImpl::~SVGFESpecularLightingElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+ if(m_surfaceScale)
+ m_surfaceScale->deref();
+ if(m_specularConstant)
+ m_specularConstant->deref();
+ if(m_specularExponent)
+ m_specularExponent->deref();
+}
+
+SVGAnimatedStringImpl *SVGFESpecularLightingElementImpl::in1() const
+{
+ return m_in1;
+}
+
+SVGAnimatedNumberImpl *SVGFESpecularLightingElementImpl::surfaceScale() const
+{
+ return m_surfaceScale;
+}
+
+SVGAnimatedNumberImpl *SVGFESpecularLightingElementImpl::specularConstant() const
+{
+ return m_specularConstant;
+}
+
+SVGAnimatedNumberImpl *SVGFESpecularLightingElementImpl::specularExponent() const
+{
+ return m_specularExponent;
+}
diff --git a/ksvg/impl/SVGFESpecularLightingElementImpl.h b/ksvg/impl/SVGFESpecularLightingElementImpl.h
index 527e7f5b..ed24d675 100644
--- a/ksvg/impl/SVGFESpecularLightingElementImpl.h
+++ b/ksvg/impl/SVGFESpecularLightingElementImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFESpotLightElementImpl.cc b/ksvg/impl/SVGFESpotLightElementImpl.cc
deleted file mode 100644
index 96950eda..00000000
--- a/ksvg/impl/SVGFESpotLightElementImpl.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGFESpotLightElementImpl.h"
-
-using namespace KSVG;
-
-SVGFESpotLightElementImpl::SVGFESpotLightElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- m_x = new SVGAnimatedNumberImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedNumberImpl();
- m_y->ref();
-
- m_z = new SVGAnimatedNumberImpl();
- m_z->ref();
-
- m_pointsAtX = new SVGAnimatedNumberImpl();
- m_pointsAtX->ref();
-
- m_pointsAtY = new SVGAnimatedNumberImpl();
- m_pointsAtY->ref();
-
- m_pointsAtZ = new SVGAnimatedNumberImpl();
- m_pointsAtZ->ref();
-
- m_specularExponent = new SVGAnimatedNumberImpl();
- m_specularExponent->ref();
-
- m_limitingConeAngle = new SVGAnimatedNumberImpl();
- m_limitingConeAngle->ref();
-}
-
-SVGFESpotLightElementImpl::~SVGFESpotLightElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_z)
- m_z->deref();
- if(m_pointsAtX)
- m_pointsAtX->deref();
- if(m_pointsAtY)
- m_pointsAtY->deref();
- if(m_pointsAtZ)
- m_pointsAtZ->deref();
- if(m_specularExponent)
- m_specularExponent->deref();
- if(m_limitingConeAngle)
- m_limitingConeAngle->deref();
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::z() const
-{
- return m_z;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::pointsAtX() const
-{
- return m_pointsAtX;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::pointsAtY() const
-{
- return m_pointsAtY;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::pointsAtZ() const
-{
- return m_pointsAtZ;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::specularExponent() const
-{
- return m_specularExponent;
-}
-
-SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::limitingConeAngle() const
-{
- return m_limitingConeAngle;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFESpotLightElementImpl.cpp b/ksvg/impl/SVGFESpotLightElementImpl.cpp
new file mode 100644
index 00000000..f92b4ccd
--- /dev/null
+++ b/ksvg/impl/SVGFESpotLightElementImpl.cpp
@@ -0,0 +1,111 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGFESpotLightElementImpl.h"
+
+using namespace KSVG;
+
+SVGFESpotLightElementImpl::SVGFESpotLightElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ m_x = new SVGAnimatedNumberImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedNumberImpl();
+ m_y->ref();
+
+ m_z = new SVGAnimatedNumberImpl();
+ m_z->ref();
+
+ m_pointsAtX = new SVGAnimatedNumberImpl();
+ m_pointsAtX->ref();
+
+ m_pointsAtY = new SVGAnimatedNumberImpl();
+ m_pointsAtY->ref();
+
+ m_pointsAtZ = new SVGAnimatedNumberImpl();
+ m_pointsAtZ->ref();
+
+ m_specularExponent = new SVGAnimatedNumberImpl();
+ m_specularExponent->ref();
+
+ m_limitingConeAngle = new SVGAnimatedNumberImpl();
+ m_limitingConeAngle->ref();
+}
+
+SVGFESpotLightElementImpl::~SVGFESpotLightElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_z)
+ m_z->deref();
+ if(m_pointsAtX)
+ m_pointsAtX->deref();
+ if(m_pointsAtY)
+ m_pointsAtY->deref();
+ if(m_pointsAtZ)
+ m_pointsAtZ->deref();
+ if(m_specularExponent)
+ m_specularExponent->deref();
+ if(m_limitingConeAngle)
+ m_limitingConeAngle->deref();
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::z() const
+{
+ return m_z;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::pointsAtX() const
+{
+ return m_pointsAtX;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::pointsAtY() const
+{
+ return m_pointsAtY;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::pointsAtZ() const
+{
+ return m_pointsAtZ;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::specularExponent() const
+{
+ return m_specularExponent;
+}
+
+SVGAnimatedNumberImpl *SVGFESpotLightElementImpl::limitingConeAngle() const
+{
+ return m_limitingConeAngle;
+}
diff --git a/ksvg/impl/SVGFESpotLightElementImpl.h b/ksvg/impl/SVGFESpotLightElementImpl.h
index 3c808698..5e14047e 100644
--- a/ksvg/impl/SVGFESpotLightElementImpl.h
+++ b/ksvg/impl/SVGFESpotLightElementImpl.h
@@ -61,5 +61,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFETileElementImpl.cc b/ksvg/impl/SVGFETileElementImpl.cc
deleted file mode 100644
index 2a794302..00000000
--- a/ksvg/impl/SVGFETileElementImpl.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFETileElementImpl.h"
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-SVGFETileElementImpl::SVGFETileElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_in1 = new SVGAnimatedStringImpl();
- m_in1->ref();
-}
-
-SVGFETileElementImpl::~SVGFETileElementImpl()
-{
- if(m_in1)
- m_in1->deref();
-}
-
-SVGAnimatedStringImpl *SVGFETileElementImpl::in1() const
-{
- return m_in1;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFETileElementImpl.cpp b/ksvg/impl/SVGFETileElementImpl.cpp
new file mode 100644
index 00000000..2ca931a2
--- /dev/null
+++ b/ksvg/impl/SVGFETileElementImpl.cpp
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFETileElementImpl.h"
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+SVGFETileElementImpl::SVGFETileElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_in1 = new SVGAnimatedStringImpl();
+ m_in1->ref();
+}
+
+SVGFETileElementImpl::~SVGFETileElementImpl()
+{
+ if(m_in1)
+ m_in1->deref();
+}
+
+SVGAnimatedStringImpl *SVGFETileElementImpl::in1() const
+{
+ return m_in1;
+}
diff --git a/ksvg/impl/SVGFETileElementImpl.h b/ksvg/impl/SVGFETileElementImpl.h
index 29cd4167..7bf87451 100644
--- a/ksvg/impl/SVGFETileElementImpl.h
+++ b/ksvg/impl/SVGFETileElementImpl.h
@@ -50,5 +50,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFETurbulenceElementImpl.cc b/ksvg/impl/SVGFETurbulenceElementImpl.cc
deleted file mode 100644
index 79c68de3..00000000
--- a/ksvg/impl/SVGFETurbulenceElementImpl.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGAnimatedIntegerImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGFETurbulenceElementImpl.h"
-
-using namespace KSVG;
-
-SVGFETurbulenceElementImpl::SVGFETurbulenceElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_baseFrequencyX = new SVGAnimatedNumberImpl();
- m_baseFrequencyX->ref();
-
- m_baseFrequencyY = new SVGAnimatedNumberImpl();
- m_baseFrequencyY->ref();
-
- m_numOctaves = new SVGAnimatedIntegerImpl();
- m_numOctaves->ref();
-
- m_seed = new SVGAnimatedNumberImpl();
- m_seed->ref();
-
- m_stitchTiles = new SVGAnimatedEnumerationImpl();
- m_stitchTiles->ref();
-
- m_type = new SVGAnimatedEnumerationImpl();
- m_type->ref();
-}
-
-SVGFETurbulenceElementImpl::~SVGFETurbulenceElementImpl()
-{
- if(m_baseFrequencyX)
- m_baseFrequencyX->deref();
-
- if(m_baseFrequencyY)
- m_baseFrequencyY->deref();
-
- if(m_numOctaves)
- m_numOctaves->deref();
-
- if(m_seed)
- m_seed->deref();
-
- if(m_stitchTiles)
- m_stitchTiles->deref();
-
- if(m_type)
- m_type->deref();
-}
-
-SVGAnimatedNumberImpl *SVGFETurbulenceElementImpl::baseFrequencyX() const
-{
- return m_baseFrequencyX;
-}
-
-SVGAnimatedNumberImpl *SVGFETurbulenceElementImpl::baseFrequencyY() const
-{
- return m_baseFrequencyY;
-}
-
-SVGAnimatedIntegerImpl *SVGFETurbulenceElementImpl::numOctaves() const
-{
- return m_numOctaves;
-}
-
-SVGAnimatedNumberImpl *SVGFETurbulenceElementImpl::seed() const
-{
- return m_seed;
-}
-
-SVGAnimatedEnumerationImpl *SVGFETurbulenceElementImpl::stitchTiles() const
-{
- return m_stitchTiles;
-}
-
-SVGAnimatedEnumerationImpl *SVGFETurbulenceElementImpl::type() const
-{
- return m_type;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFETurbulenceElementImpl.cpp b/ksvg/impl/SVGFETurbulenceElementImpl.cpp
new file mode 100644
index 00000000..7c6638ef
--- /dev/null
+++ b/ksvg/impl/SVGFETurbulenceElementImpl.cpp
@@ -0,0 +1,98 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGAnimatedIntegerImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGFETurbulenceElementImpl.h"
+
+using namespace KSVG;
+
+SVGFETurbulenceElementImpl::SVGFETurbulenceElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_baseFrequencyX = new SVGAnimatedNumberImpl();
+ m_baseFrequencyX->ref();
+
+ m_baseFrequencyY = new SVGAnimatedNumberImpl();
+ m_baseFrequencyY->ref();
+
+ m_numOctaves = new SVGAnimatedIntegerImpl();
+ m_numOctaves->ref();
+
+ m_seed = new SVGAnimatedNumberImpl();
+ m_seed->ref();
+
+ m_stitchTiles = new SVGAnimatedEnumerationImpl();
+ m_stitchTiles->ref();
+
+ m_type = new SVGAnimatedEnumerationImpl();
+ m_type->ref();
+}
+
+SVGFETurbulenceElementImpl::~SVGFETurbulenceElementImpl()
+{
+ if(m_baseFrequencyX)
+ m_baseFrequencyX->deref();
+
+ if(m_baseFrequencyY)
+ m_baseFrequencyY->deref();
+
+ if(m_numOctaves)
+ m_numOctaves->deref();
+
+ if(m_seed)
+ m_seed->deref();
+
+ if(m_stitchTiles)
+ m_stitchTiles->deref();
+
+ if(m_type)
+ m_type->deref();
+}
+
+SVGAnimatedNumberImpl *SVGFETurbulenceElementImpl::baseFrequencyX() const
+{
+ return m_baseFrequencyX;
+}
+
+SVGAnimatedNumberImpl *SVGFETurbulenceElementImpl::baseFrequencyY() const
+{
+ return m_baseFrequencyY;
+}
+
+SVGAnimatedIntegerImpl *SVGFETurbulenceElementImpl::numOctaves() const
+{
+ return m_numOctaves;
+}
+
+SVGAnimatedNumberImpl *SVGFETurbulenceElementImpl::seed() const
+{
+ return m_seed;
+}
+
+SVGAnimatedEnumerationImpl *SVGFETurbulenceElementImpl::stitchTiles() const
+{
+ return m_stitchTiles;
+}
+
+SVGAnimatedEnumerationImpl *SVGFETurbulenceElementImpl::type() const
+{
+ return m_type;
+}
diff --git a/ksvg/impl/SVGFETurbulenceElementImpl.h b/ksvg/impl/SVGFETurbulenceElementImpl.h
index 1275f8ca..bf5e8b66 100644
--- a/ksvg/impl/SVGFETurbulenceElementImpl.h
+++ b/ksvg/impl/SVGFETurbulenceElementImpl.h
@@ -61,5 +61,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFilterElementImpl.cc b/ksvg/impl/SVGFilterElementImpl.cc
deleted file mode 100644
index eb83ad4b..00000000
--- a/ksvg/impl/SVGFilterElementImpl.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFilterElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedIntegerImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-SVGFilterElementImpl::SVGFilterElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)
-{
- m_filterUnits = new SVGAnimatedEnumerationImpl();
- m_filterUnits->ref();
-
- m_primitiveUnits = new SVGAnimatedEnumerationImpl();
- m_primitiveUnits->ref();
-
- m_x = new SVGAnimatedLengthImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl();
- m_y->ref();
-
- m_width = new SVGAnimatedLengthImpl();
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl();
- m_height->ref();
-
- m_filterResX = new SVGAnimatedIntegerImpl();
- m_filterResX->ref();
-
- m_filterResY = new SVGAnimatedIntegerImpl();
- m_filterResY->ref();
-}
-
-SVGFilterElementImpl::~SVGFilterElementImpl()
-{
- if(m_filterUnits)
- m_filterUnits->deref();
- if(m_primitiveUnits)
- m_primitiveUnits->deref();
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_filterResX)
- m_filterResX->deref();
- if(m_filterResY)
- m_filterResY->deref();
-}
-
-SVGAnimatedEnumerationImpl *SVGFilterElementImpl::filterUnits() const
-{
- return m_filterUnits;
-}
-
-SVGAnimatedEnumerationImpl *SVGFilterElementImpl::primitiveUnits() const
-{
- return m_primitiveUnits;
-}
-
-SVGAnimatedLengthImpl *SVGFilterElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGFilterElementImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGFilterElementImpl::width() const
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGFilterElementImpl::height() const
-{
- return m_height;
-}
-
-SVGAnimatedIntegerImpl *SVGFilterElementImpl::filterResX() const
-{
- return m_filterResX;
-}
-
-SVGAnimatedIntegerImpl *SVGFilterElementImpl::filterResY() const
-{
- return m_filterResY;
-}
-
-void SVGFilterElementImpl::setFilterRes(unsigned long /*filterResX*/, unsigned long /*filterResY*/)
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFilterElementImpl.cpp b/ksvg/impl/SVGFilterElementImpl.cpp
new file mode 100644
index 00000000..5ed2dd8c
--- /dev/null
+++ b/ksvg/impl/SVGFilterElementImpl.cpp
@@ -0,0 +1,117 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFilterElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedIntegerImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+SVGFilterElementImpl::SVGFilterElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)
+{
+ m_filterUnits = new SVGAnimatedEnumerationImpl();
+ m_filterUnits->ref();
+
+ m_primitiveUnits = new SVGAnimatedEnumerationImpl();
+ m_primitiveUnits->ref();
+
+ m_x = new SVGAnimatedLengthImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl();
+ m_y->ref();
+
+ m_width = new SVGAnimatedLengthImpl();
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl();
+ m_height->ref();
+
+ m_filterResX = new SVGAnimatedIntegerImpl();
+ m_filterResX->ref();
+
+ m_filterResY = new SVGAnimatedIntegerImpl();
+ m_filterResY->ref();
+}
+
+SVGFilterElementImpl::~SVGFilterElementImpl()
+{
+ if(m_filterUnits)
+ m_filterUnits->deref();
+ if(m_primitiveUnits)
+ m_primitiveUnits->deref();
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_filterResX)
+ m_filterResX->deref();
+ if(m_filterResY)
+ m_filterResY->deref();
+}
+
+SVGAnimatedEnumerationImpl *SVGFilterElementImpl::filterUnits() const
+{
+ return m_filterUnits;
+}
+
+SVGAnimatedEnumerationImpl *SVGFilterElementImpl::primitiveUnits() const
+{
+ return m_primitiveUnits;
+}
+
+SVGAnimatedLengthImpl *SVGFilterElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGFilterElementImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGFilterElementImpl::width() const
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGFilterElementImpl::height() const
+{
+ return m_height;
+}
+
+SVGAnimatedIntegerImpl *SVGFilterElementImpl::filterResX() const
+{
+ return m_filterResX;
+}
+
+SVGAnimatedIntegerImpl *SVGFilterElementImpl::filterResY() const
+{
+ return m_filterResY;
+}
+
+void SVGFilterElementImpl::setFilterRes(unsigned long /*filterResX*/, unsigned long /*filterResY*/)
+{
+}
diff --git a/ksvg/impl/SVGFilterElementImpl.h b/ksvg/impl/SVGFilterElementImpl.h
index ad12a9e9..fe79a893 100644
--- a/ksvg/impl/SVGFilterElementImpl.h
+++ b/ksvg/impl/SVGFilterElementImpl.h
@@ -72,5 +72,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cc b/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cc
deleted file mode 100644
index 3f403009..00000000
--- a/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGFilterPrimitiveStandardAttributesImpl.h"
-
-using namespace KSVG;
-
-SVGFilterPrimitiveStandardAttributesImpl::SVGFilterPrimitiveStandardAttributesImpl()
-{
- m_x = new SVGAnimatedLengthImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl();
- m_y->ref();
-
- m_width = new SVGAnimatedLengthImpl();
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl();
- m_height->ref();
-
- m_result = new SVGAnimatedStringImpl();
- m_result->ref();
-}
-
-SVGFilterPrimitiveStandardAttributesImpl::~SVGFilterPrimitiveStandardAttributesImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_result)
- m_result->deref();
-}
-
-SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::width() const
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::height() const
-{
- return m_height;
-}
-
-SVGAnimatedStringImpl *SVGFilterPrimitiveStandardAttributesImpl::result() const
-{
- return m_result;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cpp b/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cpp
new file mode 100644
index 00000000..07517afd
--- /dev/null
+++ b/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGFilterPrimitiveStandardAttributesImpl.h"
+
+using namespace KSVG;
+
+SVGFilterPrimitiveStandardAttributesImpl::SVGFilterPrimitiveStandardAttributesImpl()
+{
+ m_x = new SVGAnimatedLengthImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl();
+ m_y->ref();
+
+ m_width = new SVGAnimatedLengthImpl();
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl();
+ m_height->ref();
+
+ m_result = new SVGAnimatedStringImpl();
+ m_result->ref();
+}
+
+SVGFilterPrimitiveStandardAttributesImpl::~SVGFilterPrimitiveStandardAttributesImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_result)
+ m_result->deref();
+}
+
+SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::width() const
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGFilterPrimitiveStandardAttributesImpl::height() const
+{
+ return m_height;
+}
+
+SVGAnimatedStringImpl *SVGFilterPrimitiveStandardAttributesImpl::result() const
+{
+ return m_result;
+}
diff --git a/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.h b/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.h
index 45bcd4d0..76e0015d 100644
--- a/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.h
+++ b/ksvg/impl/SVGFilterPrimitiveStandardAttributesImpl.h
@@ -51,5 +51,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFitToViewBoxImpl.cc b/ksvg/impl/SVGFitToViewBoxImpl.cc
deleted file mode 100644
index aaee3045..00000000
--- a/ksvg/impl/SVGFitToViewBoxImpl.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqstring.h>
-#include <tqstringlist.h>
-
-#include "SVGPreserveAspectRatio.h"
-
-#include "SVGRectImpl.h"
-#include "SVGFitToViewBoxImpl.h"
-#include "SVGAnimatedRectImpl.h"
-#include "SVGPreserveAspectRatioImpl.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGFitToViewBoxImpl.lut.h"
-
-SVGFitToViewBoxImpl::SVGFitToViewBoxImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_viewBox = new SVGAnimatedRectImpl();
- m_viewBox->ref();
-
- m_preserveAspectRatio = new SVGAnimatedPreserveAspectRatioImpl();
- m_preserveAspectRatio->ref();
-}
-
-SVGFitToViewBoxImpl::~SVGFitToViewBoxImpl()
-{
- if(m_viewBox)
- m_viewBox->deref();
- if(m_preserveAspectRatio)
- m_preserveAspectRatio->deref();
-}
-
-SVGAnimatedRectImpl *SVGFitToViewBoxImpl::viewBox() const
-{
- return m_viewBox;
-}
-
-SVGAnimatedPreserveAspectRatioImpl *SVGFitToViewBoxImpl::preserveAspectRatio() const
-{
- return m_preserveAspectRatio;
-}
-
-void SVGFitToViewBoxImpl::parseViewBox(const TQString &s)
-{
- // Set default if preserveAspectRatio wasnt parsed earlier (Rob)
- if(m_preserveAspectRatio->baseVal()->align() == SVG_PRESERVEASPECTRATIO_UNKNOWN)
- m_preserveAspectRatio->baseVal()->setAlign(SVG_PRESERVEASPECTRATIO_XMIDYMID);
- if(m_preserveAspectRatio->baseVal()->meetOrSlice() == SVG_MEETORSLICE_UNKNOWN)
- m_preserveAspectRatio->baseVal()->setMeetOrSlice(SVG_MEETORSLICE_MEET);
-
- // allow for viewbox def with ',' or whitespace
- TQString viewbox(s);
- TQStringList points = TQStringList::split(' ', viewbox.replace(',', ' ').simplifyWhiteSpace());
-
- viewBox()->baseVal()->setX(points[0].toFloat());
- viewBox()->baseVal()->setY(points[1].toFloat());
- viewBox()->baseVal()->setWidth(points[2].toFloat());
- viewBox()->baseVal()->setHeight(points[3].toFloat());
-}
-
-SVGMatrixImpl *SVGFitToViewBoxImpl::viewBoxToViewTransform(float viewWidth, float viewHeight) const
-{
- if(viewBox()->baseVal()->width() == 0 || viewBox()->baseVal()->height() == 0)
- return SVGSVGElementImpl::createSVGMatrix();
- else
- return preserveAspectRatio()->baseVal()->getCTM(viewBox()->baseVal()->x(),
- viewBox()->baseVal()->y(), viewBox()->baseVal()->width(), viewBox()->baseVal()->height(),
- 0, 0, viewWidth, viewHeight);
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGFitToViewBoxImpl::s_hashTable 3
- viewBox SVGFitToViewBoxImpl::ViewBox DontDelete
- preserveAspectRatio SVGFitToViewBoxImpl::PreserveAspectRatio DontDelete
-@end
-*/
-
-Value SVGFitToViewBoxImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case ViewBox:
- return m_viewBox->cache(exec);
- case PreserveAspectRatio:
- return m_preserveAspectRatio->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGFitToViewBoxImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case ViewBox:
- parseViewBox(value.toString(exec).qstring());
- break;
- case PreserveAspectRatio:
- if(preserveAspectRatio())
- preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFitToViewBoxImpl.cpp b/ksvg/impl/SVGFitToViewBoxImpl.cpp
new file mode 100644
index 00000000..a33bc0fc
--- /dev/null
+++ b/ksvg/impl/SVGFitToViewBoxImpl.cpp
@@ -0,0 +1,139 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqstring.h>
+#include <tqstringlist.h>
+
+#include "SVGPreserveAspectRatio.h"
+
+#include "SVGRectImpl.h"
+#include "SVGFitToViewBoxImpl.h"
+#include "SVGAnimatedRectImpl.h"
+#include "SVGPreserveAspectRatioImpl.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGFitToViewBoxImpl.lut.h"
+
+SVGFitToViewBoxImpl::SVGFitToViewBoxImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_viewBox = new SVGAnimatedRectImpl();
+ m_viewBox->ref();
+
+ m_preserveAspectRatio = new SVGAnimatedPreserveAspectRatioImpl();
+ m_preserveAspectRatio->ref();
+}
+
+SVGFitToViewBoxImpl::~SVGFitToViewBoxImpl()
+{
+ if(m_viewBox)
+ m_viewBox->deref();
+ if(m_preserveAspectRatio)
+ m_preserveAspectRatio->deref();
+}
+
+SVGAnimatedRectImpl *SVGFitToViewBoxImpl::viewBox() const
+{
+ return m_viewBox;
+}
+
+SVGAnimatedPreserveAspectRatioImpl *SVGFitToViewBoxImpl::preserveAspectRatio() const
+{
+ return m_preserveAspectRatio;
+}
+
+void SVGFitToViewBoxImpl::parseViewBox(const TQString &s)
+{
+ // Set default if preserveAspectRatio wasnt parsed earlier (Rob)
+ if(m_preserveAspectRatio->baseVal()->align() == SVG_PRESERVEASPECTRATIO_UNKNOWN)
+ m_preserveAspectRatio->baseVal()->setAlign(SVG_PRESERVEASPECTRATIO_XMIDYMID);
+ if(m_preserveAspectRatio->baseVal()->meetOrSlice() == SVG_MEETORSLICE_UNKNOWN)
+ m_preserveAspectRatio->baseVal()->setMeetOrSlice(SVG_MEETORSLICE_MEET);
+
+ // allow for viewbox def with ',' or whitespace
+ TQString viewbox(s);
+ TQStringList points = TQStringList::split(' ', viewbox.replace(',', ' ').simplifyWhiteSpace());
+
+ viewBox()->baseVal()->setX(points[0].toFloat());
+ viewBox()->baseVal()->setY(points[1].toFloat());
+ viewBox()->baseVal()->setWidth(points[2].toFloat());
+ viewBox()->baseVal()->setHeight(points[3].toFloat());
+}
+
+SVGMatrixImpl *SVGFitToViewBoxImpl::viewBoxToViewTransform(float viewWidth, float viewHeight) const
+{
+ if(viewBox()->baseVal()->width() == 0 || viewBox()->baseVal()->height() == 0)
+ return SVGSVGElementImpl::createSVGMatrix();
+ else
+ return preserveAspectRatio()->baseVal()->getCTM(viewBox()->baseVal()->x(),
+ viewBox()->baseVal()->y(), viewBox()->baseVal()->width(), viewBox()->baseVal()->height(),
+ 0, 0, viewWidth, viewHeight);
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGFitToViewBoxImpl::s_hashTable 3
+ viewBox SVGFitToViewBoxImpl::ViewBox DontDelete
+ preserveAspectRatio SVGFitToViewBoxImpl::PreserveAspectRatio DontDelete
+@end
+*/
+
+Value SVGFitToViewBoxImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case ViewBox:
+ return m_viewBox->cache(exec);
+ case PreserveAspectRatio:
+ return m_preserveAspectRatio->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGFitToViewBoxImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case ViewBox:
+ parseViewBox(value.toString(exec).qstring());
+ break;
+ case PreserveAspectRatio:
+ if(preserveAspectRatio())
+ preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGFitToViewBoxImpl.h b/ksvg/impl/SVGFitToViewBoxImpl.h
index 501a4061..e57a6664 100644
--- a/ksvg/impl/SVGFitToViewBoxImpl.h
+++ b/ksvg/impl/SVGFitToViewBoxImpl.h
@@ -65,5 +65,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontElementImpl.cc b/ksvg/impl/SVGFontElementImpl.cc
deleted file mode 100644
index 30d4f63f..00000000
--- a/ksvg/impl/SVGFontElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontElementImpl::SVGFontElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)
-{
-}
-
-SVGFontElementImpl::~SVGFontElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontElementImpl.cpp b/ksvg/impl/SVGFontElementImpl.cpp
new file mode 100644
index 00000000..49ed035c
--- /dev/null
+++ b/ksvg/impl/SVGFontElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontElementImpl::SVGFontElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)
+{
+}
+
+SVGFontElementImpl::~SVGFontElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFontElementImpl.h b/ksvg/impl/SVGFontElementImpl.h
index 3a753797..cea377f5 100644
--- a/ksvg/impl/SVGFontElementImpl.h
+++ b/ksvg/impl/SVGFontElementImpl.h
@@ -45,5 +45,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceElementImpl.cc b/ksvg/impl/SVGFontFaceElementImpl.cc
deleted file mode 100644
index d53e70ad..00000000
--- a/ksvg/impl/SVGFontFaceElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceElementImpl::SVGFontFaceElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGFontFaceElementImpl::~SVGFontFaceElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceElementImpl.cpp b/ksvg/impl/SVGFontFaceElementImpl.cpp
new file mode 100644
index 00000000..b8ee49e1
--- /dev/null
+++ b/ksvg/impl/SVGFontFaceElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceElementImpl::SVGFontFaceElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGFontFaceElementImpl::~SVGFontFaceElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFontFaceElementImpl.h b/ksvg/impl/SVGFontFaceElementImpl.h
index 0479ccea..113775be 100644
--- a/ksvg/impl/SVGFontFaceElementImpl.h
+++ b/ksvg/impl/SVGFontFaceElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceFormatElementImpl.cc b/ksvg/impl/SVGFontFaceFormatElementImpl.cc
deleted file mode 100644
index 48651a68..00000000
--- a/ksvg/impl/SVGFontFaceFormatElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceFormatElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceFormatElementImpl::SVGFontFaceFormatElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGFontFaceFormatElementImpl::~SVGFontFaceFormatElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceFormatElementImpl.cpp b/ksvg/impl/SVGFontFaceFormatElementImpl.cpp
new file mode 100644
index 00000000..aecf957c
--- /dev/null
+++ b/ksvg/impl/SVGFontFaceFormatElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceFormatElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceFormatElementImpl::SVGFontFaceFormatElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGFontFaceFormatElementImpl::~SVGFontFaceFormatElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFontFaceFormatElementImpl.h b/ksvg/impl/SVGFontFaceFormatElementImpl.h
index 380e29b1..6f1ca21a 100644
--- a/ksvg/impl/SVGFontFaceFormatElementImpl.h
+++ b/ksvg/impl/SVGFontFaceFormatElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceNameElementImpl.cc b/ksvg/impl/SVGFontFaceNameElementImpl.cc
deleted file mode 100644
index 276f3ae3..00000000
--- a/ksvg/impl/SVGFontFaceNameElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceNameElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceNameElementImpl::SVGFontFaceNameElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGFontFaceNameElementImpl::~SVGFontFaceNameElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceNameElementImpl.cpp b/ksvg/impl/SVGFontFaceNameElementImpl.cpp
new file mode 100644
index 00000000..c4a295fc
--- /dev/null
+++ b/ksvg/impl/SVGFontFaceNameElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceNameElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceNameElementImpl::SVGFontFaceNameElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGFontFaceNameElementImpl::~SVGFontFaceNameElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFontFaceNameElementImpl.h b/ksvg/impl/SVGFontFaceNameElementImpl.h
index 797ee17e..3f398d4d 100644
--- a/ksvg/impl/SVGFontFaceNameElementImpl.h
+++ b/ksvg/impl/SVGFontFaceNameElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceSrcElementImpl.cc b/ksvg/impl/SVGFontFaceSrcElementImpl.cc
deleted file mode 100644
index bdc40611..00000000
--- a/ksvg/impl/SVGFontFaceSrcElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceSrcElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceSrcElementImpl::SVGFontFaceSrcElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGFontFaceSrcElementImpl::~SVGFontFaceSrcElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceSrcElementImpl.cpp b/ksvg/impl/SVGFontFaceSrcElementImpl.cpp
new file mode 100644
index 00000000..9a2bd71e
--- /dev/null
+++ b/ksvg/impl/SVGFontFaceSrcElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceSrcElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceSrcElementImpl::SVGFontFaceSrcElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGFontFaceSrcElementImpl::~SVGFontFaceSrcElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFontFaceSrcElementImpl.h b/ksvg/impl/SVGFontFaceSrcElementImpl.h
index f858e829..a5a74465 100644
--- a/ksvg/impl/SVGFontFaceSrcElementImpl.h
+++ b/ksvg/impl/SVGFontFaceSrcElementImpl.h
@@ -41,5 +41,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceUriElementImpl.cc b/ksvg/impl/SVGFontFaceUriElementImpl.cc
deleted file mode 100644
index cef5a30f..00000000
--- a/ksvg/impl/SVGFontFaceUriElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGFontFaceUriElementImpl.h"
-
-using namespace KSVG;
-
-SVGFontFaceUriElementImpl::SVGFontFaceUriElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGFontFaceUriElementImpl::~SVGFontFaceUriElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGFontFaceUriElementImpl.cpp b/ksvg/impl/SVGFontFaceUriElementImpl.cpp
new file mode 100644
index 00000000..4a4153ae
--- /dev/null
+++ b/ksvg/impl/SVGFontFaceUriElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGFontFaceUriElementImpl.h"
+
+using namespace KSVG;
+
+SVGFontFaceUriElementImpl::SVGFontFaceUriElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGFontFaceUriElementImpl::~SVGFontFaceUriElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGFontFaceUriElementImpl.h b/ksvg/impl/SVGFontFaceUriElementImpl.h
index 2b670a82..767c6bce 100644
--- a/ksvg/impl/SVGFontFaceUriElementImpl.h
+++ b/ksvg/impl/SVGFontFaceUriElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGForeignObjectElementImpl.cc b/ksvg/impl/SVGForeignObjectElementImpl.cc
deleted file mode 100644
index ff605cf0..00000000
--- a/ksvg/impl/SVGForeignObjectElementImpl.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Copyright (C) 2001-20032 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGRectImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGForeignObjectElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGForeignObjectElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGForeignObjectElementImpl::SVGForeignObjectElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- m_x = new SVGAnimatedLengthImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl();
- m_y->ref();
-
- m_width = new SVGAnimatedLengthImpl();
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl();
- m_height->ref();
-}
-
-SVGForeignObjectElementImpl::~SVGForeignObjectElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
-}
-
-SVGRectImpl *SVGForeignObjectElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_x->baseVal()->value());
- ret->setY(m_y->baseVal()->value());
- ret->setWidth(m_width->baseVal()->value());
- ret->setHeight(m_height->baseVal()->value());
- return ret;
-}
-
-SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::width() const
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::height() const
-{
- return m_height;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGForeignObjectElementImpl::s_hashTable 5
- x SVGForeignObjectElementImpl::X DontDelete|ReadOnly
- y SVGForeignObjectElementImpl::Y DontDelete|ReadOnly
- width SVGForeignObjectElementImpl::Width DontDelete|ReadOnly
- height SVGForeignObjectElementImpl::Height DontDelete|ReadOnly
-@end
-*/
-
-Value SVGForeignObjectElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case X:
- return m_x->cache(exec);
- case Y:
- return m_y->cache(exec);
- case Width:
- return m_width->cache(exec);
- case Height:
- return m_height->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGForeignObjectElementImpl.cpp b/ksvg/impl/SVGForeignObjectElementImpl.cpp
new file mode 100644
index 00000000..bf6b3c7a
--- /dev/null
+++ b/ksvg/impl/SVGForeignObjectElementImpl.cpp
@@ -0,0 +1,119 @@
+/*
+ Copyright (C) 2001-20032 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGRectImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGForeignObjectElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGForeignObjectElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGForeignObjectElementImpl::SVGForeignObjectElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ m_x = new SVGAnimatedLengthImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl();
+ m_y->ref();
+
+ m_width = new SVGAnimatedLengthImpl();
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl();
+ m_height->ref();
+}
+
+SVGForeignObjectElementImpl::~SVGForeignObjectElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+}
+
+SVGRectImpl *SVGForeignObjectElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_x->baseVal()->value());
+ ret->setY(m_y->baseVal()->value());
+ ret->setWidth(m_width->baseVal()->value());
+ ret->setHeight(m_height->baseVal()->value());
+ return ret;
+}
+
+SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::width() const
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGForeignObjectElementImpl::height() const
+{
+ return m_height;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGForeignObjectElementImpl::s_hashTable 5
+ x SVGForeignObjectElementImpl::X DontDelete|ReadOnly
+ y SVGForeignObjectElementImpl::Y DontDelete|ReadOnly
+ width SVGForeignObjectElementImpl::Width DontDelete|ReadOnly
+ height SVGForeignObjectElementImpl::Height DontDelete|ReadOnly
+@end
+*/
+
+Value SVGForeignObjectElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return m_x->cache(exec);
+ case Y:
+ return m_y->cache(exec);
+ case Width:
+ return m_width->cache(exec);
+ case Height:
+ return m_height->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGForeignObjectElementImpl.h b/ksvg/impl/SVGForeignObjectElementImpl.h
index 3fea4877..e81e7c75 100644
--- a/ksvg/impl/SVGForeignObjectElementImpl.h
+++ b/ksvg/impl/SVGForeignObjectElementImpl.h
@@ -74,5 +74,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGElementImpl.cc b/ksvg/impl/SVGGElementImpl.cc
deleted file mode 100644
index 9f355540..00000000
--- a/ksvg/impl/SVGGElementImpl.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGAElementImpl.h"
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-SVGGElementImpl::SVGGElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
-}
-
-SVGGElementImpl::~SVGGElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGElementImpl.cpp b/ksvg/impl/SVGGElementImpl.cpp
new file mode 100644
index 00000000..5cba29a3
--- /dev/null
+++ b/ksvg/impl/SVGGElementImpl.cpp
@@ -0,0 +1,34 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGAElementImpl.h"
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+SVGGElementImpl::SVGGElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+}
+
+SVGGElementImpl::~SVGGElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGGElementImpl.h b/ksvg/impl/SVGGElementImpl.h
index ca4a9b4e..1d78fae2 100644
--- a/ksvg/impl/SVGGElementImpl.h
+++ b/ksvg/impl/SVGGElementImpl.h
@@ -55,5 +55,3 @@ KSVG_REGISTER_ELEMENT(SVGGElementImpl, "g")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGlyphElementImpl.cc b/ksvg/impl/SVGGlyphElementImpl.cc
deleted file mode 100644
index 4975b2c5..00000000
--- a/ksvg/impl/SVGGlyphElementImpl.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGGlyphElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGGlyphElementImpl.lut.h"
-
-SVGGlyphElementImpl::SVGGlyphElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this)
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGGlyphElementImpl::~SVGGlyphElementImpl()
-{
-}
-
-TQString SVGGlyphElementImpl::d() const
-{
- return m_d;
-}
-
-/*
-@namespace KSVG
-@begin SVGGlyphElementImpl::s_hashTable 11
- unicode SVGGlyphElementImpl::Unicode DontDelete|ReadOnly
- glyph-name SVGGlyphElementImpl::GlyphName DontDelete|ReadOnly
- d SVGGlyphElementImpl::D DontDelete|ReadOnly
- orientation SVGGlyphElementImpl::Qt::Orientation DontDelete|ReadOnly
- arabic-form SVGGlyphElementImpl::ArabicForm DontDelete|ReadOnly
- lang SVGGlyphElementImpl::Lang DontDelete|ReadOnly
- horiz-adv-x SVGGlyphElementImpl::HorizAdvX DontDelete|ReadOnly
- vert-origin-x SVGGlyphElementImpl::VertOriginX DontDelete|ReadOnly
- vert-origin-y SVGGlyphElementImpl::VertOriginY DontDelete|ReadOnly
- vert-adv-y SVGGlyphElementImpl::VertAdvY DontDelete|ReadOnly
-@end
-*/
-
-Value SVGGlyphElementImpl::getValueProperty(ExecState *, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGGlyphElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case D:
- m_d = value.toString(exec).qstring();
- break;
- case Unicode:
- case GlyphName:
- case Orientation:
- case ArabicForm:
- case Lang:
- case HorizAdvX:
- case VertOriginX:
- case VertOriginY:
- case VertAdvY:
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGlyphElementImpl.cpp b/ksvg/impl/SVGGlyphElementImpl.cpp
new file mode 100644
index 00000000..9b909960
--- /dev/null
+++ b/ksvg/impl/SVGGlyphElementImpl.cpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGGlyphElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGGlyphElementImpl.lut.h"
+
+SVGGlyphElementImpl::SVGGlyphElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this)
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGGlyphElementImpl::~SVGGlyphElementImpl()
+{
+}
+
+TQString SVGGlyphElementImpl::d() const
+{
+ return m_d;
+}
+
+/*
+@namespace KSVG
+@begin SVGGlyphElementImpl::s_hashTable 11
+ unicode SVGGlyphElementImpl::Unicode DontDelete|ReadOnly
+ glyph-name SVGGlyphElementImpl::GlyphName DontDelete|ReadOnly
+ d SVGGlyphElementImpl::D DontDelete|ReadOnly
+ orientation SVGGlyphElementImpl::Qt::Orientation DontDelete|ReadOnly
+ arabic-form SVGGlyphElementImpl::ArabicForm DontDelete|ReadOnly
+ lang SVGGlyphElementImpl::Lang DontDelete|ReadOnly
+ horiz-adv-x SVGGlyphElementImpl::HorizAdvX DontDelete|ReadOnly
+ vert-origin-x SVGGlyphElementImpl::VertOriginX DontDelete|ReadOnly
+ vert-origin-y SVGGlyphElementImpl::VertOriginY DontDelete|ReadOnly
+ vert-adv-y SVGGlyphElementImpl::VertAdvY DontDelete|ReadOnly
+@end
+*/
+
+Value SVGGlyphElementImpl::getValueProperty(ExecState *, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGGlyphElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case D:
+ m_d = value.toString(exec).qstring();
+ break;
+ case Unicode:
+ case GlyphName:
+ case Orientation:
+ case ArabicForm:
+ case Lang:
+ case HorizAdvX:
+ case VertOriginX:
+ case VertOriginY:
+ case VertAdvY:
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGGlyphElementImpl.h b/ksvg/impl/SVGGlyphElementImpl.h
index 576e554e..be999d03 100644
--- a/ksvg/impl/SVGGlyphElementImpl.h
+++ b/ksvg/impl/SVGGlyphElementImpl.h
@@ -62,5 +62,3 @@ KSVG_REGISTER_ELEMENT(SVGGlyphElementImpl, "glyph")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGlyphRefElementImpl.cc b/ksvg/impl/SVGGlyphRefElementImpl.cc
deleted file mode 100644
index 438fa0b0..00000000
--- a/ksvg/impl/SVGGlyphRefElementImpl.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGSVGElementImpl.h"
-#include "SVGGlyphRefElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGGlyphRefElementImpl.lut.h"
-#include "ksvg_lookup.h"
-
-SVGGlyphRefElementImpl::SVGGlyphRefElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGStylableImpl(this)
-{
-}
-
-SVGGlyphRefElementImpl::~SVGGlyphRefElementImpl()
-{
-}
-
-void SVGGlyphRefElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-}
-
-DOM::DOMString SVGGlyphRefElementImpl::format()
-{
- return "";
-}
-
-DOM::DOMString SVGGlyphRefElementImpl::glyphRef()
-{
- return "";
-}
-
-float SVGGlyphRefElementImpl::x() const
-{
- return m_x;
-}
-
-float SVGGlyphRefElementImpl::y() const
-{
- return m_y;
-}
-
-float SVGGlyphRefElementImpl::dx() const
-{
- return m_dx;
-}
-
-float SVGGlyphRefElementImpl::dy() const
-{
- return m_dy;
-}
-
-/*
-@namespace KSVG
-@begin SVGGlyphRefElementImpl::s_hashTable 7
- glyphRef SVGGlyphRefElementImpl::GlyphRef DontDelete|ReadOnly
- format SVGGlyphRefElementImpl::Format DontDelete|ReadOnly
- x SVGGlyphRefElementImpl::X DontDelete|ReadOnly
- y SVGGlyphRefElementImpl::Y DontDelete|ReadOnly
- dx SVGGlyphRefElementImpl::Dx DontDelete|ReadOnly
- dy SVGGlyphRefElementImpl::Dy DontDelete|ReadOnly
-@end
-*/
-
-Value SVGGlyphRefElementImpl::getValueProperty(ExecState *, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case GlyphRef: return String(m_glyphRef);
- case Format: return String(m_format);
- case X: return Number(m_x);
- case Y: return Number(m_y);
- case Dx: return Number(m_dx);
- case Dy: return Number(m_dy);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGGlyphRefElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case GlyphRef:
- m_glyphRef = value.toString(exec).string();
- break;
- case Format:
- m_format = value.toString(exec).string();
- break;
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case Dx:
- m_dx = value.toNumber(exec);
- break;
- case Dy:
- m_dy = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGlyphRefElementImpl.cpp b/ksvg/impl/SVGGlyphRefElementImpl.cpp
new file mode 100644
index 00000000..10366dd9
--- /dev/null
+++ b/ksvg/impl/SVGGlyphRefElementImpl.cpp
@@ -0,0 +1,132 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGSVGElementImpl.h"
+#include "SVGGlyphRefElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGGlyphRefElementImpl.lut.h"
+#include "ksvg_lookup.h"
+
+SVGGlyphRefElementImpl::SVGGlyphRefElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGStylableImpl(this)
+{
+}
+
+SVGGlyphRefElementImpl::~SVGGlyphRefElementImpl()
+{
+}
+
+void SVGGlyphRefElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+}
+
+DOM::DOMString SVGGlyphRefElementImpl::format()
+{
+ return "";
+}
+
+DOM::DOMString SVGGlyphRefElementImpl::glyphRef()
+{
+ return "";
+}
+
+float SVGGlyphRefElementImpl::x() const
+{
+ return m_x;
+}
+
+float SVGGlyphRefElementImpl::y() const
+{
+ return m_y;
+}
+
+float SVGGlyphRefElementImpl::dx() const
+{
+ return m_dx;
+}
+
+float SVGGlyphRefElementImpl::dy() const
+{
+ return m_dy;
+}
+
+/*
+@namespace KSVG
+@begin SVGGlyphRefElementImpl::s_hashTable 7
+ glyphRef SVGGlyphRefElementImpl::GlyphRef DontDelete|ReadOnly
+ format SVGGlyphRefElementImpl::Format DontDelete|ReadOnly
+ x SVGGlyphRefElementImpl::X DontDelete|ReadOnly
+ y SVGGlyphRefElementImpl::Y DontDelete|ReadOnly
+ dx SVGGlyphRefElementImpl::Dx DontDelete|ReadOnly
+ dy SVGGlyphRefElementImpl::Dy DontDelete|ReadOnly
+@end
+*/
+
+Value SVGGlyphRefElementImpl::getValueProperty(ExecState *, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case GlyphRef: return String(m_glyphRef);
+ case Format: return String(m_format);
+ case X: return Number(m_x);
+ case Y: return Number(m_y);
+ case Dx: return Number(m_dx);
+ case Dy: return Number(m_dy);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGGlyphRefElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case GlyphRef:
+ m_glyphRef = value.toString(exec).string();
+ break;
+ case Format:
+ m_format = value.toString(exec).string();
+ break;
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case Dx:
+ m_dx = value.toNumber(exec);
+ break;
+ case Dy:
+ m_dy = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGGlyphRefElementImpl.h b/ksvg/impl/SVGGlyphRefElementImpl.h
index 6a292a64..8e085726 100644
--- a/ksvg/impl/SVGGlyphRefElementImpl.h
+++ b/ksvg/impl/SVGGlyphRefElementImpl.h
@@ -75,5 +75,3 @@ KSVG_REGISTER_ELEMENT(SVGGlyphRefElementImpl, "glyphRef")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGradientElementImpl.cc b/ksvg/impl/SVGGradientElementImpl.cc
deleted file mode 100644
index eae9059e..00000000
--- a/ksvg/impl/SVGGradientElementImpl.cc
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGradientElement.h"
-#include "SVGGradientElementImpl.h"
-#include "SVGStopElementImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGSVGElementImpl.h"
-
-#include "KSVGCanvas.h"
-#include "CanvasItems.h"
-#include "SVGHelperImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGUnitConverter.h"
-
-using namespace KSVG;
-
-#include "SVGGradientElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-#include "ksvg_cacheimpl.h"
-
-SVGGradientElementImpl::SVGGradientElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGPaintServerImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_gradientUnits = new SVGAnimatedEnumerationImpl();
- m_gradientUnits->ref();
-
- m_gradientTransform = new SVGAnimatedTransformListImpl();
- m_gradientTransform->ref();
-
- m_spreadMethod = new SVGAnimatedEnumerationImpl();
- m_spreadMethod->ref();
-
- m_converter = new SVGUnitConverter();
-}
-
-SVGGradientElementImpl::~SVGGradientElementImpl()
-{
- if(m_gradientUnits)
- m_gradientUnits->deref();
- if(m_gradientTransform)
- m_gradientTransform->deref();
- if(m_spreadMethod)
- m_spreadMethod->deref();
- delete m_converter;
-}
-
-SVGAnimatedEnumerationImpl *SVGGradientElementImpl::gradientUnits() const
-{
- return m_gradientUnits;
-}
-
-SVGAnimatedTransformListImpl *SVGGradientElementImpl::gradientTransform() const
-{
- return m_gradientTransform;
-}
-
-SVGAnimatedEnumerationImpl *SVGGradientElementImpl::spreadMethod() const
-{
- return m_spreadMethod;
-}
-
-/*
-@namespace KSVG
-@begin SVGGradientElementImpl::s_hashTable 5
- gradientUnits SVGGradientElementImpl::GradientUnits DontDelete|ReadOnly
- gradientTransform SVGGradientElementImpl::GradientTransform DontDelete|ReadOnly
- spreadMethod SVGGradientElementImpl::SpreadMethod DontDelete|ReadOnly
-@end
-*/
-
-Value SVGGradientElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case GradientUnits:
- return m_gradientUnits->cache(exec);
- case GradientTransform:
- return m_gradientTransform->cache(exec);
- case SpreadMethod:
- return m_spreadMethod->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGGradientElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case GradientUnits:
- if(value.toString(exec).qstring() == "userSpaceOnUse")
- m_gradientUnits->setBaseVal(SVGGradientElement::SVG_UNIT_TYPE_USERSPACEONUSE);
- else
- m_gradientUnits->setBaseVal(SVGGradientElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
- break;
- case GradientTransform:
- m_gradientTransform->baseVal()->clear();
- SVGHelperImpl::parseTransformAttribute(m_gradientTransform->baseVal(), value.toString(exec).qstring());
- break;
- case SpreadMethod:
- {
- TQString spreadMethod = value.toString(exec).qstring();
-
- if(spreadMethod == "repeat")
- m_spreadMethod->setBaseVal(SVG_SPREADMETHOD_REPEAT);
- else if(spreadMethod == "reflect")
- m_spreadMethod->setBaseVal(SVG_SPREADMETHOD_REFLECT);
- else
- m_spreadMethod->setBaseVal(SVG_SPREADMETHOD_PAD);
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGGradientElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
- setAttributesFromHref();
-
- // Spec: if attribute not specified, use "pad"
- if(KSVG_TOKEN_NOT_PARSED(SpreadMethod))
- KSVG_SET_ALT_ATTRIBUTE(SpreadMethod, "pad")
-
- // Spec: if attribute not specified, use objectBoundingBox
- if(KSVG_TOKEN_NOT_PARSED(GradientUnits))
- KSVG_SET_ALT_ATTRIBUTE(GradientUnits, "objectBoundingBox")
-}
-
-void SVGGradientElementImpl::setAttributesFromHref()
-{
- TQString _href = SVGURIReferenceImpl::getTarget(href()->baseVal().string());
-
- if(!_href.isEmpty())
- {
- SVGGradientElementImpl *refGradient = dynamic_cast<SVGGradientElementImpl *>(ownerSVGElement()->getElementById(_href));
-
- if(refGradient)
- {
- TQMap<TQString, DOM::DOMString> refAttributes = refGradient->gradientAttributes();
- TQMap<TQString, DOM::DOMString>::iterator it;
-
- for(it = refAttributes.begin(); it != refAttributes.end(); ++it)
- {
- TQString name = it.key();
- DOM::DOMString value = it.data();
-
- if(!hasAttribute(name))
- {
- setAttribute(name, value);
- setAttributeInternal(name, value);
- }
- }
- }
- }
-}
-
-SVGGradientElementImpl *SVGGradientElementImpl::stopsSource()
-{
- // Spec:
- // If this element has no defined gradient stops, and the referenced element does
- // (possibly due to its own href attribute), then this element inherits the gradient stop from the referenced element.
- // Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attribute or gradient stops
- // due to its own href attribute, then the current element can inherit those attributes or gradient stops. (mop)
- bool haveStops = false;
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGStopElementImpl *stop = dynamic_cast<SVGStopElementImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
-
- if(stop)
- {
- haveStops = true;
- break;
- }
- }
-
- SVGGradientElementImpl *source = this;
-
- if(!haveStops)
- {
- TQString _href = SVGURIReferenceImpl::getTarget(href()->baseVal().string());
-
- if(!_href.isEmpty())
- {
- SVGGradientElementImpl *refGradient = dynamic_cast<SVGGradientElementImpl *>(ownerSVGElement()->getElementById(_href));
-
- if(refGradient)
- source = refGradient->stopsSource();
- }
- }
-
- return source;
-}
-
-void SVGGradientElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_paintServer)
- m_paintServer = c->createPaintServer(this);
-}
-
-void SVGGradientElementImpl::removeItem(KSVGCanvas *)
-{
- delete m_paintServer;
- m_paintServer = 0;
-}
-
-/*
-@namespace KSVG
-@begin SVGGradientElementImplConstructor::s_hashTable 5
- SVG_SPREADMETHOD_UNKNOWN KSVG::SVG_SPREADMETHOD_UNKNOWN DontDelete|ReadOnly
- SVG_SPREADMETHOD_PAD KSVG::SVG_SPREADMETHOD_PAD DontDelete|ReadOnly
- SVG_SPREADMETHOD_REFLECT KSVG::SVG_SPREADMETHOD_REFLECT DontDelete|ReadOnly
- SVG_SPREADMETHOD_REPEAT KSVG::SVG_SPREADMETHOD_REPEAT DontDelete|ReadOnly
-@end
-*/
-
-using namespace KJS;
-
-Value SVGGradientElementImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGGradientElementImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGGradientElementImplConstructor>(exec, "[[svggradientelement.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGGradientElementImpl.cpp b/ksvg/impl/SVGGradientElementImpl.cpp
new file mode 100644
index 00000000..b59679e2
--- /dev/null
+++ b/ksvg/impl/SVGGradientElementImpl.cpp
@@ -0,0 +1,262 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGradientElement.h"
+#include "SVGGradientElementImpl.h"
+#include "SVGStopElementImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGSVGElementImpl.h"
+
+#include "KSVGCanvas.h"
+#include "CanvasItems.h"
+#include "SVGHelperImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGUnitConverter.h"
+
+using namespace KSVG;
+
+#include "SVGGradientElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+#include "ksvg_cacheimpl.h"
+
+SVGGradientElementImpl::SVGGradientElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGPaintServerImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_gradientUnits = new SVGAnimatedEnumerationImpl();
+ m_gradientUnits->ref();
+
+ m_gradientTransform = new SVGAnimatedTransformListImpl();
+ m_gradientTransform->ref();
+
+ m_spreadMethod = new SVGAnimatedEnumerationImpl();
+ m_spreadMethod->ref();
+
+ m_converter = new SVGUnitConverter();
+}
+
+SVGGradientElementImpl::~SVGGradientElementImpl()
+{
+ if(m_gradientUnits)
+ m_gradientUnits->deref();
+ if(m_gradientTransform)
+ m_gradientTransform->deref();
+ if(m_spreadMethod)
+ m_spreadMethod->deref();
+ delete m_converter;
+}
+
+SVGAnimatedEnumerationImpl *SVGGradientElementImpl::gradientUnits() const
+{
+ return m_gradientUnits;
+}
+
+SVGAnimatedTransformListImpl *SVGGradientElementImpl::gradientTransform() const
+{
+ return m_gradientTransform;
+}
+
+SVGAnimatedEnumerationImpl *SVGGradientElementImpl::spreadMethod() const
+{
+ return m_spreadMethod;
+}
+
+/*
+@namespace KSVG
+@begin SVGGradientElementImpl::s_hashTable 5
+ gradientUnits SVGGradientElementImpl::GradientUnits DontDelete|ReadOnly
+ gradientTransform SVGGradientElementImpl::GradientTransform DontDelete|ReadOnly
+ spreadMethod SVGGradientElementImpl::SpreadMethod DontDelete|ReadOnly
+@end
+*/
+
+Value SVGGradientElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case GradientUnits:
+ return m_gradientUnits->cache(exec);
+ case GradientTransform:
+ return m_gradientTransform->cache(exec);
+ case SpreadMethod:
+ return m_spreadMethod->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGGradientElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case GradientUnits:
+ if(value.toString(exec).qstring() == "userSpaceOnUse")
+ m_gradientUnits->setBaseVal(SVGGradientElement::SVG_UNIT_TYPE_USERSPACEONUSE);
+ else
+ m_gradientUnits->setBaseVal(SVGGradientElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+ break;
+ case GradientTransform:
+ m_gradientTransform->baseVal()->clear();
+ SVGHelperImpl::parseTransformAttribute(m_gradientTransform->baseVal(), value.toString(exec).qstring());
+ break;
+ case SpreadMethod:
+ {
+ TQString spreadMethod = value.toString(exec).qstring();
+
+ if(spreadMethod == "repeat")
+ m_spreadMethod->setBaseVal(SVG_SPREADMETHOD_REPEAT);
+ else if(spreadMethod == "reflect")
+ m_spreadMethod->setBaseVal(SVG_SPREADMETHOD_REFLECT);
+ else
+ m_spreadMethod->setBaseVal(SVG_SPREADMETHOD_PAD);
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGGradientElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+ setAttributesFromHref();
+
+ // Spec: if attribute not specified, use "pad"
+ if(KSVG_TOKEN_NOT_PARSED(SpreadMethod))
+ KSVG_SET_ALT_ATTRIBUTE(SpreadMethod, "pad")
+
+ // Spec: if attribute not specified, use objectBoundingBox
+ if(KSVG_TOKEN_NOT_PARSED(GradientUnits))
+ KSVG_SET_ALT_ATTRIBUTE(GradientUnits, "objectBoundingBox")
+}
+
+void SVGGradientElementImpl::setAttributesFromHref()
+{
+ TQString _href = SVGURIReferenceImpl::getTarget(href()->baseVal().string());
+
+ if(!_href.isEmpty())
+ {
+ SVGGradientElementImpl *refGradient = dynamic_cast<SVGGradientElementImpl *>(ownerSVGElement()->getElementById(_href));
+
+ if(refGradient)
+ {
+ TQMap<TQString, DOM::DOMString> refAttributes = refGradient->gradientAttributes();
+ TQMap<TQString, DOM::DOMString>::iterator it;
+
+ for(it = refAttributes.begin(); it != refAttributes.end(); ++it)
+ {
+ TQString name = it.key();
+ DOM::DOMString value = it.data();
+
+ if(!hasAttribute(name))
+ {
+ setAttribute(name, value);
+ setAttributeInternal(name, value);
+ }
+ }
+ }
+ }
+}
+
+SVGGradientElementImpl *SVGGradientElementImpl::stopsSource()
+{
+ // Spec:
+ // If this element has no defined gradient stops, and the referenced element does
+ // (possibly due to its own href attribute), then this element inherits the gradient stop from the referenced element.
+ // Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attribute or gradient stops
+ // due to its own href attribute, then the current element can inherit those attributes or gradient stops. (mop)
+ bool haveStops = false;
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGStopElementImpl *stop = dynamic_cast<SVGStopElementImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
+
+ if(stop)
+ {
+ haveStops = true;
+ break;
+ }
+ }
+
+ SVGGradientElementImpl *source = this;
+
+ if(!haveStops)
+ {
+ TQString _href = SVGURIReferenceImpl::getTarget(href()->baseVal().string());
+
+ if(!_href.isEmpty())
+ {
+ SVGGradientElementImpl *refGradient = dynamic_cast<SVGGradientElementImpl *>(ownerSVGElement()->getElementById(_href));
+
+ if(refGradient)
+ source = refGradient->stopsSource();
+ }
+ }
+
+ return source;
+}
+
+void SVGGradientElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_paintServer)
+ m_paintServer = c->createPaintServer(this);
+}
+
+void SVGGradientElementImpl::removeItem(KSVGCanvas *)
+{
+ delete m_paintServer;
+ m_paintServer = 0;
+}
+
+/*
+@namespace KSVG
+@begin SVGGradientElementImplConstructor::s_hashTable 5
+ SVG_SPREADMETHOD_UNKNOWN KSVG::SVG_SPREADMETHOD_UNKNOWN DontDelete|ReadOnly
+ SVG_SPREADMETHOD_PAD KSVG::SVG_SPREADMETHOD_PAD DontDelete|ReadOnly
+ SVG_SPREADMETHOD_REFLECT KSVG::SVG_SPREADMETHOD_REFLECT DontDelete|ReadOnly
+ SVG_SPREADMETHOD_REPEAT KSVG::SVG_SPREADMETHOD_REPEAT DontDelete|ReadOnly
+@end
+*/
+
+using namespace KJS;
+
+Value SVGGradientElementImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGGradientElementImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGGradientElementImplConstructor>(exec, "[[svggradientelement.constructor]]");
+}
diff --git a/ksvg/impl/SVGGradientElementImpl.h b/ksvg/impl/SVGGradientElementImpl.h
index 60b9d3a9..d560cd17 100644
--- a/ksvg/impl/SVGGradientElementImpl.h
+++ b/ksvg/impl/SVGGradientElementImpl.h
@@ -106,5 +106,3 @@ KJS::Value getSVGGradientElementImplConstructor(KJS::ExecState *exec);
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGHKernElementImpl.cc b/ksvg/impl/SVGHKernElementImpl.cc
deleted file mode 100644
index df310d6e..00000000
--- a/ksvg/impl/SVGHKernElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGHKernElementImpl.h"
-
-using namespace KSVG;
-
-SVGHKernElementImpl::SVGHKernElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGHKernElementImpl::~SVGHKernElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGHKernElementImpl.cpp b/ksvg/impl/SVGHKernElementImpl.cpp
new file mode 100644
index 00000000..64efce26
--- /dev/null
+++ b/ksvg/impl/SVGHKernElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGHKernElementImpl.h"
+
+using namespace KSVG;
+
+SVGHKernElementImpl::SVGHKernElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGHKernElementImpl::~SVGHKernElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGHKernElementImpl.h b/ksvg/impl/SVGHKernElementImpl.h
index 6858b5be..e0822591 100644
--- a/ksvg/impl/SVGHKernElementImpl.h
+++ b/ksvg/impl/SVGHKernElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGHelperImpl.cc b/ksvg/impl/SVGHelperImpl.cc
deleted file mode 100644
index 7378b8f4..00000000
--- a/ksvg/impl/SVGHelperImpl.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- Copyright (C) 2002-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqregexp.h>
-
-#include "SVGRectImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGStylableImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGStringListImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGTransformableImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedLengthListImpl.h"
-
-#include "KSVGCanvas.h"
-#include "CanvasItem.h"
-
-using namespace KSVG;
-
-#include "ksvg_ecma.h"
-#include "ksvg_window.h"
-
-SVGHelperImpl::SVGHelperImpl()
-{
-}
-
-SVGHelperImpl::~SVGHelperImpl()
-{
-}
-
-void SVGHelperImpl::updateItem(KJS::ExecState *exec, const DOM::Node node)
-{
- // Get document
- SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
-
- // Update canvas, recursively if needed
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(node.handle()));
-
- if(shape && shape->item())
- {
- shape->item()->update(UPDATE_TRANSFORM);
- shape->item()->draw();
- shape->blit(doc->canvas());
- }
-
- if(const_cast<DOM::Node &>(node).hasChildNodes())
- {
- DOM::Node iterate = node.firstChild();
- for(; !iterate.isNull(); iterate = iterate.nextSibling())
- updateItem(exec, iterate);
- }
-}
-
-void SVGHelperImpl::copyAttributes(SVGElementImpl *src, SVGElementImpl *dst)
-{
- TQDictIterator<DOM::DOMString> it(src->attributes());
- for(; it.current(); ++it)
- {
- DOM::DOMString name = it.currentKey();
- DOM::DOMString value = it.current()->string();
-
- if(name != "id" && !dst->hasAttribute(name))
- {
- dst->setAttribute(name, value);
- dst->setAttributeInternal(name, value);
- }
- }
-}
-
-void SVGHelperImpl::parseList(SVGStringListImpl *list, char seperator, const TQString &data)
-{
- // TODO : more error checking/reporting
- list->clear();
-
- TQStringList substrings = TQStringList::split(seperator, data);
- TQStringList::ConstIterator it = substrings.begin();
- TQStringList::ConstIterator end = substrings.end();
- for(; it != end; ++it)
- {
- SharedString *string = new SharedString(*it);
- string->ref();
-
- list->appendItem(string);
- }
-}
-
-void SVGHelperImpl::parseLengthList(SVGAnimatedLengthListImpl *list, const TQString &lengths, LengthMode mode, SVGElementImpl *object)
-{
- // get either comma or space delimited lists
- // TODO : more error checking/reporting
- TQStringList sublengths = TQStringList::split(TQRegExp("[, ]"), lengths);
- TQStringList::ConstIterator it = sublengths.begin();
- TQStringList::ConstIterator end = sublengths.end();
-
- SVGLengthImpl *lengthImpl = 0;
- for(; it != end; ++it)
- {
- lengthImpl = new SVGLengthImpl(mode, object);
- lengthImpl->ref();
-
- lengthImpl->setValueAsString(*it);
- list->baseVal()->appendItem(lengthImpl);
- }
-}
-
-void SVGHelperImpl::parseCommaSeperatedList(SVGStringListImpl *list, const TQString &data)
-{
- parseList(list, ',', data);
-}
-
-void SVGHelperImpl::parseSemicolonSeperatedList(SVGStringListImpl *list, const TQString &data)
-{
- parseList(list, ';', data);
-}
-
-void SVGHelperImpl::parseTransformAttribute(SVGTransformListImpl *list, const TQString &transform)
-{
- // Split string for handling 1 transform statement at a time
- TQStringList subtransforms = TQStringList::split(')', transform);
- TQStringList::ConstIterator it = subtransforms.begin();
- TQStringList::ConstIterator end = subtransforms.end();
- for(; it != end; ++it)
- {
- TQStringList subtransform = TQStringList::split('(', (*it));
-
- subtransform[0] = subtransform[0].stripWhiteSpace().lower();
- subtransform[1] = subtransform[1].simplifyWhiteSpace();
- TQRegExp reg("([-]?\\d*\\.?\\d+(?:e[-]?\\d+)?)");
-
- int pos = 0;
- TQStringList params;
-
- while(pos >= 0)
- {
- pos = reg.search(subtransform[1], pos);
- if(pos != -1)
- {
- params += reg.cap(1);
- pos += reg.matchedLength();
- }
- }
-
- if(subtransform[0].startsWith(";") || subtransform[0].startsWith(","))
- subtransform[0] = subtransform[0].right(subtransform[0].length() - 1);
-
- SVGTransformImpl *t = SVGSVGElementImpl::createSVGTransform();
-
- if(subtransform[0] == "rotate")
- {
- if(params.count() == 3)
- t->setRotate(params[0].toDouble(),
- params[1].toDouble(),
- params[2].toDouble());
- else
- t->setRotate(params[0].toDouble(), 0, 0);
- }
- else if(subtransform[0] == "translate")
- {
- if(params.count() == 2)
- t->setTranslate(params[0].toDouble(), params[1].toDouble());
- else // Spec : if only one param given, assume 2nd param to be 0
- t->setTranslate(params[0].toDouble(), 0);
- }
- else if(subtransform[0] == "scale")
- {
- if(params.count() == 2)
- t->setScale(params[0].toDouble(), params[1].toDouble());
- else // Spec : if only one param given, assume uniform scaling
- t->setScale(params[0].toDouble(), params[0].toDouble());
- }
- else if(subtransform[0] == "skewx")
- t->setSkewX(params[0].toDouble());
- else if(subtransform[0] == "skewy")
- t->setSkewY(params[0].toDouble());
- else if(subtransform[0] == "matrix")
- {
- if(params.count() >= 6)
- {
- SVGMatrixImpl *ret = new SVGMatrixImpl(params[0].toDouble(),
- params[1].toDouble(),
- params[2].toDouble(),
- params[3].toDouble(),
- params[4].toDouble(),
- params[5].toDouble());
- t->setMatrix(ret);
- }
- }
-
- list->appendItem(t);
- }
-}
-
-/// convert from user space to "real" pixels on rendering area
-TQRect SVGHelperImpl::fromUserspace(SVGElementImpl *obj, const TQRect &r)
-{
- TQRect sr;
-
- SVGLocatableImpl *locate = dynamic_cast<SVGLocatableImpl *>(obj);
-
- if(locate)
- sr = locate->screenCTM()->qmatrix().mapRect(r);
-
- return sr;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGHelperImpl.cpp b/ksvg/impl/SVGHelperImpl.cpp
new file mode 100644
index 00000000..fb546fbe
--- /dev/null
+++ b/ksvg/impl/SVGHelperImpl.cpp
@@ -0,0 +1,228 @@
+/*
+ Copyright (C) 2002-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqregexp.h>
+
+#include "SVGRectImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGStylableImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGStringListImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGTransformableImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedLengthListImpl.h"
+
+#include "KSVGCanvas.h"
+#include "CanvasItem.h"
+
+using namespace KSVG;
+
+#include "ksvg_ecma.h"
+#include "ksvg_window.h"
+
+SVGHelperImpl::SVGHelperImpl()
+{
+}
+
+SVGHelperImpl::~SVGHelperImpl()
+{
+}
+
+void SVGHelperImpl::updateItem(KJS::ExecState *exec, const DOM::Node node)
+{
+ // Get document
+ SVGDocumentImpl *doc = Window::retrieveActive(exec)->doc();
+
+ // Update canvas, recursively if needed
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(doc->getElementFromHandle(node.handle()));
+
+ if(shape && shape->item())
+ {
+ shape->item()->update(UPDATE_TRANSFORM);
+ shape->item()->draw();
+ shape->blit(doc->canvas());
+ }
+
+ if(const_cast<DOM::Node &>(node).hasChildNodes())
+ {
+ DOM::Node iterate = node.firstChild();
+ for(; !iterate.isNull(); iterate = iterate.nextSibling())
+ updateItem(exec, iterate);
+ }
+}
+
+void SVGHelperImpl::copyAttributes(SVGElementImpl *src, SVGElementImpl *dst)
+{
+ TQDictIterator<DOM::DOMString> it(src->attributes());
+ for(; it.current(); ++it)
+ {
+ DOM::DOMString name = it.currentKey();
+ DOM::DOMString value = it.current()->string();
+
+ if(name != "id" && !dst->hasAttribute(name))
+ {
+ dst->setAttribute(name, value);
+ dst->setAttributeInternal(name, value);
+ }
+ }
+}
+
+void SVGHelperImpl::parseList(SVGStringListImpl *list, char seperator, const TQString &data)
+{
+ // TODO : more error checking/reporting
+ list->clear();
+
+ TQStringList substrings = TQStringList::split(seperator, data);
+ TQStringList::ConstIterator it = substrings.begin();
+ TQStringList::ConstIterator end = substrings.end();
+ for(; it != end; ++it)
+ {
+ SharedString *string = new SharedString(*it);
+ string->ref();
+
+ list->appendItem(string);
+ }
+}
+
+void SVGHelperImpl::parseLengthList(SVGAnimatedLengthListImpl *list, const TQString &lengths, LengthMode mode, SVGElementImpl *object)
+{
+ // get either comma or space delimited lists
+ // TODO : more error checking/reporting
+ TQStringList sublengths = TQStringList::split(TQRegExp("[, ]"), lengths);
+ TQStringList::ConstIterator it = sublengths.begin();
+ TQStringList::ConstIterator end = sublengths.end();
+
+ SVGLengthImpl *lengthImpl = 0;
+ for(; it != end; ++it)
+ {
+ lengthImpl = new SVGLengthImpl(mode, object);
+ lengthImpl->ref();
+
+ lengthImpl->setValueAsString(*it);
+ list->baseVal()->appendItem(lengthImpl);
+ }
+}
+
+void SVGHelperImpl::parseCommaSeperatedList(SVGStringListImpl *list, const TQString &data)
+{
+ parseList(list, ',', data);
+}
+
+void SVGHelperImpl::parseSemicolonSeperatedList(SVGStringListImpl *list, const TQString &data)
+{
+ parseList(list, ';', data);
+}
+
+void SVGHelperImpl::parseTransformAttribute(SVGTransformListImpl *list, const TQString &transform)
+{
+ // Split string for handling 1 transform statement at a time
+ TQStringList subtransforms = TQStringList::split(')', transform);
+ TQStringList::ConstIterator it = subtransforms.begin();
+ TQStringList::ConstIterator end = subtransforms.end();
+ for(; it != end; ++it)
+ {
+ TQStringList subtransform = TQStringList::split('(', (*it));
+
+ subtransform[0] = subtransform[0].stripWhiteSpace().lower();
+ subtransform[1] = subtransform[1].simplifyWhiteSpace();
+ TQRegExp reg("([-]?\\d*\\.?\\d+(?:e[-]?\\d+)?)");
+
+ int pos = 0;
+ TQStringList params;
+
+ while(pos >= 0)
+ {
+ pos = reg.search(subtransform[1], pos);
+ if(pos != -1)
+ {
+ params += reg.cap(1);
+ pos += reg.matchedLength();
+ }
+ }
+
+ if(subtransform[0].startsWith(";") || subtransform[0].startsWith(","))
+ subtransform[0] = subtransform[0].right(subtransform[0].length() - 1);
+
+ SVGTransformImpl *t = SVGSVGElementImpl::createSVGTransform();
+
+ if(subtransform[0] == "rotate")
+ {
+ if(params.count() == 3)
+ t->setRotate(params[0].toDouble(),
+ params[1].toDouble(),
+ params[2].toDouble());
+ else
+ t->setRotate(params[0].toDouble(), 0, 0);
+ }
+ else if(subtransform[0] == "translate")
+ {
+ if(params.count() == 2)
+ t->setTranslate(params[0].toDouble(), params[1].toDouble());
+ else // Spec : if only one param given, assume 2nd param to be 0
+ t->setTranslate(params[0].toDouble(), 0);
+ }
+ else if(subtransform[0] == "scale")
+ {
+ if(params.count() == 2)
+ t->setScale(params[0].toDouble(), params[1].toDouble());
+ else // Spec : if only one param given, assume uniform scaling
+ t->setScale(params[0].toDouble(), params[0].toDouble());
+ }
+ else if(subtransform[0] == "skewx")
+ t->setSkewX(params[0].toDouble());
+ else if(subtransform[0] == "skewy")
+ t->setSkewY(params[0].toDouble());
+ else if(subtransform[0] == "matrix")
+ {
+ if(params.count() >= 6)
+ {
+ SVGMatrixImpl *ret = new SVGMatrixImpl(params[0].toDouble(),
+ params[1].toDouble(),
+ params[2].toDouble(),
+ params[3].toDouble(),
+ params[4].toDouble(),
+ params[5].toDouble());
+ t->setMatrix(ret);
+ }
+ }
+
+ list->appendItem(t);
+ }
+}
+
+/// convert from user space to "real" pixels on rendering area
+TQRect SVGHelperImpl::fromUserspace(SVGElementImpl *obj, const TQRect &r)
+{
+ TQRect sr;
+
+ SVGLocatableImpl *locate = dynamic_cast<SVGLocatableImpl *>(obj);
+
+ if(locate)
+ sr = locate->screenCTM()->qmatrix().mapRect(r);
+
+ return sr;
+}
diff --git a/ksvg/impl/SVGHelperImpl.h b/ksvg/impl/SVGHelperImpl.h
index 86edbf66..873526e5 100644
--- a/ksvg/impl/SVGHelperImpl.h
+++ b/ksvg/impl/SVGHelperImpl.h
@@ -84,5 +84,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGICCColorImpl.cc b/ksvg/impl/SVGICCColorImpl.cc
deleted file mode 100644
index 3e708ee9..00000000
--- a/ksvg/impl/SVGICCColorImpl.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGICCColorImpl.h"
-#include "SVGNumberListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGICCColorImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGICCColorImpl::SVGICCColorImpl() : DOM::DomShared()
-{
- m_colors = new SVGNumberListImpl();
- m_colors->ref();
-}
-
-SVGICCColorImpl::SVGICCColorImpl(const SVGICCColorImpl &other) : DOM::DomShared()
-{
- (*this) = other;
-}
-
-SVGICCColorImpl::~SVGICCColorImpl()
-{
- if(m_colors)
- m_colors->deref();
-}
-
-SVGICCColorImpl &SVGICCColorImpl::operator=(const SVGICCColorImpl &other)
-{
- m_colorProfile = other.m_colorProfile;
- *m_colors = *(other.m_colors);
-
- return *this;
-}
-
-DOM::DOMString SVGICCColorImpl::colorProfile() const
-{
- return m_colorProfile;
-}
-
-void SVGICCColorImpl::setColorProfile(const DOM::DOMString &colorProfile)
-{
- m_colorProfile = colorProfile;
-}
-
-SVGNumberListImpl *SVGICCColorImpl::colors() const
-{
- return m_colors;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGICCColorImpl::s_hashTable 3
- colorProfile SVGICCColorImpl::ColorProfile DontDelete
- colors SVGICCColorImpl::Colors DontDelete|ReadOnly
-@end
-*/
-
-Value SVGICCColorImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case ColorProfile:
- return String(m_colorProfile.string());
- case Colors:
- return m_colors->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGICCColorImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case ColorProfile:
- m_colorProfile = value.toString(exec).string();
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGICCColorImpl.cpp b/ksvg/impl/SVGICCColorImpl.cpp
new file mode 100644
index 00000000..50af51c9
--- /dev/null
+++ b/ksvg/impl/SVGICCColorImpl.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGICCColorImpl.h"
+#include "SVGNumberListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGICCColorImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGICCColorImpl::SVGICCColorImpl() : DOM::DomShared()
+{
+ m_colors = new SVGNumberListImpl();
+ m_colors->ref();
+}
+
+SVGICCColorImpl::SVGICCColorImpl(const SVGICCColorImpl &other) : DOM::DomShared()
+{
+ (*this) = other;
+}
+
+SVGICCColorImpl::~SVGICCColorImpl()
+{
+ if(m_colors)
+ m_colors->deref();
+}
+
+SVGICCColorImpl &SVGICCColorImpl::operator=(const SVGICCColorImpl &other)
+{
+ m_colorProfile = other.m_colorProfile;
+ *m_colors = *(other.m_colors);
+
+ return *this;
+}
+
+DOM::DOMString SVGICCColorImpl::colorProfile() const
+{
+ return m_colorProfile;
+}
+
+void SVGICCColorImpl::setColorProfile(const DOM::DOMString &colorProfile)
+{
+ m_colorProfile = colorProfile;
+}
+
+SVGNumberListImpl *SVGICCColorImpl::colors() const
+{
+ return m_colors;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGICCColorImpl::s_hashTable 3
+ colorProfile SVGICCColorImpl::ColorProfile DontDelete
+ colors SVGICCColorImpl::Colors DontDelete|ReadOnly
+@end
+*/
+
+Value SVGICCColorImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case ColorProfile:
+ return String(m_colorProfile.string());
+ case Colors:
+ return m_colors->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGICCColorImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case ColorProfile:
+ m_colorProfile = value.toString(exec).string();
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGICCColorImpl.h b/ksvg/impl/SVGICCColorImpl.h
index 1427e59c..ff884967 100644
--- a/ksvg/impl/SVGICCColorImpl.h
+++ b/ksvg/impl/SVGICCColorImpl.h
@@ -63,5 +63,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGImageElementImpl.cc b/ksvg/impl/SVGImageElementImpl.cc
deleted file mode 100644
index 49f48e7d..00000000
--- a/ksvg/impl/SVGImageElementImpl.cc
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <tqimage.h>
-#include <tqtimer.h>
-
-#include <kdebug.h>
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-#include "KSVGHelper.h"
-
-#include "SVGRectImpl.h"
-#include "SVGEventImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGImageElementImpl.moc"
-#include "SVGColorProfileElementImpl.h"
-#include "SVGPreserveAspectRatioImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-#include "SVGPatternElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGImageElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGImageElementImpl::SVGImageElementImpl(DOM::ElementImpl *impl) : TQObject(), SVGShapeImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x->ref();
- m_x->baseVal()->setValueAsString("-1");
-
- m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y->ref();
- m_y->baseVal()->setValueAsString("-1");
-
- m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_width->ref();
- m_width->baseVal()->setValueAsString("-1");
-
- m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_height->ref();
- m_height->baseVal()->setValueAsString("-1");
-
- m_preserveAspectRatio = 0;
-
- m_doc = 0;
- m_image = 0;
- m_svgRoot = 0;
- m_colorProfile = 0;
- m_colorProfileApplied = false;
-}
-
-SVGImageElementImpl::~SVGImageElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_preserveAspectRatio)
- m_preserveAspectRatio->deref();
- if(m_doc)
- m_doc->deref();
-
- delete m_image;
-}
-
-SVGAnimatedLengthImpl *SVGImageElementImpl::x()
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGImageElementImpl::y()
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGImageElementImpl::width()
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGImageElementImpl::height()
-{
- return m_height;
-}
-
-SVGAnimatedPreserveAspectRatioImpl *SVGImageElementImpl::preserveAspectRatio() const
-{
- return m_preserveAspectRatio;
-}
-
-/*
-@namespace KSVG
-@namespace KSVG
-@begin SVGImageElementImpl::s_hashTable 7
- x SVGImageElementImpl::X DontDelete|ReadOnly
- y SVGImageElementImpl::Y DontDelete|ReadOnly
- width SVGImageElementImpl::Width DontDelete|ReadOnly
- height SVGImageElementImpl::Height DontDelete|ReadOnly
- preserveAspectRatio SVGImageElementImpl::PreserveAspectRatio DontDelete|ReadOnly
- href SVGImageElementImpl::Href DontDelete|ReadOnly
-@end
-*/
-
-Value SVGImageElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X:
- if(!attributeMode)
- return m_x->cache(exec);
- else
- return Number(m_x->baseVal()->value());
- case Y:
- if(!attributeMode)
- return m_y->cache(exec);
- else
- return Number(m_y->baseVal()->value());
- case Width:
- if(!attributeMode)
- return m_width->cache(exec);
- else
- return Number(m_width->baseVal()->value());
- case Height:
- if(!attributeMode)
- return m_height->cache(exec);
- else
- return Number(m_height->baseVal()->value());
- case PreserveAspectRatio:
- if(m_preserveAspectRatio)
- return m_preserveAspectRatio->cache(exec);
- else
- return Undefined();
- case Href:
- SVGURIReferenceImpl::getValueProperty(exec, token);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGImageElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X:
- x()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Y:
- y()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Width:
- width()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Height:
- height()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case PreserveAspectRatio:
- if(!preserveAspectRatio())
- {
- m_preserveAspectRatio = new SVGAnimatedPreserveAspectRatioImpl();
- m_preserveAspectRatio->ref();
- }
-
- preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(value.toString(exec).qstring());
- break;
- case Href:
- SVGURIReferenceImpl::putValueProperty(exec, SVGURIReferenceImpl::Href, value, attr);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGImageElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_x->baseVal()->value());
- ret->setY(m_y->baseVal()->value());
- ret->setWidth(m_width->baseVal()->value());
- ret->setHeight(m_height->baseVal()->value());
- return ret;
-}
-
-void SVGImageElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- if(KSVG_TOKEN_NOT_PARSED(X))
- KSVG_SET_ALT_ATTRIBUTE(X, "0")
-
- if(KSVG_TOKEN_NOT_PARSED(Y))
- KSVG_SET_ALT_ATTRIBUTE(Y, "0")
-
- if(KSVG_TOKEN_NOT_PARSED(PreserveAspectRatio))
- {
- setAttribute("preserveAspectRatio", "xMidYMid meet");
- KSVG_SET_ALT_ATTRIBUTE(PreserveAspectRatio, "xMidYMid meet")
- }
-}
-
-void SVGImageElementImpl::slotParsingFinished(bool error, const TQString &errorDesc)
-{
- if(error)
- kdDebug(26003) << "Finished with error : " << errorDesc << endl;
- else
- kdDebug(26003) << "Finished without errors!" << endl;
-
- m_svgRoot = m_doc->rootElement();
-}
-
-void SVGImageElementImpl::slotLoadingFinished()
-{
- ownerDoc()->notifyImageLoaded(this);
-}
-
-void SVGImageElementImpl::createItem(KSVGCanvas *c)
-{
- if(!m_item)
- {
- if(!c)
- c = ownerDoc()->canvas();
-
- m_item = c->createImage(this);
- c->insert(m_item);
-
- if(href()->baseVal().string().endsWith(".svg") || href()->baseVal().string().endsWith(".svgz"))
- {
- if(!m_svgRoot)
- {
- m_doc = new SVGDocumentImpl(true, false, this);
- m_doc->ref();
- m_doc->attach(c);
-
- connect(m_doc, TQT_SIGNAL(finishedParsing(bool, const TQString &)), this, TQT_SLOT(slotParsingFinished(bool, const TQString &)));
- connect(m_doc, TQT_SIGNAL(finishedLoading()), this, TQT_SLOT(slotLoadingFinished()));
-
- KURL file;
-
- if(!KURL::isRelativeURL(href()->baseVal().string()))
- file = KURL(href()->baseVal().string());
- else
- file = KURL(ownerDoc()->baseUrl(), href()->baseVal().string());
-
- m_doc->open(file);
-
- // The svg image will add items to the canvas in parallel with the main
- // document, so the z-order will not be correct. Get it to fix this when everything's
- // finished loading.
- ownerDoc()->resortZIndicesOnFinishedLoading();
- ownerDoc()->notifyImageLoading(this);
- }
- else
- m_svgRoot->createItem(c);
- }
- else
- {
- if(!m_image)
- {
- ownerDoc()->newImageJob(this);
- ownerDoc()->notifyImageLoading(this);
- }
- }
- }
-}
-
-void SVGImageElementImpl::removeItem(KSVGCanvas *c)
-{
- if(m_item && c)
- {
- if(m_svgRoot)
- m_svgRoot->removeItem(c);
-
- c->removeItem(m_item);
- m_item = 0;
- }
-}
-
-void SVGImageElementImpl::setupSVGElement(SVGSVGElementImpl *svg)
-{
- // Set up the root svg for an svg image.
- svg->setAttributeInternal("x", TQString("%1").arg(x()->baseVal()->value()));
- svg->setAttributeInternal("y", TQString("%1").arg(y()->baseVal()->value()));
- svg->setAttributeInternal("width", TQString("%1").arg(width()->baseVal()->value()));
- svg->setAttributeInternal("height", TQString("%1").arg(height()->baseVal()->value()));
-
- TQString par = getAttribute("preserveAspectRatio").string().stripWhiteSpace();
-
- if(par.startsWith("defer"))
- {
- if(svg->getAttribute("preserveAspectRatio").isEmpty())
- {
- par.remove("defer");
- svg->setAttribute("preserveAspectRatio", par);
- svg->setAttributeInternal("preserveAspectRatio", par);
- }
- }
- else
- {
- svg->setAttribute("preserveAspectRatio", par);
- svg->setAttributeInternal("preserveAspectRatio", par);
- }
-
- svg->setAttributes();
- svg->setRootParentScreenCTM(getScreenCTM());
-}
-
-void SVGImageElementImpl::onScreenCTMUpdated()
-{
- if(m_svgRoot)
- {
- SVGMatrixImpl *ctm = getScreenCTM();
-
- m_svgRoot->setRootParentScreenCTM(ctm);
- m_svgRoot->invalidateCachedMatrices();
- m_svgRoot->ownerDoc()->syncCachedMatrices();
- }
-}
-
-bool SVGImageElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &, SVGMouseEventImpl *mev)
-{
- // TODO : pointer-events should be stored here, not in SVGStylableImpl.
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
- if(!style || style->getPointerEvents() == PE_NONE)
- return false;
- bool test = true;
- switch(style->getPointerEvents())
- {
- case PE_VISIBLE:
- case PE_VISIBLE_PAINTED:
- case PE_VISIBLE_FILL:
- case PE_VISIBLE_STROKE: test = style->getVisible(); break;
- case PE_PAINTED:
- case PE_FILL:
- case PE_STROKE:
- case PE_ALL: break;
- default: test = false;
- };
-
- if(test && m_item)
- {
- if(m_item->bbox().contains(p))
- {
- mev->setTarget(dynamic_cast<SVGElementImpl *>(this));
- return true;
- }
- }
-
- return false;
-}
-
-void SVGImageElementImpl::setImage(TQImage *image)
-{
- m_image = image;
-
- if(m_image)
- {
- *m_image = m_image->convertDepth(32);
-
- if(m_colorProfile != 0 && !m_colorProfileApplied)
- {
- m_colorProfileApplied = true;
- applyColorProfile();
- }
-
- SVGPatternElementImpl::flushCachedTiles();
-
- if(m_item)
- {
- ownerDoc()->canvas()->invalidate(m_item, false);
- ownerDoc()->rerender();
- }
- }
-
- ownerDoc()->notifyImageLoaded(this);
-}
-
-TQImage SVGImageElementImpl::scaledImage()
-{
- SVGMatrixImpl *matrix = imageMatrix();
- double sx, sy;
-
- matrix->removeScale(&sx, &sy);
- matrix->deref();
-
- TQImage img;
-
- if(sx != 1 || sy != 1)
- {
- int scaledWidth = static_cast<int>(m_image->width() * sx + 0.5);
- int scaledHeight = static_cast<int>(m_image->height() * sy + 0.5);
-
- img = m_image->smoothScale(scaledWidth, scaledHeight);
- }
- else
- img = *m_image;
-
- return img;
-}
-
-SVGMatrixImpl *SVGImageElementImpl::imageMatrix()
-{
- SVGMatrixImpl *ctm = getScreenCTM();
-
- ctm->translate(x()->baseVal()->value(), y()->baseVal()->value());
-
- SVGMatrixImpl *viewboxMatrix = preserveAspectRatio()->baseVal()->getCTM(0, 0, image()->width(), image()->height(), 0, 0, width()->baseVal()->value(), height()->baseVal()->value());
-
- ctm->multiply(viewboxMatrix);
- viewboxMatrix->deref();
-
- return ctm;
-}
-
-SVGMatrixImpl *SVGImageElementImpl::scaledImageMatrix()
-{
- SVGMatrixImpl *matrix = imageMatrix();
- double sx, sy;
-
- matrix->removeScale(&sx, &sy);
-
- if(sx != 1 || sy != 1)
- {
- int imageWidth = static_cast<int>(m_image->width() * sx + 0.5);
- int imageHeight = static_cast<int>(m_image->height() * sy + 0.5);
-
- double trueWidth = m_image->width() * sx;
- double trueHeight = m_image->height() * sy;
-
- matrix->scaleNonUniform(trueWidth / imageWidth, trueHeight / imageHeight);
- }
-
- return matrix;
-}
-
-KSVGPolygon SVGImageElementImpl::clippingShape()
-{
- KSVGRectangle viewport(0, 0, width()->baseVal()->value(), height()->baseVal()->value());
- SVGMatrixImpl *matrix = preserveAspectRatio()->baseVal()->getCTM(0, 0, image()->width(), image()->height(), 0, 0, width()->baseVal()->value(), height()->baseVal()->value());
- KSVGPolygon p = matrix->inverseMap(viewport);
- matrix->deref();
-
- matrix = imageMatrix();
- p = matrix->map(p);
- matrix->deref();
-
- return p;
-}
-
-TQString SVGImageElementImpl::fileName() const
-{
- return href()->baseVal().string();
-}
-
-void SVGImageElementImpl::applyColorProfile()
-{
- m_image = m_colorProfile->correctImage(m_image);
-}
-
-void SVGImageElementImpl::applyColorProfile(SVGColorProfileElementImpl *profile, SVGImageElementImpl *image)
-{
- // Only apply once, if it's the same (Niko)
- if(image->m_colorProfile == profile)
- return;
-
- image->m_colorProfile = profile;
-
- if(image->m_image)
- {
- // Image is already painted, we apply the color profile and repaint it
- image->applyColorProfile();
-
- if(image->item())
- {
- image->ownerDoc()->canvas()->invalidate(image->item(), false);
- image->ownerDoc()->rerender();
- }
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGImageElementImpl.cpp b/ksvg/impl/SVGImageElementImpl.cpp
new file mode 100644
index 00000000..65c678d2
--- /dev/null
+++ b/ksvg/impl/SVGImageElementImpl.cpp
@@ -0,0 +1,520 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <tqimage.h>
+#include <tqtimer.h>
+
+#include <kdebug.h>
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+#include "KSVGHelper.h"
+
+#include "SVGRectImpl.h"
+#include "SVGEventImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGImageElementImpl.moc"
+#include "SVGColorProfileElementImpl.h"
+#include "SVGPreserveAspectRatioImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+#include "SVGPatternElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGImageElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGImageElementImpl::SVGImageElementImpl(DOM::ElementImpl *impl) : TQObject(), SVGShapeImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x->ref();
+ m_x->baseVal()->setValueAsString("-1");
+
+ m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y->ref();
+ m_y->baseVal()->setValueAsString("-1");
+
+ m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_width->ref();
+ m_width->baseVal()->setValueAsString("-1");
+
+ m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_height->ref();
+ m_height->baseVal()->setValueAsString("-1");
+
+ m_preserveAspectRatio = 0;
+
+ m_doc = 0;
+ m_image = 0;
+ m_svgRoot = 0;
+ m_colorProfile = 0;
+ m_colorProfileApplied = false;
+}
+
+SVGImageElementImpl::~SVGImageElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_preserveAspectRatio)
+ m_preserveAspectRatio->deref();
+ if(m_doc)
+ m_doc->deref();
+
+ delete m_image;
+}
+
+SVGAnimatedLengthImpl *SVGImageElementImpl::x()
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGImageElementImpl::y()
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGImageElementImpl::width()
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGImageElementImpl::height()
+{
+ return m_height;
+}
+
+SVGAnimatedPreserveAspectRatioImpl *SVGImageElementImpl::preserveAspectRatio() const
+{
+ return m_preserveAspectRatio;
+}
+
+/*
+@namespace KSVG
+@namespace KSVG
+@begin SVGImageElementImpl::s_hashTable 7
+ x SVGImageElementImpl::X DontDelete|ReadOnly
+ y SVGImageElementImpl::Y DontDelete|ReadOnly
+ width SVGImageElementImpl::Width DontDelete|ReadOnly
+ height SVGImageElementImpl::Height DontDelete|ReadOnly
+ preserveAspectRatio SVGImageElementImpl::PreserveAspectRatio DontDelete|ReadOnly
+ href SVGImageElementImpl::Href DontDelete|ReadOnly
+@end
+*/
+
+Value SVGImageElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X:
+ if(!attributeMode)
+ return m_x->cache(exec);
+ else
+ return Number(m_x->baseVal()->value());
+ case Y:
+ if(!attributeMode)
+ return m_y->cache(exec);
+ else
+ return Number(m_y->baseVal()->value());
+ case Width:
+ if(!attributeMode)
+ return m_width->cache(exec);
+ else
+ return Number(m_width->baseVal()->value());
+ case Height:
+ if(!attributeMode)
+ return m_height->cache(exec);
+ else
+ return Number(m_height->baseVal()->value());
+ case PreserveAspectRatio:
+ if(m_preserveAspectRatio)
+ return m_preserveAspectRatio->cache(exec);
+ else
+ return Undefined();
+ case Href:
+ SVGURIReferenceImpl::getValueProperty(exec, token);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGImageElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X:
+ x()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Y:
+ y()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Width:
+ width()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Height:
+ height()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case PreserveAspectRatio:
+ if(!preserveAspectRatio())
+ {
+ m_preserveAspectRatio = new SVGAnimatedPreserveAspectRatioImpl();
+ m_preserveAspectRatio->ref();
+ }
+
+ preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(value.toString(exec).qstring());
+ break;
+ case Href:
+ SVGURIReferenceImpl::putValueProperty(exec, SVGURIReferenceImpl::Href, value, attr);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGImageElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_x->baseVal()->value());
+ ret->setY(m_y->baseVal()->value());
+ ret->setWidth(m_width->baseVal()->value());
+ ret->setHeight(m_height->baseVal()->value());
+ return ret;
+}
+
+void SVGImageElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ if(KSVG_TOKEN_NOT_PARSED(X))
+ KSVG_SET_ALT_ATTRIBUTE(X, "0")
+
+ if(KSVG_TOKEN_NOT_PARSED(Y))
+ KSVG_SET_ALT_ATTRIBUTE(Y, "0")
+
+ if(KSVG_TOKEN_NOT_PARSED(PreserveAspectRatio))
+ {
+ setAttribute("preserveAspectRatio", "xMidYMid meet");
+ KSVG_SET_ALT_ATTRIBUTE(PreserveAspectRatio, "xMidYMid meet")
+ }
+}
+
+void SVGImageElementImpl::slotParsingFinished(bool error, const TQString &errorDesc)
+{
+ if(error)
+ kdDebug(26003) << "Finished with error : " << errorDesc << endl;
+ else
+ kdDebug(26003) << "Finished without errors!" << endl;
+
+ m_svgRoot = m_doc->rootElement();
+}
+
+void SVGImageElementImpl::slotLoadingFinished()
+{
+ ownerDoc()->notifyImageLoaded(this);
+}
+
+void SVGImageElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!m_item)
+ {
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ m_item = c->createImage(this);
+ c->insert(m_item);
+
+ if(href()->baseVal().string().endsWith(".svg") || href()->baseVal().string().endsWith(".svgz"))
+ {
+ if(!m_svgRoot)
+ {
+ m_doc = new SVGDocumentImpl(true, false, this);
+ m_doc->ref();
+ m_doc->attach(c);
+
+ connect(m_doc, TQT_SIGNAL(finishedParsing(bool, const TQString &)), this, TQT_SLOT(slotParsingFinished(bool, const TQString &)));
+ connect(m_doc, TQT_SIGNAL(finishedLoading()), this, TQT_SLOT(slotLoadingFinished()));
+
+ KURL file;
+
+ if(!KURL::isRelativeURL(href()->baseVal().string()))
+ file = KURL(href()->baseVal().string());
+ else
+ file = KURL(ownerDoc()->baseUrl(), href()->baseVal().string());
+
+ m_doc->open(file);
+
+ // The svg image will add items to the canvas in parallel with the main
+ // document, so the z-order will not be correct. Get it to fix this when everything's
+ // finished loading.
+ ownerDoc()->resortZIndicesOnFinishedLoading();
+ ownerDoc()->notifyImageLoading(this);
+ }
+ else
+ m_svgRoot->createItem(c);
+ }
+ else
+ {
+ if(!m_image)
+ {
+ ownerDoc()->newImageJob(this);
+ ownerDoc()->notifyImageLoading(this);
+ }
+ }
+ }
+}
+
+void SVGImageElementImpl::removeItem(KSVGCanvas *c)
+{
+ if(m_item && c)
+ {
+ if(m_svgRoot)
+ m_svgRoot->removeItem(c);
+
+ c->removeItem(m_item);
+ m_item = 0;
+ }
+}
+
+void SVGImageElementImpl::setupSVGElement(SVGSVGElementImpl *svg)
+{
+ // Set up the root svg for an svg image.
+ svg->setAttributeInternal("x", TQString("%1").arg(x()->baseVal()->value()));
+ svg->setAttributeInternal("y", TQString("%1").arg(y()->baseVal()->value()));
+ svg->setAttributeInternal("width", TQString("%1").arg(width()->baseVal()->value()));
+ svg->setAttributeInternal("height", TQString("%1").arg(height()->baseVal()->value()));
+
+ TQString par = getAttribute("preserveAspectRatio").string().stripWhiteSpace();
+
+ if(par.startsWith("defer"))
+ {
+ if(svg->getAttribute("preserveAspectRatio").isEmpty())
+ {
+ par.remove("defer");
+ svg->setAttribute("preserveAspectRatio", par);
+ svg->setAttributeInternal("preserveAspectRatio", par);
+ }
+ }
+ else
+ {
+ svg->setAttribute("preserveAspectRatio", par);
+ svg->setAttributeInternal("preserveAspectRatio", par);
+ }
+
+ svg->setAttributes();
+ svg->setRootParentScreenCTM(getScreenCTM());
+}
+
+void SVGImageElementImpl::onScreenCTMUpdated()
+{
+ if(m_svgRoot)
+ {
+ SVGMatrixImpl *ctm = getScreenCTM();
+
+ m_svgRoot->setRootParentScreenCTM(ctm);
+ m_svgRoot->invalidateCachedMatrices();
+ m_svgRoot->ownerDoc()->syncCachedMatrices();
+ }
+}
+
+bool SVGImageElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &, SVGMouseEventImpl *mev)
+{
+ // TODO : pointer-events should be stored here, not in SVGStylableImpl.
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
+ if(!style || style->getPointerEvents() == PE_NONE)
+ return false;
+ bool test = true;
+ switch(style->getPointerEvents())
+ {
+ case PE_VISIBLE:
+ case PE_VISIBLE_PAINTED:
+ case PE_VISIBLE_FILL:
+ case PE_VISIBLE_STROKE: test = style->getVisible(); break;
+ case PE_PAINTED:
+ case PE_FILL:
+ case PE_STROKE:
+ case PE_ALL: break;
+ default: test = false;
+ };
+
+ if(test && m_item)
+ {
+ if(m_item->bbox().contains(p))
+ {
+ mev->setTarget(dynamic_cast<SVGElementImpl *>(this));
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void SVGImageElementImpl::setImage(TQImage *image)
+{
+ m_image = image;
+
+ if(m_image)
+ {
+ *m_image = m_image->convertDepth(32);
+
+ if(m_colorProfile != 0 && !m_colorProfileApplied)
+ {
+ m_colorProfileApplied = true;
+ applyColorProfile();
+ }
+
+ SVGPatternElementImpl::flushCachedTiles();
+
+ if(m_item)
+ {
+ ownerDoc()->canvas()->invalidate(m_item, false);
+ ownerDoc()->rerender();
+ }
+ }
+
+ ownerDoc()->notifyImageLoaded(this);
+}
+
+TQImage SVGImageElementImpl::scaledImage()
+{
+ SVGMatrixImpl *matrix = imageMatrix();
+ double sx, sy;
+
+ matrix->removeScale(&sx, &sy);
+ matrix->deref();
+
+ TQImage img;
+
+ if(sx != 1 || sy != 1)
+ {
+ int scaledWidth = static_cast<int>(m_image->width() * sx + 0.5);
+ int scaledHeight = static_cast<int>(m_image->height() * sy + 0.5);
+
+ img = m_image->smoothScale(scaledWidth, scaledHeight);
+ }
+ else
+ img = *m_image;
+
+ return img;
+}
+
+SVGMatrixImpl *SVGImageElementImpl::imageMatrix()
+{
+ SVGMatrixImpl *ctm = getScreenCTM();
+
+ ctm->translate(x()->baseVal()->value(), y()->baseVal()->value());
+
+ SVGMatrixImpl *viewboxMatrix = preserveAspectRatio()->baseVal()->getCTM(0, 0, image()->width(), image()->height(), 0, 0, width()->baseVal()->value(), height()->baseVal()->value());
+
+ ctm->multiply(viewboxMatrix);
+ viewboxMatrix->deref();
+
+ return ctm;
+}
+
+SVGMatrixImpl *SVGImageElementImpl::scaledImageMatrix()
+{
+ SVGMatrixImpl *matrix = imageMatrix();
+ double sx, sy;
+
+ matrix->removeScale(&sx, &sy);
+
+ if(sx != 1 || sy != 1)
+ {
+ int imageWidth = static_cast<int>(m_image->width() * sx + 0.5);
+ int imageHeight = static_cast<int>(m_image->height() * sy + 0.5);
+
+ double trueWidth = m_image->width() * sx;
+ double trueHeight = m_image->height() * sy;
+
+ matrix->scaleNonUniform(trueWidth / imageWidth, trueHeight / imageHeight);
+ }
+
+ return matrix;
+}
+
+KSVGPolygon SVGImageElementImpl::clippingShape()
+{
+ KSVGRectangle viewport(0, 0, width()->baseVal()->value(), height()->baseVal()->value());
+ SVGMatrixImpl *matrix = preserveAspectRatio()->baseVal()->getCTM(0, 0, image()->width(), image()->height(), 0, 0, width()->baseVal()->value(), height()->baseVal()->value());
+ KSVGPolygon p = matrix->inverseMap(viewport);
+ matrix->deref();
+
+ matrix = imageMatrix();
+ p = matrix->map(p);
+ matrix->deref();
+
+ return p;
+}
+
+TQString SVGImageElementImpl::fileName() const
+{
+ return href()->baseVal().string();
+}
+
+void SVGImageElementImpl::applyColorProfile()
+{
+ m_image = m_colorProfile->correctImage(m_image);
+}
+
+void SVGImageElementImpl::applyColorProfile(SVGColorProfileElementImpl *profile, SVGImageElementImpl *image)
+{
+ // Only apply once, if it's the same (Niko)
+ if(image->m_colorProfile == profile)
+ return;
+
+ image->m_colorProfile = profile;
+
+ if(image->m_image)
+ {
+ // Image is already painted, we apply the color profile and repaint it
+ image->applyColorProfile();
+
+ if(image->item())
+ {
+ image->ownerDoc()->canvas()->invalidate(image->item(), false);
+ image->ownerDoc()->rerender();
+ }
+ }
+}
diff --git a/ksvg/impl/SVGImageElementImpl.h b/ksvg/impl/SVGImageElementImpl.h
index 42d7516d..96985440 100644
--- a/ksvg/impl/SVGImageElementImpl.h
+++ b/ksvg/impl/SVGImageElementImpl.h
@@ -137,5 +137,3 @@ KSVG_REGISTER_ELEMENT(SVGImageElementImpl, "image")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLangSpaceImpl.cc b/ksvg/impl/SVGLangSpaceImpl.cc
deleted file mode 100644
index edc35a4d..00000000
--- a/ksvg/impl/SVGLangSpaceImpl.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGLangSpaceImpl.h"
-
-using namespace KSVG;
-
-#include "SVGLangSpaceImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGLangSpaceImpl::SVGLangSpaceImpl()
-{
- KSVG_EMPTY_FLAGS
-
- // Spec: default for xml:space is "default"
- setXmlspace("default");
-}
-
-SVGLangSpaceImpl::~SVGLangSpaceImpl()
-{
-}
-
-void SVGLangSpaceImpl::setXmllang(const DOM::DOMString &xmllang)
-{
- m_xmllang = xmllang;
-}
-
-DOM::DOMString SVGLangSpaceImpl::xmllang() const
-{
- return m_xmllang;
-}
-
-void SVGLangSpaceImpl::setXmlspace(const DOM::DOMString &xmlspace)
-{
- m_xmlspace = xmlspace;
-}
-
-DOM::DOMString SVGLangSpaceImpl::xmlspace() const
-{
- return m_xmlspace;
-}
-
-TQString SVGLangSpaceImpl::handleText(const TQString &data) const
-{
- TQString result = data;
-
- if(xmlspace() == "preserve")
- {
- // Spec: What to do here?
- // It will convert all newline and tab characters into space characters
- result.replace("\n\r", TQString(" "));
- result.replace("\r\n", TQString(" "));
- result.replace('\t', ' ');
- }
- else if(xmlspace() == "default")
- {
- // Spec: What to do here?
- // First, it will remove all newline characters (replace)
- // Then it will convert all tab characters into space characters (simplifyWhiteSpace)
- // Then, it will strip off all leading and trailing space characters (stripWhiteSpace)
- // Then, all contiguous space characters will be consolidated. (simplifyWhiteSpace)
- result.replace('\n', TQString());
- result.replace('\r', TQString());
- result = result.stripWhiteSpace().simplifyWhiteSpace();
- }
-
- return result;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGLangSpaceImpl::s_hashTable 5
- xmllang SVGLangSpaceImpl::XmlLang DontDelete
- xmlspace SVGLangSpaceImpl::XmlSpace DontDelete
- lang SVGLangSpaceImpl::XmlLang DontDelete
- space SVGLangSpaceImpl::XmlSpace DontDelete
-@end
-*/
-
-Value SVGLangSpaceImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case XmlLang:
- return String(m_xmllang.string());
- case XmlSpace:
- return String(m_xmlspace.string());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGLangSpaceImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int /*attr*/)
-{
- switch(token)
- {
- case XmlLang:
- m_xmllang = value.toString(exec).string();
- break;
- case XmlSpace:
- m_xmlspace = value.toString(exec).string();
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLangSpaceImpl.cpp b/ksvg/impl/SVGLangSpaceImpl.cpp
new file mode 100644
index 00000000..f6081401
--- /dev/null
+++ b/ksvg/impl/SVGLangSpaceImpl.cpp
@@ -0,0 +1,128 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGLangSpaceImpl.h"
+
+using namespace KSVG;
+
+#include "SVGLangSpaceImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGLangSpaceImpl::SVGLangSpaceImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ // Spec: default for xml:space is "default"
+ setXmlspace("default");
+}
+
+SVGLangSpaceImpl::~SVGLangSpaceImpl()
+{
+}
+
+void SVGLangSpaceImpl::setXmllang(const DOM::DOMString &xmllang)
+{
+ m_xmllang = xmllang;
+}
+
+DOM::DOMString SVGLangSpaceImpl::xmllang() const
+{
+ return m_xmllang;
+}
+
+void SVGLangSpaceImpl::setXmlspace(const DOM::DOMString &xmlspace)
+{
+ m_xmlspace = xmlspace;
+}
+
+DOM::DOMString SVGLangSpaceImpl::xmlspace() const
+{
+ return m_xmlspace;
+}
+
+TQString SVGLangSpaceImpl::handleText(const TQString &data) const
+{
+ TQString result = data;
+
+ if(xmlspace() == "preserve")
+ {
+ // Spec: What to do here?
+ // It will convert all newline and tab characters into space characters
+ result.replace("\n\r", TQString(" "));
+ result.replace("\r\n", TQString(" "));
+ result.replace('\t', ' ');
+ }
+ else if(xmlspace() == "default")
+ {
+ // Spec: What to do here?
+ // First, it will remove all newline characters (replace)
+ // Then it will convert all tab characters into space characters (simplifyWhiteSpace)
+ // Then, it will strip off all leading and trailing space characters (stripWhiteSpace)
+ // Then, all contiguous space characters will be consolidated. (simplifyWhiteSpace)
+ result.replace('\n', TQString());
+ result.replace('\r', TQString());
+ result = result.stripWhiteSpace().simplifyWhiteSpace();
+ }
+
+ return result;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGLangSpaceImpl::s_hashTable 5
+ xmllang SVGLangSpaceImpl::XmlLang DontDelete
+ xmlspace SVGLangSpaceImpl::XmlSpace DontDelete
+ lang SVGLangSpaceImpl::XmlLang DontDelete
+ space SVGLangSpaceImpl::XmlSpace DontDelete
+@end
+*/
+
+Value SVGLangSpaceImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case XmlLang:
+ return String(m_xmllang.string());
+ case XmlSpace:
+ return String(m_xmlspace.string());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGLangSpaceImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int /*attr*/)
+{
+ switch(token)
+ {
+ case XmlLang:
+ m_xmllang = value.toString(exec).string();
+ break;
+ case XmlSpace:
+ m_xmlspace = value.toString(exec).string();
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGLangSpaceImpl.h b/ksvg/impl/SVGLangSpaceImpl.h
index 099884dc..63d8d4ca 100644
--- a/ksvg/impl/SVGLangSpaceImpl.h
+++ b/ksvg/impl/SVGLangSpaceImpl.h
@@ -63,5 +63,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLengthImpl.cc b/ksvg/impl/SVGLengthImpl.cc
deleted file mode 100644
index a8c9080c..00000000
--- a/ksvg/impl/SVGLengthImpl.cc
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqfont.h>
-#include <tqregexp.h>
-#include <tqwidget.h>
-#include <tqpaintdevicemetrics.h>
-
-#include "SVGLength.h"
-
-#include "SVGRectImpl.h"
-#include "SVGLengthImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGStringListImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedRectImpl.h"
-#include "svgpathparser.h"
-
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-#include "SVGLengthImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-// keep track of textual description of the unit type
-TQString UnitText[] =
-{
- "", "", "%", "em", "ex", "px", "cm", "mm", "in", "pt", "pc"
-};
-
-SVGLengthImpl::SVGLengthImpl(LengthMode mode, SVGElementImpl *context) : DOM::DomShared(), m_mode(mode), m_context(context)
-{
- KSVG_EMPTY_FLAGS
-
- m_unitType = SVG_LENGTHTYPE_UNKNOWN;
- m_value = 0;
- m_valueInSpecifiedUnits = 0;
- m_bboxContext = 0;
-}
-
-SVGLengthImpl::SVGLengthImpl(const SVGLengthImpl &other) : DOM::DomShared()
-{
- (*this) = other;
-}
-
-SVGLengthImpl::~SVGLengthImpl()
-{
-}
-
-double SVGLengthImpl::dpi()
-{
- if(m_context && m_context->ownerDoc())
- {
- if(m_mode == LENGTHMODE_WIDTH)
- return 25.4 * m_context->ownerDoc()->screenPixelsPerMillimeterX();
- else if(m_mode == LENGTHMODE_HEIGHT)
- return 25.4 * m_context->ownerDoc()->screenPixelsPerMillimeterY();
- else if(m_mode == LENGTHMODE_OTHER)
- return 25.4 * m_context->ownerDoc()->screenPixelsPerMillimeterX();
- }
- return 90.0;
-}
-
-SVGLengthImpl &SVGLengthImpl::operator=(const SVGLengthImpl &other)
-{
- m_unitType = other.m_unitType;
- m_value = other.m_value;
- m_valueInSpecifiedUnits = other.m_valueInSpecifiedUnits;
- m_bboxContext = other.m_bboxContext;
- m_mode = other.m_mode;
- m_context = other.m_context;
-
- return *this;
-}
-
-unsigned short SVGLengthImpl::unitType() const
-{
- return m_unitType;
-}
-
-void SVGLengthImpl::setValue(float value)
-{
- m_value = value;
- getValFromPx();
-}
-
-float SVGLengthImpl::value()
-{
- if(m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
- {
- float value = m_valueInSpecifiedUnits / 100.0;
- SVGRectImpl *bbox = 0;
- if(m_bboxContext && (bbox = m_bboxContext->getBBox()))
- {
- float result = 0;
- if(m_mode == LENGTHMODE_WIDTH)
- result = value * bbox->width();
- else if(m_mode == LENGTHMODE_HEIGHT)
- result = value * bbox->height();
- else if(m_mode == LENGTHMODE_OTHER)
- result = value * sqrt(pow(bbox->width(), 2) + pow(bbox->height(), 2)) / sqrt(2.0);
-
- bbox->deref();
- return result;
- }
- else
- return percentageOfViewport();
- }
- else
- return m_value;
-}
-
-void SVGLengthImpl::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
-{
- m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- convertNumToPx();
-}
-
-float SVGLengthImpl::valueInSpecifiedUnits() const
-{
- return m_valueInSpecifiedUnits;
-}
-
-void SVGLengthImpl::setValueAsString(const DOM::DOMString &valueAsString)
-{
- convertStringToPx(valueAsString.string());
-}
-
-DOM::DOMString SVGLengthImpl::valueAsString() const
-{
- DOM::DOMString valueAsString = TQString::number(m_valueInSpecifiedUnits);
- valueAsString += UnitText[m_unitType];
- return valueAsString;
-}
-
-void SVGLengthImpl::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
-{
- m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- m_unitType = unitType;
- convertNumToPx();
-}
-
-void SVGLengthImpl::convertToSpecifiedUnits(unsigned short unitType)
-{
- m_unitType = unitType;
- getValFromPx();
-}
-
-SVGLengthImpl::operator float()
-{
- return valueInSpecifiedUnits();
-}
-
-bool SVGLengthImpl::getValFromPx()
-{
- if(m_unitType == SVG_LENGTHTYPE_UNKNOWN)
- return false;
-
- switch(m_unitType)
- {
- // case SVG_LENGTHTYPE_PERCENTAGE: TODO
- // case SVG_LENGTHTYPE_EMS: TODO
- // case SVG_LENGTHTYPE_EXS: TODO
- //break;
- case SVG_LENGTHTYPE_PX:
- m_valueInSpecifiedUnits = m_value;
- break;
- case SVG_LENGTHTYPE_CM:
- m_valueInSpecifiedUnits = m_value / dpi() * 2.54;
- break;
- case SVG_LENGTHTYPE_MM:
- m_valueInSpecifiedUnits = m_value / dpi() * 25.4;
- break;
- case SVG_LENGTHTYPE_IN:
- m_valueInSpecifiedUnits = m_value / dpi();
- break;
- case SVG_LENGTHTYPE_PT:
- m_valueInSpecifiedUnits = m_value / dpi() * 72.0;
- break;
- case SVG_LENGTHTYPE_PC:
- m_valueInSpecifiedUnits = m_value / dpi() * 6.0;
- break;
- };
- return true;
-}
-
-void SVGLengthImpl::convertStringToPx(TQString s)
-{
- if(s.isEmpty())
- return;
-
- double convNum = 0;
- const char *start = s.latin1();
- const char *end = getNumber(start, convNum);
- m_valueInSpecifiedUnits = convNum;
-
- if(uint(end - start) < s.length())
- {
- if(s.endsWith(UnitText[SVG_LENGTHTYPE_PX]))
- m_unitType = SVG_LENGTHTYPE_PX;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_CM]))
- m_unitType = SVG_LENGTHTYPE_CM;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_PC]))
- m_unitType = SVG_LENGTHTYPE_PC;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_MM]))
- m_unitType = SVG_LENGTHTYPE_MM;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_IN]))
- m_unitType = SVG_LENGTHTYPE_IN;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_PT]))
- m_unitType = SVG_LENGTHTYPE_PT;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_PERCENTAGE]))
- m_unitType = SVG_LENGTHTYPE_PERCENTAGE;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_EMS]))
- m_unitType = SVG_LENGTHTYPE_EMS;
- else if(s.endsWith(UnitText[SVG_LENGTHTYPE_EXS]))
- m_unitType = SVG_LENGTHTYPE_EXS;
- else if(s.isEmpty())
- m_unitType = SVG_LENGTHTYPE_NUMBER;
- else
- m_unitType = SVG_LENGTHTYPE_UNKNOWN;
- }
- else
- m_unitType = SVG_LENGTHTYPE_PX;
- convertNumToPx();
-}
-
-void SVGLengthImpl::convertNumToPx()
-{
- switch(m_unitType)
- {
- case SVG_LENGTHTYPE_PX:
- m_value = m_valueInSpecifiedUnits;
- break;
- case SVG_LENGTHTYPE_CM:
- m_value = (m_valueInSpecifiedUnits / 2.54) * dpi();
- break;
- case SVG_LENGTHTYPE_MM:
- m_value = (m_valueInSpecifiedUnits / 25.4) * dpi();
- break;
- case SVG_LENGTHTYPE_IN:
- m_value = m_valueInSpecifiedUnits * dpi();
- break;
- case SVG_LENGTHTYPE_PT:
- m_value = (m_valueInSpecifiedUnits / 72.0) * dpi();
- break;
- case SVG_LENGTHTYPE_PC:
- m_value = (m_valueInSpecifiedUnits / 6.0) * dpi();
- break;
- case SVG_LENGTHTYPE_EMS: // Be careful here, always recheck coords-units-BE-01.svg after touching (Niko)
- case SVG_LENGTHTYPE_EXS:
- if(m_context)
- {
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(m_context);
- if(!style)
- break;
-
- bool sizeLocal = (style->getFontSize() != -1);
- bool familyLocal = (style->getFontFamily() && style->getFontFamily()->getFirst());
-
- SVGStylableImpl *parentStyle = 0;
- if((!sizeLocal || !familyLocal) && m_context)
- parentStyle = dynamic_cast<SVGStylableImpl *>(m_context->ownerDoc()->getElementFromHandle(m_context->parentNode().handle()));
-
- // Look up font-size in a SAFE way, because at this place
- // processStyle() has NOT yet been called, so we need
- // a different solution (Niko)
- TQString useFont = "Arial";
- double useSize = 12;
-
- if(sizeLocal)
- useSize = style->getFontSize();
- else if(parentStyle && parentStyle->getFontSize() != -1)
- useSize = parentStyle->getFontSize();
-
- if(familyLocal)
- useFont = style->getFontFamily()->getFirst()->string();
- else if(parentStyle && parentStyle->getFontFamily() && parentStyle->getFontFamily()->getFirst())
- useFont = parentStyle->getFontFamily()->getFirst()->string();
-
- if(m_unitType == SVG_LENGTHTYPE_EMS)
- m_value = m_valueInSpecifiedUnits * useSize;
- else
- {
- // Easiest way, use qfont (Niko)
- TQFont font(useFont);
- font.setPixelSize(static_cast<int>(useSize));
-
- TQFontMetrics fm(font);
- m_value = m_valueInSpecifiedUnits * fm.boundingRect('x').height();
- }
- }
- break;
- };
-}
-
-void SVGLengthImpl::convertPercentageToFloat(const TQString &perc, float &result)
-{
- // TODO : more error checking ?
- if(perc.endsWith("%"))
- result = perc.left(perc.length() - 1).toFloat() / 100.0;
- else
- result = perc.toFloat();
-}
-
-TQString SVGLengthImpl::convertValToPercentage(const TQString &val, float benchmark)
-{
- if(val.endsWith("%"))
- return val;
-
- TQString result;
- float temp = val.toFloat();
-
- temp = (temp / benchmark) * 100.0;
- result.setNum(temp);
- result.append("%");
-
- return result;
-}
-
-SVGElementImpl *SVGLengthImpl::context() const
-{
- return m_context;
-}
-
-void SVGLengthImpl::setContext(SVGElementImpl *context)
-{
- m_context = context;
-}
-
-void SVGLengthImpl::setBBoxContext(SVGShapeImpl *bbox)
-{
- m_bboxContext = bbox;
- convertNumToPx();
-}
-
-float SVGLengthImpl::percentageOfViewport()
-{
- float width = 0, height = 0;
- float value = m_valueInSpecifiedUnits / 100.0;
- if(m_context->viewportElement())
- {
- SVGSVGElementImpl *svg = dynamic_cast<SVGSVGElementImpl *>(m_context->viewportElement());
- if(svg)
- {
- // Calculate against viewBox, otherwise svg width/height
- width = svg->viewBox()->baseVal()->width();
- if(width == 0)
- width = svg->width()->baseVal()->value();
- height = svg->viewBox()->baseVal()->height();
- if(height == 0)
- height = svg->height()->baseVal()->value();
- }
-
- if(m_mode == LENGTHMODE_WIDTH)
- return value * width;
- else if(m_mode == LENGTHMODE_HEIGHT)
- return value * height;
- else if(m_mode == LENGTHMODE_OTHER)
- return value * sqrt(pow(width, 2) + pow(height, 2)) / sqrt(2.0);
- }
- else if(m_context == m_context->ownerDoc()->rootElement())
- {
- if(!m_context->ownerDoc()->canvas()) // Happens when parsing <svg width="100%"> with printnodetest
- return 0.0;
-
- TQPaintDeviceMetrics metrics(m_context->ownerDoc()->canvas()->drawWindow());
-
- if(m_mode == LENGTHMODE_WIDTH)
- return value * metrics.width();
- else if(m_mode == LENGTHMODE_HEIGHT)
- return value * metrics.height();
- else if(m_mode == LENGTHMODE_OTHER)
- return value * sqrt(pow(metrics.width(), 2) + pow(metrics.height(), 2)) / sqrt(2.0);
- }
-
- return 0;
-}
-
-// Ecma stuff
-//
-/*
-@namespace KSVG
-@begin SVGLengthImpl::s_hashTable 5
- unitType SVGLengthImpl::UnitType DontDelete|ReadOnly
- value SVGLengthImpl::Value DontDelete
- valueAsString SVGLengthImpl::ValueAsString DontDelete
- valueInSpecifiedUnits SVGLengthImpl::ValueInSpecifiedUnits DontDelete
-@end
-@namespace KSVG
-@begin SVGLengthImplProto::s_hashTable 3
- newValueSpecifiedUnits SVGLengthImpl::NewValueSpecifiedUnits DontDelete|Function 2
- convertToSpecifiedUnits SVGLengthImpl::ConvertToSpecifiedUnits DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGLength", SVGLengthImplProto, SVGLengthImplProtoFunc)
-
-Value SVGLengthImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case UnitType:
- return Number(unitType());
- case Value:
- return Number(m_value);
- case ValueAsString:
- return String(valueAsString().string());
- case ValueInSpecifiedUnits:
- return Number(valueInSpecifiedUnits());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-void SVGLengthImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case Value:
- setValue(value.toNumber(exec));
- SVGHelperImpl::updateItem(exec, *m_context);
- break;
- case ValueAsString:
- setValueAsString(value.toString(exec).string());
- SVGHelperImpl::updateItem(exec, *m_context);
- break;
- case ValueInSpecifiedUnits:
- setValueInSpecifiedUnits(value.toNumber(exec));
- SVGHelperImpl::updateItem(exec, *m_context);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGLengthImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGLengthImpl)
-
- switch(id)
- {
- case SVGLengthImpl::NewValueSpecifiedUnits:
- obj->newValueSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)), args[1].toNumber(exec));
- SVGHelperImpl::updateItem(exec, *obj->context());
- return Undefined();
- case SVGLengthImpl::ConvertToSpecifiedUnits:
- obj->convertToSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)));
- SVGHelperImpl::updateItem(exec, *obj->context());
- return Undefined();
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-/*
-@namespace KSVG
-@begin SVGLengthImplConstructor::s_hashTable 11
- SVG_LENGTHTYPE_UNKNOWN KSVG::SVG_LENGTHTYPE_UNKNOWN DontDelete|ReadOnly
- SVG_LENGTHTYPE_NUMBER KSVG::SVG_LENGTHTYPE_NUMBER DontDelete|ReadOnly
- SVG_LENGTHTYPE_PERCENTAGE KSVG::SVG_LENGTHTYPE_PERCENTAGE DontDelete|ReadOnly
- SVG_LENGTHTYPE_EMS KSVG::SVG_LENGTHTYPE_EMS DontDelete|ReadOnly
- SVG_LENGTHTYPE_EXS KSVG::SVG_LENGTHTYPE_EXS DontDelete|ReadOnly
- SVG_LENGTHTYPE_PX KSVG::SVG_LENGTHTYPE_PX DontDelete|ReadOnly
- SVG_LENGTHTYPE_CM KSVG::SVG_LENGTHTYPE_CM DontDelete|ReadOnly
- SVG_LENGTHTYPE_MM KSVG::SVG_LENGTHTYPE_MM DontDelete|ReadOnly
- SVG_LENGTHTYPE_PT KSVG::SVG_LENGTHTYPE_PT DontDelete|ReadOnly
- SVG_LENGTHTYPE_PC KSVG::SVG_LENGTHTYPE_PC DontDelete|ReadOnly
-@end
-*/
-
-Value SVGLengthImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGLengthImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGLengthImplConstructor>(exec, "[[svglength.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLengthImpl.cpp b/ksvg/impl/SVGLengthImpl.cpp
new file mode 100644
index 00000000..36789ffe
--- /dev/null
+++ b/ksvg/impl/SVGLengthImpl.cpp
@@ -0,0 +1,508 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqfont.h>
+#include <tqregexp.h>
+#include <tqwidget.h>
+#include <tqpaintdevicemetrics.h>
+
+#include "SVGLength.h"
+
+#include "SVGRectImpl.h"
+#include "SVGLengthImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGStringListImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedRectImpl.h"
+#include "svgpathparser.h"
+
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+#include "SVGLengthImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+// keep track of textual description of the unit type
+TQString UnitText[] =
+{
+ "", "", "%", "em", "ex", "px", "cm", "mm", "in", "pt", "pc"
+};
+
+SVGLengthImpl::SVGLengthImpl(LengthMode mode, SVGElementImpl *context) : DOM::DomShared(), m_mode(mode), m_context(context)
+{
+ KSVG_EMPTY_FLAGS
+
+ m_unitType = SVG_LENGTHTYPE_UNKNOWN;
+ m_value = 0;
+ m_valueInSpecifiedUnits = 0;
+ m_bboxContext = 0;
+}
+
+SVGLengthImpl::SVGLengthImpl(const SVGLengthImpl &other) : DOM::DomShared()
+{
+ (*this) = other;
+}
+
+SVGLengthImpl::~SVGLengthImpl()
+{
+}
+
+double SVGLengthImpl::dpi()
+{
+ if(m_context && m_context->ownerDoc())
+ {
+ if(m_mode == LENGTHMODE_WIDTH)
+ return 25.4 * m_context->ownerDoc()->screenPixelsPerMillimeterX();
+ else if(m_mode == LENGTHMODE_HEIGHT)
+ return 25.4 * m_context->ownerDoc()->screenPixelsPerMillimeterY();
+ else if(m_mode == LENGTHMODE_OTHER)
+ return 25.4 * m_context->ownerDoc()->screenPixelsPerMillimeterX();
+ }
+ return 90.0;
+}
+
+SVGLengthImpl &SVGLengthImpl::operator=(const SVGLengthImpl &other)
+{
+ m_unitType = other.m_unitType;
+ m_value = other.m_value;
+ m_valueInSpecifiedUnits = other.m_valueInSpecifiedUnits;
+ m_bboxContext = other.m_bboxContext;
+ m_mode = other.m_mode;
+ m_context = other.m_context;
+
+ return *this;
+}
+
+unsigned short SVGLengthImpl::unitType() const
+{
+ return m_unitType;
+}
+
+void SVGLengthImpl::setValue(float value)
+{
+ m_value = value;
+ getValFromPx();
+}
+
+float SVGLengthImpl::value()
+{
+ if(m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
+ {
+ float value = m_valueInSpecifiedUnits / 100.0;
+ SVGRectImpl *bbox = 0;
+ if(m_bboxContext && (bbox = m_bboxContext->getBBox()))
+ {
+ float result = 0;
+ if(m_mode == LENGTHMODE_WIDTH)
+ result = value * bbox->width();
+ else if(m_mode == LENGTHMODE_HEIGHT)
+ result = value * bbox->height();
+ else if(m_mode == LENGTHMODE_OTHER)
+ result = value * sqrt(pow(bbox->width(), 2) + pow(bbox->height(), 2)) / sqrt(2.0);
+
+ bbox->deref();
+ return result;
+ }
+ else
+ return percentageOfViewport();
+ }
+ else
+ return m_value;
+}
+
+void SVGLengthImpl::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
+{
+ m_valueInSpecifiedUnits = valueInSpecifiedUnits;
+ convertNumToPx();
+}
+
+float SVGLengthImpl::valueInSpecifiedUnits() const
+{
+ return m_valueInSpecifiedUnits;
+}
+
+void SVGLengthImpl::setValueAsString(const DOM::DOMString &valueAsString)
+{
+ convertStringToPx(valueAsString.string());
+}
+
+DOM::DOMString SVGLengthImpl::valueAsString() const
+{
+ DOM::DOMString valueAsString = TQString::number(m_valueInSpecifiedUnits);
+ valueAsString += UnitText[m_unitType];
+ return valueAsString;
+}
+
+void SVGLengthImpl::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
+{
+ m_valueInSpecifiedUnits = valueInSpecifiedUnits;
+ m_unitType = unitType;
+ convertNumToPx();
+}
+
+void SVGLengthImpl::convertToSpecifiedUnits(unsigned short unitType)
+{
+ m_unitType = unitType;
+ getValFromPx();
+}
+
+SVGLengthImpl::operator float()
+{
+ return valueInSpecifiedUnits();
+}
+
+bool SVGLengthImpl::getValFromPx()
+{
+ if(m_unitType == SVG_LENGTHTYPE_UNKNOWN)
+ return false;
+
+ switch(m_unitType)
+ {
+ // case SVG_LENGTHTYPE_PERCENTAGE: TODO
+ // case SVG_LENGTHTYPE_EMS: TODO
+ // case SVG_LENGTHTYPE_EXS: TODO
+ //break;
+ case SVG_LENGTHTYPE_PX:
+ m_valueInSpecifiedUnits = m_value;
+ break;
+ case SVG_LENGTHTYPE_CM:
+ m_valueInSpecifiedUnits = m_value / dpi() * 2.54;
+ break;
+ case SVG_LENGTHTYPE_MM:
+ m_valueInSpecifiedUnits = m_value / dpi() * 25.4;
+ break;
+ case SVG_LENGTHTYPE_IN:
+ m_valueInSpecifiedUnits = m_value / dpi();
+ break;
+ case SVG_LENGTHTYPE_PT:
+ m_valueInSpecifiedUnits = m_value / dpi() * 72.0;
+ break;
+ case SVG_LENGTHTYPE_PC:
+ m_valueInSpecifiedUnits = m_value / dpi() * 6.0;
+ break;
+ };
+ return true;
+}
+
+void SVGLengthImpl::convertStringToPx(TQString s)
+{
+ if(s.isEmpty())
+ return;
+
+ double convNum = 0;
+ const char *start = s.latin1();
+ const char *end = getNumber(start, convNum);
+ m_valueInSpecifiedUnits = convNum;
+
+ if(uint(end - start) < s.length())
+ {
+ if(s.endsWith(UnitText[SVG_LENGTHTYPE_PX]))
+ m_unitType = SVG_LENGTHTYPE_PX;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_CM]))
+ m_unitType = SVG_LENGTHTYPE_CM;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_PC]))
+ m_unitType = SVG_LENGTHTYPE_PC;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_MM]))
+ m_unitType = SVG_LENGTHTYPE_MM;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_IN]))
+ m_unitType = SVG_LENGTHTYPE_IN;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_PT]))
+ m_unitType = SVG_LENGTHTYPE_PT;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_PERCENTAGE]))
+ m_unitType = SVG_LENGTHTYPE_PERCENTAGE;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_EMS]))
+ m_unitType = SVG_LENGTHTYPE_EMS;
+ else if(s.endsWith(UnitText[SVG_LENGTHTYPE_EXS]))
+ m_unitType = SVG_LENGTHTYPE_EXS;
+ else if(s.isEmpty())
+ m_unitType = SVG_LENGTHTYPE_NUMBER;
+ else
+ m_unitType = SVG_LENGTHTYPE_UNKNOWN;
+ }
+ else
+ m_unitType = SVG_LENGTHTYPE_PX;
+ convertNumToPx();
+}
+
+void SVGLengthImpl::convertNumToPx()
+{
+ switch(m_unitType)
+ {
+ case SVG_LENGTHTYPE_PX:
+ m_value = m_valueInSpecifiedUnits;
+ break;
+ case SVG_LENGTHTYPE_CM:
+ m_value = (m_valueInSpecifiedUnits / 2.54) * dpi();
+ break;
+ case SVG_LENGTHTYPE_MM:
+ m_value = (m_valueInSpecifiedUnits / 25.4) * dpi();
+ break;
+ case SVG_LENGTHTYPE_IN:
+ m_value = m_valueInSpecifiedUnits * dpi();
+ break;
+ case SVG_LENGTHTYPE_PT:
+ m_value = (m_valueInSpecifiedUnits / 72.0) * dpi();
+ break;
+ case SVG_LENGTHTYPE_PC:
+ m_value = (m_valueInSpecifiedUnits / 6.0) * dpi();
+ break;
+ case SVG_LENGTHTYPE_EMS: // Be careful here, always recheck coords-units-BE-01.svg after touching (Niko)
+ case SVG_LENGTHTYPE_EXS:
+ if(m_context)
+ {
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(m_context);
+ if(!style)
+ break;
+
+ bool sizeLocal = (style->getFontSize() != -1);
+ bool familyLocal = (style->getFontFamily() && style->getFontFamily()->getFirst());
+
+ SVGStylableImpl *parentStyle = 0;
+ if((!sizeLocal || !familyLocal) && m_context)
+ parentStyle = dynamic_cast<SVGStylableImpl *>(m_context->ownerDoc()->getElementFromHandle(m_context->parentNode().handle()));
+
+ // Look up font-size in a SAFE way, because at this place
+ // processStyle() has NOT yet been called, so we need
+ // a different solution (Niko)
+ TQString useFont = "Arial";
+ double useSize = 12;
+
+ if(sizeLocal)
+ useSize = style->getFontSize();
+ else if(parentStyle && parentStyle->getFontSize() != -1)
+ useSize = parentStyle->getFontSize();
+
+ if(familyLocal)
+ useFont = style->getFontFamily()->getFirst()->string();
+ else if(parentStyle && parentStyle->getFontFamily() && parentStyle->getFontFamily()->getFirst())
+ useFont = parentStyle->getFontFamily()->getFirst()->string();
+
+ if(m_unitType == SVG_LENGTHTYPE_EMS)
+ m_value = m_valueInSpecifiedUnits * useSize;
+ else
+ {
+ // Easiest way, use qfont (Niko)
+ TQFont font(useFont);
+ font.setPixelSize(static_cast<int>(useSize));
+
+ TQFontMetrics fm(font);
+ m_value = m_valueInSpecifiedUnits * fm.boundingRect('x').height();
+ }
+ }
+ break;
+ };
+}
+
+void SVGLengthImpl::convertPercentageToFloat(const TQString &perc, float &result)
+{
+ // TODO : more error checking ?
+ if(perc.endsWith("%"))
+ result = perc.left(perc.length() - 1).toFloat() / 100.0;
+ else
+ result = perc.toFloat();
+}
+
+TQString SVGLengthImpl::convertValToPercentage(const TQString &val, float benchmark)
+{
+ if(val.endsWith("%"))
+ return val;
+
+ TQString result;
+ float temp = val.toFloat();
+
+ temp = (temp / benchmark) * 100.0;
+ result.setNum(temp);
+ result.append("%");
+
+ return result;
+}
+
+SVGElementImpl *SVGLengthImpl::context() const
+{
+ return m_context;
+}
+
+void SVGLengthImpl::setContext(SVGElementImpl *context)
+{
+ m_context = context;
+}
+
+void SVGLengthImpl::setBBoxContext(SVGShapeImpl *bbox)
+{
+ m_bboxContext = bbox;
+ convertNumToPx();
+}
+
+float SVGLengthImpl::percentageOfViewport()
+{
+ float width = 0, height = 0;
+ float value = m_valueInSpecifiedUnits / 100.0;
+ if(m_context->viewportElement())
+ {
+ SVGSVGElementImpl *svg = dynamic_cast<SVGSVGElementImpl *>(m_context->viewportElement());
+ if(svg)
+ {
+ // Calculate against viewBox, otherwise svg width/height
+ width = svg->viewBox()->baseVal()->width();
+ if(width == 0)
+ width = svg->width()->baseVal()->value();
+ height = svg->viewBox()->baseVal()->height();
+ if(height == 0)
+ height = svg->height()->baseVal()->value();
+ }
+
+ if(m_mode == LENGTHMODE_WIDTH)
+ return value * width;
+ else if(m_mode == LENGTHMODE_HEIGHT)
+ return value * height;
+ else if(m_mode == LENGTHMODE_OTHER)
+ return value * sqrt(pow(width, 2) + pow(height, 2)) / sqrt(2.0);
+ }
+ else if(m_context == m_context->ownerDoc()->rootElement())
+ {
+ if(!m_context->ownerDoc()->canvas()) // Happens when parsing <svg width="100%"> with printnodetest
+ return 0.0;
+
+ TQPaintDeviceMetrics metrics(m_context->ownerDoc()->canvas()->drawWindow());
+
+ if(m_mode == LENGTHMODE_WIDTH)
+ return value * metrics.width();
+ else if(m_mode == LENGTHMODE_HEIGHT)
+ return value * metrics.height();
+ else if(m_mode == LENGTHMODE_OTHER)
+ return value * sqrt(pow(metrics.width(), 2) + pow(metrics.height(), 2)) / sqrt(2.0);
+ }
+
+ return 0;
+}
+
+// Ecma stuff
+//
+/*
+@namespace KSVG
+@begin SVGLengthImpl::s_hashTable 5
+ unitType SVGLengthImpl::UnitType DontDelete|ReadOnly
+ value SVGLengthImpl::Value DontDelete
+ valueAsString SVGLengthImpl::ValueAsString DontDelete
+ valueInSpecifiedUnits SVGLengthImpl::ValueInSpecifiedUnits DontDelete
+@end
+@namespace KSVG
+@begin SVGLengthImplProto::s_hashTable 3
+ newValueSpecifiedUnits SVGLengthImpl::NewValueSpecifiedUnits DontDelete|Function 2
+ convertToSpecifiedUnits SVGLengthImpl::ConvertToSpecifiedUnits DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGLength", SVGLengthImplProto, SVGLengthImplProtoFunc)
+
+Value SVGLengthImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case UnitType:
+ return Number(unitType());
+ case Value:
+ return Number(m_value);
+ case ValueAsString:
+ return String(valueAsString().string());
+ case ValueInSpecifiedUnits:
+ return Number(valueInSpecifiedUnits());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+void SVGLengthImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case Value:
+ setValue(value.toNumber(exec));
+ SVGHelperImpl::updateItem(exec, *m_context);
+ break;
+ case ValueAsString:
+ setValueAsString(value.toString(exec).string());
+ SVGHelperImpl::updateItem(exec, *m_context);
+ break;
+ case ValueInSpecifiedUnits:
+ setValueInSpecifiedUnits(value.toNumber(exec));
+ SVGHelperImpl::updateItem(exec, *m_context);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGLengthImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGLengthImpl)
+
+ switch(id)
+ {
+ case SVGLengthImpl::NewValueSpecifiedUnits:
+ obj->newValueSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)), args[1].toNumber(exec));
+ SVGHelperImpl::updateItem(exec, *obj->context());
+ return Undefined();
+ case SVGLengthImpl::ConvertToSpecifiedUnits:
+ obj->convertToSpecifiedUnits(static_cast<unsigned short>(args[0].toNumber(exec)));
+ SVGHelperImpl::updateItem(exec, *obj->context());
+ return Undefined();
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+/*
+@namespace KSVG
+@begin SVGLengthImplConstructor::s_hashTable 11
+ SVG_LENGTHTYPE_UNKNOWN KSVG::SVG_LENGTHTYPE_UNKNOWN DontDelete|ReadOnly
+ SVG_LENGTHTYPE_NUMBER KSVG::SVG_LENGTHTYPE_NUMBER DontDelete|ReadOnly
+ SVG_LENGTHTYPE_PERCENTAGE KSVG::SVG_LENGTHTYPE_PERCENTAGE DontDelete|ReadOnly
+ SVG_LENGTHTYPE_EMS KSVG::SVG_LENGTHTYPE_EMS DontDelete|ReadOnly
+ SVG_LENGTHTYPE_EXS KSVG::SVG_LENGTHTYPE_EXS DontDelete|ReadOnly
+ SVG_LENGTHTYPE_PX KSVG::SVG_LENGTHTYPE_PX DontDelete|ReadOnly
+ SVG_LENGTHTYPE_CM KSVG::SVG_LENGTHTYPE_CM DontDelete|ReadOnly
+ SVG_LENGTHTYPE_MM KSVG::SVG_LENGTHTYPE_MM DontDelete|ReadOnly
+ SVG_LENGTHTYPE_PT KSVG::SVG_LENGTHTYPE_PT DontDelete|ReadOnly
+ SVG_LENGTHTYPE_PC KSVG::SVG_LENGTHTYPE_PC DontDelete|ReadOnly
+@end
+*/
+
+Value SVGLengthImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGLengthImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGLengthImplConstructor>(exec, "[[svglength.constructor]]");
+}
diff --git a/ksvg/impl/SVGLengthImpl.h b/ksvg/impl/SVGLengthImpl.h
index f1254c25..0bd29cee 100644
--- a/ksvg/impl/SVGLengthImpl.h
+++ b/ksvg/impl/SVGLengthImpl.h
@@ -132,5 +132,3 @@ KSVG_DEFINE_PROTOTYPE(SVGLengthImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGLengthImplProtoFunc, SVGLengthImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLengthListImpl.cc b/ksvg/impl/SVGLengthListImpl.cc
deleted file mode 100644
index 31215ddd..00000000
--- a/ksvg/impl/SVGLengthListImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGLengthListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGLengthListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGLengthListImpl::s_hashTable 2
- numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGLengthListImplProto::s_hashTable 11
- getItem SVGListDefs::GetItem DontDelete|Function 1
- removeItem SVGListDefs::RemoveItem DontDelete|Function 1
- appendItem SVGListDefs::AppendItem DontDelete|Function 1
- initialize SVGListDefs::Initialize DontDelete|Function 1
- insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
- replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
- clear SVGListDefs::Clear DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGLengthList", SVGLengthListImplProto, SVGLengthListImplProtoFunc)
-
-Value SVGLengthListImpl::getValueProperty(ExecState *exec, int token) const
-{
- return SVGList<SVGLengthImpl>::getValueProperty(exec, token);
-}
-
-Value SVGLengthListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGLengthListImpl)
-
- return obj->call(exec, static_cast<SVGList<SVGLengthImpl> *>(obj), args, id);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLengthListImpl.cpp b/ksvg/impl/SVGLengthListImpl.cpp
new file mode 100644
index 00000000..2966dec8
--- /dev/null
+++ b/ksvg/impl/SVGLengthListImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGLengthListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGLengthListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGLengthListImpl::s_hashTable 2
+ numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGLengthListImplProto::s_hashTable 11
+ getItem SVGListDefs::GetItem DontDelete|Function 1
+ removeItem SVGListDefs::RemoveItem DontDelete|Function 1
+ appendItem SVGListDefs::AppendItem DontDelete|Function 1
+ initialize SVGListDefs::Initialize DontDelete|Function 1
+ insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
+ replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
+ clear SVGListDefs::Clear DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGLengthList", SVGLengthListImplProto, SVGLengthListImplProtoFunc)
+
+Value SVGLengthListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ return SVGList<SVGLengthImpl>::getValueProperty(exec, token);
+}
+
+Value SVGLengthListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGLengthListImpl)
+
+ return obj->call(exec, static_cast<SVGList<SVGLengthImpl> *>(obj), args, id);
+}
diff --git a/ksvg/impl/SVGLengthListImpl.h b/ksvg/impl/SVGLengthListImpl.h
index 7ef8c80d..10e8de95 100644
--- a/ksvg/impl/SVGLengthListImpl.h
+++ b/ksvg/impl/SVGLengthListImpl.h
@@ -44,5 +44,3 @@ KSVG_DEFINE_PROTOTYPE(SVGLengthListImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGLengthListImplProtoFunc, SVGLengthListImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLineElementImpl.cc b/ksvg/impl/SVGLineElementImpl.cc
deleted file mode 100644
index 2db23950..00000000
--- a/ksvg/impl/SVGLineElementImpl.cc
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-#include <tdeglobal.h>
-
-#include <kdebug.h>
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-#include "SVGRectImpl.h"
-#include "SVGAngleImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGLineElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-
-using namespace KSVG;
-
-#include "SVGLineElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGLineElementImpl::SVGLineElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x1 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x1->ref();
- m_x1->baseVal()->setValueAsString("-1");
-
- m_y1 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y1->ref();
- m_y1->baseVal()->setValueAsString("-1");
-
- m_x2 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x2->ref();
- m_x2->baseVal()->setValueAsString("-1");
-
- m_y2 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y2->ref();
- m_y2->baseVal()->setValueAsString("-1");
-}
-
-SVGLineElementImpl::~SVGLineElementImpl()
-{
- if(m_x1)
- m_x1->deref();
- if(m_x2)
- m_x2->deref();
- if(m_y1)
- m_y1->deref();
- if(m_y2)
- m_y2->deref();
-}
-
-SVGAnimatedLengthImpl *SVGLineElementImpl::x1()
-{
- return m_x1;
-}
-
-SVGAnimatedLengthImpl *SVGLineElementImpl::y1()
-{
- return m_y1;
-}
-
-SVGAnimatedLengthImpl *SVGLineElementImpl::x2()
-{
- return m_x2;
-}
-
-SVGAnimatedLengthImpl *SVGLineElementImpl::y2()
-{
- return m_y2;
-}
-
-/*
-@namespace KSVG
-@begin SVGLineElementImpl::s_hashTable 5
- x1 SVGLineElementImpl::X1 DontDelete|ReadOnly
- y1 SVGLineElementImpl::Y1 DontDelete|ReadOnly
- x2 SVGLineElementImpl::X2 DontDelete|ReadOnly
- y2 SVGLineElementImpl::Y2 DontDelete|ReadOnly
-@end
-*/
-
-Value SVGLineElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X1:
- if(!attributeMode)
- return m_x1->cache(exec);
- else
- return Number(m_x1->baseVal()->value());
- case Y1:
- if(!attributeMode)
- return m_y1->cache(exec);
- else
- return Number(m_y1->baseVal()->value());
- case X2:
- if(!attributeMode)
- return m_x2->cache(exec);
- else
- return Number(m_x2->baseVal()->value());
- case Y2:
- if(!attributeMode)
- return m_y2->cache(exec);
- else
- return Number(m_y2->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGLineElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X1:
- x1()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Y1:
- y1()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case X2:
- x2()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Y2:
- y2()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGLineElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
-
- float minx = kMin(m_x1->baseVal()->value(), m_x2->baseVal()->value());
- float miny = kMin(m_y1->baseVal()->value(), m_y2->baseVal()->value());
- float maxx = kMax(m_x1->baseVal()->value(), m_x2->baseVal()->value());
- float maxy = kMax(m_y1->baseVal()->value(), m_y2->baseVal()->value());
- ret->setX(minx);
- ret->setY(miny);
- ret->setWidth(maxx - minx);
- ret->setHeight(maxy - miny);
-
- return ret;
-}
-
-void SVGLineElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(X1))
- KSVG_SET_ALT_ATTRIBUTE(X1, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Y1))
- KSVG_SET_ALT_ATTRIBUTE(Y1, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(X2))
- KSVG_SET_ALT_ATTRIBUTE(X2, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Y2))
- KSVG_SET_ALT_ATTRIBUTE(Y2, "0")
-}
-
-void SVGLineElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createLine(this);
- c->insert(m_item);
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLineElementImpl.cpp b/ksvg/impl/SVGLineElementImpl.cpp
new file mode 100644
index 00000000..eee19d06
--- /dev/null
+++ b/ksvg/impl/SVGLineElementImpl.cpp
@@ -0,0 +1,211 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+#include <tdeglobal.h>
+
+#include <kdebug.h>
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+#include "SVGRectImpl.h"
+#include "SVGAngleImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGLineElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+
+using namespace KSVG;
+
+#include "SVGLineElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGLineElementImpl::SVGLineElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x1 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x1->ref();
+ m_x1->baseVal()->setValueAsString("-1");
+
+ m_y1 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y1->ref();
+ m_y1->baseVal()->setValueAsString("-1");
+
+ m_x2 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x2->ref();
+ m_x2->baseVal()->setValueAsString("-1");
+
+ m_y2 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y2->ref();
+ m_y2->baseVal()->setValueAsString("-1");
+}
+
+SVGLineElementImpl::~SVGLineElementImpl()
+{
+ if(m_x1)
+ m_x1->deref();
+ if(m_x2)
+ m_x2->deref();
+ if(m_y1)
+ m_y1->deref();
+ if(m_y2)
+ m_y2->deref();
+}
+
+SVGAnimatedLengthImpl *SVGLineElementImpl::x1()
+{
+ return m_x1;
+}
+
+SVGAnimatedLengthImpl *SVGLineElementImpl::y1()
+{
+ return m_y1;
+}
+
+SVGAnimatedLengthImpl *SVGLineElementImpl::x2()
+{
+ return m_x2;
+}
+
+SVGAnimatedLengthImpl *SVGLineElementImpl::y2()
+{
+ return m_y2;
+}
+
+/*
+@namespace KSVG
+@begin SVGLineElementImpl::s_hashTable 5
+ x1 SVGLineElementImpl::X1 DontDelete|ReadOnly
+ y1 SVGLineElementImpl::Y1 DontDelete|ReadOnly
+ x2 SVGLineElementImpl::X2 DontDelete|ReadOnly
+ y2 SVGLineElementImpl::Y2 DontDelete|ReadOnly
+@end
+*/
+
+Value SVGLineElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X1:
+ if(!attributeMode)
+ return m_x1->cache(exec);
+ else
+ return Number(m_x1->baseVal()->value());
+ case Y1:
+ if(!attributeMode)
+ return m_y1->cache(exec);
+ else
+ return Number(m_y1->baseVal()->value());
+ case X2:
+ if(!attributeMode)
+ return m_x2->cache(exec);
+ else
+ return Number(m_x2->baseVal()->value());
+ case Y2:
+ if(!attributeMode)
+ return m_y2->cache(exec);
+ else
+ return Number(m_y2->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGLineElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X1:
+ x1()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Y1:
+ y1()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case X2:
+ x2()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Y2:
+ y2()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGLineElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+
+ float minx = kMin(m_x1->baseVal()->value(), m_x2->baseVal()->value());
+ float miny = kMin(m_y1->baseVal()->value(), m_y2->baseVal()->value());
+ float maxx = kMax(m_x1->baseVal()->value(), m_x2->baseVal()->value());
+ float maxy = kMax(m_y1->baseVal()->value(), m_y2->baseVal()->value());
+ ret->setX(minx);
+ ret->setY(miny);
+ ret->setWidth(maxx - minx);
+ ret->setHeight(maxy - miny);
+
+ return ret;
+}
+
+void SVGLineElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(X1))
+ KSVG_SET_ALT_ATTRIBUTE(X1, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Y1))
+ KSVG_SET_ALT_ATTRIBUTE(Y1, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(X2))
+ KSVG_SET_ALT_ATTRIBUTE(X2, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Y2))
+ KSVG_SET_ALT_ATTRIBUTE(Y2, "0")
+}
+
+void SVGLineElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createLine(this);
+ c->insert(m_item);
+ }
+}
diff --git a/ksvg/impl/SVGLineElementImpl.h b/ksvg/impl/SVGLineElementImpl.h
index 725881a3..06f5fb32 100644
--- a/ksvg/impl/SVGLineElementImpl.h
+++ b/ksvg/impl/SVGLineElementImpl.h
@@ -82,5 +82,3 @@ KSVG_REGISTER_ELEMENT(SVGLineElementImpl, "line")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLinearGradientElementImpl.cc b/ksvg/impl/SVGLinearGradientElementImpl.cc
deleted file mode 100644
index c08f1417..00000000
--- a/ksvg/impl/SVGLinearGradientElementImpl.cc
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGradientElement.h"
-#include "SVGLinearGradientElementImpl.h"
-
-#include "SVGDocumentImpl.h"
-#include "KSVGCanvas.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGLengthImpl.h"
-#include "SVGUnitConverter.h"
-
-using namespace KSVG;
-
-#include "SVGLinearGradientElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGLinearGradientElementImpl::SVGLinearGradientElementImpl(DOM::ElementImpl *impl) : SVGGradientElementImpl(impl)
-{
- KSVG_EMPTY_FLAGS
-
- m_x1 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x1->ref();
-
- m_y1 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y1->ref();
-
- m_x2 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x2->ref();
-
- m_y2 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y2->ref();
-
- converter()->add(m_x1);
- converter()->add(m_y1);
- converter()->add(m_x2);
- converter()->add(m_y2);
-}
-
-SVGLinearGradientElementImpl::~SVGLinearGradientElementImpl()
-{
- if(m_x1)
- m_x1->deref();
- if(m_y1)
- m_y1->deref();
- if(m_x2)
- m_x2->deref();
- if(m_y2)
- m_y2->deref();
-}
-
-SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::x1() const
-{
- return m_x1;
-}
-
-SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::y1() const
-{
- return m_y1;
-}
-
-SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::x2() const
-{
- return m_x2;
-}
-
-SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::y2() const
-{
- return m_y2;
-}
-
-/*
-@namespace KSVG
-@begin SVGLinearGradientElementImpl::s_hashTable 5
- x1 SVGLinearGradientElementImpl::X1 DontDelete|ReadOnly
- y1 SVGLinearGradientElementImpl::Y1 DontDelete|ReadOnly
- x2 SVGLinearGradientElementImpl::X2 DontDelete|ReadOnly
- y2 SVGLinearGradientElementImpl::Y2 DontDelete|ReadOnly
-@end
-*/
-
-Value SVGLinearGradientElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X1:
- if(!attributeMode)
- return m_x1->cache(exec);
- else
- return Number(m_x1->baseVal()->value());
- case Y1:
- if(!attributeMode)
- return m_y1->cache(exec);
- else
- return Number(m_y1->baseVal()->value());
- case X2:
- if(!attributeMode)
- return m_x2->cache(exec);
- else
- return Number(m_x2->baseVal()->value());
- case Y2:
- if(!attributeMode)
- return m_y2->cache(exec);
- else
- return Number(m_y2->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGLinearGradientElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X1:
- converter()->modify(x1(), value.toString(exec).qstring());
- break;
- case Y1:
- converter()->modify(y1(), value.toString(exec).qstring());
- break;
- case X2:
- converter()->modify(x2(), value.toString(exec).qstring());
- break;
- case Y2:
- converter()->modify(y2(), value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGLinearGradientElementImpl::setAttributes()
-{
- SVGGradientElementImpl::setAttributes();
-
- // Spec: no attribute, effect is af value 0% is specified
- if(KSVG_TOKEN_NOT_PARSED(X1))
- KSVG_SET_ALT_ATTRIBUTE(X1, "0")
-
- // Spec: no attribute, effect is af value 0% is specified
- if(KSVG_TOKEN_NOT_PARSED(Y1))
- KSVG_SET_ALT_ATTRIBUTE(Y1, "0")
-
- // Spec: no attribute, effect is af value 100% is specified
- if(KSVG_TOKEN_NOT_PARSED(X2))
- KSVG_SET_ALT_ATTRIBUTE(X2, "100%")
-
- // Spec: no attribute, effect is af value 0% is specified
- if(KSVG_TOKEN_NOT_PARSED(Y2))
- KSVG_SET_ALT_ATTRIBUTE(Y2, "0")
-}
-
-TQMap<TQString, DOM::DOMString> SVGLinearGradientElementImpl::gradientAttributes()
-{
- setAttributes();
-
- TQMap<TQString, DOM::DOMString> gradAttributes;
- TQDictIterator<DOM::DOMString> it(attributes());
-
- for(; it.current(); ++it)
- {
- DOM::DOMString name = it.currentKey();
- DOM::DOMString value = it.current()->string();
-
- if(name == "gradientUnits" || name == "gradientTransform" || name == "spreadMethod" || name == "x1" || name == "x2" || name == "y1" || name == "y2")
- {
- gradAttributes.insert(name.string(), value.copy());
- }
- }
-
- return gradAttributes;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLinearGradientElementImpl.cpp b/ksvg/impl/SVGLinearGradientElementImpl.cpp
new file mode 100644
index 00000000..0a01a748
--- /dev/null
+++ b/ksvg/impl/SVGLinearGradientElementImpl.cpp
@@ -0,0 +1,199 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGradientElement.h"
+#include "SVGLinearGradientElementImpl.h"
+
+#include "SVGDocumentImpl.h"
+#include "KSVGCanvas.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGLengthImpl.h"
+#include "SVGUnitConverter.h"
+
+using namespace KSVG;
+
+#include "SVGLinearGradientElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGLinearGradientElementImpl::SVGLinearGradientElementImpl(DOM::ElementImpl *impl) : SVGGradientElementImpl(impl)
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x1 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x1->ref();
+
+ m_y1 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y1->ref();
+
+ m_x2 = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x2->ref();
+
+ m_y2 = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y2->ref();
+
+ converter()->add(m_x1);
+ converter()->add(m_y1);
+ converter()->add(m_x2);
+ converter()->add(m_y2);
+}
+
+SVGLinearGradientElementImpl::~SVGLinearGradientElementImpl()
+{
+ if(m_x1)
+ m_x1->deref();
+ if(m_y1)
+ m_y1->deref();
+ if(m_x2)
+ m_x2->deref();
+ if(m_y2)
+ m_y2->deref();
+}
+
+SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::x1() const
+{
+ return m_x1;
+}
+
+SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::y1() const
+{
+ return m_y1;
+}
+
+SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::x2() const
+{
+ return m_x2;
+}
+
+SVGAnimatedLengthImpl *SVGLinearGradientElementImpl::y2() const
+{
+ return m_y2;
+}
+
+/*
+@namespace KSVG
+@begin SVGLinearGradientElementImpl::s_hashTable 5
+ x1 SVGLinearGradientElementImpl::X1 DontDelete|ReadOnly
+ y1 SVGLinearGradientElementImpl::Y1 DontDelete|ReadOnly
+ x2 SVGLinearGradientElementImpl::X2 DontDelete|ReadOnly
+ y2 SVGLinearGradientElementImpl::Y2 DontDelete|ReadOnly
+@end
+*/
+
+Value SVGLinearGradientElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X1:
+ if(!attributeMode)
+ return m_x1->cache(exec);
+ else
+ return Number(m_x1->baseVal()->value());
+ case Y1:
+ if(!attributeMode)
+ return m_y1->cache(exec);
+ else
+ return Number(m_y1->baseVal()->value());
+ case X2:
+ if(!attributeMode)
+ return m_x2->cache(exec);
+ else
+ return Number(m_x2->baseVal()->value());
+ case Y2:
+ if(!attributeMode)
+ return m_y2->cache(exec);
+ else
+ return Number(m_y2->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGLinearGradientElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X1:
+ converter()->modify(x1(), value.toString(exec).qstring());
+ break;
+ case Y1:
+ converter()->modify(y1(), value.toString(exec).qstring());
+ break;
+ case X2:
+ converter()->modify(x2(), value.toString(exec).qstring());
+ break;
+ case Y2:
+ converter()->modify(y2(), value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGLinearGradientElementImpl::setAttributes()
+{
+ SVGGradientElementImpl::setAttributes();
+
+ // Spec: no attribute, effect is af value 0% is specified
+ if(KSVG_TOKEN_NOT_PARSED(X1))
+ KSVG_SET_ALT_ATTRIBUTE(X1, "0")
+
+ // Spec: no attribute, effect is af value 0% is specified
+ if(KSVG_TOKEN_NOT_PARSED(Y1))
+ KSVG_SET_ALT_ATTRIBUTE(Y1, "0")
+
+ // Spec: no attribute, effect is af value 100% is specified
+ if(KSVG_TOKEN_NOT_PARSED(X2))
+ KSVG_SET_ALT_ATTRIBUTE(X2, "100%")
+
+ // Spec: no attribute, effect is af value 0% is specified
+ if(KSVG_TOKEN_NOT_PARSED(Y2))
+ KSVG_SET_ALT_ATTRIBUTE(Y2, "0")
+}
+
+TQMap<TQString, DOM::DOMString> SVGLinearGradientElementImpl::gradientAttributes()
+{
+ setAttributes();
+
+ TQMap<TQString, DOM::DOMString> gradAttributes;
+ TQDictIterator<DOM::DOMString> it(attributes());
+
+ for(; it.current(); ++it)
+ {
+ DOM::DOMString name = it.currentKey();
+ DOM::DOMString value = it.current()->string();
+
+ if(name == "gradientUnits" || name == "gradientTransform" || name == "spreadMethod" || name == "x1" || name == "x2" || name == "y1" || name == "y2")
+ {
+ gradAttributes.insert(name.string(), value.copy());
+ }
+ }
+
+ return gradAttributes;
+}
diff --git a/ksvg/impl/SVGLinearGradientElementImpl.h b/ksvg/impl/SVGLinearGradientElementImpl.h
index 87744708..887f1856 100644
--- a/ksvg/impl/SVGLinearGradientElementImpl.h
+++ b/ksvg/impl/SVGLinearGradientElementImpl.h
@@ -70,5 +70,3 @@ KSVG_REGISTER_ELEMENT(SVGLinearGradientElementImpl, "linearGradient")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLocatableImpl.cc b/ksvg/impl/SVGLocatableImpl.cc
deleted file mode 100644
index 0ae143fa..00000000
--- a/ksvg/impl/SVGLocatableImpl.cc
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGRectImpl.h"
-#include "SVGShapeImpl.h"
-#include "SVGContainerImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGElementImpl.h"
-#include "SVGLocatableImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGDocumentImpl.h"
-
-using namespace KSVG;
-
-#include "SVGLocatableImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGLocatableImpl::SVGLocatableImpl()
-{
- m_nearestViewportElement = 0;
- m_farthestViewportElement = 0;
- m_cachedScreenCTM = SVGSVGElementImpl::createSVGMatrix();
- m_cachedScreenCTMIsValid = false;
-}
-
-SVGLocatableImpl::~SVGLocatableImpl()
-{
- if(m_nearestViewportElement)
- m_nearestViewportElement->deref();
- if(m_farthestViewportElement)
- m_farthestViewportElement->deref();
- if(m_cachedScreenCTM)
- m_cachedScreenCTM->deref();
-}
-
-SVGRectImpl *SVGLocatableImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- return ret;
-}
-
-SVGMatrixImpl *SVGLocatableImpl::getCTM()
-{
- SVGMatrixImpl *ret = SVGSVGElementImpl::createSVGMatrix();
- return ret;
-}
-
-SVGMatrixImpl *SVGLocatableImpl::getScreenCTM()
-{
- SVGMatrixImpl *ret = SVGSVGElementImpl::createSVGMatrix();
- ret->copy(m_cachedScreenCTM);
-
- return ret;
-}
-
-SVGMatrixImpl *SVGLocatableImpl::getTransformToElement(SVGElementImpl *)
-{
- SVGMatrixImpl *ret = SVGSVGElementImpl::createSVGMatrix();
- return ret;
-}
-
-void SVGLocatableImpl::updateCachedScreenCTM(const SVGMatrixImpl *parentScreenCTM)
-{
- m_cachedScreenCTM->copy(parentScreenCTM);
-
- const SVGMatrixImpl *local = localMatrix();
-
- if(local)
- m_cachedScreenCTM->multiply(local);
- m_cachedScreenCTMIsValid = true;
-
- // Notify the element
- onScreenCTMUpdated();
-
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(this);
-
- if(shape)
- {
- // TODO: Update due to matrix animations
- //if(shape->item())
- // shape->item()->update(updateReason);
-
- SVGElementImpl *element = dynamic_cast<SVGElementImpl *>(this);
-
- DOM::Node node = element->firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *child = element->ownerDoc()->getElementFromHandle(node.handle());
- SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(child);
-
- if(child && locatable)
- locatable->updateCachedScreenCTM(m_cachedScreenCTM);
- }
- }
-}
-
-void SVGLocatableImpl::checkCachedScreenCTM(const SVGMatrixImpl *parentScreenCTM)
-{
- if(m_cachedScreenCTMIsValid)
- {
- SVGElementImpl *element = dynamic_cast<SVGElementImpl *>(this);
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(this);
-
- if(shape)
- {
- DOM::Node node = element->firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *child = element->ownerDoc()->getElementFromHandle(node.handle());
- SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(child);
-
- if(child && locatable)
- locatable->checkCachedScreenCTM(m_cachedScreenCTM);
- }
- }
- }
- else
- updateCachedScreenCTM(parentScreenCTM);
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGLocatableImpl::s_hashTable 3
- nearestViewportElement SVGLocatableImpl::NearestViewportElement DontDelete
- farthestViewportElement SVGLocatableImpl::FarthestViewportElement DontDelete
-@end
-@namespace KSVG
-@begin SVGLocatableImplProto::s_hashTable 5
- getBBox SVGLocatableImpl::GetBBox DontDelete|Function 0
- getCTM SVGLocatableImpl::GetCTM DontDelete|Function 0
- getScreenCTM SVGLocatableImpl::GetScreenCTM DontDelete|Function 0
- getTransformToElement SVGLocatableImpl::GetTransformToElement DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGLocatable", SVGLocatableImplProto, SVGLocatableImplProtoFunc)
-
-Value SVGLocatableImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case NearestViewportElement:
- return nearestViewportElement() ? nearestViewportElement()->cache(exec) : Undefined();
- case FarthestViewportElement:
- return farthestViewportElement() ? farthestViewportElement()->cache(exec) : Undefined();
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGLocatableImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGLocatableImpl)
-
- switch(id)
- {
- case SVGLocatableImpl::GetBBox:
- {
- SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(obj);
- if(container)
- return container->getBBox()->cache(exec);
- else
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(obj);
- if(shape)
- return shape->getBBox()->cache(exec);
- else
- return obj->getBBox()->cache(exec);
- }
- }
- case SVGLocatableImpl::GetCTM:
- return obj->getCTM()->cache(exec);
- case SVGLocatableImpl::GetScreenCTM:
- return obj->getScreenCTM()->cache(exec);
- case SVGLocatableImpl::GetTransformToElement:
- return obj->getTransformToElement(static_cast<KSVGBridge<SVGElementImpl> *>(args[0].imp())->impl())->cache(exec);
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGLocatableImpl.cpp b/ksvg/impl/SVGLocatableImpl.cpp
new file mode 100644
index 00000000..1bf17fb6
--- /dev/null
+++ b/ksvg/impl/SVGLocatableImpl.cpp
@@ -0,0 +1,206 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGRectImpl.h"
+#include "SVGShapeImpl.h"
+#include "SVGContainerImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGElementImpl.h"
+#include "SVGLocatableImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGDocumentImpl.h"
+
+using namespace KSVG;
+
+#include "SVGLocatableImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGLocatableImpl::SVGLocatableImpl()
+{
+ m_nearestViewportElement = 0;
+ m_farthestViewportElement = 0;
+ m_cachedScreenCTM = SVGSVGElementImpl::createSVGMatrix();
+ m_cachedScreenCTMIsValid = false;
+}
+
+SVGLocatableImpl::~SVGLocatableImpl()
+{
+ if(m_nearestViewportElement)
+ m_nearestViewportElement->deref();
+ if(m_farthestViewportElement)
+ m_farthestViewportElement->deref();
+ if(m_cachedScreenCTM)
+ m_cachedScreenCTM->deref();
+}
+
+SVGRectImpl *SVGLocatableImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ return ret;
+}
+
+SVGMatrixImpl *SVGLocatableImpl::getCTM()
+{
+ SVGMatrixImpl *ret = SVGSVGElementImpl::createSVGMatrix();
+ return ret;
+}
+
+SVGMatrixImpl *SVGLocatableImpl::getScreenCTM()
+{
+ SVGMatrixImpl *ret = SVGSVGElementImpl::createSVGMatrix();
+ ret->copy(m_cachedScreenCTM);
+
+ return ret;
+}
+
+SVGMatrixImpl *SVGLocatableImpl::getTransformToElement(SVGElementImpl *)
+{
+ SVGMatrixImpl *ret = SVGSVGElementImpl::createSVGMatrix();
+ return ret;
+}
+
+void SVGLocatableImpl::updateCachedScreenCTM(const SVGMatrixImpl *parentScreenCTM)
+{
+ m_cachedScreenCTM->copy(parentScreenCTM);
+
+ const SVGMatrixImpl *local = localMatrix();
+
+ if(local)
+ m_cachedScreenCTM->multiply(local);
+ m_cachedScreenCTMIsValid = true;
+
+ // Notify the element
+ onScreenCTMUpdated();
+
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(this);
+
+ if(shape)
+ {
+ // TODO: Update due to matrix animations
+ //if(shape->item())
+ // shape->item()->update(updateReason);
+
+ SVGElementImpl *element = dynamic_cast<SVGElementImpl *>(this);
+
+ DOM::Node node = element->firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *child = element->ownerDoc()->getElementFromHandle(node.handle());
+ SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(child);
+
+ if(child && locatable)
+ locatable->updateCachedScreenCTM(m_cachedScreenCTM);
+ }
+ }
+}
+
+void SVGLocatableImpl::checkCachedScreenCTM(const SVGMatrixImpl *parentScreenCTM)
+{
+ if(m_cachedScreenCTMIsValid)
+ {
+ SVGElementImpl *element = dynamic_cast<SVGElementImpl *>(this);
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(this);
+
+ if(shape)
+ {
+ DOM::Node node = element->firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *child = element->ownerDoc()->getElementFromHandle(node.handle());
+ SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(child);
+
+ if(child && locatable)
+ locatable->checkCachedScreenCTM(m_cachedScreenCTM);
+ }
+ }
+ }
+ else
+ updateCachedScreenCTM(parentScreenCTM);
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGLocatableImpl::s_hashTable 3
+ nearestViewportElement SVGLocatableImpl::NearestViewportElement DontDelete
+ farthestViewportElement SVGLocatableImpl::FarthestViewportElement DontDelete
+@end
+@namespace KSVG
+@begin SVGLocatableImplProto::s_hashTable 5
+ getBBox SVGLocatableImpl::GetBBox DontDelete|Function 0
+ getCTM SVGLocatableImpl::GetCTM DontDelete|Function 0
+ getScreenCTM SVGLocatableImpl::GetScreenCTM DontDelete|Function 0
+ getTransformToElement SVGLocatableImpl::GetTransformToElement DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGLocatable", SVGLocatableImplProto, SVGLocatableImplProtoFunc)
+
+Value SVGLocatableImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case NearestViewportElement:
+ return nearestViewportElement() ? nearestViewportElement()->cache(exec) : Undefined();
+ case FarthestViewportElement:
+ return farthestViewportElement() ? farthestViewportElement()->cache(exec) : Undefined();
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGLocatableImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGLocatableImpl)
+
+ switch(id)
+ {
+ case SVGLocatableImpl::GetBBox:
+ {
+ SVGContainerImpl *container = dynamic_cast<SVGContainerImpl *>(obj);
+ if(container)
+ return container->getBBox()->cache(exec);
+ else
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(obj);
+ if(shape)
+ return shape->getBBox()->cache(exec);
+ else
+ return obj->getBBox()->cache(exec);
+ }
+ }
+ case SVGLocatableImpl::GetCTM:
+ return obj->getCTM()->cache(exec);
+ case SVGLocatableImpl::GetScreenCTM:
+ return obj->getScreenCTM()->cache(exec);
+ case SVGLocatableImpl::GetTransformToElement:
+ return obj->getTransformToElement(static_cast<KSVGBridge<SVGElementImpl> *>(args[0].imp())->impl())->cache(exec);
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
diff --git a/ksvg/impl/SVGLocatableImpl.h b/ksvg/impl/SVGLocatableImpl.h
index 81ce3326..b59c60c8 100644
--- a/ksvg/impl/SVGLocatableImpl.h
+++ b/ksvg/impl/SVGLocatableImpl.h
@@ -90,5 +90,3 @@ KSVG_DEFINE_PROTOTYPE(SVGLocatableImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGLocatableImplProtoFunc, SVGLocatableImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMPathElementImpl.cc b/ksvg/impl/SVGMPathElementImpl.cc
deleted file mode 100644
index 84d48274..00000000
--- a/ksvg/impl/SVGMPathElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMPathElementImpl.h"
-
-using namespace KSVG;
-
-SVGMPathElementImpl::SVGMPathElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl()
-{
-}
-
-SVGMPathElementImpl::~SVGMPathElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMPathElementImpl.cpp b/ksvg/impl/SVGMPathElementImpl.cpp
new file mode 100644
index 00000000..8348e07a
--- /dev/null
+++ b/ksvg/impl/SVGMPathElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMPathElementImpl.h"
+
+using namespace KSVG;
+
+SVGMPathElementImpl::SVGMPathElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl()
+{
+}
+
+SVGMPathElementImpl::~SVGMPathElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGMPathElementImpl.h b/ksvg/impl/SVGMPathElementImpl.h
index 8d0bd96b..f8269d50 100644
--- a/ksvg/impl/SVGMPathElementImpl.h
+++ b/ksvg/impl/SVGMPathElementImpl.h
@@ -46,5 +46,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMarkerElementImpl.cc b/ksvg/impl/SVGMarkerElementImpl.cc
deleted file mode 100644
index a621b47f..00000000
--- a/ksvg/impl/SVGMarkerElementImpl.cc
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGMarkerElement.h"
-
-#include "SVGRectImpl.h"
-#include "SVGAngleImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedRectImpl.h"
-#include "SVGMarkerElementImpl.h"
-#include "SVGAnimatedAngleImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGPreserveAspectRatioImpl.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-#include "SVGMarkerElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-#include "ksvg_cacheimpl.h"
-
-SVGMarkerElementImpl::SVGMarkerElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGFitToViewBoxImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_refX = new SVGAnimatedLengthImpl();
- m_refX->ref();
-
- m_refY = new SVGAnimatedLengthImpl();
- m_refY->ref();
-
- m_markerUnits = new SVGAnimatedEnumerationImpl();
- m_markerUnits->ref();
-
- m_markerWidth = new SVGAnimatedLengthImpl();
- m_markerWidth->ref();
-
- m_markerHeight = new SVGAnimatedLengthImpl();
- m_markerHeight->ref();
-
- m_orientType = new SVGAnimatedEnumerationImpl();
- m_orientType->ref();
-
- m_orientAngle = new SVGAnimatedAngleImpl();
- m_orientAngle->ref();
-}
-
-SVGMarkerElementImpl::~SVGMarkerElementImpl()
-{
- if(m_refX)
- m_refX->deref();
- if(m_refY)
- m_refY->deref();
- if(m_markerUnits)
- m_markerUnits->deref();
- if(m_markerWidth)
- m_markerWidth->deref();
- if(m_markerHeight)
- m_markerHeight->deref();
- if(m_orientType)
- m_orientType->deref();
- if(m_orientAngle)
- m_orientAngle->deref();
-}
-
-SVGAnimatedLengthImpl *SVGMarkerElementImpl::refX() const
-{
- return m_refX;
-}
-
-SVGAnimatedLengthImpl *SVGMarkerElementImpl::refY() const
-{
- return m_refY;
-}
-
-SVGAnimatedEnumerationImpl *SVGMarkerElementImpl::markerUnits() const
-{
- return m_markerUnits;
-}
-
-SVGAnimatedLengthImpl *SVGMarkerElementImpl::markerWidth() const
-{
- return m_markerWidth;
-}
-
-SVGAnimatedLengthImpl *SVGMarkerElementImpl::markerHeight() const
-{
- return m_markerHeight;
-}
-
-SVGAnimatedEnumerationImpl *SVGMarkerElementImpl::orientType() const
-{
- return m_orientType;
-}
-
-SVGAnimatedAngleImpl *SVGMarkerElementImpl::orientAngle() const
-{
- return m_orientAngle;
-}
-
-void SVGMarkerElementImpl::setOrientToAuto()
-{
- orientType()->setBaseVal(SVG_MARKER_ORIENT_AUTO);
-}
-
-void SVGMarkerElementImpl::setOrientToAngle(SVGAngleImpl *angle)
-{
- m_orientAngle->baseVal()->setValue(angle->value());
-}
-
-void SVGMarkerElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(RefX))
- KSVG_SET_ALT_ATTRIBUTE(RefX, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(RefY))
- KSVG_SET_ALT_ATTRIBUTE(RefY, "0")
-
- // Spec: if not specified, effect is as if a value of "3" were specified
- if(KSVG_TOKEN_NOT_PARSED(MarkerWidth))
- KSVG_SET_ALT_ATTRIBUTE(MarkerWidth, "3")
-
- // Spec: if not specified, effect is as if a value of "3" were specified
- if(KSVG_TOKEN_NOT_PARSED(MarkerHeight))
- KSVG_SET_ALT_ATTRIBUTE(MarkerHeight, "3")
-
- // Spec: if attribute not specified, use strokeWidth
- if(KSVG_TOKEN_NOT_PARSED(MarkerUnits))
- KSVG_SET_ALT_ATTRIBUTE(MarkerUnits, "strokeWidth")
-
- // Spec: if attribute not specified, use angle
- if(KSVG_TOKEN_NOT_PARSED(Orient))
- KSVG_SET_ALT_ATTRIBUTE(Orient, "angle")
-}
-
-void SVGMarkerElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createCanvasMarker(this);
- c->insert(m_item);
- }
-}
-
-void SVGMarkerElementImpl::draw(SVGShapeImpl *referencingElement, double x, double y, double lwidth, double angle)
-{
- SVGMatrixImpl *mtx = dynamic_cast<SVGLocatableImpl *>(referencingElement)->getScreenCTM();
-
- // move to dest
- mtx->translate(x, y);
-
- // scale by linewidth if marker units == strokewidth
- if(markerUnits()->baseVal() == SVG_MARKERUNITS_STROKEWIDTH)
- mtx->scale(lwidth);
-
- // select appropriate rotation
- if(orientType()->baseVal() == SVG_MARKER_ORIENT_AUTO)
- mtx->rotate(angle);
- else
- mtx->rotate(orientAngle()->baseVal()->value());
-
- SVGRectImpl *viewBoxRect = viewBox()->baseVal();
- SVGMatrixImpl *pres = preserveAspectRatio()->baseVal()->getCTM(viewBoxRect->x(), viewBoxRect->y(),
- viewBoxRect->width(), viewBoxRect->height(),
- 0, 0, markerWidth()->baseVal()->value(),
- markerHeight()->baseVal()->value());
-
- // viewbox stuff
- mtx->multiply(pres);
-
- // Get the vertex position in viewbox coordinates. The vertex is at (0, 0) in viewport coordinates.
- double vertexX, vertexY;
- pres->qmatrix().invert().map(0, 0, &vertexX, &vertexY);
-
- // Translate so that the vertex is at (refX, refY) in viewbox coordinates.
- mtx->translate(vertexX - refX()->baseVal()->value(), vertexY - refY()->baseVal()->value());
-
- if(getOverflow())
- m_clipShape.clear();
- else
- {
- KSVGRectangle viewport;
-
- if(hasAttribute("viewBox"))
- {
- // Get the viewport ((0, 0) - (markerWidth, markerHeight)) in viewbox coordinates.
- double w, h;
- pres->qmatrix().invert().map(markerWidth()->baseVal()->value(), markerHeight()->baseVal()->value(), &w, &h);
-
- viewport = KSVGRectangle(vertexX, vertexY, w - vertexX, h - vertexY);
- }
- else
- viewport = KSVGRectangle(0, 0, markerWidth()->baseVal()->value(), markerHeight()->baseVal()->value());
-
- // Transform to screen coordinates.
- m_clipShape = mtx->map(viewport);
- }
-
- pres->deref();
-
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
-
- bool ok = tests ? tests->ok() : true;
- if(element && shape && style && ok && style->getVisible() && style->getDisplay())
- {
- SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(element);
- if(locatable)
- locatable->updateCachedScreenCTM(mtx);
-
- shape->update(UPDATE_TRANSFORM);
- shape->setReferenced(true);
- shape->draw();
- shape->setReferenced(false);
- }
- }
-
- mtx->deref();
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGMarkerElementImpl::s_hashTable 11
- refX SVGMarkerElementImpl::RefX DontDelete|ReadOnly
- refY SVGMarkerElementImpl::RefY DontDelete|ReadOnly
- markerUnits SVGMarkerElementImpl::MarkerUnits DontDelete|ReadOnly
- markerWidth SVGMarkerElementImpl::MarkerWidth DontDelete|ReadOnly
- markerHeight SVGMarkerElementImpl::MarkerHeight DontDelete|ReadOnly
- orientType SVGMarkerElementImpl::OrientType DontDelete|ReadOnly
- orientAngle SVGMarkerElementImpl::OrientAngle DontDelete|ReadOnly
- orient SVGMarkerElementImpl::Orient DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGMarkerElementImplProto::s_hashTable 3
- setOrientToAuto SVGMarkerElementImpl::SetOrientToAuto DontDelete|Function 0
- setOrientToAngle SVGMarkerElementImpl::SetOrientToAngle DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGMarkerElement", SVGMarkerElementImplProto, SVGMarkerElementImplProtoFunc)
-
-Value SVGMarkerElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case RefX:
- if(!attributeMode)
- return m_refX->cache(exec);
- else
- return Number(m_refX->baseVal()->value());
- case RefY:
- if(!attributeMode)
- return m_refY->cache(exec);
- else
- return Number(m_refY->baseVal()->value());
- case MarkerUnits:
- if(!attributeMode)
- return m_markerUnits->cache(exec);
- else
- return Number(m_markerUnits->baseVal());
- case MarkerWidth:
- if(!attributeMode)
- return m_markerWidth->cache(exec);
- else
- return Number(m_markerWidth->baseVal()->value());
- case MarkerHeight:
- if(!attributeMode)
- return m_markerHeight->cache(exec);
- else
- return Number(m_markerHeight->baseVal()->value());
- case OrientType:
- if(!attributeMode)
- return m_orientType->cache(exec);
- else
- return Number(m_orientType->baseVal());
- case OrientAngle:
- if(!attributeMode)
- return m_orientAngle->cache(exec);
- else
- return Number(m_orientAngle->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGMarkerElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case RefX:
- refX()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case RefY:
- refY()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case MarkerWidth:
- markerWidth()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case MarkerHeight:
- markerHeight()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case MarkerUnits:
- if(value.toString(exec).qstring() == "userSpaceOnUse")
- markerUnits()->setBaseVal(SVG_MARKERUNITS_USERSPACEONUSE);
- else
- markerUnits()->setBaseVal(SVG_MARKERUNITS_STROKEWIDTH);
- break;
- case Orient:
- {
- TQString param = value.toString(exec).qstring();
-
- if(param == "auto")
- orientType()->setBaseVal(SVG_MARKER_ORIENT_AUTO);
- else
- {
- orientType()->setBaseVal(SVG_MARKER_ORIENT_ANGLE);
- m_orientAngle->baseVal()->setValueAsString(param);
- }
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGMarkerElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGMarkerElementImpl)
-
- switch(id)
- {
- case SVGMarkerElementImpl::SetOrientToAuto:
- obj->setOrientToAuto();
- return Undefined();
-#ifdef __GNUC__
-#warning FIXME cache stuff
-#endif
- case SVGMarkerElementImpl::SetOrientToAngle:
- obj->setOrientToAngle(static_cast<KSVGBridge<SVGAngleImpl> *>(args[0].imp())->impl());
- return Undefined();
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// CONSTANTS
-
-/*
-@namespace KSVG
-@begin SVGMarkerElementImplConstructor::s_hashTable 7
- SVG_MARKERUNITS_UNKNOWN KSVG::SVG_MARKERUNITS_UNKNOWN DontDelete|ReadOnly
- SVG_MARKERUNITS_USERSPACEONUSE KSVG::SVG_MARKERUNITS_USERSPACEONUSE DontDelete|ReadOnly
- SVG_MARKERUNITS_STROKEWIDTH KSVG::SVG_MARKERUNITS_STROKEWIDTH DontDelete|ReadOnly
- SVG_MARKER_ORIENT_UNKNOWN KSVG::SVG_MARKER_ORIENT_UNKNOWN DontDelete|ReadOnly
- SVG_MARKER_ORIENT_AUTO KSVG::SVG_MARKER_ORIENT_AUTO DontDelete|ReadOnly
- SVG_MARKER_ORIENT_ANGLE KSVG::SVG_MARKER_ORIENT_ANGLE DontDelete|ReadOnly
-@end
-*/
-
-using namespace KJS;
-
-Value SVGMarkerElementImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGMarkerElementImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGMarkerElementImplConstructor>(exec, "[[svgmarkerelement.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMarkerElementImpl.cpp b/ksvg/impl/SVGMarkerElementImpl.cpp
new file mode 100644
index 00000000..554f56b7
--- /dev/null
+++ b/ksvg/impl/SVGMarkerElementImpl.cpp
@@ -0,0 +1,422 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGMarkerElement.h"
+
+#include "SVGRectImpl.h"
+#include "SVGAngleImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedRectImpl.h"
+#include "SVGMarkerElementImpl.h"
+#include "SVGAnimatedAngleImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGPreserveAspectRatioImpl.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+#include "SVGMarkerElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+#include "ksvg_cacheimpl.h"
+
+SVGMarkerElementImpl::SVGMarkerElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGFitToViewBoxImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_refX = new SVGAnimatedLengthImpl();
+ m_refX->ref();
+
+ m_refY = new SVGAnimatedLengthImpl();
+ m_refY->ref();
+
+ m_markerUnits = new SVGAnimatedEnumerationImpl();
+ m_markerUnits->ref();
+
+ m_markerWidth = new SVGAnimatedLengthImpl();
+ m_markerWidth->ref();
+
+ m_markerHeight = new SVGAnimatedLengthImpl();
+ m_markerHeight->ref();
+
+ m_orientType = new SVGAnimatedEnumerationImpl();
+ m_orientType->ref();
+
+ m_orientAngle = new SVGAnimatedAngleImpl();
+ m_orientAngle->ref();
+}
+
+SVGMarkerElementImpl::~SVGMarkerElementImpl()
+{
+ if(m_refX)
+ m_refX->deref();
+ if(m_refY)
+ m_refY->deref();
+ if(m_markerUnits)
+ m_markerUnits->deref();
+ if(m_markerWidth)
+ m_markerWidth->deref();
+ if(m_markerHeight)
+ m_markerHeight->deref();
+ if(m_orientType)
+ m_orientType->deref();
+ if(m_orientAngle)
+ m_orientAngle->deref();
+}
+
+SVGAnimatedLengthImpl *SVGMarkerElementImpl::refX() const
+{
+ return m_refX;
+}
+
+SVGAnimatedLengthImpl *SVGMarkerElementImpl::refY() const
+{
+ return m_refY;
+}
+
+SVGAnimatedEnumerationImpl *SVGMarkerElementImpl::markerUnits() const
+{
+ return m_markerUnits;
+}
+
+SVGAnimatedLengthImpl *SVGMarkerElementImpl::markerWidth() const
+{
+ return m_markerWidth;
+}
+
+SVGAnimatedLengthImpl *SVGMarkerElementImpl::markerHeight() const
+{
+ return m_markerHeight;
+}
+
+SVGAnimatedEnumerationImpl *SVGMarkerElementImpl::orientType() const
+{
+ return m_orientType;
+}
+
+SVGAnimatedAngleImpl *SVGMarkerElementImpl::orientAngle() const
+{
+ return m_orientAngle;
+}
+
+void SVGMarkerElementImpl::setOrientToAuto()
+{
+ orientType()->setBaseVal(SVG_MARKER_ORIENT_AUTO);
+}
+
+void SVGMarkerElementImpl::setOrientToAngle(SVGAngleImpl *angle)
+{
+ m_orientAngle->baseVal()->setValue(angle->value());
+}
+
+void SVGMarkerElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(RefX))
+ KSVG_SET_ALT_ATTRIBUTE(RefX, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(RefY))
+ KSVG_SET_ALT_ATTRIBUTE(RefY, "0")
+
+ // Spec: if not specified, effect is as if a value of "3" were specified
+ if(KSVG_TOKEN_NOT_PARSED(MarkerWidth))
+ KSVG_SET_ALT_ATTRIBUTE(MarkerWidth, "3")
+
+ // Spec: if not specified, effect is as if a value of "3" were specified
+ if(KSVG_TOKEN_NOT_PARSED(MarkerHeight))
+ KSVG_SET_ALT_ATTRIBUTE(MarkerHeight, "3")
+
+ // Spec: if attribute not specified, use strokeWidth
+ if(KSVG_TOKEN_NOT_PARSED(MarkerUnits))
+ KSVG_SET_ALT_ATTRIBUTE(MarkerUnits, "strokeWidth")
+
+ // Spec: if attribute not specified, use angle
+ if(KSVG_TOKEN_NOT_PARSED(Orient))
+ KSVG_SET_ALT_ATTRIBUTE(Orient, "angle")
+}
+
+void SVGMarkerElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createCanvasMarker(this);
+ c->insert(m_item);
+ }
+}
+
+void SVGMarkerElementImpl::draw(SVGShapeImpl *referencingElement, double x, double y, double lwidth, double angle)
+{
+ SVGMatrixImpl *mtx = dynamic_cast<SVGLocatableImpl *>(referencingElement)->getScreenCTM();
+
+ // move to dest
+ mtx->translate(x, y);
+
+ // scale by linewidth if marker units == strokewidth
+ if(markerUnits()->baseVal() == SVG_MARKERUNITS_STROKEWIDTH)
+ mtx->scale(lwidth);
+
+ // select appropriate rotation
+ if(orientType()->baseVal() == SVG_MARKER_ORIENT_AUTO)
+ mtx->rotate(angle);
+ else
+ mtx->rotate(orientAngle()->baseVal()->value());
+
+ SVGRectImpl *viewBoxRect = viewBox()->baseVal();
+ SVGMatrixImpl *pres = preserveAspectRatio()->baseVal()->getCTM(viewBoxRect->x(), viewBoxRect->y(),
+ viewBoxRect->width(), viewBoxRect->height(),
+ 0, 0, markerWidth()->baseVal()->value(),
+ markerHeight()->baseVal()->value());
+
+ // viewbox stuff
+ mtx->multiply(pres);
+
+ // Get the vertex position in viewbox coordinates. The vertex is at (0, 0) in viewport coordinates.
+ double vertexX, vertexY;
+ pres->qmatrix().invert().map(0, 0, &vertexX, &vertexY);
+
+ // Translate so that the vertex is at (refX, refY) in viewbox coordinates.
+ mtx->translate(vertexX - refX()->baseVal()->value(), vertexY - refY()->baseVal()->value());
+
+ if(getOverflow())
+ m_clipShape.clear();
+ else
+ {
+ KSVGRectangle viewport;
+
+ if(hasAttribute("viewBox"))
+ {
+ // Get the viewport ((0, 0) - (markerWidth, markerHeight)) in viewbox coordinates.
+ double w, h;
+ pres->qmatrix().invert().map(markerWidth()->baseVal()->value(), markerHeight()->baseVal()->value(), &w, &h);
+
+ viewport = KSVGRectangle(vertexX, vertexY, w - vertexX, h - vertexY);
+ }
+ else
+ viewport = KSVGRectangle(0, 0, markerWidth()->baseVal()->value(), markerHeight()->baseVal()->value());
+
+ // Transform to screen coordinates.
+ m_clipShape = mtx->map(viewport);
+ }
+
+ pres->deref();
+
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
+
+ bool ok = tests ? tests->ok() : true;
+ if(element && shape && style && ok && style->getVisible() && style->getDisplay())
+ {
+ SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(element);
+ if(locatable)
+ locatable->updateCachedScreenCTM(mtx);
+
+ shape->update(UPDATE_TRANSFORM);
+ shape->setReferenced(true);
+ shape->draw();
+ shape->setReferenced(false);
+ }
+ }
+
+ mtx->deref();
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGMarkerElementImpl::s_hashTable 11
+ refX SVGMarkerElementImpl::RefX DontDelete|ReadOnly
+ refY SVGMarkerElementImpl::RefY DontDelete|ReadOnly
+ markerUnits SVGMarkerElementImpl::MarkerUnits DontDelete|ReadOnly
+ markerWidth SVGMarkerElementImpl::MarkerWidth DontDelete|ReadOnly
+ markerHeight SVGMarkerElementImpl::MarkerHeight DontDelete|ReadOnly
+ orientType SVGMarkerElementImpl::OrientType DontDelete|ReadOnly
+ orientAngle SVGMarkerElementImpl::OrientAngle DontDelete|ReadOnly
+ orient SVGMarkerElementImpl::Orient DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGMarkerElementImplProto::s_hashTable 3
+ setOrientToAuto SVGMarkerElementImpl::SetOrientToAuto DontDelete|Function 0
+ setOrientToAngle SVGMarkerElementImpl::SetOrientToAngle DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGMarkerElement", SVGMarkerElementImplProto, SVGMarkerElementImplProtoFunc)
+
+Value SVGMarkerElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case RefX:
+ if(!attributeMode)
+ return m_refX->cache(exec);
+ else
+ return Number(m_refX->baseVal()->value());
+ case RefY:
+ if(!attributeMode)
+ return m_refY->cache(exec);
+ else
+ return Number(m_refY->baseVal()->value());
+ case MarkerUnits:
+ if(!attributeMode)
+ return m_markerUnits->cache(exec);
+ else
+ return Number(m_markerUnits->baseVal());
+ case MarkerWidth:
+ if(!attributeMode)
+ return m_markerWidth->cache(exec);
+ else
+ return Number(m_markerWidth->baseVal()->value());
+ case MarkerHeight:
+ if(!attributeMode)
+ return m_markerHeight->cache(exec);
+ else
+ return Number(m_markerHeight->baseVal()->value());
+ case OrientType:
+ if(!attributeMode)
+ return m_orientType->cache(exec);
+ else
+ return Number(m_orientType->baseVal());
+ case OrientAngle:
+ if(!attributeMode)
+ return m_orientAngle->cache(exec);
+ else
+ return Number(m_orientAngle->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGMarkerElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case RefX:
+ refX()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case RefY:
+ refY()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case MarkerWidth:
+ markerWidth()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case MarkerHeight:
+ markerHeight()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case MarkerUnits:
+ if(value.toString(exec).qstring() == "userSpaceOnUse")
+ markerUnits()->setBaseVal(SVG_MARKERUNITS_USERSPACEONUSE);
+ else
+ markerUnits()->setBaseVal(SVG_MARKERUNITS_STROKEWIDTH);
+ break;
+ case Orient:
+ {
+ TQString param = value.toString(exec).qstring();
+
+ if(param == "auto")
+ orientType()->setBaseVal(SVG_MARKER_ORIENT_AUTO);
+ else
+ {
+ orientType()->setBaseVal(SVG_MARKER_ORIENT_ANGLE);
+ m_orientAngle->baseVal()->setValueAsString(param);
+ }
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGMarkerElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGMarkerElementImpl)
+
+ switch(id)
+ {
+ case SVGMarkerElementImpl::SetOrientToAuto:
+ obj->setOrientToAuto();
+ return Undefined();
+#ifdef __GNUC__
+#warning FIXME cache stuff
+#endif
+ case SVGMarkerElementImpl::SetOrientToAngle:
+ obj->setOrientToAngle(static_cast<KSVGBridge<SVGAngleImpl> *>(args[0].imp())->impl());
+ return Undefined();
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+// CONSTANTS
+
+/*
+@namespace KSVG
+@begin SVGMarkerElementImplConstructor::s_hashTable 7
+ SVG_MARKERUNITS_UNKNOWN KSVG::SVG_MARKERUNITS_UNKNOWN DontDelete|ReadOnly
+ SVG_MARKERUNITS_USERSPACEONUSE KSVG::SVG_MARKERUNITS_USERSPACEONUSE DontDelete|ReadOnly
+ SVG_MARKERUNITS_STROKEWIDTH KSVG::SVG_MARKERUNITS_STROKEWIDTH DontDelete|ReadOnly
+ SVG_MARKER_ORIENT_UNKNOWN KSVG::SVG_MARKER_ORIENT_UNKNOWN DontDelete|ReadOnly
+ SVG_MARKER_ORIENT_AUTO KSVG::SVG_MARKER_ORIENT_AUTO DontDelete|ReadOnly
+ SVG_MARKER_ORIENT_ANGLE KSVG::SVG_MARKER_ORIENT_ANGLE DontDelete|ReadOnly
+@end
+*/
+
+using namespace KJS;
+
+Value SVGMarkerElementImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGMarkerElementImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGMarkerElementImplConstructor>(exec, "[[svgmarkerelement.constructor]]");
+}
diff --git a/ksvg/impl/SVGMarkerElementImpl.h b/ksvg/impl/SVGMarkerElementImpl.h
index 7e6539e3..f0278052 100644
--- a/ksvg/impl/SVGMarkerElementImpl.h
+++ b/ksvg/impl/SVGMarkerElementImpl.h
@@ -117,5 +117,3 @@ KSVG_DEFINE_PROTOTYPE(SVGMarkerElementImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGMarkerElementImplProtoFunc, SVGMarkerElementImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMaskElementImpl.cc b/ksvg/impl/SVGMaskElementImpl.cc
deleted file mode 100644
index 16491eb9..00000000
--- a/ksvg/impl/SVGMaskElementImpl.cc
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <cfloat>
-
-#include <kdebug.h>
-#include <tqimage.h>
-
-#include "SVGMaskElement.h"
-
-#include "SVGRectImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGMaskElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGUnitConverter.h"
-#include "SVGShapeImpl.h"
-#include "SVGMatrixImpl.h"
-#include "KSVGCanvas.h"
-#include "CanvasItems.h"
-#include "CanvasFactory.h"
-#include "KSVGHelper.h"
-
-#include <X11/Xos.h>
-
-using namespace KSVG;
-
-#include "SVGMaskElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_ecma.h"
-
-SVGMaskElementImpl::SVGMaskElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGBBoxTarget()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y->ref();
-
- m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_height->ref();
-
- m_maskUnits = new SVGAnimatedEnumerationImpl();
- m_maskUnits->ref();
-
- m_maskContentUnits = new SVGAnimatedEnumerationImpl();
- m_maskContentUnits->ref();
-
- m_converter = new SVGUnitConverter();
- m_converter->add(m_x);
- m_converter->add(m_y);
- m_converter->add(m_width);
- m_converter->add(m_height);
-
- m_canvas = 0;
-
- m_maskCache.setMaxTotalCost(1024 * 1024);
-}
-
-SVGMaskElementImpl::~SVGMaskElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_maskUnits)
- m_maskContentUnits->deref();
- if(m_maskUnits)
- m_maskContentUnits->deref();
- delete m_converter;
- if(m_canvas)
- delete m_canvas;
-}
-
-SVGAnimatedEnumerationImpl *SVGMaskElementImpl::maskUnits() const
-{
- return m_maskUnits;
-}
-
-SVGAnimatedEnumerationImpl *SVGMaskElementImpl::maskContentUnits() const
-{
- return m_maskContentUnits;
-}
-
-SVGAnimatedLengthImpl *SVGMaskElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGMaskElementImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGMaskElementImpl::width() const
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGMaskElementImpl::height() const
-{
- return m_height;
-}
-
-/*
-@namespace KSVG
-@begin SVGMaskElementImpl::s_hashTable 7
- maskUnits SVGMaskElementImpl::MaskUnits DontDelete|ReadOnly
- maskContentUnits SVGMaskElementImpl::MaskContentUnits DontDelete|ReadOnly
- x SVGMaskElementImpl::X DontDelete|ReadOnly
- y SVGMaskElementImpl::Y DontDelete|ReadOnly
- width SVGMaskElementImpl::Width DontDelete|ReadOnly
- height SVGMaskElementImpl::Height DontDelete|ReadOnly
-@end
-*/
-Value SVGMaskElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case MaskUnits:
- if(!attributeMode)
- return m_maskUnits->cache(exec);
- else
- return Number(m_maskUnits->baseVal());
- case MaskContentUnits:
- if(!attributeMode)
- return m_maskContentUnits->cache(exec);
- else
- return Number(m_maskContentUnits->baseVal());
- case X:
- if(!attributeMode)
- return m_x->cache(exec);
- else
- return Number(m_x->baseVal()->value());
- case Y:
- if(!attributeMode)
- return m_y->cache(exec);
- else
- return Number(m_y->baseVal()->value());
- case Width:
- if(!attributeMode)
- return m_width->cache(exec);
- else
- return Number(m_width->baseVal()->value());
-
- case Height:
- if(!attributeMode)
- return m_height->cache(exec);
- else
- return Number(m_height->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGMaskElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case MaskUnits:
- if(value.toString(exec).qstring() == "objectBoundingBox")
- m_maskUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
- else
- m_maskUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_USERSPACEONUSE);
- break;
- case MaskContentUnits:
- if(value.toString(exec).qstring() == "objectBoundingBox")
- m_maskContentUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
- else
- m_maskContentUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_USERSPACEONUSE);
- break;
- case X:
- converter()->modify(x(), value.toString(exec).qstring());
- break;
- case Y:
- converter()->modify(y(), value.toString(exec).qstring());
- break;
- case Width:
- converter()->modify(width(), value.toString(exec).qstring());
- break;
- case Height:
- converter()->modify(height(), value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGMaskElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_x->baseVal()->value());
- ret->setY(m_y->baseVal()->value());
- ret->setWidth(m_width->baseVal()->value());
- ret->setHeight(m_height->baseVal()->value());
- return ret;
-}
-
-void SVGMaskElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if attribute not specified, use objectBoundingBox
- if(KSVG_TOKEN_NOT_PARSED(MaskUnits))
- KSVG_SET_ALT_ATTRIBUTE(MaskUnits, "objectBoundingBox")
-
- // Spec: if attribute not specified, use userSpaceOnUse
- if(KSVG_TOKEN_NOT_PARSED(MaskContentUnits))
- KSVG_SET_ALT_ATTRIBUTE(MaskContentUnits, "userSpaceOnUse")
-
- // Spec: if attribute not specified, use "-10%"
- if(KSVG_TOKEN_NOT_PARSED(X))
- KSVG_SET_ALT_ATTRIBUTE(X, "-10%");
-
- // Spec: if attribute not specified, use "-10%"
- if(KSVG_TOKEN_NOT_PARSED(Y))
- KSVG_SET_ALT_ATTRIBUTE(Y, "-10%");
-
- // Spec: if attribute not specified, use "120%"
- if(KSVG_TOKEN_NOT_PARSED(Width))
- KSVG_SET_ALT_ATTRIBUTE(Width, "120%");
-
- // Spec: if attribute not specified, use "120%"
- if(KSVG_TOKEN_NOT_PARSED(Height))
- KSVG_SET_ALT_ATTRIBUTE(Height, "120%");
-}
-
-SVGMaskElementImpl::Mask SVGMaskElementImpl::createMask(SVGShapeImpl *referencingElement, int imageWidth, int imageHeight)
-{
- converter()->finalize(referencingElement, ownerSVGElement(), maskUnits()->baseVal());
-
- TQ_UINT32 *imageBits = new TQ_UINT32[imageWidth * imageHeight];
-
- if(m_canvas == 0)
- m_canvas = CanvasFactory::self()->loadCanvas(imageWidth, imageHeight);
-
- m_canvas->setup(reinterpret_cast<unsigned char *>(imageBits), imageWidth, imageHeight);
- m_canvas->setBackgroundColor(tqRgba(0, 0, 0, 0));
-
- SVGMatrixImpl *baseMatrix = SVGSVGElementImpl::createSVGMatrix();
-
- // Set the scale to map the mask onto the image
- double xScale = static_cast<double>(imageWidth) / width()->baseVal()->value();
- double yScale = static_cast<double>(imageHeight) / height()->baseVal()->value();
-
- baseMatrix->scaleNonUniform(xScale, yScale);
-
- SVGRectImpl *bbox = referencingElement->getBBox();
-
- if(maskUnits()->baseVal() == SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
- baseMatrix->translate(-(bbox->x() + x()->baseVal()->value()), -(bbox->y() + y()->baseVal()->value()));
- else
- baseMatrix->translate(-x()->baseVal()->value(), -y()->baseVal()->value());
-
- if(maskContentUnits()->baseVal() == SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
- {
- baseMatrix->translate(bbox->x(), bbox->y());
- baseMatrix->scaleNonUniform(bbox->width(), bbox->height());
- }
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
-
- bool ok = tests ? tests->ok() : true;
- if(element && shape && style && ok && style->getVisible() && style->getDisplay())
- {
- SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(element);
- if(locatable)
- locatable->updateCachedScreenCTM(baseMatrix);
-
- element->createItem(m_canvas);
- if(shape->item())
- {
- shape->item()->setReferenced(true);
- m_canvas->invalidate(shape->item(), true);
- }
- }
- }
-
- m_canvas->update(float(1));
-
- for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
-
- bool ok = tests ? tests->ok() : true;
- if(element && shape && style && ok && style->getVisible() && style->getDisplay())
- {
- if(shape)
- shape->removeItem(m_canvas);
- }
- }
-
-
- {
- // Note: r and b reversed
- //TQImage maskImage(reinterpret_cast<unsigned char *>(imageBits), imageWidth, imageHeight, 32, 0, 0, TQImage::IgnoreEndian);
- //maskImage.setAlphaBuffer(true);
- //maskImage.save("mask.png", "PNG");
- }
-
- TQByteArray maskData(imageWidth * imageHeight);
- const double epsilon = DBL_EPSILON;
-
- // Convert the rgba image into an 8-bit mask, according to the specs.
- for(int i = 0; i < imageWidth * imageHeight; i++)
- {
- TQ_UINT32 rgba = imageBits[i];
-
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- double r = (rgba & 0xff) / 255.0;
- double g = ((rgba >> 8) & 0xff) / 255.0;
- double b = ((rgba >> 16) & 0xff) / 255.0;
- double a = ((rgba >> 24) & 0xff) / 255.0;
-#else
- double a = (rgba & 0xff) / 255.0;
- double b = ((rgba >> 8) & 0xff) / 255.0;
- double g = ((rgba >> 16) & 0xff) / 255.0;
- double r = ((rgba >> 24) & 0xff) / 255.0;
-#endif
-
- // Remove pre-multiplication by alpha.
- if(a > epsilon)
- {
- r /= a;
- g /= a;
- b /= a;
- }
-
- // Convert to linear RGB
- r = KSVGHelper::linearRGBFromsRGB(int(r * 255 + 0.5)) / 255.0;
- g = KSVGHelper::linearRGBFromsRGB(int(g * 255 + 0.5)) / 255.0;
- b = KSVGHelper::linearRGBFromsRGB(int(b * 255 + 0.5)) / 255.0;
-
- // Convert 'luminance to alpha'
- double luminanceAlpha = 0.2125 * r + 0.7154 * g + 0.0721 * b;
-
- // Multiply by alpha.
- double maskValue = luminanceAlpha * a;
-
- maskData[i] = static_cast<unsigned char>(maskValue * 255 + 0.5);
- }
-
- delete [] imageBits;
-
- baseMatrix->deref();
- bbox->deref();
-
- // The screenToMask matrix is calculated each time the mask is used so we don't
- // need to set it here.
- TQWMatrix tempMatrix;
-
- return Mask(maskData, tempMatrix, imageWidth, imageHeight);
-}
-
-SVGMaskElementImpl::Mask SVGMaskElementImpl::createMask(SVGShapeImpl *referencingElement)
-{
- converter()->finalize(referencingElement, ownerSVGElement(), maskUnits()->baseVal());
-
- SVGMatrixImpl *refCTM = 0;
- SVGLocatableImpl *locatableRef = dynamic_cast<SVGLocatableImpl *>(referencingElement);
- if(locatableRef)
- refCTM = locatableRef->getScreenCTM();
- else
- refCTM = SVGSVGElementImpl::createSVGMatrix();
-
- double xScale, yScale;
-
- refCTM->removeScale(&xScale, &yScale);
- refCTM->deref();
-
- int imageWidth = static_cast<int>(width()->baseVal()->value() * xScale + 0.5);
- int imageHeight = static_cast<int>(height()->baseVal()->value() * yScale + 0.5);
-
- Mask mask;
-
- if(imageWidth > 0 && imageHeight > 0)
- {
- CacheKey key(referencingElement, imageWidth, imageHeight);
-
- if(!m_maskCache.find(key, mask))
- {
- mask = createMask(referencingElement, imageWidth, imageHeight);
- m_maskCache.insert(key, mask, imageWidth * imageHeight);
- }
-
- // Generate a mask-coordinates to screen-coordinates matrix
- SVGMatrixImpl *matrix = 0;
- if(locatableRef)
- matrix = locatableRef->getScreenCTM();
- else
- matrix = SVGSVGElementImpl::createSVGMatrix();
-
- if(maskUnits()->baseVal() == SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
- {
- SVGRectImpl *bbox = referencingElement->getBBox();
- matrix->translate(bbox->x() + x()->baseVal()->value(), bbox->y() + y()->baseVal()->value());
- bbox->deref();
- }
- else
- matrix->translate(x()->baseVal()->value(), y()->baseVal()->value());
-
- matrix->scaleNonUniform(1 / xScale, 1 / yScale);
-
- TQWMatrix screenToMask = matrix->qmatrix().invert();
- matrix->deref();
-
- mask.setScreenToMask(screenToMask);
- }
-
- return mask;
-}
-
-TQByteArray SVGMaskElementImpl::maskRectangle(SVGShapeImpl *shape, const TQRect& screenRectangle)
-{
- TQByteArray cumulativeMask;
-
- do
- {
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(shape);
-
- if(style && style->hasMask())
- {
- SVGElementImpl *element = shape->ownerDoc()->rootElement()->getElementById(style->getMask());
-
- if(element)
- {
- SVGMaskElementImpl *maskElement = dynamic_cast<SVGMaskElementImpl *>(element);
-
- if(maskElement)
- {
- SVGMaskElementImpl::Mask mask = maskElement->createMask(shape);
-
- if(!mask.isEmpty())
- {
- TQByteArray maskData = mask.rectangle(screenRectangle);
-
- if(cumulativeMask.size() == 0)
- cumulativeMask = maskData;
- else
- {
- int size = cumulativeMask.size();
-
- // Multiply into the cumulative mask (using fast divide by 255)
- for(int i = 0; i < size; i++)
- {
- int tmp = maskData[i] * cumulativeMask[i] + 0x80;
- cumulativeMask[i] = (tmp + (tmp >> 8)) >> 8;
- }
- }
- }
- }
- }
- }
-
- DOM::Node parentNode = shape->parentNode();
-
- if(!parentNode.isNull())
- {
- SVGElementImpl *parent = shape->ownerDoc()->getElementFromHandle(parentNode.handle());
-
- if(parent)
- shape = dynamic_cast<SVGShapeImpl *>(parent);
- else
- shape = 0;
- }
- else
- shape = 0;
-
- } while(shape);
-
- return cumulativeMask;
-}
-
-SVGMaskElementImpl::Mask::Mask(const TQByteArray& mask, const TQWMatrix& screenToMask, int width, int height)
- : m_width(width), m_height(height), m_mask(mask), m_screenToMask(screenToMask)
-{
-}
-
-TQByteArray SVGMaskElementImpl::Mask::rectangle(int screenX, int screenY, int width, int height)
-{
- TQByteArray rect(width * height);
-
- for(int x = 0; x < width; x++)
- {
- for(int y = 0; y < height; y++)
- {
- rect[x + y * width] = value(screenX + x, screenY + y);
- }
- }
-
- return rect;
-}
-
-TQByteArray SVGMaskElementImpl::Mask::rectangle(const TQRect& rect)
-{
- return rectangle(rect.x(), rect.y(), rect.width(), rect.height());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMaskElementImpl.cpp b/ksvg/impl/SVGMaskElementImpl.cpp
new file mode 100644
index 00000000..d3947ff4
--- /dev/null
+++ b/ksvg/impl/SVGMaskElementImpl.cpp
@@ -0,0 +1,540 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <cfloat>
+
+#include <kdebug.h>
+#include <tqimage.h>
+
+#include "SVGMaskElement.h"
+
+#include "SVGRectImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGMaskElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGUnitConverter.h"
+#include "SVGShapeImpl.h"
+#include "SVGMatrixImpl.h"
+#include "KSVGCanvas.h"
+#include "CanvasItems.h"
+#include "CanvasFactory.h"
+#include "KSVGHelper.h"
+
+#include <X11/Xos.h>
+
+using namespace KSVG;
+
+#include "SVGMaskElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_ecma.h"
+
+SVGMaskElementImpl::SVGMaskElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGBBoxTarget()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y->ref();
+
+ m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_height->ref();
+
+ m_maskUnits = new SVGAnimatedEnumerationImpl();
+ m_maskUnits->ref();
+
+ m_maskContentUnits = new SVGAnimatedEnumerationImpl();
+ m_maskContentUnits->ref();
+
+ m_converter = new SVGUnitConverter();
+ m_converter->add(m_x);
+ m_converter->add(m_y);
+ m_converter->add(m_width);
+ m_converter->add(m_height);
+
+ m_canvas = 0;
+
+ m_maskCache.setMaxTotalCost(1024 * 1024);
+}
+
+SVGMaskElementImpl::~SVGMaskElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_maskUnits)
+ m_maskContentUnits->deref();
+ if(m_maskUnits)
+ m_maskContentUnits->deref();
+ delete m_converter;
+ if(m_canvas)
+ delete m_canvas;
+}
+
+SVGAnimatedEnumerationImpl *SVGMaskElementImpl::maskUnits() const
+{
+ return m_maskUnits;
+}
+
+SVGAnimatedEnumerationImpl *SVGMaskElementImpl::maskContentUnits() const
+{
+ return m_maskContentUnits;
+}
+
+SVGAnimatedLengthImpl *SVGMaskElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGMaskElementImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGMaskElementImpl::width() const
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGMaskElementImpl::height() const
+{
+ return m_height;
+}
+
+/*
+@namespace KSVG
+@begin SVGMaskElementImpl::s_hashTable 7
+ maskUnits SVGMaskElementImpl::MaskUnits DontDelete|ReadOnly
+ maskContentUnits SVGMaskElementImpl::MaskContentUnits DontDelete|ReadOnly
+ x SVGMaskElementImpl::X DontDelete|ReadOnly
+ y SVGMaskElementImpl::Y DontDelete|ReadOnly
+ width SVGMaskElementImpl::Width DontDelete|ReadOnly
+ height SVGMaskElementImpl::Height DontDelete|ReadOnly
+@end
+*/
+Value SVGMaskElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case MaskUnits:
+ if(!attributeMode)
+ return m_maskUnits->cache(exec);
+ else
+ return Number(m_maskUnits->baseVal());
+ case MaskContentUnits:
+ if(!attributeMode)
+ return m_maskContentUnits->cache(exec);
+ else
+ return Number(m_maskContentUnits->baseVal());
+ case X:
+ if(!attributeMode)
+ return m_x->cache(exec);
+ else
+ return Number(m_x->baseVal()->value());
+ case Y:
+ if(!attributeMode)
+ return m_y->cache(exec);
+ else
+ return Number(m_y->baseVal()->value());
+ case Width:
+ if(!attributeMode)
+ return m_width->cache(exec);
+ else
+ return Number(m_width->baseVal()->value());
+
+ case Height:
+ if(!attributeMode)
+ return m_height->cache(exec);
+ else
+ return Number(m_height->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGMaskElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case MaskUnits:
+ if(value.toString(exec).qstring() == "objectBoundingBox")
+ m_maskUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+ else
+ m_maskUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_USERSPACEONUSE);
+ break;
+ case MaskContentUnits:
+ if(value.toString(exec).qstring() == "objectBoundingBox")
+ m_maskContentUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
+ else
+ m_maskContentUnits->setBaseVal(SVGMaskElement::SVG_UNIT_TYPE_USERSPACEONUSE);
+ break;
+ case X:
+ converter()->modify(x(), value.toString(exec).qstring());
+ break;
+ case Y:
+ converter()->modify(y(), value.toString(exec).qstring());
+ break;
+ case Width:
+ converter()->modify(width(), value.toString(exec).qstring());
+ break;
+ case Height:
+ converter()->modify(height(), value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGMaskElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_x->baseVal()->value());
+ ret->setY(m_y->baseVal()->value());
+ ret->setWidth(m_width->baseVal()->value());
+ ret->setHeight(m_height->baseVal()->value());
+ return ret;
+}
+
+void SVGMaskElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if attribute not specified, use objectBoundingBox
+ if(KSVG_TOKEN_NOT_PARSED(MaskUnits))
+ KSVG_SET_ALT_ATTRIBUTE(MaskUnits, "objectBoundingBox")
+
+ // Spec: if attribute not specified, use userSpaceOnUse
+ if(KSVG_TOKEN_NOT_PARSED(MaskContentUnits))
+ KSVG_SET_ALT_ATTRIBUTE(MaskContentUnits, "userSpaceOnUse")
+
+ // Spec: if attribute not specified, use "-10%"
+ if(KSVG_TOKEN_NOT_PARSED(X))
+ KSVG_SET_ALT_ATTRIBUTE(X, "-10%");
+
+ // Spec: if attribute not specified, use "-10%"
+ if(KSVG_TOKEN_NOT_PARSED(Y))
+ KSVG_SET_ALT_ATTRIBUTE(Y, "-10%");
+
+ // Spec: if attribute not specified, use "120%"
+ if(KSVG_TOKEN_NOT_PARSED(Width))
+ KSVG_SET_ALT_ATTRIBUTE(Width, "120%");
+
+ // Spec: if attribute not specified, use "120%"
+ if(KSVG_TOKEN_NOT_PARSED(Height))
+ KSVG_SET_ALT_ATTRIBUTE(Height, "120%");
+}
+
+SVGMaskElementImpl::Mask SVGMaskElementImpl::createMask(SVGShapeImpl *referencingElement, int imageWidth, int imageHeight)
+{
+ converter()->finalize(referencingElement, ownerSVGElement(), maskUnits()->baseVal());
+
+ TQ_UINT32 *imageBits = new TQ_UINT32[imageWidth * imageHeight];
+
+ if(m_canvas == 0)
+ m_canvas = CanvasFactory::self()->loadCanvas(imageWidth, imageHeight);
+
+ m_canvas->setup(reinterpret_cast<unsigned char *>(imageBits), imageWidth, imageHeight);
+ m_canvas->setBackgroundColor(tqRgba(0, 0, 0, 0));
+
+ SVGMatrixImpl *baseMatrix = SVGSVGElementImpl::createSVGMatrix();
+
+ // Set the scale to map the mask onto the image
+ double xScale = static_cast<double>(imageWidth) / width()->baseVal()->value();
+ double yScale = static_cast<double>(imageHeight) / height()->baseVal()->value();
+
+ baseMatrix->scaleNonUniform(xScale, yScale);
+
+ SVGRectImpl *bbox = referencingElement->getBBox();
+
+ if(maskUnits()->baseVal() == SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
+ baseMatrix->translate(-(bbox->x() + x()->baseVal()->value()), -(bbox->y() + y()->baseVal()->value()));
+ else
+ baseMatrix->translate(-x()->baseVal()->value(), -y()->baseVal()->value());
+
+ if(maskContentUnits()->baseVal() == SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
+ {
+ baseMatrix->translate(bbox->x(), bbox->y());
+ baseMatrix->scaleNonUniform(bbox->width(), bbox->height());
+ }
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
+
+ bool ok = tests ? tests->ok() : true;
+ if(element && shape && style && ok && style->getVisible() && style->getDisplay())
+ {
+ SVGLocatableImpl *locatable = dynamic_cast<SVGLocatableImpl *>(element);
+ if(locatable)
+ locatable->updateCachedScreenCTM(baseMatrix);
+
+ element->createItem(m_canvas);
+ if(shape->item())
+ {
+ shape->item()->setReferenced(true);
+ m_canvas->invalidate(shape->item(), true);
+ }
+ }
+ }
+
+ m_canvas->update(float(1));
+
+ for(DOM::Node node = firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
+
+ bool ok = tests ? tests->ok() : true;
+ if(element && shape && style && ok && style->getVisible() && style->getDisplay())
+ {
+ if(shape)
+ shape->removeItem(m_canvas);
+ }
+ }
+
+
+ {
+ // Note: r and b reversed
+ //TQImage maskImage(reinterpret_cast<unsigned char *>(imageBits), imageWidth, imageHeight, 32, 0, 0, TQImage::IgnoreEndian);
+ //maskImage.setAlphaBuffer(true);
+ //maskImage.save("mask.png", "PNG");
+ }
+
+ TQByteArray maskData(imageWidth * imageHeight);
+ const double epsilon = DBL_EPSILON;
+
+ // Convert the rgba image into an 8-bit mask, according to the specs.
+ for(int i = 0; i < imageWidth * imageHeight; i++)
+ {
+ TQ_UINT32 rgba = imageBits[i];
+
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ double r = (rgba & 0xff) / 255.0;
+ double g = ((rgba >> 8) & 0xff) / 255.0;
+ double b = ((rgba >> 16) & 0xff) / 255.0;
+ double a = ((rgba >> 24) & 0xff) / 255.0;
+#else
+ double a = (rgba & 0xff) / 255.0;
+ double b = ((rgba >> 8) & 0xff) / 255.0;
+ double g = ((rgba >> 16) & 0xff) / 255.0;
+ double r = ((rgba >> 24) & 0xff) / 255.0;
+#endif
+
+ // Remove pre-multiplication by alpha.
+ if(a > epsilon)
+ {
+ r /= a;
+ g /= a;
+ b /= a;
+ }
+
+ // Convert to linear RGB
+ r = KSVGHelper::linearRGBFromsRGB(int(r * 255 + 0.5)) / 255.0;
+ g = KSVGHelper::linearRGBFromsRGB(int(g * 255 + 0.5)) / 255.0;
+ b = KSVGHelper::linearRGBFromsRGB(int(b * 255 + 0.5)) / 255.0;
+
+ // Convert 'luminance to alpha'
+ double luminanceAlpha = 0.2125 * r + 0.7154 * g + 0.0721 * b;
+
+ // Multiply by alpha.
+ double maskValue = luminanceAlpha * a;
+
+ maskData[i] = static_cast<unsigned char>(maskValue * 255 + 0.5);
+ }
+
+ delete [] imageBits;
+
+ baseMatrix->deref();
+ bbox->deref();
+
+ // The screenToMask matrix is calculated each time the mask is used so we don't
+ // need to set it here.
+ TQWMatrix tempMatrix;
+
+ return Mask(maskData, tempMatrix, imageWidth, imageHeight);
+}
+
+SVGMaskElementImpl::Mask SVGMaskElementImpl::createMask(SVGShapeImpl *referencingElement)
+{
+ converter()->finalize(referencingElement, ownerSVGElement(), maskUnits()->baseVal());
+
+ SVGMatrixImpl *refCTM = 0;
+ SVGLocatableImpl *locatableRef = dynamic_cast<SVGLocatableImpl *>(referencingElement);
+ if(locatableRef)
+ refCTM = locatableRef->getScreenCTM();
+ else
+ refCTM = SVGSVGElementImpl::createSVGMatrix();
+
+ double xScale, yScale;
+
+ refCTM->removeScale(&xScale, &yScale);
+ refCTM->deref();
+
+ int imageWidth = static_cast<int>(width()->baseVal()->value() * xScale + 0.5);
+ int imageHeight = static_cast<int>(height()->baseVal()->value() * yScale + 0.5);
+
+ Mask mask;
+
+ if(imageWidth > 0 && imageHeight > 0)
+ {
+ CacheKey key(referencingElement, imageWidth, imageHeight);
+
+ if(!m_maskCache.find(key, mask))
+ {
+ mask = createMask(referencingElement, imageWidth, imageHeight);
+ m_maskCache.insert(key, mask, imageWidth * imageHeight);
+ }
+
+ // Generate a mask-coordinates to screen-coordinates matrix
+ SVGMatrixImpl *matrix = 0;
+ if(locatableRef)
+ matrix = locatableRef->getScreenCTM();
+ else
+ matrix = SVGSVGElementImpl::createSVGMatrix();
+
+ if(maskUnits()->baseVal() == SVGMaskElement::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
+ {
+ SVGRectImpl *bbox = referencingElement->getBBox();
+ matrix->translate(bbox->x() + x()->baseVal()->value(), bbox->y() + y()->baseVal()->value());
+ bbox->deref();
+ }
+ else
+ matrix->translate(x()->baseVal()->value(), y()->baseVal()->value());
+
+ matrix->scaleNonUniform(1 / xScale, 1 / yScale);
+
+ TQWMatrix screenToMask = matrix->qmatrix().invert();
+ matrix->deref();
+
+ mask.setScreenToMask(screenToMask);
+ }
+
+ return mask;
+}
+
+TQByteArray SVGMaskElementImpl::maskRectangle(SVGShapeImpl *shape, const TQRect& screenRectangle)
+{
+ TQByteArray cumulativeMask;
+
+ do
+ {
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(shape);
+
+ if(style && style->hasMask())
+ {
+ SVGElementImpl *element = shape->ownerDoc()->rootElement()->getElementById(style->getMask());
+
+ if(element)
+ {
+ SVGMaskElementImpl *maskElement = dynamic_cast<SVGMaskElementImpl *>(element);
+
+ if(maskElement)
+ {
+ SVGMaskElementImpl::Mask mask = maskElement->createMask(shape);
+
+ if(!mask.isEmpty())
+ {
+ TQByteArray maskData = mask.rectangle(screenRectangle);
+
+ if(cumulativeMask.size() == 0)
+ cumulativeMask = maskData;
+ else
+ {
+ int size = cumulativeMask.size();
+
+ // Multiply into the cumulative mask (using fast divide by 255)
+ for(int i = 0; i < size; i++)
+ {
+ int tmp = maskData[i] * cumulativeMask[i] + 0x80;
+ cumulativeMask[i] = (tmp + (tmp >> 8)) >> 8;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ DOM::Node parentNode = shape->parentNode();
+
+ if(!parentNode.isNull())
+ {
+ SVGElementImpl *parent = shape->ownerDoc()->getElementFromHandle(parentNode.handle());
+
+ if(parent)
+ shape = dynamic_cast<SVGShapeImpl *>(parent);
+ else
+ shape = 0;
+ }
+ else
+ shape = 0;
+
+ } while(shape);
+
+ return cumulativeMask;
+}
+
+SVGMaskElementImpl::Mask::Mask(const TQByteArray& mask, const TQWMatrix& screenToMask, int width, int height)
+ : m_width(width), m_height(height), m_mask(mask), m_screenToMask(screenToMask)
+{
+}
+
+TQByteArray SVGMaskElementImpl::Mask::rectangle(int screenX, int screenY, int width, int height)
+{
+ TQByteArray rect(width * height);
+
+ for(int x = 0; x < width; x++)
+ {
+ for(int y = 0; y < height; y++)
+ {
+ rect[x + y * width] = value(screenX + x, screenY + y);
+ }
+ }
+
+ return rect;
+}
+
+TQByteArray SVGMaskElementImpl::Mask::rectangle(const TQRect& rect)
+{
+ return rectangle(rect.x(), rect.y(), rect.width(), rect.height());
+}
diff --git a/ksvg/impl/SVGMaskElementImpl.h b/ksvg/impl/SVGMaskElementImpl.h
index 2a96967c..f95b5675 100644
--- a/ksvg/impl/SVGMaskElementImpl.h
+++ b/ksvg/impl/SVGMaskElementImpl.h
@@ -154,5 +154,3 @@ inline unsigned char SVGMaskElementImpl::Mask::value(int screenX, int screenY) c
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMatrixImpl.cc b/ksvg/impl/SVGMatrixImpl.cc
deleted file mode 100644
index 0210b8f7..00000000
--- a/ksvg/impl/SVGMatrixImpl.cc
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-
-#include <kdebug.h>
-
-#include "SVGAngleImpl.h"
-#include "SVGMatrixImpl.h"
-#include "KSVGHelper.h"
-
-using namespace KSVG;
-
-#include "SVGMatrixImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGMatrixImpl::SVGMatrixImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGMatrixImpl::SVGMatrixImpl(TQWMatrix mat)
-{
- m_mat = mat;
-}
-
-SVGMatrixImpl::SVGMatrixImpl(double a, double b, double c, double d, double e, double f)
-{
- m_mat.setMatrix(a, b, c, d, e, f);
-}
-
-SVGMatrixImpl::~SVGMatrixImpl()
-{
-}
-
-void SVGMatrixImpl::setA(const double &a)
-{
- m_mat.setMatrix(a, m_mat.m12(), m_mat.m21(), m_mat.m22(), m_mat.dx(), m_mat.dy());
-}
-
-double SVGMatrixImpl::a() const
-{
- return m_mat.m11();
-}
-
-void SVGMatrixImpl::setB(const double &b)
-{
- m_mat.setMatrix(m_mat.m11(), b, m_mat.m21(), m_mat.m22(), m_mat.dx(), m_mat.dy());
-}
-
-double SVGMatrixImpl::b() const
-{
- return m_mat.m12();
-}
-
-void SVGMatrixImpl::setC(const double &c)
-{
- m_mat.setMatrix(m_mat.m11(), m_mat.m12(), c, m_mat.m22(), m_mat.dx(), m_mat.dy());
-}
-
-double SVGMatrixImpl::c() const
-{
- return m_mat.m21();
-}
-
-void SVGMatrixImpl::setD(const double &d)
-{
- m_mat.setMatrix(m_mat.m11(), m_mat.m12(), m_mat.m21(), d, m_mat.dx(), m_mat.dy());
-}
-
-double SVGMatrixImpl::d() const
-{
- return m_mat.m22();
-}
-
-void SVGMatrixImpl::setE(const double &e)
-{
- m_mat.setMatrix(m_mat.m11(), m_mat.m12(), m_mat.m21(), m_mat.m22(), e, m_mat.dy());
-}
-
-double SVGMatrixImpl::e() const
-{
- return m_mat.dx();
-}
-
-void SVGMatrixImpl::setF(const double &f)
-{
- m_mat.setMatrix(m_mat.m11(), m_mat.m12(), m_mat.m21(), m_mat.m22(), m_mat.dx(), f);
-}
-
-double SVGMatrixImpl::f() const
-{
- return m_mat.dy();
-}
-
-void SVGMatrixImpl::copy(const SVGMatrixImpl *other)
-{
- m_mat.setMatrix(other->m_mat.m11(), other->m_mat.m12(), other->m_mat.m21(), other->m_mat.m22(), other->m_mat.dx(), other->m_mat.dy());
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postMultiply(const SVGMatrixImpl *secondMatrix)
-{
- TQWMatrix temp(secondMatrix->a(), secondMatrix->b(), secondMatrix->c(), secondMatrix->d(), secondMatrix->e(), secondMatrix->f());
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::inverse()
-{
- m_mat = m_mat.invert();
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postTranslate(const double &x, const double &y)
-{
- // Could optimise these.
- TQWMatrix temp;
- temp.translate(x, y);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postScale(const double &scaleFactor)
-{
- TQWMatrix temp;
- temp.scale(scaleFactor, scaleFactor);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postScaleNonUniform(const double &scaleFactorX, const double &scaleFactorY)
-{
- TQWMatrix temp;
- temp.scale(scaleFactorX, scaleFactorY);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postRotate(const double &angle)
-{
- TQWMatrix temp;
- temp.rotate(angle);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postRotateFromVector(const double &x, const double &y)
-{
- TQWMatrix temp;
- temp.rotate(SVGAngleImpl::todeg(atan2(y, x)));
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postFlipX()
-{
- TQWMatrix temp(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postFlipY()
-{
- TQWMatrix temp(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postSkewX(const double &angle)
-{
- TQWMatrix temp;
- temp.shear(tan(SVGAngleImpl::torad(angle)), 0.0F);
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::postSkewY(const double &angle)
-{
- TQWMatrix temp;
- temp.shear(0.0F, tan(SVGAngleImpl::torad(angle)));
- m_mat *= temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::multiply(const SVGMatrixImpl *secondMatrix)
-{
- TQWMatrix temp(secondMatrix->a(), secondMatrix->b(), secondMatrix->c(), secondMatrix->d(), secondMatrix->e(), secondMatrix->f());
- temp *= m_mat;
- m_mat = temp;
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::translate(const double &x, const double &y)
-{
- m_mat.translate(x, y);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::scale(const double &scaleFactor)
-{
- m_mat.scale(scaleFactor, scaleFactor);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::scaleNonUniform(const double &scaleFactorX, const double &scaleFactorY)
-{
- m_mat.scale(scaleFactorX, scaleFactorY);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::rotate(const double &angle)
-{
- m_mat.rotate(angle);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::rotateFromVector(const double &x, const double &y)
-{
- m_mat.rotate(SVGAngleImpl::todeg(atan2(y, x)));
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::flipX()
-{
- m_mat.scale(-1.0f, 1.0f);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::flipY()
-{
- m_mat.scale(1.0f, -1.0f);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::skewX(const double &angle)
-{
- m_mat.shear(tan(SVGAngleImpl::torad(angle)), 0.0F);
- return this;
-}
-
-SVGMatrixImpl *SVGMatrixImpl::skewY(const double &angle)
-{
- m_mat.shear(0.0F, tan(SVGAngleImpl::torad(angle)));
- return this;
-}
-
-void SVGMatrixImpl::setMatrix(TQWMatrix mat)
-{
- m_mat = mat;
-}
-
-TQWMatrix &SVGMatrixImpl::qmatrix()
-{
- return m_mat;
-}
-
-const TQWMatrix &SVGMatrixImpl::qmatrix() const
-{
- return m_mat;
-}
-
-void SVGMatrixImpl::reset()
-{
- m_mat.reset();
-}
-
-void SVGMatrixImpl::removeScale(double *xScale, double *yScale)
-{
- double sx = sqrt(a()*a() + b()*b());
- double sy = sqrt(c()*c() + d()*d());
-
- // Remove the scaling from the matrix.
-
- setA(a()/sx);
- setB(b()/sx);
- setC(c()/sy);
- setD(d()/sy);
-
- *xScale = sx;
- *yScale = sy;
-}
-
-KSVGPolygon SVGMatrixImpl::map(const KSVGPolygon& polygon) const
-{
- KSVGPolygon mapped;
-
- for(unsigned int i = 0; i < polygon.numPoints(); i++)
- {
- double x, y;
-
- m_mat.map(polygon.point(i).x(), polygon.point(i).y(), &x, &y);
- mapped.addPoint(x, y);
- }
-
- return mapped;
-}
-
-KSVGPolygon SVGMatrixImpl::inverseMap(const KSVGPolygon& polygon) const
-{
- TQWMatrix inverse = m_mat.invert();
- KSVGPolygon mapped;
-
- for(unsigned int i = 0; i < polygon.numPoints(); i++)
- {
- double x, y;
-
- inverse.map(polygon.point(i).x(), polygon.point(i).y(), &x, &y);
- mapped.addPoint(x, y);
- }
-
- return mapped;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGMatrixImpl::s_hashTable 7
- a SVGMatrixImpl::A DontDelete
- b SVGMatrixImpl::B DontDelete
- c SVGMatrixImpl::C DontDelete
- d SVGMatrixImpl::D DontDelete
- e SVGMatrixImpl::E DontDelete
- f SVGMatrixImpl::F DontDelete
-@end
-@namespace KSVG
-@begin SVGMatrixImplProto::s_hashTable 13
- inverse SVGMatrixImpl::Inverse DontDelete|Function 0
- multiply SVGMatrixImpl::Multiply DontDelete|Function 1
- translate SVGMatrixImpl::Translate DontDelete|Function 2
- scale SVGMatrixImpl::Scale DontDelete|Function 1
- rotate SVGMatrixImpl::Rotate DontDelete|Function 1
- rotateFromVector SVGMatrixImpl::RotateFromVector DontDelete|Function 2
- scaleNonUniform SVGMatrixImpl::ScaleNonUniform DontDelete|Function 2
- flipX SVGMatrixImpl::FlipX DontDelete|Function 0
- flipY SVGMatrixImpl::FlipY DontDelete|Function 0
- skewX SVGMatrixImpl::SkewX DontDelete|Function 1
- skewY SVGMatrixImpl::SkewY DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGMatrix", SVGMatrixImplProto, SVGMatrixImplProtoFunc)
-
-Value SVGMatrixImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case A:
- return Number(a());
- case B:
- return Number(b());
- case C:
- return Number(c());
- case D:
- return Number(d());
- case E:
- return Number(e());
- case F:
- return Number(f());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-
-void SVGMatrixImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case A:
- setA(value.toNumber(exec));
- break;
- case B:
- setB(value.toNumber(exec));
- break;
- case C:
- setC(value.toNumber(exec));
- break;
- case D:
- setD(value.toNumber(exec));
- break;
- case E:
- setE(value.toNumber(exec));
- break;
- case F:
- setF(value.toNumber(exec));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- break;
- }
-}
-
-Value SVGMatrixImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGMatrixImpl)
-
- switch(id)
- {
- case SVGMatrixImpl::Inverse:
- return obj->inverse()->cache(exec);
- break;
- case SVGMatrixImpl::Multiply:
- return obj->multiply(static_cast<KSVGBridge<SVGMatrixImpl> *>(args[0].imp())->impl())->cache(exec);
- break;
- case SVGMatrixImpl::Translate:
- return obj->translate(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- break;
- case SVGMatrixImpl::Scale:
- return obj->scale(args[0].toNumber(exec))->cache(exec);
- break;
- case SVGMatrixImpl::Rotate:
- return obj->rotate(args[0].toNumber(exec))->cache(exec);
- break;
- case SVGMatrixImpl::RotateFromVector:
- return obj->rotateFromVector(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- break;
- case SVGMatrixImpl::ScaleNonUniform:
- return obj->scaleNonUniform(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- break;
- case SVGMatrixImpl::FlipX:
- return obj->flipX()->cache(exec);
- break;
- case SVGMatrixImpl::FlipY:
- return obj->flipY()->cache(exec);
- break;
- case SVGMatrixImpl::SkewX:
- return obj->skewX(args[0].toNumber(exec))->cache(exec);
- break;
- case SVGMatrixImpl::SkewY:
- return obj->skewY(args[0].toNumber(exec))->cache(exec);;
- break;
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMatrixImpl.cpp b/ksvg/impl/SVGMatrixImpl.cpp
new file mode 100644
index 00000000..1f48848d
--- /dev/null
+++ b/ksvg/impl/SVGMatrixImpl.cpp
@@ -0,0 +1,458 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+
+#include <kdebug.h>
+
+#include "SVGAngleImpl.h"
+#include "SVGMatrixImpl.h"
+#include "KSVGHelper.h"
+
+using namespace KSVG;
+
+#include "SVGMatrixImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGMatrixImpl::SVGMatrixImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGMatrixImpl::SVGMatrixImpl(TQWMatrix mat)
+{
+ m_mat = mat;
+}
+
+SVGMatrixImpl::SVGMatrixImpl(double a, double b, double c, double d, double e, double f)
+{
+ m_mat.setMatrix(a, b, c, d, e, f);
+}
+
+SVGMatrixImpl::~SVGMatrixImpl()
+{
+}
+
+void SVGMatrixImpl::setA(const double &a)
+{
+ m_mat.setMatrix(a, m_mat.m12(), m_mat.m21(), m_mat.m22(), m_mat.dx(), m_mat.dy());
+}
+
+double SVGMatrixImpl::a() const
+{
+ return m_mat.m11();
+}
+
+void SVGMatrixImpl::setB(const double &b)
+{
+ m_mat.setMatrix(m_mat.m11(), b, m_mat.m21(), m_mat.m22(), m_mat.dx(), m_mat.dy());
+}
+
+double SVGMatrixImpl::b() const
+{
+ return m_mat.m12();
+}
+
+void SVGMatrixImpl::setC(const double &c)
+{
+ m_mat.setMatrix(m_mat.m11(), m_mat.m12(), c, m_mat.m22(), m_mat.dx(), m_mat.dy());
+}
+
+double SVGMatrixImpl::c() const
+{
+ return m_mat.m21();
+}
+
+void SVGMatrixImpl::setD(const double &d)
+{
+ m_mat.setMatrix(m_mat.m11(), m_mat.m12(), m_mat.m21(), d, m_mat.dx(), m_mat.dy());
+}
+
+double SVGMatrixImpl::d() const
+{
+ return m_mat.m22();
+}
+
+void SVGMatrixImpl::setE(const double &e)
+{
+ m_mat.setMatrix(m_mat.m11(), m_mat.m12(), m_mat.m21(), m_mat.m22(), e, m_mat.dy());
+}
+
+double SVGMatrixImpl::e() const
+{
+ return m_mat.dx();
+}
+
+void SVGMatrixImpl::setF(const double &f)
+{
+ m_mat.setMatrix(m_mat.m11(), m_mat.m12(), m_mat.m21(), m_mat.m22(), m_mat.dx(), f);
+}
+
+double SVGMatrixImpl::f() const
+{
+ return m_mat.dy();
+}
+
+void SVGMatrixImpl::copy(const SVGMatrixImpl *other)
+{
+ m_mat.setMatrix(other->m_mat.m11(), other->m_mat.m12(), other->m_mat.m21(), other->m_mat.m22(), other->m_mat.dx(), other->m_mat.dy());
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postMultiply(const SVGMatrixImpl *secondMatrix)
+{
+ TQWMatrix temp(secondMatrix->a(), secondMatrix->b(), secondMatrix->c(), secondMatrix->d(), secondMatrix->e(), secondMatrix->f());
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::inverse()
+{
+ m_mat = m_mat.invert();
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postTranslate(const double &x, const double &y)
+{
+ // Could optimise these.
+ TQWMatrix temp;
+ temp.translate(x, y);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postScale(const double &scaleFactor)
+{
+ TQWMatrix temp;
+ temp.scale(scaleFactor, scaleFactor);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postScaleNonUniform(const double &scaleFactorX, const double &scaleFactorY)
+{
+ TQWMatrix temp;
+ temp.scale(scaleFactorX, scaleFactorY);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postRotate(const double &angle)
+{
+ TQWMatrix temp;
+ temp.rotate(angle);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postRotateFromVector(const double &x, const double &y)
+{
+ TQWMatrix temp;
+ temp.rotate(SVGAngleImpl::todeg(atan2(y, x)));
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postFlipX()
+{
+ TQWMatrix temp(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postFlipY()
+{
+ TQWMatrix temp(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postSkewX(const double &angle)
+{
+ TQWMatrix temp;
+ temp.shear(tan(SVGAngleImpl::torad(angle)), 0.0F);
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::postSkewY(const double &angle)
+{
+ TQWMatrix temp;
+ temp.shear(0.0F, tan(SVGAngleImpl::torad(angle)));
+ m_mat *= temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::multiply(const SVGMatrixImpl *secondMatrix)
+{
+ TQWMatrix temp(secondMatrix->a(), secondMatrix->b(), secondMatrix->c(), secondMatrix->d(), secondMatrix->e(), secondMatrix->f());
+ temp *= m_mat;
+ m_mat = temp;
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::translate(const double &x, const double &y)
+{
+ m_mat.translate(x, y);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::scale(const double &scaleFactor)
+{
+ m_mat.scale(scaleFactor, scaleFactor);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::scaleNonUniform(const double &scaleFactorX, const double &scaleFactorY)
+{
+ m_mat.scale(scaleFactorX, scaleFactorY);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::rotate(const double &angle)
+{
+ m_mat.rotate(angle);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::rotateFromVector(const double &x, const double &y)
+{
+ m_mat.rotate(SVGAngleImpl::todeg(atan2(y, x)));
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::flipX()
+{
+ m_mat.scale(-1.0f, 1.0f);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::flipY()
+{
+ m_mat.scale(1.0f, -1.0f);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::skewX(const double &angle)
+{
+ m_mat.shear(tan(SVGAngleImpl::torad(angle)), 0.0F);
+ return this;
+}
+
+SVGMatrixImpl *SVGMatrixImpl::skewY(const double &angle)
+{
+ m_mat.shear(0.0F, tan(SVGAngleImpl::torad(angle)));
+ return this;
+}
+
+void SVGMatrixImpl::setMatrix(TQWMatrix mat)
+{
+ m_mat = mat;
+}
+
+TQWMatrix &SVGMatrixImpl::qmatrix()
+{
+ return m_mat;
+}
+
+const TQWMatrix &SVGMatrixImpl::qmatrix() const
+{
+ return m_mat;
+}
+
+void SVGMatrixImpl::reset()
+{
+ m_mat.reset();
+}
+
+void SVGMatrixImpl::removeScale(double *xScale, double *yScale)
+{
+ double sx = sqrt(a()*a() + b()*b());
+ double sy = sqrt(c()*c() + d()*d());
+
+ // Remove the scaling from the matrix.
+
+ setA(a()/sx);
+ setB(b()/sx);
+ setC(c()/sy);
+ setD(d()/sy);
+
+ *xScale = sx;
+ *yScale = sy;
+}
+
+KSVGPolygon SVGMatrixImpl::map(const KSVGPolygon& polygon) const
+{
+ KSVGPolygon mapped;
+
+ for(unsigned int i = 0; i < polygon.numPoints(); i++)
+ {
+ double x, y;
+
+ m_mat.map(polygon.point(i).x(), polygon.point(i).y(), &x, &y);
+ mapped.addPoint(x, y);
+ }
+
+ return mapped;
+}
+
+KSVGPolygon SVGMatrixImpl::inverseMap(const KSVGPolygon& polygon) const
+{
+ TQWMatrix inverse = m_mat.invert();
+ KSVGPolygon mapped;
+
+ for(unsigned int i = 0; i < polygon.numPoints(); i++)
+ {
+ double x, y;
+
+ inverse.map(polygon.point(i).x(), polygon.point(i).y(), &x, &y);
+ mapped.addPoint(x, y);
+ }
+
+ return mapped;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGMatrixImpl::s_hashTable 7
+ a SVGMatrixImpl::A DontDelete
+ b SVGMatrixImpl::B DontDelete
+ c SVGMatrixImpl::C DontDelete
+ d SVGMatrixImpl::D DontDelete
+ e SVGMatrixImpl::E DontDelete
+ f SVGMatrixImpl::F DontDelete
+@end
+@namespace KSVG
+@begin SVGMatrixImplProto::s_hashTable 13
+ inverse SVGMatrixImpl::Inverse DontDelete|Function 0
+ multiply SVGMatrixImpl::Multiply DontDelete|Function 1
+ translate SVGMatrixImpl::Translate DontDelete|Function 2
+ scale SVGMatrixImpl::Scale DontDelete|Function 1
+ rotate SVGMatrixImpl::Rotate DontDelete|Function 1
+ rotateFromVector SVGMatrixImpl::RotateFromVector DontDelete|Function 2
+ scaleNonUniform SVGMatrixImpl::ScaleNonUniform DontDelete|Function 2
+ flipX SVGMatrixImpl::FlipX DontDelete|Function 0
+ flipY SVGMatrixImpl::FlipY DontDelete|Function 0
+ skewX SVGMatrixImpl::SkewX DontDelete|Function 1
+ skewY SVGMatrixImpl::SkewY DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGMatrix", SVGMatrixImplProto, SVGMatrixImplProtoFunc)
+
+Value SVGMatrixImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case A:
+ return Number(a());
+ case B:
+ return Number(b());
+ case C:
+ return Number(c());
+ case D:
+ return Number(d());
+ case E:
+ return Number(e());
+ case F:
+ return Number(f());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+
+void SVGMatrixImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case A:
+ setA(value.toNumber(exec));
+ break;
+ case B:
+ setB(value.toNumber(exec));
+ break;
+ case C:
+ setC(value.toNumber(exec));
+ break;
+ case D:
+ setD(value.toNumber(exec));
+ break;
+ case E:
+ setE(value.toNumber(exec));
+ break;
+ case F:
+ setF(value.toNumber(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ break;
+ }
+}
+
+Value SVGMatrixImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGMatrixImpl)
+
+ switch(id)
+ {
+ case SVGMatrixImpl::Inverse:
+ return obj->inverse()->cache(exec);
+ break;
+ case SVGMatrixImpl::Multiply:
+ return obj->multiply(static_cast<KSVGBridge<SVGMatrixImpl> *>(args[0].imp())->impl())->cache(exec);
+ break;
+ case SVGMatrixImpl::Translate:
+ return obj->translate(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ break;
+ case SVGMatrixImpl::Scale:
+ return obj->scale(args[0].toNumber(exec))->cache(exec);
+ break;
+ case SVGMatrixImpl::Rotate:
+ return obj->rotate(args[0].toNumber(exec))->cache(exec);
+ break;
+ case SVGMatrixImpl::RotateFromVector:
+ return obj->rotateFromVector(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ break;
+ case SVGMatrixImpl::ScaleNonUniform:
+ return obj->scaleNonUniform(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ break;
+ case SVGMatrixImpl::FlipX:
+ return obj->flipX()->cache(exec);
+ break;
+ case SVGMatrixImpl::FlipY:
+ return obj->flipY()->cache(exec);
+ break;
+ case SVGMatrixImpl::SkewX:
+ return obj->skewX(args[0].toNumber(exec))->cache(exec);
+ break;
+ case SVGMatrixImpl::SkewY:
+ return obj->skewY(args[0].toNumber(exec))->cache(exec);;
+ break;
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
diff --git a/ksvg/impl/SVGMatrixImpl.h b/ksvg/impl/SVGMatrixImpl.h
index 7cf7ed92..53ba4ce8 100644
--- a/ksvg/impl/SVGMatrixImpl.h
+++ b/ksvg/impl/SVGMatrixImpl.h
@@ -126,5 +126,3 @@ KSVG_DEFINE_PROTOTYPE(SVGMatrixImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGMatrixImplProtoFunc, SVGMatrixImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMetadataElementImpl.cc b/ksvg/impl/SVGMetadataElementImpl.cc
deleted file mode 100644
index d55d4302..00000000
--- a/ksvg/impl/SVGMetadataElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMetadataElementImpl.h"
-
-using namespace KSVG;
-
-SVGMetadataElementImpl::SVGMetadataElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGMetadataElementImpl::~SVGMetadataElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMetadataElementImpl.cpp b/ksvg/impl/SVGMetadataElementImpl.cpp
new file mode 100644
index 00000000..9fa245bf
--- /dev/null
+++ b/ksvg/impl/SVGMetadataElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMetadataElementImpl.h"
+
+using namespace KSVG;
+
+SVGMetadataElementImpl::SVGMetadataElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGMetadataElementImpl::~SVGMetadataElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGMetadataElementImpl.h b/ksvg/impl/SVGMetadataElementImpl.h
index 363a9c11..113d4a03 100644
--- a/ksvg/impl/SVGMetadataElementImpl.h
+++ b/ksvg/impl/SVGMetadataElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMissingGlyphElementImpl.cc b/ksvg/impl/SVGMissingGlyphElementImpl.cc
deleted file mode 100644
index 986750c3..00000000
--- a/ksvg/impl/SVGMissingGlyphElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGMissingGlyphElementImpl.h"
-
-using namespace KSVG;
-
-SVGMissingGlyphElementImpl::SVGMissingGlyphElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this)
-{
-}
-
-SVGMissingGlyphElementImpl::~SVGMissingGlyphElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGMissingGlyphElementImpl.cpp b/ksvg/impl/SVGMissingGlyphElementImpl.cpp
new file mode 100644
index 00000000..f522dff6
--- /dev/null
+++ b/ksvg/impl/SVGMissingGlyphElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGMissingGlyphElementImpl.h"
+
+using namespace KSVG;
+
+SVGMissingGlyphElementImpl::SVGMissingGlyphElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this)
+{
+}
+
+SVGMissingGlyphElementImpl::~SVGMissingGlyphElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGMissingGlyphElementImpl.h b/ksvg/impl/SVGMissingGlyphElementImpl.h
index 275aba86..18e5204c 100644
--- a/ksvg/impl/SVGMissingGlyphElementImpl.h
+++ b/ksvg/impl/SVGMissingGlyphElementImpl.h
@@ -43,5 +43,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGNumberImpl.cc b/ksvg/impl/SVGNumberImpl.cc
deleted file mode 100644
index b926e9c2..00000000
--- a/ksvg/impl/SVGNumberImpl.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGNumberImpl.h"
-
-using namespace KSVG;
-
-#include "SVGNumberImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGNumberImpl::SVGNumberImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_value = 0;
-}
-
-SVGNumberImpl::~SVGNumberImpl()
-{
-}
-
-void SVGNumberImpl::setValue(float value)
-{
- m_value = value;
-}
-
-float SVGNumberImpl::value()
-{
- return m_value;
-}
-
-/*
-@namespace KSVG
-@begin SVGNumberImpl::s_hashTable 2
- value SVGNumberImpl::Value DontDelete
-@end
-*/
-
-Value SVGNumberImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Value:
- return Number(m_value);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-
- return Undefined();
-}
-
-void SVGNumberImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case Value:
- m_value = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGNumberImpl.cpp b/ksvg/impl/SVGNumberImpl.cpp
new file mode 100644
index 00000000..b1ec38b6
--- /dev/null
+++ b/ksvg/impl/SVGNumberImpl.cpp
@@ -0,0 +1,81 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGNumberImpl.h"
+
+using namespace KSVG;
+
+#include "SVGNumberImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGNumberImpl::SVGNumberImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_value = 0;
+}
+
+SVGNumberImpl::~SVGNumberImpl()
+{
+}
+
+void SVGNumberImpl::setValue(float value)
+{
+ m_value = value;
+}
+
+float SVGNumberImpl::value()
+{
+ return m_value;
+}
+
+/*
+@namespace KSVG
+@begin SVGNumberImpl::s_hashTable 2
+ value SVGNumberImpl::Value DontDelete
+@end
+*/
+
+Value SVGNumberImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Value:
+ return Number(m_value);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+
+ return Undefined();
+}
+
+void SVGNumberImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case Value:
+ m_value = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGNumberImpl.h b/ksvg/impl/SVGNumberImpl.h
index d94b3d63..bd60e8cb 100644
--- a/ksvg/impl/SVGNumberImpl.h
+++ b/ksvg/impl/SVGNumberImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGNumberListImpl.cc b/ksvg/impl/SVGNumberListImpl.cc
deleted file mode 100644
index 8048640c..00000000
--- a/ksvg/impl/SVGNumberListImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGNumberListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGNumberListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGNumberListImpl::s_hashTable 2
- numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGNumberListImplProto::s_hashTable 11
- getItem SVGListDefs::GetItem DontDelete|Function 1
- removeItem SVGListDefs::RemoveItem DontDelete|Function 1
- appendItem SVGListDefs::AppendItem DontDelete|Function 1
- initialize SVGListDefs::Initialize DontDelete|Function 1
- insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
- replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
- clear SVGListDefs::Clear DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGNumberList", SVGNumberListImplProto, SVGNumberListImplProtoFunc)
-
-Value SVGNumberListImpl::getValueProperty(ExecState *exec, int token) const
-{
- return SVGList<SVGNumberImpl>::getValueProperty(exec, token);
-}
-
-Value SVGNumberListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGNumberListImpl)
-
- return obj->call(exec, static_cast<SVGList<SVGNumberImpl> *>(obj), args, id);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGNumberListImpl.cpp b/ksvg/impl/SVGNumberListImpl.cpp
new file mode 100644
index 00000000..a528b474
--- /dev/null
+++ b/ksvg/impl/SVGNumberListImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGNumberListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGNumberListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGNumberListImpl::s_hashTable 2
+ numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGNumberListImplProto::s_hashTable 11
+ getItem SVGListDefs::GetItem DontDelete|Function 1
+ removeItem SVGListDefs::RemoveItem DontDelete|Function 1
+ appendItem SVGListDefs::AppendItem DontDelete|Function 1
+ initialize SVGListDefs::Initialize DontDelete|Function 1
+ insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
+ replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
+ clear SVGListDefs::Clear DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGNumberList", SVGNumberListImplProto, SVGNumberListImplProtoFunc)
+
+Value SVGNumberListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ return SVGList<SVGNumberImpl>::getValueProperty(exec, token);
+}
+
+Value SVGNumberListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGNumberListImpl)
+
+ return obj->call(exec, static_cast<SVGList<SVGNumberImpl> *>(obj), args, id);
+}
diff --git a/ksvg/impl/SVGNumberListImpl.h b/ksvg/impl/SVGNumberListImpl.h
index 87dadb6f..70773324 100644
--- a/ksvg/impl/SVGNumberListImpl.h
+++ b/ksvg/impl/SVGNumberListImpl.h
@@ -44,5 +44,3 @@ KSVG_DEFINE_PROTOTYPE(SVGNumberListImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGNumberListImplProtoFunc, SVGNumberListImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPaintImpl.cc b/ksvg/impl/SVGPaintImpl.cc
deleted file mode 100644
index aa52811a..00000000
--- a/ksvg/impl/SVGPaintImpl.cc
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPaint.h"
-#include "SVGColor.h"
-
-#include "SVGPaintImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPaintImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-SVGPaintImpl::SVGPaintImpl(SVGElementImpl *object) : SVGColorImpl(object)
-{
- m_paintType = SVG_PAINTTYPE_UNKNOWN;
-}
-
-SVGPaintImpl::SVGPaintImpl(const SVGPaintImpl &other) : SVGColorImpl(other)
-{
- (*this) = other;
-}
-
-SVGPaintImpl::~SVGPaintImpl()
-{
-}
-
-SVGPaintImpl &SVGPaintImpl::operator=(const SVGPaintImpl &other)
-{
- m_uri = other.m_uri;
- m_paintType = other.m_paintType;
-
- *(static_cast<SVGColorImpl *>(this)) = other;
-
- return *this;
-}
-
-unsigned short SVGPaintImpl::paintType() const
-{
- return m_paintType;
-}
-
-DOM::DOMString SVGPaintImpl::uri() const
-{
- return m_uri;
-}
-
-void SVGPaintImpl::setUri(const DOM::DOMString &uri)
-{
- m_uri = uri;
- m_paintType = SVG_PAINTTYPE_URI;
-}
-
-void SVGPaintImpl::setPaint(unsigned short paintType, const DOM::DOMString &/*uri*/, const DOM::DOMString &/*rgbColor*/, const DOM::DOMString &/*iccColor*/)
-{
- m_paintType = paintType;
-}
-
-void SVGPaintImpl::setRGBColor(TQColor color)
-{
- m_paintType = SVG_PAINTTYPE_RGBCOLOR;
- SVGColorImpl::setRGBColor(color);
-}
-
-void SVGPaintImpl::setRGBColor(int r, int g, int b)
-{
- m_paintType = SVG_PAINTTYPE_RGBCOLOR;
- SVGColorImpl::setRGBColor(r, g, b);
-}
-
-void SVGPaintImpl::setRGBColor(const DOM::DOMString &rgbColor)
-{
- m_paintType = SVG_PAINTTYPE_RGBCOLOR;
- SVGColorImpl::setRGBColor(rgbColor);
-}
-
-void SVGPaintImpl::setRGBColorICCColor(const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- m_paintType = SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR;
- SVGColorImpl::setRGBColorICCColor(rgbColor, iccColor);
-}
-
-void SVGPaintImpl::setColor(unsigned short colorType, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
-{
- SVGColorImpl::setColor(colorType, rgbColor, iccColor);
-
- switch(colorType)
- {
- case SVG_COLORTYPE_CURRENTCOLOR:
- m_paintType = SVG_PAINTTYPE_CURRENTCOLOR;
- break;
- case SVG_COLORTYPE_RGBCOLOR:
- m_paintType = SVG_PAINTTYPE_CURRENTCOLOR;
- break;
- case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR:
- m_paintType = SVG_PAINTTYPE_CURRENTCOLOR;
- break;
- case SVG_COLORTYPE_UNKNOWN:
- m_paintType = SVG_PAINTTYPE_UNKNOWN;
- break;
- }
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPaintImpl::s_hashTable 3
- paintType SVGPaintImpl::PaintType DontDelete
- uri SVGPaintImpl::URI DontDelete
-@end
-*/
-
-Value SVGPaintImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case PaintType:
- return Number(paintType());
- case URI:
- return String(uri().string());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-/*
-@namespace KSVG
-@begin SVGPaintImplConstructor::s_hashTable 11
-SVG_PAINTTYPE_UNKNOWN KSVG::SVG_PAINTTYPE_UNKNOWN DontDelete|ReadOnly
-SVG_PAINTTYPE_CURRENTCOLOR KSVG::SVG_PAINTTYPE_CURRENTCOLOR DontDelete|ReadOnly
-SVG_PAINTTYPE_RGBCOLOR KSVG::SVG_PAINTTYPE_RGBCOLOR DontDelete|ReadOnly
-SVG_PAINTTYPE_RGBCOLOR KSVG::SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR DontDelete|ReadOnly
-SVG_PAINTTYPE_NONE KSVG::SVG_PAINTTYPE_NONE DontDelete|ReadOnly
-SVG_PAINTTYPE_URI_NONE KSVG::SVG_PAINTTYPE_URI_NONE DontDelete|ReadOnly
-SVG_PAINTTYPE_URI_RGBCOLOR KSVG::SVG_PAINTTYPE_URI_RGBCOLOR DontDelete|ReadOnly
-SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR KSVG::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR DontDelete|ReadOnly
-SVG_PAINTTYPE_URI_CURRENTCOLOR KSVG::SVG_PAINTTYPE_URI_CURRENTCOLOR DontDelete|ReadOnly
-SVG_PAINTTYPE_URI KSVG::SVG_PAINTTYPE_URI DontDelete|ReadOnly
-@end
-*/
-
-Value SVGPaintImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGPaintImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGPaintImplConstructor>(exec, "[[svgpaint.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPaintImpl.cpp b/ksvg/impl/SVGPaintImpl.cpp
new file mode 100644
index 00000000..8e56baae
--- /dev/null
+++ b/ksvg/impl/SVGPaintImpl.cpp
@@ -0,0 +1,173 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPaint.h"
+#include "SVGColor.h"
+
+#include "SVGPaintImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPaintImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+SVGPaintImpl::SVGPaintImpl(SVGElementImpl *object) : SVGColorImpl(object)
+{
+ m_paintType = SVG_PAINTTYPE_UNKNOWN;
+}
+
+SVGPaintImpl::SVGPaintImpl(const SVGPaintImpl &other) : SVGColorImpl(other)
+{
+ (*this) = other;
+}
+
+SVGPaintImpl::~SVGPaintImpl()
+{
+}
+
+SVGPaintImpl &SVGPaintImpl::operator=(const SVGPaintImpl &other)
+{
+ m_uri = other.m_uri;
+ m_paintType = other.m_paintType;
+
+ *(static_cast<SVGColorImpl *>(this)) = other;
+
+ return *this;
+}
+
+unsigned short SVGPaintImpl::paintType() const
+{
+ return m_paintType;
+}
+
+DOM::DOMString SVGPaintImpl::uri() const
+{
+ return m_uri;
+}
+
+void SVGPaintImpl::setUri(const DOM::DOMString &uri)
+{
+ m_uri = uri;
+ m_paintType = SVG_PAINTTYPE_URI;
+}
+
+void SVGPaintImpl::setPaint(unsigned short paintType, const DOM::DOMString &/*uri*/, const DOM::DOMString &/*rgbColor*/, const DOM::DOMString &/*iccColor*/)
+{
+ m_paintType = paintType;
+}
+
+void SVGPaintImpl::setRGBColor(TQColor color)
+{
+ m_paintType = SVG_PAINTTYPE_RGBCOLOR;
+ SVGColorImpl::setRGBColor(color);
+}
+
+void SVGPaintImpl::setRGBColor(int r, int g, int b)
+{
+ m_paintType = SVG_PAINTTYPE_RGBCOLOR;
+ SVGColorImpl::setRGBColor(r, g, b);
+}
+
+void SVGPaintImpl::setRGBColor(const DOM::DOMString &rgbColor)
+{
+ m_paintType = SVG_PAINTTYPE_RGBCOLOR;
+ SVGColorImpl::setRGBColor(rgbColor);
+}
+
+void SVGPaintImpl::setRGBColorICCColor(const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ m_paintType = SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR;
+ SVGColorImpl::setRGBColorICCColor(rgbColor, iccColor);
+}
+
+void SVGPaintImpl::setColor(unsigned short colorType, const DOM::DOMString &rgbColor, const DOM::DOMString &iccColor)
+{
+ SVGColorImpl::setColor(colorType, rgbColor, iccColor);
+
+ switch(colorType)
+ {
+ case SVG_COLORTYPE_CURRENTCOLOR:
+ m_paintType = SVG_PAINTTYPE_CURRENTCOLOR;
+ break;
+ case SVG_COLORTYPE_RGBCOLOR:
+ m_paintType = SVG_PAINTTYPE_CURRENTCOLOR;
+ break;
+ case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR:
+ m_paintType = SVG_PAINTTYPE_CURRENTCOLOR;
+ break;
+ case SVG_COLORTYPE_UNKNOWN:
+ m_paintType = SVG_PAINTTYPE_UNKNOWN;
+ break;
+ }
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPaintImpl::s_hashTable 3
+ paintType SVGPaintImpl::PaintType DontDelete
+ uri SVGPaintImpl::URI DontDelete
+@end
+*/
+
+Value SVGPaintImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case PaintType:
+ return Number(paintType());
+ case URI:
+ return String(uri().string());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+/*
+@namespace KSVG
+@begin SVGPaintImplConstructor::s_hashTable 11
+SVG_PAINTTYPE_UNKNOWN KSVG::SVG_PAINTTYPE_UNKNOWN DontDelete|ReadOnly
+SVG_PAINTTYPE_CURRENTCOLOR KSVG::SVG_PAINTTYPE_CURRENTCOLOR DontDelete|ReadOnly
+SVG_PAINTTYPE_RGBCOLOR KSVG::SVG_PAINTTYPE_RGBCOLOR DontDelete|ReadOnly
+SVG_PAINTTYPE_RGBCOLOR KSVG::SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR DontDelete|ReadOnly
+SVG_PAINTTYPE_NONE KSVG::SVG_PAINTTYPE_NONE DontDelete|ReadOnly
+SVG_PAINTTYPE_URI_NONE KSVG::SVG_PAINTTYPE_URI_NONE DontDelete|ReadOnly
+SVG_PAINTTYPE_URI_RGBCOLOR KSVG::SVG_PAINTTYPE_URI_RGBCOLOR DontDelete|ReadOnly
+SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR KSVG::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR DontDelete|ReadOnly
+SVG_PAINTTYPE_URI_CURRENTCOLOR KSVG::SVG_PAINTTYPE_URI_CURRENTCOLOR DontDelete|ReadOnly
+SVG_PAINTTYPE_URI KSVG::SVG_PAINTTYPE_URI DontDelete|ReadOnly
+@end
+*/
+
+Value SVGPaintImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGPaintImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGPaintImplConstructor>(exec, "[[svgpaint.constructor]]");
+}
diff --git a/ksvg/impl/SVGPaintImpl.h b/ksvg/impl/SVGPaintImpl.h
index 03cb2153..dece0892 100644
--- a/ksvg/impl/SVGPaintImpl.h
+++ b/ksvg/impl/SVGPaintImpl.h
@@ -81,5 +81,3 @@ KJS::Value getSVGPaintImplConstructor(KJS::ExecState *exec);
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPaintServerImpl.cc b/ksvg/impl/SVGPaintServerImpl.cc
deleted file mode 100644
index e87882b1..00000000
--- a/ksvg/impl/SVGPaintServerImpl.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (C) 2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPaintServerImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KSVG;
-
-SVGPaintServerImpl::SVGPaintServerImpl()
-{
- m_paintServer = 0;
-}
-
-SVGPaintServerImpl::~SVGPaintServerImpl()
-{
-}
-
-CanvasPaintServer *SVGPaintServerImpl::paintServer(SVGDocumentImpl *doc, const TQString& id)
-{
- CanvasPaintServer *pserver = 0;
- SVGElementImpl *element = doc->rootElement()->getElementById(id);
-
- if(element)
- {
- SVGPaintServerImpl *paintServerElement = dynamic_cast<SVGPaintServerImpl *>(element);
-
- if(paintServerElement)
- pserver = paintServerElement->paintServer();
- }
-
- return pserver;
-}
-
-// vim:ts=4:noet
-
diff --git a/ksvg/impl/SVGPaintServerImpl.cpp b/ksvg/impl/SVGPaintServerImpl.cpp
new file mode 100644
index 00000000..006ba853
--- /dev/null
+++ b/ksvg/impl/SVGPaintServerImpl.cpp
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPaintServerImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KSVG;
+
+SVGPaintServerImpl::SVGPaintServerImpl()
+{
+ m_paintServer = 0;
+}
+
+SVGPaintServerImpl::~SVGPaintServerImpl()
+{
+}
+
+CanvasPaintServer *SVGPaintServerImpl::paintServer(SVGDocumentImpl *doc, const TQString& id)
+{
+ CanvasPaintServer *pserver = 0;
+ SVGElementImpl *element = doc->rootElement()->getElementById(id);
+
+ if(element)
+ {
+ SVGPaintServerImpl *paintServerElement = dynamic_cast<SVGPaintServerImpl *>(element);
+
+ if(paintServerElement)
+ pserver = paintServerElement->paintServer();
+ }
+
+ return pserver;
+}
diff --git a/ksvg/impl/SVGPaintServerImpl.h b/ksvg/impl/SVGPaintServerImpl.h
index d9f4a898..da210d23 100644
--- a/ksvg/impl/SVGPaintServerImpl.h
+++ b/ksvg/impl/SVGPaintServerImpl.h
@@ -47,6 +47,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
-
diff --git a/ksvg/impl/SVGPathElementImpl.cc b/ksvg/impl/SVGPathElementImpl.cc
deleted file mode 100644
index 93ddc6ad..00000000
--- a/ksvg/impl/SVGPathElementImpl.cc
+++ /dev/null
@@ -1,868 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-#include <cfloat>
-
-#include <kdebug.h>
-#include <tdelocale.h>
-
-#include "SVGRectImpl.h"
-#include "SVGPaintImpl.h"
-#include "SVGPointImpl.h"
-#include "SVGAngleImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGPathSegArcImpl.h"
-#include "SVGPathSegListImpl.h"
-#include "SVGPathElementImpl.h"
-#include "SVGPathSegLinetoImpl.h"
-#include "SVGPathSegMovetoImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGPathSegClosePathImpl.h"
-#include "SVGPathSegCurvetoCubicImpl.h"
-#include "SVGPathSegLinetoVerticalImpl.h"
-#include "SVGPathSegLinetoHorizontalImpl.h"
-#include "SVGPathSegCurvetoQuadraticImpl.h"
-#include "SVGPathSegCurvetoCubicSmoothImpl.h"
-#include "SVGPathSegCurvetoQuadraticSmoothImpl.h"
-
-#include "SVGPaint.h"
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-#include "BezierPath.h"
-#include "Point.h"
-
-using namespace KSVG;
-
-#include "SVGPathElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGPathElementImpl::SVGPathElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl(), SVGAnimatedPathDataImpl(), SVGPathParser()
-{
- KSVG_EMPTY_FLAGS
-
- m_pathLength = new SVGAnimatedNumberImpl();
- m_pathLength->ref();
-
- m_pathLength->setBaseVal(0);
-}
-
-SVGPathElementImpl::~SVGPathElementImpl()
-{
- pathSegList()->clear();
-
- if(m_pathLength)
- m_pathLength->deref();
-}
-
-SVGAnimatedNumberImpl *SVGPathElementImpl::pathLength() const
-{
- return m_pathLength;
-}
-
-double SVGPathElementImpl::getTotalLength()
-{
- T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
- if(path)
- return path->length();
-
- return 0;
-}
-
-SVGPointImpl *SVGPathElementImpl::getPointAtLength(double distance)
-{
- SVGPointImpl *ret = SVGSVGElementImpl::createSVGPoint();
- double totalDistance = getTotalLength();
- T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
- if(path)
- {
- T2P::Point p;
- path->pointTangentNormalAt(distance / totalDistance, &p);
- ret->setX(p.x());
- ret->setY(p.y());
- }
-
- return ret;
-}
-
-unsigned long SVGPathElementImpl::getPathSegAtLength(double)
-{
- return 0;
-}
-
-SVGPathSegClosePathImpl *SVGPathElementImpl::createSVGPathSegClosePath()
-{
- SVGPathSegClosePathImpl *temp = new SVGPathSegClosePathImpl();
- temp->ref();
-
- return temp;
-}
-
-SVGPathSegMovetoAbsImpl *SVGPathElementImpl::createSVGPathSegMovetoAbs(double x, double y)
-{
- SVGPathSegMovetoAbsImpl *temp = new SVGPathSegMovetoAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegMovetoRelImpl *SVGPathElementImpl::createSVGPathSegMovetoRel(double x, double y)
-{
- SVGPathSegMovetoRelImpl *temp = new SVGPathSegMovetoRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegLinetoAbsImpl *SVGPathElementImpl::createSVGPathSegLinetoAbs(double x, double y)
-{
- SVGPathSegLinetoAbsImpl *temp = new SVGPathSegLinetoAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegLinetoRelImpl *SVGPathElementImpl::createSVGPathSegLinetoRel(double x, double y)
-{
- SVGPathSegLinetoRelImpl *temp = new SVGPathSegLinetoRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegCurvetoCubicAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2)
-{
- SVGPathSegCurvetoCubicAbsImpl *temp = new SVGPathSegCurvetoCubicAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setX1(x1);
- temp->setY1(y1);
- temp->setX2(x2);
- temp->setY2(y2);
- return temp;
-}
-
-SVGPathSegCurvetoCubicRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2)
-{
- SVGPathSegCurvetoCubicRelImpl *temp = new SVGPathSegCurvetoCubicRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setX1(x1);
- temp->setY1(y1);
- temp->setX2(x2);
- temp->setY2(y2);
- return temp;
-}
-
-SVGPathSegCurvetoQuadraticAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1)
-{
- SVGPathSegCurvetoQuadraticAbsImpl *temp = new SVGPathSegCurvetoQuadraticAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setX1(x1);
- temp->setY1(y1);
- return temp;
-}
-
-SVGPathSegCurvetoQuadraticRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1)
-{
- SVGPathSegCurvetoQuadraticRelImpl *temp = new SVGPathSegCurvetoQuadraticRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setX1(x1);
- temp->setY1(y1);
- return temp;
-}
-
-SVGPathSegArcAbsImpl *SVGPathElementImpl::createSVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
-{
- SVGPathSegArcAbsImpl *temp = new SVGPathSegArcAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setR1(r1);
- temp->setR2(r2);
- temp->setAngle(angle);
- temp->setLargeArcFlag(largeArcFlag);
- temp->setSweepFlag(sweepFlag);
- return temp;
-}
-
-SVGPathSegArcRelImpl *SVGPathElementImpl::createSVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
-{
- SVGPathSegArcRelImpl *temp = new SVGPathSegArcRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setR1(r1);
- temp->setR2(r2);
- temp->setAngle(angle);
- temp->setLargeArcFlag(largeArcFlag);
- temp->setSweepFlag(sweepFlag);
- return temp;
-}
-
-SVGPathSegLinetoHorizontalAbsImpl *SVGPathElementImpl::createSVGPathSegLinetoHorizontalAbs(double x)
-{
- SVGPathSegLinetoHorizontalAbsImpl *temp = new SVGPathSegLinetoHorizontalAbsImpl();
- temp->ref();
-
- temp->setX(x);
- return temp;
-}
-
-SVGPathSegLinetoHorizontalRelImpl *SVGPathElementImpl::createSVGPathSegLinetoHorizontalRel(double x)
-{
- SVGPathSegLinetoHorizontalRelImpl *temp = new SVGPathSegLinetoHorizontalRelImpl();
- temp->ref();
-
- temp->setX(x);
- return temp;
-}
-
-SVGPathSegLinetoVerticalAbsImpl *SVGPathElementImpl::createSVGPathSegLinetoVerticalAbs(double y)
-{
- SVGPathSegLinetoVerticalAbsImpl *temp = new SVGPathSegLinetoVerticalAbsImpl();
- temp->ref();
-
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegLinetoVerticalRelImpl *SVGPathElementImpl::createSVGPathSegLinetoVerticalRel(double y)
-{
- SVGPathSegLinetoVerticalRelImpl *temp = new SVGPathSegLinetoVerticalRelImpl();
- temp->ref();
-
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegCurvetoCubicSmoothAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2)
-{
- SVGPathSegCurvetoCubicSmoothAbsImpl *temp = new SVGPathSegCurvetoCubicSmoothAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setX2(x2);
- temp->setY2(y2);
- return temp;
-}
-
-SVGPathSegCurvetoCubicSmoothRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2)
-{
- SVGPathSegCurvetoCubicSmoothRelImpl *temp = new SVGPathSegCurvetoCubicSmoothRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- temp->setX2(x2);
- temp->setY2(y2);
- return temp;
-}
-
-SVGPathSegCurvetoQuadraticSmoothAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y)
-{
- SVGPathSegCurvetoQuadraticSmoothAbsImpl *temp = new SVGPathSegCurvetoQuadraticSmoothAbsImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- return temp;
-}
-
-SVGPathSegCurvetoQuadraticSmoothRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y)
-{
- SVGPathSegCurvetoQuadraticSmoothRelImpl *temp = new SVGPathSegCurvetoQuadraticSmoothRelImpl();
- temp->ref();
-
- temp->setX(x);
- temp->setY(y);
- return temp;
-}
-
-void SVGPathElementImpl::svgMoveTo(double x1, double y1, bool, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegMovetoAbs(x1, y1));
- else
- pathSegList()->appendItem(createSVGPathSegMovetoRel(x1, y1));
-}
-
-void SVGPathElementImpl::svgLineTo(double x1, double y1, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegLinetoAbs(x1, y1));
- else
- pathSegList()->appendItem(createSVGPathSegLinetoRel(x1, y1));
-}
-
-void SVGPathElementImpl::svgLineToHorizontal(double x, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegLinetoHorizontalAbs(x));
- else
- pathSegList()->appendItem(createSVGPathSegLinetoHorizontalRel(x));
-}
-
-void SVGPathElementImpl::svgLineToVertical(double y, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegLinetoVerticalAbs(y));
- else
- pathSegList()->appendItem(createSVGPathSegLinetoVerticalRel(y));
-}
-
-void SVGPathElementImpl::svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2));
- else
- pathSegList()->appendItem(createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2));
-}
-
-void SVGPathElementImpl::svgCurveToCubicSmooth(double x, double y, double x2, double y2, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegCurvetoCubicSmoothAbs(x2, y2, x, y));
- else
- pathSegList()->appendItem(createSVGPathSegCurvetoCubicSmoothRel(x2, y2, x, y));
-}
-
-void SVGPathElementImpl::svgCurveToQuadratic(double x, double y, double x1, double y1, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticAbs(x1, y1, x, y));
- else
- pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticRel(x1, y1, x, y));
-}
-
-void SVGPathElementImpl::svgCurveToQuadraticSmooth(double x, double y, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticSmoothAbs(x, y));
- else
- pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticSmoothRel(x, y));
-}
-
-void SVGPathElementImpl::svgArcTo(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs)
-{
- if(abs)
- pathSegList()->appendItem(createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag));
- else
- pathSegList()->appendItem(createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag));
-}
-
-void SVGPathElementImpl::svgClosePath()
-{
- pathSegList()->appendItem(createSVGPathSegClosePath());
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathElementImpl::s_hashTable 3
- d SVGPathElementImpl::D DontDelete|ReadOnly
- pathLength SVGPathElementImpl::PathLength DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGPathElementImplProto::s_hashTable 23
- getTotalLength SVGPathElementImpl::GetTotalLength DontDelete|Function 0
- getPointAtLength SVGPathElementImpl::GetPointAtLength DontDelete|Function 1
- getPathSegAtLength SVGPathElementImpl::GetPathSegAtLength DontDelete|Function 1
- createSVGPathSegClosePath SVGPathElementImpl::CreateSVGPathSegClosePath DontDelete|Function 0
- createSVGPathSegMovetoAbs SVGPathElementImpl::CreateSVGPathSegMovetoAbs DontDelete|Function 2
- createSVGPathSegMovetoRel SVGPathElementImpl::CreateSVGPathSegMovetoRel DontDelete|Function 2
- createSVGPathSegLinetoAbs SVGPathElementImpl::CreateSVGPathSegLinetoAbs DontDelete|Function 2
- createSVGPathSegLinetoRel SVGPathElementImpl::CreateSVGPathSegLinetoRel DontDelete|Function 2
- createSVGPathSegArcAbs SVGPathElementImpl::CreateSVGPathSegArcAbs DontDelete|Function 7
- createSVGPathSegArcRel SVGPathElementImpl::CreateSVGPathSegArcRel DontDelete|Function 7
- createSVGPathSegCurvetoCubicAbs SVGPathElementImpl::CreateSVGPathSegCurvetoCubicAbs DontDelete|Function 6
- createSVGPathSegCurvetoCubicRel SVGPathElementImpl::CreateSVGPathSegCurvetoCubicRel DontDelete|Function 6
- createSVGPathSegCurvetoQuadraticAbs SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticAbs DontDelete|Function 4
- createSVGPathSegCurvetoQuadraticRel SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticRel DontDelete|Function 4
- createSVGPathSegLinetoHorizontalAbs SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalAbs DontDelete|Function 1
- createSVGPathSegLinetoHorizontalRel SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalRel DontDelete|Function 1
- createSVGPathSegLinetoVerticalAbs SVGPathElementImpl::CreateSVGPathSegLinetoVerticalAbs DontDelete|Function 1
- createSVGPathSegLinetoVerticalRel SVGPathElementImpl::CreateSVGPathSegLinetoVerticalRel DontDelete|Function 1
- createSVGPathSegCurvetoCubicAbs SVGPathElementImpl::CreateSVGPathSegCurvetoCubicAbs DontDelete|Function 4
- createSVGPathSegCurvetoCubicRel SVGPathElementImpl::CreateSVGPathSegCurvetoCubicRel DontDelete|Function 4
- createSVGPathSegCurvetoQuadraticAbs SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticAbs DontDelete|Function 2
- createSVGPathSegCurvetoQuadraticRel SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticRel DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGPathElementImpl", SVGPathElementImplProto, SVGPathElementImplProtoFunc)
-
-Value SVGPathElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case PathLength:
- return m_pathLength->cache(exec);
- case D:
-// if(!attributeMode)
- {
- TQString d;
- unsigned int nrSegs = pathSegList()->numberOfItems();
- SVGPathSegImpl *curseg = 0;
- for(unsigned int i = 0; i < nrSegs; i++)
- {
- curseg = pathSegList()->getItem(i);
- if(curseg)
- d += curseg->toString() + " ";
- }
- return String(d);
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case D:
- {
- pathSegList()->clear();
- TQString d = value.toString(exec).qstring();
- parseSVG(d, false);
- if(hasMarkers())
- m_markerData = MarkerData(pathSegList());
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGPathElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGPathElementImpl)
-
- switch(id)
- {
- case SVGPathElementImpl::GetTotalLength:
- return Number(obj->getTotalLength());
- case SVGPathElementImpl::GetPointAtLength:
- return obj->getPointAtLength(args[0].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::GetPathSegAtLength:
- return Number(obj->getPathSegAtLength(args[0].toNumber(exec)));
- case SVGPathElementImpl::CreateSVGPathSegClosePath:
- return obj->createSVGPathSegClosePath()->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegMovetoAbs:
- return obj->createSVGPathSegMovetoAbs(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegMovetoRel:
- return obj->createSVGPathSegMovetoRel(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegLinetoAbs:
- return obj->createSVGPathSegLinetoAbs(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegLinetoRel:
- return obj->createSVGPathSegLinetoRel(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicAbs:
- return obj->createSVGPathSegCurvetoCubicAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicRel:
- return obj->createSVGPathSegCurvetoCubicRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticAbs:
- return obj->createSVGPathSegCurvetoQuadraticAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticRel:
- return obj->createSVGPathSegCurvetoQuadraticRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegArcAbs:
- return obj->createSVGPathSegArcAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toBoolean(exec), args[6].toBoolean(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegArcRel:
- return obj->createSVGPathSegArcRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toBoolean(exec), args[6].toBoolean(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalAbs:
- return obj->createSVGPathSegLinetoHorizontalAbs(args[0].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalRel:
- return obj->createSVGPathSegLinetoHorizontalRel(args[0].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegLinetoVerticalAbs:
- return obj->createSVGPathSegLinetoVerticalAbs(args[0].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegLinetoVerticalRel:
- return obj->createSVGPathSegLinetoVerticalRel(args[0].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicSmoothAbs:
- return obj->createSVGPathSegCurvetoCubicSmoothAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicSmoothRel:
- return obj->createSVGPathSegCurvetoCubicSmoothRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticSmoothAbs:
- return obj->createSVGPathSegCurvetoQuadraticSmoothAbs(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticSmoothRel:
- return obj->createSVGPathSegCurvetoQuadraticSmoothRel(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-SVGRectImpl *SVGPathElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
-
- if(m_item)
- {
- T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
- if(path)
- {
- T2P::Point topLeft;
- T2P::Point bottomRight;
-
- path->boundingBox(&topLeft, &bottomRight);
-
- ret->setX(topLeft.x());
- ret->setY(topLeft.y());
- ret->setWidth(bottomRight.x() - topLeft.x());
- ret->setHeight(bottomRight.y() - topLeft.y());
- }
- }
- return ret;
-}
-
-void SVGPathElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- // TODO : this is a quick fix for this problem:
- // d attribute encountered before marker attributes.
- // Try to process the attributes in the right order, ie.
- // d attr processing should be last.
- if(hasMarkers() && m_markerData.numMarkers() == 0)
- m_markerData = MarkerData(pathSegList());
- m_item = c->createPath(this);
- c->insert(m_item);
- }
-}
-
-SVGPathElementImpl::MarkerData::MarkerData(SVGPathSegListImpl *path)
-{
- unsigned int numSegments = path->numberOfItems();
- double curx = 0;
- double cury = 0;
- int currentSubpathStartIndex = -1;
- double previousQuadraticX1 = 0;
- double previousQuadraticY1 = 0;
- double previousCubicX2 = 0;
- double previousCubicY2 = 0;
-
- TQValueVector<SegmentData> pathSegmentData(numSegments);
-
- for(unsigned int i = 0; i < numSegments; i++)
- {
- SVGPathSegImpl *segment = path->getItem(i);
- struct SegmentData data;
-
- data.type = segment->pathSegType();
-
- if(segment->pathSegType() == PATHSEG_MOVETO_ABS || segment->pathSegType() == PATHSEG_MOVETO_REL)
- {
- if(currentSubpathStartIndex >= 0)
- {
- // Finish the previous subpath.
- for(unsigned int j = currentSubpathStartIndex; j < i; j++)
- {
- pathSegmentData[j].subpathStartIndex = currentSubpathStartIndex;
- pathSegmentData[j].subpathEndIndex = i - 1;
- pathSegmentData[j].subpathIsClosed = false;
- }
- }
-
- currentSubpathStartIndex = i;
- }
- else if(segment->pathSegType() == PATHSEG_CLOSEPATH)
- {
- if(currentSubpathStartIndex >= 0)
- {
- SVGPathSegClosePathImpl *s = static_cast<SVGPathSegClosePathImpl *>(segment);
-
- s->setX(pathSegmentData[currentSubpathStartIndex].startx + pathSegmentData[currentSubpathStartIndex].dx);
- s->setY(pathSegmentData[currentSubpathStartIndex].starty + pathSegmentData[currentSubpathStartIndex].dy);
-
- for(unsigned int j = currentSubpathStartIndex; j < i; j++)
- {
- pathSegmentData[j].subpathStartIndex = currentSubpathStartIndex;
- pathSegmentData[j].subpathEndIndex = i;
- pathSegmentData[j].subpathIsClosed = true;
- }
-
- data.subpathStartIndex = currentSubpathStartIndex;
- data.subpathEndIndex = i;
- data.subpathIsClosed = true;
- }
-
- currentSubpathStartIndex = i + 1;
- }
-
- switch(segment->pathSegType())
- {
- case PATHSEG_CURVETO_CUBIC_ABS:
- {
- SVGPathSegCurvetoCubicAbsImpl *s = static_cast<SVGPathSegCurvetoCubicAbsImpl *>(segment);
- previousCubicX2 = s->x2();
- previousCubicY2 = s->y2();
- break;
- }
- case PATHSEG_CURVETO_CUBIC_REL:
- {
- SVGPathSegCurvetoCubicRelImpl *s = static_cast<SVGPathSegCurvetoCubicRelImpl *>(segment);
- previousCubicX2 = curx + s->x2();
- previousCubicY2 = cury + s->y2();
- break;
- }
- case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
- {
- SVGPathSegCurvetoCubicSmoothAbsImpl *s = static_cast<SVGPathSegCurvetoCubicSmoothAbsImpl *>(segment);
- s->setPreviousX2(previousCubicX2);
- s->setPreviousY2(previousCubicY2);
- previousCubicX2 = s->x2();
- previousCubicY2 = s->y2();
- break;
- }
- case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
- {
- SVGPathSegCurvetoCubicSmoothRelImpl *s = static_cast<SVGPathSegCurvetoCubicSmoothRelImpl *>(segment);
- s->setPreviousAbsX2(previousCubicX2);
- s->setPreviousAbsY2(previousCubicY2);
- previousCubicX2 = curx + s->x2();
- previousCubicY2 = cury + s->y2();
- break;
- }
- case PATHSEG_CURVETO_QUADRATIC_ABS:
- {
- SVGPathSegCurvetoQuadraticAbsImpl *s = static_cast<SVGPathSegCurvetoQuadraticAbsImpl *>(segment);
- previousQuadraticX1 = s->x1();
- previousQuadraticY1 = s->y1();
- break;
- }
- case PATHSEG_CURVETO_QUADRATIC_REL:
- {
- SVGPathSegCurvetoQuadraticRelImpl *s = static_cast<SVGPathSegCurvetoQuadraticRelImpl *>(segment);
- previousQuadraticX1 = curx + s->x1();
- previousQuadraticY1 = cury + s->y1();
- break;
- }
- case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
- {
- SVGPathSegCurvetoQuadraticSmoothAbsImpl *s = static_cast<SVGPathSegCurvetoQuadraticSmoothAbsImpl *>(segment);
- s->setPreviousX1(previousQuadraticX1);
- s->setPreviousY1(previousQuadraticY1);
- previousQuadraticX1 = s->x1(curx);
- previousQuadraticY1 = s->y1(cury);
- break;
- }
- case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
- {
- SVGPathSegCurvetoQuadraticSmoothRelImpl *s = static_cast<SVGPathSegCurvetoQuadraticSmoothRelImpl *>(segment);
- s->setPreviousAbsX1(previousQuadraticX1);
- s->setPreviousAbsY1(previousQuadraticY1);
- previousQuadraticX1 = s->absX1(curx);
- previousQuadraticY1 = s->absY1(cury);
- break;
- }
- default:
- previousCubicX2 = curx;
- previousCubicY2 = cury;
- previousQuadraticX1 = curx;
- previousQuadraticY1 = cury;
- break;
- }
-
- data.startx = curx;
- data.starty = cury;
-
- segment->getDeltasAndSlopes(curx, cury, &data.dx, &data.dy, &data.startSlope, &data.endSlope);
-
- pathSegmentData[i] = data;
-
- curx += data.dx;
- cury += data.dy;
- }
-
- if(currentSubpathStartIndex >= 0)
- {
- // Finish the previous subpath.
- for(unsigned int j = currentSubpathStartIndex; j < numSegments; j++)
- {
- pathSegmentData[j].subpathStartIndex = currentSubpathStartIndex;
- pathSegmentData[j].subpathEndIndex = numSegments - 1;
- pathSegmentData[j].subpathIsClosed = false;
- }
- }
-
- m_markers.resize(numSegments);
-
- for(unsigned int i = 0; i < numSegments; i++)
- {
- struct Marker marker;
-
- marker.x = pathSegmentData[i].startx + pathSegmentData[i].dx;
- marker.y = pathSegmentData[i].starty + pathSegmentData[i].dy;
-
- double inSlope;
- double outSlope;
- bool haveInSlope = false;
- bool haveOutSlope = false;
-
- if(pathSegmentData[i].subpathStartIndex == i && pathSegmentData[i].subpathIsClosed)
- {
- // Spec: For closed subpaths, the marker for the initial vertex uses the end direction
- // of the corresponding closepath for its incoming slope and the first segment's
- // start slope for its outgoing slope.
- haveInSlope = getEndSlope(pathSegmentData, pathSegmentData[i].subpathEndIndex, &inSlope);
- haveOutSlope = getStartSlope(pathSegmentData, i + 1, &outSlope);
- }
- else if(pathSegmentData[i].type == PATHSEG_CLOSEPATH)
- {
- haveInSlope = getEndSlope(pathSegmentData, i, &inSlope);
-
- // Spec: If the segment following a closepath is other than a moveto, the marker
- // for the closepath uses the following segment's start direction as its
- // outgoing direction.
- if(i + 1 < numSegments && (pathSegmentData[i + 1].type != PATHSEG_MOVETO_ABS && pathSegmentData[i + 1].type != PATHSEG_MOVETO_REL))
- haveOutSlope = getStartSlope(pathSegmentData, i + 1, &outSlope);
- else
- haveOutSlope = getStartSlope(pathSegmentData, pathSegmentData[i].subpathStartIndex, &outSlope);
- }
- else
- {
- haveOutSlope = getStartSlope(pathSegmentData, i + 1, &outSlope);
- haveInSlope = getEndSlope(pathSegmentData, i, &inSlope);
- }
-
- if(!haveInSlope && !haveOutSlope)
- {
- outSlope = 0;
- inSlope = 0;
- }
- else if(haveInSlope && !haveOutSlope)
- outSlope = inSlope;
- else if(!haveInSlope && haveOutSlope)
- inSlope = outSlope;
-
- double bisector = SVGAngleImpl::shortestArcBisector(inSlope, outSlope);
- marker.angle = bisector;
-
- m_markers[i] = marker;
- }
-}
-
-bool SVGPathElementImpl::MarkerData::getStartSlope(TQValueVector<SegmentData> segments, unsigned int i, double *pStartSlope)
-{
- if(i > segments.count() - 1 || segments[i].type == PATHSEG_MOVETO_ABS || segments[i].type == PATHSEG_MOVETO_REL)
- return false;
- else
- {
- const double epsilon = DBL_EPSILON;
-
- if(fabs(segments[i].dx) > epsilon || fabs(segments[i].dy) > epsilon)
- {
- *pStartSlope = segments[i].startSlope;
- return true;
- }
- else
- {
- int subpathStartIndex = segments[i].subpathStartIndex;
-
- for(int j = i - 1; j >= subpathStartIndex; j--)
- {
- if(segments[j].type == PATHSEG_MOVETO_ABS || segments[j].type == PATHSEG_MOVETO_REL)
- return false;
-
- if(fabs(segments[j].dx) > epsilon || fabs(segments[j].dy) > epsilon)
- {
- *pStartSlope = segments[j].endSlope;
- return true;
- }
- }
-
- return false;
- }
- }
-}
-
-bool SVGPathElementImpl::MarkerData::getEndSlope(TQValueVector<SegmentData> segments, unsigned int i, double *pEndSlope)
-{
- if(i > segments.count() - 1 || segments[i].type == PATHSEG_MOVETO_ABS || segments[i].type == PATHSEG_MOVETO_REL)
- return false;
- else
- {
- const double epsilon = DBL_EPSILON;
-
- if(fabs(segments[i].dx) > epsilon || fabs(segments[i].dy) > epsilon)
- {
- *pEndSlope = segments[i].endSlope;
- return true;
- }
- else
- {
- int subpathEndIndex = segments[i].subpathEndIndex;
-
- for(int j = i + 1; j <= subpathEndIndex; j++)
- {
- if(segments[j].type == PATHSEG_MOVETO_ABS || segments[j].type == PATHSEG_MOVETO_REL)
- return false;
-
- if(fabs(segments[j].dx) > epsilon || fabs(segments[j].dy) > epsilon)
- {
- *pEndSlope = segments[j].startSlope;
- return true;
- }
- }
-
- return false;
- }
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathElementImpl.cpp b/ksvg/impl/SVGPathElementImpl.cpp
new file mode 100644
index 00000000..d64aede3
--- /dev/null
+++ b/ksvg/impl/SVGPathElementImpl.cpp
@@ -0,0 +1,866 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+#include <cfloat>
+
+#include <kdebug.h>
+#include <tdelocale.h>
+
+#include "SVGRectImpl.h"
+#include "SVGPaintImpl.h"
+#include "SVGPointImpl.h"
+#include "SVGAngleImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGPathSegArcImpl.h"
+#include "SVGPathSegListImpl.h"
+#include "SVGPathElementImpl.h"
+#include "SVGPathSegLinetoImpl.h"
+#include "SVGPathSegMovetoImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGPathSegClosePathImpl.h"
+#include "SVGPathSegCurvetoCubicImpl.h"
+#include "SVGPathSegLinetoVerticalImpl.h"
+#include "SVGPathSegLinetoHorizontalImpl.h"
+#include "SVGPathSegCurvetoQuadraticImpl.h"
+#include "SVGPathSegCurvetoCubicSmoothImpl.h"
+#include "SVGPathSegCurvetoQuadraticSmoothImpl.h"
+
+#include "SVGPaint.h"
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+#include "BezierPath.h"
+#include "Point.h"
+
+using namespace KSVG;
+
+#include "SVGPathElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGPathElementImpl::SVGPathElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl(), SVGAnimatedPathDataImpl(), SVGPathParser()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_pathLength = new SVGAnimatedNumberImpl();
+ m_pathLength->ref();
+
+ m_pathLength->setBaseVal(0);
+}
+
+SVGPathElementImpl::~SVGPathElementImpl()
+{
+ pathSegList()->clear();
+
+ if(m_pathLength)
+ m_pathLength->deref();
+}
+
+SVGAnimatedNumberImpl *SVGPathElementImpl::pathLength() const
+{
+ return m_pathLength;
+}
+
+double SVGPathElementImpl::getTotalLength()
+{
+ T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
+ if(path)
+ return path->length();
+
+ return 0;
+}
+
+SVGPointImpl *SVGPathElementImpl::getPointAtLength(double distance)
+{
+ SVGPointImpl *ret = SVGSVGElementImpl::createSVGPoint();
+ double totalDistance = getTotalLength();
+ T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
+ if(path)
+ {
+ T2P::Point p;
+ path->pointTangentNormalAt(distance / totalDistance, &p);
+ ret->setX(p.x());
+ ret->setY(p.y());
+ }
+
+ return ret;
+}
+
+unsigned long SVGPathElementImpl::getPathSegAtLength(double)
+{
+ return 0;
+}
+
+SVGPathSegClosePathImpl *SVGPathElementImpl::createSVGPathSegClosePath()
+{
+ SVGPathSegClosePathImpl *temp = new SVGPathSegClosePathImpl();
+ temp->ref();
+
+ return temp;
+}
+
+SVGPathSegMovetoAbsImpl *SVGPathElementImpl::createSVGPathSegMovetoAbs(double x, double y)
+{
+ SVGPathSegMovetoAbsImpl *temp = new SVGPathSegMovetoAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegMovetoRelImpl *SVGPathElementImpl::createSVGPathSegMovetoRel(double x, double y)
+{
+ SVGPathSegMovetoRelImpl *temp = new SVGPathSegMovetoRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegLinetoAbsImpl *SVGPathElementImpl::createSVGPathSegLinetoAbs(double x, double y)
+{
+ SVGPathSegLinetoAbsImpl *temp = new SVGPathSegLinetoAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegLinetoRelImpl *SVGPathElementImpl::createSVGPathSegLinetoRel(double x, double y)
+{
+ SVGPathSegLinetoRelImpl *temp = new SVGPathSegLinetoRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegCurvetoCubicAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2)
+{
+ SVGPathSegCurvetoCubicAbsImpl *temp = new SVGPathSegCurvetoCubicAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setX1(x1);
+ temp->setY1(y1);
+ temp->setX2(x2);
+ temp->setY2(y2);
+ return temp;
+}
+
+SVGPathSegCurvetoCubicRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2)
+{
+ SVGPathSegCurvetoCubicRelImpl *temp = new SVGPathSegCurvetoCubicRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setX1(x1);
+ temp->setY1(y1);
+ temp->setX2(x2);
+ temp->setY2(y2);
+ return temp;
+}
+
+SVGPathSegCurvetoQuadraticAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1)
+{
+ SVGPathSegCurvetoQuadraticAbsImpl *temp = new SVGPathSegCurvetoQuadraticAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setX1(x1);
+ temp->setY1(y1);
+ return temp;
+}
+
+SVGPathSegCurvetoQuadraticRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1)
+{
+ SVGPathSegCurvetoQuadraticRelImpl *temp = new SVGPathSegCurvetoQuadraticRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setX1(x1);
+ temp->setY1(y1);
+ return temp;
+}
+
+SVGPathSegArcAbsImpl *SVGPathElementImpl::createSVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
+{
+ SVGPathSegArcAbsImpl *temp = new SVGPathSegArcAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setR1(r1);
+ temp->setR2(r2);
+ temp->setAngle(angle);
+ temp->setLargeArcFlag(largeArcFlag);
+ temp->setSweepFlag(sweepFlag);
+ return temp;
+}
+
+SVGPathSegArcRelImpl *SVGPathElementImpl::createSVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag)
+{
+ SVGPathSegArcRelImpl *temp = new SVGPathSegArcRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setR1(r1);
+ temp->setR2(r2);
+ temp->setAngle(angle);
+ temp->setLargeArcFlag(largeArcFlag);
+ temp->setSweepFlag(sweepFlag);
+ return temp;
+}
+
+SVGPathSegLinetoHorizontalAbsImpl *SVGPathElementImpl::createSVGPathSegLinetoHorizontalAbs(double x)
+{
+ SVGPathSegLinetoHorizontalAbsImpl *temp = new SVGPathSegLinetoHorizontalAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ return temp;
+}
+
+SVGPathSegLinetoHorizontalRelImpl *SVGPathElementImpl::createSVGPathSegLinetoHorizontalRel(double x)
+{
+ SVGPathSegLinetoHorizontalRelImpl *temp = new SVGPathSegLinetoHorizontalRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ return temp;
+}
+
+SVGPathSegLinetoVerticalAbsImpl *SVGPathElementImpl::createSVGPathSegLinetoVerticalAbs(double y)
+{
+ SVGPathSegLinetoVerticalAbsImpl *temp = new SVGPathSegLinetoVerticalAbsImpl();
+ temp->ref();
+
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegLinetoVerticalRelImpl *SVGPathElementImpl::createSVGPathSegLinetoVerticalRel(double y)
+{
+ SVGPathSegLinetoVerticalRelImpl *temp = new SVGPathSegLinetoVerticalRelImpl();
+ temp->ref();
+
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegCurvetoCubicSmoothAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2)
+{
+ SVGPathSegCurvetoCubicSmoothAbsImpl *temp = new SVGPathSegCurvetoCubicSmoothAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setX2(x2);
+ temp->setY2(y2);
+ return temp;
+}
+
+SVGPathSegCurvetoCubicSmoothRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2)
+{
+ SVGPathSegCurvetoCubicSmoothRelImpl *temp = new SVGPathSegCurvetoCubicSmoothRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ temp->setX2(x2);
+ temp->setY2(y2);
+ return temp;
+}
+
+SVGPathSegCurvetoQuadraticSmoothAbsImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y)
+{
+ SVGPathSegCurvetoQuadraticSmoothAbsImpl *temp = new SVGPathSegCurvetoQuadraticSmoothAbsImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ return temp;
+}
+
+SVGPathSegCurvetoQuadraticSmoothRelImpl *SVGPathElementImpl::createSVGPathSegCurvetoQuadraticSmoothRel(double x, double y)
+{
+ SVGPathSegCurvetoQuadraticSmoothRelImpl *temp = new SVGPathSegCurvetoQuadraticSmoothRelImpl();
+ temp->ref();
+
+ temp->setX(x);
+ temp->setY(y);
+ return temp;
+}
+
+void SVGPathElementImpl::svgMoveTo(double x1, double y1, bool, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegMovetoAbs(x1, y1));
+ else
+ pathSegList()->appendItem(createSVGPathSegMovetoRel(x1, y1));
+}
+
+void SVGPathElementImpl::svgLineTo(double x1, double y1, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegLinetoAbs(x1, y1));
+ else
+ pathSegList()->appendItem(createSVGPathSegLinetoRel(x1, y1));
+}
+
+void SVGPathElementImpl::svgLineToHorizontal(double x, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegLinetoHorizontalAbs(x));
+ else
+ pathSegList()->appendItem(createSVGPathSegLinetoHorizontalRel(x));
+}
+
+void SVGPathElementImpl::svgLineToVertical(double y, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegLinetoVerticalAbs(y));
+ else
+ pathSegList()->appendItem(createSVGPathSegLinetoVerticalRel(y));
+}
+
+void SVGPathElementImpl::svgCurveToCubic(double x1, double y1, double x2, double y2, double x, double y, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2));
+ else
+ pathSegList()->appendItem(createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2));
+}
+
+void SVGPathElementImpl::svgCurveToCubicSmooth(double x, double y, double x2, double y2, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegCurvetoCubicSmoothAbs(x2, y2, x, y));
+ else
+ pathSegList()->appendItem(createSVGPathSegCurvetoCubicSmoothRel(x2, y2, x, y));
+}
+
+void SVGPathElementImpl::svgCurveToQuadratic(double x, double y, double x1, double y1, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticAbs(x1, y1, x, y));
+ else
+ pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticRel(x1, y1, x, y));
+}
+
+void SVGPathElementImpl::svgCurveToQuadraticSmooth(double x, double y, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticSmoothAbs(x, y));
+ else
+ pathSegList()->appendItem(createSVGPathSegCurvetoQuadraticSmoothRel(x, y));
+}
+
+void SVGPathElementImpl::svgArcTo(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag, bool abs)
+{
+ if(abs)
+ pathSegList()->appendItem(createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag));
+ else
+ pathSegList()->appendItem(createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag));
+}
+
+void SVGPathElementImpl::svgClosePath()
+{
+ pathSegList()->appendItem(createSVGPathSegClosePath());
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathElementImpl::s_hashTable 3
+ d SVGPathElementImpl::D DontDelete|ReadOnly
+ pathLength SVGPathElementImpl::PathLength DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGPathElementImplProto::s_hashTable 23
+ getTotalLength SVGPathElementImpl::GetTotalLength DontDelete|Function 0
+ getPointAtLength SVGPathElementImpl::GetPointAtLength DontDelete|Function 1
+ getPathSegAtLength SVGPathElementImpl::GetPathSegAtLength DontDelete|Function 1
+ createSVGPathSegClosePath SVGPathElementImpl::CreateSVGPathSegClosePath DontDelete|Function 0
+ createSVGPathSegMovetoAbs SVGPathElementImpl::CreateSVGPathSegMovetoAbs DontDelete|Function 2
+ createSVGPathSegMovetoRel SVGPathElementImpl::CreateSVGPathSegMovetoRel DontDelete|Function 2
+ createSVGPathSegLinetoAbs SVGPathElementImpl::CreateSVGPathSegLinetoAbs DontDelete|Function 2
+ createSVGPathSegLinetoRel SVGPathElementImpl::CreateSVGPathSegLinetoRel DontDelete|Function 2
+ createSVGPathSegArcAbs SVGPathElementImpl::CreateSVGPathSegArcAbs DontDelete|Function 7
+ createSVGPathSegArcRel SVGPathElementImpl::CreateSVGPathSegArcRel DontDelete|Function 7
+ createSVGPathSegCurvetoCubicAbs SVGPathElementImpl::CreateSVGPathSegCurvetoCubicAbs DontDelete|Function 6
+ createSVGPathSegCurvetoCubicRel SVGPathElementImpl::CreateSVGPathSegCurvetoCubicRel DontDelete|Function 6
+ createSVGPathSegCurvetoQuadraticAbs SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticAbs DontDelete|Function 4
+ createSVGPathSegCurvetoQuadraticRel SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticRel DontDelete|Function 4
+ createSVGPathSegLinetoHorizontalAbs SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalAbs DontDelete|Function 1
+ createSVGPathSegLinetoHorizontalRel SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalRel DontDelete|Function 1
+ createSVGPathSegLinetoVerticalAbs SVGPathElementImpl::CreateSVGPathSegLinetoVerticalAbs DontDelete|Function 1
+ createSVGPathSegLinetoVerticalRel SVGPathElementImpl::CreateSVGPathSegLinetoVerticalRel DontDelete|Function 1
+ createSVGPathSegCurvetoCubicAbs SVGPathElementImpl::CreateSVGPathSegCurvetoCubicAbs DontDelete|Function 4
+ createSVGPathSegCurvetoCubicRel SVGPathElementImpl::CreateSVGPathSegCurvetoCubicRel DontDelete|Function 4
+ createSVGPathSegCurvetoQuadraticAbs SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticAbs DontDelete|Function 2
+ createSVGPathSegCurvetoQuadraticRel SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticRel DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGPathElementImpl", SVGPathElementImplProto, SVGPathElementImplProtoFunc)
+
+Value SVGPathElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case PathLength:
+ return m_pathLength->cache(exec);
+ case D:
+// if(!attributeMode)
+ {
+ TQString d;
+ unsigned int nrSegs = pathSegList()->numberOfItems();
+ SVGPathSegImpl *curseg = 0;
+ for(unsigned int i = 0; i < nrSegs; i++)
+ {
+ curseg = pathSegList()->getItem(i);
+ if(curseg)
+ d += curseg->toString() + " ";
+ }
+ return String(d);
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case D:
+ {
+ pathSegList()->clear();
+ TQString d = value.toString(exec).qstring();
+ parseSVG(d, false);
+ if(hasMarkers())
+ m_markerData = MarkerData(pathSegList());
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGPathElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGPathElementImpl)
+
+ switch(id)
+ {
+ case SVGPathElementImpl::GetTotalLength:
+ return Number(obj->getTotalLength());
+ case SVGPathElementImpl::GetPointAtLength:
+ return obj->getPointAtLength(args[0].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::GetPathSegAtLength:
+ return Number(obj->getPathSegAtLength(args[0].toNumber(exec)));
+ case SVGPathElementImpl::CreateSVGPathSegClosePath:
+ return obj->createSVGPathSegClosePath()->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegMovetoAbs:
+ return obj->createSVGPathSegMovetoAbs(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegMovetoRel:
+ return obj->createSVGPathSegMovetoRel(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegLinetoAbs:
+ return obj->createSVGPathSegLinetoAbs(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegLinetoRel:
+ return obj->createSVGPathSegLinetoRel(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicAbs:
+ return obj->createSVGPathSegCurvetoCubicAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicRel:
+ return obj->createSVGPathSegCurvetoCubicRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticAbs:
+ return obj->createSVGPathSegCurvetoQuadraticAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticRel:
+ return obj->createSVGPathSegCurvetoQuadraticRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegArcAbs:
+ return obj->createSVGPathSegArcAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toBoolean(exec), args[6].toBoolean(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegArcRel:
+ return obj->createSVGPathSegArcRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec), args[4].toNumber(exec), args[5].toBoolean(exec), args[6].toBoolean(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalAbs:
+ return obj->createSVGPathSegLinetoHorizontalAbs(args[0].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegLinetoHorizontalRel:
+ return obj->createSVGPathSegLinetoHorizontalRel(args[0].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegLinetoVerticalAbs:
+ return obj->createSVGPathSegLinetoVerticalAbs(args[0].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegLinetoVerticalRel:
+ return obj->createSVGPathSegLinetoVerticalRel(args[0].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicSmoothAbs:
+ return obj->createSVGPathSegCurvetoCubicSmoothAbs(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoCubicSmoothRel:
+ return obj->createSVGPathSegCurvetoCubicSmoothRel(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec), args[3].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticSmoothAbs:
+ return obj->createSVGPathSegCurvetoQuadraticSmoothAbs(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ case SVGPathElementImpl::CreateSVGPathSegCurvetoQuadraticSmoothRel:
+ return obj->createSVGPathSegCurvetoQuadraticSmoothRel(args[0].toNumber(exec), args[1].toNumber(exec))->cache(exec);
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+SVGRectImpl *SVGPathElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+
+ if(m_item)
+ {
+ T2P::BezierPath *path = ownerDoc()->canvas()->toBezierPath(m_item);
+ if(path)
+ {
+ T2P::Point topLeft;
+ T2P::Point bottomRight;
+
+ path->boundingBox(&topLeft, &bottomRight);
+
+ ret->setX(topLeft.x());
+ ret->setY(topLeft.y());
+ ret->setWidth(bottomRight.x() - topLeft.x());
+ ret->setHeight(bottomRight.y() - topLeft.y());
+ }
+ }
+ return ret;
+}
+
+void SVGPathElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ // TODO : this is a quick fix for this problem:
+ // d attribute encountered before marker attributes.
+ // Try to process the attributes in the right order, ie.
+ // d attr processing should be last.
+ if(hasMarkers() && m_markerData.numMarkers() == 0)
+ m_markerData = MarkerData(pathSegList());
+ m_item = c->createPath(this);
+ c->insert(m_item);
+ }
+}
+
+SVGPathElementImpl::MarkerData::MarkerData(SVGPathSegListImpl *path)
+{
+ unsigned int numSegments = path->numberOfItems();
+ double curx = 0;
+ double cury = 0;
+ int currentSubpathStartIndex = -1;
+ double previousQuadraticX1 = 0;
+ double previousQuadraticY1 = 0;
+ double previousCubicX2 = 0;
+ double previousCubicY2 = 0;
+
+ TQValueVector<SegmentData> pathSegmentData(numSegments);
+
+ for(unsigned int i = 0; i < numSegments; i++)
+ {
+ SVGPathSegImpl *segment = path->getItem(i);
+ struct SegmentData data;
+
+ data.type = segment->pathSegType();
+
+ if(segment->pathSegType() == PATHSEG_MOVETO_ABS || segment->pathSegType() == PATHSEG_MOVETO_REL)
+ {
+ if(currentSubpathStartIndex >= 0)
+ {
+ // Finish the previous subpath.
+ for(unsigned int j = currentSubpathStartIndex; j < i; j++)
+ {
+ pathSegmentData[j].subpathStartIndex = currentSubpathStartIndex;
+ pathSegmentData[j].subpathEndIndex = i - 1;
+ pathSegmentData[j].subpathIsClosed = false;
+ }
+ }
+
+ currentSubpathStartIndex = i;
+ }
+ else if(segment->pathSegType() == PATHSEG_CLOSEPATH)
+ {
+ if(currentSubpathStartIndex >= 0)
+ {
+ SVGPathSegClosePathImpl *s = static_cast<SVGPathSegClosePathImpl *>(segment);
+
+ s->setX(pathSegmentData[currentSubpathStartIndex].startx + pathSegmentData[currentSubpathStartIndex].dx);
+ s->setY(pathSegmentData[currentSubpathStartIndex].starty + pathSegmentData[currentSubpathStartIndex].dy);
+
+ for(unsigned int j = currentSubpathStartIndex; j < i; j++)
+ {
+ pathSegmentData[j].subpathStartIndex = currentSubpathStartIndex;
+ pathSegmentData[j].subpathEndIndex = i;
+ pathSegmentData[j].subpathIsClosed = true;
+ }
+
+ data.subpathStartIndex = currentSubpathStartIndex;
+ data.subpathEndIndex = i;
+ data.subpathIsClosed = true;
+ }
+
+ currentSubpathStartIndex = i + 1;
+ }
+
+ switch(segment->pathSegType())
+ {
+ case PATHSEG_CURVETO_CUBIC_ABS:
+ {
+ SVGPathSegCurvetoCubicAbsImpl *s = static_cast<SVGPathSegCurvetoCubicAbsImpl *>(segment);
+ previousCubicX2 = s->x2();
+ previousCubicY2 = s->y2();
+ break;
+ }
+ case PATHSEG_CURVETO_CUBIC_REL:
+ {
+ SVGPathSegCurvetoCubicRelImpl *s = static_cast<SVGPathSegCurvetoCubicRelImpl *>(segment);
+ previousCubicX2 = curx + s->x2();
+ previousCubicY2 = cury + s->y2();
+ break;
+ }
+ case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
+ {
+ SVGPathSegCurvetoCubicSmoothAbsImpl *s = static_cast<SVGPathSegCurvetoCubicSmoothAbsImpl *>(segment);
+ s->setPreviousX2(previousCubicX2);
+ s->setPreviousY2(previousCubicY2);
+ previousCubicX2 = s->x2();
+ previousCubicY2 = s->y2();
+ break;
+ }
+ case PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
+ {
+ SVGPathSegCurvetoCubicSmoothRelImpl *s = static_cast<SVGPathSegCurvetoCubicSmoothRelImpl *>(segment);
+ s->setPreviousAbsX2(previousCubicX2);
+ s->setPreviousAbsY2(previousCubicY2);
+ previousCubicX2 = curx + s->x2();
+ previousCubicY2 = cury + s->y2();
+ break;
+ }
+ case PATHSEG_CURVETO_QUADRATIC_ABS:
+ {
+ SVGPathSegCurvetoQuadraticAbsImpl *s = static_cast<SVGPathSegCurvetoQuadraticAbsImpl *>(segment);
+ previousQuadraticX1 = s->x1();
+ previousQuadraticY1 = s->y1();
+ break;
+ }
+ case PATHSEG_CURVETO_QUADRATIC_REL:
+ {
+ SVGPathSegCurvetoQuadraticRelImpl *s = static_cast<SVGPathSegCurvetoQuadraticRelImpl *>(segment);
+ previousQuadraticX1 = curx + s->x1();
+ previousQuadraticY1 = cury + s->y1();
+ break;
+ }
+ case PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
+ {
+ SVGPathSegCurvetoQuadraticSmoothAbsImpl *s = static_cast<SVGPathSegCurvetoQuadraticSmoothAbsImpl *>(segment);
+ s->setPreviousX1(previousQuadraticX1);
+ s->setPreviousY1(previousQuadraticY1);
+ previousQuadraticX1 = s->x1(curx);
+ previousQuadraticY1 = s->y1(cury);
+ break;
+ }
+ case PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
+ {
+ SVGPathSegCurvetoQuadraticSmoothRelImpl *s = static_cast<SVGPathSegCurvetoQuadraticSmoothRelImpl *>(segment);
+ s->setPreviousAbsX1(previousQuadraticX1);
+ s->setPreviousAbsY1(previousQuadraticY1);
+ previousQuadraticX1 = s->absX1(curx);
+ previousQuadraticY1 = s->absY1(cury);
+ break;
+ }
+ default:
+ previousCubicX2 = curx;
+ previousCubicY2 = cury;
+ previousQuadraticX1 = curx;
+ previousQuadraticY1 = cury;
+ break;
+ }
+
+ data.startx = curx;
+ data.starty = cury;
+
+ segment->getDeltasAndSlopes(curx, cury, &data.dx, &data.dy, &data.startSlope, &data.endSlope);
+
+ pathSegmentData[i] = data;
+
+ curx += data.dx;
+ cury += data.dy;
+ }
+
+ if(currentSubpathStartIndex >= 0)
+ {
+ // Finish the previous subpath.
+ for(unsigned int j = currentSubpathStartIndex; j < numSegments; j++)
+ {
+ pathSegmentData[j].subpathStartIndex = currentSubpathStartIndex;
+ pathSegmentData[j].subpathEndIndex = numSegments - 1;
+ pathSegmentData[j].subpathIsClosed = false;
+ }
+ }
+
+ m_markers.resize(numSegments);
+
+ for(unsigned int i = 0; i < numSegments; i++)
+ {
+ struct Marker marker;
+
+ marker.x = pathSegmentData[i].startx + pathSegmentData[i].dx;
+ marker.y = pathSegmentData[i].starty + pathSegmentData[i].dy;
+
+ double inSlope;
+ double outSlope;
+ bool haveInSlope = false;
+ bool haveOutSlope = false;
+
+ if(pathSegmentData[i].subpathStartIndex == i && pathSegmentData[i].subpathIsClosed)
+ {
+ // Spec: For closed subpaths, the marker for the initial vertex uses the end direction
+ // of the corresponding closepath for its incoming slope and the first segment's
+ // start slope for its outgoing slope.
+ haveInSlope = getEndSlope(pathSegmentData, pathSegmentData[i].subpathEndIndex, &inSlope);
+ haveOutSlope = getStartSlope(pathSegmentData, i + 1, &outSlope);
+ }
+ else if(pathSegmentData[i].type == PATHSEG_CLOSEPATH)
+ {
+ haveInSlope = getEndSlope(pathSegmentData, i, &inSlope);
+
+ // Spec: If the segment following a closepath is other than a moveto, the marker
+ // for the closepath uses the following segment's start direction as its
+ // outgoing direction.
+ if(i + 1 < numSegments && (pathSegmentData[i + 1].type != PATHSEG_MOVETO_ABS && pathSegmentData[i + 1].type != PATHSEG_MOVETO_REL))
+ haveOutSlope = getStartSlope(pathSegmentData, i + 1, &outSlope);
+ else
+ haveOutSlope = getStartSlope(pathSegmentData, pathSegmentData[i].subpathStartIndex, &outSlope);
+ }
+ else
+ {
+ haveOutSlope = getStartSlope(pathSegmentData, i + 1, &outSlope);
+ haveInSlope = getEndSlope(pathSegmentData, i, &inSlope);
+ }
+
+ if(!haveInSlope && !haveOutSlope)
+ {
+ outSlope = 0;
+ inSlope = 0;
+ }
+ else if(haveInSlope && !haveOutSlope)
+ outSlope = inSlope;
+ else if(!haveInSlope && haveOutSlope)
+ inSlope = outSlope;
+
+ double bisector = SVGAngleImpl::shortestArcBisector(inSlope, outSlope);
+ marker.angle = bisector;
+
+ m_markers[i] = marker;
+ }
+}
+
+bool SVGPathElementImpl::MarkerData::getStartSlope(TQValueVector<SegmentData> segments, unsigned int i, double *pStartSlope)
+{
+ if(i > segments.count() - 1 || segments[i].type == PATHSEG_MOVETO_ABS || segments[i].type == PATHSEG_MOVETO_REL)
+ return false;
+ else
+ {
+ const double epsilon = DBL_EPSILON;
+
+ if(fabs(segments[i].dx) > epsilon || fabs(segments[i].dy) > epsilon)
+ {
+ *pStartSlope = segments[i].startSlope;
+ return true;
+ }
+ else
+ {
+ int subpathStartIndex = segments[i].subpathStartIndex;
+
+ for(int j = i - 1; j >= subpathStartIndex; j--)
+ {
+ if(segments[j].type == PATHSEG_MOVETO_ABS || segments[j].type == PATHSEG_MOVETO_REL)
+ return false;
+
+ if(fabs(segments[j].dx) > epsilon || fabs(segments[j].dy) > epsilon)
+ {
+ *pStartSlope = segments[j].endSlope;
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
+
+bool SVGPathElementImpl::MarkerData::getEndSlope(TQValueVector<SegmentData> segments, unsigned int i, double *pEndSlope)
+{
+ if(i > segments.count() - 1 || segments[i].type == PATHSEG_MOVETO_ABS || segments[i].type == PATHSEG_MOVETO_REL)
+ return false;
+ else
+ {
+ const double epsilon = DBL_EPSILON;
+
+ if(fabs(segments[i].dx) > epsilon || fabs(segments[i].dy) > epsilon)
+ {
+ *pEndSlope = segments[i].endSlope;
+ return true;
+ }
+ else
+ {
+ int subpathEndIndex = segments[i].subpathEndIndex;
+
+ for(int j = i + 1; j <= subpathEndIndex; j++)
+ {
+ if(segments[j].type == PATHSEG_MOVETO_ABS || segments[j].type == PATHSEG_MOVETO_REL)
+ return false;
+
+ if(fabs(segments[j].dx) > epsilon || fabs(segments[j].dy) > epsilon)
+ {
+ *pEndSlope = segments[j].startSlope;
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/ksvg/impl/SVGPathElementImpl.h b/ksvg/impl/SVGPathElementImpl.h
index 8dda0f8f..9431e65e 100644
--- a/ksvg/impl/SVGPathElementImpl.h
+++ b/ksvg/impl/SVGPathElementImpl.h
@@ -190,5 +190,3 @@ KSVG_DEFINE_PROTOTYPE(SVGPathElementImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGPathElementImplProtoFunc, SVGPathElementImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegArcImpl.cc b/ksvg/impl/SVGPathSegArcImpl.cc
deleted file mode 100644
index 9fb4190f..00000000
--- a/ksvg/impl/SVGPathSegArcImpl.cc
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-
-#include <kdebug.h>
-
-#include "SVGPathSegArcImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegArcImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-static void getArcSlopes(bool relative, double curx, double cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag, double *pStartSlope, double *pEndSlope)
-{
- double sin_th, cos_th;
- double a00, a01, a10, a11;
- double x0, y0, x1, y1, xc, yc;
- double d, sfactor, sfactor_sq;
- double th0, th1, th_arc;
- int i, n_segs;
-
- sin_th = sin(angle * (M_PI / 180.0));
- cos_th = cos(angle * (M_PI / 180.0));
-
- double dx;
-
- if(!relative)
- dx = (curx - x) / 2.0;
- else
- dx = -x / 2.0;
-
- double dy;
-
- if(!relative)
- dy = (cury - y) / 2.0;
- else
- dy = -y / 2.0;
-
- double _x1 = cos_th * dx + sin_th * dy;
- double _y1 = -sin_th * dx + cos_th * dy;
- double Pr1 = r1 * r1;
- double Pr2 = r2 * r2;
- double Px = _x1 * _x1;
- double Py = _y1 * _y1;
-
- // Spec : check if radii are large enough
- double check = Px / Pr1 + Py / Pr2;
- if(check > 1)
- {
- r1 = r1 * sqrt(check);
- r2 = r2 * sqrt(check);
- }
-
- a00 = cos_th / r1;
- a01 = sin_th / r1;
- a10 = -sin_th / r2;
- a11 = cos_th / r2;
-
- x0 = a00 * curx + a01 * cury;
- y0 = a10 * curx + a11 * cury;
-
- if(!relative)
- x1 = a00 * x + a01 * y;
- else
- x1 = a00 * (curx + x) + a01 * (cury + y);
-
- if(!relative)
- y1 = a10 * x + a11 * y;
- else
- y1 = a10 * (curx + x) + a11 * (cury + y);
-
- /* (x0, y0) is current point in transformed coordinate space.
- (x1, y1) is new point in transformed coordinate space.
-
- The arc fits a unit-radius circle in this space.
- */
-
- d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
-
- sfactor_sq = 1.0 / d - 0.25;
-
- if(sfactor_sq < 0)
- sfactor_sq = 0;
-
- sfactor = sqrt(sfactor_sq);
-
- if(sweepFlag == largeArcFlag)
- sfactor = -sfactor;
-
- xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
- yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
-
- /* (xc, yc) is center of the circle. */
- th0 = atan2(y0 - yc, x0 - xc);
- th1 = atan2(y1 - yc, x1 - xc);
-
- th_arc = th1 - th0;
- if(th_arc < 0 && sweepFlag)
- th_arc += 2 * M_PI;
- else if(th_arc > 0 && !sweepFlag)
- th_arc -= 2 * M_PI;
-
- n_segs = (int) (int) ceil(fabs(th_arc / (M_PI * 0.5 + 0.001)));
-
- for(int step = 0; step < 2; step++)
- {
- i = step == 0 ? 0 : n_segs - 1;
-
- double sin_th, cos_th;
- double a00, a01, a10, a11;
- double x1, y1, x2, y2, x3, y3;
- double t;
- double th_half;
-
- double _th0 = th0 + i * th_arc / n_segs;
- double _th1 = th0 + (i + 1) * th_arc / n_segs;
-
- sin_th = sin(angle * (M_PI / 180.0));
- cos_th = cos(angle * (M_PI / 180.0));
-
- /* inverse transform compared with rsvg_path_arc */
- a00 = cos_th * r1;
- a01 = -sin_th * r2;
- a10 = sin_th * r1;
- a11 = cos_th * r2;
-
- th_half = 0.5 * (_th1 - _th0);
- t = (8.0 / 3.0) * sin(th_half * 0.5) * sin(th_half * 0.5) / sin(th_half);
- x1 = xc + cos(_th0) - t * sin(_th0);
- y1 = yc + sin(_th0) + t * cos(_th0);
- x3 = xc + cos(_th1);
- y3 = yc + sin(_th1);
- x2 = x3 + t * sin(_th1);
- y2 = y3 - t * cos(_th1);
-
- double bezX1 = a00 * x1 + a01 * y1;
- double bezY1 = a10 * x1 + a11 * y1;
- double bezX2 = a00 * x2 + a01 * y2;
- double bezY2 = a10 * x2 + a11 * y2;
- double bezX = a00 * x3 + a01 * y3;
- double bezY = a10 * x3 + a11 * y3;
-
- if(step == 0)
- *pStartSlope = SVGAngleImpl::todeg(atan2(bezY1 - cury, bezX1 - curx));
- else
- *pEndSlope = SVGAngleImpl::todeg(atan2(bezY - bezY2, bezX - bezX2));
- }
-}
-
-SVGPathSegArcAbsImpl::SVGPathSegArcAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegArcAbsImpl::~SVGPathSegArcAbsImpl()
-{
-}
-
-void SVGPathSegArcAbsImpl::setX(double x)
-{
- m_x = x;
-}
-
-double SVGPathSegArcAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegArcAbsImpl::setY(double y)
-{
- m_y = y;
-}
-
-double SVGPathSegArcAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegArcAbsImpl::setR1(double r1)
-{
- m_r1 = r1;
-}
-
-double SVGPathSegArcAbsImpl::r1() const
-{
- return m_r1;
-}
-
-void SVGPathSegArcAbsImpl::setR2(double r2)
-{
- m_r2 = r2;
-}
-
-double SVGPathSegArcAbsImpl::r2() const
-{
- return m_r2;
-}
-
-void SVGPathSegArcAbsImpl::setAngle(double angle)
-{
- m_angle = angle;
-}
-
-double SVGPathSegArcAbsImpl::angle() const
-{
- return m_angle;
-}
-
-void SVGPathSegArcAbsImpl::setLargeArcFlag(bool largeArcFlag)
-{
- m_largeArcFlag = largeArcFlag;
-}
-
-bool SVGPathSegArcAbsImpl::largeArcFlag() const
-{
- return m_largeArcFlag;
-}
-
-void SVGPathSegArcAbsImpl::setSweepFlag(bool sweepFlag)
-{
- m_sweepFlag = sweepFlag;
-}
-
-bool SVGPathSegArcAbsImpl::sweepFlag() const
-{
- return m_sweepFlag;
-}
-
-void SVGPathSegArcAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope;
- double endSlope;
- getArcSlopes(false, curx, cury, angle(), x(), y(), r1(), r2(), largeArcFlag(), sweepFlag(), &startSlope, &endSlope);
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegArcAbsImpl::s_hashTable 11
- x SVGPathSegArcAbsImpl::X DontDelete
- y SVGPathSegArcAbsImpl::Y DontDelete
- r1 SVGPathSegArcAbsImpl::R1 DontDelete
- r2 SVGPathSegArcAbsImpl::R2 DontDelete
- angle SVGPathSegArcAbsImpl::Angle DontDelete
- largeArcFlag SVGPathSegArcAbsImpl::LargeArcFlag DontDelete
- sweepFlag SVGPathSegArcAbsImpl::SweepFlag DontDelete
-@end
-*/
-
-Value SVGPathSegArcAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case R1:
- return Number(r1());
- case R2:
- return Number(r2());
- case Angle:
- return Number(angle());
- case LargeArcFlag:
- return Boolean(largeArcFlag());
- case SweepFlag:
- return Boolean(sweepFlag());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegArcAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case R1:
- m_r1 = value.toNumber(exec);
- break;
- case R2:
- m_r2 = value.toNumber(exec);
- break;
- case Angle:
- m_angle = value.toNumber(exec);
- break;
- case LargeArcFlag:
- m_largeArcFlag = value.toBoolean(exec);
- break;
- case SweepFlag:
- m_sweepFlag = value.toBoolean(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-SVGPathSegArcRelImpl::SVGPathSegArcRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegArcRelImpl::~SVGPathSegArcRelImpl()
-{
-}
-
-void SVGPathSegArcRelImpl::setX(double x)
-{
- m_x = x;
-}
-
-double SVGPathSegArcRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegArcRelImpl::setY(double y)
-{
- m_y = y;
-}
-
-double SVGPathSegArcRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegArcRelImpl::setR1(double r1)
-{
- m_r1 = r1;
-}
-
-double SVGPathSegArcRelImpl::r1() const
-{
- return m_r1;
-}
-
-void SVGPathSegArcRelImpl::setR2(double r2)
-{
- m_r2 = r2;
-}
-
-double SVGPathSegArcRelImpl::r2() const
-{
- return m_r2;
-}
-
-void SVGPathSegArcRelImpl::setAngle(double angle)
-{
- m_angle = angle;
-}
-
-double SVGPathSegArcRelImpl::angle() const
-{
- return m_angle;
-}
-
-void SVGPathSegArcRelImpl::setLargeArcFlag(bool largeArcFlag)
-{
- m_largeArcFlag = largeArcFlag;
-}
-
-bool SVGPathSegArcRelImpl::largeArcFlag() const
-{
- return m_largeArcFlag;
-}
-
-void SVGPathSegArcRelImpl::setSweepFlag(bool sweepFlag)
-{
- m_sweepFlag = sweepFlag;
-}
-
-bool SVGPathSegArcRelImpl::sweepFlag() const
-{
- return m_sweepFlag;
-}
-
-void SVGPathSegArcRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x();
- double dy = y();
- double startSlope;
- double endSlope;
- getArcSlopes(true, curx, cury, angle(), x(), y(), r1(), r2(), largeArcFlag(), sweepFlag(), &startSlope, &endSlope);
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegArcRelImpl::s_hashTable 11
- x SVGPathSegArcRelImpl::X DontDelete
- y SVGPathSegArcRelImpl::Y DontDelete
- r1 SVGPathSegArcRelImpl::R1 DontDelete
- r2 SVGPathSegArcRelImpl::R2 DontDelete
- angle SVGPathSegArcRelImpl::Angle DontDelete
- largeArcFlag SVGPathSegArcRelImpl::LargeArcFlag DontDelete
- sweepFlag SVGPathSegArcRelImpl::SweepFlag DontDelete
-@end
-*/
-
-Value SVGPathSegArcRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case R1:
- return Number(r1());
- case R2:
- return Number(r2());
- case Angle:
- return Number(angle());
- case LargeArcFlag:
- return Boolean(largeArcFlag());
- case SweepFlag:
- return Boolean(sweepFlag());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegArcRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case R1:
- m_r1 = value.toNumber(exec);
- break;
- case R2:
- m_r2 = value.toNumber(exec);
- break;
- case Angle:
- m_angle = value.toNumber(exec);
- break;
- case LargeArcFlag:
- m_largeArcFlag = value.toBoolean(exec);
- break;
- case SweepFlag:
- m_sweepFlag = value.toBoolean(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegArcImpl.cpp b/ksvg/impl/SVGPathSegArcImpl.cpp
new file mode 100644
index 00000000..9d5cc76a
--- /dev/null
+++ b/ksvg/impl/SVGPathSegArcImpl.cpp
@@ -0,0 +1,493 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+
+#include <kdebug.h>
+
+#include "SVGPathSegArcImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegArcImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+static void getArcSlopes(bool relative, double curx, double cury, double angle, double x, double y, double r1, double r2, bool largeArcFlag, bool sweepFlag, double *pStartSlope, double *pEndSlope)
+{
+ double sin_th, cos_th;
+ double a00, a01, a10, a11;
+ double x0, y0, x1, y1, xc, yc;
+ double d, sfactor, sfactor_sq;
+ double th0, th1, th_arc;
+ int i, n_segs;
+
+ sin_th = sin(angle * (M_PI / 180.0));
+ cos_th = cos(angle * (M_PI / 180.0));
+
+ double dx;
+
+ if(!relative)
+ dx = (curx - x) / 2.0;
+ else
+ dx = -x / 2.0;
+
+ double dy;
+
+ if(!relative)
+ dy = (cury - y) / 2.0;
+ else
+ dy = -y / 2.0;
+
+ double _x1 = cos_th * dx + sin_th * dy;
+ double _y1 = -sin_th * dx + cos_th * dy;
+ double Pr1 = r1 * r1;
+ double Pr2 = r2 * r2;
+ double Px = _x1 * _x1;
+ double Py = _y1 * _y1;
+
+ // Spec : check if radii are large enough
+ double check = Px / Pr1 + Py / Pr2;
+ if(check > 1)
+ {
+ r1 = r1 * sqrt(check);
+ r2 = r2 * sqrt(check);
+ }
+
+ a00 = cos_th / r1;
+ a01 = sin_th / r1;
+ a10 = -sin_th / r2;
+ a11 = cos_th / r2;
+
+ x0 = a00 * curx + a01 * cury;
+ y0 = a10 * curx + a11 * cury;
+
+ if(!relative)
+ x1 = a00 * x + a01 * y;
+ else
+ x1 = a00 * (curx + x) + a01 * (cury + y);
+
+ if(!relative)
+ y1 = a10 * x + a11 * y;
+ else
+ y1 = a10 * (curx + x) + a11 * (cury + y);
+
+ /* (x0, y0) is current point in transformed coordinate space.
+ (x1, y1) is new point in transformed coordinate space.
+
+ The arc fits a unit-radius circle in this space.
+ */
+
+ d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
+
+ sfactor_sq = 1.0 / d - 0.25;
+
+ if(sfactor_sq < 0)
+ sfactor_sq = 0;
+
+ sfactor = sqrt(sfactor_sq);
+
+ if(sweepFlag == largeArcFlag)
+ sfactor = -sfactor;
+
+ xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
+ yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
+
+ /* (xc, yc) is center of the circle. */
+ th0 = atan2(y0 - yc, x0 - xc);
+ th1 = atan2(y1 - yc, x1 - xc);
+
+ th_arc = th1 - th0;
+ if(th_arc < 0 && sweepFlag)
+ th_arc += 2 * M_PI;
+ else if(th_arc > 0 && !sweepFlag)
+ th_arc -= 2 * M_PI;
+
+ n_segs = (int) (int) ceil(fabs(th_arc / (M_PI * 0.5 + 0.001)));
+
+ for(int step = 0; step < 2; step++)
+ {
+ i = step == 0 ? 0 : n_segs - 1;
+
+ double sin_th, cos_th;
+ double a00, a01, a10, a11;
+ double x1, y1, x2, y2, x3, y3;
+ double t;
+ double th_half;
+
+ double _th0 = th0 + i * th_arc / n_segs;
+ double _th1 = th0 + (i + 1) * th_arc / n_segs;
+
+ sin_th = sin(angle * (M_PI / 180.0));
+ cos_th = cos(angle * (M_PI / 180.0));
+
+ /* inverse transform compared with rsvg_path_arc */
+ a00 = cos_th * r1;
+ a01 = -sin_th * r2;
+ a10 = sin_th * r1;
+ a11 = cos_th * r2;
+
+ th_half = 0.5 * (_th1 - _th0);
+ t = (8.0 / 3.0) * sin(th_half * 0.5) * sin(th_half * 0.5) / sin(th_half);
+ x1 = xc + cos(_th0) - t * sin(_th0);
+ y1 = yc + sin(_th0) + t * cos(_th0);
+ x3 = xc + cos(_th1);
+ y3 = yc + sin(_th1);
+ x2 = x3 + t * sin(_th1);
+ y2 = y3 - t * cos(_th1);
+
+ double bezX1 = a00 * x1 + a01 * y1;
+ double bezY1 = a10 * x1 + a11 * y1;
+ double bezX2 = a00 * x2 + a01 * y2;
+ double bezY2 = a10 * x2 + a11 * y2;
+ double bezX = a00 * x3 + a01 * y3;
+ double bezY = a10 * x3 + a11 * y3;
+
+ if(step == 0)
+ *pStartSlope = SVGAngleImpl::todeg(atan2(bezY1 - cury, bezX1 - curx));
+ else
+ *pEndSlope = SVGAngleImpl::todeg(atan2(bezY - bezY2, bezX - bezX2));
+ }
+}
+
+SVGPathSegArcAbsImpl::SVGPathSegArcAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegArcAbsImpl::~SVGPathSegArcAbsImpl()
+{
+}
+
+void SVGPathSegArcAbsImpl::setX(double x)
+{
+ m_x = x;
+}
+
+double SVGPathSegArcAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegArcAbsImpl::setY(double y)
+{
+ m_y = y;
+}
+
+double SVGPathSegArcAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegArcAbsImpl::setR1(double r1)
+{
+ m_r1 = r1;
+}
+
+double SVGPathSegArcAbsImpl::r1() const
+{
+ return m_r1;
+}
+
+void SVGPathSegArcAbsImpl::setR2(double r2)
+{
+ m_r2 = r2;
+}
+
+double SVGPathSegArcAbsImpl::r2() const
+{
+ return m_r2;
+}
+
+void SVGPathSegArcAbsImpl::setAngle(double angle)
+{
+ m_angle = angle;
+}
+
+double SVGPathSegArcAbsImpl::angle() const
+{
+ return m_angle;
+}
+
+void SVGPathSegArcAbsImpl::setLargeArcFlag(bool largeArcFlag)
+{
+ m_largeArcFlag = largeArcFlag;
+}
+
+bool SVGPathSegArcAbsImpl::largeArcFlag() const
+{
+ return m_largeArcFlag;
+}
+
+void SVGPathSegArcAbsImpl::setSweepFlag(bool sweepFlag)
+{
+ m_sweepFlag = sweepFlag;
+}
+
+bool SVGPathSegArcAbsImpl::sweepFlag() const
+{
+ return m_sweepFlag;
+}
+
+void SVGPathSegArcAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope;
+ double endSlope;
+ getArcSlopes(false, curx, cury, angle(), x(), y(), r1(), r2(), largeArcFlag(), sweepFlag(), &startSlope, &endSlope);
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegArcAbsImpl::s_hashTable 11
+ x SVGPathSegArcAbsImpl::X DontDelete
+ y SVGPathSegArcAbsImpl::Y DontDelete
+ r1 SVGPathSegArcAbsImpl::R1 DontDelete
+ r2 SVGPathSegArcAbsImpl::R2 DontDelete
+ angle SVGPathSegArcAbsImpl::Angle DontDelete
+ largeArcFlag SVGPathSegArcAbsImpl::LargeArcFlag DontDelete
+ sweepFlag SVGPathSegArcAbsImpl::SweepFlag DontDelete
+@end
+*/
+
+Value SVGPathSegArcAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case R1:
+ return Number(r1());
+ case R2:
+ return Number(r2());
+ case Angle:
+ return Number(angle());
+ case LargeArcFlag:
+ return Boolean(largeArcFlag());
+ case SweepFlag:
+ return Boolean(sweepFlag());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegArcAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case R1:
+ m_r1 = value.toNumber(exec);
+ break;
+ case R2:
+ m_r2 = value.toNumber(exec);
+ break;
+ case Angle:
+ m_angle = value.toNumber(exec);
+ break;
+ case LargeArcFlag:
+ m_largeArcFlag = value.toBoolean(exec);
+ break;
+ case SweepFlag:
+ m_sweepFlag = value.toBoolean(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+SVGPathSegArcRelImpl::SVGPathSegArcRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegArcRelImpl::~SVGPathSegArcRelImpl()
+{
+}
+
+void SVGPathSegArcRelImpl::setX(double x)
+{
+ m_x = x;
+}
+
+double SVGPathSegArcRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegArcRelImpl::setY(double y)
+{
+ m_y = y;
+}
+
+double SVGPathSegArcRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegArcRelImpl::setR1(double r1)
+{
+ m_r1 = r1;
+}
+
+double SVGPathSegArcRelImpl::r1() const
+{
+ return m_r1;
+}
+
+void SVGPathSegArcRelImpl::setR2(double r2)
+{
+ m_r2 = r2;
+}
+
+double SVGPathSegArcRelImpl::r2() const
+{
+ return m_r2;
+}
+
+void SVGPathSegArcRelImpl::setAngle(double angle)
+{
+ m_angle = angle;
+}
+
+double SVGPathSegArcRelImpl::angle() const
+{
+ return m_angle;
+}
+
+void SVGPathSegArcRelImpl::setLargeArcFlag(bool largeArcFlag)
+{
+ m_largeArcFlag = largeArcFlag;
+}
+
+bool SVGPathSegArcRelImpl::largeArcFlag() const
+{
+ return m_largeArcFlag;
+}
+
+void SVGPathSegArcRelImpl::setSweepFlag(bool sweepFlag)
+{
+ m_sweepFlag = sweepFlag;
+}
+
+bool SVGPathSegArcRelImpl::sweepFlag() const
+{
+ return m_sweepFlag;
+}
+
+void SVGPathSegArcRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x();
+ double dy = y();
+ double startSlope;
+ double endSlope;
+ getArcSlopes(true, curx, cury, angle(), x(), y(), r1(), r2(), largeArcFlag(), sweepFlag(), &startSlope, &endSlope);
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegArcRelImpl::s_hashTable 11
+ x SVGPathSegArcRelImpl::X DontDelete
+ y SVGPathSegArcRelImpl::Y DontDelete
+ r1 SVGPathSegArcRelImpl::R1 DontDelete
+ r2 SVGPathSegArcRelImpl::R2 DontDelete
+ angle SVGPathSegArcRelImpl::Angle DontDelete
+ largeArcFlag SVGPathSegArcRelImpl::LargeArcFlag DontDelete
+ sweepFlag SVGPathSegArcRelImpl::SweepFlag DontDelete
+@end
+*/
+
+Value SVGPathSegArcRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case R1:
+ return Number(r1());
+ case R2:
+ return Number(r2());
+ case Angle:
+ return Number(angle());
+ case LargeArcFlag:
+ return Boolean(largeArcFlag());
+ case SweepFlag:
+ return Boolean(sweepFlag());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegArcRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case R1:
+ m_r1 = value.toNumber(exec);
+ break;
+ case R2:
+ m_r2 = value.toNumber(exec);
+ break;
+ case Angle:
+ m_angle = value.toNumber(exec);
+ break;
+ case LargeArcFlag:
+ m_largeArcFlag = value.toBoolean(exec);
+ break;
+ case SweepFlag:
+ m_sweepFlag = value.toBoolean(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegArcImpl.h b/ksvg/impl/SVGPathSegArcImpl.h
index d8a1f8f9..63bc5590 100644
--- a/ksvg/impl/SVGPathSegArcImpl.h
+++ b/ksvg/impl/SVGPathSegArcImpl.h
@@ -146,5 +146,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegClosePathImpl.cc b/ksvg/impl/SVGPathSegClosePathImpl.cc
deleted file mode 100644
index c18e6027..00000000
--- a/ksvg/impl/SVGPathSegClosePathImpl.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPathSegClosePathImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-SVGPathSegClosePathImpl::SVGPathSegClosePathImpl() : SVGPathSegImpl()
-{
-}
-
-SVGPathSegClosePathImpl::~SVGPathSegClosePathImpl()
-{
-}
-
-void SVGPathSegClosePathImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegClosePathImpl.cpp b/ksvg/impl/SVGPathSegClosePathImpl.cpp
new file mode 100644
index 00000000..f5e15f88
--- /dev/null
+++ b/ksvg/impl/SVGPathSegClosePathImpl.cpp
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPathSegClosePathImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+SVGPathSegClosePathImpl::SVGPathSegClosePathImpl() : SVGPathSegImpl()
+{
+}
+
+SVGPathSegClosePathImpl::~SVGPathSegClosePathImpl()
+{
+}
+
+void SVGPathSegClosePathImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
diff --git a/ksvg/impl/SVGPathSegClosePathImpl.h b/ksvg/impl/SVGPathSegClosePathImpl.h
index c9c93ca0..41c739f5 100644
--- a/ksvg/impl/SVGPathSegClosePathImpl.h
+++ b/ksvg/impl/SVGPathSegClosePathImpl.h
@@ -57,5 +57,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoCubicImpl.cc b/ksvg/impl/SVGPathSegCurvetoCubicImpl.cc
deleted file mode 100644
index 468b1fb3..00000000
--- a/ksvg/impl/SVGPathSegCurvetoCubicImpl.cc
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegCurvetoCubicImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegCurvetoCubicImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegCurvetoCubicAbsImpl::SVGPathSegCurvetoCubicAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoCubicAbsImpl::~SVGPathSegCurvetoCubicAbsImpl()
-{
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoCubicAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoCubicAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::setX1(const double &x1)
-{
- m_x1 = x1;
-}
-
-double SVGPathSegCurvetoCubicAbsImpl::x1() const
-{
- return m_x1;
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::setY1(const double &y1)
-{
- m_y1 = y1;
-}
-
-double SVGPathSegCurvetoCubicAbsImpl::y1() const
-{
- return m_y1;
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::setX2(const double &x2)
-{
- m_x2 = x2;
-}
-
-double SVGPathSegCurvetoCubicAbsImpl::x2() const
-{
- return m_x2;
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::setY2(const double &y2)
-{
- m_y2 = y2;
-}
-
-double SVGPathSegCurvetoCubicAbsImpl::y2() const
-{
- return m_y2;
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(y1() - cury, x1() - curx));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoCubicAbsImpl::s_hashTable 7
- x SVGPathSegCurvetoCubicAbsImpl::X DontDelete
- y SVGPathSegCurvetoCubicAbsImpl::Y DontDelete
- x1 SVGPathSegCurvetoCubicAbsImpl::X1 DontDelete
- y1 SVGPathSegCurvetoCubicAbsImpl::Y1 DontDelete
- x2 SVGPathSegCurvetoCubicAbsImpl::X2 DontDelete
- y2 SVGPathSegCurvetoCubicAbsImpl::Y2 DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoCubicAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case X1:
- return Number(x1());
- case Y1:
- return Number(y1());
- case X2:
- return Number(x2());
- case Y2:
- return Number(y2());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoCubicAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case X1:
- m_x1 = value.toNumber(exec);
- break;
- case Y1:
- m_y1 = value.toNumber(exec);
- break;
- case X2:
- m_x2 = value.toNumber(exec);
- break;
- case Y2:
- m_y2 = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-
-SVGPathSegCurvetoCubicRelImpl::SVGPathSegCurvetoCubicRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoCubicRelImpl::~SVGPathSegCurvetoCubicRelImpl()
-{
-}
-
-void SVGPathSegCurvetoCubicRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoCubicRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoCubicRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoCubicRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoCubicRelImpl::setX1(const double &x1)
-{
- m_x1 = x1;
-}
-
-double SVGPathSegCurvetoCubicRelImpl::x1() const
-{
- return m_x1;
-}
-
-void SVGPathSegCurvetoCubicRelImpl::setY1(const double &y1)
-{
- m_y1 = y1;
-}
-
-double SVGPathSegCurvetoCubicRelImpl::y1() const
-{
- return m_y1;
-}
-
-void SVGPathSegCurvetoCubicRelImpl::setX2(const double &x2)
-{
- m_x2 = x2;
-}
-
-double SVGPathSegCurvetoCubicRelImpl::x2() const
-{
- return m_x2;
-}
-
-void SVGPathSegCurvetoCubicRelImpl::setY2(const double &y2)
-{
- m_y2 = y2;
-}
-
-double SVGPathSegCurvetoCubicRelImpl::y2() const
-{
- return m_y2;
-}
-
-void SVGPathSegCurvetoCubicRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- Q_UNUSED(curx);
- Q_UNUSED(cury);
- double dx = x();
- double dy = y();
- double startSlope = SVGAngleImpl::todeg(atan2(y1(), x1()));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoCubicRelImpl::s_hashTable 7
- x SVGPathSegCurvetoCubicRelImpl::X DontDelete
- y SVGPathSegCurvetoCubicRelImpl::Y DontDelete
- x1 SVGPathSegCurvetoCubicRelImpl::X1 DontDelete
- y1 SVGPathSegCurvetoCubicRelImpl::Y1 DontDelete
- x2 SVGPathSegCurvetoCubicRelImpl::X2 DontDelete
- y2 SVGPathSegCurvetoCubicRelImpl::Y2 DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoCubicRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case X1:
- return Number(x1());
- case Y1:
- return Number(y1());
- case X2:
- return Number(x2());
- case Y2:
- return Number(y2());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoCubicRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case X1:
- m_x1 = value.toNumber(exec);
- break;
- case Y1:
- m_y1 = value.toNumber(exec);
- break;
- case X2:
- m_x2 = value.toNumber(exec);
- break;
- case Y2:
- m_y2 = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoCubicImpl.cpp b/ksvg/impl/SVGPathSegCurvetoCubicImpl.cpp
new file mode 100644
index 00000000..597b5bdc
--- /dev/null
+++ b/ksvg/impl/SVGPathSegCurvetoCubicImpl.cpp
@@ -0,0 +1,323 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegCurvetoCubicImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegCurvetoCubicImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegCurvetoCubicAbsImpl::SVGPathSegCurvetoCubicAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoCubicAbsImpl::~SVGPathSegCurvetoCubicAbsImpl()
+{
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoCubicAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoCubicAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::setX1(const double &x1)
+{
+ m_x1 = x1;
+}
+
+double SVGPathSegCurvetoCubicAbsImpl::x1() const
+{
+ return m_x1;
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::setY1(const double &y1)
+{
+ m_y1 = y1;
+}
+
+double SVGPathSegCurvetoCubicAbsImpl::y1() const
+{
+ return m_y1;
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::setX2(const double &x2)
+{
+ m_x2 = x2;
+}
+
+double SVGPathSegCurvetoCubicAbsImpl::x2() const
+{
+ return m_x2;
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::setY2(const double &y2)
+{
+ m_y2 = y2;
+}
+
+double SVGPathSegCurvetoCubicAbsImpl::y2() const
+{
+ return m_y2;
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(y1() - cury, x1() - curx));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoCubicAbsImpl::s_hashTable 7
+ x SVGPathSegCurvetoCubicAbsImpl::X DontDelete
+ y SVGPathSegCurvetoCubicAbsImpl::Y DontDelete
+ x1 SVGPathSegCurvetoCubicAbsImpl::X1 DontDelete
+ y1 SVGPathSegCurvetoCubicAbsImpl::Y1 DontDelete
+ x2 SVGPathSegCurvetoCubicAbsImpl::X2 DontDelete
+ y2 SVGPathSegCurvetoCubicAbsImpl::Y2 DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoCubicAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case X1:
+ return Number(x1());
+ case Y1:
+ return Number(y1());
+ case X2:
+ return Number(x2());
+ case Y2:
+ return Number(y2());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoCubicAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case X1:
+ m_x1 = value.toNumber(exec);
+ break;
+ case Y1:
+ m_y1 = value.toNumber(exec);
+ break;
+ case X2:
+ m_x2 = value.toNumber(exec);
+ break;
+ case Y2:
+ m_y2 = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+
+SVGPathSegCurvetoCubicRelImpl::SVGPathSegCurvetoCubicRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoCubicRelImpl::~SVGPathSegCurvetoCubicRelImpl()
+{
+}
+
+void SVGPathSegCurvetoCubicRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoCubicRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoCubicRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoCubicRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoCubicRelImpl::setX1(const double &x1)
+{
+ m_x1 = x1;
+}
+
+double SVGPathSegCurvetoCubicRelImpl::x1() const
+{
+ return m_x1;
+}
+
+void SVGPathSegCurvetoCubicRelImpl::setY1(const double &y1)
+{
+ m_y1 = y1;
+}
+
+double SVGPathSegCurvetoCubicRelImpl::y1() const
+{
+ return m_y1;
+}
+
+void SVGPathSegCurvetoCubicRelImpl::setX2(const double &x2)
+{
+ m_x2 = x2;
+}
+
+double SVGPathSegCurvetoCubicRelImpl::x2() const
+{
+ return m_x2;
+}
+
+void SVGPathSegCurvetoCubicRelImpl::setY2(const double &y2)
+{
+ m_y2 = y2;
+}
+
+double SVGPathSegCurvetoCubicRelImpl::y2() const
+{
+ return m_y2;
+}
+
+void SVGPathSegCurvetoCubicRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ Q_UNUSED(curx);
+ Q_UNUSED(cury);
+ double dx = x();
+ double dy = y();
+ double startSlope = SVGAngleImpl::todeg(atan2(y1(), x1()));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoCubicRelImpl::s_hashTable 7
+ x SVGPathSegCurvetoCubicRelImpl::X DontDelete
+ y SVGPathSegCurvetoCubicRelImpl::Y DontDelete
+ x1 SVGPathSegCurvetoCubicRelImpl::X1 DontDelete
+ y1 SVGPathSegCurvetoCubicRelImpl::Y1 DontDelete
+ x2 SVGPathSegCurvetoCubicRelImpl::X2 DontDelete
+ y2 SVGPathSegCurvetoCubicRelImpl::Y2 DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoCubicRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case X1:
+ return Number(x1());
+ case Y1:
+ return Number(y1());
+ case X2:
+ return Number(x2());
+ case Y2:
+ return Number(y2());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoCubicRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case X1:
+ m_x1 = value.toNumber(exec);
+ break;
+ case Y1:
+ m_y1 = value.toNumber(exec);
+ break;
+ case X2:
+ m_x2 = value.toNumber(exec);
+ break;
+ case Y2:
+ m_y2 = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegCurvetoCubicImpl.h b/ksvg/impl/SVGPathSegCurvetoCubicImpl.h
index 83f4de6b..73a517a0 100644
--- a/ksvg/impl/SVGPathSegCurvetoCubicImpl.h
+++ b/ksvg/impl/SVGPathSegCurvetoCubicImpl.h
@@ -135,5 +135,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cc b/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cc
deleted file mode 100644
index 1d5c124a..00000000
--- a/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cc
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegCurvetoCubicSmoothImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegCurvetoCubicSmoothImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegCurvetoCubicSmoothAbsImpl::SVGPathSegCurvetoCubicSmoothAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoCubicSmoothAbsImpl::~SVGPathSegCurvetoCubicSmoothAbsImpl()
-{
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoCubicSmoothAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoCubicSmoothAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::setX2(const double &x2)
-{
- m_x2 = x2;
-}
-
-double SVGPathSegCurvetoCubicSmoothAbsImpl::x2() const
-{
- return m_x2;
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::setY2(const double &y2)
-{
- m_y2 = y2;
-}
-
-double SVGPathSegCurvetoCubicSmoothAbsImpl::y2() const
-{
- return m_y2;
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::setPreviousX2(double x2)
-{
- m_previousX2 = x2;
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::setPreviousY2(double y2)
-{
- m_previousY2 = y2;
-}
-
-double SVGPathSegCurvetoCubicSmoothAbsImpl::x1(double curx) const
-{
- return curx - (m_previousX2 - curx);
-}
-
-double SVGPathSegCurvetoCubicSmoothAbsImpl::y1(double cury) const
-{
- return cury - (m_previousY2 - cury);
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(y1(cury) - cury, x1(curx) - curx));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoCubicSmoothAbsImpl::s_hashTable 5
- x SVGPathSegCurvetoCubicSmoothAbsImpl::X DontDelete
- y SVGPathSegCurvetoCubicSmoothAbsImpl::Y DontDelete
- x2 SVGPathSegCurvetoCubicSmoothAbsImpl::X2 DontDelete
- y2 SVGPathSegCurvetoCubicSmoothAbsImpl::Y2 DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoCubicSmoothAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case X2:
- return Number(x2());
- case Y2:
- return Number(y2());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoCubicSmoothAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case X2:
- m_x2 = value.toNumber(exec);
- break;
- case Y2:
- m_y2 = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-SVGPathSegCurvetoCubicSmoothRelImpl::SVGPathSegCurvetoCubicSmoothRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoCubicSmoothRelImpl::~SVGPathSegCurvetoCubicSmoothRelImpl()
-{
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoCubicSmoothRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoCubicSmoothRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::setX2(const double &x2)
-{
- m_x2 = x2;
-}
-
-double SVGPathSegCurvetoCubicSmoothRelImpl::x2() const
-{
- return m_x2;
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::setY2(const double &y2)
-{
- m_y2 = y2;
-}
-
-double SVGPathSegCurvetoCubicSmoothRelImpl::y2() const
-{
- return m_y2;
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::setPreviousAbsX2(double x2)
-{
- m_previousAbsX2 = x2;
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::setPreviousAbsY2(double y2)
-{
- m_previousAbsY2 = y2;
-}
-
-double SVGPathSegCurvetoCubicSmoothRelImpl::absX1(double curx) const
-{
- return curx - (m_previousAbsX2 - curx);
-}
-
-double SVGPathSegCurvetoCubicSmoothRelImpl::absY1(double cury) const
-{
- return cury - (m_previousAbsY2 - cury);
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x();
- double dy = y();
- double startSlope = SVGAngleImpl::todeg(atan2(absY1(cury) - cury, absX1(curx) - curx));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoCubicSmoothRelImpl::s_hashTable 5
- x SVGPathSegCurvetoCubicSmoothRelImpl::X DontDelete
- y SVGPathSegCurvetoCubicSmoothRelImpl::Y DontDelete
- x2 SVGPathSegCurvetoCubicSmoothRelImpl::X2 DontDelete
- y2 SVGPathSegCurvetoCubicSmoothRelImpl::Y2 DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoCubicSmoothRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case X2:
- return Number(x2());
- case Y2:
- return Number(y2());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoCubicSmoothRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case X2:
- m_x2 = value.toNumber(exec);
- break;
- case Y2:
- m_y2 = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cpp b/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cpp
new file mode 100644
index 00000000..8bc5460e
--- /dev/null
+++ b/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.cpp
@@ -0,0 +1,296 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegCurvetoCubicSmoothImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegCurvetoCubicSmoothImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegCurvetoCubicSmoothAbsImpl::SVGPathSegCurvetoCubicSmoothAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoCubicSmoothAbsImpl::~SVGPathSegCurvetoCubicSmoothAbsImpl()
+{
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoCubicSmoothAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoCubicSmoothAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::setX2(const double &x2)
+{
+ m_x2 = x2;
+}
+
+double SVGPathSegCurvetoCubicSmoothAbsImpl::x2() const
+{
+ return m_x2;
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::setY2(const double &y2)
+{
+ m_y2 = y2;
+}
+
+double SVGPathSegCurvetoCubicSmoothAbsImpl::y2() const
+{
+ return m_y2;
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::setPreviousX2(double x2)
+{
+ m_previousX2 = x2;
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::setPreviousY2(double y2)
+{
+ m_previousY2 = y2;
+}
+
+double SVGPathSegCurvetoCubicSmoothAbsImpl::x1(double curx) const
+{
+ return curx - (m_previousX2 - curx);
+}
+
+double SVGPathSegCurvetoCubicSmoothAbsImpl::y1(double cury) const
+{
+ return cury - (m_previousY2 - cury);
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(y1(cury) - cury, x1(curx) - curx));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoCubicSmoothAbsImpl::s_hashTable 5
+ x SVGPathSegCurvetoCubicSmoothAbsImpl::X DontDelete
+ y SVGPathSegCurvetoCubicSmoothAbsImpl::Y DontDelete
+ x2 SVGPathSegCurvetoCubicSmoothAbsImpl::X2 DontDelete
+ y2 SVGPathSegCurvetoCubicSmoothAbsImpl::Y2 DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoCubicSmoothAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case X2:
+ return Number(x2());
+ case Y2:
+ return Number(y2());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoCubicSmoothAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case X2:
+ m_x2 = value.toNumber(exec);
+ break;
+ case Y2:
+ m_y2 = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+SVGPathSegCurvetoCubicSmoothRelImpl::SVGPathSegCurvetoCubicSmoothRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoCubicSmoothRelImpl::~SVGPathSegCurvetoCubicSmoothRelImpl()
+{
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoCubicSmoothRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoCubicSmoothRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::setX2(const double &x2)
+{
+ m_x2 = x2;
+}
+
+double SVGPathSegCurvetoCubicSmoothRelImpl::x2() const
+{
+ return m_x2;
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::setY2(const double &y2)
+{
+ m_y2 = y2;
+}
+
+double SVGPathSegCurvetoCubicSmoothRelImpl::y2() const
+{
+ return m_y2;
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::setPreviousAbsX2(double x2)
+{
+ m_previousAbsX2 = x2;
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::setPreviousAbsY2(double y2)
+{
+ m_previousAbsY2 = y2;
+}
+
+double SVGPathSegCurvetoCubicSmoothRelImpl::absX1(double curx) const
+{
+ return curx - (m_previousAbsX2 - curx);
+}
+
+double SVGPathSegCurvetoCubicSmoothRelImpl::absY1(double cury) const
+{
+ return cury - (m_previousAbsY2 - cury);
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x();
+ double dy = y();
+ double startSlope = SVGAngleImpl::todeg(atan2(absY1(cury) - cury, absX1(curx) - curx));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y2(), x() - x2()));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoCubicSmoothRelImpl::s_hashTable 5
+ x SVGPathSegCurvetoCubicSmoothRelImpl::X DontDelete
+ y SVGPathSegCurvetoCubicSmoothRelImpl::Y DontDelete
+ x2 SVGPathSegCurvetoCubicSmoothRelImpl::X2 DontDelete
+ y2 SVGPathSegCurvetoCubicSmoothRelImpl::Y2 DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoCubicSmoothRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case X2:
+ return Number(x2());
+ case Y2:
+ return Number(y2());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoCubicSmoothRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case X2:
+ m_x2 = value.toNumber(exec);
+ break;
+ case Y2:
+ m_y2 = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.h b/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.h
index 3bcc8c87..3395ea81 100644
--- a/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.h
+++ b/ksvg/impl/SVGPathSegCurvetoCubicSmoothImpl.h
@@ -135,5 +135,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cc b/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cc
deleted file mode 100644
index e6199a21..00000000
--- a/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cc
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegCurvetoQuadraticImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegCurvetoQuadraticImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegCurvetoQuadraticAbsImpl::SVGPathSegCurvetoQuadraticAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoQuadraticAbsImpl::~SVGPathSegCurvetoQuadraticAbsImpl()
-{
-}
-
-void SVGPathSegCurvetoQuadraticAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoQuadraticAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoQuadraticAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoQuadraticAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoQuadraticAbsImpl::setX1(const double &x1)
-{
- m_x1 = x1;
-}
-
-double SVGPathSegCurvetoQuadraticAbsImpl::x1() const
-{
- return m_x1;
-}
-
-void SVGPathSegCurvetoQuadraticAbsImpl::setY1(const double &y1)
-{
- m_y1 = y1;
-}
-
-double SVGPathSegCurvetoQuadraticAbsImpl::y1() const
-{
- return m_y1;
-}
-
-void SVGPathSegCurvetoQuadraticAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(y1() - cury, x1() - curx));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y1(), x() - x1()));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoQuadraticAbsImpl::s_hashTable 5
- x SVGPathSegCurvetoQuadraticAbsImpl::X DontDelete
- y SVGPathSegCurvetoQuadraticAbsImpl::Y DontDelete
- x1 SVGPathSegCurvetoQuadraticAbsImpl::X1 DontDelete
- y1 SVGPathSegCurvetoQuadraticAbsImpl::Y1 DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoQuadraticAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case X1:
- return Number(x1());
- case Y1:
- return Number(y1());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoQuadraticAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case X1:
- m_x1 = value.toNumber(exec);
- break;
- case Y1:
- m_y1 = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-SVGPathSegCurvetoQuadraticRelImpl::SVGPathSegCurvetoQuadraticRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoQuadraticRelImpl::~SVGPathSegCurvetoQuadraticRelImpl()
-{
-}
-
-void SVGPathSegCurvetoQuadraticRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoQuadraticRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoQuadraticRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoQuadraticRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoQuadraticRelImpl::setX1(const double &x1)
-{
- m_x1 = x1;
-}
-
-double SVGPathSegCurvetoQuadraticRelImpl::x1() const
-{
- return m_x1;
-}
-
-void SVGPathSegCurvetoQuadraticRelImpl::setY1(const double &y1)
-{
- m_y1 = y1;
-}
-
-double SVGPathSegCurvetoQuadraticRelImpl::y1() const
-{
- return m_y1;
-}
-
-void SVGPathSegCurvetoQuadraticRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- Q_UNUSED(curx);
- Q_UNUSED(cury);
- double dx = x();
- double dy = y();
- double startSlope = SVGAngleImpl::todeg(atan2(y1(), x1()));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y1(), x() - x1()));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoQuadraticRelImpl::s_hashTable 5
- x SVGPathSegCurvetoQuadraticRelImpl::X DontDelete
- y SVGPathSegCurvetoQuadraticRelImpl::Y DontDelete
- x1 SVGPathSegCurvetoQuadraticRelImpl::X1 DontDelete
- y1 SVGPathSegCurvetoQuadraticRelImpl::Y1 DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoQuadraticRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- case X1:
- return Number(x1());
- case Y1:
- return Number(y1());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoQuadraticRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case X1:
- m_x1 = value.toNumber(exec);
- break;
- case Y1:
- m_y1 = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cpp b/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cpp
new file mode 100644
index 00000000..fa78804f
--- /dev/null
+++ b/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.cpp
@@ -0,0 +1,258 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegCurvetoQuadraticImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegCurvetoQuadraticImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegCurvetoQuadraticAbsImpl::SVGPathSegCurvetoQuadraticAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoQuadraticAbsImpl::~SVGPathSegCurvetoQuadraticAbsImpl()
+{
+}
+
+void SVGPathSegCurvetoQuadraticAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoQuadraticAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoQuadraticAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoQuadraticAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoQuadraticAbsImpl::setX1(const double &x1)
+{
+ m_x1 = x1;
+}
+
+double SVGPathSegCurvetoQuadraticAbsImpl::x1() const
+{
+ return m_x1;
+}
+
+void SVGPathSegCurvetoQuadraticAbsImpl::setY1(const double &y1)
+{
+ m_y1 = y1;
+}
+
+double SVGPathSegCurvetoQuadraticAbsImpl::y1() const
+{
+ return m_y1;
+}
+
+void SVGPathSegCurvetoQuadraticAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(y1() - cury, x1() - curx));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y1(), x() - x1()));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoQuadraticAbsImpl::s_hashTable 5
+ x SVGPathSegCurvetoQuadraticAbsImpl::X DontDelete
+ y SVGPathSegCurvetoQuadraticAbsImpl::Y DontDelete
+ x1 SVGPathSegCurvetoQuadraticAbsImpl::X1 DontDelete
+ y1 SVGPathSegCurvetoQuadraticAbsImpl::Y1 DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoQuadraticAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case X1:
+ return Number(x1());
+ case Y1:
+ return Number(y1());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoQuadraticAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case X1:
+ m_x1 = value.toNumber(exec);
+ break;
+ case Y1:
+ m_y1 = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+SVGPathSegCurvetoQuadraticRelImpl::SVGPathSegCurvetoQuadraticRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoQuadraticRelImpl::~SVGPathSegCurvetoQuadraticRelImpl()
+{
+}
+
+void SVGPathSegCurvetoQuadraticRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoQuadraticRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoQuadraticRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoQuadraticRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoQuadraticRelImpl::setX1(const double &x1)
+{
+ m_x1 = x1;
+}
+
+double SVGPathSegCurvetoQuadraticRelImpl::x1() const
+{
+ return m_x1;
+}
+
+void SVGPathSegCurvetoQuadraticRelImpl::setY1(const double &y1)
+{
+ m_y1 = y1;
+}
+
+double SVGPathSegCurvetoQuadraticRelImpl::y1() const
+{
+ return m_y1;
+}
+
+void SVGPathSegCurvetoQuadraticRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ Q_UNUSED(curx);
+ Q_UNUSED(cury);
+ double dx = x();
+ double dy = y();
+ double startSlope = SVGAngleImpl::todeg(atan2(y1(), x1()));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y1(), x() - x1()));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoQuadraticRelImpl::s_hashTable 5
+ x SVGPathSegCurvetoQuadraticRelImpl::X DontDelete
+ y SVGPathSegCurvetoQuadraticRelImpl::Y DontDelete
+ x1 SVGPathSegCurvetoQuadraticRelImpl::X1 DontDelete
+ y1 SVGPathSegCurvetoQuadraticRelImpl::Y1 DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoQuadraticRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ case X1:
+ return Number(x1());
+ case Y1:
+ return Number(y1());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoQuadraticRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case X1:
+ m_x1 = value.toNumber(exec);
+ break;
+ case Y1:
+ m_y1 = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.h b/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.h
index 6772605f..a4a5a610 100644
--- a/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.h
+++ b/ksvg/impl/SVGPathSegCurvetoQuadraticImpl.h
@@ -119,5 +119,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cc b/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cc
deleted file mode 100644
index f8c141da..00000000
--- a/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cc
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegCurvetoQuadraticSmoothImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegCurvetoQuadraticSmoothImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegCurvetoQuadraticSmoothAbsImpl::SVGPathSegCurvetoQuadraticSmoothAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoQuadraticSmoothAbsImpl::~SVGPathSegCurvetoQuadraticSmoothAbsImpl()
-{
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoQuadraticSmoothAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoQuadraticSmoothAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setPreviousX1(double x1)
-{
- m_previousX1 = x1;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setPreviousY1(double y1)
-{
- m_previousY1 = y1;
-}
-
-double SVGPathSegCurvetoQuadraticSmoothAbsImpl::x1(double curx) const
-{
- return curx - (m_previousX1 - curx);
-}
-
-double SVGPathSegCurvetoQuadraticSmoothAbsImpl::y1(double cury) const
-{
- return cury - (m_previousY1 - cury);
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(y1(cury) - cury, x1(curx) - curx));
- double endSlope = SVGAngleImpl::todeg(atan2(y() - y1(cury), x() - x1(curx)));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoQuadraticSmoothAbsImpl::s_hashTable 3
- x SVGPathSegCurvetoQuadraticSmoothAbsImpl::X DontDelete
- y SVGPathSegCurvetoQuadraticSmoothAbsImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoQuadraticSmoothAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoQuadraticSmoothAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-
-SVGPathSegCurvetoQuadraticSmoothRelImpl::SVGPathSegCurvetoQuadraticSmoothRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegCurvetoQuadraticSmoothRelImpl::~SVGPathSegCurvetoQuadraticSmoothRelImpl()
-{
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegCurvetoQuadraticSmoothRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegCurvetoQuadraticSmoothRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRelImpl::setPreviousAbsX1(double x1)
-{
- m_previousAbsX1 = x1;
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRelImpl::setPreviousAbsY1(double y1)
-{
- m_previousAbsY1 = y1;
-}
-
-double SVGPathSegCurvetoQuadraticSmoothRelImpl::absX1(double curx) const
-{
- return curx - (m_previousAbsX1 - curx);
-}
-
-double SVGPathSegCurvetoQuadraticSmoothRelImpl::absY1(double cury) const
-{
- return cury - (m_previousAbsY1 - cury);
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
-{
- double dx = x();
- double dy = y();
- double startSlope = SVGAngleImpl::todeg(atan2(absY1(cury) - cury, absX1(curx) - curx));
- double endSlope = SVGAngleImpl::todeg(atan2(cury + y() - absY1(cury), curx + x() - absX1(curx)));
- *pDx = dx;
- *pDy = dy;
- *pStartSlope = startSlope;
- *pEndSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegCurvetoQuadraticSmoothRelImpl::s_hashTable 3
- x SVGPathSegCurvetoQuadraticSmoothRelImpl::X DontDelete
- y SVGPathSegCurvetoQuadraticSmoothRelImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegCurvetoQuadraticSmoothRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegCurvetoQuadraticSmoothRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cpp b/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cpp
new file mode 100644
index 00000000..a6cb362f
--- /dev/null
+++ b/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.cpp
@@ -0,0 +1,233 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegCurvetoQuadraticSmoothImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegCurvetoQuadraticSmoothImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegCurvetoQuadraticSmoothAbsImpl::SVGPathSegCurvetoQuadraticSmoothAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoQuadraticSmoothAbsImpl::~SVGPathSegCurvetoQuadraticSmoothAbsImpl()
+{
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoQuadraticSmoothAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoQuadraticSmoothAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setPreviousX1(double x1)
+{
+ m_previousX1 = x1;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbsImpl::setPreviousY1(double y1)
+{
+ m_previousY1 = y1;
+}
+
+double SVGPathSegCurvetoQuadraticSmoothAbsImpl::x1(double curx) const
+{
+ return curx - (m_previousX1 - curx);
+}
+
+double SVGPathSegCurvetoQuadraticSmoothAbsImpl::y1(double cury) const
+{
+ return cury - (m_previousY1 - cury);
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(y1(cury) - cury, x1(curx) - curx));
+ double endSlope = SVGAngleImpl::todeg(atan2(y() - y1(cury), x() - x1(curx)));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoQuadraticSmoothAbsImpl::s_hashTable 3
+ x SVGPathSegCurvetoQuadraticSmoothAbsImpl::X DontDelete
+ y SVGPathSegCurvetoQuadraticSmoothAbsImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoQuadraticSmoothAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoQuadraticSmoothAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+
+SVGPathSegCurvetoQuadraticSmoothRelImpl::SVGPathSegCurvetoQuadraticSmoothRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegCurvetoQuadraticSmoothRelImpl::~SVGPathSegCurvetoQuadraticSmoothRelImpl()
+{
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegCurvetoQuadraticSmoothRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegCurvetoQuadraticSmoothRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRelImpl::setPreviousAbsX1(double x1)
+{
+ m_previousAbsX1 = x1;
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRelImpl::setPreviousAbsY1(double y1)
+{
+ m_previousAbsY1 = y1;
+}
+
+double SVGPathSegCurvetoQuadraticSmoothRelImpl::absX1(double curx) const
+{
+ return curx - (m_previousAbsX1 - curx);
+}
+
+double SVGPathSegCurvetoQuadraticSmoothRelImpl::absY1(double cury) const
+{
+ return cury - (m_previousAbsY1 - cury);
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRelImpl::getDeltasAndSlopes(double curx, double cury, double *pDx, double *pDy, double *pStartSlope, double *pEndSlope) const
+{
+ double dx = x();
+ double dy = y();
+ double startSlope = SVGAngleImpl::todeg(atan2(absY1(cury) - cury, absX1(curx) - curx));
+ double endSlope = SVGAngleImpl::todeg(atan2(cury + y() - absY1(cury), curx + x() - absX1(curx)));
+ *pDx = dx;
+ *pDy = dy;
+ *pStartSlope = startSlope;
+ *pEndSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegCurvetoQuadraticSmoothRelImpl::s_hashTable 3
+ x SVGPathSegCurvetoQuadraticSmoothRelImpl::X DontDelete
+ y SVGPathSegCurvetoQuadraticSmoothRelImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegCurvetoQuadraticSmoothRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegCurvetoQuadraticSmoothRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.h b/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.h
index 6c471bd6..1351cd97 100644
--- a/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.h
+++ b/ksvg/impl/SVGPathSegCurvetoQuadraticSmoothImpl.h
@@ -119,5 +119,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegImpl.cc b/ksvg/impl/SVGPathSegImpl.cc
deleted file mode 100644
index c1f2934d..00000000
--- a/ksvg/impl/SVGPathSegImpl.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_cacheimpl.h"
-
-SVGPathSegImpl::SVGPathSegImpl()
-{
-}
-
-SVGPathSegImpl::~SVGPathSegImpl()
-{
-}
-
-void SVGPathSegImpl::getDeltasAndSlopes(double, double, double *dx, double *dy, double *startSlope, double *endSlope) const
-{
- *dx = 0;
- *dy = 0;
- *startSlope = 0;
- *endSlope = 0;
-}
-
-// Exma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegImpl::s_hashTable 3
- pathSegType SVGPathSegImpl::PathSegType DontDelete|ReadOnly
- pathSegTypeAsLetter SVGPathSegImpl::PathSegTypeAsLetter DontDelete|ReadOnly
-@end
-*/
-
-Value SVGPathSegImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case PathSegType:
- return Number(pathSegType());
- case PathSegTypeAsLetter:
- return String(pathSegTypeAsLetter().string());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-/*
-@namespace KSVG
-@begin SVGPathSegImplConstructor::s_hashTable 23
- PATHSEG_UNKNOWN KSVG::PATHSEG_UNKNOWN DontDelete|ReadOnly
- PATHSEG_CLOSEPATH KSVG::PATHSEG_CLOSEPATH DontDelete|ReadOnly
- PATHSEG_MOVETO_ABS KSVG::PATHSEG_MOVETO_ABS DontDelete|ReadOnly
- PATHSEG_MOVETO_REL KSVG::PATHSEG_MOVETO_REL DontDelete|ReadOnly
- PATHSEG_LINETO_ABS KSVG::PATHSEG_LINETO_ABS DontDelete|ReadOnly
- PATHSEG_LINETO_REL KSVG::PATHSEG_LINETO_REL DontDelete|ReadOnly
- PATHSEG_CURVETO_CUBIC_ABS KSVG::PATHSEG_CURVETO_CUBIC_ABS DontDelete|ReadOnly
- PATHSEG_CURVETO_CUBIC_REL KSVG::PATHSEG_CURVETO_CUBIC_REL DontDelete|ReadOnly
- PATHSEG_CURVETO_QUADRATIC_ABS KSVG::PATHSEG_CURVETO_QUADRATIC_ABS DontDelete|ReadOnly
- PATHSEG_CURVETO_QUADRATIC_REL KSVG::PATHSEG_CURVETO_QUADRATIC_REL DontDelete|ReadOnly
- PATHSEG_ARC_ABS KSVG::PATHSEG_ARC_ABS DontDelete|ReadOnly
- PATHSEG_ARC_REL KSVG::PATHSEG_ARC_REL DontDelete|ReadOnly
- PATHSEG_LINETO_HORIZONTAL_ABS KSVG::PATHSEG_LINETO_HORIZONTAL_ABS DontDelete|ReadOnly
- PATHSEG_LINETO_HORIZONTAL_REL KSVG::PATHSEG_LINETO_HORIZONTAL_REL DontDelete|ReadOnly
- PATHSEG_LINETO_VERTICAL_ABS KSVG::PATHSEG_LINETO_VERTICAL_ABS DontDelete|ReadOnly
- PATHSEG_LINETO_VERTICAL_REL KSVG::PATHSEG_LINETO_VERTICAL_REL DontDelete|ReadOnly
- PATHSEG_CURVETO_CUBIC_SMOOTH_ABS KSVG::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS DontDelete|ReadOnly
- PATHSEG_CURVETO_CUBIC_SMOOTH_REL KSVG::PATHSEG_CURVETO_CUBIC_SMOOTH_REL DontDelete|ReadOnly
- PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS KSVG::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS DontDelete|ReadOnly
- PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL KSVG::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL DontDelete|ReadOnly
-@end
-*/
-
-Value SVGPathSegImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGPathSegImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGPathSegImplConstructor>(exec, "[[svgpathseg.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegImpl.cpp b/ksvg/impl/SVGPathSegImpl.cpp
new file mode 100644
index 00000000..3ad83d35
--- /dev/null
+++ b/ksvg/impl/SVGPathSegImpl.cpp
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_cacheimpl.h"
+
+SVGPathSegImpl::SVGPathSegImpl()
+{
+}
+
+SVGPathSegImpl::~SVGPathSegImpl()
+{
+}
+
+void SVGPathSegImpl::getDeltasAndSlopes(double, double, double *dx, double *dy, double *startSlope, double *endSlope) const
+{
+ *dx = 0;
+ *dy = 0;
+ *startSlope = 0;
+ *endSlope = 0;
+}
+
+// Exma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegImpl::s_hashTable 3
+ pathSegType SVGPathSegImpl::PathSegType DontDelete|ReadOnly
+ pathSegTypeAsLetter SVGPathSegImpl::PathSegTypeAsLetter DontDelete|ReadOnly
+@end
+*/
+
+Value SVGPathSegImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case PathSegType:
+ return Number(pathSegType());
+ case PathSegTypeAsLetter:
+ return String(pathSegTypeAsLetter().string());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+/*
+@namespace KSVG
+@begin SVGPathSegImplConstructor::s_hashTable 23
+ PATHSEG_UNKNOWN KSVG::PATHSEG_UNKNOWN DontDelete|ReadOnly
+ PATHSEG_CLOSEPATH KSVG::PATHSEG_CLOSEPATH DontDelete|ReadOnly
+ PATHSEG_MOVETO_ABS KSVG::PATHSEG_MOVETO_ABS DontDelete|ReadOnly
+ PATHSEG_MOVETO_REL KSVG::PATHSEG_MOVETO_REL DontDelete|ReadOnly
+ PATHSEG_LINETO_ABS KSVG::PATHSEG_LINETO_ABS DontDelete|ReadOnly
+ PATHSEG_LINETO_REL KSVG::PATHSEG_LINETO_REL DontDelete|ReadOnly
+ PATHSEG_CURVETO_CUBIC_ABS KSVG::PATHSEG_CURVETO_CUBIC_ABS DontDelete|ReadOnly
+ PATHSEG_CURVETO_CUBIC_REL KSVG::PATHSEG_CURVETO_CUBIC_REL DontDelete|ReadOnly
+ PATHSEG_CURVETO_QUADRATIC_ABS KSVG::PATHSEG_CURVETO_QUADRATIC_ABS DontDelete|ReadOnly
+ PATHSEG_CURVETO_QUADRATIC_REL KSVG::PATHSEG_CURVETO_QUADRATIC_REL DontDelete|ReadOnly
+ PATHSEG_ARC_ABS KSVG::PATHSEG_ARC_ABS DontDelete|ReadOnly
+ PATHSEG_ARC_REL KSVG::PATHSEG_ARC_REL DontDelete|ReadOnly
+ PATHSEG_LINETO_HORIZONTAL_ABS KSVG::PATHSEG_LINETO_HORIZONTAL_ABS DontDelete|ReadOnly
+ PATHSEG_LINETO_HORIZONTAL_REL KSVG::PATHSEG_LINETO_HORIZONTAL_REL DontDelete|ReadOnly
+ PATHSEG_LINETO_VERTICAL_ABS KSVG::PATHSEG_LINETO_VERTICAL_ABS DontDelete|ReadOnly
+ PATHSEG_LINETO_VERTICAL_REL KSVG::PATHSEG_LINETO_VERTICAL_REL DontDelete|ReadOnly
+ PATHSEG_CURVETO_CUBIC_SMOOTH_ABS KSVG::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS DontDelete|ReadOnly
+ PATHSEG_CURVETO_CUBIC_SMOOTH_REL KSVG::PATHSEG_CURVETO_CUBIC_SMOOTH_REL DontDelete|ReadOnly
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS KSVG::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS DontDelete|ReadOnly
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL KSVG::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL DontDelete|ReadOnly
+@end
+*/
+
+Value SVGPathSegImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGPathSegImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGPathSegImplConstructor>(exec, "[[svgpathseg.constructor]]");
+}
diff --git a/ksvg/impl/SVGPathSegImpl.h b/ksvg/impl/SVGPathSegImpl.h
index 8f07baea..87bb104c 100644
--- a/ksvg/impl/SVGPathSegImpl.h
+++ b/ksvg/impl/SVGPathSegImpl.h
@@ -71,5 +71,3 @@ KJS::Value getSVGPathSegImplConstructor(KJS::ExecState *exec);
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegLinetoHorizontalImpl.cc b/ksvg/impl/SVGPathSegLinetoHorizontalImpl.cc
deleted file mode 100644
index e36e49de..00000000
--- a/ksvg/impl/SVGPathSegLinetoHorizontalImpl.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegLinetoHorizontalImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegLinetoHorizontalImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegLinetoHorizontalAbsImpl::SVGPathSegLinetoHorizontalAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegLinetoHorizontalAbsImpl::~SVGPathSegLinetoHorizontalAbsImpl()
-{
-}
-
-void SVGPathSegLinetoHorizontalAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegLinetoHorizontalAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegLinetoHorizontalAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- Q_UNUSED(cury);
- double dx = x() - curx;
- double dy = 0;
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegLinetoHorizontalAbsImpl::s_hashTable 2
- x SVGPathSegLinetoHorizontalAbsImpl::X DontDelete
-@end
-*/
-
-Value SVGPathSegLinetoHorizontalAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegLinetoHorizontalAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-
-
-SVGPathSegLinetoHorizontalRelImpl::SVGPathSegLinetoHorizontalRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegLinetoHorizontalRelImpl::~SVGPathSegLinetoHorizontalRelImpl()
-{
-}
-
-void SVGPathSegLinetoHorizontalRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegLinetoHorizontalRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegLinetoHorizontalRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- Q_UNUSED(curx);
- Q_UNUSED(cury);
- double dx = x();
- double dy = 0;
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegLinetoHorizontalRelImpl::s_hashTable 2
- x SVGPathSegLinetoHorizontalRelImpl::X DontDelete
-@end
-*/
-
-Value SVGPathSegLinetoHorizontalRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegLinetoHorizontalRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegLinetoHorizontalImpl.cpp b/ksvg/impl/SVGPathSegLinetoHorizontalImpl.cpp
new file mode 100644
index 00000000..a0f11829
--- /dev/null
+++ b/ksvg/impl/SVGPathSegLinetoHorizontalImpl.cpp
@@ -0,0 +1,165 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegLinetoHorizontalImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegLinetoHorizontalImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegLinetoHorizontalAbsImpl::SVGPathSegLinetoHorizontalAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegLinetoHorizontalAbsImpl::~SVGPathSegLinetoHorizontalAbsImpl()
+{
+}
+
+void SVGPathSegLinetoHorizontalAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegLinetoHorizontalAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegLinetoHorizontalAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ Q_UNUSED(cury);
+ double dx = x() - curx;
+ double dy = 0;
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegLinetoHorizontalAbsImpl::s_hashTable 2
+ x SVGPathSegLinetoHorizontalAbsImpl::X DontDelete
+@end
+*/
+
+Value SVGPathSegLinetoHorizontalAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegLinetoHorizontalAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+
+
+SVGPathSegLinetoHorizontalRelImpl::SVGPathSegLinetoHorizontalRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegLinetoHorizontalRelImpl::~SVGPathSegLinetoHorizontalRelImpl()
+{
+}
+
+void SVGPathSegLinetoHorizontalRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegLinetoHorizontalRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegLinetoHorizontalRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ Q_UNUSED(curx);
+ Q_UNUSED(cury);
+ double dx = x();
+ double dy = 0;
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegLinetoHorizontalRelImpl::s_hashTable 2
+ x SVGPathSegLinetoHorizontalRelImpl::X DontDelete
+@end
+*/
+
+Value SVGPathSegLinetoHorizontalRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegLinetoHorizontalRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegLinetoHorizontalImpl.h b/ksvg/impl/SVGPathSegLinetoHorizontalImpl.h
index 52355c5d..1fc9111a 100644
--- a/ksvg/impl/SVGPathSegLinetoHorizontalImpl.h
+++ b/ksvg/impl/SVGPathSegLinetoHorizontalImpl.h
@@ -95,5 +95,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegLinetoImpl.cc b/ksvg/impl/SVGPathSegLinetoImpl.cc
deleted file mode 100644
index 04203352..00000000
--- a/ksvg/impl/SVGPathSegLinetoImpl.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegLinetoImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegLinetoImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegLinetoAbsImpl::SVGPathSegLinetoAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegLinetoAbsImpl::~SVGPathSegLinetoAbsImpl()
-{
-}
-
-void SVGPathSegLinetoAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegLinetoAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegLinetoAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegLinetoAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegLinetoAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegLinetoAbsImpl::s_hashTable 3
- x SVGPathSegLinetoAbsImpl::X DontDelete
- y SVGPathSegLinetoAbsImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegLinetoAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegLinetoAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-SVGPathSegLinetoRelImpl::SVGPathSegLinetoRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegLinetoRelImpl::~SVGPathSegLinetoRelImpl()
-{
-}
-
-void SVGPathSegLinetoRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegLinetoRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegLinetoRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegLinetoRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegLinetoRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- Q_UNUSED(curx);
- Q_UNUSED(cury);
- double dx = x();
- double dy = y();
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegLinetoRelImpl::s_hashTable 3
- x SVGPathSegLinetoRelImpl::X DontDelete
- y SVGPathSegLinetoRelImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegLinetoRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegLinetoRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegLinetoImpl.cpp b/ksvg/impl/SVGPathSegLinetoImpl.cpp
new file mode 100644
index 00000000..c47b6fcc
--- /dev/null
+++ b/ksvg/impl/SVGPathSegLinetoImpl.cpp
@@ -0,0 +1,194 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegLinetoImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegLinetoImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegLinetoAbsImpl::SVGPathSegLinetoAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegLinetoAbsImpl::~SVGPathSegLinetoAbsImpl()
+{
+}
+
+void SVGPathSegLinetoAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegLinetoAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegLinetoAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegLinetoAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegLinetoAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegLinetoAbsImpl::s_hashTable 3
+ x SVGPathSegLinetoAbsImpl::X DontDelete
+ y SVGPathSegLinetoAbsImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegLinetoAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegLinetoAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+SVGPathSegLinetoRelImpl::SVGPathSegLinetoRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegLinetoRelImpl::~SVGPathSegLinetoRelImpl()
+{
+}
+
+void SVGPathSegLinetoRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegLinetoRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegLinetoRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegLinetoRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegLinetoRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ Q_UNUSED(curx);
+ Q_UNUSED(cury);
+ double dx = x();
+ double dy = y();
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegLinetoRelImpl::s_hashTable 3
+ x SVGPathSegLinetoRelImpl::X DontDelete
+ y SVGPathSegLinetoRelImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegLinetoRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegLinetoRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegLinetoImpl.h b/ksvg/impl/SVGPathSegLinetoImpl.h
index 78df51b9..5d77f816 100644
--- a/ksvg/impl/SVGPathSegLinetoImpl.h
+++ b/ksvg/impl/SVGPathSegLinetoImpl.h
@@ -103,5 +103,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegLinetoVerticalImpl.cc b/ksvg/impl/SVGPathSegLinetoVerticalImpl.cc
deleted file mode 100644
index 0eca1280..00000000
--- a/ksvg/impl/SVGPathSegLinetoVerticalImpl.cc
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegLinetoVerticalImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegLinetoVerticalImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegLinetoVerticalAbsImpl::SVGPathSegLinetoVerticalAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegLinetoVerticalAbsImpl::~SVGPathSegLinetoVerticalAbsImpl()
-{
-}
-
-void SVGPathSegLinetoVerticalAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegLinetoVerticalAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegLinetoVerticalAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- Q_UNUSED(curx);
- double dx = 0;
- double dy = y() - cury;
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegLinetoVerticalAbsImpl::s_hashTable 2
- y SVGPathSegLinetoVerticalAbsImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegLinetoVerticalAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegLinetoVerticalAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-SVGPathSegLinetoVerticalRelImpl::SVGPathSegLinetoVerticalRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegLinetoVerticalRelImpl::~SVGPathSegLinetoVerticalRelImpl()
-{
-}
-
-void SVGPathSegLinetoVerticalRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegLinetoVerticalRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegLinetoVerticalRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- Q_UNUSED(curx);
- Q_UNUSED(cury);
- double dx = 0;
- double dy = y();
- double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
- double endSlope = startSlope;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegLinetoVerticalRelImpl::s_hashTable 2
- y SVGPathSegLinetoVerticalRelImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegLinetoVerticalRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegLinetoVerticalRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegLinetoVerticalImpl.cpp b/ksvg/impl/SVGPathSegLinetoVerticalImpl.cpp
new file mode 100644
index 00000000..47ced875
--- /dev/null
+++ b/ksvg/impl/SVGPathSegLinetoVerticalImpl.cpp
@@ -0,0 +1,163 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegLinetoVerticalImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegLinetoVerticalImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegLinetoVerticalAbsImpl::SVGPathSegLinetoVerticalAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegLinetoVerticalAbsImpl::~SVGPathSegLinetoVerticalAbsImpl()
+{
+}
+
+void SVGPathSegLinetoVerticalAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegLinetoVerticalAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegLinetoVerticalAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ Q_UNUSED(curx);
+ double dx = 0;
+ double dy = y() - cury;
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegLinetoVerticalAbsImpl::s_hashTable 2
+ y SVGPathSegLinetoVerticalAbsImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegLinetoVerticalAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegLinetoVerticalAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+SVGPathSegLinetoVerticalRelImpl::SVGPathSegLinetoVerticalRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegLinetoVerticalRelImpl::~SVGPathSegLinetoVerticalRelImpl()
+{
+}
+
+void SVGPathSegLinetoVerticalRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegLinetoVerticalRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegLinetoVerticalRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ Q_UNUSED(curx);
+ Q_UNUSED(cury);
+ double dx = 0;
+ double dy = y();
+ double startSlope = SVGAngleImpl::todeg(atan2(dy, dx));
+ double endSlope = startSlope;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegLinetoVerticalRelImpl::s_hashTable 2
+ y SVGPathSegLinetoVerticalRelImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegLinetoVerticalRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegLinetoVerticalRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegLinetoVerticalImpl.h b/ksvg/impl/SVGPathSegLinetoVerticalImpl.h
index 1bbf41f4..14c7890e 100644
--- a/ksvg/impl/SVGPathSegLinetoVerticalImpl.h
+++ b/ksvg/impl/SVGPathSegLinetoVerticalImpl.h
@@ -95,5 +95,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegListImpl.cc b/ksvg/impl/SVGPathSegListImpl.cc
deleted file mode 100644
index ee316938..00000000
--- a/ksvg/impl/SVGPathSegListImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegListImpl::s_hashTable 2
- numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGPathSegListImplProto::s_hashTable 11
- getItem SVGListDefs::GetItem DontDelete|Function 1
- removeItem SVGListDefs::RemoveItem DontDelete|Function 1
- appendItem SVGListDefs::AppendItem DontDelete|Function 1
- initialize SVGListDefs::Initialize DontDelete|Function 1
- insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
- replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
- clear SVGListDefs::Clear DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGPathSegList", SVGPathSegListImplProto, SVGPathSegListImplProtoFunc)
-
-Value SVGPathSegListImpl::getValueProperty(ExecState *exec, int token) const
-{
- return SVGList<SVGPathSegImpl>::getValueProperty(exec, token);
-}
-
-Value SVGPathSegListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGPathSegListImpl)
-
- return obj->call(exec, static_cast<SVGList<SVGPathSegImpl> *>(obj), args, id);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegListImpl.cpp b/ksvg/impl/SVGPathSegListImpl.cpp
new file mode 100644
index 00000000..7e3ff83e
--- /dev/null
+++ b/ksvg/impl/SVGPathSegListImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegListImpl::s_hashTable 2
+ numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGPathSegListImplProto::s_hashTable 11
+ getItem SVGListDefs::GetItem DontDelete|Function 1
+ removeItem SVGListDefs::RemoveItem DontDelete|Function 1
+ appendItem SVGListDefs::AppendItem DontDelete|Function 1
+ initialize SVGListDefs::Initialize DontDelete|Function 1
+ insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
+ replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
+ clear SVGListDefs::Clear DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGPathSegList", SVGPathSegListImplProto, SVGPathSegListImplProtoFunc)
+
+Value SVGPathSegListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ return SVGList<SVGPathSegImpl>::getValueProperty(exec, token);
+}
+
+Value SVGPathSegListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGPathSegListImpl)
+
+ return obj->call(exec, static_cast<SVGList<SVGPathSegImpl> *>(obj), args, id);
+}
diff --git a/ksvg/impl/SVGPathSegListImpl.h b/ksvg/impl/SVGPathSegListImpl.h
index ef9c8c6e..d2681054 100644
--- a/ksvg/impl/SVGPathSegListImpl.h
+++ b/ksvg/impl/SVGPathSegListImpl.h
@@ -44,5 +44,3 @@ KSVG_DEFINE_PROTOTYPE(SVGPathSegListImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGPathSegListImplProtoFunc, SVGPathSegListImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegMovetoImpl.cc b/ksvg/impl/SVGPathSegMovetoImpl.cc
deleted file mode 100644
index 2eb64b41..00000000
--- a/ksvg/impl/SVGPathSegMovetoImpl.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPathSegMovetoImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPathSegMovetoImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGPathSegMovetoAbsImpl::SVGPathSegMovetoAbsImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegMovetoAbsImpl::~SVGPathSegMovetoAbsImpl()
-{
-}
-
-void SVGPathSegMovetoAbsImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegMovetoAbsImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegMovetoAbsImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegMovetoAbsImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegMovetoAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- double dx = x() - curx;
- double dy = y() - cury;
- double startSlope = 0;
- double endSlope = 0;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegMovetoAbsImpl::s_hashTable 3
- x SVGPathSegMovetoAbsImpl::X DontDelete
- y SVGPathSegMovetoAbsImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegMovetoAbsImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegMovetoAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-
-
-SVGPathSegMovetoRelImpl::SVGPathSegMovetoRelImpl() : SVGPathSegImpl()
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGPathSegMovetoRelImpl::~SVGPathSegMovetoRelImpl()
-{
-}
-
-void SVGPathSegMovetoRelImpl::setX(const double &x)
-{
- m_x = x;
-}
-
-double SVGPathSegMovetoRelImpl::x() const
-{
- return m_x;
-}
-
-void SVGPathSegMovetoRelImpl::setY(const double &y)
-{
- m_y = y;
-}
-
-double SVGPathSegMovetoRelImpl::y() const
-{
- return m_y;
-}
-
-void SVGPathSegMovetoRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
-{
- Q_UNUSED(curx);
- Q_UNUSED(cury);
- double dx = x();
- double dy = y();
- double startSlope = 0;
- double endSlope = 0;
- *pdx = dx;
- *pdy = dy;
- *pstartSlope = startSlope;
- *pendSlope = endSlope;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPathSegMovetoRelImpl::s_hashTable 3
- x SVGPathSegMovetoRelImpl::X DontDelete
- y SVGPathSegMovetoRelImpl::Y DontDelete
-@end
-*/
-
-Value SVGPathSegMovetoRelImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPathSegMovetoRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPathSegMovetoImpl.cpp b/ksvg/impl/SVGPathSegMovetoImpl.cpp
new file mode 100644
index 00000000..0cafbc25
--- /dev/null
+++ b/ksvg/impl/SVGPathSegMovetoImpl.cpp
@@ -0,0 +1,194 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPathSegMovetoImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPathSegMovetoImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGPathSegMovetoAbsImpl::SVGPathSegMovetoAbsImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegMovetoAbsImpl::~SVGPathSegMovetoAbsImpl()
+{
+}
+
+void SVGPathSegMovetoAbsImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegMovetoAbsImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegMovetoAbsImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegMovetoAbsImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegMovetoAbsImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ double dx = x() - curx;
+ double dy = y() - cury;
+ double startSlope = 0;
+ double endSlope = 0;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegMovetoAbsImpl::s_hashTable 3
+ x SVGPathSegMovetoAbsImpl::X DontDelete
+ y SVGPathSegMovetoAbsImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegMovetoAbsImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegMovetoAbsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+
+
+SVGPathSegMovetoRelImpl::SVGPathSegMovetoRelImpl() : SVGPathSegImpl()
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGPathSegMovetoRelImpl::~SVGPathSegMovetoRelImpl()
+{
+}
+
+void SVGPathSegMovetoRelImpl::setX(const double &x)
+{
+ m_x = x;
+}
+
+double SVGPathSegMovetoRelImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPathSegMovetoRelImpl::setY(const double &y)
+{
+ m_y = y;
+}
+
+double SVGPathSegMovetoRelImpl::y() const
+{
+ return m_y;
+}
+
+void SVGPathSegMovetoRelImpl::getDeltasAndSlopes(double curx, double cury, double *pdx, double *pdy, double *pstartSlope, double *pendSlope) const
+{
+ Q_UNUSED(curx);
+ Q_UNUSED(cury);
+ double dx = x();
+ double dy = y();
+ double startSlope = 0;
+ double endSlope = 0;
+ *pdx = dx;
+ *pdy = dy;
+ *pstartSlope = startSlope;
+ *pendSlope = endSlope;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPathSegMovetoRelImpl::s_hashTable 3
+ x SVGPathSegMovetoRelImpl::X DontDelete
+ y SVGPathSegMovetoRelImpl::Y DontDelete
+@end
+*/
+
+Value SVGPathSegMovetoRelImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPathSegMovetoRelImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPathSegMovetoImpl.h b/ksvg/impl/SVGPathSegMovetoImpl.h
index 6db95702..669aa010 100644
--- a/ksvg/impl/SVGPathSegMovetoImpl.h
+++ b/ksvg/impl/SVGPathSegMovetoImpl.h
@@ -103,5 +103,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPatternElementImpl.cc b/ksvg/impl/SVGPatternElementImpl.cpp
index 37825869..37825869 100644
--- a/ksvg/impl/SVGPatternElementImpl.cc
+++ b/ksvg/impl/SVGPatternElementImpl.cpp
diff --git a/ksvg/impl/SVGPatternElementImpl.h b/ksvg/impl/SVGPatternElementImpl.h
index 0c9abc8e..fb1f0128 100644
--- a/ksvg/impl/SVGPatternElementImpl.h
+++ b/ksvg/impl/SVGPatternElementImpl.h
@@ -132,5 +132,3 @@ KSVG_REGISTER_ELEMENT(SVGPatternElementImpl, "pattern")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPointImpl.cc b/ksvg/impl/SVGPointImpl.cc
deleted file mode 100644
index c3697f58..00000000
--- a/ksvg/impl/SVGPointImpl.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPointImpl.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPointImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGPointImpl::SVGPointImpl() : DOM::DomShared()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = 0;
- m_y = 0;
-}
-
-SVGPointImpl::~SVGPointImpl()
-{
-}
-
-void SVGPointImpl::setX(float x)
-{
- m_x = x;
-}
-
-float SVGPointImpl::x() const
-{
- return m_x;
-}
-
-void SVGPointImpl::setY(float y)
-{
- m_y = y;
-}
-
-float SVGPointImpl::y() const
-{
- return m_y;
-}
-
-SVGPointImpl *SVGPointImpl::matrixTransform(const SVGMatrixImpl &)
-{
- SVGPointImpl *ret = SVGSVGElementImpl::createSVGPoint();
- return ret;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPointImpl::s_hashTable 3
- x SVGPointImpl::X DontDelete
- y SVGPointImpl::Y DontDelete
-@end
-*/
-
-Value SVGPointImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(x());
- case Y:
- return Number(y());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGPointImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPointImpl.cpp b/ksvg/impl/SVGPointImpl.cpp
new file mode 100644
index 00000000..ebce509a
--- /dev/null
+++ b/ksvg/impl/SVGPointImpl.cpp
@@ -0,0 +1,106 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPointImpl.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPointImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGPointImpl::SVGPointImpl() : DOM::DomShared()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = 0;
+ m_y = 0;
+}
+
+SVGPointImpl::~SVGPointImpl()
+{
+}
+
+void SVGPointImpl::setX(float x)
+{
+ m_x = x;
+}
+
+float SVGPointImpl::x() const
+{
+ return m_x;
+}
+
+void SVGPointImpl::setY(float y)
+{
+ m_y = y;
+}
+
+float SVGPointImpl::y() const
+{
+ return m_y;
+}
+
+SVGPointImpl *SVGPointImpl::matrixTransform(const SVGMatrixImpl &)
+{
+ SVGPointImpl *ret = SVGSVGElementImpl::createSVGPoint();
+ return ret;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPointImpl::s_hashTable 3
+ x SVGPointImpl::X DontDelete
+ y SVGPointImpl::Y DontDelete
+@end
+*/
+
+Value SVGPointImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(x());
+ case Y:
+ return Number(y());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGPointImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGPointListImpl.cc b/ksvg/impl/SVGPointListImpl.cc
deleted file mode 100644
index 34574b60..00000000
--- a/ksvg/impl/SVGPointListImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPointListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPointListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPointListImpl::s_hashTable 2
- numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGPointListImplProto::s_hashTable 11
- getItem SVGListDefs::GetItem DontDelete|Function 1
- removeItem SVGListDefs::RemoveItem DontDelete|Function 1
- appendItem SVGListDefs::AppendItem DontDelete|Function 1
- initialize SVGListDefs::Initialize DontDelete|Function 1
- insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
- replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
- clear SVGListDefs::Clear DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGPointList", SVGPointListImplProto, SVGPointListImplProtoFunc)
-
-Value SVGPointListImpl::getValueProperty(ExecState *exec, int token) const
-{
- return SVGList<SVGPointImpl>::getValueProperty(exec, token);
-}
-
-Value SVGPointListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGPointListImpl)
-
- return obj->call(exec, static_cast<SVGList<SVGPointImpl> *>(obj), args, id);
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPointListImpl.cpp b/ksvg/impl/SVGPointListImpl.cpp
new file mode 100644
index 00000000..ba492c32
--- /dev/null
+++ b/ksvg/impl/SVGPointListImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPointListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPointListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPointListImpl::s_hashTable 2
+ numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGPointListImplProto::s_hashTable 11
+ getItem SVGListDefs::GetItem DontDelete|Function 1
+ removeItem SVGListDefs::RemoveItem DontDelete|Function 1
+ appendItem SVGListDefs::AppendItem DontDelete|Function 1
+ initialize SVGListDefs::Initialize DontDelete|Function 1
+ insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
+ replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
+ clear SVGListDefs::Clear DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGPointList", SVGPointListImplProto, SVGPointListImplProtoFunc)
+
+Value SVGPointListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ return SVGList<SVGPointImpl>::getValueProperty(exec, token);
+}
+
+Value SVGPointListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGPointListImpl)
+
+ return obj->call(exec, static_cast<SVGList<SVGPointImpl> *>(obj), args, id);
+}
diff --git a/ksvg/impl/SVGPointListImpl.h b/ksvg/impl/SVGPointListImpl.h
index 61d93731..17280dfa 100644
--- a/ksvg/impl/SVGPointListImpl.h
+++ b/ksvg/impl/SVGPointListImpl.h
@@ -44,5 +44,3 @@ KSVG_DEFINE_PROTOTYPE(SVGPointListImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGPointListImplProtoFunc, SVGPointListImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPolyElementImpl.cc b/ksvg/impl/SVGPolyElementImpl.cc
deleted file mode 100644
index 69ef57cd..00000000
--- a/ksvg/impl/SVGPolyElementImpl.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <math.h>
-#include <cfloat>
-
-#include <kdebug.h>
-
-#include "SVGRectImpl.h"
-#include "SVGPointListImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGPolyElementImpl.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-SVGPolyElementImpl::SVGPolyElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl(), SVGAnimatedPointsImpl()
-{
-}
-
-SVGPolyElementImpl::~SVGPolyElementImpl()
-{
-}
-
-SVGRectImpl *SVGPolyElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
-
- unsigned int nrPoints = points()->numberOfItems();
- float minx, miny, maxx, maxy, tempx, tempy;
- minx = points()->getItem(0)->x();
- miny = points()->getItem(0)->y();
- maxx = points()->getItem(0)->x();
- maxy = points()->getItem(0)->y();
-
- for(unsigned int i = 1; i < nrPoints; ++i)
- {
- tempx = points()->getItem(i)->x();
- tempy = points()->getItem(i)->y();
-
- if(tempx < minx)
- minx = tempx;
- if(tempx > maxx)
- maxx = tempx;
- if(tempy < miny)
- miny = tempy;
- if(tempy > maxy)
- maxy = tempy;
- }
-
- ret->setX(minx);
- ret->setY(miny);
- ret->setWidth(maxx - minx);
- ret->setHeight(maxy - miny);
- return ret;
-}
-
-bool SVGPolyElementImpl::findOutSlope(unsigned int point, double *outSlope) const
-{
- unsigned int nextPoint;
-
- if(point == points()->numberOfItems() - 1)
- {
- if(m_isOpenPath)
- return false;
- else
- nextPoint = 0;
- }
- else
- nextPoint = point + 1;
-
- if(point == nextPoint)
- return false;
-
- double x = points()->getItem(point)->x();
- double y = points()->getItem(point)->y();
- double nextX = points()->getItem(nextPoint)->x();
- double nextY = points()->getItem(nextPoint)->y();
- const double epsilon = DBL_EPSILON;
-
- if(fabs(x - nextX) < epsilon && fabs(y - nextY) < epsilon)
- return findOutSlope(nextPoint, outSlope);
- else
- {
- double slope = SVGAngleImpl::todeg(atan2(nextY - y, nextX - x));
- *outSlope = slope;
- return true;
- }
-}
-
-bool SVGPolyElementImpl::findInSlope(unsigned int point, double *inSlope) const
-{
- unsigned int prevPoint;
-
- if(point == 0)
- {
- if(m_isOpenPath)
- return false;
- else
- prevPoint = points()->numberOfItems() - 1;
- }
- else
- prevPoint = point - 1;
-
- if(point == prevPoint)
- return false;
-
- double x = points()->getItem(point)->x();
- double y = points()->getItem(point)->y();
- double prevX = points()->getItem(prevPoint)->x();
- double prevY = points()->getItem(prevPoint)->y();
- const double epsilon = DBL_EPSILON;
-
- if(fabs(x - prevX) < epsilon && fabs(y - prevY) < epsilon)
- return findInSlope(prevPoint, inSlope);
- else
- {
- double slope = SVGAngleImpl::todeg(atan2(y - prevY, x - prevX));
- *inSlope = slope;
- return true;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPolyElementImpl.cpp b/ksvg/impl/SVGPolyElementImpl.cpp
new file mode 100644
index 00000000..b1557aa3
--- /dev/null
+++ b/ksvg/impl/SVGPolyElementImpl.cpp
@@ -0,0 +1,139 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <math.h>
+#include <cfloat>
+
+#include <kdebug.h>
+
+#include "SVGRectImpl.h"
+#include "SVGPointListImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGPolyElementImpl.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+SVGPolyElementImpl::SVGPolyElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl(), SVGAnimatedPointsImpl()
+{
+}
+
+SVGPolyElementImpl::~SVGPolyElementImpl()
+{
+}
+
+SVGRectImpl *SVGPolyElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+
+ unsigned int nrPoints = points()->numberOfItems();
+ float minx, miny, maxx, maxy, tempx, tempy;
+ minx = points()->getItem(0)->x();
+ miny = points()->getItem(0)->y();
+ maxx = points()->getItem(0)->x();
+ maxy = points()->getItem(0)->y();
+
+ for(unsigned int i = 1; i < nrPoints; ++i)
+ {
+ tempx = points()->getItem(i)->x();
+ tempy = points()->getItem(i)->y();
+
+ if(tempx < minx)
+ minx = tempx;
+ if(tempx > maxx)
+ maxx = tempx;
+ if(tempy < miny)
+ miny = tempy;
+ if(tempy > maxy)
+ maxy = tempy;
+ }
+
+ ret->setX(minx);
+ ret->setY(miny);
+ ret->setWidth(maxx - minx);
+ ret->setHeight(maxy - miny);
+ return ret;
+}
+
+bool SVGPolyElementImpl::findOutSlope(unsigned int point, double *outSlope) const
+{
+ unsigned int nextPoint;
+
+ if(point == points()->numberOfItems() - 1)
+ {
+ if(m_isOpenPath)
+ return false;
+ else
+ nextPoint = 0;
+ }
+ else
+ nextPoint = point + 1;
+
+ if(point == nextPoint)
+ return false;
+
+ double x = points()->getItem(point)->x();
+ double y = points()->getItem(point)->y();
+ double nextX = points()->getItem(nextPoint)->x();
+ double nextY = points()->getItem(nextPoint)->y();
+ const double epsilon = DBL_EPSILON;
+
+ if(fabs(x - nextX) < epsilon && fabs(y - nextY) < epsilon)
+ return findOutSlope(nextPoint, outSlope);
+ else
+ {
+ double slope = SVGAngleImpl::todeg(atan2(nextY - y, nextX - x));
+ *outSlope = slope;
+ return true;
+ }
+}
+
+bool SVGPolyElementImpl::findInSlope(unsigned int point, double *inSlope) const
+{
+ unsigned int prevPoint;
+
+ if(point == 0)
+ {
+ if(m_isOpenPath)
+ return false;
+ else
+ prevPoint = points()->numberOfItems() - 1;
+ }
+ else
+ prevPoint = point - 1;
+
+ if(point == prevPoint)
+ return false;
+
+ double x = points()->getItem(point)->x();
+ double y = points()->getItem(point)->y();
+ double prevX = points()->getItem(prevPoint)->x();
+ double prevY = points()->getItem(prevPoint)->y();
+ const double epsilon = DBL_EPSILON;
+
+ if(fabs(x - prevX) < epsilon && fabs(y - prevY) < epsilon)
+ return findInSlope(prevPoint, inSlope);
+ else
+ {
+ double slope = SVGAngleImpl::todeg(atan2(y - prevY, x - prevX));
+ *inSlope = slope;
+ return true;
+ }
+}
diff --git a/ksvg/impl/SVGPolyElementImpl.h b/ksvg/impl/SVGPolyElementImpl.h
index ded41d0c..15e9234f 100644
--- a/ksvg/impl/SVGPolyElementImpl.h
+++ b/ksvg/impl/SVGPolyElementImpl.h
@@ -66,5 +66,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPolygonElementImpl.cc b/ksvg/impl/SVGPolygonElementImpl.cc
deleted file mode 100644
index bf38ff37..00000000
--- a/ksvg/impl/SVGPolygonElementImpl.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPointListImpl.h"
-#include "SVGPolygonElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "KSVGCanvas.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-SVGPolygonElementImpl::SVGPolygonElementImpl(DOM::ElementImpl *impl) : SVGPolyElementImpl(impl)
-{
- m_isOpenPath = false;
-}
-
-void SVGPolygonElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createPolygon(this);
- c->insert(m_item);
- }
-}
-
-void SVGPolygonElementImpl::drawMarkers()
-{
- SVGPointListImpl *pts = points();
- unsigned int nrPoints = pts->numberOfItems();
-
- if(nrPoints > 0 && hasMarkers())
- {
- for(unsigned int i = 0; i < nrPoints; ++i)
- {
- double inSlope;
- double outSlope;
- bool haveInSlope = findInSlope(i, &inSlope);
- bool haveOutSlope = findOutSlope(i, &outSlope);
-
- if(!haveInSlope && haveOutSlope)
- inSlope = outSlope;
- else if(haveInSlope && !haveOutSlope)
- outSlope = inSlope;
- else if(!haveInSlope && !haveOutSlope)
- {
- inSlope = 0;
- outSlope = 0;
- }
-
- double bisector = SVGAngleImpl::shortestArcBisector(inSlope, outSlope);
-
- if(i == 0)
- {
- if(hasStartMarker())
- doStartMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
- if(hasEndMarker())
- doEndMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
- }
- else
- {
- if(hasMidMarker())
- doMidMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
- }
- }
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPolygonElementImpl.cpp b/ksvg/impl/SVGPolygonElementImpl.cpp
new file mode 100644
index 00000000..0187ce43
--- /dev/null
+++ b/ksvg/impl/SVGPolygonElementImpl.cpp
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPointListImpl.h"
+#include "SVGPolygonElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "KSVGCanvas.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+SVGPolygonElementImpl::SVGPolygonElementImpl(DOM::ElementImpl *impl) : SVGPolyElementImpl(impl)
+{
+ m_isOpenPath = false;
+}
+
+void SVGPolygonElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createPolygon(this);
+ c->insert(m_item);
+ }
+}
+
+void SVGPolygonElementImpl::drawMarkers()
+{
+ SVGPointListImpl *pts = points();
+ unsigned int nrPoints = pts->numberOfItems();
+
+ if(nrPoints > 0 && hasMarkers())
+ {
+ for(unsigned int i = 0; i < nrPoints; ++i)
+ {
+ double inSlope;
+ double outSlope;
+ bool haveInSlope = findInSlope(i, &inSlope);
+ bool haveOutSlope = findOutSlope(i, &outSlope);
+
+ if(!haveInSlope && haveOutSlope)
+ inSlope = outSlope;
+ else if(haveInSlope && !haveOutSlope)
+ outSlope = inSlope;
+ else if(!haveInSlope && !haveOutSlope)
+ {
+ inSlope = 0;
+ outSlope = 0;
+ }
+
+ double bisector = SVGAngleImpl::shortestArcBisector(inSlope, outSlope);
+
+ if(i == 0)
+ {
+ if(hasStartMarker())
+ doStartMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
+ if(hasEndMarker())
+ doEndMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
+ }
+ else
+ {
+ if(hasMidMarker())
+ doMidMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
+ }
+ }
+ }
+}
diff --git a/ksvg/impl/SVGPolygonElementImpl.h b/ksvg/impl/SVGPolygonElementImpl.h
index 1c7e8c3b..af1edd77 100644
--- a/ksvg/impl/SVGPolygonElementImpl.h
+++ b/ksvg/impl/SVGPolygonElementImpl.h
@@ -50,5 +50,3 @@ KSVG_REGISTER_ELEMENT(SVGPolygonElementImpl, "polygon")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPolylineElementImpl.cc b/ksvg/impl/SVGPolylineElementImpl.cc
deleted file mode 100644
index 9c95a928..00000000
--- a/ksvg/impl/SVGPolylineElementImpl.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGPointListImpl.h"
-#include "SVGPolylineElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "KSVGCanvas.h"
-#include "SVGAngleImpl.h"
-
-using namespace KSVG;
-
-SVGPolylineElementImpl::SVGPolylineElementImpl(DOM::ElementImpl *impl) : SVGPolyElementImpl(impl)
-{
- m_isOpenPath = true;
-}
-
-void SVGPolylineElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createPolyline(this);
- c->insert(m_item);
- }
-}
-
-void SVGPolylineElementImpl::drawMarkers()
-{
- SVGPointListImpl *pts = points();
- unsigned int nrPoints = pts->numberOfItems();
-
- if(nrPoints > 0 && hasMarkers())
- {
- if(hasStartMarker())
- {
- double outSlope;
-
- if(!findOutSlope(0, &outSlope))
- outSlope = 0;
-
- doStartMarker(this, this, pts->getItem(0)->x(), pts->getItem(0)->y(), outSlope);
- }
-
- if(hasMidMarker())
- {
- for(unsigned int i = 1; i < nrPoints - 1; ++i)
- {
- double inSlope;
- double outSlope;
- bool haveInSlope = findInSlope(i, &inSlope);
- bool haveOutSlope = findOutSlope(i, &outSlope);
-
- if(!haveInSlope && haveOutSlope)
- inSlope = outSlope;
- else if(haveInSlope && !haveOutSlope)
- outSlope = inSlope;
- else if(!haveInSlope && !haveOutSlope)
- {
- inSlope = 0;
- outSlope = 0;
- }
-
- double bisector = SVGAngleImpl::shortestArcBisector(inSlope, outSlope);
-
- doMidMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
- }
- }
-
- if(hasEndMarker())
- {
- double inSlope;
-
- if(!findInSlope(nrPoints - 1, &inSlope))
- inSlope = 0;
-
- doEndMarker(this, this, pts->getItem(nrPoints - 1)->x(), pts->getItem(nrPoints - 1)->y(), inSlope);
- }
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPolylineElementImpl.cpp b/ksvg/impl/SVGPolylineElementImpl.cpp
new file mode 100644
index 00000000..487f2630
--- /dev/null
+++ b/ksvg/impl/SVGPolylineElementImpl.cpp
@@ -0,0 +1,98 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGPointListImpl.h"
+#include "SVGPolylineElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "KSVGCanvas.h"
+#include "SVGAngleImpl.h"
+
+using namespace KSVG;
+
+SVGPolylineElementImpl::SVGPolylineElementImpl(DOM::ElementImpl *impl) : SVGPolyElementImpl(impl)
+{
+ m_isOpenPath = true;
+}
+
+void SVGPolylineElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createPolyline(this);
+ c->insert(m_item);
+ }
+}
+
+void SVGPolylineElementImpl::drawMarkers()
+{
+ SVGPointListImpl *pts = points();
+ unsigned int nrPoints = pts->numberOfItems();
+
+ if(nrPoints > 0 && hasMarkers())
+ {
+ if(hasStartMarker())
+ {
+ double outSlope;
+
+ if(!findOutSlope(0, &outSlope))
+ outSlope = 0;
+
+ doStartMarker(this, this, pts->getItem(0)->x(), pts->getItem(0)->y(), outSlope);
+ }
+
+ if(hasMidMarker())
+ {
+ for(unsigned int i = 1; i < nrPoints - 1; ++i)
+ {
+ double inSlope;
+ double outSlope;
+ bool haveInSlope = findInSlope(i, &inSlope);
+ bool haveOutSlope = findOutSlope(i, &outSlope);
+
+ if(!haveInSlope && haveOutSlope)
+ inSlope = outSlope;
+ else if(haveInSlope && !haveOutSlope)
+ outSlope = inSlope;
+ else if(!haveInSlope && !haveOutSlope)
+ {
+ inSlope = 0;
+ outSlope = 0;
+ }
+
+ double bisector = SVGAngleImpl::shortestArcBisector(inSlope, outSlope);
+
+ doMidMarker(this, this, pts->getItem(i)->x(), pts->getItem(i)->y(), bisector);
+ }
+ }
+
+ if(hasEndMarker())
+ {
+ double inSlope;
+
+ if(!findInSlope(nrPoints - 1, &inSlope))
+ inSlope = 0;
+
+ doEndMarker(this, this, pts->getItem(nrPoints - 1)->x(), pts->getItem(nrPoints - 1)->y(), inSlope);
+ }
+ }
+}
diff --git a/ksvg/impl/SVGPolylineElementImpl.h b/ksvg/impl/SVGPolylineElementImpl.h
index c6ea5885..8a51dd74 100644
--- a/ksvg/impl/SVGPolylineElementImpl.h
+++ b/ksvg/impl/SVGPolylineElementImpl.h
@@ -50,5 +50,3 @@ KSVG_REGISTER_ELEMENT(SVGPolylineElementImpl, "polyline")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPreserveAspectRatioImpl.cc b/ksvg/impl/SVGPreserveAspectRatioImpl.cc
deleted file mode 100644
index f9e95405..00000000
--- a/ksvg/impl/SVGPreserveAspectRatioImpl.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqstring.h>
-#include <tqstringlist.h>
-
-#include "SVGPreserveAspectRatio.h"
-
-#include "SVGMatrixImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGPreserveAspectRatioImpl.h"
-
-using namespace KSVG;
-
-#include "SVGPreserveAspectRatioImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_meetOrSlice = SVG_MEETORSLICE_UNKNOWN;
- m_align = SVG_PRESERVEASPECTRATIO_UNKNOWN;
-}
-
-SVGPreserveAspectRatioImpl::~SVGPreserveAspectRatioImpl()
-{
-}
-
-void SVGPreserveAspectRatioImpl::setAlign(unsigned short align)
-{
- m_align = align;
-}
-
-unsigned short SVGPreserveAspectRatioImpl::align() const
-{
- return m_align;
-}
-
-void SVGPreserveAspectRatioImpl::setMeetOrSlice(unsigned short meetOrSlice)
-{
- m_meetOrSlice = meetOrSlice;
-}
-
-unsigned short SVGPreserveAspectRatioImpl::meetOrSlice() const
-{
- return m_meetOrSlice;
-}
-
-void SVGPreserveAspectRatioImpl::parsePreserveAspectRatio(const TQString &str)
-{
- // Spec: set the defaults
- setAlign(SVG_PRESERVEASPECTRATIO_NONE);
- setMeetOrSlice(SVG_MEETORSLICE_MEET);
-
- TQStringList params = TQStringList::split(' ', str.simplifyWhiteSpace());
-
- if(params[0].compare("none") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_NONE;
- else if(params[0].compare("xMinYMin") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMINYMIN;
- else if(params[0].compare("xMidYMin") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMIDYMIN;
- else if(params[0].compare("xMaxYMin") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMAXYMIN;
- else if(params[0].compare("xMinYMid") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMINYMID;
- else if(params[0].compare("xMidYMid") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID;
- else if(params[0].compare("xMaxYMid") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMAXYMID;
- else if(params[0].compare("xMinYMax") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMINYMAX;
- else if(params[0].compare("xMidYMax") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMIDYMAX;
- else if(params[0].compare("xMaxYMax") == 0)
- m_align = SVG_PRESERVEASPECTRATIO_XMAXYMAX;
-
- if(params[1].compare("slice") == 0)
- m_meetOrSlice = SVG_MEETORSLICE_SLICE;
- else
- m_meetOrSlice = SVG_MEETORSLICE_MEET;
-}
-
-SVGMatrixImpl *SVGPreserveAspectRatioImpl::getCTM(float logicX, float logicY, float logicWidth, float logicHeight,
- float /*physX*/, float /*physY*/, float physWidth, float physHeight)
-{
- SVGMatrixImpl *temp = SVGSVGElementImpl::createSVGMatrix();
-
- if(align() == SVG_PRESERVEASPECTRATIO_UNKNOWN)
- return temp;
-
- float vpar = logicWidth / logicHeight;
- float svgar = physWidth / physHeight;
-
- if(align() == SVG_PRESERVEASPECTRATIO_NONE)
- {
- temp->scaleNonUniform(physWidth / logicWidth, physHeight / logicHeight);
- temp->translate(-logicX, -logicY);
- }
- else if(vpar < svgar && (meetOrSlice() == SVG_MEETORSLICE_MEET) || vpar >= svgar && (meetOrSlice() == SVG_MEETORSLICE_SLICE))
- {
- temp->scale(physHeight / logicHeight);
-
- if(align() == SVG_PRESERVEASPECTRATIO_XMINYMIN || align() == SVG_PRESERVEASPECTRATIO_XMINYMID || align() == SVG_PRESERVEASPECTRATIO_XMINYMAX)
- temp->translate(-logicX, -logicY);
- else if(align() == SVG_PRESERVEASPECTRATIO_XMIDYMIN || align() == SVG_PRESERVEASPECTRATIO_XMIDYMID || align() == SVG_PRESERVEASPECTRATIO_XMIDYMAX)
- temp->translate(-logicX - (logicWidth - physWidth * logicHeight / physHeight) / 2, -logicY);
- else
- temp->translate(-logicX - (logicWidth - physWidth * logicHeight / physHeight), -logicY);
- }
- else
- {
- temp->scale(physWidth / logicWidth);
-
- if(align() == SVG_PRESERVEASPECTRATIO_XMINYMIN || align() == SVG_PRESERVEASPECTRATIO_XMIDYMIN || align() == SVG_PRESERVEASPECTRATIO_XMAXYMIN)
- temp->translate(-logicX, -logicY);
- else if(align() == SVG_PRESERVEASPECTRATIO_XMINYMID || align() == SVG_PRESERVEASPECTRATIO_XMIDYMID || align() == SVG_PRESERVEASPECTRATIO_XMAXYMID)
- temp->translate(-logicX, -logicY - (logicHeight - physHeight * logicWidth / physWidth) / 2);
- else
- temp->translate(-logicX, -logicY - (logicHeight - physHeight * logicWidth / physWidth));
- }
-
- return temp;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGPreserveAspectRatioImpl::s_hashTable 3
- align SVGPreserveAspectRatioImpl::Align DontDelete
- meetOrSlice SVGPreserveAspectRatioImpl::MeetOrSlice DontDelete
-@end
-*/
-
-Value SVGPreserveAspectRatioImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Align:
- return Number(align());
- case MeetOrSlice:
- return Number(meetOrSlice());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-void SVGPreserveAspectRatioImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case Align:
- m_align = static_cast<unsigned short>(value.toNumber(exec));
- break;
- case MeetOrSlice:
- m_meetOrSlice = static_cast<unsigned short>(value.toNumber(exec));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-/*
-@namespace KSVG
-@begin SVGPreserveAspectRatioImplConstructor::s_hashTable 17
- SVG_PRESERVEASPECTRATIO_UNKNOWN KSVG::SVG_PRESERVEASPECTRATIO_UNKNOWN DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_NONE KSVG::SVG_PRESERVEASPECTRATIO_NONE DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMINYMIN KSVG::SVG_PRESERVEASPECTRATIO_XMINYMIN DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMIDYMIN KSVG::SVG_PRESERVEASPECTRATIO_XMIDYMIN DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMAXYMIN KSVG::SVG_PRESERVEASPECTRATIO_XMAXYMIN DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMINYMID KSVG::SVG_PRESERVEASPECTRATIO_XMINYMID DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMIDYMID KSVG::SVG_PRESERVEASPECTRATIO_XMIDYMID DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMAXYMID KSVG::SVG_PRESERVEASPECTRATIO_XMAXYMID DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMINYMAX KSVG::SVG_PRESERVEASPECTRATIO_XMINYMAX DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMIDYMAX KSVG::SVG_PRESERVEASPECTRATIO_XMIDYMAX DontDelete|ReadOnly
- SVG_PRESERVEASPECTRATIO_XMAXYMAX KSVG::SVG_PRESERVEASPECTRATIO_XMAXYMAX DontDelete|ReadOnly
- SVG_MEETORSLICE_UNKNOWN KSVG::SVG_MEETORSLICE_UNKNOWN DontDelete|ReadOnly
- SVG_MEETORSLICE_MEET KSVG::SVG_MEETORSLICE_MEET DontDelete|ReadOnly
- SVG_MEETORSLICE_SLICE KSVG::SVG_MEETORSLICE_SLICE DontDelete|ReadOnly
-@end
-*/
-
-Value SVGPreserveAspectRatioImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token > SVG_PRESERVEASPECTRATIO_XMAXYMAX ? token - SVG_MEETORSLICE_UNKNOWN : token);
-}
-
-Value KSVG::getSVGPreserveAspectRatioImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGPreserveAspectRatioImplConstructor>(exec, "[[svgpreserveaspectratio.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGPreserveAspectRatioImpl.cpp b/ksvg/impl/SVGPreserveAspectRatioImpl.cpp
new file mode 100644
index 00000000..bce71948
--- /dev/null
+++ b/ksvg/impl/SVGPreserveAspectRatioImpl.cpp
@@ -0,0 +1,215 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqstring.h>
+#include <tqstringlist.h>
+
+#include "SVGPreserveAspectRatio.h"
+
+#include "SVGMatrixImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGPreserveAspectRatioImpl.h"
+
+using namespace KSVG;
+
+#include "SVGPreserveAspectRatioImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_meetOrSlice = SVG_MEETORSLICE_UNKNOWN;
+ m_align = SVG_PRESERVEASPECTRATIO_UNKNOWN;
+}
+
+SVGPreserveAspectRatioImpl::~SVGPreserveAspectRatioImpl()
+{
+}
+
+void SVGPreserveAspectRatioImpl::setAlign(unsigned short align)
+{
+ m_align = align;
+}
+
+unsigned short SVGPreserveAspectRatioImpl::align() const
+{
+ return m_align;
+}
+
+void SVGPreserveAspectRatioImpl::setMeetOrSlice(unsigned short meetOrSlice)
+{
+ m_meetOrSlice = meetOrSlice;
+}
+
+unsigned short SVGPreserveAspectRatioImpl::meetOrSlice() const
+{
+ return m_meetOrSlice;
+}
+
+void SVGPreserveAspectRatioImpl::parsePreserveAspectRatio(const TQString &str)
+{
+ // Spec: set the defaults
+ setAlign(SVG_PRESERVEASPECTRATIO_NONE);
+ setMeetOrSlice(SVG_MEETORSLICE_MEET);
+
+ TQStringList params = TQStringList::split(' ', str.simplifyWhiteSpace());
+
+ if(params[0].compare("none") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_NONE;
+ else if(params[0].compare("xMinYMin") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMINYMIN;
+ else if(params[0].compare("xMidYMin") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMIDYMIN;
+ else if(params[0].compare("xMaxYMin") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMAXYMIN;
+ else if(params[0].compare("xMinYMid") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMINYMID;
+ else if(params[0].compare("xMidYMid") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMIDYMID;
+ else if(params[0].compare("xMaxYMid") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMAXYMID;
+ else if(params[0].compare("xMinYMax") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMINYMAX;
+ else if(params[0].compare("xMidYMax") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMIDYMAX;
+ else if(params[0].compare("xMaxYMax") == 0)
+ m_align = SVG_PRESERVEASPECTRATIO_XMAXYMAX;
+
+ if(params[1].compare("slice") == 0)
+ m_meetOrSlice = SVG_MEETORSLICE_SLICE;
+ else
+ m_meetOrSlice = SVG_MEETORSLICE_MEET;
+}
+
+SVGMatrixImpl *SVGPreserveAspectRatioImpl::getCTM(float logicX, float logicY, float logicWidth, float logicHeight,
+ float /*physX*/, float /*physY*/, float physWidth, float physHeight)
+{
+ SVGMatrixImpl *temp = SVGSVGElementImpl::createSVGMatrix();
+
+ if(align() == SVG_PRESERVEASPECTRATIO_UNKNOWN)
+ return temp;
+
+ float vpar = logicWidth / logicHeight;
+ float svgar = physWidth / physHeight;
+
+ if(align() == SVG_PRESERVEASPECTRATIO_NONE)
+ {
+ temp->scaleNonUniform(physWidth / logicWidth, physHeight / logicHeight);
+ temp->translate(-logicX, -logicY);
+ }
+ else if(vpar < svgar && (meetOrSlice() == SVG_MEETORSLICE_MEET) || vpar >= svgar && (meetOrSlice() == SVG_MEETORSLICE_SLICE))
+ {
+ temp->scale(physHeight / logicHeight);
+
+ if(align() == SVG_PRESERVEASPECTRATIO_XMINYMIN || align() == SVG_PRESERVEASPECTRATIO_XMINYMID || align() == SVG_PRESERVEASPECTRATIO_XMINYMAX)
+ temp->translate(-logicX, -logicY);
+ else if(align() == SVG_PRESERVEASPECTRATIO_XMIDYMIN || align() == SVG_PRESERVEASPECTRATIO_XMIDYMID || align() == SVG_PRESERVEASPECTRATIO_XMIDYMAX)
+ temp->translate(-logicX - (logicWidth - physWidth * logicHeight / physHeight) / 2, -logicY);
+ else
+ temp->translate(-logicX - (logicWidth - physWidth * logicHeight / physHeight), -logicY);
+ }
+ else
+ {
+ temp->scale(physWidth / logicWidth);
+
+ if(align() == SVG_PRESERVEASPECTRATIO_XMINYMIN || align() == SVG_PRESERVEASPECTRATIO_XMIDYMIN || align() == SVG_PRESERVEASPECTRATIO_XMAXYMIN)
+ temp->translate(-logicX, -logicY);
+ else if(align() == SVG_PRESERVEASPECTRATIO_XMINYMID || align() == SVG_PRESERVEASPECTRATIO_XMIDYMID || align() == SVG_PRESERVEASPECTRATIO_XMAXYMID)
+ temp->translate(-logicX, -logicY - (logicHeight - physHeight * logicWidth / physWidth) / 2);
+ else
+ temp->translate(-logicX, -logicY - (logicHeight - physHeight * logicWidth / physWidth));
+ }
+
+ return temp;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGPreserveAspectRatioImpl::s_hashTable 3
+ align SVGPreserveAspectRatioImpl::Align DontDelete
+ meetOrSlice SVGPreserveAspectRatioImpl::MeetOrSlice DontDelete
+@end
+*/
+
+Value SVGPreserveAspectRatioImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Align:
+ return Number(align());
+ case MeetOrSlice:
+ return Number(meetOrSlice());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+void SVGPreserveAspectRatioImpl::putValueProperty(ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case Align:
+ m_align = static_cast<unsigned short>(value.toNumber(exec));
+ break;
+ case MeetOrSlice:
+ m_meetOrSlice = static_cast<unsigned short>(value.toNumber(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+/*
+@namespace KSVG
+@begin SVGPreserveAspectRatioImplConstructor::s_hashTable 17
+ SVG_PRESERVEASPECTRATIO_UNKNOWN KSVG::SVG_PRESERVEASPECTRATIO_UNKNOWN DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_NONE KSVG::SVG_PRESERVEASPECTRATIO_NONE DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMINYMIN KSVG::SVG_PRESERVEASPECTRATIO_XMINYMIN DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMIDYMIN KSVG::SVG_PRESERVEASPECTRATIO_XMIDYMIN DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMAXYMIN KSVG::SVG_PRESERVEASPECTRATIO_XMAXYMIN DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMINYMID KSVG::SVG_PRESERVEASPECTRATIO_XMINYMID DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMIDYMID KSVG::SVG_PRESERVEASPECTRATIO_XMIDYMID DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMAXYMID KSVG::SVG_PRESERVEASPECTRATIO_XMAXYMID DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMINYMAX KSVG::SVG_PRESERVEASPECTRATIO_XMINYMAX DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMIDYMAX KSVG::SVG_PRESERVEASPECTRATIO_XMIDYMAX DontDelete|ReadOnly
+ SVG_PRESERVEASPECTRATIO_XMAXYMAX KSVG::SVG_PRESERVEASPECTRATIO_XMAXYMAX DontDelete|ReadOnly
+ SVG_MEETORSLICE_UNKNOWN KSVG::SVG_MEETORSLICE_UNKNOWN DontDelete|ReadOnly
+ SVG_MEETORSLICE_MEET KSVG::SVG_MEETORSLICE_MEET DontDelete|ReadOnly
+ SVG_MEETORSLICE_SLICE KSVG::SVG_MEETORSLICE_SLICE DontDelete|ReadOnly
+@end
+*/
+
+Value SVGPreserveAspectRatioImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token > SVG_PRESERVEASPECTRATIO_XMAXYMAX ? token - SVG_MEETORSLICE_UNKNOWN : token);
+}
+
+Value KSVG::getSVGPreserveAspectRatioImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGPreserveAspectRatioImplConstructor>(exec, "[[svgpreserveaspectratio.constructor]]");
+}
diff --git a/ksvg/impl/SVGPreserveAspectRatioImpl.h b/ksvg/impl/SVGPreserveAspectRatioImpl.h
index 2a768521..f0206e04 100644
--- a/ksvg/impl/SVGPreserveAspectRatioImpl.h
+++ b/ksvg/impl/SVGPreserveAspectRatioImpl.h
@@ -80,5 +80,3 @@ KJS::Value getSVGPreserveAspectRatioImplConstructor(KJS::ExecState *exec);
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGRadialGradientElementImpl.cc b/ksvg/impl/SVGRadialGradientElementImpl.cc
deleted file mode 100644
index 44ece001..00000000
--- a/ksvg/impl/SVGRadialGradientElementImpl.cc
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGGradientElement.h"
-#include "SVGRadialGradientElementImpl.h"
-
-#include "SVGDocumentImpl.h"
-#include "KSVGCanvas.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGUnitConverter.h"
-
-using namespace KSVG;
-
-#include "SVGRadialGradientElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGRadialGradientElementImpl::SVGRadialGradientElementImpl(DOM::ElementImpl *impl) : SVGGradientElementImpl(impl)
-{
- KSVG_EMPTY_FLAGS
-
- m_cx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_cx->ref();
-
- m_cy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_cy->ref();
-
- m_r = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, this);
- m_r->ref();
-
- m_fx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_fx->ref();
-
- m_fy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_fy->ref();
-
- converter()->add(m_cx);
- converter()->add(m_cy);
- converter()->add(m_r);
- converter()->add(m_fx);
- converter()->add(m_fy);
-}
-
-SVGRadialGradientElementImpl::~SVGRadialGradientElementImpl()
-{
- if(m_cx)
- m_cx->deref();
- if(m_cy)
- m_cy->deref();
- if(m_r)
- m_r->deref();
- if(m_fx)
- m_fx->deref();
- if(m_fy)
- m_fy->deref();
-}
-
-SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::cx() const
-{
- return m_cx;
-}
-
-SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::cy() const
-{
- return m_cy;
-}
-
-SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::r() const
-{
- return m_r;
-}
-
-SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::fx() const
-{
- return m_fx;
-}
-
-SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::fy() const
-{
- return m_fy;
-}
-
-/*
-@namespace KSVG
-@begin SVGRadialGradientElementImpl::s_hashTable 7
- cx SVGRadialGradientElementImpl::Cx DontDelete|ReadOnly
- cy SVGRadialGradientElementImpl::Cy DontDelete|ReadOnly
- r SVGRadialGradientElementImpl::R DontDelete|ReadOnly
- fx SVGRadialGradientElementImpl::Fx DontDelete|ReadOnly
- fy SVGRadialGradientElementImpl::Fy DontDelete|ReadOnly
-@end
-*/
-
-Value SVGRadialGradientElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Cx:
- if(!attributeMode)
- return m_cx->cache(exec);
- else
- return Number(m_cx->baseVal()->value());
- case Cy:
- if(!attributeMode)
- return m_cy->cache(exec);
- else
- return Number(m_cy->baseVal()->value());
- case R:
- if(!attributeMode)
- return m_r->cache(exec);
- else
- return Number(m_r->baseVal()->value());
- case Fx:
- if(!attributeMode)
- return m_fx->cache(exec);
- else
- return Number(m_fx->baseVal()->value());
- case Fy:
- if(!attributeMode)
- return m_fy->cache(exec);
- else
- return Number(m_fy->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGRadialGradientElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Cx:
- converter()->modify(cx(), value.toString(exec).qstring());
- break;
- case Cy:
- converter()->modify(cy(), value.toString(exec).qstring());
- break;
- case R:
- converter()->modify(r(), value.toString(exec).qstring());
- break;
- case Fx:
- converter()->modify(fx(), value.toString(exec).qstring());
- break;
- case Fy:
- converter()->modify(fy(), value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGRadialGradientElementImpl::setAttributes()
-{
- SVGGradientElementImpl::setAttributes();
-
- // Spec: no attribute, effect is af value 50% is specified
- if(KSVG_TOKEN_NOT_PARSED(Cx))
- KSVG_SET_ALT_ATTRIBUTE(Cx, "50%")
-
- // Spec: no attribute, effect is af value 50% is specified
- if(KSVG_TOKEN_NOT_PARSED(Cy))
- KSVG_SET_ALT_ATTRIBUTE(Cy, "50%")
-
- // Spec: no attribute, effect is af value 50% is specified
- if(KSVG_TOKEN_NOT_PARSED(R))
- KSVG_SET_ALT_ATTRIBUTE(R, "50%")
-}
-
-TQMap<TQString, DOM::DOMString> SVGRadialGradientElementImpl::gradientAttributes()
-{
- setAttributes();
-
- TQMap<TQString, DOM::DOMString> gradAttributes;
- TQDictIterator<DOM::DOMString> it(attributes());
-
- for(; it.current(); ++it)
- {
- DOM::DOMString name = it.currentKey();
- DOM::DOMString value = it.current()->string();
-
- if(name == "gradientUnits" || name == "gradientTransform" || name == "spreadMethod" || name == "cx" || name == "cy" || name == "r" || name == "fx" || name == "fy")
- {
- gradAttributes.insert(name.string(), value.copy());
- }
- }
-
- return gradAttributes;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGRadialGradientElementImpl.cpp b/ksvg/impl/SVGRadialGradientElementImpl.cpp
new file mode 100644
index 00000000..6a52ab68
--- /dev/null
+++ b/ksvg/impl/SVGRadialGradientElementImpl.cpp
@@ -0,0 +1,214 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGGradientElement.h"
+#include "SVGRadialGradientElementImpl.h"
+
+#include "SVGDocumentImpl.h"
+#include "KSVGCanvas.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGUnitConverter.h"
+
+using namespace KSVG;
+
+#include "SVGRadialGradientElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGRadialGradientElementImpl::SVGRadialGradientElementImpl(DOM::ElementImpl *impl) : SVGGradientElementImpl(impl)
+{
+ KSVG_EMPTY_FLAGS
+
+ m_cx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_cx->ref();
+
+ m_cy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_cy->ref();
+
+ m_r = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, this);
+ m_r->ref();
+
+ m_fx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_fx->ref();
+
+ m_fy = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_fy->ref();
+
+ converter()->add(m_cx);
+ converter()->add(m_cy);
+ converter()->add(m_r);
+ converter()->add(m_fx);
+ converter()->add(m_fy);
+}
+
+SVGRadialGradientElementImpl::~SVGRadialGradientElementImpl()
+{
+ if(m_cx)
+ m_cx->deref();
+ if(m_cy)
+ m_cy->deref();
+ if(m_r)
+ m_r->deref();
+ if(m_fx)
+ m_fx->deref();
+ if(m_fy)
+ m_fy->deref();
+}
+
+SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::cx() const
+{
+ return m_cx;
+}
+
+SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::cy() const
+{
+ return m_cy;
+}
+
+SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::r() const
+{
+ return m_r;
+}
+
+SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::fx() const
+{
+ return m_fx;
+}
+
+SVGAnimatedLengthImpl *SVGRadialGradientElementImpl::fy() const
+{
+ return m_fy;
+}
+
+/*
+@namespace KSVG
+@begin SVGRadialGradientElementImpl::s_hashTable 7
+ cx SVGRadialGradientElementImpl::Cx DontDelete|ReadOnly
+ cy SVGRadialGradientElementImpl::Cy DontDelete|ReadOnly
+ r SVGRadialGradientElementImpl::R DontDelete|ReadOnly
+ fx SVGRadialGradientElementImpl::Fx DontDelete|ReadOnly
+ fy SVGRadialGradientElementImpl::Fy DontDelete|ReadOnly
+@end
+*/
+
+Value SVGRadialGradientElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Cx:
+ if(!attributeMode)
+ return m_cx->cache(exec);
+ else
+ return Number(m_cx->baseVal()->value());
+ case Cy:
+ if(!attributeMode)
+ return m_cy->cache(exec);
+ else
+ return Number(m_cy->baseVal()->value());
+ case R:
+ if(!attributeMode)
+ return m_r->cache(exec);
+ else
+ return Number(m_r->baseVal()->value());
+ case Fx:
+ if(!attributeMode)
+ return m_fx->cache(exec);
+ else
+ return Number(m_fx->baseVal()->value());
+ case Fy:
+ if(!attributeMode)
+ return m_fy->cache(exec);
+ else
+ return Number(m_fy->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGRadialGradientElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Cx:
+ converter()->modify(cx(), value.toString(exec).qstring());
+ break;
+ case Cy:
+ converter()->modify(cy(), value.toString(exec).qstring());
+ break;
+ case R:
+ converter()->modify(r(), value.toString(exec).qstring());
+ break;
+ case Fx:
+ converter()->modify(fx(), value.toString(exec).qstring());
+ break;
+ case Fy:
+ converter()->modify(fy(), value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGRadialGradientElementImpl::setAttributes()
+{
+ SVGGradientElementImpl::setAttributes();
+
+ // Spec: no attribute, effect is af value 50% is specified
+ if(KSVG_TOKEN_NOT_PARSED(Cx))
+ KSVG_SET_ALT_ATTRIBUTE(Cx, "50%")
+
+ // Spec: no attribute, effect is af value 50% is specified
+ if(KSVG_TOKEN_NOT_PARSED(Cy))
+ KSVG_SET_ALT_ATTRIBUTE(Cy, "50%")
+
+ // Spec: no attribute, effect is af value 50% is specified
+ if(KSVG_TOKEN_NOT_PARSED(R))
+ KSVG_SET_ALT_ATTRIBUTE(R, "50%")
+}
+
+TQMap<TQString, DOM::DOMString> SVGRadialGradientElementImpl::gradientAttributes()
+{
+ setAttributes();
+
+ TQMap<TQString, DOM::DOMString> gradAttributes;
+ TQDictIterator<DOM::DOMString> it(attributes());
+
+ for(; it.current(); ++it)
+ {
+ DOM::DOMString name = it.currentKey();
+ DOM::DOMString value = it.current()->string();
+
+ if(name == "gradientUnits" || name == "gradientTransform" || name == "spreadMethod" || name == "cx" || name == "cy" || name == "r" || name == "fx" || name == "fy")
+ {
+ gradAttributes.insert(name.string(), value.copy());
+ }
+ }
+
+ return gradAttributes;
+}
diff --git a/ksvg/impl/SVGRadialGradientElementImpl.h b/ksvg/impl/SVGRadialGradientElementImpl.h
index 54edea08..14785212 100644
--- a/ksvg/impl/SVGRadialGradientElementImpl.h
+++ b/ksvg/impl/SVGRadialGradientElementImpl.h
@@ -72,5 +72,3 @@ KSVG_REGISTER_ELEMENT(SVGRadialGradientElementImpl, "radialGradient")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGRectElementImpl.cc b/ksvg/impl/SVGRectElementImpl.cc
deleted file mode 100644
index b1e4dfba..00000000
--- a/ksvg/impl/SVGRectElementImpl.cc
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include <tdelocale.h>
-
-#include "SVGRectImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGRectElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-
-#include "KSVGCanvas.h"
-#include "CanvasItem.h"
-
-using namespace KSVG;
-
-#include "SVGRectElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGRectElementImpl::SVGRectElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x->ref();
- m_x->baseVal()->setValueAsString("-1");
-
- m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y->ref();
- m_y->baseVal()->setValueAsString("-1");
-
- m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_width->ref();
- m_width->baseVal()->setValueAsString("-1");
-
- m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_height->ref();
- m_height->baseVal()->setValueAsString("-1");
-
- m_rx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_rx->ref();
- m_rx->baseVal()->setValueAsString("-1");
-
- m_ry = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_ry->ref();
- m_ry->baseVal()->setValueAsString("-1");
-}
-
-SVGRectElementImpl::~SVGRectElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_rx)
- m_rx->deref();
- if(m_ry)
- m_ry->deref();
-}
-
-SVGAnimatedLengthImpl *SVGRectElementImpl::x()
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGRectElementImpl::y()
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGRectElementImpl::width()
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGRectElementImpl::height()
-{
- return m_height;
-}
-
-SVGAnimatedLengthImpl *SVGRectElementImpl::rx()
-{
- return m_rx;
-}
-
-SVGAnimatedLengthImpl *SVGRectElementImpl::ry()
-{
- return m_ry;
-}
-
-/*
-@namespace KSVG
-@begin SVGRectElementImpl::s_hashTable 7
- x SVGRectElementImpl::X DontDelete|ReadOnly
- y SVGRectElementImpl::Y DontDelete|ReadOnly
- width SVGRectElementImpl::Width DontDelete|ReadOnly
- height SVGRectElementImpl::Height DontDelete|ReadOnly
- rx SVGRectElementImpl::Rx DontDelete|ReadOnly
- ry SVGRectElementImpl::Ry DontDelete|ReadOnly
-@end
-*/
-
-Value SVGRectElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X:
- if(!attributeMode)
- return m_x->cache(exec);
- else
- return Number(m_x->baseVal()->value());
- case Y:
- if(!attributeMode)
- return m_y->cache(exec);
- else
- return Number(m_y->baseVal()->value());
- case Width:
- if(!attributeMode)
- return m_width->cache(exec);
- else
- return Number(m_width->baseVal()->value());
- case Height:
- if(!attributeMode)
- return m_height->cache(exec);
- else
- return Number(m_height->baseVal()->value());
- case Rx:
- if(!attributeMode)
- return m_rx->cache(exec);
- else
- return Number(m_rx->baseVal()->value());
- case Ry:
- if(!attributeMode)
- return m_ry->cache(exec);
- else
- return Number(m_ry->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGRectElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X:
- x()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Y:
- y()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Width:
- width()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(width()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute width of element <rect> is illegal"));
- break;
- case Height:
- height()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(height()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute height of element <rect> is illegal"));
- break;
- case Rx:
- rx()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(rx()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute rx of element <rect> is illegal"));
- break;
- case Ry:
- ry()->baseVal()->setValueAsString(value.toString(exec).qstring());
- if(ry()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute ry of element <rect> is illegal"));
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGRectElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_x->baseVal()->value());
- ret->setY(m_y->baseVal()->value());
- ret->setWidth(m_width->baseVal()->value());
- ret->setHeight(m_height->baseVal()->value());
- return ret;
-}
-
-void SVGRectElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(X))
- KSVG_SET_ALT_ATTRIBUTE(X, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Y))
- KSVG_SET_ALT_ATTRIBUTE(Y, "0")
-}
-
-void SVGRectElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createRectangle(this);
- c->insert(m_item);
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGRectElementImpl.cpp b/ksvg/impl/SVGRectElementImpl.cpp
new file mode 100644
index 00000000..30a527ca
--- /dev/null
+++ b/ksvg/impl/SVGRectElementImpl.cpp
@@ -0,0 +1,242 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include <tdelocale.h>
+
+#include "SVGRectImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGRectElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+
+#include "KSVGCanvas.h"
+#include "CanvasItem.h"
+
+using namespace KSVG;
+
+#include "SVGRectElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGRectElementImpl::SVGRectElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x->ref();
+ m_x->baseVal()->setValueAsString("-1");
+
+ m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y->ref();
+ m_y->baseVal()->setValueAsString("-1");
+
+ m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_width->ref();
+ m_width->baseVal()->setValueAsString("-1");
+
+ m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_height->ref();
+ m_height->baseVal()->setValueAsString("-1");
+
+ m_rx = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_rx->ref();
+ m_rx->baseVal()->setValueAsString("-1");
+
+ m_ry = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_ry->ref();
+ m_ry->baseVal()->setValueAsString("-1");
+}
+
+SVGRectElementImpl::~SVGRectElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_rx)
+ m_rx->deref();
+ if(m_ry)
+ m_ry->deref();
+}
+
+SVGAnimatedLengthImpl *SVGRectElementImpl::x()
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGRectElementImpl::y()
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGRectElementImpl::width()
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGRectElementImpl::height()
+{
+ return m_height;
+}
+
+SVGAnimatedLengthImpl *SVGRectElementImpl::rx()
+{
+ return m_rx;
+}
+
+SVGAnimatedLengthImpl *SVGRectElementImpl::ry()
+{
+ return m_ry;
+}
+
+/*
+@namespace KSVG
+@begin SVGRectElementImpl::s_hashTable 7
+ x SVGRectElementImpl::X DontDelete|ReadOnly
+ y SVGRectElementImpl::Y DontDelete|ReadOnly
+ width SVGRectElementImpl::Width DontDelete|ReadOnly
+ height SVGRectElementImpl::Height DontDelete|ReadOnly
+ rx SVGRectElementImpl::Rx DontDelete|ReadOnly
+ ry SVGRectElementImpl::Ry DontDelete|ReadOnly
+@end
+*/
+
+Value SVGRectElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X:
+ if(!attributeMode)
+ return m_x->cache(exec);
+ else
+ return Number(m_x->baseVal()->value());
+ case Y:
+ if(!attributeMode)
+ return m_y->cache(exec);
+ else
+ return Number(m_y->baseVal()->value());
+ case Width:
+ if(!attributeMode)
+ return m_width->cache(exec);
+ else
+ return Number(m_width->baseVal()->value());
+ case Height:
+ if(!attributeMode)
+ return m_height->cache(exec);
+ else
+ return Number(m_height->baseVal()->value());
+ case Rx:
+ if(!attributeMode)
+ return m_rx->cache(exec);
+ else
+ return Number(m_rx->baseVal()->value());
+ case Ry:
+ if(!attributeMode)
+ return m_ry->cache(exec);
+ else
+ return Number(m_ry->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGRectElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X:
+ x()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Y:
+ y()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Width:
+ width()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(width()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute width of element <rect> is illegal"));
+ break;
+ case Height:
+ height()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(height()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute height of element <rect> is illegal"));
+ break;
+ case Rx:
+ rx()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(rx()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute rx of element <rect> is illegal"));
+ break;
+ case Ry:
+ ry()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ if(ry()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute ry of element <rect> is illegal"));
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGRectElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_x->baseVal()->value());
+ ret->setY(m_y->baseVal()->value());
+ ret->setWidth(m_width->baseVal()->value());
+ ret->setHeight(m_height->baseVal()->value());
+ return ret;
+}
+
+void SVGRectElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(X))
+ KSVG_SET_ALT_ATTRIBUTE(X, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Y))
+ KSVG_SET_ALT_ATTRIBUTE(Y, "0")
+}
+
+void SVGRectElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createRectangle(this);
+ c->insert(m_item);
+ }
+}
diff --git a/ksvg/impl/SVGRectElementImpl.h b/ksvg/impl/SVGRectElementImpl.h
index 690084d7..7b871389 100644
--- a/ksvg/impl/SVGRectElementImpl.h
+++ b/ksvg/impl/SVGRectElementImpl.h
@@ -86,5 +86,3 @@ KSVG_REGISTER_ELEMENT(SVGRectElementImpl, "rect")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGRectImpl.cc b/ksvg/impl/SVGRectImpl.cc
deleted file mode 100644
index 3889ec79..00000000
--- a/ksvg/impl/SVGRectImpl.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqrect.h>
-
-#include "SVGRectImpl.h"
-
-using namespace KSVG;
-
-#include "SVGRectImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGRectImpl::SVGRectImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = 0;
- m_y = 0;
- m_width = 0;
- m_height = 0;
-}
-
-SVGRectImpl::SVGRectImpl(const TQRect &other)
-{
- (*this) = other;
-}
-
-SVGRectImpl::~SVGRectImpl()
-{
-}
-
-void SVGRectImpl::setX(float x)
-{
- m_x = x;
-}
-
-float SVGRectImpl::x() const
-{
- return m_x;
-}
-
-void SVGRectImpl::setY(float y)
-{
- m_y = y;
-}
-
-float SVGRectImpl::y() const
-{
- return m_y;
-}
-
-void SVGRectImpl::setWidth(float width)
-{
- m_width = width;
-}
-
-float SVGRectImpl::width() const
-{
- return m_width;
-}
-
-void SVGRectImpl::setHeight(float height)
-{
- m_height = height;
-}
-
-float SVGRectImpl::height() const
-{
- return m_height;
-}
-
-TQRect SVGRectImpl::qrect() const
-{
- // ceil() so the integer rectangle contains the whole real one.
- return TQRect(int(m_x), int(m_y), int(ceil(m_width)), int(ceil(m_height)));
-}
-
-SVGRectImpl &SVGRectImpl::operator=(const TQRect &other)
-{
- m_x = other.x();
- m_y = other.y();
- m_width = other.width();
- m_height = other.height();
-
- return *this;
-}
-
-/*
-@namespace KSVG
-@begin SVGRectImpl::s_hashTable 5
- x SVGRectImpl::X DontDelete
- y SVGRectImpl::Y DontDelete
- width SVGRectImpl::Width DontDelete
- height SVGRectImpl::Height DontDelete
-@end
-*/
-
-Value SVGRectImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case X:
- return Number(m_x);
- case Y:
- return Number(m_y);
- case Width:
- return Number(m_width);
- case Height:
- return Number(m_height);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGRectImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case X:
- m_x = value.toNumber(exec);
- break;
- case Y:
- m_y = value.toNumber(exec);
- break;
- case Width:
- m_width = value.toNumber(exec);
- break;
- case Height:
- m_height = value.toNumber(exec);
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGRectImpl.cpp b/ksvg/impl/SVGRectImpl.cpp
new file mode 100644
index 00000000..f02b5a4d
--- /dev/null
+++ b/ksvg/impl/SVGRectImpl.cpp
@@ -0,0 +1,155 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqrect.h>
+
+#include "SVGRectImpl.h"
+
+using namespace KSVG;
+
+#include "SVGRectImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGRectImpl::SVGRectImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = 0;
+ m_y = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+SVGRectImpl::SVGRectImpl(const TQRect &other)
+{
+ (*this) = other;
+}
+
+SVGRectImpl::~SVGRectImpl()
+{
+}
+
+void SVGRectImpl::setX(float x)
+{
+ m_x = x;
+}
+
+float SVGRectImpl::x() const
+{
+ return m_x;
+}
+
+void SVGRectImpl::setY(float y)
+{
+ m_y = y;
+}
+
+float SVGRectImpl::y() const
+{
+ return m_y;
+}
+
+void SVGRectImpl::setWidth(float width)
+{
+ m_width = width;
+}
+
+float SVGRectImpl::width() const
+{
+ return m_width;
+}
+
+void SVGRectImpl::setHeight(float height)
+{
+ m_height = height;
+}
+
+float SVGRectImpl::height() const
+{
+ return m_height;
+}
+
+TQRect SVGRectImpl::qrect() const
+{
+ // ceil() so the integer rectangle contains the whole real one.
+ return TQRect(int(m_x), int(m_y), int(ceil(m_width)), int(ceil(m_height)));
+}
+
+SVGRectImpl &SVGRectImpl::operator=(const TQRect &other)
+{
+ m_x = other.x();
+ m_y = other.y();
+ m_width = other.width();
+ m_height = other.height();
+
+ return *this;
+}
+
+/*
+@namespace KSVG
+@begin SVGRectImpl::s_hashTable 5
+ x SVGRectImpl::X DontDelete
+ y SVGRectImpl::Y DontDelete
+ width SVGRectImpl::Width DontDelete
+ height SVGRectImpl::Height DontDelete
+@end
+*/
+
+Value SVGRectImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case X:
+ return Number(m_x);
+ case Y:
+ return Number(m_y);
+ case Width:
+ return Number(m_width);
+ case Height:
+ return Number(m_height);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGRectImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case X:
+ m_x = value.toNumber(exec);
+ break;
+ case Y:
+ m_y = value.toNumber(exec);
+ break;
+ case Width:
+ m_width = value.toNumber(exec);
+ break;
+ case Height:
+ m_height = value.toNumber(exec);
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGRectImpl.h b/ksvg/impl/SVGRectImpl.h
index dab7bbcf..89768cae 100644
--- a/ksvg/impl/SVGRectImpl.h
+++ b/ksvg/impl/SVGRectImpl.h
@@ -76,5 +76,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSVGElementImpl.cc b/ksvg/impl/SVGSVGElementImpl.cc
deleted file mode 100644
index c9b82445..00000000
--- a/ksvg/impl/SVGSVGElementImpl.cc
+++ /dev/null
@@ -1,982 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqtimer.h>
-#include <tqstringlist.h>
-#include <tqdatetime.h>
-
-#define USE_VALGRIND 0
-
-#if USE_VALGRIND
-#include <valgrind/calltree.h>
-#endif
-
-#include "SVGLength.h"
-
-#include "SVGRectImpl.h"
-#include "SVGAngleImpl.h"
-#include "SVGShapeImpl.h"
-#include "SVGPointImpl.h"
-#include "SVGNumberImpl.h"
-#include "SVGMatrixImpl.h"
-
-#include "SVGEventImpl.h"
-#include "SVGAElementImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGViewSpecImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedRectImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGPreserveAspectRatioImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-#include "SVGSVGElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGSVGElementImpl::SVGSVGElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGLocatableImpl(), SVGFitToViewBoxImpl(), SVGZoomAndPanImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_y->ref();
-
- m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_height->ref();
-
- m_viewport = SVGSVGElementImpl::createSVGRect();
-
- m_currentTranslate = SVGSVGElementImpl::createSVGPoint();
-
- m_currentView = new SVGViewSpecImpl();
- m_currentView->ref();
-
- m_currentScale = 1.0;
-
- m_useCurrentView = false;
-
- m_clip[0] = 0;
- m_clip[1] = 0;
- m_clip[2] = 0;
- m_clip[3] = 0;
-
- m_rootParentScreenCTM = 0;
-
- m_localMatrix = SVGSVGElementImpl::createSVGMatrix();
-}
-
-SVGSVGElementImpl::~SVGSVGElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_viewport)
- m_viewport->deref();
- if(m_currentTranslate)
- m_currentTranslate->deref();
- if(m_currentView)
- m_currentView->deref();
- if(m_rootParentScreenCTM)
- m_rootParentScreenCTM->deref();
- if(m_localMatrix)
- m_localMatrix->deref();
-}
-
-bool SVGSVGElementImpl::isRootElement() const
-{
- return ownerDoc()->rootElement() == this;
-}
-
-void SVGSVGElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(X))
- KSVG_SET_ALT_ATTRIBUTE(X, "0")
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(Y))
- KSVG_SET_ALT_ATTRIBUTE(Y, "0")
-
- // Spec: If the attribute is not specified, the effect is as if a value of "100%" were specified.
- if(KSVG_TOKEN_NOT_PARSED(Width))
- KSVG_SET_ALT_ATTRIBUTE(Width, "100%")
-
- // Spec: If the attribute is not specified, the effect is as if a value of "100%" were specified.
- if(KSVG_TOKEN_NOT_PARSED(Height))
- KSVG_SET_ALT_ATTRIBUTE(Height, "100%")
-
- // Spec: The contentScriptType should default to "text/ecmascript".
- if(KSVG_TOKEN_NOT_PARSED(ContentScriptType))
- KSVG_SET_ALT_ATTRIBUTE(ContentScriptType, "text/ecmascript")
-
- // Spec: The contentStyleType should default to "text/css".
- if(KSVG_TOKEN_NOT_PARSED(ContentStyleType))
- KSVG_SET_ALT_ATTRIBUTE(ContentStyleType, "text/css")
-
- if(m_useCurrentView)
- {
- parseViewBox(m_currentView->viewBoxString().string());
- preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(m_currentView->preserveAspectRatioString().string());
- }
-
- m_viewport->setX(x()->baseVal()->value());
- m_viewport->setY(y()->baseVal()->value());
- m_viewport->setWidth(width()->baseVal()->value());
- m_viewport->setHeight(height()->baseVal()->value());
-
- if(isRootElement() && ownerDoc()->parentImage() == 0)
- {
- if(ownerDoc()->canvas())
- ownerDoc()->canvas()->setViewportDimension(int(ceil(width()->baseVal()->value() * currentScale())), int(ceil(height()->baseVal()->value() * currentScale())));
-
- // Special case for outermost svg element:
- // We need to register our id manually, because
- // m_ownerSVGElement is 0 in SVGElementImpl::setAttributes (Niko)
- if(!id().isNull())
- addToIdMap(id().string(), this);
- }
-}
-
-SVGAnimatedLengthImpl *SVGSVGElementImpl::x()
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGSVGElementImpl::y()
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGSVGElementImpl::width()
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGSVGElementImpl::height()
-{
- return m_height;
-}
-
-void SVGSVGElementImpl::setContentScriptType(const DOM::DOMString &contentScriptType)
-{
- setAttribute("contentScriptType", contentScriptType);
-}
-
-DOM::DOMString SVGSVGElementImpl::contentScriptType() const
-{
- return getAttribute("contentScriptType");
-}
-
-void SVGSVGElementImpl::setContentStyleType(const DOM::DOMString &contentStyleType)
-{
- setAttribute("contentStyleType", contentStyleType);
-}
-
-DOM::DOMString SVGSVGElementImpl::contentStyleType() const
-{
- return getAttribute("contentStyleType");
-}
-
-SVGRectImpl *SVGSVGElementImpl::viewport()
-{
- return m_viewport;
-}
-
-SVGRectImpl *SVGSVGElementImpl::getBBox()
-{
- SVGRectImpl *ret = new SVGRectImpl(getCTM()->qmatrix().invert().map(m_viewport->qrect()));
- ret->ref();
- return ret;
-}
-
-float SVGSVGElementImpl::pixelUnitToMillimeterX() const
-{
- return ownerDoc()->screenPixelsPerMillimeterX();
-}
-
-float SVGSVGElementImpl::pixelUnitToMillimeterY() const
-{
- return ownerDoc()->screenPixelsPerMillimeterY();
-}
-
-float SVGSVGElementImpl::screenPixelToMillimeterX() const
-{
- return pixelUnitToMillimeterX();
-}
-
-float SVGSVGElementImpl::screenPixelToMillimeterY() const
-{
- return pixelUnitToMillimeterY();
-}
-
-void SVGSVGElementImpl::setUseCurrentView(bool useCurrentView)
-{
- m_useCurrentView = useCurrentView;
-}
-
-bool SVGSVGElementImpl::useCurrentView() const
-{
- return m_useCurrentView;
-}
-
-SVGViewSpecImpl *SVGSVGElementImpl::currentView() const
-{
- return m_currentView;
-}
-
-void SVGSVGElementImpl::setCurrentScale(float currentScale)
-{
- if( m_currentScale != currentScale )
- {
- m_currentScale = currentScale;
- invalidateCachedMatrices();
-
- if(hasEventListener(SVGEvent::ZOOM_EVENT, true))
- dispatchEvent(SVGEvent::ZOOM_EVENT, false, false);
- }
-}
-
-float SVGSVGElementImpl::currentScale() const
-{
- return m_currentScale;
-}
-
-void SVGSVGElementImpl::setCurrentTranslate(const TQPoint &p)
-{
- if(m_currentTranslate->x() != p.x() || m_currentTranslate->y() != p.y())
- {
- m_currentTranslate->setX(p.x());
- m_currentTranslate->setY(p.y());
- invalidateCachedMatrices();
- if(hasEventListener(SVGEvent::SCROLL_EVENT, true))
- dispatchEvent(SVGEvent::SCROLL_EVENT, false, false);
- }
-}
-
-SVGPointImpl *SVGSVGElementImpl::currentTranslate()
-{
- return m_currentTranslate;
-}
-
-unsigned long SVGSVGElementImpl::suspendRedraw(unsigned long)
-{
- return 0;
-}
-
-void SVGSVGElementImpl::unsuspendRedraw(unsigned long)
-{
-}
-
-void SVGSVGElementImpl::unsuspendRedrawAll()
-{
-}
-
-void SVGSVGElementImpl::forceRedraw()
-{
-#if USE_VALGRIND
- CALLTREE_ZERO_STATS();
-#endif
-
- TQTime timer;
- timer.start();
-
- if(ownerDoc() && ownerDoc()->canvas())
- ownerDoc()->canvas()->update();
-
- kdDebug(26000) << "forceRedraw in " << timer.elapsed()/1000.0 << " seconds" << endl;
-
-#if USE_VALGRIND
- CALLTREE_DUMP_STATS();
-#endif
-}
-
-void SVGSVGElementImpl::pauseAnimations()
-{
- if(!ownerDoc()->timeScheduler()->animationsPaused())
- ownerDoc()->timeScheduler()->toggleAnimations();
-}
-
-void SVGSVGElementImpl::unpauseAnimations()
-{
- if(ownerDoc()->timeScheduler()->animationsPaused())
- ownerDoc()->timeScheduler()->toggleAnimations();
-}
-
-bool SVGSVGElementImpl::animationsPaused()
-{
- return ownerDoc()->timeScheduler()->animationsPaused();
-}
-
-float SVGSVGElementImpl::getCurrentTime() const
-{
- return ownerDoc()->timeScheduler()->elapsed();
-}
-
-void SVGSVGElementImpl::setCurrentTime(float)
-{
-}
-
-DOM::NodeList SVGSVGElementImpl::getIntersectionList(SVGRectImpl *, SVGElementImpl *)
-{
- // TODO : implement me
- return DOM::NodeList();
-}
-
-DOM::NodeList SVGSVGElementImpl::getEnclosureList(SVGRectImpl *rect, SVGElementImpl */*referenceElement*/)
-{
- DOM::NodeList list;
-
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- if(shape)
- {
- if(shape->isContainer())
- // TODO : pass it on to container::getEnclosureList() which should return a NodeList
- kdDebug() << "!shape" << endl;
- else
- {
- // TODO : add the shape to list if the test succeeds
- SVGRectImpl *current = shape->getBBox();
- if(rect->qrect().contains(current->qrect(), true))
- kdDebug() << "shape : " << element->nodeName().string() << " is fully enclosed" << endl;
-
- current->deref();
- }
- }
- }
-
- return list;
-}
-
-bool SVGSVGElementImpl::checkIntersection(SVGElementImpl *element, SVGRectImpl *rect)
-{
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- if(!shape)
- return false;
-
- SVGRectImpl *current = shape->getBBox();
- bool result = rect->qrect().intersects(current->qrect());
- current->deref();
- return result;
-}
-
-bool SVGSVGElementImpl::checkEnclosure(SVGElementImpl *element, SVGRectImpl *rect)
-{
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- if(!shape)
- return false;
-
- SVGRectImpl *current = shape->getBBox();
- bool result = rect->qrect().contains(current->qrect());
- current->deref();
- return result;
-}
-
-void SVGSVGElementImpl::deSelectAll()
-{
-}
-
-SVGNumberImpl *SVGSVGElementImpl::createSVGNumber()
-{
- // Spec: Creates an SVGNumber object outside of any document
- // trees. The object is initialized to a value of zero.
- SVGNumberImpl *ret = new SVGNumberImpl();
- ret->ref();
- return ret;
-}
-
-SVGLengthImpl *SVGSVGElementImpl::createSVGLength()
-{
- // Spec: Creates an SVGLength object outside of any document
- // trees. The object is initialized to the value of 0 user units.
- SVGLengthImpl *ret = new SVGLengthImpl();
- ret->ref();
- return ret;
-}
-
-SVGAngleImpl *SVGSVGElementImpl::createSVGAngle()
-{
- // Spec: Creates an SVGAngle object outside of any document
- // trees. The object is initialized to the value 0 degrees (unitless).
- SVGAngleImpl *ret = new SVGAngleImpl();
- ret->ref();
- return ret;
-}
-
-SVGPointImpl *SVGSVGElementImpl::createSVGPoint()
-{
- // Spec: Creates an SVGPoint object outside of any document
- // trees. The object is initialized to the point (0,0) in the user coordinate system.
- SVGPointImpl *ret = new SVGPointImpl();
- ret->ref();
- return ret;
-}
-
-SVGMatrixImpl *SVGSVGElementImpl::createSVGMatrix()
-{
- // Spec: Creates an SVGMatrix object outside of any document
- // trees. The object is initialized to the identity matrix.
- SVGMatrixImpl *ret = new SVGMatrixImpl(TQWMatrix(1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F));
- ret->ref();
- return ret;
-}
-
-SVGRectImpl *SVGSVGElementImpl::createSVGRect()
-{
- // Spec: Creates an SVGRect object outside of any document
- // trees. The object is initialized such that all values are set to 0 user units.
- SVGRectImpl *ret = new SVGRectImpl();
- ret->ref();
- return ret;
-}
-
-SVGTransformImpl *SVGSVGElementImpl::createSVGTransform()
-{
- // Spec: Creates an SVGTransform object outside of any document
- // trees. The object is initialized to an identity matrix transform (SVG_TRANSFORM_MATRIX).
- SVGTransformImpl *transform = createSVGTransformFromMatrix(createSVGMatrix());
-
- // createSVGMatrix already ref's the matrix, the SVGTransformImpl->setMatrix
- // call also does this, prevent non deleting of the object by deref'ing (Niko)
- transform->matrix()->deref();
-
- return transform;
-}
-
-SVGTransformImpl *SVGSVGElementImpl::createSVGTransformFromMatrix(SVGMatrixImpl *mat)
-{
- // Spec: Creates an SVGTransform object outside of any document
- // trees. The object is initialized to the given matrix transform (i.e., SVG_TRANSFORM_MATRIX).
- SVGTransformImpl *ret = new SVGTransformImpl();
- ret->setMatrix(mat);
- ret->ref();
- return ret;
-}
-
-SVGElementImpl *SVGSVGElementImpl::getElementById(const DOM::DOMString &elementId)
-{
- return m_map[elementId.string()];
-}
-
-void SVGSVGElementImpl::addToIdMap(const TQString &id, SVGElementImpl *obj)
-{
- m_map.insert(id, obj);
-}
-
-SVGMatrixImpl *SVGSVGElementImpl::getCTM()
-{
- return viewBoxToViewTransform(width()->baseVal()->value(), height()->baseVal()->value());
-}
-
-const SVGMatrixImpl *SVGSVGElementImpl::localMatrix()
-{
- // TODO: only update the matrix when needed and just return m_localMatrix
-
- m_localMatrix->reset();
-
- if(ownerSVGElement() == 0)
- {
- if(m_rootParentScreenCTM != 0)
- m_localMatrix->copy(m_rootParentScreenCTM);
-
- // We're the outermost svg element.
- // Put the zoom scale and translate into the matrix.
- m_localMatrix->translate(currentTranslate()->x(), currentTranslate()->y());
- m_localMatrix->scale(currentScale());
- }
-
- // Apply viewport translation.
- m_localMatrix->translate(x()->baseVal()->value(), y()->baseVal()->value());
-
- // And viewbox.
- SVGMatrixImpl *viewboxMatrix = viewBoxToViewTransform(width()->baseVal()->value(), height()->baseVal()->value());
-
- m_localMatrix->multiply(viewboxMatrix);
- viewboxMatrix->deref();
-
- return m_localMatrix;
-}
-
-void SVGSVGElementImpl::setClip(const TQString &clip)
-{
- // TODO : this routine should probably be shared between all classes that establish new viewports (Rob)
- if(!clip.startsWith("rect(") || !clip.endsWith(")"))
- return;
-
- TQString work = clip.mid(5, clip.length() - 6);
- TQStringList substrings = TQStringList::split(',', clip);
- TQStringList::ConstIterator it = substrings.begin();
-
- if(m_clip[0])
- m_clip[0]->deref();
- m_clip[0] = SVGSVGElementImpl::createSVGLength();
-
- if(*it != "auto")
- m_clip[0]->setValueAsString(*it);
- ++it;
-
- if(m_clip[1])
- m_clip[1]->deref();
- m_clip[1] = SVGSVGElementImpl::createSVGLength();
-
- if(*it != "auto")
- m_clip[1]->setValueAsString(*it);
- ++it;
-
- if(m_clip[2])
- m_clip[2]->deref();
- m_clip[2] = SVGSVGElementImpl::createSVGLength();
-
- if(*it != "auto")
- m_clip[2]->setValueAsString(*it);
- ++it;
-
- if(m_clip[3])
- m_clip[3]->deref();
- m_clip[3] = SVGSVGElementImpl::createSVGLength();
-
- if(*it != "auto")
- m_clip[3]->setValueAsString(*it);
-}
-
-TQRect SVGSVGElementImpl::clip()
-{
- // Get viewport in user coordinates.
- TQRect v(0, 0, m_viewport->qrect().width(), m_viewport->qrect().height());
-
- SVGMatrixImpl *ctm = getCTM();
- TQRect r = ctm->qmatrix().invert().mapRect(v);
- ctm->deref();
-
- if(m_clip[0])
- r.setTop(static_cast<int>(r.top() + m_clip[0]->value()));
- if(m_clip[1])
- r.setRight(static_cast<int>(r.right() - m_clip[1]->value()));
- if(m_clip[2])
- r.setBottom(static_cast<int>(r.bottom() - m_clip[2]->value()));
- if(m_clip[3])
- r.setLeft(static_cast<int>(r.left() + m_clip[3]->value()));
-
- return r;
-}
-
-void SVGSVGElementImpl::setRootParentScreenCTM(SVGMatrixImpl *screenCTM)
-{
- if(m_rootParentScreenCTM != 0)
- m_rootParentScreenCTM->deref();
-
- m_rootParentScreenCTM = screenCTM;
- screenCTM->ref();
-}
-
-bool SVGSVGElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &a, SVGMouseEventImpl *mev)
-{
- // mop: central bool var which turns to true once the current "mouseover" element has been found
- bool ret = false, dorerender = false;
- SVGElementImpl *elem = 0;
-
- SVGMatrixImpl *ctm = getCTM();
- TQPoint userA = ctm->qmatrix().invert().map(a);
- ctm->deref();
-
- // Just check the lastTarget once (mop)
- if(ownerDoc()->lastTarget())
- {
- elem = ownerDoc()->lastTarget();
- ret = elem->prepareMouseEvent(p, userA, mev);
-
- // mop: only proceed if element is not the current element anymore. rest is done in the lower part
- if(!ret)
- {
- if(elem->hasEventListener(SVGEvent::MOUSEOUT_EVENT, false))
- {
- dorerender = true;
- elem->setMouseOver(false);
- elem->dispatchMouseEvent(SVGEvent::MOUSEOUT_EVENT, true, true, 0, mev->screenX(), mev->screenY(), mev->clientX(), mev->clientY(), mev->ctrlKey(), mev->altKey(), mev->shiftKey(), mev->metaKey(), mev->button(), elem);
- }
-
- if(elem->hasEventListener(SVGEvent::DOMFOCUSOUT_EVENT, false) && elem->focus())
- {
- dorerender = true;
- elem->setFocus(false);
- elem->dispatchEvent(SVGEvent::DOMFOCUSOUT_EVENT, true, true);
- }
-
- // mop: unset last target once we left it
- ownerDoc()->setLastTarget(0);
- }
- }
-
- // mop: DAMN...logic doesn't work :(
- // we cant use the results of the above check because something like this
- // _________
- // | ____ |
- // ||____| |
- // |_________|
- //
- // wouldn't work because even if the mousepointer would be in the inner rect it would still be inside the bbox
- // of the outer (assuming that the outer is the lastTarget). :(
- ret = false;
-
- // mop: just check for a node until the element where the mouse is over is found
- // mop: "ret" can be set from the above stuff too...
- // find the element here and do the event stuff in the lower part..much cleaner
- CanvasItemList hits = ownerDoc()->canvas()->collisions(p, true);
- for(CanvasItemList::Iterator it = hits.begin(); it != hits.end(); ++it)
- {
- elem = (*it)->element();
- if(elem)
- {
- // Check if mouse is over a certain shape...
- // mop: once an element has been found check eventlisteners and leave immediately
- ret = elem->prepareMouseEvent(p, userA, mev);
- if(ret) break;
- }
- }
-
- // mop: has an element been found?
- if(ret)
- {
- int events = mev->target()->getEventListeners(false);
-
- // Dispatch mousemove, mousedown, mouseup and mouseclick events
- bool cancel = (mev->id() != SVGEvent::MOUSEMOVE_EVENT);
-
- if(events & 1 << mev->id())
- {
- mev->target()->dispatchMouseEvent(mev->id(), true, cancel, 0, mev->screenX(), mev->screenY(), mev->clientX(), mev->clientY(), mev->ctrlKey(), mev->altKey(), mev->shiftKey(), mev->metaKey(), mev->button(), elem);
- dorerender = true; // mop: if it has the event then rerender
- }
-
- // If a mouse "moves" over a shape, it's also "over" the shape
- if(mev->id() == SVGEvent::MOUSEMOVE_EVENT)
- {
- mev->target()->setMouseOver(true);
- if(events & 1 << SVGEvent::MOUSEOVER_EVENT)
- {
- mev->target()->dispatchMouseEvent(SVGEvent::MOUSEOVER_EVENT, true, cancel, 0, mev->screenX(), mev->screenY(), mev->clientX(), mev->clientY(), mev->ctrlKey(), mev->altKey(), mev->shiftKey(), mev->metaKey(), mev->button(), elem);
- dorerender = true;
- }
-
- }
-
- // Also send an domactivate + focusin event on mouseup
- bool dolinktest = true;
- if(mev->id() == SVGEvent::MOUSEUP_EVENT)
- {
- mev->target()->setFocus(true);
-
- if(events & 1 << SVGEvent::CLICK_EVENT)
- {
- dolinktest = mev->target()->dispatchEvent(SVGEvent::CLICK_EVENT, true, true);
- dorerender = true;
- }
-
- if(events & 1 << SVGEvent::DOMACTIVATE_EVENT)
- {
- mev->target()->dispatchEvent(SVGEvent::DOMACTIVATE_EVENT, true, true);
- dorerender = true;
- }
-
- if(events & 1 << SVGEvent::DOMFOCUSIN_EVENT)
- {
- mev->target()->dispatchEvent(SVGEvent::DOMFOCUSIN_EVENT, true, true);
- dorerender = true;
- }
- }
-
- // Hyperlink support
- SVGAElementImpl* link=0;
- if(dolinktest && !mev->defaultPrevented())
- {
- link = SVGAElementImpl::getLink(elem);
- if(link)
- {
- mev->setURL(link->href()->baseVal());
- emit ownerDoc()->gotURL(link->target()->baseVal().string());
- }
- }
-
- // The mouse is over a shape, so we have a target..we need to register that for a mouseout
- ownerDoc()->setLastTarget(mev->target());
- }
-
- // mop: all events may trigger changed style, add elements etc. this is definately needed :(
- if(dorerender)
- ownerDoc()->rerender();
-
- return dorerender; // mop: some kind of event has been found and executed
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGSVGElementImpl::s_hashTable 23
- x SVGSVGElementImpl::X DontDelete|ReadOnly
- y SVGSVGElementImpl::Y DontDelete|ReadOnly
- width SVGSVGElementImpl::Width DontDelete|ReadOnly
- height SVGSVGElementImpl::Height DontDelete|ReadOnly
- viewport SVGSVGElementImpl::Viewport DontDelete|ReadOnly
- contentScriptType SVGSVGElementImpl::ContentScriptType DontDelete
- contentStyleType SVGSVGElementImpl::ContentStyleType DontDelete
- pixelUnitToMillimeterX SVGSVGElementImpl::PixelUnitToMillimeterX DontDelete|ReadOnly
- pixelUnitToMillimeterY SVGSVGElementImpl::PixelUnitToMillimeterY DontDelete|ReadOnly
- screenPixelToMillimeterX SVGSVGElementImpl::ScreenPixelToMillimeterX DontDelete|ReadOnly
- screenPixelToMillimeterY SVGSVGElementImpl::ScreenPixelToMillimeterY DontDelete|ReadOnly
- useCurrentView SVGSVGElementImpl::UseCurrentView DontDelete
- currentScale SVGSVGElementImpl::CurrentScale DontDelete
- currentTranslate SVGSVGElementImpl::CurrentTranslate DontDelete|ReadOnly
- onunload SVGSVGElementImpl::OnUnload DontDelete
- onerror SVGSVGElementImpl::OnError DontDelete
- onresize SVGSVGElementImpl::OnResize DontDelete
- onzoom SVGSVGElementImpl::OnZoom DontDelete
- onscroll SVGSVGElementImpl::OnScroll DontDelete
-@end
-@namespace KSVG
-@begin SVGSVGElementImplProto::s_hashTable 29
- createSVGNumber SVGSVGElementImpl::CreateSVGNumber DontDelete|Function 0
- createSVGLength SVGSVGElementImpl::CreateSVGLength DontDelete|Function 0
- createSVGAngle SVGSVGElementImpl::CreateSVGAngle DontDelete|Function 0
- createSVGPoint SVGSVGElementImpl::CreateSVGPoint DontDelete|Function 0
- createSVGMatrix SVGSVGElementImpl::CreateSVGMatrix DontDelete|Function 0
- createSVGRect SVGSVGElementImpl::CreateSVGRect DontDelete|Function 0
- createSVGTransform SVGSVGElementImpl::CreateSVGTransform DontDelete|Function 0
- createSVGTransformFromMatrix SVGSVGElementImpl::CreateSVGTransformFromMatrix DontDelete|Function 1
- suspendRedraw SVGSVGElementImpl::SuspendRedraw DontDelete|Function 1
- unsuspendRedraw SVGSVGElementImpl::UnsuspendRedraw DontDelete|Function 1
- unsuspendRedrawAll SVGSVGElementImpl::UnsuspendRedrawAll DontDelete|Function 0
- forceRedraw SVGSVGElementImpl::ForceRedraw DontDelete|Function 0
- pauseAnimations SVGSVGElementImpl::PauseAnimations DontDelete|Function 0
- unpauseAnimations SVGSVGElementImpl::UnpauseAnimations DontDelete|Function 0
- animationsPaused SVGSVGElementImpl::AnimationsPaused DontDelete|Function 0
- getCurrentTime SVGSVGElementImpl::GetCurrentTime DontDelete|Function 0
- setCurrentTime SVGSVGElementImpl::SetCurrentTime DontDelete|Function 1
- getIntersectionList SVGSVGElementImpl::GetIntersectionList DontDelete|Function 2
- getEnclosureList SVGSVGElementImpl::GetEnclosureList DontDelete|Function 2
- checkIntersection SVGSVGElementImpl::CheckIntersection DontDelete|Function 2
- checkEnclosure SVGSVGElementImpl::CheckEnclosure DontDelete|Function 2
- deselectAll SVGSVGElementImpl::DeselectAll DontDelete|Function 0
- getElementById SVGSVGElementImpl::GetElementById DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGSVGElement", SVGSVGElementImplProto, SVGSVGElementImplProtoFunc)
-
-Value SVGSVGElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X:
- if(!attributeMode)
- return m_x->cache(exec);
- else
- return Number(m_x->baseVal()->value());
- case Y:
- if(!attributeMode)
- return m_y->cache(exec);
- else
- return Number(m_y->baseVal()->value());
- case Width:
- if(!attributeMode)
- return m_width->cache(exec);
- else
- return Number(m_width->baseVal()->value());
- case Height:
- if(!attributeMode)
- return m_height->cache(exec);
- else
- return Number(m_height->baseVal()->value());
- case Viewport:
- return m_viewport->cache(exec);
- case ContentScriptType:
- return String(contentScriptType().string());
- case ContentStyleType:
- return String(contentStyleType().string());
- case PixelUnitToMillimeterX:
- return Number(pixelUnitToMillimeterX());
- case PixelUnitToMillimeterY:
- return Number(pixelUnitToMillimeterY());
- case ScreenPixelToMillimeterX:
- return Number(screenPixelToMillimeterX());
- case ScreenPixelToMillimeterY:
- return Number(screenPixelToMillimeterY());
- case UseCurrentView:
- return Boolean(useCurrentView());
- case CurrentScale:
- return Number(currentScale());
- case CurrentTranslate:
- return m_currentTranslate->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGSVGElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
-{
- switch(token)
- {
- case ContentScriptType:
- setContentScriptType(value.toString(exec).string());
- break;
- case ContentStyleType:
- setContentStyleType(value.toString(exec).string());
- break;
- case CurrentScale:
- m_currentScale = value.toNumber(exec);
- break;
- case X:
- x()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Y:
- y()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Width:
- width()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Height:
- height()->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case OnUnload:
- // Spec: only applicable to outermost 'svg' elements
- if(isRootElement())
- setEventListener(SVGEvent::UNLOAD_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
- break;
- case OnError:
- setEventListener(SVGEvent::ERROR_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
- break;
- case OnResize:
- // Spec: only applicable to outermost 'svg' elements
- if(isRootElement())
- setEventListener(SVGEvent::RESIZE_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
- break;
- case OnZoom:
- // Spec: only applicable to outermost 'svg' elements
- if(isRootElement())
- setEventListener(SVGEvent::ZOOM_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
- break;
- case OnScroll:
- // Spec: only applicable to outermost 'svg' elements
- if(isRootElement())
- setEventListener(SVGEvent::SCROLL_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
- break;
- default:
- kdWarning() << k_funcinfo << "unhandled token " << token << endl;
- }
-}
-
-Value SVGSVGElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGSVGElementImpl)
-
- switch(id)
- {
- case SVGSVGElementImpl::CreateSVGNumber:
- return obj->createSVGNumber()->cache(exec);
- case SVGSVGElementImpl::CreateSVGLength:
- return obj->createSVGLength()->cache(exec);
- case SVGSVGElementImpl::CreateSVGAngle:
- return obj->createSVGAngle()->cache(exec);
- case SVGSVGElementImpl::CreateSVGPoint:
- return obj->createSVGPoint()->cache(exec);
- case SVGSVGElementImpl::CreateSVGMatrix:
- return obj->createSVGMatrix()->cache(exec);
- case SVGSVGElementImpl::CreateSVGRect:
- return obj->createSVGRect()->cache(exec);
- case SVGSVGElementImpl::CreateSVGTransform:
- return obj->createSVGTransform()->cache(exec);
- case SVGSVGElementImpl::CreateSVGTransformFromMatrix:
- return obj->createSVGTransformFromMatrix(static_cast<KSVGBridge<SVGMatrixImpl> *>(args[0].imp())->impl())->cache(exec);
- case SVGSVGElementImpl::GetElementById:
- {
- // Keep in sync with SVGDocumentImpl's version.
- Value ret;
-
- SVGElementImpl *element = obj->getElementById(args[0].toString(exec).string());
-
- if(element)
- ret = getDOMNode(exec, *element);
- else
- {
- element = obj->ownerDoc()->recursiveSearch(*(obj->ownerDoc()), args[0].toString(exec).string());
- if(!element)
- return Null();
-
- ret = getDOMNode(exec, *element);
- }
-
- return ret;
- }
- case SVGSVGElementImpl::GetCurrentTime:
- return Number(obj->getCurrentTime());
- case SVGSVGElementImpl::SetCurrentTime:
- obj->setCurrentTime(args[0].toNumber(exec));
- return Undefined();
- case SVGSVGElementImpl::DeselectAll:
- obj->deSelectAll();
- return Undefined();
- case SVGSVGElementImpl::PauseAnimations:
- obj->pauseAnimations();
- return Undefined();
- case SVGSVGElementImpl::UnpauseAnimations:
- obj->unpauseAnimations();
- return Undefined();
- case SVGSVGElementImpl::AnimationsPaused:
- return Boolean(obj->animationsPaused());
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSVGElementImpl.cpp b/ksvg/impl/SVGSVGElementImpl.cpp
new file mode 100644
index 00000000..98106d7c
--- /dev/null
+++ b/ksvg/impl/SVGSVGElementImpl.cpp
@@ -0,0 +1,980 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqtimer.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+
+#define USE_VALGRIND 0
+
+#if USE_VALGRIND
+#include <valgrind/calltree.h>
+#endif
+
+#include "SVGLength.h"
+
+#include "SVGRectImpl.h"
+#include "SVGAngleImpl.h"
+#include "SVGShapeImpl.h"
+#include "SVGPointImpl.h"
+#include "SVGNumberImpl.h"
+#include "SVGMatrixImpl.h"
+
+#include "SVGEventImpl.h"
+#include "SVGAElementImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGViewSpecImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedRectImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGPreserveAspectRatioImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+#include "SVGSVGElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGSVGElementImpl::SVGSVGElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGLocatableImpl(), SVGFitToViewBoxImpl(), SVGZoomAndPanImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_y->ref();
+
+ m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_height->ref();
+
+ m_viewport = SVGSVGElementImpl::createSVGRect();
+
+ m_currentTranslate = SVGSVGElementImpl::createSVGPoint();
+
+ m_currentView = new SVGViewSpecImpl();
+ m_currentView->ref();
+
+ m_currentScale = 1.0;
+
+ m_useCurrentView = false;
+
+ m_clip[0] = 0;
+ m_clip[1] = 0;
+ m_clip[2] = 0;
+ m_clip[3] = 0;
+
+ m_rootParentScreenCTM = 0;
+
+ m_localMatrix = SVGSVGElementImpl::createSVGMatrix();
+}
+
+SVGSVGElementImpl::~SVGSVGElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_viewport)
+ m_viewport->deref();
+ if(m_currentTranslate)
+ m_currentTranslate->deref();
+ if(m_currentView)
+ m_currentView->deref();
+ if(m_rootParentScreenCTM)
+ m_rootParentScreenCTM->deref();
+ if(m_localMatrix)
+ m_localMatrix->deref();
+}
+
+bool SVGSVGElementImpl::isRootElement() const
+{
+ return ownerDoc()->rootElement() == this;
+}
+
+void SVGSVGElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(X))
+ KSVG_SET_ALT_ATTRIBUTE(X, "0")
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Y))
+ KSVG_SET_ALT_ATTRIBUTE(Y, "0")
+
+ // Spec: If the attribute is not specified, the effect is as if a value of "100%" were specified.
+ if(KSVG_TOKEN_NOT_PARSED(Width))
+ KSVG_SET_ALT_ATTRIBUTE(Width, "100%")
+
+ // Spec: If the attribute is not specified, the effect is as if a value of "100%" were specified.
+ if(KSVG_TOKEN_NOT_PARSED(Height))
+ KSVG_SET_ALT_ATTRIBUTE(Height, "100%")
+
+ // Spec: The contentScriptType should default to "text/ecmascript".
+ if(KSVG_TOKEN_NOT_PARSED(ContentScriptType))
+ KSVG_SET_ALT_ATTRIBUTE(ContentScriptType, "text/ecmascript")
+
+ // Spec: The contentStyleType should default to "text/css".
+ if(KSVG_TOKEN_NOT_PARSED(ContentStyleType))
+ KSVG_SET_ALT_ATTRIBUTE(ContentStyleType, "text/css")
+
+ if(m_useCurrentView)
+ {
+ parseViewBox(m_currentView->viewBoxString().string());
+ preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(m_currentView->preserveAspectRatioString().string());
+ }
+
+ m_viewport->setX(x()->baseVal()->value());
+ m_viewport->setY(y()->baseVal()->value());
+ m_viewport->setWidth(width()->baseVal()->value());
+ m_viewport->setHeight(height()->baseVal()->value());
+
+ if(isRootElement() && ownerDoc()->parentImage() == 0)
+ {
+ if(ownerDoc()->canvas())
+ ownerDoc()->canvas()->setViewportDimension(int(ceil(width()->baseVal()->value() * currentScale())), int(ceil(height()->baseVal()->value() * currentScale())));
+
+ // Special case for outermost svg element:
+ // We need to register our id manually, because
+ // m_ownerSVGElement is 0 in SVGElementImpl::setAttributes (Niko)
+ if(!id().isNull())
+ addToIdMap(id().string(), this);
+ }
+}
+
+SVGAnimatedLengthImpl *SVGSVGElementImpl::x()
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGSVGElementImpl::y()
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGSVGElementImpl::width()
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGSVGElementImpl::height()
+{
+ return m_height;
+}
+
+void SVGSVGElementImpl::setContentScriptType(const DOM::DOMString &contentScriptType)
+{
+ setAttribute("contentScriptType", contentScriptType);
+}
+
+DOM::DOMString SVGSVGElementImpl::contentScriptType() const
+{
+ return getAttribute("contentScriptType");
+}
+
+void SVGSVGElementImpl::setContentStyleType(const DOM::DOMString &contentStyleType)
+{
+ setAttribute("contentStyleType", contentStyleType);
+}
+
+DOM::DOMString SVGSVGElementImpl::contentStyleType() const
+{
+ return getAttribute("contentStyleType");
+}
+
+SVGRectImpl *SVGSVGElementImpl::viewport()
+{
+ return m_viewport;
+}
+
+SVGRectImpl *SVGSVGElementImpl::getBBox()
+{
+ SVGRectImpl *ret = new SVGRectImpl(getCTM()->qmatrix().invert().map(m_viewport->qrect()));
+ ret->ref();
+ return ret;
+}
+
+float SVGSVGElementImpl::pixelUnitToMillimeterX() const
+{
+ return ownerDoc()->screenPixelsPerMillimeterX();
+}
+
+float SVGSVGElementImpl::pixelUnitToMillimeterY() const
+{
+ return ownerDoc()->screenPixelsPerMillimeterY();
+}
+
+float SVGSVGElementImpl::screenPixelToMillimeterX() const
+{
+ return pixelUnitToMillimeterX();
+}
+
+float SVGSVGElementImpl::screenPixelToMillimeterY() const
+{
+ return pixelUnitToMillimeterY();
+}
+
+void SVGSVGElementImpl::setUseCurrentView(bool useCurrentView)
+{
+ m_useCurrentView = useCurrentView;
+}
+
+bool SVGSVGElementImpl::useCurrentView() const
+{
+ return m_useCurrentView;
+}
+
+SVGViewSpecImpl *SVGSVGElementImpl::currentView() const
+{
+ return m_currentView;
+}
+
+void SVGSVGElementImpl::setCurrentScale(float currentScale)
+{
+ if( m_currentScale != currentScale )
+ {
+ m_currentScale = currentScale;
+ invalidateCachedMatrices();
+
+ if(hasEventListener(SVGEvent::ZOOM_EVENT, true))
+ dispatchEvent(SVGEvent::ZOOM_EVENT, false, false);
+ }
+}
+
+float SVGSVGElementImpl::currentScale() const
+{
+ return m_currentScale;
+}
+
+void SVGSVGElementImpl::setCurrentTranslate(const TQPoint &p)
+{
+ if(m_currentTranslate->x() != p.x() || m_currentTranslate->y() != p.y())
+ {
+ m_currentTranslate->setX(p.x());
+ m_currentTranslate->setY(p.y());
+ invalidateCachedMatrices();
+ if(hasEventListener(SVGEvent::SCROLL_EVENT, true))
+ dispatchEvent(SVGEvent::SCROLL_EVENT, false, false);
+ }
+}
+
+SVGPointImpl *SVGSVGElementImpl::currentTranslate()
+{
+ return m_currentTranslate;
+}
+
+unsigned long SVGSVGElementImpl::suspendRedraw(unsigned long)
+{
+ return 0;
+}
+
+void SVGSVGElementImpl::unsuspendRedraw(unsigned long)
+{
+}
+
+void SVGSVGElementImpl::unsuspendRedrawAll()
+{
+}
+
+void SVGSVGElementImpl::forceRedraw()
+{
+#if USE_VALGRIND
+ CALLTREE_ZERO_STATS();
+#endif
+
+ TQTime timer;
+ timer.start();
+
+ if(ownerDoc() && ownerDoc()->canvas())
+ ownerDoc()->canvas()->update();
+
+ kdDebug(26000) << "forceRedraw in " << timer.elapsed()/1000.0 << " seconds" << endl;
+
+#if USE_VALGRIND
+ CALLTREE_DUMP_STATS();
+#endif
+}
+
+void SVGSVGElementImpl::pauseAnimations()
+{
+ if(!ownerDoc()->timeScheduler()->animationsPaused())
+ ownerDoc()->timeScheduler()->toggleAnimations();
+}
+
+void SVGSVGElementImpl::unpauseAnimations()
+{
+ if(ownerDoc()->timeScheduler()->animationsPaused())
+ ownerDoc()->timeScheduler()->toggleAnimations();
+}
+
+bool SVGSVGElementImpl::animationsPaused()
+{
+ return ownerDoc()->timeScheduler()->animationsPaused();
+}
+
+float SVGSVGElementImpl::getCurrentTime() const
+{
+ return ownerDoc()->timeScheduler()->elapsed();
+}
+
+void SVGSVGElementImpl::setCurrentTime(float)
+{
+}
+
+DOM::NodeList SVGSVGElementImpl::getIntersectionList(SVGRectImpl *, SVGElementImpl *)
+{
+ // TODO : implement me
+ return DOM::NodeList();
+}
+
+DOM::NodeList SVGSVGElementImpl::getEnclosureList(SVGRectImpl *rect, SVGElementImpl */*referenceElement*/)
+{
+ DOM::NodeList list;
+
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ if(shape)
+ {
+ if(shape->isContainer())
+ // TODO : pass it on to container::getEnclosureList() which should return a NodeList
+ kdDebug() << "!shape" << endl;
+ else
+ {
+ // TODO : add the shape to list if the test succeeds
+ SVGRectImpl *current = shape->getBBox();
+ if(rect->qrect().contains(current->qrect(), true))
+ kdDebug() << "shape : " << element->nodeName().string() << " is fully enclosed" << endl;
+
+ current->deref();
+ }
+ }
+ }
+
+ return list;
+}
+
+bool SVGSVGElementImpl::checkIntersection(SVGElementImpl *element, SVGRectImpl *rect)
+{
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ if(!shape)
+ return false;
+
+ SVGRectImpl *current = shape->getBBox();
+ bool result = rect->qrect().intersects(current->qrect());
+ current->deref();
+ return result;
+}
+
+bool SVGSVGElementImpl::checkEnclosure(SVGElementImpl *element, SVGRectImpl *rect)
+{
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ if(!shape)
+ return false;
+
+ SVGRectImpl *current = shape->getBBox();
+ bool result = rect->qrect().contains(current->qrect());
+ current->deref();
+ return result;
+}
+
+void SVGSVGElementImpl::deSelectAll()
+{
+}
+
+SVGNumberImpl *SVGSVGElementImpl::createSVGNumber()
+{
+ // Spec: Creates an SVGNumber object outside of any document
+ // trees. The object is initialized to a value of zero.
+ SVGNumberImpl *ret = new SVGNumberImpl();
+ ret->ref();
+ return ret;
+}
+
+SVGLengthImpl *SVGSVGElementImpl::createSVGLength()
+{
+ // Spec: Creates an SVGLength object outside of any document
+ // trees. The object is initialized to the value of 0 user units.
+ SVGLengthImpl *ret = new SVGLengthImpl();
+ ret->ref();
+ return ret;
+}
+
+SVGAngleImpl *SVGSVGElementImpl::createSVGAngle()
+{
+ // Spec: Creates an SVGAngle object outside of any document
+ // trees. The object is initialized to the value 0 degrees (unitless).
+ SVGAngleImpl *ret = new SVGAngleImpl();
+ ret->ref();
+ return ret;
+}
+
+SVGPointImpl *SVGSVGElementImpl::createSVGPoint()
+{
+ // Spec: Creates an SVGPoint object outside of any document
+ // trees. The object is initialized to the point (0,0) in the user coordinate system.
+ SVGPointImpl *ret = new SVGPointImpl();
+ ret->ref();
+ return ret;
+}
+
+SVGMatrixImpl *SVGSVGElementImpl::createSVGMatrix()
+{
+ // Spec: Creates an SVGMatrix object outside of any document
+ // trees. The object is initialized to the identity matrix.
+ SVGMatrixImpl *ret = new SVGMatrixImpl(TQWMatrix(1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F));
+ ret->ref();
+ return ret;
+}
+
+SVGRectImpl *SVGSVGElementImpl::createSVGRect()
+{
+ // Spec: Creates an SVGRect object outside of any document
+ // trees. The object is initialized such that all values are set to 0 user units.
+ SVGRectImpl *ret = new SVGRectImpl();
+ ret->ref();
+ return ret;
+}
+
+SVGTransformImpl *SVGSVGElementImpl::createSVGTransform()
+{
+ // Spec: Creates an SVGTransform object outside of any document
+ // trees. The object is initialized to an identity matrix transform (SVG_TRANSFORM_MATRIX).
+ SVGTransformImpl *transform = createSVGTransformFromMatrix(createSVGMatrix());
+
+ // createSVGMatrix already ref's the matrix, the SVGTransformImpl->setMatrix
+ // call also does this, prevent non deleting of the object by deref'ing (Niko)
+ transform->matrix()->deref();
+
+ return transform;
+}
+
+SVGTransformImpl *SVGSVGElementImpl::createSVGTransformFromMatrix(SVGMatrixImpl *mat)
+{
+ // Spec: Creates an SVGTransform object outside of any document
+ // trees. The object is initialized to the given matrix transform (i.e., SVG_TRANSFORM_MATRIX).
+ SVGTransformImpl *ret = new SVGTransformImpl();
+ ret->setMatrix(mat);
+ ret->ref();
+ return ret;
+}
+
+SVGElementImpl *SVGSVGElementImpl::getElementById(const DOM::DOMString &elementId)
+{
+ return m_map[elementId.string()];
+}
+
+void SVGSVGElementImpl::addToIdMap(const TQString &id, SVGElementImpl *obj)
+{
+ m_map.insert(id, obj);
+}
+
+SVGMatrixImpl *SVGSVGElementImpl::getCTM()
+{
+ return viewBoxToViewTransform(width()->baseVal()->value(), height()->baseVal()->value());
+}
+
+const SVGMatrixImpl *SVGSVGElementImpl::localMatrix()
+{
+ // TODO: only update the matrix when needed and just return m_localMatrix
+
+ m_localMatrix->reset();
+
+ if(ownerSVGElement() == 0)
+ {
+ if(m_rootParentScreenCTM != 0)
+ m_localMatrix->copy(m_rootParentScreenCTM);
+
+ // We're the outermost svg element.
+ // Put the zoom scale and translate into the matrix.
+ m_localMatrix->translate(currentTranslate()->x(), currentTranslate()->y());
+ m_localMatrix->scale(currentScale());
+ }
+
+ // Apply viewport translation.
+ m_localMatrix->translate(x()->baseVal()->value(), y()->baseVal()->value());
+
+ // And viewbox.
+ SVGMatrixImpl *viewboxMatrix = viewBoxToViewTransform(width()->baseVal()->value(), height()->baseVal()->value());
+
+ m_localMatrix->multiply(viewboxMatrix);
+ viewboxMatrix->deref();
+
+ return m_localMatrix;
+}
+
+void SVGSVGElementImpl::setClip(const TQString &clip)
+{
+ // TODO : this routine should probably be shared between all classes that establish new viewports (Rob)
+ if(!clip.startsWith("rect(") || !clip.endsWith(")"))
+ return;
+
+ TQString work = clip.mid(5, clip.length() - 6);
+ TQStringList substrings = TQStringList::split(',', clip);
+ TQStringList::ConstIterator it = substrings.begin();
+
+ if(m_clip[0])
+ m_clip[0]->deref();
+ m_clip[0] = SVGSVGElementImpl::createSVGLength();
+
+ if(*it != "auto")
+ m_clip[0]->setValueAsString(*it);
+ ++it;
+
+ if(m_clip[1])
+ m_clip[1]->deref();
+ m_clip[1] = SVGSVGElementImpl::createSVGLength();
+
+ if(*it != "auto")
+ m_clip[1]->setValueAsString(*it);
+ ++it;
+
+ if(m_clip[2])
+ m_clip[2]->deref();
+ m_clip[2] = SVGSVGElementImpl::createSVGLength();
+
+ if(*it != "auto")
+ m_clip[2]->setValueAsString(*it);
+ ++it;
+
+ if(m_clip[3])
+ m_clip[3]->deref();
+ m_clip[3] = SVGSVGElementImpl::createSVGLength();
+
+ if(*it != "auto")
+ m_clip[3]->setValueAsString(*it);
+}
+
+TQRect SVGSVGElementImpl::clip()
+{
+ // Get viewport in user coordinates.
+ TQRect v(0, 0, m_viewport->qrect().width(), m_viewport->qrect().height());
+
+ SVGMatrixImpl *ctm = getCTM();
+ TQRect r = ctm->qmatrix().invert().mapRect(v);
+ ctm->deref();
+
+ if(m_clip[0])
+ r.setTop(static_cast<int>(r.top() + m_clip[0]->value()));
+ if(m_clip[1])
+ r.setRight(static_cast<int>(r.right() - m_clip[1]->value()));
+ if(m_clip[2])
+ r.setBottom(static_cast<int>(r.bottom() - m_clip[2]->value()));
+ if(m_clip[3])
+ r.setLeft(static_cast<int>(r.left() + m_clip[3]->value()));
+
+ return r;
+}
+
+void SVGSVGElementImpl::setRootParentScreenCTM(SVGMatrixImpl *screenCTM)
+{
+ if(m_rootParentScreenCTM != 0)
+ m_rootParentScreenCTM->deref();
+
+ m_rootParentScreenCTM = screenCTM;
+ screenCTM->ref();
+}
+
+bool SVGSVGElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &a, SVGMouseEventImpl *mev)
+{
+ // mop: central bool var which turns to true once the current "mouseover" element has been found
+ bool ret = false, dorerender = false;
+ SVGElementImpl *elem = 0;
+
+ SVGMatrixImpl *ctm = getCTM();
+ TQPoint userA = ctm->qmatrix().invert().map(a);
+ ctm->deref();
+
+ // Just check the lastTarget once (mop)
+ if(ownerDoc()->lastTarget())
+ {
+ elem = ownerDoc()->lastTarget();
+ ret = elem->prepareMouseEvent(p, userA, mev);
+
+ // mop: only proceed if element is not the current element anymore. rest is done in the lower part
+ if(!ret)
+ {
+ if(elem->hasEventListener(SVGEvent::MOUSEOUT_EVENT, false))
+ {
+ dorerender = true;
+ elem->setMouseOver(false);
+ elem->dispatchMouseEvent(SVGEvent::MOUSEOUT_EVENT, true, true, 0, mev->screenX(), mev->screenY(), mev->clientX(), mev->clientY(), mev->ctrlKey(), mev->altKey(), mev->shiftKey(), mev->metaKey(), mev->button(), elem);
+ }
+
+ if(elem->hasEventListener(SVGEvent::DOMFOCUSOUT_EVENT, false) && elem->focus())
+ {
+ dorerender = true;
+ elem->setFocus(false);
+ elem->dispatchEvent(SVGEvent::DOMFOCUSOUT_EVENT, true, true);
+ }
+
+ // mop: unset last target once we left it
+ ownerDoc()->setLastTarget(0);
+ }
+ }
+
+ // mop: DAMN...logic doesn't work :(
+ // we cant use the results of the above check because something like this
+ // _________
+ // | ____ |
+ // ||____| |
+ // |_________|
+ //
+ // wouldn't work because even if the mousepointer would be in the inner rect it would still be inside the bbox
+ // of the outer (assuming that the outer is the lastTarget). :(
+ ret = false;
+
+ // mop: just check for a node until the element where the mouse is over is found
+ // mop: "ret" can be set from the above stuff too...
+ // find the element here and do the event stuff in the lower part..much cleaner
+ CanvasItemList hits = ownerDoc()->canvas()->collisions(p, true);
+ for(CanvasItemList::Iterator it = hits.begin(); it != hits.end(); ++it)
+ {
+ elem = (*it)->element();
+ if(elem)
+ {
+ // Check if mouse is over a certain shape...
+ // mop: once an element has been found check eventlisteners and leave immediately
+ ret = elem->prepareMouseEvent(p, userA, mev);
+ if(ret) break;
+ }
+ }
+
+ // mop: has an element been found?
+ if(ret)
+ {
+ int events = mev->target()->getEventListeners(false);
+
+ // Dispatch mousemove, mousedown, mouseup and mouseclick events
+ bool cancel = (mev->id() != SVGEvent::MOUSEMOVE_EVENT);
+
+ if(events & 1 << mev->id())
+ {
+ mev->target()->dispatchMouseEvent(mev->id(), true, cancel, 0, mev->screenX(), mev->screenY(), mev->clientX(), mev->clientY(), mev->ctrlKey(), mev->altKey(), mev->shiftKey(), mev->metaKey(), mev->button(), elem);
+ dorerender = true; // mop: if it has the event then rerender
+ }
+
+ // If a mouse "moves" over a shape, it's also "over" the shape
+ if(mev->id() == SVGEvent::MOUSEMOVE_EVENT)
+ {
+ mev->target()->setMouseOver(true);
+ if(events & 1 << SVGEvent::MOUSEOVER_EVENT)
+ {
+ mev->target()->dispatchMouseEvent(SVGEvent::MOUSEOVER_EVENT, true, cancel, 0, mev->screenX(), mev->screenY(), mev->clientX(), mev->clientY(), mev->ctrlKey(), mev->altKey(), mev->shiftKey(), mev->metaKey(), mev->button(), elem);
+ dorerender = true;
+ }
+
+ }
+
+ // Also send an domactivate + focusin event on mouseup
+ bool dolinktest = true;
+ if(mev->id() == SVGEvent::MOUSEUP_EVENT)
+ {
+ mev->target()->setFocus(true);
+
+ if(events & 1 << SVGEvent::CLICK_EVENT)
+ {
+ dolinktest = mev->target()->dispatchEvent(SVGEvent::CLICK_EVENT, true, true);
+ dorerender = true;
+ }
+
+ if(events & 1 << SVGEvent::DOMACTIVATE_EVENT)
+ {
+ mev->target()->dispatchEvent(SVGEvent::DOMACTIVATE_EVENT, true, true);
+ dorerender = true;
+ }
+
+ if(events & 1 << SVGEvent::DOMFOCUSIN_EVENT)
+ {
+ mev->target()->dispatchEvent(SVGEvent::DOMFOCUSIN_EVENT, true, true);
+ dorerender = true;
+ }
+ }
+
+ // Hyperlink support
+ SVGAElementImpl* link=0;
+ if(dolinktest && !mev->defaultPrevented())
+ {
+ link = SVGAElementImpl::getLink(elem);
+ if(link)
+ {
+ mev->setURL(link->href()->baseVal());
+ emit ownerDoc()->gotURL(link->target()->baseVal().string());
+ }
+ }
+
+ // The mouse is over a shape, so we have a target..we need to register that for a mouseout
+ ownerDoc()->setLastTarget(mev->target());
+ }
+
+ // mop: all events may trigger changed style, add elements etc. this is definately needed :(
+ if(dorerender)
+ ownerDoc()->rerender();
+
+ return dorerender; // mop: some kind of event has been found and executed
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGSVGElementImpl::s_hashTable 23
+ x SVGSVGElementImpl::X DontDelete|ReadOnly
+ y SVGSVGElementImpl::Y DontDelete|ReadOnly
+ width SVGSVGElementImpl::Width DontDelete|ReadOnly
+ height SVGSVGElementImpl::Height DontDelete|ReadOnly
+ viewport SVGSVGElementImpl::Viewport DontDelete|ReadOnly
+ contentScriptType SVGSVGElementImpl::ContentScriptType DontDelete
+ contentStyleType SVGSVGElementImpl::ContentStyleType DontDelete
+ pixelUnitToMillimeterX SVGSVGElementImpl::PixelUnitToMillimeterX DontDelete|ReadOnly
+ pixelUnitToMillimeterY SVGSVGElementImpl::PixelUnitToMillimeterY DontDelete|ReadOnly
+ screenPixelToMillimeterX SVGSVGElementImpl::ScreenPixelToMillimeterX DontDelete|ReadOnly
+ screenPixelToMillimeterY SVGSVGElementImpl::ScreenPixelToMillimeterY DontDelete|ReadOnly
+ useCurrentView SVGSVGElementImpl::UseCurrentView DontDelete
+ currentScale SVGSVGElementImpl::CurrentScale DontDelete
+ currentTranslate SVGSVGElementImpl::CurrentTranslate DontDelete|ReadOnly
+ onunload SVGSVGElementImpl::OnUnload DontDelete
+ onerror SVGSVGElementImpl::OnError DontDelete
+ onresize SVGSVGElementImpl::OnResize DontDelete
+ onzoom SVGSVGElementImpl::OnZoom DontDelete
+ onscroll SVGSVGElementImpl::OnScroll DontDelete
+@end
+@namespace KSVG
+@begin SVGSVGElementImplProto::s_hashTable 29
+ createSVGNumber SVGSVGElementImpl::CreateSVGNumber DontDelete|Function 0
+ createSVGLength SVGSVGElementImpl::CreateSVGLength DontDelete|Function 0
+ createSVGAngle SVGSVGElementImpl::CreateSVGAngle DontDelete|Function 0
+ createSVGPoint SVGSVGElementImpl::CreateSVGPoint DontDelete|Function 0
+ createSVGMatrix SVGSVGElementImpl::CreateSVGMatrix DontDelete|Function 0
+ createSVGRect SVGSVGElementImpl::CreateSVGRect DontDelete|Function 0
+ createSVGTransform SVGSVGElementImpl::CreateSVGTransform DontDelete|Function 0
+ createSVGTransformFromMatrix SVGSVGElementImpl::CreateSVGTransformFromMatrix DontDelete|Function 1
+ suspendRedraw SVGSVGElementImpl::SuspendRedraw DontDelete|Function 1
+ unsuspendRedraw SVGSVGElementImpl::UnsuspendRedraw DontDelete|Function 1
+ unsuspendRedrawAll SVGSVGElementImpl::UnsuspendRedrawAll DontDelete|Function 0
+ forceRedraw SVGSVGElementImpl::ForceRedraw DontDelete|Function 0
+ pauseAnimations SVGSVGElementImpl::PauseAnimations DontDelete|Function 0
+ unpauseAnimations SVGSVGElementImpl::UnpauseAnimations DontDelete|Function 0
+ animationsPaused SVGSVGElementImpl::AnimationsPaused DontDelete|Function 0
+ getCurrentTime SVGSVGElementImpl::GetCurrentTime DontDelete|Function 0
+ setCurrentTime SVGSVGElementImpl::SetCurrentTime DontDelete|Function 1
+ getIntersectionList SVGSVGElementImpl::GetIntersectionList DontDelete|Function 2
+ getEnclosureList SVGSVGElementImpl::GetEnclosureList DontDelete|Function 2
+ checkIntersection SVGSVGElementImpl::CheckIntersection DontDelete|Function 2
+ checkEnclosure SVGSVGElementImpl::CheckEnclosure DontDelete|Function 2
+ deselectAll SVGSVGElementImpl::DeselectAll DontDelete|Function 0
+ getElementById SVGSVGElementImpl::GetElementById DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGSVGElement", SVGSVGElementImplProto, SVGSVGElementImplProtoFunc)
+
+Value SVGSVGElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X:
+ if(!attributeMode)
+ return m_x->cache(exec);
+ else
+ return Number(m_x->baseVal()->value());
+ case Y:
+ if(!attributeMode)
+ return m_y->cache(exec);
+ else
+ return Number(m_y->baseVal()->value());
+ case Width:
+ if(!attributeMode)
+ return m_width->cache(exec);
+ else
+ return Number(m_width->baseVal()->value());
+ case Height:
+ if(!attributeMode)
+ return m_height->cache(exec);
+ else
+ return Number(m_height->baseVal()->value());
+ case Viewport:
+ return m_viewport->cache(exec);
+ case ContentScriptType:
+ return String(contentScriptType().string());
+ case ContentStyleType:
+ return String(contentStyleType().string());
+ case PixelUnitToMillimeterX:
+ return Number(pixelUnitToMillimeterX());
+ case PixelUnitToMillimeterY:
+ return Number(pixelUnitToMillimeterY());
+ case ScreenPixelToMillimeterX:
+ return Number(screenPixelToMillimeterX());
+ case ScreenPixelToMillimeterY:
+ return Number(screenPixelToMillimeterY());
+ case UseCurrentView:
+ return Boolean(useCurrentView());
+ case CurrentScale:
+ return Number(currentScale());
+ case CurrentTranslate:
+ return m_currentTranslate->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGSVGElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int)
+{
+ switch(token)
+ {
+ case ContentScriptType:
+ setContentScriptType(value.toString(exec).string());
+ break;
+ case ContentStyleType:
+ setContentStyleType(value.toString(exec).string());
+ break;
+ case CurrentScale:
+ m_currentScale = value.toNumber(exec);
+ break;
+ case X:
+ x()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Y:
+ y()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Width:
+ width()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Height:
+ height()->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case OnUnload:
+ // Spec: only applicable to outermost 'svg' elements
+ if(isRootElement())
+ setEventListener(SVGEvent::UNLOAD_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
+ break;
+ case OnError:
+ setEventListener(SVGEvent::ERROR_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
+ break;
+ case OnResize:
+ // Spec: only applicable to outermost 'svg' elements
+ if(isRootElement())
+ setEventListener(SVGEvent::RESIZE_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
+ break;
+ case OnZoom:
+ // Spec: only applicable to outermost 'svg' elements
+ if(isRootElement())
+ setEventListener(SVGEvent::ZOOM_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
+ break;
+ case OnScroll:
+ // Spec: only applicable to outermost 'svg' elements
+ if(isRootElement())
+ setEventListener(SVGEvent::SCROLL_EVENT, ownerDoc()->createEventListener(value.toString(exec).qstring()));
+ break;
+ default:
+ kdWarning() << k_funcinfo << "unhandled token " << token << endl;
+ }
+}
+
+Value SVGSVGElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGSVGElementImpl)
+
+ switch(id)
+ {
+ case SVGSVGElementImpl::CreateSVGNumber:
+ return obj->createSVGNumber()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGLength:
+ return obj->createSVGLength()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGAngle:
+ return obj->createSVGAngle()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGPoint:
+ return obj->createSVGPoint()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGMatrix:
+ return obj->createSVGMatrix()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGRect:
+ return obj->createSVGRect()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGTransform:
+ return obj->createSVGTransform()->cache(exec);
+ case SVGSVGElementImpl::CreateSVGTransformFromMatrix:
+ return obj->createSVGTransformFromMatrix(static_cast<KSVGBridge<SVGMatrixImpl> *>(args[0].imp())->impl())->cache(exec);
+ case SVGSVGElementImpl::GetElementById:
+ {
+ // Keep in sync with SVGDocumentImpl's version.
+ Value ret;
+
+ SVGElementImpl *element = obj->getElementById(args[0].toString(exec).string());
+
+ if(element)
+ ret = getDOMNode(exec, *element);
+ else
+ {
+ element = obj->ownerDoc()->recursiveSearch(*(obj->ownerDoc()), args[0].toString(exec).string());
+ if(!element)
+ return Null();
+
+ ret = getDOMNode(exec, *element);
+ }
+
+ return ret;
+ }
+ case SVGSVGElementImpl::GetCurrentTime:
+ return Number(obj->getCurrentTime());
+ case SVGSVGElementImpl::SetCurrentTime:
+ obj->setCurrentTime(args[0].toNumber(exec));
+ return Undefined();
+ case SVGSVGElementImpl::DeselectAll:
+ obj->deSelectAll();
+ return Undefined();
+ case SVGSVGElementImpl::PauseAnimations:
+ obj->pauseAnimations();
+ return Undefined();
+ case SVGSVGElementImpl::UnpauseAnimations:
+ obj->unpauseAnimations();
+ return Undefined();
+ case SVGSVGElementImpl::AnimationsPaused:
+ return Boolean(obj->animationsPaused());
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
diff --git a/ksvg/impl/SVGSVGElementImpl.h b/ksvg/impl/SVGSVGElementImpl.h
index d2667a35..ec73bfc9 100644
--- a/ksvg/impl/SVGSVGElementImpl.h
+++ b/ksvg/impl/SVGSVGElementImpl.h
@@ -194,5 +194,3 @@ KSVG_DEFINE_PROTOTYPE(SVGSVGElementImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGSVGElementImplProtoFunc, SVGSVGElementImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGScriptElementImpl.cc b/ksvg/impl/SVGScriptElementImpl.cc
deleted file mode 100644
index 541c098d..00000000
--- a/ksvg/impl/SVGScriptElementImpl.cc
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tdeio/job.h>
-#include <kfilterdev.h>
-#include <tqbuffer.h>
-
-#include "SVGDocumentImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGScriptElementImpl.moc"
-
-using namespace KSVG;
-
-#include "SVGScriptElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGScriptElementImpl::SVGScriptElementImpl(DOM::ElementImpl *impl) : TQObject(), SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_job = 0;
- m_added = false;
-}
-
-SVGScriptElementImpl::~SVGScriptElementImpl()
-{
-}
-
-void SVGScriptElementImpl::setType(const DOM::DOMString &type)
-{
- setAttribute("type", type);
-}
-
-DOM::DOMString SVGScriptElementImpl::type() const
-{
- return getAttribute("type");
-}
-
-void SVGScriptElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: provide a default type
- if(KSVG_TOKEN_NOT_PARSED(Type))
- KSVG_SET_ALT_ATTRIBUTE(Type, "text/ecmascript")
-
- // Remote downloading
- TQString href = m_href->baseVal().string();
-
- if(!href.isEmpty())
- {
- KURL url(ownerDoc()->baseUrl(), href);
-
- if(m_job == 0)
- m_job = TDEIO::get(url, false, false);
-
- connect(m_job, TQT_SIGNAL(data(TDEIO::Job *, const TQByteArray &)), this, TQT_SLOT(slotData(TDEIO::Job *, const TQByteArray &)));
- connect(m_job, TQT_SIGNAL(result(TDEIO::Job *)), this, TQT_SLOT(slotResult(TDEIO::Job *)));
- }
-}
-
-void SVGScriptElementImpl::slotData(TDEIO::Job *, const TQByteArray &data)
-{
- TQDataStream dataStream(m_data, IO_WriteOnly | IO_Append);
- dataStream.writeRawBytes(data.data(), data.size());
-}
-
-void SVGScriptElementImpl::slotResult(TDEIO::Job *)
-{
- m_job = 0;
-
- // Append a NULL terminator so we don't die
- m_data.resize(m_data.size() + 1);
- m_data[m_data.size() - 1] = '\0';
-
- TQBuffer buf(m_data);
- TQIODevice *dev = KFilterDev::device(TQT_TQIODEVICE(&buf), "application/x-gzip", false);
- TQByteArray contents;
- if(dev->open(IO_ReadOnly))
- contents = dev->readAll();
- delete dev;
- m_text = TQString::fromUtf8(contents.data());
-
- m_data.resize(0);
-}
-
-bool SVGScriptElementImpl::canExecuteScript()
-{
- if(!m_added)
- {
- m_added = true;
- m_text += collectText();
- }
-
- if(m_text.isEmpty() && !getAttribute("href").isNull() && !getAttribute("href").string().isEmpty())
- return false;
-
- return true;
-}
-
-bool SVGScriptElementImpl::executeScript(DOM::Node node)
-{
- return SVGScriptElementImpl::executeScript(node, ownerDoc(), m_text);
-}
-
-bool SVGScriptElementImpl::executeScript(DOM::Node node, SVGDocumentImpl *document, const TQString &text)
-{
-#ifdef KJS_VERBOSE
- kdDebug(6070) << "SVGScriptElementImpl::executeScript n=" << node.nodeName().string().latin1() << "(" << (node.isNull() ? 0 : node.nodeType()) << ") " << text << endl;
-#endif
- KSVGEcma *ecmaEngine = document->ecmaEngine();
-
- if(!ecmaEngine->initialized())
- ecmaEngine->setup();
-
- KJS::Value thisNode = node.isNull() ? ecmaEngine->globalObject() : getDOMNode(ecmaEngine->globalExec(), node);
-
- KJS::UString code(text);
- KJS::Completion comp = ecmaEngine->evaluate(code, thisNode);
-
- // TODO: If that's needed find a better solution which
- // doesn't cause endless loops if the func, specified in
- // onerror="..." isn't yet available
- // onerror support
-// if(comp.complType() == Throw)
-// document->rootElement()->dispatchEvent(SVGEventImpl::ERROR_EVENT, false, false);
-
- return (comp.complType() == KJS::Normal) || (comp.complType() == KJS::ReturnValue);
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGScriptElementImpl::s_hashTable 2
- type SVGScriptElementImpl::Type DontDelete
-@end
-*/
-
-Value SVGScriptElementImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case Type:
- return String(type());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGScriptElementImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case Type:
- setType(value.toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGScriptElementImpl.cpp b/ksvg/impl/SVGScriptElementImpl.cpp
new file mode 100644
index 00000000..f97ebf89
--- /dev/null
+++ b/ksvg/impl/SVGScriptElementImpl.cpp
@@ -0,0 +1,183 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tdeio/job.h>
+#include <kfilterdev.h>
+#include <tqbuffer.h>
+
+#include "SVGDocumentImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGScriptElementImpl.moc"
+
+using namespace KSVG;
+
+#include "SVGScriptElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGScriptElementImpl::SVGScriptElementImpl(DOM::ElementImpl *impl) : TQObject(), SVGElementImpl(impl), SVGURIReferenceImpl(), SVGExternalResourcesRequiredImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_job = 0;
+ m_added = false;
+}
+
+SVGScriptElementImpl::~SVGScriptElementImpl()
+{
+}
+
+void SVGScriptElementImpl::setType(const DOM::DOMString &type)
+{
+ setAttribute("type", type);
+}
+
+DOM::DOMString SVGScriptElementImpl::type() const
+{
+ return getAttribute("type");
+}
+
+void SVGScriptElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: provide a default type
+ if(KSVG_TOKEN_NOT_PARSED(Type))
+ KSVG_SET_ALT_ATTRIBUTE(Type, "text/ecmascript")
+
+ // Remote downloading
+ TQString href = m_href->baseVal().string();
+
+ if(!href.isEmpty())
+ {
+ KURL url(ownerDoc()->baseUrl(), href);
+
+ if(m_job == 0)
+ m_job = TDEIO::get(url, false, false);
+
+ connect(m_job, TQT_SIGNAL(data(TDEIO::Job *, const TQByteArray &)), this, TQT_SLOT(slotData(TDEIO::Job *, const TQByteArray &)));
+ connect(m_job, TQT_SIGNAL(result(TDEIO::Job *)), this, TQT_SLOT(slotResult(TDEIO::Job *)));
+ }
+}
+
+void SVGScriptElementImpl::slotData(TDEIO::Job *, const TQByteArray &data)
+{
+ TQDataStream dataStream(m_data, IO_WriteOnly | IO_Append);
+ dataStream.writeRawBytes(data.data(), data.size());
+}
+
+void SVGScriptElementImpl::slotResult(TDEIO::Job *)
+{
+ m_job = 0;
+
+ // Append a NULL terminator so we don't die
+ m_data.resize(m_data.size() + 1);
+ m_data[m_data.size() - 1] = '\0';
+
+ TQBuffer buf(m_data);
+ TQIODevice *dev = KFilterDev::device(TQT_TQIODEVICE(&buf), "application/x-gzip", false);
+ TQByteArray contents;
+ if(dev->open(IO_ReadOnly))
+ contents = dev->readAll();
+ delete dev;
+ m_text = TQString::fromUtf8(contents.data());
+
+ m_data.resize(0);
+}
+
+bool SVGScriptElementImpl::canExecuteScript()
+{
+ if(!m_added)
+ {
+ m_added = true;
+ m_text += collectText();
+ }
+
+ if(m_text.isEmpty() && !getAttribute("href").isNull() && !getAttribute("href").string().isEmpty())
+ return false;
+
+ return true;
+}
+
+bool SVGScriptElementImpl::executeScript(DOM::Node node)
+{
+ return SVGScriptElementImpl::executeScript(node, ownerDoc(), m_text);
+}
+
+bool SVGScriptElementImpl::executeScript(DOM::Node node, SVGDocumentImpl *document, const TQString &text)
+{
+#ifdef KJS_VERBOSE
+ kdDebug(6070) << "SVGScriptElementImpl::executeScript n=" << node.nodeName().string().latin1() << "(" << (node.isNull() ? 0 : node.nodeType()) << ") " << text << endl;
+#endif
+ KSVGEcma *ecmaEngine = document->ecmaEngine();
+
+ if(!ecmaEngine->initialized())
+ ecmaEngine->setup();
+
+ KJS::Value thisNode = node.isNull() ? ecmaEngine->globalObject() : getDOMNode(ecmaEngine->globalExec(), node);
+
+ KJS::UString code(text);
+ KJS::Completion comp = ecmaEngine->evaluate(code, thisNode);
+
+ // TODO: If that's needed find a better solution which
+ // doesn't cause endless loops if the func, specified in
+ // onerror="..." isn't yet available
+ // onerror support
+// if(comp.complType() == Throw)
+// document->rootElement()->dispatchEvent(SVGEventImpl::ERROR_EVENT, false, false);
+
+ return (comp.complType() == KJS::Normal) || (comp.complType() == KJS::ReturnValue);
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGScriptElementImpl::s_hashTable 2
+ type SVGScriptElementImpl::Type DontDelete
+@end
+*/
+
+Value SVGScriptElementImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case Type:
+ return String(type());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGScriptElementImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case Type:
+ setType(value.toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGScriptElementImpl.h b/ksvg/impl/SVGScriptElementImpl.h
index df7d88c0..2850af9d 100644
--- a/ksvg/impl/SVGScriptElementImpl.h
+++ b/ksvg/impl/SVGScriptElementImpl.h
@@ -87,5 +87,3 @@ KSVG_REGISTER_ELEMENT(SVGScriptElementImpl, "script")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSetElementImpl.cc b/ksvg/impl/SVGSetElementImpl.cc
deleted file mode 100644
index 66460db9..00000000
--- a/ksvg/impl/SVGSetElementImpl.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDocumentImpl.h"
-#include "SVGSetElementImpl.h"
-
-using namespace KSVG;
-
-SVGSetElementImpl::SVGSetElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
-{
-}
-
-SVGSetElementImpl::~SVGSetElementImpl()
-{
-}
-
-void SVGSetElementImpl::setAttributes()
-{
- SVGAnimationElementImpl::setAttributes();
-
- // Always create singleShot timers when used by <set> (Niko)
- // Those are automatically deleted by the scheduler after timeout.
- ownerDoc()->timeScheduler()->addTimer(this, int(getStartTime() * 1000.0));
-}
-
-void SVGSetElementImpl::handleTimerEvent()
-{
- applyAttribute(getAttributeName(), getTo());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSetElementImpl.cpp b/ksvg/impl/SVGSetElementImpl.cpp
new file mode 100644
index 00000000..9e506eac
--- /dev/null
+++ b/ksvg/impl/SVGSetElementImpl.cpp
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDocumentImpl.h"
+#include "SVGSetElementImpl.h"
+
+using namespace KSVG;
+
+SVGSetElementImpl::SVGSetElementImpl(DOM::ElementImpl *impl) : SVGAnimationElementImpl(impl)
+{
+}
+
+SVGSetElementImpl::~SVGSetElementImpl()
+{
+}
+
+void SVGSetElementImpl::setAttributes()
+{
+ SVGAnimationElementImpl::setAttributes();
+
+ // Always create singleShot timers when used by <set> (Niko)
+ // Those are automatically deleted by the scheduler after timeout.
+ ownerDoc()->timeScheduler()->addTimer(this, int(getStartTime() * 1000.0));
+}
+
+void SVGSetElementImpl::handleTimerEvent()
+{
+ applyAttribute(getAttributeName(), getTo());
+}
diff --git a/ksvg/impl/SVGSetElementImpl.h b/ksvg/impl/SVGSetElementImpl.h
index 0a0c050c..4a260fae 100644
--- a/ksvg/impl/SVGSetElementImpl.h
+++ b/ksvg/impl/SVGSetElementImpl.h
@@ -50,5 +50,3 @@ KSVG_REGISTER_ELEMENT(SVGSetElementImpl, "set")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGShapeImpl.cc b/ksvg/impl/SVGShapeImpl.cc
deleted file mode 100644
index d8ef45c5..00000000
--- a/ksvg/impl/SVGShapeImpl.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGPaint.h"
-
-#include "SVGRectImpl.h"
-#include "SVGEventImpl.h"
-#include "SVGShapeImpl.h"
-#include "SVGPaintImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGClipPathElementImpl.h"
-#include "SVGAnimatedLengthListImpl.h"
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-SVGShapeImpl::SVGShapeImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- m_item = 0;
-}
-
-SVGShapeImpl::~SVGShapeImpl()
-{
- if(hasChildNodes())
- {
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGShapeImpl *rend = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
- if(rend)
- rend->deref();
- }
- }
-}
-
-bool SVGShapeImpl::directRender()
-{
- SVGShapeImpl *parent = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(parentNode().handle()));
- if(parent)
- return parent->directRender();
- else
- return true;
-}
-
-SVGRectImpl *SVGShapeImpl::getBBox()
-{
- SVGRectImpl *rect = SVGSVGElementImpl::createSVGRect();
- return rect;
-}
-
-SVGRectImpl *SVGShapeImpl::getBBoxInternal()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- if(m_item)
- {
- TQRect r = m_item->bbox();
- ret->setX(r.x());
- ret->setY(r.y());
- ret->setWidth(r.width());
- ret->setHeight(r.height());
- }
- return ret;
-}
-
-bool SVGShapeImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &, SVGMouseEventImpl *mev)
-{
- // TODO : pointer-events should be stored here, not in SVGStylableImpl.
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
- if(!style || style->getPointerEvents() == PE_NONE)
- return false;
- bool testFill = false;
- bool testStroke = false;
- switch(style->getPointerEvents())
- {
- case PE_VISIBLE: testFill = testStroke = style->getVisible(); break;
- case PE_VISIBLE_PAINTED: testStroke = style->getVisible() && style->isStroked();
- case PE_VISIBLE_FILL: testFill = style->getVisible() && style->isFilled(); break;
- case PE_VISIBLE_STROKE: testStroke = style->getVisible() && style->isStroked(); break;
- case PE_PAINTED: testStroke = style->isStroked();
- case PE_FILL: testFill = style->isFilled(); break;
- case PE_STROKE: testStroke = style->isStroked(); break;
- case PE_ALL:
- default: testFill = testStroke = true;
- };
-
- if(testFill || testStroke)
- {
- if((testFill && m_item->fillContains(p)) || (testStroke && m_item->strokeContains(p)))
- {
- mev->setTarget(this);
- return true;
- }
- }
-
- return false;
-}
-
-void SVGShapeImpl::update(CanvasItemUpdate reason, int param1, int param2)
-{
- if(m_item)
- m_item->update(reason, param1, param2);
-}
-
-void SVGShapeImpl::invalidate(KSVGCanvas *c, bool recalc)
-{
- if(m_item && c)
- c->invalidate(m_item, recalc);
-}
-
-void SVGShapeImpl::setReferenced(bool referenced)
-{
- if(m_item)
- m_item->setReferenced(referenced);
-}
-
-void SVGShapeImpl::draw()
-{
- if(m_item)
- m_item->draw();
-}
-
-void SVGShapeImpl::blit(KSVGCanvas *c)
-{
- SVGRectImpl *rect = getBBoxInternal();
- c->blit(rect->qrect(), true);
- rect->deref();
-}
-
-void SVGShapeImpl::removeItem(KSVGCanvas *c)
-{
- if(m_item && c)
- {
- c->removeItem(m_item);
- m_item = 0;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGShapeImpl.cpp b/ksvg/impl/SVGShapeImpl.cpp
new file mode 100644
index 00000000..dc9b728f
--- /dev/null
+++ b/ksvg/impl/SVGShapeImpl.cpp
@@ -0,0 +1,160 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGPaint.h"
+
+#include "SVGRectImpl.h"
+#include "SVGEventImpl.h"
+#include "SVGShapeImpl.h"
+#include "SVGPaintImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGClipPathElementImpl.h"
+#include "SVGAnimatedLengthListImpl.h"
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+SVGShapeImpl::SVGShapeImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ m_item = 0;
+}
+
+SVGShapeImpl::~SVGShapeImpl()
+{
+ if(hasChildNodes())
+ {
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGShapeImpl *rend = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(node.handle()));
+ if(rend)
+ rend->deref();
+ }
+ }
+}
+
+bool SVGShapeImpl::directRender()
+{
+ SVGShapeImpl *parent = dynamic_cast<SVGShapeImpl *>(ownerDoc()->getElementFromHandle(parentNode().handle()));
+ if(parent)
+ return parent->directRender();
+ else
+ return true;
+}
+
+SVGRectImpl *SVGShapeImpl::getBBox()
+{
+ SVGRectImpl *rect = SVGSVGElementImpl::createSVGRect();
+ return rect;
+}
+
+SVGRectImpl *SVGShapeImpl::getBBoxInternal()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ if(m_item)
+ {
+ TQRect r = m_item->bbox();
+ ret->setX(r.x());
+ ret->setY(r.y());
+ ret->setWidth(r.width());
+ ret->setHeight(r.height());
+ }
+ return ret;
+}
+
+bool SVGShapeImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &, SVGMouseEventImpl *mev)
+{
+ // TODO : pointer-events should be stored here, not in SVGStylableImpl.
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
+ if(!style || style->getPointerEvents() == PE_NONE)
+ return false;
+ bool testFill = false;
+ bool testStroke = false;
+ switch(style->getPointerEvents())
+ {
+ case PE_VISIBLE: testFill = testStroke = style->getVisible(); break;
+ case PE_VISIBLE_PAINTED: testStroke = style->getVisible() && style->isStroked();
+ case PE_VISIBLE_FILL: testFill = style->getVisible() && style->isFilled(); break;
+ case PE_VISIBLE_STROKE: testStroke = style->getVisible() && style->isStroked(); break;
+ case PE_PAINTED: testStroke = style->isStroked();
+ case PE_FILL: testFill = style->isFilled(); break;
+ case PE_STROKE: testStroke = style->isStroked(); break;
+ case PE_ALL:
+ default: testFill = testStroke = true;
+ };
+
+ if(testFill || testStroke)
+ {
+ if((testFill && m_item->fillContains(p)) || (testStroke && m_item->strokeContains(p)))
+ {
+ mev->setTarget(this);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void SVGShapeImpl::update(CanvasItemUpdate reason, int param1, int param2)
+{
+ if(m_item)
+ m_item->update(reason, param1, param2);
+}
+
+void SVGShapeImpl::invalidate(KSVGCanvas *c, bool recalc)
+{
+ if(m_item && c)
+ c->invalidate(m_item, recalc);
+}
+
+void SVGShapeImpl::setReferenced(bool referenced)
+{
+ if(m_item)
+ m_item->setReferenced(referenced);
+}
+
+void SVGShapeImpl::draw()
+{
+ if(m_item)
+ m_item->draw();
+}
+
+void SVGShapeImpl::blit(KSVGCanvas *c)
+{
+ SVGRectImpl *rect = getBBoxInternal();
+ c->blit(rect->qrect(), true);
+ rect->deref();
+}
+
+void SVGShapeImpl::removeItem(KSVGCanvas *c)
+{
+ if(m_item && c)
+ {
+ c->removeItem(m_item);
+ m_item = 0;
+ }
+}
diff --git a/ksvg/impl/SVGShapeImpl.h b/ksvg/impl/SVGShapeImpl.h
index c61038d2..a76c6d03 100644
--- a/ksvg/impl/SVGShapeImpl.h
+++ b/ksvg/impl/SVGShapeImpl.h
@@ -69,5 +69,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStopElementImpl.cc b/ksvg/impl/SVGStopElementImpl.cc
deleted file mode 100644
index 09761232..00000000
--- a/ksvg/impl/SVGStopElementImpl.cc
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include "SVGLengthImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGStopElementImpl.h"
-#include "SVGAnimatedNumberImpl.h"
-#include "SVGColorImpl.h"
-
-using namespace KSVG;
-
-#include "SVGStopElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGStopElementImpl::SVGStopElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this)
-{
- KSVG_EMPTY_FLAGS
-
- m_offset = new SVGAnimatedNumberImpl();
- m_offset->ref();
-
- m_stopOpacity = 1;
-}
-
-SVGStopElementImpl::~SVGStopElementImpl()
-{
- if(m_offset)
- m_offset->deref();
-}
-
-SVGAnimatedNumberImpl *SVGStopElementImpl::offset() const
-{
- return m_offset;
-}
-
-float SVGStopElementImpl::stopOpacity() const
-{
- return m_stopOpacity;
-}
-
-
-/*
-@namespace KSVG
-@begin SVGStopElementImpl::s_hashTable 3
- offset SVGStopElementImpl::Offset DontDelete|ReadOnly
- stop-opacity SVGStopElementImpl::StopOpacity DontDelete|ReadOnly
-@end
-*/
-
-Value SVGStopElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Offset:
- if(!attributeMode)
- return m_offset->cache(exec);
- else
- return Number(m_offset->baseVal());
- case StopOpacity:
- if(!attributeMode)
- return Undefined();
- else
- return Number(m_stopOpacity);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGStopElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Offset:
- float temp;
- SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), temp);
- offset()->setBaseVal(temp);
- break;
- case StopOpacity:
- {
- SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_stopOpacity);
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGStopElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not set, specifiy 0
- if(KSVG_TOKEN_NOT_PARSED(Offset))
- KSVG_SET_ALT_ATTRIBUTE(Offset, "0")
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStopElementImpl.cpp b/ksvg/impl/SVGStopElementImpl.cpp
new file mode 100644
index 00000000..f15fb0a6
--- /dev/null
+++ b/ksvg/impl/SVGStopElementImpl.cpp
@@ -0,0 +1,123 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "SVGLengthImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGStopElementImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGColorImpl.h"
+
+using namespace KSVG;
+
+#include "SVGStopElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGStopElementImpl::SVGStopElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGStylableImpl(this)
+{
+ KSVG_EMPTY_FLAGS
+
+ m_offset = new SVGAnimatedNumberImpl();
+ m_offset->ref();
+
+ m_stopOpacity = 1;
+}
+
+SVGStopElementImpl::~SVGStopElementImpl()
+{
+ if(m_offset)
+ m_offset->deref();
+}
+
+SVGAnimatedNumberImpl *SVGStopElementImpl::offset() const
+{
+ return m_offset;
+}
+
+float SVGStopElementImpl::stopOpacity() const
+{
+ return m_stopOpacity;
+}
+
+
+/*
+@namespace KSVG
+@begin SVGStopElementImpl::s_hashTable 3
+ offset SVGStopElementImpl::Offset DontDelete|ReadOnly
+ stop-opacity SVGStopElementImpl::StopOpacity DontDelete|ReadOnly
+@end
+*/
+
+Value SVGStopElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Offset:
+ if(!attributeMode)
+ return m_offset->cache(exec);
+ else
+ return Number(m_offset->baseVal());
+ case StopOpacity:
+ if(!attributeMode)
+ return Undefined();
+ else
+ return Number(m_stopOpacity);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGStopElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Offset:
+ float temp;
+ SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), temp);
+ offset()->setBaseVal(temp);
+ break;
+ case StopOpacity:
+ {
+ SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_stopOpacity);
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGStopElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not set, specifiy 0
+ if(KSVG_TOKEN_NOT_PARSED(Offset))
+ KSVG_SET_ALT_ATTRIBUTE(Offset, "0")
+}
diff --git a/ksvg/impl/SVGStopElementImpl.h b/ksvg/impl/SVGStopElementImpl.h
index 369b7867..a51070a5 100644
--- a/ksvg/impl/SVGStopElementImpl.h
+++ b/ksvg/impl/SVGStopElementImpl.h
@@ -66,5 +66,3 @@ KSVG_REGISTER_ELEMENT(SVGStopElementImpl, "stop")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStringListImpl.cc b/ksvg/impl/SVGStringListImpl.cc
deleted file mode 100644
index 58a0dc0f..00000000
--- a/ksvg/impl/SVGStringListImpl.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGStringListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGStringListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SharedString::s_hashTable 2
- dummy SharedString::Dummy DontDelete|ReadOnly
-@end
-*/
-
-/*
-@namespace KSVG
-@begin SVGStringListImpl::s_hashTable 2
- numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGStringListImplProto::s_hashTable 11
- getItem SVGListDefs::GetItem DontDelete|Function 1
- removeItem SVGListDefs::RemoveItem DontDelete|Function 1
- appendItem SVGListDefs::AppendItem DontDelete|Function 1
- initialize SVGListDefs::Initialize DontDelete|Function 1
- insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
- replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
- clear SVGListDefs::Clear DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGStringList", SVGStringListImplProto, SVGStringListImplProtoFunc)
-
-Value SVGStringListImpl::getValueProperty(ExecState *exec, int token) const
-{
- return SVGList<SharedString>::getValueProperty(exec, token);
-}
-
-Value SVGStringListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGStringListImpl)
-
- return obj->call(exec, static_cast<SVGList<SharedString> *>(obj), args, id);
-}
-
-TQString SVGStringListImpl::join(const TQString &seperator) const
-{
- SVGStringListImpl *self = const_cast<SVGStringListImpl *>(this);
-
- TQString result;
-
- if(!self->getItem(0))
- return result;
- else
- result += self->getItem(0)->string();
-
- for(unsigned int i = 1; i <= numberOfItems(); i++)
- {
- DOM::DOMString *string = self->getItem(i);
-
- if(string)
- result += seperator + string->string();
- }
-
- return result;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStringListImpl.cpp b/ksvg/impl/SVGStringListImpl.cpp
new file mode 100644
index 00000000..331b4393
--- /dev/null
+++ b/ksvg/impl/SVGStringListImpl.cpp
@@ -0,0 +1,91 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGStringListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGStringListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SharedString::s_hashTable 2
+ dummy SharedString::Dummy DontDelete|ReadOnly
+@end
+*/
+
+/*
+@namespace KSVG
+@begin SVGStringListImpl::s_hashTable 2
+ numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGStringListImplProto::s_hashTable 11
+ getItem SVGListDefs::GetItem DontDelete|Function 1
+ removeItem SVGListDefs::RemoveItem DontDelete|Function 1
+ appendItem SVGListDefs::AppendItem DontDelete|Function 1
+ initialize SVGListDefs::Initialize DontDelete|Function 1
+ insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
+ replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
+ clear SVGListDefs::Clear DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGStringList", SVGStringListImplProto, SVGStringListImplProtoFunc)
+
+Value SVGStringListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ return SVGList<SharedString>::getValueProperty(exec, token);
+}
+
+Value SVGStringListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGStringListImpl)
+
+ return obj->call(exec, static_cast<SVGList<SharedString> *>(obj), args, id);
+}
+
+TQString SVGStringListImpl::join(const TQString &seperator) const
+{
+ SVGStringListImpl *self = const_cast<SVGStringListImpl *>(this);
+
+ TQString result;
+
+ if(!self->getItem(0))
+ return result;
+ else
+ result += self->getItem(0)->string();
+
+ for(unsigned int i = 1; i <= numberOfItems(); i++)
+ {
+ DOM::DOMString *string = self->getItem(i);
+
+ if(string)
+ result += seperator + string->string();
+ }
+
+ return result;
+}
diff --git a/ksvg/impl/SVGStringListImpl.h b/ksvg/impl/SVGStringListImpl.h
index 8d92b660..a4f510ac 100644
--- a/ksvg/impl/SVGStringListImpl.h
+++ b/ksvg/impl/SVGStringListImpl.h
@@ -78,5 +78,3 @@ KSVG_DEFINE_PROTOTYPE(SVGStringListImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGStringListImplProtoFunc, SVGStringListImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStylableImpl.cc b/ksvg/impl/SVGStylableImpl.cc
deleted file mode 100644
index c03c6f19..00000000
--- a/ksvg/impl/SVGStylableImpl.cc
+++ /dev/null
@@ -1,1309 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqrect.h>
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-#include "SVGPaint.h"
-#include "SVGColorImpl.h"
-#include "SVGPaintImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGLengthImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGStylableImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGStringListImpl.h"
-#include "SVGImageElementImpl.h"
-#include "SVGURIReferenceImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGColorProfileElementImpl.h"
-#include "SVGAnimatedLengthListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGStylableImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGStylableImpl::SVGStylableImpl(SVGElementImpl *object) : m_object(object)
-{
- KSVG_EMPTY_FLAGS
-
- // View propidx.html, if you want to verify those default values (Niko)
- m_flags = SVG_STYLE_FLAG_NONE;
-
- // Initialize all pointers to 0
- // Important!
- m_color = 0;
- m_fillColor = 0;
- m_stopColor = 0;
- m_dashArray = 0;
- m_dashOffset = 0;
- m_strokeWidth = 0;
- m_strokeColor = 0;
- m_fontFamily = 0;
-
- m_fillOpacity = 1;
- m_strokeOpacity = 1;
- m_opacity = 1;
-
- // Special case, getFontSize() could be accessed
- // _before_ processStyle() is called -> no default
- // value for font-size yet -> crash
- // SVGLengthImpl access it when parsing em/ex values (Niko)
- m_fontSize = -1;
-}
-
-SVGStylableImpl::~SVGStylableImpl()
-{
- if(m_strokeWidth)
- m_strokeWidth->deref();
- if(m_fontFamily)
- m_fontFamily->deref();
- if(m_strokeColor)
- m_strokeColor->deref();
- if(m_fillColor)
- m_fillColor->deref();
- if(m_color)
- m_color->deref();
- if(m_stopColor)
- m_stopColor->deref();
- if(m_dashOffset)
- m_dashOffset->deref();
- if(m_dashArray)
- m_dashArray->deref();
-}
-
-void SVGStylableImpl::processStyle()
-{
- SVGStylableImpl *parentStyle = 0;
- if(m_object && m_object->ownerDoc())
- parentStyle = dynamic_cast<SVGStylableImpl *>(m_object->ownerDoc()->getElementFromHandle((*m_object).parentNode().handle()));
-
- // Spec: default "none"
- if(~m_flags & SVG_STYLE_FLAG_STROKE)
- {
- m_strokeColor = new SVGPaintImpl(m_object);
- m_strokeColor->ref();
-
- SVGPaintImpl *strokeColor = 0L;
- if(parentStyle)
- strokeColor = parentStyle->getStrokeColor();
-
- if(strokeColor)
- *m_strokeColor = *strokeColor;
- else
- m_strokeColor->setPaint(SVG_PAINTTYPE_NONE);
- }
-
- // Spec: default "black"
- if(~m_flags & SVG_STYLE_FLAG_FILL)
- {
- m_fillColor = new SVGPaintImpl(m_object);
- m_fillColor->ref();
-
- SVGPaintImpl *fillColor = 0;
- if(parentStyle)
- fillColor = parentStyle->getFillColor();
-
- if(fillColor)
- *m_fillColor = *fillColor;
- else
- m_fillColor->setRGBColor(DOM::DOMString("black"));
- }
-
- // Spec: no real default
- if(~m_flags & SVG_STYLE_FLAG_COLOR)
- {
- m_color = new SVGColorImpl(m_object);
- m_color->ref();
- SVGColorImpl *color = 0;
- if(parentStyle)
- color = parentStyle->getColor();
-
- if(color)
- *m_color = *color;
- }
-
- // Spec: default sRGB
- if(~m_flags & SVG_STYLE_FLAG_COLOR_INTERPOLATION)
- {
- if(parentStyle)
- m_colorInterpolation = parentStyle->getColorInterpolation();
- else
- m_colorInterpolation = CI_SRGB;
- }
-
- // Spec: default "1"
- if(~m_flags & SVG_STYLE_FLAG_STROKE_WIDTH)
- {
- m_strokeWidth = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
- m_strokeWidth->ref();
-
- SVGAnimatedLengthImpl *strokeWidth = 0;
- if(parentStyle)
- strokeWidth = parentStyle->getStrokeWidth();
-
- if(strokeWidth)
- *m_strokeWidth = *strokeWidth;
- else
- m_strokeWidth->baseVal()->setValue(1.0);
- }
-
- // Spec: default "4"
- if(~m_flags & SVG_STYLE_FLAG_STROKE_MITER_LIMIT)
- {
- if(parentStyle)
- m_strokeMiterlimit = parentStyle->getStrokeMiterlimit();
- else
- m_strokeMiterlimit = 4;
- }
-
- // Spec: default "butt"
- if(~m_flags & SVG_STYLE_FLAG_STROKE_LINE_CAP)
- {
- if(parentStyle)
- m_capStyle = parentStyle->getCapStyle();
- else
- m_capStyle = PATH_STROKE_CAP_BUTT;
- }
-
- // Spec: default "miter"
- if(~m_flags & SVG_STYLE_FLAG_STROKE_LINE_JOIN)
- {
- if(parentStyle)
- m_joinStyle = parentStyle->getJoinStyle();
- else
- m_joinStyle = PATH_STROKE_JOIN_MITER;
- }
-
- // Spec: default "auto"
- if(~m_flags & SVG_STYLE_FLAG_CURSOR)
- {
- if(parentStyle)
- m_cursor = parentStyle->getCursor();
- else
- m_cursor = CURSOR_AUTO;
- }
-
- // Spec: default "visiblePainted"
- if(~m_flags & SVG_STYLE_FLAG_POINTER_EVENTS)
- {
- if(parentStyle)
- m_pointerEvents = parentStyle->getPointerEvents();
- else
- m_pointerEvents = PE_VISIBLE_PAINTED;
- }
-
- // Spec: default "0"
- if(~m_flags & SVG_STYLE_FLAG_STROKE_DASH_OFFSET)
- {
- m_dashOffset = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
- m_dashOffset->ref();
-
- SVGAnimatedLengthImpl *dashOffset = 0;
- if(parentStyle)
- dashOffset = parentStyle->getDashOffset();
-
- if(dashOffset)
- *m_dashOffset = *dashOffset;
- else
- m_dashOffset->baseVal()->setValue(0);
- }
-
- // Spec: default "none" -> 0 == empty dash array
- if(~m_flags & SVG_STYLE_FLAG_STROKE_DASH_ARRAY)
- {
- SVGAnimatedLengthListImpl *dashArray = 0;
- if(parentStyle)
- dashArray = parentStyle->getDashArray();
-
- if(dashArray)
- {
- if (!m_dashArray)
- {
- m_dashArray = new SVGAnimatedLengthListImpl();
- m_dashArray->ref();
- }
- *m_dashArray = *dashArray;
- }
- else
- m_dashArray = 0;
- }
-
- // Spec: default "1" -> 1 == Not opaque
- if(~m_flags & SVG_STYLE_FLAG_FILL_OPACITY)
- {
- if(parentStyle)
- m_fillOpacity = parentStyle->getFillOpacity();
- else
- m_fillOpacity = 1;
- }
-
- if(~m_flags & SVG_STYLE_FLAG_STROKE_OPACITY)
- {
- if(parentStyle)
- m_strokeOpacity = parentStyle->getStrokeOpacity();
- else
- m_strokeOpacity = 1;
- }
-
- // Fake group opacity by multiplying by our parent's group opacity
- if(~m_flags & SVG_STYLE_FLAG_OPACITY)
- {
- if(parentStyle)
- m_opacity = parentStyle->getOpacity();
- else
- m_opacity = 1;
- }
- else
- if(parentStyle)
- m_opacity *= parentStyle->getOpacity();
-
- if(~m_flags & SVG_STYLE_FLAG_CLIP_PATH)
- m_clipPath = "";
-
- if(~m_flags & SVG_STYLE_FLAG_MASK)
- m_mask = "";
-
- // Spec: default "nonzero"
- if(~m_flags & SVG_STYLE_FLAG_FILL_RULE)
- {
- if(parentStyle)
- m_fillRule = parentStyle->getFillRule();
- else
- m_fillRule = RULE_NONZERO;
- }
-
- if(~m_flags & SVG_STYLE_FLAG_CLIP_RULE)
- {
- if(parentStyle)
- m_clipRule = parentStyle->getClipRule();
- else
- m_clipRule = RULE_NONZERO;
- }
-
- // Spec: default "hidden"
- if(~m_flags & SVG_STYLE_FLAG_OVERFLOW)
- {
- if(parentStyle)
- m_overflow = parentStyle->getOverflow();
- else
- m_overflow = false;
- }
-
- // We are not really, spec compatible here, we just
- // define a bool, to indicate wheter an element should
- // be rendered or not.
- if(~m_flags & SVG_STYLE_FLAG_DISPLAY)
- m_display = true;
-
- if(~m_flags & SVG_STYLE_FLAG_VISIBILITY)
- {
- if(parentStyle)
- m_visible = parentStyle->getVisible();
- else
- m_visible = true;
- }
-
- // Spec: default "medium"
- if(~m_flags & SVG_STYLE_FLAG_FONT_SIZE)
- {
- if(parentStyle)
- m_fontSize = parentStyle->getFontSize();
- else
- m_fontSize = fontSizeForText("medium");
- }
-
- // Spec: default "depends on user agent" -> "Arial" for SVG
- if(~m_flags & SVG_STYLE_FLAG_FONT_FAMILY)
- {
- if(!m_fontFamily)
- {
- m_fontFamily = new SVGStringListImpl();
- m_fontFamily->ref();
- }
-
- SVGStringListImpl *fontFamily = 0;
- if(parentStyle)
- fontFamily = parentStyle->getFontFamily();
-
- if(fontFamily)
- *m_fontFamily = *fontFamily;
- else
- {
- SharedString *string = new SharedString("Arial");
- string->ref();
-
- m_fontFamily->appendItem(string);
- }
- }
-
- // Spec: default "normal"
- if(~m_flags & SVG_STYLE_FLAG_FONT_STYLE)
- {
- if(parentStyle)
- m_fontStyle = parentStyle->getFontStyle();
- else
- m_fontStyle = FSNORMAL;
- }
-
- // Spec: default "normal"
- if(~m_flags & SVG_STYLE_FLAG_FONT_WEIGHT)
- {
- if(parentStyle)
- m_fontWeight = parentStyle->getFontWeight();
- else
- m_fontWeight = "normal";
- }
-
- // Spec: default "start"
- if(~m_flags & SVG_STYLE_FLAG_TEXT_ANCHOR)
- {
- if(parentStyle)
- m_textAnchor = parentStyle->getTextAnchor();
- else
- m_textAnchor = TASTART;
- }
-
- // Spec: default "LTR"
- if(~m_flags & SVG_STYLE_FLAG_TEXT_DIRECTION)
- {
- if(parentStyle)
- m_textDirection = parentStyle->getTextDirection();
- else
- m_textDirection = LTR;
- }
-
- // Spec: default "none"
- if(~m_flags & SVG_STYLE_FLAG_TEXT_DECORATION)
- {
- if(parentStyle)
- m_textDecoration = parentStyle->getTextDecoration();
- else
- m_textDecoration = TDNONE;
- }
-
- // Spec: default "baseline"
- if(~m_flags & SVG_STYLE_FLAG_BASELINE_SHIFT)
- {
- if(parentStyle)
- m_baselineShift = parentStyle->getBaselineShift();
- else
- m_baselineShift = "baseline";
- }
-
- // Spec: default "lr-tb", FIXME
- if(~m_flags & SVG_STYLE_FLAG_TEXT_WRITING_MODE)
- {
- if(parentStyle)
- m_textWritingMode = parentStyle->getTextWritingMode();
- else
- m_textWritingMode = LR;
- }
-
- // Spec: default "normal"
- if(~m_flags & SVG_STYLE_FLAG_TEXT_UNICODE_BIDI)
- {
- if(parentStyle)
- m_textUnicodeBidi = parentStyle->getTextUnicodeBidi();
- else
- m_textUnicodeBidi = UBNORMAL;
- }
-
- // Spec: default "auto"
- if(~m_flags & SVG_STYLE_FLAG_GLYPH_ORIENTATION_VERTICAL)
- {
- if(parentStyle)
- m_glyphOrientationVertical = parentStyle->getGlyphOrientationVertical();
- else
- m_glyphOrientationVertical = "auto";
- }
-
- // Spec: default "auto"
- if(~m_flags & SVG_STYLE_FLAG_GLYPH_ORIENTATION_HORIZONTAL)
- {
- if(parentStyle)
- m_glyphOrientationHorizontal = parentStyle->getGlyphOrientationHorizontal();
- else
- m_glyphOrientationHorizontal = "auto";
- }
-
- // Spec: default "normal"
- if(~m_flags & SVG_STYLE_FLAG_LETTER_SPACING)
- {
- if(parentStyle)
- m_letterSpacing = parentStyle->getLetterSpacing();
- else
- m_letterSpacing = "normal";
- }
-
- // Spec: default "normal"
- if(~m_flags & SVG_STYLE_FLAG_WORD_SPACING)
- {
- if(parentStyle)
- m_wordSpacing = parentStyle->getWordSpacing();
- else
- m_wordSpacing = "normal";
- }
-
- // Spec: default "black"
- if(~m_flags & SVG_STYLE_FLAG_STOP)
- {
- m_stopColor = new SVGColorImpl(m_object);
- m_stopColor->ref();
-
- m_stopColor->setRGBColor(DOM::DOMString("black"));
- }
-
- // Spec: default "none"
- if(~m_flags & SVG_STYLE_FLAG_MARKER_START)
- {
- if(parentStyle)
- m_startMarker = parentStyle->getStartMarker();
- else
- m_startMarker = TQString();
- }
-
- // Spec: default "none"
- if(~m_flags & SVG_STYLE_FLAG_MARKER_MID)
- {
- if(parentStyle)
- m_midMarker = parentStyle->getMidMarker();
- else
- m_midMarker = TQString();
- }
-
- // Spec: default "none"
- if(~m_flags & SVG_STYLE_FLAG_MARKER_END)
- {
- if(parentStyle)
- m_endMarker = parentStyle->getEndMarker();
- else
- m_endMarker = TQString();
- }
-}
-
-bool SVGStylableImpl::isStroked() const
-{
- if(!m_strokeColor)
- return false;
-
- return m_strokeColor->paintType() != SVG_PAINTTYPE_UNKNOWN &&
- m_strokeColor->paintType() != SVG_PAINTTYPE_NONE &&
- m_strokeColor->paintType() != SVG_PAINTTYPE_URI_NONE;
-}
-
-bool SVGStylableImpl::isFilled() const
-{
- if(!m_fillColor)
- return false;
-
- return m_fillColor->paintType() != SVG_PAINTTYPE_UNKNOWN &&
- m_fillColor->paintType() != SVG_PAINTTYPE_NONE &&
- m_fillColor->paintType() != SVG_PAINTTYPE_URI_NONE;
-}
-
-TQString SVGStylableImpl::extractUrlId(const TQString &url)
-{
- TQString id;
-
- if(url.startsWith("url(#"))
- {
- int idstart = url.find("#") + 1;
- id = url.mid(idstart, url.length() - idstart - 1);
- }
- else
- id = url;
-
- return id;
-}
-
-void SVGStylableImpl::setMarkers(const TQString &marker)
-{
- setStartMarker(marker);
- setMidMarker(marker);
- setEndMarker(marker);
-}
-
-void SVGStylableImpl::setStartMarker(const TQString &startMarker)
-{
- if(startMarker.startsWith("url(#"))
- {
- int idstart = startMarker.find("#") + 1;
- m_startMarker = startMarker.mid(idstart, startMarker.length() - idstart - 1);
- }
- else if(startMarker == "none")
- m_startMarker = TQString();
-}
-
-void SVGStylableImpl::setMidMarker(const TQString &midMarker)
-{
- if(midMarker.startsWith("url(#"))
- {
- int idstart = midMarker.find("#") + 1;
- m_midMarker = midMarker.mid(idstart, midMarker.length() - idstart - 1);
- }
- else if(midMarker == "none")
- m_midMarker = TQString();
-}
-
-void SVGStylableImpl::setEndMarker(const TQString &endMarker)
-{
- if(endMarker.startsWith("url(#"))
- {
- int idstart = endMarker.find("#") + 1;
- m_endMarker = endMarker.mid(idstart, endMarker.length() - idstart - 1);
- }
- else if(endMarker == "none")
- m_endMarker = TQString();
-}
-
-bool SVGStylableImpl::hasMarkers() const
-{
- return !m_startMarker.isEmpty() || !m_midMarker.isEmpty() || !m_endMarker.isEmpty();
-}
-
-void SVGStylableImpl::setPaint(const TQString &param, SVGPaintImpl *svgPaint)
-{
- if(param.stripWhiteSpace() == "none")
- svgPaint->setPaint(SVG_PAINTTYPE_NONE, DOM::DOMString(""), DOM::DOMString(""));
- else if(SVGURIReferenceImpl::isUrl(param))
- svgPaint->setUri(SVGURIReferenceImpl::getTarget(param));
- else
- setColor(param, svgPaint);
-}
-
-void SVGStylableImpl::setColor(const TQString &param, SVGColorImpl *svgColor)
-{
- if(param.stripWhiteSpace().startsWith("#"))
- {
- if(param.contains("icc-color"))
- {
- TQString first = param.left(7);
- TQString last = param.right(param.length() - 8);
-
- svgColor->setRGBColorICCColor(first, last);
- }
- else
- {
- TQColor color;
- color.setNamedColor(param.stripWhiteSpace());
- svgColor->setRGBColor(color);
- }
- }
- else if(param.stripWhiteSpace().startsWith("rgb("))
- {
- TQString parse = param.stripWhiteSpace();
- TQStringList colors = TQStringList::split(',', parse);
- TQString r = colors[0].right((colors[0].length() - 4));
- TQString g = colors[1];
- TQString b = colors[2].left((colors[2].length() - 1));
-
- if(r.contains("%"))
- {
- r = r.left(r.length() - 1);
- r = TQString::number(int((double(255 * r.toDouble()) / 100.0)));
- }
-
- if(g.contains("%"))
- {
- g = g.left(g.length() - 1);
- g = TQString::number(int((double(255 * g.toDouble()) / 100.0)));
- }
-
- if(b.contains("%"))
- {
- b = b.left(b.length() - 1);
- b = TQString::number(int((double(255 * b.toDouble()) / 100.0)));
- }
-
- svgColor->setRGBColor(int(r.toFloat()), int(g.toFloat()), int(b.toFloat()));
- }
- else
- {
- if(param.stripWhiteSpace().lower() == "currentcolor")
- svgColor->setColor(SVG_COLORTYPE_CURRENTCOLOR, DOM::DOMString(""), DOM::DOMString(""));
- else
- svgColor->setRGBColor(DOM::DOMString(param.stripWhiteSpace().lower()));
- }
-}
-
-TQRect SVGStylableImpl::clip()
-{
- return TQRect();
-}
-
-void SVGStylableImpl::setClip(const TQString &)
-{
-}
-
-float SVGStylableImpl::fontSizeForText(const TQString &value)
-{
- float ret = -1;
-
- // Spec: "On a computer screen a scaling factor of 1.2 is suggested between adjacent indexes"
- const float factor = 1.2;
-
- // Spec: "If the 'medium' font is 12pt, the 'large' font could be 14.4pt."
- const float mediumFont = 12.0;
-
- if(value == "xx-small")
- ret = mediumFont - (3.0 * factor);
- else if(value == "x-small")
- ret = mediumFont - (2.0 * factor);
- else if(value == "small")
- ret = mediumFont - factor;
- else if(value == "medium")
- ret = mediumFont;
- else if(value == "large")
- ret = mediumFont + factor;
- else if(value == "x-large")
- ret = mediumFont + (2.0 * factor);
- else if(value == "xx-large")
- ret = mediumFont + (3.0 * factor);
-
- return ret;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGStylableImpl::s_hashTable 47
- className SVGStylableImpl::ClassName DontDelete|ReadOnly
- style SVGStylableImpl::Style DontDelete|ReadOnly
- stroke-width SVGStylableImpl::StrokeWidth DontDelete|ReadOnly
- stroke-miterlimit SVGStylableImpl::StrokeMiterlimit DontDelete|ReadOnly
- stroke-linecap SVGStylableImpl::StrokeLineCap DontDelete|ReadOnly
- stroke-linejoin SVGStylableImpl::StrokeLineJoin DontDelete|ReadOnly
- stroke SVGStylableImpl::Stroke DontDelete|ReadOnly
- fill SVGStylableImpl::Fill DontDelete|ReadOnly
- color SVGStylableImpl::Color DontDelete|ReadOnly
- stop-color SVGStylableImpl::StopColor DontDelete|ReadOnly
- font-size SVGStylableImpl::FontSize DontDelete|ReadOnly
- font-family SVGStylableImpl::FontFamily DontDelete|ReadOnly
- font-weight SVGStylableImpl::FontWeight DontDelete|ReadOnly
- font-style SVGStylableImpl::FontStyle DontDelete|ReadOnly
- text-decoration SVGStylableImpl::TextDecoration DontDelete|ReadOnly
- text-anchor SVGStylableImpl::TextAnchor DontDelete|ReadOnly
- direction SVGStylableImpl::Direction DontDelete|ReadOnly
- writing-mode SVGStylableImpl::WritingMode DontDelete|ReadOnly
- unicode-bidi SVGStylableImpl::UnicodeBidi DontDelete|ReadOnly
- opacity SVGStylableImpl::Opacity DontDelete|ReadOnly
- fill-opacity SVGStylableImpl::FillOpacity DontDelete|ReadOnly
- stroke-opacity SVGStylableImpl::StrokeOpacity DontDelete|ReadOnly
- clip-path SVGStylableImpl::ClipPath DontDelete|ReadOnly
- marker-start SVGStylableImpl::MarkerStart DontDelete|ReadOnly
- marker-mid SVGStylableImpl::MarkerMid DontDelete|ReadOnly
- marker-end SVGStylableImpl::MarkerEnd DontDelete|ReadOnly
- marker SVGStylableImpl::Marker DontDelete|ReadOnly
- cursor SVGStylableImpl::Cursor DontDelete|ReadOnly
- display SVGStylableImpl::Display DontDelete|ReadOnly
- overflow SVGStylableImpl::Overflow DontDelete|ReadOnly
- clip SVGStylableImpl::Clip DontDelete|ReadOnly
- visibility SVGStylableImpl::Visibility DontDelete|ReadOnly
- fill-rule SVGStylableImpl::FillRule DontDelete|ReadOnly
- clip-rule SVGStylableImpl::ClipRule DontDelete|ReadOnly
- stroke-dashoffset SVGStylableImpl::StrokeDashOffset DontDelete|ReadOnly
- stroke-dasharray SVGStylableImpl::StrokeDashArray DontDelete|ReadOnly
- color-profile SVGStylableImpl::ColorProfile DontDelete|ReadOnly
- baseline-shift SVGStylableImpl::BaselineShift DontDelete|ReadOnly
- letter-spacing SVGStylableImpl::LetterSpacing DontDelete|ReadOnly
- word-spacing SVGStylableImpl::WordSpacing DontDelete|ReadOnly
- pointer-events SVGStylableImpl::PointerEvents DontDelete|ReadOnly
- glyph-orientation-vertical SVGStylableImpl::GlyphOrientationVertical DontDelete|ReadOnly
- glyph-orientation-horizontal SVGStylableImpl::GlyphOrientationHorizontal DontDelete|ReadOnly
- color-interpolation SVGStylableImpl::ColorInterpolation DontDelete|ReadOnly
- mask SVGStylableImpl::Mask DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGStylableImplProto::s_hashTable 2
- getStyle SVGStylableImpl::GetStyle DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGStylable", SVGStylableImplProto, SVGStylableImplProtoFunc)
-
-Value SVGStylableImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- //case ClassName:
- // return String(className().string());
- case Style:
- return String(m_object ? m_object->DOM::Element::getAttribute("style") : "");
- case Visibility:
- return String(m_visible ? "visible" : "hidden");
- case Display:
- return String(m_display ? "inline" : "none");
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGStylableImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- TQString param = value.toString(exec).qstring();
-
- if (param.isEmpty())
- return;
-
- bool redraw = false;
- bool inherit = (param == "inherit");
- int update = -1;
-
- switch(token)
- {
- case Style:
- {
- if(!m_object)
- return;
-
- TQStringList substyles = TQStringList::split(';', param);
- for(TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it)
- {
- TQStringList substyle = TQStringList::split(':', (*it));
- m_object->setAttributeInternal(substyle[0].stripWhiteSpace(), substyle[1].stripWhiteSpace());
- }
- break;
- }
- case StrokeWidth:
- if(m_flags & SVG_STYLE_FLAG_STROKE_WIDTH)
- {
- redraw = true;
- update = UPDATE_LINEWIDTH;
- }
- if(inherit)
- m_flags &= ~SVG_STYLE_FLAG_STROKE_WIDTH;
- else
- {
- m_flags |= SVG_STYLE_FLAG_STROKE_WIDTH;
-
- if(!m_strokeWidth)
- {
- m_strokeWidth = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
- m_strokeWidth->ref();
- }
-
- m_strokeWidth->baseVal()->setValueAsString(param);
- }
- break;
- case StrokeMiterlimit:
- m_flags |= SVG_STYLE_FLAG_STROKE_MITER_LIMIT;
- if(!inherit)
- m_strokeMiterlimit = param.toUInt();
- break;
- case StrokeLineCap:
- m_flags |= SVG_STYLE_FLAG_STROKE_LINE_CAP;
- if(param == "butt")
- m_capStyle = PATH_STROKE_CAP_BUTT;
- else if(param == "round")
- m_capStyle = PATH_STROKE_CAP_ROUND;
- else if(param == "square")
- m_capStyle = PATH_STROKE_CAP_SQUARE;
- break;
- case StrokeLineJoin:
- m_flags |= SVG_STYLE_FLAG_STROKE_LINE_JOIN;
- if(param == "miter")
- m_joinStyle = PATH_STROKE_JOIN_MITER;
- else if(param == "round")
- m_joinStyle = PATH_STROKE_JOIN_ROUND;
- else if(param == "bevel")
- m_joinStyle = PATH_STROKE_JOIN_BEVEL;
- break;
- case Stroke:
- if(m_flags & SVG_STYLE_FLAG_STROKE)
- redraw = true;
- if(inherit)
- m_flags &= ~SVG_STYLE_FLAG_STROKE;
- else
- {
- m_flags |= SVG_STYLE_FLAG_STROKE;
-
- if(!m_strokeColor)
- {
- m_strokeColor = new SVGPaintImpl(m_object);
- m_strokeColor->ref();
- }
-
- setPaint(param, m_strokeColor);
- }
- break;
- case Fill:
- if(m_flags & SVG_STYLE_FLAG_FILL)
- {
- redraw = true;
- update = UPDATE_STYLE;
- }
- if(inherit)
- m_flags &= ~SVG_STYLE_FLAG_FILL;
- else
- {
- m_flags |= SVG_STYLE_FLAG_FILL;
-
- if(!m_fillColor)
- {
- m_fillColor = new SVGPaintImpl(m_object);
- m_fillColor->ref();
- }
-
- setPaint(param, m_fillColor);
- }
- break;
- case Color:
- if(m_flags & SVG_STYLE_FLAG_COLOR)
- redraw = true;
- if(inherit)
- m_flags &= ~SVG_STYLE_FLAG_COLOR;
- else
- {
- m_flags |= SVG_STYLE_FLAG_COLOR;
-
- if(!m_color)
- {
- m_color = new SVGColorImpl(m_object);
- m_color->ref();
- }
- setColor(param, m_color);
- }
- break;
- case StopColor:
- m_flags |= SVG_STYLE_FLAG_STOP;
-
- if(!m_stopColor)
- {
- m_stopColor = new SVGColorImpl(m_object);
- m_stopColor->ref();
- }
-
- if(!inherit)
- setColor(param, m_stopColor);
- break;
- case ColorInterpolation:
- if(inherit)
- m_flags &= ~SVG_STYLE_FLAG_COLOR_INTERPOLATION;
- else
- {
- m_flags |= SVG_STYLE_FLAG_COLOR_INTERPOLATION;
- if(param == "auto" || param == "sRGB")
- m_colorInterpolation = CI_SRGB;
- else
- if(param == "linearRGB")
- m_colorInterpolation = CI_LINEARRGB;
- }
- break;
- case FontSize:
- {
- m_flags |= SVG_STYLE_FLAG_FONT_SIZE;
- if(!inherit)
- {
- double temp = fontSizeForText(param);
- if(temp != -1) // Is "absolute-size"
- {
- m_fontSize = temp;
- break;
- }
-
- SVGLengthImpl *length = SVGSVGElementImpl::createSVGLength();
- length->setContext(m_object);
- length->setValueAsString(DOM::DOMString(param));
- m_fontSize = length->value();
- length->deref();
- }
- break;
- }
- case FontFamily:
- m_flags |= SVG_STYLE_FLAG_FONT_FAMILY;
-
- // Hacks
- // #1 Replace "'" characters by ""
- param = param.replace('\'', TQString());
- // #2 Replace "MS-Gothic" by "MS Gothic"
- param = param.replace("MS-Gothic", "MS Gothic");
- // #3 Replace "Helvetica" by "Arial"
- param = param.replace("Helvetica", "Arial");
- param = param.replace("helvetica", "Arial");
-
- if(!m_fontFamily)
- {
- m_fontFamily = new SVGStringListImpl();
- m_fontFamily->ref();
- }
-
- if(!inherit)
- SVGHelperImpl::parseCommaSeperatedList(m_fontFamily, param);
- break;
- case FontWeight:
- m_flags |= SVG_STYLE_FLAG_FONT_WEIGHT;
- if(!inherit)
- m_fontWeight = param;
- break;
- case FontStyle:
- m_flags |= SVG_STYLE_FLAG_FONT_STYLE;
- if(param == "normal")
- m_fontStyle = FSNORMAL;
- else if(param == "italic")
- m_fontStyle = ITALIC;
- else if(param == "oblique")
- m_fontStyle = OBLIQUE;
- break;
- case TextDecoration:
- m_flags |= SVG_STYLE_FLAG_TEXT_DECORATION;
- if(param == "none")
- m_textDecoration = TDNONE;
- {
- // CSS2 allows multiple decorations
- m_textDecoration = TDNONE;
- TQStringList decorations = TQStringList::split(' ', param);
- for(TQStringList::Iterator it = decorations.begin(); it != decorations.end(); ++it)
- {
- if(*it == "underline")
- m_textDecoration |= UNDERLINE;
- else if(*it == "overline")
- m_textDecoration |= OVERLINE;
- else if(*it == "line-through")
- m_textDecoration |= LINE_THROUGH;
- }
- }
- break;
- case TextAnchor:
- m_flags |= SVG_STYLE_FLAG_TEXT_ANCHOR;
- if(param == "start")
- m_textAnchor = TASTART;
- else if(param == "middle")
- m_textAnchor = TAMIDDLE;
- else if(param == "end")
- m_textAnchor = TAEND;
- break;
- case Direction:
- m_flags |= SVG_STYLE_FLAG_TEXT_DIRECTION;
- // Spec: direction is only processed when unicode-bidi
- // is set to bidi-override or embedded
- if(m_textUnicodeBidi == OVERRIDE ||
- m_textUnicodeBidi == EMBED ||
- m_textUnicodeBidi == UBNORMAL)
- {
- if(param == "rtl")
- m_textDirection = RTL;
- else if(param == "ltr")
- m_textDirection = LTR;
- }
- break;
- case WritingMode:
- m_flags |= SVG_STYLE_FLAG_TEXT_WRITING_MODE;
- if(param == "lr-tb" || param == "lr")
- m_textWritingMode = LR;
- else if(param == "rl-tb" || param == "rl")
- m_textWritingMode = RL;
- else if(param == "tb-lr" || param == "tb")
- m_textWritingMode = TB;
- break;
- case UnicodeBidi:
- m_flags |= SVG_STYLE_FLAG_TEXT_UNICODE_BIDI;
- if(param == "normal")
- m_textUnicodeBidi = UBNORMAL;
- else if(param == "embed")
- m_textUnicodeBidi = EMBED;
- else if(param == "bidi-override")
- m_textUnicodeBidi = OVERRIDE;
- break;
- case GlyphOrientationVertical:
- m_flags |= SVG_STYLE_FLAG_GLYPH_ORIENTATION_VERTICAL;
- m_glyphOrientationVertical = param;
- break;
- case GlyphOrientationHorizontal:
- m_flags |= SVG_STYLE_FLAG_GLYPH_ORIENTATION_HORIZONTAL;
- m_glyphOrientationHorizontal = param;
- break;
- case Opacity:
- m_flags |= SVG_STYLE_FLAG_OPACITY;
-
- if(!inherit)
- {
- SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_opacity);
- }
- break;
- case FillOpacity:
- m_flags |= SVG_STYLE_FLAG_FILL_OPACITY;
-
- if(!inherit)
- {
- SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_fillOpacity);
- }
- break;
- case StrokeOpacity:
- m_flags |= SVG_STYLE_FLAG_STROKE_OPACITY;
-
- if(!inherit)
- {
- SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_strokeOpacity);
- }
- break;
- case ClipPath:
- m_flags |= SVG_STYLE_FLAG_CLIP_PATH;
- if(!inherit)
- m_clipPath = extractUrlId(param);
- break;
- case Mask:
- m_flags |= SVG_STYLE_FLAG_MASK;
- if(!inherit)
- m_mask = extractUrlId(param);
- break;
- case MarkerStart:
- m_flags |= SVG_STYLE_FLAG_MARKER_START;
- if(!inherit)
- setStartMarker(param);
- break;
- case MarkerMid:
- m_flags |= SVG_STYLE_FLAG_MARKER_MID;
- if(!inherit)
- setMidMarker(param);
- break;
- case MarkerEnd:
- m_flags |= SVG_STYLE_FLAG_MARKER_END;
- if(!inherit)
- setEndMarker(param);
- break;
- case Marker:
- m_flags |= (SVG_STYLE_FLAG_MARKER_START | SVG_STYLE_FLAG_MARKER_MID | SVG_STYLE_FLAG_MARKER_END);
- if(!inherit)
- setMarkers(param);
- break;
- case PointerEvents:
- m_flags |= SVG_STYLE_FLAG_POINTER_EVENTS;
- if(param == "none")
- m_pointerEvents = PE_NONE;
- else if(param == "stroke")
- m_pointerEvents = PE_STROKE;
- else if(param == "fill")
- m_pointerEvents = PE_FILL;
- else if(param == "painted")
- m_pointerEvents = PE_PAINTED;
- else if(param == "visibleStroke")
- m_pointerEvents = PE_VISIBLE_STROKE;
- else if(param == "visibleFill")
- m_pointerEvents = PE_VISIBLE_FILL;
- else if(param == "visiblePainted")
- m_pointerEvents = PE_VISIBLE_PAINTED;
- else if(param == "visible")
- m_pointerEvents = PE_VISIBLE;
- else if(param == "all")
- m_pointerEvents = PE_ALL;
- break;
- case Cursor:
- m_flags |= SVG_STYLE_FLAG_CURSOR;
- if(param == "auto")
- m_cursor = CURSOR_AUTO;
- else if(param == "crosshair")
- m_cursor = CURSOR_CROSSHAIR;
- else if(param == "default")
- m_cursor = CURSOR_DEFAULT;
- else if(param == "pointer")
- m_cursor = CURSOR_POINTER;
- else if(param == "move")
- m_cursor = CURSOR_MOVE;
- else if(param == "e-resize")
- m_cursor = CURSOR_E_RESIZE;
- else if(param == "ne-resize")
- m_cursor = CURSOR_NE_RESIZE;
- else if(param == "nw-resize")
- m_cursor = CURSOR_NW_RESIZE;
- else if(param == "n-resize")
- m_cursor = CURSOR_N_RESIZE;
- else if(param == "se-resize")
- m_cursor = CURSOR_SE_RESIZE;
- else if(param == "sw-resize")
- m_cursor = CURSOR_SW_RESIZE;
- else if(param == "s-resize")
- m_cursor = CURSOR_S_RESIZE;
- else if(param == "w-resize")
- m_cursor = CURSOR_W_RESIZE;
- else if(param == "text")
- m_cursor = CURSOR_TEXT;
- else if(param == "wait")
- m_cursor = CURSOR_WAIT;
- else if(param == "help")
- m_cursor = CURSOR_HELP;
- break;
- case Display:
- m_flags |= SVG_STYLE_FLAG_DISPLAY;
-
- if(param == "none")
- m_display = false;
- else if(!inherit)
- m_display = true;
- break;
- case Overflow:
- m_flags |= SVG_STYLE_FLAG_OVERFLOW;
- if(param == "hidden" || param == "scroll")
- m_overflow = false;
- else if(!inherit)
- m_overflow = true;
- break;
- case Clip:
- m_flags |= SVG_STYLE_FLAG_CLIP_PATH;
- if(!inherit)
- setClip(param);
- break;
- case Visibility:
- if(m_flags & SVG_STYLE_FLAG_VISIBILITY)
- redraw = true;
- if(inherit)
- m_flags &= ~SVG_STYLE_FLAG_COLOR;
- else
- {
- m_flags |= SVG_STYLE_FLAG_VISIBILITY;
-
- if(param == "visible")
- m_visible = true;
- else if(!inherit)
- m_visible = false;
-
- // Just a quick fix for the script-* files (Niko)
- // Any better solution??
- update = UPDATE_TRANSFORM;
- redraw = true;
- }
- SVGHelperImpl::applyContainer<SVGStylableImpl>(this, Visibility, param);
- break;
- case FillRule:
- m_flags |= SVG_STYLE_FLAG_FILL_RULE;
- if(!inherit)
- m_fillRule = (param == "evenodd" ? RULE_EVENODD : RULE_NONZERO);
- break;
- case ClipRule:
- m_flags |= SVG_STYLE_FLAG_CLIP_RULE;
- if(!inherit)
- m_clipRule = (param == "evenodd" ? RULE_EVENODD : RULE_NONZERO);
- break;
- case StrokeDashOffset:
- m_flags |= SVG_STYLE_FLAG_STROKE_DASH_OFFSET;
-
- if(!m_dashOffset)
- {
- m_dashOffset = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
- m_dashOffset->ref();
- }
-
- if(!inherit)
- m_dashOffset->baseVal()->setValueAsString(param);
- break;
- case StrokeDashArray:
- {
- m_flags |= SVG_STYLE_FLAG_STROKE_DASH_ARRAY;
-
- if(!m_dashArray)
- {
- m_dashArray = new SVGAnimatedLengthListImpl();
- m_dashArray->ref();
- }
- else
- m_dashArray->baseVal()->clear();
-
- if(param != "none" && !inherit)
- SVGHelperImpl::parseLengthList(m_dashArray, param);
- break;
- }
- case ColorProfile:
- {
- m_flags |= SVG_STYLE_FLAG_COLOR_PROFILE;
- if(!inherit)
- {
- if(!m_object)
- return;
-
- SVGColorProfileElementImpl *handle = static_cast<SVGColorProfileElementImpl *>(m_object->ownerSVGElement()->getElementById(SVGURIReferenceImpl::getTarget(param)));
- if(handle)
- SVGImageElementImpl::applyColorProfile(handle, static_cast<SVGImageElementImpl *>(this));
- }
- break;
- }
- case BaselineShift:
- {
- m_flags |= SVG_STYLE_FLAG_BASELINE_SHIFT;
- if(!inherit)
- m_baselineShift = param;
- break;
- }
- case LetterSpacing:
- m_flags |= SVG_STYLE_FLAG_LETTER_SPACING;
- case WordSpacing:
- {
- if(!inherit)
- {
- if(token == WordSpacing)
- {
- m_flags |= SVG_STYLE_FLAG_WORD_SPACING;
- m_wordSpacing = param;
- }
- else
- m_letterSpacing = param;
- }
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-
- if(redraw)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_object);
- if(inherit)
- processStyle();
-
- if(shape && shape->item())
- {
- if(update > -1)
- shape->item()->update(static_cast<CanvasItemUpdate>(update));
- else if(m_object)
- m_object->ownerDoc()->canvas()->invalidate(shape->item(), false);
- }
- }
-}
-
-Value SVGStylableImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
-{
- KSVG_CHECK_THIS(SVGStylableImpl)
-
- switch(id)
- {
- case SVGStylableImpl::GetStyle:
- return Undefined();
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStylableImpl.cpp b/ksvg/impl/SVGStylableImpl.cpp
new file mode 100644
index 00000000..4400b236
--- /dev/null
+++ b/ksvg/impl/SVGStylableImpl.cpp
@@ -0,0 +1,1307 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqrect.h>
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+#include "SVGPaint.h"
+#include "SVGColorImpl.h"
+#include "SVGPaintImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGLengthImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGStylableImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGStringListImpl.h"
+#include "SVGImageElementImpl.h"
+#include "SVGURIReferenceImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGColorProfileElementImpl.h"
+#include "SVGAnimatedLengthListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGStylableImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGStylableImpl::SVGStylableImpl(SVGElementImpl *object) : m_object(object)
+{
+ KSVG_EMPTY_FLAGS
+
+ // View propidx.html, if you want to verify those default values (Niko)
+ m_flags = SVG_STYLE_FLAG_NONE;
+
+ // Initialize all pointers to 0
+ // Important!
+ m_color = 0;
+ m_fillColor = 0;
+ m_stopColor = 0;
+ m_dashArray = 0;
+ m_dashOffset = 0;
+ m_strokeWidth = 0;
+ m_strokeColor = 0;
+ m_fontFamily = 0;
+
+ m_fillOpacity = 1;
+ m_strokeOpacity = 1;
+ m_opacity = 1;
+
+ // Special case, getFontSize() could be accessed
+ // _before_ processStyle() is called -> no default
+ // value for font-size yet -> crash
+ // SVGLengthImpl access it when parsing em/ex values (Niko)
+ m_fontSize = -1;
+}
+
+SVGStylableImpl::~SVGStylableImpl()
+{
+ if(m_strokeWidth)
+ m_strokeWidth->deref();
+ if(m_fontFamily)
+ m_fontFamily->deref();
+ if(m_strokeColor)
+ m_strokeColor->deref();
+ if(m_fillColor)
+ m_fillColor->deref();
+ if(m_color)
+ m_color->deref();
+ if(m_stopColor)
+ m_stopColor->deref();
+ if(m_dashOffset)
+ m_dashOffset->deref();
+ if(m_dashArray)
+ m_dashArray->deref();
+}
+
+void SVGStylableImpl::processStyle()
+{
+ SVGStylableImpl *parentStyle = 0;
+ if(m_object && m_object->ownerDoc())
+ parentStyle = dynamic_cast<SVGStylableImpl *>(m_object->ownerDoc()->getElementFromHandle((*m_object).parentNode().handle()));
+
+ // Spec: default "none"
+ if(~m_flags & SVG_STYLE_FLAG_STROKE)
+ {
+ m_strokeColor = new SVGPaintImpl(m_object);
+ m_strokeColor->ref();
+
+ SVGPaintImpl *strokeColor = 0L;
+ if(parentStyle)
+ strokeColor = parentStyle->getStrokeColor();
+
+ if(strokeColor)
+ *m_strokeColor = *strokeColor;
+ else
+ m_strokeColor->setPaint(SVG_PAINTTYPE_NONE);
+ }
+
+ // Spec: default "black"
+ if(~m_flags & SVG_STYLE_FLAG_FILL)
+ {
+ m_fillColor = new SVGPaintImpl(m_object);
+ m_fillColor->ref();
+
+ SVGPaintImpl *fillColor = 0;
+ if(parentStyle)
+ fillColor = parentStyle->getFillColor();
+
+ if(fillColor)
+ *m_fillColor = *fillColor;
+ else
+ m_fillColor->setRGBColor(DOM::DOMString("black"));
+ }
+
+ // Spec: no real default
+ if(~m_flags & SVG_STYLE_FLAG_COLOR)
+ {
+ m_color = new SVGColorImpl(m_object);
+ m_color->ref();
+ SVGColorImpl *color = 0;
+ if(parentStyle)
+ color = parentStyle->getColor();
+
+ if(color)
+ *m_color = *color;
+ }
+
+ // Spec: default sRGB
+ if(~m_flags & SVG_STYLE_FLAG_COLOR_INTERPOLATION)
+ {
+ if(parentStyle)
+ m_colorInterpolation = parentStyle->getColorInterpolation();
+ else
+ m_colorInterpolation = CI_SRGB;
+ }
+
+ // Spec: default "1"
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_WIDTH)
+ {
+ m_strokeWidth = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
+ m_strokeWidth->ref();
+
+ SVGAnimatedLengthImpl *strokeWidth = 0;
+ if(parentStyle)
+ strokeWidth = parentStyle->getStrokeWidth();
+
+ if(strokeWidth)
+ *m_strokeWidth = *strokeWidth;
+ else
+ m_strokeWidth->baseVal()->setValue(1.0);
+ }
+
+ // Spec: default "4"
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_MITER_LIMIT)
+ {
+ if(parentStyle)
+ m_strokeMiterlimit = parentStyle->getStrokeMiterlimit();
+ else
+ m_strokeMiterlimit = 4;
+ }
+
+ // Spec: default "butt"
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_LINE_CAP)
+ {
+ if(parentStyle)
+ m_capStyle = parentStyle->getCapStyle();
+ else
+ m_capStyle = PATH_STROKE_CAP_BUTT;
+ }
+
+ // Spec: default "miter"
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_LINE_JOIN)
+ {
+ if(parentStyle)
+ m_joinStyle = parentStyle->getJoinStyle();
+ else
+ m_joinStyle = PATH_STROKE_JOIN_MITER;
+ }
+
+ // Spec: default "auto"
+ if(~m_flags & SVG_STYLE_FLAG_CURSOR)
+ {
+ if(parentStyle)
+ m_cursor = parentStyle->getCursor();
+ else
+ m_cursor = CURSOR_AUTO;
+ }
+
+ // Spec: default "visiblePainted"
+ if(~m_flags & SVG_STYLE_FLAG_POINTER_EVENTS)
+ {
+ if(parentStyle)
+ m_pointerEvents = parentStyle->getPointerEvents();
+ else
+ m_pointerEvents = PE_VISIBLE_PAINTED;
+ }
+
+ // Spec: default "0"
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_DASH_OFFSET)
+ {
+ m_dashOffset = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
+ m_dashOffset->ref();
+
+ SVGAnimatedLengthImpl *dashOffset = 0;
+ if(parentStyle)
+ dashOffset = parentStyle->getDashOffset();
+
+ if(dashOffset)
+ *m_dashOffset = *dashOffset;
+ else
+ m_dashOffset->baseVal()->setValue(0);
+ }
+
+ // Spec: default "none" -> 0 == empty dash array
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_DASH_ARRAY)
+ {
+ SVGAnimatedLengthListImpl *dashArray = 0;
+ if(parentStyle)
+ dashArray = parentStyle->getDashArray();
+
+ if(dashArray)
+ {
+ if (!m_dashArray)
+ {
+ m_dashArray = new SVGAnimatedLengthListImpl();
+ m_dashArray->ref();
+ }
+ *m_dashArray = *dashArray;
+ }
+ else
+ m_dashArray = 0;
+ }
+
+ // Spec: default "1" -> 1 == Not opaque
+ if(~m_flags & SVG_STYLE_FLAG_FILL_OPACITY)
+ {
+ if(parentStyle)
+ m_fillOpacity = parentStyle->getFillOpacity();
+ else
+ m_fillOpacity = 1;
+ }
+
+ if(~m_flags & SVG_STYLE_FLAG_STROKE_OPACITY)
+ {
+ if(parentStyle)
+ m_strokeOpacity = parentStyle->getStrokeOpacity();
+ else
+ m_strokeOpacity = 1;
+ }
+
+ // Fake group opacity by multiplying by our parent's group opacity
+ if(~m_flags & SVG_STYLE_FLAG_OPACITY)
+ {
+ if(parentStyle)
+ m_opacity = parentStyle->getOpacity();
+ else
+ m_opacity = 1;
+ }
+ else
+ if(parentStyle)
+ m_opacity *= parentStyle->getOpacity();
+
+ if(~m_flags & SVG_STYLE_FLAG_CLIP_PATH)
+ m_clipPath = "";
+
+ if(~m_flags & SVG_STYLE_FLAG_MASK)
+ m_mask = "";
+
+ // Spec: default "nonzero"
+ if(~m_flags & SVG_STYLE_FLAG_FILL_RULE)
+ {
+ if(parentStyle)
+ m_fillRule = parentStyle->getFillRule();
+ else
+ m_fillRule = RULE_NONZERO;
+ }
+
+ if(~m_flags & SVG_STYLE_FLAG_CLIP_RULE)
+ {
+ if(parentStyle)
+ m_clipRule = parentStyle->getClipRule();
+ else
+ m_clipRule = RULE_NONZERO;
+ }
+
+ // Spec: default "hidden"
+ if(~m_flags & SVG_STYLE_FLAG_OVERFLOW)
+ {
+ if(parentStyle)
+ m_overflow = parentStyle->getOverflow();
+ else
+ m_overflow = false;
+ }
+
+ // We are not really, spec compatible here, we just
+ // define a bool, to indicate wheter an element should
+ // be rendered or not.
+ if(~m_flags & SVG_STYLE_FLAG_DISPLAY)
+ m_display = true;
+
+ if(~m_flags & SVG_STYLE_FLAG_VISIBILITY)
+ {
+ if(parentStyle)
+ m_visible = parentStyle->getVisible();
+ else
+ m_visible = true;
+ }
+
+ // Spec: default "medium"
+ if(~m_flags & SVG_STYLE_FLAG_FONT_SIZE)
+ {
+ if(parentStyle)
+ m_fontSize = parentStyle->getFontSize();
+ else
+ m_fontSize = fontSizeForText("medium");
+ }
+
+ // Spec: default "depends on user agent" -> "Arial" for SVG
+ if(~m_flags & SVG_STYLE_FLAG_FONT_FAMILY)
+ {
+ if(!m_fontFamily)
+ {
+ m_fontFamily = new SVGStringListImpl();
+ m_fontFamily->ref();
+ }
+
+ SVGStringListImpl *fontFamily = 0;
+ if(parentStyle)
+ fontFamily = parentStyle->getFontFamily();
+
+ if(fontFamily)
+ *m_fontFamily = *fontFamily;
+ else
+ {
+ SharedString *string = new SharedString("Arial");
+ string->ref();
+
+ m_fontFamily->appendItem(string);
+ }
+ }
+
+ // Spec: default "normal"
+ if(~m_flags & SVG_STYLE_FLAG_FONT_STYLE)
+ {
+ if(parentStyle)
+ m_fontStyle = parentStyle->getFontStyle();
+ else
+ m_fontStyle = FSNORMAL;
+ }
+
+ // Spec: default "normal"
+ if(~m_flags & SVG_STYLE_FLAG_FONT_WEIGHT)
+ {
+ if(parentStyle)
+ m_fontWeight = parentStyle->getFontWeight();
+ else
+ m_fontWeight = "normal";
+ }
+
+ // Spec: default "start"
+ if(~m_flags & SVG_STYLE_FLAG_TEXT_ANCHOR)
+ {
+ if(parentStyle)
+ m_textAnchor = parentStyle->getTextAnchor();
+ else
+ m_textAnchor = TASTART;
+ }
+
+ // Spec: default "LTR"
+ if(~m_flags & SVG_STYLE_FLAG_TEXT_DIRECTION)
+ {
+ if(parentStyle)
+ m_textDirection = parentStyle->getTextDirection();
+ else
+ m_textDirection = LTR;
+ }
+
+ // Spec: default "none"
+ if(~m_flags & SVG_STYLE_FLAG_TEXT_DECORATION)
+ {
+ if(parentStyle)
+ m_textDecoration = parentStyle->getTextDecoration();
+ else
+ m_textDecoration = TDNONE;
+ }
+
+ // Spec: default "baseline"
+ if(~m_flags & SVG_STYLE_FLAG_BASELINE_SHIFT)
+ {
+ if(parentStyle)
+ m_baselineShift = parentStyle->getBaselineShift();
+ else
+ m_baselineShift = "baseline";
+ }
+
+ // Spec: default "lr-tb", FIXME
+ if(~m_flags & SVG_STYLE_FLAG_TEXT_WRITING_MODE)
+ {
+ if(parentStyle)
+ m_textWritingMode = parentStyle->getTextWritingMode();
+ else
+ m_textWritingMode = LR;
+ }
+
+ // Spec: default "normal"
+ if(~m_flags & SVG_STYLE_FLAG_TEXT_UNICODE_BIDI)
+ {
+ if(parentStyle)
+ m_textUnicodeBidi = parentStyle->getTextUnicodeBidi();
+ else
+ m_textUnicodeBidi = UBNORMAL;
+ }
+
+ // Spec: default "auto"
+ if(~m_flags & SVG_STYLE_FLAG_GLYPH_ORIENTATION_VERTICAL)
+ {
+ if(parentStyle)
+ m_glyphOrientationVertical = parentStyle->getGlyphOrientationVertical();
+ else
+ m_glyphOrientationVertical = "auto";
+ }
+
+ // Spec: default "auto"
+ if(~m_flags & SVG_STYLE_FLAG_GLYPH_ORIENTATION_HORIZONTAL)
+ {
+ if(parentStyle)
+ m_glyphOrientationHorizontal = parentStyle->getGlyphOrientationHorizontal();
+ else
+ m_glyphOrientationHorizontal = "auto";
+ }
+
+ // Spec: default "normal"
+ if(~m_flags & SVG_STYLE_FLAG_LETTER_SPACING)
+ {
+ if(parentStyle)
+ m_letterSpacing = parentStyle->getLetterSpacing();
+ else
+ m_letterSpacing = "normal";
+ }
+
+ // Spec: default "normal"
+ if(~m_flags & SVG_STYLE_FLAG_WORD_SPACING)
+ {
+ if(parentStyle)
+ m_wordSpacing = parentStyle->getWordSpacing();
+ else
+ m_wordSpacing = "normal";
+ }
+
+ // Spec: default "black"
+ if(~m_flags & SVG_STYLE_FLAG_STOP)
+ {
+ m_stopColor = new SVGColorImpl(m_object);
+ m_stopColor->ref();
+
+ m_stopColor->setRGBColor(DOM::DOMString("black"));
+ }
+
+ // Spec: default "none"
+ if(~m_flags & SVG_STYLE_FLAG_MARKER_START)
+ {
+ if(parentStyle)
+ m_startMarker = parentStyle->getStartMarker();
+ else
+ m_startMarker = TQString();
+ }
+
+ // Spec: default "none"
+ if(~m_flags & SVG_STYLE_FLAG_MARKER_MID)
+ {
+ if(parentStyle)
+ m_midMarker = parentStyle->getMidMarker();
+ else
+ m_midMarker = TQString();
+ }
+
+ // Spec: default "none"
+ if(~m_flags & SVG_STYLE_FLAG_MARKER_END)
+ {
+ if(parentStyle)
+ m_endMarker = parentStyle->getEndMarker();
+ else
+ m_endMarker = TQString();
+ }
+}
+
+bool SVGStylableImpl::isStroked() const
+{
+ if(!m_strokeColor)
+ return false;
+
+ return m_strokeColor->paintType() != SVG_PAINTTYPE_UNKNOWN &&
+ m_strokeColor->paintType() != SVG_PAINTTYPE_NONE &&
+ m_strokeColor->paintType() != SVG_PAINTTYPE_URI_NONE;
+}
+
+bool SVGStylableImpl::isFilled() const
+{
+ if(!m_fillColor)
+ return false;
+
+ return m_fillColor->paintType() != SVG_PAINTTYPE_UNKNOWN &&
+ m_fillColor->paintType() != SVG_PAINTTYPE_NONE &&
+ m_fillColor->paintType() != SVG_PAINTTYPE_URI_NONE;
+}
+
+TQString SVGStylableImpl::extractUrlId(const TQString &url)
+{
+ TQString id;
+
+ if(url.startsWith("url(#"))
+ {
+ int idstart = url.find("#") + 1;
+ id = url.mid(idstart, url.length() - idstart - 1);
+ }
+ else
+ id = url;
+
+ return id;
+}
+
+void SVGStylableImpl::setMarkers(const TQString &marker)
+{
+ setStartMarker(marker);
+ setMidMarker(marker);
+ setEndMarker(marker);
+}
+
+void SVGStylableImpl::setStartMarker(const TQString &startMarker)
+{
+ if(startMarker.startsWith("url(#"))
+ {
+ int idstart = startMarker.find("#") + 1;
+ m_startMarker = startMarker.mid(idstart, startMarker.length() - idstart - 1);
+ }
+ else if(startMarker == "none")
+ m_startMarker = TQString();
+}
+
+void SVGStylableImpl::setMidMarker(const TQString &midMarker)
+{
+ if(midMarker.startsWith("url(#"))
+ {
+ int idstart = midMarker.find("#") + 1;
+ m_midMarker = midMarker.mid(idstart, midMarker.length() - idstart - 1);
+ }
+ else if(midMarker == "none")
+ m_midMarker = TQString();
+}
+
+void SVGStylableImpl::setEndMarker(const TQString &endMarker)
+{
+ if(endMarker.startsWith("url(#"))
+ {
+ int idstart = endMarker.find("#") + 1;
+ m_endMarker = endMarker.mid(idstart, endMarker.length() - idstart - 1);
+ }
+ else if(endMarker == "none")
+ m_endMarker = TQString();
+}
+
+bool SVGStylableImpl::hasMarkers() const
+{
+ return !m_startMarker.isEmpty() || !m_midMarker.isEmpty() || !m_endMarker.isEmpty();
+}
+
+void SVGStylableImpl::setPaint(const TQString &param, SVGPaintImpl *svgPaint)
+{
+ if(param.stripWhiteSpace() == "none")
+ svgPaint->setPaint(SVG_PAINTTYPE_NONE, DOM::DOMString(""), DOM::DOMString(""));
+ else if(SVGURIReferenceImpl::isUrl(param))
+ svgPaint->setUri(SVGURIReferenceImpl::getTarget(param));
+ else
+ setColor(param, svgPaint);
+}
+
+void SVGStylableImpl::setColor(const TQString &param, SVGColorImpl *svgColor)
+{
+ if(param.stripWhiteSpace().startsWith("#"))
+ {
+ if(param.contains("icc-color"))
+ {
+ TQString first = param.left(7);
+ TQString last = param.right(param.length() - 8);
+
+ svgColor->setRGBColorICCColor(first, last);
+ }
+ else
+ {
+ TQColor color;
+ color.setNamedColor(param.stripWhiteSpace());
+ svgColor->setRGBColor(color);
+ }
+ }
+ else if(param.stripWhiteSpace().startsWith("rgb("))
+ {
+ TQString parse = param.stripWhiteSpace();
+ TQStringList colors = TQStringList::split(',', parse);
+ TQString r = colors[0].right((colors[0].length() - 4));
+ TQString g = colors[1];
+ TQString b = colors[2].left((colors[2].length() - 1));
+
+ if(r.contains("%"))
+ {
+ r = r.left(r.length() - 1);
+ r = TQString::number(int((double(255 * r.toDouble()) / 100.0)));
+ }
+
+ if(g.contains("%"))
+ {
+ g = g.left(g.length() - 1);
+ g = TQString::number(int((double(255 * g.toDouble()) / 100.0)));
+ }
+
+ if(b.contains("%"))
+ {
+ b = b.left(b.length() - 1);
+ b = TQString::number(int((double(255 * b.toDouble()) / 100.0)));
+ }
+
+ svgColor->setRGBColor(int(r.toFloat()), int(g.toFloat()), int(b.toFloat()));
+ }
+ else
+ {
+ if(param.stripWhiteSpace().lower() == "currentcolor")
+ svgColor->setColor(SVG_COLORTYPE_CURRENTCOLOR, DOM::DOMString(""), DOM::DOMString(""));
+ else
+ svgColor->setRGBColor(DOM::DOMString(param.stripWhiteSpace().lower()));
+ }
+}
+
+TQRect SVGStylableImpl::clip()
+{
+ return TQRect();
+}
+
+void SVGStylableImpl::setClip(const TQString &)
+{
+}
+
+float SVGStylableImpl::fontSizeForText(const TQString &value)
+{
+ float ret = -1;
+
+ // Spec: "On a computer screen a scaling factor of 1.2 is suggested between adjacent indexes"
+ const float factor = 1.2;
+
+ // Spec: "If the 'medium' font is 12pt, the 'large' font could be 14.4pt."
+ const float mediumFont = 12.0;
+
+ if(value == "xx-small")
+ ret = mediumFont - (3.0 * factor);
+ else if(value == "x-small")
+ ret = mediumFont - (2.0 * factor);
+ else if(value == "small")
+ ret = mediumFont - factor;
+ else if(value == "medium")
+ ret = mediumFont;
+ else if(value == "large")
+ ret = mediumFont + factor;
+ else if(value == "x-large")
+ ret = mediumFont + (2.0 * factor);
+ else if(value == "xx-large")
+ ret = mediumFont + (3.0 * factor);
+
+ return ret;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGStylableImpl::s_hashTable 47
+ className SVGStylableImpl::ClassName DontDelete|ReadOnly
+ style SVGStylableImpl::Style DontDelete|ReadOnly
+ stroke-width SVGStylableImpl::StrokeWidth DontDelete|ReadOnly
+ stroke-miterlimit SVGStylableImpl::StrokeMiterlimit DontDelete|ReadOnly
+ stroke-linecap SVGStylableImpl::StrokeLineCap DontDelete|ReadOnly
+ stroke-linejoin SVGStylableImpl::StrokeLineJoin DontDelete|ReadOnly
+ stroke SVGStylableImpl::Stroke DontDelete|ReadOnly
+ fill SVGStylableImpl::Fill DontDelete|ReadOnly
+ color SVGStylableImpl::Color DontDelete|ReadOnly
+ stop-color SVGStylableImpl::StopColor DontDelete|ReadOnly
+ font-size SVGStylableImpl::FontSize DontDelete|ReadOnly
+ font-family SVGStylableImpl::FontFamily DontDelete|ReadOnly
+ font-weight SVGStylableImpl::FontWeight DontDelete|ReadOnly
+ font-style SVGStylableImpl::FontStyle DontDelete|ReadOnly
+ text-decoration SVGStylableImpl::TextDecoration DontDelete|ReadOnly
+ text-anchor SVGStylableImpl::TextAnchor DontDelete|ReadOnly
+ direction SVGStylableImpl::Direction DontDelete|ReadOnly
+ writing-mode SVGStylableImpl::WritingMode DontDelete|ReadOnly
+ unicode-bidi SVGStylableImpl::UnicodeBidi DontDelete|ReadOnly
+ opacity SVGStylableImpl::Opacity DontDelete|ReadOnly
+ fill-opacity SVGStylableImpl::FillOpacity DontDelete|ReadOnly
+ stroke-opacity SVGStylableImpl::StrokeOpacity DontDelete|ReadOnly
+ clip-path SVGStylableImpl::ClipPath DontDelete|ReadOnly
+ marker-start SVGStylableImpl::MarkerStart DontDelete|ReadOnly
+ marker-mid SVGStylableImpl::MarkerMid DontDelete|ReadOnly
+ marker-end SVGStylableImpl::MarkerEnd DontDelete|ReadOnly
+ marker SVGStylableImpl::Marker DontDelete|ReadOnly
+ cursor SVGStylableImpl::Cursor DontDelete|ReadOnly
+ display SVGStylableImpl::Display DontDelete|ReadOnly
+ overflow SVGStylableImpl::Overflow DontDelete|ReadOnly
+ clip SVGStylableImpl::Clip DontDelete|ReadOnly
+ visibility SVGStylableImpl::Visibility DontDelete|ReadOnly
+ fill-rule SVGStylableImpl::FillRule DontDelete|ReadOnly
+ clip-rule SVGStylableImpl::ClipRule DontDelete|ReadOnly
+ stroke-dashoffset SVGStylableImpl::StrokeDashOffset DontDelete|ReadOnly
+ stroke-dasharray SVGStylableImpl::StrokeDashArray DontDelete|ReadOnly
+ color-profile SVGStylableImpl::ColorProfile DontDelete|ReadOnly
+ baseline-shift SVGStylableImpl::BaselineShift DontDelete|ReadOnly
+ letter-spacing SVGStylableImpl::LetterSpacing DontDelete|ReadOnly
+ word-spacing SVGStylableImpl::WordSpacing DontDelete|ReadOnly
+ pointer-events SVGStylableImpl::PointerEvents DontDelete|ReadOnly
+ glyph-orientation-vertical SVGStylableImpl::GlyphOrientationVertical DontDelete|ReadOnly
+ glyph-orientation-horizontal SVGStylableImpl::GlyphOrientationHorizontal DontDelete|ReadOnly
+ color-interpolation SVGStylableImpl::ColorInterpolation DontDelete|ReadOnly
+ mask SVGStylableImpl::Mask DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGStylableImplProto::s_hashTable 2
+ getStyle SVGStylableImpl::GetStyle DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGStylable", SVGStylableImplProto, SVGStylableImplProtoFunc)
+
+Value SVGStylableImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ //case ClassName:
+ // return String(className().string());
+ case Style:
+ return String(m_object ? m_object->DOM::Element::getAttribute("style") : "");
+ case Visibility:
+ return String(m_visible ? "visible" : "hidden");
+ case Display:
+ return String(m_display ? "inline" : "none");
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGStylableImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ TQString param = value.toString(exec).qstring();
+
+ if (param.isEmpty())
+ return;
+
+ bool redraw = false;
+ bool inherit = (param == "inherit");
+ int update = -1;
+
+ switch(token)
+ {
+ case Style:
+ {
+ if(!m_object)
+ return;
+
+ TQStringList substyles = TQStringList::split(';', param);
+ for(TQStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it)
+ {
+ TQStringList substyle = TQStringList::split(':', (*it));
+ m_object->setAttributeInternal(substyle[0].stripWhiteSpace(), substyle[1].stripWhiteSpace());
+ }
+ break;
+ }
+ case StrokeWidth:
+ if(m_flags & SVG_STYLE_FLAG_STROKE_WIDTH)
+ {
+ redraw = true;
+ update = UPDATE_LINEWIDTH;
+ }
+ if(inherit)
+ m_flags &= ~SVG_STYLE_FLAG_STROKE_WIDTH;
+ else
+ {
+ m_flags |= SVG_STYLE_FLAG_STROKE_WIDTH;
+
+ if(!m_strokeWidth)
+ {
+ m_strokeWidth = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
+ m_strokeWidth->ref();
+ }
+
+ m_strokeWidth->baseVal()->setValueAsString(param);
+ }
+ break;
+ case StrokeMiterlimit:
+ m_flags |= SVG_STYLE_FLAG_STROKE_MITER_LIMIT;
+ if(!inherit)
+ m_strokeMiterlimit = param.toUInt();
+ break;
+ case StrokeLineCap:
+ m_flags |= SVG_STYLE_FLAG_STROKE_LINE_CAP;
+ if(param == "butt")
+ m_capStyle = PATH_STROKE_CAP_BUTT;
+ else if(param == "round")
+ m_capStyle = PATH_STROKE_CAP_ROUND;
+ else if(param == "square")
+ m_capStyle = PATH_STROKE_CAP_SQUARE;
+ break;
+ case StrokeLineJoin:
+ m_flags |= SVG_STYLE_FLAG_STROKE_LINE_JOIN;
+ if(param == "miter")
+ m_joinStyle = PATH_STROKE_JOIN_MITER;
+ else if(param == "round")
+ m_joinStyle = PATH_STROKE_JOIN_ROUND;
+ else if(param == "bevel")
+ m_joinStyle = PATH_STROKE_JOIN_BEVEL;
+ break;
+ case Stroke:
+ if(m_flags & SVG_STYLE_FLAG_STROKE)
+ redraw = true;
+ if(inherit)
+ m_flags &= ~SVG_STYLE_FLAG_STROKE;
+ else
+ {
+ m_flags |= SVG_STYLE_FLAG_STROKE;
+
+ if(!m_strokeColor)
+ {
+ m_strokeColor = new SVGPaintImpl(m_object);
+ m_strokeColor->ref();
+ }
+
+ setPaint(param, m_strokeColor);
+ }
+ break;
+ case Fill:
+ if(m_flags & SVG_STYLE_FLAG_FILL)
+ {
+ redraw = true;
+ update = UPDATE_STYLE;
+ }
+ if(inherit)
+ m_flags &= ~SVG_STYLE_FLAG_FILL;
+ else
+ {
+ m_flags |= SVG_STYLE_FLAG_FILL;
+
+ if(!m_fillColor)
+ {
+ m_fillColor = new SVGPaintImpl(m_object);
+ m_fillColor->ref();
+ }
+
+ setPaint(param, m_fillColor);
+ }
+ break;
+ case Color:
+ if(m_flags & SVG_STYLE_FLAG_COLOR)
+ redraw = true;
+ if(inherit)
+ m_flags &= ~SVG_STYLE_FLAG_COLOR;
+ else
+ {
+ m_flags |= SVG_STYLE_FLAG_COLOR;
+
+ if(!m_color)
+ {
+ m_color = new SVGColorImpl(m_object);
+ m_color->ref();
+ }
+ setColor(param, m_color);
+ }
+ break;
+ case StopColor:
+ m_flags |= SVG_STYLE_FLAG_STOP;
+
+ if(!m_stopColor)
+ {
+ m_stopColor = new SVGColorImpl(m_object);
+ m_stopColor->ref();
+ }
+
+ if(!inherit)
+ setColor(param, m_stopColor);
+ break;
+ case ColorInterpolation:
+ if(inherit)
+ m_flags &= ~SVG_STYLE_FLAG_COLOR_INTERPOLATION;
+ else
+ {
+ m_flags |= SVG_STYLE_FLAG_COLOR_INTERPOLATION;
+ if(param == "auto" || param == "sRGB")
+ m_colorInterpolation = CI_SRGB;
+ else
+ if(param == "linearRGB")
+ m_colorInterpolation = CI_LINEARRGB;
+ }
+ break;
+ case FontSize:
+ {
+ m_flags |= SVG_STYLE_FLAG_FONT_SIZE;
+ if(!inherit)
+ {
+ double temp = fontSizeForText(param);
+ if(temp != -1) // Is "absolute-size"
+ {
+ m_fontSize = temp;
+ break;
+ }
+
+ SVGLengthImpl *length = SVGSVGElementImpl::createSVGLength();
+ length->setContext(m_object);
+ length->setValueAsString(DOM::DOMString(param));
+ m_fontSize = length->value();
+ length->deref();
+ }
+ break;
+ }
+ case FontFamily:
+ m_flags |= SVG_STYLE_FLAG_FONT_FAMILY;
+
+ // Hacks
+ // #1 Replace "'" characters by ""
+ param = param.replace('\'', TQString());
+ // #2 Replace "MS-Gothic" by "MS Gothic"
+ param = param.replace("MS-Gothic", "MS Gothic");
+ // #3 Replace "Helvetica" by "Arial"
+ param = param.replace("Helvetica", "Arial");
+ param = param.replace("helvetica", "Arial");
+
+ if(!m_fontFamily)
+ {
+ m_fontFamily = new SVGStringListImpl();
+ m_fontFamily->ref();
+ }
+
+ if(!inherit)
+ SVGHelperImpl::parseCommaSeperatedList(m_fontFamily, param);
+ break;
+ case FontWeight:
+ m_flags |= SVG_STYLE_FLAG_FONT_WEIGHT;
+ if(!inherit)
+ m_fontWeight = param;
+ break;
+ case FontStyle:
+ m_flags |= SVG_STYLE_FLAG_FONT_STYLE;
+ if(param == "normal")
+ m_fontStyle = FSNORMAL;
+ else if(param == "italic")
+ m_fontStyle = ITALIC;
+ else if(param == "oblique")
+ m_fontStyle = OBLIQUE;
+ break;
+ case TextDecoration:
+ m_flags |= SVG_STYLE_FLAG_TEXT_DECORATION;
+ if(param == "none")
+ m_textDecoration = TDNONE;
+ {
+ // CSS2 allows multiple decorations
+ m_textDecoration = TDNONE;
+ TQStringList decorations = TQStringList::split(' ', param);
+ for(TQStringList::Iterator it = decorations.begin(); it != decorations.end(); ++it)
+ {
+ if(*it == "underline")
+ m_textDecoration |= UNDERLINE;
+ else if(*it == "overline")
+ m_textDecoration |= OVERLINE;
+ else if(*it == "line-through")
+ m_textDecoration |= LINE_THROUGH;
+ }
+ }
+ break;
+ case TextAnchor:
+ m_flags |= SVG_STYLE_FLAG_TEXT_ANCHOR;
+ if(param == "start")
+ m_textAnchor = TASTART;
+ else if(param == "middle")
+ m_textAnchor = TAMIDDLE;
+ else if(param == "end")
+ m_textAnchor = TAEND;
+ break;
+ case Direction:
+ m_flags |= SVG_STYLE_FLAG_TEXT_DIRECTION;
+ // Spec: direction is only processed when unicode-bidi
+ // is set to bidi-override or embedded
+ if(m_textUnicodeBidi == OVERRIDE ||
+ m_textUnicodeBidi == EMBED ||
+ m_textUnicodeBidi == UBNORMAL)
+ {
+ if(param == "rtl")
+ m_textDirection = RTL;
+ else if(param == "ltr")
+ m_textDirection = LTR;
+ }
+ break;
+ case WritingMode:
+ m_flags |= SVG_STYLE_FLAG_TEXT_WRITING_MODE;
+ if(param == "lr-tb" || param == "lr")
+ m_textWritingMode = LR;
+ else if(param == "rl-tb" || param == "rl")
+ m_textWritingMode = RL;
+ else if(param == "tb-lr" || param == "tb")
+ m_textWritingMode = TB;
+ break;
+ case UnicodeBidi:
+ m_flags |= SVG_STYLE_FLAG_TEXT_UNICODE_BIDI;
+ if(param == "normal")
+ m_textUnicodeBidi = UBNORMAL;
+ else if(param == "embed")
+ m_textUnicodeBidi = EMBED;
+ else if(param == "bidi-override")
+ m_textUnicodeBidi = OVERRIDE;
+ break;
+ case GlyphOrientationVertical:
+ m_flags |= SVG_STYLE_FLAG_GLYPH_ORIENTATION_VERTICAL;
+ m_glyphOrientationVertical = param;
+ break;
+ case GlyphOrientationHorizontal:
+ m_flags |= SVG_STYLE_FLAG_GLYPH_ORIENTATION_HORIZONTAL;
+ m_glyphOrientationHorizontal = param;
+ break;
+ case Opacity:
+ m_flags |= SVG_STYLE_FLAG_OPACITY;
+
+ if(!inherit)
+ {
+ SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_opacity);
+ }
+ break;
+ case FillOpacity:
+ m_flags |= SVG_STYLE_FLAG_FILL_OPACITY;
+
+ if(!inherit)
+ {
+ SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_fillOpacity);
+ }
+ break;
+ case StrokeOpacity:
+ m_flags |= SVG_STYLE_FLAG_STROKE_OPACITY;
+
+ if(!inherit)
+ {
+ SVGLengthImpl::convertPercentageToFloat(value.toString(exec).qstring(), m_strokeOpacity);
+ }
+ break;
+ case ClipPath:
+ m_flags |= SVG_STYLE_FLAG_CLIP_PATH;
+ if(!inherit)
+ m_clipPath = extractUrlId(param);
+ break;
+ case Mask:
+ m_flags |= SVG_STYLE_FLAG_MASK;
+ if(!inherit)
+ m_mask = extractUrlId(param);
+ break;
+ case MarkerStart:
+ m_flags |= SVG_STYLE_FLAG_MARKER_START;
+ if(!inherit)
+ setStartMarker(param);
+ break;
+ case MarkerMid:
+ m_flags |= SVG_STYLE_FLAG_MARKER_MID;
+ if(!inherit)
+ setMidMarker(param);
+ break;
+ case MarkerEnd:
+ m_flags |= SVG_STYLE_FLAG_MARKER_END;
+ if(!inherit)
+ setEndMarker(param);
+ break;
+ case Marker:
+ m_flags |= (SVG_STYLE_FLAG_MARKER_START | SVG_STYLE_FLAG_MARKER_MID | SVG_STYLE_FLAG_MARKER_END);
+ if(!inherit)
+ setMarkers(param);
+ break;
+ case PointerEvents:
+ m_flags |= SVG_STYLE_FLAG_POINTER_EVENTS;
+ if(param == "none")
+ m_pointerEvents = PE_NONE;
+ else if(param == "stroke")
+ m_pointerEvents = PE_STROKE;
+ else if(param == "fill")
+ m_pointerEvents = PE_FILL;
+ else if(param == "painted")
+ m_pointerEvents = PE_PAINTED;
+ else if(param == "visibleStroke")
+ m_pointerEvents = PE_VISIBLE_STROKE;
+ else if(param == "visibleFill")
+ m_pointerEvents = PE_VISIBLE_FILL;
+ else if(param == "visiblePainted")
+ m_pointerEvents = PE_VISIBLE_PAINTED;
+ else if(param == "visible")
+ m_pointerEvents = PE_VISIBLE;
+ else if(param == "all")
+ m_pointerEvents = PE_ALL;
+ break;
+ case Cursor:
+ m_flags |= SVG_STYLE_FLAG_CURSOR;
+ if(param == "auto")
+ m_cursor = CURSOR_AUTO;
+ else if(param == "crosshair")
+ m_cursor = CURSOR_CROSSHAIR;
+ else if(param == "default")
+ m_cursor = CURSOR_DEFAULT;
+ else if(param == "pointer")
+ m_cursor = CURSOR_POINTER;
+ else if(param == "move")
+ m_cursor = CURSOR_MOVE;
+ else if(param == "e-resize")
+ m_cursor = CURSOR_E_RESIZE;
+ else if(param == "ne-resize")
+ m_cursor = CURSOR_NE_RESIZE;
+ else if(param == "nw-resize")
+ m_cursor = CURSOR_NW_RESIZE;
+ else if(param == "n-resize")
+ m_cursor = CURSOR_N_RESIZE;
+ else if(param == "se-resize")
+ m_cursor = CURSOR_SE_RESIZE;
+ else if(param == "sw-resize")
+ m_cursor = CURSOR_SW_RESIZE;
+ else if(param == "s-resize")
+ m_cursor = CURSOR_S_RESIZE;
+ else if(param == "w-resize")
+ m_cursor = CURSOR_W_RESIZE;
+ else if(param == "text")
+ m_cursor = CURSOR_TEXT;
+ else if(param == "wait")
+ m_cursor = CURSOR_WAIT;
+ else if(param == "help")
+ m_cursor = CURSOR_HELP;
+ break;
+ case Display:
+ m_flags |= SVG_STYLE_FLAG_DISPLAY;
+
+ if(param == "none")
+ m_display = false;
+ else if(!inherit)
+ m_display = true;
+ break;
+ case Overflow:
+ m_flags |= SVG_STYLE_FLAG_OVERFLOW;
+ if(param == "hidden" || param == "scroll")
+ m_overflow = false;
+ else if(!inherit)
+ m_overflow = true;
+ break;
+ case Clip:
+ m_flags |= SVG_STYLE_FLAG_CLIP_PATH;
+ if(!inherit)
+ setClip(param);
+ break;
+ case Visibility:
+ if(m_flags & SVG_STYLE_FLAG_VISIBILITY)
+ redraw = true;
+ if(inherit)
+ m_flags &= ~SVG_STYLE_FLAG_COLOR;
+ else
+ {
+ m_flags |= SVG_STYLE_FLAG_VISIBILITY;
+
+ if(param == "visible")
+ m_visible = true;
+ else if(!inherit)
+ m_visible = false;
+
+ // Just a quick fix for the script-* files (Niko)
+ // Any better solution??
+ update = UPDATE_TRANSFORM;
+ redraw = true;
+ }
+ SVGHelperImpl::applyContainer<SVGStylableImpl>(this, Visibility, param);
+ break;
+ case FillRule:
+ m_flags |= SVG_STYLE_FLAG_FILL_RULE;
+ if(!inherit)
+ m_fillRule = (param == "evenodd" ? RULE_EVENODD : RULE_NONZERO);
+ break;
+ case ClipRule:
+ m_flags |= SVG_STYLE_FLAG_CLIP_RULE;
+ if(!inherit)
+ m_clipRule = (param == "evenodd" ? RULE_EVENODD : RULE_NONZERO);
+ break;
+ case StrokeDashOffset:
+ m_flags |= SVG_STYLE_FLAG_STROKE_DASH_OFFSET;
+
+ if(!m_dashOffset)
+ {
+ m_dashOffset = new SVGAnimatedLengthImpl(LENGTHMODE_OTHER, m_object);
+ m_dashOffset->ref();
+ }
+
+ if(!inherit)
+ m_dashOffset->baseVal()->setValueAsString(param);
+ break;
+ case StrokeDashArray:
+ {
+ m_flags |= SVG_STYLE_FLAG_STROKE_DASH_ARRAY;
+
+ if(!m_dashArray)
+ {
+ m_dashArray = new SVGAnimatedLengthListImpl();
+ m_dashArray->ref();
+ }
+ else
+ m_dashArray->baseVal()->clear();
+
+ if(param != "none" && !inherit)
+ SVGHelperImpl::parseLengthList(m_dashArray, param);
+ break;
+ }
+ case ColorProfile:
+ {
+ m_flags |= SVG_STYLE_FLAG_COLOR_PROFILE;
+ if(!inherit)
+ {
+ if(!m_object)
+ return;
+
+ SVGColorProfileElementImpl *handle = static_cast<SVGColorProfileElementImpl *>(m_object->ownerSVGElement()->getElementById(SVGURIReferenceImpl::getTarget(param)));
+ if(handle)
+ SVGImageElementImpl::applyColorProfile(handle, static_cast<SVGImageElementImpl *>(this));
+ }
+ break;
+ }
+ case BaselineShift:
+ {
+ m_flags |= SVG_STYLE_FLAG_BASELINE_SHIFT;
+ if(!inherit)
+ m_baselineShift = param;
+ break;
+ }
+ case LetterSpacing:
+ m_flags |= SVG_STYLE_FLAG_LETTER_SPACING;
+ case WordSpacing:
+ {
+ if(!inherit)
+ {
+ if(token == WordSpacing)
+ {
+ m_flags |= SVG_STYLE_FLAG_WORD_SPACING;
+ m_wordSpacing = param;
+ }
+ else
+ m_letterSpacing = param;
+ }
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+
+ if(redraw)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_object);
+ if(inherit)
+ processStyle();
+
+ if(shape && shape->item())
+ {
+ if(update > -1)
+ shape->item()->update(static_cast<CanvasItemUpdate>(update));
+ else if(m_object)
+ m_object->ownerDoc()->canvas()->invalidate(shape->item(), false);
+ }
+ }
+}
+
+Value SVGStylableImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
+{
+ KSVG_CHECK_THIS(SVGStylableImpl)
+
+ switch(id)
+ {
+ case SVGStylableImpl::GetStyle:
+ return Undefined();
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
diff --git a/ksvg/impl/SVGStylableImpl.h b/ksvg/impl/SVGStylableImpl.h
index 50a37568..09f8fc07 100644
--- a/ksvg/impl/SVGStylableImpl.h
+++ b/ksvg/impl/SVGStylableImpl.h
@@ -323,5 +323,3 @@ KSVG_DEFINE_PROTOTYPE(SVGStylableImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGStylableImplProtoFunc, SVGStylableImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStyleElementImpl.cc b/ksvg/impl/SVGStyleElementImpl.cc
deleted file mode 100644
index d826441b..00000000
--- a/ksvg/impl/SVGStyleElementImpl.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGStyleElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGStyleElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGStyleElementImpl::SVGStyleElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
- KSVG_EMPTY_FLAGS
-}
-
-SVGStyleElementImpl::~SVGStyleElementImpl()
-{
-}
-
-void SVGStyleElementImpl::setXmlspace(const DOM::DOMString &xmlspace)
-{
- setAttribute("xml:space", xmlspace);
-}
-
-DOM::DOMString SVGStyleElementImpl::xmlspace() const
-{
- return getAttribute("xml:space");
-}
-
-void SVGStyleElementImpl::setType(const DOM::DOMString &type)
-{
- setAttribute("type", type);
-}
-
-DOM::DOMString SVGStyleElementImpl::type() const
-{
- return getAttribute("type");
-}
-
-void SVGStyleElementImpl::setMedia(const DOM::DOMString &media)
-{
- setAttribute("media", media);
-}
-
-DOM::DOMString SVGStyleElementImpl::media() const
-{
- return getAttribute("media");
-}
-
-void SVGStyleElementImpl::setTitle(const DOM::DOMString &title)
-{
- setAttribute("title", title);
-}
-
-DOM::DOMString SVGStyleElementImpl::title() const
-{
- return getAttribute("title");
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGStyleElementImpl::s_hashTable 5
- xmlspace SVGStyleElementImpl::Xmlspace DontDelete
- type SVGStyleElementImpl::Type DontDelete
- media SVGStyleElementImpl::Media DontDelete
- title SVGStyleElementImpl::Title DontDelete
-@end
-*/
-
-Value SVGStyleElementImpl::getValueProperty(ExecState *, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Xmlspace:
- return String(xmlspace());
- case Type:
- return String(type());
- case Media:
- return String(media());
- case Title:
- return String(title());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGStyleElementImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case Xmlspace:
- setXmlspace(value.toString(exec).string());
- break;
- case Type:
- setType(value.toString(exec).string());
- break;
- case Media:
- setMedia(value.toString(exec).string());
- break;
- case Title:
- setTitle(value.toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- break;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGStyleElementImpl.cpp b/ksvg/impl/SVGStyleElementImpl.cpp
new file mode 100644
index 00000000..c376cb30
--- /dev/null
+++ b/ksvg/impl/SVGStyleElementImpl.cpp
@@ -0,0 +1,133 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGStyleElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGStyleElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGStyleElementImpl::SVGStyleElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+ KSVG_EMPTY_FLAGS
+}
+
+SVGStyleElementImpl::~SVGStyleElementImpl()
+{
+}
+
+void SVGStyleElementImpl::setXmlspace(const DOM::DOMString &xmlspace)
+{
+ setAttribute("xml:space", xmlspace);
+}
+
+DOM::DOMString SVGStyleElementImpl::xmlspace() const
+{
+ return getAttribute("xml:space");
+}
+
+void SVGStyleElementImpl::setType(const DOM::DOMString &type)
+{
+ setAttribute("type", type);
+}
+
+DOM::DOMString SVGStyleElementImpl::type() const
+{
+ return getAttribute("type");
+}
+
+void SVGStyleElementImpl::setMedia(const DOM::DOMString &media)
+{
+ setAttribute("media", media);
+}
+
+DOM::DOMString SVGStyleElementImpl::media() const
+{
+ return getAttribute("media");
+}
+
+void SVGStyleElementImpl::setTitle(const DOM::DOMString &title)
+{
+ setAttribute("title", title);
+}
+
+DOM::DOMString SVGStyleElementImpl::title() const
+{
+ return getAttribute("title");
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGStyleElementImpl::s_hashTable 5
+ xmlspace SVGStyleElementImpl::Xmlspace DontDelete
+ type SVGStyleElementImpl::Type DontDelete
+ media SVGStyleElementImpl::Media DontDelete
+ title SVGStyleElementImpl::Title DontDelete
+@end
+*/
+
+Value SVGStyleElementImpl::getValueProperty(ExecState *, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Xmlspace:
+ return String(xmlspace());
+ case Type:
+ return String(type());
+ case Media:
+ return String(media());
+ case Title:
+ return String(title());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGStyleElementImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case Xmlspace:
+ setXmlspace(value.toString(exec).string());
+ break;
+ case Type:
+ setType(value.toString(exec).string());
+ break;
+ case Media:
+ setMedia(value.toString(exec).string());
+ break;
+ case Title:
+ setTitle(value.toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ break;
+ }
+}
diff --git a/ksvg/impl/SVGStyleElementImpl.h b/ksvg/impl/SVGStyleElementImpl.h
index fcf7b152..6bdbbeb6 100644
--- a/ksvg/impl/SVGStyleElementImpl.h
+++ b/ksvg/impl/SVGStyleElementImpl.h
@@ -68,5 +68,3 @@ KSVG_REGISTER_ELEMENT(SVGStyleElementImpl, "style")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSwitchElementImpl.cc b/ksvg/impl/SVGSwitchElementImpl.cc
deleted file mode 100644
index 613a1982..00000000
--- a/ksvg/impl/SVGSwitchElementImpl.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDocumentImpl.h"
-#include "SVGSwitchElementImpl.h"
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-SVGSwitchElementImpl::SVGSwitchElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
-}
-
-SVGSwitchElementImpl::~SVGSwitchElementImpl()
-{
-}
-
-void SVGSwitchElementImpl::createItem(KSVGCanvas *c)
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- DOM::Node node = firstChild();
- for(; !node.isNull(); node = node.nextSibling())
- {
- SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
- SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
-
- bool ok = tests ? tests->ok() : true;
-
- if(element && shape && ok && style->getVisible() && style->getDisplay() && (shape->directRender() || !directRender()))
- {
- element->createItem(c);
- break;
- }
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSwitchElementImpl.cpp b/ksvg/impl/SVGSwitchElementImpl.cpp
new file mode 100644
index 00000000..d69483f7
--- /dev/null
+++ b/ksvg/impl/SVGSwitchElementImpl.cpp
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDocumentImpl.h"
+#include "SVGSwitchElementImpl.h"
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+SVGSwitchElementImpl::SVGSwitchElementImpl(DOM::ElementImpl *impl) : SVGContainerImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+}
+
+SVGSwitchElementImpl::~SVGSwitchElementImpl()
+{
+}
+
+void SVGSwitchElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ DOM::Node node = firstChild();
+ for(; !node.isNull(); node = node.nextSibling())
+ {
+ SVGElementImpl *element = ownerDoc()->getElementFromHandle(node.handle());
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element);
+ SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element);
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element);
+
+ bool ok = tests ? tests->ok() : true;
+
+ if(element && shape && ok && style->getVisible() && style->getDisplay() && (shape->directRender() || !directRender()))
+ {
+ element->createItem(c);
+ break;
+ }
+ }
+}
diff --git a/ksvg/impl/SVGSwitchElementImpl.h b/ksvg/impl/SVGSwitchElementImpl.h
index 2b29d2a4..5807e77a 100644
--- a/ksvg/impl/SVGSwitchElementImpl.h
+++ b/ksvg/impl/SVGSwitchElementImpl.h
@@ -58,5 +58,3 @@ KSVG_REGISTER_ELEMENT(SVGSwitchElementImpl, "switch")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSymbolElementImpl.cc b/ksvg/impl/SVGSymbolElementImpl.cc
deleted file mode 100644
index da0b5b90..00000000
--- a/ksvg/impl/SVGSymbolElementImpl.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGRectImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGAnimatedRectImpl.h"
-#include "SVGSymbolElementImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGPreserveAspectRatioImpl.h"
-#include "SVGAnimatedPreserveAspectRatioImpl.h"
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-#include "SVGSymbolElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-
-SVGSymbolElementImpl::SVGSymbolElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGFitToViewBoxImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
- m_height->ref();
-}
-
-SVGSymbolElementImpl::~SVGSymbolElementImpl()
-{
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
-}
-/*
-@namespace KSVG
-@begin SVGSymbolElementImpl::s_hashTable 3
- width SVGSymbolElementImpl::Width DontDelete|ReadOnly
- height SVGSymbolElementImpl::Height DontDelete|ReadOnly
-@end
-*/
-
-Value SVGSymbolElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case Width:
- if(!attributeMode)
- return m_width->cache(exec);
- else
- return Number(m_width->baseVal()->value());
- case Height:
- if(!attributeMode)
- return m_height->cache(exec);
- else
- return Number(m_height->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGSymbolElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Width:
- m_width->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- case Height:
- m_height->baseVal()->setValueAsString(value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGSymbolElementImpl.cpp b/ksvg/impl/SVGSymbolElementImpl.cpp
new file mode 100644
index 00000000..bbbef0b8
--- /dev/null
+++ b/ksvg/impl/SVGSymbolElementImpl.cpp
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGRectImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGAnimatedRectImpl.h"
+#include "SVGSymbolElementImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGPreserveAspectRatioImpl.h"
+#include "SVGAnimatedPreserveAspectRatioImpl.h"
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+#include "SVGSymbolElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+
+SVGSymbolElementImpl::SVGSymbolElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGFitToViewBoxImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_width = new SVGAnimatedLengthImpl(LENGTHMODE_WIDTH, this);
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl(LENGTHMODE_HEIGHT, this);
+ m_height->ref();
+}
+
+SVGSymbolElementImpl::~SVGSymbolElementImpl()
+{
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+}
+/*
+@namespace KSVG
+@begin SVGSymbolElementImpl::s_hashTable 3
+ width SVGSymbolElementImpl::Width DontDelete|ReadOnly
+ height SVGSymbolElementImpl::Height DontDelete|ReadOnly
+@end
+*/
+
+Value SVGSymbolElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case Width:
+ if(!attributeMode)
+ return m_width->cache(exec);
+ else
+ return Number(m_width->baseVal()->value());
+ case Height:
+ if(!attributeMode)
+ return m_height->cache(exec);
+ else
+ return Number(m_height->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGSymbolElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Width:
+ m_width->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ case Height:
+ m_height->baseVal()->setValueAsString(value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGSymbolElementImpl.h b/ksvg/impl/SVGSymbolElementImpl.h
index 19278ea0..461a749c 100644
--- a/ksvg/impl/SVGSymbolElementImpl.h
+++ b/ksvg/impl/SVGSymbolElementImpl.h
@@ -72,5 +72,3 @@ KSVG_REGISTER_ELEMENT(SVGSymbolElementImpl, "symbol")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTRefElementImpl.cc b/ksvg/impl/SVGTRefElementImpl.cc
deleted file mode 100644
index 73cb2532..00000000
--- a/ksvg/impl/SVGTRefElementImpl.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTRefElementImpl.h"
-#include "SVGTextElementImpl.h"
-#include "SVGAnimatedStringImpl.h"
-
-#include "KSVGLoader.h"
-
-using namespace KSVG;
-
-SVGTRefElementImpl::SVGTRefElementImpl(DOM::ElementImpl *impl) : SVGTSpanElementImpl(impl), SVGURIReferenceImpl()
-{
-}
-
-SVGTRefElementImpl::~SVGTRefElementImpl()
-{
-}
-
-void SVGTRefElementImpl::setAttributes()
-{
- SVGTSpanElementImpl::setAttributes();
-
- DOM::DOMString _href = href()->baseVal();
-
- if(!_href.isNull())
- href()->setBaseVal(DOM::DOMString(SVGURIReferenceImpl::getTarget(_href.string())));
-
- // get the text of the referenced element
- TQString text;
-
- TQString url = _href.string().stripWhiteSpace(), filename, id;
- if(!SVGURIReferenceImpl::parseURIReference(url, filename, id))
- return;
-
- if(!filename.isEmpty()) // a reference into another svg
- text = KSVGLoader::getCharacterData(KURL(ownerDoc()->baseUrl().path(), filename), id);
- else
- {
- // a reference to an element in this svg
- SVGElementImpl *target = ownerSVGElement()->getElementById(id);
- SVGTextElementImpl *textTarget = dynamic_cast<SVGTextElementImpl *>(target);
-
- if(textTarget)
- text = textTarget->text();
- }
-
- text = handleText(text);
-
- if(!text.isEmpty())
- {
- DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(text);
- appendChild(impl);
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTRefElementImpl.cpp b/ksvg/impl/SVGTRefElementImpl.cpp
new file mode 100644
index 00000000..1f352f9b
--- /dev/null
+++ b/ksvg/impl/SVGTRefElementImpl.cpp
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTRefElementImpl.h"
+#include "SVGTextElementImpl.h"
+#include "SVGAnimatedStringImpl.h"
+
+#include "KSVGLoader.h"
+
+using namespace KSVG;
+
+SVGTRefElementImpl::SVGTRefElementImpl(DOM::ElementImpl *impl) : SVGTSpanElementImpl(impl), SVGURIReferenceImpl()
+{
+}
+
+SVGTRefElementImpl::~SVGTRefElementImpl()
+{
+}
+
+void SVGTRefElementImpl::setAttributes()
+{
+ SVGTSpanElementImpl::setAttributes();
+
+ DOM::DOMString _href = href()->baseVal();
+
+ if(!_href.isNull())
+ href()->setBaseVal(DOM::DOMString(SVGURIReferenceImpl::getTarget(_href.string())));
+
+ // get the text of the referenced element
+ TQString text;
+
+ TQString url = _href.string().stripWhiteSpace(), filename, id;
+ if(!SVGURIReferenceImpl::parseURIReference(url, filename, id))
+ return;
+
+ if(!filename.isEmpty()) // a reference into another svg
+ text = KSVGLoader::getCharacterData(KURL(ownerDoc()->baseUrl().path(), filename), id);
+ else
+ {
+ // a reference to an element in this svg
+ SVGElementImpl *target = ownerSVGElement()->getElementById(id);
+ SVGTextElementImpl *textTarget = dynamic_cast<SVGTextElementImpl *>(target);
+
+ if(textTarget)
+ text = textTarget->text();
+ }
+
+ text = handleText(text);
+
+ if(!text.isEmpty())
+ {
+ DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(text);
+ appendChild(impl);
+ }
+}
diff --git a/ksvg/impl/SVGTRefElementImpl.h b/ksvg/impl/SVGTRefElementImpl.h
index 60d82231..4a61e916 100644
--- a/ksvg/impl/SVGTRefElementImpl.h
+++ b/ksvg/impl/SVGTRefElementImpl.h
@@ -48,5 +48,3 @@ KSVG_REGISTER_ELEMENT(SVGTRefElementImpl, "tref")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTSpanElementImpl.cc b/ksvg/impl/SVGTSpanElementImpl.cc
deleted file mode 100644
index 2d3fef15..00000000
--- a/ksvg/impl/SVGTSpanElementImpl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <Glyph.h>
-
-#include "SVGDocumentImpl.h"
-#include "SVGTextElementImpl.h"
-#include "SVGTSpanElementImpl.h"
-#include "SVGAnimatedLengthListImpl.h"
-
-#include "KSVGCanvas.h"
-#include "KSVGTextChunk.h"
-
-using namespace KSVG;
-using namespace KJS;
-
-SVGTSpanElementImpl::SVGTSpanElementImpl(DOM::ElementImpl *impl) : SVGTextPositioningElementImpl(impl)
-{
-}
-
-SVGTSpanElementImpl::~SVGTSpanElementImpl()
-{
-}
-
-long SVGTSpanElementImpl::getNumberOfChars()
-{
- return text().length();
-}
-
-TQString SVGTSpanElementImpl::text()
-{
- // Otherwhise some js scripts which require a child, don't work (Niko)
- if(!hasChildNodes())
- {
- DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(DOM::DOMString(""));
- appendChild(impl);
- }
-
- return textDirectionAwareText();
-}
-
-void SVGTSpanElementImpl::setAttributes()
-{
- SVGTextPositioningElementImpl::setAttributes();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTSpanElementImpl.cpp b/ksvg/impl/SVGTSpanElementImpl.cpp
new file mode 100644
index 00000000..2cc35d05
--- /dev/null
+++ b/ksvg/impl/SVGTSpanElementImpl.cpp
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <Glyph.h>
+
+#include "SVGDocumentImpl.h"
+#include "SVGTextElementImpl.h"
+#include "SVGTSpanElementImpl.h"
+#include "SVGAnimatedLengthListImpl.h"
+
+#include "KSVGCanvas.h"
+#include "KSVGTextChunk.h"
+
+using namespace KSVG;
+using namespace KJS;
+
+SVGTSpanElementImpl::SVGTSpanElementImpl(DOM::ElementImpl *impl) : SVGTextPositioningElementImpl(impl)
+{
+}
+
+SVGTSpanElementImpl::~SVGTSpanElementImpl()
+{
+}
+
+long SVGTSpanElementImpl::getNumberOfChars()
+{
+ return text().length();
+}
+
+TQString SVGTSpanElementImpl::text()
+{
+ // Otherwhise some js scripts which require a child, don't work (Niko)
+ if(!hasChildNodes())
+ {
+ DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(DOM::DOMString(""));
+ appendChild(impl);
+ }
+
+ return textDirectionAwareText();
+}
+
+void SVGTSpanElementImpl::setAttributes()
+{
+ SVGTextPositioningElementImpl::setAttributes();
+}
diff --git a/ksvg/impl/SVGTSpanElementImpl.h b/ksvg/impl/SVGTSpanElementImpl.h
index 631b7896..012c24a6 100644
--- a/ksvg/impl/SVGTSpanElementImpl.h
+++ b/ksvg/impl/SVGTSpanElementImpl.h
@@ -51,5 +51,3 @@ KSVG_REGISTER_ELEMENT(SVGTSpanElementImpl, "tspan")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTestsImpl.cc b/ksvg/impl/SVGTestsImpl.cc
deleted file mode 100644
index e2154b7b..00000000
--- a/ksvg/impl/SVGTestsImpl.cc
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <tdelocale.h>
-#include <tdeglobal.h>
-
-#include "SVGTestsImpl.h"
-#include "SVGStringListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTestsImpl.lut.h"
-
-SVGTestsImpl::SVGTestsImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_requiredFeatures = new SVGStringListImpl();
- m_requiredFeatures->ref();
-
- m_requiredExtensions = new SVGStringListImpl();
- m_requiredExtensions->ref();
-
- m_systemLanguage = new SVGStringListImpl();
- m_systemLanguage->ref();
-}
-
-SVGTestsImpl::~SVGTestsImpl()
-{
- if(m_requiredFeatures)
- m_requiredFeatures->deref();
- if(m_requiredExtensions)
- m_requiredExtensions->deref();
- if(m_systemLanguage)
- m_systemLanguage->deref();
-}
-
-void SVGTestsImpl::parseRequiredFeatures(const TQString &/*value*/)
-{
- // FIXME
-}
-
-void SVGTestsImpl::parseRequiredExtensions(const TQString &value)
-{
- m_requiredExtensions->appendItem(new SharedString(value));
-}
-
-void SVGTestsImpl::parseSystemLanguage(const TQString &value)
-{
- m_systemLanguage->appendItem(new SharedString(value));
-}
-
-SVGStringListImpl *SVGTestsImpl::requiredFeatures() const
-{
- return m_requiredFeatures;
-}
-
-SVGStringListImpl *SVGTestsImpl::requiredExtensions() const
-{
- return m_requiredExtensions;
-}
-
-SVGStringListImpl *SVGTestsImpl::systemLanguage() const
-{
- return m_systemLanguage;
-}
-
-bool SVGTestsImpl::ok()
-{
- for(unsigned int i = 0;i < m_requiredExtensions->numberOfItems();i++)
- {
- // FIXME
- return false;
- }
- for(unsigned int i = 0;i < m_systemLanguage->numberOfItems();i++)
- {
- TQString value = m_systemLanguage->getItem(i)->string();
- if(value.isEmpty() || value != (TDEGlobal::locale()->language()).left(2))
- return false;
- }
- return true;
-}
-
-bool SVGTestsImpl::hasExtension(const DOM::DOMString &/*extension*/)
-{
- return false;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGTestsImpl::s_hashTable 5
- requiredFeatures SVGTestsImpl::RequiredFeatures DontDelete|ReadOnly
- requiredExtensions SVGTestsImpl::RequiredExtensions DontDelete|ReadOnly
- systemLanguage SVGTestsImpl::SystemLanguage DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGTestsImplProto::s_hashTable 2
- hasExtension SVGTestsImpl::HasExtension DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGTests", SVGTestsImplProto, SVGTestsImplProtoFunc)
-
-Value SVGTestsImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case RequiredFeatures:
- return m_requiredFeatures->cache(exec);
- case RequiredExtensions:
- return m_requiredExtensions->cache(exec);
- case SystemLanguage:
- return m_systemLanguage->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGTestsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case RequiredFeatures:
- parseRequiredFeatures(value.toString(exec).qstring());
- break;
- case RequiredExtensions:
- parseRequiredExtensions(value.toString(exec).qstring());
- break;
- case SystemLanguage:
- parseSystemLanguage(value.toString(exec).qstring());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGTestsImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGTestsImpl)
-
- switch(id)
- {
- case SVGTestsImpl::HasExtension:
- return Boolean(obj->hasExtension(args[0].toString(exec).string()));
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTestsImpl.cpp b/ksvg/impl/SVGTestsImpl.cpp
new file mode 100644
index 00000000..15f8bcc6
--- /dev/null
+++ b/ksvg/impl/SVGTestsImpl.cpp
@@ -0,0 +1,176 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <tdelocale.h>
+#include <tdeglobal.h>
+
+#include "SVGTestsImpl.h"
+#include "SVGStringListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTestsImpl.lut.h"
+
+SVGTestsImpl::SVGTestsImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_requiredFeatures = new SVGStringListImpl();
+ m_requiredFeatures->ref();
+
+ m_requiredExtensions = new SVGStringListImpl();
+ m_requiredExtensions->ref();
+
+ m_systemLanguage = new SVGStringListImpl();
+ m_systemLanguage->ref();
+}
+
+SVGTestsImpl::~SVGTestsImpl()
+{
+ if(m_requiredFeatures)
+ m_requiredFeatures->deref();
+ if(m_requiredExtensions)
+ m_requiredExtensions->deref();
+ if(m_systemLanguage)
+ m_systemLanguage->deref();
+}
+
+void SVGTestsImpl::parseRequiredFeatures(const TQString &/*value*/)
+{
+ // FIXME
+}
+
+void SVGTestsImpl::parseRequiredExtensions(const TQString &value)
+{
+ m_requiredExtensions->appendItem(new SharedString(value));
+}
+
+void SVGTestsImpl::parseSystemLanguage(const TQString &value)
+{
+ m_systemLanguage->appendItem(new SharedString(value));
+}
+
+SVGStringListImpl *SVGTestsImpl::requiredFeatures() const
+{
+ return m_requiredFeatures;
+}
+
+SVGStringListImpl *SVGTestsImpl::requiredExtensions() const
+{
+ return m_requiredExtensions;
+}
+
+SVGStringListImpl *SVGTestsImpl::systemLanguage() const
+{
+ return m_systemLanguage;
+}
+
+bool SVGTestsImpl::ok()
+{
+ for(unsigned int i = 0;i < m_requiredExtensions->numberOfItems();i++)
+ {
+ // FIXME
+ return false;
+ }
+ for(unsigned int i = 0;i < m_systemLanguage->numberOfItems();i++)
+ {
+ TQString value = m_systemLanguage->getItem(i)->string();
+ if(value.isEmpty() || value != (TDEGlobal::locale()->language()).left(2))
+ return false;
+ }
+ return true;
+}
+
+bool SVGTestsImpl::hasExtension(const DOM::DOMString &/*extension*/)
+{
+ return false;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGTestsImpl::s_hashTable 5
+ requiredFeatures SVGTestsImpl::RequiredFeatures DontDelete|ReadOnly
+ requiredExtensions SVGTestsImpl::RequiredExtensions DontDelete|ReadOnly
+ systemLanguage SVGTestsImpl::SystemLanguage DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGTestsImplProto::s_hashTable 2
+ hasExtension SVGTestsImpl::HasExtension DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGTests", SVGTestsImplProto, SVGTestsImplProtoFunc)
+
+Value SVGTestsImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case RequiredFeatures:
+ return m_requiredFeatures->cache(exec);
+ case RequiredExtensions:
+ return m_requiredExtensions->cache(exec);
+ case SystemLanguage:
+ return m_systemLanguage->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGTestsImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case RequiredFeatures:
+ parseRequiredFeatures(value.toString(exec).qstring());
+ break;
+ case RequiredExtensions:
+ parseRequiredExtensions(value.toString(exec).qstring());
+ break;
+ case SystemLanguage:
+ parseSystemLanguage(value.toString(exec).qstring());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGTestsImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGTestsImpl)
+
+ switch(id)
+ {
+ case SVGTestsImpl::HasExtension:
+ return Boolean(obj->hasExtension(args[0].toString(exec).string()));
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
diff --git a/ksvg/impl/SVGTestsImpl.h b/ksvg/impl/SVGTestsImpl.h
index 25c0e02b..a3123234 100644
--- a/ksvg/impl/SVGTestsImpl.h
+++ b/ksvg/impl/SVGTestsImpl.h
@@ -73,5 +73,3 @@ KSVG_DEFINE_PROTOTYPE(SVGTestsImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGTestsImplProtoFunc, SVGTestsImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextContentElementImpl.cc b/ksvg/impl/SVGTextContentElementImpl.cc
deleted file mode 100644
index 4af6c7d0..00000000
--- a/ksvg/impl/SVGTextContentElementImpl.cc
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include <tdelocale.h>
-
-#include "Glyph.h"
-
-#include "SVGStringListImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGTextContentElementImpl.h"
-#include "SVGTextElementImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-#include "SVGDocumentImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTextContentElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_cacheimpl.h"
-
-SVGTextContentElementImpl::SVGTextContentElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)
-{
- KSVG_EMPTY_FLAGS
-
- m_lengthAdjust = new SVGAnimatedEnumerationImpl();
- m_lengthAdjust->ref();
-
- // Spec: default value 'spacing'
- m_lengthAdjust->setBaseVal(LENGTHADJUST_SPACING);
-
- m_textLength = new SVGAnimatedLengthImpl();
- m_textLength->baseVal()->setValueAsString("-1");
- m_textLength->ref();
-}
-
-SVGTextContentElementImpl::~SVGTextContentElementImpl()
-{
- if(m_lengthAdjust)
- m_lengthAdjust->deref();
- if(m_textLength)
- m_textLength->deref();
-}
-
-TQString SVGTextContentElementImpl::textDirectionAwareText()
-{
- TQString text;
-
- if(hasChildNodes())
- {
- bool ltr = getTextDirection() == LTR;
- DOM::Node node = ltr ? firstChild() : lastChild();
-
- for(; !node.isNull(); node = ltr ? node.nextSibling() : node.previousSibling())
- {
- if(node.nodeType() == TEXT_NODE)
- {
- DOM::Text textNode = node;
- TQString temp = textNode.data().string();
-
- if(!ltr)
- {
- TQString convert = temp;
-
- for(int i = temp.length(); i > 0; i--)
- convert[temp.length() - i] = temp[i - 1];
-
- text += convert;
- }
- else
- text += temp;
- }
- else
- return text;
- }
- }
-
- return text;
-}
-
-T2P::GlyphLayoutParams *SVGTextContentElementImpl::layoutParams() const
-{
- SVGStylableImpl *style = const_cast<SVGTextContentElementImpl *>(this);
-
- T2P::GlyphLayoutParams *params = new T2P::GlyphLayoutParams();
- params->setTb(style->getTextWritingMode() == TB);
- params->setUseBidi(style->getTextUnicodeBidi() == UBNORMAL);
- if(!dynamic_cast<SVGTextElementImpl *>(m_object)) // not allowed for <text>
- params->setBaselineShift(style->getBaselineShift().latin1());
-
- bool worked = true;
- int deg = style->getGlyphOrientationVertical().toInt(&worked);
- if(!worked)
- params->setGlyphOrientationVertical(-90);
- else
- params->setGlyphOrientationVertical(deg);
-
- worked = true;
- deg = style->getGlyphOrientationHorizontal().toInt(&worked);
- if(!worked)
- params->setGlyphOrientationHorizontal(-90);
- else
- params->setGlyphOrientationHorizontal(deg);
-
- SVGLengthImpl *length = new SVGLengthImpl(LENGTHMODE_OTHER, const_cast<SVGTextContentElementImpl *>(this));
- length->ref();
-
- if(style->getLetterSpacing() != "normal" && style->getLetterSpacing() != "inherit")
- length->setValueAsString(DOM::DOMString(style->getLetterSpacing()));
- params->setLetterSpacing(length->value());
-
- if(style->getWordSpacing() != "normal" && style->getWordSpacing() != "inherit")
- length->setValueAsString(DOM::DOMString(style->getWordSpacing()));
- params->setWordSpacing(length->value());
-
- length->deref();
-
- return params;
-}
-
-SVGAnimatedLengthImpl *SVGTextContentElementImpl::textLength() const
-{
- return m_textLength;
-}
-
-SVGAnimatedEnumerationImpl *SVGTextContentElementImpl::lengthAdjust() const
-{
- return m_lengthAdjust;
-}
-
-long SVGTextContentElementImpl::getNumberOfChars()
-{
- return 0;
-}
-
-float SVGTextContentElementImpl::getComputedTextLength()
-{
- return 0.0;
-}
-
-/*
-float SVGTextContentElementImpl::getSubStringLength(const unsigned long &charnum,const unsigned long &nchars)
-{
-}
-
-SVGPoint SVGTextContentElementImpl::getStartPositionOfChar(const unsigned long &charnum)
-{
-}
-
-SVGPoint SVGTextContentElementImpl::getEndPositionOfChar(const unsigned long &charnum)
-{
-}
-
-SVGRect SVGTextContentElementImpl::getExtentOfChar(const unsigned long &charnum)
-{
-}
-
-float SVGTextContentElementImpl::getRotationOfChar(const unsigned long &charnum)
-{
-}
-
-long SVGTextContentElementImpl::getCharNumAtPosition(const SVGPoint &point)
-{
-}
-
-void SVGTextContentElementImpl::selectSubString(const unsigned long &charnum,const unsigned long &nchars)
-{
-}
-*/
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGTextContentElementImpl::s_hashTable 3
- textLength SVGTextContentElementImpl::TextLength DontDelete|ReadOnly
- lengthAdjust SVGTextContentElementImpl::LengthAdjust DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGTextContentElementImplProto::s_hashTable 11
- getNumberOfChars SVGTextContentElementImpl::GetNumberOfChars DontDelete|Function 0
- getComputedTextLength SVGTextContentElementImpl::GetComputedTextLength DontDelete|Function 0
- getSubStringLength SVGTextContentElementImpl::GetSubStringLength DontDelete|Function 2
- getStartPositionOfChar SVGTextContentElementImpl::GetStartPositionOfChar DontDelete|Function 1
- getEndPositionOfChar SVGTextContentElementImpl::GetEndPositionOfChar DontDelete|Function 1
- getExtentOfChar SVGTextContentElementImpl::GetExtentOfChar DontDelete|Function 1
- getRotationOfChar SVGTextContentElementImpl::GetRotationOfChar DontDelete|Function 1
- getCharNumAtPosition SVGTextContentElementImpl::GetCharNumAtPosition DontDelete|Function 1
- selectSubString SVGTextContentElementImpl::SelectSubString DontDelete|Function 2
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGTextContentElement", SVGTextContentElementImplProto, SVGTextContentElementImplProtoFunc)
-
-Value SVGTextContentElementImpl::getValueProperty(ExecState *, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGTextContentElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case TextLength:
- m_textLength->baseVal()->setValueAsString(value.toString(exec).string());
- if(m_textLength->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute textLength of element <text> is illegal"));
- break;
- case LengthAdjust:
- {
- TQString temp = value.toString(exec).qstring();
- if(temp == "spacingAndGlyphs")
- m_lengthAdjust->setBaseVal(LENGTHADJUST_SPACINGANDGLYPHS);
- else if(temp == "spacing")
- m_lengthAdjust->setBaseVal(LENGTHADJUST_SPACING);
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-Value SVGTextContentElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
-{
- KSVG_CHECK_THIS(SVGTextContentElementImpl)
-
- switch(id)
- {
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-/*
-@namespace KSVG
-@begin SVGTextContentElementImplConstructor::s_hashTable 5
- LENGTHADJUST_UNKNOWN KSVG::LENGTHADJUST_UNKNOWN DontDelete|ReadOnly
- LENGTHADJUST_SPACING KSVG::LENGTHADJUST_SPACING DontDelete|ReadOnly
- LENGTHADJUST_SPACINGANDGLYPHS KSVG::LENGTHADJUST_SPACINGANDGLYPHS DontDelete|ReadOnly
-@end
-*/
-
-Value SVGTextContentElementImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGTextContentElementImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGTextContentElementImplConstructor>(exec, "[[svgtextcontentelement.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextContentElementImpl.cpp b/ksvg/impl/SVGTextContentElementImpl.cpp
new file mode 100644
index 00000000..a772672b
--- /dev/null
+++ b/ksvg/impl/SVGTextContentElementImpl.cpp
@@ -0,0 +1,283 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include <tdelocale.h>
+
+#include "Glyph.h"
+
+#include "SVGStringListImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGTextContentElementImpl.h"
+#include "SVGTextElementImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGDocumentImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTextContentElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_cacheimpl.h"
+
+SVGTextContentElementImpl::SVGTextContentElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this)
+{
+ KSVG_EMPTY_FLAGS
+
+ m_lengthAdjust = new SVGAnimatedEnumerationImpl();
+ m_lengthAdjust->ref();
+
+ // Spec: default value 'spacing'
+ m_lengthAdjust->setBaseVal(LENGTHADJUST_SPACING);
+
+ m_textLength = new SVGAnimatedLengthImpl();
+ m_textLength->baseVal()->setValueAsString("-1");
+ m_textLength->ref();
+}
+
+SVGTextContentElementImpl::~SVGTextContentElementImpl()
+{
+ if(m_lengthAdjust)
+ m_lengthAdjust->deref();
+ if(m_textLength)
+ m_textLength->deref();
+}
+
+TQString SVGTextContentElementImpl::textDirectionAwareText()
+{
+ TQString text;
+
+ if(hasChildNodes())
+ {
+ bool ltr = getTextDirection() == LTR;
+ DOM::Node node = ltr ? firstChild() : lastChild();
+
+ for(; !node.isNull(); node = ltr ? node.nextSibling() : node.previousSibling())
+ {
+ if(node.nodeType() == TEXT_NODE)
+ {
+ DOM::Text textNode = node;
+ TQString temp = textNode.data().string();
+
+ if(!ltr)
+ {
+ TQString convert = temp;
+
+ for(int i = temp.length(); i > 0; i--)
+ convert[temp.length() - i] = temp[i - 1];
+
+ text += convert;
+ }
+ else
+ text += temp;
+ }
+ else
+ return text;
+ }
+ }
+
+ return text;
+}
+
+T2P::GlyphLayoutParams *SVGTextContentElementImpl::layoutParams() const
+{
+ SVGStylableImpl *style = const_cast<SVGTextContentElementImpl *>(this);
+
+ T2P::GlyphLayoutParams *params = new T2P::GlyphLayoutParams();
+ params->setTb(style->getTextWritingMode() == TB);
+ params->setUseBidi(style->getTextUnicodeBidi() == UBNORMAL);
+ if(!dynamic_cast<SVGTextElementImpl *>(m_object)) // not allowed for <text>
+ params->setBaselineShift(style->getBaselineShift().latin1());
+
+ bool worked = true;
+ int deg = style->getGlyphOrientationVertical().toInt(&worked);
+ if(!worked)
+ params->setGlyphOrientationVertical(-90);
+ else
+ params->setGlyphOrientationVertical(deg);
+
+ worked = true;
+ deg = style->getGlyphOrientationHorizontal().toInt(&worked);
+ if(!worked)
+ params->setGlyphOrientationHorizontal(-90);
+ else
+ params->setGlyphOrientationHorizontal(deg);
+
+ SVGLengthImpl *length = new SVGLengthImpl(LENGTHMODE_OTHER, const_cast<SVGTextContentElementImpl *>(this));
+ length->ref();
+
+ if(style->getLetterSpacing() != "normal" && style->getLetterSpacing() != "inherit")
+ length->setValueAsString(DOM::DOMString(style->getLetterSpacing()));
+ params->setLetterSpacing(length->value());
+
+ if(style->getWordSpacing() != "normal" && style->getWordSpacing() != "inherit")
+ length->setValueAsString(DOM::DOMString(style->getWordSpacing()));
+ params->setWordSpacing(length->value());
+
+ length->deref();
+
+ return params;
+}
+
+SVGAnimatedLengthImpl *SVGTextContentElementImpl::textLength() const
+{
+ return m_textLength;
+}
+
+SVGAnimatedEnumerationImpl *SVGTextContentElementImpl::lengthAdjust() const
+{
+ return m_lengthAdjust;
+}
+
+long SVGTextContentElementImpl::getNumberOfChars()
+{
+ return 0;
+}
+
+float SVGTextContentElementImpl::getComputedTextLength()
+{
+ return 0.0;
+}
+
+/*
+float SVGTextContentElementImpl::getSubStringLength(const unsigned long &charnum,const unsigned long &nchars)
+{
+}
+
+SVGPoint SVGTextContentElementImpl::getStartPositionOfChar(const unsigned long &charnum)
+{
+}
+
+SVGPoint SVGTextContentElementImpl::getEndPositionOfChar(const unsigned long &charnum)
+{
+}
+
+SVGRect SVGTextContentElementImpl::getExtentOfChar(const unsigned long &charnum)
+{
+}
+
+float SVGTextContentElementImpl::getRotationOfChar(const unsigned long &charnum)
+{
+}
+
+long SVGTextContentElementImpl::getCharNumAtPosition(const SVGPoint &point)
+{
+}
+
+void SVGTextContentElementImpl::selectSubString(const unsigned long &charnum,const unsigned long &nchars)
+{
+}
+*/
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGTextContentElementImpl::s_hashTable 3
+ textLength SVGTextContentElementImpl::TextLength DontDelete|ReadOnly
+ lengthAdjust SVGTextContentElementImpl::LengthAdjust DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGTextContentElementImplProto::s_hashTable 11
+ getNumberOfChars SVGTextContentElementImpl::GetNumberOfChars DontDelete|Function 0
+ getComputedTextLength SVGTextContentElementImpl::GetComputedTextLength DontDelete|Function 0
+ getSubStringLength SVGTextContentElementImpl::GetSubStringLength DontDelete|Function 2
+ getStartPositionOfChar SVGTextContentElementImpl::GetStartPositionOfChar DontDelete|Function 1
+ getEndPositionOfChar SVGTextContentElementImpl::GetEndPositionOfChar DontDelete|Function 1
+ getExtentOfChar SVGTextContentElementImpl::GetExtentOfChar DontDelete|Function 1
+ getRotationOfChar SVGTextContentElementImpl::GetRotationOfChar DontDelete|Function 1
+ getCharNumAtPosition SVGTextContentElementImpl::GetCharNumAtPosition DontDelete|Function 1
+ selectSubString SVGTextContentElementImpl::SelectSubString DontDelete|Function 2
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGTextContentElement", SVGTextContentElementImplProto, SVGTextContentElementImplProtoFunc)
+
+Value SVGTextContentElementImpl::getValueProperty(ExecState *, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGTextContentElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case TextLength:
+ m_textLength->baseVal()->setValueAsString(value.toString(exec).string());
+ if(m_textLength->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute textLength of element <text> is illegal"));
+ break;
+ case LengthAdjust:
+ {
+ TQString temp = value.toString(exec).qstring();
+ if(temp == "spacingAndGlyphs")
+ m_lengthAdjust->setBaseVal(LENGTHADJUST_SPACINGANDGLYPHS);
+ else if(temp == "spacing")
+ m_lengthAdjust->setBaseVal(LENGTHADJUST_SPACING);
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+Value SVGTextContentElementImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &)
+{
+ KSVG_CHECK_THIS(SVGTextContentElementImpl)
+
+ switch(id)
+ {
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+/*
+@namespace KSVG
+@begin SVGTextContentElementImplConstructor::s_hashTable 5
+ LENGTHADJUST_UNKNOWN KSVG::LENGTHADJUST_UNKNOWN DontDelete|ReadOnly
+ LENGTHADJUST_SPACING KSVG::LENGTHADJUST_SPACING DontDelete|ReadOnly
+ LENGTHADJUST_SPACINGANDGLYPHS KSVG::LENGTHADJUST_SPACINGANDGLYPHS DontDelete|ReadOnly
+@end
+*/
+
+Value SVGTextContentElementImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGTextContentElementImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGTextContentElementImplConstructor>(exec, "[[svgtextcontentelement.constructor]]");
+}
diff --git a/ksvg/impl/SVGTextContentElementImpl.h b/ksvg/impl/SVGTextContentElementImpl.h
index bd962037..e5a703c3 100644
--- a/ksvg/impl/SVGTextContentElementImpl.h
+++ b/ksvg/impl/SVGTextContentElementImpl.h
@@ -111,5 +111,3 @@ KSVG_DEFINE_PROTOTYPE(SVGTextContentElementImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGTextContentElementImplProtoFunc, SVGTextContentElementImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextElementImpl.cc b/ksvg/impl/SVGTextElementImpl.cc
deleted file mode 100644
index 82a53ea9..00000000
--- a/ksvg/impl/SVGTextElementImpl.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <Glyph.h>
-
-#include "SVGRectImpl.h"
-#include "SVGEventImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTextElementImpl.h"
-
-#include "CanvasItem.h"
-#include "KSVGCanvas.h"
-
-using namespace KSVG;
-
-SVGTextElementImpl::SVGTextElementImpl(DOM::ElementImpl *impl) : SVGTextPositioningElementImpl(impl), SVGTransformableImpl()
-{
- m_bboxX = 0;
- m_bboxY = 0;
-
- m_bboxWidth = 0;
- m_bboxHeight = 0;
-}
-
-SVGTextElementImpl::~SVGTextElementImpl()
-{
-}
-
-long SVGTextElementImpl::getNumberOfChars()
-{
- return text().length();
-}
-
-TQString SVGTextElementImpl::text()
-{
- // Otherwhise some js scripts which require a child, don't work (Niko)
- if(!hasChildNodes())
- {
- DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(DOM::DOMString(""));
- appendChild(impl);
- }
-
- return textDirectionAwareText();
-}
-
-SVGRectImpl *SVGTextElementImpl::getBBox()
-{
- SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
- ret->setX(m_bboxX);
- ret->setY(m_bboxY);
- ret->setWidth(m_bboxWidth);
- ret->setHeight(m_bboxHeight);
- return ret;
-}
-
-void SVGTextElementImpl::createItem(KSVGCanvas *c )
-{
- if(!c)
- c = ownerDoc()->canvas();
-
- if(!m_item)
- {
- m_item = c->createText(this);
- // Set up bbox before insert(), as that may render the item
- TQRect rect = m_item->bbox();
- m_bboxX = rect.x();
- m_bboxY = rect.y();
- m_bboxWidth = rect.width();
- m_bboxHeight = rect.height();
- c->insert(m_item);
- }
-}
-
-bool SVGTextElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &, SVGMouseEventImpl *mev)
-{
- // TODO : pointer-events should be stored here, not in SVGStylableImpl.
- SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
- if(!style || style->getPointerEvents() == PE_NONE)
- return false;
- bool test = false;
- switch(style->getPointerEvents())
- {
- case PE_VISIBLE: test = style->getVisible(); break;
- case PE_VISIBLE_PAINTED: test = style->getVisible() && (style->isStroked() || style->isFilled()) ; break;
- case PE_VISIBLE_FILL: test = style->getVisible() && style->isFilled(); break;
- case PE_VISIBLE_STROKE: test = style->getVisible() && style->isStroked(); break;
- case PE_PAINTED: test = style->isStroked() || style->isFilled(); break;
- case PE_FILL: test = style->isFilled(); break;
- case PE_STROKE: test = style->isStroked(); break;
- case PE_ALL:
- default: test = true;
- };
-
- if(test)
- {
- if(m_item->bbox().contains(p))
- {
- mev->setTarget(dynamic_cast<SVGElementImpl *>(this));
- return true;
- }
- }
-
- return false;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextElementImpl.cpp b/ksvg/impl/SVGTextElementImpl.cpp
new file mode 100644
index 00000000..7617f7de
--- /dev/null
+++ b/ksvg/impl/SVGTextElementImpl.cpp
@@ -0,0 +1,122 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <Glyph.h>
+
+#include "SVGRectImpl.h"
+#include "SVGEventImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTextElementImpl.h"
+
+#include "CanvasItem.h"
+#include "KSVGCanvas.h"
+
+using namespace KSVG;
+
+SVGTextElementImpl::SVGTextElementImpl(DOM::ElementImpl *impl) : SVGTextPositioningElementImpl(impl), SVGTransformableImpl()
+{
+ m_bboxX = 0;
+ m_bboxY = 0;
+
+ m_bboxWidth = 0;
+ m_bboxHeight = 0;
+}
+
+SVGTextElementImpl::~SVGTextElementImpl()
+{
+}
+
+long SVGTextElementImpl::getNumberOfChars()
+{
+ return text().length();
+}
+
+TQString SVGTextElementImpl::text()
+{
+ // Otherwhise some js scripts which require a child, don't work (Niko)
+ if(!hasChildNodes())
+ {
+ DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(DOM::DOMString(""));
+ appendChild(impl);
+ }
+
+ return textDirectionAwareText();
+}
+
+SVGRectImpl *SVGTextElementImpl::getBBox()
+{
+ SVGRectImpl *ret = SVGSVGElementImpl::createSVGRect();
+ ret->setX(m_bboxX);
+ ret->setY(m_bboxY);
+ ret->setWidth(m_bboxWidth);
+ ret->setHeight(m_bboxHeight);
+ return ret;
+}
+
+void SVGTextElementImpl::createItem(KSVGCanvas *c )
+{
+ if(!c)
+ c = ownerDoc()->canvas();
+
+ if(!m_item)
+ {
+ m_item = c->createText(this);
+ // Set up bbox before insert(), as that may render the item
+ TQRect rect = m_item->bbox();
+ m_bboxX = rect.x();
+ m_bboxY = rect.y();
+ m_bboxWidth = rect.width();
+ m_bboxHeight = rect.height();
+ c->insert(m_item);
+ }
+}
+
+bool SVGTextElementImpl::prepareMouseEvent(const TQPoint &p, const TQPoint &, SVGMouseEventImpl *mev)
+{
+ // TODO : pointer-events should be stored here, not in SVGStylableImpl.
+ SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(this);
+ if(!style || style->getPointerEvents() == PE_NONE)
+ return false;
+ bool test = false;
+ switch(style->getPointerEvents())
+ {
+ case PE_VISIBLE: test = style->getVisible(); break;
+ case PE_VISIBLE_PAINTED: test = style->getVisible() && (style->isStroked() || style->isFilled()) ; break;
+ case PE_VISIBLE_FILL: test = style->getVisible() && style->isFilled(); break;
+ case PE_VISIBLE_STROKE: test = style->getVisible() && style->isStroked(); break;
+ case PE_PAINTED: test = style->isStroked() || style->isFilled(); break;
+ case PE_FILL: test = style->isFilled(); break;
+ case PE_STROKE: test = style->isStroked(); break;
+ case PE_ALL:
+ default: test = true;
+ };
+
+ if(test)
+ {
+ if(m_item->bbox().contains(p))
+ {
+ mev->setTarget(dynamic_cast<SVGElementImpl *>(this));
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/ksvg/impl/SVGTextElementImpl.h b/ksvg/impl/SVGTextElementImpl.h
index fe87848a..a59564ed 100644
--- a/ksvg/impl/SVGTextElementImpl.h
+++ b/ksvg/impl/SVGTextElementImpl.h
@@ -61,5 +61,3 @@ KSVG_REGISTER_ELEMENT(SVGTextElementImpl, "text")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextPathElementImpl.cc b/ksvg/impl/SVGTextPathElementImpl.cc
deleted file mode 100644
index 8634155b..00000000
--- a/ksvg/impl/SVGTextPathElementImpl.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include <tdelocale.h>
-
-#include "Glyph.h"
-
-#include "SVGDocumentImpl.h"
-#include "SVGTextPathElement.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGTextPathElementImpl.h"
-#include "SVGAnimatedEnumerationImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTextPathElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_ecma.h"
-#include "ksvg_cacheimpl.h"
-
-SVGTextPathElementImpl::SVGTextPathElementImpl(DOM::ElementImpl *impl) : SVGTextContentElementImpl(impl), SVGURIReferenceImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_startOffset = new SVGAnimatedLengthImpl();
- m_startOffset->ref();
-
- m_method = new SVGAnimatedEnumerationImpl();
- m_method->ref();
-
- m_spacing = new SVGAnimatedEnumerationImpl();
- m_spacing->ref();
-}
-
-SVGTextPathElementImpl::~SVGTextPathElementImpl()
-{
- if(m_startOffset)
- m_startOffset->deref();
- if(m_method)
- m_method->deref();
- if(m_spacing)
- m_spacing->deref();
-}
-
-SVGAnimatedLengthImpl *SVGTextPathElementImpl::startOffset() const
-{
- return m_startOffset;
-}
-
-SVGAnimatedEnumerationImpl *SVGTextPathElementImpl::method() const
-{
- return m_method;
-}
-
-SVGAnimatedEnumerationImpl *SVGTextPathElementImpl::spacing() const
-{
- return m_spacing;
-}
-
-TQString SVGTextPathElementImpl::text()
-{
- // Otherwhise some js scripts which require a child, don't work (Niko)
- if(!hasChildNodes())
- {
- DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(DOM::DOMString(""));
- appendChild(impl);
- }
-
- return textDirectionAwareText();
-}
-
-void SVGTextPathElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- // Spec: if not specified, effect is as if a value of "0" were specified
- if(KSVG_TOKEN_NOT_PARSED(StartOffset))
- KSVG_SET_ALT_ATTRIBUTE(StartOffset, "0")
-
- // Spec: if not specified, effect is as if a value of "align" were specified
- if(KSVG_TOKEN_NOT_PARSED(Method))
- KSVG_SET_ALT_ATTRIBUTE(Method, "align")
-
- // Spec: if not specified, effect is as if a value of "exact" were specified
- if(KSVG_TOKEN_NOT_PARSED(Spacing))
- KSVG_SET_ALT_ATTRIBUTE(Spacing, "exact")
-}
-
-T2P::GlyphLayoutParams *SVGTextPathElementImpl::layoutParams() const
-{
- T2P::GlyphLayoutParams *params = SVGTextContentElementImpl::layoutParams();
- params->setTextPathStartOffset(startOffset()->baseVal()->value());
- return params;
-}
-
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGTextPathElementImpl::s_hashTable 5
- startOffset SVGTextPathElementImpl::StartOffset DontDelete|ReadOnly
- method SVGTextPathElementImpl::Method DontDelete|ReadOnly
- spacing SVGTextPathElementImpl::Spacing DontDelete|ReadOnly
-@end
-*/
-
-Value SVGTextPathElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case StartOffset:
- if(!attributeMode)
- return m_startOffset->cache(exec);
- else
- return Number(m_startOffset->baseVal()->value());
- case Method:
- if(!attributeMode)
- return m_method->cache(exec);
- else
- return Number(m_method->baseVal());
- case Spacing:
- if(!attributeMode)
- return m_spacing->cache(exec);
- else
- return Number(m_spacing->baseVal());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGTextPathElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case StartOffset:
- {
- TQString param = value.toString(exec).qstring();
-
- if(param.endsWith("%"))
- {
- TQString value = param.left(param.length() - 1);
- bool ok = false;
- double dValue = value.toDouble(&ok);
- if(ok)
- startOffset()->baseVal()->setValue(dValue / 100.0);
- else
- kdDebug() << "Couldn't parse startOffset: " << value << endl;
- }
- else
- startOffset()->baseVal()->setValueAsString(value.toString(exec).qstring());
-
- if(startOffset()->baseVal()->value() < 0) // A negative value is an error
- gotError(i18n("Negative value for attribute startOffset of element <textPath> is illegal"));
- break;
- }
- case Method:
- {
- TQString param = value.toString(exec).qstring();
-
- if(param == "align")
- method()->setBaseVal(TEXTPATH_METHODTYPE_ALIGN);
- else if(param == "stretch")
- method()->setBaseVal(TEXTPATH_METHODTYPE_STRETCH);
- else
- method()->setBaseVal(TEXTPATH_METHODTYPE_UNKNOWN);
-
- break;
- }
- case Spacing:
- {
- TQString param = value.toString(exec).qstring();
-
- if(param == "auto")
- spacing()->setBaseVal(TEXTPATH_SPACINGTYPE_AUTO);
- else if(param == "exact")
- spacing()->setBaseVal(TEXTPATH_SPACINGTYPE_EXACT);
- else
- spacing()->setBaseVal(TEXTPATH_SPACINGTYPE_UNKNOWN);
-
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// CONSTANTS
-
-/*
-@namespace KSVG
-@begin SVGTextPathElementImplConstructor::s_hashTable 7
- TEXTPATH_METHODTYPE_UNKNOWN KSVG::TEXTPATH_METHODTYPE_UNKNOWN DontDelete|ReadOnly
- TEXTPATH_METHODTYPE_ALIGN KSVG::TEXTPATH_METHODTYPE_ALIGN DontDelete|ReadOnly
- TEXTPATH_METHODTYPE_STRETCH KSVG::TEXTPATH_METHODTYPE_STRETCH DontDelete|ReadOnly
- TEXTPATH_SPACINGTYPE_UNKNOWN KSVG::TEXTPATH_SPACINGTYPE_UNKNOWN DontDelete|ReadOnly
- TEXTPATH_SPACINGTYPE_AUTO KSVG::TEXTPATH_SPACINGTYPE_AUTO DontDelete|ReadOnly
- TEXTPATH_SPACINGTYPE_EXACT KSVG::TEXTPATH_SPACINGTYPE_EXACT DontDelete|ReadOnly
-@end
-*/
-
-using namespace KJS;
-
-Value SVGTextPathElementImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGTextPathElementImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGTextPathElementImplConstructor>(exec, "[[svgtextpathelement.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextPathElementImpl.cpp b/ksvg/impl/SVGTextPathElementImpl.cpp
new file mode 100644
index 00000000..4a116715
--- /dev/null
+++ b/ksvg/impl/SVGTextPathElementImpl.cpp
@@ -0,0 +1,238 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include <tdelocale.h>
+
+#include "Glyph.h"
+
+#include "SVGDocumentImpl.h"
+#include "SVGTextPathElement.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGTextPathElementImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTextPathElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_ecma.h"
+#include "ksvg_cacheimpl.h"
+
+SVGTextPathElementImpl::SVGTextPathElementImpl(DOM::ElementImpl *impl) : SVGTextContentElementImpl(impl), SVGURIReferenceImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_startOffset = new SVGAnimatedLengthImpl();
+ m_startOffset->ref();
+
+ m_method = new SVGAnimatedEnumerationImpl();
+ m_method->ref();
+
+ m_spacing = new SVGAnimatedEnumerationImpl();
+ m_spacing->ref();
+}
+
+SVGTextPathElementImpl::~SVGTextPathElementImpl()
+{
+ if(m_startOffset)
+ m_startOffset->deref();
+ if(m_method)
+ m_method->deref();
+ if(m_spacing)
+ m_spacing->deref();
+}
+
+SVGAnimatedLengthImpl *SVGTextPathElementImpl::startOffset() const
+{
+ return m_startOffset;
+}
+
+SVGAnimatedEnumerationImpl *SVGTextPathElementImpl::method() const
+{
+ return m_method;
+}
+
+SVGAnimatedEnumerationImpl *SVGTextPathElementImpl::spacing() const
+{
+ return m_spacing;
+}
+
+TQString SVGTextPathElementImpl::text()
+{
+ // Otherwhise some js scripts which require a child, don't work (Niko)
+ if(!hasChildNodes())
+ {
+ DOM::Text impl = static_cast<DOM::Document *>(ownerDoc())->createTextNode(DOM::DOMString(""));
+ appendChild(impl);
+ }
+
+ return textDirectionAwareText();
+}
+
+void SVGTextPathElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ // Spec: if not specified, effect is as if a value of "0" were specified
+ if(KSVG_TOKEN_NOT_PARSED(StartOffset))
+ KSVG_SET_ALT_ATTRIBUTE(StartOffset, "0")
+
+ // Spec: if not specified, effect is as if a value of "align" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Method))
+ KSVG_SET_ALT_ATTRIBUTE(Method, "align")
+
+ // Spec: if not specified, effect is as if a value of "exact" were specified
+ if(KSVG_TOKEN_NOT_PARSED(Spacing))
+ KSVG_SET_ALT_ATTRIBUTE(Spacing, "exact")
+}
+
+T2P::GlyphLayoutParams *SVGTextPathElementImpl::layoutParams() const
+{
+ T2P::GlyphLayoutParams *params = SVGTextContentElementImpl::layoutParams();
+ params->setTextPathStartOffset(startOffset()->baseVal()->value());
+ return params;
+}
+
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGTextPathElementImpl::s_hashTable 5
+ startOffset SVGTextPathElementImpl::StartOffset DontDelete|ReadOnly
+ method SVGTextPathElementImpl::Method DontDelete|ReadOnly
+ spacing SVGTextPathElementImpl::Spacing DontDelete|ReadOnly
+@end
+*/
+
+Value SVGTextPathElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case StartOffset:
+ if(!attributeMode)
+ return m_startOffset->cache(exec);
+ else
+ return Number(m_startOffset->baseVal()->value());
+ case Method:
+ if(!attributeMode)
+ return m_method->cache(exec);
+ else
+ return Number(m_method->baseVal());
+ case Spacing:
+ if(!attributeMode)
+ return m_spacing->cache(exec);
+ else
+ return Number(m_spacing->baseVal());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGTextPathElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case StartOffset:
+ {
+ TQString param = value.toString(exec).qstring();
+
+ if(param.endsWith("%"))
+ {
+ TQString value = param.left(param.length() - 1);
+ bool ok = false;
+ double dValue = value.toDouble(&ok);
+ if(ok)
+ startOffset()->baseVal()->setValue(dValue / 100.0);
+ else
+ kdDebug() << "Couldn't parse startOffset: " << value << endl;
+ }
+ else
+ startOffset()->baseVal()->setValueAsString(value.toString(exec).qstring());
+
+ if(startOffset()->baseVal()->value() < 0) // A negative value is an error
+ gotError(i18n("Negative value for attribute startOffset of element <textPath> is illegal"));
+ break;
+ }
+ case Method:
+ {
+ TQString param = value.toString(exec).qstring();
+
+ if(param == "align")
+ method()->setBaseVal(TEXTPATH_METHODTYPE_ALIGN);
+ else if(param == "stretch")
+ method()->setBaseVal(TEXTPATH_METHODTYPE_STRETCH);
+ else
+ method()->setBaseVal(TEXTPATH_METHODTYPE_UNKNOWN);
+
+ break;
+ }
+ case Spacing:
+ {
+ TQString param = value.toString(exec).qstring();
+
+ if(param == "auto")
+ spacing()->setBaseVal(TEXTPATH_SPACINGTYPE_AUTO);
+ else if(param == "exact")
+ spacing()->setBaseVal(TEXTPATH_SPACINGTYPE_EXACT);
+ else
+ spacing()->setBaseVal(TEXTPATH_SPACINGTYPE_UNKNOWN);
+
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+// CONSTANTS
+
+/*
+@namespace KSVG
+@begin SVGTextPathElementImplConstructor::s_hashTable 7
+ TEXTPATH_METHODTYPE_UNKNOWN KSVG::TEXTPATH_METHODTYPE_UNKNOWN DontDelete|ReadOnly
+ TEXTPATH_METHODTYPE_ALIGN KSVG::TEXTPATH_METHODTYPE_ALIGN DontDelete|ReadOnly
+ TEXTPATH_METHODTYPE_STRETCH KSVG::TEXTPATH_METHODTYPE_STRETCH DontDelete|ReadOnly
+ TEXTPATH_SPACINGTYPE_UNKNOWN KSVG::TEXTPATH_SPACINGTYPE_UNKNOWN DontDelete|ReadOnly
+ TEXTPATH_SPACINGTYPE_AUTO KSVG::TEXTPATH_SPACINGTYPE_AUTO DontDelete|ReadOnly
+ TEXTPATH_SPACINGTYPE_EXACT KSVG::TEXTPATH_SPACINGTYPE_EXACT DontDelete|ReadOnly
+@end
+*/
+
+using namespace KJS;
+
+Value SVGTextPathElementImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGTextPathElementImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGTextPathElementImplConstructor>(exec, "[[svgtextpathelement.constructor]]");
+}
diff --git a/ksvg/impl/SVGTextPathElementImpl.h b/ksvg/impl/SVGTextPathElementImpl.h
index 98a88d33..7a4f83bf 100644
--- a/ksvg/impl/SVGTextPathElementImpl.h
+++ b/ksvg/impl/SVGTextPathElementImpl.h
@@ -80,5 +80,3 @@ KSVG_REGISTER_ELEMENT(SVGTextPathElementImpl, "textPath")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextPositioningElementImpl.cc b/ksvg/impl/SVGTextPositioningElementImpl.cc
deleted file mode 100644
index 924fd091..00000000
--- a/ksvg/impl/SVGTextPositioningElementImpl.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGHelperImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGAnimatedLengthListImpl.h"
-#include "SVGAnimatedNumberListImpl.h"
-#include "SVGTextPositioningElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTextPositioningElementImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGTextPositioningElementImpl::SVGTextPositioningElementImpl(DOM::ElementImpl *impl) : SVGTextContentElementImpl(impl)
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthListImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedLengthListImpl();
- m_y->ref();
-
- m_dx = new SVGAnimatedLengthListImpl();
- m_dx->ref();
-
- m_dy = new SVGAnimatedLengthListImpl();
- m_dy->ref();
-
- m_rotate = new SVGAnimatedNumberListImpl();
- m_rotate->ref();
-}
-
-SVGTextPositioningElementImpl::~SVGTextPositioningElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_dx)
- m_dx->deref();
- if(m_dy)
- m_dy->deref();
- if(m_rotate)
- m_rotate->deref();
-}
-
-SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::x()
-{
- return m_x;
-}
-
-SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::y()
-{
- return m_y;
-}
-
-SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::dx()
-{
- return m_dx;
-}
-
-SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::dy()
-{
- return m_dy;
-}
-
-SVGAnimatedNumberListImpl *SVGTextPositioningElementImpl::rotate()
-{
- return m_rotate;
-}
-
-/*
-@namespace KSVG
-@begin SVGTextPositioningElementImpl::s_hashTable 7
- x SVGTextPositioningElementImpl::X DontDelete|ReadOnly
- y SVGTextPositioningElementImpl::Y DontDelete|ReadOnly
- dx SVGTextPositioningElementImpl::Dx DontDelete|ReadOnly
- dy SVGTextPositioningElementImpl::Dy DontDelete|ReadOnly
- rotate SVGTextPositioningElementImpl::Rotate DontDelete|ReadOnly
-@end
-*/
-
-Value SVGTextPositioningElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X:
- if(!attributeMode)
- return m_x->cache(exec);
- else
- return Number(m_x->baseVal()->getItem(0)->value());
- case Y:
- if(!attributeMode)
- return m_y->cache(exec);
- else
- return Number(m_y->baseVal()->getItem(0)->value());
- case Dx:
- if(!attributeMode)
- return m_dx->cache(exec);
- else
- return Number(m_dx->baseVal()->getItem(0)->value());
- case Dy:
- if(!attributeMode)
- return m_dy->cache(exec);
- else
- return Number(m_dy->baseVal()->getItem(0)->value());
- case Rotate:
- if(!attributeMode)
- return m_rotate->cache(exec);
- else
- return Number(m_rotate->baseVal()->getItem(0)->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGTextPositioningElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X:
- x()->baseVal()->clear();
- SVGHelperImpl::parseLengthList(x(), value.toString(exec).qstring(), LENGTHMODE_WIDTH, this);
- break;
- case Y:
- y()->baseVal()->clear();
- SVGHelperImpl::parseLengthList(y(), value.toString(exec).qstring(), LENGTHMODE_HEIGHT, this);
- break;
- case Dx:
- dx()->baseVal()->clear();
- SVGHelperImpl::parseLengthList(dx(), value.toString(exec).qstring(), LENGTHMODE_WIDTH, this);
- break;
- case Dy:
- dy()->baseVal()->clear();
- SVGHelperImpl::parseLengthList(dy(), value.toString(exec).qstring(), LENGTHMODE_HEIGHT, this);
- break;
- case Rotate:
- {
- rotate()->baseVal()->clear();
-
- SVGNumberImpl *number = SVGSVGElementImpl::createSVGNumber();
- number->setValue(value.toNumber(exec));
- rotate()->baseVal()->appendItem(number);
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-void SVGTextPositioningElementImpl::setAttributes()
-{
- SVGElementImpl::setAttributes();
-
- if(tagName() != "text")
- return;
-
- // Spec: If the attribute is not specified, the effect is as if a value of "0" were specified.
- if(KSVG_TOKEN_NOT_PARSED(X))
- KSVG_SET_ALT_ATTRIBUTE(X, "0")
-
- // Spec: If the attribute is not specified, the effect is as if a value of "0" were specified.
- if(KSVG_TOKEN_NOT_PARSED(Y))
- KSVG_SET_ALT_ATTRIBUTE(Y, "0")
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTextPositioningElementImpl.cpp b/ksvg/impl/SVGTextPositioningElementImpl.cpp
new file mode 100644
index 00000000..e6b02745
--- /dev/null
+++ b/ksvg/impl/SVGTextPositioningElementImpl.cpp
@@ -0,0 +1,196 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGHelperImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGAnimatedLengthListImpl.h"
+#include "SVGAnimatedNumberListImpl.h"
+#include "SVGTextPositioningElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTextPositioningElementImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGTextPositioningElementImpl::SVGTextPositioningElementImpl(DOM::ElementImpl *impl) : SVGTextContentElementImpl(impl)
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthListImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthListImpl();
+ m_y->ref();
+
+ m_dx = new SVGAnimatedLengthListImpl();
+ m_dx->ref();
+
+ m_dy = new SVGAnimatedLengthListImpl();
+ m_dy->ref();
+
+ m_rotate = new SVGAnimatedNumberListImpl();
+ m_rotate->ref();
+}
+
+SVGTextPositioningElementImpl::~SVGTextPositioningElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_dx)
+ m_dx->deref();
+ if(m_dy)
+ m_dy->deref();
+ if(m_rotate)
+ m_rotate->deref();
+}
+
+SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::x()
+{
+ return m_x;
+}
+
+SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::y()
+{
+ return m_y;
+}
+
+SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::dx()
+{
+ return m_dx;
+}
+
+SVGAnimatedLengthListImpl *SVGTextPositioningElementImpl::dy()
+{
+ return m_dy;
+}
+
+SVGAnimatedNumberListImpl *SVGTextPositioningElementImpl::rotate()
+{
+ return m_rotate;
+}
+
+/*
+@namespace KSVG
+@begin SVGTextPositioningElementImpl::s_hashTable 7
+ x SVGTextPositioningElementImpl::X DontDelete|ReadOnly
+ y SVGTextPositioningElementImpl::Y DontDelete|ReadOnly
+ dx SVGTextPositioningElementImpl::Dx DontDelete|ReadOnly
+ dy SVGTextPositioningElementImpl::Dy DontDelete|ReadOnly
+ rotate SVGTextPositioningElementImpl::Rotate DontDelete|ReadOnly
+@end
+*/
+
+Value SVGTextPositioningElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X:
+ if(!attributeMode)
+ return m_x->cache(exec);
+ else
+ return Number(m_x->baseVal()->getItem(0)->value());
+ case Y:
+ if(!attributeMode)
+ return m_y->cache(exec);
+ else
+ return Number(m_y->baseVal()->getItem(0)->value());
+ case Dx:
+ if(!attributeMode)
+ return m_dx->cache(exec);
+ else
+ return Number(m_dx->baseVal()->getItem(0)->value());
+ case Dy:
+ if(!attributeMode)
+ return m_dy->cache(exec);
+ else
+ return Number(m_dy->baseVal()->getItem(0)->value());
+ case Rotate:
+ if(!attributeMode)
+ return m_rotate->cache(exec);
+ else
+ return Number(m_rotate->baseVal()->getItem(0)->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGTextPositioningElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X:
+ x()->baseVal()->clear();
+ SVGHelperImpl::parseLengthList(x(), value.toString(exec).qstring(), LENGTHMODE_WIDTH, this);
+ break;
+ case Y:
+ y()->baseVal()->clear();
+ SVGHelperImpl::parseLengthList(y(), value.toString(exec).qstring(), LENGTHMODE_HEIGHT, this);
+ break;
+ case Dx:
+ dx()->baseVal()->clear();
+ SVGHelperImpl::parseLengthList(dx(), value.toString(exec).qstring(), LENGTHMODE_WIDTH, this);
+ break;
+ case Dy:
+ dy()->baseVal()->clear();
+ SVGHelperImpl::parseLengthList(dy(), value.toString(exec).qstring(), LENGTHMODE_HEIGHT, this);
+ break;
+ case Rotate:
+ {
+ rotate()->baseVal()->clear();
+
+ SVGNumberImpl *number = SVGSVGElementImpl::createSVGNumber();
+ number->setValue(value.toNumber(exec));
+ rotate()->baseVal()->appendItem(number);
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+void SVGTextPositioningElementImpl::setAttributes()
+{
+ SVGElementImpl::setAttributes();
+
+ if(tagName() != "text")
+ return;
+
+ // Spec: If the attribute is not specified, the effect is as if a value of "0" were specified.
+ if(KSVG_TOKEN_NOT_PARSED(X))
+ KSVG_SET_ALT_ATTRIBUTE(X, "0")
+
+ // Spec: If the attribute is not specified, the effect is as if a value of "0" were specified.
+ if(KSVG_TOKEN_NOT_PARSED(Y))
+ KSVG_SET_ALT_ATTRIBUTE(Y, "0")
+}
diff --git a/ksvg/impl/SVGTextPositioningElementImpl.h b/ksvg/impl/SVGTextPositioningElementImpl.h
index c80b48ff..9b75cee9 100644
--- a/ksvg/impl/SVGTextPositioningElementImpl.h
+++ b/ksvg/impl/SVGTextPositioningElementImpl.h
@@ -79,5 +79,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTimeScheduler.cc b/ksvg/impl/SVGTimeScheduler.cc
deleted file mode 100644
index caddf81f..00000000
--- a/ksvg/impl/SVGTimeScheduler.cc
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- Copyright (C) 2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "KSVGCanvas.h"
-#include "CanvasItem.h"
-#include "SVGShapeImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGTimeScheduler.moc"
-
-using namespace KSVG;
-
-SVGTimer::SVGTimer(TQObject *scheduler, unsigned int ms, bool singleShot)
-{
- m_ms = ms;
- m_singleShot = singleShot;
- m_timer = new TQTimer(scheduler);
-}
-
-SVGTimer::~SVGTimer()
-{
- delete m_timer;
-}
-
-bool SVGTimer::operator==(const TQTimer *timer)
-{
- return (m_timer == timer);
-}
-
-const TQTimer *SVGTimer::qtimer() const
-{
- return m_timer;
-}
-
-void SVGTimer::start(TQObject *receiver, const char *member)
-{
- TQObject::connect(m_timer, TQT_SIGNAL(timeout()), receiver, member);
- m_timer->start(m_ms, m_singleShot);
-}
-
-void SVGTimer::stop()
-{
- m_timer->stop();
-}
-
-bool SVGTimer::isActive() const
-{
- return m_timer->isActive();
-}
-
-unsigned int SVGTimer::ms() const
-{
- return m_ms;
-}
-
-bool SVGTimer::singleShot() const
-{
- return m_singleShot;
-}
-
-void SVGTimer::notifyAll()
-{
- if(m_notifyList.isEmpty())
- return;
-
- TQValueList<SVGElementImpl *> elements;
- for(unsigned int i = m_notifyList.count();i > 0; i--)
- {
- SVGElementImpl *element = m_notifyList[i - 1];
- if(!element)
- continue;
-
- SVGAnimationElementImpl *animation = dynamic_cast<SVGAnimationElementImpl *>(element);
- if(animation)
- {
- animation->handleTimerEvent();
-
- SVGElementImpl *target = animation->targetElement();
- if(!elements.contains(target))
- elements.append(target);
- }
- }
-
- // Optimized update logic (to avoid 4 updates, on the same element)
- TQValueList<SVGElementImpl *>::iterator it2;
- for(it2 = elements.begin(); it2 != elements.end(); ++it2)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(*it2);
- if(shape && shape->item())
- shape->item()->update(UPDATE_TRANSFORM);
- }
-}
-
-void SVGTimer::addNotify(SVGElementImpl *element)
-{
- m_notifyList.append(element);
-}
-
-void SVGTimer::removeNotify(SVGElementImpl *element)
-{
- m_notifyList.remove(element);
-
- if(m_notifyList.isEmpty())
- stop();
-}
-
-const unsigned int SVGTimeScheduler::staticTimerInterval = 15; // milliseconds
-
-SVGTimeScheduler::SVGTimeScheduler(SVGDocumentImpl *doc) : TQObject(), m_doc(doc)
-{
- // Create static interval timers but don't start it yet!
- m_intervalTimer = new SVGTimer(this, staticTimerInterval, false);
- m_creationTime.start();
-}
-
-SVGTimeScheduler::~SVGTimeScheduler()
-{
- // Usually singleShot timers cleanup themselves, after usage
- SVGTimerList::iterator it;
- for(it = m_timerList.begin(); it != m_timerList.end(); ++it)
- {
- SVGTimer *svgTimer = *it;
- delete svgTimer;
- }
- delete m_intervalTimer;
-}
-
-void SVGTimeScheduler::addTimer(SVGElementImpl *element, unsigned int ms)
-{
- SVGTimer *svgTimer = new SVGTimer(this, ms, true);
- svgTimer->addNotify(element);
- m_timerList.append(svgTimer);
-}
-
-void SVGTimeScheduler::connectIntervalTimer(SVGElementImpl *element)
-{
- m_intervalTimer->addNotify(element);
-}
-
-void SVGTimeScheduler::disconnectIntervalTimer(SVGElementImpl *element)
-{
- m_intervalTimer->removeNotify(element);
-}
-
-void SVGTimeScheduler::startAnimations()
-{
- SVGTimerList::iterator it;
- for(it = m_timerList.begin(); it != m_timerList.end(); ++it)
- {
- SVGTimer *svgTimer = *it;
- if(svgTimer && !svgTimer->isActive())
- svgTimer->start(this, TQT_SLOT(slotTimerNotify()));
- }
-}
-
-void SVGTimeScheduler::toggleAnimations()
-{
- if(m_intervalTimer->isActive())
- m_intervalTimer->stop();
- else
- m_intervalTimer->start(this, TQT_SLOT(slotTimerNotify()));
-}
-
-bool SVGTimeScheduler::animationsPaused() const
-{
- return !m_intervalTimer->isActive();
-}
-
-void SVGTimeScheduler::slotTimerNotify()
-{
- TQTimer *senderTimer = const_cast<TQTimer *>(static_cast<const TQTimer *>(sender()));
-
- SVGTimer *svgTimer = 0;
- SVGTimerList::iterator it;
- for(it = m_timerList.begin(); it != m_timerList.end(); ++it)
- {
- SVGTimer *cur = *it;
- if(*cur == senderTimer)
- {
- svgTimer = cur;
- break;
- }
- }
-
- if(!svgTimer)
- {
- svgTimer = (*m_intervalTimer == senderTimer) ? m_intervalTimer : 0;
-
- if(!svgTimer)
- return;
- }
-
- svgTimer->notifyAll();
-
- // Animations need direct updates
- if(m_doc->canvas())
- m_doc->canvas()->update();
- emit m_doc->finishedRendering();
-
- if(svgTimer->singleShot())
- {
- m_timerList.remove(svgTimer);
- delete svgTimer;
- }
-
- // The singleShot timers of ie. <animate> with begin="3s" are notified
- // by the previous call, and now all connections to the interval timer
- // are created and now we just need to fire that timer (Niko)
- if(svgTimer != m_intervalTimer && !m_intervalTimer->isActive())
- m_intervalTimer->start(this, TQT_SLOT(slotTimerNotify()));
-}
-
-float SVGTimeScheduler::elapsed() const
-{
- return float(m_creationTime.elapsed()) / 1000.0;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTimeScheduler.cpp b/ksvg/impl/SVGTimeScheduler.cpp
new file mode 100644
index 00000000..b38eceaa
--- /dev/null
+++ b/ksvg/impl/SVGTimeScheduler.cpp
@@ -0,0 +1,232 @@
+/*
+ Copyright (C) 2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "KSVGCanvas.h"
+#include "CanvasItem.h"
+#include "SVGShapeImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGTimeScheduler.moc"
+
+using namespace KSVG;
+
+SVGTimer::SVGTimer(TQObject *scheduler, unsigned int ms, bool singleShot)
+{
+ m_ms = ms;
+ m_singleShot = singleShot;
+ m_timer = new TQTimer(scheduler);
+}
+
+SVGTimer::~SVGTimer()
+{
+ delete m_timer;
+}
+
+bool SVGTimer::operator==(const TQTimer *timer)
+{
+ return (m_timer == timer);
+}
+
+const TQTimer *SVGTimer::qtimer() const
+{
+ return m_timer;
+}
+
+void SVGTimer::start(TQObject *receiver, const char *member)
+{
+ TQObject::connect(m_timer, TQT_SIGNAL(timeout()), receiver, member);
+ m_timer->start(m_ms, m_singleShot);
+}
+
+void SVGTimer::stop()
+{
+ m_timer->stop();
+}
+
+bool SVGTimer::isActive() const
+{
+ return m_timer->isActive();
+}
+
+unsigned int SVGTimer::ms() const
+{
+ return m_ms;
+}
+
+bool SVGTimer::singleShot() const
+{
+ return m_singleShot;
+}
+
+void SVGTimer::notifyAll()
+{
+ if(m_notifyList.isEmpty())
+ return;
+
+ TQValueList<SVGElementImpl *> elements;
+ for(unsigned int i = m_notifyList.count();i > 0; i--)
+ {
+ SVGElementImpl *element = m_notifyList[i - 1];
+ if(!element)
+ continue;
+
+ SVGAnimationElementImpl *animation = dynamic_cast<SVGAnimationElementImpl *>(element);
+ if(animation)
+ {
+ animation->handleTimerEvent();
+
+ SVGElementImpl *target = animation->targetElement();
+ if(!elements.contains(target))
+ elements.append(target);
+ }
+ }
+
+ // Optimized update logic (to avoid 4 updates, on the same element)
+ TQValueList<SVGElementImpl *>::iterator it2;
+ for(it2 = elements.begin(); it2 != elements.end(); ++it2)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(*it2);
+ if(shape && shape->item())
+ shape->item()->update(UPDATE_TRANSFORM);
+ }
+}
+
+void SVGTimer::addNotify(SVGElementImpl *element)
+{
+ m_notifyList.append(element);
+}
+
+void SVGTimer::removeNotify(SVGElementImpl *element)
+{
+ m_notifyList.remove(element);
+
+ if(m_notifyList.isEmpty())
+ stop();
+}
+
+const unsigned int SVGTimeScheduler::staticTimerInterval = 15; // milliseconds
+
+SVGTimeScheduler::SVGTimeScheduler(SVGDocumentImpl *doc) : TQObject(), m_doc(doc)
+{
+ // Create static interval timers but don't start it yet!
+ m_intervalTimer = new SVGTimer(this, staticTimerInterval, false);
+ m_creationTime.start();
+}
+
+SVGTimeScheduler::~SVGTimeScheduler()
+{
+ // Usually singleShot timers cleanup themselves, after usage
+ SVGTimerList::iterator it;
+ for(it = m_timerList.begin(); it != m_timerList.end(); ++it)
+ {
+ SVGTimer *svgTimer = *it;
+ delete svgTimer;
+ }
+ delete m_intervalTimer;
+}
+
+void SVGTimeScheduler::addTimer(SVGElementImpl *element, unsigned int ms)
+{
+ SVGTimer *svgTimer = new SVGTimer(this, ms, true);
+ svgTimer->addNotify(element);
+ m_timerList.append(svgTimer);
+}
+
+void SVGTimeScheduler::connectIntervalTimer(SVGElementImpl *element)
+{
+ m_intervalTimer->addNotify(element);
+}
+
+void SVGTimeScheduler::disconnectIntervalTimer(SVGElementImpl *element)
+{
+ m_intervalTimer->removeNotify(element);
+}
+
+void SVGTimeScheduler::startAnimations()
+{
+ SVGTimerList::iterator it;
+ for(it = m_timerList.begin(); it != m_timerList.end(); ++it)
+ {
+ SVGTimer *svgTimer = *it;
+ if(svgTimer && !svgTimer->isActive())
+ svgTimer->start(this, TQT_SLOT(slotTimerNotify()));
+ }
+}
+
+void SVGTimeScheduler::toggleAnimations()
+{
+ if(m_intervalTimer->isActive())
+ m_intervalTimer->stop();
+ else
+ m_intervalTimer->start(this, TQT_SLOT(slotTimerNotify()));
+}
+
+bool SVGTimeScheduler::animationsPaused() const
+{
+ return !m_intervalTimer->isActive();
+}
+
+void SVGTimeScheduler::slotTimerNotify()
+{
+ TQTimer *senderTimer = const_cast<TQTimer *>(static_cast<const TQTimer *>(sender()));
+
+ SVGTimer *svgTimer = 0;
+ SVGTimerList::iterator it;
+ for(it = m_timerList.begin(); it != m_timerList.end(); ++it)
+ {
+ SVGTimer *cur = *it;
+ if(*cur == senderTimer)
+ {
+ svgTimer = cur;
+ break;
+ }
+ }
+
+ if(!svgTimer)
+ {
+ svgTimer = (*m_intervalTimer == senderTimer) ? m_intervalTimer : 0;
+
+ if(!svgTimer)
+ return;
+ }
+
+ svgTimer->notifyAll();
+
+ // Animations need direct updates
+ if(m_doc->canvas())
+ m_doc->canvas()->update();
+ emit m_doc->finishedRendering();
+
+ if(svgTimer->singleShot())
+ {
+ m_timerList.remove(svgTimer);
+ delete svgTimer;
+ }
+
+ // The singleShot timers of ie. <animate> with begin="3s" are notified
+ // by the previous call, and now all connections to the interval timer
+ // are created and now we just need to fire that timer (Niko)
+ if(svgTimer != m_intervalTimer && !m_intervalTimer->isActive())
+ m_intervalTimer->start(this, TQT_SLOT(slotTimerNotify()));
+}
+
+float SVGTimeScheduler::elapsed() const
+{
+ return float(m_creationTime.elapsed()) / 1000.0;
+}
diff --git a/ksvg/impl/SVGTimeScheduler.h b/ksvg/impl/SVGTimeScheduler.h
index b1e938a7..cc897a57 100644
--- a/ksvg/impl/SVGTimeScheduler.h
+++ b/ksvg/impl/SVGTimeScheduler.h
@@ -101,5 +101,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTitleElementImpl.cc b/ksvg/impl/SVGTitleElementImpl.cc
deleted file mode 100644
index 5bfe2936..00000000
--- a/ksvg/impl/SVGTitleElementImpl.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGDocumentImpl.h"
-#include "SVGTitleElementImpl.h"
-
-using namespace KSVG;
-
-SVGTitleElementImpl::SVGTitleElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGLangSpaceImpl(), SVGStylableImpl(this)
-{
-}
-
-SVGTitleElementImpl::~SVGTitleElementImpl()
-{
-}
-
-void SVGTitleElementImpl::createItem(KSVGCanvas *)
-{
- emit ownerDoc()->gotTitle(collectText());
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTitleElementImpl.cpp b/ksvg/impl/SVGTitleElementImpl.cpp
new file mode 100644
index 00000000..838f27fe
--- /dev/null
+++ b/ksvg/impl/SVGTitleElementImpl.cpp
@@ -0,0 +1,37 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGDocumentImpl.h"
+#include "SVGTitleElementImpl.h"
+
+using namespace KSVG;
+
+SVGTitleElementImpl::SVGTitleElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGLangSpaceImpl(), SVGStylableImpl(this)
+{
+}
+
+SVGTitleElementImpl::~SVGTitleElementImpl()
+{
+}
+
+void SVGTitleElementImpl::createItem(KSVGCanvas *)
+{
+ emit ownerDoc()->gotTitle(collectText());
+}
diff --git a/ksvg/impl/SVGTitleElementImpl.h b/ksvg/impl/SVGTitleElementImpl.h
index 7c948842..04ca9d81 100644
--- a/ksvg/impl/SVGTitleElementImpl.h
+++ b/ksvg/impl/SVGTitleElementImpl.h
@@ -51,5 +51,3 @@ KSVG_REGISTER_ELEMENT(SVGTitleElementImpl, "title")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTransformImpl.cc b/ksvg/impl/SVGTransformImpl.cc
deleted file mode 100644
index 5b2d754a..00000000
--- a/ksvg/impl/SVGTransformImpl.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGTransform.h"
-
-#include "SVGMatrixImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTransformImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-SVGTransformImpl::SVGTransformImpl()
-{
- m_matrix = SVGSVGElementImpl::createSVGMatrix();
-
- m_type = SVG_TRANSFORM_UNKNOWN;
- m_angle = 0;
-}
-
-SVGTransformImpl::~SVGTransformImpl()
-{
- if(m_matrix)
- m_matrix->deref();
-}
-
-unsigned short SVGTransformImpl::type() const
-{
- return m_type;
-}
-
-SVGMatrixImpl *SVGTransformImpl::matrix() const
-{
- return m_matrix;
-}
-
-double SVGTransformImpl::angle() const
-{
- return m_angle;
-}
-
-void SVGTransformImpl::setMatrix(SVGMatrixImpl *matrix)
-{
- if(!matrix)
- return;
-
- m_type = SVG_TRANSFORM_MATRIX;
- m_angle = 0;
-
- m_matrix->deref();
- m_matrix = matrix;
- m_matrix->ref();
-}
-
-void SVGTransformImpl::setTranslate(double tx, double ty)
-{
- m_type = SVG_TRANSFORM_TRANSLATE;
- m_angle = 0;
- m_matrix->reset();
- m_matrix->translate(tx, ty);
-}
-
-void SVGTransformImpl::setScale(double sx, double sy)
-{
- m_type = SVG_TRANSFORM_SCALE;
- m_angle = 0;
- m_matrix->reset();
- m_matrix->scaleNonUniform(sx, sy);
-}
-
-void SVGTransformImpl::setRotate(double angle, double cx, double cy)
-{
- m_type = SVG_TRANSFORM_ROTATE;
- // mop: evil...fix that...needed to make toString() work correctly
- m_cx = cx;
- m_cy = cy;
- m_angle = angle;
- m_matrix->reset();
- m_matrix->translate(cx, cy);
- m_matrix->rotate(angle);
- m_matrix->translate(-cx, -cy);
-}
-
-void SVGTransformImpl::setSkewX(double angle)
-{
- m_type = SVG_TRANSFORM_SKEWX;
- m_angle = angle;
- m_matrix->reset();
- m_matrix->skewX(angle);
-}
-
-void SVGTransformImpl::setSkewY(double angle)
-{
- m_type = SVG_TRANSFORM_SKEWY;
- m_angle = angle;
- m_matrix->reset();
- m_matrix->skewY(angle);
-}
-
-TQString SVGTransformImpl::toString() const
-{
- switch (m_type)
- {
- case SVG_TRANSFORM_UNKNOWN:
- return TQString();
- case SVG_TRANSFORM_MATRIX:
- return TQString("matrix(" + TQString::number(m_matrix->a()) + " " + TQString::number(m_matrix->b()) + " " + TQString::number(m_matrix->c()) + " " + TQString::number(m_matrix->d()) + " " + TQString::number(m_matrix->e()) + " " + TQString::number(m_matrix->f()) + ")");
- case SVG_TRANSFORM_TRANSLATE:
- return TQString("translate(" + TQString::number(m_matrix->e()) + " " + TQString::number(m_matrix->f()) + ")");
- case SVG_TRANSFORM_SCALE:
- return TQString("scale(" + TQString::number(m_matrix->a()) + " " + TQString::number(m_matrix->d()) + ")");
- case SVG_TRANSFORM_ROTATE:
- return TQString("rotate(" + TQString::number(m_angle) + " " + TQString::number(m_cx) + " " + TQString::number(m_cy) + ")");
- case SVG_TRANSFORM_SKEWX:
- return TQString("skewX(" + TQString::number(m_angle) + ")");
- case SVG_TRANSFORM_SKEWY:
- return TQString("skewY(" + TQString::number(m_angle) + ")");
- default:
- kdWarning() << "Unknown transform type " << m_type << endl;
- return TQString();
- }
-}
-
-// ECMA binding
-
-/*
-@namespace KSVG
-@begin SVGTransformImpl::s_hashTable 5
- type SVGTransformImpl::Type DontDelete|ReadOnly
- matrix SVGTransformImpl::Matrix DontDelete|ReadOnly
- angle SVGTransformImpl::Angle DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGTransformImplProto::s_hashTable 7
- setMatrix SVGTransformImpl::SetMatrix DontDelete|Function 1
- setTranslate SVGTransformImpl::SetTranslate DontDelete|Function 2
- setScale SVGTransformImpl::SetScale DontDelete|Function 2
- setRotate SVGTransformImpl::SetRotate DontDelete|Function 3
- setSkewX SVGTransformImpl::SetSkewX DontDelete|Function 1
- setSkewY SVGTransformImpl::SetSkewY DontDelete|Function 1
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGTransform", SVGTransformImplProto, SVGTransformImplProtoFunc)
-
-Value SVGTransformImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Type:
- return Number(m_type);
- case Matrix:
- return m_matrix->cache(exec);
- case Angle:
- return Number(m_angle);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-Value SVGTransformImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGTransformImpl)
-
- switch(id)
- {
- case SVGTransformImpl::SetMatrix:
- obj->setMatrix(static_cast<KSVGBridge<SVGMatrixImpl> *>(args[0].imp())->impl());
- break;
- case SVGTransformImpl::SetTranslate:
- obj->setTranslate(args[0].toNumber(exec), args[1].toNumber(exec));
- break;
- case SVGTransformImpl::SetScale:
- obj->setScale(args[0].toNumber(exec), args[1].toNumber(exec));
- break;
- case SVGTransformImpl::SetRotate:
- obj->setRotate(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec));
- break;
- case SVGTransformImpl::SetSkewX:
- obj->setSkewX(args[0].toNumber(exec));
- break;
- case SVGTransformImpl::SetSkewY:
- obj->setSkewY(args[0].toNumber(exec));
- break;
- default:
- kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
- break;
- }
-
- return Undefined();
-}
-
-/*
-@namespace KSVG
-@begin SVGTransformImplConstructor::s_hashTable 11
- SVG_TRANSFORM_UNKNOWN KSVG::SVG_TRANSFORM_UNKNOWN DontDelete|ReadOnly
- SVG_TRANSFORM_MATRIX KSVG::SVG_TRANSFORM_MATRIX DontDelete|ReadOnly
- SVG_TRANSFORM_TRANSLATE KSVG::SVG_TRANSFORM_TRANSLATE DontDelete|ReadOnly
- SVG_TRANSFORM_SCALE KSVG::SVG_TRANSFORM_SCALE DontDelete|ReadOnly
- SVG_TRANSFORM_ROTATE KSVG::SVG_TRANSFORM_ROTATE DontDelete|ReadOnly
- SVG_TRANSFORM_SKEWX KSVG::SVG_TRANSFORM_SKEWX DontDelete|ReadOnly
- SVG_TRANSFORM_SKEWY KSVG::SVG_TRANSFORM_SKEWY DontDelete|ReadOnly
-@end
-*/
-
-Value SVGTransformImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGTransformImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGTransformImplConstructor>(exec, "[[svgtransform.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTransformImpl.cpp b/ksvg/impl/SVGTransformImpl.cpp
new file mode 100644
index 00000000..dba50b09
--- /dev/null
+++ b/ksvg/impl/SVGTransformImpl.cpp
@@ -0,0 +1,238 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGTransform.h"
+
+#include "SVGMatrixImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTransformImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+SVGTransformImpl::SVGTransformImpl()
+{
+ m_matrix = SVGSVGElementImpl::createSVGMatrix();
+
+ m_type = SVG_TRANSFORM_UNKNOWN;
+ m_angle = 0;
+}
+
+SVGTransformImpl::~SVGTransformImpl()
+{
+ if(m_matrix)
+ m_matrix->deref();
+}
+
+unsigned short SVGTransformImpl::type() const
+{
+ return m_type;
+}
+
+SVGMatrixImpl *SVGTransformImpl::matrix() const
+{
+ return m_matrix;
+}
+
+double SVGTransformImpl::angle() const
+{
+ return m_angle;
+}
+
+void SVGTransformImpl::setMatrix(SVGMatrixImpl *matrix)
+{
+ if(!matrix)
+ return;
+
+ m_type = SVG_TRANSFORM_MATRIX;
+ m_angle = 0;
+
+ m_matrix->deref();
+ m_matrix = matrix;
+ m_matrix->ref();
+}
+
+void SVGTransformImpl::setTranslate(double tx, double ty)
+{
+ m_type = SVG_TRANSFORM_TRANSLATE;
+ m_angle = 0;
+ m_matrix->reset();
+ m_matrix->translate(tx, ty);
+}
+
+void SVGTransformImpl::setScale(double sx, double sy)
+{
+ m_type = SVG_TRANSFORM_SCALE;
+ m_angle = 0;
+ m_matrix->reset();
+ m_matrix->scaleNonUniform(sx, sy);
+}
+
+void SVGTransformImpl::setRotate(double angle, double cx, double cy)
+{
+ m_type = SVG_TRANSFORM_ROTATE;
+ // mop: evil...fix that...needed to make toString() work correctly
+ m_cx = cx;
+ m_cy = cy;
+ m_angle = angle;
+ m_matrix->reset();
+ m_matrix->translate(cx, cy);
+ m_matrix->rotate(angle);
+ m_matrix->translate(-cx, -cy);
+}
+
+void SVGTransformImpl::setSkewX(double angle)
+{
+ m_type = SVG_TRANSFORM_SKEWX;
+ m_angle = angle;
+ m_matrix->reset();
+ m_matrix->skewX(angle);
+}
+
+void SVGTransformImpl::setSkewY(double angle)
+{
+ m_type = SVG_TRANSFORM_SKEWY;
+ m_angle = angle;
+ m_matrix->reset();
+ m_matrix->skewY(angle);
+}
+
+TQString SVGTransformImpl::toString() const
+{
+ switch (m_type)
+ {
+ case SVG_TRANSFORM_UNKNOWN:
+ return TQString();
+ case SVG_TRANSFORM_MATRIX:
+ return TQString("matrix(" + TQString::number(m_matrix->a()) + " " + TQString::number(m_matrix->b()) + " " + TQString::number(m_matrix->c()) + " " + TQString::number(m_matrix->d()) + " " + TQString::number(m_matrix->e()) + " " + TQString::number(m_matrix->f()) + ")");
+ case SVG_TRANSFORM_TRANSLATE:
+ return TQString("translate(" + TQString::number(m_matrix->e()) + " " + TQString::number(m_matrix->f()) + ")");
+ case SVG_TRANSFORM_SCALE:
+ return TQString("scale(" + TQString::number(m_matrix->a()) + " " + TQString::number(m_matrix->d()) + ")");
+ case SVG_TRANSFORM_ROTATE:
+ return TQString("rotate(" + TQString::number(m_angle) + " " + TQString::number(m_cx) + " " + TQString::number(m_cy) + ")");
+ case SVG_TRANSFORM_SKEWX:
+ return TQString("skewX(" + TQString::number(m_angle) + ")");
+ case SVG_TRANSFORM_SKEWY:
+ return TQString("skewY(" + TQString::number(m_angle) + ")");
+ default:
+ kdWarning() << "Unknown transform type " << m_type << endl;
+ return TQString();
+ }
+}
+
+// ECMA binding
+
+/*
+@namespace KSVG
+@begin SVGTransformImpl::s_hashTable 5
+ type SVGTransformImpl::Type DontDelete|ReadOnly
+ matrix SVGTransformImpl::Matrix DontDelete|ReadOnly
+ angle SVGTransformImpl::Angle DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGTransformImplProto::s_hashTable 7
+ setMatrix SVGTransformImpl::SetMatrix DontDelete|Function 1
+ setTranslate SVGTransformImpl::SetTranslate DontDelete|Function 2
+ setScale SVGTransformImpl::SetScale DontDelete|Function 2
+ setRotate SVGTransformImpl::SetRotate DontDelete|Function 3
+ setSkewX SVGTransformImpl::SetSkewX DontDelete|Function 1
+ setSkewY SVGTransformImpl::SetSkewY DontDelete|Function 1
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGTransform", SVGTransformImplProto, SVGTransformImplProtoFunc)
+
+Value SVGTransformImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Type:
+ return Number(m_type);
+ case Matrix:
+ return m_matrix->cache(exec);
+ case Angle:
+ return Number(m_angle);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+Value SVGTransformImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGTransformImpl)
+
+ switch(id)
+ {
+ case SVGTransformImpl::SetMatrix:
+ obj->setMatrix(static_cast<KSVGBridge<SVGMatrixImpl> *>(args[0].imp())->impl());
+ break;
+ case SVGTransformImpl::SetTranslate:
+ obj->setTranslate(args[0].toNumber(exec), args[1].toNumber(exec));
+ break;
+ case SVGTransformImpl::SetScale:
+ obj->setScale(args[0].toNumber(exec), args[1].toNumber(exec));
+ break;
+ case SVGTransformImpl::SetRotate:
+ obj->setRotate(args[0].toNumber(exec), args[1].toNumber(exec), args[2].toNumber(exec));
+ break;
+ case SVGTransformImpl::SetSkewX:
+ obj->setSkewX(args[0].toNumber(exec));
+ break;
+ case SVGTransformImpl::SetSkewY:
+ obj->setSkewY(args[0].toNumber(exec));
+ break;
+ default:
+ kdWarning() << "Unhandled function id in " << k_funcinfo << " : " << id << endl;
+ break;
+ }
+
+ return Undefined();
+}
+
+/*
+@namespace KSVG
+@begin SVGTransformImplConstructor::s_hashTable 11
+ SVG_TRANSFORM_UNKNOWN KSVG::SVG_TRANSFORM_UNKNOWN DontDelete|ReadOnly
+ SVG_TRANSFORM_MATRIX KSVG::SVG_TRANSFORM_MATRIX DontDelete|ReadOnly
+ SVG_TRANSFORM_TRANSLATE KSVG::SVG_TRANSFORM_TRANSLATE DontDelete|ReadOnly
+ SVG_TRANSFORM_SCALE KSVG::SVG_TRANSFORM_SCALE DontDelete|ReadOnly
+ SVG_TRANSFORM_ROTATE KSVG::SVG_TRANSFORM_ROTATE DontDelete|ReadOnly
+ SVG_TRANSFORM_SKEWX KSVG::SVG_TRANSFORM_SKEWX DontDelete|ReadOnly
+ SVG_TRANSFORM_SKEWY KSVG::SVG_TRANSFORM_SKEWY DontDelete|ReadOnly
+@end
+*/
+
+Value SVGTransformImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGTransformImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGTransformImplConstructor>(exec, "[[svgtransform.constructor]]");
+}
diff --git a/ksvg/impl/SVGTransformImpl.h b/ksvg/impl/SVGTransformImpl.h
index c52ffdf2..219dad47 100644
--- a/ksvg/impl/SVGTransformImpl.h
+++ b/ksvg/impl/SVGTransformImpl.h
@@ -95,5 +95,3 @@ KSVG_DEFINE_PROTOTYPE(SVGTransformImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGTransformImplProtoFunc, SVGTransformImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTransformListImpl.cc b/ksvg/impl/SVGTransformListImpl.cc
deleted file mode 100644
index 5ecc16b6..00000000
--- a/ksvg/impl/SVGTransformListImpl.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGMatrixImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTransformListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTransformListImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGTransformListImpl::s_hashTable 2
- numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
-@end
-@namespace KSVG
-@begin SVGTransformListImplProto::s_hashTable 11
- getItem SVGListDefs::GetItem DontDelete|Function 1
- removeItem SVGListDefs::RemoveItem DontDelete|Function 1
- appendItem SVGListDefs::AppendItem DontDelete|Function 1
- initialize SVGListDefs::Initialize DontDelete|Function 1
- insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
- replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
- clear SVGListDefs::Clear DontDelete|Function 0
-@end
-*/
-
-KSVG_IMPLEMENT_PROTOTYPE("SVGTransformList", SVGTransformListImplProto, SVGTransformListImplProtoFunc)
-
-Value SVGTransformListImpl::getValueProperty(ExecState *exec, int token) const
-{
- return SVGList<SVGTransformImpl>::getValueProperty(exec, token);
-}
-
-Value SVGTransformListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
-{
- KSVG_CHECK_THIS(SVGTransformListImpl)
-
- return obj->call(exec, static_cast<SVGList<SVGTransformImpl> *>(obj), args, id);
-}
-
-SVGTransformImpl *SVGTransformListImpl::consolidate()
-{
- SVGTransformImpl *trans = 0;
-
- if(numberOfItems()>0)
- {
- trans = SVGSVGElementImpl::createSVGTransform();
- SVGMatrixImpl *matrix = SVGSVGElementImpl::createSVGMatrix();
-
- for(unsigned int i = 0; i < numberOfItems(); i++)
- matrix->multiply(getItem(i)->matrix());
-
- // Pedantic - sets type to MATRIX as per spec.
- trans->setMatrix(matrix);
- matrix->deref();
- initialize(trans);
- trans->ref();
- }
-
- return trans;
-}
-
-SVGMatrixImpl *SVGTransformListImpl::concatenate() const
-{
- SVGMatrixImpl *matrix = 0;
-
- if(numberOfItems()>0)
- {
- matrix = SVGSVGElementImpl::createSVGMatrix();
-
- for(unsigned int i = 0; i < numberOfItems(); i++)
- matrix->multiply(getItem(i)->matrix());
- }
-
- return matrix;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTransformListImpl.cpp b/ksvg/impl/SVGTransformListImpl.cpp
new file mode 100644
index 00000000..18e737b5
--- /dev/null
+++ b/ksvg/impl/SVGTransformListImpl.cpp
@@ -0,0 +1,101 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGMatrixImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTransformListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTransformListImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGTransformListImpl::s_hashTable 2
+ numberOfItems SVGListDefs::NumberOfItems DontDelete|ReadOnly
+@end
+@namespace KSVG
+@begin SVGTransformListImplProto::s_hashTable 11
+ getItem SVGListDefs::GetItem DontDelete|Function 1
+ removeItem SVGListDefs::RemoveItem DontDelete|Function 1
+ appendItem SVGListDefs::AppendItem DontDelete|Function 1
+ initialize SVGListDefs::Initialize DontDelete|Function 1
+ insertItemBefore SVGListDefs::InsertItemBefore DontDelete|Function 2
+ replaceItem SVGListDefs::ReplaceItem DontDelete|Function 2
+ clear SVGListDefs::Clear DontDelete|Function 0
+@end
+*/
+
+KSVG_IMPLEMENT_PROTOTYPE("SVGTransformList", SVGTransformListImplProto, SVGTransformListImplProtoFunc)
+
+Value SVGTransformListImpl::getValueProperty(ExecState *exec, int token) const
+{
+ return SVGList<SVGTransformImpl>::getValueProperty(exec, token);
+}
+
+Value SVGTransformListImplProtoFunc::call(ExecState *exec, Object &thisObj, const List &args)
+{
+ KSVG_CHECK_THIS(SVGTransformListImpl)
+
+ return obj->call(exec, static_cast<SVGList<SVGTransformImpl> *>(obj), args, id);
+}
+
+SVGTransformImpl *SVGTransformListImpl::consolidate()
+{
+ SVGTransformImpl *trans = 0;
+
+ if(numberOfItems()>0)
+ {
+ trans = SVGSVGElementImpl::createSVGTransform();
+ SVGMatrixImpl *matrix = SVGSVGElementImpl::createSVGMatrix();
+
+ for(unsigned int i = 0; i < numberOfItems(); i++)
+ matrix->multiply(getItem(i)->matrix());
+
+ // Pedantic - sets type to MATRIX as per spec.
+ trans->setMatrix(matrix);
+ matrix->deref();
+ initialize(trans);
+ trans->ref();
+ }
+
+ return trans;
+}
+
+SVGMatrixImpl *SVGTransformListImpl::concatenate() const
+{
+ SVGMatrixImpl *matrix = 0;
+
+ if(numberOfItems()>0)
+ {
+ matrix = SVGSVGElementImpl::createSVGMatrix();
+
+ for(unsigned int i = 0; i < numberOfItems(); i++)
+ matrix->multiply(getItem(i)->matrix());
+ }
+
+ return matrix;
+}
diff --git a/ksvg/impl/SVGTransformListImpl.h b/ksvg/impl/SVGTransformListImpl.h
index d59c6046..f4d59623 100644
--- a/ksvg/impl/SVGTransformListImpl.h
+++ b/ksvg/impl/SVGTransformListImpl.h
@@ -49,5 +49,3 @@ KSVG_DEFINE_PROTOTYPE(SVGTransformListImplProto)
KSVG_IMPLEMENT_PROTOFUNC(SVGTransformListImplProtoFunc, SVGTransformListImpl)
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTransformableImpl.cc b/ksvg/impl/SVGTransformableImpl.cc
deleted file mode 100644
index 59dd904b..00000000
--- a/ksvg/impl/SVGTransformableImpl.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGMatrixImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGTransformableImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-#include "SVGElementImpl.h"
-#include "SVGDocumentImpl.h"
-
-using namespace KSVG;
-
-#include "SVGTransformableImpl.lut.h"
-#include "ksvg_bridge.h"
-
-SVGTransformableImpl::SVGTransformableImpl() : SVGLocatableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_transform = new SVGAnimatedTransformListImpl();
- m_transform->ref();
-
- m_localMatrix = 0;
-}
-
-SVGTransformableImpl::SVGTransformableImpl(const SVGTransformableImpl &other) : SVGLocatableImpl()
-{
- (*this) = other;
-}
-
-SVGTransformableImpl::~SVGTransformableImpl()
-{
- if(m_transform)
- m_transform->deref();
- if(m_localMatrix)
- m_localMatrix->deref();
-}
-
-SVGTransformableImpl &SVGTransformableImpl::operator=(const SVGTransformableImpl &other)
-{
- SVGTransformListImpl *otherTransform = other.m_transform->baseVal();
-
- // Concat computed values
- for(unsigned int i = 0;i < otherTransform->numberOfItems(); i++)
- {
- SVGTransformImpl *trafo = otherTransform->getItem(i);
- m_transform->baseVal()->insertItemBefore(SVGSVGElementImpl::createSVGTransformFromMatrix(trafo->matrix()), i);
- }
-
- return *this;
-}
-
-SVGAnimatedTransformListImpl *SVGTransformableImpl::transform() const
-{
- return m_transform;
-}
-
-SVGMatrixImpl *SVGTransformableImpl::getCTM()
-{
- SVGMatrixImpl *ctm = SVGSVGElementImpl::createSVGMatrix();
-
- SVGElementImpl *element = dynamic_cast<SVGElementImpl *>(this);
- Q_ASSERT(element);
-
- DOM::Node parentNde = element->parentNode();
-
- if(!parentNde.isNull() && parentNde.nodeType() != DOM::Node::DOCUMENT_NODE)
- {
- SVGElementImpl *parent = element->ownerDoc()->getElementFromHandle(parentNde.handle());
- SVGLocatableImpl *locatableParent = dynamic_cast<SVGLocatableImpl *>(parent);
-
- if(locatableParent)
- {
- SVGMatrixImpl *parentCTM = locatableParent->getCTM();
- ctm->multiply(parentCTM);
- parentCTM->deref();
- }
- }
-
- if(m_localMatrix)
- {
- ctm->multiply(m_localMatrix);
- }
-
- return ctm;
-}
-
-void SVGTransformableImpl::updateLocalMatrix()
-{
- if(m_transform->baseVal()->numberOfItems()>0)
- {
- if(m_localMatrix)
- m_localMatrix->deref();
-
- m_localMatrix = m_transform->baseVal()->concatenate();
- }
- else
- {
- if(m_localMatrix)
- {
- m_localMatrix->deref();
- m_localMatrix = 0;
- }
- }
-
- invalidateCachedMatrices();
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGTransformableImpl::s_hashTable 2
- transform SVGTransformableImpl::Transform DontDelete
-@end
-*/
-
-Value SVGTransformableImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Transform:
- return m_transform->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGTransformableImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Transform:
- SVGHelperImpl::parseTransformAttribute(m_transform->baseVal(), value.toString(exec).qstring());
- updateLocalMatrix();
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGTransformableImpl.cpp b/ksvg/impl/SVGTransformableImpl.cpp
new file mode 100644
index 00000000..6d9e4055
--- /dev/null
+++ b/ksvg/impl/SVGTransformableImpl.cpp
@@ -0,0 +1,167 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGMatrixImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGTransformableImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+#include "SVGElementImpl.h"
+#include "SVGDocumentImpl.h"
+
+using namespace KSVG;
+
+#include "SVGTransformableImpl.lut.h"
+#include "ksvg_bridge.h"
+
+SVGTransformableImpl::SVGTransformableImpl() : SVGLocatableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_transform = new SVGAnimatedTransformListImpl();
+ m_transform->ref();
+
+ m_localMatrix = 0;
+}
+
+SVGTransformableImpl::SVGTransformableImpl(const SVGTransformableImpl &other) : SVGLocatableImpl()
+{
+ (*this) = other;
+}
+
+SVGTransformableImpl::~SVGTransformableImpl()
+{
+ if(m_transform)
+ m_transform->deref();
+ if(m_localMatrix)
+ m_localMatrix->deref();
+}
+
+SVGTransformableImpl &SVGTransformableImpl::operator=(const SVGTransformableImpl &other)
+{
+ SVGTransformListImpl *otherTransform = other.m_transform->baseVal();
+
+ // Concat computed values
+ for(unsigned int i = 0;i < otherTransform->numberOfItems(); i++)
+ {
+ SVGTransformImpl *trafo = otherTransform->getItem(i);
+ m_transform->baseVal()->insertItemBefore(SVGSVGElementImpl::createSVGTransformFromMatrix(trafo->matrix()), i);
+ }
+
+ return *this;
+}
+
+SVGAnimatedTransformListImpl *SVGTransformableImpl::transform() const
+{
+ return m_transform;
+}
+
+SVGMatrixImpl *SVGTransformableImpl::getCTM()
+{
+ SVGMatrixImpl *ctm = SVGSVGElementImpl::createSVGMatrix();
+
+ SVGElementImpl *element = dynamic_cast<SVGElementImpl *>(this);
+ Q_ASSERT(element);
+
+ DOM::Node parentNde = element->parentNode();
+
+ if(!parentNde.isNull() && parentNde.nodeType() != DOM::Node::DOCUMENT_NODE)
+ {
+ SVGElementImpl *parent = element->ownerDoc()->getElementFromHandle(parentNde.handle());
+ SVGLocatableImpl *locatableParent = dynamic_cast<SVGLocatableImpl *>(parent);
+
+ if(locatableParent)
+ {
+ SVGMatrixImpl *parentCTM = locatableParent->getCTM();
+ ctm->multiply(parentCTM);
+ parentCTM->deref();
+ }
+ }
+
+ if(m_localMatrix)
+ {
+ ctm->multiply(m_localMatrix);
+ }
+
+ return ctm;
+}
+
+void SVGTransformableImpl::updateLocalMatrix()
+{
+ if(m_transform->baseVal()->numberOfItems()>0)
+ {
+ if(m_localMatrix)
+ m_localMatrix->deref();
+
+ m_localMatrix = m_transform->baseVal()->concatenate();
+ }
+ else
+ {
+ if(m_localMatrix)
+ {
+ m_localMatrix->deref();
+ m_localMatrix = 0;
+ }
+ }
+
+ invalidateCachedMatrices();
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGTransformableImpl::s_hashTable 2
+ transform SVGTransformableImpl::Transform DontDelete
+@end
+*/
+
+Value SVGTransformableImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Transform:
+ return m_transform->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGTransformableImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Transform:
+ SVGHelperImpl::parseTransformAttribute(m_transform->baseVal(), value.toString(exec).qstring());
+ updateLocalMatrix();
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGTransformableImpl.h b/ksvg/impl/SVGTransformableImpl.h
index 0ccd4908..cb1d15a6 100644
--- a/ksvg/impl/SVGTransformableImpl.h
+++ b/ksvg/impl/SVGTransformableImpl.h
@@ -73,5 +73,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGURIReferenceImpl.cc b/ksvg/impl/SVGURIReferenceImpl.cc
deleted file mode 100644
index 8a6fda76..00000000
--- a/ksvg/impl/SVGURIReferenceImpl.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGURIReferenceImpl.h"
-#include "SVGAnimatedStringImpl.h"
-
-using namespace KSVG;
-
-#include "SVGURIReferenceImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-
-SVGURIReferenceImpl::SVGURIReferenceImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_href = new SVGAnimatedStringImpl();
- m_href->ref();
-}
-
-SVGURIReferenceImpl::~SVGURIReferenceImpl()
-{
- if(m_href)
- m_href->deref();
-}
-
-SVGAnimatedStringImpl *SVGURIReferenceImpl::href() const
-{
- return m_href;
-}
-
-bool SVGURIReferenceImpl::parseURIReference(const TQString &urireference, TQString &uri, TQString &elementreference)
-{
- int seperator = urireference.find("#");
-
- if(seperator == -1)
- return false;
-
- uri = urireference.left(seperator);
- elementreference = urireference.mid(seperator + 1);
-
- return true;
-}
-
-bool SVGURIReferenceImpl::isUrl(const TQString &url)
-{
- TQString temp = url.stripWhiteSpace();
- return temp.startsWith("url(#") && temp.endsWith(")");
-}
-
-TQString SVGURIReferenceImpl::getTarget(const TQString &url)
-{
- if(url.startsWith("url(")) // URI References, ie. fill:url(#target)
- {
- unsigned int start = url.find("#") + 1;
- unsigned int end = url.findRev(")");
-
- return url.mid(start, end - start);
- }
- else if(url.find("#") > -1) // format is #target
- {
- unsigned int start = url.find("#") + 1;
-
- return url.mid(start, url.length() - start);
- }
- else // Normal Reference, ie. style="color-profile:changeColor"
- return url;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGURIReferenceImpl::s_hashTable 2
- href SVGURIReferenceImpl::Href DontDelete|ReadOnly
-@end
-*/
-
-Value SVGURIReferenceImpl::getValueProperty(ExecState *exec, int token) const
-{
- switch(token)
- {
- case Href:
- return m_href->cache(exec);
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGURIReferenceImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case Href:
- {
- if(m_href)
- m_href->deref();
-
- SVGAnimatedStringImpl *temp = new SVGAnimatedStringImpl();
- temp->ref();
- temp->setBaseVal(value.toString(exec).string());
- m_href = temp;
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGURIReferenceImpl.cpp b/ksvg/impl/SVGURIReferenceImpl.cpp
new file mode 100644
index 00000000..0d634e13
--- /dev/null
+++ b/ksvg/impl/SVGURIReferenceImpl.cpp
@@ -0,0 +1,133 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGURIReferenceImpl.h"
+#include "SVGAnimatedStringImpl.h"
+
+using namespace KSVG;
+
+#include "SVGURIReferenceImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+
+SVGURIReferenceImpl::SVGURIReferenceImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_href = new SVGAnimatedStringImpl();
+ m_href->ref();
+}
+
+SVGURIReferenceImpl::~SVGURIReferenceImpl()
+{
+ if(m_href)
+ m_href->deref();
+}
+
+SVGAnimatedStringImpl *SVGURIReferenceImpl::href() const
+{
+ return m_href;
+}
+
+bool SVGURIReferenceImpl::parseURIReference(const TQString &urireference, TQString &uri, TQString &elementreference)
+{
+ int seperator = urireference.find("#");
+
+ if(seperator == -1)
+ return false;
+
+ uri = urireference.left(seperator);
+ elementreference = urireference.mid(seperator + 1);
+
+ return true;
+}
+
+bool SVGURIReferenceImpl::isUrl(const TQString &url)
+{
+ TQString temp = url.stripWhiteSpace();
+ return temp.startsWith("url(#") && temp.endsWith(")");
+}
+
+TQString SVGURIReferenceImpl::getTarget(const TQString &url)
+{
+ if(url.startsWith("url(")) // URI References, ie. fill:url(#target)
+ {
+ unsigned int start = url.find("#") + 1;
+ unsigned int end = url.findRev(")");
+
+ return url.mid(start, end - start);
+ }
+ else if(url.find("#") > -1) // format is #target
+ {
+ unsigned int start = url.find("#") + 1;
+
+ return url.mid(start, url.length() - start);
+ }
+ else // Normal Reference, ie. style="color-profile:changeColor"
+ return url;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGURIReferenceImpl::s_hashTable 2
+ href SVGURIReferenceImpl::Href DontDelete|ReadOnly
+@end
+*/
+
+Value SVGURIReferenceImpl::getValueProperty(ExecState *exec, int token) const
+{
+ switch(token)
+ {
+ case Href:
+ return m_href->cache(exec);
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGURIReferenceImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case Href:
+ {
+ if(m_href)
+ m_href->deref();
+
+ SVGAnimatedStringImpl *temp = new SVGAnimatedStringImpl();
+ temp->ref();
+ temp->setBaseVal(value.toString(exec).string());
+ m_href = temp;
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGURIReferenceImpl.h b/ksvg/impl/SVGURIReferenceImpl.h
index 8d6500b0..fa291fb3 100644
--- a/ksvg/impl/SVGURIReferenceImpl.h
+++ b/ksvg/impl/SVGURIReferenceImpl.h
@@ -60,5 +60,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGUnitConverter.h b/ksvg/impl/SVGUnitConverter.h
index cb8bac04..14f3af17 100644
--- a/ksvg/impl/SVGUnitConverter.h
+++ b/ksvg/impl/SVGUnitConverter.h
@@ -96,5 +96,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGUseElementImpl.cc b/ksvg/impl/SVGUseElementImpl.cc
deleted file mode 100644
index db822a64..00000000
--- a/ksvg/impl/SVGUseElementImpl.cc
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqstring.h>
-
-#include "KSVGLoader.h"
-#include "KSVGCanvas.h"
-
-#include "SVGRectImpl.h"
-#include "SVGEventImpl.h"
-#include "SVGHelperImpl.h"
-#include "SVGMatrixImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGTransformImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGUseElementImpl.h"
-#include "SVGSymbolElementImpl.h"
-#include "SVGTransformListImpl.h"
-#include "SVGAnimatedStringImpl.h"
-#include "SVGAnimatedLengthImpl.h"
-#include "SVGElementInstanceImpl.h"
-#include "SVGAnimatedTransformListImpl.h"
-
-using namespace KSVG;
-
-#include "SVGUseElementImpl.lut.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGUseElementImpl::SVGUseElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_x = new SVGAnimatedLengthImpl();
- m_x->ref();
-
- m_y = new SVGAnimatedLengthImpl();
- m_y->ref();
-
- m_width = new SVGAnimatedLengthImpl();
- m_width->ref();
-
- m_height = new SVGAnimatedLengthImpl();
- m_height->ref();
-
- m_instanceRoot = 0;
-}
-
-SVGUseElementImpl::~SVGUseElementImpl()
-{
- if(m_x)
- m_x->deref();
- if(m_y)
- m_y->deref();
- if(m_width)
- m_width->deref();
- if(m_height)
- m_height->deref();
- if(m_instanceRoot)
- m_instanceRoot->deref();
-}
-
-SVGAnimatedLengthImpl *SVGUseElementImpl::x() const
-{
- return m_x;
-}
-
-SVGAnimatedLengthImpl *SVGUseElementImpl::y() const
-{
- return m_y;
-}
-
-SVGAnimatedLengthImpl *SVGUseElementImpl::width() const
-{
- return m_width;
-}
-
-SVGAnimatedLengthImpl *SVGUseElementImpl::height() const
-{
- return m_height;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGUseElementImpl::s_hashTable 11
- x SVGUseElementImpl::X DontDelete|ReadOnly
- y SVGUseElementImpl::Y DontDelete|ReadOnly
- width SVGUseElementImpl::Width DontDelete|ReadOnly
- height SVGUseElementImpl::Height DontDelete|ReadOnly
- href SVGUseElementImpl::Href DontDelete|ReadOnly
- instanceRoot SVGUseElementImpl::InstanceRoot DontDelete|ReadOnly
- animatedInstanceRoot SVGUseElementImpl::AnimatedInstanceRoot DontDelete|ReadOnly
-@end
-*/
-
-Value SVGUseElementImpl::getValueProperty(ExecState *exec, int token) const
-{
- KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case X:
- if(!attributeMode)
- return m_x->cache(exec);
- else
- return Number(m_x->baseVal()->value());
- case Y:
- if(!attributeMode)
- return m_y->cache(exec);
- else
- return Number(m_y->baseVal()->value());
- case Width:
- if(!attributeMode)
- return m_width->cache(exec);
- else
- return Number(m_width->baseVal()->value());
- case Height:
- if(!attributeMode)
- return m_height->cache(exec);
- else
- return Number(m_height->baseVal()->value());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGUseElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case X:
- x()->baseVal()->setValue(value.toNumber(exec));
- break;
- case Y:
- y()->baseVal()->setValue(value.toNumber(exec));
- break;
- case Width:
- width()->baseVal()->setValue(value.toNumber(exec));
- break;
- case Height:
- height()->baseVal()->setValue(value.toNumber(exec));
- break;
- case Href:
- {
- TQString url = value.toString(exec).qstring();
- href()->setBaseVal(SVGURIReferenceImpl::getTarget(url));
- break;
- }
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-SVGRectImpl *SVGUseElementImpl::getBBox()
-{
- if(m_instanceRoot)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
- if(KSVG_TOKEN_NOT_PARSED(Width) && KSVG_TOKEN_NOT_PARSED(Height) && shape)
- return shape->getBBox();
- }
-
- SVGRectImpl *ret = new SVGRectImpl();
- ret->ref();
- ret->setX(m_x->baseVal()->value());
- ret->setY(m_y->baseVal()->value());
- ret->setWidth(m_width->baseVal()->value());
- ret->setHeight(m_height->baseVal()->value());
- return ret;
-}
-
-SVGElementInstanceImpl *SVGUseElementImpl::instanceRoot() const
-{
- return m_instanceRoot;
-}
-
-SVGElementInstanceImpl *SVGUseElementImpl::animatedInstanceRoot() const
-{
- return m_animatedInstanceRoot;
-}
-
-void SVGUseElementImpl::createItem(KSVGCanvas *c)
-{
- if(!m_instanceRoot)
- {
- // ownerSVGElement()->getElementById() is wrong here.
- // It could reference elements from other documents when using getURL (Niko)
- TQString filename, id;
- DOM::DOMString url = getAttribute("href");
- if(!SVGURIReferenceImpl::parseURIReference(url.string(), filename, id))
- return;
-
- SVGElementImpl *orig;
- if(!filename.isEmpty())
- {
- KURL fragmentUrl(ownerDoc()->baseUrl(), url.string());
-
- id = fragmentUrl.ref();
- fragmentUrl.setRef(TQString());
-
- orig = KSVGLoader::getSVGFragment(fragmentUrl, ownerDoc(), id);
- }
- else
- {
- orig = ownerDoc()->getElementByIdRecursive(ownerSVGElement(), href()->baseVal());
-
- if(orig == 0)
- {
- // The document will try to create this item again once the parsing has finished.
- ownerDoc()->addForwardReferencingUseElement(this);
- }
- }
-
- if(orig == 0)
- return;
-
- setReferencedElement(orig);
-
- // Create a parent, a <g>
- SVGElementImpl *parent = 0;
- DOM::Element impl = static_cast<DOM::Document *>(ownerDoc())->createElement("g");
- parent = SVGDocumentImpl::createElement("g", impl, ownerDoc());
- SVGElementImpl *clone = orig->cloneNode(true);
-
- // Apply the use-correction
- TQString trans;
- trans += " translate(";
- trans += TQString::number(x()->baseVal()->value());
- trans += " ";
- trans += TQString::number(y()->baseVal()->value());
- trans += ")";
-
- // Apply the transform attribute and render the element
- parent->setAttributeInternal("transform", trans);
- parent->setAttribute("transform", trans);
-
- // Apply width/height if symbol
- if(dynamic_cast<SVGSymbolElementImpl *>(clone))
- {
- DOM::Element impl = static_cast<DOM::Document *>(ownerDoc())->createElement("svg");
- SVGElementImpl *symbolSvg = SVGDocumentImpl::createElement("svg", impl, ownerDoc());
-
- SVGHelperImpl::copyAttributes(orig, symbolSvg);
-
- symbolSvg->setAttribute("width", getAttribute("width"));
- symbolSvg->setAttributeInternal("width", getAttribute("width"));
- symbolSvg->setAttribute("height", getAttribute("height"));
- symbolSvg->setAttributeInternal("height", getAttribute("height"));
- DOM::Node node = clone->firstChild();
- for(; !node.isNull(); node = clone->firstChild())
- symbolSvg->appendChild(node);
-
- clone = symbolSvg;
- }
- else if(dynamic_cast<SVGSVGElementImpl *>(clone))
- {
- if(!getAttribute("width").isEmpty())
- {
- clone->setAttribute("width", getAttribute("width"));
- clone->setAttributeInternal("width", getAttribute("width"));
- }
-
- if(!getAttribute("height").isEmpty())
- {
- clone->setAttribute("height", getAttribute("height"));
- clone->setAttributeInternal("height", getAttribute("height"));
- }
- }
-
- appendChild(*parent);
- parent->appendChild(*clone);
-
- setupSubtree(parent, ownerSVGElement(), viewportElement());
-
- m_instanceRoot->setCorrespondingElement(clone);
-
- dynamic_cast<SVGLocatableImpl *>(parent)->updateCachedScreenCTM(screenCTM());
-
- // Redirect local ecma event handlers to the correspondingElement
- TQPtrListIterator<SVGRegisteredEventListener> it(eventListeners());
- SVGRegisteredEventListener *eventListener;
- while((eventListener = it.current()) != 0)
- {
- ++it;
- clone->setEventListener(eventListener->id, eventListener->listener);
- }
- }
-
- if(m_instanceRoot)
- {
- SVGElementImpl *element = m_instanceRoot->correspondingElement();
- element->createItem(c);
- }
-}
-
-void SVGUseElementImpl::removeItem(KSVGCanvas *c)
-{
- if(m_instanceRoot)
- {
- SVGElementImpl *element = m_instanceRoot->correspondingElement();
- element->removeItem(c);
- }
-}
-
-void SVGUseElementImpl::setupSubtree(SVGElementImpl *element, SVGSVGElementImpl *ownerSVG, SVGElementImpl *viewport)
-{
- element->setOwnerSVGElement(ownerSVG);
- element->setViewportElement(viewport);
- element->setAttributes();
-
- SVGSVGElementImpl *thisSVG = dynamic_cast<SVGSVGElementImpl *>(element);
-
- if(thisSVG != 0)
- {
- ownerSVG = thisSVG;
- viewport = element;
- }
-
- DOM::Node child = element->firstChild();
- for(; !child.isNull(); child = child.nextSibling())
- {
- SVGElementImpl *childElement = ownerDoc()->getElementFromHandle(child.handle());
- if(childElement != 0)
- setupSubtree(childElement, ownerSVG, viewport);
- }
-}
-
-void SVGUseElementImpl::setReferencedElement(SVGElementImpl *referenced)
-{
- if(!referenced)
- return;
-
- if(!m_instanceRoot)
- {
- m_instanceRoot = new SVGElementInstanceImpl();
- m_instanceRoot->ref();
- }
-
- m_instanceRoot->setCorrespondingElement(referenced);
-}
-
-void SVGUseElementImpl::update(CanvasItemUpdate reason, int param1, int param2)
-{
- if(m_instanceRoot)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
- if(shape)
- shape->update(reason, param1, param2);
- }
-}
-
-void SVGUseElementImpl::invalidate(KSVGCanvas *c, bool recalc)
-{
- if(m_instanceRoot)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
- if(shape)
- shape->invalidate(c, recalc);
- }
-}
-
-void SVGUseElementImpl::setReferenced(bool referenced)
-{
- if(m_instanceRoot)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
- if(shape)
- shape->setReferenced(referenced);
- }
-}
-
-void SVGUseElementImpl::draw()
-{
- if(m_instanceRoot)
- {
- SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
- if(shape)
- shape->draw();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGUseElementImpl.cpp b/ksvg/impl/SVGUseElementImpl.cpp
new file mode 100644
index 00000000..b7f36be5
--- /dev/null
+++ b/ksvg/impl/SVGUseElementImpl.cpp
@@ -0,0 +1,407 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqstring.h>
+
+#include "KSVGLoader.h"
+#include "KSVGCanvas.h"
+
+#include "SVGRectImpl.h"
+#include "SVGEventImpl.h"
+#include "SVGHelperImpl.h"
+#include "SVGMatrixImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGTransformImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGUseElementImpl.h"
+#include "SVGSymbolElementImpl.h"
+#include "SVGTransformListImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedLengthImpl.h"
+#include "SVGElementInstanceImpl.h"
+#include "SVGAnimatedTransformListImpl.h"
+
+using namespace KSVG;
+
+#include "SVGUseElementImpl.lut.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGUseElementImpl::SVGUseElementImpl(DOM::ElementImpl *impl) : SVGShapeImpl(impl), SVGURIReferenceImpl(), SVGTestsImpl(), SVGLangSpaceImpl(), SVGExternalResourcesRequiredImpl(), SVGStylableImpl(this), SVGTransformableImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_x = new SVGAnimatedLengthImpl();
+ m_x->ref();
+
+ m_y = new SVGAnimatedLengthImpl();
+ m_y->ref();
+
+ m_width = new SVGAnimatedLengthImpl();
+ m_width->ref();
+
+ m_height = new SVGAnimatedLengthImpl();
+ m_height->ref();
+
+ m_instanceRoot = 0;
+}
+
+SVGUseElementImpl::~SVGUseElementImpl()
+{
+ if(m_x)
+ m_x->deref();
+ if(m_y)
+ m_y->deref();
+ if(m_width)
+ m_width->deref();
+ if(m_height)
+ m_height->deref();
+ if(m_instanceRoot)
+ m_instanceRoot->deref();
+}
+
+SVGAnimatedLengthImpl *SVGUseElementImpl::x() const
+{
+ return m_x;
+}
+
+SVGAnimatedLengthImpl *SVGUseElementImpl::y() const
+{
+ return m_y;
+}
+
+SVGAnimatedLengthImpl *SVGUseElementImpl::width() const
+{
+ return m_width;
+}
+
+SVGAnimatedLengthImpl *SVGUseElementImpl::height() const
+{
+ return m_height;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGUseElementImpl::s_hashTable 11
+ x SVGUseElementImpl::X DontDelete|ReadOnly
+ y SVGUseElementImpl::Y DontDelete|ReadOnly
+ width SVGUseElementImpl::Width DontDelete|ReadOnly
+ height SVGUseElementImpl::Height DontDelete|ReadOnly
+ href SVGUseElementImpl::Href DontDelete|ReadOnly
+ instanceRoot SVGUseElementImpl::InstanceRoot DontDelete|ReadOnly
+ animatedInstanceRoot SVGUseElementImpl::AnimatedInstanceRoot DontDelete|ReadOnly
+@end
+*/
+
+Value SVGUseElementImpl::getValueProperty(ExecState *exec, int token) const
+{
+ KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case X:
+ if(!attributeMode)
+ return m_x->cache(exec);
+ else
+ return Number(m_x->baseVal()->value());
+ case Y:
+ if(!attributeMode)
+ return m_y->cache(exec);
+ else
+ return Number(m_y->baseVal()->value());
+ case Width:
+ if(!attributeMode)
+ return m_width->cache(exec);
+ else
+ return Number(m_width->baseVal()->value());
+ case Height:
+ if(!attributeMode)
+ return m_height->cache(exec);
+ else
+ return Number(m_height->baseVal()->value());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGUseElementImpl::putValueProperty(ExecState *exec, int token, const Value &value, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case X:
+ x()->baseVal()->setValue(value.toNumber(exec));
+ break;
+ case Y:
+ y()->baseVal()->setValue(value.toNumber(exec));
+ break;
+ case Width:
+ width()->baseVal()->setValue(value.toNumber(exec));
+ break;
+ case Height:
+ height()->baseVal()->setValue(value.toNumber(exec));
+ break;
+ case Href:
+ {
+ TQString url = value.toString(exec).qstring();
+ href()->setBaseVal(SVGURIReferenceImpl::getTarget(url));
+ break;
+ }
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+SVGRectImpl *SVGUseElementImpl::getBBox()
+{
+ if(m_instanceRoot)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
+ if(KSVG_TOKEN_NOT_PARSED(Width) && KSVG_TOKEN_NOT_PARSED(Height) && shape)
+ return shape->getBBox();
+ }
+
+ SVGRectImpl *ret = new SVGRectImpl();
+ ret->ref();
+ ret->setX(m_x->baseVal()->value());
+ ret->setY(m_y->baseVal()->value());
+ ret->setWidth(m_width->baseVal()->value());
+ ret->setHeight(m_height->baseVal()->value());
+ return ret;
+}
+
+SVGElementInstanceImpl *SVGUseElementImpl::instanceRoot() const
+{
+ return m_instanceRoot;
+}
+
+SVGElementInstanceImpl *SVGUseElementImpl::animatedInstanceRoot() const
+{
+ return m_animatedInstanceRoot;
+}
+
+void SVGUseElementImpl::createItem(KSVGCanvas *c)
+{
+ if(!m_instanceRoot)
+ {
+ // ownerSVGElement()->getElementById() is wrong here.
+ // It could reference elements from other documents when using getURL (Niko)
+ TQString filename, id;
+ DOM::DOMString url = getAttribute("href");
+ if(!SVGURIReferenceImpl::parseURIReference(url.string(), filename, id))
+ return;
+
+ SVGElementImpl *orig;
+ if(!filename.isEmpty())
+ {
+ KURL fragmentUrl(ownerDoc()->baseUrl(), url.string());
+
+ id = fragmentUrl.ref();
+ fragmentUrl.setRef(TQString());
+
+ orig = KSVGLoader::getSVGFragment(fragmentUrl, ownerDoc(), id);
+ }
+ else
+ {
+ orig = ownerDoc()->getElementByIdRecursive(ownerSVGElement(), href()->baseVal());
+
+ if(orig == 0)
+ {
+ // The document will try to create this item again once the parsing has finished.
+ ownerDoc()->addForwardReferencingUseElement(this);
+ }
+ }
+
+ if(orig == 0)
+ return;
+
+ setReferencedElement(orig);
+
+ // Create a parent, a <g>
+ SVGElementImpl *parent = 0;
+ DOM::Element impl = static_cast<DOM::Document *>(ownerDoc())->createElement("g");
+ parent = SVGDocumentImpl::createElement("g", impl, ownerDoc());
+ SVGElementImpl *clone = orig->cloneNode(true);
+
+ // Apply the use-correction
+ TQString trans;
+ trans += " translate(";
+ trans += TQString::number(x()->baseVal()->value());
+ trans += " ";
+ trans += TQString::number(y()->baseVal()->value());
+ trans += ")";
+
+ // Apply the transform attribute and render the element
+ parent->setAttributeInternal("transform", trans);
+ parent->setAttribute("transform", trans);
+
+ // Apply width/height if symbol
+ if(dynamic_cast<SVGSymbolElementImpl *>(clone))
+ {
+ DOM::Element impl = static_cast<DOM::Document *>(ownerDoc())->createElement("svg");
+ SVGElementImpl *symbolSvg = SVGDocumentImpl::createElement("svg", impl, ownerDoc());
+
+ SVGHelperImpl::copyAttributes(orig, symbolSvg);
+
+ symbolSvg->setAttribute("width", getAttribute("width"));
+ symbolSvg->setAttributeInternal("width", getAttribute("width"));
+ symbolSvg->setAttribute("height", getAttribute("height"));
+ symbolSvg->setAttributeInternal("height", getAttribute("height"));
+ DOM::Node node = clone->firstChild();
+ for(; !node.isNull(); node = clone->firstChild())
+ symbolSvg->appendChild(node);
+
+ clone = symbolSvg;
+ }
+ else if(dynamic_cast<SVGSVGElementImpl *>(clone))
+ {
+ if(!getAttribute("width").isEmpty())
+ {
+ clone->setAttribute("width", getAttribute("width"));
+ clone->setAttributeInternal("width", getAttribute("width"));
+ }
+
+ if(!getAttribute("height").isEmpty())
+ {
+ clone->setAttribute("height", getAttribute("height"));
+ clone->setAttributeInternal("height", getAttribute("height"));
+ }
+ }
+
+ appendChild(*parent);
+ parent->appendChild(*clone);
+
+ setupSubtree(parent, ownerSVGElement(), viewportElement());
+
+ m_instanceRoot->setCorrespondingElement(clone);
+
+ dynamic_cast<SVGLocatableImpl *>(parent)->updateCachedScreenCTM(screenCTM());
+
+ // Redirect local ecma event handlers to the correspondingElement
+ TQPtrListIterator<SVGRegisteredEventListener> it(eventListeners());
+ SVGRegisteredEventListener *eventListener;
+ while((eventListener = it.current()) != 0)
+ {
+ ++it;
+ clone->setEventListener(eventListener->id, eventListener->listener);
+ }
+ }
+
+ if(m_instanceRoot)
+ {
+ SVGElementImpl *element = m_instanceRoot->correspondingElement();
+ element->createItem(c);
+ }
+}
+
+void SVGUseElementImpl::removeItem(KSVGCanvas *c)
+{
+ if(m_instanceRoot)
+ {
+ SVGElementImpl *element = m_instanceRoot->correspondingElement();
+ element->removeItem(c);
+ }
+}
+
+void SVGUseElementImpl::setupSubtree(SVGElementImpl *element, SVGSVGElementImpl *ownerSVG, SVGElementImpl *viewport)
+{
+ element->setOwnerSVGElement(ownerSVG);
+ element->setViewportElement(viewport);
+ element->setAttributes();
+
+ SVGSVGElementImpl *thisSVG = dynamic_cast<SVGSVGElementImpl *>(element);
+
+ if(thisSVG != 0)
+ {
+ ownerSVG = thisSVG;
+ viewport = element;
+ }
+
+ DOM::Node child = element->firstChild();
+ for(; !child.isNull(); child = child.nextSibling())
+ {
+ SVGElementImpl *childElement = ownerDoc()->getElementFromHandle(child.handle());
+ if(childElement != 0)
+ setupSubtree(childElement, ownerSVG, viewport);
+ }
+}
+
+void SVGUseElementImpl::setReferencedElement(SVGElementImpl *referenced)
+{
+ if(!referenced)
+ return;
+
+ if(!m_instanceRoot)
+ {
+ m_instanceRoot = new SVGElementInstanceImpl();
+ m_instanceRoot->ref();
+ }
+
+ m_instanceRoot->setCorrespondingElement(referenced);
+}
+
+void SVGUseElementImpl::update(CanvasItemUpdate reason, int param1, int param2)
+{
+ if(m_instanceRoot)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
+ if(shape)
+ shape->update(reason, param1, param2);
+ }
+}
+
+void SVGUseElementImpl::invalidate(KSVGCanvas *c, bool recalc)
+{
+ if(m_instanceRoot)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
+ if(shape)
+ shape->invalidate(c, recalc);
+ }
+}
+
+void SVGUseElementImpl::setReferenced(bool referenced)
+{
+ if(m_instanceRoot)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
+ if(shape)
+ shape->setReferenced(referenced);
+ }
+}
+
+void SVGUseElementImpl::draw()
+{
+ if(m_instanceRoot)
+ {
+ SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(m_instanceRoot->correspondingElement());
+ if(shape)
+ shape->draw();
+ }
+}
diff --git a/ksvg/impl/SVGUseElementImpl.h b/ksvg/impl/SVGUseElementImpl.h
index 02eb8d88..d2a10e19 100644
--- a/ksvg/impl/SVGUseElementImpl.h
+++ b/ksvg/impl/SVGUseElementImpl.h
@@ -97,5 +97,3 @@ KSVG_REGISTER_ELEMENT(SVGUseElementImpl, "use")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGVKernElementImpl.cc b/ksvg/impl/SVGVKernElementImpl.cc
deleted file mode 100644
index b89d6e6f..00000000
--- a/ksvg/impl/SVGVKernElementImpl.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGVKernElementImpl.h"
-
-using namespace KSVG;
-
-SVGVKernElementImpl::SVGVKernElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
-{
-}
-
-SVGVKernElementImpl::~SVGVKernElementImpl()
-{
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGVKernElementImpl.cpp b/ksvg/impl/SVGVKernElementImpl.cpp
new file mode 100644
index 00000000..2f07baee
--- /dev/null
+++ b/ksvg/impl/SVGVKernElementImpl.cpp
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGVKernElementImpl.h"
+
+using namespace KSVG;
+
+SVGVKernElementImpl::SVGVKernElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl)
+{
+}
+
+SVGVKernElementImpl::~SVGVKernElementImpl()
+{
+}
diff --git a/ksvg/impl/SVGVKernElementImpl.h b/ksvg/impl/SVGVKernElementImpl.h
index c8302c35..e05b7626 100644
--- a/ksvg/impl/SVGVKernElementImpl.h
+++ b/ksvg/impl/SVGVKernElementImpl.h
@@ -42,5 +42,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGViewElementImpl.cc b/ksvg/impl/SVGViewElementImpl.cc
deleted file mode 100644
index a051fba0..00000000
--- a/ksvg/impl/SVGViewElementImpl.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGStringListImpl.h"
-#include "SVGViewElementImpl.h"
-
-using namespace KSVG;
-
-#include "SVGViewElementImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_ecma.h"
-
-SVGViewElementImpl::SVGViewElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGExternalResourcesRequiredImpl(), SVGFitToViewBoxImpl(), SVGZoomAndPanImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_viewTarget = new SVGStringListImpl();
- m_viewTarget->ref();
-}
-
-SVGViewElementImpl::~SVGViewElementImpl()
-{
- if(m_viewTarget)
- m_viewTarget->deref();
-}
-
-SVGStringListImpl *SVGViewElementImpl::viewTarget() const
-{
- return m_viewTarget;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGViewElementImpl::s_hashTable 2
- viewTarget SVGViewElementImpl::ViewTarget DontDelete|ReadOnly
-@end
-*/
-
-Value SVGViewElementImpl::getValueProperty(ExecState *, int token) const
-{
- //KSVG_CHECK_ATTRIBUTE
-
- switch(token)
- {
- case ViewTarget:
- // TODO
- return Undefined();
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-void SVGViewElementImpl::putValueProperty(ExecState *, int token, const Value &, int attr)
-{
- // This class has just ReadOnly properties, only with the Internal flag set
- // it's allowed to modify those.
- if(!(attr & KJS::Internal))
- return;
-
- switch(token)
- {
- case ViewTarget:
- // TODO
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGViewElementImpl.cpp b/ksvg/impl/SVGViewElementImpl.cpp
new file mode 100644
index 00000000..19d56dc5
--- /dev/null
+++ b/ksvg/impl/SVGViewElementImpl.cpp
@@ -0,0 +1,92 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGStringListImpl.h"
+#include "SVGViewElementImpl.h"
+
+using namespace KSVG;
+
+#include "SVGViewElementImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_ecma.h"
+
+SVGViewElementImpl::SVGViewElementImpl(DOM::ElementImpl *impl) : SVGElementImpl(impl), SVGExternalResourcesRequiredImpl(), SVGFitToViewBoxImpl(), SVGZoomAndPanImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_viewTarget = new SVGStringListImpl();
+ m_viewTarget->ref();
+}
+
+SVGViewElementImpl::~SVGViewElementImpl()
+{
+ if(m_viewTarget)
+ m_viewTarget->deref();
+}
+
+SVGStringListImpl *SVGViewElementImpl::viewTarget() const
+{
+ return m_viewTarget;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGViewElementImpl::s_hashTable 2
+ viewTarget SVGViewElementImpl::ViewTarget DontDelete|ReadOnly
+@end
+*/
+
+Value SVGViewElementImpl::getValueProperty(ExecState *, int token) const
+{
+ //KSVG_CHECK_ATTRIBUTE
+
+ switch(token)
+ {
+ case ViewTarget:
+ // TODO
+ return Undefined();
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
+
+void SVGViewElementImpl::putValueProperty(ExecState *, int token, const Value &, int attr)
+{
+ // This class has just ReadOnly properties, only with the Internal flag set
+ // it's allowed to modify those.
+ if(!(attr & KJS::Internal))
+ return;
+
+ switch(token)
+ {
+ case ViewTarget:
+ // TODO
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
diff --git a/ksvg/impl/SVGViewElementImpl.h b/ksvg/impl/SVGViewElementImpl.h
index 8b8d7e0b..dc0a1731 100644
--- a/ksvg/impl/SVGViewElementImpl.h
+++ b/ksvg/impl/SVGViewElementImpl.h
@@ -66,5 +66,3 @@ KSVG_REGISTER_ELEMENT(SVGViewElementImpl, "view")
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGViewSpecImpl.cc b/ksvg/impl/SVGViewSpecImpl.cc
deleted file mode 100644
index 6a225626..00000000
--- a/ksvg/impl/SVGViewSpecImpl.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include <tqstringlist.h>
-
-#include "SVGElementImpl.h"
-#include "SVGViewSpecImpl.h"
-#include "SVGTransformListImpl.h"
-
-using namespace KSVG;
-
-SVGViewSpecImpl::SVGViewSpecImpl() : SVGZoomAndPanImpl(), SVGFitToViewBoxImpl()
-{
- m_transform = new SVGTransformListImpl();
- m_transform->ref();
-
- m_viewTarget = new SVGElementImpl(0);
- m_viewTarget->ref();
-}
-
-SVGViewSpecImpl::~SVGViewSpecImpl()
-{
- if(m_transform)
- m_transform->deref();
- if(m_viewTarget)
- m_viewTarget->deref();
-}
-
-SVGTransformListImpl *SVGViewSpecImpl::transform() const
-{
- return m_transform;
-}
-
-SVGElementImpl *SVGViewSpecImpl::viewTarget() const
-{
- return m_viewTarget;
-}
-
-DOM::DOMString SVGViewSpecImpl::viewBoxString() const
-{
- return m_viewBoxString;
-}
-
-DOM::DOMString SVGViewSpecImpl::preserveAspectRatioString() const
-{
- return m_preserveAspectRatioString;
-}
-
-DOM::DOMString SVGViewSpecImpl::transformString() const
-{
- return m_transformString;
-}
-
-DOM::DOMString SVGViewSpecImpl::viewTargetString() const
-{
- return m_viewTargetString;
-}
-
-bool SVGViewSpecImpl::parseViewSpec(const TQString &s)
-{
- if(!s.startsWith("svgView("))
- return false;
-
- // remove 'svgView(' and ')'
- TQStringList subAttrs = TQStringList::split(';', s.mid(8));
-
- for(TQStringList::ConstIterator it = subAttrs.begin() ; it != subAttrs.end(); ++it)
- {
- if((*it).startsWith("viewBox("))
- m_viewBoxString = (*it).mid(8);
- else if((*it).startsWith("zoomAndPan("))
- parseZoomAndPan(DOM::DOMString((*it).mid(11)));
- else if((*it).startsWith("preserveAspectRatio("))
- m_preserveAspectRatioString = (*it).mid(20);
- }
- return true;
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGViewSpecImpl.cpp b/ksvg/impl/SVGViewSpecImpl.cpp
new file mode 100644
index 00000000..ff42db43
--- /dev/null
+++ b/ksvg/impl/SVGViewSpecImpl.cpp
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include <tqstringlist.h>
+
+#include "SVGElementImpl.h"
+#include "SVGViewSpecImpl.h"
+#include "SVGTransformListImpl.h"
+
+using namespace KSVG;
+
+SVGViewSpecImpl::SVGViewSpecImpl() : SVGZoomAndPanImpl(), SVGFitToViewBoxImpl()
+{
+ m_transform = new SVGTransformListImpl();
+ m_transform->ref();
+
+ m_viewTarget = new SVGElementImpl(0);
+ m_viewTarget->ref();
+}
+
+SVGViewSpecImpl::~SVGViewSpecImpl()
+{
+ if(m_transform)
+ m_transform->deref();
+ if(m_viewTarget)
+ m_viewTarget->deref();
+}
+
+SVGTransformListImpl *SVGViewSpecImpl::transform() const
+{
+ return m_transform;
+}
+
+SVGElementImpl *SVGViewSpecImpl::viewTarget() const
+{
+ return m_viewTarget;
+}
+
+DOM::DOMString SVGViewSpecImpl::viewBoxString() const
+{
+ return m_viewBoxString;
+}
+
+DOM::DOMString SVGViewSpecImpl::preserveAspectRatioString() const
+{
+ return m_preserveAspectRatioString;
+}
+
+DOM::DOMString SVGViewSpecImpl::transformString() const
+{
+ return m_transformString;
+}
+
+DOM::DOMString SVGViewSpecImpl::viewTargetString() const
+{
+ return m_viewTargetString;
+}
+
+bool SVGViewSpecImpl::parseViewSpec(const TQString &s)
+{
+ if(!s.startsWith("svgView("))
+ return false;
+
+ // remove 'svgView(' and ')'
+ TQStringList subAttrs = TQStringList::split(';', s.mid(8));
+
+ for(TQStringList::ConstIterator it = subAttrs.begin() ; it != subAttrs.end(); ++it)
+ {
+ if((*it).startsWith("viewBox("))
+ m_viewBoxString = (*it).mid(8);
+ else if((*it).startsWith("zoomAndPan("))
+ parseZoomAndPan(DOM::DOMString((*it).mid(11)));
+ else if((*it).startsWith("preserveAspectRatio("))
+ m_preserveAspectRatioString = (*it).mid(20);
+ }
+ return true;
+}
diff --git a/ksvg/impl/SVGViewSpecImpl.h b/ksvg/impl/SVGViewSpecImpl.h
index 2bdf849b..a20f2c18 100644
--- a/ksvg/impl/SVGViewSpecImpl.h
+++ b/ksvg/impl/SVGViewSpecImpl.h
@@ -65,5 +65,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGWindowImpl.cc b/ksvg/impl/SVGWindowImpl.cc
deleted file mode 100644
index c0e459c8..00000000
--- a/ksvg/impl/SVGWindowImpl.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "SVGWindowImpl.h"
-#include "SVGDocumentImpl.h"
-#include "SVGSVGElementImpl.h"
-#include "SVGEvent.h"
-#include "KSVGCanvas.h"
-#include <ksvg_ecma.h>
-#include <ksvg_scriptinterpreter.h>
-
-#include <tqstylesheet.h>
-
-#include <kurl.h>
-#include <tdemessagebox.h>
-#include <kinputdialog.h>
-#include <tdelocale.h>
-
-using namespace KSVG;
-
-
-SVGWindowImpl::SVGWindowImpl()
-{
- m_document = 0;
-}
-
-SVGWindowImpl::SVGWindowImpl(SVGDocumentImpl *doc)
-{
- m_document = doc;
- if(m_document)
- m_document->ref();
-}
-
-SVGWindowImpl::~SVGWindowImpl()
-{
- if(m_document)
- m_document->deref();
-}
-
-/*StyleSheet SVGWindowImpl::defaultStyleSheet() const
-{
- return m_defaultStyleSheet;
-}*/
-
-SVGDocumentImpl *SVGWindowImpl::document() const
-{
- return m_document;
-}
-
-DOM::Event SVGWindowImpl::evt() const
-{
- return KSVG::SVGEvent(m_document->ecmaEngine()->interpreter()->currentEvent());
-}
-
-long SVGWindowImpl::innerHeight() const
-{
- return m_document ? int(m_document->canvas()->height()) : -1;
-}
-
-long SVGWindowImpl::innerWidth() const
-{
- return m_document ? int(m_document->canvas()->width()) : -1;
-}
-
-void SVGWindowImpl::setSrc(const DOM::DOMString &/*src*/)
-{
- // TODO : make KURL, load and parse doc
-}
-
-DOM::DOMString SVGWindowImpl::src() const
-{
- if(!m_document)
- return DOM::DOMString();
- return m_document->baseUrl().prettyURL();
-}
-
-void SVGWindowImpl::clearInterval(long /*interval*/)
-{
-}
-
-void SVGWindowImpl::clearTimeout(long /*timeout*/)
-{
-}
-
-void SVGWindowImpl::getURL(const DOM::DOMString &/*uri*/, const DOM::EventListener &/*callback*/)
-{
-}
-
-/*DocumentFragment SVGWindowImpl::parseXML(const DOM::DOMString &source, const Document &document)
-{
-}*/
-
-void SVGWindowImpl::postURL(const DOM::DOMString &/*uri*/, const DOM::DOMString &/*data*/, const DOM::EventListener &/*callback*/, const DOM::DOMString &/*mimeType*/, const DOM::DOMString &/*contentEncoding*/)
-{
-}
-
-DOM::DOMString SVGWindowImpl::printNode(const DOM::Node &node, unsigned short level)
-{
- TQString ret;
- if(node.isNull()) return ret;
- SVGElementImpl *elem = m_document->getElementFromHandle(node.handle());
- if(node.nodeType() == DOM::Node::DOCUMENT_NODE)
- {
- ret += "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n" + printNode(node.firstChild()).string() + "\n";
- }
- else if(node.nodeType() == DOM::Node::TEXT_NODE)
- {
- printIndentation(ret, level);
- ret += node.nodeValue().string();
- }
- else if(elem)
- {
- printIndentation(ret, level);
- ret += "<" + elem->tagName().string();
- // handle attrs
- TQDictIterator<DOM::DOMString> it(elem->attributes());
- for(;it.current(); ++it)
- ret += " " + it.currentKey() + "=\"" + it.current()->string() + '\"';
- if(elem->firstChild().isNull()) // no children
- ret += " />\n";
- else // handle children
- {
- ret += ">\n";
- for(DOM::Node child = node.firstChild();!child.isNull();child = child.nextSibling())
- ret += printNode(child, level + 1).string();
- printIndentation(ret, level);
- ret += "</" + elem->tagName().string() + ">\n";
- }
- }
- return ret;
-}
-
-void SVGWindowImpl::printIndentation(TQString &ret, unsigned short level, unsigned short indent)
-{
- for(int i = 0;i < indent * level;i++)
- ret += " ";
-}
-
-long SVGWindowImpl::setInterval(const DOM::DOMString &/*code*/, const long &/*delay*/)
-{
- return 0;
-}
-
-long SVGWindowImpl::setTimeout(const DOM::DOMString &/*code*/, const long &/*delay*/)
-{
- return 0;
-}
-
-void SVGWindowImpl::alert(const DOM::DOMString &message, const TQString &title)
-{
- KMessageBox::error(0L, TQStyleSheet::convertFromPlainText(message.string()), title);
-}
-
-bool SVGWindowImpl::confirm(const DOM::DOMString &message, const TQString &title)
-{
- return KMessageBox::warningContinueCancel(0L, TQStyleSheet::convertFromPlainText(message.string()), title, KStdGuiItem::ok()) == KMessageBox::Continue;
-}
-
-DOM::DOMString SVGWindowImpl::prompt(const DOM::DOMString &message, const DOM::DOMString &_default, const TQString &)
-{
- bool ok;
- TQString str;
- str = KInputDialog::getText(i18n("Prompt"), TQStyleSheet::convertFromPlainText(message.string()), _default.string(), &ok);
- if(ok)
- return str;
- else
- return "";
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGWindowImpl.cpp b/ksvg/impl/SVGWindowImpl.cpp
new file mode 100644
index 00000000..5edd4b4e
--- /dev/null
+++ b/ksvg/impl/SVGWindowImpl.cpp
@@ -0,0 +1,185 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "SVGWindowImpl.h"
+#include "SVGDocumentImpl.h"
+#include "SVGSVGElementImpl.h"
+#include "SVGEvent.h"
+#include "KSVGCanvas.h"
+#include <ksvg_ecma.h>
+#include <ksvg_scriptinterpreter.h>
+
+#include <tqstylesheet.h>
+
+#include <kurl.h>
+#include <tdemessagebox.h>
+#include <kinputdialog.h>
+#include <tdelocale.h>
+
+using namespace KSVG;
+
+
+SVGWindowImpl::SVGWindowImpl()
+{
+ m_document = 0;
+}
+
+SVGWindowImpl::SVGWindowImpl(SVGDocumentImpl *doc)
+{
+ m_document = doc;
+ if(m_document)
+ m_document->ref();
+}
+
+SVGWindowImpl::~SVGWindowImpl()
+{
+ if(m_document)
+ m_document->deref();
+}
+
+/*StyleSheet SVGWindowImpl::defaultStyleSheet() const
+{
+ return m_defaultStyleSheet;
+}*/
+
+SVGDocumentImpl *SVGWindowImpl::document() const
+{
+ return m_document;
+}
+
+DOM::Event SVGWindowImpl::evt() const
+{
+ return KSVG::SVGEvent(m_document->ecmaEngine()->interpreter()->currentEvent());
+}
+
+long SVGWindowImpl::innerHeight() const
+{
+ return m_document ? int(m_document->canvas()->height()) : -1;
+}
+
+long SVGWindowImpl::innerWidth() const
+{
+ return m_document ? int(m_document->canvas()->width()) : -1;
+}
+
+void SVGWindowImpl::setSrc(const DOM::DOMString &/*src*/)
+{
+ // TODO : make KURL, load and parse doc
+}
+
+DOM::DOMString SVGWindowImpl::src() const
+{
+ if(!m_document)
+ return DOM::DOMString();
+ return m_document->baseUrl().prettyURL();
+}
+
+void SVGWindowImpl::clearInterval(long /*interval*/)
+{
+}
+
+void SVGWindowImpl::clearTimeout(long /*timeout*/)
+{
+}
+
+void SVGWindowImpl::getURL(const DOM::DOMString &/*uri*/, const DOM::EventListener &/*callback*/)
+{
+}
+
+/*DocumentFragment SVGWindowImpl::parseXML(const DOM::DOMString &source, const Document &document)
+{
+}*/
+
+void SVGWindowImpl::postURL(const DOM::DOMString &/*uri*/, const DOM::DOMString &/*data*/, const DOM::EventListener &/*callback*/, const DOM::DOMString &/*mimeType*/, const DOM::DOMString &/*contentEncoding*/)
+{
+}
+
+DOM::DOMString SVGWindowImpl::printNode(const DOM::Node &node, unsigned short level)
+{
+ TQString ret;
+ if(node.isNull()) return ret;
+ SVGElementImpl *elem = m_document->getElementFromHandle(node.handle());
+ if(node.nodeType() == DOM::Node::DOCUMENT_NODE)
+ {
+ ret += "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n" + printNode(node.firstChild()).string() + "\n";
+ }
+ else if(node.nodeType() == DOM::Node::TEXT_NODE)
+ {
+ printIndentation(ret, level);
+ ret += node.nodeValue().string();
+ }
+ else if(elem)
+ {
+ printIndentation(ret, level);
+ ret += "<" + elem->tagName().string();
+ // handle attrs
+ TQDictIterator<DOM::DOMString> it(elem->attributes());
+ for(;it.current(); ++it)
+ ret += " " + it.currentKey() + "=\"" + it.current()->string() + '\"';
+ if(elem->firstChild().isNull()) // no children
+ ret += " />\n";
+ else // handle children
+ {
+ ret += ">\n";
+ for(DOM::Node child = node.firstChild();!child.isNull();child = child.nextSibling())
+ ret += printNode(child, level + 1).string();
+ printIndentation(ret, level);
+ ret += "</" + elem->tagName().string() + ">\n";
+ }
+ }
+ return ret;
+}
+
+void SVGWindowImpl::printIndentation(TQString &ret, unsigned short level, unsigned short indent)
+{
+ for(int i = 0;i < indent * level;i++)
+ ret += " ";
+}
+
+long SVGWindowImpl::setInterval(const DOM::DOMString &/*code*/, const long &/*delay*/)
+{
+ return 0;
+}
+
+long SVGWindowImpl::setTimeout(const DOM::DOMString &/*code*/, const long &/*delay*/)
+{
+ return 0;
+}
+
+void SVGWindowImpl::alert(const DOM::DOMString &message, const TQString &title)
+{
+ KMessageBox::error(0L, TQStyleSheet::convertFromPlainText(message.string()), title);
+}
+
+bool SVGWindowImpl::confirm(const DOM::DOMString &message, const TQString &title)
+{
+ return KMessageBox::warningContinueCancel(0L, TQStyleSheet::convertFromPlainText(message.string()), title, KStdGuiItem::ok()) == KMessageBox::Continue;
+}
+
+DOM::DOMString SVGWindowImpl::prompt(const DOM::DOMString &message, const DOM::DOMString &_default, const TQString &)
+{
+ bool ok;
+ TQString str;
+ str = KInputDialog::getText(i18n("Prompt"), TQStyleSheet::convertFromPlainText(message.string()), _default.string(), &ok);
+ if(ok)
+ return str;
+ else
+ return "";
+}
diff --git a/ksvg/impl/SVGWindowImpl.h b/ksvg/impl/SVGWindowImpl.h
index 72e95741..caaf8030 100644
--- a/ksvg/impl/SVGWindowImpl.h
+++ b/ksvg/impl/SVGWindowImpl.h
@@ -69,5 +69,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGZoomAndPanImpl.cc b/ksvg/impl/SVGZoomAndPanImpl.cc
deleted file mode 100644
index f3bf96ce..00000000
--- a/ksvg/impl/SVGZoomAndPanImpl.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-
-#include "SVGZoomAndPan.h"
-#include "SVGZoomAndPanImpl.h"
-
-using namespace KSVG;
-
-#include "SVGZoomAndPanImpl.lut.h"
-#include "ksvg_scriptinterpreter.h"
-#include "ksvg_bridge.h"
-#include "ksvg_cacheimpl.h"
-
-SVGZoomAndPanImpl::SVGZoomAndPanImpl()
-{
- KSVG_EMPTY_FLAGS
-
- m_zoomAndPan = SVG_ZOOMANDPAN_MAGNIFY;
-}
-
-SVGZoomAndPanImpl::~SVGZoomAndPanImpl()
-{
-}
-
-void SVGZoomAndPanImpl::setZoomAndPan(unsigned short zoomAndPan)
-{
- m_zoomAndPan = zoomAndPan;
-}
-
-unsigned short SVGZoomAndPanImpl::zoomAndPan() const
-{
- return m_zoomAndPan;
-}
-
-void SVGZoomAndPanImpl::parseZoomAndPan(const DOM::DOMString &attr)
-{
- if(attr == "disable")
- m_zoomAndPan = SVG_ZOOMANDPAN_DISABLE;
-}
-
-// Ecma stuff
-
-/*
-@namespace KSVG
-@begin SVGZoomAndPanImpl::s_hashTable 2
- zoomAndPan SVGZoomAndPanImpl::ZoomAndPan DontDelete
-@end
-*/
-
-Value SVGZoomAndPanImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case ZoomAndPan:
- return Number(zoomAndPan());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return KJS::Undefined();
- }
-}
-
-void SVGZoomAndPanImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
-{
- switch(token)
- {
- case ZoomAndPan:
- parseZoomAndPan(value.toString(exec).string());
- break;
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- }
-}
-
-/*
-@namespace KSVG
-@begin SVGZoomAndPanImplConstructor::s_hashTable 5
- SVG_ZOOMANDPAN_UNKNOWN KSVG::SVG_ZOOMANDPAN_UNKNOWN DontDelete|ReadOnly
- SVG_ZOOMANDPAN_DISABLE KSVG::SVG_ZOOMANDPAN_DISABLE DontDelete|ReadOnly
- SVG_ZOOMANDPAN_MAGNIFY KSVG::SVG_ZOOMANDPAN_MAGNIFY DontDelete|ReadOnly
-@end
-*/
-
-Value SVGZoomAndPanImplConstructor::getValueProperty(ExecState *, int token) const
-{
- return Number(token);
-}
-
-Value KSVG::getSVGZoomAndPanImplConstructor(ExecState *exec)
-{
- return cacheGlobalBridge<SVGZoomAndPanImplConstructor>(exec, "[[svgzoomandpan.constructor]]");
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGZoomAndPanImpl.cpp b/ksvg/impl/SVGZoomAndPanImpl.cpp
new file mode 100644
index 00000000..c632a4dc
--- /dev/null
+++ b/ksvg/impl/SVGZoomAndPanImpl.cpp
@@ -0,0 +1,110 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+
+#include "SVGZoomAndPan.h"
+#include "SVGZoomAndPanImpl.h"
+
+using namespace KSVG;
+
+#include "SVGZoomAndPanImpl.lut.h"
+#include "ksvg_scriptinterpreter.h"
+#include "ksvg_bridge.h"
+#include "ksvg_cacheimpl.h"
+
+SVGZoomAndPanImpl::SVGZoomAndPanImpl()
+{
+ KSVG_EMPTY_FLAGS
+
+ m_zoomAndPan = SVG_ZOOMANDPAN_MAGNIFY;
+}
+
+SVGZoomAndPanImpl::~SVGZoomAndPanImpl()
+{
+}
+
+void SVGZoomAndPanImpl::setZoomAndPan(unsigned short zoomAndPan)
+{
+ m_zoomAndPan = zoomAndPan;
+}
+
+unsigned short SVGZoomAndPanImpl::zoomAndPan() const
+{
+ return m_zoomAndPan;
+}
+
+void SVGZoomAndPanImpl::parseZoomAndPan(const DOM::DOMString &attr)
+{
+ if(attr == "disable")
+ m_zoomAndPan = SVG_ZOOMANDPAN_DISABLE;
+}
+
+// Ecma stuff
+
+/*
+@namespace KSVG
+@begin SVGZoomAndPanImpl::s_hashTable 2
+ zoomAndPan SVGZoomAndPanImpl::ZoomAndPan DontDelete
+@end
+*/
+
+Value SVGZoomAndPanImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case ZoomAndPan:
+ return Number(zoomAndPan());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return KJS::Undefined();
+ }
+}
+
+void SVGZoomAndPanImpl::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value &value, int)
+{
+ switch(token)
+ {
+ case ZoomAndPan:
+ parseZoomAndPan(value.toString(exec).string());
+ break;
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ }
+}
+
+/*
+@namespace KSVG
+@begin SVGZoomAndPanImplConstructor::s_hashTable 5
+ SVG_ZOOMANDPAN_UNKNOWN KSVG::SVG_ZOOMANDPAN_UNKNOWN DontDelete|ReadOnly
+ SVG_ZOOMANDPAN_DISABLE KSVG::SVG_ZOOMANDPAN_DISABLE DontDelete|ReadOnly
+ SVG_ZOOMANDPAN_MAGNIFY KSVG::SVG_ZOOMANDPAN_MAGNIFY DontDelete|ReadOnly
+@end
+*/
+
+Value SVGZoomAndPanImplConstructor::getValueProperty(ExecState *, int token) const
+{
+ return Number(token);
+}
+
+Value KSVG::getSVGZoomAndPanImplConstructor(ExecState *exec)
+{
+ return cacheGlobalBridge<SVGZoomAndPanImplConstructor>(exec, "[[svgzoomandpan.constructor]]");
+}
diff --git a/ksvg/impl/SVGZoomAndPanImpl.h b/ksvg/impl/SVGZoomAndPanImpl.h
index ed7fef98..e62b6003 100644
--- a/ksvg/impl/SVGZoomAndPanImpl.h
+++ b/ksvg/impl/SVGZoomAndPanImpl.h
@@ -72,5 +72,3 @@ KJS::Value getSVGZoomAndPanImplConstructor(KJS::ExecState *exec);
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGZoomEventImpl.cc b/ksvg/impl/SVGZoomEventImpl.cc
deleted file mode 100644
index 448309f0..00000000
--- a/ksvg/impl/SVGZoomEventImpl.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- Copyright (C) 2001-2003 KSVG Team
- This file is part of the KDE project
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <kdebug.h>
-#include "SVGRectImpl.h"
-#include "SVGPointImpl.h"
-#include "SVGZoomEventImpl.h"
-
-using namespace KSVG;
-
-#include "SVGZoomEventImpl.lut.h"
-#include "SVGSVGElementImpl.h"
-
-using namespace KJS;
-
-SVGZoomEventImpl::SVGZoomEventImpl(SVGEvent::EventId _id,
- bool canBubbleArg,
- bool cancelableArg,
- DOM::AbstractView &viewArg,
- long detailArg,
- float previousScale, SVGPointImpl *previousTranslate,
- float newScale, SVGPointImpl *newTranslate)
-: SVGUIEventImpl(_id, canBubbleArg, cancelableArg, viewArg, detailArg), m_previousScale( previousScale ), m_newScale( newScale )
-{
- m_zoomRectScreen = SVGSVGElementImpl::createSVGRect();
- m_previousTranslate = previousTranslate;
- if(m_previousTranslate)
- m_previousTranslate->ref();
- m_newTranslate = newTranslate;
- if(m_newTranslate)
- m_newTranslate->ref();
-}
-
-SVGZoomEventImpl::~SVGZoomEventImpl()
-{
- if(m_zoomRectScreen)
- m_zoomRectScreen->deref();
- if(m_previousTranslate)
- m_previousTranslate->deref();
- if(m_newTranslate)
- m_newTranslate->deref();
-}
-
-SVGRectImpl *SVGZoomEventImpl::zoomRectScreen() const
-{
- return m_zoomRectScreen;
-}
-
-float SVGZoomEventImpl::previousScale() const
-{
- return m_previousScale;
-}
-
-SVGPointImpl *SVGZoomEventImpl::previousTranslate() const
-{
- return m_previousTranslate;
-}
-
-float SVGZoomEventImpl::newScale() const
-{
- return m_newScale;
-}
-
-SVGPointImpl *SVGZoomEventImpl::newTranslate() const
-{
- return m_newTranslate;
-}
-
-/*
-@namespace KSVG
-@begin SVGZoomEventImpl::s_hashTable 7
- zoomRectScreen SVGZoomEventImpl::ZoomRectScreen DontDelete|ReadOnly
- previousScale SVGZoomEventImpl::PreviousScale DontDelete|ReadOnly
- previousTranslate SVGZoomEventImpl::PreviousTranslate DontDelete|ReadOnly
- newScale SVGZoomEventImpl::NewScale DontDelete|ReadOnly
- newTranslate SVGZoomEventImpl::NewTranslate DontDelete|ReadOnly
-@end
-*/
-
-Value SVGZoomEventImpl::getValueProperty(ExecState *, int token) const
-{
- switch(token)
- {
- case PreviousScale:
- return Number(previousScale());
- case NewScale:
- return Number(newScale());
- default:
- kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
- return Undefined();
- }
-}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/SVGZoomEventImpl.cpp b/ksvg/impl/SVGZoomEventImpl.cpp
new file mode 100644
index 00000000..0164779c
--- /dev/null
+++ b/ksvg/impl/SVGZoomEventImpl.cpp
@@ -0,0 +1,109 @@
+/*
+ Copyright (C) 2001-2003 KSVG Team
+ This file is part of the KDE project
+
+ 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., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "SVGRectImpl.h"
+#include "SVGPointImpl.h"
+#include "SVGZoomEventImpl.h"
+
+using namespace KSVG;
+
+#include "SVGZoomEventImpl.lut.h"
+#include "SVGSVGElementImpl.h"
+
+using namespace KJS;
+
+SVGZoomEventImpl::SVGZoomEventImpl(SVGEvent::EventId _id,
+ bool canBubbleArg,
+ bool cancelableArg,
+ DOM::AbstractView &viewArg,
+ long detailArg,
+ float previousScale, SVGPointImpl *previousTranslate,
+ float newScale, SVGPointImpl *newTranslate)
+: SVGUIEventImpl(_id, canBubbleArg, cancelableArg, viewArg, detailArg), m_previousScale( previousScale ), m_newScale( newScale )
+{
+ m_zoomRectScreen = SVGSVGElementImpl::createSVGRect();
+ m_previousTranslate = previousTranslate;
+ if(m_previousTranslate)
+ m_previousTranslate->ref();
+ m_newTranslate = newTranslate;
+ if(m_newTranslate)
+ m_newTranslate->ref();
+}
+
+SVGZoomEventImpl::~SVGZoomEventImpl()
+{
+ if(m_zoomRectScreen)
+ m_zoomRectScreen->deref();
+ if(m_previousTranslate)
+ m_previousTranslate->deref();
+ if(m_newTranslate)
+ m_newTranslate->deref();
+}
+
+SVGRectImpl *SVGZoomEventImpl::zoomRectScreen() const
+{
+ return m_zoomRectScreen;
+}
+
+float SVGZoomEventImpl::previousScale() const
+{
+ return m_previousScale;
+}
+
+SVGPointImpl *SVGZoomEventImpl::previousTranslate() const
+{
+ return m_previousTranslate;
+}
+
+float SVGZoomEventImpl::newScale() const
+{
+ return m_newScale;
+}
+
+SVGPointImpl *SVGZoomEventImpl::newTranslate() const
+{
+ return m_newTranslate;
+}
+
+/*
+@namespace KSVG
+@begin SVGZoomEventImpl::s_hashTable 7
+ zoomRectScreen SVGZoomEventImpl::ZoomRectScreen DontDelete|ReadOnly
+ previousScale SVGZoomEventImpl::PreviousScale DontDelete|ReadOnly
+ previousTranslate SVGZoomEventImpl::PreviousTranslate DontDelete|ReadOnly
+ newScale SVGZoomEventImpl::NewScale DontDelete|ReadOnly
+ newTranslate SVGZoomEventImpl::NewTranslate DontDelete|ReadOnly
+@end
+*/
+
+Value SVGZoomEventImpl::getValueProperty(ExecState *, int token) const
+{
+ switch(token)
+ {
+ case PreviousScale:
+ return Number(previousScale());
+ case NewScale:
+ return Number(newScale());
+ default:
+ kdWarning() << "Unhandled token in " << k_funcinfo << " : " << token << endl;
+ return Undefined();
+ }
+}
diff --git a/ksvg/impl/SVGZoomEventImpl.h b/ksvg/impl/SVGZoomEventImpl.h
index 41706a37..375d0782 100644
--- a/ksvg/impl/SVGZoomEventImpl.h
+++ b/ksvg/impl/SVGZoomEventImpl.h
@@ -73,5 +73,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Affine.cpp b/ksvg/impl/libs/libtext2path/src/Affine.cpp
index d06b53bc..8486b983 100644
--- a/ksvg/impl/libs/libtext2path/src/Affine.cpp
+++ b/ksvg/impl/libs/libtext2path/src/Affine.cpp
@@ -170,5 +170,3 @@ double *Affine::data()
{
return m_affine;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Affine.h b/ksvg/impl/libs/libtext2path/src/Affine.h
index c0f11e9b..ef3435f9 100644
--- a/ksvg/impl/libs/libtext2path/src/Affine.h
+++ b/ksvg/impl/libs/libtext2path/src/Affine.h
@@ -63,5 +63,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/BezierPath.h b/ksvg/impl/libs/libtext2path/src/BezierPath.h
index 1c357abd..2526ee6c 100644
--- a/ksvg/impl/libs/libtext2path/src/BezierPath.h
+++ b/ksvg/impl/libs/libtext2path/src/BezierPath.h
@@ -52,5 +52,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/CMakeLists.txt b/ksvg/impl/libs/libtext2path/src/CMakeLists.txt
index 098f836d..29ab129e 100644
--- a/ksvg/impl/libs/libtext2path/src/CMakeLists.txt
+++ b/ksvg/impl/libs/libtext2path/src/CMakeLists.txt
@@ -46,4 +46,4 @@ tde_add_library( text2path SHARED
VERSION 0.0.0
LINK ${FREETYPE_LIBRARIES} ${FRIBIDI_LIBRARIES} ${FONTCONFIG_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}
-) \ No newline at end of file
+)
diff --git a/ksvg/impl/libs/libtext2path/src/Cache.h b/ksvg/impl/libs/libtext2path/src/Cache.h
index a85fdf92..531135e0 100644
--- a/ksvg/impl/libs/libtext2path/src/Cache.h
+++ b/ksvg/impl/libs/libtext2path/src/Cache.h
@@ -25,8 +25,7 @@
#include <string>
#include <vector>
#include <iostream>
-
-#include "myboost/shared_ptr.hpp"
+#include <memory>
namespace T2P
{
@@ -50,7 +49,7 @@ namespace T2P
class Cache
{
public:
- typedef myboost::shared_ptr<T> SharedT;
+ typedef std::shared_ptr<T> SharedT;
Cache(int maxSize = 10) : m_size(0), m_maxSize(maxSize) { }
~Cache() { clear(); }
@@ -152,5 +151,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Converter.cpp b/ksvg/impl/libs/libtext2path/src/Converter.cpp
index 59ab8e5c..6434798e 100644
--- a/ksvg/impl/libs/libtext2path/src/Converter.cpp
+++ b/ksvg/impl/libs/libtext2path/src/Converter.cpp
@@ -22,7 +22,6 @@
#include <math.h>
-#include "myboost/shared_ptr.hpp"
#include <fontconfig/fontconfig.h>
#include <fribidi/fribidi.h>
@@ -509,4 +508,3 @@ std::string Converter::cacheGlyphKey(const GlyphRenderParams *params) const
// std::cout << "Glyph cache key: " << key << std::endl;
return key;
}
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Converter.h b/ksvg/impl/libs/libtext2path/src/Converter.h
index d6e19521..7f76533f 100644
--- a/ksvg/impl/libs/libtext2path/src/Converter.h
+++ b/ksvg/impl/libs/libtext2path/src/Converter.h
@@ -44,8 +44,8 @@ namespace T2P
class GlyphLayoutParams;
class GlyphRenderParams;
- typedef myboost::shared_ptr<Font> SharedFont;
- typedef myboost::shared_ptr<Glyph> SharedGlyph;
+ typedef std::shared_ptr<Font> SharedFont;
+ typedef std::shared_ptr<Glyph> SharedGlyph;
class Converter
{
@@ -90,5 +90,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Font.cpp b/ksvg/impl/libs/libtext2path/src/Font.cpp
index 1d6f7005..a9db7113 100644
--- a/ksvg/impl/libs/libtext2path/src/Font.cpp
+++ b/ksvg/impl/libs/libtext2path/src/Font.cpp
@@ -248,5 +248,3 @@ const FontVisualParams *Font::fontParams() const
{
return m_fontParams;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Font.h b/ksvg/impl/libs/libtext2path/src/Font.h
index 72844285..fc3435f9 100644
--- a/ksvg/impl/libs/libtext2path/src/Font.h
+++ b/ksvg/impl/libs/libtext2path/src/Font.h
@@ -87,5 +87,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Glyph.cpp b/ksvg/impl/libs/libtext2path/src/Glyph.cpp
index d2e16189..76390e08 100644
--- a/ksvg/impl/libs/libtext2path/src/Glyph.cpp
+++ b/ksvg/impl/libs/libtext2path/src/Glyph.cpp
@@ -348,5 +348,3 @@ void GlyphRenderParams::setCharacter(unsigned short character)
{
m_character = character;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Glyph.h b/ksvg/impl/libs/libtext2path/src/Glyph.h
index b3bd3fb5..9cc58871 100644
--- a/ksvg/impl/libs/libtext2path/src/Glyph.h
+++ b/ksvg/impl/libs/libtext2path/src/Glyph.h
@@ -194,5 +194,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/GlyphTracer.cpp b/ksvg/impl/libs/libtext2path/src/GlyphTracer.cpp
index 42457553..175311c2 100644
--- a/ksvg/impl/libs/libtext2path/src/GlyphTracer.cpp
+++ b/ksvg/impl/libs/libtext2path/src/GlyphTracer.cpp
@@ -72,5 +72,3 @@ FT_Outline_Funcs *GlyphTracer::outlineFuncs()
m_outlineMethods = ret;
return m_outlineMethods;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/GlyphTracer.h b/ksvg/impl/libs/libtext2path/src/GlyphTracer.h
index 7607ecad..d7ca5ea2 100644
--- a/ksvg/impl/libs/libtext2path/src/GlyphTracer.h
+++ b/ksvg/impl/libs/libtext2path/src/GlyphTracer.h
@@ -61,5 +61,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Point.h b/ksvg/impl/libs/libtext2path/src/Point.h
index d95742a2..9e379820 100644
--- a/ksvg/impl/libs/libtext2path/src/Point.h
+++ b/ksvg/impl/libs/libtext2path/src/Point.h
@@ -61,5 +61,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/QtUnicode.h b/ksvg/impl/libs/libtext2path/src/QtUnicode.h
index 29714502..671d71f0 100644
--- a/ksvg/impl/libs/libtext2path/src/QtUnicode.h
+++ b/ksvg/impl/libs/libtext2path/src/QtUnicode.h
@@ -145,5 +145,3 @@ else \
script = (T2P::Script) QtUnicode::scriptForChar(c);
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Rectangle.cpp b/ksvg/impl/libs/libtext2path/src/Rectangle.cpp
index ef59d6be..679eeef2 100644
--- a/ksvg/impl/libs/libtext2path/src/Rectangle.cpp
+++ b/ksvg/impl/libs/libtext2path/src/Rectangle.cpp
@@ -98,5 +98,3 @@ void Rectangle::bboxUnion(const Rectangle &src1, const Rectangle &src2)
setB(Point(T2PMAX(src1x1, src2x1), T2PMAX(src1y1, src2y1)));
}
}
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Rectangle.h b/ksvg/impl/libs/libtext2path/src/Rectangle.h
index 1a5eeeb1..ed173456 100644
--- a/ksvg/impl/libs/libtext2path/src/Rectangle.h
+++ b/ksvg/impl/libs/libtext2path/src/Rectangle.h
@@ -51,5 +51,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/Tools.h b/ksvg/impl/libs/libtext2path/src/Tools.h
index 6bf33bf7..50adfd49 100644
--- a/ksvg/impl/libs/libtext2path/src/Tools.h
+++ b/ksvg/impl/libs/libtext2path/src/Tools.h
@@ -76,5 +76,3 @@ namespace T2P
#endif
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/impl/libs/libtext2path/src/myboost/assert.hpp b/ksvg/impl/libs/libtext2path/src/myboost/assert.hpp
deleted file mode 100644
index 3f3c61c2..00000000
--- a/ksvg/impl/libs/libtext2path/src/myboost/assert.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// boost/assert.hpp - BOOST_ASSERT(expr)
-//
-// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
-//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-// Note: There are no include guards. This is intentional.
-//
-// See http://www.boost.org/libs/utility/assert.html for documentation.
-//
-
-#ifndef ASSERT_HPP
-#define ASSERT_HPP
-
-#undef BOOST_ASSERT
-
-# include <assert.h>
-# define BOOST_ASSERT(expr) assert(expr)
-
-#endif
diff --git a/ksvg/impl/libs/libtext2path/src/myboost/checked_delete.hpp b/ksvg/impl/libs/libtext2path/src/myboost/checked_delete.hpp
deleted file mode 100644
index 73afd5f5..00000000
--- a/ksvg/impl/libs/libtext2path/src/myboost/checked_delete.hpp
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
-#define BOOST_CHECKED_DELETE_HPP_INCLUDED
-
-//
-// boost/checked_delete.hpp
-//
-// Copyright (c) 1999, 2000, 2001, 2002 boost.org
-// Copyright (c) 2002, 2003 Peter Dimov
-//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-// See http://www.boost.org/libs/utility/checked_delete.html for documentation.
-//
-
-namespace myboost
-{
-
-// verify that types are complete for increased safety
-
-template<class T> inline void checked_delete(T * x)
-{
- // Intel 7 accepts sizeof(incomplete) as 0 in system headers
- typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
- delete x;
-}
-
-template<class T> inline void checked_array_delete(T * x)
-{
- typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
- delete [] x;
-}
-
-template<class T> struct checked_deleter
-{
- typedef void result_type;
- typedef T * argument_type;
-
- void operator()(T * x) const
- {
- // boost:: disables ADL
- myboost::checked_delete(x);
- }
-};
-
-template<class T> struct checked_array_deleter
-{
- typedef void result_type;
- typedef T * argument_type;
-
- void operator()(T * x) const
- {
- myboost::checked_array_delete(x);
- }
-};
-
-} // namespace myboost
-
-#endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
diff --git a/ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.hpp b/ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.hpp
deleted file mode 100644
index 10db127c..00000000
--- a/ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
-#define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
-
-//
-// boost/detail/lwm_pthreads.hpp
-//
-// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
-//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-
-#include <pthread.h>
-
-namespace myboost
-{
-
-namespace detail
-{
-
-class lightweight_mutex
-{
-private:
-
- pthread_mutex_t m_;
-
- lightweight_mutex(lightweight_mutex const &);
- lightweight_mutex & operator=(lightweight_mutex const &);
-
-public:
-
- lightweight_mutex()
- {
- pthread_mutex_init(&m_, 0);
- }
-
- ~lightweight_mutex()
- {
- pthread_mutex_destroy(&m_);
- }
-
- class scoped_lock;
- friend class scoped_lock;
-
- class scoped_lock
- {
- private:
-
- pthread_mutex_t & m_;
-
- scoped_lock(scoped_lock const &);
- scoped_lock & operator=(scoped_lock const &);
-
- public:
-
- scoped_lock(lightweight_mutex & m): m_(m.m_)
- {
- pthread_mutex_lock(&m_);
- }
-
- ~scoped_lock()
- {
- pthread_mutex_unlock(&m_);
- }
- };
-};
-
-} // namespace detail
-
-} // namespace myboost
-
-#endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
diff --git a/ksvg/impl/libs/libtext2path/src/myboost/shared_count.hpp b/ksvg/impl/libs/libtext2path/src/myboost/shared_count.hpp
deleted file mode 100644
index e8ec19a8..00000000
--- a/ksvg/impl/libs/libtext2path/src/myboost/shared_count.hpp
+++ /dev/null
@@ -1,367 +0,0 @@
-#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
-#define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
-
-//
-// detail/shared_count.hpp
-//
-// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
-//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-
-#include "myboost/checked_delete.hpp"
-#include "myboost/throw_exception.hpp"
-#include "myboost/lightweight_mutex.hpp"
-
-#include <memory> // std::auto_ptr, std::allocator
-#include <functional> // std::less
-#include <exception> // std::exception
-#include <new> // std::bad_alloc
-#include <typeinfo> // std::type_info in get_deleter
-#include <cstddef> // std::size_t
-
-namespace myboost
-{
-
-class bad_weak_ptr: public std::exception
-{
-public:
-
- virtual char const * what() const throw()
- {
- return "myboost::bad_weak_ptr";
- }
-};
-
-namespace detail
-{
-
-class sp_counted_base
-{
-private:
-
- typedef detail::lightweight_mutex mutex_type;
-
-public:
-
- sp_counted_base(): use_count_(1), weak_count_(1)
- {
- }
-
- virtual ~sp_counted_base() // nothrow
- {
- }
-
- // dispose() is called when use_count_ drops to zero, to release
- // the resources managed by *this.
-
- virtual void dispose() = 0; // nothrow
-
- // destruct() is called when weak_count_ drops to zero.
-
- virtual void destruct() // nothrow
- {
- delete this;
- }
-
- virtual void * get_deleter(std::type_info const & ti) = 0;
-
- void add_ref_copy()
- {
- mutex_type::scoped_lock lock(mtx_);
- ++use_count_;
- }
-
- void add_ref_lock()
- {
- mutex_type::scoped_lock lock(mtx_);
- if(use_count_ == 0) myboost::throw_exception(myboost::bad_weak_ptr());
- ++use_count_;
- }
-
- void release() // nothrow
- {
- {
- mutex_type::scoped_lock lock(mtx_);
- long new_use_count = --use_count_;
-
- if(new_use_count != 0) return;
- }
-
- dispose();
- weak_release();
- }
-
- void weak_add_ref() // nothrow
- {
- mutex_type::scoped_lock lock(mtx_);
- ++weak_count_;
- }
-
- void weak_release() // nothrow
- {
- long new_weak_count;
-
- {
- mutex_type::scoped_lock lock(mtx_);
- new_weak_count = --weak_count_;
- }
-
- if(new_weak_count == 0)
- {
- destruct();
- }
- }
-
- long use_count() const // nothrow
- {
- mutex_type::scoped_lock lock(mtx_);
- return use_count_;
- }
-
-private:
-
- sp_counted_base(sp_counted_base const &);
- sp_counted_base & operator= (sp_counted_base const &);
-
- long use_count_; // #shared
- long weak_count_; // #weak + (#shared != 0)
-
- mutable mutex_type mtx_;
-};
-
-template<class P, class D> class sp_counted_base_impl: public sp_counted_base
-{
-private:
-
- P ptr; // copy constructor must not throw
- D del; // copy constructor must not throw
-
- sp_counted_base_impl(sp_counted_base_impl const &);
- sp_counted_base_impl & operator= (sp_counted_base_impl const &);
-
- typedef sp_counted_base_impl<P, D> this_type;
-
-public:
-
- // pre: initial_use_count <= initial_weak_count, d(p) must not throw
-
- sp_counted_base_impl(P p, D d): ptr(p), del(d)
- {
- }
-
- virtual void dispose() // nothrow
- {
- del(ptr);
- }
-
- virtual void * get_deleter(std::type_info const & ti)
- {
- return ti == typeid(D)? &del: 0;
- }
-
- void * operator new(std::size_t)
- {
- return std::allocator<this_type>().allocate(1, static_cast<this_type *>(0));
- }
-
- void operator delete(void * p)
- {
- std::allocator<this_type>().deallocate(static_cast<this_type *>(p), 1);
- }
-};
-
-class weak_count;
-
-class shared_count
-{
-private:
-
- sp_counted_base * pi_;
-
- friend class weak_count;
-
-public:
-
- shared_count(): pi_(0) // nothrow
- {
- }
-
- template<class P, class D> shared_count(P p, D d): pi_(0)
- {
-
- try
- {
- pi_ = new sp_counted_base_impl<P, D>(p, d);
- }
- catch(...)
- {
- d(p); // delete p
- throw;
- }
-
-
- pi_ = new sp_counted_base_impl<P, D>(p, d);
-
- if(pi_ == 0)
- {
- d(p); // delete p
- myboost::throw_exception(std::bad_alloc());
- }
- }
-
- // auto_ptr<Y> is special cased to provide the strong guarantee
-
- template<class Y>
- explicit shared_count(std::auto_ptr<Y> & r): pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
- {
- r.release();
- }
-
- ~shared_count() // nothrow
- {
- if(pi_ != 0) pi_->release();
- }
-
- shared_count(shared_count const & r): pi_(r.pi_) // nothrow
- {
- if(pi_ != 0) pi_->add_ref_copy();
- }
-
- explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
-
- shared_count & operator= (shared_count const & r) // nothrow
- {
- sp_counted_base * tmp = r.pi_;
- if(tmp != 0) tmp->add_ref_copy();
- if(pi_ != 0) pi_->release();
- pi_ = tmp;
-
- return *this;
- }
-
- void swap(shared_count & r) // nothrow
- {
- sp_counted_base * tmp = r.pi_;
- r.pi_ = pi_;
- pi_ = tmp;
- }
-
- long use_count() const // nothrow
- {
- return pi_ != 0? pi_->use_count(): 0;
- }
-
- bool unique() const // nothrow
- {
- return use_count() == 1;
- }
-
- friend inline bool operator==(shared_count const & a, shared_count const & b)
- {
- return a.pi_ == b.pi_;
- }
-
- friend inline bool operator<(shared_count const & a, shared_count const & b)
- {
- return std::less<sp_counted_base *>()(a.pi_, b.pi_);
- }
-
- void * get_deleter(std::type_info const & ti) const
- {
- return pi_? pi_->get_deleter(ti): 0;
- }
-};
-
-class weak_count
-{
-private:
-
- sp_counted_base * pi_;
-
- friend class shared_count;
-
-public:
-
- weak_count(): pi_(0) // nothrow
- {
- }
-
- weak_count(shared_count const & r): pi_(r.pi_) // nothrow
- {
- if(pi_ != 0) pi_->weak_add_ref();
- }
-
- weak_count(weak_count const & r): pi_(r.pi_) // nothrow
- {
- if(pi_ != 0) pi_->weak_add_ref();
- }
-
- ~weak_count() // nothrow
- {
- if(pi_ != 0) pi_->weak_release();
- }
-
- weak_count & operator= (shared_count const & r) // nothrow
- {
- sp_counted_base * tmp = r.pi_;
- if(tmp != 0) tmp->weak_add_ref();
- if(pi_ != 0) pi_->weak_release();
- pi_ = tmp;
-
- return *this;
- }
-
- weak_count & operator= (weak_count const & r) // nothrow
- {
- sp_counted_base * tmp = r.pi_;
- if(tmp != 0) tmp->weak_add_ref();
- if(pi_ != 0) pi_->weak_release();
- pi_ = tmp;
-
- return *this;
- }
-
- void swap(weak_count & r) // nothrow
- {
- sp_counted_base * tmp = r.pi_;
- r.pi_ = pi_;
- pi_ = tmp;
- }
-
- long use_count() const // nothrow
- {
- return pi_ != 0? pi_->use_count(): 0;
- }
-
- friend inline bool operator==(weak_count const & a, weak_count const & b)
- {
- return a.pi_ == b.pi_;
- }
-
- friend inline bool operator<(weak_count const & a, weak_count const & b)
- {
- return std::less<sp_counted_base *>()(a.pi_, b.pi_);
- }
-};
-
-inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
-{
- if(pi_ != 0)
- {
- pi_->add_ref_lock();
- }
- else
- {
- myboost::throw_exception(myboost::bad_weak_ptr());
- }
-}
-
-} // namespace detail
-
-} // namespace myboost
-
-#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
diff --git a/ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.hpp b/ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.hpp
deleted file mode 100644
index 3f2fe30d..00000000
--- a/ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.hpp
+++ /dev/null
@@ -1,395 +0,0 @@
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
-#define BOOST_SHARED_PTR_HPP_INCLUDED
-
-// shared_ptr.hpp
-//
-// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
-// Copyright (c) 2001, 2002, 2003 Peter Dimov
-//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
-//
-
-#include "myboost/assert.hpp"
-#include "myboost/checked_delete.hpp"
-#include "myboost/throw_exception.hpp"
-#include "myboost/shared_count.hpp"
-
-#include <memory> // for std::auto_ptr
-#include <algorithm> // for std::swap
-#include <functional> // for std::less
-#include <typeinfo> // for std::bad_cast
-#include <iosfwd> // for std::basic_ostream
-
-namespace myboost
-{
-
-template<class T> class weak_ptr;
-template<class T> class enable_shared_from_this;
-
-namespace detail
-{
-
-struct static_cast_tag {};
-struct const_cast_tag {};
-struct dynamic_cast_tag {};
-struct polymorphic_cast_tag {};
-
-template<class T> struct shared_ptr_traits
-{
- typedef T & reference;
-};
-
-template<> struct shared_ptr_traits<void>
-{
- typedef void reference;
-};
-
-template<> struct shared_ptr_traits<void const>
-{
- typedef void reference;
-};
-
-template<> struct shared_ptr_traits<void volatile>
-{
- typedef void reference;
-};
-
-template<> struct shared_ptr_traits<void const volatile>
-{
- typedef void reference;
-};
-
-// enable_shared_from_this support
-
-template<class T, class Y> void sp_enable_shared_from_this(myboost::enable_shared_from_this<T> * pe, Y * px, shared_count const & pn)
-{
- if(pe != 0) pe->_internal_weak_this._internal_assign(px, pn);
-}
-
-inline void sp_enable_shared_from_this(void const *, void const *, shared_count const &)
-{
-}
-
-} // namespace detail
-
-
-//
-// shared_ptr
-//
-// An enhanced relative of scoped_ptr with reference counted copy semantics.
-// The object pointed to is deleted when the last shared_ptr pointing to it
-// is destroyed or reset.
-//
-
-template<class T> class shared_ptr
-{
-private:
-
- // Borland 5.5.1 specific workaround
- typedef shared_ptr<T> this_type;
-
-public:
-
- typedef T element_type;
- typedef T value_type;
- typedef T * pointer;
- typedef typename detail::shared_ptr_traits<T>::reference reference;
-
- shared_ptr(): px(0), pn() // never throws in 1.30+
- {
- }
-
- template<class Y>
- explicit shared_ptr(Y * p): px(p), pn(p, checked_deleter<Y>()) // Y must be complete
- {
- detail::sp_enable_shared_from_this(p, p, pn);
- }
-
- //
- // Requirements: D's copy constructor must not throw
- //
- // shared_ptr will release p by calling d(p)
- //
-
- template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
- {
- detail::sp_enable_shared_from_this(p, p, pn);
- }
-
-// generated copy constructor, assignment, destructor are fine...
-// except that Borland C++ has a bug, and g++ with -Wsynth warns
- shared_ptr & operator=(shared_ptr const & r) // never throws
- {
- px = r.px;
- pn = r.pn; // shared_count::op= doesn't throw
- return *this;
- }
-
- template<class Y>
- explicit shared_ptr(weak_ptr<Y> const & r): pn(r.pn) // may throw
- {
- // it is now safe to copy r.px, as pn(r.pn) did not throw
- px = r.px;
- }
-
- template<class Y>
- shared_ptr(shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
- {
- }
-
- template<class Y>
- shared_ptr(shared_ptr<Y> const & r, detail::static_cast_tag): px(static_cast<element_type *>(r.px)), pn(r.pn)
- {
- }
-
- template<class Y>
- shared_ptr(shared_ptr<Y> const & r, detail::const_cast_tag): px(const_cast<element_type *>(r.px)), pn(r.pn)
- {
- }
-
- template<class Y>
- shared_ptr(shared_ptr<Y> const & r, detail::dynamic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
- {
- if(px == 0) // need to allocate new counter -- the cast failed
- {
- pn = detail::shared_count();
- }
- }
-
- template<class Y>
- shared_ptr(shared_ptr<Y> const & r, detail::polymorphic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
- {
- if(px == 0)
- {
- myboost::throw_exception(std::bad_cast());
- }
- }
-
- template<class Y>
- explicit shared_ptr(std::auto_ptr<Y> & r): px(r.get()), pn()
- {
- Y * tmp = r.get();
- pn = detail::shared_count(r);
- detail::sp_enable_shared_from_this(tmp, tmp, pn);
- }
-
- template<class Y>
- shared_ptr & operator=(shared_ptr<Y> const & r) // never throws
- {
- px = r.px;
- pn = r.pn; // shared_count::op= doesn't throw
- return *this;
- }
-
- template<class Y>
- shared_ptr & operator=(std::auto_ptr<Y> & r)
- {
- this_type(r).swap(*this);
- return *this;
- }
-
- void reset() // never throws in 1.30+
- {
- this_type().swap(*this);
- }
-
- template<class Y> void reset(Y * p) // Y must be complete
- {
- BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors
- this_type(p).swap(*this);
- }
-
- template<class Y, class D> void reset(Y * p, D d)
- {
- this_type(p, d).swap(*this);
- }
-
- reference operator* () const // never throws
- {
- BOOST_ASSERT(px != 0);
- return *px;
- }
-
- T * operator-> () const // never throws
- {
- BOOST_ASSERT(px != 0);
- return px;
- }
-
- T * get() const // never throws
- {
- return px;
- }
-
- typedef T * (this_type::*unspecified_bool_type)() const;
-
- operator unspecified_bool_type() const // never throws
- {
- return px == 0? 0: &this_type::get;
- }
-
- // operator! is redundant, but some compilers need it
-
- bool operator! () const // never throws
- {
- return px == 0;
- }
-
- bool unique() const // never throws
- {
- return pn.unique();
- }
-
- long use_count() const // never throws
- {
- return pn.use_count();
- }
-
- void swap(shared_ptr<T> & other) // never throws
- {
- std::swap(px, other.px);
- pn.swap(other.pn);
- }
-
- template<class Y> bool _internal_less(shared_ptr<Y> const & rhs) const
- {
- return pn < rhs.pn;
- }
-
- void * _internal_get_deleter(std::type_info const & ti) const
- {
- return pn.get_deleter(ti);
- }
-
-// Tasteless as this may seem, making all members public allows member templates
-// to work in the absence of member template friends. (Matthew Langston)
-
-# if __GNUC__ >= 2 && __GNUC_MINOR__ >= 97
-private:
-
- template<class Y> friend class shared_ptr;
- template<class Y> friend class weak_ptr;
-#endif
-
- T * px; // contained pointer
- detail::shared_count pn; // reference counter
-
-}; // shared_ptr
-
-template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b)
-{
- return a.get() == b.get();
-}
-
-template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b)
-{
- return a.get() != b.get();
-}
-
-#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
-
-// Resolve the ambiguity between our op!= and the one in rel_ops
-
-template<class T> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<T> const & b)
-{
- return a.get() != b.get();
-}
-
-#endif
-
-template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b)
-{
- return a._internal_less(b);
-}
-
-template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b)
-{
- a.swap(b);
-}
-
-template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r)
-{
- return shared_ptr<T>(r, detail::static_cast_tag());
-}
-
-template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r)
-{
- return shared_ptr<T>(r, detail::const_cast_tag());
-}
-
-template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r)
-{
- return shared_ptr<T>(r, detail::dynamic_cast_tag());
-}
-
-// shared_*_cast names are deprecated. Use *_pointer_cast instead.
-
-template<class T, class U> shared_ptr<T> shared_static_cast(shared_ptr<U> const & r)
-{
- return shared_ptr<T>(r, detail::static_cast_tag());
-}
-
-template<class T, class U> shared_ptr<T> shared_dynamic_cast(shared_ptr<U> const & r)
-{
- return shared_ptr<T>(r, detail::dynamic_cast_tag());
-}
-
-template<class T, class U> shared_ptr<T> shared_polymorphic_cast(shared_ptr<U> const & r)
-{
- return shared_ptr<T>(r, detail::polymorphic_cast_tag());
-}
-
-template<class T, class U> shared_ptr<T> shared_polymorphic_downcast(shared_ptr<U> const & r)
-{
- BOOST_ASSERT(dynamic_cast<T *>(r.get()) == r.get());
- return shared_static_cast<T>(r);
-}
-
-// get_pointer() enables boost::mem_fn to recognize shared_ptr
-
-template<class T> inline T * get_pointer(shared_ptr<T> const & p)
-{
- return p.get();
-}
-
-// operator<<
-
-
-template<class Y> std::ostream & operator<< (std::ostream & os, shared_ptr<Y> const & p)
-{
- os << p.get();
- return os;
-}
-
-
-// get_deleter (experimental)
-
-#if (defined(__GNUC__) && (__GNUC__ < 3)) || (defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238))
-
-// g++ 2.9x doesn't allow static_cast<X const *>(void *)
-// apparently EDG 2.38 also doesn't accept it
-
-template<class D, class T> D * get_deleter(shared_ptr<T> const & p)
-{
- void const * q = p._internal_get_deleter(typeid(D));
- return const_cast<D *>(static_cast<D const *>(q));
-}
-
-#else
-
-template<class D, class T> D * get_deleter(shared_ptr<T> const & p)
-{
- return static_cast<D *>(p._internal_get_deleter(typeid(D)));
-}
-
-#endif
-
-} // namespace boost
-
-
-#endif // #ifndef BOOST_SHARED_PTR_HPP_INCLUDED
diff --git a/ksvg/impl/libs/libtext2path/src/myboost/throw_exception.hpp b/ksvg/impl/libs/libtext2path/src/myboost/throw_exception.hpp
deleted file mode 100644
index dd32ec43..00000000
--- a/ksvg/impl/libs/libtext2path/src/myboost/throw_exception.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
-#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
-
-
-//
-// boost/throw_exception.hpp
-//
-// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
-//
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-//
-// http://www.boost.org/libs/utility/throw_exception.html
-//
-
-# include <exception>
-
-namespace myboost
-{
-
-template<class E> void throw_exception(E const & e)
-{
- throw e;
-}
-
-} // namespace myboost
-
-#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
diff --git a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib-drawable.c b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib-drawable.c
index 3ed343c5..0beec611 100644
--- a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib-drawable.c
+++ b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib-drawable.c
@@ -1,4 +1,3 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GdkPixbuf library - convert X drawable information to RGB
*
* Copyright (C) 1999 Michael Zucchi
diff --git a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib.c b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib.c
index 8383246b..99ff4fdf 100644
--- a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib.c
+++ b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlib.c
@@ -22,6 +22,7 @@
#include <X11/Xlib.h>
/*#include <gdk-pixbuf/gdk-pixbuf-private.h>*/
#include "gdk-pixbuf-xlib-private.h"
+#include "gdk-pixbuf-xlibrgb.h"
Display *gdk_pixbuf_dpy = NULL;
int gdk_pixbuf_screen = -1;
diff --git a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.c b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.c
index eb7e4cdf..a580997a 100644
--- a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.c
+++ b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+/*
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "MPL"); you may not use this file except in
diff --git a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.h b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.h
index afde174e..63c4842f 100644
--- a/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.h
+++ b/ksvg/impl/libs/xrgbrender/gdk-pixbuf-xlibrgb.h
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+/*
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "MPL"); you may not use this file except in
diff --git a/ksvg/impl/svgpathparser.cc b/ksvg/impl/svgpathparser.cpp
index 87a03aca..87a03aca 100644
--- a/ksvg/impl/svgpathparser.cc
+++ b/ksvg/impl/svgpathparser.cpp
diff --git a/ksvg/plugin/CMakeLists.txt b/ksvg/plugin/CMakeLists.txt
index 08078eb5..a46cb8df 100644
--- a/ksvg/plugin/CMakeLists.txt
+++ b/ksvg/plugin/CMakeLists.txt
@@ -27,6 +27,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
+ ${ART_LIBRARY_DIRS}
)
@@ -39,9 +40,11 @@ install( FILES
##### other data ################################
-install( FILES
- ksvgplugin.desktop svgthumbnail.desktop
- DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE ksvgplugin.desktop svgthumbnail.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR ksvg-desktops
+)
install( FILES
ksvgplugin.rc
diff --git a/ksvg/plugin/backends/agg/AggCanvasFactory.cpp b/ksvg/plugin/backends/agg/AggCanvasFactory.cpp
index 368cb252..6261bbac 100644
--- a/ksvg/plugin/backends/agg/AggCanvasFactory.cpp
+++ b/ksvg/plugin/backends/agg/AggCanvasFactory.cpp
@@ -41,5 +41,3 @@ TQObject *AggCanvasFactory::createObject(TQObject *, const char *, const char *,
unsigned int height = (*args.at(0)).toUInt();
return new AggCanvas(width, height);
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/AggCanvasFactory.h b/ksvg/plugin/backends/agg/AggCanvasFactory.h
index d075d688..e0785460 100644
--- a/ksvg/plugin/backends/agg/AggCanvasFactory.h
+++ b/ksvg/plugin/backends/agg/AggCanvasFactory.h
@@ -41,5 +41,3 @@ public:
};
#endif
-
-/// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/AggCanvasItems.cpp b/ksvg/plugin/backends/agg/AggCanvasItems.cpp
index 1052edb8..dd089fcd 100644
--- a/ksvg/plugin/backends/agg/AggCanvasItems.cpp
+++ b/ksvg/plugin/backends/agg/AggCanvasItems.cpp
@@ -1743,5 +1743,3 @@ void AggPattern::render(AggCanvas *c)
c->m_ras.render(sl, rp);
}
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/AggCanvasItems.h b/ksvg/plugin/backends/agg/AggCanvasItems.h
index f6b1d44a..af456e72 100644
--- a/ksvg/plugin/backends/agg/AggCanvasItems.h
+++ b/ksvg/plugin/backends/agg/AggCanvasItems.h
@@ -496,5 +496,3 @@ namespace KSVG
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/BezierPathAgg.cpp b/ksvg/plugin/backends/agg/BezierPathAgg.cpp
index 10a75c1c..c956f92b 100644
--- a/ksvg/plugin/backends/agg/BezierPathAgg.cpp
+++ b/ksvg/plugin/backends/agg/BezierPathAgg.cpp
@@ -122,5 +122,3 @@ void BezierPathAgg::boundingBox(Point *topLeft, Point *bottomRight)
*topLeft = Point(x1, y1);
*bottomRight = Point(x2, y2);
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/BezierPathAgg.h b/ksvg/plugin/backends/agg/BezierPathAgg.h
index 21451aa9..47f0b0fb 100644
--- a/ksvg/plugin/backends/agg/BezierPathAgg.h
+++ b/ksvg/plugin/backends/agg/BezierPathAgg.h
@@ -79,5 +79,3 @@ namespace T2P
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/GlyphTracerAgg.cpp b/ksvg/plugin/backends/agg/GlyphTracerAgg.cpp
index 39b00146..c101620d 100644
--- a/ksvg/plugin/backends/agg/GlyphTracerAgg.cpp
+++ b/ksvg/plugin/backends/agg/GlyphTracerAgg.cpp
@@ -109,5 +109,3 @@ void GlyphTracerAgg::closePath(Glyph *glyph)
BezierPathAgg *bpath = static_cast<BezierPathAgg *>(glyph->modifiableBezierPath());
bpath->m_storage.close_polygon();
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/GlyphTracerAgg.h b/ksvg/plugin/backends/agg/GlyphTracerAgg.h
index 5fb24d4b..27298750 100644
--- a/ksvg/plugin/backends/agg/GlyphTracerAgg.h
+++ b/ksvg/plugin/backends/agg/GlyphTracerAgg.h
@@ -45,5 +45,3 @@ namespace T2P
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/agg/ksvgaggcanvas.desktop b/ksvg/plugin/backends/agg/ksvgaggcanvas.desktop
index 1efb8cff..d68c8134 100644
--- a/ksvg/plugin/backends/agg/ksvgaggcanvas.desktop
+++ b/ksvg/plugin/backends/agg/ksvgaggcanvas.desktop
@@ -4,98 +4,5 @@ X-TDE-ServiceTypes=KSVG/Renderer
X-TDE-Library=libksvgrendereragg
X-KSVG-InternalName=agg
Name=KSVG Rendering Backend - Anti Grain Geometry
-Name[ar]=خلفية رسم ل KSVG - هندسة Anti Grain
-Name[bs]=KSVG renderiranje - Anti Grain Geometry
-Name[ca]=Representació en segon pla de KSVG - Geometria anti gra
-Name[cs]=Vykreslovací nástroj KSVG - Anti Grain Geometry
-Name[cy]=Ôl-wyneb Llunio KSVG - Geometreg Wrth-Raen
-Name[da]=Underliggende program for KSVG-visning - antikorn geometri
-Name[de]=KSVG-Darstellungsmodul - Antikörnungs-Geometrie
-Name[el]= Σύστημα υποστήριξης αποτύπωσης του KSVG - Anti Grain Geometry
-Name[es]=Motor de procesado de KSVG - Geometría suavizada
-Name[et]=KSVG renderdamise taustarakendus - teralisusevastane geomeetria (AGG)
-Name[eu]=KSVG errendatze programa - Anti Grain geometriarekin
-Name[fa]=پایانۀ پشتیبانی پرداخت KSVG - هندسۀ ضد ذره
-Name[fi]=KSVG-piirtäjän taustaohjelma - sileä geometria
-Name[fr]=Moteur de rendu KSVG - Anti Grain Geometry
-Name[gl]=Mecanismo de Interpretación KSVG - Xeometría Anti-gran
-Name[he]=מנוע רינדור KSVG
-Name[hi]=के-एसवीजी रेंडरिंग बैकएण्ड- एन्टी ग्रेन ज्यामिती
-Name[hu]=KSVG megjelenítő motor - AGG (Anti Grain Geometry)
-Name[is]=KSVG teiknari - Anti Grain Geometry
-Name[it]=Backend KSVG per il rendering - Geometrie senza sgranature
-Name[ja]=KSVG レンダリングバックエンド - Anti Grain Geometry
-Name[kk]=KSVG кескіндеу бағдарламасы - қиыршықтыққа қарсы геометриясы
-Name[km]=កម្មវិធី​សម្រាប់​បង្ហាញ KSVG - រាង​មិន​គ្រើម
-Name[lt]=KSVG atkūrimo programinė sąsaja - Anti Grain geometrija
-Name[ms]=Tepi Belakang KSVG - Geometri Anti Bijian
-Name[nb]=Modul for KSVG-tegning – antikorngeometri
-Name[nds]=KSVG-Dorstellhölper - Antigrissel-Geometrie
-Name[ne]=KSVG रेन्डरिङ ब्याकइन्ड - एन्टि ग्रेन ज्योमेट्रि
-Name[nl]=KSVG weergavecomponent - Anti Grain Geometry
-Name[nn]=Modul for KSVG-teikning – antikorngeometri
-Name[pl]=Narzędzie do renderowania KSVG - nieziarnista geometria
-Name[pt]=Infra-Estrutura de Desenho do KSVG - Geometria Anti-Grão
-Name[pt_BR]=Estrutura de Renderização do KSVG - Geometria Anti-Grain
-Name[ro]=Motor de randare KSVG - Anti Grain Geometry
-Name[ru]=Движок отрисовки KSVG - противозернистая геометрия
-Name[sk]=Nástroj pre zobrazovanie KSVG - antigranularitná geometria
-Name[sl]=Izrisovalnik KSVG - Protizrnska geometrija
-Name[sr]=KSVG-ов позадински систем за рендеровање — Противзрнаста геометрија
-Name[sr@Latn]=KSVG-ov pozadinski sistem za renderovanje — Protivzrnasta geometrija
-Name[sv]=KSVG-uppritningsmodul - geometri mot korninghet
-Name[ta]=KSVG வழங்கும் பின் அமைப்பு - ஆன்டி க்ரேன் ஜியோமெட்ரி
-Name[tg]=Лағжандаи тасовироти KSVG - геометрияи мутақобили гандумӣ
-Name[tr]=KSVG Derleme Aracı - Taneciksiz Geometri
-Name[uk]=Інтерфейс відтворення KSVG - AGG
-Name[zh_CN]=KSVG 渲染后端 - 反增长几何形状
-Name[zh_HK]=KSVG 合成後端 - Anti Grain Geometry
-Name[zh_TW]=KSVG 上色後端介面 - Anti Grain Geometry
Comment=New, unstable ksvg rendering backend
-Comment[bs]=Novi, nestabilni ksvg renderiranje backend
-Comment[ca]=Nou, inestable representador en segon pla de ksvg
-Comment[cs]=Nový, nestabilní vykreslovací nástroj KSVG
-Comment[cy]=Ôl-wyneb llunio ksvg newydd, ansad
-Comment[da]=Nyt, ustabilt underliggende program til ksvg-visning
-Comment[de]=Neues, unausgereiftes KSVG-Darstellungsmodul
-Comment[el]=Νέο υπό ανάπτυξη σύστημα υποστήριξης αποτύπωσης
-Comment[es]=Nuevo motor de procesado de ksvg, inestable
-Comment[et]=Uus ebastabiilne ksvg renderdamise taustarakendus
-Comment[eu]=Berria, ksvg errendatze programa ezegonkorra
-Comment[fa]=جدید، پایانۀ پشتیبانی ناپایدار پرداخت ksvg
-Comment[fi]=Uusi epävakaa ksvg-piirtäjän taustaohjelma
-Comment[fr]=Nouveau moteur de rendu KSVG instable
-Comment[gl]=Novo e inestábel mecanismo de interpretación ksvg
-Comment[he]=חדש, מנוע רינדור לא יציב עבור KSVG
-Comment[hi]=नया, अस्थिर के-एसवीजी रेंडरिंग बैकएण्ड
-Comment[hu]=Új, még nem teljesen kiforrott megjelenítőmotor a KSVG-hez
-Comment[is]=Nýr og óstöðugur ksvg teiknari
-Comment[it]=Nuovo, instabile backend di KSVG per il rendering
-Comment[ja]=新しく、まだ開発途上の ksvg レンダリングバックエンド
-Comment[kk]=Жаңа, әлі тұрақсыз KSVG кескіндеу бағдарламасы
-Comment[km]=កម្មវិធី​សម្រាប់​បង្ហាញ ksvg ថ្មី​តែ​មិន​សូវ​ឋិតថេរ
-Comment[lt]=Nauja, nestabili ksvg atkūrimo programinė sąsaja
-Comment[ms]=Tepi Belakang Menrealisasi ksvg yang baru dan tidak stabil
-Comment[nb]=Ny og ustabil modul for ksvg-tegning
-Comment[nds]=Nieg, nich stevig KSVG-Dorstellhölper
-Comment[ne]=नयाँ, अस्थिर ksvg रेन्डरिङ ब्याकइन्ड
-Comment[nl]=Nieuwe, niet stabiele KSVG weergavecomponent
-Comment[nn]=Ny og ustabil modul for ksvg-teikning
-Comment[pl]=Nowe, niestabilne, narzędzie do renderowania KSVG
-Comment[pt]=Uma infra-estrutura de desenho do ksvg, nova e instável
-Comment[pt_BR]=Nova e instável estrutura de renderização do ksvg
-Comment[ro]=Motor de randare KSVG nou, netestat suficient
-Comment[ru]=Новый, нестабильный движок прорисовки ksvg
-Comment[sk]=Nová, nestabilná verzia nástroja pre zobrazovanie ksvg
-Comment[sl]=Nov, nestabilen izrisovalnik KSVG
-Comment[sr]=Нов, нестабилан KSVG-ов позадински систем за рендеровање
-Comment[sr@Latn]=Nov, nestabilan KSVG-ov pozadinski sistem za renderovanje
-Comment[sv]=Ny, instabil KSVG-uppritningsmodul
-Comment[ta]=புதிய, நிலையில்லாத ksvg வழங்கும் பின் அமைப்பு
-Comment[tg]=Лағжандаи ғайриустувори тасовироти ksvg-и нав
-Comment[tr]=Yeni, stabil olmayan ksvg derleme aracı
-Comment[uk]=Новий, нестабільний інтерфейс відтворення KSVG
-Comment[zh_CN]=新的不稳定的 ksvg 渲染后端
-Comment[zh_HK]=新但不穩定的 ksvg 合成後端
-Comment[zh_TW]=新的,不穩定的 ksvg 上色後端介面
author=Rob Buis <buis@kde.org>
diff --git a/ksvg/plugin/backends/libart/BezierPathLibart.cpp b/ksvg/plugin/backends/libart/BezierPathLibart.cpp
index fb163952..2c3ae007 100644
--- a/ksvg/plugin/backends/libart/BezierPathLibart.cpp
+++ b/ksvg/plugin/backends/libart/BezierPathLibart.cpp
@@ -156,5 +156,3 @@ void BezierPathLibart::boundingBox(Point *topLeft, Point *bottomRight)
*bottomRight = Point(0, 0);
}
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/BezierPathLibart.h b/ksvg/plugin/backends/libart/BezierPathLibart.h
index dd8fda6f..c9cb4eea 100644
--- a/ksvg/plugin/backends/libart/BezierPathLibart.h
+++ b/ksvg/plugin/backends/libart/BezierPathLibart.h
@@ -48,5 +48,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/CMakeLists.txt b/ksvg/plugin/backends/libart/CMakeLists.txt
index 68f2871e..d9478a8d 100644
--- a/ksvg/plugin/backends/libart/CMakeLists.txt
+++ b/ksvg/plugin/backends/libart/CMakeLists.txt
@@ -28,14 +28,17 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
+ ${ART_LIBRARY_DIRS}
)
##### other data ################################
-install( FILES
- ksvglibartcanvas.desktop
- DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE ksvglibartcanvas.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR ksvg-desktops
+)
##### libksvgrendererlibart (module) ############
diff --git a/ksvg/plugin/backends/libart/GlyphTracerLibart.cpp b/ksvg/plugin/backends/libart/GlyphTracerLibart.cpp
index b034c6e6..925e55e1 100644
--- a/ksvg/plugin/backends/libart/GlyphTracerLibart.cpp
+++ b/ksvg/plugin/backends/libart/GlyphTracerLibart.cpp
@@ -173,5 +173,3 @@ void GlyphTracerLibart::closePath(Glyph *glyph)
path->m_array.resize(index + 1);
path->m_array[index].code = ART_END;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/GlyphTracerLibart.h b/ksvg/plugin/backends/libart/GlyphTracerLibart.h
index 39b87490..e32cb0b1 100644
--- a/ksvg/plugin/backends/libart/GlyphTracerLibart.h
+++ b/ksvg/plugin/backends/libart/GlyphTracerLibart.h
@@ -46,5 +46,3 @@ namespace T2P
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/LibartCanvas.cpp b/ksvg/plugin/backends/libart/LibartCanvas.cpp
index f46051f5..4a3af267 100644
--- a/ksvg/plugin/backends/libart/LibartCanvas.cpp
+++ b/ksvg/plugin/backends/libart/LibartCanvas.cpp
@@ -421,5 +421,3 @@ ArtSVP *LibartCanvas::svpFromPolygon(const KSVGPolygon& polygon)
else
return 0;
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/LibartCanvas.h b/ksvg/plugin/backends/libart/LibartCanvas.h
index 9232789a..3b2b6c92 100644
--- a/ksvg/plugin/backends/libart/LibartCanvas.h
+++ b/ksvg/plugin/backends/libart/LibartCanvas.h
@@ -80,5 +80,3 @@ public:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp b/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp
index 9360389c..69a7c89b 100644
--- a/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp
+++ b/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp
@@ -41,5 +41,3 @@ TQObject *LibartCanvasFactory::createObject(TQObject *, const char *, const char
int height = (*args.at(0)).toInt();
return new LibartCanvas(width, height);
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/LibartCanvasFactory.h b/ksvg/plugin/backends/libart/LibartCanvasFactory.h
index c26aa833..6afd958d 100644
--- a/ksvg/plugin/backends/libart/LibartCanvasFactory.h
+++ b/ksvg/plugin/backends/libart/LibartCanvasFactory.h
@@ -41,5 +41,3 @@ public:
}
#endif
-
-/// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/LibartCanvasItems.cpp b/ksvg/plugin/backends/libart/LibartCanvasItems.cpp
index aca4c517..a256bdf4 100644
--- a/ksvg/plugin/backends/libart/LibartCanvasItems.cpp
+++ b/ksvg/plugin/backends/libart/LibartCanvasItems.cpp
@@ -2205,5 +2205,3 @@ void LibartPattern::render(KSVGCanvas *c, ArtSVP *svp, float opacity, TQByteArra
ksvg_art_rgb_texture(svp, c->renderingBuffer() + screenBBox.x() * c->nrChannels() + screenBBox.y() * c->rowStride(), screenBBox.left(), screenBBox.top(), screenBBox.right() + 1, screenBBox.bottom() + 1, c->rowStride(), c->nrChannels(), tile.image().bits(), tile.image().width(), tile.image().height(), tile.image().width() * 4, affine, ART_FILTER_NEAREST, 0L, alpha, (art_u8 *)mask.data());
}
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/backends/libart/ksvglibartcanvas.desktop b/ksvg/plugin/backends/libart/ksvglibartcanvas.desktop
index e61f6375..bb7cfa48 100644
--- a/ksvg/plugin/backends/libart/ksvglibartcanvas.desktop
+++ b/ksvg/plugin/backends/libart/ksvglibartcanvas.desktop
@@ -4,98 +4,5 @@ X-TDE-ServiceTypes=KSVG/Renderer
X-TDE-Library=libksvgrendererlibart
X-KSVG-InternalName=libart
Name=KSVG Rendering Backend - Libart
-Name[ar]=خلفية الرسم ل KSVG - Libart
-Name[bs]=KSVG renderiranje - Libart
-Name[ca]=Representació en segon pla de KSVG - Biblioteca d'imatges
-Name[cs]=Vykreslovací nástroj KSVG - Libart
-Name[cy]=Ôl-wyneb Llunio KSVG - Libart
-Name[da]=Underliggende program til KSVG-visning - Libart
-Name[de]=KSVG-Darstellungsmodul - Libart
-Name[el]=Σύστημα υποστήριξης αποτύπωσης του KSVG - Libart
-Name[es]=Motor de procesado de KSVG - Libart
-Name[et]=KSVG renderdamise taustarakendus - Libart
-Name[eu]=KSVG errendatze programa - Libart
-Name[fa]=پایانۀ پشتیبانی پرداخت KSVG - Libart
-Name[fi]=KSVG-piirtäjän taustaohjelma - Libart
-Name[fr]=Moteur de rendu KSVG - Libart
-Name[ga]=Inneall Rindreála KSVG - Libart
-Name[gl]=Mecanismo de Interpretación KSVG - Libart
-Name[hi]=के-एसवीजी रेंडरिंग बैकएण्ड- लिबआर्ट
-Name[hu]=KSVG megjelenítőmotor - Libart
-Name[is]=KSVG teiknari - Libart
-Name[it]=Backend di KSVG per il rendering - Libart
-Name[ja]=KSVG レンダリングバックエンド - Libart
-Name[kk]=KSVG кескіндеу бағдарламасы - Libart
-Name[km]=កម្មវិធី​សម្រាប់​បង្ហាញ KSVG - Libart
-Name[lt]=KSVG atkūrimo programinė sąsaja - Libart
-Name[ms]=Tepi Belakang Menrealisasi KSVG - Libart
-Name[nb]=Modul for KSVG-tegning – Libart
-Name[nds]=KSVG-Dorstellhölper - Libart
-Name[ne]=KSVG रेन्डरिङ ब्याकइन्ड - लिबर्ट
-Name[nl]=KSVG weergavecomponent - Libart
-Name[nn]=Modul for KSVG-teikning – Libart
-Name[pl]=Narzędzie do renderowania KSVG - Libart
-Name[pt]=Infra-Estrutura de Desenho do KSVG - Libart
-Name[pt_BR]=Estrutura de KSVG Rendering Backend - Libart
-Name[ro]=Motor de randare KSVG - Libart
-Name[ru]=Движок отрисовки KSVG - Libart
-Name[sk]=Nástroj pre zobrazovanie KSVG - libart
-Name[sl]=Izrisovalnik KSVG - Libart
-Name[sr]=KSVG-ов позадински систем за рендеровање — Libart
-Name[sr@Latn]=KSVG-ov pozadinski sistem za renderovanje — Libart
-Name[sv]=KSVG-uppritningsmodul - konstbibliotek
-Name[ta]=KSVG வழங்கும் பின் அமைப்பு - லிபார்ட்
-Name[tg]=Лағжандаи тасовироти KSVG - Libart
-Name[tr]=KSVG Derleme Aracı - Libart
-Name[uk]=Інтерфейс відтворення KSVG - Libart
-Name[zh_CN]=KSVG 渲染后端 - Libart
-Name[zh_HK]=KSVG 合成後端 - Libart
-Name[zh_TW]=KSVG 上色後端介面 - Libart
Comment=Mature ksvg rendering backend
-Comment[ar]=خلفية الرسم لksvg البالغة
-Comment[bs]=Zreli ksvg rendering backend
-Comment[ca]=Representador madur en segon pla de ksvg
-Comment[cs]=Vyspělý vykreslovací nástroj KSVG
-Comment[cy]=Ôl-wyneb llunio ksvg aeddfed
-Comment[da]=Modent underliggende program til ksvg-visning
-Comment[de]=Ausgereiftes KSVG-Darstellungsmodul
-Comment[el]=Ώριμο σύστημα υποστήριξης αποτύπωσης του KSVG
-Comment[es]=Motor de procesado de ksvg tradicional
-Comment[et]=Kasutamisküps ksvg renderdamise taustarakendus
-Comment[eu]=ksvg errendatze programa egonkorra
-Comment[fa]=پایانۀ پشتیبانی کامل پرداخت ksvg
-Comment[fi]=Kypsä ksvg-piirtäjän taustaohjelma
-Comment[fr]=Moteur de rendu KSVG mature
-Comment[gl]=Mecanismo de interpretación maduro ksvg
-Comment[hi]=परिपक्व के-एसवीजी रेंडरिंग बैकएण्ड
-Comment[hu]=Egy kiforrott megjelenítőmotor a KSVG-hez
-Comment[is]=Reyndur ksvg teiknari
-Comment[it]=Maturo backend di KSVG per il rendering
-Comment[ja]=成熟した ksvg レンダリングバックエンド
-Comment[kk]=Баяғы, жетілірдірген, KSVG кескіндеу бағдарламасы
-Comment[km]=កម្មវិធី​សម្រាប់​បង្ហាញ ksvg ចាស់ៗ
-Comment[lt]=Išvystyta ksvg atkūrimo programinė sąsaja
-Comment[ms]=Tepi belakang menrealisasi ksvg matang
-Comment[nb]=Velutviklet modul for ksvg-tegning
-Comment[nds]=Reep KSVG-Dorstellhölper
-Comment[ne]=पूर्ण विकसित ksvg रेन्डरिङ ब्याकइन्ड
-Comment[nl]=Volgroeide KSVG weergavecomponent
-Comment[nn]=Velutvikla modul for ksvg-teikning
-Comment[pl]=Dopracowane narzędzie do renderowania KSVG
-Comment[pt]=Uma infra-estrutura de desenho do ksvg mais madura
-Comment[pt_BR]=Estrutura de renderização madura do ksvg
-Comment[ro]=Motor de randare KSVG matur
-Comment[ru]=Старый движок отрисовки ksvg
-Comment[sk]=Stabilný nástroj pre zobrazovanie ksvg
-Comment[sl]=Zrel izrisovalnik KSVG
-Comment[sr]=Стари KSVG-ов позадински систем за рендеровање
-Comment[sr@Latn]=Stari KSVG-ov pozadinski sistem za renderovanje
-Comment[sv]=Mogen KSVG-uppritningsmodul
-Comment[ta]=முழுமையான ksvg வழங்கும் பின் அமைப்பு
-Comment[tg]=Лағжандаи тасовироти кӯҳнаи ksvg
-Comment[tr]=Tamamlanmış ksvg derleme aracı
-Comment[uk]=Стабільний інтерфейс відтворення KSVG
-Comment[zh_CN]=稳定的 ksvg 渲染后端
-Comment[zh_HK]=成熟的 ksvg 合成後端
-Comment[zh_TW]=成熟的 ksvg 上色後端介面
author=Nikolas Zimmermann <wildfox@kde.org>
diff --git a/ksvg/plugin/ksvg_factory.h b/ksvg/plugin/ksvg_factory.h
index c756bd66..0141915e 100644
--- a/ksvg/plugin/ksvg_factory.h
+++ b/ksvg/plugin/ksvg_factory.h
@@ -56,5 +56,3 @@ public:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/ksvg_plugin.cpp b/ksvg/plugin/ksvg_plugin.cpp
index 14eaa417..48cf6d56 100644
--- a/ksvg/plugin/ksvg_plugin.cpp
+++ b/ksvg/plugin/ksvg_plugin.cpp
@@ -413,5 +413,3 @@ void KSVGPlugin::slotGotURL(const TQString &text)
else
emit setStatusBarText(text);
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/ksvg_plugin.h b/ksvg/plugin/ksvg_plugin.h
index 405bedaf..7097f728 100644
--- a/ksvg/plugin/ksvg_plugin.h
+++ b/ksvg/plugin/ksvg_plugin.h
@@ -84,5 +84,3 @@ private:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/ksvg_widget.cpp b/ksvg/plugin/ksvg_widget.cpp
index ee8b315e..2e65f012 100644
--- a/ksvg/plugin/ksvg_widget.cpp
+++ b/ksvg/plugin/ksvg_widget.cpp
@@ -263,5 +263,3 @@ void KSVGWidget::resizeEvent(TQResizeEvent *e)
emit redraw(TQRect(0, 0, e->size().width(), e->size().height()));
}
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/ksvg_widget.h b/ksvg/plugin/ksvg_widget.h
index 6b934895..eadc57a7 100644
--- a/ksvg/plugin/ksvg_widget.h
+++ b/ksvg/plugin/ksvg_widget.h
@@ -65,5 +65,3 @@ private:
};
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/plugin/ksvgplugin.desktop b/ksvg/plugin/ksvgplugin.desktop
index e391e978..e5cc4e81 100644
--- a/ksvg/plugin/ksvgplugin.desktop
+++ b/ksvg/plugin/ksvgplugin.desktop
@@ -1,84 +1,8 @@
[Desktop Entry]
Name=KSVGPlugin
-Name[ar]=برنامج KSVGPlugin
-Name[ca]=Connector KSVG
-Name[cy]=AtegynKSVG
-Name[el]=Πρόσθετο KSVG
-Name[eo]=Vektorgrafiko-kromaĵo
-Name[eu]=KSVGPlugina
-Name[fr]=Module SVG
-Name[hi]=के-एसवीजी-प्लगइन
-Name[hu]=KSVG bővítőmodul
-Name[is]=KSVGÍforrit
-Name[lv]=KSVGIespraudnis
-Name[ne]=KSVG प्लगइन
-Name[pl]=Wtyczka KSVG
-Name[ro]=Modul KSVG
-Name[sv]=KSVG-insticksprogram
-Name[ta]=KSVGசொருகுப்பொருள்
-Name[tr]=KSVG Eklentisi
-Name[xh]=Iplagi efakiweyo ye KSVG
-Name[zu]=Iplagi efakiweyo ye KSVG
+Comment=Scalable Vector Graphics Viewer
Icon=image-svg+xml
MimeType=image/svg+xml;image/svg
-Comment=Scalable Vector Graphics Viewer
-Comment[ar]=عارض الرسومات الثابتة القابلة للقياس
-Comment[az]=Miqyaslı Vektor Qrafikaları Nümayişçisi
-Comment[bs]=Scalable Vector Graphics preglednik
-Comment[ca]=Visualitzador de gràfics vectorials escalables (SVG)
-Comment[cs]=Prohlížeč pro formát Scalable Vector Graphics (SVG)
-Comment[cy]=Gwelydd Graffeg Fector Graddedig
-Comment[da]=Fremviser af skalerbar vektorgrafik
-Comment[de]=Betrachter für skalierbare Vektorgraphiken
-Comment[el]=Προβολέας διανυσματικών γραφικών
-Comment[eo]=Rigardilo por pligrandigeblaj vektorgrafikoj
-Comment[es]=Visor de gráficos vectoriales escalables (SVG)
-Comment[et]=Skaleeritava vektorgraafika (SVG) näitaja
-Comment[eu]=Scalable Vector Graphics ikustailua
-Comment[fa]=مشاهده‌گر نگاره‌‌‌‌‌سازی مقیاس‌پذیر برداری
-Comment[fi]=Scalable Vector Graphics -näytin
-Comment[fr]=Afficheur d'images au format Graphisme vectoriel échelonnable (SVG)
-Comment[ga]=Amharcán SVG (Scalable Vector Graphics)
-Comment[gl]=Visor de gráficos vectoriais escalables
-Comment[hi]=स्केलेबल वेक्टर ग्राफिक्स प्रदर्शक
-Comment[hr]=Preglednik SVG datoteka
-Comment[hu]=SVG-megjelenítő
-Comment[is]=Scalable Vector Graphics (SVG) myndbirtir
-Comment[it]=Visore di file SVG
-Comment[ja]=SVG (スケーラブルベクトルグラフィックス) ビューア
-Comment[kk]=SVG файлдарды қарау
-Comment[km]=កម្មវិធី​មើល​ក្រាហ្វិក​វ៉ិចទ័រ​មាន​មាត្រដ្ឋាន
-Comment[lt]=Kintamo dydžio vektorinė grafika
-Comment[lv]=Mērogojamas Vektoru Grafikas Skatītājs
-Comment[ms]=Pemapar Grafik Vektor Boleh Skala
-Comment[mt]=Werrej tas-"Scalable Vector Graphics"
-Comment[nb]=Framvisningsprogram for SVG-bilde («Scalable Vector Graphics»)
-Comment[nds]=Kieker för skaleerbor Vektorgrafiken
-Comment[ne]=मापनयोग्य भेक्टर ग्राफिक्स दर्शक
-Comment[nl]=Scalable Vector Graphics-weergaveprogramma
-Comment[nn]=Framvisingsprogram for SVG-grafikk («Scalable Vector Graphics»)
-Comment[pl]=Przeglądarka dla plików SVG (skalowalnej grafiki wektorowej)
-Comment[pt]=Visualizador de Gráficos Vectoriais Escaláveis (SVG)
-Comment[pt_BR]=Visualizador de Vetores Escaláveis
-Comment[ro]=Vizualizor SVG
-Comment[ru]=Просмотр SVG
-Comment[sk]=Prehliadač pre škálovateľnú vektorovú grafiku SVG
-Comment[sl]=Pregledovalnik skalabilne vektorske grafike
-Comment[sr]=Приказивач скалабилне векторске графике
-Comment[sr@Latn]=Prikazivač skalabilne vektorske grafike
-Comment[sv]=Visning av skalbar vektorgrafik
-Comment[ta]=அளவிடக்கூடிய வெக்டார் சித்திரங்கள் காட்சி
-Comment[tg]=Намоиши SVG
-Comment[tr]=Boyutlandırılabilir Vektör Grafik Gösterici
-Comment[uk]=Переглядач векторної графіки
-Comment[uz]=SVG koʻruvchi
-Comment[uz@cyrillic]=SVG кўрувчи
-Comment[ven]=Muvhono wa girafiki wa scalable vector
-Comment[xh]=Umboniseli wemizobo olinganiselwayo onesalathiso
-Comment[zh_CN]=可缩放矢量图查看器
-Comment[zh_HK]=可縮放向量圖形(SVG)檢視器
-Comment[zh_TW]=可調整的向量圖形檢視器
-Comment[zu]=Umbonisi wemidwebo Onenani Elibalekayo
Type=Service
X-TDE-ServiceTypes=KParts/ReadOnlyPart,Browser/View
X-TDE-Library=libksvgplugin
diff --git a/ksvg/plugin/svgcreator.cpp b/ksvg/plugin/svgcreator.cpp
index 521a8b88..60328855 100644
--- a/ksvg/plugin/svgcreator.cpp
+++ b/ksvg/plugin/svgcreator.cpp
@@ -89,5 +89,3 @@ ThumbCreator::Flags SVGCreator::flags() const
{
return DrawFrame;
}
-
-// vim: ts=4 sw=4 noet
diff --git a/ksvg/plugin/svgcreator.h b/ksvg/plugin/svgcreator.h
index 696251ce..f788895b 100644
--- a/ksvg/plugin/svgcreator.h
+++ b/ksvg/plugin/svgcreator.h
@@ -42,5 +42,3 @@ private:
};
#endif
-
-// vim: ts=4 sw=4 noet
diff --git a/ksvg/plugin/svgthumbnail.desktop b/ksvg/plugin/svgthumbnail.desktop
index e50f19d9..e3fbdc01 100644
--- a/ksvg/plugin/svgthumbnail.desktop
+++ b/ksvg/plugin/svgthumbnail.desktop
@@ -1,49 +1,6 @@
[Desktop Entry]
Type=Service
Name=Scalable Vector Graphics
-Name[ar]=رسومات ثابتة قابلة للقياس
-Name[az]=Miqyaslı Vektor Qrafikaları
-Name[ca]=Gràfics vectorials escalables (SVG)
-Name[cy]=Graffeg Fector Graddedig
-Name[da]=Skalerbar vektorgrafik
-Name[de]=Skalierbare Vektorgraphiken
-Name[el]=Διανυσματικά γραφικά
-Name[eo]=Vektorgrafikoj
-Name[es]=Gráficos vectoriales escalables (SVG)
-Name[et]=Skaleeritav vektorgraafika (SVG)
-Name[fa]=نگاره‌سازی مقیاس‌پذیر برداری
-Name[fr]=Graphisme vectoriel échelonnable (SVG)
-Name[gl]=Gráficos vectoriais escalables
-Name[hi]=स्केलेबल वेक्टर ग्राफिक्स
-Name[hu]=SVG
-Name[it]=Grafica vettoriale riscalabile
-Name[ja]=SVG (スケーラブルベクトルグラフィックス)
-Name[kk]=SVG сызбалы суреттер
-Name[km]=ក្រាហ្វិក​វ៉ិចទ័រ​មាន​មាត្រដ្ឋាន
-Name[lt]=Kintamo dydžio vektorinė grafika
-Name[lv]=Mērogojama Vektoru Grafika
-Name[ms]=Grafik Vektor Boleh Skala
-Name[nds]=Skaleerbor Vektorgrafiken
-Name[ne]=मापनयोग्य भेक्टर ग्राफिक्स
-Name[pl]=Skalowalna Grafika Wektorowa
-Name[pt]=SVG - Gráficos Vectoriais Escaláveis
-Name[pt_BR]=Vetores Escaláveis
-Name[ro]=Grafică vectorială scalabilă (SVG)
-Name[ru]=Векторные рисунки (.svg)
-Name[sl]=Skalabilna vektorska grafika
-Name[sr]=Скалабилна векторска графика (SVG)
-Name[sr@Latn]=Skalabilna vektorska grafika (SVG)
-Name[sv]=Skalbar vektorgrafik
-Name[ta]=அளவிடக்கூடிய வெக்டார் சித்திரங்கள்
-Name[tg]=Расмҳои вектории масштабкунанда (SVG)
-Name[tr]=Boyutlandırılabilir Vektör Grafiği
-Name[uk]=Масштабовна векторна графіка
-Name[ven]=Dzigirafiki ya vekitha ya Scalable
-Name[xh]=Imizobo elinganiselwayo enesalathisi
-Name[zh_CN]=可缩放矢量图
-Name[zh_HK]=可縮放向量圖形(SVG)
-Name[zh_TW]=可調整的向量圖形
-Name[zu]=Imidwebo Enenani Elibalekayo
Icon=thumbnail
MimeTypes=image/svg+xml
X-TDE-Library=svgthumbnail
diff --git a/ksvg/scripts/check_hashtablesize.pl b/ksvg/scripts/check_hashtablesize.pl
index d22e3f30..d460e5ad 100755
--- a/ksvg/scripts/check_hashtablesize.pl
+++ b/ksvg/scripts/check_hashtablesize.pl
@@ -138,10 +138,10 @@ foreach(@useresult) {
my $temp = $middle[0];
if($calcMode != 2) {
- $temp =~ s/.cc://;
+ $temp =~ s/.cpp://;
$class = $temp;
} else {
- $temp =~ s/.cc//;
+ $temp =~ s/.cpp//;
$class = substr($temp, 0, index($temp, ":"));
}
}
diff --git a/ksvg/scripts/gen.sh b/ksvg/scripts/gen.sh
index d608385b..5e53438e 100755
--- a/ksvg/scripts/gen.sh
+++ b/ksvg/scripts/gen.sh
@@ -12,11 +12,11 @@ fi
# make them
touch $1.h
-touch $1.cc
+touch $1.cpp
#start with copyright notices
cat ../COPYRIGHTS > $1.h
-cat ../COPYRIGHTS > $1.cc
+cat ../COPYRIGHTS > $1.cpp
# add define for multiple include problem
echo "" >> $1.h
@@ -27,13 +27,13 @@ echo "namespace KSVG" >> $1.h
echo "{" >> $1.h
echo "" >> $1.h
-#include in .cc + namespace
-echo "" >> $1.cc
-echo "#include \"$1.h\"" >> $1.cc
-echo "#include \"$1Impl.h\"" >> $1.cc
-echo "" >> $1.cc
-echo "using namespace KSVG;" >> $1.cc
-echo "" >> $1.cc
+#include in .cpp + namespace
+echo "" >> $1.cpp
+echo "#include \"$1.h\"" >> $1.cpp
+echo "#include \"$1Impl.h\"" >> $1.cpp
+echo "" >> $1.cpp
+echo "using namespace KSVG;" >> $1.cpp
+echo "" >> $1.cpp
#go go go
$cmd_awk -f ../makeheader $1
@@ -43,9 +43,3 @@ $cmd_awk -f ../makecc $1
echo "};" >> $1.h
echo "" >> $1.h
echo "#endif" >> $1.h
-echo "" >> $1.h
-
-echo "// vim:ts=4:noet" >> $1.h
-echo "// vim:ts=4:noet" >> $1.cc
-
-#done I hope
diff --git a/ksvg/scripts/genimpl.sh b/ksvg/scripts/genimpl.sh
index 5a0742d2..c4cd1284 100755
--- a/ksvg/scripts/genimpl.sh
+++ b/ksvg/scripts/genimpl.sh
@@ -12,11 +12,11 @@ fi
# you cant touch this
touch $1Impl.h
-touch $1Impl.cc
+touch $1Impl.cpp
#start with copyright notices
cat ../COPYRIGHTS > $1Impl.h
-cat ../COPYRIGHTS > $1Impl.cc
+cat ../COPYRIGHTS > $1Impl.cpp
# add define for multiple include problem
echo "" >> $1Impl.h
@@ -28,12 +28,12 @@ echo "" >> $1Impl.h
echo "namespace KSVG" >> $1Impl.h
echo "{" >> $1Impl.h
-#include in .cc + namespace
-echo "" >> $1Impl.cc
-echo "#include \"$1Impl.h\"" >> $1Impl.cc
-echo "" >> $1Impl.cc
-echo "using namespace KSVG;" >> $1Impl.cc
-echo "" >> $1Impl.cc
+#include in .cpp + namespace
+echo "" >> $1Impl.cpp
+echo "#include \"$1Impl.h\"" >> $1Impl.cpp
+echo "" >> $1Impl.cpp
+echo "using namespace KSVG;" >> $1Impl.cpp
+echo "" >> $1Impl.cpp
#go go go
$cmd_awk -f ../makeimpl $1
@@ -42,8 +42,3 @@ $cmd_awk -f ../makeimpl $1
echo "};" >> $1Impl.h
echo "" >> $1Impl.h
echo "#endif" >> $1Impl.h
-echo "" >> $1Impl.h
-echo "// vim:ts=4:noet" >> $1Impl.h
-
-echo "// vim:ts=4:noet" >> $1Impl.cc
-#done I hope
diff --git a/ksvg/scripts/getjs.php b/ksvg/scripts/getjs.php
index 5f300fe9..514287a3 100755
--- a/ksvg/scripts/getjs.php
+++ b/ksvg/scripts/getjs.php
@@ -359,7 +359,7 @@ function crawlFiles($path)
crawlFiles($path."/".$file);
fputs($fp,"Leaving directory ".$file."\n");
}
- elseif (is_file($path."/".$file) && preg_match("/^[A-Za-z0-9_]+(\.cc|\.cpp|\.h|\.hpp)$/",$file))
+ elseif (is_file($path."/".$file) && preg_match("/^[A-Za-z0-9_]+(\.cpp|\.h)$/",$file))
{
fputs($fp,"\tchecking $file\n");
searchKalyptusCode($path."/".$file,$fp);
diff --git a/ksvg/scripts/makecc b/ksvg/scripts/makecc
index 29a28b93..97eb4b74 100644
--- a/ksvg/scripts/makecc
+++ b/ksvg/scripts/makecc
@@ -1,6 +1,6 @@
function printg( a )
{
- printf a >> FILENAME ".cc"
+ printf a >> FILENAME ".cpp"
}
function doFunc( a )
{
diff --git a/ksvg/scripts/makeimpl b/ksvg/scripts/makeimpl
index fb5ab8f5..e6c7b719 100644
--- a/ksvg/scripts/makeimpl
+++ b/ksvg/scripts/makeimpl
@@ -21,7 +21,7 @@ function printg( a )
}
function printh( a )
{
- printf a >> FILENAME "Impl.cc"
+ printf a >> FILENAME "Impl.cpp"
}
function doFuncCC( a, class )
{
@@ -166,7 +166,7 @@ function doAttr( a, class )
printg( " " )n
printg( b[nr] ");\n" )
- # do put method .cc
+ # do put method .cpp
printtofunc( "void " clas "::set" )
printtofunc( toupper( substr( b[nr], 1, 1) ) )
printtofunc( substr( b[nr], 2) "(" )
@@ -212,7 +212,7 @@ function doAttr( a, class )
$temp = b[nr]
printg( $temp "() const;\n" )
- # do get method .cc
+ # do get method .cpp
i = 1
while ( i < nr )
{
@@ -277,7 +277,7 @@ function doReadonlyAttr( a, class )
$temp = b[nr]
printg( $temp "() const;\n" )
- # do get method .cc
+ # do get method .cpp
i = 1
while ( i < nr )
{
diff --git a/ksvg/test/external/CMakeLists.txt b/ksvg/test/external/CMakeLists.txt
index 69eafac7..a07e0406 100644
--- a/ksvg/test/external/CMakeLists.txt
+++ b/ksvg/test/external/CMakeLists.txt
@@ -25,13 +25,14 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
+ ${ART_LIBRARY_DIRS}
)
##### svgdisplay (executable) ###################
tde_add_executable( svgdisplay AUTOMOC
- SOURCES SVGTestWidget.cc svgdisplay.cc
+ SOURCES SVGTestWidget.cpp svgdisplay.cpp
LINK ksvg-shared
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/ksvg/test/external/Makefile.am b/ksvg/test/external/Makefile.am
index 8d9f817b..8b217332 100644
--- a/ksvg/test/external/Makefile.am
+++ b/ksvg/test/external/Makefile.am
@@ -4,7 +4,7 @@ KDE_CXXFLAGS = $(USE_EXCEPTIONS)
bin_PROGRAMS = svgdisplay printnodetest
-svgdisplay_SOURCES = SVGTestWidget.cc svgdisplay.cc
+svgdisplay_SOURCES = SVGTestWidget.cpp svgdisplay.cpp
svgdisplay_LDADD = $(LIB_TDECORE) ../../libksvg.la
svgdisplay_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor
diff --git a/ksvg/test/external/SVGTestWidget.cc b/ksvg/test/external/SVGTestWidget.cc
deleted file mode 100644
index ba17bc37..00000000
--- a/ksvg/test/external/SVGTestWidget.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-// Very small test app to look at ksvg performance without konqueror overhead (Rob)
-
-#include "SVGTestWidget.moc"
-#include "DocumentFactory.h"
-#include "CanvasFactory.h"
-#include "SVGCircleElement.h"
-#include "SVGAnimatedLength.h"
-#include "SVGLength.h"
-#include "SVGSVGElement.h"
-#include "SVGEventImpl.h"
-#include "KSVGCanvas.h"
-#include "CanvasItem.h"
-#include <kcursor.h>
-
-using namespace KSVG;
-
-SVGTestWidget::SVGTestWidget(const KURL &url)
-{
- setBackgroundColor(TQt::white);
- setMouseTracking(true);
- setFocusPolicy(TQ_WheelFocus);
-
- m_doc = DocumentFactory::self()->requestDocument(TQT_TQOBJECT(this), TQT_SLOT(slotRenderingFinished()));
- if(!m_doc)
- return;
-
- resize(450, 450);
- m_canvas = CanvasFactory::self()->loadCanvas(450, 450);
- if(!m_canvas)
- return;
-
- m_canvas->setup(TQT_TQPAINTDEVICE(this), TQT_TQPAINTDEVICE(this));
-
- if(!DocumentFactory::self()->attachCanvas(m_canvas, m_doc))
- return;
-
- if(!DocumentFactory::self()->startParsing(m_doc, url))
- return;
-}
-
-SVGTestWidget::~SVGTestWidget()
-{
- delete m_canvas;
- delete m_doc;
-}
-
-void SVGTestWidget::slotRenderingFinished()
-{
- TQRect rect(0, 0, width(), height());
- m_canvas->blit(rect, true);
-
- SVGElement test = m_doc->rootElement().getElementById("test");
- if(test.nodeName() == "circle")
- {
- SVGCircleElement c = dom_cast(SVGCircleElement, test);
- c.r().baseVal().setValue(150);
- c.setAttribute("fill", "blue");
- }
-}
-
-void SVGTestWidget::paintEvent(TQPaintEvent *event)
-{
- m_canvas->update();
- m_canvas->blit(event->rect(), true);
-}
-
-void SVGTestWidget::resizeEvent(TQResizeEvent *event)
-{
- int w = event->size().width();
- int h = event->size().height();
-
- m_canvas->resize(w, h);
- resize(w, h);
- m_canvas->blit();
-}
-/*
-KSVG::SVGMouseEventImpl *newMouseEvent(SVGDocument *doc, KSVG::SVGEventImpl::EventId id, TQMouseEvent *event)
-{
- DOM::AbstractView temp;
-
- int clientX = event->x();
- int clientY = event->y();
-
- if(doc && doc->rootElement())
- {
- clientX = int(clientX / doc->rootElement()->currentScale());
- clientY = int(clientY / doc->rootElement()->currentScale());
- }
-
- int button = 0;
- if(event->stateAfter() & Qt::LeftButton)
- button = 1;
- else if(event->stateAfter() & Qt::MidButton)
- button = 2;
- else if(event->stateAfter() & Qt::RightButton)
- button = 3;
-
- KSVG::SVGMouseEventImpl *mev = new KSVG::SVGMouseEventImpl(id, // type
- true, // canBubbleArg
- true, // cancelableArg
- temp, // view
- 0, // detail
- event->globalX(), //screenXArg
- event->globalY(), // screenYArg,
- clientX, // clientXArg
- clientY, // clientYArg
- (event->state() & TQt::ControlButton), // ctrlKeyArg
- (event->state() & TQt::AltButton), // altKeyArg
- (event->state() & TQt::ShiftButton), // shiftKeyArg
- (event->state() & TQt::MetaButton), // metaKeyArg
- button, // buttonArg
- 0);
-
- mev->ref();
-
- return mev;
-}
-
-void SVGTestWidget::mouseMoveEvent(TQMouseEvent *event)
-{
- if(event->state() & TQMouseEvent::ControlButton && event->state() & TQMouseEvent::LeftButton)
- {
- if(m_panningPos.isNull())
- m_panningPos = event->pos();
- else
- {
- TQPoint panPoint = m_oldPanningPos - (m_panningPos - event->pos());
- m_doc->rootElement()->setCurrentTranslate(panPoint);
-// m_doc->syncCachedMatrices(); FIXME
- m_canvas->update(panPoint);
- }
- return;
- }
- else if(event->state() & TQMouseEvent::ControlButton)
- return;
-}
-
-void SVGTestWidget::mousePressEvent(TQMouseEvent *event)
-{
- if(event->state() & TQMouseEvent::ControlButton)
- return;
-
- KSVG::SVGMouseEventImpl *mev = newMouseEvent(m_doc, KSVG::SVGEventImpl::MOUSEDOWN_EVENT, event);
-
- if(m_doc && m_doc->rootElement())
- m_doc->rootElement()->prepareMouseEvent(event->pos(), event->pos(), mev);
- mev->deref();
-}
-
-void SVGTestWidget::mouseReleaseEvent(TQMouseEvent *event)
-{
- if(!m_panningPos.isNull())
- {
- m_oldPanningPos = m_oldPanningPos - (m_panningPos - event->pos());
- m_panningPos.setX(0);
- m_panningPos.setY(0);
- }
-
- if(event->state() & TQMouseEvent::ControlButton)
- return;
-
- // only simulate mouse clicks for now
- KSVG::SVGMouseEventImpl *mev = newMouseEvent(m_doc, KSVG::SVGEventImpl::MOUSEUP_EVENT, event);
-
- if(m_doc && m_doc->rootElement())
- m_doc->rootElement()->prepareMouseEvent(event->pos(), event->pos(), mev);
- mev->deref();
-}
-
-void SVGTestWidget::keyPressEvent(TQKeyEvent *event)
-{
- if(event->stateAfter() & TQMouseEvent::ControlButton)
- {
- setCursor(KCursor::sizeAllCursor());
- return;
- }
-}
-
-void SVGTestWidget::keyReleaseEvent(TQKeyEvent *event)
-{
- if(event->state() & TQMouseEvent::ControlButton)
- {
- setCursor(KCursor::arrowCursor());
- return;
- }
- SVGSVGElementImpl *root = m_doc->rootElement();
- if(!root) return;
- if(event->key() == TQt::Key_Minus)
- {
- erase(0, 0, m_canvas->width(), m_canvas->height());
- float zoomFactor = root->currentScale() / 1.2;
- root->setCurrentScale(zoomFactor);
- m_doc->syncCachedMatrices();
- m_canvas->update(zoomFactor);
- }
- else if(event->key() == TQt::Key_Plus)
- {
- float zoomFactor = root->currentScale() * 1.2;
- root->setCurrentScale(zoomFactor);
- m_doc->syncCachedMatrices();
- m_canvas->update(zoomFactor);
- }
-}
-*/
-
-// vim:ts=4:noet
diff --git a/ksvg/test/external/SVGTestWidget.cpp b/ksvg/test/external/SVGTestWidget.cpp
new file mode 100644
index 00000000..895b5357
--- /dev/null
+++ b/ksvg/test/external/SVGTestWidget.cpp
@@ -0,0 +1,204 @@
+// Very small test app to look at ksvg performance without konqueror overhead (Rob)
+
+#include "SVGTestWidget.moc"
+#include "DocumentFactory.h"
+#include "CanvasFactory.h"
+#include "SVGCircleElement.h"
+#include "SVGAnimatedLength.h"
+#include "SVGLength.h"
+#include "SVGSVGElement.h"
+#include "SVGEventImpl.h"
+#include "KSVGCanvas.h"
+#include "CanvasItem.h"
+#include <kcursor.h>
+
+using namespace KSVG;
+
+SVGTestWidget::SVGTestWidget(const KURL &url)
+{
+ setBackgroundColor(TQt::white);
+ setMouseTracking(true);
+ setFocusPolicy(TQ_WheelFocus);
+
+ m_doc = DocumentFactory::self()->requestDocument(TQT_TQOBJECT(this), TQT_SLOT(slotRenderingFinished()));
+ if(!m_doc)
+ return;
+
+ resize(450, 450);
+ m_canvas = CanvasFactory::self()->loadCanvas(450, 450);
+ if(!m_canvas)
+ return;
+
+ m_canvas->setup(TQT_TQPAINTDEVICE(this), TQT_TQPAINTDEVICE(this));
+
+ if(!DocumentFactory::self()->attachCanvas(m_canvas, m_doc))
+ return;
+
+ if(!DocumentFactory::self()->startParsing(m_doc, url))
+ return;
+}
+
+SVGTestWidget::~SVGTestWidget()
+{
+ delete m_canvas;
+ delete m_doc;
+}
+
+void SVGTestWidget::slotRenderingFinished()
+{
+ TQRect rect(0, 0, width(), height());
+ m_canvas->blit(rect, true);
+
+ SVGElement test = m_doc->rootElement().getElementById("test");
+ if(test.nodeName() == "circle")
+ {
+ SVGCircleElement c = dom_cast(SVGCircleElement, test);
+ c.r().baseVal().setValue(150);
+ c.setAttribute("fill", "blue");
+ }
+}
+
+void SVGTestWidget::paintEvent(TQPaintEvent *event)
+{
+ m_canvas->update();
+ m_canvas->blit(event->rect(), true);
+}
+
+void SVGTestWidget::resizeEvent(TQResizeEvent *event)
+{
+ int w = event->size().width();
+ int h = event->size().height();
+
+ m_canvas->resize(w, h);
+ resize(w, h);
+ m_canvas->blit();
+}
+/*
+KSVG::SVGMouseEventImpl *newMouseEvent(SVGDocument *doc, KSVG::SVGEventImpl::EventId id, TQMouseEvent *event)
+{
+ DOM::AbstractView temp;
+
+ int clientX = event->x();
+ int clientY = event->y();
+
+ if(doc && doc->rootElement())
+ {
+ clientX = int(clientX / doc->rootElement()->currentScale());
+ clientY = int(clientY / doc->rootElement()->currentScale());
+ }
+
+ int button = 0;
+ if(event->stateAfter() & Qt::LeftButton)
+ button = 1;
+ else if(event->stateAfter() & Qt::MidButton)
+ button = 2;
+ else if(event->stateAfter() & Qt::RightButton)
+ button = 3;
+
+ KSVG::SVGMouseEventImpl *mev = new KSVG::SVGMouseEventImpl(id, // type
+ true, // canBubbleArg
+ true, // cancelableArg
+ temp, // view
+ 0, // detail
+ event->globalX(), //screenXArg
+ event->globalY(), // screenYArg,
+ clientX, // clientXArg
+ clientY, // clientYArg
+ (event->state() & TQt::ControlButton), // ctrlKeyArg
+ (event->state() & TQt::AltButton), // altKeyArg
+ (event->state() & TQt::ShiftButton), // shiftKeyArg
+ (event->state() & TQt::MetaButton), // metaKeyArg
+ button, // buttonArg
+ 0);
+
+ mev->ref();
+
+ return mev;
+}
+
+void SVGTestWidget::mouseMoveEvent(TQMouseEvent *event)
+{
+ if(event->state() & TQMouseEvent::ControlButton && event->state() & TQMouseEvent::LeftButton)
+ {
+ if(m_panningPos.isNull())
+ m_panningPos = event->pos();
+ else
+ {
+ TQPoint panPoint = m_oldPanningPos - (m_panningPos - event->pos());
+ m_doc->rootElement()->setCurrentTranslate(panPoint);
+// m_doc->syncCachedMatrices(); FIXME
+ m_canvas->update(panPoint);
+ }
+ return;
+ }
+ else if(event->state() & TQMouseEvent::ControlButton)
+ return;
+}
+
+void SVGTestWidget::mousePressEvent(TQMouseEvent *event)
+{
+ if(event->state() & TQMouseEvent::ControlButton)
+ return;
+
+ KSVG::SVGMouseEventImpl *mev = newMouseEvent(m_doc, KSVG::SVGEventImpl::MOUSEDOWN_EVENT, event);
+
+ if(m_doc && m_doc->rootElement())
+ m_doc->rootElement()->prepareMouseEvent(event->pos(), event->pos(), mev);
+ mev->deref();
+}
+
+void SVGTestWidget::mouseReleaseEvent(TQMouseEvent *event)
+{
+ if(!m_panningPos.isNull())
+ {
+ m_oldPanningPos = m_oldPanningPos - (m_panningPos - event->pos());
+ m_panningPos.setX(0);
+ m_panningPos.setY(0);
+ }
+
+ if(event->state() & TQMouseEvent::ControlButton)
+ return;
+
+ // only simulate mouse clicks for now
+ KSVG::SVGMouseEventImpl *mev = newMouseEvent(m_doc, KSVG::SVGEventImpl::MOUSEUP_EVENT, event);
+
+ if(m_doc && m_doc->rootElement())
+ m_doc->rootElement()->prepareMouseEvent(event->pos(), event->pos(), mev);
+ mev->deref();
+}
+
+void SVGTestWidget::keyPressEvent(TQKeyEvent *event)
+{
+ if(event->stateAfter() & TQMouseEvent::ControlButton)
+ {
+ setCursor(KCursor::sizeAllCursor());
+ return;
+ }
+}
+
+void SVGTestWidget::keyReleaseEvent(TQKeyEvent *event)
+{
+ if(event->state() & TQMouseEvent::ControlButton)
+ {
+ setCursor(KCursor::arrowCursor());
+ return;
+ }
+ SVGSVGElementImpl *root = m_doc->rootElement();
+ if(!root) return;
+ if(event->key() == TQt::Key_Minus)
+ {
+ erase(0, 0, m_canvas->width(), m_canvas->height());
+ float zoomFactor = root->currentScale() / 1.2;
+ root->setCurrentScale(zoomFactor);
+ m_doc->syncCachedMatrices();
+ m_canvas->update(zoomFactor);
+ }
+ else if(event->key() == TQt::Key_Plus)
+ {
+ float zoomFactor = root->currentScale() * 1.2;
+ root->setCurrentScale(zoomFactor);
+ m_doc->syncCachedMatrices();
+ m_canvas->update(zoomFactor);
+ }
+}
+*/
diff --git a/ksvg/test/external/printnodetest.h b/ksvg/test/external/printnodetest.h
index 6c799000..39903b75 100644
--- a/ksvg/test/external/printnodetest.h
+++ b/ksvg/test/external/printnodetest.h
@@ -29,5 +29,3 @@ private:
}
#endif
-
-// vim:ts=4:noet
diff --git a/ksvg/test/external/svgdisplay.cc b/ksvg/test/external/svgdisplay.cpp
index de1172dc..de1172dc 100644
--- a/ksvg/test/external/svgdisplay.cc
+++ b/ksvg/test/external/svgdisplay.cpp
diff --git a/kuickshow/src/CMakeL10n.txt b/kuickshow/src/CMakeL10n.txt
index 417663ed..e3c8d80a 100644
--- a/kuickshow/src/CMakeL10n.txt
+++ b/kuickshow/src/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "kuickshow" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kuickshow.desktop/"
+ SOURCES kuickshow.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kuickshow/src/CMakeLists.txt b/kuickshow/src/CMakeLists.txt
index 21d145ce..c0b714f9 100644
--- a/kuickshow/src/CMakeLists.txt
+++ b/kuickshow/src/CMakeLists.txt
@@ -18,13 +18,14 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
+ ${IMLIB_LIBRARY_DIRS}
)
##### other data ################################
tde_install_icons( kuickshow )
-install( FILES kuickshow.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( kuickshow.desktop )
##### kuickshow (tdeinit) #######################
diff --git a/kuickshow/src/kuickshow.desktop b/kuickshow/src/kuickshow.desktop
index 802e3212..11d118dd 100644
--- a/kuickshow/src/kuickshow.desktop
+++ b/kuickshow/src/kuickshow.desktop
@@ -1,19 +1,5 @@
[Desktop Entry]
Name=Kuickshow
-Name[af]=Vinnig-vertoon
-Name[ar]=عرض سريع
-Name[eo]=Rapidmontrilo
-Name[fr]=KuickShow
-Name[hi]=क्विक-शो
-Name[it]=KuickShow
-Name[ko]=K퀵쇼
-Name[ne]=क्विकशो
-Name[pt_BR]=KRápida Exibição
-Name[ta]=விரைவுகாட்சி
-Name[th]=ดูภาพด่วน - K
-Name[ven]=Musumbedzo wa kuick
-Name[zh_TW]=Kuickshow 快秀
-Name[zu]=I Kuickshow
Exec=kuickshow %i %m -caption "%c" %U
Icon=kuickshow
Type=Application
@@ -23,71 +9,5 @@ Terminal=false
X-TDE-InitialPreference=6
GenericName=Image Viewer
-GenericName[af]=Beeld Aansig
-GenericName[ar]=عارض صور
-GenericName[bg]=Преглед на изображения
-GenericName[br]=Gweler ar skeudennoù
-GenericName[bs]=Preglednik slika
-GenericName[ca]=Visualitzador d'imatges
-GenericName[cs]=Prohlížeč obrázků
-GenericName[cy]=Gwelydd Delweddau
-GenericName[da]=Billedfremviser
-GenericName[de]=Bildbetrachter
-GenericName[el]=Προβολέας εικόνων
-GenericName[eo]=Bildorigardilo
-GenericName[es]=Visor de imágenes
-GenericName[et]=Pildifailide näitaja
-GenericName[eu]=Irudi ikustailua
-GenericName[fa]=مشاهده‌گر تصویر
-GenericName[fi]=Kuvannäytin
-GenericName[fr]=Afficheur d'images
-GenericName[ga]=Amharcán Íomhánna
-GenericName[gl]=Visor de imaxes
-GenericName[he]=מציג תמונות
-GenericName[hi]=छवि प्रदर्शक
-GenericName[hr]=Preglednik slika
-GenericName[hu]=Képnézegető
-GenericName[is]=Myndaskoðari
-GenericName[it]=Visore di immagini
-GenericName[ja]=画像ビューア
-GenericName[kk]=Кескіндерді қарау
-GenericName[km]=កម្មវិធី​មើល​រូបភាព
-GenericName[lt]=Paveikslėlių žiūriklis
-GenericName[lv]=Attēlu Skatītājs
-GenericName[ms]=Paparan Imej
-GenericName[mt]=Werrej tal-istampi
-GenericName[nb]=Bildefremviser
-GenericName[nds]=Bildkieker
-GenericName[ne]=छवि दर्शक
-GenericName[nl]=Afbeeldingenweergaveprogramma
-GenericName[nn]=Biletvisar
-GenericName[nso]=Molebeledi wa Ponagalo
-GenericName[pa]=ਚਿੱਤਰ ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka obrazków
-GenericName[pt]=Visualizador de Imagens
-GenericName[pt_BR]=Visualizador de Imagens
-GenericName[ro]=Vizualizor de imagini
-GenericName[ru]=Просмотр изображений
-GenericName[rw]=Mugaraza Shusho
-GenericName[se]=Govvačájeheaddji
-GenericName[sk]=Prehliadač obrázkov
-GenericName[sl]=Pregledovalnik slik
-GenericName[sr]=Приказивач слика
-GenericName[sr@Latn]=Prikazivač slika
-GenericName[sv]=Bildvisare
-GenericName[ta]=பிம்ப காட்சி
-GenericName[tg]=Намоиши тасвирот
-GenericName[th]=เครื่องมือแสดงภาพ
-GenericName[tr]=Resim Göstericisi
-GenericName[uk]=Переглядач зображень
-GenericName[uz]=Rasm koʻruvchi
-GenericName[uz@cyrillic]=Расм кўрувчи
-GenericName[ven]=Tshivhoni tsha Mutaleli
-GenericName[wa]=Håyneu d' imådjes
-GenericName[xh]=Umboniseli Womfanekiso
-GenericName[zh_CN]=图片查看程序
-GenericName[zh_HK]=圖像檢視器
-GenericName[zh_TW]=影像檢視程式
-GenericName[zu]=Umbonisi Womfanekiso
X-DCOP-ServiceType=Multi
Categories=Qt;TDE;Graphics;
diff --git a/kview/CMakeL10n.txt b/kview/CMakeL10n.txt
index 5014fb42..18ed9351 100644
--- a/kview/CMakeL10n.txt
+++ b/kview/CMakeL10n.txt
@@ -6,3 +6,9 @@ tde_l10n_create_template(
)
tde_l10n_auto_add_subdirectories( )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kview-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kview/CMakeLists.txt b/kview/CMakeLists.txt
index c038f009..8d6eed7e 100644
--- a/kview/CMakeLists.txt
+++ b/kview/CMakeLists.txt
@@ -31,7 +31,12 @@ link_directories(
##### other data ################################
tde_install_icons( kview )
-install( FILES kview.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE kview.desktop
+ PO_DIR kview-desktops
+)
+
install( FILES kviewui.rc DESTINATION ${DATA_INSTALL_DIR}/kview )
diff --git a/kview/ChangeLog b/kview/ChangeLog
index 15463e2f..e6d62342 100644
--- a/kview/ChangeLog
+++ b/kview/ChangeLog
@@ -94,5 +94,3 @@
added the architectural thoughts I had today
* ChangeLog:
started a ChangeLog (like you can see)
-
-# vim: sw=4 ts=4 tw=80 noet
diff --git a/kview/TODO b/kview/TODO
index e8515db1..2e800234 100644
--- a/kview/TODO
+++ b/kview/TODO
@@ -69,5 +69,3 @@
configuration dialog (or should it be kept - dunno)
- config option to always rotate the image so that it's shown with maximum size
-
-# vim: sw=4 ts=4 tw=80
diff --git a/kview/config/CMakeLists.txt b/kview/config/CMakeLists.txt
index d2649a1c..5fc252ea 100644
--- a/kview/config/CMakeLists.txt
+++ b/kview/config/CMakeLists.txt
@@ -24,7 +24,12 @@ link_directories(
##### other data ################################
-install( FILES kviewgeneralconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog )
+tde_create_translated_desktop(
+ SOURCE kviewgeneralconfig.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog
+ PO_DIR kview-desktops
+)
+
install( FILES kview.setdlg DESTINATION ${DATA_INSTALL_DIR}/kview )
diff --git a/kview/config/kviewconfmodules.cpp b/kview/config/kviewconfmodules.cpp
index 23f800a9..1c2bcec5 100644
--- a/kview/config/kviewconfmodules.cpp
+++ b/kview/config/kviewconfmodules.cpp
@@ -84,7 +84,4 @@ void KViewGeneralConfig::resizeChanged( int pos )
{
emit changed( ( pos != m_savedPosition ) );
}
-
-// vim:sw=4:ts=4
-
#include "kviewconfmodules.moc"
diff --git a/kview/config/kviewconfmodules.h b/kview/config/kviewconfmodules.h
index a22c3dc2..e1cc5047 100644
--- a/kview/config/kviewconfmodules.h
+++ b/kview/config/kviewconfmodules.h
@@ -42,7 +42,4 @@ class KViewGeneralConfig : public TDECModule
TQVButtonGroup * m_pResizeGroup;
int m_savedPosition;
};
-
-// vim:sw=4:ts=4
-
#endif // KVIEWCONFMODULES_H
diff --git a/kview/config/kviewgeneralconfig.desktop b/kview/config/kviewgeneralconfig.desktop
index d9c47429..08cc176c 100644
--- a/kview/config/kviewgeneralconfig.desktop
+++ b/kview/config/kviewgeneralconfig.desktop
@@ -12,120 +12,4 @@ X-TDE-Weight=5
X-TDE-CfgDlgHierarchy=Application
Name=Application
-Name[ar]=التطبيق
-Name[az]=Proqram
-Name[bg]=Програма
-Name[br]=Arload
-Name[bs]=Program
-Name[ca]=Aplicació
-Name[cs]=Aplikace
-Name[cy]=Cymhwysiad
-Name[da]=Program
-Name[de]=Anwendung
-Name[el]=Εφαρμογή
-Name[eo]=Aplikaĵo
-Name[es]=Aplicación
-Name[et]=Rakendus
-Name[eu]=Aplikazioa
-Name[fa]=کاربرد
-Name[fi]=Sovellus
-Name[ga]=Feidhmchlár
-Name[gl]=Aplicación
-Name[he]=יישום
-Name[hi]=अनुप्रयोग
-Name[hr]=Program
-Name[hu]=Alkalmazás
-Name[id]=Aplikasi
-Name[is]=Forrit
-Name[it]=Applicazione
-Name[ja]=アプリケーション
-Name[kk]=Қолданба
-Name[km]=កម្មវិធី
-Name[lt]=Programa
-Name[lv]=Aplikācija
-Name[mk]=Апликација
-Name[ms]=Aplikasi
-Name[mt]=Programm
-Name[nb]=Program
-Name[nds]=Programm
-Name[ne]=अनुप्रयोग
-Name[nl]=Toepassing
-Name[nn]=Program
-Name[pa]=ਕਾਰਜ
-Name[pl]=Program
-Name[pt]=Aplicação
-Name[pt_BR]=Aplicativo
-Name[ro]=Aplicaţie
-Name[ru]=Приложение
-Name[rw]=Porogaramu
-Name[se]=Prográmma
-Name[sk]=Aplikácia
-Name[sl]=Program
-Name[sr]=Програм
-Name[sr@Latn]=Program
-Name[sv]=Program
-Name[ta]=பயன்பாடு
-Name[tg]=Барнома
-Name[th]=แอพพลิเคชัน
-Name[tr]=Uygulama
-Name[uk]=Програма
-Name[uz]=Dastur
-Name[uz@cyrillic]=Дастур
-Name[ven]=Apulifikhesheni
-Name[wa]=Programe
-Name[xh]=Isicelo
-Name[zh_CN]=应用程序
-Name[zh_HK]=應用程式
-Name[zh_TW]=應用程式
-Name[zu]=Isicelo
Comment=Configuration for the standalone Version of KView
-Comment[ar]=اعدادات الاصدار المستقل من KView
-Comment[bg]=Настройки на главната програма
-Comment[bs]=Postavke za samostalnu verziju KView
-Comment[ca]=Configuració per a la versió independent de KView
-Comment[cs]=Nastavení samostatné verze KView
-Comment[cy]=Ffurfweddiad ar gyfer y fersiwn arunigol o KGweld
-Comment[da]=Indstilling af den alenestående udgave af KView
-Comment[de]=Einstellungen für die Anwendung KView
-Comment[el]=Ρύθμιση της standalone έκδοσης του KView
-Comment[eo]=Agordo por la aŭtonoma versio de KView
-Comment[es]=Configuración para la versión independiente de KView
-Comment[et]=KView iseseisva versiooni seadistus
-Comment[eu]=KView programaren konfigurazioa
-Comment[fa]=پیکربندی برای نسخۀ خوداتکای KView
-Comment[fi]=Asetukset itsenäiselle versiolle KView-ohjelmasta
-Comment[fr]=Configuration de la version isolée de KView
-Comment[gl]=Configuración para a versión «standalone» de KView
-Comment[he]=הגדרות עבור הגרסה העצמאית של KView
-Comment[hi]= के-व्यू के स्टैण्डएलोन संस्करण के लिए कॉन्फ़िगरेशन
-Comment[hu]=A KView önállóan futtatható verziójának beállításai
-Comment[is]=Stillingar fyrir KView
-Comment[it]=Configurazione di KView
-Comment[ja]=スタンドアロンバージョンの KView の設定
-Comment[kk]=KView бағдарламасының жеке-дара нұсқасының баптаулары
-Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​សម្រាប់​កំណែ​កម្មវិធី KView រត់​តែ​ឯង
-Comment[lt]=KView kaip nepriklausomos programos konfigūravimas
-Comment[ms]=Konfigurasi untuk Versi tunggal bagi KView
-Comment[nb]=Oppsett av den frittstående utgaven av KView
-Comment[nds]=Instellen för de Enkelverschoon vun KView
-Comment[ne]=केडीई दृश्यको स्यान्डअलोन संस्करणाका लागि कन्फिगरेसन
-Comment[nl]=Instellingen voor KView op zichzelf
-Comment[nn]=Oppsett av den frittståande utgåva av KView
-Comment[pl]=Konfiguracja KView jako osobnego programu
-Comment[pt]=Configuração da versão independente do KView
-Comment[pt_BR]=Configuração para visão independente do KView
-Comment[ro]=Configurare pentru versiunea de sine stătătoare a KView
-Comment[ru]=Настройка самостоятельного приложения KView
-Comment[se]=Heivet KView:a oktosaš veršuvnna
-Comment[sk]=Konfigurácia pre samostatnú verziu KView
-Comment[sl]=Nastavitve za samostojno različico KView
-Comment[sr]=Подешавање за самосталну верзију KView-а
-Comment[sr@Latn]=Podešavanje za samostalnu verziju KView-a
-Comment[sv]=Inställning för fristående version av Kview
-Comment[ta]=கேகாட்சியின் தனிப் பதிப்புக்கான வடிவமைப்பு
-Comment[tg]=Танзимоти барномаи мустақили KView
-Comment[tr]=KView programının yanlız sürümünün ayarları
-Comment[uk]=Налаштування KView, як окремої програми
-Comment[zh_CN]=KView 标准版本的配置
-Comment[zh_HK]=獨立版本的 KView 的設定
-Comment[zh_TW]= KView 單獨執行版本的設定
diff --git a/kview/config/plugins/CMakeLists.txt b/kview/config/plugins/CMakeLists.txt
index 1b1fbec4..9cbbb47a 100644
--- a/kview/config/plugins/CMakeLists.txt
+++ b/kview/config/plugins/CMakeLists.txt
@@ -22,7 +22,11 @@ link_directories(
##### other data ################################
-install( FILES kviewpluginsconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog )
+tde_create_translated_desktop(
+ SOURCE kviewpluginsconfig.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog
+ PO_DIR kview-desktops
+)
##### kcm_kviewpluginsconfig (module) ###########
diff --git a/kview/config/plugins/kviewpluginsconfig.cpp b/kview/config/plugins/kviewpluginsconfig.cpp
index 49c2775f..73d36b77 100644
--- a/kview/config/plugins/kviewpluginsconfig.cpp
+++ b/kview/config/plugins/kviewpluginsconfig.cpp
@@ -40,7 +40,4 @@ KViewPluginsConfig::~KViewPluginsConfig()
{
delete m_config;
}
-
-// vim: sw=4 ts=4 noet
-
#include "kviewpluginsconfig.moc"
diff --git a/kview/config/plugins/kviewpluginsconfig.desktop b/kview/config/plugins/kviewpluginsconfig.desktop
index c90781ad..b598280f 100644
--- a/kview/config/plugins/kviewpluginsconfig.desktop
+++ b/kview/config/plugins/kviewpluginsconfig.desktop
@@ -12,107 +12,4 @@ X-TDE-Weight=6
X-TDE-CfgDlgHierarchy=Application
Name=Plugins
-Name[ar]=البرامج المساعدة
-Name[bg]=Приставки
-Name[br]=Lugantoù
-Name[bs]=Dodaci
-Name[ca]=Connectors
-Name[cs]=Moduly
-Name[cy]=Ategion
-Name[da]=Plugin
-Name[de]=Module
-Name[el]=Πρόσθετα
-Name[eo]=Kromaĵoj
-Name[es]=Extensiones
-Name[et]=Pluginad
-Name[eu]=Pluginak
-Name[fa]=وصله‌ها
-Name[fi]=Liitännäiset
-Name[fr]=Modules externes
-Name[ga]=Breiseáin
-Name[he]=תוספים
-Name[hi]=प्लगइन्स
-Name[hr]=Umetci
-Name[hu]=Bővítőmodulok
-Name[is]=Íforrit
-Name[it]=Plugin
-Name[ja]=プラグイン
-Name[kk]=Плагин модулі
-Name[km]=កម្មវិធី​ជំនួយ
-Name[lt]=Priedai
-Name[ms]=Plugin
-Name[nb]=Programtillegg
-Name[nds]=Modulen
-Name[ne]=प्लगइन
-Name[nn]=Programtillegg
-Name[pa]=ਪਲੱਗਿੰਨ
-Name[pl]=Wtyczki
-Name[pt]='Plugins'
-Name[ro]=Module
-Name[ru]=Модули
-Name[rw]=Amacomeka
-Name[se]=Lassemoduvllat
-Name[sk]=Moduly
-Name[sl]=Vstavki
-Name[sr]=Прикључци
-Name[sr@Latn]=Priključci
-Name[sv]=Insticksprogram
-Name[ta]=சொருகுப்பொருள்
-Name[tg]=Модулҳо
-Name[tr]=Eklentiler
-Name[uk]=Втулки
-Name[uz]=Plaginlar
-Name[uz@cyrillic]=Плагинлар
-Name[wa]=Tchôke-divins
-Name[zh_CN]=插件
-Name[zh_HK]=插件
-Name[zh_TW]=外掛程式
Comment=Choose and Configure Your Plugins
-Comment[bg]=Избор и настройване на приставки
-Comment[br]=Dibabit ha kefluniut ho lugentoù
-Comment[bs]=Izaberite i podesite vaše dodatke
-Comment[ca]=Escolliu i configureu els connectors
-Comment[cs]=Zvolte a nastavte si moduly
-Comment[da]=Vælg og indstil dine plugin
-Comment[de]=Auswahl und Einrichtung der Module
-Comment[el]=Επιλέξτε και ρυθμίστε τα πρόσθετα σας
-Comment[eo]=Elektu kaj agordu viajn kromprogramojn
-Comment[es]=Seleccione y configure sus extensiones
-Comment[et]=Pluginate valimine ja seadistamine
-Comment[eu]=Aukeratu eta konfigurau zure pluginak
-Comment[fa]=وصله‌های خود را انتخاب و پیکربندی کنید
-Comment[fi]=Valitse ja muokkaa liitännäisten asetuksia
-Comment[fr]=Choisissez et configurez vos modules externes
-Comment[gl]=Elexir e Configurar as súas Extensións
-Comment[he]=בחר והגדר את התוספים שלך
-Comment[hu]=Bővítőmodulok kiválasztása, beállítása
-Comment[is]=Velja og stilla íforrit
-Comment[it]=Scegli e configura i tuoi plugin
-Comment[ja]=プラグインを選択して設定します
-Comment[kk]=Плагин модулін таңдап алып баптау
-Comment[km]=ជ្រើស និង​កំណត់​រចនាសម្ព័ន្ធ​កម្មវិធី​ជំនួយ​របស់​អ្នក
-Comment[lt]=Pasirinkite ir konfigūruokite priedus
-Comment[ms]=Pilih dan Konfigur Plugin Anda
-Comment[nb]=Velg og sett opp programtilleggene
-Comment[nds]=Dien Modulen utsöken un instellen
-Comment[ne]=तपाईँको प्लगइन रोज्नुहोस् र कन्फिगर गर्नुहोस्
-Comment[nl]=Kies uw plugins en stel ze in
-Comment[nn]=Vel og set opp programtillegga
-Comment[pl]=Wybór i konfiguracja wtyczek
-Comment[pt]=Escolha e Configure os 'Plugins'
-Comment[pt_BR]=Escolha e Configure os Seus Plugins
-Comment[ro]=Alegeţi şi configuraţi modulele dumneavoastră
-Comment[ru]=Выберите и настройте модули
-Comment[sk]=Vyberte a nastavte si moduly
-Comment[sl]=Izberite in nastavite vstavke
-Comment[sr]=Изаберите и подесите ваше прикључке
-Comment[sr@Latn]=Izaberite i podesite vaše priključke
-Comment[sv]=Välj och anpassa insticksprogram
-Comment[ta]=சொருகுப்பொருள்களைத் தேர்ந்தெடுத்து வடிவமைக்கவும்
-Comment[tr]=Eklentilerinizi Seçin ve Yapılandırın:
-Comment[uk]=Виберіть та налаштуйте ваші втулки
-Comment[uz]=Plaginlarni tanlash va moslash
-Comment[uz@cyrillic]=Плагинларни танлаш ва мослаш
-Comment[zh_CN]=选择并配置您的插件
-Comment[zh_HK]=選擇及設定你的插件
-Comment[zh_TW]=選擇並設定您的外掛程式
diff --git a/kview/config/plugins/kviewpluginsconfig.h b/kview/config/plugins/kviewpluginsconfig.h
index 99ac995b..f326be83 100644
--- a/kview/config/plugins/kviewpluginsconfig.h
+++ b/kview/config/plugins/kviewpluginsconfig.h
@@ -33,7 +33,4 @@ class KViewPluginsConfig : public KSettings::PluginPage
private:
TDEConfig * m_config;
};
-
-// vim: sw=4 ts=4 noet
-
#endif // KVIEWPLUGINSCONFIG_H
diff --git a/kview/kimageviewer/CMakeLists.txt b/kview/kimageviewer/CMakeLists.txt
index e910c560..094da7c8 100644
--- a/kview/kimageviewer/CMakeLists.txt
+++ b/kview/kimageviewer/CMakeLists.txt
@@ -22,9 +22,11 @@ link_directories(
##### other data ################################
-install( FILES
- kimageviewercanvas.desktop kimageviewer.desktop
- DESTINATION ${SERVICETYPES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kimageviewercanvas.desktop kimageviewer.desktop
+ DESTINATION ${SERVICETYPES_INSTALL_DIR}
+ PO_DIR kview-desktops
+)
##### kimageviewer (shared) #####################
diff --git a/kview/kimageviewer/canvas.cpp b/kview/kimageviewer/canvas.cpp
index 9b2c987b..98174503 100644
--- a/kview/kimageviewer/canvas.cpp
+++ b/kview/kimageviewer/canvas.cpp
@@ -31,5 +31,3 @@ namespace KImageViewer
{
}
} //namespace
-
-// vim: sw=4 ts=4
diff --git a/kview/kimageviewer/canvas.h b/kview/kimageviewer/canvas.h
index 2495f372..81417c9f 100644
--- a/kview/kimageviewer/canvas.h
+++ b/kview/kimageviewer/canvas.h
@@ -342,7 +342,4 @@ class KDE_EXPORT Canvas
}; //class Canvas
} //namespace KImageViewer
-
-// vim:sw=4:ts=4
-
#endif // KIMAGEVIEWER_CANVAS_H
diff --git a/kview/kimageviewer/kimageviewer.desktop b/kview/kimageviewer/kimageviewer.desktop
index a6006b98..de82a8bc 100644
--- a/kview/kimageviewer/kimageviewer.desktop
+++ b/kview/kimageviewer/kimageviewer.desktop
@@ -4,60 +4,3 @@ X-TDE-ServiceType=KImageViewer/Viewer
X-TDE-Derived=KParts/ReadWritePart
Icon=image-x-generic
Comment=Embeddable Image Viewer Component
-Comment[af]=Inlegbare Beeld Aansig Komponent
-Comment[ar]=مكون عارض الصور القابل للدمج
-Comment[bg]=Модул за преглед на изображения
-Comment[br]=Parzh gweler skeudennoù enframmus
-Comment[bs]=Ugradiva komponenta za pregled slika
-Comment[ca]=Component visualitzador d'imatges encastable
-Comment[cs]=Komponenta pro zobrazování obrázků
-Comment[cy]=Cydran Mewnadeiladadwy Gwelydd Delweddau
-Comment[da]=Indlejrbar billedviserkomponent
-Comment[de]=Einbettungsfähige Bildbetrachter-Komponente
-Comment[el]=Ενσωματώσιμο συστατικό προβολέα εικόνων
-Comment[eo]=Enkonstruebla bildrigardilo
-Comment[es]=Componente empotrable para visualizar imágenes
-Comment[et]=Põimitav pildifailide näitaja komponent
-Comment[eu]=Irudi ikustailu txertagarri osagaia
-Comment[fa]=مؤلفۀ مشاهده‌گر تصویر نهفته‌شده
-Comment[fi]=Upotettava kuviennäyttökomponentti
-Comment[fr]=Composant afficheur d'images incorporable
-Comment[gl]=Componente de visualización integrable
-Comment[he]=רכיב מציג תמונות בר־הטבעה
-Comment[hi]=एम्बेडेबल छवि प्रदर्शक अवयव
-Comment[hr]=Umetljiva komponenta za gledanje slika
-Comment[hu]=Beágyazható képnézegető komponens
-Comment[is]=Ívefjanleg myndsjá
-Comment[it]=Componente integrabile per la visione di immagini
-Comment[ja]=埋め込み可能な画像ビューアコンポーネント
-Comment[kk]=Ендірілетін кескін қарау компоненті
-Comment[km]=សមាសភាគ​របស់​កម្មវិធី​មើល​រូបភាព​ដែល​អាច​បង្កប់​បាន
-Comment[lt]=Įdedamas piešinių peržiūros komponentas
-Comment[ms]=Komponen Pemapar Imej Boleh Benam
-Comment[nb]=Inkluderbar bildevisningskomponent
-Comment[nds]=Inbettbor Bildkiekerkomponent
-Comment[ne]=सम्मिलित छवि दर्शक अवयव
-Comment[nl]=Ingebed weergavecomponent voor afbeeldingen
-Comment[nn]=Inkluderbart komponent for biletvising
-Comment[nso]=Seripa seo se Robatsegago sa Molebeledi wa Ponagalo
-Comment[pl]=Składnik do przeglądania obrazków
-Comment[pt]=Componente Embebida de Visualização de Imagens
-Comment[pt_BR]=Componente Integrado do Visualizador de Imagens
-Comment[ro]=Componentă înglobată de vizualizare imagini
-Comment[ru]=Встраиваемый компонент просмотра изображений
-Comment[se]=Vuojuhanláhkái govvačájehanoassi
-Comment[sk]=Vložiteľný komponent prehliadač obrázkov
-Comment[sl]=Vključen dodatek za pregled slik
-Comment[sr]=Уградива компонента приказивача слика
-Comment[sr@Latn]=Ugradiva komponenta prikazivača slika
-Comment[sv]=Inbäddningsbar bildvisande komponent
-Comment[ta]=பொதிந்த பிம்ப காட்சி பகுதி
-Comment[tg]=Қисмати дар дохилсозандаи намоиши тасвирот
-Comment[tr]=Gömülebilir Resim Görüntüleme Bileşeni
-Comment[uk]=Вмонтовний компонент перегляду зображень
-Comment[ven]=Tshipida tsha muvhoni wa tshifanyiso tsho dzheniswaho
-Comment[xh]=Ingxenye Yombonisi Womfanekiso Olungisiweyo
-Comment[zh_CN]=可嵌入的图像查看器组件
-Comment[zh_HK]=可嵌入的圖像檢視器元件
-Comment[zh_TW]=可嵌入的影像檢視器元件
-Comment[zu]=Ilunga Lombukisi Wesithombe Esixubeneyo
diff --git a/kview/kimageviewer/kimageviewercanvas.desktop b/kview/kimageviewer/kimageviewercanvas.desktop
index 780b97be..71d360ed 100644
--- a/kview/kimageviewer/kimageviewercanvas.desktop
+++ b/kview/kimageviewer/kimageviewercanvas.desktop
@@ -2,59 +2,3 @@
Type=ServiceType
X-TDE-ServiceType=KImageViewer/Canvas
Comment=Embeddable Image Viewer Canvas (widget that shows an image)
-Comment[af]=Inlegbare Beeld Aansig Kanvas (gui-element wat vertoon 'n Beeld)
-Comment[ar]= مساحة رسم لعرض الصور قابلة للدمج (كائن يعرض صورة)
-Comment[bg]=Модул за преглед на изображения (полето, в което се показва самото изображение)
-Comment[bs]=Ugradiva pozadina za pregled slika (grafički element koji prikazuje slike)
-Comment[ca]=Llenç visualitzador d'imatges encastable (estri que mostra una imatge)
-Comment[cs]=Pohltitelná komponenta pro zobrazování obrázků
-Comment[cy]=Cynfas Mewnadeiladadwy Gwelydd Delweddau (celfigyn sy'n dangos delwedd)
-Comment[da]=Indlejrbar billedviserlærred (kontrol der viser et billede)
-Comment[de]=Einbettungsfähiges Bildbetrachtermodul (Bildschirmausschnitt, der ein Bild anzeigt)
-Comment[el]=Ενσωματώσιμος Καμβάς Προβολής Εικόνων (γραφικό συστατικό που εμφανίζει μία εικόνα)
-Comment[eo]=Enkonstruebla bildrigardilo kromaĵo
-Comment[es]=Componente empotrable para visualizar lienzos (widget que muestra una imagen)
-Comment[et]=Põimitavad pildifailide näitaja lõuendid (element, mis näitab pilti)
-Comment[eu]=Irudi ikustailu txertagarriren ohila (irudi bat erakuts dezakeen tresnatxoa)
-Comment[fa]=صفحۀ مجازی مشاهده‌گر تصویر نهفته‌‌شده )عنصری که یک تصویر را نمایش می‌دهد)
-Comment[fi]=Upotettava kuviennäyttökomponentti (käyttöliittymäelementti joka näyttää kuvan)
-Comment[fr]=Composant afficheur d'images incorporable (widget qui affiche une image)
-Comment[gl]=Visor de imaxes integrado (complemento que amosa unha imaxe)
-Comment[he]=רכיב מציג תמונות בר־הטבעה (פריט המציג תמונה)
-Comment[hi]=एम्बेडेबल छवि प्रदर्शक केनवास (विजेट जो छवि दिखाता है)
-Comment[hr]=Umetljivo platno za pregled slika (widget koji pokazuje sliku)
-Comment[hu]=Beágyazható képnézegető objektum (képmegjelenítő)
-Comment[is]=Ívefjanleg myndsjá (græja sem birtir mynd)
-Comment[it]=Componente integrabile per la visione di immagini (widget che mostra un'immagine)
-Comment[ja]=埋め込み可能な画像ビューアキャンバス (画像を表示するウィジェット)
-Comment[kk]=Кескін қарауға арналған ендірілетін өріс (кескінді көрсететін бөлшегі)
-Comment[km]=ផ្នែក​របស់​កម្មវិធី​មើល​រូបភាព​ដែល​អាច​បង្កប់​បាន (ផ្នែក​ដែល​បង្ហាញ​រូបភាព)
-Comment[lt]=Įdedamas piešinių peržiūros paveikslas (valdiklis, kuris rodo paveikslėlį)
-Comment[ms]=Kanvas Pemapar Imej Boleh Benam (widget yang memaparkan imej)
-Comment[nb]=Inkluderbare bildevisningskomponenter (skjermelement som viser et bilde)
-Comment[nds]=Inbettbor Bildkieker-Rahmen (Element, dat en Bild wiest)
-Comment[ne]=सम्मिलित छवि दर्शक क्यानभास (छवि देखाउने विजेट)
-Comment[nl]=Ingebed weergave-canvas (widget die een afbeelding toont)
-Comment[nn]=Inkluderbart lerret for biletvising (skjermelement som viser eit bilete)
-Comment[nso]=Canvas yeo e Robatsegago ya Molebeledi wa Ponagalo (widget yeo e bontshago ponagalo)
-Comment[pl]=Obszar do przeglądania obrazków (wnętrze okienka, które pokazuje obrazek)
-Comment[pt]=Área de Visualização Embebida de Imagens (um item que mostra uma imagem)
-Comment[pt_BR]=Componente Integrado do Visualizador Canvas (componente que exibe uma imagem)
-Comment[ro]=Componentă înglobată de vizualizare imagini (widget)
-Comment[ru]=Встраиваемый элемент просмотра изображений (просмотр изображения в виджете)
-Comment[se]=Vuojuhahtti govvačájehanliinni (áhtá mii čájeha gova)
-Comment[sk]=Vložiteľný komponent prehliadač obrázkov (prvok, ktorý zobrazuje obrázky)
-Comment[sl]=Vključljivo platno za pregled slik (gradnik, ki prikaže sliko)
-Comment[sr]=Уградиво платно приказивача слика (контрола која показује слику)
-Comment[sr@Latn]=Ugradivo platno prikazivača slika (kontrola koja pokazuje sliku)
-Comment[sv]=Inbäddningsbar bildvisande duk (komponent som visar en bild)
-Comment[ta]=பொதிந்த பிம்ப காட்சி திரைவடிவம்(சாளரம் ஒரு பிம்பத்தை காட்டுகிறது)
-Comment[tg]=Ҷузъи дар дохилсозандаи намоиши тасвирот (намоиши тасвирот дар виджет)
-Comment[tr]=Gömülebilir Resim Görüntüleme Penceresi
-Comment[uk]=Вмонтовний компонент полотна перегляду зображень (віджет, що малює зображення)
-Comment[ven]=Muvhala wa muvhoni wa tshifanyiso tsho dzheniswaho (tshishumiswa tsha vhuthogwa tshine tsha sumbedza tshifanyiso)
-Comment[xh]=Iseyile Yombonisi Womfanekiso Olungisiweyo (widget ebonisa umfanekiso)
-Comment[zh_CN]=可嵌入的图像查看画布(显示图像的部件)
-Comment[zh_HK]=可嵌入的圖像檢視器畫布(顯示圖像的器件)
-Comment[zh_TW]=可嵌入的影像檢視器畫布(顯示影像的界面工具)
-Comment[zu]=Inkalivasi Yombukisi Wesithombe Esixubeneyo (i-widget ekhombisa isithombe)
diff --git a/kview/kimageviewer/viewer.cpp b/kview/kimageviewer/viewer.cpp
index 1a5890d6..4f3771b8 100644
--- a/kview/kimageviewer/viewer.cpp
+++ b/kview/kimageviewer/viewer.cpp
@@ -33,4 +33,3 @@ namespace KImageViewer
} //namespace
#include "viewer.moc"
-// vim: sw=4 ts=4
diff --git a/kview/kimageviewer/viewer.h b/kview/kimageviewer/viewer.h
index 790a102c..46e1a548 100644
--- a/kview/kimageviewer/viewer.h
+++ b/kview/kimageviewer/viewer.h
@@ -94,7 +94,4 @@ class KDE_EXPORT Viewer : public KParts::ReadWritePart
}; //class Viewer
} //namespace KImageViewer
-
-// vim:sw=4:ts=4
-
#endif // KIMAGEVIEWER_VIEWER_H
diff --git a/kview/kview.cpp b/kview/kview.cpp
index d8af5f25..063a0e14 100644
--- a/kview/kview.cpp
+++ b/kview/kview.cpp
@@ -691,8 +691,5 @@ void KView::statusbarToggled( bool sbvisible )
kdDebug( 4600 ) << k_funcinfo << sbvisible << endl;
m_pViewer->setProgressInfoEnabled( !sbvisible );
}
-
-// vim:sw=4:ts=4
-
#include "kview.moc"
diff --git a/kview/kview.desktop b/kview/kview.desktop
index 3c0fd8f2..aee0b897 100644
--- a/kview/kview.desktop
+++ b/kview/kview.desktop
@@ -6,89 +6,8 @@ Path=
X-DocPath=kview/index.html
Terminal=false
GenericName=Image Viewer
-GenericName[af]=Beeld Aansig
-GenericName[ar]=عارض صور
-GenericName[bg]=Преглед на изображения
-GenericName[br]=Gweler ar skeudennoù
-GenericName[bs]=Preglednik slika
-GenericName[ca]=Visualitzador d'imatges
-GenericName[cs]=Prohlížeč obrázků
-GenericName[cy]=Gwelydd Delweddau
-GenericName[da]=Billedfremviser
-GenericName[de]=Bildbetrachter
-GenericName[el]=Προβολέας εικόνων
-GenericName[eo]=Bildorigardilo
-GenericName[es]=Visor de imágenes
-GenericName[et]=Pildifailide näitaja
-GenericName[eu]=Irudi ikustailua
-GenericName[fa]=مشاهده‌گر تصویر
-GenericName[fi]=Kuvannäytin
-GenericName[fr]=Afficheur d'images
-GenericName[ga]=Amharcán Íomhánna
-GenericName[gl]=Visor de imaxes
-GenericName[he]=מציג תמונות
-GenericName[hi]=छवि प्रदर्शक
-GenericName[hr]=Preglednik slika
-GenericName[hu]=Képnézegető
-GenericName[is]=Myndaskoðari
-GenericName[it]=Visore di immagini
-GenericName[ja]=画像ビューア
-GenericName[kk]=Кескіндерді қарау
-GenericName[km]=កម្មវិធី​មើល​រូបភាព
-GenericName[lt]=Paveikslėlių žiūriklis
-GenericName[lv]=Attēlu Skatītājs
-GenericName[ms]=Paparan Imej
-GenericName[mt]=Werrej tal-istampi
-GenericName[nb]=Bildefremviser
-GenericName[nds]=Bildkieker
-GenericName[ne]=छवि दर्शक
-GenericName[nl]=Afbeeldingenweergaveprogramma
-GenericName[nn]=Biletvisar
-GenericName[nso]=Molebeledi wa Ponagalo
-GenericName[pa]=ਚਿੱਤਰ ਦਰਸ਼ਕ
-GenericName[pl]=Przeglądarka obrazków
-GenericName[pt]=Visualizador de Imagens
-GenericName[pt_BR]=Visualizador de Imagens
-GenericName[ro]=Vizualizor de imagini
-GenericName[ru]=Просмотр изображений
-GenericName[rw]=Mugaraza Shusho
-GenericName[se]=Govvačájeheaddji
-GenericName[sk]=Prehliadač obrázkov
-GenericName[sl]=Pregledovalnik slik
-GenericName[sr]=Приказивач слика
-GenericName[sr@Latn]=Prikazivač slika
-GenericName[sv]=Bildvisare
-GenericName[ta]=பிம்ப காட்சி
-GenericName[tg]=Намоиши тасвирот
-GenericName[th]=เครื่องมือแสดงภาพ
-GenericName[tr]=Resim Göstericisi
-GenericName[uk]=Переглядач зображень
-GenericName[uz]=Rasm koʻruvchi
-GenericName[uz@cyrillic]=Расм кўрувчи
-GenericName[ven]=Tshivhoni tsha Mutaleli
-GenericName[wa]=Håyneu d' imådjes
-GenericName[xh]=Umboniseli Womfanekiso
-GenericName[zh_CN]=图片查看程序
-GenericName[zh_HK]=圖像檢視器
-GenericName[zh_TW]=影像檢視程式
-GenericName[zu]=Umbonisi Womfanekiso
MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/x-bmp;image/png;image/x-ico;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap;image/tiff;image/jp2;
Name=KView
-Name[af]=K-bekyk
-Name[ar]=برنامج KView
-Name[cy]=KGweld
-Name[eo]=Rigardilo
-Name[hi]=के-व्यू
-Name[hr]=Preglednik slika
-Name[lv]=KSkatīt
-Name[ne]=केडीई दर्शक
-Name[pl]=Przeglądarka obrazków
-Name[pt_BR]=KVisualização
-Name[sv]=Kview
-Name[ta]=கேகாட்சி
-Name[th]=ดูภาพ - K
-Name[ven]=U vhona ha K
-Name[zh_TW]=KView 檢視器
X-TDE-InitialPreference=3
X-TDE-StartupNotify=true
X-DCOP-ServiceType=Multi
diff --git a/kview/kview.h b/kview/kview.h
index 24b94a00..017a3132 100644
--- a/kview/kview.h
+++ b/kview/kview.h
@@ -119,7 +119,4 @@ class KView : public KParts::MainWindow
KProgress * m_pProgressBar;
};
-
-// vim:sw=4:ts=4
-
#endif // KVIEW_H
diff --git a/kview/kviewcanvas/CMakeLists.txt b/kview/kviewcanvas/CMakeLists.txt
index 3b8f4704..2c62d6eb 100644
--- a/kview/kviewcanvas/CMakeLists.txt
+++ b/kview/kviewcanvas/CMakeLists.txt
@@ -25,7 +25,11 @@ link_directories(
##### other data ################################
-install( FILES kviewcanvas.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kviewcanvas.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kview-desktops
+)
##### libkviewcanvas (module) ###################
diff --git a/kview/kviewcanvas/ChangeLog b/kview/kviewcanvas/ChangeLog
index 73d74094..2d2ccd65 100644
--- a/kview/kviewcanvas/ChangeLog
+++ b/kview/kviewcanvas/ChangeLog
@@ -14,5 +14,3 @@
* kimagecanvas.{h,cpp}:
New method boundImageTo( QSize ). Fits the image into the
requested width and height.
-
-# vim: sw=4 ts=4 tw=80 noet
diff --git a/kview/kviewcanvas/config/CMakeLists.txt b/kview/kviewcanvas/config/CMakeLists.txt
index fc094083..eb730680 100644
--- a/kview/kviewcanvas/config/CMakeLists.txt
+++ b/kview/kviewcanvas/config/CMakeLists.txt
@@ -22,9 +22,11 @@ link_directories(
##### other data ################################
-install( FILES
- kviewcanvasconfig.desktop
- DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog )
+tde_create_translated_desktop(
+ SOURCE kviewcanvasconfig.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog
+ PO_DIR kview-desktops
+)
##### kcm_kviewcanvasconfig (module) ############
diff --git a/kview/kviewcanvas/config/confmodules.cpp b/kview/kviewcanvas/config/confmodules.cpp
index 55efba65..ec43813b 100644
--- a/kview/kviewcanvas/config/confmodules.cpp
+++ b/kview/kviewcanvas/config/confmodules.cpp
@@ -139,7 +139,4 @@ void KViewCanvasConfig::configChanged()
{
emit changed( true );
}
-
-// vim:sw=4:ts=4
-
#include "confmodules.moc"
diff --git a/kview/kviewcanvas/config/confmodules.h b/kview/kviewcanvas/config/confmodules.h
index eaf40539..3d3b9e7f 100644
--- a/kview/kviewcanvas/config/confmodules.h
+++ b/kview/kviewcanvas/config/confmodules.h
@@ -46,7 +46,4 @@ class KViewCanvasConfig : public TDECModule
GeneralConfigWidget * m_pWidget;
TQPtrList<TQCheckListItem> m_items;
};
-
-// vim:sw=4:ts=4
-
#endif // CONFMODULES_H
diff --git a/kview/kviewcanvas/config/defaults.h b/kview/kviewcanvas/config/defaults.h
index 4d309585..38ed2c83 100644
--- a/kview/kviewcanvas/config/defaults.h
+++ b/kview/kviewcanvas/config/defaults.h
@@ -42,5 +42,3 @@ namespace Defaults {
}
#endif // DEFAULTS_H
-
-// vim: sw=4 ts=4
diff --git a/kview/kviewcanvas/config/kviewcanvasconfig.desktop b/kview/kviewcanvas/config/kviewcanvasconfig.desktop
index 03afec2a..d631eff2 100644
--- a/kview/kviewcanvas/config/kviewcanvasconfig.desktop
+++ b/kview/kviewcanvas/config/kviewcanvasconfig.desktop
@@ -12,107 +12,4 @@ X-TDE-Weight=1
X-TDE-CfgDlgHierarchy=Viewer
Name=Viewer
-Name[ar]=العارض
-Name[bg]=Визуализатор
-Name[br]=Gweler
-Name[bs]=Preglednik
-Name[ca]=Visualitzador
-Name[cs]=Prohlížeč
-Name[cy]=Gwelydd
-Name[da]=Fremviser
-Name[de]=Betrachter
-Name[el]=Προβολέας
-Name[eo]=Rigardilo
-Name[es]=Visor
-Name[et]=Näitaja
-Name[eu]=Ikustailua
-Name[fa]=مشاهده‌گر
-Name[fi]=Näytin
-Name[fr]=Afficheur
-Name[gl]=Visor
-Name[he]=מציג
-Name[hi]=प्रदर्शक
-Name[hu]=Nézegető
-Name[is]=Birtir
-Name[it]=Visore
-Name[ja]=ビューア
-Name[kk]=Кескінді қарау
-Name[km]=កម្មវិធី​មើល
-Name[lt]=Žiūriklis
-Name[ms]=Pemapar
-Name[nb]=Fremviser
-Name[nds]=Kieker
-Name[ne]=दर्शक
-Name[nl]=Weergaveprogramma
-Name[nn]=Framvisar
-Name[pa]=ਦਰਸ਼ਕ
-Name[pl]=Przeglądarka obrazków
-Name[pt]=Visualizador
-Name[pt_BR]=Visualizador
-Name[ro]=Vizualizor
-Name[ru]=Просмотрщик
-Name[se]=Čájeheaddji
-Name[sk]=Prehliadač
-Name[sl]=Pregledovalnik
-Name[sr]=Приказивач
-Name[sr@Latn]=Prikazivač
-Name[sv]=Visning
-Name[ta]=காட்சி
-Name[tg]=Намоишгар
-Name[tr]=Görüntüleyici
-Name[uk]=Переглядач
-Name[uz]=Koʻruvchi
-Name[uz@cyrillic]=Кўрувчи
-Name[wa]=Håyneu
-Name[zh_CN]=查看器
-Name[zh_HK]=檢視器
Comment=General KViewCanvas Configuration
-Comment[ar]=اعدادات KViewCanvas العامة
-Comment[bg]=Общи настройки на визуализатора (KViewCanvas)
-Comment[bs]=Opšte KViewCanvas postavke
-Comment[ca]=Configuració general de KViewCanvas
-Comment[cs]=Obecné nastavení KView
-Comment[cy]=Ffurfweddiad Cyffredinol KGweldCynfas
-Comment[da]=Generel indstilling af KViewCanvas
-Comment[de]=Allgemeine Einstellungen für KViewCanvas
-Comment[el]=Γενική ρύθμιση του KViewCanvas
-Comment[eo]=Ĝenerala Agordo de KViewCanvas
-Comment[es]=Configuración general de KViewCanvas
-Comment[et]=KView lõuendite üldine seadistus
-Comment[eu]=KViewCanvas konfigurazio orokorra
-Comment[fa]=پیکربندی عمومی KViewCanvas
-Comment[fi]=Yleiset KViewCanvas -asetukset
-Comment[fr]=Configuration générale de KViewCanvas
-Comment[gl]=Configuración xeral de KViewCanvas
-Comment[he]=הגדרות KViewCanvas כלליות
-Comment[hi]=सामान्य के-व्यू-केनवास कॉन्फ़िगरेशन
-Comment[hu]=A KViewCanvas általános beállításai
-Comment[is]=Almennar stillingar KViewCanvas
-Comment[it]=Configurazione generale per KViewCanvas
-Comment[ja]=KViewCanvas の一般的な設定
-Comment[kk]=KViewCanvas өрісінің жалпы баптаулары
-Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ទូទៅ​សម្រាប់ KViewCanvas
-Comment[lt]=Bendrasis KViewCanvas konfigūravimas
-Comment[ms]=Konfigurasi KViewCanvas Umum
-Comment[nb]=Generelt oppsett av KViewCanvas
-Comment[nds]=Allgemeen Instellen för KViewCanvas
-Comment[ne]=साधारण केडीई दृश्य क्यानभास कन्फिगरेसन
-Comment[nl]=Algemene KViewCanvas instellingen
-Comment[nn]=Generelt oppsett av KViewCanvas
-Comment[pl]=Ogólna konfiguracja KViewCanvas
-Comment[pt]=Configuração Geral do KViewCanvas
-Comment[pt_BR]=Configuração Geral do Canvas com o KView
-Comment[ro]=Configurare KViewCanvas general
-Comment[ru]=Общая настройка KViewCanvas
-Comment[sk]=Všeobecné nastavenie KViewCanvas
-Comment[sl]=Splošne nastavitve KViewCanvas
-Comment[sr]=Општа подешавања за KViewCanvas
-Comment[sr@Latn]=Opšta podešavanja za KViewCanvas
-Comment[sv]=Allmän inställning av Kviews duk
-Comment[ta]=பொதுவான கேகாட்சி சித்திரவடிவ வடிவமைப்பு
-Comment[tg]=Танзимоти умумии KViewCanvas
-Comment[tr]=Genel KView Ekran Ayarları
-Comment[uk]=Загальні параметри KViewCanvas
-Comment[zh_CN]=KViewCanvas 常规配置
-Comment[zh_HK]=一般 KViewCanvas 設定
-Comment[zh_TW]=一般 KViewCanvas 設定
diff --git a/kview/kviewcanvas/kimagecanvas.cpp b/kview/kviewcanvas/kimagecanvas.cpp
index 32260a45..8c203478 100644
--- a/kview/kviewcanvas/kimagecanvas.cpp
+++ b/kview/kviewcanvas/kimagecanvas.cpp
@@ -949,5 +949,3 @@ KImageHolder * KImageCanvas::createNewClient()
}
#include "kimagecanvas.moc"
-
-// vim:sw=4:ts=4
diff --git a/kview/kviewcanvas/kimagecanvas.h b/kview/kviewcanvas/kimagecanvas.h
index 39ff28b6..77cd4e19 100644
--- a/kview/kviewcanvas/kimagecanvas.h
+++ b/kview/kviewcanvas/kimagecanvas.h
@@ -361,7 +361,4 @@ class KDE_EXPORT KImageCanvas : public TQScrollView, public KImageViewer::Canvas
TQRect m_selection; //unzoomed selection rect
};
-
-// vim:sw=4:ts=4
-
#endif // _KIMAGECANVAS_H
diff --git a/kview/kviewcanvas/kimageholder.cpp b/kview/kviewcanvas/kimageholder.cpp
index b34cfab2..62eaeea2 100644
--- a/kview/kviewcanvas/kimageholder.cpp
+++ b/kview/kviewcanvas/kimageholder.cpp
@@ -367,5 +367,3 @@ const KPixmap & KImageHolder::checkboardPixmap()
}
#include "kimageholder.moc"
-
-// vim:sw=4:ts=4
diff --git a/kview/kviewcanvas/kimageholder.h b/kview/kviewcanvas/kimageholder.h
index c33073a8..347d9c74 100644
--- a/kview/kviewcanvas/kimageholder.h
+++ b/kview/kviewcanvas/kimageholder.h
@@ -100,7 +100,4 @@ class KImageHolder : public TQWidget
KPixmap * m_pDoubleBuffer;
KPixmap * m_pCheckboardPixmap;
};
-
-// vim:sw=4:ts=4
-
#endif // _KIMAGEHOLDER_H
diff --git a/kview/kviewcanvas/kviewcanvas.desktop b/kview/kviewcanvas/kviewcanvas.desktop
index 84c65d71..09cc3cef 100644
--- a/kview/kviewcanvas/kviewcanvas.desktop
+++ b/kview/kviewcanvas/kviewcanvas.desktop
@@ -1,63 +1,6 @@
[Desktop Entry]
Type=Service
Name=KView Image Viewer Widget
-Name[af]=K-bekyk Beeld Aansig Gui-element
-Name[ar]=كائن عارض الصور KView
-Name[br]=Widget gweler skeudennoù KView
-Name[bs]=KView predglednik slika - grafički element
-Name[ca]=Estri visualitzador d'imatges KView
-Name[cs]=Komponenta prohlížeče obrázků KView
-Name[cy]=Celfigyn Gwelydd Delweddau KGweld
-Name[da]=KView-billedviserkontrol
-Name[de]=KView Bildanzeige-Bildschirmausschnitt
-Name[el]=Γραφικό συστατικό προβολέα εικόνων του KView
-Name[eo]=Bildrigardilo fenestro
-Name[es]=Widget visor de imágenes de KView
-Name[et]=KView pildifailide näitaja element
-Name[eu]=KView irudi ikustailu botoia
-Name[fa]=عنصر مشاهده‌گر تصویر KView
-Name[fi]=KView-kuviennäyttökomponentti
-Name[fr]=Widget visualisateur d'images KView
-Name[gl]=Complemento do visor de Imaxes KView
-Name[he]=פריט מציג תמונות ל־KView
-Name[hi]=के-व्यू छवि प्रदर्शक विजेट
-Name[hr]=KView widget za pregled slika
-Name[hu]=KView képnézegető grafikus elem
-Name[is]=KView myndbirtigræja
-Name[it]=Widget visore immagini KView
-Name[ja]=KView 画像ビューアウィジェット
-Name[kk]=KView кескінді көрсететін бөлшегі
-Name[km]=ធាតុ​ក្រាហ្វិក​កម្មវិធី​មើល​រូបភាព KView
-Name[lt]=KView paveikslėlių žiūriklio valdiklis
-Name[ms]=Widget Pemapar Imej KView
-Name[nb]=KView bilde-fremviserelement
-Name[nds]=KView-Bildkiekrahmen
-Name[ne]=केडीई दृश्य छवि दर्शक विजेट
-Name[nl]=KView afbeeldingwidget
-Name[nn]=KView biletvisarelement
-Name[nso]=KView Widget ya Molebeledi wa Ponagalo
-Name[pl]=Okienko przeglądarki obrazków KView
-Name[pt]=Elemento de Visualização de Imagens do KView
-Name[pt_BR]=Componente de Visualização de Imagens do KVisualização
-Name[ro]=Widget vizualizare imagini KView
-Name[ru]=Виджет с просмотром изображения KView
-Name[se]=KView govvačájehanáhta
-Name[sk]=Prvok prehliadača obrázkov KView
-Name[sl]=Gradnik pregledovalnika slik KView
-Name[sr]=KView, контрола за приказ слика
-Name[sr@Latn]=KView, kontrola za prikaz slika
-Name[sv]=Kview bildvisande komponent
-Name[ta]=கேகாட்சி பிம்பக் காட்சி சாளரம்
-Name[tg]=Виджет бо намоиши тасвироти KView
-Name[tr]=KView Resim Görüntüleme Parçacığı
-Name[uk]=Віджет переглядача зображень KView
-Name[ven]=Tshishumiswa tsha vhuthogwa tsha muvhoni wa tshifanyiso tsha mbonalelo ya K
-Name[wa]=Ahesse håyneu d' imådjes KView
-Name[xh]=Widget Yombonisi Womfanekiso we KView
-Name[zh_CN]=KView 图像查看器部件
-Name[zh_HK]=KView 圖像檢視器器件
-Name[zh_TW]=KView 影像檢視器界面工具
-Name[zu]=I-widget Yombukisi Wesithombe se-KView
X-TDE-Library=libkviewcanvas
X-TDE-InitialPreference=2
X-TDE-ServiceTypes=KImageViewer/Canvas
diff --git a/kview/kviewviewer/CMakeLists.txt b/kview/kviewviewer/CMakeLists.txt
index 78829f61..61e738fb 100644
--- a/kview/kviewviewer/CMakeLists.txt
+++ b/kview/kviewviewer/CMakeLists.txt
@@ -25,7 +25,12 @@ link_directories(
##### other data ################################
-install( FILES kviewviewer.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE kviewviewer.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kview-desktops
+)
+
install( FILES kviewviewer.rc kviewviewer_ro.rc kviewpopup.rc DESTINATION ${DATA_INSTALL_DIR}/kviewviewer )
diff --git a/kview/kviewviewer/ChangeLog b/kview/kviewviewer/ChangeLog
index e76a70cd..67951dda 100644
--- a/kview/kviewviewer/ChangeLog
+++ b/kview/kviewviewer/ChangeLog
@@ -64,5 +64,3 @@
* kviewviewer.{cpp,h,rc}, kviewviewer_ro.rc:
added "rotate clockwise" and changed icon of CCW (patch by
Adriaan de Groot)
-
-# vim: sw=4 ts=4 tw=80 noet
diff --git a/kview/kviewviewer/config/CMakeLists.txt b/kview/kviewviewer/config/CMakeLists.txt
index 10b5b05f..7ab9ee80 100644
--- a/kview/kviewviewer/config/CMakeLists.txt
+++ b/kview/kviewviewer/config/CMakeLists.txt
@@ -22,9 +22,11 @@ link_directories(
##### other data ################################
-install( FILES
- kviewviewerpluginsconfig.desktop
- DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog )
+tde_create_translated_desktop(
+ SOURCE kviewviewerpluginsconfig.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog
+ PO_DIR kview-desktops
+)
##### kcm_kviewviewerpluginsconfig (module) #####
diff --git a/kview/kviewviewer/config/kviewviewerpluginsconfig.cpp b/kview/kviewviewer/config/kviewviewerpluginsconfig.cpp
index af444cdd..d6d9a2d6 100644
--- a/kview/kviewviewer/config/kviewviewerpluginsconfig.cpp
+++ b/kview/kviewviewer/config/kviewviewerpluginsconfig.cpp
@@ -42,7 +42,4 @@ KViewViewerPluginsConfig::~KViewViewerPluginsConfig()
{
delete m_config;
}
-
-// vim: sw=4 ts=4 noet
-
#include "kviewviewerpluginsconfig.moc"
diff --git a/kview/kviewviewer/config/kviewviewerpluginsconfig.desktop b/kview/kviewviewer/config/kviewviewerpluginsconfig.desktop
index b53d17ec..f76996cd 100644
--- a/kview/kviewviewer/config/kviewviewerpluginsconfig.desktop
+++ b/kview/kviewviewer/config/kviewviewerpluginsconfig.desktop
@@ -12,107 +12,4 @@ X-TDE-Weight=2
X-TDE-CfgDlgHierarchy=Viewer
Name=Plugins
-Name[ar]=البرامج المساعدة
-Name[bg]=Приставки
-Name[br]=Lugantoù
-Name[bs]=Dodaci
-Name[ca]=Connectors
-Name[cs]=Moduly
-Name[cy]=Ategion
-Name[da]=Plugin
-Name[de]=Module
-Name[el]=Πρόσθετα
-Name[eo]=Kromaĵoj
-Name[es]=Extensiones
-Name[et]=Pluginad
-Name[eu]=Pluginak
-Name[fa]=وصله‌ها
-Name[fi]=Liitännäiset
-Name[fr]=Modules externes
-Name[ga]=Breiseáin
-Name[he]=תוספים
-Name[hi]=प्लगइन्स
-Name[hr]=Umetci
-Name[hu]=Bővítőmodulok
-Name[is]=Íforrit
-Name[it]=Plugin
-Name[ja]=プラグイン
-Name[kk]=Плагин модулі
-Name[km]=កម្មវិធី​ជំនួយ
-Name[lt]=Priedai
-Name[ms]=Plugin
-Name[nb]=Programtillegg
-Name[nds]=Modulen
-Name[ne]=प्लगइन
-Name[nn]=Programtillegg
-Name[pa]=ਪਲੱਗਿੰਨ
-Name[pl]=Wtyczki
-Name[pt]='Plugins'
-Name[ro]=Module
-Name[ru]=Модули
-Name[rw]=Amacomeka
-Name[se]=Lassemoduvllat
-Name[sk]=Moduly
-Name[sl]=Vstavki
-Name[sr]=Прикључци
-Name[sr@Latn]=Priključci
-Name[sv]=Insticksprogram
-Name[ta]=சொருகுப்பொருள்
-Name[tg]=Модулҳо
-Name[tr]=Eklentiler
-Name[uk]=Втулки
-Name[uz]=Plaginlar
-Name[uz@cyrillic]=Плагинлар
-Name[wa]=Tchôke-divins
-Name[zh_CN]=插件
-Name[zh_HK]=插件
-Name[zh_TW]=外掛程式
Comment=Choose and Configure Your Plugins
-Comment[bg]=Избор и настройване на приставки
-Comment[br]=Dibabit ha kefluniut ho lugentoù
-Comment[bs]=Izaberite i podesite vaše dodatke
-Comment[ca]=Escolliu i configureu els connectors
-Comment[cs]=Zvolte a nastavte si moduly
-Comment[da]=Vælg og indstil dine plugin
-Comment[de]=Auswahl und Einrichtung der Module
-Comment[el]=Επιλέξτε και ρυθμίστε τα πρόσθετα σας
-Comment[eo]=Elektu kaj agordu viajn kromprogramojn
-Comment[es]=Seleccione y configure sus extensiones
-Comment[et]=Pluginate valimine ja seadistamine
-Comment[eu]=Aukeratu eta konfigurau zure pluginak
-Comment[fa]=وصله‌های خود را انتخاب و پیکربندی کنید
-Comment[fi]=Valitse ja muokkaa liitännäisten asetuksia
-Comment[fr]=Choisissez et configurez vos modules externes
-Comment[gl]=Elexir e Configurar as súas Extensións
-Comment[he]=בחר והגדר את התוספים שלך
-Comment[hu]=Bővítőmodulok kiválasztása, beállítása
-Comment[is]=Velja og stilla íforrit
-Comment[it]=Scegli e configura i tuoi plugin
-Comment[ja]=プラグインを選択して設定します
-Comment[kk]=Плагин модулін таңдап алып баптау
-Comment[km]=ជ្រើស និង​កំណត់​រចនាសម្ព័ន្ធ​កម្មវិធី​ជំនួយ​របស់​អ្នក
-Comment[lt]=Pasirinkite ir konfigūruokite priedus
-Comment[ms]=Pilih dan Konfigur Plugin Anda
-Comment[nb]=Velg og sett opp programtilleggene
-Comment[nds]=Dien Modulen utsöken un instellen
-Comment[ne]=तपाईँको प्लगइन रोज्नुहोस् र कन्फिगर गर्नुहोस्
-Comment[nl]=Kies uw plugins en stel ze in
-Comment[nn]=Vel og set opp programtillegga
-Comment[pl]=Wybór i konfiguracja wtyczek
-Comment[pt]=Escolha e Configure os 'Plugins'
-Comment[pt_BR]=Escolha e Configure os Seus Plugins
-Comment[ro]=Alegeţi şi configuraţi modulele dumneavoastră
-Comment[ru]=Выберите и настройте модули
-Comment[sk]=Vyberte a nastavte si moduly
-Comment[sl]=Izberite in nastavite vstavke
-Comment[sr]=Изаберите и подесите ваше прикључке
-Comment[sr@Latn]=Izaberite i podesite vaše priključke
-Comment[sv]=Välj och anpassa insticksprogram
-Comment[ta]=சொருகுப்பொருள்களைத் தேர்ந்தெடுத்து வடிவமைக்கவும்
-Comment[tr]=Eklentilerinizi Seçin ve Yapılandırın:
-Comment[uk]=Виберіть та налаштуйте ваші втулки
-Comment[uz]=Plaginlarni tanlash va moslash
-Comment[uz@cyrillic]=Плагинларни танлаш ва мослаш
-Comment[zh_CN]=选择并配置您的插件
-Comment[zh_HK]=選擇及設定你的插件
-Comment[zh_TW]=選擇並設定您的外掛程式
diff --git a/kview/kviewviewer/config/kviewviewerpluginsconfig.h b/kview/kviewviewer/config/kviewviewerpluginsconfig.h
index 08f95b52..492e5607 100644
--- a/kview/kviewviewer/config/kviewviewerpluginsconfig.h
+++ b/kview/kviewviewer/config/kviewviewerpluginsconfig.h
@@ -33,7 +33,4 @@ class KViewViewerPluginsConfig : public KSettings::PluginPage
private:
TDEConfig * m_config;
};
-
-// vim: sw=4 ts=4 noet
-
#endif // KVIEWVIEWERPLUGINSCONFIG_H
diff --git a/kview/kviewviewer/imagesettings.cpp b/kview/kviewviewer/imagesettings.cpp
index 1cb82f58..5c13f2d3 100644
--- a/kview/kviewviewer/imagesettings.cpp
+++ b/kview/kviewviewer/imagesettings.cpp
@@ -69,5 +69,3 @@ bool ImageSettings::isValid( TQString & /*msg*/ )
}
#include "imagesettings.moc"
-
-// vim:sw=4:ts=4
diff --git a/kview/kviewviewer/imagesettings.h b/kview/kviewviewer/imagesettings.h
index fa5ed06c..683de123 100644
--- a/kview/kviewviewer/imagesettings.h
+++ b/kview/kviewviewer/imagesettings.h
@@ -39,8 +39,4 @@ class ImageSettings : public KPrintDialogPage
TQCheckBox * m_pFitImage;
TQCheckBox * m_pCenter;
};
-
-// vim:sw=4:ts=4
-
#endif // IMAGESETTINGS_H
-
diff --git a/kview/kviewviewer/kviewkonqextension.cpp b/kview/kviewviewer/kviewkonqextension.cpp
index 43f1fa5d..ca1c6ca3 100644
--- a/kview/kviewviewer/kviewkonqextension.cpp
+++ b/kview/kviewviewer/kviewkonqextension.cpp
@@ -98,8 +98,4 @@ void KViewKonqExtension::del()
{
m_pViewer->slotDel();
}
-
-// vim:sw=4:ts=4
-
#include "kviewkonqextension.moc"
-
diff --git a/kview/kviewviewer/kviewkonqextension.h b/kview/kviewviewer/kviewkonqextension.h
index e46e78f6..ed4ba750 100644
--- a/kview/kviewviewer/kviewkonqextension.h
+++ b/kview/kviewviewer/kviewkonqextension.h
@@ -47,7 +47,4 @@ class KViewKonqExtension: public KParts::BrowserExtension
KViewViewer * m_pViewer;
KImageViewer::Canvas * m_pCanvas;
};
-
-// vim:sw=4:ts=4
-
#endif
diff --git a/kview/kviewviewer/kviewviewer.cpp b/kview/kviewviewer/kviewviewer.cpp
index 781dbc24..dcafd750 100644
--- a/kview/kviewviewer/kviewviewer.cpp
+++ b/kview/kviewviewer/kviewviewer.cpp
@@ -876,8 +876,4 @@ void KViewViewer::hasImage( bool b )
emit setWindowCaption( m_sCaption );
}
}
-
-// vim:sw=4:ts=4
-
#include "kviewviewer.moc"
-
diff --git a/kview/kviewviewer/kviewviewer.desktop b/kview/kviewviewer/kviewviewer.desktop
index c78edc08..a5643d98 100644
--- a/kview/kviewviewer/kviewviewer.desktop
+++ b/kview/kviewviewer/kviewviewer.desktop
@@ -2,117 +2,8 @@
Type=Service
Icon=kview
# Comment=TDE Image Viewer Part
-# Comment[af]=Kde Beeld Aansig Deel
-# Comment[ar]=عارض جزء الصور ل TDE
-# Comment[br]=Perzh gweler skeudennoù TDE
-# Comment[bs]=TDE Part - Preglednik slika
-# Comment[ca]=Peça de TDE visualitzadora d'imatges
-# Comment[cs]=Komponenta prohlížeče obrázků TDE
-# Comment[cy]=Rhan Gwelydd Delweddau TDE
-# Comment[da]=TDE Billedviser-part
-# Comment[de]=TDE Bildbetrachter-Komponente (KPart)
-# Comment[el]=Part προβολέα εικόνων του TDE
-# Comment[eo]=TDE-bildorigardilo parto
-# Comment[es]=Parte de visor de imágenes de TDE
-# Comment[et]=TDE pildifailide näitaja komponent
-# Comment[eu]=TDE irudi ikustailearen zatia
-# Comment[fa]=جزء مشاهده‌گر تصویر TDE
-# Comment[fi]=TDE:n kuvannäyttökomponentti
-# Comment[fr]=Composant d'affichage d'images de TDE
-# Comment[gl]=Visor de imaxes integrado do TDE
-# Comment[he]=רכיב מציג תמונות ל־TDE
-# Comment[hi]=केडीई छवि प्रदर्शक पार्ट
-# Comment[hr]=TDE komponenta za pregledavanje slika
-# Comment[hu]=TDE képnézegető objektum
-# Comment[is]=Myndbirtir TDE
-# Comment[it]=Componente TDE per la visione di immagini
-# Comment[ja]=TDE 画像ビューアパート
-# Comment[kk]=TDE кескінді қарау құралының бөлшегі
-# Comment[km]=ផ្នែក​របស់​កម្មវិធី​មើល​រូបភាព TDE
-# Comment[lt]=TDE paveikslėlių žiūriklio dalis
-# Comment[ms]=Bahagian Pemapar Imej TDE
-# Comment[nb]=TDE-bildefremviserdel
-# Comment[nds]=Bildkieker-Komponent för TDE
-# Comment[ne]=TDE छवि दर्शक भाग
-# Comment[nl]=TDE's weergavecomponent (Part) voor afbeeldingen
-# Comment[nn]=Biletvisardel for TDE
-# Comment[nso]=Seripa sa Molebeledi wa Ponagalo sa TDE
-# Comment[pa]=TDE ਚਿੱਤਰ ਦਰਸ਼ਕ ਭਾਗ
-# Comment[pl]=Składnik do przeglądarka obrazków TDE
-# Comment[pt]=Componente de Visualização de Imagens do TDE
-# Comment[pt_BR]=Parte do Visualizador de Imagens do TDE
-# Comment[ro]=Componentă TDE de vizualizare imagini
-# Comment[ru]=Компонент TDE просмотра изображений
-# Comment[se]=TDE:a govvačájehanoassi
-# Comment[sk]=Part TDE Prehliadač obrázkov
-# Comment[sl]=Del pregledovalnika slik TDE
-# Comment[sr]=TDE-ов део за приказивање слика
-# Comment[sr@Latn]=TDE-ov deo za prikazivanje slika
-# Comment[sv]=TDE:s bildvisningsdel
-# Comment[ta]=கேடிஇ பகுதி பிம்பக் காட்சி
-# Comment[tg]=Қисмати TDE-и намоиши тасвирот
-# Comment[tr]=TDE Resim Göstericisi Kısmı
-# Comment[uk]=Складова TDE переглядача зображень
-# Comment[ven]=Tshipida tsha muvhoni wa tshifanyiso tsha TDE
-# Comment[xh]=Iqhekeza Lombonisi Womfanekiso we TDE
-# Comment[zh_CN]=TDE 图像查看器组件
-# Comment[zh_HK]=TDE 圖像檢視器組件
-# Comment[zh_TW]=TDE 影像檢視器組件
-# Comment[zu]=Ingxenye Yombukisi Wesithombe se-TDE
MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/x-bmp;image/png;image/x-ico;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap;image/tiff;image/jp2
Name=KView Image Viewer
-Name[ar]=عارض KView للصور
-Name[br]=Gweler skeudennoù KView
-Name[bs]=KView predglednik slika
-Name[ca]=Visualitzador d'imatges KView
-Name[cs]=Prohlížeč obrázků KView
-Name[cy]=Celfigyn Gwelydd Delweddau KGweld
-Name[da]=KView-billedfremviser
-Name[de]=Bildbetrachter KView
-Name[el]=Προβολέας εικόνων KView
-Name[eo]=KView-Bildrigardilo
-Name[es]=Visor de imágenes de KView
-Name[et]=KView pildifailide näitaja
-Name[eu]=KView irudi ikustailea
-Name[fa]=مشاهده‌گر تصویر KView
-Name[fi]=KView-kuvannäytin
-Name[fr]=Visualisateur d'images KView
-Name[gl]=Visor de imaxes KView
-Name[he]=מציג תמונות KView
-Name[hi]=के-व्यू छवि प्रदर्शक
-Name[hu]=KView képnézegető
-Name[is]=KView myndbirtirinn
-Name[it]=Visore di immagini KView
-Name[ja]=KView 画像ビューア
-Name[kk]=KView кескінді қарау құралы
-Name[km]=កម្មវិធី​មើល​រូបភាព KView
-Name[lt]=KView paveikslėlių žiūryklė
-Name[ms]=Pemapar Imej KView
-Name[nb]=Bildeviseren KView
-Name[nds]=Bildkieker KView
-Name[ne]=केडीई दृश्य छवि दर्शक
-Name[nl]=KView afbeeldingenweergave
-Name[nn]=Biletvisaren KView
-Name[pa]=KView ਚਿੱਤਰ ਦਰਸ਼ਕ
-Name[pl]=Przeglądarka obrazków KView
-Name[pt]=Visualizador de Imagens KView
-Name[pt_BR]=Visualizador de Imagens do KVisualização
-Name[ro]=Vizualizor imagini KView
-Name[ru]=Программа просмотра изображений KView
-Name[se]=KView govvačájeheaddji
-Name[sk]=Prehliadač obrázkov KView
-Name[sl]=Pregledovalnik slik KView
-Name[sr]=KView, приказивач слика
-Name[sr@Latn]=KView, prikazivač slika
-Name[sv]=Kview bildvisning
-Name[ta]=கேகாட்சி பிம்பக் காட்சி
-Name[tg]=Барномаи намоиши тасвироти KView
-Name[tr]=KView Resim Görüntüleyici
-Name[uk]=Переглядач зображень KView
-Name[wa]=KView Håyneu d' imådjes
-Name[zh_CN]=KView 图像查看器
-Name[zh_HK]=KView 圖像檢視器
-Name[zh_TW]=KView 影像檢視器
X-TDE-ServiceTypes=KImageViewer/Viewer,KParts/ReadWritePart,Browser/View
X-TDE-InitialPreference=3
X-TDE-Library=libkviewviewer
diff --git a/kview/kviewviewer/kviewviewer.h b/kview/kviewviewer/kviewviewer.h
index 58cb1c1c..fa80a255 100644
--- a/kview/kviewviewer/kviewviewer.h
+++ b/kview/kviewviewer/kviewviewer.h
@@ -140,7 +140,4 @@ class KDE_EXPORT KViewViewer : public KImageViewer::Viewer, public KViewViewerIf
TQValueVector<unsigned int> m_vEffects;
};
-
-// vim:sw=4:ts=4
-
#endif
diff --git a/kview/kviewviewer/kviewvieweriface.h b/kview/kviewviewer/kviewvieweriface.h
index 19a56232..970d095b 100644
--- a/kview/kviewviewer/kviewvieweriface.h
+++ b/kview/kviewviewer/kviewvieweriface.h
@@ -26,5 +26,3 @@ class KViewViewerIface
};
#endif // KVIEWVIEWERIFACE_H
-
-// vim: sw=4 ts=4
diff --git a/kview/kviewviewer/printimagesettings.ui b/kview/kviewviewer/printimagesettings.ui
index b33b7798..36f07649 100644
--- a/kview/kviewviewer/printimagesettings.ui
+++ b/kview/kviewviewer/printimagesettings.ui
@@ -180,10 +180,8 @@
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
<include location="global" impldecl="in implementation">knuminput.h</include>
+ <include location="global" impldecl="in implementation">tqwidget.h</include>
</includes>
<layoutdefaults spacing="6" margin="11"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
-<includehints>
- <includehint>tqwidget.h</includehint>
-</includehints>
</UI>
diff --git a/kview/main.cpp b/kview/main.cpp
index 3fc3b364..9faba378 100644
--- a/kview/main.cpp
+++ b/kview/main.cpp
@@ -66,5 +66,3 @@ extern "C" KDE_EXPORT int kdemain( int argc, char ** argv )
return app.exec();
}
-
-// vim:sw=4:ts=4
diff --git a/kview/modules/browser/CMakeLists.txt b/kview/modules/browser/CMakeLists.txt
index efa48578..933a2523 100644
--- a/kview/modules/browser/CMakeLists.txt
+++ b/kview/modules/browser/CMakeLists.txt
@@ -23,9 +23,17 @@ link_directories(
##### other data ################################
-install( FILES
- kviewbrowser.desktop kviewbrowser.rc
- DESTINATION ${DATA_INSTALL_DIR}/kviewviewer/kpartplugins )
+tde_create_translated_desktop(
+ SOURCE kviewbrowser.desktop
+ DESTINATION ${DATA_INSTALL_DIR}/kviewviewer/kpartplugins
+ PO_DIR kview-desktops
+)
+
+install(
+ FILES
+ kviewbrowser.rc
+ DESTINATION ${DATA_INSTALL_DIR}/kviewviewer/kpartplugins
+)
##### kview_browserplugin (module) ##############
diff --git a/kview/modules/browser/kmyfileitemlist.h b/kview/modules/browser/kmyfileitemlist.h
index 80f01013..a84beb75 100644
--- a/kview/modules/browser/kmyfileitemlist.h
+++ b/kview/modules/browser/kmyfileitemlist.h
@@ -33,7 +33,4 @@ class KMyFileItemList : public TQPtrList<KFileItem>
protected:
virtual int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 );
};
-
-// vim:sw=4:ts=4
-
#endif
diff --git a/kview/modules/browser/kviewbrowser.cpp b/kview/modules/browser/kviewbrowser.cpp
index 41fee38b..a8c2fed6 100644
--- a/kview/modules/browser/kviewbrowser.cpp
+++ b/kview/modules/browser/kviewbrowser.cpp
@@ -174,6 +174,4 @@ void KViewBrowser::setupDirLister()
TQApplication::restoreOverrideCursor();
}
}
-
-// vim:sw=4:ts=4:cindent
#include "kviewbrowser.moc"
diff --git a/kview/modules/browser/kviewbrowser.desktop b/kview/modules/browser/kviewbrowser.desktop
index 04248614..8673e8bc 100644
--- a/kview/modules/browser/kviewbrowser.desktop
+++ b/kview/modules/browser/kviewbrowser.desktop
@@ -12,119 +12,4 @@ X-TDE-PluginInfo-License=GPL
X-TDE-PluginInfo-EnabledByDefault=true
Name=Browser
-Name[af]=Blaaier
-Name[ar]=المتصفح
-Name[bg]=Браузър
-Name[br]=Furcher
-Name[bs]=Preglednik
-Name[ca]=Fullejador
-Name[cs]=Prohlížeč
-Name[cy]=Porydd
-Name[el]=Περιηγητής
-Name[eo]=Trair-Rigardilo
-Name[es]=Navegador
-Name[et]=Sirvija
-Name[eu]=Nabegatzailea
-Name[fa]=مرورگر
-Name[fi]=Selain
-Name[fr]=Navigateur
-Name[ga]=Brabhsálaí
-Name[gl]=Explorador
-Name[he]=דפדפן
-Name[hi]=ब्राउज़र
-Name[hr]=Preglednik
-Name[hu]=Böngésző
-Name[is]=Flakkari
-Name[ja]=ブラウザ
-Name[kk]=Шолғыш
-Name[km]=កម្មវិធី​រុករក
-Name[lt]=Naršyklė
-Name[ms]=Pelayar
-Name[nb]=Leser
-Name[nds]=Kieker
-Name[ne]=ब्राउजर
-Name[nl]=Bladeren
-Name[nn]=Snøgglesar
-Name[nso]=Seinyakisi
-Name[pa]=ਝਲਕਾਰਾ
-Name[pl]=Przeglądarka
-Name[pt]=Navegador
-Name[pt_BR]=Navegador
-Name[ro]=Navigator
-Name[ru]=Просмотр
-Name[se]=Bláđđejeaddji
-Name[sk]=Prehliadač
-Name[sl]=Brskalnik
-Name[sr]=Прегледач
-Name[sr@Latn]=Pregledač
-Name[sv]=Bläddrare
-Name[ta]=உலாவி
-Name[tg]=Воқеъанигор
-Name[tr]=Tarayıcı
-Name[uk]=Навігатор
-Name[uz]=Brauzer
-Name[uz@cyrillic]=Браузер
-Name[ven]=Burausa
-Name[wa]=Foyteuse
-Name[xh]=Umkhangeli wencwadi
-Name[zh_CN]=浏览器
-Name[zh_HK]=瀏覽器
-Name[zh_TW]=瀏覽器
-Name[zu]=Umcingi
Comment=Enables you to browse through all of the images in the current directory.
-Comment[af]=Aktiveer jy na blaai deur alle van die beelde in die huidige gids.
-Comment[ar]=يمكنك من تصفَح كل الصور في الدليل الحالي.
-Comment[bg]=Преглед на изображенията в текущата директория
-Comment[bs]=Omogućuje vam da pregledate sve slike u trenutnom direktoriju.
-Comment[ca]=Us permet navegar entre totes les imatges del directori actual.
-Comment[cs]=Umožňuje procházet všechny obrázky v aktuálním adresáři.
-Comment[cy]=Alluogi i chi bori drwy pob delwedd yn y cyfeiriadur cyfredol.
-Comment[da]=Lader dig gennemse alle billederne i denne mappe.
-Comment[de]=Ermöglicht das Durchsehen der Bilder im aktuellen Ordner.
-Comment[el]=Σας επιτρέπει να περιηγηθείτε σε όλες τις εικόνες στον τρέχον κατάλογο.
-Comment[eo]=Permesas al vi povas trarigardi ĉiujn bildojn en la nuna dosierujo.
-Comment[es]=Le permite navegar por todas las imágenes del directorio actual.
-Comment[et]=Võimaldab sirvida aktiivse kataloogi kõiki pilte.
-Comment[eu]=Uneko direktorioko irudien artean nabigatzen uzten dizu.
-Comment[fa]=برای مرور تمام تصاویر موجود در فهرست راهنمای جاری شما را توانا می‌کند.
-Comment[fi]=Mahdollistaa nykyisessä kansiossa olevien kuvien selailun
-Comment[fr]=Permet de naviguer parmi les images dans le dossier courant.
-Comment[gl]=Permítelle navegar a través de todas as imaxes no directorio actual.
-Comment[he]=מאפשר לך לעיין בכל התמונות שבספריה הנוכחית
-Comment[hi]=मौज़ूदा डिरेक्ट्री के सभी छवियों को ब्राउज़ करने में आपको सक्षम बनाता है.
-Comment[hu]=Lehetővé teszi az aktuális könyvtárban található képek áttekintését, böngészését.
-Comment[is]=Gerir þér kleyft að flakka í öllum myndunum í þessari möppu.
-Comment[it]=Permette di navigare tra le immagini nella directory corrente.
-Comment[ja]=現在のディレクトリのすべての画像をブラウズできるようになります。
-Comment[kk]=Назардағы қапшықтағы барлық кескіндерді шолу құралы.
-Comment[km]=អាច​ឲ្យ​អ្នក​រកមើល​រូបភាព​ទាំងអស់ នៅ​ក្នុង​ថត​បច្ចុប្បន្ន ។
-Comment[lt]=Leidžia jums naršyti visuose paveikslėliuose esamame aplanke.
-Comment[ms]=Membolehkan anda melayar semua imej dalam direktori semasa.
-Comment[nb]=Lar deg bla gjennom alle bildene i den gjeldende katalogen.
-Comment[nds]=Dörkieken vun all Biller binnen den aktuellen Orner.
-Comment[ne]=हालको डाइरेक्टरिमा छविको सबै तिर ब्राउज गर्न तपाईँलाई सक्षम पार्दछ ।
-Comment[nl]=Hiermee kunt u door alle afbeeldingen in de huidige map bladeren.
-Comment[nn]=Let deg bla gjennom alle bileta i ein katalog.
-Comment[nso]=Ego dumelela go inyakisa kago diponagalo kamoka kago tshupetso ya bjale.
-Comment[pl]=Pozwala na przeglądanie wszystkich obrazków w bieżącym katalogu.
-Comment[pt]=Permite-lhe navegar por todas as imagens na directoria actual.
-Comment[pt_BR]=Habilita você a navegar por todas as imagens no diretório atual.
-Comment[ro]=Vă permite să navigaţi prin toate imaginile din directorul curent.
-Comment[ru]=Просмотр всех изображений в текущей папке.
-Comment[se]=Diktá du bláđđet buot govaid čađa dán ozus.
-Comment[sk]=Umožňuje prechádzať mezi obrázkami v aktuálnom priečinku.
-Comment[sl]=Omogoča vam brskanje po vseh slikah v trenutni mapi.
-Comment[sr]=Омогућава вам да прегледате све слике у текућем директоријуму
-Comment[sr@Latn]=Omogućava vam da pregledate sve slike u tekućem direktorijumu
-Comment[sv]=Låter dig bläddra igenom alla bilder i den aktuella katalogen.
-Comment[ta]=நடப்பு அடைவில் உள்ள பிம்பங்களை எல்லாம் பார்க்க முடியும்.
-Comment[tg]=Намоиши тамоми тасвирот дар каталоги ҷорӣ.
-Comment[tr]=Bulunduğunuz dizindeki tüm resimler arasında gezinmenizi sağlar.
-Comment[uk]=Дозволяє навігацію всіх зображень в поточному каталозі.
-Comment[ven]=Ini konisa u tshimbidza kha zwifanyiso zwothe kha tsumbavhulwo ya zwino.
-Comment[wa]=Vos permete di foyter dins totes les imådjes do ridant do moumint.
-Comment[xh]=Ikuvumela ukuba ukwazi ukukhangela yonke imifanekiso kulawulo lwangoku.
-Comment[zh_CN]=使您能够浏览当前目录中的所有图像。
-Comment[zh_HK]=讓您瀏覽當前目錄的所有圖像。
-Comment[zh_TW]=讓您瀏覽目前目錄的所有影像。
-Comment[zu]=Ikuvumela ukuba ucinge ngokwedlulela izithombe ohlwini lwamafayela lwamanje.
diff --git a/kview/modules/browser/kviewbrowser.h b/kview/modules/browser/kviewbrowser.h
index 198c53af..24aa3770 100644
--- a/kview/modules/browser/kviewbrowser.h
+++ b/kview/modules/browser/kviewbrowser.h
@@ -58,6 +58,4 @@ private:
TDEAction * m_paBack;
TDEAction * m_paForward;
};
-
-// vim:sw=4:ts=4:cindent
#endif
diff --git a/kview/modules/effects/CMakeLists.txt b/kview/modules/effects/CMakeLists.txt
index b871c6ad..bf905f66 100644
--- a/kview/modules/effects/CMakeLists.txt
+++ b/kview/modules/effects/CMakeLists.txt
@@ -23,9 +23,17 @@ link_directories(
##### other data ################################
-install( FILES
- kvieweffects.desktop kvieweffects.rc
- DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins )
+tde_create_translated_desktop(
+ SOURCE kvieweffects.desktop
+ DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins
+ PO_DIR kview-desktops
+)
+
+install(
+ FILES
+ kvieweffects.rc
+ DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins
+)
##### kview_effectsplugin (module) ##############
diff --git a/kview/modules/effects/kvieweffects.cpp b/kview/modules/effects/kvieweffects.cpp
index 803b81e7..4ae192a6 100644
--- a/kview/modules/effects/kvieweffects.cpp
+++ b/kview/modules/effects/kvieweffects.cpp
@@ -239,6 +239,4 @@ inline TQImage * KViewEffects::workImage()
}
return 0;
}
-
-// vim:sw=4:ts=4:cindent
#include "kvieweffects.moc"
diff --git a/kview/modules/effects/kvieweffects.desktop b/kview/modules/effects/kvieweffects.desktop
index ddc42e08..39f85b34 100644
--- a/kview/modules/effects/kvieweffects.desktop
+++ b/kview/modules/effects/kvieweffects.desktop
@@ -11,109 +11,4 @@ X-TDE-PluginInfo-License=GPL
X-TDE-PluginInfo-EnabledByDefault=false
Name=Effects
-Name[ar]=مؤثرات
-Name[bg]=Ефекти
-Name[bs]=Efekti
-Name[ca]=Efectes
-Name[cs]=Efekty
-Name[cy]=Effeithiau
-Name[da]=Effekter
-Name[de]=Effekte
-Name[el]=Εφέ
-Name[eo]=Efektoj
-Name[es]=Efectos
-Name[et]=Efektid
-Name[eu]=Efectuak
-Name[fa]=اثرها
-Name[fi]=Tehosteet
-Name[fr]=Effets
-Name[ga]=Maisíochtaí
-Name[gl]=Efectos
-Name[he]=אפקטים
-Name[hi]=प्रभाव
-Name[hu]=Effektusok
-Name[is]=Brellur
-Name[it]=Effetti
-Name[ja]=効果
-Name[kk]=Эффекттері
-Name[km]=បែបផែន
-Name[lt]=Efektai
-Name[ms]=Kesan
-Name[nb]=Effekter
-Name[nds]=Effekten
-Name[ne]=असर
-Name[nl]=Effecten
-Name[nn]=Effektar
-Name[pa]=ਪ੍ਰਭਾਵ
-Name[pl]=Efekty
-Name[pt]=Efeitos
-Name[pt_BR]=Efeitos
-Name[ro]=Efecte
-Name[ru]=Эффекты
-Name[sk]=Efekty
-Name[sl]=Učinki
-Name[sr]=Ефекти
-Name[sr@Latn]=Efekti
-Name[sv]=Effekter
-Name[ta]=விளைவுகள்
-Name[tg]=Воситаҳо
-Name[tr]=Efektler
-Name[uk]=Ефекти
-Name[uz]=Effektlar
-Name[uz@cyrillic]=Эффектлар
-Name[wa]=Efets
-Name[zh_CN]=特效
-Name[zh_HK]=效果
-Name[zh_TW]=特效
Comment=Provides some image effects
-Comment[ar]=يقدم بعض مؤثرات الصور
-Comment[bg]=Визуални ефекти при зареждане на изображенията
-Comment[bs]=Pruža neke efekte za slike
-Comment[ca]=Proporciona alguns efectes d'imatges
-Comment[cs]=Poskytuje několik efektů pro obrázky
-Comment[cy]=Darparu rhai effeithiau delwedd
-Comment[da]=Sørger for nogle billedeffekter
-Comment[de]=Stellt einige Bildverarbeitungseffekte zur Verfügung
-Comment[el]=Παρέχει μερικά εφέ εικόνας
-Comment[eo]=Provizas kelkajn bildefektojn
-Comment[es]=Proporciona alguno efectos para imágenes
-Comment[et]=Mõned pildiefektid
-Comment[eu]=Irudi efektu batzuk eskuratzen ditu
-Comment[fa]=برخی اثرهای تصویر را فراهم می‌کند
-Comment[fi]=Tarjoaa joitain kuvatehosteita
-Comment[fr]=Fournit des effets sur les images
-Comment[gl]=Proporciona algúns efectos para as imaxes
-Comment[he]=מספק מספר אפקטים עבור תמונות
-Comment[hi]=छवि में प्रभाव उत्पन्न करता है
-Comment[hu]=Képeffektusok használata
-Comment[is]=Býður uppá ýmsar myndbrellur
-Comment[it]=Fornisce alcuni effetti per le immagini
-Comment[ja]=画像効果を提供します
-Comment[kk]=Кескіндердің кейбір эффектерін іске асыру
-Comment[km]=ផ្ដល់​នូវ​បែបផែន​រូបភាព​មួយ​ចំនួន
-Comment[lt]=Prideda kai kuriuos paveikslėlių efektus
-Comment[ms]=Menyediakan beberapa kesan imej
-Comment[nb]=Utfører noen effekter på bilder
-Comment[nds]=Stellt en poor Bildeffekten praat
-Comment[ne]=केही छवि असर प्रदान गर्दछ
-Comment[nl]=Biedt enkele effecten om afbeeldingen te bewerken
-Comment[nn]=Utfører nokre effektar på bilete
-Comment[pl]=Dodaje kilka efektów do obrazków
-Comment[pt]=Fornece alguns efeitos de imagem
-Comment[pt_BR]=Fornece alguns efeitos de imagem
-Comment[ro]=Oferă unele efecte pentru imagini
-Comment[ru]=Некоторые эффекты обработки изображений
-Comment[sk]=Poskytuje niektoré efekty pre obrázky
-Comment[sl]=Prinaša nekaj učinkov za slike
-Comment[sr]=Пружа неке сликовне ефекте
-Comment[sr@Latn]=Pruža neke slikovne efekte
-Comment[sv]=Tillhandahåller vissa bildeffekter
-Comment[ta]=சில பிம்ப விளைவுகளை தருகிறது
-Comment[tg]=Якчанд воситаҳои коркарди тасвирот
-Comment[tr]=Resim efektleri oluşturur
-Comment[uk]=Надає деякі ефекти зображень
-Comment[uz]=Rasm effektlari
-Comment[uz@cyrillic]=Расм эффектлари
-Comment[zh_CN]=提供某些图像特效
-Comment[zh_HK]=提供一些圖像效果
-Comment[zh_TW]=提供影像特效
diff --git a/kview/modules/effects/kvieweffects.h b/kview/modules/effects/kvieweffects.h
index 461b9c0f..93088317 100644
--- a/kview/modules/effects/kvieweffects.h
+++ b/kview/modules/effects/kvieweffects.h
@@ -42,6 +42,4 @@ private:
TQColor m_color;
TQImage * m_image;
};
-
-// vim:sw=4:ts=4:cindent
#endif // KVIEWEFFECTS_H
diff --git a/kview/modules/presenter/CMakeLists.txt b/kview/modules/presenter/CMakeLists.txt
index aa21d851..c50266af 100644
--- a/kview/modules/presenter/CMakeLists.txt
+++ b/kview/modules/presenter/CMakeLists.txt
@@ -26,9 +26,17 @@ link_directories(
##### other data ################################
-install( FILES
- kviewpresenter.desktop kviewpresenter.rc
- DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins )
+tde_create_translated_desktop(
+ SOURCE kviewpresenter.desktop
+ DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins
+ PO_DIR kview-desktops
+)
+
+install(
+ FILES
+ kviewpresenter.rc
+ DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins
+)
##### kview_presenterplugin (module) ############
diff --git a/kview/modules/presenter/config/CMakeLists.txt b/kview/modules/presenter/config/CMakeLists.txt
index e359bee9..3432b3ed 100644
--- a/kview/modules/presenter/config/CMakeLists.txt
+++ b/kview/modules/presenter/config/CMakeLists.txt
@@ -22,9 +22,11 @@ link_directories(
##### other data ################################
-install( FILES
- kviewpresenterconfig.desktop
- DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog )
+tde_create_translated_desktop(
+ SOURCE kviewpresenterconfig.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog
+ PO_DIR kview-desktops
+)
##### kcm_kviewpresenterconfig (module) #########
diff --git a/kview/modules/presenter/config/kviewpresenterconfig.cpp b/kview/modules/presenter/config/kviewpresenterconfig.cpp
index 5cda7ee0..f88f09b1 100644
--- a/kview/modules/presenter/config/kviewpresenterconfig.cpp
+++ b/kview/modules/presenter/config/kviewpresenterconfig.cpp
@@ -66,7 +66,4 @@ void KViewPresenterConfig::save()
void KViewPresenterConfig::defaults()
{
}
-
-// vim:sw=4:ts=4
-
#include "kviewpresenterconfig.moc"
diff --git a/kview/modules/presenter/config/kviewpresenterconfig.desktop b/kview/modules/presenter/config/kviewpresenterconfig.desktop
index e6f4ca32..64e5c389 100644
--- a/kview/modules/presenter/config/kviewpresenterconfig.desktop
+++ b/kview/modules/presenter/config/kviewpresenterconfig.desktop
@@ -9,112 +9,4 @@ X-TDE-FactoryName=KViewPresenterConfigFactory
X-TDE-ParentComponents=kviewpresenter
Name=Name
-Name[ar]=اسم
-Name[bg]=Име
-Name[br]=Anv
-Name[bs]=Ime
-Name[ca]=Nom
-Name[cy]=Enw
-Name[da]=Navn
-Name[el]=Όνομα
-Name[eo]=Nomo
-Name[es]=Nombre
-Name[et]=Nimi
-Name[eu]=Izena
-Name[fa]=نام
-Name[fi]=Nimi
-Name[fr]=Nom
-Name[ga]=Ainm
-Name[gl]=Nome
-Name[he]=שם
-Name[hi]=नाम
-Name[hu]=Név
-Name[is]=Heiti
-Name[it]=Nome
-Name[ja]=名前
-Name[kk]=Атауы
-Name[km]=ឈ្មោះ
-Name[lt]=Pavadinimas
-Name[ms]=Nama
-Name[nb]=Navn
-Name[nds]=Naam
-Name[ne]=नाम
-Name[nl]=Naam
-Name[nn]=Namn
-Name[pa]=ਨਾਂ
-Name[pl]=Nazwa
-Name[pt]=Nome
-Name[pt_BR]=Nome
-Name[ro]=Nume
-Name[ru]=Имя
-Name[se]=Namma
-Name[sk]=Meno
-Name[sl]=Ime
-Name[sr]=Име
-Name[sr@Latn]=Ime
-Name[sv]=Namn
-Name[ta]=பெயர்
-Name[tg]=Ном
-Name[uk]=Назва
-Name[uz]=Nomi
-Name[uz@cyrillic]=Номи
-Name[wa]=No
-Name[zh_CN]=名称
-Name[zh_HK]=名稱
-Name[zh_TW]=名稱
Comment=Comment
-Comment[ar]=تعليق
-Comment[bg]=Коментар
-Comment[br]=Askelenn
-Comment[bs]=Komentar
-Comment[ca]=Comentari
-Comment[cy]=Sylwad
-Comment[da]=Kommentar
-Comment[de]=Kommentar
-Comment[el]=Σχόλιο
-Comment[eo]=Komento
-Comment[es]=Comentario
-Comment[et]=Kommentaar
-Comment[eu]=Iruzkina
-Comment[fa]=توضیح
-Comment[fi]=Kommentti
-Comment[fr]=Commentaire
-Comment[ga]=Nóta
-Comment[gl]=Comentario
-Comment[he]=הערה
-Comment[hi]=टिप्पणी
-Comment[hu]=Megjegyzés
-Comment[is]=Athugasemd
-Comment[it]=Commento
-Comment[ja]=コメント
-Comment[kk]=Түсініктемесі
-Comment[km]=សេចក្ដី​អធិប្បាយ
-Comment[lt]=Komentaras
-Comment[ms]=Komen
-Comment[nb]=Kommentar
-Comment[nds]=Kommentar
-Comment[ne]=टिप्पणी
-Comment[nl]=Omschrijving
-Comment[nn]=Kommentar
-Comment[pa]=ਟਿੱਪਣੀ
-Comment[pl]=Komentarz
-Comment[pt]=Comentário
-Comment[pt_BR]=Comentário
-Comment[ro]=Comentariu
-Comment[ru]=Комментарий
-Comment[se]=Kommeanta
-Comment[sk]=Komentár
-Comment[sl]=Komentar
-Comment[sr]=Коментар
-Comment[sr@Latn]=Komentar
-Comment[sv]=Kommentar
-Comment[ta]=குறிப்பு
-Comment[tg]=Эзоҳ
-Comment[tr]=Açıklama
-Comment[uk]=Коментар
-Comment[uz]=Izoh
-Comment[uz@cyrillic]=Изоҳ
-Comment[wa]=Rawete
-Comment[zh_CN]=注释
-Comment[zh_HK]=註解
-Comment[zh_TW]=註解
diff --git a/kview/modules/presenter/config/kviewpresenterconfig.h b/kview/modules/presenter/config/kviewpresenterconfig.h
index 3ad25c2b..8aaf462f 100644
--- a/kview/modules/presenter/config/kviewpresenterconfig.h
+++ b/kview/modules/presenter/config/kviewpresenterconfig.h
@@ -41,7 +41,4 @@ class KViewPresenterConfig : public TDECModule
private:
TQCheckBox * m_pCheckBox;
};
-
-// vim:sw=4:ts=4
-
#endif // KVIEWPRESENTERCONFIG_H
diff --git a/kview/modules/presenter/imagelistdialog.ui b/kview/modules/presenter/imagelistdialog.ui
index 547c0cf0..26e03b01 100644
--- a/kview/modules/presenter/imagelistdialog.ui
+++ b/kview/modules/presenter/imagelistdialog.ui
@@ -254,15 +254,18 @@
</connections>
<includes>
<include location="global" impldecl="in declaration">kdialog.h</include>
+ <include location="local" impldecl="in implementation">imagelistdialog.ui.h</include>
+ <include location="local" impldecl="in implementation">imagelistitem.h</include>
<include location="global" impldecl="in implementation">kdebug.h</include>
<include location="global" impldecl="in implementation">kimageviewer/viewer.h</include>
- <include location="global" impldecl="in implementation">tdeio/netaccess.h</include>
+ <include location="global" impldecl="in implementation">knuminput.h</include>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
<include location="global" impldecl="in implementation">kurl.h</include>
<include location="global" impldecl="in implementation">tdefiledialog.h</include>
- <include location="global" impldecl="in implementation">tqstring.h</include>
+ <include location="global" impldecl="in implementation">tdeio/netaccess.h</include>
+ <include location="global" impldecl="in implementation">tdelistview.h</include>
<include location="global" impldecl="in implementation">tdemessagebox.h</include>
- <include location="local" impldecl="in implementation">imagelistitem.h</include>
- <include location="local" impldecl="in implementation">imagelistdialog.ui.h</include>
+ <include location="global" impldecl="in implementation">tqstring.h</include>
</includes>
<forwards>
<forward>class KURL</forward>
@@ -273,12 +276,4 @@
</Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
-<includes>
- <include location="global" impldecl="in implementation">knuminput.h</include>
- <include location="global" impldecl="in implementation">kpushbutton.h</include>
-</includes>
-<includehints>
- <includehint>kdialog.h</includehint>
- <includehint>tdelistview.h</includehint>
-</includehints>
</UI>
diff --git a/kview/modules/presenter/imagelistitem.cpp b/kview/modules/presenter/imagelistitem.cpp
index 62ca6e90..d002023d 100644
--- a/kview/modules/presenter/imagelistitem.cpp
+++ b/kview/modules/presenter/imagelistitem.cpp
@@ -78,5 +78,3 @@ const KURL & ImageListItem::url() const
{
return m_url;
}
-
-// vim:sw=4:ts=4
diff --git a/kview/modules/presenter/imagelistitem.h b/kview/modules/presenter/imagelistitem.h
index 321dcf4d..b10e5cfa 100644
--- a/kview/modules/presenter/imagelistitem.h
+++ b/kview/modules/presenter/imagelistitem.h
@@ -44,6 +44,4 @@ class ImageListItem : public TDEListViewItem
TQString m_filename;
KURL m_url;
};
-
-// vim:sw=4:ts=4
#endif // IMAGELISTITEM_H
diff --git a/kview/modules/presenter/kviewpresenter.cpp b/kview/modules/presenter/kviewpresenter.cpp
index c7405547..c05490bb 100644
--- a/kview/modules/presenter/kviewpresenter.cpp
+++ b/kview/modules/presenter/kviewpresenter.cpp
@@ -487,6 +487,4 @@ void KViewPresenter::saveList()
}
}
}
-
-// vim:sw=4:ts=4
#include "kviewpresenter.moc"
diff --git a/kview/modules/presenter/kviewpresenter.desktop b/kview/modules/presenter/kviewpresenter.desktop
index 672ff605..7d55f9ae 100644
--- a/kview/modules/presenter/kviewpresenter.desktop
+++ b/kview/modules/presenter/kviewpresenter.desktop
@@ -11,108 +11,4 @@ X-TDE-PluginInfo-License=GPL
X-TDE-PluginInfo-EnabledByDefault=true
Name=Presenter
-Name[ar]=المقدّم
-Name[bg]=Презентация
-Name[br]=Emginniger
-Name[bs]=Prezentator
-Name[ca]=Presentador
-Name[cs]=Prezentace
-Name[cy]=Cyflwynydd
-Name[de]=Präsentationsprogramm
-Name[el]=Παρουσιαστής
-Name[eo]=Prezentilo
-Name[et]=Esitleja
-Name[eu]=Aurkezlea
-Name[fa]=ارائه‌کننده
-Name[fi]=Esitysohjelma
-Name[fr]=Présentateur
-Name[ga]=Láithreoir
-Name[gl]=Escaparate
-Name[he]=מצגות
-Name[hi]=प्रस्तुतकर्ता
-Name[hr]=Prezentator
-Name[hu]=Bemutató
-Name[it]=Presentazione
-Name[ja]=プレゼンタ
-Name[kk]=Презентатор
-Name[km]=កម្មវិធី​បង្ហាញ
-Name[lt]=Pristatytojas
-Name[ms]=Penyampai
-Name[nds]=Präsentatschoonprogramm
-Name[ne]=प्रस्तोता
-Name[nl]=Presentatieprogramma
-Name[nso]=Mohlagisi
-Name[pa]=ਪੇਸ਼ਕਾਰ
-Name[pl]=Prezenter
-Name[pt]=Apresentador
-Name[pt_BR]=Apresentador
-Name[ro]=Prezentare
-Name[ru]=Презентатор
-Name[sk]=Vytvorenie prezentácie
-Name[sl]=Predstavitelj
-Name[sr]=Презентер
-Name[sr@Latn]=Prezenter
-Name[sv]=Presentationer
-Name[ta]=வழங்குபவர்
-Name[tg]=Презентатор
-Name[tr]=Sunum Aracı
-Name[ven]=Mulanguli
-Name[xh]=Umbonisi
-Name[zh_CN]=演示板
-Name[zh_HK]=簡報器
-Name[zh_TW]=簡報
-Name[zu]=Umnikeli
Comment=Creates an imagelist and enables you to create a slideshow
-Comment[ar]=ينشئ قائمة صور ويمكنك من استعراض الصور تلقائيا
-Comment[bg]=Създаване на списък с изображения и слайдшоу от тях
-Comment[bs]=Pravi listu slika i omogućuje vam da napravite slide show
-Comment[ca]=Crea una llista d'imatges i us permet crear un passi de diapositives
-Comment[cs]=Vytvoří seznam obrázků a umožní vám z nich vytvořit slideshow.
-Comment[cy]=Creu rhestr delweddau ac alluogi i chi greu sioe haenluniau
-Comment[da]=Laver en billedliste og giver dig muligheden for at lave et diasshow
-Comment[de]=Erzeugt eine Bilderliste und ermöglicht das Erstellen von Diashows
-Comment[el]=Δημιουργεί μια λίστα εικόνων και σας επιτρέπει να δημιουργήσετε μια προβολή σλάιντ
-Comment[es]=Crea una lista de imágenes ofreciendole la posibilidad de crear una animación de diapositivas
-Comment[et]=Loob piltide nimekirja ja laseb selle põhjal luua slaidiseansi
-Comment[eu]=Irudi-zerrenda bat sortzen du eta diapositiba-aurkezpena egiten du
-Comment[fa]=یک فهرست تصویر ایجاد می‌کند و شما را قادر به ایجاد یک نمایش اسلاید می‌کند
-Comment[fi]=Luo kuvalistan ja mahdollistaa esityksen luomisen
-Comment[fr]=Crée une liste d'images et vous permet de créer un diaporama
-Comment[gl]=Crea unha lista de imaxes e permite crear unha moviola
-Comment[he]=יוצר רשימת תמונות ומאפשר לך ליצור מצגת שקופיות
-Comment[hi]=एक छवि-सूची बनाता है तथा आपको एक स्लाइड-शो तैयार करने में सक्षम बनाता है
-Comment[hu]=Képsorozat összeállítását és bemutatását teszi lehetővé
-Comment[is]=Býr til myndlista og gerir þér kleyft að búa til myndsýningu
-Comment[it]=Crea una lista di immagini e permette di creare una presentazione
-Comment[ja]=画像リストを作成し、スライドショーを作成します
-Comment[kk]=Слайд-шоу көрсетуге кескіндер тізімін дайындау
-Comment[km]=បង្កើត​បញ្ជី​រូបភាព ហើយ​អាច​ឲ្យ​អ្នក​បង្កើត​ជា​ការ​បញ្ចាំង​ស្លាយ
-Comment[lt]=Sukuria paveikslėlių sąrašą ir leidžia jums sukurti skaidrių peržiūrą
-Comment[ms]=Cipta senarai imej dan membolehkan anda mencipta tayangan slaid
-Comment[nb]=Oppretter en bildeliste og lar deg lage en lysbildeserie
-Comment[nds]=Stellt en Bildlist op un lett Di en Diaschau opstellen
-Comment[ne]=छवि सूची सिर्जना गर्दछ र तपाईँलाई स्लाइड प्रर्दशन सिर्जना गर्न सक्षम पार्दछ
-Comment[nl]=Maakt een afbeeldingenlijst waarmee u een diashow kunt maken
-Comment[nn]=Lagar ei biletliste du kan bruka til framvising
-Comment[nso]=Hlagisa palo ya ponagalo gape ego dumelela go hlagisa slidesshow
-Comment[pl]=Tworzy listę obrazków i umożliwia tworzenie z niej pokazu slajdów
-Comment[pt]=Cria uma lista de imagens e permite-lhe criar uma apresentação
-Comment[pt_BR]=Cria uma lista de imagens e habilita você a criar uma exibição de slides
-Comment[ro]=Creează o listă de imagini şi vă permite să reallizaţi o succesiune de imagini
-Comment[ru]=Создание галерей изображений и просмотр их в качестве слайдов
-Comment[se]=Ráhkada govvalisttu ja diktá du ráhkadit govvačájeheami
-Comment[sk]=Vytvorí zoznam obrázok a umožní z nich vytvoriť prezentáciu
-Comment[sl]=Ustvari seznam slik in vam omogoča ustvariti predstavitev
-Comment[sr]=Прави листу слика и омогућава вам да направите слајд-шоу
-Comment[sr@Latn]=Pravi listu slika i omogućava vam da napravite slajd-šou
-Comment[sv]=Skapar en bildlista och ger dig möjlighet att göra ett bildspel
-Comment[ta]=திரைக் காட்சிக்கான பிம்ப பட்டியலை உருவாக்கலாம்
-Comment[tg]=Эҷоди нигористони тасвирот ва намоиши онҳо ҳамчун слайд
-Comment[tr]=Bir resim listesi oluşturur ve slayt gösterisi yapmanıza olanak tanır
-Comment[uk]=Створює список зображень та дозволяє створювати презентацію слайдів
-Comment[ven]=Iita mutevhe wa tshifanyiso ya dovha yani tendela uita tsumbedzo ya tshilaidi
-Comment[xh]=Yenza uluhlu lwemifanekiso ekuvumela ukwazi ukwenza umboniso wotyibiliko
-Comment[zh_CN]=创建图像列表,并能为您创建幻灯片
-Comment[zh_HK]=建立圖像清單並讓您能建立幻燈片式放映
-Comment[zh_TW]=建立影像清單並讓您能建立幻燈片式放映
-Comment[zu]=Idala uhlu lwesithombe futhi ikuvumela wena ukuba udale umbukiso wesithombe esishibilikayo
diff --git a/kview/modules/presenter/kviewpresenter.h b/kview/modules/presenter/kviewpresenter.h
index 94b9fa65..4159abc5 100644
--- a/kview/modules/presenter/kviewpresenter.h
+++ b/kview/modules/presenter/kviewpresenter.h
@@ -99,6 +99,4 @@ private:
ImageListItem * m_pCurrentItem;
TQTimer * m_pSlideshowTimer;
};
-
-// vim:sw=4:ts=4:cindent
#endif
diff --git a/kview/modules/presenter/kviewpresenterconfmodule.cpp b/kview/modules/presenter/kviewpresenterconfmodule.cpp
index 3d6de8b4..aee4dd44 100644
--- a/kview/modules/presenter/kviewpresenterconfmodule.cpp
+++ b/kview/modules/presenter/kviewpresenterconfmodule.cpp
@@ -54,7 +54,4 @@ void KViewPresenterConfModule::createPage( TQFrame * page )
m_pCheckBox = new TQCheckBox( "This is only for testing...", page );
}
-
-// vim:sw=4:ts=4
-
#include "kviewpresenterconfmodule.moc"
diff --git a/kview/modules/presenter/kviewpresenterconfmodule.h b/kview/modules/presenter/kviewpresenterconfmodule.h
index 2c9a2ef6..c4bd52e0 100644
--- a/kview/modules/presenter/kviewpresenterconfmodule.h
+++ b/kview/modules/presenter/kviewpresenterconfmodule.h
@@ -44,7 +44,4 @@ class KViewPresenterConfModule : public KPreferencesModule
private:
TQCheckBox * m_pCheckBox;
};
-
-// vim:sw=4:ts=4
-
#endif // KVIEWPRESENTERCONFMODULE_H
diff --git a/kview/modules/scale/kview_scale.cpp b/kview/modules/scale/kview_scale.cpp
index 2e6d03c4..28298323 100644
--- a/kview/modules/scale/kview_scale.cpp
+++ b/kview/modules/scale/kview_scale.cpp
@@ -175,6 +175,4 @@ void KViewScale::slotScale()
else
kdDebug( 4630 ) << "no image to scale" << endl;
}
-
-// vim:sw=4:ts=4:cindent
#include "kview_scale.moc"
diff --git a/kview/modules/scale/kview_scale.desktop b/kview/modules/scale/kview_scale.desktop
index 38edcb6a..9b8da0a2 100644
--- a/kview/modules/scale/kview_scale.desktop
+++ b/kview/modules/scale/kview_scale.desktop
@@ -1,122 +1,6 @@
[Desktop Entry]
Name=Scale
-Name[af]=Skaal
-Name[ar]=تكبير أو تصغير
-Name[bg]=Мащабиране
-Name[br]=Skeulaet
-Name[bs]=Skaliraj
-Name[ca]=Escala
-Name[cs]=Změna měřítka
-Name[cy]=Graddfa
-Name[da]=Skala
-Name[de]=Skalierer
-Name[el]=Κλιμάκωση
-Name[eo]=Grandecŝanĝo
-Name[et]=Skaleerija
-Name[eu]=Eskalatu
-Name[fa]=مقیاس
-Name[fi]=Skaalaa
-Name[fr]=Échelle
-Name[ga]=Scála
-Name[gl]=Redimensionar
-Name[he]=קנה מידה
-Name[hi]=स्केल
-Name[hr]=Skala
-Name[hu]=Nagyítás
-Name[is]=Skala
-Name[it]=Riscala
-Name[ja]=スケール
-Name[kk]=Масштабтау
-Name[km]=ធ្វើ​មាត្រដ្ឋាន
-Name[lt]=Mąstelis
-Name[ms]=Skala
-Name[nb]=Skaler
-Name[nds]=Grött-Topasser
-Name[ne]=स्केल
-Name[nl]=Schaalprogramma
-Name[nn]=Skaler
-Name[nso]=Sekala
-Name[pa]=ਸਕੇਲ
-Name[pl]=Skala
-Name[pt]=Redimensionamento
-Name[pt_BR]=Escala
-Name[ro]=Scalare
-Name[ru]=Масштабирование
-Name[se]=Skále
-Name[sk]=Škálovač
-Name[sl]=Raztegni
-Name[sr]=Скалирање
-Name[sr@Latn]=Skaliranje
-Name[sv]=Skala
-Name[ta]=அளவுக்கோல்
-Name[tg]=Масштабонӣ
-Name[tr]=Oranla
-Name[uk]=Масштаб
-Name[ven]=Tshikeili
-Name[wa]=Al schåle
-Name[xh]=Isikali
-Name[zh_CN]=缩放
-Name[zh_HK]=縮放
-Name[zh_TW]=縮放
-Name[zu]=Isikali
Comment=Filter to scale the image
-Comment[af]=Filter na skaal die beeld
-Comment[ar]=فلتر لتكبير أو تصغير الصورة
-Comment[bg]=Филтър за мащабиране на изображения
-Comment[bs]=Filter za skaliranje slike
-Comment[ca]=Filtre per escalar la imatge
-Comment[cs]=Filtr ke změně měřítka obrázku
-Comment[cy]=Hidl i raddio'r ddelwedd
-Comment[da]=Filter til at skalere billedet
-Comment[de]=Ein Filter zum Skalieren von Bildern
-Comment[el]=Φίλτρο για την κλιμάκωση της εικόνας
-Comment[eo]=por ŝanĝi la grandecon de la bildo
-Comment[es]=Filtro para cambiar la escala de una imagen
-Comment[et]=Filter piltide skaleerimiseks
-Comment[eu]=Eskalatu irudia
-Comment[fa]=پالایه برای مقیاس کردن تصویر
-Comment[fi]=Suodatin kuvan skaalaamiseen
-Comment[fr]=Filtre pour zoomer une image
-Comment[gl]=Filtro para redimensionar a imaxe
-Comment[he]=מסנן לשינוי קנה המידה של התמונה
-Comment[hi]=छवि का आकार बदलने का फ़िल्टर
-Comment[hr]=Filter za promjenu veličine slike
-Comment[hu]=Képméretező szűrő
-Comment[is]=Sía sem skalar myndina
-Comment[it]=Filtro per ridimensionare l'immagine
-Comment[ja]=画像をスケールするフィルタ
-Comment[kk]=Кескідерді масштабтау сүзгісі
-Comment[km]=តម្រងធ្វើ​មាត្រដ្ឋាន​រូបភាព
-Comment[lt]=Filtras paveikslėliui didinti ar mažinti
-Comment[ms]=Tapis untuk menskalakan imej
-Comment[nb]=Filter for skalering av bildet
-Comment[nds]=En Filter för't Topassen vun de Bildgrött
-Comment[ne]=छवि मापन गर्न फिल्टर
-Comment[nl]=Filter om de afbeelding te schalen
-Comment[nn]=Filter for skalering av biletet
-Comment[nso]=Sesekodi sago kala ponagalo
-Comment[pl]=Filtr do skalowania obrazków
-Comment[pt]=Um filtro para escalar a imagem
-Comment[pt_BR]=Filtro para escalar a imagem
-Comment[ro]=Filtru de scalat imaginea
-Comment[ru]=Фильтр для масштабирования изображений
-Comment[se]=Silli mii skálere govaid
-Comment[sk]=Filter pre zväčšenie obrázku
-Comment[sl]=Filter za raztegovanje slike
-Comment[sr]=Филтер за промену величине слике
-Comment[sr@Latn]=Filter za promenu veličine slike
-Comment[sv]=Filter för att skala bilden
-Comment[ta]=பிம்பத்தை மாற்றும் வடிகட்டி
-Comment[tg]=Филтр барои масштабонии тасвирот
-Comment[tr]=Resmi oranlamak için filtre
-Comment[uk]=Фільтр для масштабування зображення
-Comment[ven]=Faela yau kala tshifanyiso
-Comment[wa]=Passete po mete l' imådje al schåle
-Comment[xh]=Icebo lokucoca ulwelo lokukala umfanekiso
-Comment[zh_CN]=缩放图像的滤镜
-Comment[zh_HK]=用來縮放影像的過濾器
-Comment[zh_TW]=用來縮放影像的濾鏡
-Comment[zu]=Hluza isithombe esikaleni
Type=Plugin
[X-TDE Plugin Info]
diff --git a/kview/modules/scale/kview_scale.h b/kview/modules/scale/kview_scale.h
index 6834cda5..71550df1 100644
--- a/kview/modules/scale/kview_scale.h
+++ b/kview/modules/scale/kview_scale.h
@@ -44,6 +44,4 @@ private:
KImageViewer::Viewer * m_pViewer;
KImageViewer::Canvas * m_pCanvas;
};
-
-// vim:sw=4:ts=4:cindent
#endif
diff --git a/kview/modules/scanner/CMakeLists.txt b/kview/modules/scanner/CMakeLists.txt
index e4b4cb67..c7db3a61 100644
--- a/kview/modules/scanner/CMakeLists.txt
+++ b/kview/modules/scanner/CMakeLists.txt
@@ -23,9 +23,17 @@ link_directories(
##### other data ################################
-install( FILES
- kviewscanner.desktop kviewscanner.rc
- DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins )
+tde_create_translated_desktop(
+ SOURCE kviewscanner.desktop
+ DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins
+ PO_DIR kview-desktops
+)
+
+install(
+ FILES
+ kviewscanner.rc
+ DESTINATION ${DATA_INSTALL_DIR}/kview/kpartplugins
+)
##### kview_scannerplugin (module) ##############
diff --git a/kview/modules/scanner/kviewscanner.cpp b/kview/modules/scanner/kviewscanner.cpp
index ee3ca0dd..8f464522 100644
--- a/kview/modules/scanner/kviewscanner.cpp
+++ b/kview/modules/scanner/kviewscanner.cpp
@@ -91,6 +91,4 @@ void KViewScanner::slotImgScanned( const TQImage & img )
kdDebug( 4630 ) << "received an image from the scanner" << endl;
m_pViewer->newImage( img );
}
-
-// vim:sw=4:ts=4:cindent
#include "kviewscanner.moc"
diff --git a/kview/modules/scanner/kviewscanner.desktop b/kview/modules/scanner/kviewscanner.desktop
index eea30a1f..0c7009d2 100644
--- a/kview/modules/scanner/kviewscanner.desktop
+++ b/kview/modules/scanner/kviewscanner.desktop
@@ -11,117 +11,4 @@ X-TDE-PluginInfo-License=GPL
X-TDE-PluginInfo-EnabledByDefault=false
Name=Scanner
-Name[af]=Skandeerder
-Name[ar]=الماسح الضوئي
-Name[bg]=Скенер
-Name[br]=Eiltreser
-Name[bs]=Skener
-Name[ca]=Escàner
-Name[cy]=Sganiwr
-Name[da]=Skanner
-Name[el]=Σαρωτής
-Name[eo]=Skanilo
-Name[et]=Skänner
-Name[eu]=Eskanerra
-Name[fa]=پویشگر
-Name[fi]=Skanneri
-Name[fo]=Ljóslesari
-Name[ga]=Scanóir
-Name[gl]=Escáner
-Name[he]=סורק
-Name[hi]=स्कैनर
-Name[hr]=Skener
-Name[hu]=Lapolvasó
-Name[is]=Skanni
-Name[ja]=スキャナ
-Name[kk]=Сканер
-Name[km]=ម៉ាស៊ីន​ស្កេន
-Name[lt]=Skaneris
-Name[ms]=Pengimbas
-Name[nb]=Skanner
-Name[nds]=Bildinleser
-Name[ne]=स्क्यानर
-Name[nl]=Scanprogramma
-Name[nn]=Skannar
-Name[nso]=Selebeledi
-Name[pa]=ਸਕੈਨਰ
-Name[pl]=Skaner
-Name[pt]=Digitalizador
-Name[pt_BR]=Digitalizador
-Name[ro]=Scaner
-Name[ru]=Сканер
-Name[se]=Skánner
-Name[sk]=Skener
-Name[sl]=Skener
-Name[sr]=Скенер
-Name[sr@Latn]=Skener
-Name[sv]=Bildläsare
-Name[ta]=வருடி
-Name[tg]=Сканер
-Name[tr]=Tarayıcı
-Name[uk]=Сканер
-Name[uz]=Skanner
-Name[uz@cyrillic]=Сканнер
-Name[ven]=Tshinanguludzi
-Name[wa]=Sicanrece
-Name[xh]=Umvavanyi
-Name[zh_CN]=扫描仪
-Name[zh_HK]=掃描器
-Name[zh_TW]=掃描器
-Name[zu]=Umhloli
Comment=Open images from your scanner into KView
-Comment[af]=Open beelde van jou skandeerder binnein K-bekyk
-Comment[ar]=يفتح الصور الموجودة على ماسحك الضوئي في برنامج KView
-Comment[bg]=Сканиране и отваряне на изображения от скенера
-Comment[bs]=Otvara slike sa skenera u KView
-Comment[ca]=Obre les imatges de l'escàner a KView
-Comment[cs]=Otevírá obrázky ze skeneru do KView
-Comment[cy]=Agor delweddau oddiwrth eich sganiwr yn KGweld
-Comment[da]=åbn billeder fra din skanner til KView
-Comment[de]=Lädt Bilder vom Scanner in KView
-Comment[el]=Ανοίξτε εικόνες από το σαρωτή σας στο KView
-Comment[es]=Abre imágenes desde su escáner en KView
-Comment[et]=Avab skaneeritud pilte rakendusega KView
-Comment[eu]=Zure eskanerretik irudiak KView-en erakusten ditu
-Comment[fa]=باز کردن تصاویر از پویشگرتان در KView
-Comment[fi]=Avaa kuvan skannerilta KView-ohjelmaan
-Comment[fr]=Ouvre des images de votre scanner dans KView
-Comment[gl]=Obre as imaxes do teu escáner en KView
-Comment[he]=פתיחת תמונות מהסורק שלך ב־KView
-Comment[hi]=आपके स्कैनर से के-व्यू में छवि खोलता है
-Comment[hu]=Kép beolvasása lapolvasóról a KView-ba
-Comment[is]=Senda myndir frá skannanum í KView
-Comment[it]=Apre le immagini provenienti dallo scanner in KView
-Comment[ja]=スキャナから画像を開き KView に転送します
-Comment[kk]=Сканерден KView-ға кескінді түсіру
-Comment[km]=បើក​រូបភាព​ពី​ម៉ាស៊ីន​ស្កេន​របស់​អ្នក​ក្នុង KView
-Comment[lt]=Atveria paveikslėlius iš Jūsų skanerio į KView
-Comment[ms]=Buka imej dari pengimbas anda ke dalam KView
-Comment[nb]=Åpner bilder fra skanneren til KView
-Comment[nds]=Haalt Biller vun Dien Inleser na KView
-Comment[ne]=तपाईँको स्क्यानरबाट केडीई दृश्य भित्र छवि खोल्नुहोस्
-Comment[nl]=Scan afbeeldingen rechtstreeks in KView
-Comment[nn]=Opnar bilete frå skannaren i KView
-Comment[nso]=Bula diponagalo gotswa go selebeledi sa gago goya kago KView
-Comment[pl]=Otwiera obrazki ze skanera w przeglądarce KView
-Comment[pt]=Abrir as imagens do seu 'scanner' no KView
-Comment[pt_BR]=Abre imagens do seu digitalizador no KVisualização
-Comment[ro]=Deschide imagini din scaner în KView
-Comment[ru]=Сканирование изображений в KView
-Comment[se]=Rahpá govaid skánneris KView:as
-Comment[sk]=Otvorí obrázky z vášho skeneru v KView
-Comment[sl]=Odpre sliko iz vašega skenerja v KView
-Comment[sr]=Отвара слике из вашег скенера у KView-у
-Comment[sr@Latn]=Otvara slike iz vašeg skenera u KView-u
-Comment[sv]=Öppnar bilder från bildläsaren i Kview
-Comment[ta]= கேகாட்சியின் வருடியில் இருந்து பிம்பங்களைத் திற
-Comment[tg]=Сканеронии тасвирот дар KView
-Comment[tr]=Tarayıcıdan KView'a resim gönderin
-Comment[uk]=Відкриває зображення з вашого сканера в KView
-Comment[ven]=Vulani zwifanyiso ubva kha tshinanguludzi uya kha mbonalelo ya K
-Comment[wa]=Drovi des imådjes di vosse sicanrece avou KView
-Comment[xh]=Vula imifanekiso evela kumvavanyisi wakho kwi KView
-Comment[zh_CN]=从您的扫描仪中打开图像至 KView
-Comment[zh_HK]=從您的掃描器開啟圖像至 KView
-Comment[zh_TW]=從您的掃描器開啟影像至 KView
-Comment[zu]=Vula izithombe ezisuka kumhloli wakho kwi-KView
diff --git a/kview/modules/scanner/kviewscanner.h b/kview/modules/scanner/kviewscanner.h
index c34bc0d3..09ac2dc7 100644
--- a/kview/modules/scanner/kviewscanner.h
+++ b/kview/modules/scanner/kviewscanner.h
@@ -46,6 +46,4 @@ private:
KScanDialog * m_pScandlg;
KImageViewer::Viewer * m_pViewer;
};
-
-// vim:sw=4:ts=4:cindent
#endif
diff --git a/kview/modules/template/kviewtemplate.cpp b/kview/modules/template/kviewtemplate.cpp
index dc386560..023788c7 100644
--- a/kview/modules/template/kviewtemplate.cpp
+++ b/kview/modules/template/kviewtemplate.cpp
@@ -38,6 +38,4 @@ KViewTemplate::~KViewTemplate()
void KViewTemplate::yourSlot()
{
}
-
-// vim:sw=4:ts=4:cindent
#include "kviewtemplate.moc"
diff --git a/kview/modules/template/kviewtemplate.desktop b/kview/modules/template/kviewtemplate.desktop
index 64098ded..818ad4d0 100644
--- a/kview/modules/template/kviewtemplate.desktop
+++ b/kview/modules/template/kviewtemplate.desktop
@@ -11,119 +11,4 @@ X-TDE-PluginInfo-License=Public Domain
X-TDE-PluginInfo-EnabledByDefault=true
Name=Template
-Name[af]=Werkvoorbeeld
-Name[ar]=قالب
-Name[bg]=Шаблон
-Name[br]=Patrom
-Name[bs]=Šablon
-Name[ca]=Plantilla
-Name[cs]=Šablona
-Name[cy]=Patrymlun
-Name[da]=Skabelon
-Name[de]=Vorlage
-Name[el]=Πρότυπο
-Name[eo]=Ŝablono
-Name[es]=Plantilla
-Name[et]=Mallid
-Name[eu]=Txantiloia
-Name[fa]=قالب
-Name[fi]=Pohja
-Name[fr]=Modèle
-Name[ga]=Teimpléad
-Name[gl]=Modelo
-Name[he]=תבנית
-Name[hi]=टैम्प्लेट
-Name[hu]=Sablon
-Name[is]=Snið
-Name[it]=Modello
-Name[ja]=テンプレート
-Name[kk]=Үлгі
-Name[km]=ពុម្ព
-Name[lt]=Šablonas
-Name[ms]=Templat
-Name[nb]=Mal
-Name[nds]=Vörlaag
-Name[ne]=टेम्प्लेट
-Name[nl]=Sjabloon
-Name[nn]=Mal
-Name[nso]=Papiso
-Name[pl]=Wzorzec
-Name[pt]=Modelo
-Name[pt_BR]=Modelo
-Name[ro]=Model
-Name[ru]=Шаблон
-Name[se]=Málle
-Name[sk]=Šablóna
-Name[sl]=Predloga
-Name[sr]=Шаблон
-Name[sr@Latn]=Šablon
-Name[sv]=Mall
-Name[ta]=வார்ப்புரு
-Name[tg]=Қолиб
-Name[tr]=Şablon
-Name[uk]=Шаблон
-Name[uz]=Namuna
-Name[uz@cyrillic]=Намуна
-Name[wa]=Modele
-Name[zh_CN]=模板
-Name[zh_HK]=範本
-Name[zh_TW]=範本
-Name[zu]=i-template
Comment=A longer description of what the plugin does
-Comment[af]='n langer beskrywing van wat die inplak doen
-Comment[ar]=وصف أطول عن عمل البرنامج المساعد
-Comment[bg]=Подробно описание на приставката
-Comment[bs]=Duži opis onoga što dodatak radi
-Comment[ca]=Una descripció més llarga del que fa l'endollat
-Comment[cs]=Zde by měl být delší popis modulu
-Comment[cy]=Disgrifiad hirach o beth mae'r ategyn yn ei wneud
-Comment[da]=En længere beskrivelse af hvad dette plugin gør
-Comment[de]=Hier sollte eine längere Beschreibung des Moduls stehen
-Comment[el]=Μια μεγαλύτερη περιγραφή για το τι κάνει το πρόσθετο
-Comment[eo]=Pli longa priskribo pri la kromaĵo
-Comment[es]=Una descripción más completa de la función del plugin
-Comment[et]=Pluginate tegevuse pikemad kirjeldused
-Comment[eu]=Pluginak egiten duenaren azalpen luzeagoa
-Comment[fa]=توصیفی طولانی‌تر از آنچه وصله انجام می‌دهد
-Comment[fi]=Pidempi kuvaus, mitä liitännäinen tekee
-Comment[fr]=Une plus longue description de ce que fait le module
-Comment[gl]=Unha descrición máis longa do que pode facer a extensión
-Comment[he]=תיאור מפורט יותר לגבי מה שהתוסף עושה
-Comment[hi]=प्लगइन के बारे में लंबा वर्णन कि वह क्या करता है
-Comment[hr]=Duži opis umetka
-Comment[hu]=Ez a bővítőmodul részletesebb leírása
-Comment[is]=hér ætti að vera smá lýsing á hvað þetta gerir
-Comment[it]=Una descrizione più lunga di quello che fa il plugin
-Comment[ja]=ここにより詳細なプラグインの記述をします
-Comment[kk]=Плагин модульдің түсініктемесі
-Comment[km]=សេចក្ដី​ពណ៌នា​វែង អំពី​មុខងារ​របស់​កម្មវិធី​ជំនួយ
-Comment[lt]=Ilgesnis aprašymas, ką daro priedas
-Comment[ms]=Huraian panjang tentang apa yang plugin lakukan
-Comment[nb]=En lengre beskrivelse av hva modulen gjør
-Comment[nds]=En länger Beschrieven vun't Könen vun dat Moduul
-Comment[ne]=प्लगइनले गर्ने कामको बारेमा लामो वर्णन
-Comment[nl]=Plaats hier een kleine omschrijving van uw plugin
-Comment[nn]=Ei lengre skildring av kva modulen gjer
-Comment[nso]=Thlaloso ye telele ya seo ya seo plugin ese dirago
-Comment[pl]=Dłuższy opis tego, co wtyczka robi
-Comment[pt]=Uma descrição mais extensa do que o 'plugin' faz
-Comment[pt_BR]= Uma descrição maior do que um plugin faz
-Comment[ro]=O descriere mai lungă a modulului
-Comment[ru]=А здесь должно быть описание модуля
-Comment[se]=Guhkkit čilgehus mii muitala maid lassemoduvla bargá
-Comment[sk]=Tu by mal byť popis, čo modul robí
-Comment[sl]=Daljši opis, kaj naredi ta vstavek
-Comment[sr]=Дужи опис чему прикључак служи
-Comment[sr@Latn]=Duži opis čemu priključak služi
-Comment[sv]=En längre beskrivningen av vad insticksprogrammet gör
-Comment[ta]= சொருகுப்பொருள் செய்த பணியின் நீண்ட வருணனை
-Comment[tg]=Дар инҷо бояд тасвироти модул бошад
-Comment[tr]=Eklentinin uzun açıklaması
-Comment[uk]=Докладний опис можливостей втулку
-Comment[ven]=Thalutshedzo khulwane ya ine plugin ya ita zwone
-Comment[wa]=On discrijhaedje pus complet di çou k' est fwait på tchôke-divins
-Comment[xh]=Inkcazelo ende echaza ukuba iplagi ezingaphakathi zenza ntoni na
-Comment[zh_CN]=这里应该填写插件功能详细一点的描述
-Comment[zh_HK]=這個插件的功用的較長描述
-Comment[zh_TW]=關於這個外掛程式的所做所為的較長描述
-Comment[zu]=incazelo ende yokuthi i-plugin yenzani
diff --git a/kview/modules/template/kviewtemplate.h b/kview/modules/template/kviewtemplate.h
index 68084058..6130d50d 100644
--- a/kview/modules/template/kviewtemplate.h
+++ b/kview/modules/template/kviewtemplate.h
@@ -23,6 +23,4 @@ private slots:
private:
KImageViewer::Viewer * m_pViewer;
};
-
-// vim:sw=4:ts=4:cindent
#endif
diff --git a/kview/photobook/CMakeLists.txt b/kview/photobook/CMakeLists.txt
index bb7f2913..74a1ea04 100644
--- a/kview/photobook/CMakeLists.txt
+++ b/kview/photobook/CMakeLists.txt
@@ -23,7 +23,13 @@ link_directories(
##### other data ################################
tde_install_icons( photobook )
-install( FILES photobook.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+
+tde_create_translated_desktop(
+ SOURCE photobook.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kview-desktops
+)
+
install( FILES photobookui.rc DESTINATION ${DATA_INSTALL_DIR}/photobook )
diff --git a/kview/photobook/photobook.desktop b/kview/photobook/photobook.desktop
index 31c62a48..3326a473 100644
--- a/kview/photobook/photobook.desktop
+++ b/kview/photobook/photobook.desktop
@@ -1,129 +1,10 @@
[Desktop Entry]
GenericName=Photobook
-GenericName[bg]=Фотоалбум
-GenericName[br]=Levr foto
-GenericName[ca]=Llibre de fotografies
-GenericName[da]=Fotoalbum
-GenericName[de]=Photobuch
-GenericName[es]=Libro de fotografías
-GenericName[et]=Fotoalbum
-GenericName[fa]=کتاب عکس
-GenericName[fi]=Valokuvakirja
-GenericName[fr]=Album photo
-GenericName[gl]=Libro de Fotografías
-GenericName[he]=ספר תמונות
-GenericName[hu]=Fényképalbum
-GenericName[is]=Myndabók
-GenericName[it]=Album fotografico
-GenericName[ja]=フォトブック
-GenericName[kk]=Фотоальбом
-GenericName[km]=សៀវភៅ​រូបថត
-GenericName[lt]=Fotoalbumas
-GenericName[ms]=Bukufoto
-GenericName[nb]=Fotoalbum
-GenericName[nds]=Fotoalbum
-GenericName[ne]=फोटो पुस्तक
-GenericName[nl]=Fotoboek
-GenericName[nn]=Fotoalbum
-GenericName[pa]=ਫੋਟੋ ਬੁੱਕ
-GenericName[pl]=Album ze zdjęciami
-GenericName[pt]=Álbum Fotográfico
-GenericName[pt_BR]=Álbum de Fotos
-GenericName[ro]=Colecţie de fotografii
-GenericName[sk]=Album fotiek
-GenericName[sl]=Album slik
-GenericName[sr]=Фотокњига
-GenericName[sr@Latn]=Fotoknjiga
-GenericName[sv]=Fotoalbum
-GenericName[ta]=புகைப்படப் புத்தகம்
-GenericName[tr]=Albüm
-GenericName[uz]=Rasmlar toʻplami
-GenericName[uz@cyrillic]=Расмлар тўплами
-GenericName[zh_HK]=照相簿
MimeType=inode/directory
Icon=photobook
Name=Photobook
-Name[br]=Levr foto
-Name[ca]=Llibre de fotografies
-Name[da]=Fotoalbum
-Name[es]=Libro de fotografías
-Name[et]=Fotoalbum
-Name[fa]=کتاب عکس
-Name[fi]=Valokuvakirja
-Name[fr]=Album photo
-Name[gl]=Libro de Fotografías
-Name[he]=ספר תמונות
-Name[hu]=Fényképalbum
-Name[is]=Myndabók
-Name[it]=Album fotografico
-Name[kk]=Фотоальбом
-Name[km]=សៀវភៅ​រូបថត
-Name[lt]=Fotoalbumas
-Name[ms]=Bukufoto
-Name[nb]=Fotoalbum
-Name[ne]=फोटो पुस्तक
-Name[nl]=Fotoboek
-Name[nn]=Fotoalbum
-Name[pa]=ਫੋਟੋ ਬੁੱਕ
-Name[pl]=Album zdjęciowy
-Name[pt]=Álbum Fotográfico
-Name[pt_BR]=Álbum de Fotos
-Name[ro]=Colecţia de fotografii
-Name[sk]=Album fotiek
-Name[sr]=Фотокњига
-Name[sr@Latn]=Fotoknjiga
-Name[sv]=Fotoalbum
-Name[ta]=புகைப்படப் புத்தகம்
-Name[tr]=Albüm
-Name[uz]=Rasmlar toʻplami
-Name[uz@cyrillic]=Расмлар тўплами
-Name[zh_HK]=照相簿
Comment=Easily browse a folder of photographs
-Comment[bg]=Колекциониране на снимки като във фотоалбум
-Comment[bs]=Jednostavno pregledajte direktorij sa fotografijama
-Comment[ca]=Mirar fàcilment una carpeta de fotografies
-Comment[cs]=Jednoduché prohlížení složek s fotkami
-Comment[da]=Mappe med fotografier, nem at gennemse
-Comment[de]=Auf einfache Weise einen Ordner nach Photos durchsuchen
-Comment[el]=Εύκολη περιήγηση σε ένα φάκελο φωτογραφιών
-Comment[es]=Vistazo rápido de una carpeta con fotografías
-Comment[et]=Fotode kausta mugav lehitsemine
-Comment[eu]=Arakatu argazki karpetak modu errazan
-Comment[fa]=مرور آسان پوشه‌ای از عکسها
-Comment[fi]=Selaile helpolla valokuvakansioita
-Comment[fr]=Naviguer facilement dans un dossier contenant des photos
-Comment[gl]=Explorar doadamente un cartafol de fotografías
-Comment[he]=דפדף בקלות בתיקייה המכילה תמונות
-Comment[hu]=Könyvtárba helyezett fényképek nézegetéséhez
-Comment[is]=Flettu á auðveldan hátt gegnum möppu með myndum
-Comment[it]=Sfoglia facilmente una cartella di fotografie
-Comment[ja]=写真を含むフォルダをブラウズ
-Comment[kk]=Қапшықтағы фотоларды шолу
-Comment[km]=រកមើល​ថត​រូបថត​យ៉ាង​ងាយស្រួល
-Comment[lt]=Lengvai naršykite fotografijų aplankus
-Comment[ms]=Layar folder fotograf dengan mudah
-Comment[nb]=Enkel lesing av mapper med bilder
-Comment[nds]=Op eenfache Oort en Foto-Orner dörkieken
-Comment[ne]=फोटोग्राफको फोल्डर सजिलै ब्राउज गर्नुहोस्
-Comment[nl]=Blader eenvoudig door een map met foto's
-Comment[nn]=Enkel vising av mapper med bilete
-Comment[pl]=Łatwe przeglądanie folderów ze zdjęciami
-Comment[pt]=Navegue facilmente numa pasta de fotografias
-Comment[pt_BR]=Navegue facilmente por uma pasta cheia de fotos
-Comment[ro]=Răsfoiţi cu uşurinţă un folder de fotografii
-Comment[ru]=Просмотр папок с фотографиями
-Comment[sk]=Jednoducho prehliada priečinky s fotografiami
-Comment[sl]=Zlahka brskajte po mapi s fotografijami
-Comment[sr]=Лако прегледајте фасциклу са сликама
-Comment[sr@Latn]=Lako pregledajte fasciklu sa slikama
-Comment[sv]=Bläddra enkelt i en katalog med fotografier
-Comment[ta]=புகைப்படங்களின் அடைவை சுலபமாக உலாவ
-Comment[tr]=Fotoğraflarla dolu bir dizini kolayca gez
-Comment[uk]=Простий перегляд тек з фотографіями
-Comment[zh_CN]=轻松浏览照片文件夹
-Comment[zh_HK]=容易地瀏覽資料夾的照片
-Comment[zh_TW]=輕易地瀏覽相片的資料夾
X-TDE-ServiceTypes=KParts/ReadOnlyPart,Browser/View
X-TDE-Library=libphotobook
X-TDE-BrowserView-Args=DetailedList
diff --git a/kviewshell/CMakeL10n.txt b/kviewshell/CMakeL10n.txt
index f7aa7dab..512902e6 100644
--- a/kviewshell/CMakeL10n.txt
+++ b/kviewshell/CMakeL10n.txt
@@ -6,3 +6,9 @@ tde_l10n_create_template(
)
tde_l10n_auto_add_subdirectories( )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/kviewshell-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/kviewshell/CMakeLists.txt b/kviewshell/CMakeLists.txt
index e41b832f..71d53359 100644
--- a/kviewshell/CMakeLists.txt
+++ b/kviewshell/CMakeLists.txt
@@ -64,8 +64,19 @@ if ( BUILD_KVIEWSHELL )
install( FILES kviewshell.rc DESTINATION ${DATA_INSTALL_DIR}/kviewshell )
install( FILES kviewerpart.rc DESTINATION ${DATA_INSTALL_DIR}/kviewerpart )
- install( FILES tdemultipage.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
- install( FILES emptymultipage.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+
+ tde_create_translated_desktop(
+ SOURCE tdemultipage.desktop
+ DESTINATION ${SERVICETYPES_INSTALL_DIR}
+ PO_DIR kviewshell-desktops
+ )
+
+ tde_create_translated_desktop(
+ SOURCE emptymultipage.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kviewshell-desktops
+ )
+
install( FILES kviewshell.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
diff --git a/kviewshell/anchor.h b/kviewshell/anchor.h
index f3faf13e..e6c4869e 100644
--- a/kviewshell/anchor.h
+++ b/kviewshell/anchor.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// anchor.h
//
diff --git a/kviewshell/bookmark.h b/kviewshell/bookmark.h
index a1a310fb..f5dd2c0d 100644
--- a/kviewshell/bookmark.h
+++ b/kviewshell/bookmark.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/***************************************************************************
* Copyright (C) 2005 by Stefan Kebekus *
* kebekus@kde.org *
diff --git a/kviewshell/documentPageCache.h b/kviewshell/documentPageCache.h
index 5e5936d5..0218addd 100644
--- a/kviewshell/documentPageCache.h
+++ b/kviewshell/documentPageCache.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: documentPageCache
//
diff --git a/kviewshell/documentRenderer.h b/kviewshell/documentRenderer.h
index 4ac576fc..b94f0d9a 100644
--- a/kviewshell/documentRenderer.h
+++ b/kviewshell/documentRenderer.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: documentRenderer
//
diff --git a/kviewshell/documentWidget.h b/kviewshell/documentWidget.h
index d9b2839c..911d3c9d 100644
--- a/kviewshell/documentWidget.h
+++ b/kviewshell/documentWidget.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: documentWidet
//
diff --git a/kviewshell/emptyRenderer.h b/kviewshell/emptyRenderer.h
index 87ec5a0c..3c8a3f8e 100644
--- a/kviewshell/emptyRenderer.h
+++ b/kviewshell/emptyRenderer.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// ***************************************************************************
//
// Copyright (C) 2005 by Wilfried Huss <Wilfried.Huss@gmx.at>
diff --git a/kviewshell/empty_multipage.h b/kviewshell/empty_multipage.h
index 5f425ec8..753cdaba 100644
--- a/kviewshell/empty_multipage.h
+++ b/kviewshell/empty_multipage.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// ***************************************************************************
//
// Copyright (C) 2005 by Wilfried Huss <Wilfried.Huss@gmx.at>
diff --git a/kviewshell/emptymultipage.desktop b/kviewshell/emptymultipage.desktop
index 3b8a90bc..87696453 100644
--- a/kviewshell/emptymultipage.desktop
+++ b/kviewshell/emptymultipage.desktop
@@ -1,28 +1,6 @@
[Desktop Entry]
Type=Service
-Comment=
Name=EmptyMultiPage
-Name[de]=Leere Mehrfachseite
-Name[el]=ΚενήΠολλαπλήΣελίδα
-Name[es]=Vaciado multipágina
-Name[fi]=TyhjäMoniSivu
-Name[fr]=Multi-page vide
-Name[gl]=MultiPáxinaBaleira
-Name[hu]=ÜresTöbbOldalas
-Name[it]=MultiPaginaVuota
-Name[nb]=Tom Flerside
-Name[nds]=Leddig Mehrfachsiet
-Name[ne]=रिक्त बहुपृष्ठ
-Name[nl]=LegeMultiPagina
-Name[nn]=Tom fleirside
-Name[pl]=Puste wielostronicowe
-Name[pt_BR]=MultiPáginas Vazias
-Name[ro]=Pagini multiple goale
-Name[sk]=EmprtyMultiPage
-Name[sv]=Tom flera sidor
-Name[ta]=காலியான பலபக்கம்
-Name[tr]=BoşÇokluSayfa
-Name[zh_HK]=空的多頁
X-TDE-ServiceTypes=KViewShell/MultiPage
X-TDE-Library=emptymultipagepart
X-TDE-EmptyMultiPage=1
diff --git a/kviewshell/history.h b/kviewshell/history.h
index ba6376ef..791e39be 100644
--- a/kviewshell/history.h
+++ b/kviewshell/history.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef history_h
#define history_h
diff --git a/kviewshell/hyperlink.h b/kviewshell/hyperlink.h
index d57843b8..723c7237 100644
--- a/kviewshell/hyperlink.h
+++ b/kviewshell/hyperlink.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: hyperlink
//
diff --git a/kviewshell/kprintDialogPage_pageoptions.h b/kviewshell/kprintDialogPage_pageoptions.h
index 8b3ff434..68fe8a8c 100644
--- a/kviewshell/kprintDialogPage_pageoptions.h
+++ b/kviewshell/kprintDialogPage_pageoptions.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// KPrintDialogPage_PageOptions.h
//
// Part of KVIEWSHELL - A framework for multipage text/gfx viewers
diff --git a/kviewshell/kviewpart.h b/kviewshell/kviewpart.h
index b378028b..aaa0240b 100644
--- a/kviewshell/kviewpart.h
+++ b/kviewshell/kviewpart.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef KVIEWPART_H
#define KVIEWPART_H
diff --git a/kviewshell/kviewpart_iface.h b/kviewshell/kviewpart_iface.h
index 009552f1..78dd9cec 100644
--- a/kviewshell/kviewpart_iface.h
+++ b/kviewshell/kviewpart_iface.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef KVIEWPART_IFACE_H
#define KVIEWPART_IFACE_H
diff --git a/kviewshell/kviewshell.h b/kviewshell/kviewshell.h
index e4c45ee7..43876bcd 100644
--- a/kviewshell/kviewshell.h
+++ b/kviewshell/kviewshell.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef KVIEWSHELL_H
#define KVIEWSHELL_H
diff --git a/kviewshell/length.h b/kviewshell/length.h
index 149c8a10..4578d5e0 100644
--- a/kviewshell/length.h
+++ b/kviewshell/length.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: length
//
diff --git a/kviewshell/marklist.h b/kviewshell/marklist.h
index 0ee15758..d844934a 100644
--- a/kviewshell/marklist.h
+++ b/kviewshell/marklist.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* This file is part of the KDE project
Copyright (C) 2004 Wilfried Huss <Wilfried.Huss@gmx.at>
diff --git a/kviewshell/pageNumber.h b/kviewshell/pageNumber.h
index 9fd48dc6..fa91ea52 100644
--- a/kviewshell/pageNumber.h
+++ b/kviewshell/pageNumber.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// pageNumber.h
//
diff --git a/kviewshell/pageSize.h b/kviewshell/pageSize.h
index d7cbbd81..d7f31146 100644
--- a/kviewshell/pageSize.h
+++ b/kviewshell/pageSize.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// pageSize.h
//
diff --git a/kviewshell/pageSizeDialog.h b/kviewshell/pageSizeDialog.h
index 5614c7bb..8c651d55 100644
--- a/kviewshell/pageSizeDialog.h
+++ b/kviewshell/pageSizeDialog.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/*
* pageSizeDialog, for kviewshell
* This file: Copyright (C) 2002-2003 Stefan Kebekus, kebekus@kde.org
diff --git a/kviewshell/pageSizeWidget.h b/kviewshell/pageSizeWidget.h
index 572afe63..4834883f 100644
--- a/kviewshell/pageSizeWidget.h
+++ b/kviewshell/pageSizeWidget.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// pageSizeWidget.h
//
// Part of KVIEWSHELL - A framework for multipage text/gfx viewers
diff --git a/kviewshell/pageView.h b/kviewshell/pageView.h
index 4d2ef271..6b15b1f7 100644
--- a/kviewshell/pageView.h
+++ b/kviewshell/pageView.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* This file is part of the KDE project
Copyright (C) 2001 Wilco Greven <greven@kde.org>
Copyright (C) 2004-2005 Wilfried Huss <Wilfried.Huss@gmx.at>
diff --git a/kviewshell/plugins/djvu/CMakeLists.txt b/kviewshell/plugins/djvu/CMakeLists.txt
index fe9d4ef9..237f6bf3 100644
--- a/kviewshell/plugins/djvu/CMakeLists.txt
+++ b/kviewshell/plugins/djvu/CMakeLists.txt
@@ -28,7 +28,12 @@ link_directories(
##### other data ################################
-install( FILES djvumultipage.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE djvumultipage.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR kviewshell-desktops
+)
+
install( FILES djvumultipage.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES djvumultipage.rc DESTINATION ${DATA_INSTALL_DIR} )
diff --git a/kviewshell/plugins/djvu/djvumultipage.desktop b/kviewshell/plugins/djvu/djvumultipage.desktop
index 6da86c47..6aecc337 100644
--- a/kviewshell/plugins/djvu/djvumultipage.desktop
+++ b/kviewshell/plugins/djvu/djvumultipage.desktop
@@ -1,56 +1,8 @@
[Desktop Entry]
Name=kdjview
-Name[hu]=KDjView
-Name[ja]=Kdjview
-Name[ne]=केडीजे दृश्य
-Name[sk]=kdjView
-Name[sv]=Kdjview
-Name[zh_CN]=KDjView
Icon=kdjview
Type=Service
Comment=KViewShell plugin for DjVu files
-Comment[bg]=Приставка за файлове DjVu
-Comment[br]=Lugent KViewShell evit ar restroù DjVu
-Comment[bs]=KViewShell dodatak za DjVu datoteke
-Comment[ca]=Connector pel KViewShell per fitxers DjVu
-Comment[cs]=KViewShell modul pro DjVu soubory
-Comment[da]=Kviewshell-plugin for DjVu-filer
-Comment[de]=Ein KViewShell-Modul für DjVu-Dateien
-Comment[el]=Πρόσθετο του KViewShell για αρχεία DjVu
-Comment[es]=Extensión KViewShell para archivos DjVu
-Comment[et]=KView DjVu-failide plugin
-Comment[eu]=DjVu fitxategien KViewShell-en plugina
-Comment[fa]=وصلۀ KViewShell برای پرونده‌های DjVu
-Comment[fi]=KViewShell sovelma DjVu-tiedostoille
-Comment[fr]=Module KViewShell pour les fichiers DjVu
-Comment[gl]=Extensión de KViewShell para ficheiros DjVu
-Comment[hu]=KViewShell-modul DjVu-fájlokhoz
-Comment[is]=KViewShell íforrit fyrir DjVu skrár
-Comment[it]=Plugin KViewShell per file DjVu
-Comment[ja]=DjVu ファイル用の KViewShell プラグイン
-Comment[kk]=DjVu файлдарына арналған KViewShell плагин модулі
-Comment[km]=កម្មវិធី​ជំនួយ KViewShell សម្រាប់​ឯកសារ DjVu
-Comment[lt]=KViewShell priedas, skirtas DjVu byloms
-Comment[ms]=Plugin KViewShell untuk fail DjVu
-Comment[nb]=KViewShell programtillegg for DjVu-filer
-Comment[nds]=En "KViewShell"-Moduul för DjVu-Dateien
-Comment[ne]=डिजे भीयू फाइलका लागि केडीई दृश्य शेल प्लगइन
-Comment[nl]=KViewShell-plugin voor DjVu-bestanden
-Comment[nn]=KViewShell-programtillegg for DjVu-filer
-Comment[pl]=Wtyczka KViewShell do plików DjVu
-Comment[pt]='Plugin' do KViewShell para ficheiros do DjVu
-Comment[pt_BR]=Plugin KViewShell para arquivos DjVu
-Comment[ru]=Компонент просмотра файлов DjVu
-Comment[sk]=KViewShell modul pre DjVu súbory
-Comment[sl]=Vstavek za KViewShell za datoteke DjVu
-Comment[sr]=KViewShell-ов прикључак за DjVu фајлове
-Comment[sr@Latn]=KViewShell-ov priključak za DjVu fajlove
-Comment[sv]=Kviewshell-insticksprogram för DjVu-filer
-Comment[tr]=DjVu dosyaları için KViewShell eklentisi
-Comment[uk]=Втулок перегляду файлів DjVu для KViewShell
-Comment[zh_CN]=DjVu 文件的 KViewShell 插件
-Comment[zh_HK]=用於 DjVu 檔案的 KViewShell 插件
-Comment[zh_TW]=DjVu 檔的 KViewShell 外掛程式
X-TDE-ServiceTypes=KViewShell/MultiPage
X-TDE-MimeTypes=image/x-djvu
X-TDE-Library=djvuviewpart
diff --git a/kviewshell/plugins/djvu/libdjvu/Arrays.cpp b/kviewshell/plugins/djvu/libdjvu/Arrays.cpp
index 5cb7b04c..5a877dd6 100644
--- a/kviewshell/plugins/djvu/libdjvu/Arrays.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/Arrays.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/Arrays.h b/kviewshell/plugins/djvu/libdjvu/Arrays.h
index b2676d5a..2e16520c 100644
--- a/kviewshell/plugins/djvu/libdjvu/Arrays.h
+++ b/kviewshell/plugins/djvu/libdjvu/Arrays.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/BSByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/BSByteStream.cpp
index 77334a45..62dfa440 100644
--- a/kviewshell/plugins/djvu/libdjvu/BSByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/BSByteStream.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/BSByteStream.h b/kviewshell/plugins/djvu/libdjvu/BSByteStream.h
index 6a985cdf..be5735bd 100644
--- a/kviewshell/plugins/djvu/libdjvu/BSByteStream.h
+++ b/kviewshell/plugins/djvu/libdjvu/BSByteStream.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/BSEncodeByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/BSEncodeByteStream.cpp
index 9d5b726d..6278c19a 100644
--- a/kviewshell/plugins/djvu/libdjvu/BSEncodeByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/BSEncodeByteStream.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp
index 011b348d..ff04da3e 100644
--- a/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/ByteStream.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/ByteStream.h b/kviewshell/plugins/djvu/libdjvu/ByteStream.h
index 7ecfd8b7..a92e8aa4 100644
--- a/kviewshell/plugins/djvu/libdjvu/ByteStream.h
+++ b/kviewshell/plugins/djvu/libdjvu/ByteStream.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DataPool.cpp b/kviewshell/plugins/djvu/libdjvu/DataPool.cpp
index 1190292e..ab738a56 100644
--- a/kviewshell/plugins/djvu/libdjvu/DataPool.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DataPool.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DataPool.h b/kviewshell/plugins/djvu/libdjvu/DataPool.h
index fb4bea4e..ffd99ec5 100644
--- a/kviewshell/plugins/djvu/libdjvu/DataPool.h
+++ b/kviewshell/plugins/djvu/libdjvu/DataPool.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp
index 83f9df78..5b78d6fd 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir.h b/kviewshell/plugins/djvu/libdjvu/DjVmDir.h
index 86b661e3..80a93b40 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp
index 62694098..4994d5e7 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir0.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDir0.h b/kviewshell/plugins/djvu/libdjvu/DjVmDir0.h
index c17c795e..289a63c6 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDir0.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDir0.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp
index 5b851d6e..e6ba4a30 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDoc.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmDoc.h b/kviewshell/plugins/djvu/libdjvu/DjVmDoc.h
index 637d0b78..794e9802 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmDoc.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmDoc.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp
index 9e8b5fd7..cab46992 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVmNav.h b/kviewshell/plugins/djvu/libdjvu/DjVmNav.h
index 46c5d57f..746b6274 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVmNav.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVmNav.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
index 7cece60b..1d42b737 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h
index ed82f933..54c91e83 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuAnno.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp
index 542faa7a..1c6a3445 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h
index 7bf6124a..c7474cb3 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocEditor.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp
index 3b33d943..c7effd99 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h
index 418d0814..68376e39 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDocument.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp
index 2d977be1..6bc43ce7 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.h b/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.h
index 33be56c3..e0440344 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuDumpHelper.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp
index e7c74b84..302c6a91 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h
index 885e76aa..e4f38a0d 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuErrorList.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp
index 73e3a9c2..415992d4 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h
index ea0e6db3..5648184e 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFile.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFile.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.cpp
index 13220a96..b54d68b9 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h b/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h
index 9898b8f3..c6b1b70b 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuFileCache.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp
index b31b04bf..4caf68ba 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.h b/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.h
index 3d26c8cf..665be768 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuGlobal.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuGlobalMemory.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuGlobalMemory.cpp
index 1c684336..94474127 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuGlobalMemory.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuGlobalMemory.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp
index f384ce97..28d01b8c 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h
index 57b40938..f898c5a6 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuImage.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuImage.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuInfo.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuInfo.cpp
index 13ae6480..b77905f5 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuInfo.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuInfo.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuInfo.h b/kviewshell/plugins/djvu/libdjvu/DjVuInfo.h
index 67a83be9..4e188cad 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuInfo.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuInfo.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp
index e92b7570..9bcf3011 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuMessage.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuMessage.h b/kviewshell/plugins/djvu/libdjvu/DjVuMessage.h
index 2302be37..c9b598e7 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuMessage.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuMessage.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.cpp
index 258b0649..a312677c 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.h b/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.h
index f2e941cf..2f6cc93a 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuMessageLite.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.cpp
index 615041b0..48fd4507 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.h b/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.h
index 90b2b8db..d0bbb949 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuNavDir.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
index 0b8fa614..06e6e911 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h
index 7f9884f1..93b7661e 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPalette.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp
index 5e8a25c9..97723221 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPort.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuPort.h b/kviewshell/plugins/djvu/libdjvu/DjVuPort.h
index 99c165fb..d7700997 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuPort.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuPort.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp
index 5be8cbe7..152efa2c 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuText.h b/kviewshell/plugins/djvu/libdjvu/DjVuText.h
index b06536c7..abd57a62 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuText.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuText.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
index d18c7801..78490777 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002-2003 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.h b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.h
index 95d547bb..7c3efb2e 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.h
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002-2003 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp b/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp
index 696367e7..8af09e7c 100644
--- a/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GBitmap.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GBitmap.h b/kviewshell/plugins/djvu/libdjvu/GBitmap.h
index 22abbe06..fb255d44 100644
--- a/kviewshell/plugins/djvu/libdjvu/GBitmap.h
+++ b/kviewshell/plugins/djvu/libdjvu/GBitmap.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GContainer.cpp b/kviewshell/plugins/djvu/libdjvu/GContainer.cpp
index 2019439c..feeedd99 100644
--- a/kviewshell/plugins/djvu/libdjvu/GContainer.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GContainer.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GContainer.h b/kviewshell/plugins/djvu/libdjvu/GContainer.h
index 61fabfaf..9a298b04 100644
--- a/kviewshell/plugins/djvu/libdjvu/GContainer.h
+++ b/kviewshell/plugins/djvu/libdjvu/GContainer.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GException.cpp b/kviewshell/plugins/djvu/libdjvu/GException.cpp
index f3f84dda..a04ef1b2 100644
--- a/kviewshell/plugins/djvu/libdjvu/GException.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GException.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GException.h b/kviewshell/plugins/djvu/libdjvu/GException.h
index 97286987..822b668e 100644
--- a/kviewshell/plugins/djvu/libdjvu/GException.h
+++ b/kviewshell/plugins/djvu/libdjvu/GException.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GIFFManager.cpp b/kviewshell/plugins/djvu/libdjvu/GIFFManager.cpp
index 973c6cec..63ca548b 100644
--- a/kviewshell/plugins/djvu/libdjvu/GIFFManager.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GIFFManager.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GIFFManager.h b/kviewshell/plugins/djvu/libdjvu/GIFFManager.h
index 722f592f..921a7c64 100644
--- a/kviewshell/plugins/djvu/libdjvu/GIFFManager.h
+++ b/kviewshell/plugins/djvu/libdjvu/GIFFManager.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp b/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp
index 5a85e1fc..69c5b93f 100644
--- a/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GMapAreas.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GMapAreas.h b/kviewshell/plugins/djvu/libdjvu/GMapAreas.h
index 251427ed..46319147 100644
--- a/kviewshell/plugins/djvu/libdjvu/GMapAreas.h
+++ b/kviewshell/plugins/djvu/libdjvu/GMapAreas.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GOS.cpp b/kviewshell/plugins/djvu/libdjvu/GOS.cpp
index ebfaddfa..515c9e23 100644
--- a/kviewshell/plugins/djvu/libdjvu/GOS.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GOS.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GOS.h b/kviewshell/plugins/djvu/libdjvu/GOS.h
index 3e57fb40..1201e564 100644
--- a/kviewshell/plugins/djvu/libdjvu/GOS.h
+++ b/kviewshell/plugins/djvu/libdjvu/GOS.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp b/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp
index 81c1dd71..b9c15c72 100644
--- a/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GPixmap.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GPixmap.h b/kviewshell/plugins/djvu/libdjvu/GPixmap.h
index 32d51c7e..023fc411 100644
--- a/kviewshell/plugins/djvu/libdjvu/GPixmap.h
+++ b/kviewshell/plugins/djvu/libdjvu/GPixmap.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GRect.cpp b/kviewshell/plugins/djvu/libdjvu/GRect.cpp
index 1ac0a87c..fe482368 100644
--- a/kviewshell/plugins/djvu/libdjvu/GRect.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GRect.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GRect.h b/kviewshell/plugins/djvu/libdjvu/GRect.h
index 51770cbb..67c0ce94 100644
--- a/kviewshell/plugins/djvu/libdjvu/GRect.h
+++ b/kviewshell/plugins/djvu/libdjvu/GRect.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GScaler.cpp b/kviewshell/plugins/djvu/libdjvu/GScaler.cpp
index 0eeb9ebf..2f381449 100644
--- a/kviewshell/plugins/djvu/libdjvu/GScaler.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GScaler.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GScaler.h b/kviewshell/plugins/djvu/libdjvu/GScaler.h
index 4843f6d0..f2347a85 100644
--- a/kviewshell/plugins/djvu/libdjvu/GScaler.h
+++ b/kviewshell/plugins/djvu/libdjvu/GScaler.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp
index 8c17755d..92608c16 100644
--- a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h
index 937a783d..422b6569 100644
--- a/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h
+++ b/kviewshell/plugins/djvu/libdjvu/GSmartPointer.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GString.cpp b/kviewshell/plugins/djvu/libdjvu/GString.cpp
index a618055e..1b0deeae 100644
--- a/kviewshell/plugins/djvu/libdjvu/GString.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GString.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GString.h b/kviewshell/plugins/djvu/libdjvu/GString.h
index 601db983..a605de1d 100644
--- a/kviewshell/plugins/djvu/libdjvu/GString.h
+++ b/kviewshell/plugins/djvu/libdjvu/GString.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GThreads.cpp b/kviewshell/plugins/djvu/libdjvu/GThreads.cpp
index ce88361e..2e96d887 100644
--- a/kviewshell/plugins/djvu/libdjvu/GThreads.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GThreads.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GThreads.h b/kviewshell/plugins/djvu/libdjvu/GThreads.h
index 92691db4..1e43ea80 100644
--- a/kviewshell/plugins/djvu/libdjvu/GThreads.h
+++ b/kviewshell/plugins/djvu/libdjvu/GThreads.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GURL.cpp b/kviewshell/plugins/djvu/libdjvu/GURL.cpp
index 54b082ff..812f1d22 100644
--- a/kviewshell/plugins/djvu/libdjvu/GURL.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GURL.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GURL.h b/kviewshell/plugins/djvu/libdjvu/GURL.h
index eb3ed4bc..077da24a 100644
--- a/kviewshell/plugins/djvu/libdjvu/GURL.h
+++ b/kviewshell/plugins/djvu/libdjvu/GURL.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp b/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp
index dbbefc5c..ea3aba52 100644
--- a/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/GUnicode.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp
index c8b79809..51a491ab 100644
--- a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h
index cb1fb616..291e86fe 100644
--- a/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h
+++ b/kviewshell/plugins/djvu/libdjvu/IFFByteStream.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp b/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp
index c63eda7d..57b2a10a 100644
--- a/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/IW44EncodeCodec.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp
index 2cadf4f9..d2e94a1f 100644
--- a/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/IW44Image.h b/kviewshell/plugins/djvu/libdjvu/IW44Image.h
index 56cf00fa..817c1e5d 100644
--- a/kviewshell/plugins/djvu/libdjvu/IW44Image.h
+++ b/kviewshell/plugins/djvu/libdjvu/IW44Image.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp
index 5a8092a0..8491e760 100644
--- a/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/JB2EncodeCodec.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp
index 7aad9261..2d1bd218 100644
--- a/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/JB2Image.h b/kviewshell/plugins/djvu/libdjvu/JB2Image.h
index a8ea8aae..d3f2acaa 100644
--- a/kviewshell/plugins/djvu/libdjvu/JB2Image.h
+++ b/kviewshell/plugins/djvu/libdjvu/JB2Image.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp b/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp
index 3f611965..82ec93f0 100644
--- a/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.h b/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.h
index 8a0ace5d..8fcd737c 100644
--- a/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.h
+++ b/kviewshell/plugins/djvu/libdjvu/JPEGDecoder.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp
index 64be7931..add09e3b 100644
--- a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h
index 6516b4cd..633c1258 100644
--- a/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h
+++ b/kviewshell/plugins/djvu/libdjvu/MMRDecoder.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/MMX.cpp b/kviewshell/plugins/djvu/libdjvu/MMX.cpp
index 58b74177..e60ec1c9 100644
--- a/kviewshell/plugins/djvu/libdjvu/MMX.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/MMX.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/MMX.h b/kviewshell/plugins/djvu/libdjvu/MMX.h
index 9f432fe6..e6d17ba7 100644
--- a/kviewshell/plugins/djvu/libdjvu/MMX.h
+++ b/kviewshell/plugins/djvu/libdjvu/MMX.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/Template.h b/kviewshell/plugins/djvu/libdjvu/Template.h
index c37935ce..73de046a 100644
--- a/kviewshell/plugins/djvu/libdjvu/Template.h
+++ b/kviewshell/plugins/djvu/libdjvu/Template.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp b/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp
index 8d4f0188..a2affc02 100644
--- a/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.h b/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.h
index df678ffe..f4642067 100644
--- a/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.h
+++ b/kviewshell/plugins/djvu/libdjvu/UnicodeByteStream.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp
index b1d9f469..26910f34 100644
--- a/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/XMLParser.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/XMLParser.h b/kviewshell/plugins/djvu/libdjvu/XMLParser.h
index 08b6d508..0afd1bb3 100644
--- a/kviewshell/plugins/djvu/libdjvu/XMLParser.h
+++ b/kviewshell/plugins/djvu/libdjvu/XMLParser.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/XMLTags.cpp b/kviewshell/plugins/djvu/libdjvu/XMLTags.cpp
index 2511a585..58acaf57 100644
--- a/kviewshell/plugins/djvu/libdjvu/XMLTags.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/XMLTags.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/XMLTags.h b/kviewshell/plugins/djvu/libdjvu/XMLTags.h
index 027e629b..f217b8f3 100644
--- a/kviewshell/plugins/djvu/libdjvu/XMLTags.h
+++ b/kviewshell/plugins/djvu/libdjvu/XMLTags.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/ZPCodec.cpp b/kviewshell/plugins/djvu/libdjvu/ZPCodec.cpp
index 89461872..60b0ccf8 100644
--- a/kviewshell/plugins/djvu/libdjvu/ZPCodec.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/ZPCodec.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/ZPCodec.h b/kviewshell/plugins/djvu/libdjvu/ZPCodec.h
index 4eba6901..bee55490 100644
--- a/kviewshell/plugins/djvu/libdjvu/ZPCodec.h
+++ b/kviewshell/plugins/djvu/libdjvu/ZPCodec.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/configure.in.in b/kviewshell/plugins/djvu/libdjvu/configure.in.in
index 9af3757d..72029d3b 100644
--- a/kviewshell/plugins/djvu/libdjvu/configure.in.in
+++ b/kviewshell/plugins/djvu/libdjvu/configure.in.in
@@ -28,8 +28,8 @@ dnl -------------------------------------------------------
AC_DEFUN([AC_CHECK_CXX_OPT],[
opt="$1"
AC_MSG_CHECKING([if $CXX accepts $opt])
- echo 'void f(){}' > conftest.cc
- if test -z "`${CXX} ${CXXFLAGS} ${OPTS} $opt -c conftest.cc 2>&1`"; then
+ echo 'void f(){}' > conftest.cpp
+ if test -z "`${CXX} ${CXXFLAGS} ${OPTS} $opt -c conftest.cpp 2>&1`"; then
AC_MSG_RESULT(yes)
rm conftest.*
$2
@@ -389,8 +389,8 @@ if test x$acx_cothread != xno ; then
AC_MSG_RESULT($acx_cothread_patch)
if test x$acx_cothread_patch = xno ; then
AC_MSG_CHECKING([if the cothread patch is critical])
- echo 'void foo() { throw "Hello"; }' > conftest.cc
- compile="$CXX $CXXFLAGS -c conftest.cc"
+ echo 'void foo() { throw "Hello"; }' > conftest.cpp
+ compile="$CXX $CXXFLAGS -c conftest.cpp"
check="nm conftest.o | grep sjthrow | cat > conftest.out"
acx_cothread_patch=yes
if AC_TRY_EVAL(compile) && AC_TRY_EVAL(check) ; then
diff --git a/kviewshell/plugins/djvu/libdjvu/debug.cpp b/kviewshell/plugins/djvu/libdjvu/debug.cpp
index 20c93e50..40e57b70 100644
--- a/kviewshell/plugins/djvu/libdjvu/debug.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/debug.cpp
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/plugins/djvu/libdjvu/debug.h b/kviewshell/plugins/djvu/libdjvu/debug.h
index c39390a2..0aa4945b 100644
--- a/kviewshell/plugins/djvu/libdjvu/debug.h
+++ b/kviewshell/plugins/djvu/libdjvu/debug.h
@@ -1,4 +1,3 @@
-//C- -*- C++ -*-
//C- -------------------------------------------------------------------
//C- DjVuLibre-3.5
//C- Copyright (c) 2002 Leon Bottou and Yann Le Cun.
diff --git a/kviewshell/renderedDocumentPage.h b/kviewshell/renderedDocumentPage.h
index a266188a..2de1f992 100644
--- a/kviewshell/renderedDocumentPage.h
+++ b/kviewshell/renderedDocumentPage.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: documentPage
//
diff --git a/kviewshell/renderedDocumentPagePixmap.h b/kviewshell/renderedDocumentPagePixmap.h
index 2944075a..19c69567 100644
--- a/kviewshell/renderedDocumentPagePixmap.h
+++ b/kviewshell/renderedDocumentPagePixmap.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: RenderedDocumentPagePixmap
//
diff --git a/kviewshell/renderedDocumentPagePrinter.h b/kviewshell/renderedDocumentPagePrinter.h
index f0b78f91..c9e644b5 100644
--- a/kviewshell/renderedDocumentPagePrinter.h
+++ b/kviewshell/renderedDocumentPagePrinter.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: RenderedDocumentPagePrinter
//
diff --git a/kviewshell/searchWidget.h b/kviewshell/searchWidget.h
index d4b09e4d..f01b66bc 100644
--- a/kviewshell/searchWidget.h
+++ b/kviewshell/searchWidget.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/***************************************************************************
* Copyright (C) 2005 by Wilfried Huss *
* Wilfried.Huss@gmx.at *
diff --git a/kviewshell/selection.h b/kviewshell/selection.h
index 0f58fe5b..313b2815 100644
--- a/kviewshell/selection.h
+++ b/kviewshell/selection.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// selection.h
//
diff --git a/kviewshell/simplePageSize.h b/kviewshell/simplePageSize.h
index 46972e88..1bd39166 100644
--- a/kviewshell/simplePageSize.h
+++ b/kviewshell/simplePageSize.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// simplePageSize.h
//
diff --git a/kviewshell/sizePreview.h b/kviewshell/sizePreview.h
index 2d6e06fa..f5cddb50 100644
--- a/kviewshell/sizePreview.h
+++ b/kviewshell/sizePreview.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// SizePreview.h
//
// Part of KVIEWSHELL - A framework for multipage text/gfx viewers
diff --git a/kviewshell/tableOfContents.h b/kviewshell/tableOfContents.h
index d4f58c44..3e878ae3 100644
--- a/kviewshell/tableOfContents.h
+++ b/kviewshell/tableOfContents.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/***************************************************************************
* Copyright (C) 2005 by Wilfried Huss *
* Wilfried.Huss@gmx.at *
diff --git a/kviewshell/tdemultipage.desktop b/kviewshell/tdemultipage.desktop
index 0ef915a9..5d1aee9e 100644
--- a/kviewshell/tdemultipage.desktop
+++ b/kviewshell/tdemultipage.desktop
@@ -2,34 +2,6 @@
Type=Service
X-TDE-ServiceType=KViewShell/MultiPage
Name=KViewShell MultiPage
-Name[da]=KViewShell Multiside
-Name[de]=KViewShell Mehrfachseiten
-Name[el]=Πολλαπλή σελίδα KViewShell
-Name[es]=Multipágina KViewShell
-Name[fi]=KViewShell MoniSivu
-Name[fr]=Multi-page KViewShell
-Name[gl]=KViewShell Multipáxina
-Name[hu]=KViewShell többoldalas
-Name[it]=MultiPagina KViewShell
-Name[kk]=Көпбетті KViewShell
-Name[ms]=PelbagaiMuka KViewShell
-Name[nb]=KViewShell Flerside
-Name[nds]=KViewShell för Mehrfachsieden
-Name[ne]=के दृश्य शेल बहुपृष्ठ
-Name[nl]=KViewShell MultiPagina
-Name[nn]=KViewShell-fleirside
-Name[pl]=Wielostronicowe dla KViewShell
-Name[pt]=KViewShell MultiPágina
-Name[pt_BR]=KViewShell - Múltiplas Páginas
-Name[ro]=KViewShell Pagini Multiple
-Name[ru]=Компонент MultiPage
-Name[sr]=KViewShell вишестрани
-Name[sr@Latn]=KViewShell višestrani
-Name[sv]=Kviewshell flera sidor
-Name[ta]=கேகாட்சிஓடு பலபக்கம்
-Name[tr]=KViewShell ÇokluSayfa
-Name[zh_CN]=KViewShell 多页
-Name[zh_HK]=KViewShell 多頁
[PropertyDef::X-TDE-MimeTypes]
Type=TQString
diff --git a/kviewshell/tdemultipage.h b/kviewshell/tdemultipage.h
index c1402809..f41ff94f 100644
--- a/kviewshell/tdemultipage.h
+++ b/kviewshell/tdemultipage.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef _TDEMULTIPAGE_H
#define _TDEMULTIPAGE_H
diff --git a/kviewshell/tdemultipageInterface.h b/kviewshell/tdemultipageInterface.h
index f060a708..c1bbad90 100644
--- a/kviewshell/tdemultipageInterface.h
+++ b/kviewshell/tdemultipageInterface.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef TDEMULTIPAGEINTERFACE_H
#define TDEMULTIPAGEINTERFACE_H
diff --git a/kviewshell/textBox.h b/kviewshell/textBox.h
index 682b5583..22e24848 100644
--- a/kviewshell/textBox.h
+++ b/kviewshell/textBox.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
//
// Class: textBox
//
diff --git a/kviewshell/zoom.h b/kviewshell/zoom.h
index 4a1b780a..2ceb5f59 100644
--- a/kviewshell/zoom.h
+++ b/kviewshell/zoom.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
// zoom.h
//
// Part of KVIEWSHELL - A framework for multipage text/gfx viewers
diff --git a/kviewshell/zoomlimits.h b/kviewshell/zoomlimits.h
index 2458c488..e02641d6 100644
--- a/kviewshell/zoomlimits.h
+++ b/kviewshell/zoomlimits.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
#ifndef ZOOMLIMITS_H
#define ZOOMLIMITS_H
diff --git a/libkscan/CMakeL10n.txt b/libkscan/CMakeL10n.txt
index ff1141cd..b9f4eee0 100644
--- a/libkscan/CMakeL10n.txt
+++ b/libkscan/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "libkscan" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/scanservice.desktop/"
+ SOURCES scanservice.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/libkscan/CMakeLists.txt b/libkscan/CMakeLists.txt
index b108f9e9..0bd244b4 100644
--- a/libkscan/CMakeLists.txt
+++ b/libkscan/CMakeLists.txt
@@ -30,7 +30,10 @@ link_directories(
##### other data ################################
-install( FILES scanservice.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE scanservice.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+)
##### kscan (shared) ############################
diff --git a/libkscan/scanservice.desktop b/libkscan/scanservice.desktop
index 1a28f532..ae2943e2 100644
--- a/libkscan/scanservice.desktop
+++ b/libkscan/scanservice.desktop
@@ -1,70 +1,6 @@
[Desktop Entry]
Type=Service
Name=TDE Scan Service
-Name[af]=Kde Skandeer Diens
-Name[ar]=خدمة TDE للمسح الضوئي
-Name[az]=TDE Darama Servisi
-Name[bg]=Услуга за сканиране
-Name[br]=Damanterien skramm
-Name[ca]=Servei d'escaneig del TDE
-Name[cs]=Skenovací služba pro TDE
-Name[cy]=Gwasanaeth Sganio TDE
-Name[da]=TDE Skanneservice
-Name[de]=Scan-Dienst von TDE
-Name[el]=Υπηρεσία σάρωσης του TDE
-Name[eo]=Bildcifereciga servo (skano)
-Name[es]=Servicio de digitalización de TDE
-Name[et]=TDE skaneerimisteenus
-Name[eu]=TDE eskaneatze zerbitzua
-Name[fa]=خدمت پویش TDE
-Name[fi]=TDE :n skannauspalvelu
-Name[fr]=Service de numérisation pour TDE
-Name[gl]=Servicio de escáner de TDE
-Name[he]=שירות הסריקה של TDE
-Name[hi]=केडीई स्कैन सर्विस
-Name[hr]=TDE skan servis
-Name[hu]=TDE lapolvasó szolgáltatás
-Name[is]=TDE myndlesaraþjónusta
-Name[it]=Servizio di scansione di TDE
-Name[ja]=TDE スキャンサービス
-Name[kk]=TDE сканер қызметі
-Name[km]=សេវា​ស្កេន​របស់ TDE
-Name[ko]=TDE 스캔 서비스
-Name[lt]=TDE skanavimo tarnyba
-Name[lv]=TDE Skanēšanas Serviss
-Name[ms]=Perkhidmatan Imbas TDE
-Name[mt]=Servizz TDE tal-iskannjar
-Name[nb]=TDE skannetjeneste
-Name[nds]=Bildinleesdeenst för TDE
-Name[ne]=केडीई स्क्यान सेवा
-Name[nl]=TDE Scannerdiensten
-Name[nn]=TDE Skanningsteneste
-Name[nso]=Tirelo ya Tebelelo ya TDE
-Name[pl]=Usługa skanowania TDE
-Name[pt]=Serviço de 'Scanner' do TDE
-Name[pt_BR]=Serviço de Digitalização do TDE
-Name[ro]=Serviciu de scanare TDE
-Name[ru]=Служба сканирования TDE
-Name[se]=TDE skánnenbálválus
-Name[sk]=TDE skenovacia služba
-Name[sl]=Storitev skeniranja za TDE
-Name[sr]=TDE-ов сервис за скенирање
-Name[sr@Latn]=TDE-ov servis za skeniranje
-Name[sv]=TDE:s bildläsartjänst
-Name[ta]=கேடிஇ வருடு சேவை
-Name[tg]=Сканеронӣ дар TDE
-Name[th]=บริการสแกนภาพ - K
-Name[tr]=TDE Tarama Servisi
-Name[uk]=Служба пошуку TDE
-Name[uz]=TDE skan qilish xizmati
-Name[uz@cyrillic]=TDE скан қилиш хизмати
-Name[ven]=Tshishumiswa tshau naga tsha TDE
-Name[wa]=Siervice di scanaedje di TDE
-Name[xh]=Inkonzo yemita yovavanyo ye TDE
-Name[zh_CN]=TDE 扫描服务
-Name[zh_HK]=TDE 掃描服務
-Name[zh_TW]=TDE 掃描服務
-Name[zu]=Umsebenzi Lokuhlola lwe-TDE
X-TDE-Library=libkscan
X-TDE-InitialPreference=2
X-TDE-ServiceTypes=KScan/KScanDialog
diff --git a/tdefile-plugins/CMakeL10n.txt b/tdefile-plugins/CMakeL10n.txt
index b585ce4a..af16c09a 100644
--- a/tdefile-plugins/CMakeL10n.txt
+++ b/tdefile-plugins/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_auto_add_subdirectories( )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/tdefile-desktops/"
+ SOURCES *.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/tdefile-plugins/bmp/CMakeLists.txt b/tdefile-plugins/bmp/CMakeLists.txt
index 1bc54e24..4c5ddba5 100644
--- a/tdefile-plugins/bmp/CMakeLists.txt
+++ b/tdefile-plugins/bmp/CMakeLists.txt
@@ -22,7 +22,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_bmp.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_bmp.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_bmp (module) #########################
diff --git a/tdefile-plugins/bmp/tdefile_bmp.desktop b/tdefile-plugins/bmp/tdefile_bmp.desktop
index c6d25ee3..c62ee3e1 100644
--- a/tdefile-plugins/bmp/tdefile_bmp.desktop
+++ b/tdefile-plugins/bmp/tdefile_bmp.desktop
@@ -1,64 +1,6 @@
[Desktop Entry]
Type=Service
Name=BMP Info
-Name[af]=Bmp Inligting
-Name[ar]=معلومات BMP
-Name[br]=Titouroù BMP
-Name[ca]=Informació de BMP
-Name[cs]=BMP info
-Name[cy]=Gwybodaeth BMP
-Name[da]=BMP-info
-Name[de]=BMP-Info
-Name[el]=Πληροφορίες BMP
-Name[eo]=BMP-informo
-Name[es]=Info BMP
-Name[et]=BMP info
-Name[fa]=اطلاعات BMP
-Name[fi]=BMP-tiedot
-Name[fr]=Informations BMP
-Name[ga]=Eolas faoi BMP
-Name[gl]=Inf. BMP
-Name[he]=מידע BMP
-Name[hi]=BMP जानकारी
-Name[hr]=BMP informacije
-Name[hu]=BMP-jellemzők
-Name[is]=BMP upplýsingar
-Name[it]=Informazioni BMP
-Name[ja]=BMP 情報
-Name[kk]=BMP мәліметі
-Name[km]=ព័ត៌មាន BMP
-Name[lt]=BMP informacija
-Name[ms]=Maklumat BMP
-Name[nds]=BMP-Info
-Name[ne]=BMP सूचना
-Name[nl]=BMP-info
-Name[nn]=BMP-info
-Name[nso]=Tshedimoso ya BMP
-Name[pa]=BMP ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku BMP
-Name[pt]=Informação do BMP
-Name[pt_BR]=Informação sobre BMP
-Name[ro]=Informaţii BMP
-Name[ru]=Информация о BMP
-Name[se]=BMP-dieđut
-Name[sl]=Podatki o BMP
-Name[sr]=BMP информације
-Name[sr@Latn]=BMP informacije
-Name[sv]=BMP-information
-Name[ta]=BMP தகவல்
-Name[tg]=Иттилоот оиди BMP
-Name[th]=ข้อมูลแฟ้ม BMP
-Name[tr]=BMP Bilgisi
-Name[uk]=Інформація по BMP
-Name[uz]=BMP haqida maʼlumot
-Name[uz@cyrillic]=BMP ҳақида маълумот
-Name[ven]=Mafhungo BMP
-Name[wa]=Informåcion sol imådje BMP
-Name[xh]=Ulwazi lwe BMP
-Name[zh_CN]=BMP 信息
-Name[zh_HK]=BMP 資訊
-Name[zh_TW]=BMP 資訊
-Name[zu]=Ulwazi lwe-BMP
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_bmp
MimeType=image/x-bmp
diff --git a/tdefile-plugins/dds/CMakeLists.txt b/tdefile-plugins/dds/CMakeLists.txt
index eb367982..d2f56ce6 100644
--- a/tdefile-plugins/dds/CMakeLists.txt
+++ b/tdefile-plugins/dds/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data ##################################
-install( FILES tdefile_dds.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_dds.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_dds (module) ##########################
diff --git a/tdefile-plugins/dds/tdefile_dds.desktop b/tdefile-plugins/dds/tdefile_dds.desktop
index 7886ffac..a5e65b05 100644
--- a/tdefile-plugins/dds/tdefile_dds.desktop
+++ b/tdefile-plugins/dds/tdefile_dds.desktop
@@ -1,51 +1,6 @@
[Desktop Entry]
Type=Service
Name=DirectDraw Surface Info
-Name[ca]=Informació de superfície DirectDraw
-Name[cs]=DirectDraw Surface info
-Name[da]=DirectDraw overflade-info
-Name[de]=DirectDraw Oberflächeninfo
-Name[el]=Πληροφορίες επιφάνειας DirectDraw
-Name[eo]=DirectDraw surfac-informo
-Name[es]=Información de la primera vista de DirectDraw
-Name[et]=DirectDraw Surface'i info
-Name[eu]=DirectDraw Surface informazioa
-Name[fa]=اطلاعات سطح DirectDraw
-Name[fi]=DirectDraw pintatieto
-Name[fr]=Informations de surface DirectDraw
-Name[ga]=Eolas faoi DirectDraw Surface
-Name[gl]=Información de Superficie de DirectDraw
-Name[he]=מיגע אודות משטח DirectDraw
-Name[hu]=DirectDraw felületinformáció
-Name[is]=DirectDraw yfirborðs upplýsingar
-Name[it]=Informazioni superficie DirectDraw
-Name[ja]=DDS (DirectDraw Surface) 情報
-Name[kk]=DirectDraw бедерінің мәлметі
-Name[km]=ព័ត៌មាន​ផ្ទៃ​ខាង​ក្រៅ​អំពី DirectDraw
-Name[lt]=DirectDraw Surface informacija
-Name[ms]=Maklumat Permukaan LukisTerus
-Name[nb]=DirectDraw Overflate info
-Name[nds]="DirectDraw"-Böversietinfo
-Name[ne]=प्रत्यक्ष रेखाचित्र सतह सूचना
-Name[nl]=DirectDraw Surface-info
-Name[nn]=DirectDraw-overflateinfo
-Name[pl]=Informacja o powierzchni DirectDraw
-Name[pt]=Informação de Superfície DirectDraw
-Name[pt_BR]=Informações Sobre Superfícies Direct Draw
-Name[ro]=Informaţii Suprafaţă DirectDraw
-Name[ru]=Сведения о поверхности DirectDraw
-Name[sk]=DirectDraw informácie o povrchu
-Name[sl]=Podatki o površini DirectDraw
-Name[sr]=Информације о DirectDraw површини
-Name[sr@Latn]=Informacije o DirectDraw površini
-Name[sv]=Directdraw ytinformation
-Name[ta]=நேரடி மேற்பரப்பு தகவல்
-Name[th]=ข้อมูลแฟ้มพื้นผิว DirectDraw
-Name[tr]=DirectDraw Yüzey Bilgisi
-Name[uk]=Інформація про поверхню DirectDraw
-Name[zh_CN]=DirectDraw 表面信息
-Name[zh_HK]=DirectDraw 表面資訊
-Name[zh_TW]=DirectDraw Surface 資訊
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_dds
MimeType=image/x-dds
diff --git a/tdefile-plugins/dependencies/poppler-tqt/CMakeLists.txt b/tdefile-plugins/dependencies/poppler-tqt/CMakeLists.txt
index 2ce99412..d95dc846 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/CMakeLists.txt
+++ b/tdefile-plugins/dependencies/poppler-tqt/CMakeLists.txt
@@ -41,15 +41,22 @@ install( FILES
poppler-qt.h poppler-page-transition.h poppler-link-qt3.h
DESTINATION ${INCLUDE_INSTALL_DIR} )
+
##### poppler-tqt (shared) ############################
tde_add_library( poppler-tqt SHARED AUTOMOC
SOURCES
- poppler-document.cc poppler-fontinfo.cc
- poppler-link.cc poppler-page.cc
- poppler-page-transition.cc poppler-page-transition-private.h
- poppler-private.cc poppler-private.h
+ poppler-document.cpp poppler-fontinfo.cpp
+ poppler-link.cpp poppler-page.cpp
+ poppler-page-transition.cpp poppler-page-transition-private.h
+ poppler-private.cpp poppler-private.h
VERSION 0.0.0
+ CXX_FEATURES ${POPPLER_CXX_FEATURES}
LINK ${POPPLER_LIBRARIES} ${TQT_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}
)
+
+
+##### install cmake export file #################
+
+tde_install_export( )
diff --git a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
index 8fa36199..b6e0fbdd 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
+++ b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
@@ -24,7 +24,7 @@ check_cxx_source_compiles("
HAVE_POPPLER_030 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
-foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 )
+foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 0.83 0.86 21.08 21.11 21.12 22.03 )
string( REPLACE "." "" _poppler_str "${_poppler_ver}" )
if( NOT DEFINED HAVE_POPPLER_${_poppler_str} )
message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" )
@@ -37,3 +37,7 @@ foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 )
endif( )
endif( )
endforeach( )
+
+if( HAVE_POPPLER_2112 )
+ set( POPPLER_CXX_FEATURES cxx_std_17 CACHE INTERNAL "C++ standard required by Poppler" )
+endif()
diff --git a/tdefile-plugins/dependencies/poppler-tqt/Makefile.am b/tdefile-plugins/dependencies/poppler-tqt/Makefile.am
index 949dc2a4..2cd59963 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/Makefile.am
+++ b/tdefile-plugins/dependencies/poppler-tqt/Makefile.am
@@ -15,13 +15,13 @@ poppler_include_HEADERS = \
lib_LTLIBRARIES = libpoppler-tqt.la
libpoppler_tqt_la_SOURCES = \
- poppler-document.cc \
- poppler-fontinfo.cc \
- poppler-link.cc \
- poppler-page.cc \
- poppler-page-transition.cc \
+ poppler-document.cpp \
+ poppler-fontinfo.cpp \
+ poppler-link.cpp \
+ poppler-page.cpp \
+ poppler-page-transition.cpp \
poppler-page-transition-private.h \
- poppler-private.cc \
+ poppler-private.cpp \
poppler-private.h
libpoppler_tqt_la_LIBADD = \
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
deleted file mode 100644
index d35e4645..00000000
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc
+++ /dev/null
@@ -1,402 +0,0 @@
-/* poppler-document.cc: qt interface to poppler
- * Copyright (C) 2005, Net Integration Technologies, Inc.
- * Copyright (C) 2005-2009, Albert Astals Cid <aacid@kde.org>
- * Copyright (C) 2006, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
- * Copyright (C) 2006, Wilfried Huss <Wilfried.Huss@gmx.at>
- *
- * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <config.h>
-#include <poppler-qt.h>
-#include <tqfile.h>
-#include <GlobalParams.h>
-#include <Outline.h>
-#include <PDFDoc.h>
-#include <PSOutputDev.h>
-#include <Catalog.h>
-#include <ErrorCodes.h>
-#include <SplashOutputDev.h>
-#include <splash/SplashBitmap.h>
-#include <DateInfo.h>
-#include "poppler-private.h"
-
-#if !defined(HAVE_POPPLER_071)
-#undef bool
-#endif
-
-namespace Poppler {
-
-Document *Document::load(const TQString &filePath)
-{
- if (!globalParams) {
- globalParams = new GlobalParams();
- }
-
- DocumentData *doc = new DocumentData(new GooString(TQFile::encodeName(filePath)), NULL);
- Document *pdoc;
- if (doc->doc.isOk() || doc->doc.getErrorCode() == errEncrypted) {
- pdoc = new Document(doc);
- if (doc->doc.getErrorCode() == errEncrypted)
- pdoc->data->locked = true;
- else
- pdoc->data->locked = false;
- pdoc->data->m_fontInfoScanner = new FontInfoScanner(&(doc->doc));
- return pdoc;
- }
- else
- return NULL;
-}
-
-Document::Document(DocumentData *dataA)
-{
- data = dataA;
-}
-
-Document::~Document()
-{
- delete data;
-}
-
-bool Document::isLocked() const
-{
- return data->locked;
-}
-
-bool Document::unlock(const TQCString &password)
-{
- if (data->locked) {
- /* racier then it needs to be */
- GooString *filename = new GooString(data->doc.getFileName());
- GooString *pwd = new GooString(password.data());
- DocumentData *doc2 = new DocumentData(filename, pwd);
- delete pwd;
- if (!doc2->doc.isOk()) {
- delete doc2;
- } else {
- delete data;
- data = doc2;
- data->locked = false;
- data->m_fontInfoScanner = new FontInfoScanner(&(data->doc));
- }
- }
- return data->locked;
-}
-
-Document::PageMode Document::getPageMode(void) const
-{
- switch (data->doc.getCatalog()->getPageMode()) {
- case Catalog::pageModeNone:
- return UseNone;
- case Catalog::pageModeOutlines:
- return UseOutlines;
- case Catalog::pageModeThumbs:
- return UseThumbs;
- case Catalog::pageModeFullScreen:
- return FullScreen;
- case Catalog::pageModeOC:
- return UseOC;
- default:
- return UseNone;
- }
-}
-
-int Document::getNumPages() const
-{
- return data->doc.getNumPages();
-}
-
-TQValueList<FontInfo> Document::fonts() const
-{
- TQValueList<FontInfo> ourList;
- scanForFonts(getNumPages(), &ourList);
- return ourList;
-}
-
-bool Document::scanForFonts( int numPages, TQValueList<FontInfo> *fontList ) const
-{
- FONTS_LIST_TYPE items = data->m_fontInfoScanner->scan( numPages );
-
-#if !defined(HAVE_POPPLER_082)
- if ( NULL == items )
- return false;
-#endif
-#if !defined(HAVE_POPPLER_076)
- if ( FONTS_LIST_IS_EMPTY(items) ) {
-# if !defined(HAVE_POPPLER_082)
- delete items;
-# endif
- return false;
- }
-#endif
-
- for ( int i = 0; i < FONTS_LIST_LENGTH(items); ++i ) {
- TQString fontName;
- ::FontInfo *fontInfo = FONTS_LIST_GET(items, i);
- if (fontInfo->getName())
- fontName = fontInfo->getName()->GOO_GET_CSTR();
-
- FontInfo font(fontName,
- fontInfo->getEmbedded(),
- fontInfo->getSubset(),
- (Poppler::FontInfo::Type)(fontInfo->getType()));
- fontList->append(font);
- }
-# if defined(HAVE_POPPLER_082)
- for (auto entry : items) {
- delete entry;
- }
-# elif defined(HAVE_POPPLER_076)
- for (auto entry : *items) {
- delete entry;
- }
- delete items;
-# elif defined(HAVE_POPPLER_070)
- deleteGooList<::FontInfo>(items);
-# else
- deleteGooList(items, ::FontInfo);
-# endif
- return true;
-}
-
-/* borrowed from kpdf */
-TQString Document::getInfo( const TQString & type ) const
-{
- // [Albert] Code adapted from pdfinfo.cc on xpdf
- Object info;
- if ( data->locked )
- return NULL;
-
-# if defined(HAVE_POPPLER_058)
- info = data->doc.getDocInfo();
-# else
- data->doc.getDocInfo( &info );
-# endif
- if ( !info.isDict() )
- return NULL;
-
- TQString result;
- Object obj;
- CONST_064 GooString *s1;
- GBool isUnicode;
- Unicode u;
- int i;
- Dict *infoDict = info.getDict();
-
-#if defined(HAVE_POPPLER_058)
- obj = infoDict->lookup( (char*)type.latin1() );
-#else
- infoDict->lookup( (char*)type.latin1(), &obj );
-#endif
- if (!obj.isNull() && obj.isString())
- {
- s1 = obj.getString();
- if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff )
- {
- isUnicode = gTrue;
- i = 2;
- }
- else
- {
- isUnicode = gFalse;
- i = 0;
- }
- while ( i < obj.getString()->getLength() )
- {
- if ( isUnicode )
- {
- u = ( ( s1->getChar(i) & 0xff ) << 8 ) | ( s1->getChar(i+1) & 0xff );
- i += 2;
- }
- else
- {
- u = s1->getChar(i) & 0xff;
- ++i;
- }
- result += unicodeToTQString( &u, 1 );
- }
-# if !defined(HAVE_POPPLER_058)
- obj.free();
- info.free();
-# endif
- return result;
- }
-# if !defined(HAVE_POPPLER_058)
- obj.free();
- info.free();
-# endif
- return NULL;
-}
-
-/* borrowed from kpdf */
-TQDateTime Document::getDate( const TQString & type ) const
-{
- // [Albert] Code adapted from pdfinfo.cc on xpdf
- if ( data->locked )
- return TQDateTime();
-
- Object info;
-# if defined(HAVE_POPPLER_058)
- info = data->doc.getDocInfo();
-# else
- data->doc.getDocInfo( &info );
-# endif
- if ( !info.isDict() ) {
-# if !defined(HAVE_POPPLER_058)
- info.free();
-# endif
- return TQDateTime();
- }
-
- Object obj;
- int year, mon, day, hour, min, sec, tz_hour, tz_minute;
- char tz;
- Dict *infoDict = info.getDict();
- TQString result;
-
-#if defined(HAVE_POPPLER_058)
- obj = infoDict->lookup( (char*)type.latin1() );
-#else
- infoDict->lookup( (char*)type.latin1(), &obj );
-#endif
- if (!obj.isNull() && obj.isString())
- {
- TQString s = UnicodeParsedString(obj.getString());
- // TODO do something with the timezone information
- if ( parseDateString( s.latin1(), &year, &mon, &day, &hour, &min, &sec, &tz, &tz_hour, &tz_minute ) )
- {
- TQDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
- TQTime t( hour, min, sec );
- if ( d.isValid() && t.isValid() ) {
-# if !defined(HAVE_POPPLER_058)
- obj.free();
- info.free();
-# endif
- return TQDateTime( d, t );
- }
- }
- }
-# if !defined(HAVE_POPPLER_058)
- obj.free();
- info.free();
-# endif
- return TQDateTime();
-}
-
-bool Document::isEncrypted() const
-{
- return data->doc.isEncrypted();
-}
-
-bool Document::isLinearized() const
-{
- return data->doc.isLinearized();
-}
-
-bool Document::okToPrint() const
-{
- return data->doc.okToPrint();
-}
-
-bool Document::okToChange() const
-{
- return data->doc.okToChange();
-}
-
-bool Document::okToCopy() const
-{
- return data->doc.okToCopy();
-}
-
-bool Document::okToAddNotes() const
-{
- return data->doc.okToAddNotes();
-}
-
-double Document::getPDFVersion() const
-{
- return data->doc.getPDFMajorVersion () + data->doc.getPDFMinorVersion() / 10.0;
-}
-
-void Document::getPdfVersion(int *major, int *minor) const
-{
- if (major)
- *major = data->doc.getPDFMajorVersion();
- if (minor)
- *minor = data->doc.getPDFMinorVersion();
-}
-
-TQDomDocument *Document::toc() const
-{
- Outline * outline = data->doc.getOutline();
- if ( !outline )
- return NULL;
-
- OUTLINE_ITEMS_TYPE * items = outline->getItems();
- if ( !items || OUTLINE_ITEMS_LENGTH(items) < 1 )
- return NULL;
-
- TQDomDocument *toc = new TQDomDocument();
- if ( OUTLINE_ITEMS_LENGTH(items) > 0 )
- data->addTocChildren( toc, toc, items );
-
- return toc;
-}
-
-LinkDestination *Document::linkDestination( const TQString &name )
-{
- GooString * namedDest = TQStringToGooString( name );
- LinkDestinationData ldd(NULL, namedDest, data);
- LinkDestination *ld = new LinkDestination(ldd);
- delete namedDest;
- return ld;
-}
-
-bool Document::print(const TQString &fileName, TQValueList<int> pageList, double hDPI, double vDPI, int rotate)
-{
- return print(fileName, pageList, hDPI, vDPI, rotate, -1, -1);
-}
-
-bool Document::print(const TQString &file, TQValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
-{
-#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030)
- std::vector<int> pages;
- TQValueList<int>::iterator it;
- for (it = pageList.begin(); it != pageList.end(); ++it ) {
- pages.push_back(*it);
- }
- PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, pages, psModePS, paperWidth, paperHeight);
-#elif defined(HAVE_POPPLER_020)
- PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
-#elif defined(HAVE_POPPLER_016)
- PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
-#else
- PSOutputDev *psOut = new PSOutputDev(file.latin1(), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
-#endif
-
- if (psOut->isOk()) {
- TQValueList<int>::iterator it;
- for (it = pageList.begin(); it != pageList.end(); ++it )
- data->doc.displayPage(psOut, *it, hDPI, vDPI, rotate, gFalse, gTrue, gTrue);
-
- delete psOut;
- return true;
- } else {
- delete psOut;
- return false;
- }
-}
-
-}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
new file mode 100644
index 00000000..86e831ee
--- /dev/null
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
@@ -0,0 +1,421 @@
+/* poppler-document.cpp: qt interface to poppler
+ * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2005-2009, Albert Astals Cid <aacid@kde.org>
+ * Copyright (C) 2006, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
+ * Copyright (C) 2006, Wilfried Huss <Wilfried.Huss@gmx.at>
+ *
+ * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <config.h>
+#include <poppler-qt.h>
+#include <tqfile.h>
+#include <GlobalParams.h>
+#include <Outline.h>
+#include <PDFDoc.h>
+#include <PSOutputDev.h>
+#include <Catalog.h>
+#include <ErrorCodes.h>
+#include <SplashOutputDev.h>
+#include <splash/SplashBitmap.h>
+#include <DateInfo.h>
+#include "poppler-private.h"
+
+#if !defined(HAVE_POPPLER_071)
+#undef bool
+#endif
+
+namespace Poppler {
+
+Document *Document::load(const TQString &filePath)
+{
+ if (!globalParams) {
+ globalParams =
+#if defined(HAVE_POPPLER_083)
+ std::make_unique<GlobalParams>();
+#else
+ new GlobalParams();
+#endif
+ }
+
+# if defined(HAVE_POPPLER_2203)
+ DocumentData *doc = new DocumentData(std::make_unique<GooString>(TQFile::encodeName(filePath)), {});
+# else
+ DocumentData *doc = new DocumentData(new GooString(TQFile::encodeName(filePath)), NULL);
+# endif
+ Document *pdoc;
+ if (doc->doc.isOk() || doc->doc.getErrorCode() == errEncrypted) {
+ pdoc = new Document(doc);
+ if (doc->doc.getErrorCode() == errEncrypted)
+ pdoc->data->locked = true;
+ else
+ pdoc->data->locked = false;
+ pdoc->data->m_fontInfoScanner = new FontInfoScanner(&(doc->doc));
+ return pdoc;
+ }
+ else
+ return NULL;
+}
+
+Document::Document(DocumentData *dataA)
+{
+ data = dataA;
+}
+
+Document::~Document()
+{
+ delete data;
+}
+
+bool Document::isLocked() const
+{
+ return data->locked;
+}
+
+bool Document::unlock(const TQCString &password)
+{
+ if (data->locked) {
+ /* racier then it needs to be */
+# if defined(HAVE_POPPLER_2203)
+ DocumentData *doc2 = new DocumentData(std::make_unique<GooString>(data->doc.getFileName()),
+ GooString(password.data()));
+# else
+ GooString *filename = new GooString(data->doc.getFileName());
+ GooString *pwd = new GooString(password.data());
+ DocumentData *doc2 = new DocumentData(filename, pwd);
+ delete pwd;
+# endif
+ if (!doc2->doc.isOk()) {
+ delete doc2;
+ } else {
+ delete data;
+ data = doc2;
+ data->locked = false;
+ data->m_fontInfoScanner = new FontInfoScanner(&(data->doc));
+ }
+ }
+ return data->locked;
+}
+
+Document::PageMode Document::getPageMode(void) const
+{
+ switch (data->doc.getCatalog()->getPageMode()) {
+ case Catalog::pageModeNone:
+ return UseNone;
+ case Catalog::pageModeOutlines:
+ return UseOutlines;
+ case Catalog::pageModeThumbs:
+ return UseThumbs;
+ case Catalog::pageModeFullScreen:
+ return FullScreen;
+ case Catalog::pageModeOC:
+ return UseOC;
+ default:
+ return UseNone;
+ }
+}
+
+int Document::getNumPages() const
+{
+ return data->doc.getNumPages();
+}
+
+TQValueList<FontInfo> Document::fonts() const
+{
+ TQValueList<FontInfo> ourList;
+ scanForFonts(getNumPages(), &ourList);
+ return ourList;
+}
+
+bool Document::scanForFonts( int numPages, TQValueList<FontInfo> *fontList ) const
+{
+ FONTS_LIST_TYPE items = data->m_fontInfoScanner->scan( numPages );
+
+#if !defined(HAVE_POPPLER_082)
+ if ( NULL == items )
+ return false;
+#endif
+#if !defined(HAVE_POPPLER_076)
+ if ( FONTS_LIST_IS_EMPTY(items) ) {
+# if !defined(HAVE_POPPLER_082)
+ delete items;
+# endif
+ return false;
+ }
+#endif
+
+ for ( int i = 0; i < FONTS_LIST_LENGTH(items); ++i ) {
+ TQString fontName;
+ ::FontInfo *fontInfo = FONTS_LIST_GET(items, i);
+ if (fontInfo->getName())
+ fontName = fontInfo->getName()->GOO_GET_CSTR();
+
+ FontInfo font(fontName,
+ fontInfo->getEmbedded(),
+ fontInfo->getSubset(),
+ (Poppler::FontInfo::Type)(fontInfo->getType()));
+ fontList->append(font);
+ }
+# if defined(HAVE_POPPLER_082)
+ for (auto entry : items) {
+ delete entry;
+ }
+# elif defined(HAVE_POPPLER_076)
+ for (auto entry : *items) {
+ delete entry;
+ }
+ delete items;
+# elif defined(HAVE_POPPLER_070)
+ deleteGooList<::FontInfo>(items);
+# else
+ deleteGooList(items, ::FontInfo);
+# endif
+ return true;
+}
+
+/* borrowed from kpdf */
+TQString Document::getInfo( const TQString & type ) const
+{
+ // [Albert] Code adapted from pdfinfo.cpp on xpdf
+ Object info;
+ if ( data->locked )
+ return NULL;
+
+# if defined(HAVE_POPPLER_058)
+ info = data->doc.getDocInfo();
+# else
+ data->doc.getDocInfo( &info );
+# endif
+ if ( !info.isDict() )
+ return NULL;
+
+ TQString result;
+ Object obj;
+ CONST_064 GooString *s1;
+ GBool isUnicode;
+ Unicode u;
+ int i;
+ Dict *infoDict = info.getDict();
+
+#if defined(HAVE_POPPLER_058)
+ obj = infoDict->lookup( (char*)type.latin1() );
+#else
+ infoDict->lookup( (char*)type.latin1(), &obj );
+#endif
+ if (!obj.isNull() && obj.isString())
+ {
+ s1 = obj.getString();
+ if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff )
+ {
+ isUnicode = gTrue;
+ i = 2;
+ }
+ else
+ {
+ isUnicode = gFalse;
+ i = 0;
+ }
+ while ( i < obj.getString()->getLength() )
+ {
+ if ( isUnicode )
+ {
+ u = ( ( s1->getChar(i) & 0xff ) << 8 ) | ( s1->getChar(i+1) & 0xff );
+ i += 2;
+ }
+ else
+ {
+ u = s1->getChar(i) & 0xff;
+ ++i;
+ }
+ result += unicodeToTQString( &u, 1 );
+ }
+# if !defined(HAVE_POPPLER_058)
+ obj.free();
+ info.free();
+# endif
+ return result;
+ }
+# if !defined(HAVE_POPPLER_058)
+ obj.free();
+ info.free();
+# endif
+ return NULL;
+}
+
+/* borrowed from kpdf */
+TQDateTime Document::getDate( const TQString & type ) const
+{
+ // [Albert] Code adapted from pdfinfo.cpp on xpdf
+ if ( data->locked )
+ return TQDateTime();
+
+ Object info;
+# if defined(HAVE_POPPLER_058)
+ info = data->doc.getDocInfo();
+# else
+ data->doc.getDocInfo( &info );
+# endif
+ if ( !info.isDict() ) {
+# if !defined(HAVE_POPPLER_058)
+ info.free();
+# endif
+ return TQDateTime();
+ }
+
+ Object obj;
+ int year, mon, day, hour, min, sec, tz_hour, tz_minute;
+ char tz;
+ Dict *infoDict = info.getDict();
+ TQString result;
+
+#if defined(HAVE_POPPLER_058)
+ obj = infoDict->lookup( (char*)type.latin1() );
+#else
+ infoDict->lookup( (char*)type.latin1(), &obj );
+#endif
+ if (!obj.isNull() && obj.isString())
+ {
+# if defined(HAVE_POPPLER_2108)
+ const GooString *s = obj.getString();
+# else
+ TQString tqs = UnicodeParsedString(obj.getString());
+ const char *s = tqs.latin1();
+# endif
+ // TODO do something with the timezone information
+ if (parseDateString(s, &year, &mon, &day, &hour, &min, &sec, &tz, &tz_hour, &tz_minute))
+ {
+ TQDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
+ TQTime t( hour, min, sec );
+ if ( d.isValid() && t.isValid() ) {
+# if !defined(HAVE_POPPLER_058)
+ obj.free();
+ info.free();
+# endif
+ return TQDateTime( d, t );
+ }
+ }
+ }
+# if !defined(HAVE_POPPLER_058)
+ obj.free();
+ info.free();
+# endif
+ return TQDateTime();
+}
+
+bool Document::isEncrypted() const
+{
+ return data->doc.isEncrypted();
+}
+
+bool Document::isLinearized() const
+{
+ return data->doc.isLinearized();
+}
+
+bool Document::okToPrint() const
+{
+ return data->doc.okToPrint();
+}
+
+bool Document::okToChange() const
+{
+ return data->doc.okToChange();
+}
+
+bool Document::okToCopy() const
+{
+ return data->doc.okToCopy();
+}
+
+bool Document::okToAddNotes() const
+{
+ return data->doc.okToAddNotes();
+}
+
+double Document::getPDFVersion() const
+{
+ return data->doc.getPDFMajorVersion () + data->doc.getPDFMinorVersion() / 10.0;
+}
+
+void Document::getPdfVersion(int *major, int *minor) const
+{
+ if (major)
+ *major = data->doc.getPDFMajorVersion();
+ if (minor)
+ *minor = data->doc.getPDFMinorVersion();
+}
+
+TQDomDocument *Document::toc() const
+{
+ Outline * outline = data->doc.getOutline();
+ if ( !outline )
+ return NULL;
+
+ OUTLINE_ITEMS_TYPE * items = outline->getItems();
+ if ( !items || OUTLINE_ITEMS_LENGTH(items) < 1 )
+ return NULL;
+
+ TQDomDocument *toc = new TQDomDocument();
+ if ( OUTLINE_ITEMS_LENGTH(items) > 0 )
+ data->addTocChildren( toc, toc, items );
+
+ return toc;
+}
+
+LinkDestination *Document::linkDestination( const TQString &name )
+{
+ GooString * namedDest = TQStringToGooString( name );
+ LinkDestinationData ldd(NULL, namedDest, data);
+ LinkDestination *ld = new LinkDestination(ldd);
+ delete namedDest;
+ return ld;
+}
+
+bool Document::print(const TQString &fileName, TQValueList<int> pageList, double hDPI, double vDPI, int rotate)
+{
+ return print(fileName, pageList, hDPI, vDPI, rotate, -1, -1);
+}
+
+bool Document::print(const TQString &file, TQValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
+{
+#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030)
+ std::vector<int> pages;
+ TQValueList<int>::iterator it;
+ for (it = pageList.begin(); it != pageList.end(); ++it ) {
+ pages.push_back(*it);
+ }
+ PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, pages, psModePS, paperWidth, paperHeight);
+#elif defined(HAVE_POPPLER_020)
+ PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
+#elif defined(HAVE_POPPLER_016)
+ PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
+#else
+ PSOutputDev *psOut = new PSOutputDev(file.latin1(), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
+#endif
+
+ if (psOut->isOk()) {
+ TQValueList<int>::iterator it;
+ for (it = pageList.begin(); it != pageList.end(); ++it )
+ data->doc.displayPage(psOut, *it, hDPI, vDPI, rotate, gFalse, gTrue, gTrue);
+
+ delete psOut;
+ return true;
+ } else {
+ delete psOut;
+ return false;
+ }
+}
+
+}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-fontinfo.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-fontinfo.cpp
index c0e777a7..c0e777a7 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-fontinfo.cc
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-fontinfo.cpp
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc
deleted file mode 100644
index 52d7e4ab..00000000
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc
+++ /dev/null
@@ -1,267 +0,0 @@
-/* poppler-link.cc: qt interface to poppler
- * Copyright (C) 2006, 2008 Albert Astals Cid
- * Adapting code from
- * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
- *
- * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <poppler-qt.h>
-#include <poppler-private.h>
-
-#include <tqstringlist.h>
-
-#include <Link.h>
-
-namespace Poppler {
-
- LinkDestination::LinkDestination(const LinkDestinationData &data)
- {
- bool deleteDest = false;
- CONST_064 LinkDest *ld = data.ld;
-
- if ( data.namedDest && !ld )
- {
- deleteDest = true;
- ld = data.doc->doc.findDest( data.namedDest );
- }
-
- if (!ld) return;
-
- if (ld->getKind() == ::destXYZ) m_kind = destXYZ;
- else if (ld->getKind() == ::destFit) m_kind = destFit;
- else if (ld->getKind() == ::destFitH) m_kind = destFitH;
- else if (ld->getKind() == ::destFitV) m_kind = destFitV;
- else if (ld->getKind() == ::destFitR) m_kind = destFitR;
- else if (ld->getKind() == ::destFitB) m_kind = destFitB;
- else if (ld->getKind() == ::destFitBH) m_kind = destFitBH;
- else if (ld->getKind() == ::destFitBV) m_kind = destFitBV;
-
- if ( !ld->isPageRef() ) m_pageNum = ld->getPageNum();
- else
- {
- Ref ref = ld->getPageRef();
- m_pageNum = data.doc->doc.findPage(FIND_PAGE_ARGS(ref));
- }
- double left = ld->getLeft();
- double bottom = ld->getBottom();
- double right = ld->getRight();
- double top = ld->getTop();
- m_zoom = ld->getZoom();
- m_changeLeft = ld->getChangeLeft();
- m_changeTop = ld->getChangeTop();
- m_changeZoom = ld->getChangeZoom();
-
- int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0;
-
-#if defined(HAVE_SPLASH)
- SplashOutputDev *sod = data.doc->getOutputDev();
- sod->cvtUserToDev( left, top, &leftAux, &topAux );
- sod->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
-#endif
-
- m_left = leftAux;
- m_top = topAux;
- m_right = rightAux;
- m_bottom = bottomAux;
-
- if (deleteDest) delete ld;
- }
-
- LinkDestination::LinkDestination(const TQString &description)
- {
- TQStringList tokens = TQStringList::split(';', description);
- m_kind = static_cast<Kind>(tokens[0].toInt());
- m_pageNum = tokens[1].toInt();
- m_left = tokens[2].toDouble();
- m_bottom = tokens[3].toDouble();
- m_right = tokens[4].toDouble();
- m_top = tokens[5].toDouble();
- m_zoom = tokens[6].toDouble();
- m_changeLeft = static_cast<bool>(tokens[7].toInt());
- m_changeTop = static_cast<bool>(tokens[8].toInt());
- m_changeZoom = static_cast<bool>(tokens[9].toInt());
- }
-
- LinkDestination::Kind LinkDestination::kind() const
- {
- return m_kind;
- }
-
- int LinkDestination::pageNumber() const
- {
- return m_pageNum;
- }
-
- double LinkDestination::left() const
- {
- return m_left;
- }
-
- double LinkDestination::bottom() const
- {
- return m_bottom;
- }
-
- double LinkDestination::right() const
- {
- return m_right;
- }
-
- double LinkDestination::top() const
- {
- return m_top;
- }
-
- double LinkDestination::zoom() const
- {
- return m_zoom;
- }
-
- bool LinkDestination::isChangeLeft() const
- {
- return m_changeLeft;
- }
-
- bool LinkDestination::isChangeTop() const
- {
- return m_changeTop;
- }
-
- bool LinkDestination::isChangeZoom() const
- {
- return m_changeZoom;
- }
-
- TQString LinkDestination::toString() const
- {
- TQString s = TQString::number( (TQ_INT8)m_kind );
- s += ";" + TQString::number( m_pageNum );
- s += ";" + TQString::number( m_left );
- s += ";" + TQString::number( m_bottom );
- s += ";" + TQString::number( m_right );
- s += ";" + TQString::number( m_top );
- s += ";" + TQString::number( m_zoom );
- s += ";" + TQString::number( (TQ_INT8)m_changeLeft );
- s += ";" + TQString::number( (TQ_INT8)m_changeTop );
- s += ";" + TQString::number( (TQ_INT8)m_changeZoom );
- return s;
- }
-
-
- // Link
- Link::~Link()
- {
- }
-
- Link::Link(const TQRect &linkArea) : m_linkArea(linkArea)
- {
- }
-
- Link::LinkType Link::linkType() const
- {
- return None;
- }
-
- TQRect Link::linkArea() const
- {
- return m_linkArea;
- }
-
- // LinkGoto
- LinkGoto::LinkGoto( const TQRect &linkArea, TQString extFileName, const LinkDestination & destination ) : Link(linkArea), m_extFileName(extFileName), m_destination(destination)
- {
- }
-
- bool LinkGoto::isExternal() const
- {
- return !m_extFileName.isEmpty();
- }
-
- const TQString &LinkGoto::fileName() const
- {
- return m_extFileName;
- }
-
- const LinkDestination &LinkGoto::destination() const
- {
- return m_destination;
- }
-
- Link::LinkType LinkGoto::linkType() const
- {
- return Goto;
- }
-
- // LinkExecute
- LinkExecute::LinkExecute( const TQRect &linkArea, const TQString & file, const TQString & params ) : Link(linkArea), m_fileName(file), m_parameters(params)
- {
- }
-
- const TQString & LinkExecute::fileName() const
- {
- return m_fileName;
- }
- const TQString & LinkExecute::parameters() const
- {
- return m_parameters;
- }
-
- Link::LinkType LinkExecute::linkType() const
- {
- return Execute;
- }
-
- // LinkBrowse
- LinkBrowse::LinkBrowse( const TQRect &linkArea, const TQString &url ) : Link(linkArea), m_url(url)
- {
- }
-
- const TQString & LinkBrowse::url() const
- {
- return m_url;
- }
-
- Link::LinkType LinkBrowse::linkType() const
- {
- return Browse;
- }
-
- // LinkAction
- LinkAction::LinkAction( const TQRect &linkArea, ActionType actionType ) : Link(linkArea), m_type(actionType)
- {
- }
-
- LinkAction::ActionType LinkAction::actionType() const
- {
- return m_type;
- }
-
- Link::LinkType LinkAction::linkType() const
- {
- return Action;
- }
-
- // LinkMovie
- LinkMovie::LinkMovie( const TQRect &linkArea ) : Link(linkArea)
- {
- }
-
- Link::LinkType LinkMovie::linkType() const
- {
- return Movie;
- }
-
-}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cpp
new file mode 100644
index 00000000..99cd8cc9
--- /dev/null
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cpp
@@ -0,0 +1,273 @@
+/* poppler-link.cpp: qt interface to poppler
+ * Copyright (C) 2006, 2008 Albert Astals Cid
+ * Adapting code from
+ * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it>
+ *
+ * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <poppler-qt.h>
+#include <poppler-private.h>
+
+#include <tqstringlist.h>
+
+#include <Link.h>
+
+namespace Poppler {
+
+ LinkDestination::LinkDestination(const LinkDestinationData &data)
+ {
+ bool deleteDest = false;
+ CONST_064 LinkDest *ld = data.ld;
+
+ if ( data.namedDest && !ld )
+ {
+ deleteDest = true;
+# if defined(HAVE_POPPLER_086)
+ ld = data.doc->doc.findDest( data.namedDest ).get();
+# else
+ ld = data.doc->doc.findDest( data.namedDest );
+# endif
+ }
+
+ if (!ld) return;
+
+ if (ld->getKind() == ::destXYZ) m_kind = destXYZ;
+ else if (ld->getKind() == ::destFit) m_kind = destFit;
+ else if (ld->getKind() == ::destFitH) m_kind = destFitH;
+ else if (ld->getKind() == ::destFitV) m_kind = destFitV;
+ else if (ld->getKind() == ::destFitR) m_kind = destFitR;
+ else if (ld->getKind() == ::destFitB) m_kind = destFitB;
+ else if (ld->getKind() == ::destFitBH) m_kind = destFitBH;
+ else if (ld->getKind() == ::destFitBV) m_kind = destFitBV;
+
+ if ( !ld->isPageRef() ) m_pageNum = ld->getPageNum();
+ else
+ {
+ Ref ref = ld->getPageRef();
+ m_pageNum = data.doc->doc.findPage(FIND_PAGE_ARGS(ref));
+ }
+ double left = ld->getLeft();
+ double bottom = ld->getBottom();
+ double right = ld->getRight();
+ double top = ld->getTop();
+ m_zoom = ld->getZoom();
+ m_changeLeft = ld->getChangeLeft();
+ m_changeTop = ld->getChangeTop();
+ m_changeZoom = ld->getChangeZoom();
+
+ int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0;
+
+#if defined(HAVE_SPLASH)
+ SplashOutputDev *sod = data.doc->getOutputDev();
+ sod->cvtUserToDev( left, top, &leftAux, &topAux );
+ sod->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
+#endif
+
+ m_left = leftAux;
+ m_top = topAux;
+ m_right = rightAux;
+ m_bottom = bottomAux;
+
+# if !defined(HAVE_POPPLER_086)
+ if (deleteDest) delete ld;
+# endif
+ }
+
+ LinkDestination::LinkDestination(const TQString &description)
+ {
+ TQStringList tokens = TQStringList::split(';', description);
+ m_kind = static_cast<Kind>(tokens[0].toInt());
+ m_pageNum = tokens[1].toInt();
+ m_left = tokens[2].toDouble();
+ m_bottom = tokens[3].toDouble();
+ m_right = tokens[4].toDouble();
+ m_top = tokens[5].toDouble();
+ m_zoom = tokens[6].toDouble();
+ m_changeLeft = static_cast<bool>(tokens[7].toInt());
+ m_changeTop = static_cast<bool>(tokens[8].toInt());
+ m_changeZoom = static_cast<bool>(tokens[9].toInt());
+ }
+
+ LinkDestination::Kind LinkDestination::kind() const
+ {
+ return m_kind;
+ }
+
+ int LinkDestination::pageNumber() const
+ {
+ return m_pageNum;
+ }
+
+ double LinkDestination::left() const
+ {
+ return m_left;
+ }
+
+ double LinkDestination::bottom() const
+ {
+ return m_bottom;
+ }
+
+ double LinkDestination::right() const
+ {
+ return m_right;
+ }
+
+ double LinkDestination::top() const
+ {
+ return m_top;
+ }
+
+ double LinkDestination::zoom() const
+ {
+ return m_zoom;
+ }
+
+ bool LinkDestination::isChangeLeft() const
+ {
+ return m_changeLeft;
+ }
+
+ bool LinkDestination::isChangeTop() const
+ {
+ return m_changeTop;
+ }
+
+ bool LinkDestination::isChangeZoom() const
+ {
+ return m_changeZoom;
+ }
+
+ TQString LinkDestination::toString() const
+ {
+ TQString s = TQString::number( (TQ_INT8)m_kind );
+ s += ";" + TQString::number( m_pageNum );
+ s += ";" + TQString::number( m_left );
+ s += ";" + TQString::number( m_bottom );
+ s += ";" + TQString::number( m_right );
+ s += ";" + TQString::number( m_top );
+ s += ";" + TQString::number( m_zoom );
+ s += ";" + TQString::number( (TQ_INT8)m_changeLeft );
+ s += ";" + TQString::number( (TQ_INT8)m_changeTop );
+ s += ";" + TQString::number( (TQ_INT8)m_changeZoom );
+ return s;
+ }
+
+
+ // Link
+ Link::~Link()
+ {
+ }
+
+ Link::Link(const TQRect &linkArea) : m_linkArea(linkArea)
+ {
+ }
+
+ Link::LinkType Link::linkType() const
+ {
+ return None;
+ }
+
+ TQRect Link::linkArea() const
+ {
+ return m_linkArea;
+ }
+
+ // LinkGoto
+ LinkGoto::LinkGoto( const TQRect &linkArea, TQString extFileName, const LinkDestination & destination ) : Link(linkArea), m_extFileName(extFileName), m_destination(destination)
+ {
+ }
+
+ bool LinkGoto::isExternal() const
+ {
+ return !m_extFileName.isEmpty();
+ }
+
+ const TQString &LinkGoto::fileName() const
+ {
+ return m_extFileName;
+ }
+
+ const LinkDestination &LinkGoto::destination() const
+ {
+ return m_destination;
+ }
+
+ Link::LinkType LinkGoto::linkType() const
+ {
+ return Goto;
+ }
+
+ // LinkExecute
+ LinkExecute::LinkExecute( const TQRect &linkArea, const TQString & file, const TQString & params ) : Link(linkArea), m_fileName(file), m_parameters(params)
+ {
+ }
+
+ const TQString & LinkExecute::fileName() const
+ {
+ return m_fileName;
+ }
+ const TQString & LinkExecute::parameters() const
+ {
+ return m_parameters;
+ }
+
+ Link::LinkType LinkExecute::linkType() const
+ {
+ return Execute;
+ }
+
+ // LinkBrowse
+ LinkBrowse::LinkBrowse( const TQRect &linkArea, const TQString &url ) : Link(linkArea), m_url(url)
+ {
+ }
+
+ const TQString & LinkBrowse::url() const
+ {
+ return m_url;
+ }
+
+ Link::LinkType LinkBrowse::linkType() const
+ {
+ return Browse;
+ }
+
+ // LinkAction
+ LinkAction::LinkAction( const TQRect &linkArea, ActionType actionType ) : Link(linkArea), m_type(actionType)
+ {
+ }
+
+ LinkAction::ActionType LinkAction::actionType() const
+ {
+ return m_type;
+ }
+
+ Link::LinkType LinkAction::linkType() const
+ {
+ return Action;
+ }
+
+ // LinkMovie
+ LinkMovie::LinkMovie( const TQRect &linkArea ) : Link(linkArea)
+ {
+ }
+
+ Link::LinkType LinkMovie::linkType() const
+ {
+ return Movie;
+ }
+
+}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cc
deleted file mode 100644
index cde8818d..00000000
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/* PageTransition.cc
- * Copyright (C) 2005, Net Integration Technologies, 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "PageTransition.h"
-#include "poppler-page-transition.h"
-#include "poppler-page-transition-private.h"
-
-namespace Poppler {
-
-class PageTransitionData
-{
- public:
- PageTransitionData(Object *trans)
- {
- pt = new ::PageTransition(trans);
- }
-
- PageTransitionData(const PageTransitionData &ptd)
- {
- pt = new ::PageTransition(*ptd.pt);
- }
-
- ~PageTransitionData()
- {
- delete pt;
- }
-
- ::PageTransition *pt;
-};
-
-PageTransition::PageTransition(const PageTransitionParams &params)
-{
- data = new PageTransitionData(params.dictObj);
-}
-
-PageTransition::PageTransition(const PageTransition &pt)
-{
- data = new PageTransitionData(*pt.data);
-}
-
-PageTransition::~PageTransition()
-{
- delete data;
-}
-
-PageTransition::Type PageTransition::type() const
-{
- return (Poppler::PageTransition::Type)data->pt->getType();
-}
-
-int PageTransition::duration() const
-{
- return data->pt->getDuration();
-}
-
-PageTransition::Alignment PageTransition::alignment() const
-{
- return (Poppler::PageTransition::Alignment)data->pt->getAlignment();
-}
-
-PageTransition::Direction PageTransition::direction() const
-{
- return (Poppler::PageTransition::Direction)data->pt->getDirection();
-}
-
-int PageTransition::angle() const
-{
- return data->pt->getAngle();
-}
-
-double PageTransition::scale() const
-{
- return data->pt->getScale();
-}
-bool PageTransition::isRectangular() const
-{
- return data->pt->isRectangular();
-}
-
-}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cpp
new file mode 100644
index 00000000..015d17eb
--- /dev/null
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-page-transition.cpp
@@ -0,0 +1,95 @@
+/* PageTransition.cpp
+ * Copyright (C) 2005, Net Integration Technologies, 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "PageTransition.h"
+#include "poppler-page-transition.h"
+#include "poppler-page-transition-private.h"
+
+namespace Poppler {
+
+class PageTransitionData
+{
+ public:
+ PageTransitionData(Object *trans)
+ {
+ pt = new ::PageTransition(trans);
+ }
+
+ PageTransitionData(const PageTransitionData &ptd)
+ {
+ pt = new ::PageTransition(*ptd.pt);
+ }
+
+ ~PageTransitionData()
+ {
+ delete pt;
+ }
+
+ ::PageTransition *pt;
+};
+
+PageTransition::PageTransition(const PageTransitionParams &params)
+{
+ data = new PageTransitionData(params.dictObj);
+}
+
+PageTransition::PageTransition(const PageTransition &pt)
+{
+ data = new PageTransitionData(*pt.data);
+}
+
+PageTransition::~PageTransition()
+{
+ delete data;
+}
+
+PageTransition::Type PageTransition::type() const
+{
+ return (Poppler::PageTransition::Type)data->pt->getType();
+}
+
+int PageTransition::duration() const
+{
+ return data->pt->getDuration();
+}
+
+PageTransition::Alignment PageTransition::alignment() const
+{
+ return (Poppler::PageTransition::Alignment)data->pt->getAlignment();
+}
+
+PageTransition::Direction PageTransition::direction() const
+{
+ return (Poppler::PageTransition::Direction)data->pt->getDirection();
+}
+
+int PageTransition::angle() const
+{
+ return data->pt->getAngle();
+}
+
+double PageTransition::scale() const
+{
+ return data->pt->getScale();
+}
+bool PageTransition::isRectangular() const
+{
+ return data->pt->isRectangular();
+}
+
+}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc
deleted file mode 100644
index 4293b7ce..00000000
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc
+++ /dev/null
@@ -1,377 +0,0 @@
-/* poppler-page.cc: qt interface to poppler
- * Copyright (C) 2005, Net Integration Technologies, Inc.
- * Copyright (C) 2005-2006, Albert Astals Cid <aacid@kde.org>
- * Copyright (C) 2005, Tobias Koening <tokoe@kde.org>
- * Copyright (C) 2005, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
- * Copyright (C) 2006, Wilfried Huss <Wilfried.Huss@gmx.at>
- * Copyright (C) 2006, Jerry Epplin <jepplin@globalvelocity.com>
- * Copyright (C) 2007, 2010, Pino Toscano <pino@kde.org>
- *
- * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <poppler-qt.h>
-#include <tqfile.h>
-#include <tqimage.h>
-#include <config.h>
-#include <GlobalParams.h>
-#include <PDFDoc.h>
-#include <Catalog.h>
-#include <ErrorCodes.h>
-#include <TextOutputDev.h>
-#include <Link.h>
-#if defined(HAVE_SPLASH)
-#include <SplashOutputDev.h>
-#include <splash/SplashBitmap.h>
-#endif
-
-#include "poppler-private.h"
-#include "poppler-page-transition-private.h"
-
-namespace Poppler {
-
-class PageData {
- public:
- const Document *doc;
- int index;
- PageTransition *transition;
-};
-
-Page::Page(const Document *doc, int index) {
- data = new PageData();
- data->index = index;
- data->doc = doc;
- data->transition = 0;
-}
-
-Page::~Page()
-{
- delete data->transition;
- delete data;
-}
-
-void Page::renderToPixmap(TQPixmap **q, int x, int y, int w, int h, bool doLinks) const
-{
- renderToPixmap(q, x, y, w, h, 72.0, 72.0, doLinks);
-}
-
-void Page::renderToPixmap(TQPixmap **q, int x, int y, int w, int h, double xres, double yres, bool doLinks) const
-{
- TQImage img = renderToImage(xres, yres, doLinks);
- *q = new TQPixmap( img );
-}
-
-TQImage Page::renderToImage(double xres, double yres, bool doLinks) const
-{
-#if defined(HAVE_SPLASH)
- SplashOutputDev *output_dev;
- SplashBitmap *bitmap;
- SplashColorPtr color_ptr;
- output_dev = data->doc->data->getOutputDev();
-
- data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, xres, yres,
- 0, false, true, false, -1, -1, -1, -1);
- bitmap = output_dev->getBitmap ();
- color_ptr = bitmap->getDataPtr ();
- int bw = output_dev->getBitmap()->getWidth();
- int bh = output_dev->getBitmap()->getHeight();
- SplashColorPtr dataPtr = output_dev->getBitmap()->getDataPtr();
-
- if (TQImage::BigEndian == TQImage::systemByteOrder())
- {
- uchar c;
- int count = bw * bh * 4;
- for (int k = 0; k < count; k += 4)
- {
- c = dataPtr[k];
- dataPtr[k] = dataPtr[k+3];
- dataPtr[k+3] = c;
-
- c = dataPtr[k+1];
- dataPtr[k+1] = dataPtr[k+2];
- dataPtr[k+2] = c;
- }
- }
-
- // construct a qimage SHARING the raw bitmap data in memory
- TQImage img( dataPtr, bw, bh, 32, 0, 0, TQImage::IgnoreEndian );
- img = img.copy();
- // unload underlying xpdf bitmap
- output_dev->startPage( 0, NULL );
-
- return img;
-#else
- (void)xres;
- (void)xres;
- (void)doLinks;
-
- return TQImage();
-#endif
-}
-
-TQString Page::getText(const Rectangle &r) const
-{
- TextOutputDev *output_dev;
- GooString *s;
- const PDFRectangle *rect;
- TQString result;
- ::Page *p;
-
-#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
- output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse);
-#else
- output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
-#endif
- data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
- 0, false, false, false, -1, -1, -1, -1);
- p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
- if (r.isNull())
- {
- rect = p->getCropBox();
- s = output_dev->getText(rect->x1, rect->y1, rect->x2, rect->y2);
- }
- else
- {
- double height, y1, y2;
- height = p->getCropHeight();
- y1 = height - r.m_y2;
- y2 = height - r.m_y1;
- s = output_dev->getText(r.m_x1, y1, r.m_x2, y2);
- }
-
- result = TQString::fromUtf8(s->GOO_GET_CSTR());
-
- delete output_dev;
- delete s;
- return result;
-}
-
-TQValueList<TextBox*> Page::textList() const
-{
- TextOutputDev *output_dev;
-
- TQValueList<TextBox*> output_list;
-
-#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
- output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse);
-#else
- output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
-#endif
-
- data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
- 0, false, false, false, -1, -1, -1, -1);
-
- TextWordList *word_list = output_dev->makeWordList();
-
- if (!word_list) {
- delete output_dev;
- return output_list;
- }
-
- for (int i = 0; i < word_list->getLength(); i++) {
- TextWord *word = word_list->get(i);
- GooString *word_str = word->getText();
- TQString string = TQString::fromUtf8(word_str->GOO_GET_CSTR());
- delete word_str;
- double xMin, yMin, xMax, yMax;
- word->getBBox(&xMin, &yMin, &xMax, &yMax);
-
- TextBox* text_box = new TextBox(string, Rectangle(xMin, yMin, xMax, yMax));
-
- output_list.append(text_box);
- }
-
- delete word_list;
- delete output_dev;
-
- return output_list;
-}
-
-PageTransition *Page::getTransition() const
-{
- if (!data->transition)
- {
- Object o;
- PageTransitionParams params;
-# if defined(HAVE_POPPLER_058)
- o = data->doc->data->doc.getCatalog()->getPage(data->index + 1)->getTrans();
-# else
- data->doc->data->doc.getCatalog()->getPage(data->index + 1)->getTrans(&o);
-# endif
- params.dictObj = &o;
- data->transition = new PageTransition(params);
-# if !defined(HAVE_POPPLER_058)
- o.free();
-# endif
- }
- return data->transition;
-}
-
-TQSize Page::pageSize() const
-{
- ::Page *p;
-
- p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
- if ( ( Page::Landscape == orientation() ) || (Page::Seascape == orientation() ) ) {
- return TQSize( (int)p->getCropHeight(), (int)p->getCropWidth() );
- } else {
- return TQSize( (int)p->getCropWidth(), (int)p->getCropHeight() );
- }
-}
-
-Page::Orientation Page::orientation() const
-{
- ::Page *p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
-
- int rotation = p->getRotate();
- switch (rotation) {
- case 90:
- return Page::Landscape;
- break;
- case 180:
- return Page::UpsideDown;
- break;
- case 270:
- return Page::Seascape;
- break;
- default:
- return Page::Portrait;
- }
-}
-
-TQValueList<Link*> Page::links() const
-{
- TQValueList<Link*> popplerLinks;
-
-#if defined(HAVE_SPLASH)
- Links *xpdfLinks = data->doc->data->doc.getLinks(data->index + 1);
- for (int i = 0; i < xpdfLinks->getNumLinks(); ++i)
- {
- ::Link *xpdfLink = xpdfLinks->getLink(i);
-
- double left, top, right, bottom;
- int leftAux, topAux, rightAux, bottomAux;
- xpdfLink->getRect( &left, &top, &right, &bottom );
- TQRect linkArea;
-
- data->doc->data->m_outputDev->cvtUserToDev( left, top, &leftAux, &topAux );
- data->doc->data->m_outputDev->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
- linkArea.setLeft(leftAux);
- linkArea.setTop(topAux);
- linkArea.setRight(rightAux);
- linkArea.setBottom(bottomAux);
-
- if (!xpdfLink->isOk()) continue;
-
- Link *popplerLink = NULL;
- ::LinkAction *a = xpdfLink->getAction();
- if ( a )
- {
- switch ( a->getKind() )
- {
- case actionGoTo:
- {
- LinkGoTo * g = (LinkGoTo *) a;
- // create link: no ext file, namedDest, object pointer
- popplerLink = new LinkGoto( linkArea, TQString(), LinkDestination( LinkDestinationData(g->getDest(), g->getNamedDest(), data->doc->data ) ) );
- }
- break;
-
- case actionGoToR:
- {
- LinkGoToR * g = (LinkGoToR *) a;
- // copy link file
- const TQString fileName = UnicodeParsedString( g->getFileName() );
- // ceate link: fileName, namedDest, object pointer
- popplerLink = new LinkGoto( linkArea, fileName, LinkDestination( LinkDestinationData(g->getDest(), g->getNamedDest(), data->doc->data ) ) );
- }
- break;
-
- case actionLaunch:
- {
- LinkLaunch * e = (LinkLaunch *)a;
- GooString * p = e->getParams();
- popplerLink = new LinkExecute( linkArea, e->getFileName()->GOO_GET_CSTR(), p ? p->GOO_GET_CSTR() : 0 );
- }
- break;
-
- case actionNamed:
- {
- const char * name = ((LinkNamed *)a)->getName()->GOO_GET_CSTR();
- if ( !strcmp( name, "NextPage" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::PageNext );
- else if ( !strcmp( name, "PrevPage" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::PagePrev );
- else if ( !strcmp( name, "FirstPage" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::PageFirst );
- else if ( !strcmp( name, "LastPage" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::PageLast );
- else if ( !strcmp( name, "GoBack" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::HistoryBack );
- else if ( !strcmp( name, "GoForward" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::HistoryForward );
- else if ( !strcmp( name, "Quit" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::Quit );
- else if ( !strcmp( name, "GoToPage" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::GoToPage );
- else if ( !strcmp( name, "Find" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::Find );
- else if ( !strcmp( name, "FullScreen" ) )
- popplerLink = new LinkAction( linkArea, LinkAction::Presentation );
- else if ( !strcmp( name, "Close" ) )
- {
- // acroread closes the document always, doesnt care whether
- // its presentation mode or not
- // popplerLink = new LinkAction( linkArea, LinkAction::EndPresentation );
- popplerLink = new LinkAction( linkArea, LinkAction::Close );
- }
- else
- {
- // TODO
- }
- }
- break;
-
- case actionURI:
- {
- popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->GOO_GET_CSTR() );
- }
- break;
-
- case actionMovie:
- case actionSound:
- case actionRendition:
- case actionJavaScript:
- case actionOCGState:
- break;
-
- case actionUnknown:
- break;
- }
- }
-
- if (popplerLink)
- {
- popplerLinks.append(popplerLink);
- }
- }
-
- delete xpdfLinks;
-#endif
-
- return popplerLinks;
-}
-
-}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp
new file mode 100644
index 00000000..9b4f6208
--- /dev/null
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp
@@ -0,0 +1,383 @@
+/* poppler-page.cpp: qt interface to poppler
+ * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2005-2006, Albert Astals Cid <aacid@kde.org>
+ * Copyright (C) 2005, Tobias Koening <tokoe@kde.org>
+ * Copyright (C) 2005, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
+ * Copyright (C) 2006, Wilfried Huss <Wilfried.Huss@gmx.at>
+ * Copyright (C) 2006, Jerry Epplin <jepplin@globalvelocity.com>
+ * Copyright (C) 2007, 2010, Pino Toscano <pino@kde.org>
+ *
+ * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <poppler-qt.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <config.h>
+#include <GlobalParams.h>
+#include <PDFDoc.h>
+#include <Catalog.h>
+#include <ErrorCodes.h>
+#include <TextOutputDev.h>
+#include <Link.h>
+#if defined(HAVE_SPLASH)
+#include <SplashOutputDev.h>
+#include <splash/SplashBitmap.h>
+#endif
+
+#include "poppler-private.h"
+#include "poppler-page-transition-private.h"
+
+namespace Poppler {
+
+class PageData {
+ public:
+ const Document *doc;
+ int index;
+ PageTransition *transition;
+};
+
+Page::Page(const Document *doc, int index) {
+ data = new PageData();
+ data->index = index;
+ data->doc = doc;
+ data->transition = 0;
+}
+
+Page::~Page()
+{
+ delete data->transition;
+ delete data;
+}
+
+void Page::renderToPixmap(TQPixmap **q, int x, int y, int w, int h, bool doLinks) const
+{
+ renderToPixmap(q, x, y, w, h, 72.0, 72.0, doLinks);
+}
+
+void Page::renderToPixmap(TQPixmap **q, int x, int y, int w, int h, double xres, double yres, bool doLinks) const
+{
+ TQImage img = renderToImage(xres, yres, doLinks);
+ *q = new TQPixmap( img );
+}
+
+TQImage Page::renderToImage(double xres, double yres, bool doLinks) const
+{
+#if defined(HAVE_SPLASH)
+ SplashOutputDev *output_dev;
+ SplashBitmap *bitmap;
+ SplashColorPtr color_ptr;
+ output_dev = data->doc->data->getOutputDev();
+
+ data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, xres, yres,
+ 0, false, true, false, -1, -1, -1, -1);
+ bitmap = output_dev->getBitmap ();
+ color_ptr = bitmap->getDataPtr ();
+ int bw = output_dev->getBitmap()->getWidth();
+ int bh = output_dev->getBitmap()->getHeight();
+ SplashColorPtr dataPtr = output_dev->getBitmap()->getDataPtr();
+
+ if (TQImage::BigEndian == TQImage::systemByteOrder())
+ {
+ uchar c;
+ int count = bw * bh * 4;
+ for (int k = 0; k < count; k += 4)
+ {
+ c = dataPtr[k];
+ dataPtr[k] = dataPtr[k+3];
+ dataPtr[k+3] = c;
+
+ c = dataPtr[k+1];
+ dataPtr[k+1] = dataPtr[k+2];
+ dataPtr[k+2] = c;
+ }
+ }
+
+ // construct a qimage SHARING the raw bitmap data in memory
+ TQImage img( dataPtr, bw, bh, 32, 0, 0, TQImage::IgnoreEndian );
+ img = img.copy();
+ // unload underlying xpdf bitmap
+ output_dev->startPage( 0, NULL );
+
+ return img;
+#else
+ (void)xres;
+ (void)xres;
+ (void)doLinks;
+
+ return TQImage();
+#endif
+}
+
+TQString Page::getText(const Rectangle &r) const
+{
+ TextOutputDev *output_dev;
+ GooString *s;
+ const PDFRectangle *rect;
+ TQString result;
+ ::Page *p;
+
+#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
+ output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse);
+#else
+ output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
+#endif
+ data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
+ 0, false, false, false, -1, -1, -1, -1);
+ p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
+ if (r.isNull())
+ {
+ rect = p->getCropBox();
+ s = output_dev->getText(rect->x1, rect->y1, rect->x2, rect->y2);
+ }
+ else
+ {
+ double height, y1, y2;
+ height = p->getCropHeight();
+ y1 = height - r.m_y2;
+ y2 = height - r.m_y1;
+ s = output_dev->getText(r.m_x1, y1, r.m_x2, y2);
+ }
+
+ result = TQString::fromUtf8(s->GOO_GET_CSTR());
+
+ delete output_dev;
+ delete s;
+ return result;
+}
+
+TQValueList<TextBox*> Page::textList() const
+{
+ TextOutputDev *output_dev;
+
+ TQValueList<TextBox*> output_list;
+
+#if defined(HAVE_POPPLER_058) || defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020)
+ output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse);
+#else
+ output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
+#endif
+
+ data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
+ 0, false, false, false, -1, -1, -1, -1);
+
+# if defined(HAVE_POPPLER_2111)
+ std::unique_ptr<TextWordList> word_list = output_dev->makeWordList();
+# else
+ TextWordList *word_list = output_dev->makeWordList();
+# endif
+
+ if (!word_list) {
+ delete output_dev;
+ return output_list;
+ }
+
+ for (int i = 0; i < word_list->getLength(); i++) {
+ TextWord *word = word_list->get(i);
+ GooString *word_str = word->getText();
+ TQString string = TQString::fromUtf8(word_str->GOO_GET_CSTR());
+ delete word_str;
+ double xMin, yMin, xMax, yMax;
+ word->getBBox(&xMin, &yMin, &xMax, &yMax);
+
+ TextBox* text_box = new TextBox(string, Rectangle(xMin, yMin, xMax, yMax));
+
+ output_list.append(text_box);
+ }
+
+# if !defined(HAVE_POPPLER_2111)
+ delete word_list;
+# endif
+ delete output_dev;
+
+ return output_list;
+}
+
+PageTransition *Page::getTransition() const
+{
+ if (!data->transition)
+ {
+ Object o;
+ PageTransitionParams params;
+# if defined(HAVE_POPPLER_058)
+ o = data->doc->data->doc.getCatalog()->getPage(data->index + 1)->getTrans();
+# else
+ data->doc->data->doc.getCatalog()->getPage(data->index + 1)->getTrans(&o);
+# endif
+ params.dictObj = &o;
+ data->transition = new PageTransition(params);
+# if !defined(HAVE_POPPLER_058)
+ o.free();
+# endif
+ }
+ return data->transition;
+}
+
+TQSize Page::pageSize() const
+{
+ ::Page *p;
+
+ p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
+ if ( ( Page::Landscape == orientation() ) || (Page::Seascape == orientation() ) ) {
+ return TQSize( (int)p->getCropHeight(), (int)p->getCropWidth() );
+ } else {
+ return TQSize( (int)p->getCropWidth(), (int)p->getCropHeight() );
+ }
+}
+
+Page::Orientation Page::orientation() const
+{
+ ::Page *p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
+
+ int rotation = p->getRotate();
+ switch (rotation) {
+ case 90:
+ return Page::Landscape;
+ break;
+ case 180:
+ return Page::UpsideDown;
+ break;
+ case 270:
+ return Page::Seascape;
+ break;
+ default:
+ return Page::Portrait;
+ }
+}
+
+TQValueList<Link*> Page::links() const
+{
+ TQValueList<Link*> popplerLinks;
+
+#if defined(HAVE_SPLASH)
+ Links *xpdfLinks = data->doc->data->doc.getLinks(data->index + 1);
+ for (int i = 0; i < xpdfLinks->getNumLinks(); ++i)
+ {
+ ::Link *xpdfLink = xpdfLinks->getLink(i);
+
+ double left, top, right, bottom;
+ int leftAux, topAux, rightAux, bottomAux;
+ xpdfLink->getRect( &left, &top, &right, &bottom );
+ TQRect linkArea;
+
+ data->doc->data->m_outputDev->cvtUserToDev( left, top, &leftAux, &topAux );
+ data->doc->data->m_outputDev->cvtUserToDev( right, bottom, &rightAux, &bottomAux );
+ linkArea.setLeft(leftAux);
+ linkArea.setTop(topAux);
+ linkArea.setRight(rightAux);
+ linkArea.setBottom(bottomAux);
+
+ if (!xpdfLink->isOk()) continue;
+
+ Link *popplerLink = NULL;
+ ::LinkAction *a = xpdfLink->getAction();
+ if ( a )
+ {
+ switch ( a->getKind() )
+ {
+ case actionGoTo:
+ {
+ LinkGoTo * g = (LinkGoTo *) a;
+ // create link: no ext file, namedDest, object pointer
+ popplerLink = new LinkGoto( linkArea, TQString(), LinkDestination( LinkDestinationData(g->getDest(), g->getNamedDest(), data->doc->data ) ) );
+ }
+ break;
+
+ case actionGoToR:
+ {
+ LinkGoToR * g = (LinkGoToR *) a;
+ // copy link file
+ const TQString fileName = UnicodeParsedString( g->getFileName() );
+ // ceate link: fileName, namedDest, object pointer
+ popplerLink = new LinkGoto( linkArea, fileName, LinkDestination( LinkDestinationData(g->getDest(), g->getNamedDest(), data->doc->data ) ) );
+ }
+ break;
+
+ case actionLaunch:
+ {
+ LinkLaunch * e = (LinkLaunch *)a;
+ GooString * p = e->getParams();
+ popplerLink = new LinkExecute( linkArea, e->getFileName()->GOO_GET_CSTR(), p ? p->GOO_GET_CSTR() : 0 );
+ }
+ break;
+
+ case actionNamed:
+ {
+ const char * name = ((LinkNamed *)a)->getName()->GOO_GET_CSTR();
+ if ( !strcmp( name, "NextPage" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::PageNext );
+ else if ( !strcmp( name, "PrevPage" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::PagePrev );
+ else if ( !strcmp( name, "FirstPage" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::PageFirst );
+ else if ( !strcmp( name, "LastPage" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::PageLast );
+ else if ( !strcmp( name, "GoBack" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::HistoryBack );
+ else if ( !strcmp( name, "GoForward" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::HistoryForward );
+ else if ( !strcmp( name, "Quit" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::Quit );
+ else if ( !strcmp( name, "GoToPage" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::GoToPage );
+ else if ( !strcmp( name, "Find" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::Find );
+ else if ( !strcmp( name, "FullScreen" ) )
+ popplerLink = new LinkAction( linkArea, LinkAction::Presentation );
+ else if ( !strcmp( name, "Close" ) )
+ {
+ // acroread closes the document always, doesnt care whether
+ // its presentation mode or not
+ // popplerLink = new LinkAction( linkArea, LinkAction::EndPresentation );
+ popplerLink = new LinkAction( linkArea, LinkAction::Close );
+ }
+ else
+ {
+ // TODO
+ }
+ }
+ break;
+
+ case actionURI:
+ {
+ popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->GOO_GET_CSTR() );
+ }
+ break;
+
+ case actionMovie:
+ case actionSound:
+ case actionRendition:
+ case actionJavaScript:
+ case actionOCGState:
+ break;
+
+ case actionUnknown:
+ break;
+ }
+ }
+
+ if (popplerLink)
+ {
+ popplerLinks.append(popplerLink);
+ }
+ }
+
+ delete xpdfLinks;
+#endif
+
+ return popplerLinks;
+}
+
+}
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp
index 059bf1c0..059bf1c0 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h
index 26a9bb62..f1096ceb 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h
@@ -29,6 +29,11 @@
#include <Object.h>
#include <PDFDoc.h>
#include <FontInfo.h>
+
+#if defined(HAVE_SPLASH)
+# undef HAVE_SPLASH
+#endif
+
#if defined(HAVE_SPLASH)
#include <SplashOutputDev.h>
#else
@@ -99,7 +104,11 @@ class LinkDestinationData {
class DocumentData {
public:
+# if defined(HAVE_POPPLER_2203)
+ DocumentData(std::unique_ptr<GooString> &&filePath, const std::optional<GooString> &password) : doc(std::move(filePath), password), m_fontInfoScanner(0), m_outputDev(0) {}
+# else
DocumentData(GooString *filePath, GooString *password) : doc(filePath,password), m_fontInfoScanner(0), m_outputDev(0) {}
+# endif
~DocumentData()
{
diff --git a/tdefile-plugins/dvi/CMakeLists.txt b/tdefile-plugins/dvi/CMakeLists.txt
index beb5d8e2..55c1ef7d 100644
--- a/tdefile-plugins/dvi/CMakeLists.txt
+++ b/tdefile-plugins/dvi/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_dvi.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_dvi.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_dvi (module) #########################
diff --git a/tdefile-plugins/dvi/tdefile_dvi.desktop b/tdefile-plugins/dvi/tdefile_dvi.desktop
index 10122e8f..23560eeb 100644
--- a/tdefile-plugins/dvi/tdefile_dvi.desktop
+++ b/tdefile-plugins/dvi/tdefile_dvi.desktop
@@ -2,58 +2,6 @@
Icon=
MimeType=application/x-dvi
Name=DVI Info
-Name[ar]=معلومات DVI
-Name[br]=Titouroù DVI
-Name[ca]=Informació de DVI
-Name[cs]=DVI info
-Name[cy]=Gwybodaeth DVI
-Name[da]=DVI-info
-Name[de]=DVI-Info
-Name[el]=Πληροφορίες DVI
-Name[eo]=DVI-informo
-Name[es]=Info DVI
-Name[et]=DVI info
-Name[fa]=اطلاعات DVI
-Name[fi]=DVI-tiedot
-Name[fr]=Informations DVI
-Name[ga]=Eolas faoi DVI
-Name[gl]=Inf. DVI
-Name[he]=מידע DVI
-Name[hi]=DVI जानकारी
-Name[hu]=DVI-jellemzők
-Name[is]=DVI upplýsingar
-Name[it]=Informazioni DVI
-Name[ja]=DVI 情報
-Name[kk]=DVI мәліметі
-Name[km]=ព័ត៌មាន DVI
-Name[lt]=DVI informacija
-Name[ms]=Maklumat DVI
-Name[nds]=DVI-Info
-Name[ne]=DVI सूचना
-Name[nl]=DVI-info
-Name[nn]=DVI-info
-Name[pa]=DVI ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku DVI
-Name[pt]=Informação do DVI
-Name[pt_BR]=Informação sobre DVI
-Name[ro]=Informaţii DVI
-Name[ru]=Информация о DVI
-Name[se]=DVI-dieđut
-Name[sl]=Podatki o DVI
-Name[sr]=DVI информације
-Name[sr@Latn]=DVI informacije
-Name[sv]=DVI-information
-Name[ta]=DVI தகவல்
-Name[tg]=Иттилоот оиди DVI
-Name[th]=ข้อมูลแฟ้ม DVI
-Name[tr]=DVI Bilgisi
-Name[uk]=Інформація по DVI
-Name[uz]=DVI haqida maʼlumot
-Name[uz@cyrillic]=DVI ҳақида маълумот
-Name[wa]=Informåcion sol documint DVI
-Name[zh_CN]=DVI 信息
-Name[zh_HK]=DVI 資訊
-Name[zh_TW]=DVI 資訊
X-TDE-ServiceTypes=KFilePlugin
Type=Service
X-TDE-Library=tdefile_dvi
diff --git a/tdefile-plugins/exr/CMakeLists.txt b/tdefile-plugins/exr/CMakeLists.txt
index 284c973a..0f022758 100644
--- a/tdefile-plugins/exr/CMakeLists.txt
+++ b/tdefile-plugins/exr/CMakeLists.txt
@@ -26,7 +26,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_exr.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_exr.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_exr (module) #########################
diff --git a/tdefile-plugins/exr/tdefile_exr.cpp b/tdefile-plugins/exr/tdefile_exr.cpp
index a2613bff..77e5c80d 100644
--- a/tdefile-plugins/exr/tdefile_exr.cpp
+++ b/tdefile-plugins/exr/tdefile_exr.cpp
@@ -1,4 +1,3 @@
-// -*- C++;indent-tabs-mode: t; tab-width: 4; c-basic-offset: 4; -*-
/* This file is part of the KDE project
* Copyright (C) 2003 <bradh@frogmouth.net>
*
diff --git a/tdefile-plugins/exr/tdefile_exr.desktop b/tdefile-plugins/exr/tdefile_exr.desktop
index 76a6f250..a984a981 100644
--- a/tdefile-plugins/exr/tdefile_exr.desktop
+++ b/tdefile-plugins/exr/tdefile_exr.desktop
@@ -1,55 +1,6 @@
[Desktop Entry]
Type=Service
Name=EXR Info
-Name[br]=Titouroù EXR
-Name[ca]=Informació EXR
-Name[cs]=EXR info
-Name[cy]=Gwybodaeth EXR
-Name[da]=EXR-Info
-Name[de]=EXR-Info
-Name[el]=Πληροφορίες EXR
-Name[eo]=EXR-informo
-Name[es]=Info EXR
-Name[et]=EXR info
-Name[fa]=اطلاعات EXR
-Name[fi]=EXR-tiedot
-Name[fr]=Informations EXR
-Name[ga]=Eolas faoi EXR
-Name[gl]=Inf. EXR
-Name[he]=מידע EXR
-Name[hu]=EXR-jellemzők
-Name[is]=EXR upplýsingar
-Name[it]=Informazioni EXR
-Name[ja]=EXR 情報
-Name[kk]=EXR мәліметі
-Name[km]=ព័ត៌មាន EXR
-Name[lt]=EXR informacija
-Name[ms]=Maklumat EXR
-Name[nds]=EXR-Info
-Name[ne]=EXR सूचना
-Name[nl]=EXR-info
-Name[nn]=EXR-info
-Name[pa]=EXR ਜਾਣਕਾਰੀ
-Name[pl]=Informacja EXR
-Name[pt]=Informação do EXR
-Name[pt_BR]=Informação sobre EXR
-Name[ro]=Informaţii EXR
-Name[ru]=Информация о EXR
-Name[se]=EXR-dieđut
-Name[sl]=Podatki o EXR
-Name[sr]=EXR информације
-Name[sr@Latn]=EXR informacije
-Name[sv]=EXR-information
-Name[ta]=EXR தகவல்
-Name[tg]=Иттилоот оиди EXR
-Name[th]=ข้อมูลแฟ้ม EXR
-Name[tr]=EXR Bilgisi
-Name[uk]=Інформація по EXR
-Name[uz]=EXR haqida maʼlumot
-Name[uz@cyrillic]=EXR ҳақида маълумот
-Name[zh_CN]=EXR 信息
-Name[zh_HK]=EXR 資訊
-Name[zh_TW]=EXR 資訊
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_exr
MimeType=image/x-exr
diff --git a/tdefile-plugins/gif/CMakeLists.txt b/tdefile-plugins/gif/CMakeLists.txt
index 8e71efbf..f7f9d9d0 100644
--- a/tdefile-plugins/gif/CMakeLists.txt
+++ b/tdefile-plugins/gif/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_gif.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_gif.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_gif (module) #########################
diff --git a/tdefile-plugins/gif/tdefile_gif.desktop b/tdefile-plugins/gif/tdefile_gif.desktop
index 53ca313e..35bee53f 100644
--- a/tdefile-plugins/gif/tdefile_gif.desktop
+++ b/tdefile-plugins/gif/tdefile_gif.desktop
@@ -1,64 +1,6 @@
[Desktop Entry]
Type=Service
Name=GIF Info
-Name[af]=Gif Inligting
-Name[ar]=معلومات GIF
-Name[br]=Titouroù GIF
-Name[ca]=Informació de GIF
-Name[cs]=GIF info
-Name[cy]=Gwybodaeth GIF
-Name[da]=GIF-info
-Name[de]=GIF-Info
-Name[el]=Πληροφορίες GIF
-Name[eo]=GIF-informo
-Name[es]=Info GIF
-Name[et]=GIF info
-Name[fa]=اطلاعات GIF
-Name[fi]=GIF-tiedot
-Name[fr]=Informations GIF
-Name[ga]=Eolas faoi GIF
-Name[gl]=Inf. Gif
-Name[he]=מידע GIF
-Name[hi]=GIF जानकारी
-Name[hr]=GIF Informacije
-Name[hu]=GIF-jellemzők
-Name[is]=GIF upplýsingar
-Name[it]=Informazioni GIF
-Name[ja]=GIF 情報
-Name[kk]=GIF мәліметі
-Name[km]=ព័ត៌មាន GIF
-Name[lt]=GIF informacija
-Name[ms]=Maklumat GIF
-Name[nds]=GIF-Info
-Name[ne]=GIF सूचना
-Name[nl]=GIF-info
-Name[nn]=GIF-info
-Name[nso]=Tshedimoso ya GIF
-Name[pa]=GIF ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku GIF
-Name[pt]=Informação do GIF
-Name[pt_BR]=Informação sobre GIF
-Name[ro]=Informaţii GIF
-Name[ru]=Информация о GIF
-Name[se]=GIF-dieđut
-Name[sl]=Podatki o GIF
-Name[sr]=GIF информације
-Name[sr@Latn]=GIF informacije
-Name[sv]=Gif-information
-Name[ta]=GIF தகவல்
-Name[tg]=Иттилоот оиди GIF
-Name[th]=ข้อมูลแฟ้ม GIF
-Name[tr]=GIF Bilgisi
-Name[uk]=Інформація по GIF
-Name[uz]=GIF haqida maʼlumot
-Name[uz@cyrillic]=GIF ҳақида маълумот
-Name[ven]=Mafhungo a GIF
-Name[wa]=Informåcion sol imådje GIF
-Name[xh]=Ulwazi lwe GIF
-Name[zh_CN]=GIF 信息
-Name[zh_HK]=GIF 資訊
-Name[zh_TW]=GIF 資訊
-Name[zu]=Ulwazi lwe-GIF
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_gif
MimeType=image/gif
diff --git a/tdefile-plugins/ico/CMakeLists.txt b/tdefile-plugins/ico/CMakeLists.txt
index 54d87add..886df0b4 100644
--- a/tdefile-plugins/ico/CMakeLists.txt
+++ b/tdefile-plugins/ico/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_ico.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_ico.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_ico (module) ########################
diff --git a/tdefile-plugins/ico/tdefile_ico.desktop b/tdefile-plugins/ico/tdefile_ico.desktop
index 19dae923..446d17bc 100644
--- a/tdefile-plugins/ico/tdefile_ico.desktop
+++ b/tdefile-plugins/ico/tdefile_ico.desktop
@@ -1,63 +1,6 @@
[Desktop Entry]
Type=Service
Name=ICO Info
-Name[af]=Ico Inligting
-Name[ar]=معلومات ICO
-Name[br]=Titouroù ICO
-Name[ca]=Informació d'ICO
-Name[cs]=ICO info
-Name[cy]=Gwybodaeth ICO
-Name[da]=ICO-info
-Name[de]=ICO-Info
-Name[el]=Πληροφορίες ICO
-Name[eo]=ICO-informo
-Name[es]=Info ICO
-Name[et]=ICO info
-Name[fa]=اطلاعات ICO
-Name[fi]=ICO-tiedot
-Name[fr]=Informations ICO
-Name[gl]=Inf. ICO
-Name[he]=מידע ICO
-Name[hi]=ICO जानकारी
-Name[hr]=ICO informacije
-Name[hu]=ICO-jellemzők
-Name[is]=ICO upplýsingar
-Name[it]=Informazioni ICO
-Name[ja]=ICO 情報
-Name[kk]=ICO мәліметі
-Name[km]=ព័ត៌មាន ICO
-Name[lt]=ICO informacija
-Name[ms]= Maklumat ICO
-Name[nds]=ICO-Info
-Name[ne]=ICO सूचना
-Name[nl]=ICO-info
-Name[nn]=ICO-info
-Name[nso]=Tshedimoso ya ICO
-Name[pa]=ICO ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku ICO
-Name[pt]=Informação do ICO
-Name[pt_BR]=Informação sobre ICO
-Name[ro]=Informaţii ICO
-Name[ru]=Информация об ICO
-Name[se]=ICO-dieđut
-Name[sl]=Podatki o ICO
-Name[sr]=ICO информације
-Name[sr@Latn]=ICO informacije
-Name[sv]=Ico-information
-Name[ta]=ICO தகவல்
-Name[tg]=Иттилоот оиди ICO
-Name[th]=ข้อมูลแฟ้ม ICO
-Name[tr]=ICO Bilgisi
-Name[uk]=Інформація по ICO
-Name[uz]=ICO haqida maʼlumot
-Name[uz@cyrillic]=ICO ҳақида маълумот
-Name[ven]=Mafhungo a ICO
-Name[wa]=Informåcion sol imådjete ICO
-Name[xh]=Ulwazi lwe ICO
-Name[zh_CN]=ICO 信息
-Name[zh_HK]=ICO 資訊
-Name[zh_TW]=ICO 資訊
-Name[zu]=Ulwazi lwe-ICO
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_ico
MimeType=image/x-ico
diff --git a/tdefile-plugins/jpeg/CMakeLists.txt b/tdefile-plugins/jpeg/CMakeLists.txt
index 3e99eba7..f5f2aae5 100644
--- a/tdefile-plugins/jpeg/CMakeLists.txt
+++ b/tdefile-plugins/jpeg/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_jpeg.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_jpeg.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_jpeg (module) ########################
diff --git a/tdefile-plugins/jpeg/tdefile_jpeg.desktop b/tdefile-plugins/jpeg/tdefile_jpeg.desktop
index d7eb1abd..ae77bd2e 100644
--- a/tdefile-plugins/jpeg/tdefile_jpeg.desktop
+++ b/tdefile-plugins/jpeg/tdefile_jpeg.desktop
@@ -1,62 +1,6 @@
[Desktop Entry]
Type=Service
Name=JPEG EXIF Info
-Name[ar]=معلومات JPEG EXIF
-Name[br]=Titouroù EXIF JPEG
-Name[ca]=Informació de JPEG EXIF
-Name[cs]=JPEG EXIF info
-Name[cy]=Gwybodaeth JPEG EXIF
-Name[da]=JPEG EXIF-info
-Name[de]=JPEG EXIF-Info
-Name[el]=Πληροφορίες JPEG EXIF
-Name[eo]=JPEG-EXIF-informo
-Name[es]=Info JPEG EXIF
-Name[et]=JPEG EXIF info
-Name[fa]=اطلاعات JPEG EXIF
-Name[fi]=JPEG EXIF -tiedot
-Name[fr]=Informations JPEG EXIF
-Name[gl]=Inf. JPEG EXIF
-Name[he]=מידע JPEG EXIF
-Name[hi]=JPEG EXIF जानकारी
-Name[hr]=JPEG EXIF Informacije
-Name[hu]=JPEG EXIF-jellemzők
-Name[is]=JPEG EXIF upplýsingar
-Name[it]=Informazioni JPEG EXIF
-Name[ja]=JPEG EXIF 情報
-Name[kk]=JPEG EXIF мәліметі
-Name[km]=ព័ត៌មាន JPEG EXIF
-Name[lt]=JPEG EXIF informacija
-Name[ms]=Maklumat JPEG EXIF
-Name[nds]=JPEG-EXIF-Info
-Name[ne]=JPEG EXIF सूचना
-Name[nl]=JPEG EXIF-info
-Name[nn]=JPEG EXIF-info
-Name[nso]=TshedimoJPEG EXIF Info
-Name[pa]=JPEG EXIF ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku JPEG EXIF
-Name[pt]=Informação do JPEG EXIF
-Name[pt_BR]=Informação sobre JPEG EXIF
-Name[ro]=Informaţii EXIF JPEG
-Name[ru]=Информация о JPEG EXIF
-Name[se]=JPEG EXIF-dieđut
-Name[sl]=Podatki o JPEG EXIF
-Name[sr]=JPEG EXIF информације
-Name[sr@Latn]=JPEG EXIF informacije
-Name[sv]=JPEG EXIF-information
-Name[ta]=JPEG EXIF தகவல்
-Name[tg]=Иттилоот оиди JPEG EXIF
-Name[th]=ข้อมูลแฟ้ม JPEG EXIF
-Name[tr]=JPEG EXIF Bilgisi
-Name[uk]=Інформація про JPEG EXIF
-Name[uz]=JPEG EXIF haqida maʼlumot
-Name[uz@cyrillic]=JPEG EXIF ҳақида маълумот
-Name[ven]=Mafhungo a JPEG EXIF
-Name[wa]=Informåcion sol imådje JPEG EXIF
-Name[xh]=Ulwazi lwe JPEG EXIF
-Name[zh_CN]=JPEG EXIF 信息
-Name[zh_HK]=JPEG EXIF 資訊
-Name[zh_TW]=JPEG EXIF 資訊
-Name[zu]=Ulwazi lwe-JPEG EXIF
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_jpeg
MimeType=image/jpeg
diff --git a/tdefile-plugins/pcx/CMakeLists.txt b/tdefile-plugins/pcx/CMakeLists.txt
index 7eea5125..438e0ce9 100644
--- a/tdefile-plugins/pcx/CMakeLists.txt
+++ b/tdefile-plugins/pcx/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_pcx.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_pcx.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_pcx (module) #########################
diff --git a/tdefile-plugins/pcx/tdefile_pcx.cpp b/tdefile-plugins/pcx/tdefile_pcx.cpp
index 2c4047a6..9ef2ed25 100644
--- a/tdefile-plugins/pcx/tdefile_pcx.cpp
+++ b/tdefile-plugins/pcx/tdefile_pcx.cpp
@@ -116,7 +116,3 @@ bool KPcxPlugin::readInfo( KFileMetaInfo& info, uint )
}
#include "tdefile_pcx.moc"
-
-/* vim: et sw=2 ts=2
-*/
-
diff --git a/tdefile-plugins/pcx/tdefile_pcx.desktop b/tdefile-plugins/pcx/tdefile_pcx.desktop
index b555c7b3..d0ad9700 100644
--- a/tdefile-plugins/pcx/tdefile_pcx.desktop
+++ b/tdefile-plugins/pcx/tdefile_pcx.desktop
@@ -1,60 +1,6 @@
[Desktop Entry]
Type=Service
Name=PCX File Meta Info
-Name[ar]=معلومات ملف PCX
-Name[br]=Meta-titouroù ar restr PCX
-Name[bs]=PCX meta-podaci
-Name[ca]=Metainformació de fitxer PCX
-Name[cs]=Metainformace obrázku typu PCX
-Name[cy]=Meta-wybodaeth Ffeil PCX
-Name[da]=PCX Fil-meta-info
-Name[de]=PCX Metainformation
-Name[el]=Μετα-πληροφορίες αρχείου PCX
-Name[eo]=PCX-dosiera metainformo
-Name[es]=Info meta de archivos PCX
-Name[et]=PCX faili metainfo
-Name[eu]=PCX fitxategi meta info
-Name[fa]=فرااطلاعات پروندۀ PCX
-Name[fi]=PCX-tiedoston metatiedot
-Name[fr]=Méta Informations sur les fichiers PCX
-Name[gl]=Inf. metaficheiro PCX
-Name[he]=מידע PCX
-Name[hi]=PCX फ़ाइल मेटा जानकारी
-Name[hu]=PCX-jellemzők
-Name[is]=PCX File Meta upplýsingar
-Name[it]=Informazioni PCX
-Name[ja]=PCX ファイルメタ情報
-Name[kk]=PCX файлдың мета деректері
-Name[km]=ព័ត៌មាន​មេតា​របស់​ឯកសារ PCX
-Name[lt]=PCX bylos meta informacija
-Name[ms]=Maklumat Meta Fail PCX
-Name[nb]=PCX-filmetainfo
-Name[nds]=PCX-Metainfo
-Name[ne]=PCX फाइल मेटा सूचना
-Name[nl]=PCX meta-info
-Name[nn]=PCX-filmetainfo
-Name[pl]=Informacja o pliku PCX
-Name[pt]=Meta-Informação do Ficheiro PCX
-Name[pt_BR]=Informação sobre Meta Arquivo PCX
-Name[ro]=Metainformaţii PCX
-Name[ru]=Информация о метафайле PCX
-Name[se]=PCX-filla metadieđut
-Name[sk]=Meta-info o súbore PCX
-Name[sl]=Meta podatki o PCX
-Name[sr]=Мета информације PCX фајла
-Name[sr@Latn]=Meta informacije PCX fajla
-Name[sv]=Metainformation om PCX-fil
-Name[ta]=PCX File Meta தகவல்
-Name[tg]=Иттилоот оиди метафайли PCX
-Name[th]=ข้อมูลเมตาแฟ้ม PCX
-Name[tr]=PCX Dosya Bilgisi
-Name[uk]=Метаінформація про файл PCX
-Name[uz]=PCX-faylining meta-maʼlumoti
-Name[uz@cyrillic]=PCX-файлининг мета-маълумоти
-Name[wa]=Informåcion sol imådje PCX
-Name[zh_CN]=PCX 文件元信息
-Name[zh_HK]=PCX 檔案 Meta 資訊
-Name[zh_TW]=PCX 檔案 Meta 資訊
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_pcx
MimeType=image/x-pcx
diff --git a/tdefile-plugins/pcx/tdefile_pcx.h b/tdefile-plugins/pcx/tdefile_pcx.h
index c8e0726e..bf567792 100644
--- a/tdefile-plugins/pcx/tdefile_pcx.h
+++ b/tdefile-plugins/pcx/tdefile_pcx.h
@@ -83,7 +83,3 @@ private:
};
#endif
-
-/* vim: et sw=2 ts=2
-*/
-
diff --git a/tdefile-plugins/pdf/CMakeLists.txt b/tdefile-plugins/pdf/CMakeLists.txt
index 3213a047..8d01a571 100644
--- a/tdefile-plugins/pdf/CMakeLists.txt
+++ b/tdefile-plugins/pdf/CMakeLists.txt
@@ -24,7 +24,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_pdf.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_pdf.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_pdf (module) #########################
diff --git a/tdefile-plugins/pdf/tdefile_pdf.desktop b/tdefile-plugins/pdf/tdefile_pdf.desktop
index 24ac872a..ac675396 100644
--- a/tdefile-plugins/pdf/tdefile_pdf.desktop
+++ b/tdefile-plugins/pdf/tdefile_pdf.desktop
@@ -1,63 +1,6 @@
[Desktop Entry]
Type=Service
Name=PDF Info
-Name[af]=Pdf Inligting
-Name[ar]=معلومات PDF
-Name[br]=Titouroù PDF
-Name[ca]=Informació de PDF
-Name[cs]=PDF info
-Name[cy]=Gybodaeth PDF
-Name[da]=PDF-info
-Name[de]=PDF-Info
-Name[el]=Πληροφορίες PDF
-Name[eo]=PDF-informo
-Name[es]=Info PDF
-Name[et]=PDF info
-Name[fa]=اطلاعات PDF
-Name[fi]=PDF-tiedot
-Name[fr]=Informations PDF
-Name[gl]=Inf. PDF
-Name[he]=מידע PDF
-Name[hi]=PDF जानकारी
-Name[hr]=PDF Informacije
-Name[hu]=PDF-jellemzők
-Name[is]=PDF upplýsingar
-Name[it]=Informazioni PDF
-Name[ja]=PDF 情報
-Name[kk]=PDF мәліметі
-Name[km]=ព័ត៌មាន PDF
-Name[lt]=PDF informacija
-Name[ms]=Maklumat PDF
-Name[nds]=PDF-Info
-Name[ne]=PDF सूचना
-Name[nl]=PDF-info
-Name[nn]=PDF-info
-Name[nso]=Tshedimoso ya PDF
-Name[pa]=PDF ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku PDF
-Name[pt]=Informação do PDF
-Name[pt_BR]=Informação sobre PDF
-Name[ro]=Informaţii PDF
-Name[ru]=Информация о PDF
-Name[se]=PDF-dieđut
-Name[sl]=Podatki o PDF
-Name[sr]=PDF информације
-Name[sr@Latn]=PDF informacije
-Name[sv]=PDF-information
-Name[ta]=PDF தகவல்
-Name[tg]=Иттилоот оиди PDF
-Name[th]=ข้อมูลแฟ้ม PDF
-Name[tr]=PDF Bilgisi
-Name[uk]=Інформація про PDF
-Name[uz]=PDF haqida maʼlumot
-Name[uz@cyrillic]=PDF ҳақида маълумот
-Name[ven]=Mafhungo a PDF
-Name[wa]=Informåcion sol documint PDF
-Name[xh]=PDF Ulwazi
-Name[zh_CN]=PDF 信息
-Name[zh_HK]=PDF 資訊
-Name[zh_TW]=PDF 資訊
-Name[zu]=Ulwazi lwe-PDF
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_pdf
MimeType=application/pdf
diff --git a/tdefile-plugins/png/CMakeLists.txt b/tdefile-plugins/png/CMakeLists.txt
index 7000bcd7..371aa775 100644
--- a/tdefile-plugins/png/CMakeLists.txt
+++ b/tdefile-plugins/png/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_png.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_png.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_png (module) #########################
diff --git a/tdefile-plugins/png/tdefile_png.desktop b/tdefile-plugins/png/tdefile_png.desktop
index 94afa880..02a75256 100644
--- a/tdefile-plugins/png/tdefile_png.desktop
+++ b/tdefile-plugins/png/tdefile_png.desktop
@@ -1,63 +1,6 @@
[Desktop Entry]
Type=Service
Name=PNG Info
-Name[af]=Png Inligting
-Name[ar]=معلومات PNG
-Name[br]=Titouroù PNG
-Name[ca]=Informació de PNG
-Name[cs]=PNG info
-Name[cy]=Gybodaeth PNG
-Name[da]=PNG-info
-Name[de]=PNG-Info
-Name[el]=Πληροφορίες PNG
-Name[eo]=PNG-informo
-Name[es]=Info PNG
-Name[et]=PNG info
-Name[fa]=اطلاعات PNG
-Name[fi]=PNG-tiedot
-Name[fr]=Informations PNG
-Name[gl]=Inf. PNG
-Name[he]=מידע PNG
-Name[hi]=PNG जानकारी
-Name[hr]=PNG Informacije
-Name[hu]=PNG-jellemzők
-Name[is]=PNG upplýsingar
-Name[it]=Informazioni PNG
-Name[ja]=PNG 情報
-Name[kk]=PNG мәліметі
-Name[km]=ព័ត៌មាន PNG
-Name[lt]=PNG informacija
-Name[ms]=Maklumat PNG
-Name[nds]=PNG-Info
-Name[ne]=PNG सूचना
-Name[nl]=PNG-Info
-Name[nn]=PNG-info
-Name[nso]=Tshedimoso ya PNG
-Name[pa]=PNG ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku PNG
-Name[pt]=Informação do PNG
-Name[pt_BR]= Informação sobre PNG
-Name[ro]=Informaţii PNG
-Name[ru]=Информация о PNG
-Name[se]=PNG-dieđut
-Name[sl]=Podatki o PNG
-Name[sr]=PNG информације
-Name[sr@Latn]=PNG informacije
-Name[sv]=PNG-information
-Name[ta]=PNG தகவல்
-Name[tg]=Иттилоот оиди PNG
-Name[th]=ข้อมูลแฟ้ม PNG
-Name[tr]=PNG Bilgisi
-Name[uk]=Інформація про PNG
-Name[uz]=PNG haqida maʼlumot
-Name[uz@cyrillic]=PNG ҳақида маълумот
-Name[ven]=Mafhungo a PNG
-Name[wa]=Informåcion sol imådje PNG
-Name[xh]=PNG Ulwazi
-Name[zh_CN]=PNG 信息
-Name[zh_HK]=PNG 資訊
-Name[zh_TW]=PNG 資訊
-Name[zu]=Ulwazi lwe-PNG
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_png
MimeType=image/png
diff --git a/tdefile-plugins/pnm/CMakeLists.txt b/tdefile-plugins/pnm/CMakeLists.txt
index 637fe59d..4896e21c 100644
--- a/tdefile-plugins/pnm/CMakeLists.txt
+++ b/tdefile-plugins/pnm/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_pnm.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_pnm.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_pnm (module) #########################
diff --git a/tdefile-plugins/pnm/tdefile_pnm.desktop b/tdefile-plugins/pnm/tdefile_pnm.desktop
index dec0c4ba..c0ed4be9 100644
--- a/tdefile-plugins/pnm/tdefile_pnm.desktop
+++ b/tdefile-plugins/pnm/tdefile_pnm.desktop
@@ -1,58 +1,6 @@
[Desktop Entry]
Type=Service
Name=PNM Info
-Name[ar]=معلومات PNM
-Name[br]=Titouroù PNM
-Name[ca]=Informació de PNM
-Name[cs]=PNM info
-Name[cy]=Gybodaeth PNM
-Name[da]=PNG-info
-Name[de]=PNM-Info
-Name[el]=Πληροφορίες PNM
-Name[eo]=PNM-informo
-Name[es]=Info PNM
-Name[et]=PNM info
-Name[fa]=اطلاعات PNM
-Name[fi]=PNM-tiedot
-Name[fr]=Informations PNM
-Name[gl]=Inf. PNM
-Name[he]=מידע PNM
-Name[hi]=PNM जानकारी
-Name[hu]=PNM-jellemzők
-Name[is]=PNM upplýsingar
-Name[it]=Informazioni PNM
-Name[ja]=PNM 情報
-Name[kk]=PNM мәліметі
-Name[km]=ព័ត៌មាន PNM
-Name[lt]=PNM informacija
-Name[ms]=Maklumat PNM
-Name[nb]=PNM-info
-Name[nds]=PNM-Info
-Name[ne]=PNM सूचना
-Name[nl]=PNG-info
-Name[nn]=PNM-info
-Name[pa]=PNM ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku PNM
-Name[pt]=Informação do PNM
-Name[pt_BR]=Informação sobre PNG
-Name[ro]=Informaţii PNM
-Name[ru]=Информация о PNM
-Name[se]=PNM-dieđut
-Name[sl]=Podatki o PNM
-Name[sr]=PNM информације
-Name[sr@Latn]=PNM informacije
-Name[sv]=PNM-information
-Name[ta]=PNM தகவல்
-Name[tg]=Иттилоот оиди PNM
-Name[th]=ข้อมูลแฟ้ม PNM
-Name[tr]=PNM Bilgisi
-Name[uk]=Інформація про PNM
-Name[uz]=PNM haqida maʼlumot
-Name[uz@cyrillic]=PNM ҳақида маълумот
-Name[wa]=Informåcion sol imådje PNM
-Name[zh_CN]=PNM 信息
-Name[zh_HK]=PNM 資訊
-Name[zh_TW]=PNM 資訊
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_pnm
MimeType=image/x-portable-bitmap;image/x-portable-greymap;image/x-portable-pixmap
diff --git a/tdefile-plugins/ps/CMakeLists.txt b/tdefile-plugins/ps/CMakeLists.txt
index 9a13bcb1..8706f44a 100644
--- a/tdefile-plugins/ps/CMakeLists.txt
+++ b/tdefile-plugins/ps/CMakeLists.txt
@@ -25,7 +25,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_ps.desktop gsthumbnail.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_ps.desktop gsthumbnail.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_ps (module) ########################
diff --git a/tdefile-plugins/ps/gscreator.cpp b/tdefile-plugins/ps/gscreator.cpp
index c664947b..88601a4c 100644
--- a/tdefile-plugins/ps/gscreator.cpp
+++ b/tdefile-plugins/ps/gscreator.cpp
@@ -241,7 +241,7 @@ bool GSCreator::create(const TQString &path, int width, int height, TQImage &img
char translation[64] = "";
char pagesize[32] = "";
char resopt[32] = "";
- std::auto_ptr<KDSCBBOX> bbox = dsc.bbox();
+ std::unique_ptr<KDSCBBOX> bbox = dsc.bbox();
if (is_encapsulated) {
// GhostScript's rendering at the extremely low resolutions
// required for thumbnails leaves something to be desired. To
diff --git a/tdefile-plugins/ps/gsthumbnail.desktop b/tdefile-plugins/ps/gsthumbnail.desktop
index 7ef9ba44..e3978a3e 100644
--- a/tdefile-plugins/ps/gsthumbnail.desktop
+++ b/tdefile-plugins/ps/gsthumbnail.desktop
@@ -1,59 +1,6 @@
[Desktop Entry]
Type=Service
Name=PostScript, PDF and DVI Files
-Name[ar]=ملفات الــ PostScript ، PDF و DVI
-Name[br]=Restroù PostScript, PDF ha DVI
-Name[bs]=Postscript, PDF i DVI datoteke
-Name[ca]=Fitxers PostScript, PDF i DVI
-Name[cs]=Postscriptové, PDF a DVI soubory
-Name[cy]=Ffeiliau PostScript, PDF a DVI
-Name[da]=PostScript, PDF- og DVI-filer
-Name[de]=PostScript-, PDF- und DVI-Dateien
-Name[el]=Αρχεία PostScript, PDF και DVI
-Name[eo]=Postskriptaj, PDF- kaj DVI-dosieroj
-Name[es]=Archivos PostScript, PDF y DVI
-Name[et]=PostScript-, PDF- ja DVI-failid
-Name[eu]=PostScript, PDF eta DVI fitxategiak
-Name[fa]=پرونده‌های PostScript، PDF و DVI
-Name[fi]=PostScript-, PDF- ja DVI-tiedostot
-Name[fr]=Fichiers PostScript, PDF et DVI
-Name[ga]=Comhaid PostScript, PDF agus DVI
-Name[gl]=Ficheiros PostScript, PDF e DVI
-Name[he]=קבצי PostScript, PDF ו־DVI
-Name[hu]=PostScript-, PDF- és DVI-fájlok
-Name[is]=PostScript PDF og DVI skrár
-Name[it]=File PostScript, PDF e DVI
-Name[ja]=Postscript,PDF,DVIファイル
-Name[kk]=PostScript, PDF және DVI файлдары
-Name[km]=ឯកសារ PostScript, PDF និង DVI
-Name[lt]=Postscript, PDF ir DVI bylos
-Name[ms]=PostScript, PDF dan Fail DVI
-Name[nb]=PostScript, PDF og DVI filer
-Name[nds]=PostScript-, PDF- un DVI-Dateien
-Name[ne]=पोष्टस्क्रिप्ट, PDF र DVI फाइल
-Name[nl]=PostScript-, DVI- en PDF-bestanden
-Name[nn]=PostScript-, PDF- og DVI-filer
-Name[pl]=Pliki PostScript, PDF i DVI
-Name[pt]=Ficheiros PostScript, PDF e DVI
-Name[pt_BR]=Arquivos PostScript, PDF e DVI
-Name[ro]=Fişiere PostScript, PDF şi DVI
-Name[ru]=Файлы PostScript, PDF и DVI
-Name[se]=PostScript-, PDF- ja DVI-fiillat
-Name[sk]=PostScript, PDF a DVI súbory
-Name[sl]=Datoteke PostScript, PDF in DVI
-Name[sr]=PostScript, PDF и DVI фајлови
-Name[sr@Latn]=PostScript, PDF i DVI fajlovi
-Name[sv]=Postscript, PDF och DVI-filer
-Name[ta]= போஸ்ட்கிரிப்ட், பிடிஃப் மற்றும் டிவிஐ கோப்புகள்
-Name[tg]=Файлҳои PostScript, PDF ва DVI
-Name[th]=แฟ้ม PDF, DVI และ โพสต์สคริปต์
-Name[tr]=PostScript, PDF ve DVI Dosyaları
-Name[uk]=Файли PostScript, PDF та DVI
-Name[uz]=PostScript, PDF va DVI fayllari
-Name[uz@cyrillic]=PostScript, PDF ва DVI файллари
-Name[zh_CN]=PostScript、PDF 和 DVI 文件
-Name[zh_HK]=PostScript 、PDF 及 DVI 檔案
-Name[zh_TW]=PostScript,PDF 與 DVI 檔
X-TDE-ServiceTypes=ThumbCreator
MimeTypes=application/x-dvi,application/postscript,application/pdf,image/x-eps
X-TDE-Library=gsthumbnail
diff --git a/tdefile-plugins/ps/tdefile_ps.desktop b/tdefile-plugins/ps/tdefile_ps.desktop
index f3284a21..8c55a99c 100644
--- a/tdefile-plugins/ps/tdefile_ps.desktop
+++ b/tdefile-plugins/ps/tdefile_ps.desktop
@@ -1,65 +1,6 @@
[Desktop Entry]
Type=Service
Name=PostScript Info
-Name[af]=Postscript Inligting
-Name[ar]=معلومات PostScript
-Name[br]=Procinfo PostScript
-Name[ca]=Informació de PostScript
-Name[cs]=PostScript info
-Name[cy]=Gwybodaeth PostScript
-Name[da]=PostScript-info
-Name[de]=PostScript-Info
-Name[el]=Πληροφορίες PostScript
-Name[eo]=Postskriptinformo
-Name[es]=Info PostScript
-Name[et]=PostScript info
-Name[fa]=اطلاعات PostScript
-Name[fi]=PostScript-tiedot
-Name[fr]=Informations PostScript
-Name[gl]=Inf. PostScript
-Name[he]=מידע PostScript
-Name[hi]=पोस्टस्क्रिप्ट जानकारी
-Name[hr]=Postscript informacije
-Name[hu]=PostScript-jellemzők
-Name[is]=PostScript upplýsingar
-Name[it]=Informazioni PostScript
-Name[ja]=PostScript 情報
-Name[kk]=PostScript мәліметі
-Name[km]=ព័ត៌មាន PostScript
-Name[lt]=PostScript informacija
-Name[lv]=Postscript Info
-Name[ms]=Maklumat PostScript
-Name[nb]=PostScript-info
-Name[nds]=PostScript-Info
-Name[ne]=पोष्टस्क्रिप्ट सूचना
-Name[nl]=PostScript-info
-Name[nn]=PostScript-info
-Name[nso]=Tshedimoso ya PostScript
-Name[pa]=PostScript ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku PostScriptu
-Name[pt]=Informação do PostScript
-Name[pt_BR]=Informação sobre PostScript
-Name[ro]=Informaţii PostScript
-Name[ru]=Информация о PostScript
-Name[se]=PostScript-dieđut
-Name[sl]=Podatki o PostScriptu
-Name[sr]=PostScript информације
-Name[sr@Latn]=PostScript informacije
-Name[sv]=Postscript-information
-Name[ta]=முன் எழுத்தாக்க தகவல்
-Name[tg]=Иттилоот оиди PostScript
-Name[th]=ข้อมูลโพสต์สคริปต์
-Name[tr]=PostScript Bilgisi
-Name[uk]=Інформація про PostScript
-Name[uz]=PostScript haqida maʼlumot
-Name[uz@cyrillic]=PostScript ҳақида маълумот
-Name[ven]=Mafhungo a mabammbiri a poso
-Name[wa]=Informåcion sol documint PostScript
-Name[xh]=Ulwazi Lwe PostScript
-Name[zh_CN]=PostScript 信息
-Name[zh_HK]=PostScript 資訊
-Name[zh_TW]=PostScript 資訊
-Name[zu]=Ulwazi Lwesi-PostScript
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_ps
MimeType=application/postscript;image/x-eps
diff --git a/tdefile-plugins/raw/CMakeLists.txt b/tdefile-plugins/raw/CMakeLists.txt
index 80810e07..11a7c172 100644
--- a/tdefile-plugins/raw/CMakeLists.txt
+++ b/tdefile-plugins/raw/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_raw.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_raw.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_raw (module) #########################
diff --git a/tdefile-plugins/raw/tdefile_raw.desktop b/tdefile-plugins/raw/tdefile_raw.desktop
index 0393194b..bd998ed7 100644
--- a/tdefile-plugins/raw/tdefile_raw.desktop
+++ b/tdefile-plugins/raw/tdefile_raw.desktop
@@ -1,51 +1,6 @@
[Desktop Entry]
Type=Service
Name=RAW Camera Files
-Name[br]=Restroù kamera kriz
-Name[bs]=RAW kamera datoteke
-Name[ca]=Fitxers RAW de càmera
-Name[cs]=RAW soubory
-Name[da]=RAW kamera-filer
-Name[de]=RAW Kamera-Dateien
-Name[el]=RAW αρχείο κάμερας
-Name[es]=Archivos RAW de cámara
-Name[et]=Toored kaamerafailid
-Name[eu]=RAW kamera-fitxategiak
-Name[fa]=پرونده‌های خام دوربین
-Name[fi]=RAW-kuvatiedostot
-Name[fr]=Fichiers RAW d'appareil photo numérique
-Name[ga]=Comhaid Cheamara RAW
-Name[gl]=Ficheiros RAW de Cámara
-Name[he]=קבצי מצלמה דיגיטלית גולמיים
-Name[hu]=RAW-fájlok
-Name[is]=RAW myndavélaskrár
-Name[it]=File grezzi fotocamera digitale
-Name[ja]=RAW カメラファイル
-Name[kk]=Камераның RAW пішімдегі файлдары
-Name[km]=ឯកសារ​ចេញ​ពី​ម៉ាស៊ីន​ថត​រូប
-Name[lt]=RAW fotoaparato bylos
-Name[nb]=RAW-kamerafiler
-Name[nds]=RAW-Kameradateien
-Name[ne]=RAW क्यामेरा फाइल
-Name[nl]=Rauwe camerabestanden
-Name[nn]=RAW-kamerafiler
-Name[pa]=RAW ਕੈਮਰਾ ਫਾਇਲਾਂ
-Name[pl]=Pliki RAW z aparatów cyfrowych
-Name[pt]=Ficheiros de Máquina Fotográfica Digital RAW
-Name[pt_BR]=Arquivos de Câmeras
-Name[ro]=Fişiere foto brute
-Name[ru]=Необработанные Файлы с цифровой камеры (RAW)
-Name[sk]=RAW súbory digitálneho fotoaparátu
-Name[sl]=Surove datoteke s fotoaparata
-Name[sr]=RAW фајлови слика
-Name[sr@Latn]=RAW fajlovi slika
-Name[sv]=Obehandlade kamerafiler
-Name[th]=แฟ้มภาพ RAW จากกล้อง
-Name[tr]=RAW Kamera Dosyaları
-Name[uk]=Файли цифрової камери RAW
-Name[zh_CN]=RAW 相机文件
-Name[zh_HK]=RAW 相機檔案
-Name[zh_TW]=原始相機檔
X-TDE-ServiceTypes=KFilePlugin
MimeType=image/x-raw
X-TDE-Library=tdefile_raw
diff --git a/tdefile-plugins/rgb/CMakeLists.txt b/tdefile-plugins/rgb/CMakeLists.txt
index 7596f2cb..01db22a9 100644
--- a/tdefile-plugins/rgb/CMakeLists.txt
+++ b/tdefile-plugins/rgb/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_rgb.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_rgb.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_rgb (module) #########################
diff --git a/tdefile-plugins/rgb/tdefile_rgb.desktop b/tdefile-plugins/rgb/tdefile_rgb.desktop
index 20f993fc..97d688b7 100644
--- a/tdefile-plugins/rgb/tdefile_rgb.desktop
+++ b/tdefile-plugins/rgb/tdefile_rgb.desktop
@@ -1,59 +1,6 @@
[Desktop Entry]
Type=Service
Name=SGI Image (RGB)
-Name[br]=Skeudenn SGI (RGB)
-Name[bs]=SGI slika (RGB)
-Name[ca]=Imatge SGI (RGB)
-Name[cs]=SGI obrázek (RGB)
-Name[cy]=Delwedd SGI (RGB)
-Name[da]=SGI-billede (RGB)
-Name[de]=SGI-Bild (RGB)
-Name[el]=Εικόνα SGI (RGB)
-Name[es]=Imagen SGI (RGB)
-Name[et]=SGI pildifail (RGB)
-Name[eu]=SGI irudia RGB)
-Name[fa]=تصویر SGI (RGB)
-Name[fi]=SGI-kuva (RGB)
-Name[fr]=Image SGI (RVB)
-Name[ga]=Íomhá SGI (RGB)
-Name[gl]=Imaxe SGI (RGB)
-Name[he]=תמונת SGI (RGB)
-Name[hr]=SGI slika (RGB)
-Name[hu]=SGI-kép (RGB)
-Name[is]=SGI mynd (TGB)
-Name[it]=Immagine SGI (RGB)
-Name[ja]=SGI 画像 (RGB)
-Name[kk]=SGI кескіні (RGB)
-Name[km]=រូបភាព SGI (RGB)
-Name[lt]=SGI paveiksliukas (RGB)
-Name[ms]=Imej SGI (RGB)
-Name[nb]=Bildeindeks
-Name[nds]=SGI-Bild (RGB)
-Name[ne]=SGI छवि (RGB)
-Name[nl]=SGI-afbeelding (RGB)
-Name[nn]=SGI-bilete (RGB)
-Name[pl]=Obrazek SGI (RGB)
-Name[pt]=Imagem SGI (RGB)
-Name[pt_BR]=Imagem SGI (RGB)
-Name[ro]=Imagine SGI (RGB)
-Name[ru]=Изображение SGI (RGB)
-Name[rw]=SGI Ishusho (RGB)
-Name[se]=SGI-govva (RGB)
-Name[sk]=SGI obrázok (RGB)
-Name[sl]=Slika SGI (RGB)
-Name[sr]=SGI слика (RGB)
-Name[sr@Latn]=SGI slika (RGB)
-Name[sv]=SGI-bild (RGB)
-Name[ta]=எஸ்ஜிஐ படிமம் (RGB)
-Name[tg]=Тасвироти SGI (RGB)
-Name[th]=ภาพ SGI (RGB)
-Name[tr]=SGI Resmi(KYM)
-Name[uk]=Зображення SGI (RGB)
-Name[uz]=SGI-rasm (RGB)
-Name[uz@cyrillic]=SGI-расм (RGB)
-Name[zh_CN]=SGI 图像(RGB)
-Name[zh_HK]=SGI 圖像 (RGB)
-Name[zh_TW]=SGI 影像(RGB)
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_rgb
MimeType=image/x-rgb
diff --git a/tdefile-plugins/tga/CMakeLists.txt b/tdefile-plugins/tga/CMakeLists.txt
index 7040c7ca..a40a823f 100644
--- a/tdefile-plugins/tga/CMakeLists.txt
+++ b/tdefile-plugins/tga/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_tga.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_tga.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_tga (module) #########################
diff --git a/tdefile-plugins/tga/tdefile_tga.desktop b/tdefile-plugins/tga/tdefile_tga.desktop
index eb6b6f8f..6f6eb59b 100644
--- a/tdefile-plugins/tga/tdefile_tga.desktop
+++ b/tdefile-plugins/tga/tdefile_tga.desktop
@@ -1,62 +1,6 @@
[Desktop Entry]
Type=Service
Name=Truevision Targa Info
-Name[ar]=معلومات Truevision Targa
-Name[br]=Gorretaol Truevision Targa
-Name[ca]=Informació de Targa Truevision
-Name[cs]=Truevision Targa info
-Name[cy]=Gwybodaeth Truevision Targa
-Name[da]=Truevision Targa-info
-Name[de]=Truevision Targa-Info
-Name[el]=Πληροφορίες Truevision Targa
-Name[eo]=TARGA-informo
-Name[es]=Info de Targa visión verdadera
-Name[et]=Truevision Targa info
-Name[fa]=اطلاعات Truevision Targa
-Name[fi]=Truevision Targa -tiedot
-Name[fr]=Informations Truevision
-Name[gl]=Inf. Truevision Targa
-Name[he]=מידע Truevision Targa
-Name[hi]=ट्रू-विज़न टाग्रा जानकारी
-Name[hr]=Truevision Targa Infomacije
-Name[hu]=Truevision/Targa-jellemzők
-Name[is]=Truevision Targa upplýsingar
-Name[it]=Informazioni Truevision Targa
-Name[ja]=TGA (Truevision Targa) 情報
-Name[kk]=Truevision Targa мәліметі
-Name[km]=ព័ត៌មាន Truevision Targa
-Name[lt]=Truevision Targa informacija
-Name[ms]=Maklumat Targa Truevision
-Name[nb]=Truevision Targa-info
-Name[nds]="Truevision Targa"-Info
-Name[ne]=ट्रुभिजन टार्गा सूचना
-Name[nl]=Truevision Targa-info
-Name[nn]=Truevision Targa-info
-Name[nso]=Tshedimoso ya Targa ya pono ya Nnete
-Name[pl]=Informacja o pliku Truevision Targa
-Name[pt]=Informação do Targa da Truevision
-Name[pt_BR]=Informação sobre Truevision Targa
-Name[ro]=Informaţii Targa Truevision
-Name[ru]=Информация о Truevision Targa
-Name[se]=Truevision Targa-dieđut
-Name[sl]=Podatki o Truevision Targa
-Name[sr]=Truevision Targa информације
-Name[sr@Latn]=Truevision Targa informacije
-Name[sv]=Information om Truevision Targa
-Name[ta]=சரியான பார்வை தார்கா தகவல்
-Name[tg]=Иттилоот оиди Truevision Targa
-Name[th]=ข้อมูลแฟ้ม Truevision Targa
-Name[tr]=Truevision Targa Bilgisi
-Name[uk]=Інформація по Truevision Targa
-Name[uz]=TGA haqida maʼlumot
-Name[uz@cyrillic]=TGA ҳақида маълумот
-Name[ven]=Mafhungo a Targa ya mbonalelo ya vhukuma
-Name[wa]=Informåcion sol imådje Truevision Targa
-Name[xh]=Ulwazi lwe Truevision Targa
-Name[zh_CN]=Truevision Targa 信息
-Name[zh_HK]=Truevision Targa 資訊
-Name[zh_TW]=Truevision Targa 資訊
-Name[zu]=Ulwazi lwe-Truevision Targa
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_tga
MimeType=image/x-targa
diff --git a/tdefile-plugins/tiff/CMakeLists.txt b/tdefile-plugins/tiff/CMakeLists.txt
index d3ec9b90..cd875145 100644
--- a/tdefile-plugins/tiff/CMakeLists.txt
+++ b/tdefile-plugins/tiff/CMakeLists.txt
@@ -25,7 +25,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_tiff.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_tiff.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_tiff (module) ########################
diff --git a/tdefile-plugins/tiff/tdefile_tiff.desktop b/tdefile-plugins/tiff/tdefile_tiff.desktop
index c1140de0..a02e9fef 100644
--- a/tdefile-plugins/tiff/tdefile_tiff.desktop
+++ b/tdefile-plugins/tiff/tdefile_tiff.desktop
@@ -1,65 +1,6 @@
[Desktop Entry]
Type=Service
Name=TIFF File Meta Info
-Name[af]=Tiff Lêer Meta Inligting
-Name[ar]=معلومات ملف TIFF
-Name[br]=Meta-titouroù ar restr TIFF
-Name[ca]=Metainformació de fitxer TIFF
-Name[cs]=Metainformace obrázku typu TIFF
-Name[cy]=Meta-wybodaeth Ffeil TIFF
-Name[da]=TIFF Fil-meta-info
-Name[de]=TIFF-Metainformation
-Name[el]=Μετα-πληροφορίες αρχείου TIFF
-Name[eo]=TIFF-informo
-Name[es]=Info meta de archivos TIFF
-Name[et]=TIFF faili metainfo
-Name[eu]=TIFF fitxategi meta info
-Name[fa]=فرااطلاعات پروندۀ TIFF
-Name[fi]=TIFF-metatiedot
-Name[fr]=Méta Informations sur les fichiers TIFF
-Name[gl]=Inf. metaficheiro TIFF
-Name[he]=מידע TIFF
-Name[hi]=TIFF फ़ाइल मेटा जानकारी
-Name[hr]=TIFF meta informacije
-Name[hu]=TIFF-metajellemzők
-Name[is]=TIFF File Meta upplýsingar
-Name[it]=Informazioni TIFF
-Name[ja]=TIFF ファイルメタ情報
-Name[kk]=TIFF файлдың мета деректері
-Name[km]=ព័ត៌មាន​មេតា​របស់​ឯកសារ TIFF
-Name[lt]=TIFF bylos meta informacija
-Name[ms]=TIFF Maklumat Meta Fail TIFF
-Name[nb]=TIFF-filmetainfo
-Name[nds]=TIFF-Metainfo
-Name[ne]=TIFF फाइल मेटा सूचना
-Name[nl]=TIFF File Meta-info
-Name[nn]=TIFF-filmetainfo
-Name[nso]=Tshedimoso ya Meta wa Faele ya TIFF
-Name[pl]=Informacja o pliku TIFF
-Name[pt]=Meta-Informação do Ficheiro TIFF
-Name[pt_BR]=Informação sobre Meta Arquivo TIFF
-Name[ro]=Metainformaţii TIFF
-Name[ru]=Информация о метафайле TIFF
-Name[se]=TIFF-filla metadieđut
-Name[sk]=Meta-info o súbore TIFF
-Name[sl]=Meta podatki o TIFF
-Name[sr]=Мета информације TIFF фајла
-Name[sr@Latn]=Meta informacije TIFF fajla
-Name[sv]=Metainformation om TIFF-fil
-Name[ta]=TIFF மீக்கோப்பு தகவல்
-Name[tg]=Иттилоот оиди метафайли TIFF
-Name[th]=ข้อมูลเมตาแฟ้ม TIFF
-Name[tr]=TIFF Dosya Bilgisi
-Name[uk]=Метаінформація про файл TIFF
-Name[uz]=TIFF-faylining meta-maʼlumoti
-Name[uz@cyrillic]=TIFF-файлининг мета-маълумоти
-Name[ven]=Mafhungo a Meta faela ya TIFF
-Name[wa]=Informåcion sol imådje TIFF
-Name[xh]=Ulwazi lwe TIFF Ifayile Esembindini
-Name[zh_CN]=TIFF 文件元信息
-Name[zh_HK]=TIFF 檔案 Meta 資訊
-Name[zh_TW]=TIFF 檔案 Meta 資訊
-Name[zu]=Ulwazi Lwefayela yemeta ye-TIFF
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_tiff
MimeType=image/tiff
diff --git a/tdefile-plugins/xbm/CMakeLists.txt b/tdefile-plugins/xbm/CMakeLists.txt
index 4b96ade8..76fd74e3 100644
--- a/tdefile-plugins/xbm/CMakeLists.txt
+++ b/tdefile-plugins/xbm/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_xbm.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_xbm.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_xbm (module) ########################
diff --git a/tdefile-plugins/xbm/tdefile_xbm.desktop b/tdefile-plugins/xbm/tdefile_xbm.desktop
index 04775b03..b7299e2d 100644
--- a/tdefile-plugins/xbm/tdefile_xbm.desktop
+++ b/tdefile-plugins/xbm/tdefile_xbm.desktop
@@ -1,63 +1,6 @@
[Desktop Entry]
Type=Service
Name=XBM Info
-Name[af]=Xbm Inligting
-Name[ar]=معلومات XBM
-Name[br]=Titouroù XBM
-Name[ca]=Informació d'XBM
-Name[cs]=XBM info
-Name[cy]=Gwybodaeth XBM
-Name[da]=XBM-info
-Name[de]=XBM-Info
-Name[el]=Πληροφορίες XBM
-Name[eo]=XBM-informo
-Name[es]=Info XBM
-Name[et]=XBM info
-Name[fa]=اطلاعات XBM
-Name[fi]=XBM-tiedot
-Name[fr]=Informations sur XBM
-Name[gl]=Inf. XBM
-Name[he]=מידע XBM
-Name[hi]=XBM जानकारी
-Name[hr]=XBM Infoformacije
-Name[hu]=XBM-jellemzők
-Name[is]=XBM upplýsingar
-Name[it]=Informazioni XBM
-Name[ja]=XBM 情報
-Name[kk]=XBM мәліметі
-Name[km]=ព័ត៌មាន XBM
-Name[lt]=XBM informacija
-Name[ms]=Maklumat XBM
-Name[nds]=XBM-Info
-Name[ne]=XBM सूचना
-Name[nl]=XBM-info
-Name[nn]=XBM-info
-Name[nso]=Tshedimoso ya XBM
-Name[pa]=XBM ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku XBM
-Name[pt]=Informação do XBM
-Name[pt_BR]=Informação sobre XBM
-Name[ro]=Informaţii XBM
-Name[ru]=Информация о XBM
-Name[se]=XBM-dieđut
-Name[sl]=Podatki o XBM
-Name[sr]=XBM информације
-Name[sr@Latn]=XBM informacije
-Name[sv]=XBM-information
-Name[ta]=XBM தகவல்
-Name[tg]=Иттилоот оиди XBM
-Name[th]=ข้อมูลแฟ้ม XBM
-Name[tr]=XBM Bilgisi
-Name[uk]=Інформація по XBM
-Name[uz]=XBM haqida maʼlumot
-Name[uz@cyrillic]=XBM ҳақида маълумот
-Name[ven]=Mafhungo a XBM
-Name[wa]=Informåcion sol imådje XBM
-Name[xh]=Ulwazi lwe XBM
-Name[zh_CN]=XBM 信息
-Name[zh_HK]=XBM 資訊
-Name[zh_TW]=XBM 資訊
-Name[zu]=Ulwazi lwe-XBM
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_xbm
MimeType=image/x-xbm
diff --git a/tdefile-plugins/xpm/CMakeLists.txt b/tdefile-plugins/xpm/CMakeLists.txt
index 5b357416..25df4f68 100644
--- a/tdefile-plugins/xpm/CMakeLists.txt
+++ b/tdefile-plugins/xpm/CMakeLists.txt
@@ -23,7 +23,11 @@ link_directories(
#### other data #################################
-install( FILES tdefile_xpm.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+tde_create_translated_desktop(
+ SOURCE tdefile_xpm.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+ PO_DIR tdefile-desktops
+)
#### tdefile_xpm (module) #########################
diff --git a/tdefile-plugins/xpm/tdefile_xpm.desktop b/tdefile-plugins/xpm/tdefile_xpm.desktop
index d42c22b6..69888a57 100644
--- a/tdefile-plugins/xpm/tdefile_xpm.desktop
+++ b/tdefile-plugins/xpm/tdefile_xpm.desktop
@@ -1,51 +1,6 @@
[Desktop Entry]
Type=Service
Name=XPM Info
-Name[br]=Titouroù XPM
-Name[ca]=Informació de XPM
-Name[cs]=XPM info
-Name[de]=XPM-Info
-Name[el]=Πληροφορίες XPM
-Name[eo]=XPM-informo
-Name[es]=Información XPM
-Name[et]=XPM info
-Name[fa]=اطلاعات XPM
-Name[fi]=XPM-tiedot
-Name[fr]=Informations XPM
-Name[gl]=Información XPM
-Name[he]=מידע XPM
-Name[hu]=XPM-jellemzők
-Name[is]=XPM upplýsingar
-Name[it]=Informazioni XPM
-Name[ja]=XPM 情報
-Name[kk]=XPM мәліметі
-Name[km]=ព័ត៌មាន XPM
-Name[lt]=XPM informacija
-Name[ms]=Maklumat XPM
-Name[nb]=XPM-info
-Name[nds]=XPM-Info
-Name[ne]=XPM सूचना
-Name[nl]=XPM-info
-Name[nn]=XPM-info
-Name[pa]=XPM ਜਾਣਕਾਰੀ
-Name[pl]=Informacja o pliku XPM
-Name[pt]=Informação do XPM
-Name[pt_BR]=Informações Sobre XPM
-Name[ro]=Informaţii XPM
-Name[ru]=Информация о XPM
-Name[sl]=Podatki o XPM
-Name[sr]=XPM информације
-Name[sr@Latn]=XPM informacije
-Name[sv]=XPM-information
-Name[ta]=XPM தகவல்
-Name[th]=ข้อมูลแฟ้ม XPM
-Name[tr]=XPM Bilgisi
-Name[uk]=Інформація про XPM
-Name[uz]=XPM haqida maʼlumot
-Name[uz@cyrillic]=XPM ҳақида маълумот
-Name[zh_CN]=XPM 信息
-Name[zh_HK]=XPM 資訊
-Name[zh_TW]=XPM 資訊
X-TDE-ServiceTypes=KFilePlugin
X-TDE-Library=tdefile_xpm
MimeType=image/x-xpm
diff --git a/tdeiconedit/CMakeL10n.txt b/tdeiconedit/CMakeL10n.txt
index ba443424..e3fd4474 100644
--- a/tdeiconedit/CMakeL10n.txt
+++ b/tdeiconedit/CMakeL10n.txt
@@ -1,3 +1,9 @@
##### create translation templates ##############
tde_l10n_create_template( "tdeiconedit" )
+
+tde_l10n_create_template(
+ CATALOG "desktop_files/tdeiconedit.desktop/"
+ SOURCES tdeiconedit.desktop
+ DESTINATION "${CMAKE_SOURCE_DIR}/translations"
+)
diff --git a/tdeiconedit/CMakeLists.txt b/tdeiconedit/CMakeLists.txt
index 4faa13c5..17a68b7a 100644
--- a/tdeiconedit/CMakeLists.txt
+++ b/tdeiconedit/CMakeLists.txt
@@ -25,7 +25,7 @@ link_directories(
#### other data #################################
-install( FILES tdeiconedit.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+tde_create_translated_desktop( tdeiconedit.desktop )
install( FILES tdeiconeditui.rc DESTINATION ${DATA_INSTALL_DIR}/tdeiconedit )
diff --git a/tdeiconedit/palettetoolbar.cpp b/tdeiconedit/palettetoolbar.cpp
index 5e61cb48..04914f2b 100644
--- a/tdeiconedit/palettetoolbar.cpp
+++ b/tdeiconedit/palettetoolbar.cpp
@@ -172,7 +172,3 @@ void PaletteToolBar::currentColorChanged(uint color)
}
#include "palettetoolbar.moc"
-
-/* vim: et sw=2 ts=2
-*/
-
diff --git a/tdeiconedit/palettetoolbar.h b/tdeiconedit/palettetoolbar.h
index 3945331a..42281551 100644
--- a/tdeiconedit/palettetoolbar.h
+++ b/tdeiconedit/palettetoolbar.h
@@ -58,7 +58,3 @@ class PaletteToolBar : public TDEToolBar
};
#endif // PALLETTETOOLBAR_H
-
-/* vim: et sw=2 ts=2
-*/
-
diff --git a/tdeiconedit/tdeiconedit.desktop b/tdeiconedit/tdeiconedit.desktop
index cf79d3cc..9ebd6da4 100644
--- a/tdeiconedit/tdeiconedit.desktop
+++ b/tdeiconedit/tdeiconedit.desktop
@@ -1,88 +1,6 @@
[Desktop Entry]
GenericName=Icon Editor
-GenericName[af]=Ikoon Redigeerder
-GenericName[ar]=محرر الإيقونات
-GenericName[bg]=Редактор на икони
-GenericName[br]=Aozer arlunioù
-GenericName[bs]=Editor ikona
-GenericName[ca]=Editor d'icones
-GenericName[cs]=Editor ikon
-GenericName[cy]=Golygydd Eiconau
-GenericName[da]=Ikoneditor
-GenericName[de]=Editor für Arbeitsflächensymbole
-GenericName[el]=Επεξεργαστής εικονιδίων
-GenericName[eo]=Ilo por pentri kaj redakti piktogramojn
-GenericName[es]=Editor de iconos
-GenericName[et]=Ikoonide redaktor
-GenericName[eu]=Ikono editorea
-GenericName[fa]=ویرایشگر شمایل
-GenericName[fi]=Kuvakemuokkain
-GenericName[fr]=Éditeur d'icônes
-GenericName[ga]=Eagarthóir Deilbhíní
-GenericName[gl]=Editor de iconas
-GenericName[he]=עורך סמלים
-GenericName[hi]=प्रतीक (आइकॉन) संपादक
-GenericName[hr]=Uređivač ikona
-GenericName[hu]=Ikonszerkesztő
-GenericName[is]=Táknmyndaritill
-GenericName[it]=Editor di icone
-GenericName[ja]=アイコンエディタ
-GenericName[kk]=Таңбаша өңдегіші
-GenericName[km]=កម្មវិធី​និពន្ធ​រូបតំណាង
-GenericName[lt]=Ženkliukų redaktorius
-GenericName[lv]=Ikonu Redaktors
-GenericName[ms]=Editor Ikon
-GenericName[nb]=Ikonredigerer
-GenericName[nds]=Lüttbildeditor
-GenericName[ne]=प्रतिमा सम्पादक
-GenericName[nl]=Pictogrambewerker
-GenericName[nn]=Ikonredigering
-GenericName[nso]=Mofetosi wa Seemedi
-GenericName[pa]=ਆਈਕਾਨ ਸੰਪਾਦਕ
-GenericName[pl]=Edytor ikon
-GenericName[pt]=Editor de Ícones
-GenericName[pt_BR]=Editor de Ícones
-GenericName[ro]=Editor de iconiţe
-GenericName[ru]=Редактор пиктограмм
-GenericName[se]=Govašdoaimmaheaddji
-GenericName[sk]=Editor ikon
-GenericName[sl]=Urejevalnik ikon
-GenericName[sr]=Уређивач икона
-GenericName[sr@Latn]=Uređivač ikona
-GenericName[sv]=Ikoneditor
-GenericName[ta]= கேசின்னம் திருத்தி
-GenericName[tg]=Муҳаррири ишорот
-GenericName[th]=เครื่องมือแก้ไขไอคอน
-GenericName[tr]=Simge Düzenleyici
-GenericName[uk]=Редактор піктограм
-GenericName[uz]=Nishoncha tahrirchi
-GenericName[uz@cyrillic]=Нишонча таҳрирчи
-GenericName[ven]=Musengulusi wa Aikhono
-GenericName[wa]=Aspougneu d' imådjetes
-GenericName[xh]=Umhleli we Icon
-GenericName[zh_CN]=图标编辑器
-GenericName[zh_HK]=圖示編輯器
-GenericName[zh_TW]=圖示編輯器
-GenericName[zu]=Umhleli we Icon
Name=TDEIconEdit
-Name[af]=TDE-ikoon-redigeer
-Name[ar]=برنامج TDEIconEdit
-Name[cy]=KGolyguEicon
-Name[eo]=Piktogramredaktilo
-Name[hi]=के-आइकॉन-एडिट
-Name[hr]=Uređivač ikona
-Name[is]=Táknmyndaritill
-Name[lv]=KIkonuRedaktors
-Name[ms]=KIkonEdit
-Name[ne]=केडीई प्रतिमा सम्पादन
-Name[pl]=Edytor ikon
-Name[pt_BR]=KEditor de Ícones
-Name[ro]=Editor iconiţe
-Name[sv]=TDEiconedit
-Name[ta]=கேசின்னம் திருத்து
-Name[tr]=K Icon Düzenleyici
-Name[ven]=U sengulusa ha aikhono ya K
-Name[zh_TW]=TDEIconEdit 圖示編輯器
MimeType=image/x-xpm;image/x-ico;image/png;image/jpeg;
Exec=tdeiconedit -caption "%c" %i %m %u
Icon=tdeiconedit
diff --git a/tdeiconedit/tdeicongrid.cpp b/tdeiconedit/tdeicongrid.cpp
index af62db5e..b441035b 100644
--- a/tdeiconedit/tdeicongrid.cpp
+++ b/tdeiconedit/tdeicongrid.cpp
@@ -2260,4 +2260,3 @@ void TDEIconEditGrid::setModified(bool m)
#include "tdeicongrid.moc"
-// vim: set ts=4:
diff --git a/translations/desktop_files/kamera.desktop/af.po b/translations/desktop_files/kamera.desktop/af.po
new file mode 100644
index 00000000..32238dd2
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/af.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitaal Kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Konfigureer Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/ar.po b/translations/desktop_files/kamera.desktop/ar.po
new file mode 100644
index 00000000..192daafc
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ar.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "كاميرا رقمية"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "إعداد Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;كاميرا;كاميرا رقمية;كاميرا ويب;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/az.po b/translations/desktop_files/kamera.desktop/az.po
new file mode 100644
index 00000000..fa99d3b9
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/az.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digital Kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kameranı Quraşdır"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;veb kamera;Kamera;webcam;"
diff --git a/translations/desktop_files/kamera.desktop/bg.po b/translations/desktop_files/kamera.desktop/bg.po
new file mode 100644
index 00000000..6cde257a
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/bg.po
@@ -0,0 +1,34 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Фотоапарат"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Настройване на цифров фотоапарат"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
+"фото; апарат; фотоапарат; камера; цифров; цифрова; gphoto; camera; digicam; "
+"webcam; kamera;"
diff --git a/translations/desktop_files/kamera.desktop/br.po b/translations/desktop_files/kamera.desktop/br.po
new file mode 100644
index 00000000..21865e0f
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/br.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Kamera niverel"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kefluniañ Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/bs.po b/translations/desktop_files/kamera.desktop/bs.po
new file mode 100644
index 00000000..1a359f7d
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/bs.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalna kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Podesi kameru"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/ca.po b/translations/desktop_files/kamera.desktop/ca.po
new file mode 100644
index 00000000..88d19cd1
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ca.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Càmera digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configura Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;càmera;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/cs.po b/translations/desktop_files/kamera.desktop/cs.po
new file mode 100644
index 00000000..4e744414
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/cs.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitální fotoaparát"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Nastavení Kamery"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;Kamera;Digitální kamera;Webová kamera;Foto;"
diff --git a/translations/desktop_files/kamera.desktop/cy.po b/translations/desktop_files/kamera.desktop/cy.po
new file mode 100644
index 00000000..8acfe15c
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/cy.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Camera Digidol"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Ffurfweddu Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/da.po b/translations/desktop_files/kamera.desktop/da.po
new file mode 100644
index 00000000..c62502d8
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/da.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalt kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Indstil kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;webcam;"
diff --git a/translations/desktop_files/kamera.desktop/de.po b/translations/desktop_files/kamera.desktop/de.po
new file mode 100644
index 00000000..c84d828f
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/de.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalkamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kamera einrichten"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;Kamera;Digicam;Webcam;Digitalkamera;"
diff --git a/translations/desktop_files/kamera.desktop/el.po b/translations/desktop_files/kamera.desktop/el.po
new file mode 100644
index 00000000..f8442728
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/el.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Ψηφιακή κάμερα"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Ρύθμιση Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;κάμερα;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/eo.po b/translations/desktop_files/kamera.desktop/eo.po
new file mode 100644
index 00000000..bc68e33c
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/eo.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Cifereca fotilo"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Agordu fotilon"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamerao;fotilo;cifereca fotilo;TTT-fotilo;"
diff --git a/translations/desktop_files/kamera.desktop/es.po b/translations/desktop_files/kamera.desktop/es.po
new file mode 100644
index 00000000..67e48a86
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/es.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Cámara digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configura Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;cámara;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/et.po b/translations/desktop_files/kamera.desktop/et.po
new file mode 100644
index 00000000..671187c4
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/et.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitaalkaamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kaamera seadistamine"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kaamera;digitaalkaamera;veebikaamera;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/eu.po b/translations/desktop_files/kamera.desktop/eu.po
new file mode 100644
index 00000000..e870883f
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/eu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Kamera digitala"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Konfiguratu Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/fa.po b/translations/desktop_files/kamera.desktop/fa.po
new file mode 100644
index 00000000..c96eb90c
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/fa.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "دوربین رقمی"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "پیکربندی Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto، دوربین، دوربین رقمی، دوربین وب، kamera;"
diff --git a/translations/desktop_files/kamera.desktop/fi.po b/translations/desktop_files/kamera.desktop/fi.po
new file mode 100644
index 00000000..0b9edbfd
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/fi.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitaalikamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kameran asetukset"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;webcam;"
diff --git a/translations/desktop_files/kamera.desktop/fr.po b/translations/desktop_files/kamera.desktop/fr.po
new file mode 100644
index 00000000..0e18054d
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/fr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Appareil photo numérique"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configuration de Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;caméscope;caméra;appareil photo;"
diff --git a/translations/desktop_files/kamera.desktop/ga.po b/translations/desktop_files/kamera.desktop/ga.po
new file mode 100644
index 00000000..2242dc1e
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ga.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Ceamara Digiteach"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Cumraigh Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/gl.po b/translations/desktop_files/kamera.desktop/gl.po
new file mode 100644
index 00000000..323f8037
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/gl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Cámara dixital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configurar Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/he.po b/translations/desktop_files/kamera.desktop/he.po
new file mode 100644
index 00000000..3cc1c6f4
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/he.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "מצלמה דיגיטלית"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "שינוי הגדרות Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;מצלמה;מצלמת רשת;מצלמה דיגיטלית; amera;digicam;webcam;"
diff --git a/translations/desktop_files/kamera.desktop/hi.po b/translations/desktop_files/kamera.desktop/hi.po
new file mode 100644
index 00000000..ad076c21
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/hi.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "डिजिटल कैमरा"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "कॉन्फ़िगर केमरा"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "जीफोटो;केमरा;डिजिकेम;वेबकेम;केमरा;"
diff --git a/translations/desktop_files/kamera.desktop/hr.po b/translations/desktop_files/kamera.desktop/hr.po
new file mode 100644
index 00000000..46e4a4b1
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/hr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalna kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Podesi Kameru"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/hu.po b/translations/desktop_files/kamera.desktop/hu.po
new file mode 100644
index 00000000..a9dd3877
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/hu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitális fényképezőgép"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "A digitális fényképezőgépek beállításai"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;fényképezőgép;digitális fényképezőgép;webkamera;videókamera;"
diff --git a/translations/desktop_files/kamera.desktop/id.po b/translations/desktop_files/kamera.desktop/id.po
new file mode 100644
index 00000000..48ef38fd
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/id.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr ""
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Konfigurasi kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/is.po b/translations/desktop_files/kamera.desktop/is.po
new file mode 100644
index 00000000..41072da6
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/is.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Stafræn myndavél"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Stilla samskiptaforrit stafrænna myndavéla (Kamera)"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;myndavél;stafræn myndavél;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/it.po b/translations/desktop_files/kamera.desktop/it.po
new file mode 100644
index 00000000..9de93b11
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/it.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Macchina fotografica digitale"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configura Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;fotocamera;macchina fotografica digitale;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/ja.po b/translations/desktop_files/kamera.desktop/ja.po
new file mode 100644
index 00000000..05f44dc4
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ja.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "デジタルカメラ"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "カメラの設定"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;カメラ;デジカム;ウェブカム;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/kamera.desktop.pot b/translations/desktop_files/kamera.desktop/kamera.desktop.pot
new file mode 100644
index 00000000..a60f5cdc
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/kamera.desktop.pot
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr ""
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr ""
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/kk.po b/translations/desktop_files/kamera.desktop/kk.po
new file mode 100644
index 00000000..4e91ccc0
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/kk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Цифрлық камера"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kamera баптаулары"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/km.po b/translations/desktop_files/kamera.desktop/km.po
new file mode 100644
index 00000000..00c2ae5d
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/km.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "ម៉ាស៊ីន​ថតរូប​ឌីជីថល"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "កំណត់​រចនាសម្ព័ន្ធ Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;ម៉ាស៊ីន​ថត​រូប;digicam;ម៉ាស៊ីនថត​តាម​បណ្ដាញ;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/ko.po b/translations/desktop_files/kamera.desktop/ko.po
new file mode 100644
index 00000000..b5903bfc
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ko.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr ""
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "카메라 설정"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;사진;카메라;사진기;웹캠;"
diff --git a/translations/desktop_files/kamera.desktop/lt.po b/translations/desktop_files/kamera.desktop/lt.po
new file mode 100644
index 00000000..32e347d4
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/lt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Skaitmeninė kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Konfigūruoti Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/lv.po b/translations/desktop_files/kamera.desktop/lv.po
new file mode 100644
index 00000000..5cc31f65
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/lv.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitālā Kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr ""
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gfoto;camera;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/mk.po b/translations/desktop_files/kamera.desktop/mk.po
new file mode 100644
index 00000000..c598c73f
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/mk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Дигитална камера"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Конфигурирајте ја Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/ms.po b/translations/desktop_files/kamera.desktop/ms.po
new file mode 100644
index 00000000..9adea550
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ms.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Kamera Digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Konfigurasi Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/mt.po b/translations/desktop_files/kamera.desktop/mt.po
new file mode 100644
index 00000000..ec93f086
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/mt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Kamera diġitali"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Ikkonfigura Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/nb.po b/translations/desktop_files/kamera.desktop/nb.po
new file mode 100644
index 00000000..da1cb5a7
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/nb.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalkamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Tilpass Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;webcam;webkamera;"
diff --git a/translations/desktop_files/kamera.desktop/nds.po b/translations/desktop_files/kamera.desktop/nds.po
new file mode 100644
index 00000000..f26cc073
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/nds.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitaalkamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kamera instellen"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;Kamera;Webcam;Kamera;Nettkamera;"
diff --git a/translations/desktop_files/kamera.desktop/ne.po b/translations/desktop_files/kamera.desktop/ne.po
new file mode 100644
index 00000000..002718cd
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ne.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "डिजिटल क्यामेरा"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "क्यामेरा कन्फिगर गर्नुहोस्"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "जी फोटो; क्यामेरा; डिजिक्याम; वेबक्याम; कामेरा;"
diff --git a/translations/desktop_files/kamera.desktop/nl.po b/translations/desktop_files/kamera.desktop/nl.po
new file mode 100644
index 00000000..a8b9b730
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/nl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitale camera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Camera instellen"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;foto;"
diff --git a/translations/desktop_files/kamera.desktop/nn.po b/translations/desktop_files/kamera.desktop/nn.po
new file mode 100644
index 00000000..6fccd4bc
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/nn.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalkamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Set opp Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;fotoapparat;digitalt kamera;webkamera;vevkamera;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/nso.po b/translations/desktop_files/kamera.desktop/nso.po
new file mode 100644
index 00000000..8a70b91f
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/nso.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Camera ya Digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Beakanya Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/pa.po b/translations/desktop_files/kamera.desktop/pa.po
new file mode 100644
index 00000000..5c0e6cfa
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/pa.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "ਡਿਜ਼ੀਟਲ ਕੈਮਰਾ"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "ਕੈਮਰਾ ਸੰਰਚਨਾ"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/pl.po b/translations/desktop_files/kamera.desktop/pl.po
new file mode 100644
index 00000000..e14349bc
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/pl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Aparat cyfrowy"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Konfiguracja Kamery"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;kamera cyfrowa;kamera sieciowa;"
diff --git a/translations/desktop_files/kamera.desktop/pt.po b/translations/desktop_files/kamera.desktop/pt.po
new file mode 100644
index 00000000..4c4b4107
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/pt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Máquina Fotográfica Digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configuração do Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;câmara;digicam;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/pt_BR.po b/translations/desktop_files/kamera.desktop/pt_BR.po
new file mode 100644
index 00000000..d2687904
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/pt_BR.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Câmera Digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configurar Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;câmera;câmera digital;webcam;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/ro.po b/translations/desktop_files/kamera.desktop/ro.po
new file mode 100644
index 00000000..d56d8912
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ro.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Aparat foto digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Configurează aparatul foto digital"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;aparat;foto;digicam;webcam;camera;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/ru.po b/translations/desktop_files/kamera.desktop/ru.po
new file mode 100644
index 00000000..9a1edb48
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ru.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Цифровая камера"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Настройка камеры"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;камера;фото;"
diff --git a/translations/desktop_files/kamera.desktop/se.po b/translations/desktop_files/kamera.desktop/se.po
new file mode 100644
index 00000000..53614dae
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/se.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalalaš govvenapperáhtta"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Heivet govvenapperáhta"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/sk.po b/translations/desktop_files/kamera.desktop/sk.po
new file mode 100644
index 00000000..3e16b5c9
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/sk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitálny fotoaparát"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Nastaviť program Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/sl.po b/translations/desktop_files/kamera.desktop/sl.po
new file mode 100644
index 00000000..cc55341b
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/sl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalni fotoaparat"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Nastavitve fotoaparata"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;webcam;foto;fotoaparat;spletna kamera;"
diff --git a/translations/desktop_files/kamera.desktop/sr.po b/translations/desktop_files/kamera.desktop/sr.po
new file mode 100644
index 00000000..9b27c90e
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/sr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Дигитална камера"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Подеси Kamera-у"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;камера;"
diff --git a/translations/desktop_files/kamera.desktop/sr@Latn.po b/translations/desktop_files/kamera.desktop/sr@Latn.po
new file mode 100644
index 00000000..b1a808e0
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/sr@Latn.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalna kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Podesi Kamera-u"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/sv.po b/translations/desktop_files/kamera.desktop/sv.po
new file mode 100644
index 00000000..a1d02695
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/sv.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digitalkamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Anpassa kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digital kamera;webbkamera;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/ta.po b/translations/desktop_files/kamera.desktop/ta.po
new file mode 100644
index 00000000..88622c4d
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ta.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Digital Camera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "காமிராவை அமை"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "ஜிபோட்டோ; காமிரா; டிஜிகேம்;வலைதள காமிரா; காமிரா;"
diff --git a/translations/desktop_files/kamera.desktop/tg.po b/translations/desktop_files/kamera.desktop/tg.po
new file mode 100644
index 00000000..cd8e1246
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/tg.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Камераи digital"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Танзимоти камера"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;камера;фото;"
diff --git a/translations/desktop_files/kamera.desktop/th.po b/translations/desktop_files/kamera.desktop/th.po
new file mode 100644
index 00000000..a97758f7
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/th.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "กล้องดิจิตอล"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "ปรับแต่ง Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/tr.po b/translations/desktop_files/kamera.desktop/tr.po
new file mode 100644
index 00000000..7f4af9e7
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/tr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Sayısal Kamera"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Kamera'yı Yapılandır"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;kamera;digicam;web kamera;Kamera;webcam;"
diff --git a/translations/desktop_files/kamera.desktop/uk.po b/translations/desktop_files/kamera.desktop/uk.po
new file mode 100644
index 00000000..f6d5f201
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/uk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Цифровий фотоапарат"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Налаштувати Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;камера;цифрова камера;камера Тенет;kamera;"
diff --git a/translations/desktop_files/kamera.desktop/uz.po b/translations/desktop_files/kamera.desktop/uz.po
new file mode 100644
index 00000000..027adecc
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/uz.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Fotoaparat"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Fotoaparatni moslash"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/uz@cyrillic.po b/translations/desktop_files/kamera.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..9c743fff
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/uz@cyrillic.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Фотоапарат"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Фотоапаратни мослаш"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/ven.po b/translations/desktop_files/kamera.desktop/ven.po
new file mode 100644
index 00000000..dcdaf77e
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/ven.po
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Tshau dzhia zwifanyiso tsha didzhithala"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Dzudzanya kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
+"Tshinepe tsha g;Tshaudzhia zwifanyiso;digicam;webcam;Tshaudzhiazwifanyiso;"
diff --git a/translations/desktop_files/kamera.desktop/xh.po b/translations/desktop_files/kamera.desktop/xh.po
new file mode 100644
index 00000000..d4101994
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/xh.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Ikhamera Yesuntswana"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Qwalasela Umfoti"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;umfoti;digicam;webcam;umfoti;"
diff --git a/translations/desktop_files/kamera.desktop/zh_CN.po b/translations/desktop_files/kamera.desktop/zh_CN.po
new file mode 100644
index 00000000..058e3b70
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/zh_CN.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "数码相机"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "配置 Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;照相机;数码相机;摄像头;"
diff --git a/translations/desktop_files/kamera.desktop/zh_HK.po b/translations/desktop_files/kamera.desktop/zh_HK.po
new file mode 100644
index 00000000..4e889ca8
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/zh_HK.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "數碼相機"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "設定 Kamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr ""
diff --git a/translations/desktop_files/kamera.desktop/zh_TW.po b/translations/desktop_files/kamera.desktop/zh_TW.po
new file mode 100644
index 00000000..6a07172c
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/zh_TW.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "數位相機"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "設定照相機"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;camera;digicam;webcam;kamera;照相機;"
diff --git a/translations/desktop_files/kamera.desktop/zu.po b/translations/desktop_files/kamera.desktop/zu.po
new file mode 100644
index 00000000..9e998443
--- /dev/null
+++ b/translations/desktop_files/kamera.desktop/zu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:48+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kamera.desktop:2
+msgid "Digital Camera"
+msgstr "Ikhamera ebonisa inani ngalinye"
+
+#. Comment
+#: kamera.desktop:3
+msgid "Configure Kamera"
+msgstr "Hlanganisa ikhamera"
+
+#. Keywords
+#: kamera.desktop:4
+msgid "gphoto;camera;digicam;webcam;kamera;"
+msgstr "gphoto;ikhamera;digicam;webcam;ikhamera;"
diff --git a/translations/desktop_files/kcoloredit-desktops/af.po b/translations/desktop_files/kcoloredit-desktops/af.po
new file mode 100644
index 00000000..87533529
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/af.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Kleur Kieser"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "K-kleur-kieser"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Kleur Palet Redigeerder"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "K-kleur-redigeer"
diff --git a/translations/desktop_files/kcoloredit-desktops/ar.po b/translations/desktop_files/kcoloredit-desktops/ar.po
new file mode 100644
index 00000000..da0d34f5
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ar.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "برنامج اختيار الألوان"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "برنامج KColorChooser"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "محرر لوحة الألوان"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "برنامج KColorEdit"
diff --git a/translations/desktop_files/kcoloredit-desktops/bg.po b/translations/desktop_files/kcoloredit-desktops/bg.po
new file mode 100644
index 00000000..33f6be13
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/bg.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Избор на цвят"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Избор на цвят"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Редактор на цветове"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Редактор на цветове"
diff --git a/translations/desktop_files/kcoloredit-desktops/br.po b/translations/desktop_files/kcoloredit-desktops/br.po
new file mode 100644
index 00000000..ee7f4e66
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/br.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Dibaber livioù"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Dibaber livioù"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Aozer livaoueg"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Aozer livaoueg"
diff --git a/translations/desktop_files/kcoloredit-desktops/bs.po b/translations/desktop_files/kcoloredit-desktops/bs.po
new file mode 100644
index 00000000..1270bee3
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/bs.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Izbornik boja"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Izbornik boja"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor palete boja"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor palete boja"
diff --git a/translations/desktop_files/kcoloredit-desktops/ca.po b/translations/desktop_files/kcoloredit-desktops/ca.po
new file mode 100644
index 00000000..25ba549c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ca.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Elecció de colors"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Elecció de colors"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor de la paleta de colors"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor de la paleta de colors"
diff --git a/translations/desktop_files/kcoloredit-desktops/cs.po b/translations/desktop_files/kcoloredit-desktops/cs.po
new file mode 100644
index 00000000..3f3eba90
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/cs.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Výběr barev"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Výběr barev"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor palety barev"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Editor barev"
diff --git a/translations/desktop_files/kcoloredit-desktops/cy.po b/translations/desktop_files/kcoloredit-desktops/cy.po
new file mode 100644
index 00000000..e14d6184
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/cy.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Dewis Lliwiau"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KDewisLliw"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Golygydd Palet Lliwiau"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KGolyguLliw"
diff --git a/translations/desktop_files/kcoloredit-desktops/da.po b/translations/desktop_files/kcoloredit-desktops/da.po
new file mode 100644
index 00000000..fd1aca4c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/da.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Farvevælger"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Farvevælger"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Farvepaletredigering"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Farvepaletredigering"
diff --git a/translations/desktop_files/kcoloredit-desktops/de.po b/translations/desktop_files/kcoloredit-desktops/de.po
new file mode 100644
index 00000000..c0f776f6
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/de.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Farbauswahl"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Farbauswahl"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor für Farbpaletten"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor für Farbpaletten"
diff --git a/translations/desktop_files/kcoloredit-desktops/el.po b/translations/desktop_files/kcoloredit-desktops/el.po
new file mode 100644
index 00000000..281c6b18
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/el.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Επιλογέας χρωμάτων"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Επιλογέας χρωμάτων"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Επεξεργαστής παλέτας χρωμάτων"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Επεξεργαστής παλέτας χρωμάτων"
diff --git a/translations/desktop_files/kcoloredit-desktops/en_GB.po b/translations/desktop_files/kcoloredit-desktops/en_GB.po
new file mode 100644
index 00000000..33b313bd
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/en_GB.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: en_GB\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Colour Chooser"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Colour Chooser"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Colour Palette Editor"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Colour Palette Editor"
diff --git a/translations/desktop_files/kcoloredit-desktops/eo.po b/translations/desktop_files/kcoloredit-desktops/eo.po
new file mode 100644
index 00000000..369ddde8
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/eo.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Ilo por elekti koloron"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Kolorelektilo"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Paletroredaktilo"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Kolorredaktilo"
diff --git a/translations/desktop_files/kcoloredit-desktops/es.po b/translations/desktop_files/kcoloredit-desktops/es.po
new file mode 100644
index 00000000..aacad0c0
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/es.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Selector de colores"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Selector de colores"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor de paleta de color"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor de paleta de color"
diff --git a/translations/desktop_files/kcoloredit-desktops/et.po b/translations/desktop_files/kcoloredit-desktops/et.po
new file mode 100644
index 00000000..f2c5972c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/et.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Värvivalija"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Värvivalija"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Värvipaleti redaktor"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Värvipaleti redaktor"
diff --git a/translations/desktop_files/kcoloredit-desktops/eu.po b/translations/desktop_files/kcoloredit-desktops/eu.po
new file mode 100644
index 00000000..4cf82c31
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/eu.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Kolore hautatzailea"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Kolore hautatzailea"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Koloreko paleta editorea"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Koloreko paleta editorea"
diff --git a/translations/desktop_files/kcoloredit-desktops/fa.po b/translations/desktop_files/kcoloredit-desktops/fa.po
new file mode 100644
index 00000000..38ef9aa7
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/fa.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "انتخاب‌‌کنندۀ رنگ"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "انتخاب‌‌کنندۀ رنگ"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "ویرایشگر پالت رنگ"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "ویرایشگر پالت رنگ"
diff --git a/translations/desktop_files/kcoloredit-desktops/fi.po b/translations/desktop_files/kcoloredit-desktops/fi.po
new file mode 100644
index 00000000..6f6d53ec
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/fi.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Värivalitsin"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Värivalitsin"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Väripalettien muokkain"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Väripalettien muokkain"
diff --git a/translations/desktop_files/kcoloredit-desktops/fr.po b/translations/desktop_files/kcoloredit-desktops/fr.po
new file mode 100644
index 00000000..9f91daab
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/fr.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Sélecteur de couleur"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Sélecteur de couleur"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Éditeur de palette de couleurs"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Éditeur de palette de couleurs"
diff --git a/translations/desktop_files/kcoloredit-desktops/gl.po b/translations/desktop_files/kcoloredit-desktops/gl.po
new file mode 100644
index 00000000..af1af33b
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/gl.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Selecionador de cores"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Selecionador de cores"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor de paletas de cores"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor de paletas de cores"
diff --git a/translations/desktop_files/kcoloredit-desktops/he.po b/translations/desktop_files/kcoloredit-desktops/he.po
new file mode 100644
index 00000000..c27db1c5
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/he.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "בוחר צבעים"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "בוחר צבעים"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "עורך לוחות צבעים"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "עורך לוחות צבעים"
diff --git a/translations/desktop_files/kcoloredit-desktops/hi.po b/translations/desktop_files/kcoloredit-desktops/hi.po
new file mode 100644
index 00000000..4285d299
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/hi.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "रंग चयनक"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "के-कलर-चूसर"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "रंग पट्टिका संपादक"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "के-कलर-एडिट"
diff --git a/translations/desktop_files/kcoloredit-desktops/hr.po b/translations/desktop_files/kcoloredit-desktops/hr.po
new file mode 100644
index 00000000..8600edae
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/hr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Izbornik boja"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Izbornik boja"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Uređivač palete"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Uređivač boja"
diff --git a/translations/desktop_files/kcoloredit-desktops/hu.po b/translations/desktop_files/kcoloredit-desktops/hu.po
new file mode 100644
index 00000000..beebd5ef
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/hu.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Színválasztó"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Színválasztó"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Palettaszerkesztő"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Palettaszerkesztő"
diff --git a/translations/desktop_files/kcoloredit-desktops/is.po b/translations/desktop_files/kcoloredit-desktops/is.po
new file mode 100644
index 00000000..8e3ff14b
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/is.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Litavalstól"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Litaval"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Sýsla með litaspjöld"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Sýsla með litaspjöld"
diff --git a/translations/desktop_files/kcoloredit-desktops/it.po b/translations/desktop_files/kcoloredit-desktops/it.po
new file mode 100644
index 00000000..db36f14c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/it.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: 2021-05-10 07:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kcoloredit-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Selettore di colori"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KColorChooser"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor di tavolozza"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KColorEdit"
diff --git a/translations/desktop_files/kcoloredit-desktops/ja.po b/translations/desktop_files/kcoloredit-desktops/ja.po
new file mode 100644
index 00000000..a8f561e5
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ja.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "色の選択"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "色の選択"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "カラーパレットエディタ"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "カラーパレットエディタ"
diff --git a/translations/desktop_files/kcoloredit-desktops/kcoloredit-desktops.pot b/translations/desktop_files/kcoloredit-desktops/kcoloredit-desktops.pot
new file mode 100644
index 00000000..92d165ed
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/kcoloredit-desktops.pot
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr ""
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr ""
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr ""
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr ""
diff --git a/translations/desktop_files/kcoloredit-desktops/kk.po b/translations/desktop_files/kcoloredit-desktops/kk.po
new file mode 100644
index 00000000..aefc13a6
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/kk.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Түсті таңдау"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Түсті таңдау"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Түстер палитрасын өңдеу"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Түстер палитрасын өңдеу"
diff --git a/translations/desktop_files/kcoloredit-desktops/km.po b/translations/desktop_files/kcoloredit-desktops/km.po
new file mode 100644
index 00000000..b97375fa
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/km.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "កម្មវិធី​ជ្រើស​ពណ៌"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "កម្មវិធី​ជ្រើស​ពណ៌"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "កម្មវិធី​និពន្ធ​ក្ដារ​លាយ​ពណ៌"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "កម្មវិធី​និពន្ធ​ក្ដារ​លាយ​ពណ៌"
diff --git a/translations/desktop_files/kcoloredit-desktops/lt.po b/translations/desktop_files/kcoloredit-desktops/lt.po
new file mode 100644
index 00000000..4ce0aedf
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/lt.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Spalvų parinkiklis"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Spalvų parinkiklis"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Spalvų paletės redaktorius"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Spalvų paletės redaktorius"
diff --git a/translations/desktop_files/kcoloredit-desktops/lv.po b/translations/desktop_files/kcoloredit-desktops/lv.po
new file mode 100644
index 00000000..6bc01026
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/lv.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Krāsu Izvēlētājs"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KKrāsuIzvēlētājs"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Krāsu Paletes Redaktors"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KKrāsuRedaktors"
diff --git a/translations/desktop_files/kcoloredit-desktops/mk.po b/translations/desktop_files/kcoloredit-desktops/mk.po
new file mode 100644
index 00000000..e9849315
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/mk.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Избирач на бои"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Избирач на бои"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Уредувач на палета"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Уредувач на палета"
diff --git a/translations/desktop_files/kcoloredit-desktops/ms.po b/translations/desktop_files/kcoloredit-desktops/ms.po
new file mode 100644
index 00000000..71f28da2
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ms.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Pemilih Warna"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Pemilih Warna"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor Palet Warna"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor Palet Warna"
diff --git a/translations/desktop_files/kcoloredit-desktops/mt.po b/translations/desktop_files/kcoloredit-desktops/mt.po
new file mode 100644
index 00000000..577d2535
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/mt.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Agħżel Kulur"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Agħżel Kulur"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editur tal-palett ta' kului"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editur tal-palett ta' kului"
diff --git a/translations/desktop_files/kcoloredit-desktops/nb.po b/translations/desktop_files/kcoloredit-desktops/nb.po
new file mode 100644
index 00000000..d918f40f
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/nb.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Fargevelger"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Fargevelger"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Palett-redigerer"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Palett-redigerer"
diff --git a/translations/desktop_files/kcoloredit-desktops/nds.po b/translations/desktop_files/kcoloredit-desktops/nds.po
new file mode 100644
index 00000000..4575ef28
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/nds.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Klöörutwahl"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Klöörutwahl"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Klörensett-Editor"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Klörensett-Editor"
diff --git a/translations/desktop_files/kcoloredit-desktops/ne.po b/translations/desktop_files/kcoloredit-desktops/ne.po
new file mode 100644
index 00000000..f90bdb76
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ne.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "रङ चयनकर्ता"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "केडीई रङ चयनकर्ता"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "रङदानी सम्पादक"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "केडीई रङ सम्पादन"
diff --git a/translations/desktop_files/kcoloredit-desktops/nl.po b/translations/desktop_files/kcoloredit-desktops/nl.po
new file mode 100644
index 00000000..43f657dd
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/nl.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Kleurenkiezer"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Kleurenkiezer"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Kleurenpaletbewerker"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Kleurenpaletbewerker"
diff --git a/translations/desktop_files/kcoloredit-desktops/nn.po b/translations/desktop_files/kcoloredit-desktops/nn.po
new file mode 100644
index 00000000..06360b23
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/nn.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Fargeveljar"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "TDE-fargeveljar"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Palettredigering"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Palettredigering"
diff --git a/translations/desktop_files/kcoloredit-desktops/nso.po b/translations/desktop_files/kcoloredit-desktops/nso.po
new file mode 100644
index 00000000..8ea743bd
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/nso.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+#, fuzzy
+msgid "Color Chooser"
+msgstr "KMokgethi wa Mmala"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KMokgethi wa Mmala"
+
+#. GenericName
+#: kcoloredit.desktop:8
+#, fuzzy
+msgid "Color Palette Editor"
+msgstr "KPhetoso ya Mmala"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KPhetoso ya Mmala"
diff --git a/translations/desktop_files/kcoloredit-desktops/pa.po b/translations/desktop_files/kcoloredit-desktops/pa.po
new file mode 100644
index 00000000..ea9d639e
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/pa.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "ਰੰਗ ਸੰਰਚਨਾ"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "ਕੇਰੰਗਚੋਣਕਾਰ"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "ਰੰਗ ਪੱਟੀ ਸੰਪਾਦਕ"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "ਕੇਰੰਗ ਸੰਪਾਦਕ"
diff --git a/translations/desktop_files/kcoloredit-desktops/pl.po b/translations/desktop_files/kcoloredit-desktops/pl.po
new file mode 100644
index 00000000..6879d108
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/pl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Wybór koloru"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Wybór koloru"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Edytor palety (kolorów)"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Edytor kolorów"
diff --git a/translations/desktop_files/kcoloredit-desktops/pt.po b/translations/desktop_files/kcoloredit-desktops/pt.po
new file mode 100644
index 00000000..4f42ec95
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/pt.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kcoloredit-desktop-files/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Selector de Cores"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KColorChooser"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor de Paletas de Cores"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KColorEdit"
diff --git a/translations/desktop_files/kcoloredit-desktops/pt_BR.po b/translations/desktop_files/kcoloredit-desktops/pt_BR.po
new file mode 100644
index 00000000..4c127f27
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/pt_BR.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Seletor de Cores"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KSeletor de Cores"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor de Paleta de Cores"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KEditor de Cores"
diff --git a/translations/desktop_files/kcoloredit-desktops/ro.po b/translations/desktop_files/kcoloredit-desktops/ro.po
new file mode 100644
index 00000000..f615aa75
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ro.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Selector de culori"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Selector culori"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor paletă de culori"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Editor culori"
diff --git a/translations/desktop_files/kcoloredit-desktops/ru.po b/translations/desktop_files/kcoloredit-desktops/ru.po
new file mode 100644
index 00000000..f73fbcab
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ru.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Выбор цвета"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Выбор цвета"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Редактор палитры"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Редактор палитры"
diff --git a/translations/desktop_files/kcoloredit-desktops/se.po b/translations/desktop_files/kcoloredit-desktops/se.po
new file mode 100644
index 00000000..64de0b0f
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/se.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Ivdneválljejeaddji"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "TDE-ivdneválljejeaddji"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Ivdnepaleahta doaimmaheaddji"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Ivdnepaleahta doaimmaheaddji"
diff --git a/translations/desktop_files/kcoloredit-desktops/sk.po b/translations/desktop_files/kcoloredit-desktops/sk.po
new file mode 100644
index 00000000..0c049153
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/sk.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Výber farieb"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Výber farieb"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Editor palety farieb"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Editor palety farieb"
diff --git a/translations/desktop_files/kcoloredit-desktops/sl.po b/translations/desktop_files/kcoloredit-desktops/sl.po
new file mode 100644
index 00000000..307a7085
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/sl.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Izbirnik barv"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Izbirnik barv"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Urejevalnik barvne palete"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Urejevalnik barvne palete"
diff --git a/translations/desktop_files/kcoloredit-desktops/sr.po b/translations/desktop_files/kcoloredit-desktops/sr.po
new file mode 100644
index 00000000..91ed709b
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/sr.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Бирач боја"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Бирач боја"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Уређивач палете боја"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Уређивач палете боја"
diff --git a/translations/desktop_files/kcoloredit-desktops/sr@Latn.po b/translations/desktop_files/kcoloredit-desktops/sr@Latn.po
new file mode 100644
index 00000000..17c4b74d
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/sr@Latn.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Birač boja"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Birač boja"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Uređivač palete boja"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Uređivač palete boja"
diff --git a/translations/desktop_files/kcoloredit-desktops/sv.po b/translations/desktop_files/kcoloredit-desktops/sv.po
new file mode 100644
index 00000000..e338d84a
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/sv.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Färgväljare"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Kcolorchooser"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Färgpaletteditor"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Kcoloredit"
diff --git a/translations/desktop_files/kcoloredit-desktops/ta.po b/translations/desktop_files/kcoloredit-desktops/ta.po
new file mode 100644
index 00000000..676bab36
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ta.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "வண்ணத் தேர்வு"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "கேவண்ணத் தேர்வு"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "வண்ணகளஞ்சியம்"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "கேவண்ணம் திருத்தம்"
diff --git a/translations/desktop_files/kcoloredit-desktops/tg.po b/translations/desktop_files/kcoloredit-desktops/tg.po
new file mode 100644
index 00000000..b305865c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/tg.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Интихоби ранг"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Интихоби ранг"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Муҳаррири палитра"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Муҳаррири палитра"
diff --git a/translations/desktop_files/kcoloredit-desktops/th.po b/translations/desktop_files/kcoloredit-desktops/th.po
new file mode 100644
index 00000000..7521e42c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/th.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "เครื่องมือเลือกสีของ TDE"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "เครื่องมือเลือกสี - K"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "เครื่องมือแก้ไขจานสีของ TDE"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "แก้ไขค่าสี - K"
diff --git a/translations/desktop_files/kcoloredit-desktops/tr.po b/translations/desktop_files/kcoloredit-desktops/tr.po
new file mode 100644
index 00000000..e0b883dd
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/tr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Renk Seçici"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "K Renk Seçici"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Renk Paleti Düzenleyici"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "K Renk Düzenleyici"
diff --git a/translations/desktop_files/kcoloredit-desktops/uk.po b/translations/desktop_files/kcoloredit-desktops/uk.po
new file mode 100644
index 00000000..85dd0925
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/uk.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kcoloredit-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Селектор кольорів"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Селектор кольорів"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Редактор палітри кольорів"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KColorEdit"
diff --git a/translations/desktop_files/kcoloredit-desktops/uz.po b/translations/desktop_files/kcoloredit-desktops/uz.po
new file mode 100644
index 00000000..f0946c72
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/uz.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Rang tanlovchi"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Rang tanlovchi"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr ""
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr ""
diff --git a/translations/desktop_files/kcoloredit-desktops/uz@cyrillic.po b/translations/desktop_files/kcoloredit-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..deb666da
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/uz@cyrillic.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Ранг танловчи"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Ранг танловчи"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr ""
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr ""
diff --git a/translations/desktop_files/kcoloredit-desktops/ven.po b/translations/desktop_files/kcoloredit-desktops/ven.po
new file mode 100644
index 00000000..ab70bf3d
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/ven.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Munangi wa Muvhala"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Tshinangi tsha muvhala tsha K"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Musengulusi wa phalete ya muvhala"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "U sengulusa muvhala ha K"
diff --git a/translations/desktop_files/kcoloredit-desktops/wa.po b/translations/desktop_files/kcoloredit-desktops/wa.po
new file mode 100644
index 00000000..eb5c01c6
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/wa.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Tchoezixheu di coleurs"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "Tchoezixheu di coleurs"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Aspougneu del palete di coleurs"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "Aspougneu del palete di coleurs"
diff --git a/translations/desktop_files/kcoloredit-desktops/xh.po b/translations/desktop_files/kcoloredit-desktops/xh.po
new file mode 100644
index 00000000..960871a2
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/xh.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Mkhethi Wombala"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Umkhethi Wombala i K"
+
+#. GenericName
+#: kcoloredit.desktop:8
+#, fuzzy
+msgid "Color Palette Editor"
+msgstr "Umhleli Wombala ye K"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Umhleli Wombala ye K"
diff --git a/translations/desktop_files/kcoloredit-desktops/zh_CN.po b/translations/desktop_files/kcoloredit-desktops/zh_CN.po
new file mode 100644
index 00000000..5564bbe3
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/zh_CN.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "颜色选择程序"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "颜色选择程序"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "调色板编辑器"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "调色板编辑器"
diff --git a/translations/desktop_files/kcoloredit-desktops/zh_HK.po b/translations/desktop_files/kcoloredit-desktops/zh_HK.po
new file mode 100644
index 00000000..9d52676c
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/zh_HK.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "顏色選擇器"
+
+#. Name
+#: kcolorchooser.desktop:9
+#, fuzzy
+msgid "KColorChooser"
+msgstr "顏色選擇器"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "調色板編輯器"
+
+#. Name
+#: kcoloredit.desktop:9
+#, fuzzy
+msgid "KColorEdit"
+msgstr "調色板編輯器"
diff --git a/translations/desktop_files/kcoloredit-desktops/zh_TW.po b/translations/desktop_files/kcoloredit-desktops/zh_TW.po
new file mode 100644
index 00000000..927c6d12
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/zh_TW.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "顏色選擇程式"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "KColorChooser 顏色選擇器"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "調色板編輯器"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "KColorEdit 顏色編輯器"
diff --git a/translations/desktop_files/kcoloredit-desktops/zu.po b/translations/desktop_files/kcoloredit-desktops/zu.po
new file mode 100644
index 00000000..5a61ea0b
--- /dev/null
+++ b/translations/desktop_files/kcoloredit-desktops/zu.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 22:52+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kcolorchooser.desktop:8
+msgid "Color Chooser"
+msgstr "Umkhethi Wombala"
+
+#. Name
+#: kcolorchooser.desktop:9
+msgid "KColorChooser"
+msgstr "Umkhethi Wombala ka K"
+
+#. GenericName
+#: kcoloredit.desktop:8
+msgid "Color Palette Editor"
+msgstr "Umhleli Wombala we Palette"
+
+#. Name
+#: kcoloredit.desktop:9
+msgid "KColorEdit"
+msgstr "Umhleli Wombala ka K"
diff --git a/translations/desktop_files/kdvi-desktops/af.po b/translations/desktop_files/kdvi-desktops/af.po
new file mode 100644
index 00000000..bab55cde
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/af.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Dvi Aansig"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "Kdvi"
+
+#. Comment
+#: kdvimultipage.desktop:3
+#, fuzzy
+msgid "DVI"
+msgstr "Kdvi"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ar.po b/translations/desktop_files/kdvi-desktops/ar.po
new file mode 100644
index 00000000..642084d2
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ar.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "عارض ملفات DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "برنامج KDVI"
+
+#. Comment
+#: kdvimultipage.desktop:3
+#, fuzzy
+msgid "DVI"
+msgstr "برنامج KDVI"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/az.po b/translations/desktop_files/kdvi-desktops/az.po
new file mode 100644
index 00000000..2e1bc107
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/az.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI Nümayişçisi"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/bg.po b/translations/desktop_files/kdvi-desktops/bg.po
new file mode 100644
index 00000000..7f6b0036
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/bg.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Преглед на документи DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/br.po b/translations/desktop_files/kdvi-desktops/br.po
new file mode 100644
index 00000000..d3e9a315
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/br.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Gweler DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/bs.po b/translations/desktop_files/kdvi-desktops/bs.po
new file mode 100644
index 00000000..e647cce9
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/bs.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Preglednik DVI dokumenata"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ca.po b/translations/desktop_files/kdvi-desktops/ca.po
new file mode 100644
index 00000000..75d3d9f1
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ca.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Visualitzador de DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/cs.po b/translations/desktop_files/kdvi-desktops/cs.po
new file mode 100644
index 00000000..633064ce
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/cs.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Prohlížeč DVI souborů"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/cy.po b/translations/desktop_files/kdvi-desktops/cy.po
new file mode 100644
index 00000000..6cfb92c4
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/cy.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Gwelydd DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/da.po b/translations/desktop_files/kdvi-desktops/da.po
new file mode 100644
index 00000000..ba14dbe4
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/da.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-fremviser"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/de.po b/translations/desktop_files/kdvi-desktops/de.po
new file mode 100644
index 00000000..66af2bad
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/de.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-Betrachter"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/el.po b/translations/desktop_files/kdvi-desktops/el.po
new file mode 100644
index 00000000..e023ecb4
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/el.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Προβολέας DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/eo.po b/translations/desktop_files/kdvi-desktops/eo.po
new file mode 100644
index 00000000..1843bc65
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/eo.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-rigardilo"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "DVI-rigardilo"
+
+#. Comment
+#: kdvimultipage.desktop:3
+#, fuzzy
+msgid "DVI"
+msgstr "DVI-rigardilo"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/es.po b/translations/desktop_files/kdvi-desktops/es.po
new file mode 100644
index 00000000..350d4162
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/es.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Visor de documentos DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVIMultiPágina"
diff --git a/translations/desktop_files/kdvi-desktops/et.po b/translations/desktop_files/kdvi-desktops/et.po
new file mode 100644
index 00000000..1e94b5fc
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/et.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI failide vaataja"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/eu.po b/translations/desktop_files/kdvi-desktops/eu.po
new file mode 100644
index 00000000..de319ebb
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/eu.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI ikustailea"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/fa.po b/translations/desktop_files/kdvi-desktops/fa.po
new file mode 100644
index 00000000..1fbfc861
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/fa.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "مشاهده‌گر DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/fi.po b/translations/desktop_files/kdvi-desktops/fi.po
new file mode 100644
index 00000000..3ab2d9b0
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/fi.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-näytin"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/fr.po b/translations/desktop_files/kdvi-desktops/fr.po
new file mode 100644
index 00000000..8a8bf86c
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/fr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Afficheur DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "Multi-page KDVI"
diff --git a/translations/desktop_files/kdvi-desktops/ga.po b/translations/desktop_files/kdvi-desktops/ga.po
new file mode 100644
index 00000000..fa5df359
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ga.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Amharcán DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/gl.po b/translations/desktop_files/kdvi-desktops/gl.po
new file mode 100644
index 00000000..10fed16c
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/gl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Visor de DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/he.po b/translations/desktop_files/kdvi-desktops/he.po
new file mode 100644
index 00000000..a5f844cf
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/he.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "מציג DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/hi.po b/translations/desktop_files/kdvi-desktops/hi.po
new file mode 100644
index 00000000..af117c35
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/hi.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "डीवीआई प्रदर्शक"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "के-डीवीआई"
+
+#. Comment
+#: kdvimultipage.desktop:3
+#, fuzzy
+msgid "DVI"
+msgstr "के-डीवीआई"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/hr.po b/translations/desktop_files/kdvi-desktops/hr.po
new file mode 100644
index 00000000..c9e5c7ce
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/hr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Preglednik DVI dokumenata"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/hu.po b/translations/desktop_files/kdvi-desktops/hu.po
new file mode 100644
index 00000000..5dbfcfac
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/hu.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-nézegető"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVITöbbOldalas"
diff --git a/translations/desktop_files/kdvi-desktops/id.po b/translations/desktop_files/kdvi-desktops/id.po
new file mode 100644
index 00000000..f87f9ad1
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/id.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Viewer DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/is.po b/translations/desktop_files/kdvi-desktops/is.po
new file mode 100644
index 00000000..555e7d18
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/is.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI sjá"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/it.po b/translations/desktop_files/kdvi-desktops/it.po
new file mode 100644
index 00000000..12b78ff4
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/it.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: 2021-05-10 07:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kdvi-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Visore DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "KDVI"
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr "DVI"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVIMultiPage"
diff --git a/translations/desktop_files/kdvi-desktops/ja.po b/translations/desktop_files/kdvi-desktops/ja.po
new file mode 100644
index 00000000..f57b7ce5
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ja.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI ビューア"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/kdvi-desktops.pot b/translations/desktop_files/kdvi-desktops/kdvi-desktops.pot
new file mode 100644
index 00000000..69d65884
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/kdvi-desktops.pot
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr ""
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/kk.po b/translations/desktop_files/kdvi-desktops/kk.po
new file mode 100644
index 00000000..05345b42
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/kk.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI файлдарын қарау"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/km.po b/translations/desktop_files/kdvi-desktops/km.po
new file mode 100644
index 00000000..03900b9c
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/km.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "កម្មវិធី​មើល DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ko.po b/translations/desktop_files/kdvi-desktops/ko.po
new file mode 100644
index 00000000..f218214c
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ko.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI 보기"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/lt.po b/translations/desktop_files/kdvi-desktops/lt.po
new file mode 100644
index 00000000..6ed19746
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/lt.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI Žiūriklis"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/lv.po b/translations/desktop_files/kdvi-desktops/lv.po
new file mode 100644
index 00000000..6f9ed75c
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/lv.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI Skatītājs"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/mk.po b/translations/desktop_files/kdvi-desktops/mk.po
new file mode 100644
index 00000000..3e0c0b17
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/mk.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Прикажувач на DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ms.po b/translations/desktop_files/kdvi-desktops/ms.po
new file mode 100644
index 00000000..369f08e7
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ms.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Pemapar DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/mt.po b/translations/desktop_files/kdvi-desktops/mt.po
new file mode 100644
index 00000000..685d0a4a
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/mt.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Werrej DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/nb.po b/translations/desktop_files/kdvi-desktops/nb.po
new file mode 100644
index 00000000..6ee11ab2
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/nb.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-fremviser"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVI Flerside"
diff --git a/translations/desktop_files/kdvi-desktops/nds.po b/translations/desktop_files/kdvi-desktops/nds.po
new file mode 100644
index 00000000..58e9d356
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/nds.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-Kieker"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ne.po b/translations/desktop_files/kdvi-desktops/ne.po
new file mode 100644
index 00000000..42b5f2fe
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ne.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI दर्शक"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "केडीभीआई बहुपृष्ठ"
diff --git a/translations/desktop_files/kdvi-desktops/nl.po b/translations/desktop_files/kdvi-desktops/nl.po
new file mode 100644
index 00000000..d7cff0d6
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/nl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-weergaveprogramma"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVIMultiPagina"
diff --git a/translations/desktop_files/kdvi-desktops/nn.po b/translations/desktop_files/kdvi-desktops/nn.po
new file mode 100644
index 00000000..cddf2d8c
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/nn.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-lesar"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVI-fleirside"
diff --git a/translations/desktop_files/kdvi-desktops/pa.po b/translations/desktop_files/kdvi-desktops/pa.po
new file mode 100644
index 00000000..197effce
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/pa.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI ਦਰਸ਼ਕ"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/pl.po b/translations/desktop_files/kdvi-desktops/pl.po
new file mode 100644
index 00000000..ccd88fb0
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/pl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Przeglądarka plików DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/pt.po b/translations/desktop_files/kdvi-desktops/pt.po
new file mode 100644
index 00000000..f09efed2
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/pt.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kdvi-desktop-files/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Visualizador de DVIs"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "KDVI"
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr "DVI"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVIMultiPágina"
diff --git a/translations/desktop_files/kdvi-desktops/pt_BR.po b/translations/desktop_files/kdvi-desktops/pt_BR.po
new file mode 100644
index 00000000..44b0b9a1
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/pt_BR.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Visualizador de DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ro.po b/translations/desktop_files/kdvi-desktops/ro.po
new file mode 100644
index 00000000..6baa5ddf
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ro.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Vizualizor DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVI Pagini Multiple"
diff --git a/translations/desktop_files/kdvi-desktops/ru.po b/translations/desktop_files/kdvi-desktops/ru.po
new file mode 100644
index 00000000..6771b6ee
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ru.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Просмотр файлов DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/rw.po b/translations/desktop_files/kdvi-desktops/rw.po
new file mode 100644
index 00000000..a8476ddc
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/rw.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Ikigaragaza DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/se.po b/translations/desktop_files/kdvi-desktops/se.po
new file mode 100644
index 00000000..b70ecf72
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/se.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI čájeheaddji"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/sk.po b/translations/desktop_files/kdvi-desktops/sk.po
new file mode 100644
index 00000000..d41c50d7
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/sk.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Prehliadač DVI súborov"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/sl.po b/translations/desktop_files/kdvi-desktops/sl.po
new file mode 100644
index 00000000..90f25bb9
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/sl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Pregledovalnik datotek DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/sr.po b/translations/desktop_files/kdvi-desktops/sr.po
new file mode 100644
index 00000000..769348ae
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/sr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI приказивач"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/sr@Latn.po b/translations/desktop_files/kdvi-desktops/sr@Latn.po
new file mode 100644
index 00000000..117ebe87
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/sr@Latn.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI prikazivač"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/sv.po b/translations/desktop_files/kdvi-desktops/sv.po
new file mode 100644
index 00000000..95c3c7dd
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/sv.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI-visare"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVI flera sidor"
diff --git a/translations/desktop_files/kdvi-desktops/ta.po b/translations/desktop_files/kdvi-desktops/ta.po
new file mode 100644
index 00000000..e5c49395
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ta.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI காட்சி"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/tg.po b/translations/desktop_files/kdvi-desktops/tg.po
new file mode 100644
index 00000000..42578f9e
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/tg.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Намоиши файли DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/th.po b/translations/desktop_files/kdvi-desktops/th.po
new file mode 100644
index 00000000..4634c6d0
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/th.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "ตัวแสดงผล DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/tr.po b/translations/desktop_files/kdvi-desktops/tr.po
new file mode 100644
index 00000000..4dca2db1
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/tr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI Görüntüleyici"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/uk.po b/translations/desktop_files/kdvi-desktops/uk.po
new file mode 100644
index 00000000..3a462dbf
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/uk.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kdvi-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Переглядач DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "KDVI"
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr "DVI"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr "KDVIMultiPage"
diff --git a/translations/desktop_files/kdvi-desktops/uz.po b/translations/desktop_files/kdvi-desktops/uz.po
new file mode 100644
index 00000000..7a80df83
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/uz.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI koʻruvchi"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/uz@cyrillic.po b/translations/desktop_files/kdvi-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..53a74a0d
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/uz@cyrillic.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI кўрувчи"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/ven.po b/translations/desktop_files/kdvi-desktops/ven.po
new file mode 100644
index 00000000..ff0659ed
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/ven.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Muvhoni wa DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/wa.po b/translations/desktop_files/kdvi-desktops/wa.po
new file mode 100644
index 00000000..3b2b22dc
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/wa.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Håyneu di fitchîs DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/xh.po b/translations/desktop_files/kdvi-desktops/xh.po
new file mode 100644
index 00000000..cfd6223a
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/xh.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Umboniseli we DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/zh_CN.po b/translations/desktop_files/kdvi-desktops/zh_CN.po
new file mode 100644
index 00000000..c629626b
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/zh_CN.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI 查看器"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/zh_HK.po b/translations/desktop_files/kdvi-desktops/zh_HK.po
new file mode 100644
index 00000000..75c84fdf
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/zh_HK.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI 檢視器"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/zh_TW.po b/translations/desktop_files/kdvi-desktops/zh_TW.po
new file mode 100644
index 00000000..8f6b2457
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/zh_TW.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "DVI 檢視器"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr "KDVI 檢視器"
+
+#. Comment
+#: kdvimultipage.desktop:3
+#, fuzzy
+msgid "DVI"
+msgstr "KDVI 檢視器"
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kdvi-desktops/zu.po b/translations/desktop_files/kdvi-desktops/zu.po
new file mode 100644
index 00000000..ee7b6d36
--- /dev/null
+++ b/translations/desktop_files/kdvi-desktops/zu.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kdvi.desktop:2
+msgid "DVI Viewer"
+msgstr "Umboniseli we DVI"
+
+#. Name
+#: kdvi.desktop:3
+msgid "KDVI"
+msgstr ""
+
+#. Comment
+#: kdvimultipage.desktop:3
+msgid "DVI"
+msgstr ""
+
+#. Name
+#: kdvimultipage.desktop:4
+msgid "KDVIMultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/af.po b/translations/desktop_files/kfax.desktop/af.po
new file mode 100644
index 00000000..32c9fc78
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faks Aansig"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "K-faks"
diff --git a/translations/desktop_files/kfax.desktop/ar.po b/translations/desktop_files/kfax.desktop/ar.po
new file mode 100644
index 00000000..60aa532c
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "عارض الفاكس"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "برنامج KFax"
diff --git a/translations/desktop_files/kfax.desktop/bg.po b/translations/desktop_files/kfax.desktop/bg.po
new file mode 100644
index 00000000..15709644
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Преглед на факсове"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/br.po b/translations/desktop_files/kfax.desktop/br.po
new file mode 100644
index 00000000..7142381f
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/br.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Gweler faks"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/bs.po b/translations/desktop_files/kfax.desktop/bs.po
new file mode 100644
index 00000000..d6632a20
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Preglednik faxova"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/ca.po b/translations/desktop_files/kfax.desktop/ca.po
new file mode 100644
index 00000000..ef15a4d4
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Visualitzador de fax"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/cs.po b/translations/desktop_files/kfax.desktop/cs.po
new file mode 100644
index 00000000..299bebb0
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Prohlížeč faxů"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/cy.po b/translations/desktop_files/kfax.desktop/cy.po
new file mode 100644
index 00000000..6d05cd40
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Gwelydd Ffacs"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "KFfacs"
diff --git a/translations/desktop_files/kfax.desktop/da.po b/translations/desktop_files/kfax.desktop/da.po
new file mode 100644
index 00000000..0b2301cf
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Fax-fremviser"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/de.po b/translations/desktop_files/kfax.desktop/de.po
new file mode 100644
index 00000000..5739e06e
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faxbetrachter"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/el.po b/translations/desktop_files/kfax.desktop/el.po
new file mode 100644
index 00000000..1fb796f1
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Προβολέας φαξ"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/eo.po b/translations/desktop_files/kfax.desktop/eo.po
new file mode 100644
index 00000000..9d679720
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faksrigardilo"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "Faksrigardilo"
diff --git a/translations/desktop_files/kfax.desktop/es.po b/translations/desktop_files/kfax.desktop/es.po
new file mode 100644
index 00000000..88d091fe
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Visor de faxes"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/et.po b/translations/desktop_files/kfax.desktop/et.po
new file mode 100644
index 00000000..087718a2
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Fakside vaataja"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/eu.po b/translations/desktop_files/kfax.desktop/eu.po
new file mode 100644
index 00000000..0aa49fc5
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Fax ikustailua"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/fa.po b/translations/desktop_files/kfax.desktop/fa.po
new file mode 100644
index 00000000..53a1b552
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "مشاهده‌گر دورنگار"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/fi.po b/translations/desktop_files/kfax.desktop/fi.po
new file mode 100644
index 00000000..cfbfd216
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faksinäytin"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/fr.po b/translations/desktop_files/kfax.desktop/fr.po
new file mode 100644
index 00000000..8f166934
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Afficheur de fax"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/gl.po b/translations/desktop_files/kfax.desktop/gl.po
new file mode 100644
index 00000000..2977e1d5
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Visor de fax"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/he.po b/translations/desktop_files/kfax.desktop/he.po
new file mode 100644
index 00000000..e09df3e9
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "מציג פקסים"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/hi.po b/translations/desktop_files/kfax.desktop/hi.po
new file mode 100644
index 00000000..79357cc9
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "फ़ैक्स प्रदर्शक"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "के-फ़ैक्स"
diff --git a/translations/desktop_files/kfax.desktop/hr.po b/translations/desktop_files/kfax.desktop/hr.po
new file mode 100644
index 00000000..ef2c6523
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Preglednik faksova"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/hu.po b/translations/desktop_files/kfax.desktop/hu.po
new file mode 100644
index 00000000..7a44b184
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faxnézegető"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/is.po b/translations/desktop_files/kfax.desktop/is.po
new file mode 100644
index 00000000..04f66886
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Fax sjá"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/it.po b/translations/desktop_files/kfax.desktop/it.po
new file mode 100644
index 00000000..824e3b1b
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: 2021-05-10 07:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kfax-kfaxdesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Visore di fax"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "KFax"
diff --git a/translations/desktop_files/kfax.desktop/ja.po b/translations/desktop_files/kfax.desktop/ja.po
new file mode 100644
index 00000000..7f9a8e8c
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "ファクスビューア"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/kfax.desktop.pot b/translations/desktop_files/kfax.desktop/kfax.desktop.pot
new file mode 100644
index 00000000..83a0d3fd
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/kfax.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr ""
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/kk.po b/translations/desktop_files/kfax.desktop/kk.po
new file mode 100644
index 00000000..fa79a460
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Факсты қарау"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/km.po b/translations/desktop_files/kfax.desktop/km.po
new file mode 100644
index 00000000..8af344ce
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "កម្មវិធី​មើល​ទូរសារ"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/lt.po b/translations/desktop_files/kfax.desktop/lt.po
new file mode 100644
index 00000000..80192ecb
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faksų žiūriklis"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/lv.po b/translations/desktop_files/kfax.desktop/lv.po
new file mode 100644
index 00000000..de522718
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faksu Skatītājs"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "KFakss"
diff --git a/translations/desktop_files/kfax.desktop/ms.po b/translations/desktop_files/kfax.desktop/ms.po
new file mode 100644
index 00000000..5b7e1b09
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Pemapar Faks"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/nb.po b/translations/desktop_files/kfax.desktop/nb.po
new file mode 100644
index 00000000..ba3299d7
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faksfremviser"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/nds.po b/translations/desktop_files/kfax.desktop/nds.po
new file mode 100644
index 00000000..09607915
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faxkieker"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/ne.po b/translations/desktop_files/kfax.desktop/ne.po
new file mode 100644
index 00000000..4eb8497f
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "फ्याक्स द्रष्टा"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "केडीई फ्याक्स"
diff --git a/translations/desktop_files/kfax.desktop/nl.po b/translations/desktop_files/kfax.desktop/nl.po
new file mode 100644
index 00000000..fba37835
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faxweergaveprogramma"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/nn.po b/translations/desktop_files/kfax.desktop/nn.po
new file mode 100644
index 00000000..caa81dc6
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faksvisar"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/pa.po b/translations/desktop_files/kfax.desktop/pa.po
new file mode 100644
index 00000000..0330cfb2
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/pa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "ਫੈਕਸ ਦਰਸ਼ਕ"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/pl.po b/translations/desktop_files/kfax.desktop/pl.po
new file mode 100644
index 00000000..b6c87606
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Przeglądarka faksów"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/pt.po b/translations/desktop_files/kfax.desktop/pt.po
new file mode 100644
index 00000000..9f97ac39
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/pt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Visualizador de Faxes"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/pt_BR.po b/translations/desktop_files/kfax.desktop/pt_BR.po
new file mode 100644
index 00000000..46dc09de
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Visualizador de Faxes"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/ro.po b/translations/desktop_files/kfax.desktop/ro.po
new file mode 100644
index 00000000..65d9a4cf
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Vizualizor FAX"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/ru.po b/translations/desktop_files/kfax.desktop/ru.po
new file mode 100644
index 00000000..1832e82f
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Просмотр факсов"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/se.po b/translations/desktop_files/kfax.desktop/se.po
new file mode 100644
index 00000000..f1a96db6
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Fáksačájeheaddji"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/sk.po b/translations/desktop_files/kfax.desktop/sk.po
new file mode 100644
index 00000000..1b8b0f77
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Prehliadač faxov"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/sl.po b/translations/desktop_files/kfax.desktop/sl.po
new file mode 100644
index 00000000..07801f8d
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Pregledovalnik faksov"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/sr.po b/translations/desktop_files/kfax.desktop/sr.po
new file mode 100644
index 00000000..380c49ae
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Приказивач факсова"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/sr@Latn.po b/translations/desktop_files/kfax.desktop/sr@Latn.po
new file mode 100644
index 00000000..6353e2c9
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Prikazivač faksova"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/sv.po b/translations/desktop_files/kfax.desktop/sv.po
new file mode 100644
index 00000000..852b70bb
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faxvisare"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "Kfax"
diff --git a/translations/desktop_files/kfax.desktop/ta.po b/translations/desktop_files/kfax.desktop/ta.po
new file mode 100644
index 00000000..4225d9f0
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "ஃபாக்ஸ் காட்சி"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "கேஃபாக்ஸ்"
diff --git a/translations/desktop_files/kfax.desktop/tg.po b/translations/desktop_files/kfax.desktop/tg.po
new file mode 100644
index 00000000..27788c4f
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Хондани факс"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/th.po b/translations/desktop_files/kfax.desktop/th.po
new file mode 100644
index 00000000..c5e6e3fe
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "เครื่องมือแสดงโทรสารของ TDE"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/tr.po b/translations/desktop_files/kfax.desktop/tr.po
new file mode 100644
index 00000000..ce7dc073
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faks Görüntüleyici"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/uk.po b/translations/desktop_files/kfax.desktop/uk.po
new file mode 100644
index 00000000..0e4efa53
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kfax-kfaxdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Переглядач факсів"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "KFax"
diff --git a/translations/desktop_files/kfax.desktop/uz.po b/translations/desktop_files/kfax.desktop/uz.po
new file mode 100644
index 00000000..4f1a529e
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Faks koʻruvchi"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/uz@cyrillic.po b/translations/desktop_files/kfax.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..a535cd59
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Факс кўрувчи"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/ven.po b/translations/desktop_files/kfax.desktop/ven.po
new file mode 100644
index 00000000..600e5be7
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Muvhoni wa Fekisi"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "Fekisi ya K"
diff --git a/translations/desktop_files/kfax.desktop/wa.po b/translations/desktop_files/kfax.desktop/wa.po
new file mode 100644
index 00000000..db05c1f2
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Håyneu di facs"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "KFacs"
diff --git a/translations/desktop_files/kfax.desktop/xh.po b/translations/desktop_files/kfax.desktop/xh.po
new file mode 100644
index 00000000..ae7d4bf1
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Umboniseli Wefax"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/zh_CN.po b/translations/desktop_files/kfax.desktop/zh_CN.po
new file mode 100644
index 00000000..1df72fc2
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "传真查看器"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/zh_HK.po b/translations/desktop_files/kfax.desktop/zh_HK.po
new file mode 100644
index 00000000..ff828e44
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "傳真檢視器"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfax.desktop/zh_TW.po b/translations/desktop_files/kfax.desktop/zh_TW.po
new file mode 100644
index 00000000..b102db8c
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "傳真檢視器"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr "KFax 傳真檢視器"
diff --git a/translations/desktop_files/kfax.desktop/zu.po b/translations/desktop_files/kfax.desktop/zu.po
new file mode 100644
index 00000000..c48fb601
--- /dev/null
+++ b/translations/desktop_files/kfax.desktop/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:09+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kfax.desktop:3
+msgid "Fax Viewer"
+msgstr "Umbonisi wefax"
+
+#. Name
+#: kfax.desktop:4
+msgid "KFax"
+msgstr ""
diff --git a/translations/desktop_files/kfaxview-desktops/af.po b/translations/desktop_files/kfaxview-desktops/af.po
new file mode 100644
index 00000000..d4e76026
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/af.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faks Aansig"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faks Aansig"
diff --git a/translations/desktop_files/kfaxview-desktops/ar.po b/translations/desktop_files/kfaxview-desktops/ar.po
new file mode 100644
index 00000000..06d1da57
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ar.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "عارض الفاكس"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "عارض الفاكس"
diff --git a/translations/desktop_files/kfaxview-desktops/bg.po b/translations/desktop_files/kfaxview-desktops/bg.po
new file mode 100644
index 00000000..414b2aea
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/bg.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Приставка за факс файлове"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Преглед на факсове"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Преглед на факсове"
diff --git a/translations/desktop_files/kfaxview-desktops/br.po b/translations/desktop_files/kfaxview-desktops/br.po
new file mode 100644
index 00000000..16fc2d65
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/br.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Lugent KViewShell evit ar restroù faks"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Gweler faks"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Gweler faks"
diff --git a/translations/desktop_files/kfaxview-desktops/bs.po b/translations/desktop_files/kfaxview-desktops/bs.po
new file mode 100644
index 00000000..ad4976c2
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/bs.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell dodatak za fax datoteke"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Preglednik faxova"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Preglednik faxova"
diff --git a/translations/desktop_files/kfaxview-desktops/ca.po b/translations/desktop_files/kfaxview-desktops/ca.po
new file mode 100644
index 00000000..83dafbdc
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ca.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Connector pel KViewShell per a fitxers de fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Visualitzador de fax"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Visualitzador de fax"
diff --git a/translations/desktop_files/kfaxview-desktops/cs.po b/translations/desktop_files/kfaxview-desktops/cs.po
new file mode 100644
index 00000000..3e6b04a6
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/cs.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell modul pro faxové soubory"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Prohlížeč faxů"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Prohlížeč faxů"
diff --git a/translations/desktop_files/kfaxview-desktops/cy.po b/translations/desktop_files/kfaxview-desktops/cy.po
new file mode 100644
index 00000000..5eb705eb
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/cy.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Gwelydd Ffacs"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Gwelydd Ffacs"
diff --git a/translations/desktop_files/kfaxview-desktops/da.po b/translations/desktop_files/kfaxview-desktops/da.po
new file mode 100644
index 00000000..4a8d723d
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/da.po
@@ -0,0 +1,44 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+#, fuzzy
+msgid "kfaxview"
+msgstr "Kfaxview TIFF"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Kviewshell-plugin for telefaxfiler"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "Kfaxview TIFF"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Fax-fremviser"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Fax-fremviser"
diff --git a/translations/desktop_files/kfaxview-desktops/de.po b/translations/desktop_files/kfaxview-desktops/de.po
new file mode 100644
index 00000000..32b31d7f
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/de.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Ein Modul für KViewShell zum Betrachten von Faxdateien"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faxbetrachter"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faxbetrachter"
diff --git a/translations/desktop_files/kfaxview-desktops/el.po b/translations/desktop_files/kfaxview-desktops/el.po
new file mode 100644
index 00000000..4876dc62
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/el.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Πρόσθετο του KViewShell για αρχεία φαξ"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Προβολέας φαξ"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Προβολέας φαξ"
diff --git a/translations/desktop_files/kfaxview-desktops/eo.po b/translations/desktop_files/kfaxview-desktops/eo.po
new file mode 100644
index 00000000..da92b395
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/eo.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell-kromaĵo for faksdosieroj"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faksrigardilo"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faksrigardilo"
diff --git a/translations/desktop_files/kfaxview-desktops/es.po b/translations/desktop_files/kfaxview-desktops/es.po
new file mode 100644
index 00000000..fb0f5d03
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/es.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Extensión KViewShell para archivos de fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Visor de faxes"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Visor de faxes"
diff --git a/translations/desktop_files/kfaxview-desktops/et.po b/translations/desktop_files/kfaxview-desktops/et.po
new file mode 100644
index 00000000..3c5d8bbf
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/et.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KView faksifailide plugin"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Fakside vaataja"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Fakside vaataja"
diff --git a/translations/desktop_files/kfaxview-desktops/eu.po b/translations/desktop_files/kfaxview-desktops/eu.po
new file mode 100644
index 00000000..be47c2ba
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/eu.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Fax fitxategientzatko KViewShell-en plugina"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Fax ikustailua"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Fax ikustailua"
diff --git a/translations/desktop_files/kfaxview-desktops/fa.po b/translations/desktop_files/kfaxview-desktops/fa.po
new file mode 100644
index 00000000..2bc8ad9c
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/fa.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "وصلۀ KViewShell برای پرونده‌های دورنگار"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "مشاهده‌گر دورنگار"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "مشاهده‌گر دورنگار"
diff --git a/translations/desktop_files/kfaxview-desktops/fi.po b/translations/desktop_files/kfaxview-desktops/fi.po
new file mode 100644
index 00000000..d6b83d7d
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/fi.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell sovelma faksitiedostoille"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faksinäytin"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faksinäytin"
diff --git a/translations/desktop_files/kfaxview-desktops/fr.po b/translations/desktop_files/kfaxview-desktops/fr.po
new file mode 100644
index 00000000..c166f0bd
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/fr.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Module KViewShell pour les fichiers de fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Afficheur de fax"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Afficheur de fax"
diff --git a/translations/desktop_files/kfaxview-desktops/gl.po b/translations/desktop_files/kfaxview-desktops/gl.po
new file mode 100644
index 00000000..781ae3be
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/gl.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Extensión de KViewShell para ficheiros de fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Visor de fax"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Visor de fax"
diff --git a/translations/desktop_files/kfaxview-desktops/he.po b/translations/desktop_files/kfaxview-desktops/he.po
new file mode 100644
index 00000000..12c1cfdd
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/he.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "מציג פקסים"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "מציג פקסים"
diff --git a/translations/desktop_files/kfaxview-desktops/hi.po b/translations/desktop_files/kfaxview-desktops/hi.po
new file mode 100644
index 00000000..3081a003
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/hi.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "फ़ैक्स प्रदर्शक"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "फ़ैक्स प्रदर्शक"
diff --git a/translations/desktop_files/kfaxview-desktops/hr.po b/translations/desktop_files/kfaxview-desktops/hr.po
new file mode 100644
index 00000000..6cf53ddb
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/hr.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Preglednik faksova"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Preglednik faksova"
diff --git a/translations/desktop_files/kfaxview-desktops/hu.po b/translations/desktop_files/kfaxview-desktops/hu.po
new file mode 100644
index 00000000..2d1c8c4d
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/hu.po
@@ -0,0 +1,44 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "KFaxView"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell-modul faxfájlokhoz"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+#, fuzzy
+msgid "kfaxview_tiff"
+msgstr "KFaxView"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faxnézegető"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faxnézegető"
diff --git a/translations/desktop_files/kfaxview-desktops/is.po b/translations/desktop_files/kfaxview-desktops/is.po
new file mode 100644
index 00000000..86c9bf84
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/is.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell íforrit fyrir faxskrár"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Fax sjá"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Fax sjá"
diff --git a/translations/desktop_files/kfaxview-desktops/it.po b/translations/desktop_files/kfaxview-desktops/it.po
new file mode 100644
index 00000000..d3abeb3e
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/it.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: 2021-05-10 07:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kfaxview-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "kfaxview"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Plugin KViewShell per file di fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "kfaxview_tiff"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Visualizzzatore di fax"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "KFaxView"
diff --git a/translations/desktop_files/kfaxview-desktops/ja.po b/translations/desktop_files/kfaxview-desktops/ja.po
new file mode 100644
index 00000000..d39dec0d
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ja.po
@@ -0,0 +1,44 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "KfaxView"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "ファクスファイル用の KViewShell プラグイン"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+#, fuzzy
+msgid "kfaxview_tiff"
+msgstr "KfaxView"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "ファクスビューア"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "ファクスビューア"
diff --git a/translations/desktop_files/kfaxview-desktops/kfaxview-desktops.pot b/translations/desktop_files/kfaxview-desktops/kfaxview-desktops.pot
new file mode 100644
index 00000000..95b390e7
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/kfaxview-desktops.pot
@@ -0,0 +1,42 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr ""
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr ""
diff --git a/translations/desktop_files/kfaxview-desktops/kk.po b/translations/desktop_files/kfaxview-desktops/kk.po
new file mode 100644
index 00000000..e8e6126a
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/kk.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Факс файлдарын қарау плагин модулі"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Факсты қарау"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Факсты қарау"
diff --git a/translations/desktop_files/kfaxview-desktops/km.po b/translations/desktop_files/kfaxview-desktops/km.po
new file mode 100644
index 00000000..18ffb3d8
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/km.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "កម្មវិធី​ជំនួយ KViewShell សម្រាប់​ឯកសារ​ទូរសារ"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "កម្មវិធី​មើល​ទូរសារ"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "កម្មវិធី​មើល​ទូរសារ"
diff --git a/translations/desktop_files/kfaxview-desktops/lt.po b/translations/desktop_files/kfaxview-desktops/lt.po
new file mode 100644
index 00000000..7172010e
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/lt.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell priedas fakso byloms"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faksų žiūriklis"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faksų žiūriklis"
diff --git a/translations/desktop_files/kfaxview-desktops/lv.po b/translations/desktop_files/kfaxview-desktops/lv.po
new file mode 100644
index 00000000..c3d58fc7
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/lv.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faksu Skatītājs"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faksu Skatītājs"
diff --git a/translations/desktop_files/kfaxview-desktops/ms.po b/translations/desktop_files/kfaxview-desktops/ms.po
new file mode 100644
index 00000000..1ff9bcce
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ms.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Plugin KViewShell untuk fail faks"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Pemapar Faks"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Pemapar Faks"
diff --git a/translations/desktop_files/kfaxview-desktops/nb.po b/translations/desktop_files/kfaxview-desktops/nb.po
new file mode 100644
index 00000000..76129b3f
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/nb.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "Kfaxview"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell programtillegg for faksfiler"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+#, fuzzy
+msgid "kfaxview_tiff"
+msgstr "Kfaxview"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faksfremviser"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "Kfaxview"
diff --git a/translations/desktop_files/kfaxview-desktops/nds.po b/translations/desktop_files/kfaxview-desktops/nds.po
new file mode 100644
index 00000000..df415279
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/nds.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "\"KViewShell\"-Moduul för Faxdateien"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faxkieker"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faxkieker"
diff --git a/translations/desktop_files/kfaxview-desktops/ne.po b/translations/desktop_files/kfaxview-desktops/ne.po
new file mode 100644
index 00000000..f30bf63f
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ne.po
@@ -0,0 +1,42 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "केडीई फ्याक्स दृश्य"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "फ्याक्स फाइलका लागि केडीई दृश्य शेल प्लगइन"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "केडीई फ्याक्स दृश्य टिफ"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "फ्याक्स द्रष्टा"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "केडीई फ्याक्स दृश्य"
diff --git a/translations/desktop_files/kfaxview-desktops/nl.po b/translations/desktop_files/kfaxview-desktops/nl.po
new file mode 100644
index 00000000..d80e547f
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/nl.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell-plugin voor faxbestanden"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faxweergaveprogramma"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faxweergaveprogramma"
diff --git a/translations/desktop_files/kfaxview-desktops/nn.po b/translations/desktop_files/kfaxview-desktops/nn.po
new file mode 100644
index 00000000..152e40ca
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/nn.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell-programtillegg for faksfiler"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faksvisar"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faksvisar"
diff --git a/translations/desktop_files/kfaxview-desktops/pa.po b/translations/desktop_files/kfaxview-desktops/pa.po
new file mode 100644
index 00000000..316d08e1
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/pa.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "ਫੈਕਸ ਦਰਸ਼ਕ"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "ਫੈਕਸ ਦਰਸ਼ਕ"
diff --git a/translations/desktop_files/kfaxview-desktops/pl.po b/translations/desktop_files/kfaxview-desktops/pl.po
new file mode 100644
index 00000000..a7f2f7ff
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/pl.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Wtyczka KViewShell do plików faksów"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Przeglądarka faksów"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Przeglądarka faksów"
diff --git a/translations/desktop_files/kfaxview-desktops/pt.po b/translations/desktop_files/kfaxview-desktops/pt.po
new file mode 100644
index 00000000..48aea1c6
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/pt.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kfaxview-desktop-files/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "kfaxview"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "'Plugin' do KViewShell para ficheiros de Fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "kfaxview_tiff"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Visualizador de Faxes"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "KFaxView"
diff --git a/translations/desktop_files/kfaxview-desktops/pt_BR.po b/translations/desktop_files/kfaxview-desktops/pt_BR.po
new file mode 100644
index 00000000..a58c2927
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/pt_BR.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Plugin KViewShell para arquivos de fax"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Visualizador de Faxes"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Visualizador de Faxes"
diff --git a/translations/desktop_files/kfaxview-desktops/ro.po b/translations/desktop_files/kfaxview-desktops/ro.po
new file mode 100644
index 00000000..3abc2a4f
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ro.po
@@ -0,0 +1,44 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "KFaxiView"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+#, fuzzy
+msgid "kfaxview_tiff"
+msgstr "KFaxiView"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Vizualizor FAX"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Vizualizor FAX"
diff --git a/translations/desktop_files/kfaxview-desktops/ru.po b/translations/desktop_files/kfaxview-desktops/ru.po
new file mode 100644
index 00000000..c05d50ce
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ru.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Компонент просмотра факсов"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Просмотр факсов"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Просмотр факсов"
diff --git a/translations/desktop_files/kfaxview-desktops/se.po b/translations/desktop_files/kfaxview-desktops/se.po
new file mode 100644
index 00000000..7ce0624e
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/se.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Fáksačájeheaddji"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Fáksačájeheaddji"
diff --git a/translations/desktop_files/kfaxview-desktops/sk.po b/translations/desktop_files/kfaxview-desktops/sk.po
new file mode 100644
index 00000000..1525d27a
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/sk.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell modul pre faxové súbory"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Prehliadač faxov"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Prehliadač faxov"
diff --git a/translations/desktop_files/kfaxview-desktops/sl.po b/translations/desktop_files/kfaxview-desktops/sl.po
new file mode 100644
index 00000000..7818e2d7
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/sl.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Vstavek za KViewShell za fakse"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Pregledovalnik faksov"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Pregledovalnik faksov"
diff --git a/translations/desktop_files/kfaxview-desktops/sr.po b/translations/desktop_files/kfaxview-desktops/sr.po
new file mode 100644
index 00000000..9d23b1fa
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/sr.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell-ов прикључак за факс фајлове"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Приказивач факсова"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Приказивач факсова"
diff --git a/translations/desktop_files/kfaxview-desktops/sr@Latn.po b/translations/desktop_files/kfaxview-desktops/sr@Latn.po
new file mode 100644
index 00000000..7980c70d
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/sr@Latn.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell-ov priključak za faks fajlove"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Prikazivač faksova"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Prikazivač faksova"
diff --git a/translations/desktop_files/kfaxview-desktops/sv.po b/translations/desktop_files/kfaxview-desktops/sv.po
new file mode 100644
index 00000000..03b67704
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/sv.po
@@ -0,0 +1,42 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "Kfaxview"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Kviewshell-insticksprogram för telefaxfiler"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "Kfaxview TIFF"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faxvisare"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "Kfaxview"
diff --git a/translations/desktop_files/kfaxview-desktops/ta.po b/translations/desktop_files/kfaxview-desktops/ta.po
new file mode 100644
index 00000000..b36e23a9
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ta.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "ஃபாக்ஸ் காட்சி"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "ஃபாக்ஸ் காட்சி"
diff --git a/translations/desktop_files/kfaxview-desktops/tg.po b/translations/desktop_files/kfaxview-desktops/tg.po
new file mode 100644
index 00000000..e0939553
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/tg.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Хондани факс"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Хондани факс"
diff --git a/translations/desktop_files/kfaxview-desktops/th.po b/translations/desktop_files/kfaxview-desktops/th.po
new file mode 100644
index 00000000..47ae31ed
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/th.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "ปลั๊กอินสำหรับแสดงแฟ้มโทรสารของ KViewShell"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "เครื่องมือแสดงโทรสารของ TDE"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "เครื่องมือแสดงโทรสารของ TDE"
diff --git a/translations/desktop_files/kfaxview-desktops/tr.po b/translations/desktop_files/kfaxview-desktops/tr.po
new file mode 100644
index 00000000..8326e48b
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/tr.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Faks dosyaları için KViewShell eklentisi"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faks Görüntüleyici"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faks Görüntüleyici"
diff --git a/translations/desktop_files/kfaxview-desktops/uk.po b/translations/desktop_files/kfaxview-desktops/uk.po
new file mode 100644
index 00000000..59a4cd6b
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/uk.po
@@ -0,0 +1,44 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kfaxview-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "kfaxview"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "Втулок перегляду файлів факсів для KViewShell"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "kfaxview_tiff"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Переглядач факсів"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "KFaxView"
diff --git a/translations/desktop_files/kfaxview-desktops/uz.po b/translations/desktop_files/kfaxview-desktops/uz.po
new file mode 100644
index 00000000..f885f2ba
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/uz.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Faks koʻruvchi"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Faks koʻruvchi"
diff --git a/translations/desktop_files/kfaxview-desktops/uz@cyrillic.po b/translations/desktop_files/kfaxview-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..4e3e6d3e
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/uz@cyrillic.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Факс кўрувчи"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Факс кўрувчи"
diff --git a/translations/desktop_files/kfaxview-desktops/ven.po b/translations/desktop_files/kfaxview-desktops/ven.po
new file mode 100644
index 00000000..f6c93a68
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/ven.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Muvhoni wa Fekisi"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Muvhoni wa Fekisi"
diff --git a/translations/desktop_files/kfaxview-desktops/wa.po b/translations/desktop_files/kfaxview-desktops/wa.po
new file mode 100644
index 00000000..a9d83de7
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/wa.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Håyneu di facs"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Håyneu di facs"
diff --git a/translations/desktop_files/kfaxview-desktops/xh.po b/translations/desktop_files/kfaxview-desktops/xh.po
new file mode 100644
index 00000000..516020ba
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/xh.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Umboniseli Wefax"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Umboniseli Wefax"
diff --git a/translations/desktop_files/kfaxview-desktops/zh_CN.po b/translations/desktop_files/kfaxview-desktops/zh_CN.po
new file mode 100644
index 00000000..afe4a854
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/zh_CN.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr "KFaxView"
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "传真文件的 KViewShell 插件"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr "KFaxView_tiff"
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "传真查看器"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "传真查看器"
diff --git a/translations/desktop_files/kfaxview-desktops/zh_HK.po b/translations/desktop_files/kfaxview-desktops/zh_HK.po
new file mode 100644
index 00000000..ccde1955
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/zh_HK.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "傳真檔的 KViewShell 插件"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "傳真檢視器"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "傳真檢視器"
diff --git a/translations/desktop_files/kfaxview-desktops/zh_TW.po b/translations/desktop_files/kfaxview-desktops/zh_TW.po
new file mode 100644
index 00000000..c7a04e35
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/zh_TW.po
@@ -0,0 +1,42 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr "KViewShell 傳真檔外掛程式"
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "傳真檢視器"
+
+#. Name
+#: kfaxview.desktop:3
+msgid "KFaxView"
+msgstr "KFaxView 傳真檢視"
diff --git a/translations/desktop_files/kfaxview-desktops/zu.po b/translations/desktop_files/kfaxview-desktops/zu.po
new file mode 100644
index 00000000..f450e97e
--- /dev/null
+++ b/translations/desktop_files/kfaxview-desktops/zu.po
@@ -0,0 +1,43 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:16+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kfaxmultipage.desktop:2
+msgid "kfaxview"
+msgstr ""
+
+#. Comment
+#: kfaxmultipage.desktop:5 kfaxmultipage_tiff.desktop:5
+msgid "KViewShell plugin for fax files"
+msgstr ""
+
+#. Name
+#: kfaxmultipage_tiff.desktop:2
+msgid "kfaxview_tiff"
+msgstr ""
+
+#. GenericName
+#: kfaxview.desktop:2
+msgid "Fax Viewer"
+msgstr "Umbonisi wefax"
+
+#. Name
+#: kfaxview.desktop:3
+#, fuzzy
+msgid "KFaxView"
+msgstr "Umbonisi wefax"
diff --git a/translations/desktop_files/kgamma.desktop/ar.po b/translations/desktop_files/kgamma.desktop/ar.po
new file mode 100644
index 00000000..659c6584
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ar.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "غاما"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "أداة مراقبة وتعيير"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/az.po b/translations/desktop_files/kgamma.desktop/az.po
new file mode 100644
index 00000000..f7cdb72b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/az.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Qamma"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/bg.po b/translations/desktop_files/kgamma.desktop/bg.po
new file mode 100644
index 00000000..192296f5
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/bg.po
@@ -0,0 +1,34 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гама"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Калибриране на монитора"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
+"калибриране; гама; яркост; цвят; монитор; екран; KGamma; kgamma; Gamma; "
+"gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/bs.po b/translations/desktop_files/kgamma.desktop/bs.po
new file mode 100644
index 00000000..0a36f06b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/bs.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Alat za kalibraciju monitora"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/ca.po b/translations/desktop_files/kgamma.desktop/ca.po
new file mode 100644
index 00000000..17cc7e21
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ca.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Una eina de calibració del monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/cs.po b/translations/desktop_files/kgamma.desktop/cs.po
new file mode 100644
index 00000000..90b805f2
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/cs.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Nástroj pro kalibraci monitoru"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/cy.po b/translations/desktop_files/kgamma.desktop/cy.po
new file mode 100644
index 00000000..ad73363d
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/cy.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Erfyn graddnodi dangosydd"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/da.po b/translations/desktop_files/kgamma.desktop/da.po
new file mode 100644
index 00000000..2293d22f
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/da.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Et skærmkalibreringsværktøj"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/de.po b/translations/desktop_files/kgamma.desktop/de.po
new file mode 100644
index 00000000..41603db8
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/de.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Ein Kalibrierungswerkzeug für Monitore"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;Gamma;gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/el.po b/translations/desktop_files/kgamma.desktop/el.po
new file mode 100644
index 00000000..2afb463c
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/el.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Γάμμα"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Ένα εργαλείο ρύθμισης της οθόνης"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Γάμμα; γάμμα;"
diff --git a/translations/desktop_files/kgamma.desktop/eo.po b/translations/desktop_files/kgamma.desktop/eo.po
new file mode 100644
index 00000000..b3b3ef45
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/eo.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gamo"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Ekrankalibrilo"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/es.po b/translations/desktop_files/kgamma.desktop/es.po
new file mode 100644
index 00000000..05bbbc62
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/es.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Una herramienta de calibración del monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/et.po b/translations/desktop_files/kgamma.desktop/et.po
new file mode 100644
index 00000000..e5890c45
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/et.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Monitori kalibreerija"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/eu.po b/translations/desktop_files/kgamma.desktop/eu.po
new file mode 100644
index 00000000..243bd391
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/eu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Monitoreak kalibratzeko tresna"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/fa.po b/translations/desktop_files/kgamma.desktop/fa.po
new file mode 100644
index 00000000..891786ad
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/fa.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "گاما"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "ابزار درجه‌بندی نمایشگر"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/fi.po b/translations/desktop_files/kgamma.desktop/fi.po
new file mode 100644
index 00000000..0b1535d5
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/fi.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Näytön asetustyökalu"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/fr.po b/translations/desktop_files/kgamma.desktop/fr.po
new file mode 100644
index 00000000..c30d68c5
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/fr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Outil de calibrage de moniteur"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/ga.po b/translations/desktop_files/kgamma.desktop/ga.po
new file mode 100644
index 00000000..7dd69511
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ga.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gáma"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; Gáma;"
diff --git a/translations/desktop_files/kgamma.desktop/gl.po b/translations/desktop_files/kgamma.desktop/gl.po
new file mode 100644
index 00000000..f89428bf
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/gl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Unha utilidade para calibrar o monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/he.po b/translations/desktop_files/kgamma.desktop/he.po
new file mode 100644
index 00000000..f80bedfe
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/he.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "גאמה"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; גאמה;"
diff --git a/translations/desktop_files/kgamma.desktop/hi.po b/translations/desktop_files/kgamma.desktop/hi.po
new file mode 100644
index 00000000..d41b75d6
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/hi.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "मॉनीटर केलिब्रेशन औज़ार"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "के-गामा;केगामा;गामा;गामा;"
diff --git a/translations/desktop_files/kgamma.desktop/hr.po b/translations/desktop_files/kgamma.desktop/hr.po
new file mode 100644
index 00000000..f171bb0f
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/hr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/hu.po b/translations/desktop_files/kgamma.desktop/hu.po
new file mode 100644
index 00000000..0abd7880
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/hu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gamma-korrekció"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Monitorbeállító program"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;gamma;gamma-korrekció;"
diff --git a/translations/desktop_files/kgamma.desktop/is.po b/translations/desktop_files/kgamma.desktop/is.po
new file mode 100644
index 00000000..4db977aa
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/is.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Litatíðni (gamma)"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Tól til að stilla skjáinn"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/it.po b/translations/desktop_files/kgamma.desktop/it.po
new file mode 100644
index 00000000..d775355b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/it.po
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: 2021-05-12 01:08+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kgamma-kgammadesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gamma"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Calibrazione del monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/ja.po b/translations/desktop_files/kgamma.desktop/ja.po
new file mode 100644
index 00000000..577385f7
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ja.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "モニタ測定ツール"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; ガンマ; Gamma; gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/kgamma.desktop.pot b/translations/desktop_files/kgamma.desktop/kgamma.desktop.pot
new file mode 100644
index 00000000..9849e99c
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/kgamma.desktop.pot
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/kk.po b/translations/desktop_files/kgamma.desktop/kk.po
new file mode 100644
index 00000000..ac31e0fd
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/kk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гамма"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Мониторды калибрлеу құралы"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/km.po b/translations/desktop_files/kgamma.desktop/km.po
new file mode 100644
index 00000000..b00a84ee
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/km.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "ហ្គាម៉ា"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "ឧបករណ៍​ក្រិត​របស់​ម៉ូនីទ័រ"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma;ហ្គ៉ាម៉ា;"
diff --git a/translations/desktop_files/kgamma.desktop/lt.po b/translations/desktop_files/kgamma.desktop/lt.po
new file mode 100644
index 00000000..52f7a86c
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/lt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Monitoriaus kalibravimo įrankis"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/ms.po b/translations/desktop_files/kgamma.desktop/ms.po
new file mode 100644
index 00000000..81f31a89
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ms.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Alat tentukur monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/nb.po b/translations/desktop_files/kgamma.desktop/nb.po
new file mode 100644
index 00000000..155bc835
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/nb.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Et verktøy for å kalibrere skjermen"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/nds.po b/translations/desktop_files/kgamma.desktop/nds.po
new file mode 100644
index 00000000..bc23edaa
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/nds.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "En Afstimmwarktüüch för Monitoren"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;Gamma;gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/ne.po b/translations/desktop_files/kgamma.desktop/ne.po
new file mode 100644
index 00000000..8de66a24
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ne.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "गामा"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "मोनिटर क्यालिब्रेसन उपकरण"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "के गामा; के गामा; गामा; गामा;"
diff --git a/translations/desktop_files/kgamma.desktop/nl.po b/translations/desktop_files/kgamma.desktop/nl.po
new file mode 100644
index 00000000..bf184782
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/nl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Gereedschap om de kleurweergave goed in te stellen"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;Gamma;gamma;kleurweergave;"
diff --git a/translations/desktop_files/kgamma.desktop/nn.po b/translations/desktop_files/kgamma.desktop/nn.po
new file mode 100644
index 00000000..b9cbe761
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/nn.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Eit verktøy for å kalibrera skjermen"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/pa.po b/translations/desktop_files/kgamma.desktop/pa.po
new file mode 100644
index 00000000..b278de03
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/pa.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "ਗ਼ਾਮਾ"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/pl.po b/translations/desktop_files/kgamma.desktop/pl.po
new file mode 100644
index 00000000..af604da8
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/pl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Narzędzie do kalibracji monitora"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; jasność;ciemność;rozjaśnienie;"
diff --git a/translations/desktop_files/kgamma.desktop/pt.po b/translations/desktop_files/kgamma.desktop/pt.po
new file mode 100644
index 00000000..4cf87d84
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/pt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Ferramenta de calibração do monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "kgamma; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/pt_BR.po b/translations/desktop_files/kgamma.desktop/pt_BR.po
new file mode 100644
index 00000000..50ffde7b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/pt_BR.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Uma ferramenta de calibragem de monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGama; kgama; Gama; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/ro.po b/translations/desktop_files/kgamma.desktop/ro.po
new file mode 100644
index 00000000..56f37e09
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ro.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Un utilitar de calibrat monitorul"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;gama;gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/ru.po b/translations/desktop_files/kgamma.desktop/ru.po
new file mode 100644
index 00000000..56b734e6
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ru.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гамма"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Утилита для калибровки монитора"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;Gamma;gamma;гамма;монитор;"
diff --git a/translations/desktop_files/kgamma.desktop/sk.po b/translations/desktop_files/kgamma.desktop/sk.po
new file mode 100644
index 00000000..02362b58
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/sk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Kalibračný nástroj pre monitor"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; gamma;"
diff --git a/translations/desktop_files/kgamma.desktop/sl.po b/translations/desktop_files/kgamma.desktop/sl.po
new file mode 100644
index 00000000..ecc9aa5b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/sl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Kalibracijsko orodje za monitorje"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;Gama;gama;"
diff --git a/translations/desktop_files/kgamma.desktop/sr.po b/translations/desktop_files/kgamma.desktop/sr.po
new file mode 100644
index 00000000..5f49616d
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/sr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гама"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Алат за калибрацију монитора"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; гама;"
diff --git a/translations/desktop_files/kgamma.desktop/sr@Latn.po b/translations/desktop_files/kgamma.desktop/sr@Latn.po
new file mode 100644
index 00000000..07fb9b37
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/sr@Latn.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Alat za kalibraciju monitora"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/sv.po b/translations/desktop_files/kgamma.desktop/sv.po
new file mode 100644
index 00000000..56c30b4a
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/sv.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Kalibreringsverktyg för skärmen"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/ta.po b/translations/desktop_files/kgamma.desktop/ta.po
new file mode 100644
index 00000000..11223e3b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/ta.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "காமா"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "திரை நிலைக்கருவி"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "கேகாமா; கேகாமா; காமா; காமா;"
diff --git a/translations/desktop_files/kgamma.desktop/tg.po b/translations/desktop_files/kgamma.desktop/tg.po
new file mode 100644
index 00000000..da558378
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/tg.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гамма"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Утилита барои калибратсия кардани монитор"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma;kgamma;Gamma;gamma;гамма;монитор;"
diff --git a/translations/desktop_files/kgamma.desktop/th.po b/translations/desktop_files/kgamma.desktop/th.po
new file mode 100644
index 00000000..b7a4815c
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/th.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "แกมมา"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "เครื่องมือปรับความเที่ยงตรงของจอภาพ"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/tr.po b/translations/desktop_files/kgamma.desktop/tr.po
new file mode 100644
index 00000000..f040172b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/tr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Monitör kalibrasyon aracı"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/uk.po b/translations/desktop_files/kgamma.desktop/uk.po
new file mode 100644
index 00000000..1d586949
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/uk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гама"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "Засіб для калібрування монітора"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma; гама; яскравість;"
diff --git a/translations/desktop_files/kgamma.desktop/uz@cyrillic.po b/translations/desktop_files/kgamma.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..05048c0a
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/uz@cyrillic.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Гамма"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Гамма; гамма;"
diff --git a/translations/desktop_files/kgamma.desktop/wa.po b/translations/desktop_files/kgamma.desktop/wa.po
new file mode 100644
index 00000000..e681b81b
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/wa.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Gama"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gama; gama;"
diff --git a/translations/desktop_files/kgamma.desktop/xh.po b/translations/desktop_files/kgamma.desktop/xh.po
new file mode 100644
index 00000000..6471e121
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/xh.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "Unobumba wesithathu konoobumba besiGrike"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr ""
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/zh_CN.po b/translations/desktop_files/kgamma.desktop/zh_CN.po
new file mode 100644
index 00000000..d22c99f7
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/zh_CN.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "监视器校准工具"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr "KGamma; kgamma; Gamma; gamma;伽玛;"
diff --git a/translations/desktop_files/kgamma.desktop/zh_HK.po b/translations/desktop_files/kgamma.desktop/zh_HK.po
new file mode 100644
index 00000000..085e97e4
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/zh_HK.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr "伽馬(Gamma)"
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "顯示器調校工具"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kgamma.desktop/zh_TW.po b/translations/desktop_files/kgamma.desktop/zh_TW.po
new file mode 100644
index 00000000..22f73ab1
--- /dev/null
+++ b/translations/desktop_files/kgamma.desktop/zh_TW.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:18+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kgamma.desktop:13
+msgid "Gamma"
+msgstr ""
+
+#. Comment
+#: kgamma.desktop:15
+msgid "A monitor calibration tool"
+msgstr "監視器校準工具"
+
+#. Keywords
+#: kgamma.desktop:17
+msgid "KGamma; kgamma; Gamma; gamma;"
+msgstr ""
diff --git a/translations/desktop_files/kghostview-desktops/af.po b/translations/desktop_files/kghostview-desktops/af.po
new file mode 100644
index 00000000..7454b93b
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "Kghostview"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Ps/Pdf Aansig"
diff --git a/translations/desktop_files/kghostview-desktops/ar.po b/translations/desktop_files/kghostview-desktops/ar.po
new file mode 100644
index 00000000..eb256333
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "برنامج KGhostView"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "عارض PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/bg.po b/translations/desktop_files/kghostview-desktops/bg.po
new file mode 100644
index 00000000..61ebfae0
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Преглед на документи PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/br.po b/translations/desktop_files/kghostview-desktops/br.po
new file mode 100644
index 00000000..982089dc
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/br.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Gweler PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/bs.po b/translations/desktop_files/kghostview-desktops/bs.po
new file mode 100644
index 00000000..5599b0ee
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Preglednik PS/PDF dokumenata"
diff --git a/translations/desktop_files/kghostview-desktops/ca.po b/translations/desktop_files/kghostview-desktops/ca.po
new file mode 100644
index 00000000..d96f27bc
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Visualitzador de PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/cs.po b/translations/desktop_files/kghostview-desktops/cs.po
new file mode 100644
index 00000000..8b690227
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Prohlížeč PS/PDF souborů"
diff --git a/translations/desktop_files/kghostview-desktops/cy.po b/translations/desktop_files/kghostview-desktops/cy.po
new file mode 100644
index 00000000..3ce2ce80
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Gwelydd PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/da.po b/translations/desktop_files/kghostview-desktops/da.po
new file mode 100644
index 00000000..2e513c91
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-fremviser"
diff --git a/translations/desktop_files/kghostview-desktops/de.po b/translations/desktop_files/kghostview-desktops/de.po
new file mode 100644
index 00000000..057b7553
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-Betrachter"
diff --git a/translations/desktop_files/kghostview-desktops/el.po b/translations/desktop_files/kghostview-desktops/el.po
new file mode 100644
index 00000000..32bcc754
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Προβολέας PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/eo.po b/translations/desktop_files/kghostview-desktops/eo.po
new file mode 100644
index 00000000..7aeefef3
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "Postskriptrigardilo"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-rigardilo"
diff --git a/translations/desktop_files/kghostview-desktops/es.po b/translations/desktop_files/kghostview-desktops/es.po
new file mode 100644
index 00000000..ebc09956
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Visor de documentos PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/et.po b/translations/desktop_files/kghostview-desktops/et.po
new file mode 100644
index 00000000..2cabc404
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-failide näitaja"
diff --git a/translations/desktop_files/kghostview-desktops/eu.po b/translations/desktop_files/kghostview-desktops/eu.po
new file mode 100644
index 00000000..5351a654
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF ikustailua"
diff --git a/translations/desktop_files/kghostview-desktops/fa.po b/translations/desktop_files/kghostview-desktops/fa.po
new file mode 100644
index 00000000..d2c82374
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "مشاهده‌گر PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/fi.po b/translations/desktop_files/kghostview-desktops/fi.po
new file mode 100644
index 00000000..cdfc6042
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-näytin"
diff --git a/translations/desktop_files/kghostview-desktops/fr.po b/translations/desktop_files/kghostview-desktops/fr.po
new file mode 100644
index 00000000..a2c0aabb
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Afficheur PostScript et PDF"
diff --git a/translations/desktop_files/kghostview-desktops/ga.po b/translations/desktop_files/kghostview-desktops/ga.po
new file mode 100644
index 00000000..d6d24d2e
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ga.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Amharcán PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/gl.po b/translations/desktop_files/kghostview-desktops/gl.po
new file mode 100644
index 00000000..4fb8adc8
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Visor PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/he.po b/translations/desktop_files/kghostview-desktops/he.po
new file mode 100644
index 00000000..4d1ac0f4
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "מציג PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/hi.po b/translations/desktop_files/kghostview-desktops/hi.po
new file mode 100644
index 00000000..1d0d0b6f
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "के-घोस्ट-व्यू"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF प्रदर्शक"
diff --git a/translations/desktop_files/kghostview-desktops/hr.po b/translations/desktop_files/kghostview-desktops/hr.po
new file mode 100644
index 00000000..15437a5f
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Preglednik PS/PDF dokumenata"
diff --git a/translations/desktop_files/kghostview-desktops/hu.po b/translations/desktop_files/kghostview-desktops/hu.po
new file mode 100644
index 00000000..c196e7b5
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "KGhostview"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-megjelenítő"
diff --git a/translations/desktop_files/kghostview-desktops/is.po b/translations/desktop_files/kghostview-desktops/is.po
new file mode 100644
index 00000000..e8bab2ad
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF sjá"
diff --git a/translations/desktop_files/kghostview-desktops/it.po b/translations/desktop_files/kghostview-desktops/it.po
new file mode 100644
index 00000000..2d28e5d8
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: 2021-05-12 01:08+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kghostview-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "KGhostView"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Visore PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/ja.po b/translations/desktop_files/kghostview-desktops/ja.po
new file mode 100644
index 00000000..28440927
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF ビューア"
diff --git a/translations/desktop_files/kghostview-desktops/kghostview-desktops.pot b/translations/desktop_files/kghostview-desktops/kghostview-desktops.pot
new file mode 100644
index 00000000..b4c32562
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/kghostview-desktops.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr ""
diff --git a/translations/desktop_files/kghostview-desktops/kk.po b/translations/desktop_files/kghostview-desktops/kk.po
new file mode 100644
index 00000000..1d8256aa
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF файлдарын қарау"
diff --git a/translations/desktop_files/kghostview-desktops/km.po b/translations/desktop_files/kghostview-desktops/km.po
new file mode 100644
index 00000000..c81ca0b9
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "កម្មវិធី​មើល PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/lt.po b/translations/desktop_files/kghostview-desktops/lt.po
new file mode 100644
index 00000000..dd2f4882
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF žiūriklis"
diff --git a/translations/desktop_files/kghostview-desktops/lv.po b/translations/desktop_files/kghostview-desktops/lv.po
new file mode 100644
index 00000000..e6c4bf0a
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF Skatītājs"
diff --git a/translations/desktop_files/kghostview-desktops/ms.po b/translations/desktop_files/kghostview-desktops/ms.po
new file mode 100644
index 00000000..01d2cb11
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Pemapar PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/nb.po b/translations/desktop_files/kghostview-desktops/nb.po
new file mode 100644
index 00000000..d4261151
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS-/PDF-fremviser"
diff --git a/translations/desktop_files/kghostview-desktops/nds.po b/translations/desktop_files/kghostview-desktops/nds.po
new file mode 100644
index 00000000..afa89161
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PostScript-/PDF-Kieker"
diff --git a/translations/desktop_files/kghostview-desktops/ne.po b/translations/desktop_files/kghostview-desktops/ne.po
new file mode 100644
index 00000000..c9b6107b
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "केडीई घोस्ट दृश्य"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF दर्शक"
diff --git a/translations/desktop_files/kghostview-desktops/nl.po b/translations/desktop_files/kghostview-desktops/nl.po
new file mode 100644
index 00000000..f141c1ae
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PostScript/PDF-weergaveprogramma"
diff --git a/translations/desktop_files/kghostview-desktops/nn.po b/translations/desktop_files/kghostview-desktops/nn.po
new file mode 100644
index 00000000..4d0898b5
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-lesar"
diff --git a/translations/desktop_files/kghostview-desktops/nso.po b/translations/desktop_files/kghostview-desktops/nso.po
new file mode 100644
index 00000000..be751dfe
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/nso.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Molebeledi wa PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/pa.po b/translations/desktop_files/kghostview-desktops/pa.po
new file mode 100644
index 00000000..03bd9deb
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/pa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF ਦਰਸ਼ਕ"
diff --git a/translations/desktop_files/kghostview-desktops/pl.po b/translations/desktop_files/kghostview-desktops/pl.po
new file mode 100644
index 00000000..2ba2b3c8
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Przeglądarka plików PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/pt.po b/translations/desktop_files/kghostview-desktops/pt.po
new file mode 100644
index 00000000..10384202
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2022.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: 2022-04-03 18:21+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kghostview-desktop-files/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.11.2\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "KGhostView"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Visualizador de PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/pt_BR.po b/translations/desktop_files/kghostview-desktops/pt_BR.po
new file mode 100644
index 00000000..e5a11471
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Visualizador PDF/PS"
diff --git a/translations/desktop_files/kghostview-desktops/ro.po b/translations/desktop_files/kghostview-desktops/ro.po
new file mode 100644
index 00000000..bff283a3
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Vizualizor PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/ru.po b/translations/desktop_files/kghostview-desktops/ru.po
new file mode 100644
index 00000000..29b0a101
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Просмотр Postscript и PDF"
diff --git a/translations/desktop_files/kghostview-desktops/se.po b/translations/desktop_files/kghostview-desktops/se.po
new file mode 100644
index 00000000..d90e4bfa
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-čájeheaddji"
diff --git a/translations/desktop_files/kghostview-desktops/sk.po b/translations/desktop_files/kghostview-desktops/sk.po
new file mode 100644
index 00000000..4018c0fa
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Prehliadač PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/sl.po b/translations/desktop_files/kghostview-desktops/sl.po
new file mode 100644
index 00000000..c7321389
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Pregledovalnik datotek PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/sr.po b/translations/desktop_files/kghostview-desktops/sr.po
new file mode 100644
index 00000000..5debf178
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF приказивач"
diff --git a/translations/desktop_files/kghostview-desktops/sr@Latn.po b/translations/desktop_files/kghostview-desktops/sr@Latn.po
new file mode 100644
index 00000000..b8514ddb
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF prikazivač"
diff --git a/translations/desktop_files/kghostview-desktops/sv.po b/translations/desktop_files/kghostview-desktops/sv.po
new file mode 100644
index 00000000..ce1c9e9c
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "Kghostview"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF-visare"
diff --git a/translations/desktop_files/kghostview-desktops/ta.po b/translations/desktop_files/kghostview-desktops/ta.po
new file mode 100644
index 00000000..d6a89f16
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "கேமற்றொரு காட்சி"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF காட்சி"
diff --git a/translations/desktop_files/kghostview-desktops/tg.po b/translations/desktop_files/kghostview-desktops/tg.po
new file mode 100644
index 00000000..9ab7cc5b
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Хондани PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/th.po b/translations/desktop_files/kghostview-desktops/th.po
new file mode 100644
index 00000000..354253a5
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "เครื่องมือแสดงแฟ้มโพสต์สคริปต์ PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/tr.po b/translations/desktop_files/kghostview-desktops/tr.po
new file mode 100644
index 00000000..f05ea4db
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "GhostView"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF Görüntüleyici"
diff --git a/translations/desktop_files/kghostview-desktops/uk.po b/translations/desktop_files/kghostview-desktops/uk.po
new file mode 100644
index 00000000..a0378ba3
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kghostview-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "KGhostView"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Переглядач PDF/PS"
diff --git a/translations/desktop_files/kghostview-desktops/uz.po b/translations/desktop_files/kghostview-desktops/uz.po
new file mode 100644
index 00000000..9cddf836
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF koʻruvchi"
diff --git a/translations/desktop_files/kghostview-desktops/uz@cyrillic.po b/translations/desktop_files/kghostview-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..59f70628
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF кўрувчи"
diff --git a/translations/desktop_files/kghostview-desktops/ven.po b/translations/desktop_files/kghostview-desktops/ven.po
new file mode 100644
index 00000000..1fd53b42
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "Mbonalelo ya tshipuku tsha K"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Muvhoni wa PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/wa.po b/translations/desktop_files/kghostview-desktops/wa.po
new file mode 100644
index 00000000..5c507671
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Håyneu di documints PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/xh.po b/translations/desktop_files/kghostview-desktops/xh.po
new file mode 100644
index 00000000..9e4928d8
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr "Imboniselo yeKGhost"
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Umboniseli we PS/PDF"
diff --git a/translations/desktop_files/kghostview-desktops/zh_CN.po b/translations/desktop_files/kghostview-desktops/zh_CN.po
new file mode 100644
index 00000000..12876ec3
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF 查看器"
diff --git a/translations/desktop_files/kghostview-desktops/zh_HK.po b/translations/desktop_files/kghostview-desktops/zh_HK.po
new file mode 100644
index 00000000..e0f8def4
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF 檢視器"
diff --git a/translations/desktop_files/kghostview-desktops/zh_TW.po b/translations/desktop_files/kghostview-desktops/zh_TW.po
new file mode 100644
index 00000000..e8724024
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "PS/PDF 檢視器"
diff --git a/translations/desktop_files/kghostview-desktops/zu.po b/translations/desktop_files/kghostview-desktops/zu.po
new file mode 100644
index 00000000..f075a4de
--- /dev/null
+++ b/translations/desktop_files/kghostview-desktops/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:22+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kghostview.desktop:2 kghostview_part.desktop:2
+msgid "KGhostView"
+msgstr ""
+
+#. GenericName
+#: kghostview.desktop:3
+msgid "PS/PDF Viewer"
+msgstr "Umboniseli we PS/PDF"
diff --git a/translations/desktop_files/kmrml-desktops/af.po b/translations/desktop_files/kmrml-desktops/af.po
new file mode 100644
index 00000000..75e01c80
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/af.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr ""
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Soektog vir Soortgelyk Beelde..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Onttrekking Opmerk Taal Dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/ar.po b/translations/desktop_files/kmrml-desktops/ar.po
new file mode 100644
index 00000000..77f3d0f7
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ar.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "فهرس الصور"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "اعدادات لاستخدام أداة GNU للبحث عن الصور"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "صور;بحث;استعلام;Find;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "بحث عن الصور المتشابهه..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "مستند لغة ترميز استرجاع الوسائط المتعددة"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "برنامج MRML View"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "مراقب KDED KMRML Daemon"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/bg.po b/translations/desktop_files/kmrml-desktops/bg.po
new file mode 100644
index 00000000..84c6e161
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/bg.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Графичен индекс"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Настройване на програмата за индексиране и търсене на изображения"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"изображения; търсене; заявка; картинка; картинки; снимки; Images; Search; "
+"Query; Find; Gift; kmrml; mrml; CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Търсене на подобни изображения..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Стартиране на демоните при заявка и рестартиране на демони при грешка"
diff --git a/translations/desktop_files/kmrml-desktops/br.po b/translations/desktop_files/kmrml-desktops/br.po
new file mode 100644
index 00000000..527fb05a
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/br.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Meneger ar skeudenn"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr ""
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Gwel MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/bs.po b/translations/desktop_files/kmrml-desktops/bs.po
new file mode 100644
index 00000000..b9e27513
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/bs.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Indeks slika"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Podešavanje za upotrebu GNU Alata za pronalaženje slika"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;slike;pretraga;upit;nađi;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Traženje sličnih slika..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML nadzor demona"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Pokreće demone po potrebi i restartuje ih ako se sruše"
diff --git a/translations/desktop_files/kmrml-desktops/ca.po b/translations/desktop_files/kmrml-desktops/ca.po
new file mode 100644
index 00000000..f6cbf5fc
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ca.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Índex d'imatge"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configuració per a l'ús de l'eina de cerca d'imatges GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Imatges;Cerca;Consulta;Busca;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Cerca imatges similars..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Document de llenguatge de marcatge de recuperació multimèdia"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Vista MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Dimoni vigilant KDED KMRL"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Engega els dimonis sota petició i els torna a engegar si fallen"
diff --git a/translations/desktop_files/kmrml-desktops/cs.po b/translations/desktop_files/kmrml-desktops/cs.po
new file mode 100644
index 00000000..b0088f87
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/cs.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Rejstřík obrázků"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Konfigurace používání nástroje GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Obrázky;Hledat;Dotaz;Najít;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Hledat podobný obrázek..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML pohled"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Sledovač KMRML démonů"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Spouští démony na požádání a restartuje je při selhání"
diff --git a/translations/desktop_files/kmrml-desktops/cy.po b/translations/desktop_files/kmrml-desktops/cy.po
new file mode 100644
index 00000000..eb23589c
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/cy.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Mynegai Delweddau"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Ffurfweddiad am ddefnyddio'r Erfyn Canfod Delweddau GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Delweddau;Chwilio;Canfod;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Chwilio am Ddelweddau Tebyg..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dogfen Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Gwelydd MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Gwyliwr Ellyll KMRML KDED"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/da.po b/translations/desktop_files/kmrml-desktops/da.po
new file mode 100644
index 00000000..d7d28bf6
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/da.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Billedindeks"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Indstilling for brug af GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Billeder;Søgning;Forespørgsel;Find;Gave;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Søg efter lignende filer..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language-dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-visning"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML-dæmon-overvåger"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Starter dæmoner ved forespørgsel og genstarter dem ved fejl"
diff --git a/translations/desktop_files/kmrml-desktops/de.po b/translations/desktop_files/kmrml-desktops/de.po
new file mode 100644
index 00000000..3d8e169c
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/de.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Bildindex"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+"Einrichtung für die Benutzung des GNU Bildersuchwerkzeugs (GNU Image Finding "
+"Tool)"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Bilder;Suche;Anfrage;finden;Geschenk;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Nach ähnlichen Bildern suchen ..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Suche- und Beschreibungssprache-Dokument (MRML-Dokument)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-Ansicht"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Überwachung der KDE-Bildersuche"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Startet KMRML-Dienste bei Bedarf und im Fehlerfall neu"
diff --git a/translations/desktop_files/kmrml-desktops/el.po b/translations/desktop_files/kmrml-desktops/el.po
new file mode 100644
index 00000000..73d2cca2
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/el.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Ευρετήριο εικόνων"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Ρύθμιση για τη χρήση του εργαλείου αναζήτησης εικόνων GIFT"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Εικόνες;Αναζήτηση;Ερώτηση;Αναζήτηση;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Αναζήτηση για παρόμοιες εικόνες..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Έγγραφο Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Προβολή MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Επόπτης δαίμονα KMRML KDED"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Εκκινεί δαίμονες όταν ζητηθεί και τους επανεκκινεί κατά την αποτυχία"
diff --git a/translations/desktop_files/kmrml-desktops/eo.po b/translations/desktop_files/kmrml-desktops/eo.po
new file mode 100644
index 00000000..b85b4592
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/eo.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Bildindekso"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Serĉi Similajn Bildojn..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-Rigardo"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/es.po b/translations/desktop_files/kmrml-desktops/es.po
new file mode 100644
index 00000000..62d02c4e
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/es.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Índice de imágenes"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+"Configuración para utilizar la herramienta de búsqueda de imágenes de GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Imágenes;Búsqueda;Consulta;Buscar;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Búsqueda de imágenes similares..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Documento de lenguaje de descripción de descargas multimedia"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Vista de MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Guardián del demonio KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Inicia los demonios bajo demanda y los reinicia si fallan"
diff --git a/translations/desktop_files/kmrml-desktops/et.po b/translations/desktop_files/kmrml-desktops/et.po
new file mode 100644
index 00000000..847a20db
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/et.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Pildiindeks"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Seadistused GNU pildileidmisrakenduse kasutamiseks"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "pildid;otsing;päring;leia;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Otsi sarnaseid pilte..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimeedia otsingu märgistuskeele (MRML) dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML vaade"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML deemoni jälgija"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
+"Käivitab nõudmisel deemoneid ja taaskäivitab neid ebaõnnestumise korral"
diff --git a/translations/desktop_files/kmrml-desktops/eu.po b/translations/desktop_files/kmrml-desktops/eu.po
new file mode 100644
index 00000000..e96f179d
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/eu.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Irudiaren indizea"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU irudi aurkitzailea erabiltzeko konfigurazioa"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Irudiak;Bilaketa;Bilatu;Galdetu;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Bilatu antzeko irudiak..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language dokumentua"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML ikuspegia"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML deabru behatzailea"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Demonioak hasi eta bukau egiten ditu eskatzen zaionean"
diff --git a/translations/desktop_files/kmrml-desktops/fa.po b/translations/desktop_files/kmrml-desktops/fa.po
new file mode 100644
index 00000000..c12bf113
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/fa.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "نمایۀ تصویر"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "پیکربندی برای استفاده از ابزار یافتن تصویر GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "تصاویر، جستجو، پرس‌و‌جو، یافتن، Gift،kmrml،mrml،CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "جستجو برای تصاویر مشابه..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "سند زبان نشان‌گذاری بازیابی چند رسانه‌ای"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "نمای MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "پایشگر شبح KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "شبحها را بر اساس نیاز آغاز می‌کند و هنگام خرابی آنها را بازآغازی می‌کند"
diff --git a/translations/desktop_files/kmrml-desktops/fi.po b/translations/desktop_files/kmrml-desktops/fi.po
new file mode 100644
index 00000000..45d6b20a
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/fi.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Kuvahakemisto"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Asetukset GNU Image Finding Tool -ohjelman käyttöä varten"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Kuvat;Haku;Etsi;Lahja;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Etsi samankaltaisia kuvia..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedianhakuasiakirja"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-näkymä"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML-palvelimen tarkkailija"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
+"Käynnistää palvelimia tarpeen mukaan ja uudelleenkäynnistää ne virheen "
+"yhteydessä"
diff --git a/translations/desktop_files/kmrml-desktops/fr.po b/translations/desktop_files/kmrml-desktops/fr.po
new file mode 100644
index 00000000..c7b5f780
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/fr.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Indexation des images"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configuration pour l'utilisation du GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Images;Recherche;Requête;Chercher;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Recherche d'images semblables..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Document en langage Multimedia Retrieval Markup (MRML)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Affichage MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Observateur KDE du démon KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Lance les démons à la demande et les redémarre en cas d'échec"
diff --git a/translations/desktop_files/kmrml-desktops/ga.po b/translations/desktop_files/kmrml-desktops/ga.po
new file mode 100644
index 00000000..bddfa9fa
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ga.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr ""
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr ""
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Amharc MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/gl.po b/translations/desktop_files/kmrml-desktops/gl.po
new file mode 100644
index 00000000..6759179b
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/gl.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Índice imaxe"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configuración para empregar a «GNU Image Finding Tool»"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR; imaxes; procura;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Procurar imaxes semellantes..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Visor MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Vixiante do daemon de KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Iniciar daemons cando sexa preciso e reinicialos se fallan."
diff --git a/translations/desktop_files/kmrml-desktops/he.po b/translations/desktop_files/kmrml-desktops/he.po
new file mode 100644
index 00000000..f4955366
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/he.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "אינדקס תמונות"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "שינוי הגדרות כלי חיפוש התמונות של GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "תמונות;חיפוש;שאילתה;Gift;kmrml;mrml;CBIR; Images;Search;Query;Find;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "חיפוש תמונות דומות..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "מסמך שפת סימון לאחזור מולטימדיה"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "תצוגת MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "צופה תהליכי הרקע של KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "מפעיל תהליכי רקע לפי דרישה ומפעיל אותם מחדש במקרה של כשל"
diff --git a/translations/desktop_files/kmrml-desktops/hi.po b/translations/desktop_files/kmrml-desktops/hi.po
new file mode 100644
index 00000000..071b4bbc
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/hi.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "छवि सूची"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "ग्नू छवि खोज औज़ार को उपयोग करने के लिए कॉन्फ़िगरेशन"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "छवि; खोज;ढूंढ;तलाश;उपहार;केएमआरएमएल;एमआरएमएल;सीबीआईआर;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "एक जैसे छवियों के लिए ढूंढें..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "मल्टीमीडिया रिट्राइवल मार्कअप लैंग्वेज दस्तावेज़"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML दृश्य"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML डेमन वाचर"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/hu.po b/translations/desktop_files/kmrml-desktops/hu.po
new file mode 100644
index 00000000..39c8ab1d
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/hu.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Képkereső"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "A GIFT képkereső szolgáltatás beállításai"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "képek;keresés;lekérdezés;találat;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Ehhez hasonló képek keresése..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "MRML-fájl"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-nézet"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML szolgáltatásfigyelő"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Szükség esetén elindítja, hiba esetén újraindítja a szolgáltatásokat"
diff --git a/translations/desktop_files/kmrml-desktops/is.po b/translations/desktop_files/kmrml-desktops/is.po
new file mode 100644
index 00000000..cbfe1a8c
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/is.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Myndayfirlit"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Stillingar til þess að nota GNU myndleitartólið"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Leita að svipuðum myndum..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language skjal"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML sýn"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Eftirlit með KDED KMRML þjóninum"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Ræsir þjóna þegar þarf og endurræsir þá ef þeir bregðast"
diff --git a/translations/desktop_files/kmrml-desktops/it.po b/translations/desktop_files/kmrml-desktops/it.po
new file mode 100644
index 00000000..52b4f7f6
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/it.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Indice di immagini"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configurazione della ricerca delle immagini"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "immagini;ricerca;trovare;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Cerca immagini simili..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Documento MRML"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Visione MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Controllo del demone KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Avvia i demoni su richiesta e li riavvia in caso di problemi"
diff --git a/translations/desktop_files/kmrml-desktops/ja.po b/translations/desktop_files/kmrml-desktops/ja.po
new file mode 100644
index 00000000..9a444042
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ja.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "画像インデックス"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GIFT (GNU Image Finding Tool) を使用するための設定"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "画像;検索;クエリ;検索;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "同じような画像を検索..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language ドキュメント"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML ビュー"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML デーモンウォッチャー"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "デーモンをオンデマンドで起動し、失敗したときは再起動します。"
diff --git a/translations/desktop_files/kmrml-desktops/kk.po b/translations/desktop_files/kmrml-desktops/kk.po
new file mode 100644
index 00000000..fcb00e11
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/kk.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Кескіндер индексі"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU Image Finding Tool кескінді табу құралын пайдалану баптаулары"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Ұқсас кескіндерді іздеу..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "MRML (Multimedia Retrieval Markup Language) құжаты"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML файлдарды қарау"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML қызметі"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Талап бойынша қызметті жегу, жаңылса қайта жегу"
diff --git a/translations/desktop_files/kmrml-desktops/km.po b/translations/desktop_files/kmrml-desktops/km.po
new file mode 100644
index 00000000..139fab81
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/km.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "លិបិក្រម​រូបភាព"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "ការ​កំណត់​រចនាសម្ព័ន្ធ​ដើម្បី​ប្រើ​ឧបករណ៍​ស្វែងរក​រូបភាព​របស់ GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "រូបភាព;ស្វែងរក;សួរ;រក;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "ស្វែងរក​រូបភាព​ស្រដៀង​គ្នា..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "ឯកសារ Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "ទិដ្ឋភាព MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "កម្មវិធី​ឃ្លាំមើល​ដេមិន KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "ចាប់ផ្ដើម​ដេមិន​នៅ​ពេល​ត្រូវការ ហើយ​ចាប់ផ្ដើម​ពួក​វា​ឡើង​វិញ​នៅ​ពេល​បរាជ័យ"
diff --git a/translations/desktop_files/kmrml-desktops/kmrml-desktops.pot b/translations/desktop_files/kmrml-desktops/kmrml-desktops.pot
new file mode 100644
index 00000000..17babdf7
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/kmrml-desktops.pot
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr ""
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr ""
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/lt.po b/translations/desktop_files/kmrml-desktops/lt.po
new file mode 100644
index 00000000..ae81ebf7
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/lt.po
@@ -0,0 +1,60 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Paveikslėlių rodyklė"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU paveikslėlių paieškos įrankio konfigūracija"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"Images;Search;Query;Find;Gift;kmrml;mrml;CBIR; paveikslėliai;paieška;"
+"paklausimas;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Panašių paveikslėlių paieška..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup kalbos dokumentas"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML peržiūra"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML tarnybos stebėtojas"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
+"Paleidžia tarnybas pagal pareikalavimą ir paleidžia iš naujo nesėkmės atveju"
diff --git a/translations/desktop_files/kmrml-desktops/ms.po b/translations/desktop_files/kmrml-desktops/ms.po
new file mode 100644
index 00000000..908a516a
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ms.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Indeks Imej"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Konfigurasi untuk mengguna Alat Carian Imej GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Cari Imej Serupa..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dokumen Bahasa Capaian Tandatas Multimedia"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Paparan MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Pemerhati Daemon KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Mulakan daemons atas permintaan dan mula semula atas kegagalan"
diff --git a/translations/desktop_files/kmrml-desktops/nb.po b/translations/desktop_files/kmrml-desktops/nb.po
new file mode 100644
index 00000000..8896899b
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/nb.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Bildeindeks"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Tilpass GNU bildesøkingsverktøy"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Bilder;Søk;Spørringer;Finn;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Søk etter liknende bilder …"
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "«Multimedia Retrieval Markup Language»-dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML nisseovervåker"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Starter nisser på forespørsler og starter dem igjen ved feil."
diff --git a/translations/desktop_files/kmrml-desktops/nds.po b/translations/desktop_files/kmrml-desktops/nds.po
new file mode 100644
index 00000000..2eda29e0
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/nds.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Bildindex"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Inrichten för dat GNU-Bildsöökwarktüüch"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Biller;Söök;Anfraag;söken;Gaav;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Na lieke Biller söken..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dokment in de Affraag-Utteekspraak för Multimedia-Dokmenten"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-Ansicht"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KMRML-Luerdämoon för KDED"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Start Achtergrundperzessen op Nafraag un bi Fehlers nieg"
diff --git a/translations/desktop_files/kmrml-desktops/ne.po b/translations/desktop_files/kmrml-desktops/ne.po
new file mode 100644
index 00000000..bcd9555f
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ne.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "छवि अनुक्रमणिका"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU छवि फेला पार्ने उपकरण प्रयोगका लागि कन्फिगरेसन"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "उस्तै छविका लागि खोजी गर्नुहोस्..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "मल्टिमिडिया पुन: प्राप्ति मार्कअप भाषा कागजात"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML दृश्य"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML डेइमन दर्शक"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "माग गरेको बेलामा डेइमन सुरु गर्दछ र अफफल भएमा फेरि सुरु गर्दछ"
diff --git a/translations/desktop_files/kmrml-desktops/nl.po b/translations/desktop_files/kmrml-desktops/nl.po
new file mode 100644
index 00000000..7906db03
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/nl.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Afbeeldingenindex"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configuratie voor het gebruik van de GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"illustraties;figuren;figuur;afbeeldingen;plaatjes;zoeken;find;gift;kmrml;"
+"mrml;CBIR;images;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Zoeken naar vergelijkbare afbeeldingen..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language-document"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-weergave"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML-daemonbeheer"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Start achtergrondprogramma's op en herstart deze indien nodig"
diff --git a/translations/desktop_files/kmrml-desktops/nn.po b/translations/desktop_files/kmrml-desktops/nn.po
new file mode 100644
index 00000000..c44476b9
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/nn.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Biletindeks"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Oppsett av GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "bilete;søk;spørjing;finn;gåve;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Søk etter liknande bilete …"
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "«Multimedia Retrieval Markup Language»-dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML-nisseovervaking"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Startar nissar når dei trengst og startar dei om att ved feil"
diff --git a/translations/desktop_files/kmrml-desktops/nso.po b/translations/desktop_files/kmrml-desktops/nso.po
new file mode 100644
index 00000000..c42742db
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/nso.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Palo ya Ponagalo"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Diponagalo;Nyaka;Kgokgonego;Hwetsa;Mpho;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Nyako ya Diponagalo tseo di Swanago..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Tokomane ya Leleme la Peakanyo ya Kutullo ya Multimedia"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Pono ya MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/pa.po b/translations/desktop_files/kmrml-desktops/pa.po
new file mode 100644
index 00000000..8716598a
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/pa.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr ""
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr ""
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML ਝਲਕ"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/pl.po b/translations/desktop_files/kmrml-desktops/pl.po
new file mode 100644
index 00000000..7b8a9ebe
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/pl.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Spis obrazków"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Konfiguracja Gifta (narzędzia do szukania obrazków GNU)"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Obrazki;Szukanie;Zapytanie;Szukaj;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Szukaj podobnych obrazków"
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dokument MRML (Język Znacznikowy Pozyskiwania Multimediów)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Widok MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Monitor usług KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Uruchamia usługi na żądanie i wznawia je po awarii"
diff --git a/translations/desktop_files/kmrml-desktops/pt.po b/translations/desktop_files/kmrml-desktops/pt.po
new file mode 100644
index 00000000..0b568fb8
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/pt.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Índice de Imagens"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configuração da Ferramenta de Procura de Imagens da GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Imagens;Procurar;Pesquisar;Encontrar;Prenda;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Procurar por Imagens Semelhantes..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Documento de Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Janela de MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Monitor KMRML de Servidores KDED"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Inicia os servidores a pedido e reinicia-os em caso de falha"
diff --git a/translations/desktop_files/kmrml-desktops/pt_BR.po b/translations/desktop_files/kmrml-desktops/pt_BR.po
new file mode 100644
index 00000000..cd5eb6f4
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/pt_BR.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Índice de Imagens"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configuração para o uso da Ferramenta de Procura de Imagens GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Imagens;Busca;Consulta;Procurar;Presente;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Procurar por Imagens Parecidas..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Documento da Linguagem de Marcação de Recuperação Multimídia "
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Visualização de MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Sentinela de Serviços KDED"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Inicia serviços sob demanda e reinicia-os em caso de falha"
diff --git a/translations/desktop_files/kmrml-desktops/ro.po b/translations/desktop_files/kmrml-desktops/ro.po
new file mode 100644
index 00000000..49275648
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ro.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Index imagini"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Configurare pentru GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "imagini;căutare;caută;interogare;găseşte;dar;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Caută imagini similare..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Document MRML (limbaj de marcare pentru căutări multimedia)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Vizualizare MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Demon KDED pentru MRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Porneşte demonii la cerere şi îi reporneşte în caz de eroare"
diff --git a/translations/desktop_files/kmrml-desktops/ru.po b/translations/desktop_files/kmrml-desktops/ru.po
new file mode 100644
index 00000000..a7f9afd5
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ru.po
@@ -0,0 +1,60 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Alexander Golubev <fatzer2@gmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: 2021-01-21 09:11+0000\n"
+"Last-Translator: Alexander Golubev <fatzer2@gmail.com>\n"
+"Language-Team: Russian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kmrml-desktop-files/ru/>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.4.2\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Индексирование изображений"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+"Настройка использования программы поиска изображений GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "изображения;поиск;запрос;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Поиск похожих изображений..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Документ MRML (Multimedia Retrieval Markup Language)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Просмотр MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Служба наблюдения за демоном KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Поддержка протокола MRML"
diff --git a/translations/desktop_files/kmrml-desktops/se.po b/translations/desktop_files/kmrml-desktops/se.po
new file mode 100644
index 00000000..dd0db4d6
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/se.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Govvaindeaksa"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Heivet GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Oza seammalágana govaid …"
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "«Multimedia Retrieval Markup Language»-dokumeanta"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML-čájeheapmi"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML-duogášprográmmagoziheaddji"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/sk.po b/translations/desktop_files/kmrml-desktops/sk.po
new file mode 100644
index 00000000..7df0200b
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/sk.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Katalóg obrázkov"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Konfigurácia pre GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Obrázky;Hľadanie;Dotazy;Nájsť;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Hľadať podobné obrázky..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dokument Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Prehliadač MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Sledovanie démona KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Spustí démonov podľa požiadaviek a pri zlyhaní ich reštartuje"
diff --git a/translations/desktop_files/kmrml-desktops/sl.po b/translations/desktop_files/kmrml-desktops/sl.po
new file mode 100644
index 00000000..5239c30b
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/sl.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Seznam slik"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Nastavitve za uporabo orodja GNU za iskanje slik"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "slike;iskanje;povpraševanje;išči;najdi;gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Išči podobne slike ..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dokument Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Pregledovalnik MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Opazovalnik demona KMRML za KDED"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Na zahtevo zažene demone in jih ob napaki znova zažene"
diff --git a/translations/desktop_files/kmrml-desktops/sr.po b/translations/desktop_files/kmrml-desktops/sr.po
new file mode 100644
index 00000000..c0abd1ac
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/sr.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Индекс слика"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Подешавање коришћења GNU-овог алата за тражење слика"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;слике;тражи;упит;нађи;поклон;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Потражи сличне слике..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Документ у обележивачком језику за добављање мултимедије (MRML)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML приказивач"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML демон за праћење"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "На захтев покреће демоне и поново их покреће ако се сруше"
diff --git a/translations/desktop_files/kmrml-desktops/sr@Latn.po b/translations/desktop_files/kmrml-desktops/sr@Latn.po
new file mode 100644
index 00000000..1e6ad7cf
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/sr@Latn.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Indeks slika"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Podešavanje korišćenja GNU-ovog alata za traženje slika"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;slike;traži;upit;nađi;poklon;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Potraži slične slike..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Dokument u obeleživačkom jeziku za dobavljanje multimedije (MRML)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML prikazivač"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML demon za praćenje"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Na zahtev pokreće demone i ponovo ih pokreće ako se sruše"
diff --git a/translations/desktop_files/kmrml-desktops/sv.po b/translations/desktop_files/kmrml-desktops/sv.po
new file mode 100644
index 00000000..8340f205
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/sv.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Bildindex"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Inställning för att använda GNU:s bildsökverktyg"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Bilder;Sök;Förfrågan;Hitta;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Sök efter liknande bilder..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language-dokument"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML-demonbevakare"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Starta demoner vid behov och starta om dem vid fel"
diff --git a/translations/desktop_files/kmrml-desktops/ta.po b/translations/desktop_files/kmrml-desktops/ta.po
new file mode 100644
index 00000000..c8d68029
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ta.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "பிம்ப அட்டவணை"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU பிம்ப தேடுதல் கருவியை பயன்படுத்துவதற்கான அமைப்பு"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "பிம்பங்கள்; தேடு; கேள்வி; கண்டுபிடி;பரிசு;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "இதே போன்ற பிம்பங்களை தேடுக..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "பல் ஊடக திரும்பப்பெறு அடையாள மொழி ஆவணம்"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML காட்சி"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED டிமென் வாட்சர்"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "அவசிய நேரத்தில் டிமென்னை துவக்குகிறது. இயலாதபோது திரும்ப துவக்குகிறது"
diff --git a/translations/desktop_files/kmrml-desktops/tg.po b/translations/desktop_files/kmrml-desktops/tg.po
new file mode 100644
index 00000000..16b268ad
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/tg.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Индексатсия кардани тасвирот"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+"Танзимоти истифодабарии барномаиҷустуҷӯи тасвироти GNU Image Finding Tool"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "тасвирот;ҷустуҷӯӣ;дархост;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Ҷустуҷӯи тасвироти якхела..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Санади MRML (Multimedia Retrieval Markup Language)"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Намоиши MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Мудири демони KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
+"Оғози демон аз рӯи дархост ва ҳангоми нуқсони он аз сари нав оғоз намудан."
diff --git a/translations/desktop_files/kmrml-desktops/th.po b/translations/desktop_files/kmrml-desktops/th.po
new file mode 100644
index 00000000..417ed14a
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/th.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "ดัชนีรูปภาพ"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "ค้นหาภาพที่เหมือนกัน..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "เอกสาร Multimedia Retrieval Markup Language"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "ดู MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "ตัวเฝ้าดูแดมอน KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/tr.po b/translations/desktop_files/kmrml-desktops/tr.po
new file mode 100644
index 00000000..4e290d03
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/tr.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Resim İndeksi"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU Resim Bulma Aracı yapılandırması"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Resimler;Ara;Arama;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Benzer Resimleri Ara..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Multimedia Retrieval Markup Language Belgesi"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML Görünümü"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML Aracı İzleyici"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "İstek halinde programı başlatır ve hata durumunda yeniden başlatır."
diff --git a/translations/desktop_files/kmrml-desktops/uk.po b/translations/desktop_files/kmrml-desktops/uk.po
new file mode 100644
index 00000000..fe6fba11
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/uk.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Індекс зображень"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Налаштування засобу пошуку зображень GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "зображення;пошук;запит;знайти;подарунок;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Пошук схожих зображень..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Документ формату зберігання мультимедіа"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Перегляд MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "Спостерігач демону KDED KMRML"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "Запускає демони при потребі та перезапускає їх при аварії"
diff --git a/translations/desktop_files/kmrml-desktops/uz.po b/translations/desktop_files/kmrml-desktops/uz.po
new file mode 100644
index 00000000..e42f9335
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/uz.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Rasm indeksi"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Oʻxshash rasmlarni qidirish"
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/uz@cyrillic.po b/translations/desktop_files/kmrml-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..ec6f347d
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/uz@cyrillic.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Расм индекси"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr ""
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Ўхшаш расмларни қидириш"
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/ven.po b/translations/desktop_files/kmrml-desktops/ven.po
new file mode 100644
index 00000000..2e045d76
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/ven.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Index ya tshifanyiso"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Nzudzanyo yau shumisa tshishumiswa tshau toda tshifanyiso tsha GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Zwifanyiso;Toda;Mbudziso;Wana;Mpho;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Todani zwifanyiso zwielanaho..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Manwalwa a luambo lwau humbula zwa khasho nnzhi"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Mbonalelo ya MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/wa.po b/translations/desktop_files/kmrml-desktops/wa.po
new file mode 100644
index 00000000..bdf5607e
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/wa.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Indecse des imådjes"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Apontiaedje po-z eployî l' usteye di cweraedje d' imådjes di GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Imådjes;Cweri;Cweraedje;Trover;Gift;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Cweri après des rshonnantès imådjes..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr ""
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr ""
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/xh.po b/translations/desktop_files/kmrml-desktops/xh.po
new file mode 100644
index 00000000..147e2dcd
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/xh.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Isalathisi Somfanekiso"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Uqwalaselo lokusebenzisa Isixhobo Sokufumana Umfanekiso we GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Imifanekiso;Uphendlo;Ubuzo;fumana;Isiphiwo;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Phendla Imifanekiso Efanayo..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Uxwebhu Lolwimi Lophawulo phezulu Lokufumana i Multimedia"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML Imbono"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kmrml-desktops/zh_CN.po b/translations/desktop_files/kmrml-desktops/zh_CN.po
new file mode 100644
index 00000000..669ee44d
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/zh_CN.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "图像索引"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "使用 GNU 图像查找工具的配置"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr ""
+"Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;图像;搜索;查询;查找;礼物;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "搜索类似图像..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "多媒体检索标记语言文档"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML 查看器"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML 守护程序监视器"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "按需启动守护程序并在失败时重新启动"
diff --git a/translations/desktop_files/kmrml-desktops/zh_HK.po b/translations/desktop_files/kmrml-desktops/zh_HK.po
new file mode 100644
index 00000000..cf409cf4
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/zh_HK.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "圖像索引"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU 圖像搜尋工具的設定"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;圖像;搜尋;查詢;尋找;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "尋找類似的圖像..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "多媒體取得標記語言文件"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML 檢視"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML 系統程式監察器"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "依要求啟動系統程式並在失敗時重新啟動它們。"
diff --git a/translations/desktop_files/kmrml-desktops/zh_TW.po b/translations/desktop_files/kmrml-desktops/zh_TW.po
new file mode 100644
index 00000000..86aed715
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/zh_TW.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "影像索引"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "GNU 影像搜尋工具組態"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;影像;搜尋;查詢;尋找;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "尋找類似的影像..."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "多媒體補償標記語言文件"
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "MRML 檢視器"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr "KDED KMRML 伺服程式監看器"
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr "需要時啟動守護程式,失敗的話重新啟動"
diff --git a/translations/desktop_files/kmrml-desktops/zu.po b/translations/desktop_files/kmrml-desktops/zu.po
new file mode 100644
index 00000000..29d4f74b
--- /dev/null
+++ b/translations/desktop_files/kmrml-desktops/zu.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kcontrol/kcmkmrml.desktop:9
+msgid "Image Index"
+msgstr "Isiqalo Sesithombe"
+
+#. Comment
+#: kcontrol/kcmkmrml.desktop:11
+msgid "Configuration for using the GNU Image Finding Tool"
+msgstr "Inhlanganiselo yokusebenzisa Ithuluzi Lokuthola Isithombe se-GNU"
+
+#. Keywords
+#: kcontrol/kcmkmrml.desktop:13
+msgid "Images;Search;Query;Find;Gift;kmrml;mrml;CBIR;"
+msgstr "Izithombe;Funa;Buza;Thola;Isipho;kmrml;mrml;CBIR;"
+
+#. Name
+#: mrml-servicemenu.desktop:6
+msgid "Search for Similar Images..."
+msgstr "Sesha ukuthola Izithombe Ezifanayo...."
+
+#. Comment
+#: mrml.desktop:2
+msgid "Multimedia Retrieval Markup Language Document"
+msgstr "Ushicilelo Lwe-Multimedia Retrieval Markup Language "
+
+#. Name
+#: mrml_part.desktop:4
+msgid "MRML View"
+msgstr "Umbukiso we-MRML"
+
+#. Name
+#: server/daemonwatcher.desktop:3
+msgid "KDED KMRML Daemon Watcher"
+msgstr ""
+
+#. Comment
+#: server/daemonwatcher.desktop:4
+msgid "Starts daemons on demand and restarts them on failure"
+msgstr ""
diff --git a/translations/desktop_files/kolourpaint.desktop/af.po b/translations/desktop_files/kolourpaint.desktop/af.po
new file mode 100644
index 00000000..9085b474
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Verf Program"
diff --git a/translations/desktop_files/kolourpaint.desktop/ar.po b/translations/desktop_files/kolourpaint.desktop/ar.po
new file mode 100644
index 00000000..06698299
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "برنامج تلوين"
diff --git a/translations/desktop_files/kolourpaint.desktop/bg.po b/translations/desktop_files/kolourpaint.desktop/bg.po
new file mode 100644
index 00000000..e2262912
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Графичен редактор"
diff --git a/translations/desktop_files/kolourpaint.desktop/br.po b/translations/desktop_files/kolourpaint.desktop/br.po
new file mode 100644
index 00000000..79b22868
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/br.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Goulev tresañ"
diff --git a/translations/desktop_files/kolourpaint.desktop/bs.po b/translations/desktop_files/kolourpaint.desktop/bs.po
new file mode 100644
index 00000000..0290b247
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Jednostavni program za crtanje"
diff --git a/translations/desktop_files/kolourpaint.desktop/ca.po b/translations/desktop_files/kolourpaint.desktop/ca.po
new file mode 100644
index 00000000..48b64bc9
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programa de pintura"
diff --git a/translations/desktop_files/kolourpaint.desktop/cs.po b/translations/desktop_files/kolourpaint.desktop/cs.po
new file mode 100644
index 00000000..f60c0812
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Kreslící program"
diff --git a/translations/desktop_files/kolourpaint.desktop/cy.po b/translations/desktop_files/kolourpaint.desktop/cy.po
new file mode 100644
index 00000000..33383843
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Rhaglen Peintio"
diff --git a/translations/desktop_files/kolourpaint.desktop/da.po b/translations/desktop_files/kolourpaint.desktop/da.po
new file mode 100644
index 00000000..f88142c2
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Maleprogram"
diff --git a/translations/desktop_files/kolourpaint.desktop/de.po b/translations/desktop_files/kolourpaint.desktop/de.po
new file mode 100644
index 00000000..0f44c02e
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Mal- und Zeichenprogramm"
diff --git a/translations/desktop_files/kolourpaint.desktop/el.po b/translations/desktop_files/kolourpaint.desktop/el.po
new file mode 100644
index 00000000..8ec7ec0f
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Πρόγραμμα ζωγραφικής"
diff --git a/translations/desktop_files/kolourpaint.desktop/eo.po b/translations/desktop_files/kolourpaint.desktop/eo.po
new file mode 100644
index 00000000..16d0be2c
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Pentrilo"
diff --git a/translations/desktop_files/kolourpaint.desktop/es.po b/translations/desktop_files/kolourpaint.desktop/es.po
new file mode 100644
index 00000000..df4b77c4
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programa de pintura"
diff --git a/translations/desktop_files/kolourpaint.desktop/et.po b/translations/desktop_files/kolourpaint.desktop/et.po
new file mode 100644
index 00000000..702fd294
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Joonistusprogramm"
diff --git a/translations/desktop_files/kolourpaint.desktop/eu.po b/translations/desktop_files/kolourpaint.desktop/eu.po
new file mode 100644
index 00000000..7fcc8e50
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Marrazteko programa"
diff --git a/translations/desktop_files/kolourpaint.desktop/fa.po b/translations/desktop_files/kolourpaint.desktop/fa.po
new file mode 100644
index 00000000..2d5df206
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "برنامۀ رنگ"
diff --git a/translations/desktop_files/kolourpaint.desktop/fi.po b/translations/desktop_files/kolourpaint.desktop/fi.po
new file mode 100644
index 00000000..a3264b10
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Piirto-ohjelma"
diff --git a/translations/desktop_files/kolourpaint.desktop/fr.po b/translations/desktop_files/kolourpaint.desktop/fr.po
new file mode 100644
index 00000000..5ebcef83
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Petit programme de dessin"
diff --git a/translations/desktop_files/kolourpaint.desktop/ga.po b/translations/desktop_files/kolourpaint.desktop/ga.po
new file mode 100644
index 00000000..59a93b37
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ga.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Clár Péinteála"
diff --git a/translations/desktop_files/kolourpaint.desktop/gl.po b/translations/desktop_files/kolourpaint.desktop/gl.po
new file mode 100644
index 00000000..e1a34b83
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programa de debuxo"
diff --git a/translations/desktop_files/kolourpaint.desktop/he.po b/translations/desktop_files/kolourpaint.desktop/he.po
new file mode 100644
index 00000000..ee9099bd
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "תוכנית ציור"
diff --git a/translations/desktop_files/kolourpaint.desktop/hi.po b/translations/desktop_files/kolourpaint.desktop/hi.po
new file mode 100644
index 00000000..c208229c
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "छवि बनाने का प्रोग्राम"
diff --git a/translations/desktop_files/kolourpaint.desktop/hr.po b/translations/desktop_files/kolourpaint.desktop/hr.po
new file mode 100644
index 00000000..dd028f0a
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Program za slikanje"
diff --git a/translations/desktop_files/kolourpaint.desktop/hu.po b/translations/desktop_files/kolourpaint.desktop/hu.po
new file mode 100644
index 00000000..ceb61692
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Rajzolóprogram"
diff --git a/translations/desktop_files/kolourpaint.desktop/is.po b/translations/desktop_files/kolourpaint.desktop/is.po
new file mode 100644
index 00000000..4d276f50
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Teikniforrit"
diff --git a/translations/desktop_files/kolourpaint.desktop/it.po b/translations/desktop_files/kolourpaint.desktop/it.po
new file mode 100644
index 00000000..f1471fac
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: 2021-05-17 06:10+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kolourpaint-kolourpaintdesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "KolourPaint"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programma di disegno"
diff --git a/translations/desktop_files/kolourpaint.desktop/ja.po b/translations/desktop_files/kolourpaint.desktop/ja.po
new file mode 100644
index 00000000..0d63a78a
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "ペイントプログラム"
diff --git a/translations/desktop_files/kolourpaint.desktop/kk.po b/translations/desktop_files/kolourpaint.desktop/kk.po
new file mode 100644
index 00000000..a7f50300
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Сурет салу бағдарламасы"
diff --git a/translations/desktop_files/kolourpaint.desktop/km.po b/translations/desktop_files/kolourpaint.desktop/km.po
new file mode 100644
index 00000000..ab99ed82
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "កម្មវិធី​គូរ"
diff --git a/translations/desktop_files/kolourpaint.desktop/kolourpaint.desktop.pot b/translations/desktop_files/kolourpaint.desktop/kolourpaint.desktop.pot
new file mode 100644
index 00000000..07ecadcf
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/kolourpaint.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr ""
diff --git a/translations/desktop_files/kolourpaint.desktop/lt.po b/translations/desktop_files/kolourpaint.desktop/lt.po
new file mode 100644
index 00000000..b8e9aa1f
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Piešimo programa"
diff --git a/translations/desktop_files/kolourpaint.desktop/lv.po b/translations/desktop_files/kolourpaint.desktop/lv.po
new file mode 100644
index 00000000..2051cb88
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Krāsošanas Programma"
diff --git a/translations/desktop_files/kolourpaint.desktop/ms.po b/translations/desktop_files/kolourpaint.desktop/ms.po
new file mode 100644
index 00000000..0f372a07
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Program Mewarna"
diff --git a/translations/desktop_files/kolourpaint.desktop/mt.po b/translations/desktop_files/kolourpaint.desktop/mt.po
new file mode 100644
index 00000000..b70c0e5e
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/mt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programm sempliċi tat-tpinġija"
diff --git a/translations/desktop_files/kolourpaint.desktop/nb.po b/translations/desktop_files/kolourpaint.desktop/nb.po
new file mode 100644
index 00000000..c6a899d1
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "KPaint"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Maleprogram"
diff --git a/translations/desktop_files/kolourpaint.desktop/nds.po b/translations/desktop_files/kolourpaint.desktop/nds.po
new file mode 100644
index 00000000..0fbc43fe
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Maalprogramm"
diff --git a/translations/desktop_files/kolourpaint.desktop/ne.po b/translations/desktop_files/kolourpaint.desktop/ne.po
new file mode 100644
index 00000000..7151c7ff
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "रङ पेन्ट"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "पेन्ट कार्यक्रम"
diff --git a/translations/desktop_files/kolourpaint.desktop/nl.po b/translations/desktop_files/kolourpaint.desktop/nl.po
new file mode 100644
index 00000000..d8ba870e
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Tekenprogramma"
diff --git a/translations/desktop_files/kolourpaint.desktop/nn.po b/translations/desktop_files/kolourpaint.desktop/nn.po
new file mode 100644
index 00000000..3940cd49
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Måleprogram"
diff --git a/translations/desktop_files/kolourpaint.desktop/nso.po b/translations/desktop_files/kolourpaint.desktop/nso.po
new file mode 100644
index 00000000..7bddcd47
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/nso.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Lenaneo la Paint"
diff --git a/translations/desktop_files/kolourpaint.desktop/pa.po b/translations/desktop_files/kolourpaint.desktop/pa.po
new file mode 100644
index 00000000..7274c1b0
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/pa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "ਕੇ-ਰੰਗ-ਪੇਂਟ"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "ਰੰਗ ਕਾਰਜ"
diff --git a/translations/desktop_files/kolourpaint.desktop/pl.po b/translations/desktop_files/kolourpaint.desktop/pl.po
new file mode 100644
index 00000000..8c66edb3
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Program Paint"
diff --git a/translations/desktop_files/kolourpaint.desktop/pt.po b/translations/desktop_files/kolourpaint.desktop/pt.po
new file mode 100644
index 00000000..a117d168
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2022.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: 2022-05-20 14:22+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kolourpaint-kolourpaintdesktop/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.12.2\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "KolourPaint"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programa de Pintura"
diff --git a/translations/desktop_files/kolourpaint.desktop/pt_BR.po b/translations/desktop_files/kolourpaint.desktop/pt_BR.po
new file mode 100644
index 00000000..524076f2
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Programa de Pintura"
diff --git a/translations/desktop_files/kolourpaint.desktop/ro.po b/translations/desktop_files/kolourpaint.desktop/ro.po
new file mode 100644
index 00000000..c58c402c
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Program de desenare"
diff --git a/translations/desktop_files/kolourpaint.desktop/ru.po b/translations/desktop_files/kolourpaint.desktop/ru.po
new file mode 100644
index 00000000..5bee7fce
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Графический редактор"
diff --git a/translations/desktop_files/kolourpaint.desktop/rw.po b/translations/desktop_files/kolourpaint.desktop/rw.po
new file mode 100644
index 00000000..e328a5ed
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/rw.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Porogaramu Gusiga irangi"
diff --git a/translations/desktop_files/kolourpaint.desktop/se.po b/translations/desktop_files/kolourpaint.desktop/se.po
new file mode 100644
index 00000000..bef0b905
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Málenprográmma"
diff --git a/translations/desktop_files/kolourpaint.desktop/sk.po b/translations/desktop_files/kolourpaint.desktop/sk.po
new file mode 100644
index 00000000..f633a255
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Kreslenie"
diff --git a/translations/desktop_files/kolourpaint.desktop/sl.po b/translations/desktop_files/kolourpaint.desktop/sl.po
new file mode 100644
index 00000000..f6a9681e
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Slikarski program"
diff --git a/translations/desktop_files/kolourpaint.desktop/sr.po b/translations/desktop_files/kolourpaint.desktop/sr.po
new file mode 100644
index 00000000..626a4888
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Програм за сликање"
diff --git a/translations/desktop_files/kolourpaint.desktop/sr@Latn.po b/translations/desktop_files/kolourpaint.desktop/sr@Latn.po
new file mode 100644
index 00000000..443125c4
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Program za slikanje"
diff --git a/translations/desktop_files/kolourpaint.desktop/sv.po b/translations/desktop_files/kolourpaint.desktop/sv.po
new file mode 100644
index 00000000..330f01f5
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "Kolourpaint"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Ritprogram"
diff --git a/translations/desktop_files/kolourpaint.desktop/ta.po b/translations/desktop_files/kolourpaint.desktop/ta.po
new file mode 100644
index 00000000..0ec2439a
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "நிற பெயின்ட்"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "பெயிண்ட் நிரலி"
diff --git a/translations/desktop_files/kolourpaint.desktop/tg.po b/translations/desktop_files/kolourpaint.desktop/tg.po
new file mode 100644
index 00000000..1eda2c2a
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Муҳаррири графикӣ"
diff --git a/translations/desktop_files/kolourpaint.desktop/th.po b/translations/desktop_files/kolourpaint.desktop/th.po
new file mode 100644
index 00000000..8ad9cc0a
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "โปรแกรมวาดภาพธรรมดาๆ"
diff --git a/translations/desktop_files/kolourpaint.desktop/tr.po b/translations/desktop_files/kolourpaint.desktop/tr.po
new file mode 100644
index 00000000..736a44a4
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Boyama Programı"
diff --git a/translations/desktop_files/kolourpaint.desktop/uk.po b/translations/desktop_files/kolourpaint.desktop/uk.po
new file mode 100644
index 00000000..2beae38c
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kolourpaint-kolourpaintdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "KolourPaint"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Програма для малювання"
diff --git a/translations/desktop_files/kolourpaint.desktop/uz.po b/translations/desktop_files/kolourpaint.desktop/uz.po
new file mode 100644
index 00000000..03da0dcd
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Chizish dasturi"
diff --git a/translations/desktop_files/kolourpaint.desktop/uz@cyrillic.po b/translations/desktop_files/kolourpaint.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..f9bf30ab
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Чизиш дастури"
diff --git a/translations/desktop_files/kolourpaint.desktop/ven.po b/translations/desktop_files/kolourpaint.desktop/ven.po
new file mode 100644
index 00000000..b32fa738
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Mbekanyamushumo ya Pennde"
diff --git a/translations/desktop_files/kolourpaint.desktop/wa.po b/translations/desktop_files/kolourpaint.desktop/wa.po
new file mode 100644
index 00000000..e63c2388
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Program di dessinaedje"
diff --git a/translations/desktop_files/kolourpaint.desktop/xh.po b/translations/desktop_files/kolourpaint.desktop/xh.po
new file mode 100644
index 00000000..c1777b14
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Udweliso lwenkqubo lwepeyinti"
diff --git a/translations/desktop_files/kolourpaint.desktop/zh_CN.po b/translations/desktop_files/kolourpaint.desktop/zh_CN.po
new file mode 100644
index 00000000..df075a1b
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "绘图程序"
diff --git a/translations/desktop_files/kolourpaint.desktop/zh_HK.po b/translations/desktop_files/kolourpaint.desktop/zh_HK.po
new file mode 100644
index 00000000..04957226
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "繪圖程式"
diff --git a/translations/desktop_files/kolourpaint.desktop/zh_TW.po b/translations/desktop_files/kolourpaint.desktop/zh_TW.po
new file mode 100644
index 00000000..f2e10af3
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr "KolourPaint 小畫家"
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "繪圖程式"
diff --git a/translations/desktop_files/kolourpaint.desktop/zu.po b/translations/desktop_files/kolourpaint.desktop/zu.po
new file mode 100644
index 00000000..3dfe9b7e
--- /dev/null
+++ b/translations/desktop_files/kolourpaint.desktop/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kolourpaint.desktop:3
+msgid "KolourPaint"
+msgstr ""
+
+#. GenericName
+#: kolourpaint.desktop:4
+msgid "Paint Program"
+msgstr "Elila Iprogremu Kapende"
diff --git a/translations/desktop_files/kooka.desktop/af.po b/translations/desktop_files/kooka.desktop/af.po
new file mode 100644
index 00000000..d9a99822
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skandeer & Optiese karakter herkenning Program"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ar.po b/translations/desktop_files/kooka.desktop/ar.po
new file mode 100644
index 00000000..45ded4bf
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "برنامج للمسح الضوئي"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "برنامج Kooka"
diff --git a/translations/desktop_files/kooka.desktop/bg.po b/translations/desktop_files/kooka.desktop/bg.po
new file mode 100644
index 00000000..b0bc662c
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Сканиране"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/bs.po b/translations/desktop_files/kooka.desktop/bs.po
new file mode 100644
index 00000000..47087688
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program za skeniranje i OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ca.po b/translations/desktop_files/kooka.desktop/ca.po
new file mode 100644
index 00000000..81159301
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Programa d'escaneig i OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/cs.po b/translations/desktop_files/kooka.desktop/cs.po
new file mode 100644
index 00000000..a972a857
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program pro skenování a OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/cy.po b/translations/desktop_files/kooka.desktop/cy.po
new file mode 100644
index 00000000..460aa28d
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Rhaglen Sganio ac OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/da.po b/translations/desktop_files/kooka.desktop/da.po
new file mode 100644
index 00000000..ed91cb80
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skanne- & OCR-program"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/de.po b/translations/desktop_files/kooka.desktop/de.po
new file mode 100644
index 00000000..745e7d87
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Scan- und OCR-Programm"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/el.po b/translations/desktop_files/kooka.desktop/el.po
new file mode 100644
index 00000000..371bd46d
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Πρόγραμμα Σάρωσης & OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/eo.po b/translations/desktop_files/kooka.desktop/eo.po
new file mode 100644
index 00000000..046d497c
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Bildbitiga programo kaj tekstrekono"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "Kokao"
diff --git a/translations/desktop_files/kooka.desktop/es.po b/translations/desktop_files/kooka.desktop/es.po
new file mode 100644
index 00000000..3d0407a9
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "OCR y explorador con un escáner"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/et.po b/translations/desktop_files/kooka.desktop/et.po
new file mode 100644
index 00000000..49d9eb79
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skaneerimise ja OMT rakendus"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/eu.po b/translations/desktop_files/kooka.desktop/eu.po
new file mode 100644
index 00000000..145ae708
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Eskaneatzeko eta OCR programa"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/fa.po b/translations/desktop_files/kooka.desktop/fa.po
new file mode 100644
index 00000000..345aaa7e
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "پویش و برنامۀ OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/fi.po b/translations/desktop_files/kooka.desktop/fi.po
new file mode 100644
index 00000000..297663d3
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skannaus- ja tekstintunnistusohjelma"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/fr.po b/translations/desktop_files/kooka.desktop/fr.po
new file mode 100644
index 00000000..8bab2d1b
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Numérisation et reconnaissance de caractères"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/gl.po b/translations/desktop_files/kooka.desktop/gl.po
new file mode 100644
index 00000000..d3b2b7c4
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Programa para escanear e facer OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/he.po b/translations/desktop_files/kooka.desktop/he.po
new file mode 100644
index 00000000..67a86f70
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "תוכנית סריקה וזיהוי תווים אופטי"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/hi.po b/translations/desktop_files/kooka.desktop/hi.po
new file mode 100644
index 00000000..c50c4fc4
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "स्कैन व ऑप्टिकल कैरेक्टर रिकॉग्नीशन प्रोग्राम (OCR)"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "कूका"
diff --git a/translations/desktop_files/kooka.desktop/hr.po b/translations/desktop_files/kooka.desktop/hr.po
new file mode 100644
index 00000000..c0a26f2c
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program za skaniranje i OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/hu.po b/translations/desktop_files/kooka.desktop/hu.po
new file mode 100644
index 00000000..c47777ed
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Lapolvasó"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/is.po b/translations/desktop_files/kooka.desktop/is.po
new file mode 100644
index 00000000..d029230c
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Forrit til að skanna inn myndir"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "Skanni"
diff --git a/translations/desktop_files/kooka.desktop/it.po b/translations/desktop_files/kooka.desktop/it.po
new file mode 100644
index 00000000..7b0165f8
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: 2021-05-17 06:10+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kooka-kookadesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Programma di scansione e OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "Kooka"
diff --git a/translations/desktop_files/kooka.desktop/ja.po b/translations/desktop_files/kooka.desktop/ja.po
new file mode 100644
index 00000000..3cca81f5
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "スキャン & OCR プログラム"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/kk.po b/translations/desktop_files/kooka.desktop/kk.po
new file mode 100644
index 00000000..8d85287c
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Сканерге түсіру және танып-талдау"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/km.po b/translations/desktop_files/kooka.desktop/km.po
new file mode 100644
index 00000000..ba67c7d4
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "កម្មវិធី​ស្កេន & OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ko.po b/translations/desktop_files/kooka.desktop/ko.po
new file mode 100644
index 00000000..9394cb4b
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ko.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr ""
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "쿠카"
diff --git a/translations/desktop_files/kooka.desktop/kooka.desktop.pot b/translations/desktop_files/kooka.desktop/kooka.desktop.pot
new file mode 100644
index 00000000..27b22a0d
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/kooka.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr ""
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/lt.po b/translations/desktop_files/kooka.desktop/lt.po
new file mode 100644
index 00000000..0bddae2d
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skanavimo ir teksto atpažinimo programa"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/lv.po b/translations/desktop_files/kooka.desktop/lv.po
new file mode 100644
index 00000000..74bee718
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skanēšanas un OCR Programma"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ms.po b/translations/desktop_files/kooka.desktop/ms.po
new file mode 100644
index 00000000..734da5e2
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program Imbas & OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/nb.po b/translations/desktop_files/kooka.desktop/nb.po
new file mode 100644
index 00000000..4248e60b
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Et skanne-og OCR-program"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/nds.po b/translations/desktop_files/kooka.desktop/nds.po
new file mode 100644
index 00000000..92f5b1c8
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Inlees- un OTR-Programm"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ne.po b/translations/desktop_files/kooka.desktop/ne.po
new file mode 100644
index 00000000..da50be48
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "स्क्यान र OCR कार्यक्रम"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "कोओका"
diff --git a/translations/desktop_files/kooka.desktop/nl.po b/translations/desktop_files/kooka.desktop/nl.po
new file mode 100644
index 00000000..b08cb71b
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Scan- en OCR-programma"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/nn.po b/translations/desktop_files/kooka.desktop/nn.po
new file mode 100644
index 00000000..4c0bc59f
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skanne- og tekstattkjenningsprogram"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/pa.po b/translations/desktop_files/kooka.desktop/pa.po
new file mode 100644
index 00000000..4bf535a4
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/pa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr ""
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "ਕੋਕਾ"
diff --git a/translations/desktop_files/kooka.desktop/pl.po b/translations/desktop_files/kooka.desktop/pl.po
new file mode 100644
index 00000000..0320552e
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program do skanowania i rozpoznawania pisma"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/pt.po b/translations/desktop_files/kooka.desktop/pt.po
new file mode 100644
index 00000000..d7fc0789
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/pt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Programa de Digitalização e OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/pt_BR.po b/translations/desktop_files/kooka.desktop/pt_BR.po
new file mode 100644
index 00000000..373ee1dc
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Um programa de Digitalização & OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ro.po b/translations/desktop_files/kooka.desktop/ro.po
new file mode 100644
index 00000000..cb76226e
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Scanare imagini şi OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ru.po b/translations/desktop_files/kooka.desktop/ru.po
new file mode 100644
index 00000000..58326c97
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Сканирование и распознавание текста"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/sk.po b/translations/desktop_files/kooka.desktop/sk.po
new file mode 100644
index 00000000..2e53bed6
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Skenovací program s OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/sl.po b/translations/desktop_files/kooka.desktop/sl.po
new file mode 100644
index 00000000..21fe1a73
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program za skeniranje in prepoznavanje znakov"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/sr.po b/translations/desktop_files/kooka.desktop/sr.po
new file mode 100644
index 00000000..00645d12
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Програм за скенирање и препознавање текста"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/sr@Latn.po b/translations/desktop_files/kooka.desktop/sr@Latn.po
new file mode 100644
index 00000000..977a263d
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Program za skeniranje i prepoznavanje teksta"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/sv.po b/translations/desktop_files/kooka.desktop/sv.po
new file mode 100644
index 00000000..67cc39df
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Bildläsar- och OCR-program"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/ta.po b/translations/desktop_files/kooka.desktop/ta.po
new file mode 100644
index 00000000..252c9e10
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "வருடு & OCR நிரலி"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "கூக்கா"
diff --git a/translations/desktop_files/kooka.desktop/tg.po b/translations/desktop_files/kooka.desktop/tg.po
new file mode 100644
index 00000000..678685c0
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Барномаи сканеронӣ ва шиносоии матн"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/th.po b/translations/desktop_files/kooka.desktop/th.po
new file mode 100644
index 00000000..75b0d6b8
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "โปรแกรมสแกนภาพและ OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/tr.po b/translations/desktop_files/kooka.desktop/tr.po
new file mode 100644
index 00000000..7d4146f5
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Tarayıcı ve karakter tanıma programı"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/uk.po b/translations/desktop_files/kooka.desktop/uk.po
new file mode 100644
index 00000000..f51a6316
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kooka-kookadesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Програма сканування та розпізнавання символів"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "Kooka"
diff --git a/translations/desktop_files/kooka.desktop/ven.po b/translations/desktop_files/kooka.desktop/ven.po
new file mode 100644
index 00000000..d28d85bc
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "U nanga & Mbekanyamushumo ya OCR"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/wa.po b/translations/desktop_files/kooka.desktop/wa.po
new file mode 100644
index 00000000..41c81c20
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Programe di scanaedje eyet di ricnoxhance di tecse"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/xh.po b/translations/desktop_files/kooka.desktop/xh.po
new file mode 100644
index 00000000..4b2cdef5
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Udweliso Lwenkqubo Yemita Yovavanyo"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/zh_CN.po b/translations/desktop_files/kooka.desktop/zh_CN.po
new file mode 100644
index 00000000..f7c84b05
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "扫描和文字识别程序"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/zh_HK.po b/translations/desktop_files/kooka.desktop/zh_HK.po
new file mode 100644
index 00000000..aa3362de
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "掃描和文字辦識程式"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kooka.desktop/zh_TW.po b/translations/desktop_files/kooka.desktop/zh_TW.po
new file mode 100644
index 00000000..3785fd5d
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "掃描和文字辦識程式"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr "Kooka 掃描器"
diff --git a/translations/desktop_files/kooka.desktop/zu.po b/translations/desktop_files/kooka.desktop/zu.po
new file mode 100644
index 00000000..7a608cfb
--- /dev/null
+++ b/translations/desktop_files/kooka.desktop/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kooka.desktop:8
+msgid "Scan & OCR Program"
+msgstr "Scan & OCR Iprogremu"
+
+#. Name
+#: kooka.desktop:9
+msgid "Kooka"
+msgstr ""
diff --git a/translations/desktop_files/kpdf-desktops/ar.po b/translations/desktop_files/kpdf-desktops/ar.po
new file mode 100644
index 00000000..55109ccd
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "برنامج KPDF"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "عارض ملفات PDF"
diff --git a/translations/desktop_files/kpdf-desktops/az.po b/translations/desktop_files/kpdf-desktops/az.po
new file mode 100644
index 00000000..35975a29
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/az.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF Nümayişçisi"
diff --git a/translations/desktop_files/kpdf-desktops/bg.po b/translations/desktop_files/kpdf-desktops/bg.po
new file mode 100644
index 00000000..dbc25897
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Преглед на документи PDF"
diff --git a/translations/desktop_files/kpdf-desktops/br.po b/translations/desktop_files/kpdf-desktops/br.po
new file mode 100644
index 00000000..d0a64abc
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/br.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Gweler PDF"
diff --git a/translations/desktop_files/kpdf-desktops/bs.po b/translations/desktop_files/kpdf-desktops/bs.po
new file mode 100644
index 00000000..658c87db
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Preglednik PDF dokumenata"
diff --git a/translations/desktop_files/kpdf-desktops/ca.po b/translations/desktop_files/kpdf-desktops/ca.po
new file mode 100644
index 00000000..e97a37fe
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Visualitzador de PDF"
diff --git a/translations/desktop_files/kpdf-desktops/cs.po b/translations/desktop_files/kpdf-desktops/cs.po
new file mode 100644
index 00000000..cad24995
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Prohlížeč PDF souborů"
diff --git a/translations/desktop_files/kpdf-desktops/cy.po b/translations/desktop_files/kpdf-desktops/cy.po
new file mode 100644
index 00000000..b5c384fd
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Gwelydd PDF"
diff --git a/translations/desktop_files/kpdf-desktops/da.po b/translations/desktop_files/kpdf-desktops/da.po
new file mode 100644
index 00000000..90adbf11
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-fremviser"
diff --git a/translations/desktop_files/kpdf-desktops/de.po b/translations/desktop_files/kpdf-desktops/de.po
new file mode 100644
index 00000000..81ca4fa3
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-Betrachter"
diff --git a/translations/desktop_files/kpdf-desktops/el.po b/translations/desktop_files/kpdf-desktops/el.po
new file mode 100644
index 00000000..91d71361
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Προβολέας PDF"
diff --git a/translations/desktop_files/kpdf-desktops/eo.po b/translations/desktop_files/kpdf-desktops/eo.po
new file mode 100644
index 00000000..79c2adfe
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-rigardilo"
diff --git a/translations/desktop_files/kpdf-desktops/es.po b/translations/desktop_files/kpdf-desktops/es.po
new file mode 100644
index 00000000..1ce40755
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Visor de PDF"
diff --git a/translations/desktop_files/kpdf-desktops/et.po b/translations/desktop_files/kpdf-desktops/et.po
new file mode 100644
index 00000000..15b95c2b
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-failide näitaja"
diff --git a/translations/desktop_files/kpdf-desktops/eu.po b/translations/desktop_files/kpdf-desktops/eu.po
new file mode 100644
index 00000000..8db2f4cf
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF ikustailua"
diff --git a/translations/desktop_files/kpdf-desktops/fa.po b/translations/desktop_files/kpdf-desktops/fa.po
new file mode 100644
index 00000000..fa41b8ec
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "مشاهده‌گر PDF"
diff --git a/translations/desktop_files/kpdf-desktops/fi.po b/translations/desktop_files/kpdf-desktops/fi.po
new file mode 100644
index 00000000..8489bed6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-näytin"
diff --git a/translations/desktop_files/kpdf-desktops/fr.po b/translations/desktop_files/kpdf-desktops/fr.po
new file mode 100644
index 00000000..fc5119fb
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Afficheur PDF"
diff --git a/translations/desktop_files/kpdf-desktops/ga.po b/translations/desktop_files/kpdf-desktops/ga.po
new file mode 100644
index 00000000..9b37adc8
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ga.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Amharcán PDF"
diff --git a/translations/desktop_files/kpdf-desktops/gl.po b/translations/desktop_files/kpdf-desktops/gl.po
new file mode 100644
index 00000000..addb4579
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Visor PDF"
diff --git a/translations/desktop_files/kpdf-desktops/he.po b/translations/desktop_files/kpdf-desktops/he.po
new file mode 100644
index 00000000..24ec6852
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "מציג PDF"
diff --git a/translations/desktop_files/kpdf-desktops/hi.po b/translations/desktop_files/kpdf-desktops/hi.po
new file mode 100644
index 00000000..9bb7f213
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "के-पीडीएफ"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "पीडीएफ प्रदर्शक"
diff --git a/translations/desktop_files/kpdf-desktops/hr.po b/translations/desktop_files/kpdf-desktops/hr.po
new file mode 100644
index 00000000..d32824a7
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Preglednik PDF dokumenata"
diff --git a/translations/desktop_files/kpdf-desktops/hu.po b/translations/desktop_files/kpdf-desktops/hu.po
new file mode 100644
index 00000000..3de548cc
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-nézegető"
diff --git a/translations/desktop_files/kpdf-desktops/id.po b/translations/desktop_files/kpdf-desktops/id.po
new file mode 100644
index 00000000..8ec66896
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/id.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Viewer PDF"
diff --git a/translations/desktop_files/kpdf-desktops/is.po b/translations/desktop_files/kpdf-desktops/is.po
new file mode 100644
index 00000000..5b03b7de
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF sjá"
diff --git a/translations/desktop_files/kpdf-desktops/it.po b/translations/desktop_files/kpdf-desktops/it.po
new file mode 100644
index 00000000..b23c8357
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: 2021-05-17 06:10+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kpdf-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "KPDF"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Visore PDF"
diff --git a/translations/desktop_files/kpdf-desktops/ja.po b/translations/desktop_files/kpdf-desktops/ja.po
new file mode 100644
index 00000000..06f701fb
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF ビューア"
diff --git a/translations/desktop_files/kpdf-desktops/kk.po b/translations/desktop_files/kpdf-desktops/kk.po
new file mode 100644
index 00000000..357a64b6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF файлдарын қарау"
diff --git a/translations/desktop_files/kpdf-desktops/km.po b/translations/desktop_files/kpdf-desktops/km.po
new file mode 100644
index 00000000..19a871fd
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "កម្មវិធី​មើល PDF"
diff --git a/translations/desktop_files/kpdf-desktops/kpdf-desktops.pot b/translations/desktop_files/kpdf-desktops/kpdf-desktops.pot
new file mode 100644
index 00000000..91d592f4
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/kpdf-desktops.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr ""
diff --git a/translations/desktop_files/kpdf-desktops/lt.po b/translations/desktop_files/kpdf-desktops/lt.po
new file mode 100644
index 00000000..e41b5a40
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF Žiūriklis"
diff --git a/translations/desktop_files/kpdf-desktops/lv.po b/translations/desktop_files/kpdf-desktops/lv.po
new file mode 100644
index 00000000..4e40fab3
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF Skatītājs"
diff --git a/translations/desktop_files/kpdf-desktops/mk.po b/translations/desktop_files/kpdf-desktops/mk.po
new file mode 100644
index 00000000..1e724a23
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/mk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Прикажувач на PDF датотеки"
diff --git a/translations/desktop_files/kpdf-desktops/ms.po b/translations/desktop_files/kpdf-desktops/ms.po
new file mode 100644
index 00000000..e90ce3e6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Pemapar PDF"
diff --git a/translations/desktop_files/kpdf-desktops/mt.po b/translations/desktop_files/kpdf-desktops/mt.po
new file mode 100644
index 00000000..b835abce
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/mt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Werrej PDF"
diff --git a/translations/desktop_files/kpdf-desktops/nb.po b/translations/desktop_files/kpdf-desktops/nb.po
new file mode 100644
index 00000000..f825861c
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-fremviser"
diff --git a/translations/desktop_files/kpdf-desktops/nds.po b/translations/desktop_files/kpdf-desktops/nds.po
new file mode 100644
index 00000000..b8d9befe
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-Kieker"
diff --git a/translations/desktop_files/kpdf-desktops/ne.po b/translations/desktop_files/kpdf-desktops/ne.po
new file mode 100644
index 00000000..d6925e9a
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF दर्शक"
diff --git a/translations/desktop_files/kpdf-desktops/nl.po b/translations/desktop_files/kpdf-desktops/nl.po
new file mode 100644
index 00000000..ae9dcd81
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-weergaveprogramma"
diff --git a/translations/desktop_files/kpdf-desktops/nn.po b/translations/desktop_files/kpdf-desktops/nn.po
new file mode 100644
index 00000000..bc27fbe0
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-lesar"
diff --git a/translations/desktop_files/kpdf-desktops/pa.po b/translations/desktop_files/kpdf-desktops/pa.po
new file mode 100644
index 00000000..ed7ea910
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/pa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF ਦਰਸ਼ਕ"
diff --git a/translations/desktop_files/kpdf-desktops/pl.po b/translations/desktop_files/kpdf-desktops/pl.po
new file mode 100644
index 00000000..88e93db4
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/pl.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Jan Stolarek <jwstolarek@gmail.com>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: 2020-08-19 01:45+0000\n"
+"Last-Translator: Jan Stolarek <jwstolarek@gmail.com>\n"
+"Language-Team: Polish <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kpdf-desktop-files/pl/>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "KPDF"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Przeglądarka plików PDF"
diff --git a/translations/desktop_files/kpdf-desktops/pt.po b/translations/desktop_files/kpdf-desktops/pt.po
new file mode 100644
index 00000000..a129f8e6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2022.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: 2022-05-20 14:22+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kpdf-desktop-files/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.12.2\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "KPDF"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Visualizador de PDFs"
diff --git a/translations/desktop_files/kpdf-desktops/pt_BR.po b/translations/desktop_files/kpdf-desktops/pt_BR.po
new file mode 100644
index 00000000..44b362a1
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Visualizador de arquivos PDF"
diff --git a/translations/desktop_files/kpdf-desktops/ro.po b/translations/desktop_files/kpdf-desktops/ro.po
new file mode 100644
index 00000000..70c7d233
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Vizualizor PDF"
diff --git a/translations/desktop_files/kpdf-desktops/ru.po b/translations/desktop_files/kpdf-desktops/ru.po
new file mode 100644
index 00000000..d133a377
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Просмотр PDF"
diff --git a/translations/desktop_files/kpdf-desktops/rw.po b/translations/desktop_files/kpdf-desktops/rw.po
new file mode 100644
index 00000000..9dd5afe6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/rw.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Mugaragaza PDF"
diff --git a/translations/desktop_files/kpdf-desktops/se.po b/translations/desktop_files/kpdf-desktops/se.po
new file mode 100644
index 00000000..c03ac534
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-čájeheaddji"
diff --git a/translations/desktop_files/kpdf-desktops/sk.po b/translations/desktop_files/kpdf-desktops/sk.po
new file mode 100644
index 00000000..936c876c
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Prehliadač PDF"
diff --git a/translations/desktop_files/kpdf-desktops/sl.po b/translations/desktop_files/kpdf-desktops/sl.po
new file mode 100644
index 00000000..830c0f4d
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Pregledovalnik datotek PDF"
diff --git a/translations/desktop_files/kpdf-desktops/sr.po b/translations/desktop_files/kpdf-desktops/sr.po
new file mode 100644
index 00000000..0571b327
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF приказивач"
diff --git a/translations/desktop_files/kpdf-desktops/sr@Latn.po b/translations/desktop_files/kpdf-desktops/sr@Latn.po
new file mode 100644
index 00000000..3706b78e
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF prikazivač"
diff --git a/translations/desktop_files/kpdf-desktops/sv.po b/translations/desktop_files/kpdf-desktops/sv.po
new file mode 100644
index 00000000..5e6e6e93
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF-visare"
diff --git a/translations/desktop_files/kpdf-desktops/ta.po b/translations/desktop_files/kpdf-desktops/ta.po
new file mode 100644
index 00000000..a339f845
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PS/PDF காட்சி"
diff --git a/translations/desktop_files/kpdf-desktops/tg.po b/translations/desktop_files/kpdf-desktops/tg.po
new file mode 100644
index 00000000..71e746f2
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Хондани санадоти PDF"
diff --git a/translations/desktop_files/kpdf-desktops/th.po b/translations/desktop_files/kpdf-desktops/th.po
new file mode 100644
index 00000000..15d51bbc
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "ตัวแสดงผล PDF"
diff --git a/translations/desktop_files/kpdf-desktops/tr.po b/translations/desktop_files/kpdf-desktops/tr.po
new file mode 100644
index 00000000..978a15c9
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF Görüntüleyici"
diff --git a/translations/desktop_files/kpdf-desktops/uk.po b/translations/desktop_files/kpdf-desktops/uk.po
new file mode 100644
index 00000000..66a340e6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kpdf-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "KPDF"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Переглядач PDF"
diff --git a/translations/desktop_files/kpdf-desktops/uz.po b/translations/desktop_files/kpdf-desktops/uz.po
new file mode 100644
index 00000000..455cc57f
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF koʻruvchi"
diff --git a/translations/desktop_files/kpdf-desktops/uz@cyrillic.po b/translations/desktop_files/kpdf-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..7aecadb2
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF кўрувчи"
diff --git a/translations/desktop_files/kpdf-desktops/ven.po b/translations/desktop_files/kpdf-desktops/ven.po
new file mode 100644
index 00000000..3754b9e4
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Tshivhoni tsha PDF"
diff --git a/translations/desktop_files/kpdf-desktops/wa.po b/translations/desktop_files/kpdf-desktops/wa.po
new file mode 100644
index 00000000..5bfe3697
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Håyneu di documints PDF"
diff --git a/translations/desktop_files/kpdf-desktops/xh.po b/translations/desktop_files/kpdf-desktops/xh.po
new file mode 100644
index 00000000..5155d424
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Umboniseli we PDF"
diff --git a/translations/desktop_files/kpdf-desktops/zh_CN.po b/translations/desktop_files/kpdf-desktops/zh_CN.po
new file mode 100644
index 00000000..a63583a6
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF 查看器"
diff --git a/translations/desktop_files/kpdf-desktops/zh_HK.po b/translations/desktop_files/kpdf-desktops/zh_HK.po
new file mode 100644
index 00000000..872f2b8d
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF 檢視器"
diff --git a/translations/desktop_files/kpdf-desktops/zh_TW.po b/translations/desktop_files/kpdf-desktops/zh_TW.po
new file mode 100644
index 00000000..4cbdbc23
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr "KPDF 檢視器"
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "PDF 檢視器"
diff --git a/translations/desktop_files/kpdf-desktops/zu.po b/translations/desktop_files/kpdf-desktops/zu.po
new file mode 100644
index 00000000..af10f381
--- /dev/null
+++ b/translations/desktop_files/kpdf-desktops/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:35+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpdf_part.desktop:3 shell/kpdf.desktop:4
+msgid "KPDF"
+msgstr ""
+
+#. GenericName
+#: shell/kpdf.desktop:5
+msgid "PDF Viewer"
+msgstr "Umboniseli we PDF"
diff --git a/translations/desktop_files/kpovmodeler.desktop/ca.po b/translations/desktop_files/kpovmodeler.desktop/ca.po
new file mode 100644
index 00000000..d1a35124
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ca.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelador Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelador Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/cs.po b/translations/desktop_files/kpovmodeler.desktop/cs.po
new file mode 100644
index 00000000..48492b14
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/cs.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelář Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelář Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/cy.po b/translations/desktop_files/kpovmodeler.desktop/cy.po
new file mode 100644
index 00000000..453bf1b8
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/cy.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelydd Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelydd Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/da.po b/translations/desktop_files/kpovmodeler.desktop/da.po
new file mode 100644
index 00000000..f6705ae5
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/da.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray-modellering"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-modellering"
diff --git a/translations/desktop_files/kpovmodeler.desktop/de.po b/translations/desktop_files/kpovmodeler.desktop/de.po
new file mode 100644
index 00000000..4e677c12
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/de.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray-Modellierer"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-Modellierer"
diff --git a/translations/desktop_files/kpovmodeler.desktop/en_GB.po b/translations/desktop_files/kpovmodeler.desktop/en_GB.po
new file mode 100644
index 00000000..cf8207a6
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/en_GB.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: en_GB\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray Modeller"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray Modeller"
diff --git a/translations/desktop_files/kpovmodeler.desktop/eo.po b/translations/desktop_files/kpovmodeler.desktop/eo.po
new file mode 100644
index 00000000..9a30179b
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "KPovModelilo"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-modelilo"
diff --git a/translations/desktop_files/kpovmodeler.desktop/es.po b/translations/desktop_files/kpovmodeler.desktop/es.po
new file mode 100644
index 00000000..97c40b21
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "Modelador Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelador Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/et.po b/translations/desktop_files/kpovmodeler.desktop/et.po
new file mode 100644
index 00000000..152f8f46
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/et.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray modelleerija"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray modelleerija"
diff --git a/translations/desktop_files/kpovmodeler.desktop/eu.po b/translations/desktop_files/kpovmodeler.desktop/eu.po
new file mode 100644
index 00000000..d1a13bd1
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/eu.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray modelatzailea"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray modelatzailea"
diff --git a/translations/desktop_files/kpovmodeler.desktop/fa.po b/translations/desktop_files/kpovmodeler.desktop/fa.po
new file mode 100644
index 00000000..838d54cb
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/fa.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "سازندۀ مدل Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "سازندۀ مدل Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/fi.po b/translations/desktop_files/kpovmodeler.desktop/fi.po
new file mode 100644
index 00000000..29534cd5
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/fi.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray-mallintaja"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-mallintaja"
diff --git a/translations/desktop_files/kpovmodeler.desktop/fr.po b/translations/desktop_files/kpovmodeler.desktop/fr.po
new file mode 100644
index 00000000..339b9c84
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/fr.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modeleur Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modeleur Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/gl.po b/translations/desktop_files/kpovmodeler.desktop/gl.po
new file mode 100644
index 00000000..c8f11c87
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/gl.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelador Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelador Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/he.po b/translations/desktop_files/kpovmodeler.desktop/he.po
new file mode 100644
index 00000000..92a3a12a
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "מעצב Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "מעצב Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/hu.po b/translations/desktop_files/kpovmodeler.desktop/hu.po
new file mode 100644
index 00000000..c7b41e5c
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/hu.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray-modellező"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-modellező"
diff --git a/translations/desktop_files/kpovmodeler.desktop/is.po b/translations/desktop_files/kpovmodeler.desktop/is.po
new file mode 100644
index 00000000..9d509f04
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/is.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray hönnuður"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray hönnuður"
diff --git a/translations/desktop_files/kpovmodeler.desktop/it.po b/translations/desktop_files/kpovmodeler.desktop/it.po
new file mode 100644
index 00000000..11281212
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: 2021-05-17 06:10+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kpovmodeler-kpovmodelerdesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "KPovModeler"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modellatore per Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/ja.po b/translations/desktop_files/kpovmodeler.desktop/ja.po
new file mode 100644
index 00000000..b954d8d4
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ja.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray モデラー"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray モデラー"
diff --git a/translations/desktop_files/kpovmodeler.desktop/kk.po b/translations/desktop_files/kpovmodeler.desktop/kk.po
new file mode 100644
index 00000000..7a602ff2
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/kk.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray үлгілеу"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray үлгілеу"
diff --git a/translations/desktop_files/kpovmodeler.desktop/km.po b/translations/desktop_files/kpovmodeler.desktop/km.po
new file mode 100644
index 00000000..e70ca3f4
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/km.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "កម្មវិធី​ធ្វើ​ម៉ូដែល Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "កម្មវិធី​ធ្វើ​ម៉ូដែល Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/kpovmodeler.desktop.pot b/translations/desktop_files/kpovmodeler.desktop/kpovmodeler.desktop.pot
new file mode 100644
index 00000000..713c0411
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/kpovmodeler.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr ""
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr ""
diff --git a/translations/desktop_files/kpovmodeler.desktop/ms.po b/translations/desktop_files/kpovmodeler.desktop/ms.po
new file mode 100644
index 00000000..09029cfb
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ms.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Pemodel Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Pemodel Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/nb.po b/translations/desktop_files/kpovmodeler.desktop/nb.po
new file mode 100644
index 00000000..1ccf4baa
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "KPov-modellerer"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-modellerer"
diff --git a/translations/desktop_files/kpovmodeler.desktop/nds.po b/translations/desktop_files/kpovmodeler.desktop/nds.po
new file mode 100644
index 00000000..f26cc17a
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/nds.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray-Modellmaker"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-Modellmaker"
diff --git a/translations/desktop_files/kpovmodeler.desktop/ne.po b/translations/desktop_files/kpovmodeler.desktop/ne.po
new file mode 100644
index 00000000..831946b0
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "केडीई पोभ मोडेलर"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "पोभ्रे मोडेलर"
diff --git a/translations/desktop_files/kpovmodeler.desktop/nn.po b/translations/desktop_files/kpovmodeler.desktop/nn.po
new file mode 100644
index 00000000..54d1f9dc
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "KPov-modellering"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray-modellering"
diff --git a/translations/desktop_files/kpovmodeler.desktop/pl.po b/translations/desktop_files/kpovmodeler.desktop/pl.po
new file mode 100644
index 00000000..da5bcde1
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/pl.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modeler Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modeler Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/pt.po b/translations/desktop_files/kpovmodeler.desktop/pt.po
new file mode 100644
index 00000000..6cd365e0
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelador de Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelador de Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/pt_BR.po b/translations/desktop_files/kpovmodeler.desktop/pt_BR.po
new file mode 100644
index 00000000..f9d4471d
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/pt_BR.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelador Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelador Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/ro.po b/translations/desktop_files/kpovmodeler.desktop/ro.po
new file mode 100644
index 00000000..4bbd274f
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ro.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelator Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelator Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/ru.po b/translations/desktop_files/kpovmodeler.desktop/ru.po
new file mode 100644
index 00000000..4ba486bc
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ru.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Редактор Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Редактор Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/sl.po b/translations/desktop_files/kpovmodeler.desktop/sl.po
new file mode 100644
index 00000000..583014e3
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/sl.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelirnik Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelirnik Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/sr.po b/translations/desktop_files/kpovmodeler.desktop/sr.po
new file mode 100644
index 00000000..d2ff07d9
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/sr.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Моделар за Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Моделар за Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/sr@Latn.po b/translations/desktop_files/kpovmodeler.desktop/sr@Latn.po
new file mode 100644
index 00000000..15371957
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/sr@Latn.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Modelar za Povray"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modelar za Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/sv.po b/translations/desktop_files/kpovmodeler.desktop/sv.po
new file mode 100644
index 00000000..82b56648
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "Kpovmodeler"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Modellering med Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/ta.po b/translations/desktop_files/kpovmodeler.desktop/ta.po
new file mode 100644
index 00000000..a997fbe6
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/ta.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "பாவ்ரே மாடுல்லர்"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "பாவ்ரே மாடுல்லர்"
diff --git a/translations/desktop_files/kpovmodeler.desktop/tr.po b/translations/desktop_files/kpovmodeler.desktop/tr.po
new file mode 100644
index 00000000..2da3fef7
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/tr.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray Modelleyici"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray Modelleyici"
diff --git a/translations/desktop_files/kpovmodeler.desktop/uk.po b/translations/desktop_files/kpovmodeler.desktop/uk.po
new file mode 100644
index 00000000..1bed1020
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kpovmodeler-kpovmodelerdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+msgid "KPovModeler"
+msgstr "KPovModeler"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Моделювальник Povray"
diff --git a/translations/desktop_files/kpovmodeler.desktop/zh_CN.po b/translations/desktop_files/kpovmodeler.desktop/zh_CN.po
new file mode 100644
index 00000000..0d6feb6e
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/zh_CN.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray 建模器"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray 建模器"
diff --git a/translations/desktop_files/kpovmodeler.desktop/zh_HK.po b/translations/desktop_files/kpovmodeler.desktop/zh_HK.po
new file mode 100644
index 00000000..e8b98262
--- /dev/null
+++ b/translations/desktop_files/kpovmodeler.desktop/zh_HK.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kpovmodeler.desktop:6
+#, fuzzy
+msgid "KPovModeler"
+msgstr "Povray 建模器"
+
+#. GenericName
+#: kpovmodeler.desktop:7
+msgid "Povray Modeler"
+msgstr "Povray 建模器"
diff --git a/translations/desktop_files/kruler-eventsrc/af.po b/translations/desktop_files/kruler-eventsrc/af.po
new file mode 100644
index 00000000..8cc566f4
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/af.po
@@ -0,0 +1,34 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Kde Skerm Liniaal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Verskuif deur Plekaanduier Sleutels"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
+"Die liniaal het verskuif beeldelement-gewys te gebruik Die plekaanduier "
+"sleutels"
diff --git a/translations/desktop_files/kruler-eventsrc/ar.po b/translations/desktop_files/kruler-eventsrc/ar.po
new file mode 100644
index 00000000..66e14bc1
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ar.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "مسطرة شاشة"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "تم تحريكها بمفاتيح الفأرة"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "تم تحريك المسطرة بكسليا باستخدام مفاتيح الفأرة"
diff --git a/translations/desktop_files/kruler-eventsrc/az.po b/translations/desktop_files/kruler-eventsrc/az.po
new file mode 100644
index 00000000..b6623ec0
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/az.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Ekran Xətkeşi"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "İstiqamət düymələri ilə hərəkət etdirildi"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Cədvəl piksel piksel istiqamət düymələri ilə hərəkət etdirildi"
diff --git a/translations/desktop_files/kruler-eventsrc/bg.po b/translations/desktop_files/kruler-eventsrc/bg.po
new file mode 100644
index 00000000..55cd1a44
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/bg.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Линийка за екрана"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Преместване чрез клавиатурата"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Преместване чрез клавиатурата"
diff --git a/translations/desktop_files/kruler-eventsrc/bs.po b/translations/desktop_files/kruler-eventsrc/bs.po
new file mode 100644
index 00000000..4b5bea67
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/bs.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ekranski linijar"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Pomjera se kursorskim tipkama"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Linijar se pomjera u pixelima koristeći kursorske tipke"
diff --git a/translations/desktop_files/kruler-eventsrc/ca.po b/translations/desktop_files/kruler-eventsrc/ca.po
new file mode 100644
index 00000000..0884dad4
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ca.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Regla de pantalla"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Mogut mitjançant les tecles de cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "La regla s'ha mogut píxel a píxel usant les tecles de cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/cs.po b/translations/desktop_files/kruler-eventsrc/cs.po
new file mode 100644
index 00000000..59658d16
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/cs.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Obrazovkové pravítko"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Přesunutý kurzorovými klávesami"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Pravítko bylo kurzorovými klávesami posunuto o několik bodů"
diff --git a/translations/desktop_files/kruler-eventsrc/cy.po b/translations/desktop_files/kruler-eventsrc/cy.po
new file mode 100644
index 00000000..19fa2eef
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/cy.po
@@ -0,0 +1,34 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Mesurydd Sgrîn"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Symudir gan y Bysellau Cyrchydd"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
+"Mae'r mesurydd wedi symud o safbwynt picseli wrth ddefnyddio'r bysellau "
+"cyrchydd"
diff --git a/translations/desktop_files/kruler-eventsrc/da.po b/translations/desktop_files/kruler-eventsrc/da.po
new file mode 100644
index 00000000..abe05646
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/da.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Skærmlineal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Flyttet med piletaster"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Linealen er flyttet en pixel af gangen med piletasterne"
diff --git a/translations/desktop_files/kruler-eventsrc/de.po b/translations/desktop_files/kruler-eventsrc/de.po
new file mode 100644
index 00000000..fe4f934f
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/de.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Bildschirmlineal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Durch Pfeiltasten verschoben"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Das Lineal wurde durch die Pfeiltasten um einige Pixel verschoben"
diff --git a/translations/desktop_files/kruler-eventsrc/el.po b/translations/desktop_files/kruler-eventsrc/el.po
new file mode 100644
index 00000000..d5b8a9b3
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/el.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Χάρακας οθόνης του"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Μετακινήθηκε από τα πλήκτρα κίνησης"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Ο χάρακας μετακινήθηκε pixelwise με τη χρήση των πλήκτρων κίνησης"
diff --git a/translations/desktop_files/kruler-eventsrc/eo.po b/translations/desktop_files/kruler-eventsrc/eo.po
new file mode 100644
index 00000000..c328ce27
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/eo.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Ekranliniilo"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Movata de la direktoklavoj"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "La liniilo estas movita popunkte uzante la direktoklavojn"
diff --git a/translations/desktop_files/kruler-eventsrc/es.po b/translations/desktop_files/kruler-eventsrc/es.po
new file mode 100644
index 00000000..ce6794b9
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/es.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Regla para la pantalla de"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Movido por las teclas del cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "La regla se ha movido entre los pixels usando las teclas del cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/et.po b/translations/desktop_files/kruler-eventsrc/et.po
new file mode 100644
index 00000000..9dadb251
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/et.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ekraani joonlaud"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Liigutati nooleklahve kasutades"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Joonlauda liigutati pikselhaaval nooleklahve kasutades"
diff --git a/translations/desktop_files/kruler-eventsrc/eu.po b/translations/desktop_files/kruler-eventsrc/eu.po
new file mode 100644
index 00000000..9d155a18
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/eu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "pantaila erregela"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Cursor Keys-ek mugitua"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Erregela mugitu da kurtsore teklek eragina"
diff --git a/translations/desktop_files/kruler-eventsrc/fa.po b/translations/desktop_files/kruler-eventsrc/fa.po
new file mode 100644
index 00000000..b6c85871
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/fa.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "خط‌کش پردۀ"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "توسط کلیدهای مکان‌نما حرکت کرد"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "خط‌کش با استفاده از کلیدهای مکان‌نما در جهت تصویردانه حرکت کرده است."
diff --git a/translations/desktop_files/kruler-eventsrc/fi.po b/translations/desktop_files/kruler-eventsrc/fi.po
new file mode 100644
index 00000000..45cbfb33
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/fi.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Näytön mittaaja"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Siirrettiin kursorinäppäimillä"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Mittanauha on liikkunut pikseleitä käyttämällä kursorinäppäimiä"
diff --git a/translations/desktop_files/kruler-eventsrc/fr.po b/translations/desktop_files/kruler-eventsrc/fr.po
new file mode 100644
index 00000000..9147d558
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/fr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Règle d'écran pour"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Déplacée par les touches fléchées"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "La règle s'est déplacée sous l'action des touches fléchées"
diff --git a/translations/desktop_files/kruler-eventsrc/ga.po b/translations/desktop_files/kruler-eventsrc/ga.po
new file mode 100644
index 00000000..23c3d848
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ga.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Rialóir Scáileáin"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr ""
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
diff --git a/translations/desktop_files/kruler-eventsrc/gl.po b/translations/desktop_files/kruler-eventsrc/gl.po
new file mode 100644
index 00000000..de223e5e
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/gl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Regra de pantalla de"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Mover coas teclas de cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "A regra moverá o «pixelwise» empregando as teclas de cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/he.po b/translations/desktop_files/kruler-eventsrc/he.po
new file mode 100644
index 00000000..4d1792bc
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/he.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "סרגל המסך של"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "הזזה באמצעות מקשי החצים"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "הסרגל הוזז באמצעות מקשי החצים"
diff --git a/translations/desktop_files/kruler-eventsrc/hi.po b/translations/desktop_files/kruler-eventsrc/hi.po
new file mode 100644
index 00000000..1dae2e96
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/hi.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "केडीई स्क्रीन रूलर"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "संकेतक कुंजियों द्वारा खिसकता है"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "संकेतक कुंजियों की मदद से रूसर पिक्सलवाइज़ खिसका"
diff --git a/translations/desktop_files/kruler-eventsrc/hr.po b/translations/desktop_files/kruler-eventsrc/hr.po
new file mode 100644
index 00000000..61f18363
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/hr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ravnalo za ekran"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Pomaknuto tipkama za kretanje"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Ravnalo je pomaknuto pomoću tipki za kretanje"
diff --git a/translations/desktop_files/kruler-eventsrc/hu.po b/translations/desktop_files/kruler-eventsrc/hu.po
new file mode 100644
index 00000000..f905e313
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/hu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Képernyővonalzó"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "A vonalzó elmozgatva a kurzorbillentyűkkel"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "A vonalzó elmozgatva képpontonként a kurzorbillentyűkkel"
diff --git a/translations/desktop_files/kruler-eventsrc/is.po b/translations/desktop_files/kruler-eventsrc/is.po
new file mode 100644
index 00000000..c89b39fa
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/is.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Reglustikan"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Fært með örvalyklum"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Reglustikan hefur verið færð um e-a punkta með örvalyklunum"
diff --git a/translations/desktop_files/kruler-eventsrc/it.po b/translations/desktop_files/kruler-eventsrc/it.po
new file mode 100644
index 00000000..41c398d3
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/it.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Righello dello schermo"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Spostato dai tasti cursore"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Il righello è stato spostato usando i tasti cursore"
diff --git a/translations/desktop_files/kruler-eventsrc/ja.po b/translations/desktop_files/kruler-eventsrc/ja.po
new file mode 100644
index 00000000..331c53e6
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ja.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "スクリーン定規"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "カーソルキーで移動"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "定規がカーソルキーによってピクセル単位で移動しました"
diff --git a/translations/desktop_files/kruler-eventsrc/kk.po b/translations/desktop_files/kruler-eventsrc/kk.po
new file mode 100644
index 00000000..f3023404
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/kk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "экран өлшегіші"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Жебелі пернелерімен жылжыту"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Өлшегіш жебелі пернелер көмегімен пикселдеп жылжиды"
diff --git a/translations/desktop_files/kruler-eventsrc/km.po b/translations/desktop_files/kruler-eventsrc/km.po
new file mode 100644
index 00000000..4386a182
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/km.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "បន្ទាត់​អេក្រង់"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "បាន​ផ្លាស់ទី​ដោយ​គ្រាប់ចុច​ទស្សន៍​ទ្រនិច"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "បន្ទាត់​ត្រូវ​បាន​ផ្លាស់ទី​តាម​ភីកសែល ដោយ​ប្រើ​គ្រាប់ចុច​ទស្សន៍​ទ្រនិច"
diff --git a/translations/desktop_files/kruler-eventsrc/ko.po b/translations/desktop_files/kruler-eventsrc/ko.po
new file mode 100644
index 00000000..55d09b42
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ko.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "용 화면 자"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "방향 글쇠로 옮겼습니다"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "방향 글쇠로 자대를 옮겼습니다"
diff --git a/translations/desktop_files/kruler-eventsrc/kruler-eventsrc.pot b/translations/desktop_files/kruler-eventsrc/kruler-eventsrc.pot
new file mode 100644
index 00000000..8fc288b4
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/kruler-eventsrc.pot
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr ""
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr ""
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
diff --git a/translations/desktop_files/kruler-eventsrc/lt.po b/translations/desktop_files/kruler-eventsrc/lt.po
new file mode 100644
index 00000000..61fafdcb
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/lt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ekrano liniuotė"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Judinama klaviatūros rodyklėmis"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Liniuote buvo paslinkta kelis taškus naudojant klaviatūros rodykles."
diff --git a/translations/desktop_files/kruler-eventsrc/lv.po b/translations/desktop_files/kruler-eventsrc/lv.po
new file mode 100644
index 00000000..84dbf1a7
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/lv.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Ekrāna Mērjosla"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Pārvietots ar Kursora Taustiņiem"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Mērjosla pārvietota pikseļavirzienā izmantojot kursora taustiņus."
diff --git a/translations/desktop_files/kruler-eventsrc/ms.po b/translations/desktop_files/kruler-eventsrc/ms.po
new file mode 100644
index 00000000..c09f50cb
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ms.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Pembaris Skrin"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Dialih oleh Kekunci Kursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Pembaris telah mengalih ikut piksel menggunakan kekunci kursor"
diff --git a/translations/desktop_files/kruler-eventsrc/mt.po b/translations/desktop_files/kruler-eventsrc/mt.po
new file mode 100644
index 00000000..0f03b68f
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/mt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Riga tal-Iskrin"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Immexxi bil-buttuni tal-vleġeġ"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Ir-riga mxiet b'tikka waħda permezz tal-buttuni vleġeġ"
diff --git a/translations/desktop_files/kruler-eventsrc/nb.po b/translations/desktop_files/kruler-eventsrc/nb.po
new file mode 100644
index 00000000..2488b961
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/nb.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "skjermlinjal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Flyttet med piltaster"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Linjalen ble flyttet punktvis ved bruk av piltastene"
diff --git a/translations/desktop_files/kruler-eventsrc/nds.po b/translations/desktop_files/kruler-eventsrc/nds.po
new file mode 100644
index 00000000..614343e6
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/nds.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Schirmlineaal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Mit Pieltasten verschaven"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Dat Lineaal warrt mit de Pieltasten pixelwies verschaven"
diff --git a/translations/desktop_files/kruler-eventsrc/ne.po b/translations/desktop_files/kruler-eventsrc/ne.po
new file mode 100644
index 00000000..faa20811
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ne.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "केडीई पर्दा रूलर"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "कर्सर कुञ्जीद्वारा सारिएको"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "कर्सर कुञ्जी प्रयोग गरेर रूलर पिक्सेलअनुसार सारियो"
diff --git a/translations/desktop_files/kruler-eventsrc/nl.po b/translations/desktop_files/kruler-eventsrc/nl.po
new file mode 100644
index 00000000..155fcf0b
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/nl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Schermliniaal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Verplaatst met de cursortoetsen"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "De liniaal is enkele pixels verplaatst via de cursortoetsen"
diff --git a/translations/desktop_files/kruler-eventsrc/nn.po b/translations/desktop_files/kruler-eventsrc/nn.po
new file mode 100644
index 00000000..81f66b8e
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/nn.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Skjermlinjal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Flytt med piltastane"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Linjalen vert flytta piksel for piksel med piltastane"
diff --git a/translations/desktop_files/kruler-eventsrc/nso.po b/translations/desktop_files/kruler-eventsrc/nso.po
new file mode 100644
index 00000000..7e8daedf
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/nso.po
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Molaodi wa Pontsho ya"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Sutisa ke Ditobetswa tsa Cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
+"Molaodi o tsamaile ka mokgwa wa pixelwise a somisa ditobetswa tsa cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/pl.po b/translations/desktop_files/kruler-eventsrc/pl.po
new file mode 100644
index 00000000..6ed667b5
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/pl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Linijka ekranowa"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Przesunięto klawiszami kursora"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Linijka przesunięta o zadaną ilość pikseli używając klawiszy kursora"
diff --git a/translations/desktop_files/kruler-eventsrc/pt.po b/translations/desktop_files/kruler-eventsrc/pt.po
new file mode 100644
index 00000000..743d37e5
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/pt.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Régua do ecrã do"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Movimentado com as Teclas de Cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "A régua foi movida com as teclas de cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/pt_BR.po b/translations/desktop_files/kruler-eventsrc/pt_BR.po
new file mode 100644
index 00000000..56f62fe6
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/pt_BR.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Régua da Tela do"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Movido pelas Teclas de Direção"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "A régua foi movida usando as teclas de direção"
diff --git a/translations/desktop_files/kruler-eventsrc/ro.po b/translations/desktop_files/kruler-eventsrc/ro.po
new file mode 100644
index 00000000..690c2254
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ro.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Riglă de ecran pentru"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Mutat cu tastele cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Rigla a fost mutată cîţiva pixeli cu tastele cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/ru.po b/translations/desktop_files/kruler-eventsrc/ru.po
new file mode 100644
index 00000000..c9c40142
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ru.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Экранная линейка"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Передвижение стрелками"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Линейка сдвигается попиксельно с помощью стрелок."
diff --git a/translations/desktop_files/kruler-eventsrc/se.po b/translations/desktop_files/kruler-eventsrc/se.po
new file mode 100644
index 00000000..303794d2
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/se.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "šearbmalinjála"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr ""
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
diff --git a/translations/desktop_files/kruler-eventsrc/sk.po b/translations/desktop_files/kruler-eventsrc/sk.po
new file mode 100644
index 00000000..219c26a0
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/sk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "pravítko obrazovky"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Presunutý kurzorovými klávesmi"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Pravítko bolo kurzorovými klávesmi posunuté o niekoľko bodov"
diff --git a/translations/desktop_files/kruler-eventsrc/sl.po b/translations/desktop_files/kruler-eventsrc/sl.po
new file mode 100644
index 00000000..ccac7c72
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/sl.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Zaslonsko ravnilo"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Premaknjeno s smernimi tipkami"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Ravnilo se je premaknilo po točkah z uporabo smernih tipk"
diff --git a/translations/desktop_files/kruler-eventsrc/sr.po b/translations/desktop_files/kruler-eventsrc/sr.po
new file mode 100644
index 00000000..9d2ae2f7
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/sr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ов екрански лењир"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Померен курсорским тастерима"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Лењир се померио за пиксел помоћу курсорских тастера"
diff --git a/translations/desktop_files/kruler-eventsrc/sr@Latn.po b/translations/desktop_files/kruler-eventsrc/sr@Latn.po
new file mode 100644
index 00000000..c5c21f05
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/sr@Latn.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ov ekranski lenjir"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Pomeren kursorskim tasterima"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Lenjir se pomerio za piksel pomoću kursorskih tastera"
diff --git a/translations/desktop_files/kruler-eventsrc/sv.po b/translations/desktop_files/kruler-eventsrc/sv.po
new file mode 100644
index 00000000..6a4a64e7
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/sv.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "skärmlinjal"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Flyttade med piltangenteran"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Linjalen har flyttats bildpunktsvis med piltangenterna"
diff --git a/translations/desktop_files/kruler-eventsrc/ta.po b/translations/desktop_files/kruler-eventsrc/ta.po
new file mode 100644
index 00000000..99b1c20b
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ta.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "கேடிஇ திரைக்கான அளவுக்கோல்"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "சுட்டி விசையால் நகர்த்தப்பட்டது"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "சுட்டி விசைகளை பயன்படுத்தி படத்துணுக்கு மூலமாக வரை உருளை நகர்த்தப்பட்டது"
diff --git a/translations/desktop_files/kruler-eventsrc/tg.po b/translations/desktop_files/kruler-eventsrc/tg.po
new file mode 100644
index 00000000..d42e559d
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/tg.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Ҷадвали экрании"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Ба ҳаракат даровардан бо аломати тира"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Ҷадвал бо ёрии аломати тира, пикселнокӣ ҳаракат мекунад."
diff --git a/translations/desktop_files/kruler-eventsrc/th.po b/translations/desktop_files/kruler-eventsrc/th.po
new file mode 100644
index 00000000..784f82aa
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/th.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ไม้บรรทัดบนหน้าจอของ"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "ย้ายด้วยปุ่มลูกศร"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
diff --git a/translations/desktop_files/kruler-eventsrc/tr.po b/translations/desktop_files/kruler-eventsrc/tr.po
new file mode 100644
index 00000000..f7d0b332
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/tr.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Ekran Cetveli"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Yön tuşlarıyla hareket ettirildi"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Cetvel piksel piksel yön tuşlarıyla hareket ettirildi"
diff --git a/translations/desktop_files/kruler-eventsrc/uk.po b/translations/desktop_files/kruler-eventsrc/uk.po
new file mode 100644
index 00000000..e167e76c
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/uk.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Лінійка екрана"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Пересунуто клавішами курсора"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Лінійка пересувається по пікселях за допомогою клавіш курсора"
diff --git a/translations/desktop_files/kruler-eventsrc/uz.po b/translations/desktop_files/kruler-eventsrc/uz.po
new file mode 100644
index 00000000..c6165d3d
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/uz.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "ekran lineykasi"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr ""
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
diff --git a/translations/desktop_files/kruler-eventsrc/uz@cyrillic.po b/translations/desktop_files/kruler-eventsrc/uz@cyrillic.po
new file mode 100644
index 00000000..e53eb7ce
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/uz@cyrillic.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "экран линейкаси"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr ""
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr ""
diff --git a/translations/desktop_files/kruler-eventsrc/ven.po b/translations/desktop_files/kruler-eventsrc/ven.po
new file mode 100644
index 00000000..d5803ba9
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/ven.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Muvhusi wa tshikirini tsha"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Tshimbidzhwa nga khii ya musevhe"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Muvhusi o sudzulusa pixelwise a tshi khou shumisa khii ya Cursor"
diff --git a/translations/desktop_files/kruler-eventsrc/xh.po b/translations/desktop_files/kruler-eventsrc/xh.po
new file mode 100644
index 00000000..dbf51e43
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/xh.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Umlawuli wekhusi le"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Ishukunyiswa zizitshixo zesalathisi"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Umlawuli ushukume jikelele kwipixel esebenzisa izitshixi zesalathisi"
diff --git a/translations/desktop_files/kruler-eventsrc/zh_CN.po b/translations/desktop_files/kruler-eventsrc/zh_CN.po
new file mode 100644
index 00000000..29e270e3
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/zh_CN.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "屏幕标尺"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "用光标键移动"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "标尺已经用光标键按像素移动"
diff --git a/translations/desktop_files/kruler-eventsrc/zh_HK.po b/translations/desktop_files/kruler-eventsrc/zh_HK.po
new file mode 100644
index 00000000..94bca1c6
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/zh_HK.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "螢幕尺規"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "用游標鍵移動"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "使用游標鍵移動尺規單一個像"
diff --git a/translations/desktop_files/kruler-eventsrc/zh_TW.po b/translations/desktop_files/kruler-eventsrc/zh_TW.po
new file mode 100644
index 00000000..a4d746ca
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/zh_TW.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "螢幕尺規"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "用游標鍵移動"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "使用游標鍵移動尺規單一個像"
diff --git a/translations/desktop_files/kruler-eventsrc/zu.po b/translations/desktop_files/kruler-eventsrc/zu.po
new file mode 100644
index 00000000..6887c8c4
--- /dev/null
+++ b/translations/desktop_files/kruler-eventsrc/zu.po
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:41+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: eventsrc:3
+msgid "Screen Ruler"
+msgstr "Umlawuli Wesikrini se"
+
+#. Name
+#: eventsrc:6
+msgid "Moved by Cursor Keys"
+msgstr "Inyakaziswe Izikhiye Ze Cursor"
+
+#. Comment
+#: eventsrc:7
+msgid "The ruler has moved pixelwise using the cursor keys"
+msgstr "Umlawuli unyakazise jikelele kwipixel esebenzisa izikhiye ze cursor"
diff --git a/translations/desktop_files/kruler.desktop/af.po b/translations/desktop_files/kruler.desktop/af.po
new file mode 100644
index 00000000..ab72552d
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Skerm Liniaal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "K-lineaal"
diff --git a/translations/desktop_files/kruler.desktop/ar.po b/translations/desktop_files/kruler.desktop/ar.po
new file mode 100644
index 00000000..5a04348a
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "مسطرة الشاشة"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "المسطرة (KRuler)"
diff --git a/translations/desktop_files/kruler.desktop/bg.po b/translations/desktop_files/kruler.desktop/bg.po
new file mode 100644
index 00000000..d25b07e5
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Линийка за екрана"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/bs.po b/translations/desktop_files/kruler.desktop/bs.po
new file mode 100644
index 00000000..bfc95690
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekranski linijar"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/ca.po b/translations/desktop_files/kruler.desktop/ca.po
new file mode 100644
index 00000000..9ca2ed07
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Regla de pantalla"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/cs.po b/translations/desktop_files/kruler.desktop/cs.po
new file mode 100644
index 00000000..a28c4006
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Obrazovkové pravítko"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/cy.po b/translations/desktop_files/kruler.desktop/cy.po
new file mode 100644
index 00000000..b474b189
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Mesurydd Sgrîn"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KMesurydd"
diff --git a/translations/desktop_files/kruler.desktop/da.po b/translations/desktop_files/kruler.desktop/da.po
new file mode 100644
index 00000000..ccc892a4
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Skærmlineal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/de.po b/translations/desktop_files/kruler.desktop/de.po
new file mode 100644
index 00000000..ac162ea1
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Bildschirmlineal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/el.po b/translations/desktop_files/kruler.desktop/el.po
new file mode 100644
index 00000000..3e92819e
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Χάρακας οθόνης"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/eo.po b/translations/desktop_files/kruler.desktop/eo.po
new file mode 100644
index 00000000..a57b2f3b
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekranliniilo"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "Liniilo"
diff --git a/translations/desktop_files/kruler.desktop/es.po b/translations/desktop_files/kruler.desktop/es.po
new file mode 100644
index 00000000..3b0417b7
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Regla para la pantalla"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/et.po b/translations/desktop_files/kruler.desktop/et.po
new file mode 100644
index 00000000..a5e5e185
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekraani joonlaud"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/eu.po b/translations/desktop_files/kruler.desktop/eu.po
new file mode 100644
index 00000000..11bc18de
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Pantaila erregela"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/fa.po b/translations/desktop_files/kruler.desktop/fa.po
new file mode 100644
index 00000000..4dcf25b3
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "خط‌کش پرده"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/fi.po b/translations/desktop_files/kruler.desktop/fi.po
new file mode 100644
index 00000000..ac73c7e2
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Näytön mittaaja"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/fr.po b/translations/desktop_files/kruler.desktop/fr.po
new file mode 100644
index 00000000..0f56baf4
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Règle d'écran"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/gl.po b/translations/desktop_files/kruler.desktop/gl.po
new file mode 100644
index 00000000..f6b759c5
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Regra de pantalla"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/he.po b/translations/desktop_files/kruler.desktop/he.po
new file mode 100644
index 00000000..c533248f
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "סרגל מסך"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/hi.po b/translations/desktop_files/kruler.desktop/hi.po
new file mode 100644
index 00000000..b4f6f6ea
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "स्क्रीन रूलर"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "के-रूलर"
diff --git a/translations/desktop_files/kruler.desktop/hr.po b/translations/desktop_files/kruler.desktop/hr.po
new file mode 100644
index 00000000..eb16595a
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ravnalo"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "Ravnalo"
diff --git a/translations/desktop_files/kruler.desktop/hu.po b/translations/desktop_files/kruler.desktop/hu.po
new file mode 100644
index 00000000..e3b6204f
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Képernyővonalzó"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/is.po b/translations/desktop_files/kruler.desktop/is.po
new file mode 100644
index 00000000..8c5e81d3
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Reglustika"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KReglustika"
diff --git a/translations/desktop_files/kruler.desktop/it.po b/translations/desktop_files/kruler.desktop/it.po
new file mode 100644
index 00000000..0c849868
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: 2021-05-17 06:10+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kruler-krulerdesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Righello per lo schermo"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KRuler"
diff --git a/translations/desktop_files/kruler.desktop/ja.po b/translations/desktop_files/kruler.desktop/ja.po
new file mode 100644
index 00000000..01c63b7b
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "スクリーン定規"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/kk.po b/translations/desktop_files/kruler.desktop/kk.po
new file mode 100644
index 00000000..ec6995a1
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Экран өлшегіші"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/km.po b/translations/desktop_files/kruler.desktop/km.po
new file mode 100644
index 00000000..6ea8c6bc
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "បន្ទាត់​អេក្រង់"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/kruler.desktop.pot b/translations/desktop_files/kruler.desktop/kruler.desktop.pot
new file mode 100644
index 00000000..e400fc76
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/kruler.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr ""
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/lt.po b/translations/desktop_files/kruler.desktop/lt.po
new file mode 100644
index 00000000..c45fffa8
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekrano liniuotė"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/lv.po b/translations/desktop_files/kruler.desktop/lv.po
new file mode 100644
index 00000000..44e67616
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekrāna Mērjosla"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KRulers"
diff --git a/translations/desktop_files/kruler.desktop/ms.po b/translations/desktop_files/kruler.desktop/ms.po
new file mode 100644
index 00000000..d6742e83
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Pembaris Skrin"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KPembaris"
diff --git a/translations/desktop_files/kruler.desktop/nb.po b/translations/desktop_files/kruler.desktop/nb.po
new file mode 100644
index 00000000..69225642
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Skjermlinjal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/nds.po b/translations/desktop_files/kruler.desktop/nds.po
new file mode 100644
index 00000000..d72ebdcf
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Schirmlineaal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/ne.po b/translations/desktop_files/kruler.desktop/ne.po
new file mode 100644
index 00000000..e969234e
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "पर्दा रूलर"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "केडीई रूलर"
diff --git a/translations/desktop_files/kruler.desktop/nl.po b/translations/desktop_files/kruler.desktop/nl.po
new file mode 100644
index 00000000..da771b50
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Schermliniaal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/nn.po b/translations/desktop_files/kruler.desktop/nn.po
new file mode 100644
index 00000000..3a35005d
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Skjermlinjal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/pl.po b/translations/desktop_files/kruler.desktop/pl.po
new file mode 100644
index 00000000..c68ebc2b
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Linijka ekranowa"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "Linijka"
diff --git a/translations/desktop_files/kruler.desktop/pt.po b/translations/desktop_files/kruler.desktop/pt.po
new file mode 100644
index 00000000..e62f9b47
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/pt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Régua do Ecrã"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/pt_BR.po b/translations/desktop_files/kruler.desktop/pt_BR.po
new file mode 100644
index 00000000..8fb828ce
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Régua da Tela"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KRégua"
diff --git a/translations/desktop_files/kruler.desktop/ro.po b/translations/desktop_files/kruler.desktop/ro.po
new file mode 100644
index 00000000..26023ae8
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Riglă de ecran"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "Riglă"
diff --git a/translations/desktop_files/kruler.desktop/ru.po b/translations/desktop_files/kruler.desktop/ru.po
new file mode 100644
index 00000000..8e6c45d4
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Экранная линейка TDE"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/se.po b/translations/desktop_files/kruler.desktop/se.po
new file mode 100644
index 00000000..2a5d7226
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Šearpmalinjála"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/sk.po b/translations/desktop_files/kruler.desktop/sk.po
new file mode 100644
index 00000000..03ac7de1
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Pravítko obrazovky"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/sl.po b/translations/desktop_files/kruler.desktop/sl.po
new file mode 100644
index 00000000..7ab6cfe6
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Zaslonsko ravnilo"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/sr.po b/translations/desktop_files/kruler.desktop/sr.po
new file mode 100644
index 00000000..3c7a5153
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Екрански лењир"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/sr@Latn.po b/translations/desktop_files/kruler.desktop/sr@Latn.po
new file mode 100644
index 00000000..bed94c07
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekranski lenjir"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/sv.po b/translations/desktop_files/kruler.desktop/sv.po
new file mode 100644
index 00000000..8687b07b
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Skärmlinjal"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "Kruler"
diff --git a/translations/desktop_files/kruler.desktop/ta.po b/translations/desktop_files/kruler.desktop/ta.po
new file mode 100644
index 00000000..0ec6ae88
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "திரை உருளை"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "கேவரை உருளை"
diff --git a/translations/desktop_files/kruler.desktop/tg.po b/translations/desktop_files/kruler.desktop/tg.po
new file mode 100644
index 00000000..a53f8a74
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ҷадвали экрании TDE"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/th.po b/translations/desktop_files/kruler.desktop/th.po
new file mode 100644
index 00000000..e97c94da
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "ไม้บรรทัดสำหรับจอภาพ"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "ไม้บรรทัด - K"
diff --git a/translations/desktop_files/kruler.desktop/tr.po b/translations/desktop_files/kruler.desktop/tr.po
new file mode 100644
index 00000000..5b140826
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekran Cetveli"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/uk.po b/translations/desktop_files/kruler.desktop/uk.po
new file mode 100644
index 00000000..cf918af3
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kruler-krulerdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Лінійка екрана"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KRuler"
diff --git a/translations/desktop_files/kruler.desktop/uz.po b/translations/desktop_files/kruler.desktop/uz.po
new file mode 100644
index 00000000..568f6ea4
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Ekran lineykasi"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/uz@cyrillic.po b/translations/desktop_files/kruler.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..c08a9d8e
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Экран линейкаси"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/ven.po b/translations/desktop_files/kruler.desktop/ven.po
new file mode 100644
index 00000000..1f511500
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Muvhusi wa Tshikirini"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "Muvhusi wa K"
diff --git a/translations/desktop_files/kruler.desktop/zh_CN.po b/translations/desktop_files/kruler.desktop/zh_CN.po
new file mode 100644
index 00000000..5855616c
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "屏幕标尺"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/zh_HK.po b/translations/desktop_files/kruler.desktop/zh_HK.po
new file mode 100644
index 00000000..3136bfde
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "螢幕尺規"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr ""
diff --git a/translations/desktop_files/kruler.desktop/zh_TW.po b/translations/desktop_files/kruler.desktop/zh_TW.po
new file mode 100644
index 00000000..9a83c090
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "螢幕尺規"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KRuler 尺規"
diff --git a/translations/desktop_files/kruler.desktop/zu.po b/translations/desktop_files/kruler.desktop/zu.po
new file mode 100644
index 00000000..026642c6
--- /dev/null
+++ b/translations/desktop_files/kruler.desktop/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:40+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: kruler.desktop:2
+msgid "Screen Ruler"
+msgstr "Umlawuli Wesikrini"
+
+#. Name
+#: kruler.desktop:3
+msgid "KRuler"
+msgstr "KUmlawuli"
diff --git a/translations/desktop_files/ksnapshot.desktop/af.po b/translations/desktop_files/ksnapshot.desktop/af.po
new file mode 100644
index 00000000..719974da
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Skerm Vang Program"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ar.po b/translations/desktop_files/ksnapshot.desktop/ar.po
new file mode 100644
index 00000000..5e1ccf53
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "برنامج تصوير الشاشة"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/bg.po b/translations/desktop_files/ksnapshot.desktop/bg.po
new file mode 100644
index 00000000..9452a777
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Снимки на екрана"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/bs.po b/translations/desktop_files/ksnapshot.desktop/bs.po
new file mode 100644
index 00000000..f8da84bb
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program za \"hvatanje\" slike"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ca.po b/translations/desktop_files/ksnapshot.desktop/ca.po
new file mode 100644
index 00000000..48d748d7
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Programa de captura de pantalla"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/cs.po b/translations/desktop_files/ksnapshot.desktop/cs.po
new file mode 100644
index 00000000..014020f9
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Snímač obrazovky"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/cy.po b/translations/desktop_files/ksnapshot.desktop/cy.po
new file mode 100644
index 00000000..47b794f6
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Rhaglen Cipio'r Sgrîn"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/da.po b/translations/desktop_files/ksnapshot.desktop/da.po
new file mode 100644
index 00000000..0fe2d69d
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program til øjebliksbilleder"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/de.po b/translations/desktop_files/ksnapshot.desktop/de.po
new file mode 100644
index 00000000..1dbebe53
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Bildschirmfotos"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/el.po b/translations/desktop_files/ksnapshot.desktop/el.po
new file mode 100644
index 00000000..6d1e5242
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Πρόγραμμα σύλληψης οθόνης"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/eo.po b/translations/desktop_files/ksnapshot.desktop/eo.po
new file mode 100644
index 00000000..e18fd997
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Ekranfota programo"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/es.po b/translations/desktop_files/ksnapshot.desktop/es.po
new file mode 100644
index 00000000..123eeb34
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Capturador de pantalla"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/et.po b/translations/desktop_files/ksnapshot.desktop/et.po
new file mode 100644
index 00000000..024f8174
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Töölaua pildistamine"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/eu.po b/translations/desktop_files/ksnapshot.desktop/eu.po
new file mode 100644
index 00000000..3e136ffb
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Pantailari argazkiak ateratzeko programa"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/fa.po b/translations/desktop_files/ksnapshot.desktop/fa.po
new file mode 100644
index 00000000..52be7e42
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "برنامۀ گیراندازی پرده"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/fi.po b/translations/desktop_files/ksnapshot.desktop/fi.po
new file mode 100644
index 00000000..7d36c0e4
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Ruudunkaappausohjelma"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/fr.po b/translations/desktop_files/ksnapshot.desktop/fr.po
new file mode 100644
index 00000000..432d0a5e
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Logiciel de capture d'écran"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ga.po b/translations/desktop_files/ksnapshot.desktop/ga.po
new file mode 100644
index 00000000..c2bc8aca
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ga.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Clár gabhála scáileáin"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/gl.po b/translations/desktop_files/ksnapshot.desktop/gl.po
new file mode 100644
index 00000000..8d45a1ea
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Progama para facer capturas de pantalla"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/he.po b/translations/desktop_files/ksnapshot.desktop/he.po
new file mode 100644
index 00000000..d98b5259
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "תוכנית לצילום המסך"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/hi.po b/translations/desktop_files/ksnapshot.desktop/hi.po
new file mode 100644
index 00000000..fb67a80e
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "स्क्रीन केप्चर प्रोग्राम"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr "के-स्नेपशॉट"
diff --git a/translations/desktop_files/ksnapshot.desktop/hr.po b/translations/desktop_files/ksnapshot.desktop/hr.po
new file mode 100644
index 00000000..a18f980f
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program za snimanje zaslona"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/hu.po b/translations/desktop_files/ksnapshot.desktop/hu.po
new file mode 100644
index 00000000..f1c9284b
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Képlopó"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/is.po b/translations/desktop_files/ksnapshot.desktop/is.po
new file mode 100644
index 00000000..2d3cc174
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Forrit sem grípur skjámyndir"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/it.po b/translations/desktop_files/ksnapshot.desktop/it.po
new file mode 100644
index 00000000..4e0ac6fe
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: 2021-05-19 03:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/ksnapshot-ksnapshotdesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Scatta foto allo schermo"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr "KSnapshot"
diff --git a/translations/desktop_files/ksnapshot.desktop/ja.po b/translations/desktop_files/ksnapshot.desktop/ja.po
new file mode 100644
index 00000000..09760abd
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "スクリーンキャプチャプログラム"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/kk.po b/translations/desktop_files/ksnapshot.desktop/kk.po
new file mode 100644
index 00000000..afd054ab
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Экраннан түсіріп алу бағдарламасы"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/km.po b/translations/desktop_files/ksnapshot.desktop/km.po
new file mode 100644
index 00000000..55c08c19
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "កម្មវិធី​ចាប់យក​អេក្រង់"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ksnapshot.desktop.pot b/translations/desktop_files/ksnapshot.desktop/ksnapshot.desktop.pot
new file mode 100644
index 00000000..7778518b
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ksnapshot.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr ""
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/lt.po b/translations/desktop_files/ksnapshot.desktop/lt.po
new file mode 100644
index 00000000..6467ac2e
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Ekrano kopijos programa"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/lv.po b/translations/desktop_files/ksnapshot.desktop/lv.po
new file mode 100644
index 00000000..42271c0d
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Ekrāna Sagrābšanas Programma"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ms.po b/translations/desktop_files/ksnapshot.desktop/ms.po
new file mode 100644
index 00000000..43c7317f
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program Cekupan Skrin"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/mt.po b/translations/desktop_files/ksnapshot.desktop/mt.po
new file mode 100644
index 00000000..e579f914
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/mt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Programm biex tieħu \"ritratt\" tal-iskrin"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/nb.po b/translations/desktop_files/ksnapshot.desktop/nb.po
new file mode 100644
index 00000000..1ee48bc2
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Skjermdumpprogram"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/nds.po b/translations/desktop_files/ksnapshot.desktop/nds.po
new file mode 100644
index 00000000..fc7be1eb
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Schirmfotos opnehmen"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ne.po b/translations/desktop_files/ksnapshot.desktop/ne.po
new file mode 100644
index 00000000..350813c6
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "पर्दा समात्ने कार्यक्रम"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/nl.po b/translations/desktop_files/ksnapshot.desktop/nl.po
new file mode 100644
index 00000000..364a37a7
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Schermafdrukprogramma"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/nn.po b/translations/desktop_files/ksnapshot.desktop/nn.po
new file mode 100644
index 00000000..6e7a3625
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program for skjermbilete"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/nso.po b/translations/desktop_files/ksnapshot.desktop/nso.po
new file mode 100644
index 00000000..97e068d7
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/nso.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Lenaneo lago Apesa Pontsho"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/pl.po b/translations/desktop_files/ksnapshot.desktop/pl.po
new file mode 100644
index 00000000..14d3d7a0
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/pl.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Jan Stolarek <jwstolarek@gmail.com>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: 2020-08-14 11:31+0000\n"
+"Last-Translator: Jan Stolarek <jwstolarek@gmail.com>\n"
+"Language-Team: Polish <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/ksnapshot-ksnapshotdesktop/pl/>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program do zrzutów ekranu"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr "Zrzuty ekranu"
diff --git a/translations/desktop_files/ksnapshot.desktop/pt.po b/translations/desktop_files/ksnapshot.desktop/pt.po
new file mode 100644
index 00000000..636faf97
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/ksnapshot-ksnapshotdesktop/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Programa de Captura do Ecrã"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr "KSnapshot"
diff --git a/translations/desktop_files/ksnapshot.desktop/pt_BR.po b/translations/desktop_files/ksnapshot.desktop/pt_BR.po
new file mode 100644
index 00000000..a0c192a8
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Programa de Captura de Tela"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ro.po b/translations/desktop_files/ksnapshot.desktop/ro.po
new file mode 100644
index 00000000..1ce8c784
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program de captură de ecran"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ru.po b/translations/desktop_files/ksnapshot.desktop/ru.po
new file mode 100644
index 00000000..06954d12
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Создание снимков экрана"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/rw.po b/translations/desktop_files/ksnapshot.desktop/rw.po
new file mode 100644
index 00000000..e002a4ab
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/rw.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Porogaramu Gufata Mugaragaza"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/se.po b/translations/desktop_files/ksnapshot.desktop/se.po
new file mode 100644
index 00000000..0a6f0cf3
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Šearbmagovvenprográmma"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/sk.po b/translations/desktop_files/ksnapshot.desktop/sk.po
new file mode 100644
index 00000000..04f0630b
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Zachytenie obrazovky"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/sl.po b/translations/desktop_files/ksnapshot.desktop/sl.po
new file mode 100644
index 00000000..209d8d4c
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program za zajem zaslona"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/sr.po b/translations/desktop_files/ksnapshot.desktop/sr.po
new file mode 100644
index 00000000..f5929919
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Програм за снимање екрана"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/sr@Latn.po b/translations/desktop_files/ksnapshot.desktop/sr@Latn.po
new file mode 100644
index 00000000..0899ef07
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Program za snimanje ekrana"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/sv.po b/translations/desktop_files/ksnapshot.desktop/sv.po
new file mode 100644
index 00000000..0fb2fa50
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Ta en skärmdump"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ta.po b/translations/desktop_files/ksnapshot.desktop/ta.po
new file mode 100644
index 00000000..18cc576e
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "திரை கைப்பற்றும் நிரலி"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/tg.po b/translations/desktop_files/ksnapshot.desktop/tg.po
new file mode 100644
index 00000000..38f55657
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Эҷоди суратҳои экран"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/th.po b/translations/desktop_files/ksnapshot.desktop/th.po
new file mode 100644
index 00000000..9d5558f1
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "โปรแกรมจับภาพหน้าจอ"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/tr.po b/translations/desktop_files/ksnapshot.desktop/tr.po
new file mode 100644
index 00000000..7df56ac9
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Ekran Yakalama Programı"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/uk.po b/translations/desktop_files/ksnapshot.desktop/uk.po
new file mode 100644
index 00000000..9e75b0f7
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/ksnapshot-ksnapshotdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Захоплювач екрана"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr "KSnapshot"
diff --git a/translations/desktop_files/ksnapshot.desktop/uz.po b/translations/desktop_files/ksnapshot.desktop/uz.po
new file mode 100644
index 00000000..43f9bf79
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Skrinshot olish dasturi"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/uz@cyrillic.po b/translations/desktop_files/ksnapshot.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..24cd6759
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Скриншот олиш дастури"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/ven.po b/translations/desktop_files/ksnapshot.desktop/ven.po
new file mode 100644
index 00000000..1fd8383b
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Mbekanya mushumo ino gavha tshikirini"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/wa.po b/translations/desktop_files/ksnapshot.desktop/wa.po
new file mode 100644
index 00000000..4afea554
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Programe po fé des waitroûlêyes"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/xh.po b/translations/desktop_files/ksnapshot.desktop/xh.po
new file mode 100644
index 00000000..5db0ec08
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Iinkcazelo Ezigcina Ikhusi"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/zh_CN.po b/translations/desktop_files/ksnapshot.desktop/zh_CN.po
new file mode 100644
index 00000000..c295783a
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "屏幕截图程序"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/zh_HK.po b/translations/desktop_files/ksnapshot.desktop/zh_HK.po
new file mode 100644
index 00000000..9c737d9b
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "螢幕擷取程式"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/zh_TW.po b/translations/desktop_files/ksnapshot.desktop/zh_TW.po
new file mode 100644
index 00000000..b4fd202d
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "畫面擷取程式"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksnapshot.desktop/zu.po b/translations/desktop_files/ksnapshot.desktop/zu.po
new file mode 100644
index 00000000..7ad4ff70
--- /dev/null
+++ b/translations/desktop_files/ksnapshot.desktop/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:46+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: ksnapshot.desktop:2
+msgid "Screen Capture Program"
+msgstr "Iprogremu Yokubamba Isikrini"
+
+#. Name
+#: ksnapshot.desktop:4
+msgid "KSnapshot"
+msgstr ""
diff --git a/translations/desktop_files/ksvg-desktops/ar.po b/translations/desktop_files/ksvg-desktops/ar.po
new file mode 100644
index 00000000..c1927ee6
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ar.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "خلفية رسم KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "خلفية رسم ل KSVG - هندسة Anti Grain"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+#, fuzzy
+msgid "New, unstable ksvg rendering backend"
+msgstr "خلفية الرسم لksvg البالغة"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "خلفية الرسم ل KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "خلفية الرسم لksvg البالغة"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "برنامج KSVGPlugin"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "عارض الرسومات الثابتة القابلة للقياس"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "رسومات ثابتة قابلة للقياس"
diff --git a/translations/desktop_files/ksvg-desktops/az.po b/translations/desktop_files/ksvg-desktops/az.po
new file mode 100644
index 00000000..158266e9
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/az.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Miqyaslı Vektor Qrafikaları Nümayişçisi"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Miqyaslı Vektor Qrafikaları"
diff --git a/translations/desktop_files/ksvg-desktops/bs.po b/translations/desktop_files/ksvg-desktops/bs.po
new file mode 100644
index 00000000..4f580cf0
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/bs.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG renderiranje"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG renderiranje - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Novi, nestabilni ksvg renderiranje backend"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG renderiranje - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Zreli ksvg rendering backend"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Scalable Vector Graphics preglednik"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Scalable Vector Graphics preglednik"
diff --git a/translations/desktop_files/ksvg-desktops/ca.po b/translations/desktop_files/ksvg-desktops/ca.po
new file mode 100644
index 00000000..8447dc34
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ca.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Representació en segon pla de KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Representació en segon pla de KSVG - Geometria anti gra"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nou, inestable representador en segon pla de ksvg"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Representació en segon pla de KSVG - Biblioteca d'imatges"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Representador madur en segon pla de ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Connector KSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visualitzador de gràfics vectorials escalables (SVG)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Gràfics vectorials escalables (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/cs.po b/translations/desktop_files/ksvg-desktops/cs.po
new file mode 100644
index 00000000..ef0c0858
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/cs.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Vykreslovací nástroj KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Vykreslovací nástroj KSVG - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nový, nestabilní vykreslovací nástroj KSVG"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Vykreslovací nástroj KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Vyspělý vykreslovací nástroj KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Prohlížeč pro formát Scalable Vector Graphics (SVG)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Prohlížeč pro formát Scalable Vector Graphics (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/cy.po b/translations/desktop_files/ksvg-desktops/cy.po
new file mode 100644
index 00000000..e21dadd0
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/cy.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Ôl-wyneb Llunio KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Ôl-wyneb Llunio KSVG - Geometreg Wrth-Raen"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Ôl-wyneb llunio ksvg newydd, ansad"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Ôl-wyneb Llunio KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Ôl-wyneb llunio ksvg aeddfed"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "AtegynKSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Gwelydd Graffeg Fector Graddedig"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Graffeg Fector Graddedig"
diff --git a/translations/desktop_files/ksvg-desktops/da.po b/translations/desktop_files/ksvg-desktops/da.po
new file mode 100644
index 00000000..03a4fcba
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/da.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Underliggende program for KSVG-visning"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Underliggende program for KSVG-visning - antikorn geometri"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nyt, ustabilt underliggende program til ksvg-visning"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Underliggende program til KSVG-visning - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Modent underliggende program til ksvg-visning"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Fremviser af skalerbar vektorgrafik"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skalerbar vektorgrafik"
diff --git a/translations/desktop_files/ksvg-desktops/de.po b/translations/desktop_files/ksvg-desktops/de.po
new file mode 100644
index 00000000..8bb23240
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/de.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG-Darstellungsmodul"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG-Darstellungsmodul - Antikörnungs-Geometrie"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Neues, unausgereiftes KSVG-Darstellungsmodul"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG-Darstellungsmodul - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Ausgereiftes KSVG-Darstellungsmodul"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Betrachter für skalierbare Vektorgraphiken"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skalierbare Vektorgraphiken"
diff --git a/translations/desktop_files/ksvg-desktops/el.po b/translations/desktop_files/ksvg-desktops/el.po
new file mode 100644
index 00000000..e710c9c3
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/el.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Σύστημα υποστήριξης αποτύπωσης του KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Σύστημα υποστήριξης αποτύπωσης του KSVG - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Νέο υπό ανάπτυξη σύστημα υποστήριξης αποτύπωσης"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Σύστημα υποστήριξης αποτύπωσης του KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Ώριμο σύστημα υποστήριξης αποτύπωσης του KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Πρόσθετο KSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Προβολέας διανυσματικών γραφικών"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Διανυσματικά γραφικά"
diff --git a/translations/desktop_files/ksvg-desktops/eo.po b/translations/desktop_files/ksvg-desktops/eo.po
new file mode 100644
index 00000000..5f785bfb
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/eo.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Vektorgrafiko-kromaĵo"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Rigardilo por pligrandigeblaj vektorgrafikoj"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Vektorgrafikoj"
diff --git a/translations/desktop_files/ksvg-desktops/es.po b/translations/desktop_files/ksvg-desktops/es.po
new file mode 100644
index 00000000..016ab2c1
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/es.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Motor de procesado de KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Motor de procesado de KSVG - Geometría suavizada"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nuevo motor de procesado de ksvg, inestable"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Motor de procesado de KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Motor de procesado de ksvg tradicional"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visor de gráficos vectoriales escalables (SVG)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Gráficos vectoriales escalables (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/et.po b/translations/desktop_files/ksvg-desktops/et.po
new file mode 100644
index 00000000..a67cabed
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/et.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG renderdamise taustarakendus"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG renderdamise taustarakendus - teralisusevastane geomeetria (AGG)"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Uus ebastabiilne ksvg renderdamise taustarakendus"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG renderdamise taustarakendus - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Kasutamisküps ksvg renderdamise taustarakendus"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Skaleeritava vektorgraafika (SVG) näitaja"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skaleeritav vektorgraafika (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/eu.po b/translations/desktop_files/ksvg-desktops/eu.po
new file mode 100644
index 00000000..6228e7a0
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/eu.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG errendatze programa"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG errendatze programa - Anti Grain geometriarekin"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Berria, ksvg errendatze programa ezegonkorra"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG errendatze programa - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "ksvg errendatze programa egonkorra"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVGPlugina"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Scalable Vector Graphics ikustailua"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Scalable Vector Graphics ikustailua"
diff --git a/translations/desktop_files/ksvg-desktops/fa.po b/translations/desktop_files/ksvg-desktops/fa.po
new file mode 100644
index 00000000..2982c687
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/fa.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "پایانۀ پشتیبانی پرداخت KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "پایانۀ پشتیبانی پرداخت KSVG - هندسۀ ضد ذره"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "جدید، پایانۀ پشتیبانی ناپایدار پرداخت ksvg"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "پایانۀ پشتیبانی پرداخت KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "پایانۀ پشتیبانی کامل پرداخت ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "مشاهده‌گر نگاره‌‌‌‌‌سازی مقیاس‌پذیر برداری"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "نگاره‌سازی مقیاس‌پذیر برداری"
diff --git a/translations/desktop_files/ksvg-desktops/fi.po b/translations/desktop_files/ksvg-desktops/fi.po
new file mode 100644
index 00000000..39558891
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/fi.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG-piirtäjän taustaohjelma"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG-piirtäjän taustaohjelma - sileä geometria"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Uusi epävakaa ksvg-piirtäjän taustaohjelma"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG-piirtäjän taustaohjelma - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Kypsä ksvg-piirtäjän taustaohjelma"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Scalable Vector Graphics -näytin"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Scalable Vector Graphics -näytin"
diff --git a/translations/desktop_files/ksvg-desktops/fr.po b/translations/desktop_files/ksvg-desktops/fr.po
new file mode 100644
index 00000000..f17f9209
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/fr.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Moteur de rendu KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Moteur de rendu KSVG - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nouveau moteur de rendu KSVG instable"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Moteur de rendu KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Moteur de rendu KSVG mature"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Module SVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Afficheur d'images au format Graphisme vectoriel échelonnable (SVG)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Graphisme vectoriel échelonnable (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/ga.po b/translations/desktop_files/ksvg-desktops/ga.po
new file mode 100644
index 00000000..946de996
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ga.po
@@ -0,0 +1,60 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Inneall Rindreála KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+#, fuzzy
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Inneall Rindreála KSVG - Libart"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Inneall Rindreála KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+#, fuzzy
+msgid "Mature ksvg rendering backend"
+msgstr "Inneall Rindreála KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Amharcán SVG (Scalable Vector Graphics)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Amharcán SVG (Scalable Vector Graphics)"
diff --git a/translations/desktop_files/ksvg-desktops/gl.po b/translations/desktop_files/ksvg-desktops/gl.po
new file mode 100644
index 00000000..1b0a8ee8
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/gl.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Backend de Renderizado KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Mecanismo de Interpretación KSVG - Xeometría Anti-gran"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Novo e inestábel mecanismo de interpretación ksvg"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Mecanismo de Interpretación KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Mecanismo de interpretación maduro ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visor de gráficos vectoriais escalables"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Gráficos vectoriais escalables"
diff --git a/translations/desktop_files/ksvg-desktops/he.po b/translations/desktop_files/ksvg-desktops/he.po
new file mode 100644
index 00000000..89192de9
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/he.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "מנוע רינדור KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "מנוע רינדור KSVG"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "חדש, מנוע רינדור לא יציב עבור KSVG"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+#, fuzzy
+msgid "KSVG Rendering Backend - Libart"
+msgstr "מנוע רינדור KSVG"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+#, fuzzy
+msgid "Mature ksvg rendering backend"
+msgstr "חדש, מנוע רינדור לא יציב עבור KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr ""
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr ""
diff --git a/translations/desktop_files/ksvg-desktops/hi.po b/translations/desktop_files/ksvg-desktops/hi.po
new file mode 100644
index 00000000..0195f010
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/hi.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "के-एसवीजी रेंडरिंग बैकएण्ड"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "के-एसवीजी रेंडरिंग बैकएण्ड- एन्टी ग्रेन ज्यामिती"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "नया, अस्थिर के-एसवीजी रेंडरिंग बैकएण्ड"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "के-एसवीजी रेंडरिंग बैकएण्ड- लिबआर्ट"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "परिपक्व के-एसवीजी रेंडरिंग बैकएण्ड"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "के-एसवीजी-प्लगइन"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "स्केलेबल वेक्टर ग्राफिक्स प्रदर्शक"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "स्केलेबल वेक्टर ग्राफिक्स"
diff --git a/translations/desktop_files/ksvg-desktops/hr.po b/translations/desktop_files/ksvg-desktops/hr.po
new file mode 100644
index 00000000..1bd62f92
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/hr.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Preglednik SVG datoteka"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Preglednik SVG datoteka"
diff --git a/translations/desktop_files/ksvg-desktops/hu.po b/translations/desktop_files/ksvg-desktops/hu.po
new file mode 100644
index 00000000..6d9cd37a
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/hu.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG megjelenítőmotor"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG megjelenítő motor - AGG (Anti Grain Geometry)"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Új, még nem teljesen kiforrott megjelenítőmotor a KSVG-hez"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG megjelenítőmotor - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Egy kiforrott megjelenítőmotor a KSVG-hez"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVG bővítőmodul"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "SVG-megjelenítő"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "SVG"
diff --git a/translations/desktop_files/ksvg-desktops/is.po b/translations/desktop_files/ksvg-desktops/is.po
new file mode 100644
index 00000000..a4ceb545
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/is.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG teiknari"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG teiknari - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nýr og óstöðugur ksvg teiknari"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG teiknari - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Reyndur ksvg teiknari"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVGÍforrit"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Scalable Vector Graphics (SVG) myndbirtir"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Scalable Vector Graphics (SVG) myndbirtir"
diff --git a/translations/desktop_files/ksvg-desktops/it.po b/translations/desktop_files/ksvg-desktops/it.po
new file mode 100644
index 00000000..196bd7b0
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/it.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: 2021-05-19 03:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/ksvg-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Backend di KSVG per il rendering"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Backend KSVG per il rendering - Geometrie senza sgranature"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nuovo, instabile backend di KSVG per il rendering"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Backend di KSVG per il rendering - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Maturo backend di KSVG per il rendering"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVGPlugin"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visore di file SVG"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Grafica vettoriale riscalabile"
diff --git a/translations/desktop_files/ksvg-desktops/ja.po b/translations/desktop_files/ksvg-desktops/ja.po
new file mode 100644
index 00000000..f5305e9c
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ja.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG レンダリングバックエンド"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG レンダリングバックエンド - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "新しく、まだ開発途上の ksvg レンダリングバックエンド"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG レンダリングバックエンド - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "成熟した ksvg レンダリングバックエンド"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "SVG (スケーラブルベクトルグラフィックス) ビューア"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "SVG (スケーラブルベクトルグラフィックス)"
diff --git a/translations/desktop_files/ksvg-desktops/kk.po b/translations/desktop_files/ksvg-desktops/kk.po
new file mode 100644
index 00000000..0e922ebf
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/kk.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG кескіндеу бағдарламасы"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG кескіндеу бағдарламасы - қиыршықтыққа қарсы геометриясы"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Жаңа, әлі тұрақсыз KSVG кескіндеу бағдарламасы"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG кескіндеу бағдарламасы - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Баяғы, жетілірдірген, KSVG кескіндеу бағдарламасы"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "SVG файлдарды қарау"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "SVG сызбалы суреттер"
diff --git a/translations/desktop_files/ksvg-desktops/km.po b/translations/desktop_files/ksvg-desktops/km.po
new file mode 100644
index 00000000..f7261f1a
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/km.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "កម្មវិធី​សម្រាប់​បង្ហាញ KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "កម្មវិធី​សម្រាប់​បង្ហាញ KSVG - រាង​មិន​គ្រើម"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "កម្មវិធី​សម្រាប់​បង្ហាញ ksvg ថ្មី​តែ​មិន​សូវ​ឋិតថេរ"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "កម្មវិធី​សម្រាប់​បង្ហាញ KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "កម្មវិធី​សម្រាប់​បង្ហាញ ksvg ចាស់ៗ"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "កម្មវិធី​មើល​ក្រាហ្វិក​វ៉ិចទ័រ​មាន​មាត្រដ្ឋាន"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "ក្រាហ្វិក​វ៉ិចទ័រ​មាន​មាត្រដ្ឋាន"
diff --git a/translations/desktop_files/ksvg-desktops/ksvg-desktops.pot b/translations/desktop_files/ksvg-desktops/ksvg-desktops.pot
new file mode 100644
index 00000000..eac2a3f0
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ksvg-desktops.pot
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr ""
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr ""
diff --git a/translations/desktop_files/ksvg-desktops/lt.po b/translations/desktop_files/ksvg-desktops/lt.po
new file mode 100644
index 00000000..2b84ba9d
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/lt.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG atkūrimo programinė sąsaja"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG atkūrimo programinė sąsaja - Anti Grain geometrija"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nauja, nestabili ksvg atkūrimo programinė sąsaja"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG atkūrimo programinė sąsaja - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Išvystyta ksvg atkūrimo programinė sąsaja"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Kintamo dydžio vektorinė grafika"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Kintamo dydžio vektorinė grafika"
diff --git a/translations/desktop_files/ksvg-desktops/lv.po b/translations/desktop_files/ksvg-desktops/lv.po
new file mode 100644
index 00000000..6fcfa111
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/lv.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVGIespraudnis"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Mērogojamas Vektoru Grafikas Skatītājs"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Mērogojama Vektoru Grafika"
diff --git a/translations/desktop_files/ksvg-desktops/ms.po b/translations/desktop_files/ksvg-desktops/ms.po
new file mode 100644
index 00000000..243385ca
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ms.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Tepi Belakang Menrealisasi KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Tepi Belakang KSVG - Geometri Anti Bijian"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Tepi Belakang Menrealisasi ksvg yang baru dan tidak stabil"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Tepi Belakang Menrealisasi KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Tepi belakang menrealisasi ksvg matang"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Pemapar Grafik Vektor Boleh Skala"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Grafik Vektor Boleh Skala"
diff --git a/translations/desktop_files/ksvg-desktops/mt.po b/translations/desktop_files/ksvg-desktops/mt.po
new file mode 100644
index 00000000..58675154
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/mt.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Werrej tas-\"Scalable Vector Graphics\""
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Werrej tas-\"Scalable Vector Graphics\""
diff --git a/translations/desktop_files/ksvg-desktops/nb.po b/translations/desktop_files/ksvg-desktops/nb.po
new file mode 100644
index 00000000..6eacb936
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/nb.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Modul for KSVG-tegning"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Modul for KSVG-tegning – antikorngeometri"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Ny og ustabil modul for ksvg-tegning"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Modul for KSVG-tegning – Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Velutviklet modul for ksvg-tegning"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Framvisningsprogram for SVG-bilde («Scalable Vector Graphics»)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Framvisningsprogram for SVG-bilde («Scalable Vector Graphics»)"
diff --git a/translations/desktop_files/ksvg-desktops/nds.po b/translations/desktop_files/ksvg-desktops/nds.po
new file mode 100644
index 00000000..0aa509a1
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/nds.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG-Dorstellhölper"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG-Dorstellhölper - Antigrissel-Geometrie"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nieg, nich stevig KSVG-Dorstellhölper"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG-Dorstellhölper - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Reep KSVG-Dorstellhölper"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Kieker för skaleerbor Vektorgrafiken"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skaleerbor Vektorgrafiken"
diff --git a/translations/desktop_files/ksvg-desktops/ne.po b/translations/desktop_files/ksvg-desktops/ne.po
new file mode 100644
index 00000000..4852101d
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ne.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG रेन्डरिङ ब्याकइन्ड"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG रेन्डरिङ ब्याकइन्ड - एन्टि ग्रेन ज्योमेट्रि"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "नयाँ, अस्थिर ksvg रेन्डरिङ ब्याकइन्ड"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG रेन्डरिङ ब्याकइन्ड - लिबर्ट"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "पूर्ण विकसित ksvg रेन्डरिङ ब्याकइन्ड"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVG प्लगइन"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "मापनयोग्य भेक्टर ग्राफिक्स दर्शक"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "मापनयोग्य भेक्टर ग्राफिक्स"
diff --git a/translations/desktop_files/ksvg-desktops/nl.po b/translations/desktop_files/ksvg-desktops/nl.po
new file mode 100644
index 00000000..38dbc0b1
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/nl.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG weergavecomponent"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG weergavecomponent - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nieuwe, niet stabiele KSVG weergavecomponent"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG weergavecomponent - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Volgroeide KSVG weergavecomponent"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Scalable Vector Graphics-weergaveprogramma"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Scalable Vector Graphics-weergaveprogramma"
diff --git a/translations/desktop_files/ksvg-desktops/nn.po b/translations/desktop_files/ksvg-desktops/nn.po
new file mode 100644
index 00000000..4558a93c
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/nn.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Modul for KSVG-teikning"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Modul for KSVG-teikning – antikorngeometri"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Ny og ustabil modul for ksvg-teikning"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Modul for KSVG-teikning – Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Velutvikla modul for ksvg-teikning"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Framvisingsprogram for SVG-grafikk («Scalable Vector Graphics»)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Framvisingsprogram for SVG-grafikk («Scalable Vector Graphics»)"
diff --git a/translations/desktop_files/ksvg-desktops/pl.po b/translations/desktop_files/ksvg-desktops/pl.po
new file mode 100644
index 00000000..d7b37ff0
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/pl.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Narzędzie do renderowania KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Narzędzie do renderowania KSVG - nieziarnista geometria"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nowe, niestabilne, narzędzie do renderowania KSVG"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Narzędzie do renderowania KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Dopracowane narzędzie do renderowania KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Wtyczka KSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Przeglądarka dla plików SVG (skalowalnej grafiki wektorowej)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skalowalna Grafika Wektorowa"
diff --git a/translations/desktop_files/ksvg-desktops/pt.po b/translations/desktop_files/ksvg-desktops/pt.po
new file mode 100644
index 00000000..40e52702
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/pt.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Infra-Estrutura de Desenho KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Infra-Estrutura de Desenho do KSVG - Geometria Anti-Grão"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Uma infra-estrutura de desenho do ksvg, nova e instável"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Infra-Estrutura de Desenho do KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Uma infra-estrutura de desenho do ksvg mais madura"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visualizador de Gráficos Vectoriais Escaláveis (SVG)"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "SVG - Gráficos Vectoriais Escaláveis"
diff --git a/translations/desktop_files/ksvg-desktops/pt_BR.po b/translations/desktop_files/ksvg-desktops/pt_BR.po
new file mode 100644
index 00000000..6a8553aa
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/pt_BR.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Estrutura de Renderização do KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Estrutura de Renderização do KSVG - Geometria Anti-Grain"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nova e instável estrutura de renderização do ksvg"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Estrutura de KSVG Rendering Backend - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Estrutura de renderização madura do ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visualizador de Vetores Escaláveis"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Vetores Escaláveis"
diff --git a/translations/desktop_files/ksvg-desktops/ro.po b/translations/desktop_files/ksvg-desktops/ro.po
new file mode 100644
index 00000000..51d3e634
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ro.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Motorul de randare KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Motor de randare KSVG - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Motor de randare KSVG nou, netestat suficient"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Motor de randare KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Motor de randare KSVG matur"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Modul KSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Vizualizor SVG"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Grafică vectorială scalabilă (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/ru.po b/translations/desktop_files/ksvg-desktops/ru.po
new file mode 100644
index 00000000..c64f0db5
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ru.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Движок прорисовки KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Движок отрисовки KSVG - противозернистая геометрия"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Новый, нестабильный движок прорисовки ksvg"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Движок отрисовки KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Старый движок отрисовки ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Просмотр SVG"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Векторные рисунки (.svg)"
diff --git a/translations/desktop_files/ksvg-desktops/sk.po b/translations/desktop_files/ksvg-desktops/sk.po
new file mode 100644
index 00000000..09cec873
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/sk.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Nástroj pre zobrazovanie KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Nástroj pre zobrazovanie KSVG - antigranularitná geometria"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nová, nestabilná verzia nástroja pre zobrazovanie ksvg"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Nástroj pre zobrazovanie KSVG - libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Stabilný nástroj pre zobrazovanie ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Prehliadač pre škálovateľnú vektorovú grafiku SVG"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "Prehliadač pre škálovateľnú vektorovú grafiku SVG"
diff --git a/translations/desktop_files/ksvg-desktops/sl.po b/translations/desktop_files/ksvg-desktops/sl.po
new file mode 100644
index 00000000..8b25d2ae
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/sl.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Izrisovalnik KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Izrisovalnik KSVG - Protizrnska geometrija"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nov, nestabilen izrisovalnik KSVG"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Izrisovalnik KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Zrel izrisovalnik KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Pregledovalnik skalabilne vektorske grafike"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skalabilna vektorska grafika"
diff --git a/translations/desktop_files/ksvg-desktops/sr.po b/translations/desktop_files/ksvg-desktops/sr.po
new file mode 100644
index 00000000..b221f64d
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/sr.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG-ов позадински систем за рендеровање"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG-ов позадински систем за рендеровање — Противзрнаста геометрија"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Нов, нестабилан KSVG-ов позадински систем за рендеровање"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG-ов позадински систем за рендеровање — Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Стари KSVG-ов позадински систем за рендеровање"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Приказивач скалабилне векторске графике"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Скалабилна векторска графика (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/sr@Latn.po b/translations/desktop_files/ksvg-desktops/sr@Latn.po
new file mode 100644
index 00000000..54dea4d7
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/sr@Latn.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG-ov pozadinski sistem za renderovanje"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG-ov pozadinski sistem za renderovanje — Protivzrnasta geometrija"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Nov, nestabilan KSVG-ov pozadinski sistem za renderovanje"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG-ov pozadinski sistem za renderovanje — Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Stari KSVG-ov pozadinski sistem za renderovanje"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Prikazivač skalabilne vektorske grafike"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skalabilna vektorska grafika (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/sv.po b/translations/desktop_files/ksvg-desktops/sv.po
new file mode 100644
index 00000000..05f98cad
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/sv.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG-uppritningsmodul"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG-uppritningsmodul - geometri mot korninghet"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Ny, instabil KSVG-uppritningsmodul"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG-uppritningsmodul - konstbibliotek"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Mogen KSVG-uppritningsmodul"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVG-insticksprogram"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Visning av skalbar vektorgrafik"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Skalbar vektorgrafik"
diff --git a/translations/desktop_files/ksvg-desktops/ta.po b/translations/desktop_files/ksvg-desktops/ta.po
new file mode 100644
index 00000000..1c119306
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ta.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG வழங்கும் பின் அமைப்பு"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG வழங்கும் பின் அமைப்பு - ஆன்டி க்ரேன் ஜியோமெட்ரி"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "புதிய, நிலையில்லாத ksvg வழங்கும் பின் அமைப்பு"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG வழங்கும் பின் அமைப்பு - லிபார்ட்"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "முழுமையான ksvg வழங்கும் பின் அமைப்பு"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVGசொருகுப்பொருள்"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "அளவிடக்கூடிய வெக்டார் சித்திரங்கள் காட்சி"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "அளவிடக்கூடிய வெக்டார் சித்திரங்கள்"
diff --git a/translations/desktop_files/ksvg-desktops/tg.po b/translations/desktop_files/ksvg-desktops/tg.po
new file mode 100644
index 00000000..63083144
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/tg.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Лағжандаи тасовироти KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Лағжандаи тасовироти KSVG - геометрияи мутақобили гандумӣ"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Лағжандаи ғайриустувори тасовироти ksvg-и нав"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Лағжандаи тасовироти KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Лағжандаи тасовироти кӯҳнаи ksvg"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Намоиши SVG"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Расмҳои вектории масштабкунанда (SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/tr.po b/translations/desktop_files/ksvg-desktops/tr.po
new file mode 100644
index 00000000..bdb9d1df
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/tr.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG Tarama Arkayüzü"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG Derleme Aracı - Taneciksiz Geometri"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Yeni, stabil olmayan ksvg derleme aracı"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG Derleme Aracı - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Tamamlanmış ksvg derleme aracı"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVG Eklentisi"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Boyutlandırılabilir Vektör Grafik Gösterici"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Boyutlandırılabilir Vektör Grafiği"
diff --git a/translations/desktop_files/ksvg-desktops/uk.po b/translations/desktop_files/ksvg-desktops/uk.po
new file mode 100644
index 00000000..ef99bbf8
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/uk.po
@@ -0,0 +1,59 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/ksvg-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "Інтерфейс відтворення KSVG"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "Інтерфейс відтворення KSVG - AGG"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "Новий, нестабільний інтерфейс відтворення KSVG"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "Інтерфейс відтворення KSVG - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "Стабільний інтерфейс відтворення KSVG"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "KSVGPlugin"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Переглядач векторної графіки"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Масштабовна векторна графіка"
diff --git a/translations/desktop_files/ksvg-desktops/uz.po b/translations/desktop_files/ksvg-desktops/uz.po
new file mode 100644
index 00000000..e1b03093
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/uz.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "SVG koʻruvchi"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "SVG koʻruvchi"
diff --git a/translations/desktop_files/ksvg-desktops/uz@cyrillic.po b/translations/desktop_files/ksvg-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..8756c0fb
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/uz@cyrillic.po
@@ -0,0 +1,58 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "SVG кўрувчи"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+#, fuzzy
+msgid "Scalable Vector Graphics"
+msgstr "SVG кўрувчи"
diff --git a/translations/desktop_files/ksvg-desktops/ven.po b/translations/desktop_files/ksvg-desktops/ven.po
new file mode 100644
index 00000000..d219c2d8
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/ven.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Muvhono wa girafiki wa scalable vector"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Dzigirafiki ya vekitha ya Scalable"
diff --git a/translations/desktop_files/ksvg-desktops/xh.po b/translations/desktop_files/ksvg-desktops/xh.po
new file mode 100644
index 00000000..b734285a
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/xh.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Iplagi efakiweyo ye KSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Umboniseli wemizobo olinganiselwayo onesalathiso"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Imizobo elinganiselwayo enesalathisi"
diff --git a/translations/desktop_files/ksvg-desktops/zh_CN.po b/translations/desktop_files/ksvg-desktops/zh_CN.po
new file mode 100644
index 00000000..4658d7ce
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/zh_CN.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG 渲染后端"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG 渲染后端 - 反增长几何形状"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "新的不稳定的 ksvg 渲染后端"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG 渲染后端 - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "稳定的 ksvg 渲染后端"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "可缩放矢量图查看器"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "可缩放矢量图"
diff --git a/translations/desktop_files/ksvg-desktops/zh_HK.po b/translations/desktop_files/ksvg-desktops/zh_HK.po
new file mode 100644
index 00000000..5cbbb546
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/zh_HK.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG 合成後端"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG 合成後端 - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "新但不穩定的 ksvg 合成後端"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG 合成後端 - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "成熟的 ksvg 合成後端"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "可縮放向量圖形(SVG)檢視器"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "可縮放向量圖形(SVG)"
diff --git a/translations/desktop_files/ksvg-desktops/zh_TW.po b/translations/desktop_files/ksvg-desktops/zh_TW.po
new file mode 100644
index 00000000..8c86f6ae
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/zh_TW.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr "KSVG 上色後端介面"
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr "KSVG 上色後端介面 - Anti Grain Geometry"
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr "新的,不穩定的 ksvg 上色後端介面"
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr "KSVG 上色後端介面 - Libart"
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr "成熟的 ksvg 上色後端介面"
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr ""
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "可調整的向量圖形檢視器"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "可調整的向量圖形"
diff --git a/translations/desktop_files/ksvg-desktops/zu.po b/translations/desktop_files/ksvg-desktops/zu.po
new file mode 100644
index 00000000..a844c4b7
--- /dev/null
+++ b/translations/desktop_files/ksvg-desktops/zu.po
@@ -0,0 +1,57 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-08 23:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Comment
+#: core/ksvgrenderer.desktop:5
+msgid "KSVG Rendering Backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/agg/ksvgaggcanvas.desktop:6
+msgid "KSVG Rendering Backend - Anti Grain Geometry"
+msgstr ""
+
+#. Comment
+#: plugin/backends/agg/ksvgaggcanvas.desktop:7
+msgid "New, unstable ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/backends/libart/ksvglibartcanvas.desktop:6
+msgid "KSVG Rendering Backend - Libart"
+msgstr ""
+
+#. Comment
+#: plugin/backends/libart/ksvglibartcanvas.desktop:7
+msgid "Mature ksvg rendering backend"
+msgstr ""
+
+#. Name
+#: plugin/ksvgplugin.desktop:2
+msgid "KSVGPlugin"
+msgstr "Iplagi efakiweyo ye KSVG"
+
+#. Comment
+#: plugin/ksvgplugin.desktop:3
+msgid "Scalable Vector Graphics Viewer"
+msgstr "Umbonisi wemidwebo Onenani Elibalekayo"
+
+#. Name
+#: plugin/svgthumbnail.desktop:3
+msgid "Scalable Vector Graphics"
+msgstr "Imidwebo Enenani Elibalekayo"
diff --git a/translations/desktop_files/kuickshow.desktop/af.po b/translations/desktop_files/kuickshow.desktop/af.po
new file mode 100644
index 00000000..f08420ad
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "Vinnig-vertoon"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Beeld Aansig"
diff --git a/translations/desktop_files/kuickshow.desktop/ar.po b/translations/desktop_files/kuickshow.desktop/ar.po
new file mode 100644
index 00000000..3db0b438
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "عرض سريع"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "عارض صور"
diff --git a/translations/desktop_files/kuickshow.desktop/bg.po b/translations/desktop_files/kuickshow.desktop/bg.po
new file mode 100644
index 00000000..90b60d0c
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/bg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Преглед на изображения"
diff --git a/translations/desktop_files/kuickshow.desktop/br.po b/translations/desktop_files/kuickshow.desktop/br.po
new file mode 100644
index 00000000..90f09729
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/br.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Gweler ar skeudennoù"
diff --git a/translations/desktop_files/kuickshow.desktop/bs.po b/translations/desktop_files/kuickshow.desktop/bs.po
new file mode 100644
index 00000000..acc4c4b2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/bs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Preglednik slika"
diff --git a/translations/desktop_files/kuickshow.desktop/ca.po b/translations/desktop_files/kuickshow.desktop/ca.po
new file mode 100644
index 00000000..940e5829
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ca.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Visualitzador d'imatges"
diff --git a/translations/desktop_files/kuickshow.desktop/cs.po b/translations/desktop_files/kuickshow.desktop/cs.po
new file mode 100644
index 00000000..6618d218
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/cs.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Prohlížeč obrázků"
diff --git a/translations/desktop_files/kuickshow.desktop/cy.po b/translations/desktop_files/kuickshow.desktop/cy.po
new file mode 100644
index 00000000..e56b132a
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Gwelydd Delweddau"
diff --git a/translations/desktop_files/kuickshow.desktop/da.po b/translations/desktop_files/kuickshow.desktop/da.po
new file mode 100644
index 00000000..0617b1c7
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/da.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Billedfremviser"
diff --git a/translations/desktop_files/kuickshow.desktop/de.po b/translations/desktop_files/kuickshow.desktop/de.po
new file mode 100644
index 00000000..85b755d6
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/de.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Bildbetrachter"
diff --git a/translations/desktop_files/kuickshow.desktop/el.po b/translations/desktop_files/kuickshow.desktop/el.po
new file mode 100644
index 00000000..cd145536
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/el.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Προβολέας εικόνων"
diff --git a/translations/desktop_files/kuickshow.desktop/eo.po b/translations/desktop_files/kuickshow.desktop/eo.po
new file mode 100644
index 00000000..4c45f7d0
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "Rapidmontrilo"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Bildorigardilo"
diff --git a/translations/desktop_files/kuickshow.desktop/es.po b/translations/desktop_files/kuickshow.desktop/es.po
new file mode 100644
index 00000000..32b2f45d
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/es.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Visor de imágenes"
diff --git a/translations/desktop_files/kuickshow.desktop/et.po b/translations/desktop_files/kuickshow.desktop/et.po
new file mode 100644
index 00000000..29a706c7
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/et.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Pildifailide näitaja"
diff --git a/translations/desktop_files/kuickshow.desktop/eu.po b/translations/desktop_files/kuickshow.desktop/eu.po
new file mode 100644
index 00000000..67c36ef0
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/eu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Irudi ikustailua"
diff --git a/translations/desktop_files/kuickshow.desktop/fa.po b/translations/desktop_files/kuickshow.desktop/fa.po
new file mode 100644
index 00000000..151936a4
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/fa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "مشاهده‌گر تصویر"
diff --git a/translations/desktop_files/kuickshow.desktop/fi.po b/translations/desktop_files/kuickshow.desktop/fi.po
new file mode 100644
index 00000000..c4d80424
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/fi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Kuvannäytin"
diff --git a/translations/desktop_files/kuickshow.desktop/fr.po b/translations/desktop_files/kuickshow.desktop/fr.po
new file mode 100644
index 00000000..35e9973b
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/fr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "KuickShow"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Afficheur d'images"
diff --git a/translations/desktop_files/kuickshow.desktop/ga.po b/translations/desktop_files/kuickshow.desktop/ga.po
new file mode 100644
index 00000000..ca7d1b0a
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ga.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Amharcán Íomhánna"
diff --git a/translations/desktop_files/kuickshow.desktop/gl.po b/translations/desktop_files/kuickshow.desktop/gl.po
new file mode 100644
index 00000000..34c676b2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/gl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Visor de imaxes"
diff --git a/translations/desktop_files/kuickshow.desktop/he.po b/translations/desktop_files/kuickshow.desktop/he.po
new file mode 100644
index 00000000..6c71abe2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/he.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "מציג תמונות"
diff --git a/translations/desktop_files/kuickshow.desktop/hi.po b/translations/desktop_files/kuickshow.desktop/hi.po
new file mode 100644
index 00000000..f7072134
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "क्विक-शो"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "छवि प्रदर्शक"
diff --git a/translations/desktop_files/kuickshow.desktop/hr.po b/translations/desktop_files/kuickshow.desktop/hr.po
new file mode 100644
index 00000000..7576c83f
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Preglednik slika"
diff --git a/translations/desktop_files/kuickshow.desktop/hu.po b/translations/desktop_files/kuickshow.desktop/hu.po
new file mode 100644
index 00000000..7007f1a0
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/hu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Képnézegető"
diff --git a/translations/desktop_files/kuickshow.desktop/is.po b/translations/desktop_files/kuickshow.desktop/is.po
new file mode 100644
index 00000000..ce8fa6ba
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Myndaskoðari"
diff --git a/translations/desktop_files/kuickshow.desktop/it.po b/translations/desktop_files/kuickshow.desktop/it.po
new file mode 100644
index 00000000..60e2bdfd
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/it.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "KuickShow"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Visore di immagini"
diff --git a/translations/desktop_files/kuickshow.desktop/ja.po b/translations/desktop_files/kuickshow.desktop/ja.po
new file mode 100644
index 00000000..411178ac
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ja.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "画像ビューア"
diff --git a/translations/desktop_files/kuickshow.desktop/kk.po b/translations/desktop_files/kuickshow.desktop/kk.po
new file mode 100644
index 00000000..d3836b50
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/kk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Кескіндерді қарау"
diff --git a/translations/desktop_files/kuickshow.desktop/km.po b/translations/desktop_files/kuickshow.desktop/km.po
new file mode 100644
index 00000000..f04fb618
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/km.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "កម្មវិធី​មើល​រូបភាព"
diff --git a/translations/desktop_files/kuickshow.desktop/ko.po b/translations/desktop_files/kuickshow.desktop/ko.po
new file mode 100644
index 00000000..801a50fe
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ko.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "K퀵쇼"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr ""
diff --git a/translations/desktop_files/kuickshow.desktop/kuickshow.desktop.pot b/translations/desktop_files/kuickshow.desktop/kuickshow.desktop.pot
new file mode 100644
index 00000000..677bcd98
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/kuickshow.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr ""
diff --git a/translations/desktop_files/kuickshow.desktop/lt.po b/translations/desktop_files/kuickshow.desktop/lt.po
new file mode 100644
index 00000000..f107b388
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/lt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Paveikslėlių žiūriklis"
diff --git a/translations/desktop_files/kuickshow.desktop/lv.po b/translations/desktop_files/kuickshow.desktop/lv.po
new file mode 100644
index 00000000..485b4393
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Attēlu Skatītājs"
diff --git a/translations/desktop_files/kuickshow.desktop/ms.po b/translations/desktop_files/kuickshow.desktop/ms.po
new file mode 100644
index 00000000..b8e54135
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Paparan Imej"
diff --git a/translations/desktop_files/kuickshow.desktop/mt.po b/translations/desktop_files/kuickshow.desktop/mt.po
new file mode 100644
index 00000000..975063a4
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/mt.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Werrej tal-istampi"
diff --git a/translations/desktop_files/kuickshow.desktop/nb.po b/translations/desktop_files/kuickshow.desktop/nb.po
new file mode 100644
index 00000000..ec4e6c16
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/nb.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Bildefremviser"
diff --git a/translations/desktop_files/kuickshow.desktop/nds.po b/translations/desktop_files/kuickshow.desktop/nds.po
new file mode 100644
index 00000000..5f463be2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/nds.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Bildkieker"
diff --git a/translations/desktop_files/kuickshow.desktop/ne.po b/translations/desktop_files/kuickshow.desktop/ne.po
new file mode 100644
index 00000000..547ab276
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "क्विकशो"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "छवि दर्शक"
diff --git a/translations/desktop_files/kuickshow.desktop/nl.po b/translations/desktop_files/kuickshow.desktop/nl.po
new file mode 100644
index 00000000..dd335aa7
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/nl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Afbeeldingenweergaveprogramma"
diff --git a/translations/desktop_files/kuickshow.desktop/nn.po b/translations/desktop_files/kuickshow.desktop/nn.po
new file mode 100644
index 00000000..a9fea014
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/nn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Biletvisar"
diff --git a/translations/desktop_files/kuickshow.desktop/nso.po b/translations/desktop_files/kuickshow.desktop/nso.po
new file mode 100644
index 00000000..885ce3c9
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/nso.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Molebeledi wa Ponagalo"
diff --git a/translations/desktop_files/kuickshow.desktop/pa.po b/translations/desktop_files/kuickshow.desktop/pa.po
new file mode 100644
index 00000000..f02a96f2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/pa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "ਚਿੱਤਰ ਦਰਸ਼ਕ"
diff --git a/translations/desktop_files/kuickshow.desktop/pl.po b/translations/desktop_files/kuickshow.desktop/pl.po
new file mode 100644
index 00000000..6ff49e22
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Przeglądarka obrazków"
diff --git a/translations/desktop_files/kuickshow.desktop/pt.po b/translations/desktop_files/kuickshow.desktop/pt.po
new file mode 100644
index 00000000..58fb3486
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kuickshow-kuickshowdesktop/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "Kuickshow"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Visualizador de Imagens"
diff --git a/translations/desktop_files/kuickshow.desktop/pt_BR.po b/translations/desktop_files/kuickshow.desktop/pt_BR.po
new file mode 100644
index 00000000..db60c125
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "KRápida Exibição"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Visualizador de Imagens"
diff --git a/translations/desktop_files/kuickshow.desktop/ro.po b/translations/desktop_files/kuickshow.desktop/ro.po
new file mode 100644
index 00000000..e4677542
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Vizualizor de imagini"
diff --git a/translations/desktop_files/kuickshow.desktop/ru.po b/translations/desktop_files/kuickshow.desktop/ru.po
new file mode 100644
index 00000000..e88d4fae
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ru.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Просмотр изображений"
diff --git a/translations/desktop_files/kuickshow.desktop/rw.po b/translations/desktop_files/kuickshow.desktop/rw.po
new file mode 100644
index 00000000..52b46445
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/rw.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Mugaraza Shusho"
diff --git a/translations/desktop_files/kuickshow.desktop/se.po b/translations/desktop_files/kuickshow.desktop/se.po
new file mode 100644
index 00000000..70aa37cc
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/se.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Govvačájeheaddji"
diff --git a/translations/desktop_files/kuickshow.desktop/sk.po b/translations/desktop_files/kuickshow.desktop/sk.po
new file mode 100644
index 00000000..b9d87b4d
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/sk.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Prehliadač obrázkov"
diff --git a/translations/desktop_files/kuickshow.desktop/sl.po b/translations/desktop_files/kuickshow.desktop/sl.po
new file mode 100644
index 00000000..473897e2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/sl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Pregledovalnik slik"
diff --git a/translations/desktop_files/kuickshow.desktop/sr.po b/translations/desktop_files/kuickshow.desktop/sr.po
new file mode 100644
index 00000000..d47412e2
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/sr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Приказивач слика"
diff --git a/translations/desktop_files/kuickshow.desktop/sr@Latn.po b/translations/desktop_files/kuickshow.desktop/sr@Latn.po
new file mode 100644
index 00000000..f5108edf
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/sr@Latn.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Prikazivač slika"
diff --git a/translations/desktop_files/kuickshow.desktop/sv.po b/translations/desktop_files/kuickshow.desktop/sv.po
new file mode 100644
index 00000000..53d094db
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Bildvisare"
diff --git a/translations/desktop_files/kuickshow.desktop/ta.po b/translations/desktop_files/kuickshow.desktop/ta.po
new file mode 100644
index 00000000..b42c51a8
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "விரைவுகாட்சி"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "பிம்ப காட்சி"
diff --git a/translations/desktop_files/kuickshow.desktop/tg.po b/translations/desktop_files/kuickshow.desktop/tg.po
new file mode 100644
index 00000000..780f802b
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/tg.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Намоиши тасвирот"
diff --git a/translations/desktop_files/kuickshow.desktop/th.po b/translations/desktop_files/kuickshow.desktop/th.po
new file mode 100644
index 00000000..fbf0719f
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/th.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "ดูภาพด่วน - K"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "เครื่องมือแสดงภาพ"
diff --git a/translations/desktop_files/kuickshow.desktop/tr.po b/translations/desktop_files/kuickshow.desktop/tr.po
new file mode 100644
index 00000000..147b4806
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Resim Göstericisi"
diff --git a/translations/desktop_files/kuickshow.desktop/uk.po b/translations/desktop_files/kuickshow.desktop/uk.po
new file mode 100644
index 00000000..9e8e8ec0
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kuickshow-kuickshowdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "Kuickshow"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Переглядач зображень"
diff --git a/translations/desktop_files/kuickshow.desktop/uz.po b/translations/desktop_files/kuickshow.desktop/uz.po
new file mode 100644
index 00000000..fd497767
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/uz.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Rasm koʻruvchi"
diff --git a/translations/desktop_files/kuickshow.desktop/uz@cyrillic.po b/translations/desktop_files/kuickshow.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..27e13dd4
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/uz@cyrillic.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Расм кўрувчи"
diff --git a/translations/desktop_files/kuickshow.desktop/ven.po b/translations/desktop_files/kuickshow.desktop/ven.po
new file mode 100644
index 00000000..5f829071
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "Musumbedzo wa kuick"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Tshivhoni tsha Mutaleli"
diff --git a/translations/desktop_files/kuickshow.desktop/wa.po b/translations/desktop_files/kuickshow.desktop/wa.po
new file mode 100644
index 00000000..63de2d0d
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/wa.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Håyneu d' imådjes"
diff --git a/translations/desktop_files/kuickshow.desktop/xh.po b/translations/desktop_files/kuickshow.desktop/xh.po
new file mode 100644
index 00000000..a13bb1dc
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/xh.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Umboniseli Womfanekiso"
diff --git a/translations/desktop_files/kuickshow.desktop/zh_CN.po b/translations/desktop_files/kuickshow.desktop/zh_CN.po
new file mode 100644
index 00000000..922d20d9
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/zh_CN.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "图片查看程序"
diff --git a/translations/desktop_files/kuickshow.desktop/zh_HK.po b/translations/desktop_files/kuickshow.desktop/zh_HK.po
new file mode 100644
index 00000000..37b10af3
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/zh_HK.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr ""
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "圖像檢視器"
diff --git a/translations/desktop_files/kuickshow.desktop/zh_TW.po b/translations/desktop_files/kuickshow.desktop/zh_TW.po
new file mode 100644
index 00000000..953fb798
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "Kuickshow 快秀"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "影像檢視程式"
diff --git a/translations/desktop_files/kuickshow.desktop/zu.po b/translations/desktop_files/kuickshow.desktop/zu.po
new file mode 100644
index 00000000..f60220da
--- /dev/null
+++ b/translations/desktop_files/kuickshow.desktop/zu.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 00:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: kuickshow.desktop:2
+msgid "Kuickshow"
+msgstr "I Kuickshow"
+
+#. GenericName
+#: kuickshow.desktop:11
+msgid "Image Viewer"
+msgstr "Umbonisi Womfanekiso"
diff --git a/translations/desktop_files/kview-desktops/af.po b/translations/desktop_files/kview-desktops/af.po
new file mode 100644
index 00000000..d44c8801
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/af.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr ""
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Inlegbare Beeld Aansig Komponent"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Inlegbare Beeld Aansig Kanvas (gui-element wat vertoon 'n Beeld)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Beeld Aansig"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "K-bekyk"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "K-bekyk"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "K-bekyk Beeld Aansig Gui-element"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "K-bekyk Beeld Aansig Gui-element"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Blaaier"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Aktiveer jy na blaai deur alle van die beelde in die huidige gids."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaal"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter na skaal die beeld"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skandeerder"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Open beelde van jou skandeerder binnein K-bekyk"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Werkvoorbeeld"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "'n langer beskrywing van wat die inplak doen"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Kde Beeld Aansig Deel"
diff --git a/translations/desktop_files/kview-desktops/ar.po b/translations/desktop_files/kview-desktops/ar.po
new file mode 100644
index 00000000..531be81e
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ar.po
@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "التطبيق"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "اعدادات الاصدار المستقل من KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "البرامج المساعدة"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "مكون عارض الصور القابل للدمج"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "مساحة رسم لعرض الصور قابلة للدمج (كائن يعرض صورة)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "عارض صور"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "برنامج KView"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "العارض"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "اعدادات KViewCanvas العامة"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "كائن عارض الصور KView "
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "عارض KView للصور"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "المتصفح"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "يمكنك من تصفَح كل الصور في الدليل الحالي."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "مؤثرات"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "يقدم بعض مؤثرات الصور"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "اسم"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "تعليق"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "المقدّم"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "ينشئ قائمة صور ويمكنك من استعراض الصور تلقائيا"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "تكبير أو تصغير"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "فلتر لتكبير أو تصغير الصورة"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "الماسح الضوئي"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "يفتح الصور الموجودة على ماسحك الضوئي في برنامج KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "قالب"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "وصف أطول عن عمل البرنامج المساعد"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "عارض جزء الصور ل TDE"
diff --git a/translations/desktop_files/kview-desktops/az.po b/translations/desktop_files/kview-desktops/az.po
new file mode 100644
index 00000000..7ce9b80f
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/az.po
@@ -0,0 +1,161 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Proqram"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr ""
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr ""
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr ""
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr ""
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
diff --git a/translations/desktop_files/kview-desktops/bg.po b/translations/desktop_files/kview-desktops/bg.po
new file mode 100644
index 00000000..a7e7f54d
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/bg.po
@@ -0,0 +1,170 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Програма"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Настройки на главната програма"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Приставки"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Избор и настройване на приставки"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Модул за преглед на изображения"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Модул за преглед на изображения (полето, в което се показва самото "
+"изображение)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Преглед на изображения"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Визуализатор"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Визуализатор"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Общи настройки на визуализатора (KViewCanvas)"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Преглед на изображения"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Преглед на изображения"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Браузър"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Преглед на изображенията в текущата директория"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Ефекти"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Визуални ефекти при зареждане на изображенията"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Име"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Коментар"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Презентация"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Създаване на списък с изображения и слайдшоу от тях"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Мащабиране"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Филтър за мащабиране на изображения"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Скенер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Сканиране и отваряне на изображения от скенера"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Шаблон"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Подробно описание на приставката"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Фотоалбум"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Колекциониране на снимки като във фотоалбум"
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Преглед на изображения"
diff --git a/translations/desktop_files/kview-desktops/br.po b/translations/desktop_files/kview-desktops/br.po
new file mode 100644
index 00000000..86db2b4b
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/br.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Arload"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Lugantoù"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Dibabit ha kefluniut ho lugentoù"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Parzh gweler skeudennoù enframmus"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+#, fuzzy
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Parzh gweler skeudennoù enframmus"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Gweler ar skeudennoù"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Gweler"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Gweler"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget gweler skeudennoù KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Gweler skeudennoù KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Furcher"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Anv"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Askelenn"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Emginniger"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skeulaet"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Eiltreser"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Patrom"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Levr foto"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Perzh gweler skeudennoù TDE"
diff --git a/translations/desktop_files/kview-desktops/bs.po b/translations/desktop_files/kview-desktops/bs.po
new file mode 100644
index 00000000..ae531872
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/bs.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Postavke za samostalnu verziju KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Dodaci"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Izaberite i podesite vaše dodatke"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ugradiva komponenta za pregled slika"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Ugradiva pozadina za pregled slika (grafički element koji prikazuje slike)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Preglednik slika"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Preglednik"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Preglednik"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Opšte KViewCanvas postavke"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView predglednik slika - grafički element"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView predglednik slika"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Preglednik"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Omogućuje vam da pregledate sve slike u trenutnom direktoriju."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efekti"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Pruža neke efekte za slike"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Ime"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezentator"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Pravi listu slika i omogućuje vam da napravite slide show"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaliraj"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter za skaliranje slike"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skener"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Otvara slike sa skenera u KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Šablon"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Duži opis onoga što dodatak radi"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Jednostavno pregledajte direktorij sa fotografijama"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE Part - Preglednik slika"
diff --git a/translations/desktop_files/kview-desktops/ca.po b/translations/desktop_files/kview-desktops/ca.po
new file mode 100644
index 00000000..0e881124
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ca.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplicació"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configuració per a la versió independent de KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Connectors"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Escolliu i configureu els connectors"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Component visualitzador d'imatges encastable"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Llenç visualitzador d'imatges encastable (estri que mostra una imatge)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Visualitzador d'imatges"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Visualitzador"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visualitzador"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configuració general de KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Estri visualitzador d'imatges KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visualitzador d'imatges KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Fullejador"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Us permet navegar entre totes les imatges del directori actual."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efectes"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Proporciona alguns efectes d'imatges"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nom"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Comentari"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Presentador"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Crea una llista d'imatges i us permet crear un passi de diapositives"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Escala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtre per escalar la imatge"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Escàner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Obre les imatges de l'escàner a KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Plantilla"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Una descripció més llarga del que fa l'endollat"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Llibre de fotografies"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Mirar fàcilment una carpeta de fotografies"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Peça de TDE visualitzadora d'imatges"
diff --git a/translations/desktop_files/kview-desktops/cs.po b/translations/desktop_files/kview-desktops/cs.po
new file mode 100644
index 00000000..54a51024
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/cs.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikace"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Nastavení samostatné verze KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Moduly"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Zvolte a nastavte si moduly"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Komponenta pro zobrazování obrázků"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Pohltitelná komponenta pro zobrazování obrázků"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Prohlížeč obrázků"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Prohlížeč"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Prohlížeč"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Obecné nastavení KView"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Komponenta prohlížeče obrázků KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Prohlížeč obrázků KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Prohlížeč"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Umožňuje procházet všechny obrázky v aktuálním adresáři."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efekty"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Poskytuje několik efektů pro obrázky"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezentace"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Vytvoří seznam obrázků a umožní vám z nich vytvořit slideshow."
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Změna měřítka"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtr ke změně měřítka obrázku"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Otevírá obrázky ze skeneru do KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Šablona"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Zde by měl být delší popis modulu"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Jednoduché prohlížení složek s fotkami"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Komponenta prohlížeče obrázků TDE"
diff --git a/translations/desktop_files/kview-desktops/cy.po b/translations/desktop_files/kview-desktops/cy.po
new file mode 100644
index 00000000..18719987
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/cy.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Cymhwysiad"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Ffurfweddiad ar gyfer y fersiwn arunigol o KGweld"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Ategion"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Cydran Mewnadeiladadwy Gwelydd Delweddau"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Cynfas Mewnadeiladadwy Gwelydd Delweddau (celfigyn sy'n dangos delwedd)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Gwelydd Delweddau"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "KGweld"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Gwelydd"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Ffurfweddiad Cyffredinol KGweldCynfas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Celfigyn Gwelydd Delweddau KGweld"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Celfigyn Gwelydd Delweddau KGweld"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Porydd"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Alluogi i chi bori drwy pob delwedd yn y cyfeiriadur cyfredol."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effeithiau"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Darparu rhai effeithiau delwedd"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Enw"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Sylwad"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Cyflwynydd"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Creu rhestr delweddau ac alluogi i chi greu sioe haenluniau"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Graddfa"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Hidl i raddio'r ddelwedd"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Sganiwr"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Agor delweddau oddiwrth eich sganiwr yn KGweld"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Patrymlun"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Disgrifiad hirach o beth mae'r ategyn yn ei wneud"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Rhan Gwelydd Delweddau TDE "
diff --git a/translations/desktop_files/kview-desktops/da.po b/translations/desktop_files/kview-desktops/da.po
new file mode 100644
index 00000000..cb37c3b4
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/da.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Indstilling af den alenestående udgave af KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Plugin"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Vælg og indstil dine plugin"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Indlejrbar billedviserkomponent"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Indlejrbar billedviserlærred (kontrol der viser et billede)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Billedfremviser"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Fremviser"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Fremviser"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Generel indstilling af KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView-billedviserkontrol"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView-billedfremviser"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Lader dig gennemse alle billederne i denne mappe."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effekter"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Sørger for nogle billedeffekter"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Navn"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Laver en billedliste og giver dig muligheden for at lave et diasshow"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter til at skalere billedet"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skanner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "åbn billeder fra din skanner til KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Skabelon"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "En længere beskrivelse af hvad dette plugin gør"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Mappe med fotografier, nem at gennemse"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE Billedviser-part"
diff --git a/translations/desktop_files/kview-desktops/de.po b/translations/desktop_files/kview-desktops/de.po
new file mode 100644
index 00000000..03f1faae
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/de.po
@@ -0,0 +1,167 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Anwendung"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Einstellungen für die Anwendung KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Module"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Auswahl und Einrichtung der Module"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Einbettungsfähige Bildbetrachter-Komponente"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Einbettungsfähiges Bildbetrachtermodul (Bildschirmausschnitt, der ein Bild "
+"anzeigt)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Bildbetrachter"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Betrachter"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Betrachter"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Allgemeine Einstellungen für KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView Bildanzeige-Bildschirmausschnitt"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Bildbetrachter KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Ermöglicht das Durchsehen der Bilder im aktuellen Ordner."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effekte"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Stellt einige Bildverarbeitungseffekte zur Verfügung"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Präsentationsprogramm"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Erzeugt eine Bilderliste und ermöglicht das Erstellen von Diashows"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skalierer"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Ein Filter zum Skalieren von Bildern"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Lädt Bilder vom Scanner in KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Vorlage"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Hier sollte eine längere Beschreibung des Moduls stehen"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Photobuch"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Auf einfache Weise einen Ordner nach Photos durchsuchen"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE Bildbetrachter-Komponente (KPart)"
diff --git a/translations/desktop_files/kview-desktops/el.po b/translations/desktop_files/kview-desktops/el.po
new file mode 100644
index 00000000..56d6026e
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/el.po
@@ -0,0 +1,170 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Εφαρμογή"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Ρύθμιση της standalone έκδοσης του KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Πρόσθετα"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Επιλέξτε και ρυθμίστε τα πρόσθετα σας"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ενσωματώσιμο συστατικό προβολέα εικόνων"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Ενσωματώσιμος Καμβάς Προβολής Εικόνων (γραφικό συστατικό που εμφανίζει μία "
+"εικόνα)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Προβολέας εικόνων"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Προβολέας"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Προβολέας"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Γενική ρύθμιση του KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Γραφικό συστατικό προβολέα εικόνων του KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Προβολέας εικόνων KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Περιηγητής"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+"Σας επιτρέπει να περιηγηθείτε σε όλες τις εικόνες στον τρέχον κατάλογο."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Εφέ"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Παρέχει μερικά εφέ εικόνας"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Όνομα"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Σχόλιο"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Παρουσιαστής"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Δημιουργεί μια λίστα εικόνων και σας επιτρέπει να δημιουργήσετε μια προβολή "
+"σλάιντ"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Κλιμάκωση"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Φίλτρο για την κλιμάκωση της εικόνας"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Σαρωτής"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Ανοίξτε εικόνες από το σαρωτή σας στο KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Πρότυπο"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Μια μεγαλύτερη περιγραφή για το τι κάνει το πρόσθετο"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Εύκολη περιήγηση σε ένα φάκελο φωτογραφιών"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Part προβολέα εικόνων του TDE"
diff --git a/translations/desktop_files/kview-desktops/eo.po b/translations/desktop_files/kview-desktops/eo.po
new file mode 100644
index 00000000..d5f08834
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/eo.po
@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikaĵo"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Agordo por la aŭtonoma versio de KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Kromaĵoj"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Elektu kaj agordu viajn kromprogramojn"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Enkonstruebla bildrigardilo"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Enkonstruebla bildrigardilo kromaĵo"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Bildorigardilo"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "Rigardilo"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Rigardilo"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Ĝenerala Agordo de KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Bildrigardilo fenestro"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView-Bildrigardilo"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Trair-Rigardilo"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Permesas al vi povas trarigardi ĉiujn bildojn en la nuna dosierujo."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efektoj"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Provizas kelkajn bildefektojn"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nomo"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komento"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezentilo"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Grandecŝanĝo"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "por ŝanĝi la grandecon de la bildo"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skanilo"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Ŝablono"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Pli longa priskribo pri la kromaĵo"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE-bildorigardilo parto"
diff --git a/translations/desktop_files/kview-desktops/es.po b/translations/desktop_files/kview-desktops/es.po
new file mode 100644
index 00000000..f058f4ca
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/es.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplicación"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configuración para la versión independiente de KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Extensiones"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Seleccione y configure sus extensiones"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Componente empotrable para visualizar imágenes"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Componente empotrable para visualizar lienzos (widget que muestra una imagen)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Visor de imágenes"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Visor"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visor"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configuración general de KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget visor de imágenes de KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visor de imágenes de KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Navegador"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Le permite navegar por todas las imágenes del directorio actual."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efectos"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Proporciona alguno efectos para imágenes"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nombre"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Comentario"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Crea una lista de imágenes ofreciendole la posibilidad de crear una "
+"animación de diapositivas"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtro para cambiar la escala de una imagen"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Abre imágenes desde su escáner en KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Plantilla"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Una descripción más completa de la función del plugin"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Libro de fotografías"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Vistazo rápido de una carpeta con fotografías"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Parte de visor de imágenes de TDE"
diff --git a/translations/desktop_files/kview-desktops/et.po b/translations/desktop_files/kview-desktops/et.po
new file mode 100644
index 00000000..4d103fa4
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/et.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Rakendus"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView iseseisva versiooni seadistus"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Pluginad"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Pluginate valimine ja seadistamine"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Põimitav pildifailide näitaja komponent"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Põimitavad pildifailide näitaja lõuendid (element, mis näitab pilti)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Pildifailide näitaja"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Näitaja"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Näitaja"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "KView lõuendite üldine seadistus"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView pildifailide näitaja element"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView pildifailide näitaja"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Sirvija"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Võimaldab sirvida aktiivse kataloogi kõiki pilte."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efektid"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Mõned pildiefektid"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nimi"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentaar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Esitleja"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Loob piltide nimekirja ja laseb selle põhjal luua slaidiseansi"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaleerija"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter piltide skaleerimiseks"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skänner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Avab skaneeritud pilte rakendusega KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Mallid"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Pluginate tegevuse pikemad kirjeldused"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Fotode kausta mugav lehitsemine"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE pildifailide näitaja komponent"
diff --git a/translations/desktop_files/kview-desktops/eu.po b/translations/desktop_files/kview-desktops/eu.po
new file mode 100644
index 00000000..fb5c5f9a
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/eu.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikazioa"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView programaren konfigurazioa"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Pluginak"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Aukeratu eta konfigurau zure pluginak"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Irudi ikustailu txertagarri osagaia"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Irudi ikustailu txertagarriren ohila (irudi bat erakuts dezakeen tresnatxoa)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Irudi ikustailua"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Ikustailua"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Ikustailua"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "KViewCanvas konfigurazio orokorra"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView irudi ikustailu botoia"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView irudi ikustailea"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Nabegatzailea"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Uneko direktorioko irudien artean nabigatzen uzten dizu."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efectuak"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Irudi efektu batzuk eskuratzen ditu"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Izena"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Iruzkina"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Aurkezlea"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Irudi-zerrenda bat sortzen du eta diapositiba-aurkezpena egiten du"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Eskalatu"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Eskalatu irudia"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Eskanerra"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Zure eskanerretik irudiak KView-en erakusten ditu"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Txantiloia"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Pluginak egiten duenaren azalpen luzeagoa"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Arakatu argazki karpetak modu errazan"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE irudi ikustailearen zatia"
diff --git a/translations/desktop_files/kview-desktops/fa.po b/translations/desktop_files/kview-desktops/fa.po
new file mode 100644
index 00000000..d8bc7ba3
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/fa.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "کاربرد"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "پیکربندی برای نسخۀ خوداتکای KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "وصله‌ها"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "وصله‌های خود را انتخاب و پیکربندی کنید"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "مؤلفۀ مشاهده‌گر تصویر نهفته‌شده"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "صفحۀ مجازی مشاهده‌گر تصویر نهفته‌‌شده )عنصری که یک تصویر را نمایش می‌دهد)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "مشاهده‌گر تصویر"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "مشاهده‌گر"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "مشاهده‌گر"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "پیکربندی عمومی KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "عنصر مشاهده‌گر تصویر KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "مشاهده‌گر تصویر KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "مرورگر"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "برای مرور تمام تصاویر موجود در فهرست راهنمای جاری شما را توانا می‌کند."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "اثرها"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "برخی اثرهای تصویر را فراهم می‌کند"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "نام"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "توضیح"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "ارائه‌کننده"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"یک فهرست تصویر ایجاد می‌کند و شما را قادر به ایجاد یک نمایش اسلاید می‌کند"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "مقیاس"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "پالایه برای مقیاس کردن تصویر"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "پویشگر"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "باز کردن تصاویر از پویشگرتان در KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "قالب"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "توصیفی طولانی‌تر از آنچه وصله انجام می‌دهد"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "کتاب عکس"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "مرور آسان پوشه‌ای از عکسها"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "جزء مشاهده‌گر تصویر TDE"
diff --git a/translations/desktop_files/kview-desktops/fi.po b/translations/desktop_files/kview-desktops/fi.po
new file mode 100644
index 00000000..2f8e58f1
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/fi.po
@@ -0,0 +1,167 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Sovellus"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Asetukset itsenäiselle versiolle KView-ohjelmasta"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Liitännäiset"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Valitse ja muokkaa liitännäisten asetuksia"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Upotettava kuviennäyttökomponentti"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Upotettava kuviennäyttökomponentti (käyttöliittymäelementti joka näyttää "
+"kuvan)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Kuvannäytin"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Näytin"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Näytin"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Yleiset KViewCanvas -asetukset"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView-kuviennäyttökomponentti"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView-kuvannäytin"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Selain"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Mahdollistaa nykyisessä kansiossa olevien kuvien selailun"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Tehosteet"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Tarjoaa joitain kuvatehosteita"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nimi"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentti"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Esitysohjelma"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Luo kuvalistan ja mahdollistaa esityksen luomisen"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaalaa"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Suodatin kuvan skaalaamiseen"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skanneri"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Avaa kuvan skannerilta KView-ohjelmaan"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Pohja"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Pidempi kuvaus, mitä liitännäinen tekee"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Valokuvakirja"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Selaile helpolla valokuvakansioita"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE:n kuvannäyttökomponentti"
diff --git a/translations/desktop_files/kview-desktops/fo.po b/translations/desktop_files/kview-desktops/fo.po
new file mode 100644
index 00000000..3fb88678
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/fo.po
@@ -0,0 +1,161 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr ""
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr ""
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr ""
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr ""
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr ""
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Ljóslesari"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
diff --git a/translations/desktop_files/kview-desktops/fr.po b/translations/desktop_files/kview-desktops/fr.po
new file mode 100644
index 00000000..cc0c4784
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/fr.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr ""
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configuration de la version isolée de KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Modules externes"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Choisissez et configurez vos modules externes"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Composant afficheur d'images incorporable"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Composant afficheur d'images incorporable (widget qui affiche une image)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Afficheur d'images"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Afficheur"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Afficheur"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configuration générale de KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget visualisateur d'images KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visualisateur d'images KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Navigateur"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Permet de naviguer parmi les images dans le dossier courant."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effets"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Fournit des effets sur les images"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nom"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Commentaire"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Présentateur"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Crée une liste d'images et vous permet de créer un diaporama"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Échelle"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtre pour zoomer une image"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Ouvre des images de votre scanner dans KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Modèle"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Une plus longue description de ce que fait le module"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Album photo"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Naviguer facilement dans un dossier contenant des photos"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Composant d'affichage d'images de TDE"
diff --git a/translations/desktop_files/kview-desktops/ga.po b/translations/desktop_files/kview-desktops/ga.po
new file mode 100644
index 00000000..8f5b18d0
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ga.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Feidhmchlár"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Breiseáin"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Amharcán Íomhánna"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Amharcán Íomhánna"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Amharcán Íomhánna"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Amharcán Íomhánna"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Brabhsálaí"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Maisíochtaí"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Ainm"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Nóta"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Láithreoir"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Scála"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Scanóir"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Teimpléad"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Amharcán Íomhánna"
diff --git a/translations/desktop_files/kview-desktops/gl.po b/translations/desktop_files/kview-desktops/gl.po
new file mode 100644
index 00000000..24479e5c
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/gl.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplicación"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configuración para a versión «standalone» de KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Elexir e Configurar as súas Extensións"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Componente de visualización integrable"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Visor de imaxes integrado (complemento que amosa unha imaxe)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Visor de imaxes"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Visor"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visor"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configuración xeral de KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Complemento do visor de Imaxes KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visor de imaxes KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Explorador"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Permítelle navegar a través de todas as imaxes no directorio actual."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efectos"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Proporciona algúns efectos para as imaxes"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nome"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Comentario"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Escaparate"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Crea unha lista de imaxes e permite crear unha moviola"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Redimensionar"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtro para redimensionar a imaxe"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Escáner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Obre as imaxes do teu escáner en KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Modelo"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Unha descrición máis longa do que pode facer a extensión"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Libro de Fotografías"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Explorar doadamente un cartafol de fotografías"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Visor de imaxes integrado do TDE"
diff --git a/translations/desktop_files/kview-desktops/he.po b/translations/desktop_files/kview-desktops/he.po
new file mode 100644
index 00000000..cbf38974
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/he.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "יישום"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "הגדרות עבור הגרסה העצמאית של KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "תוספים"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "בחר והגדר את התוספים שלך"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "רכיב מציג תמונות בר־הטבעה"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "רכיב מציג תמונות בר־הטבעה (פריט המציג תמונה)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "מציג תמונות"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "מציג"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "מציג"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "הגדרות KViewCanvas כלליות"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "פריט מציג תמונות ל־KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "מציג תמונות KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "דפדפן"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "מאפשר לך לעיין בכל התמונות שבספריה הנוכחית"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "אפקטים"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "מספק מספר אפקטים עבור תמונות"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "שם"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "הערה"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "מצגות"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "יוצר רשימת תמונות ומאפשר לך ליצור מצגת שקופיות"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "קנה מידה"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "מסנן לשינוי קנה המידה של התמונה"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "סורק"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "פתיחת תמונות מהסורק שלך ב־KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "תבנית"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "תיאור מפורט יותר לגבי מה שהתוסף עושה"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "ספר תמונות"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "דפדף בקלות בתיקייה המכילה תמונות"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "רכיב מציג תמונות ל־TDE"
diff --git a/translations/desktop_files/kview-desktops/hi.po b/translations/desktop_files/kview-desktops/hi.po
new file mode 100644
index 00000000..84e76bc8
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/hi.po
@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "अनुप्रयोग"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "के-व्यू के स्टैण्डएलोन संस्करण के लिए कॉन्फ़िगरेशन"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "प्लगइन्स"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "एम्बेडेबल छवि प्रदर्शक अवयव"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "एम्बेडेबल छवि प्रदर्शक केनवास (विजेट जो छवि दिखाता है)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "छवि प्रदर्शक"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "के-व्यू"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "प्रदर्शक"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "सामान्य के-व्यू-केनवास कॉन्फ़िगरेशन"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "के-व्यू छवि प्रदर्शक विजेट"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "के-व्यू छवि प्रदर्शक"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "ब्राउज़र"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "मौज़ूदा डिरेक्ट्री के सभी छवियों को ब्राउज़ करने में आपको सक्षम बनाता है."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "प्रभाव"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "छवि में प्रभाव उत्पन्न करता है"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "नाम"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "टिप्पणी"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "प्रस्तुतकर्ता"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "एक छवि-सूची बनाता है तथा आपको एक स्लाइड-शो तैयार करने में सक्षम बनाता है"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "स्केल"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "छवि का आकार बदलने का फ़िल्टर"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "स्कैनर"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "आपके स्कैनर से के-व्यू में छवि खोलता है"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "टैम्प्लेट"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "प्लगइन के बारे में लंबा वर्णन कि वह क्या करता है"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "केडीई छवि प्रदर्शक पार्ट"
diff --git a/translations/desktop_files/kview-desktops/hr.po b/translations/desktop_files/kview-desktops/hr.po
new file mode 100644
index 00000000..3bf78349
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/hr.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Umetci"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Umetljiva komponenta za gledanje slika"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Umetljivo platno za pregled slika (widget koji pokazuje sliku)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Preglednik slika"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "Preglednik slika"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Preglednik slika"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView widget za pregled slika"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "KView widget za pregled slika"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Preglednik"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezentator"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter za promjenu veličine slike"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skener"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Duži opis umetka"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE komponenta za pregledavanje slika"
diff --git a/translations/desktop_files/kview-desktops/hu.po b/translations/desktop_files/kview-desktops/hu.po
new file mode 100644
index 00000000..c88a12ae
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/hu.po
@@ -0,0 +1,167 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Alkalmazás"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "A KView önállóan futtatható verziójának beállításai"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Bővítőmodulok"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Bővítőmodulok kiválasztása, beállítása"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Beágyazható képnézegető komponens"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Beágyazható képnézegető objektum (képmegjelenítő)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Képnézegető"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Nézegető"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Nézegető"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "A KViewCanvas általános beállításai"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView képnézegető grafikus elem"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView képnézegető"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Böngésző"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+"Lehetővé teszi az aktuális könyvtárban található képek áttekintését, "
+"böngészését."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effektusok"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Képeffektusok használata"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Név"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Megjegyzés"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Bemutató"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Képsorozat összeállítását és bemutatását teszi lehetővé"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Nagyítás"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Képméretező szűrő"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Lapolvasó"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Kép beolvasása lapolvasóról a KView-ba"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Sablon"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Ez a bővítőmodul részletesebb leírása"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fényképalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Könyvtárba helyezett fényképek nézegetéséhez"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE képnézegető objektum"
diff --git a/translations/desktop_files/kview-desktops/id.po b/translations/desktop_files/kview-desktops/id.po
new file mode 100644
index 00000000..a0eea900
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/id.po
@@ -0,0 +1,161 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikasi"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr ""
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr ""
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr ""
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr ""
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
diff --git a/translations/desktop_files/kview-desktops/is.po b/translations/desktop_files/kview-desktops/is.po
new file mode 100644
index 00000000..20c03a0d
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/is.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Forrit"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Stillingar fyrir KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Íforrit"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Velja og stilla íforrit"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ívefjanleg myndsjá"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Ívefjanleg myndsjá (græja sem birtir mynd)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Myndaskoðari"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Birtir"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Birtir"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Almennar stillingar KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView myndbirtigræja"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView myndbirtirinn"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Flakkari"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Gerir þér kleyft að flakka í öllum myndunum í þessari möppu."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Brellur"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Býður uppá ýmsar myndbrellur"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Heiti"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Athugasemd"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Býr til myndlista og gerir þér kleyft að búa til myndsýningu"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Sía sem skalar myndina"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skanni"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Senda myndir frá skannanum í KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Snið"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "hér ætti að vera smá lýsing á hvað þetta gerir"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Myndabók"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Flettu á auðveldan hátt gegnum möppu með myndum"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Myndbirtir TDE"
diff --git a/translations/desktop_files/kview-desktops/it.po b/translations/desktop_files/kview-desktops/it.po
new file mode 100644
index 00000000..93af40cb
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/it.po
@@ -0,0 +1,167 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: 2021-05-19 03:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kview-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Applicazione"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configurazione di KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Plugin"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Scegli e configura i tuoi plugin"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Componente integrabile per la visione di immagini"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Componente integrabile per la visione di immagini (widget che mostra "
+"un'immagine)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Visore di immagini"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "KView"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visore"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configurazione generale per KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget visore immagini KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visore di immagini KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Browser"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Permette di navigare tra le immagini nella directory corrente."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effetti"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Fornisce alcuni effetti per le immagini"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nome"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Commento"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Presentazione"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Crea una lista di immagini e permette di creare una presentazione"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Riscala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtro per ridimensionare l'immagine"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Scanner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Apre le immagini provenienti dallo scanner in KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Modello"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Una descrizione più lunga di quello che fa il plugin"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Album fotografico"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Sfoglia facilmente una cartella di fotografie"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Componente TDE per la visione di immagini"
diff --git a/translations/desktop_files/kview-desktops/ja.po b/translations/desktop_files/kview-desktops/ja.po
new file mode 100644
index 00000000..94c95f31
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ja.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "アプリケーション"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "スタンドアロンバージョンの KView の設定"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "プラグイン"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "プラグインを選択して設定します"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "埋め込み可能な画像ビューアコンポーネント"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "埋め込み可能な画像ビューアキャンバス (画像を表示するウィジェット)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "画像ビューア"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "ビューア"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "ビューア"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "KViewCanvas の一般的な設定"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView 画像ビューアウィジェット"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView 画像ビューア"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "ブラウザ"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "現在のディレクトリのすべての画像をブラウズできるようになります。"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "効果"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "画像効果を提供します"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "名前"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "コメント"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "プレゼンタ"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "画像リストを作成し、スライドショーを作成します"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "スケール"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "画像をスケールするフィルタ"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "スキャナ"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "スキャナから画像を開き KView に転送します"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "テンプレート"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "ここにより詳細なプラグインの記述をします"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "フォトブック"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "写真を含むフォルダをブラウズ"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE 画像ビューアパート"
diff --git a/translations/desktop_files/kview-desktops/kk.po b/translations/desktop_files/kview-desktops/kk.po
new file mode 100644
index 00000000..1c9c3cc5
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/kk.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Қолданба"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView бағдарламасының жеке-дара нұсқасының баптаулары"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Плагин модулі"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Плагин модулін таңдап алып баптау"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ендірілетін кескін қарау компоненті"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Кескін қарауға арналған ендірілетін өріс (кескінді көрсететін бөлшегі)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Кескіндерді қарау"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Кескінді қарау"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Кескінді қарау"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "KViewCanvas өрісінің жалпы баптаулары"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView кескінді көрсететін бөлшегі"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView кескінді қарау құралы"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Шолғыш"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Назардағы қапшықтағы барлық кескіндерді шолу құралы."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Эффекттері"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Кескіндердің кейбір эффектерін іске асыру"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Атауы"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Түсініктемесі"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Презентатор"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Слайд-шоу көрсетуге кескіндер тізімін дайындау"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Масштабтау"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Кескідерді масштабтау сүзгісі"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Сканер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Сканерден KView-ға кескінді түсіру"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Үлгі"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Плагин модульдің түсініктемесі"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Фотоальбом"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Қапшықтағы фотоларды шолу"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE кескінді қарау құралының бөлшегі"
diff --git a/translations/desktop_files/kview-desktops/km.po b/translations/desktop_files/kview-desktops/km.po
new file mode 100644
index 00000000..0bc79975
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/km.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "កម្មវិធី"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "ការ​កំណត់​រចនាសម្ព័ន្ធ​សម្រាប់​កំណែ​កម្មវិធី KView រត់​តែ​ឯង"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "កម្មវិធី​ជំនួយ"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "ជ្រើស និង​កំណត់​រចនាសម្ព័ន្ធ​កម្មវិធី​ជំនួយ​របស់​អ្នក"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "សមាសភាគ​របស់​កម្មវិធី​មើល​រូបភាព​ដែល​អាច​បង្កប់​បាន"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "ផ្នែក​របស់​កម្មវិធី​មើល​រូបភាព​ដែល​អាច​បង្កប់​បាន (ផ្នែក​ដែល​បង្ហាញ​រូបភាព)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "កម្មវិធី​មើល​រូបភាព"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "កម្មវិធី​មើល"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "កម្មវិធី​មើល"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "ការ​កំណត់​រចនាសម្ព័ន្ធ​ទូទៅ​សម្រាប់ KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "ធាតុ​ក្រាហ្វិក​កម្មវិធី​មើល​រូបភាព KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "កម្មវិធី​មើល​រូបភាព KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "កម្មវិធី​រុករក"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "អាច​ឲ្យ​អ្នក​រកមើល​រូបភាព​ទាំងអស់ នៅ​ក្នុង​ថត​បច្ចុប្បន្ន ។"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "បែបផែន"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "ផ្ដល់​នូវ​បែបផែន​រូបភាព​មួយ​ចំនួន"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "ឈ្មោះ"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "សេចក្ដី​អធិប្បាយ"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "កម្មវិធី​បង្ហាញ"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "បង្កើត​បញ្ជី​រូបភាព ហើយ​អាច​ឲ្យ​អ្នក​បង្កើត​ជា​ការ​បញ្ចាំង​ស្លាយ"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "ធ្វើ​មាត្រដ្ឋាន"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "តម្រងធ្វើ​មាត្រដ្ឋាន​រូបភាព"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "ម៉ាស៊ីន​ស្កេន"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "បើក​រូបភាព​ពី​ម៉ាស៊ីន​ស្កេន​របស់​អ្នក​ក្នុង KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "ពុម្ព"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "សេចក្ដី​ពណ៌នា​វែង អំពី​មុខងារ​របស់​កម្មវិធី​ជំនួយ"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "សៀវភៅ​រូបថត"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "រកមើល​ថត​រូបថត​យ៉ាង​ងាយស្រួល"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "ផ្នែក​របស់​កម្មវិធី​មើល​រូបភាព TDE"
diff --git a/translations/desktop_files/kview-desktops/kview-desktops.pot b/translations/desktop_files/kview-desktops/kview-desktops.pot
new file mode 100644
index 00000000..d9079295
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/kview-desktops.pot
@@ -0,0 +1,161 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2021-07-07 22:20+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr ""
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr ""
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr ""
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr ""
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr ""
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
diff --git a/translations/desktop_files/kview-desktops/lt.po b/translations/desktop_files/kview-desktops/lt.po
new file mode 100644
index 00000000..abec5790
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/lt.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Programa"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView kaip nepriklausomos programos konfigūravimas"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Priedai"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Pasirinkite ir konfigūruokite priedus"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Įdedamas piešinių peržiūros komponentas"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Įdedamas piešinių peržiūros paveikslas (valdiklis, kuris rodo paveikslėlį)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Paveikslėlių žiūriklis"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Žiūriklis"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Žiūriklis"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Bendrasis KViewCanvas konfigūravimas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView paveikslėlių žiūriklio valdiklis"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView paveikslėlių žiūryklė"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Naršyklė"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Leidžia jums naršyti visuose paveikslėliuose esamame aplanke."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efektai"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Prideda kai kuriuos paveikslėlių efektus"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Pavadinimas"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komentaras"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Pristatytojas"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Sukuria paveikslėlių sąrašą ir leidžia jums sukurti skaidrių peržiūrą"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Mąstelis"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtras paveikslėliui didinti ar mažinti"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skaneris"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Atveria paveikslėlius iš Jūsų skanerio į KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Šablonas"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Ilgesnis aprašymas, ką daro priedas"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbumas"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Lengvai naršykite fotografijų aplankus"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE paveikslėlių žiūriklio dalis"
diff --git a/translations/desktop_files/kview-desktops/lv.po b/translations/desktop_files/kview-desktops/lv.po
new file mode 100644
index 00000000..f569e918
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/lv.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikācija"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Attēlu Skatītājs"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "KSkatīt"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "KSkatīt"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Attēlu Skatītājs"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Attēlu Skatītājs"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Attēlu Skatītājs"
diff --git a/translations/desktop_files/kview-desktops/mk.po b/translations/desktop_files/kview-desktops/mk.po
new file mode 100644
index 00000000..5d2365ff
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/mk.po
@@ -0,0 +1,161 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Апликација"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr ""
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr ""
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr ""
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr ""
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
diff --git a/translations/desktop_files/kview-desktops/ms.po b/translations/desktop_files/kview-desktops/ms.po
new file mode 100644
index 00000000..dc865133
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ms.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikasi"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Konfigurasi untuk Versi tunggal bagi KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Plugin"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Pilih dan Konfigur Plugin Anda"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Komponen Pemapar Imej Boleh Benam"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Kanvas Pemapar Imej Boleh Benam (widget yang memaparkan imej)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Paparan Imej"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Pemapar"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Pemapar"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Konfigurasi KViewCanvas Umum"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget Pemapar Imej KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Pemapar Imej KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Pelayar"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Membolehkan anda melayar semua imej dalam direktori semasa."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Kesan"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Menyediakan beberapa kesan imej"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nama"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komen"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Penyampai"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Cipta senarai imej dan membolehkan anda mencipta tayangan slaid"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Tapis untuk menskalakan imej"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Pengimbas"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Buka imej dari pengimbas anda ke dalam KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Templat"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Huraian panjang tentang apa yang plugin lakukan"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Bukufoto"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Layar folder fotograf dengan mudah"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Bahagian Pemapar Imej TDE"
diff --git a/translations/desktop_files/kview-desktops/mt.po b/translations/desktop_files/kview-desktops/mt.po
new file mode 100644
index 00000000..7ee31892
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/mt.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Programm"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Werrej tal-istampi"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Werrej tal-istampi"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Werrej tal-istampi"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Werrej tal-istampi"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Werrej tal-istampi"
diff --git a/translations/desktop_files/kview-desktops/nb.po b/translations/desktop_files/kview-desktops/nb.po
new file mode 100644
index 00000000..f480ffcb
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/nb.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Oppsett av den frittstående utgaven av KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Programtillegg"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Velg og sett opp programtilleggene"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Inkluderbar bildevisningskomponent"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Inkluderbare bildevisningskomponenter (skjermelement som viser et bilde)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Bildefremviser"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Fremviser"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Fremviser"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Generelt oppsett av KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView bilde-fremviserelement"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Bildeviseren KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Leser"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Lar deg bla gjennom alle bildene i den gjeldende katalogen."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effekter"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Utfører noen effekter på bilder"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Navn"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Oppretter en bildeliste og lar deg lage en lysbildeserie"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaler"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter for skalering av bildet"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skanner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Åpner bilder fra skanneren til KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Mal"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "En lengre beskrivelse av hva modulen gjør"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Enkel lesing av mapper med bilder"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE-bildefremviserdel"
diff --git a/translations/desktop_files/kview-desktops/nds.po b/translations/desktop_files/kview-desktops/nds.po
new file mode 100644
index 00000000..def28118
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/nds.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Programm"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Instellen för de Enkelverschoon vun KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Modulen"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Dien Modulen utsöken un instellen"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Inbettbor Bildkiekerkomponent"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Inbettbor Bildkieker-Rahmen (Element, dat en Bild wiest)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Bildkieker"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Kieker"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Kieker"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Allgemeen Instellen för KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView-Bildkiekrahmen"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Bildkieker KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Kieker"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Dörkieken vun all Biller binnen den aktuellen Orner."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effekten"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Stellt en poor Bildeffekten praat"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Naam"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Präsentatschoonprogramm"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Stellt en Bildlist op un lett Di en Diaschau opstellen"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Grött-Topasser"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "En Filter för't Topassen vun de Bildgrött"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Bildinleser"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Haalt Biller vun Dien Inleser na KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Vörlaag"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "En länger Beschrieven vun't Könen vun dat Moduul"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Op eenfache Oort en Foto-Orner dörkieken"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Bildkieker-Komponent för TDE"
diff --git a/translations/desktop_files/kview-desktops/ne.po b/translations/desktop_files/kview-desktops/ne.po
new file mode 100644
index 00000000..4207c048
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ne.po
@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "अनुप्रयोग"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "केडीई दृश्यको स्यान्डअलोन संस्करणाका लागि कन्फिगरेसन"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "प्लगइन"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "तपाईँको प्लगइन रोज्नुहोस् र कन्फिगर गर्नुहोस्"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "सम्मिलित छवि दर्शक अवयव"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "सम्मिलित छवि दर्शक क्यानभास (छवि देखाउने विजेट)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "छवि दर्शक"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "केडीई दर्शक"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "दर्शक"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "साधारण केडीई दृश्य क्यानभास कन्फिगरेसन"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "केडीई दृश्य छवि दर्शक विजेट"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "केडीई दृश्य छवि दर्शक"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "ब्राउजर"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "हालको डाइरेक्टरिमा छविको सबै तिर ब्राउज गर्न तपाईँलाई सक्षम पार्दछ ।"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "असर"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "केही छवि असर प्रदान गर्दछ"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "नाम"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "टिप्पणी"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "प्रस्तोता"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "छवि सूची सिर्जना गर्दछ र तपाईँलाई स्लाइड प्रर्दशन सिर्जना गर्न सक्षम पार्दछ"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "स्केल"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "छवि मापन गर्न फिल्टर"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "स्क्यानर"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "तपाईँको स्क्यानरबाट केडीई दृश्य भित्र छवि खोल्नुहोस्"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "टेम्प्लेट"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "प्लगइनले गर्ने कामको बारेमा लामो वर्णन"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "फोटो पुस्तक"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "फोटोग्राफको फोल्डर सजिलै ब्राउज गर्नुहोस्"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE छवि दर्शक भाग"
diff --git a/translations/desktop_files/kview-desktops/nl.po b/translations/desktop_files/kview-desktops/nl.po
new file mode 100644
index 00000000..a8318013
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/nl.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Toepassing"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Instellingen voor KView op zichzelf"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Kies uw plugins en stel ze in"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ingebed weergavecomponent voor afbeeldingen"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Ingebed weergave-canvas (widget die een afbeelding toont)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Afbeeldingenweergaveprogramma"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Weergaveprogramma"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Weergaveprogramma"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Algemene KViewCanvas instellingen"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView afbeeldingwidget"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView afbeeldingenweergave"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Bladeren"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Hiermee kunt u door alle afbeeldingen in de huidige map bladeren."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effecten"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Biedt enkele effecten om afbeeldingen te bewerken"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Naam"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Omschrijving"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Presentatieprogramma"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Maakt een afbeeldingenlijst waarmee u een diashow kunt maken"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Schaalprogramma"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter om de afbeelding te schalen"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Scanprogramma"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Scan afbeeldingen rechtstreeks in KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Sjabloon"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Plaats hier een kleine omschrijving van uw plugin"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoboek"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Blader eenvoudig door een map met foto's"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE's weergavecomponent (Part) voor afbeeldingen"
diff --git a/translations/desktop_files/kview-desktops/nn.po b/translations/desktop_files/kview-desktops/nn.po
new file mode 100644
index 00000000..037ab23b
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/nn.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Oppsett av den frittståande utgåva av KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Programtillegg"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Vel og set opp programtillegga"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Inkluderbart komponent for biletvising"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Inkluderbart lerret for biletvising (skjermelement som viser eit bilete)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Biletvisar"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Framvisar"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Framvisar"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Generelt oppsett av KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView biletvisarelement"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Biletvisaren KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Snøgglesar"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Let deg bla gjennom alle bileta i ein katalog."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effektar"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Utfører nokre effektar på bilete"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Namn"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Lagar ei biletliste du kan bruka til framvising"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaler"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter for skalering av biletet"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skannar"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Opnar bilete frå skannaren i KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Mal"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Ei lengre skildring av kva modulen gjer"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Enkel vising av mapper med bilete"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Biletvisardel for TDE"
diff --git a/translations/desktop_files/kview-desktops/nso.po b/translations/desktop_files/kview-desktops/nso.po
new file mode 100644
index 00000000..23c835bf
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/nso.po
@@ -0,0 +1,169 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr ""
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Seripa seo se Robatsegago sa Molebeledi wa Ponagalo"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Canvas yeo e Robatsegago ya Molebeledi wa Ponagalo (widget yeo e bontshago "
+"ponagalo)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Molebeledi wa Ponagalo"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Molebeledi wa Ponagalo"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView Widget ya Molebeledi wa Ponagalo"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "KView Widget ya Molebeledi wa Ponagalo"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Seinyakisi"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+"Ego dumelela go inyakisa kago diponagalo kamoka kago tshupetso ya bjale."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Mohlagisi"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Hlagisa palo ya ponagalo gape ego dumelela go hlagisa slidesshow"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Sekala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Sesekodi sago kala ponagalo"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Selebeledi"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Bula diponagalo gotswa go selebeledi sa gago goya kago KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Papiso"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Thlaloso ye telele ya seo ya seo plugin ese dirago"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Seripa sa Molebeledi wa Ponagalo sa TDE"
diff --git a/translations/desktop_files/kview-desktops/pa.po b/translations/desktop_files/kview-desktops/pa.po
new file mode 100644
index 00000000..e3f2b7a9
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/pa.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "ਕਾਰਜ"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "ਪਲੱਗਿੰਨ"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "ਚਿੱਤਰ ਦਰਸ਼ਕ"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "ਦਰਸ਼ਕ"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "ਦਰਸ਼ਕ"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "KView ਚਿੱਤਰ ਦਰਸ਼ਕ"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView ਚਿੱਤਰ ਦਰਸ਼ਕ"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "ਝਲਕਾਰਾ"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "ਪ੍ਰਭਾਵ"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "ਨਾਂ"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "ਟਿੱਪਣੀ"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "ਪੇਸ਼ਕਾਰ"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "ਸਕੇਲ"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "ਸਕੈਨਰ"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "ਫੋਟੋ ਬੁੱਕ"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE ਚਿੱਤਰ ਦਰਸ਼ਕ ਭਾਗ"
diff --git a/translations/desktop_files/kview-desktops/pl.po b/translations/desktop_files/kview-desktops/pl.po
new file mode 100644
index 00000000..07520e2d
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/pl.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Konfiguracja KView jako osobnego programu"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Wtyczki"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Wybór i konfiguracja wtyczek"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Składnik do przeglądania obrazków"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Obszar do przeglądania obrazków (wnętrze okienka, które pokazuje obrazek)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Przeglądarka obrazków"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "Przeglądarka obrazków"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Przeglądarka obrazków"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Ogólna konfiguracja KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Okienko przeglądarki obrazków KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Przeglądarka obrazków KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Przeglądarka"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Pozwala na przeglądanie wszystkich obrazków w bieżącym katalogu."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efekty"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Dodaje kilka efektów do obrazków"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nazwa"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komentarz"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezenter"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Tworzy listę obrazków i umożliwia tworzenie z niej pokazu slajdów"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtr do skalowania obrazków"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skaner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Otwiera obrazki ze skanera w przeglądarce KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Wzorzec"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Dłuższy opis tego, co wtyczka robi"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Album ze zdjęciami"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Łatwe przeglądanie folderów ze zdjęciami"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Składnik do przeglądarka obrazków TDE"
diff --git a/translations/desktop_files/kview-desktops/pt.po b/translations/desktop_files/kview-desktops/pt.po
new file mode 100644
index 00000000..98665f09
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/pt.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplicação"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configuração da versão independente do KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "'Plugins'"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Escolha e Configure os 'Plugins'"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Componente Embebida de Visualização de Imagens"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Área de Visualização Embebida de Imagens (um item que mostra uma imagem)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Visualizador de Imagens"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Visualizador"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visualizador"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configuração Geral do KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Elemento de Visualização de Imagens do KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visualizador de Imagens KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Navegador"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Permite-lhe navegar por todas as imagens na directoria actual."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efeitos"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Fornece alguns efeitos de imagem"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nome"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Comentário"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Apresentador"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Cria uma lista de imagens e permite-lhe criar uma apresentação"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Redimensionamento"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Um filtro para escalar a imagem"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Digitalizador"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Abrir as imagens do seu 'scanner' no KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Modelo"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Uma descrição mais extensa do que o 'plugin' faz"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Álbum Fotográfico"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Navegue facilmente numa pasta de fotografias"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Componente de Visualização de Imagens do TDE"
diff --git a/translations/desktop_files/kview-desktops/pt_BR.po b/translations/desktop_files/kview-desktops/pt_BR.po
new file mode 100644
index 00000000..55def423
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/pt_BR.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplicativo"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configuração para visão independente do KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Escolha e Configure os Seus Plugins"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Componente Integrado do Visualizador de Imagens"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Componente Integrado do Visualizador Canvas (componente que exibe uma imagem)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Visualizador de Imagens"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "KVisualização"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visualizador"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configuração Geral do Canvas com o KView"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Componente de Visualização de Imagens do KVisualização"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Visualizador de Imagens do KVisualização"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Navegador"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Habilita você a navegar por todas as imagens no diretório atual."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efeitos"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Fornece alguns efeitos de imagem"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nome"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Comentário"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Apresentador"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Cria uma lista de imagens e habilita você a criar uma exibição de slides"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Escala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtro para escalar a imagem"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Digitalizador"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Abre imagens do seu digitalizador no KVisualização"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Modelo"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Uma descrição maior do que um plugin faz"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Álbum de Fotos"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Navegue facilmente por uma pasta cheia de fotos"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Parte do Visualizador de Imagens do TDE"
diff --git a/translations/desktop_files/kview-desktops/ro.po b/translations/desktop_files/kview-desktops/ro.po
new file mode 100644
index 00000000..9cc88286
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ro.po
@@ -0,0 +1,167 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplicaţie"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Configurare pentru versiunea de sine stătătoare a KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Module"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Alegeţi şi configuraţi modulele dumneavoastră"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Componentă înglobată de vizualizare imagini"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Componentă înglobată de vizualizare imagini (widget)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Vizualizor de imagini"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Vizualizor"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Vizualizor"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Configurare KViewCanvas general"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget vizualizare imagini KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Vizualizor imagini KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Navigator"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Vă permite să navigaţi prin toate imaginile din directorul curent."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efecte"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Oferă unele efecte pentru imagini"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nume"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Comentariu"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezentare"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Creează o listă de imagini şi vă permite să reallizaţi o succesiune de "
+"imagini"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Scalare"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filtru de scalat imaginea"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Scaner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Deschide imagini din scaner în KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Model"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "O descriere mai lungă a modulului"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Colecţie de fotografii"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Răsfoiţi cu uşurinţă un folder de fotografii"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Componentă TDE de vizualizare imagini"
diff --git a/translations/desktop_files/kview-desktops/ru.po b/translations/desktop_files/kview-desktops/ru.po
new file mode 100644
index 00000000..cbd2eee0
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ru.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Приложение"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Настройка самостоятельного приложения KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Модули"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Выберите и настройте модули"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Встраиваемый компонент просмотра изображений"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Встраиваемый элемент просмотра изображений (просмотр изображения в виджете)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Просмотр изображений"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Просмотрщик"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Просмотрщик"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Общая настройка KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Виджет с просмотром изображения KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Программа просмотра изображений KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Просмотр"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Просмотр всех изображений в текущей папке."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Эффекты"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Некоторые эффекты обработки изображений"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Имя"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Комментарий"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Презентатор"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Создание галерей изображений и просмотр их в качестве слайдов"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Масштабирование"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Фильтр для масштабирования изображений"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Сканер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Сканирование изображений в KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Шаблон"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "А здесь должно быть описание модуля"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Просмотр папок с фотографиями"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Компонент TDE просмотра изображений"
diff --git a/translations/desktop_files/kview-desktops/rw.po b/translations/desktop_files/kview-desktops/rw.po
new file mode 100644
index 00000000..e101bd2e
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/rw.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Porogaramu"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Amacomeka"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Mugaraza Shusho"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Mugaraza Shusho"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Mugaraza Shusho"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Mugaraza Shusho"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Mugaraza Shusho"
diff --git a/translations/desktop_files/kview-desktops/se.po b/translations/desktop_files/kview-desktops/se.po
new file mode 100644
index 00000000..58fb9479
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/se.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Prográmma"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Heivet KView:a oktosaš veršuvnna"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Lassemoduvllat"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Vuojuhanláhkái govvačájehanoassi"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Vuojuhahtti govvačájehanliinni (áhtá mii čájeha gova)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Govvačájeheaddji"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Čájeheaddji"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Čájeheaddji"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView govvačájehanáhta"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView govvačájeheaddji"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Bláđđejeaddji"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Diktá du bláđđet buot govaid čađa dán ozus."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Namma"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommeanta"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Ráhkada govvalisttu ja diktá du ráhkadit govvačájeheami"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skále"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Silli mii skálere govaid"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skánner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Rahpá govaid skánneris KView:as"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Málle"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Guhkkit čilgehus mii muitala maid lassemoduvla bargá"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE:a govvačájehanoassi"
diff --git a/translations/desktop_files/kview-desktops/sk.po b/translations/desktop_files/kview-desktops/sk.po
new file mode 100644
index 00000000..2cbefcc8
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/sk.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Aplikácia"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Konfigurácia pre samostatnú verziu KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Moduly"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Vyberte a nastavte si moduly"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Vložiteľný komponent prehliadač obrázkov"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Vložiteľný komponent prehliadač obrázkov (prvok, ktorý zobrazuje obrázky)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Prehliadač obrázkov"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Prehliadač"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Prehliadač"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Všeobecné nastavenie KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Prvok prehliadača obrázkov KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Prehliadač obrázkov KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Prehliadač"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Umožňuje prechádzať mezi obrázkami v aktuálnom priečinku."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efekty"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Poskytuje niektoré efekty pre obrázky"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Meno"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komentár"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Vytvorenie prezentácie"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Vytvorí zoznam obrázok a umožní z nich vytvoriť prezentáciu"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Škálovač"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter pre zväčšenie obrázku"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skener"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Otvorí obrázky z vášho skeneru v KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Šablóna"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Tu by mal byť popis, čo modul robí"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Album fotiek"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Jednoducho prehliada priečinky s fotografiami"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Part TDE Prehliadač obrázkov"
diff --git a/translations/desktop_files/kview-desktops/sl.po b/translations/desktop_files/kview-desktops/sl.po
new file mode 100644
index 00000000..ec4ff2dd
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/sl.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Nastavitve za samostojno različico KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Vstavki"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Izberite in nastavite vstavke"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Vključen dodatek za pregled slik"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Vključljivo platno za pregled slik (gradnik, ki prikaže sliko)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Pregledovalnik slik"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Pregledovalnik"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Pregledovalnik"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Splošne nastavitve KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Gradnik pregledovalnika slik KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Pregledovalnik slik KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Brskalnik"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Omogoča vam brskanje po vseh slikah v trenutni mapi."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Učinki"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Prinaša nekaj učinkov za slike"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Ime"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Predstavitelj"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Ustvari seznam slik in vam omogoča ustvariti predstavitev"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Raztegni"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter za raztegovanje slike"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skener"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Odpre sliko iz vašega skenerja v KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Predloga"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Daljši opis, kaj naredi ta vstavek"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Album slik"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Zlahka brskajte po mapi s fotografijami"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Del pregledovalnika slik TDE"
diff --git a/translations/desktop_files/kview-desktops/sr.po b/translations/desktop_files/kview-desktops/sr.po
new file mode 100644
index 00000000..12c4bc2e
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/sr.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Програм"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Подешавање за самосталну верзију KView-а"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Прикључци"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Изаберите и подесите ваше прикључке"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Уградива компонента приказивача слика"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Уградиво платно приказивача слика (контрола која показује слику)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Приказивач слика"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Приказивач"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Приказивач"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Општа подешавања за KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView, контрола за приказ слика"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView, приказивач слика"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Прегледач"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Омогућава вам да прегледате све слике у текућем директоријуму "
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Ефекти"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Пружа неке сликовне ефекте"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Име"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Коментар"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Презентер"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Прави листу слика и омогућава вам да направите слајд-шоу"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Скалирање"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Филтер за промену величине слике"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Скенер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Отвара слике из вашег скенера у KView-у"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Шаблон"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Дужи опис чему прикључак служи"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Фотокњига"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Лако прегледајте фасциклу са сликама"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE-ов део за приказивање слика"
diff --git a/translations/desktop_files/kview-desktops/sr@Latn.po b/translations/desktop_files/kview-desktops/sr@Latn.po
new file mode 100644
index 00000000..166fa1dd
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/sr@Latn.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Podešavanje za samostalnu verziju KView-a"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Priključci"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Izaberite i podesite vaše priključke"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ugradiva komponenta prikazivača slika"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Ugradivo platno prikazivača slika (kontrola koja pokazuje sliku)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Prikazivač slika"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Prikazivač"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Prikazivač"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Opšta podešavanja za KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView, kontrola za prikaz slika"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView, prikazivač slika"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Pregledač"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Omogućava vam da pregledate sve slike u tekućem direktorijumu "
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efekti"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Pruža neke slikovne efekte"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Ime"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Komentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Prezenter"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Pravi listu slika i omogućava vam da napravite slajd-šou"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skaliranje"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter za promenu veličine slike"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skener"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Otvara slike iz vašeg skenera u KView-u"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Šablon"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Duži opis čemu priključak služi"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoknjiga"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Lako pregledajte fasciklu sa slikama"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE-ov deo za prikazivanje slika"
diff --git a/translations/desktop_files/kview-desktops/sv.po b/translations/desktop_files/kview-desktops/sv.po
new file mode 100644
index 00000000..b152c278
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/sv.po
@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Program"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Inställning för fristående version av Kview"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Insticksprogram"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Välj och anpassa insticksprogram"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Inbäddningsbar bildvisande komponent"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Inbäddningsbar bildvisande duk (komponent som visar en bild)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Bildvisare"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "Kview"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Visning"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Allmän inställning av Kviews duk"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Kview bildvisande komponent"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Kview bildvisning"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Bläddrare"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Låter dig bläddra igenom alla bilder i den aktuella katalogen."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effekter"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Tillhandahåller vissa bildeffekter"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Namn"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Kommentar"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Presentationer"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Skapar en bildlista och ger dig möjlighet att göra ett bildspel"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Skala"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Filter för att skala bilden"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Bildläsare"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Öppnar bilder från bildläsaren i Kview"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Mall"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "En längre beskrivningen av vad insticksprogrammet gör"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Fotoalbum"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Bläddra enkelt i en katalog med fotografier"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE:s bildvisningsdel"
diff --git a/translations/desktop_files/kview-desktops/ta.po b/translations/desktop_files/kview-desktops/ta.po
new file mode 100644
index 00000000..5f435d4d
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ta.po
@@ -0,0 +1,164 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "பயன்பாடு"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "கேகாட்சியின் தனிப் பதிப்புக்கான வடிவமைப்பு"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "சொருகுப்பொருள்"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "சொருகுப்பொருள்களைத் தேர்ந்தெடுத்து வடிவமைக்கவும்"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "பொதிந்த பிம்ப காட்சி பகுதி"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "பொதிந்த பிம்ப காட்சி திரைவடிவம்(சாளரம் ஒரு பிம்பத்தை காட்டுகிறது)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "பிம்ப காட்சி"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "கேகாட்சி"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "காட்சி"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "பொதுவான கேகாட்சி சித்திரவடிவ வடிவமைப்பு"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "கேகாட்சி பிம்பக் காட்சி சாளரம்"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "கேகாட்சி பிம்பக் காட்சி"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "உலாவி"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "நடப்பு அடைவில் உள்ள பிம்பங்களை எல்லாம் பார்க்க முடியும்."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "விளைவுகள்"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "சில பிம்ப விளைவுகளை தருகிறது"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "பெயர்"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "குறிப்பு"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "வழங்குபவர்"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "திரைக் காட்சிக்கான பிம்ப பட்டியலை உருவாக்கலாம்"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "அளவுக்கோல்"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "பிம்பத்தை மாற்றும் வடிகட்டி"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "வருடி"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "கேகாட்சியின் வருடியில் இருந்து பிம்பங்களைத் திற"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "வார்ப்புரு"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "சொருகுப்பொருள் செய்த பணியின் நீண்ட வருணனை"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "புகைப்படப் புத்தகம்"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "புகைப்படங்களின் அடைவை சுலபமாக உலாவ"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "கேடிஇ பகுதி பிம்பக் காட்சி"
diff --git a/translations/desktop_files/kview-desktops/tg.po b/translations/desktop_files/kview-desktops/tg.po
new file mode 100644
index 00000000..81785309
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/tg.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Барнома"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Танзимоти барномаи мустақили KView"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Модулҳо"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Қисмати дар дохилсозандаи намоиши тасвирот"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Ҷузъи дар дохилсозандаи намоиши тасвирот (намоиши тасвирот дар виджет)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Намоиши тасвирот"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Намоишгар"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Намоишгар"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Танзимоти умумии KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Виджет бо намоиши тасвироти KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Барномаи намоиши тасвироти KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Воқеъанигор"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Намоиши тамоми тасвирот дар каталоги ҷорӣ."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Воситаҳо"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Якчанд воситаҳои коркарди тасвирот"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Ном"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Эзоҳ"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Презентатор"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Эҷоди нигористони тасвирот ва намоиши онҳо ҳамчун слайд"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Масштабонӣ"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Филтр барои масштабонии тасвирот"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Сканер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Сканеронии тасвирот дар KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Қолиб"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Дар инҷо бояд тасвироти модул бошад"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Қисмати TDE-и намоиши тасвирот"
diff --git a/translations/desktop_files/kview-desktops/th.po b/translations/desktop_files/kview-desktops/th.po
new file mode 100644
index 00000000..4cd61f13
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/th.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "แอพพลิเคชัน"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "เครื่องมือแสดงภาพ"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "ดูภาพ - K"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "ดูภาพ - K"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "เครื่องมือแสดงภาพ"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "เครื่องมือแสดงภาพ"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr ""
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr ""
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "เครื่องมือแสดงภาพ"
diff --git a/translations/desktop_files/kview-desktops/tr.po b/translations/desktop_files/kview-desktops/tr.po
new file mode 100644
index 00000000..bff2421b
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/tr.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Uygulama"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView programının yanlız sürümünün ayarları"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Eklentiler"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Eklentilerinizi Seçin ve Yapılandırın:"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Gömülebilir Resim Görüntüleme Bileşeni"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Gömülebilir Resim Görüntüleme Penceresi"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Resim Göstericisi"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Görüntüleyici"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Görüntüleyici"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Genel KView Ekran Ayarları"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView Resim Görüntüleme Parçacığı"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView Resim Görüntüleyici"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Tarayıcı"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Bulunduğunuz dizindeki tüm resimler arasında gezinmenizi sağlar."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efektler"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Resim efektleri oluşturur"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Açıklama"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Sunum Aracı"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Bir resim listesi oluşturur ve slayt gösterisi yapmanıza olanak tanır"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Oranla"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Resmi oranlamak için filtre"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Tarayıcı"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Tarayıcıdan KView'a resim gönderin"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Şablon"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Eklentinin uzun açıklaması"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Albüm"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Fotoğraflarla dolu bir dizini kolayca gez"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE Resim Göstericisi Kısmı"
diff --git a/translations/desktop_files/kview-desktops/uk.po b/translations/desktop_files/kview-desktops/uk.po
new file mode 100644
index 00000000..96b9171f
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/uk.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kview-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Програма"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "Налаштування KView, як окремої програми"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Втулки"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Виберіть та налаштуйте ваші втулки"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Вмонтовний компонент перегляду зображень"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Вмонтовний компонент полотна перегляду зображень (віджет, що малює "
+"зображення)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Переглядач зображень"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "KView"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Переглядач"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "Загальні параметри KViewCanvas"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Віджет переглядача зображень KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "Переглядач зображень KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Навігатор"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Дозволяє навігацію всіх зображень в поточному каталозі."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Ефекти"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Надає деякі ефекти зображень"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Назва"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Коментар"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Пред'явник"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "Створює список зображень та дозволяє створювати презентацію слайдів"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Масштаб"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Фільтр для масштабування зображення"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Сканер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Відкриває зображення з вашого сканера в KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Шаблон"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Докладний опис можливостей втулку"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Фотокнига"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "Простий перегляд тек з фотографіями"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Складова TDE переглядача зображень"
diff --git a/translations/desktop_files/kview-desktops/uz.po b/translations/desktop_files/kview-desktops/uz.po
new file mode 100644
index 00000000..68d3e8e5
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/uz.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Dastur"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Plaginlar"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Plaginlarni tanlash va moslash"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Rasm koʻruvchi"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Koʻruvchi"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Koʻruvchi"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Rasm koʻruvchi"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Rasm koʻruvchi"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Brauzer"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Effektlar"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Rasm effektlari"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Nomi"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Izoh"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Skanner"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Namuna"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Rasmlar toʻplami"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Rasm koʻruvchi"
diff --git a/translations/desktop_files/kview-desktops/uz@cyrillic.po b/translations/desktop_files/kview-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..baf02847
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/uz@cyrillic.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Дастур"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Плагинлар"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "Плагинларни танлаш ва мослаш"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Расм кўрувчи"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Кўрувчи"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Кўрувчи"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+#, fuzzy
+msgid "KView Image Viewer Widget"
+msgstr "Расм кўрувчи"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Расм кўрувчи"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Браузер"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Эффектлар"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "Расм эффектлари"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "Номи"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Изоҳ"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr ""
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr ""
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Сканнер"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr ""
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Намуна"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr ""
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "Расмлар тўплами"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Расм кўрувчи"
diff --git a/translations/desktop_files/kview-desktops/ven.po b/translations/desktop_files/kview-desktops/ven.po
new file mode 100644
index 00000000..a3960592
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/ven.po
@@ -0,0 +1,172 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Apulifikhesheni"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Tshipida tsha muvhoni wa tshifanyiso tsho dzheniswaho"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Muvhala wa muvhoni wa tshifanyiso tsho dzheniswaho (tshishumiswa tsha "
+"vhuthogwa tshine tsha sumbedza tshifanyiso)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Tshivhoni tsha Mutaleli"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "U vhona ha K"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "U vhona ha K"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr ""
+"Tshishumiswa tsha vhuthogwa tsha muvhoni wa tshifanyiso tsha mbonalelo ya K"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr ""
+"Tshishumiswa tsha vhuthogwa tsha muvhoni wa tshifanyiso tsha mbonalelo ya K"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Burausa"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+"Ini konisa u tshimbidza kha zwifanyiso zwothe kha tsumbavhulwo ya zwino."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Mulanguli"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Iita mutevhe wa tshifanyiso ya dovha yani tendela uita tsumbedzo ya tshilaidi"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Tshikeili"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Faela yau kala tshifanyiso"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Tshinanguludzi"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Vulani zwifanyiso ubva kha tshinanguludzi uya kha mbonalelo ya K"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Thalutshedzo khulwane ya ine plugin ya ita zwone"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Tshipida tsha muvhoni wa tshifanyiso tsha TDE"
diff --git a/translations/desktop_files/kview-desktops/wa.po b/translations/desktop_files/kview-desktops/wa.po
new file mode 100644
index 00000000..8185b719
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/wa.po
@@ -0,0 +1,166 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Programe"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "Tchôke-divins"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Håyneu d' imådjes"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "Håyneu"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "Håyneu"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Ahesse håyneu d' imådjes KView "
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView Håyneu d' imådjes"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Foyteuse"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "Vos permete di foyter dins totes les imådjes do ridant do moumint."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "Efets"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "No"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "Rawete"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr ""
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Al schåle"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Passete po mete l' imådje al schåle"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Sicanrece"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Drovi des imådjes di vosse sicanrece avou KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "Modele"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "On discrijhaedje pus complet di çou k' est fwait på tchôke-divins"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#, fuzzy
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Håyneu d' imådjes"
diff --git a/translations/desktop_files/kview-desktops/xh.po b/translations/desktop_files/kview-desktops/xh.po
new file mode 100644
index 00000000..e955b409
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/xh.po
@@ -0,0 +1,168 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Isicelo"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ingxenye Yombonisi Womfanekiso Olungisiweyo"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "Iseyile Yombonisi Womfanekiso Olungisiweyo (widget ebonisa umfanekiso)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Umboniseli Womfanekiso"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Umboniseli Womfanekiso"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "Widget Yombonisi Womfanekiso we KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "Widget Yombonisi Womfanekiso we KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Umkhangeli wencwadi"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+"Ikuvumela ukuba ukwazi ukukhangela yonke imifanekiso kulawulo lwangoku."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Umbonisi"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Yenza uluhlu lwemifanekiso ekuvumela ukwazi ukwenza umboniso wotyibiliko"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Isikali"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Icebo lokucoca ulwelo lokukala umfanekiso"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Umvavanyi"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Vula imifanekiso evela kumvavanyisi wakho kwi KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr ""
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "Inkcazelo ende echaza ukuba iplagi ezingaphakathi zenza ntoni na"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Iqhekeza Lombonisi Womfanekiso we TDE"
diff --git a/translations/desktop_files/kview-desktops/zh_CN.po b/translations/desktop_files/kview-desktops/zh_CN.po
new file mode 100644
index 00000000..fd61136f
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/zh_CN.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "应用程序"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView 标准版本的配置"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "插件"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "选择并配置您的插件"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "可嵌入的图像查看器组件"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "可嵌入的图像查看画布(显示图像的部件)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "图片查看程序"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "查看器"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "查看器"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "KViewCanvas 常规配置"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView 图像查看器部件"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView 图像查看器"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "浏览器"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "使您能够浏览当前目录中的所有图像。"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "特效"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "提供某些图像特效"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "名称"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "注释"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "演示板"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "创建图像列表,并能为您创建幻灯片"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "缩放"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "缩放图像的滤镜"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "扫描仪"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "从您的扫描仪中打开图像至 KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "模板"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "这里应该填写插件功能详细一点的描述"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "轻松浏览照片文件夹"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE 图像查看器组件"
diff --git a/translations/desktop_files/kview-desktops/zh_HK.po b/translations/desktop_files/kview-desktops/zh_HK.po
new file mode 100644
index 00000000..246ba83a
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/zh_HK.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "應用程式"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "獨立版本的 KView 的設定"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "插件"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "選擇及設定你的插件"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "可嵌入的圖像檢視器元件"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "可嵌入的圖像檢視器畫布(顯示圖像的器件)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "圖像檢視器"
+
+#. Name
+#: kview.desktop:10
+#, fuzzy
+msgid "KView"
+msgstr "檢視器"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+msgid "Viewer"
+msgstr "檢視器"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "一般 KViewCanvas 設定"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView 圖像檢視器器件"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView 圖像檢視器"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "瀏覽器"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "讓您瀏覽當前目錄的所有圖像。"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "效果"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "提供一些圖像效果"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "名稱"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "註解"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "簡報器"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "建立圖像清單並讓您能建立幻燈片式放映"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "縮放"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "用來縮放影像的過濾器"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "掃描器"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "從您的掃描器開啟圖像至 KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "範本"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "這個插件的功用的較長描述"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr "照相簿"
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "容易地瀏覽資料夾的照片"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE 圖像檢視器組件"
diff --git a/translations/desktop_files/kview-desktops/zh_TW.po b/translations/desktop_files/kview-desktops/zh_TW.po
new file mode 100644
index 00000000..7d9b0888
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/zh_TW.po
@@ -0,0 +1,165 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "應用程式"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr "KView 單獨執行版本的設定"
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr "外掛程式"
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr "選擇並設定您的外掛程式"
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "可嵌入的影像檢視器元件"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr "可嵌入的影像檢視器畫布(顯示影像的界面工具)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "影像檢視程式"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr "KView 檢視器"
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "KView 檢視器"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr "一般 KViewCanvas 設定"
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "KView 影像檢視器界面工具"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+msgid "KView Image Viewer"
+msgstr "KView 影像檢視器"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "瀏覽器"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr "讓您瀏覽目前目錄的所有影像。"
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr "特效"
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr "提供影像特效"
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr "名稱"
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr "註解"
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "簡報"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr "建立影像清單並讓您能建立幻燈片式放映"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "縮放"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "用來縮放影像的濾鏡"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "掃描器"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "從您的掃描器開啟影像至 KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "範本"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "關於這個外掛程式的所做所為的較長描述"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr "輕易地瀏覽相片的資料夾"
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "TDE 影像檢視器組件"
diff --git a/translations/desktop_files/kview-desktops/zu.po b/translations/desktop_files/kview-desktops/zu.po
new file mode 100644
index 00000000..4aa2fe61
--- /dev/null
+++ b/translations/desktop_files/kview-desktops/zu.po
@@ -0,0 +1,170 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 17:37+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: config/kviewgeneralconfig.desktop:14
+msgid "Application"
+msgstr "Isicelo"
+
+#. Comment
+#: config/kviewgeneralconfig.desktop:15
+msgid "Configuration for the standalone Version of KView"
+msgstr ""
+
+#. Name
+#: config/plugins/kviewpluginsconfig.desktop:14
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:14
+msgid "Plugins"
+msgstr ""
+
+#. Comment
+#: config/plugins/kviewpluginsconfig.desktop:15
+#: kviewviewer/config/kviewviewerpluginsconfig.desktop:15
+msgid "Choose and Configure Your Plugins"
+msgstr ""
+
+#. Comment
+#: kimageviewer/kimageviewer.desktop:6
+msgid "Embeddable Image Viewer Component"
+msgstr "Ilunga Lombukisi Wesithombe Esixubeneyo"
+
+#. Comment
+#: kimageviewer/kimageviewercanvas.desktop:4
+msgid "Embeddable Image Viewer Canvas (widget that shows an image)"
+msgstr ""
+"Inkalivasi Yombukisi Wesithombe Esixubeneyo (i-widget ekhombisa isithombe)"
+
+#. GenericName
+#: kview.desktop:8
+msgid "Image Viewer"
+msgstr "Umbonisi Womfanekiso"
+
+#. Name
+#: kview.desktop:10
+msgid "KView"
+msgstr ""
+
+#. Name
+#: kviewcanvas/config/kviewcanvasconfig.desktop:14
+#, fuzzy
+msgid "Viewer"
+msgstr "Umbonisi Womfanekiso"
+
+#. Comment
+#: kviewcanvas/config/kviewcanvasconfig.desktop:15
+msgid "General KViewCanvas Configuration"
+msgstr ""
+
+#. Name
+#: kviewcanvas/kviewcanvas.desktop:3
+msgid "KView Image Viewer Widget"
+msgstr "I-widget Yombukisi Wesithombe se-KView"
+
+#. Name
+#: kviewviewer/kviewviewer.desktop:6
+#, fuzzy
+msgid "KView Image Viewer"
+msgstr "I-widget Yombukisi Wesithombe se-KView"
+
+#. Name
+#: modules/browser/kviewbrowser.desktop:14
+msgid "Browser"
+msgstr "Umcingi"
+
+#. Comment
+#: modules/browser/kviewbrowser.desktop:15
+msgid ""
+"Enables you to browse through all of the images in the current directory."
+msgstr ""
+"Ikuvumela ukuba ucinge ngokwedlulela izithombe ohlwini lwamafayela lwamanje."
+
+#. Name
+#: modules/effects/kvieweffects.desktop:13
+msgid "Effects"
+msgstr ""
+
+#. Comment
+#: modules/effects/kvieweffects.desktop:14
+msgid "Provides some image effects"
+msgstr ""
+
+#. Name
+#: modules/presenter/config/kviewpresenterconfig.desktop:11
+msgid "Name"
+msgstr ""
+
+#. Comment
+#: modules/presenter/config/kviewpresenterconfig.desktop:12
+msgid "Comment"
+msgstr ""
+
+#. Name
+#: modules/presenter/kviewpresenter.desktop:13
+msgid "Presenter"
+msgstr "Umnikeli"
+
+#. Comment
+#: modules/presenter/kviewpresenter.desktop:14
+msgid "Creates an imagelist and enables you to create a slideshow"
+msgstr ""
+"Idala uhlu lwesithombe futhi ikuvumela wena ukuba udale umbukiso wesithombe "
+"esishibilikayo"
+
+#. Name
+#: modules/scale/kview_scale.desktop:2
+msgid "Scale"
+msgstr "Isikali"
+
+#. Comment
+#: modules/scale/kview_scale.desktop:3
+msgid "Filter to scale the image"
+msgstr "Hluza isithombe esikaleni"
+
+#. Name
+#: modules/scanner/kviewscanner.desktop:13
+msgid "Scanner"
+msgstr "Umhloli"
+
+#. Comment
+#: modules/scanner/kviewscanner.desktop:14
+msgid "Open images from your scanner into KView"
+msgstr "Vula izithombe ezisuka kumhloli wakho kwi-KView"
+
+#. Name
+#: modules/template/kviewtemplate.desktop:13
+msgid "Template"
+msgstr "i-template"
+
+#. Comment
+#: modules/template/kviewtemplate.desktop:14
+msgid "A longer description of what the plugin does"
+msgstr "incazelo ende yokuthi i-plugin yenzani"
+
+#. GenericName
+#. Name
+#: photobook/photobook.desktop:2 photobook/photobook.desktop:6
+msgid "Photobook"
+msgstr ""
+
+#. Comment
+#: photobook/photobook.desktop:7
+msgid "Easily browse a folder of photographs"
+msgstr ""
+
+#~ msgid "TDE Image Viewer Part"
+#~ msgstr "Ingxenye Yombukisi Wesithombe se-TDE"
diff --git a/translations/desktop_files/kviewshell-desktops/bg.po b/translations/desktop_files/kviewshell-desktops/bg.po
new file mode 100644
index 00000000..5ea007dc
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/bg.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Приставка за файлове DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/br.po b/translations/desktop_files/kviewshell-desktops/br.po
new file mode 100644
index 00000000..ed8ebbc4
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/br.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Lugent KViewShell evit ar restroù DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/bs.po b/translations/desktop_files/kviewshell-desktops/bs.po
new file mode 100644
index 00000000..f689bbb8
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/bs.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell dodatak za DjVu datoteke"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/ca.po b/translations/desktop_files/kviewshell-desktops/ca.po
new file mode 100644
index 00000000..59a93903
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ca.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Connector pel KViewShell per fitxers DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/cs.po b/translations/desktop_files/kviewshell-desktops/cs.po
new file mode 100644
index 00000000..be7ea131
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/cs.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell modul pro DjVu soubory"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/da.po b/translations/desktop_files/kviewshell-desktops/da.po
new file mode 100644
index 00000000..39fd3a62
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/da.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Kviewshell-plugin for DjVu-filer"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell Multiside"
diff --git a/translations/desktop_files/kviewshell-desktops/de.po b/translations/desktop_files/kviewshell-desktops/de.po
new file mode 100644
index 00000000..f60ad5ee
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/de.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Leere Mehrfachseite"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Ein KViewShell-Modul für DjVu-Dateien"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell Mehrfachseiten"
diff --git a/translations/desktop_files/kviewshell-desktops/el.po b/translations/desktop_files/kviewshell-desktops/el.po
new file mode 100644
index 00000000..7fde63ea
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/el.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "ΚενήΠολλαπλήΣελίδα"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Πρόσθετο του KViewShell για αρχεία DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Πολλαπλή σελίδα KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/es.po b/translations/desktop_files/kviewshell-desktops/es.po
new file mode 100644
index 00000000..4f5c7091
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/es.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Vaciado multipágina"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Extensión KViewShell para archivos DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Multipágina KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/et.po b/translations/desktop_files/kviewshell-desktops/et.po
new file mode 100644
index 00000000..c4d27d3f
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/et.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KView DjVu-failide plugin"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/eu.po b/translations/desktop_files/kviewshell-desktops/eu.po
new file mode 100644
index 00000000..73932353
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/eu.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "DjVu fitxategien KViewShell-en plugina"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/fa.po b/translations/desktop_files/kviewshell-desktops/fa.po
new file mode 100644
index 00000000..a2103b11
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/fa.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "وصلۀ KViewShell برای پرونده‌های DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/fi.po b/translations/desktop_files/kviewshell-desktops/fi.po
new file mode 100644
index 00000000..3dba7c7e
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/fi.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "TyhjäMoniSivu"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell sovelma DjVu-tiedostoille"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell MoniSivu"
diff --git a/translations/desktop_files/kviewshell-desktops/fr.po b/translations/desktop_files/kviewshell-desktops/fr.po
new file mode 100644
index 00000000..e689ddcd
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/fr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Multi-page vide"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Module KViewShell pour les fichiers DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Multi-page KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/gl.po b/translations/desktop_files/kviewshell-desktops/gl.po
new file mode 100644
index 00000000..a427bae2
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/gl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "MultiPáxinaBaleira"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Extensión de KViewShell para ficheiros DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell Multipáxina"
diff --git a/translations/desktop_files/kviewshell-desktops/hu.po b/translations/desktop_files/kviewshell-desktops/hu.po
new file mode 100644
index 00000000..ca38ba8a
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/hu.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "ÜresTöbbOldalas"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "KDjView"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell-modul DjVu-fájlokhoz"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell többoldalas"
diff --git a/translations/desktop_files/kviewshell-desktops/is.po b/translations/desktop_files/kviewshell-desktops/is.po
new file mode 100644
index 00000000..ae562f87
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/is.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell íforrit fyrir DjVu skrár"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/it.po b/translations/desktop_files/kviewshell-desktops/it.po
new file mode 100644
index 00000000..54603767
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/it.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: 2021-05-22 12:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kviewshell-desktop-files/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "MultiPaginaVuota"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "kdjview"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Plugin KViewShell per file DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "MultiPagina KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/ja.po b/translations/desktop_files/kviewshell-desktops/ja.po
new file mode 100644
index 00000000..e7e72ea1
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ja.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "Kdjview"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "DjVu ファイル用の KViewShell プラグイン"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/kk.po b/translations/desktop_files/kviewshell-desktops/kk.po
new file mode 100644
index 00000000..dd9e3fc4
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/kk.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "DjVu файлдарына арналған KViewShell плагин модулі"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Көпбетті KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/km.po b/translations/desktop_files/kviewshell-desktops/km.po
new file mode 100644
index 00000000..e8a89508
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/km.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "កម្មវិធី​ជំនួយ KViewShell សម្រាប់​ឯកសារ DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/kviewshell-desktops.pot b/translations/desktop_files/kviewshell-desktops/kviewshell-desktops.pot
new file mode 100644
index 00000000..575f1641
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/kviewshell-desktops.pot
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr ""
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/lt.po b/translations/desktop_files/kviewshell-desktops/lt.po
new file mode 100644
index 00000000..1301baed
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/lt.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell priedas, skirtas DjVu byloms"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/ms.po b/translations/desktop_files/kviewshell-desktops/ms.po
new file mode 100644
index 00000000..510f2bc8
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ms.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Plugin KViewShell untuk fail DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "PelbagaiMuka KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/nb.po b/translations/desktop_files/kviewshell-desktops/nb.po
new file mode 100644
index 00000000..0fb7c055
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/nb.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Tom Flerside"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell programtillegg for DjVu-filer"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell Flerside"
diff --git a/translations/desktop_files/kviewshell-desktops/nds.po b/translations/desktop_files/kviewshell-desktops/nds.po
new file mode 100644
index 00000000..574575f0
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/nds.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Leddig Mehrfachsiet"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "En \"KViewShell\"-Moduul för DjVu-Dateien"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell för Mehrfachsieden"
diff --git a/translations/desktop_files/kviewshell-desktops/ne.po b/translations/desktop_files/kviewshell-desktops/ne.po
new file mode 100644
index 00000000..4548dc69
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ne.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "रिक्त बहुपृष्ठ"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "केडीजे दृश्य"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "डिजे भीयू फाइलका लागि केडीई दृश्य शेल प्लगइन"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "के दृश्य शेल बहुपृष्ठ"
diff --git a/translations/desktop_files/kviewshell-desktops/nl.po b/translations/desktop_files/kviewshell-desktops/nl.po
new file mode 100644
index 00000000..e565129c
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/nl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "LegeMultiPagina"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell-plugin voor DjVu-bestanden"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell MultiPagina"
diff --git a/translations/desktop_files/kviewshell-desktops/nn.po b/translations/desktop_files/kviewshell-desktops/nn.po
new file mode 100644
index 00000000..980b69ef
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/nn.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Tom fleirside"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell-programtillegg for DjVu-filer"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell-fleirside"
diff --git a/translations/desktop_files/kviewshell-desktops/pl.po b/translations/desktop_files/kviewshell-desktops/pl.po
new file mode 100644
index 00000000..883e4e0b
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/pl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Puste wielostronicowe"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Wtyczka KViewShell do plików DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Wielostronicowe dla KViewShell"
diff --git a/translations/desktop_files/kviewshell-desktops/pt.po b/translations/desktop_files/kviewshell-desktops/pt.po
new file mode 100644
index 00000000..dc006e2c
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/pt.po
@@ -0,0 +1,38 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kviewshell-desktop-files/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "EmptyMultiPage"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "kdjview"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "'Plugin' do KViewShell para ficheiros do DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell MultiPágina"
diff --git a/translations/desktop_files/kviewshell-desktops/pt_BR.po b/translations/desktop_files/kviewshell-desktops/pt_BR.po
new file mode 100644
index 00000000..60508c0b
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/pt_BR.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "MultiPáginas Vazias"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Plugin KViewShell para arquivos DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell - Múltiplas Páginas"
diff --git a/translations/desktop_files/kviewshell-desktops/ro.po b/translations/desktop_files/kviewshell-desktops/ro.po
new file mode 100644
index 00000000..8a2e0f9e
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ro.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Pagini multiple goale"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr ""
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell Pagini Multiple"
diff --git a/translations/desktop_files/kviewshell-desktops/ru.po b/translations/desktop_files/kviewshell-desktops/ru.po
new file mode 100644
index 00000000..f0b38212
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ru.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Компонент просмотра файлов DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Компонент MultiPage"
diff --git a/translations/desktop_files/kviewshell-desktops/sk.po b/translations/desktop_files/kviewshell-desktops/sk.po
new file mode 100644
index 00000000..cf787cb7
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/sk.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "EmprtyMultiPage"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "kdjView"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell modul pre DjVu súbory"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/sl.po b/translations/desktop_files/kviewshell-desktops/sl.po
new file mode 100644
index 00000000..c1d99699
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/sl.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Vstavek za KViewShell za datoteke DjVu"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/kviewshell-desktops/sr.po b/translations/desktop_files/kviewshell-desktops/sr.po
new file mode 100644
index 00000000..92627385
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/sr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell-ов прикључак за DjVu фајлове"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell вишестрани"
diff --git a/translations/desktop_files/kviewshell-desktops/sr@Latn.po b/translations/desktop_files/kviewshell-desktops/sr@Latn.po
new file mode 100644
index 00000000..c5cd5546
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/sr@Latn.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "KViewShell-ov priključak za DjVu fajlove"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell višestrani"
diff --git a/translations/desktop_files/kviewshell-desktops/sv.po b/translations/desktop_files/kviewshell-desktops/sv.po
new file mode 100644
index 00000000..6de4c94c
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/sv.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "Tom flera sidor"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "Kdjview"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Kviewshell-insticksprogram för DjVu-filer"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "Kviewshell flera sidor"
diff --git a/translations/desktop_files/kviewshell-desktops/ta.po b/translations/desktop_files/kviewshell-desktops/ta.po
new file mode 100644
index 00000000..2371aefc
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/ta.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "காலியான பலபக்கம்"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr ""
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "கேகாட்சிஓடு பலபக்கம்"
diff --git a/translations/desktop_files/kviewshell-desktops/tr.po b/translations/desktop_files/kviewshell-desktops/tr.po
new file mode 100644
index 00000000..b5924ba6
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/tr.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "BoşÇokluSayfa"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "DjVu dosyaları için KViewShell eklentisi"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell ÇokluSayfa"
diff --git a/translations/desktop_files/kviewshell-desktops/uk.po b/translations/desktop_files/kviewshell-desktops/uk.po
new file mode 100644
index 00000000..5e2e7e18
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/uk.po
@@ -0,0 +1,39 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/kviewshell-desktop-files/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "EmptyMultiPage"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "kdjview"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "Втулок перегляду файлів DjVu для KViewShell"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell БагатоСторінковий"
diff --git a/translations/desktop_files/kviewshell-desktops/zh_CN.po b/translations/desktop_files/kviewshell-desktops/zh_CN.po
new file mode 100644
index 00000000..ef890e6e
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/zh_CN.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr "KDjView"
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "DjVu 文件的 KViewShell 插件"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell 多页"
diff --git a/translations/desktop_files/kviewshell-desktops/zh_HK.po b/translations/desktop_files/kviewshell-desktops/zh_HK.po
new file mode 100644
index 00000000..9be02825
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/zh_HK.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr "空的多頁"
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "用於 DjVu 檔案的 KViewShell 插件"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr "KViewShell 多頁"
diff --git a/translations/desktop_files/kviewshell-desktops/zh_TW.po b/translations/desktop_files/kviewshell-desktops/zh_TW.po
new file mode 100644
index 00000000..cc52b3b9
--- /dev/null
+++ b/translations/desktop_files/kviewshell-desktops/zh_TW.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:25+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: emptymultipage.desktop:3
+msgid "EmptyMultiPage"
+msgstr ""
+
+#. Name
+#: plugins/djvu/djvumultipage.desktop:2
+msgid "kdjview"
+msgstr ""
+
+#. Comment
+#: plugins/djvu/djvumultipage.desktop:5
+msgid "KViewShell plugin for DjVu files"
+msgstr "DjVu 檔的 KViewShell 外掛程式"
+
+#. Name
+#: tdemultipage.desktop:4
+msgid "KViewShell MultiPage"
+msgstr ""
diff --git a/translations/desktop_files/scanservice.desktop/af.po b/translations/desktop_files/scanservice.desktop/af.po
new file mode 100644
index 00000000..48565259
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/af.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Kde Skandeer Diens"
diff --git a/translations/desktop_files/scanservice.desktop/ar.po b/translations/desktop_files/scanservice.desktop/ar.po
new file mode 100644
index 00000000..325d0973
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ar.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "خدمة TDE للمسح الضوئي"
diff --git a/translations/desktop_files/scanservice.desktop/az.po b/translations/desktop_files/scanservice.desktop/az.po
new file mode 100644
index 00000000..3acf9715
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/az.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: az\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE Darama Servisi"
diff --git a/translations/desktop_files/scanservice.desktop/bg.po b/translations/desktop_files/scanservice.desktop/bg.po
new file mode 100644
index 00000000..4c5e17da
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/bg.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Услуга за сканиране"
diff --git a/translations/desktop_files/scanservice.desktop/br.po b/translations/desktop_files/scanservice.desktop/br.po
new file mode 100644
index 00000000..23acea36
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/br.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Damanterien skramm"
diff --git a/translations/desktop_files/scanservice.desktop/ca.po b/translations/desktop_files/scanservice.desktop/ca.po
new file mode 100644
index 00000000..7cb2d732
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ca.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Servei d'escaneig del TDE"
diff --git a/translations/desktop_files/scanservice.desktop/cs.po b/translations/desktop_files/scanservice.desktop/cs.po
new file mode 100644
index 00000000..31d80475
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/cs.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Skenovací služba pro TDE"
diff --git a/translations/desktop_files/scanservice.desktop/cy.po b/translations/desktop_files/scanservice.desktop/cy.po
new file mode 100644
index 00000000..539a7ddd
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/cy.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Gwasanaeth Sganio TDE"
diff --git a/translations/desktop_files/scanservice.desktop/da.po b/translations/desktop_files/scanservice.desktop/da.po
new file mode 100644
index 00000000..06cebf3c
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/da.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE Skanneservice"
diff --git a/translations/desktop_files/scanservice.desktop/de.po b/translations/desktop_files/scanservice.desktop/de.po
new file mode 100644
index 00000000..4f79d5ff
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/de.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Scan-Dienst von TDE"
diff --git a/translations/desktop_files/scanservice.desktop/el.po b/translations/desktop_files/scanservice.desktop/el.po
new file mode 100644
index 00000000..46b8f984
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/el.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Υπηρεσία σάρωσης του TDE"
diff --git a/translations/desktop_files/scanservice.desktop/eo.po b/translations/desktop_files/scanservice.desktop/eo.po
new file mode 100644
index 00000000..38b736fe
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/eo.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Bildcifereciga servo (skano)"
diff --git a/translations/desktop_files/scanservice.desktop/es.po b/translations/desktop_files/scanservice.desktop/es.po
new file mode 100644
index 00000000..39b59ce0
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/es.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Servicio de digitalización de TDE"
diff --git a/translations/desktop_files/scanservice.desktop/et.po b/translations/desktop_files/scanservice.desktop/et.po
new file mode 100644
index 00000000..d15ad469
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/et.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skaneerimisteenus"
diff --git a/translations/desktop_files/scanservice.desktop/eu.po b/translations/desktop_files/scanservice.desktop/eu.po
new file mode 100644
index 00000000..46fa9b2f
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/eu.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE eskaneatze zerbitzua"
diff --git a/translations/desktop_files/scanservice.desktop/fa.po b/translations/desktop_files/scanservice.desktop/fa.po
new file mode 100644
index 00000000..e14baff6
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/fa.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "خدمت پویش TDE"
diff --git a/translations/desktop_files/scanservice.desktop/fi.po b/translations/desktop_files/scanservice.desktop/fi.po
new file mode 100644
index 00000000..d8d8bcd8
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/fi.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE :n skannauspalvelu"
diff --git a/translations/desktop_files/scanservice.desktop/fr.po b/translations/desktop_files/scanservice.desktop/fr.po
new file mode 100644
index 00000000..0d00acf5
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/fr.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Service de numérisation pour TDE"
diff --git a/translations/desktop_files/scanservice.desktop/gl.po b/translations/desktop_files/scanservice.desktop/gl.po
new file mode 100644
index 00000000..48202c9c
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/gl.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Servicio de escáner de TDE"
diff --git a/translations/desktop_files/scanservice.desktop/he.po b/translations/desktop_files/scanservice.desktop/he.po
new file mode 100644
index 00000000..5e21cc5e
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/he.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "שירות הסריקה של TDE"
diff --git a/translations/desktop_files/scanservice.desktop/hi.po b/translations/desktop_files/scanservice.desktop/hi.po
new file mode 100644
index 00000000..23fd717b
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/hi.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "केडीई स्कैन सर्विस"
diff --git a/translations/desktop_files/scanservice.desktop/hr.po b/translations/desktop_files/scanservice.desktop/hr.po
new file mode 100644
index 00000000..e01217e2
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/hr.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skan servis"
diff --git a/translations/desktop_files/scanservice.desktop/hu.po b/translations/desktop_files/scanservice.desktop/hu.po
new file mode 100644
index 00000000..f5c41bf3
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/hu.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE lapolvasó szolgáltatás"
diff --git a/translations/desktop_files/scanservice.desktop/is.po b/translations/desktop_files/scanservice.desktop/is.po
new file mode 100644
index 00000000..4a4236ba
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/is.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE myndlesaraþjónusta"
diff --git a/translations/desktop_files/scanservice.desktop/it.po b/translations/desktop_files/scanservice.desktop/it.po
new file mode 100644
index 00000000..a8541c52
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/it.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Servizio di scansione di TDE"
diff --git a/translations/desktop_files/scanservice.desktop/ja.po b/translations/desktop_files/scanservice.desktop/ja.po
new file mode 100644
index 00000000..23c0c47c
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ja.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE スキャンサービス"
diff --git a/translations/desktop_files/scanservice.desktop/kk.po b/translations/desktop_files/scanservice.desktop/kk.po
new file mode 100644
index 00000000..20740205
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/kk.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE сканер қызметі"
diff --git a/translations/desktop_files/scanservice.desktop/km.po b/translations/desktop_files/scanservice.desktop/km.po
new file mode 100644
index 00000000..8087e796
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/km.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "សេវា​ស្កេន​របស់ TDE"
diff --git a/translations/desktop_files/scanservice.desktop/ko.po b/translations/desktop_files/scanservice.desktop/ko.po
new file mode 100644
index 00000000..8f84093b
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ko.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE 스캔 서비스"
diff --git a/translations/desktop_files/scanservice.desktop/lt.po b/translations/desktop_files/scanservice.desktop/lt.po
new file mode 100644
index 00000000..08467632
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/lt.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skanavimo tarnyba"
diff --git a/translations/desktop_files/scanservice.desktop/lv.po b/translations/desktop_files/scanservice.desktop/lv.po
new file mode 100644
index 00000000..d81f6eb4
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/lv.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE Skanēšanas Serviss"
diff --git a/translations/desktop_files/scanservice.desktop/ms.po b/translations/desktop_files/scanservice.desktop/ms.po
new file mode 100644
index 00000000..c98d5951
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ms.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Perkhidmatan Imbas TDE"
diff --git a/translations/desktop_files/scanservice.desktop/mt.po b/translations/desktop_files/scanservice.desktop/mt.po
new file mode 100644
index 00000000..694621d3
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/mt.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: mt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Servizz TDE tal-iskannjar"
diff --git a/translations/desktop_files/scanservice.desktop/nb.po b/translations/desktop_files/scanservice.desktop/nb.po
new file mode 100644
index 00000000..03a22eb4
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/nb.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skannetjeneste"
diff --git a/translations/desktop_files/scanservice.desktop/nds.po b/translations/desktop_files/scanservice.desktop/nds.po
new file mode 100644
index 00000000..02d0b60d
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/nds.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Bildinleesdeenst för TDE"
diff --git a/translations/desktop_files/scanservice.desktop/ne.po b/translations/desktop_files/scanservice.desktop/ne.po
new file mode 100644
index 00000000..91d0439e
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ne.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "केडीई स्क्यान सेवा"
diff --git a/translations/desktop_files/scanservice.desktop/nl.po b/translations/desktop_files/scanservice.desktop/nl.po
new file mode 100644
index 00000000..1876914c
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/nl.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE Scannerdiensten"
diff --git a/translations/desktop_files/scanservice.desktop/nn.po b/translations/desktop_files/scanservice.desktop/nn.po
new file mode 100644
index 00000000..bce2d05d
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/nn.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE Skanningsteneste"
diff --git a/translations/desktop_files/scanservice.desktop/nso.po b/translations/desktop_files/scanservice.desktop/nso.po
new file mode 100644
index 00000000..281fb258
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/nso.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Tirelo ya Tebelelo ya TDE"
diff --git a/translations/desktop_files/scanservice.desktop/pl.po b/translations/desktop_files/scanservice.desktop/pl.po
new file mode 100644
index 00000000..26c9eb7a
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/pl.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Usługa skanowania TDE"
diff --git a/translations/desktop_files/scanservice.desktop/pt.po b/translations/desktop_files/scanservice.desktop/pt.po
new file mode 100644
index 00000000..df90f7b1
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/pt.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Serviço de 'Scanner' do TDE"
diff --git a/translations/desktop_files/scanservice.desktop/pt_BR.po b/translations/desktop_files/scanservice.desktop/pt_BR.po
new file mode 100644
index 00000000..cb205454
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/pt_BR.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Serviço de Digitalização do TDE"
diff --git a/translations/desktop_files/scanservice.desktop/ro.po b/translations/desktop_files/scanservice.desktop/ro.po
new file mode 100644
index 00000000..6acf38b3
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ro.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Serviciu de scanare TDE"
diff --git a/translations/desktop_files/scanservice.desktop/ru.po b/translations/desktop_files/scanservice.desktop/ru.po
new file mode 100644
index 00000000..685ca959
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ru.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Служба сканирования TDE"
diff --git a/translations/desktop_files/scanservice.desktop/scanservice.desktop.pot b/translations/desktop_files/scanservice.desktop/scanservice.desktop.pot
new file mode 100644
index 00000000..30cb837d
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/scanservice.desktop.pot
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr ""
diff --git a/translations/desktop_files/scanservice.desktop/se.po b/translations/desktop_files/scanservice.desktop/se.po
new file mode 100644
index 00000000..db05e7de
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/se.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skánnenbálválus"
diff --git a/translations/desktop_files/scanservice.desktop/sk.po b/translations/desktop_files/scanservice.desktop/sk.po
new file mode 100644
index 00000000..108028cd
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/sk.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skenovacia služba"
diff --git a/translations/desktop_files/scanservice.desktop/sl.po b/translations/desktop_files/scanservice.desktop/sl.po
new file mode 100644
index 00000000..95098a62
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/sl.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Storitev skeniranja za TDE"
diff --git a/translations/desktop_files/scanservice.desktop/sr.po b/translations/desktop_files/scanservice.desktop/sr.po
new file mode 100644
index 00000000..3135a98a
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/sr.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE-ов сервис за скенирање"
diff --git a/translations/desktop_files/scanservice.desktop/sr@Latn.po b/translations/desktop_files/scanservice.desktop/sr@Latn.po
new file mode 100644
index 00000000..549cf150
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/sr@Latn.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE-ov servis za skeniranje"
diff --git a/translations/desktop_files/scanservice.desktop/sv.po b/translations/desktop_files/scanservice.desktop/sv.po
new file mode 100644
index 00000000..6525f335
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/sv.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE:s bildläsartjänst"
diff --git a/translations/desktop_files/scanservice.desktop/ta.po b/translations/desktop_files/scanservice.desktop/ta.po
new file mode 100644
index 00000000..1cc250c4
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ta.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "கேடிஇ வருடு சேவை"
diff --git a/translations/desktop_files/scanservice.desktop/tg.po b/translations/desktop_files/scanservice.desktop/tg.po
new file mode 100644
index 00000000..436ec65a
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/tg.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Сканеронӣ дар TDE"
diff --git a/translations/desktop_files/scanservice.desktop/th.po b/translations/desktop_files/scanservice.desktop/th.po
new file mode 100644
index 00000000..1aca8653
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/th.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "บริการสแกนภาพ - K"
diff --git a/translations/desktop_files/scanservice.desktop/tr.po b/translations/desktop_files/scanservice.desktop/tr.po
new file mode 100644
index 00000000..c3b973ad
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/tr.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE Tarama Servisi"
diff --git a/translations/desktop_files/scanservice.desktop/uk.po b/translations/desktop_files/scanservice.desktop/uk.po
new file mode 100644
index 00000000..6115ec80
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/uk.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Служба пошуку TDE"
diff --git a/translations/desktop_files/scanservice.desktop/uz.po b/translations/desktop_files/scanservice.desktop/uz.po
new file mode 100644
index 00000000..ce2fc20a
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/uz.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE skan qilish xizmati"
diff --git a/translations/desktop_files/scanservice.desktop/uz@cyrillic.po b/translations/desktop_files/scanservice.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..3e951fc8
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/uz@cyrillic.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE скан қилиш хизмати"
diff --git a/translations/desktop_files/scanservice.desktop/ven.po b/translations/desktop_files/scanservice.desktop/ven.po
new file mode 100644
index 00000000..3ae05fc1
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/ven.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Tshishumiswa tshau naga tsha TDE"
diff --git a/translations/desktop_files/scanservice.desktop/wa.po b/translations/desktop_files/scanservice.desktop/wa.po
new file mode 100644
index 00000000..b1dd5a79
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/wa.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Siervice di scanaedje di TDE"
diff --git a/translations/desktop_files/scanservice.desktop/xh.po b/translations/desktop_files/scanservice.desktop/xh.po
new file mode 100644
index 00000000..134b5027
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/xh.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Inkonzo yemita yovavanyo ye TDE"
diff --git a/translations/desktop_files/scanservice.desktop/zh_CN.po b/translations/desktop_files/scanservice.desktop/zh_CN.po
new file mode 100644
index 00000000..119ef1b4
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/zh_CN.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE 扫描服务"
diff --git a/translations/desktop_files/scanservice.desktop/zh_HK.po b/translations/desktop_files/scanservice.desktop/zh_HK.po
new file mode 100644
index 00000000..3179e1f6
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/zh_HK.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE 掃描服務"
diff --git a/translations/desktop_files/scanservice.desktop/zh_TW.po b/translations/desktop_files/scanservice.desktop/zh_TW.po
new file mode 100644
index 00000000..97e6d499
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/zh_TW.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "TDE 掃描服務"
diff --git a/translations/desktop_files/scanservice.desktop/zu.po b/translations/desktop_files/scanservice.desktop/zu.po
new file mode 100644
index 00000000..2bcc34a4
--- /dev/null
+++ b/translations/desktop_files/scanservice.desktop/zu.po
@@ -0,0 +1,22 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 15:53+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: scanservice.desktop:3
+msgid "TDE Scan Service"
+msgstr "Umsebenzi Lokuhlola lwe-TDE"
diff --git a/translations/desktop_files/tdefile-desktops/af.po b/translations/desktop_files/tdefile-desktops/af.po
new file mode 100644
index 00000000..ddc679e5
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/af.po
@@ -0,0 +1,118 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Bmp Inligting"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "Gif Inligting"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "Xbm Inligting"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Gif Inligting"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Ico Inligting"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+#, fuzzy
+msgid "JPEG EXIF Info"
+msgstr "Gif Inligting"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+#, fuzzy
+msgid "PCX File Meta Info"
+msgstr "Tiff Lêer Meta Inligting"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Pdf Inligting"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Png Inligting"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "Png Inligting"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Postscript Inligting"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Tiff Lêer Meta Inligting"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Xbm Inligting"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Xbm Inligting"
diff --git a/translations/desktop_files/tdefile-desktops/ar.po b/translations/desktop_files/tdefile-desktops/ar.po
new file mode 100644
index 00000000..f8f4dc2a
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ar.po
@@ -0,0 +1,114 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "معلومات BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "معلومات DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "معلومات XBM"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "معلومات GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "معلومات ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "معلومات JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "معلومات ملف PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "معلومات PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "معلومات PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "معلومات PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "ملفات الــ PostScript ، PDF و DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "معلومات PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "معلومات Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "معلومات ملف TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "معلومات XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "معلومات PNM"
diff --git a/translations/desktop_files/tdefile-desktops/br.po b/translations/desktop_files/tdefile-desktops/br.po
new file mode 100644
index 00000000..38b44f0e
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/br.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Titouroù BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Titouroù DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Titouroù EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Titouroù GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Titouroù ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Titouroù EXIF JPEG"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Meta-titouroù ar restr PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Titouroù PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Titouroù PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Titouroù PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Restroù PostScript, PDF ha DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Procinfo PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Restroù kamera kriz"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Skeudenn SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Gorretaol Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Meta-titouroù ar restr TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Titouroù XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Titouroù XPM"
diff --git a/translations/desktop_files/tdefile-desktops/bs.po b/translations/desktop_files/tdefile-desktops/bs.po
new file mode 100644
index 00000000..4c744e4c
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/bs.po
@@ -0,0 +1,113 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr ""
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr ""
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr ""
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr ""
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr ""
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX meta-podaci"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr ""
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr ""
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr ""
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Postscript, PDF i DVI datoteke"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr ""
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW kamera datoteke"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI slika (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+#, fuzzy
+msgid "TIFF File Meta Info"
+msgstr "PCX meta-podaci"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr ""
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr ""
diff --git a/translations/desktop_files/tdefile-desktops/ca.po b/translations/desktop_files/tdefile-desktops/ca.po
new file mode 100644
index 00000000..f67d32cb
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ca.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informació de BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informació de superfície DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informació de DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informació EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informació de GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informació d'ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informació de JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Metainformació de fitxer PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informació de PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informació de PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informació de PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Fitxers PostScript, PDF i DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informació de PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Fitxers RAW de càmera"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imatge SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informació de Targa Truevision"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Metainformació de fitxer TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informació d'XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informació de XPM"
diff --git a/translations/desktop_files/tdefile-desktops/cs.po b/translations/desktop_files/tdefile-desktops/cs.po
new file mode 100644
index 00000000..9b77a066
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/cs.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Surface info"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Metainformace obrázku typu PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Postscriptové, PDF a DVI soubory"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW soubory"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI obrázek (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Metainformace obrázku typu TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM info"
diff --git a/translations/desktop_files/tdefile-desktops/cy.po b/translations/desktop_files/tdefile-desktops/cy.po
new file mode 100644
index 00000000..e6864d0e
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/cy.po
@@ -0,0 +1,113 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Gwybodaeth BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Gwybodaeth DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Gwybodaeth EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Gwybodaeth GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Gwybodaeth ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Gwybodaeth JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Meta-wybodaeth Ffeil PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Gybodaeth PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Gybodaeth PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Gybodaeth PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Ffeiliau PostScript, PDF a DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Gwybodaeth PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Delwedd SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Gwybodaeth Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Meta-wybodaeth Ffeil TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Gwybodaeth XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Gybodaeth PNM"
diff --git a/translations/desktop_files/tdefile-desktops/da.po b/translations/desktop_files/tdefile-desktops/da.po
new file mode 100644
index 00000000..ff4e73df
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/da.po
@@ -0,0 +1,113 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw overflade-info"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-Info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX Fil-meta-info"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNG-info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF- og DVI-filer"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW kamera-filer"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-billede (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa-info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF Fil-meta-info"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "PNG-info"
diff --git a/translations/desktop_files/tdefile-desktops/de.po b/translations/desktop_files/tdefile-desktops/de.po
new file mode 100644
index 00000000..74b70e91
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/de.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-Info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Oberflächeninfo"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-Info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-Info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-Info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-Info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-Info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX Metainformation"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-Info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-Info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-Info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- und DVI-Dateien"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-Info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW Kamera-Dateien"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-Bild (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa-Info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-Metainformation"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-Info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-Info"
diff --git a/translations/desktop_files/tdefile-desktops/el.po b/translations/desktop_files/tdefile-desktops/el.po
new file mode 100644
index 00000000..127e9bde
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/el.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Πληροφορίες BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Πληροφορίες επιφάνειας DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Πληροφορίες DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Πληροφορίες EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Πληροφορίες GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Πληροφορίες ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Πληροφορίες JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Μετα-πληροφορίες αρχείου PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Πληροφορίες PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Πληροφορίες PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Πληροφορίες PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Αρχεία PostScript, PDF και DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Πληροφορίες PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW αρχείο κάμερας"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Εικόνα SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Πληροφορίες Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Μετα-πληροφορίες αρχείου TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Πληροφορίες XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Πληροφορίες XPM"
diff --git a/translations/desktop_files/tdefile-desktops/eo.po b/translations/desktop_files/tdefile-desktops/eo.po
new file mode 100644
index 00000000..3043b319
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/eo.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-informo"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw surfac-informo"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-informo"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-informo"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-informo"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-informo"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG-EXIF-informo"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-dosiera metainformo"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-informo"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-informo"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-informo"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Postskriptaj, PDF- kaj DVI-dosieroj"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Postskriptinformo"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "TARGA-informo"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-informo"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-informo"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-informo"
diff --git a/translations/desktop_files/tdefile-desktops/es.po b/translations/desktop_files/tdefile-desktops/es.po
new file mode 100644
index 00000000..3985a1b2
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/es.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Info BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Información de la primera vista de DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Info DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Info EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Info GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Info ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Info JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Info meta de archivos PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Info PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Info PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Info PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Archivos PostScript, PDF y DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Info PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Archivos RAW de cámara"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imagen SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Info de Targa visión verdadera"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Info meta de archivos TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Info XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Información XPM"
diff --git a/translations/desktop_files/tdefile-desktops/et.po b/translations/desktop_files/tdefile-desktops/et.po
new file mode 100644
index 00000000..21dfd48a
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/et.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Surface'i info"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX faili metainfo"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- ja DVI-failid"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Toored kaamerafailid"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI pildifail (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF faili metainfo"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM info"
diff --git a/translations/desktop_files/tdefile-desktops/eu.po b/translations/desktop_files/tdefile-desktops/eu.po
new file mode 100644
index 00000000..ed42a2fc
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/eu.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr ""
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Surface informazioa"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr ""
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr ""
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr ""
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr ""
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX fitxategi meta info"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr ""
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr ""
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr ""
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF eta DVI fitxategiak"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr ""
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW kamera-fitxategiak"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI irudia RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF fitxategi meta info"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr ""
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr ""
diff --git a/translations/desktop_files/tdefile-desktops/fa.po b/translations/desktop_files/tdefile-desktops/fa.po
new file mode 100644
index 00000000..c026e691
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/fa.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "اطلاعات BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "اطلاعات سطح DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "اطلاعات DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "اطلاعات EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "اطلاعات GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "اطلاعات ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "اطلاعات JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "فرااطلاعات پروندۀ PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "اطلاعات PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "اطلاعات PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "اطلاعات PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "پرونده‌های PostScript، PDF و DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "اطلاعات PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "پرونده‌های خام دوربین"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "تصویر SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "اطلاعات Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "فرااطلاعات پروندۀ TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "اطلاعات XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "اطلاعات XPM"
diff --git a/translations/desktop_files/tdefile-desktops/fi.po b/translations/desktop_files/tdefile-desktops/fi.po
new file mode 100644
index 00000000..bffc0531
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/fi.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-tiedot"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw pintatieto"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-tiedot"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-tiedot"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-tiedot"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-tiedot"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF -tiedot"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-tiedoston metatiedot"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-tiedot"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-tiedot"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-tiedot"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- ja DVI-tiedostot"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-tiedot"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW-kuvatiedostot"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-kuva (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa -tiedot"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-metatiedot"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-tiedot"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-tiedot"
diff --git a/translations/desktop_files/tdefile-desktops/fr.po b/translations/desktop_files/tdefile-desktops/fr.po
new file mode 100644
index 00000000..d36b48e4
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/fr.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informations BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informations de surface DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informations DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informations EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informations GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informations ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informations JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Méta Informations sur les fichiers PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informations PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informations PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informations PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Fichiers PostScript, PDF et DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informations PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Fichiers RAW d'appareil photo numérique"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Image SGI (RVB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informations Truevision"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Méta Informations sur les fichiers TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informations sur XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informations XPM"
diff --git a/translations/desktop_files/tdefile-desktops/ga.po b/translations/desktop_files/tdefile-desktops/ga.po
new file mode 100644
index 00000000..7c4bf474
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ga.po
@@ -0,0 +1,119 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Eolas faoi BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Eolas faoi DirectDraw Surface"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Eolas faoi DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Eolas faoi EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Eolas faoi GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+#, fuzzy
+msgid "ICO Info"
+msgstr "Eolas faoi DVI"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+#, fuzzy
+msgid "JPEG EXIF Info"
+msgstr "Eolas faoi GIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr ""
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+#, fuzzy
+msgid "PDF Info"
+msgstr "Eolas faoi GIF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+#, fuzzy
+msgid "PNG Info"
+msgstr "Eolas faoi BMP"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "Eolas faoi BMP"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Comhaid PostScript, PDF agus DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr ""
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Comhaid Cheamara RAW"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Íomhá SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr ""
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+#, fuzzy
+msgid "XBM Info"
+msgstr "Eolas faoi BMP"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Eolas faoi BMP"
diff --git a/translations/desktop_files/tdefile-desktops/gl.po b/translations/desktop_files/tdefile-desktops/gl.po
new file mode 100644
index 00000000..a7df0989
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/gl.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Inf. BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Información de Superficie de DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Inf. DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Inf. EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Inf. Gif"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Inf. ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Inf. JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Inf. metaficheiro PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Inf. PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Inf. PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Inf. PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Ficheiros PostScript, PDF e DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Inf. PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Ficheiros RAW de Cámara"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imaxe SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Inf. Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Inf. metaficheiro TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Inf. XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Información XPM"
diff --git a/translations/desktop_files/tdefile-desktops/he.po b/translations/desktop_files/tdefile-desktops/he.po
new file mode 100644
index 00000000..6a658bd0
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/he.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "מידע BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "מיגע אודות משטח DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "מידע DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "מידע EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "מידע GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "מידע ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "מידע JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "מידע PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "מידע PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "מידע PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "מידע PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "קבצי PostScript, PDF ו־DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "מידע PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "קבצי מצלמה דיגיטלית גולמיים"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "תמונת SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "מידע Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "מידע TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "מידע XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "מידע XPM"
diff --git a/translations/desktop_files/tdefile-desktops/hi.po b/translations/desktop_files/tdefile-desktops/hi.po
new file mode 100644
index 00000000..be49b393
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/hi.po
@@ -0,0 +1,114 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP जानकारी"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI जानकारी"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "XBM जानकारी"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF जानकारी"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO जानकारी"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF जानकारी"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX फ़ाइल मेटा जानकारी"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF जानकारी"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG जानकारी"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM जानकारी"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "पोस्टस्क्रिप्ट जानकारी"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "ट्रू-विज़न टाग्रा जानकारी"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF फ़ाइल मेटा जानकारी"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM जानकारी"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "PNM जानकारी"
diff --git a/translations/desktop_files/tdefile-desktops/hr.po b/translations/desktop_files/tdefile-desktops/hr.po
new file mode 100644
index 00000000..b3e15870
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/hr.po
@@ -0,0 +1,117 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP informacije"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "GIF Informacije"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "XBM Infoformacije"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF Informacije"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO informacije"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF Informacije"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+#, fuzzy
+msgid "PCX File Meta Info"
+msgstr "TIFF meta informacije"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF Informacije"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG Informacije"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "PNG Informacije"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Postscript informacije"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI slika (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa Infomacije"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF meta informacije"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM Infoformacije"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "XBM Infoformacije"
diff --git a/translations/desktop_files/tdefile-desktops/hu.po b/translations/desktop_files/tdefile-desktops/hu.po
new file mode 100644
index 00000000..9453c600
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/hu.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-jellemzők"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw felületinformáció"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-jellemzők"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-jellemzők"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-jellemzők"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-jellemzők"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-jellemzők"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-jellemzők"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-jellemzők"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-jellemzők"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-jellemzők"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- és DVI-fájlok"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-jellemzők"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW-fájlok"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-kép (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision/Targa-jellemzők"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-metajellemzők"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-jellemzők"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-jellemzők"
diff --git a/translations/desktop_files/tdefile-desktops/is.po b/translations/desktop_files/tdefile-desktops/is.po
new file mode 100644
index 00000000..47ca7668
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/is.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP upplýsingar"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw yfirborðs upplýsingar"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI upplýsingar"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR upplýsingar"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF upplýsingar"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO upplýsingar"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF upplýsingar"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX File Meta upplýsingar"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF upplýsingar"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG upplýsingar"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM upplýsingar"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript PDF og DVI skrár"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript upplýsingar"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW myndavélaskrár"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI mynd (TGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa upplýsingar"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF File Meta upplýsingar"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM upplýsingar"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM upplýsingar"
diff --git a/translations/desktop_files/tdefile-desktops/it.po b/translations/desktop_files/tdefile-desktops/it.po
new file mode 100644
index 00000000..36ea43ed
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/it.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informazioni BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informazioni superficie DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informazioni DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informazioni EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informazioni GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informazioni ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informazioni JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Informazioni PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informazioni PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informazioni PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informazioni PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "File PostScript, PDF e DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informazioni PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "File grezzi fotocamera digitale"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Immagine SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informazioni Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Informazioni TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informazioni XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informazioni XPM"
diff --git a/translations/desktop_files/tdefile-desktops/ja.po b/translations/desktop_files/tdefile-desktops/ja.po
new file mode 100644
index 00000000..b8dbab6b
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ja.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP 情報"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DDS (DirectDraw Surface) 情報"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI 情報"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR 情報"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF 情報"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO 情報"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF 情報"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX ファイルメタ情報"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF 情報"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG 情報"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM 情報"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Postscript,PDF,DVIファイル"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript 情報"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW カメラファイル"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI 画像 (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "TGA (Truevision Targa) 情報"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF ファイルメタ情報"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM 情報"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM 情報"
diff --git a/translations/desktop_files/tdefile-desktops/kk.po b/translations/desktop_files/tdefile-desktops/kk.po
new file mode 100644
index 00000000..b8b43625
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/kk.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP мәліметі"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw бедерінің мәлметі"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI мәліметі"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR мәліметі"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF мәліметі"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO мәліметі"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF мәліметі"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX файлдың мета деректері"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF мәліметі"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG мәліметі"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM мәліметі"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF және DVI файлдары"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript мәліметі"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Камераның RAW пішімдегі файлдары"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI кескіні (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa мәліметі"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF файлдың мета деректері"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM мәліметі"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM мәліметі"
diff --git a/translations/desktop_files/tdefile-desktops/km.po b/translations/desktop_files/tdefile-desktops/km.po
new file mode 100644
index 00000000..e12b522b
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/km.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "ព័ត៌មាន BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "ព័ត៌មាន​ផ្ទៃ​ខាង​ក្រៅ​អំពី DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "ព័ត៌មាន DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "ព័ត៌មាន EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "ព័ត៌មាន GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ព័ត៌មាន ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "ព័ត៌មាន JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "ព័ត៌មាន​មេតា​របស់​ឯកសារ PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "ព័ត៌មាន PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "ព័ត៌មាន PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "ព័ត៌មាន PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "ឯកសារ PostScript, PDF និង DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "ព័ត៌មាន PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "ឯកសារ​ចេញ​ពី​ម៉ាស៊ីន​ថត​រូប"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "រូបភាព SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "ព័ត៌មាន Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "ព័ត៌មាន​មេតា​របស់​ឯកសារ TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "ព័ត៌មាន XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "ព័ត៌មាន XPM"
diff --git a/translations/desktop_files/tdefile-desktops/lt.po b/translations/desktop_files/tdefile-desktops/lt.po
new file mode 100644
index 00000000..03e06a27
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/lt.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP informacija"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Surface informacija"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI informacija"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR informacija"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF informacija"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO informacija"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF informacija"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX bylos meta informacija"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF informacija"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG informacija"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM informacija"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Postscript, PDF ir DVI bylos"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript informacija"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW fotoaparato bylos"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI paveiksliukas (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa informacija"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF bylos meta informacija"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM informacija"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM informacija"
diff --git a/translations/desktop_files/tdefile-desktops/lv.po b/translations/desktop_files/tdefile-desktops/lv.po
new file mode 100644
index 00000000..71413044
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/lv.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr ""
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr ""
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr ""
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr ""
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr ""
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr ""
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr ""
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr ""
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr ""
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Postscript Info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr ""
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr ""
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr ""
diff --git a/translations/desktop_files/tdefile-desktops/ms.po b/translations/desktop_files/tdefile-desktops/ms.po
new file mode 100644
index 00000000..204da22f
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ms.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Maklumat BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Maklumat Permukaan LukisTerus"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Maklumat DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Maklumat EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Maklumat GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Maklumat ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Maklumat JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Maklumat Meta Fail PCX "
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Maklumat PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Maklumat PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Maklumat PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF dan Fail DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Maklumat PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imej SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Maklumat Targa Truevision"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF Maklumat Meta Fail TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Maklumat XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Maklumat XPM"
diff --git a/translations/desktop_files/tdefile-desktops/nb.po b/translations/desktop_files/tdefile-desktops/nb.po
new file mode 100644
index 00000000..4c505c1f
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/nb.po
@@ -0,0 +1,120 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+#, fuzzy
+msgid "BMP Info"
+msgstr "PNM-info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Overflate info"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "PNM-info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "XPM-info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+#, fuzzy
+msgid "GIF Info"
+msgstr "PNM-info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+#, fuzzy
+msgid "ICO Info"
+msgstr "PNM-info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-filmetainfo"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+#, fuzzy
+msgid "PDF Info"
+msgstr "PNM-info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+#, fuzzy
+msgid "PNG Info"
+msgstr "PNM-info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF og DVI filer"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW-kamerafiler"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Bildeindeks"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa-info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-filmetainfo"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+#, fuzzy
+msgid "XBM Info"
+msgstr "XPM-info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-info"
diff --git a/translations/desktop_files/tdefile-desktops/nds.po b/translations/desktop_files/tdefile-desktops/nds.po
new file mode 100644
index 00000000..35d8a82d
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/nds.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-Info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "\"DirectDraw\"-Böversietinfo"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-Info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-Info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-Info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-Info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG-EXIF-Info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-Metainfo"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-Info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-Info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-Info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- un DVI-Dateien"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-Info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW-Kameradateien"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-Bild (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "\"Truevision Targa\"-Info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-Metainfo"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-Info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-Info"
diff --git a/translations/desktop_files/tdefile-desktops/ne.po b/translations/desktop_files/tdefile-desktops/ne.po
new file mode 100644
index 00000000..3dc52d6c
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ne.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP सूचना"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "प्रत्यक्ष रेखाचित्र सतह सूचना"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI सूचना"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR सूचना"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF सूचना"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO सूचना"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF सूचना"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX फाइल मेटा सूचना"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF सूचना"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG सूचना"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM सूचना"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "पोष्टस्क्रिप्ट, PDF र DVI फाइल"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "पोष्टस्क्रिप्ट सूचना"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW क्यामेरा फाइल"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI छवि (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "ट्रुभिजन टार्गा सूचना"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF फाइल मेटा सूचना"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM सूचना"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM सूचना"
diff --git a/translations/desktop_files/tdefile-desktops/nl.po b/translations/desktop_files/tdefile-desktops/nl.po
new file mode 100644
index 00000000..300b1c47
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/nl.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Surface-info"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX meta-info"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-Info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNG-info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, DVI- en PDF-bestanden"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Rauwe camerabestanden"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-afbeelding (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa-info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF File Meta-info"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-info"
diff --git a/translations/desktop_files/tdefile-desktops/nn.po b/translations/desktop_files/tdefile-desktops/nn.po
new file mode 100644
index 00000000..feab1652
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/nn.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-info"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw-overflateinfo"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-info"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-info"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-info"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-info"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-filmetainfo"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-info"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-info"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-info"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- og DVI-filer"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-info"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW-kamerafiler"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-bilete (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa-info"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-filmetainfo"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-info"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-info"
diff --git a/translations/desktop_files/tdefile-desktops/nso.po b/translations/desktop_files/tdefile-desktops/nso.po
new file mode 100644
index 00000000..83a25a0d
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/nso.po
@@ -0,0 +1,117 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Tshedimoso ya BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "Tshedimoso ya GIF"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "Tshedimoso ya XBM"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Tshedimoso ya GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Tshedimoso ya ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "TshedimoJPEG EXIF Info"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+#, fuzzy
+msgid "PCX File Meta Info"
+msgstr "Tshedimoso ya Meta wa Faele ya TIFF"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Tshedimoso ya PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Tshedimoso ya PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "Tshedimoso ya PNG"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Tshedimoso ya PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Tshedimoso ya Targa ya pono ya Nnete"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Tshedimoso ya Meta wa Faele ya TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Tshedimoso ya XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Tshedimoso ya XBM"
diff --git a/translations/desktop_files/tdefile-desktops/pa.po b/translations/desktop_files/tdefile-desktops/pa.po
new file mode 100644
index 00000000..8b297c42
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/pa.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP ਜਾਣਕਾਰੀ"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI ਜਾਣਕਾਰੀ"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR ਜਾਣਕਾਰੀ"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF ਜਾਣਕਾਰੀ"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO ਜਾਣਕਾਰੀ"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF ਜਾਣਕਾਰੀ"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr ""
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF ਜਾਣਕਾਰੀ"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG ਜਾਣਕਾਰੀ"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM ਜਾਣਕਾਰੀ"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript ਜਾਣਕਾਰੀ"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW ਕੈਮਰਾ ਫਾਇਲਾਂ"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr ""
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM ਜਾਣਕਾਰੀ"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM ਜਾਣਕਾਰੀ"
diff --git a/translations/desktop_files/tdefile-desktops/pl.po b/translations/desktop_files/tdefile-desktops/pl.po
new file mode 100644
index 00000000..e64443a9
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/pl.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informacja o pliku BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informacja o powierzchni DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informacja o pliku DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informacja EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informacja o pliku GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informacja o pliku ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informacja o pliku JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Informacja o pliku PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informacja o pliku PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informacja o pliku PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informacja o pliku PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Pliki PostScript, PDF i DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informacja o pliku PostScriptu"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Pliki RAW z aparatów cyfrowych"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Obrazek SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informacja o pliku Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Informacja o pliku TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informacja o pliku XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informacja o pliku XPM"
diff --git a/translations/desktop_files/tdefile-desktops/pt.po b/translations/desktop_files/tdefile-desktops/pt.po
new file mode 100644
index 00000000..cc725234
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/pt.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informação do BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informação de Superfície DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informação do DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informação do EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informação do GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informação do ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informação do JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Meta-Informação do Ficheiro PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informação do PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informação do PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informação do PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Ficheiros PostScript, PDF e DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informação do PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Ficheiros de Máquina Fotográfica Digital RAW"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imagem SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informação do Targa da Truevision"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Meta-Informação do Ficheiro TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informação do XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informação do XPM"
diff --git a/translations/desktop_files/tdefile-desktops/pt_BR.po b/translations/desktop_files/tdefile-desktops/pt_BR.po
new file mode 100644
index 00000000..d09ff2b7
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/pt_BR.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informação sobre BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informações Sobre Superfícies Direct Draw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informação sobre DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informação sobre EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informação sobre GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informação sobre ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informação sobre JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Informação sobre Meta Arquivo PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informação sobre PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informação sobre PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informação sobre PNG"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Arquivos PostScript, PDF e DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informação sobre PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Arquivos de Câmeras"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imagem SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informação sobre Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Informação sobre Meta Arquivo TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informação sobre XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informações Sobre XPM"
diff --git a/translations/desktop_files/tdefile-desktops/ro.po b/translations/desktop_files/tdefile-desktops/ro.po
new file mode 100644
index 00000000..a298aab3
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ro.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informaţii BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informaţii Suprafaţă DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informaţii DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Informaţii EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informaţii GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informaţii ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informaţii EXIF JPEG"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Metainformaţii PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informaţii PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informaţii PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informaţii PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Fişiere PostScript, PDF şi DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informaţii PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Fişiere foto brute"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Imagine SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informaţii Targa Truevision"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Metainformaţii TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informaţii XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Informaţii XPM"
diff --git a/translations/desktop_files/tdefile-desktops/ru.po b/translations/desktop_files/tdefile-desktops/ru.po
new file mode 100644
index 00000000..df7feb80
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ru.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Информация о BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Сведения о поверхности DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Информация о DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Информация о EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Информация о GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Информация об ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Информация о JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Информация о метафайле PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Информация о PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Информация о PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Информация о PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Файлы PostScript, PDF и DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Информация о PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Необработанные Файлы с цифровой камеры (RAW)"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Изображение SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Информация о Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Информация о метафайле TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Информация о XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Информация о XPM"
diff --git a/translations/desktop_files/tdefile-desktops/rw.po b/translations/desktop_files/tdefile-desktops/rw.po
new file mode 100644
index 00000000..87bbe817
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/rw.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: rw\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr ""
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr ""
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr ""
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr ""
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr ""
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr ""
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr ""
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr ""
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr ""
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr ""
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI Ishusho (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr ""
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr ""
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr ""
diff --git a/translations/desktop_files/tdefile-desktops/se.po b/translations/desktop_files/tdefile-desktops/se.po
new file mode 100644
index 00000000..2082b8ef
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/se.po
@@ -0,0 +1,113 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-dieđut"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-dieđut"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-dieđut"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF-dieđut"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO-dieđut"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-dieđut"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-filla metadieđut"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-dieđut"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-dieđut"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-dieđut"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript-, PDF- ja DVI-fiillat"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript-dieđut"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-govva (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa-dieđut"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-filla metadieđut"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-dieđut"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "PNM-dieđut"
diff --git a/translations/desktop_files/tdefile-desktops/sk.po b/translations/desktop_files/tdefile-desktops/sk.po
new file mode 100644
index 00000000..30ce588f
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/sk.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr ""
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw informácie o povrchu"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr ""
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr ""
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr ""
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr ""
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Meta-info o súbore PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr ""
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr ""
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr ""
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF a DVI súbory"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr ""
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW súbory digitálneho fotoaparátu"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI obrázok (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Meta-info o súbore TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr ""
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr ""
diff --git a/translations/desktop_files/tdefile-desktops/sl.po b/translations/desktop_files/tdefile-desktops/sl.po
new file mode 100644
index 00000000..a4524bab
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/sl.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Podatki o BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Podatki o površini DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Podatki o DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Podatki o EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Podatki o GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Podatki o ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Podatki o JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Meta podatki o PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Podatki o PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Podatki o PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Podatki o PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Datoteke PostScript, PDF in DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Podatki o PostScriptu"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Surove datoteke s fotoaparata"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Slika SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Podatki o Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Meta podatki o TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Podatki o XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Podatki o XPM"
diff --git a/translations/desktop_files/tdefile-desktops/sr.po b/translations/desktop_files/tdefile-desktops/sr.po
new file mode 100644
index 00000000..60364649
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/sr.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP информације"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Информације о DirectDraw површини"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI информације"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR информације"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF информације"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO информације"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF информације"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Мета информације PCX фајла"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF информације"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG информације"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM информације"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF и DVI фајлови"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript информације"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW фајлови слика"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI слика (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa информације"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Мета информације TIFF фајла"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM информације"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM информације"
diff --git a/translations/desktop_files/tdefile-desktops/sr@Latn.po b/translations/desktop_files/tdefile-desktops/sr@Latn.po
new file mode 100644
index 00000000..331b1d58
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/sr@Latn.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP informacije"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Informacije o DirectDraw površini"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI informacije"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR informacije"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF informacije"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO informacije"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF informacije"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Meta informacije PCX fajla"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF informacije"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG informacije"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM informacije"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF i DVI fajlovi"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript informacije"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW fajlovi slika"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI slika (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa informacije"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Meta informacije TIFF fajla"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM informacije"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM informacije"
diff --git a/translations/desktop_files/tdefile-desktops/sv.po b/translations/desktop_files/tdefile-desktops/sv.po
new file mode 100644
index 00000000..e60e0cdc
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/sv.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP-information"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Directdraw ytinformation"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI-information"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR-information"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Gif-information"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Ico-information"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF-information"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Metainformation om PCX-fil"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF-information"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG-information"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM-information"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Postscript, PDF och DVI-filer"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Postscript-information"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Obehandlade kamerafiler"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-bild (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Information om Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Metainformation om TIFF-fil"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM-information"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM-information"
diff --git a/translations/desktop_files/tdefile-desktops/ta.po b/translations/desktop_files/tdefile-desktops/ta.po
new file mode 100644
index 00000000..629ceeb7
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ta.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP தகவல்"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "நேரடி மேற்பரப்பு தகவல்"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI தகவல்"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR தகவல்"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF தகவல்"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO தகவல்"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF தகவல்"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX File Meta தகவல்"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF தகவல்"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG தகவல்"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM தகவல்"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "போஸ்ட்கிரிப்ட், பிடிஃப் மற்றும் டிவிஐ கோப்புகள்"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "முன் எழுத்தாக்க தகவல்"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "எஸ்ஜிஐ படிமம் (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "சரியான பார்வை தார்கா தகவல்"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF மீக்கோப்பு தகவல்"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM தகவல்"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM தகவல்"
diff --git a/translations/desktop_files/tdefile-desktops/tdefile-desktops.pot b/translations/desktop_files/tdefile-desktops/tdefile-desktops.pot
new file mode 100644
index 00000000..039424d9
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/tdefile-desktops.pot
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr ""
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr ""
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr ""
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr ""
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr ""
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr ""
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr ""
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr ""
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr ""
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr ""
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr ""
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr ""
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr ""
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr ""
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr ""
diff --git a/translations/desktop_files/tdefile-desktops/tg.po b/translations/desktop_files/tdefile-desktops/tg.po
new file mode 100644
index 00000000..9ef1aeeb
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/tg.po
@@ -0,0 +1,113 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Иттилоот оиди BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Иттилоот оиди DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Иттилоот оиди EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Иттилоот оиди GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Иттилоот оиди ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Иттилоот оиди JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Иттилоот оиди метафайли PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Иттилоот оиди PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Иттилоот оиди PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Иттилоот оиди PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Файлҳои PostScript, PDF ва DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Иттилоот оиди PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Тасвироти SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Иттилоот оиди Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Иттилоот оиди метафайли TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Иттилоот оиди XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Иттилоот оиди PNM"
diff --git a/translations/desktop_files/tdefile-desktops/th.po b/translations/desktop_files/tdefile-desktops/th.po
new file mode 100644
index 00000000..780d098a
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/th.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "ข้อมูลแฟ้ม BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "ข้อมูลแฟ้มพื้นผิว DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "ข้อมูลแฟ้ม DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "ข้อมูลแฟ้ม EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "ข้อมูลแฟ้ม GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ข้อมูลแฟ้ม ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "ข้อมูลแฟ้ม JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "ข้อมูลเมตาแฟ้ม PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "ข้อมูลแฟ้ม PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "ข้อมูลแฟ้ม PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "ข้อมูลแฟ้ม PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "แฟ้ม PDF, DVI และ โพสต์สคริปต์"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "ข้อมูลโพสต์สคริปต์"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "แฟ้มภาพ RAW จากกล้อง"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "ภาพ SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "ข้อมูลแฟ้ม Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "ข้อมูลเมตาแฟ้ม TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "ข้อมูลแฟ้ม XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "ข้อมูลแฟ้ม XPM"
diff --git a/translations/desktop_files/tdefile-desktops/tr.po b/translations/desktop_files/tdefile-desktops/tr.po
new file mode 100644
index 00000000..98a9f960
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/tr.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP Bilgisi"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Yüzey Bilgisi"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI Bilgisi"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR Bilgisi"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF Bilgisi"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO Bilgisi"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF Bilgisi"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX Dosya Bilgisi"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF Bilgisi"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG Bilgisi"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM Bilgisi"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF ve DVI Dosyaları"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript Bilgisi"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW Kamera Dosyaları"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI Resmi(KYM)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa Bilgisi"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF Dosya Bilgisi"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM Bilgisi"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM Bilgisi"
diff --git a/translations/desktop_files/tdefile-desktops/uk.po b/translations/desktop_files/tdefile-desktops/uk.po
new file mode 100644
index 00000000..23f8b16e
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/uk.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Інформація по BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "Інформація про поверхню DirectDraw"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Інформація по DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "Інформація по EXR"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Інформація по GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Інформація по ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Інформація про JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Метаінформація про файл PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Інформація про PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Інформація про PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Інформація про PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "Файли PostScript, PDF та DVI"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Інформація про PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "Файли цифрової камери RAW"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "Зображення SGI (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Інформація по Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Метаінформація про файл TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Інформація по XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "Інформація про XPM"
diff --git a/translations/desktop_files/tdefile-desktops/uz.po b/translations/desktop_files/tdefile-desktops/uz.po
new file mode 100644
index 00000000..4040ca4b
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/uz.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP haqida maʼlumot"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI haqida maʼlumot"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR haqida maʼlumot"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF haqida maʼlumot"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO haqida maʼlumot"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF haqida maʼlumot"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-faylining meta-maʼlumoti"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF haqida maʼlumot"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG haqida maʼlumot"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM haqida maʼlumot"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF va DVI fayllari"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript haqida maʼlumot"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-rasm (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "TGA haqida maʼlumot"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-faylining meta-maʼlumoti"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM haqida maʼlumot"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM haqida maʼlumot"
diff --git a/translations/desktop_files/tdefile-desktops/uz@cyrillic.po b/translations/desktop_files/tdefile-desktops/uz@cyrillic.po
new file mode 100644
index 00000000..02afc634
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/uz@cyrillic.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP ҳақида маълумот"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI ҳақида маълумот"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR ҳақида маълумот"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF ҳақида маълумот"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO ҳақида маълумот"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF ҳақида маълумот"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX-файлининг мета-маълумоти"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF ҳақида маълумот"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG ҳақида маълумот"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM ҳақида маълумот"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript, PDF ва DVI файллари"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript ҳақида маълумот"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI-расм (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "TGA ҳақида маълумот"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF-файлининг мета-маълумоти"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM ҳақида маълумот"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM ҳақида маълумот"
diff --git a/translations/desktop_files/tdefile-desktops/ven.po b/translations/desktop_files/tdefile-desktops/ven.po
new file mode 100644
index 00000000..c8729b44
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/ven.po
@@ -0,0 +1,117 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Mafhungo BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "Mafhungo a GIF"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "Mafhungo a XBM"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Mafhungo a GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Mafhungo a ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Mafhungo a JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+#, fuzzy
+msgid "PCX File Meta Info"
+msgstr "Mafhungo a Meta faela ya TIFF"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Mafhungo a PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Mafhungo a PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "Mafhungo a PNG"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Mafhungo a mabammbiri a poso"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Mafhungo a Targa ya mbonalelo ya vhukuma"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Mafhungo a Meta faela ya TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Mafhungo a XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Mafhungo a XBM"
diff --git a/translations/desktop_files/tdefile-desktops/wa.po b/translations/desktop_files/tdefile-desktops/wa.po
new file mode 100644
index 00000000..a83b307c
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/wa.po
@@ -0,0 +1,114 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Informåcion sol imådje BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "Informåcion sol documint DVI"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "Informåcion sol imådje XBM"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Informåcion sol imådje GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Informåcion sol imådjete ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Informåcion sol imådje JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "Informåcion sol imådje PCX"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Informåcion sol documint PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Informåcion sol imådje PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "Informåcion sol imådje PNM"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Informåcion sol documint PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Informåcion sol imådje Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Informåcion sol imådje TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Informåcion sol imådje XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Informåcion sol imådje PNM"
diff --git a/translations/desktop_files/tdefile-desktops/xh.po b/translations/desktop_files/tdefile-desktops/xh.po
new file mode 100644
index 00000000..1adccb09
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/xh.po
@@ -0,0 +1,117 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Ulwazi lwe BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "Ulwazi lwe GIF"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "Ulwazi lwe XBM"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Ulwazi lwe GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Ulwazi lwe ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Ulwazi lwe JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+#, fuzzy
+msgid "PCX File Meta Info"
+msgstr "Ulwazi lwe TIFF Ifayile Esembindini"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF Ulwazi"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG Ulwazi"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "PNG Ulwazi"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Ulwazi Lwe PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Ulwazi lwe Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Ulwazi lwe TIFF Ifayile Esembindini"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Ulwazi lwe XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Ulwazi lwe XBM"
diff --git a/translations/desktop_files/tdefile-desktops/zh_CN.po b/translations/desktop_files/tdefile-desktops/zh_CN.po
new file mode 100644
index 00000000..8f44707e
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/zh_CN.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP 信息"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw 表面信息"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI 信息"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR 信息"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF 信息"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO 信息"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF 信息"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX 文件元信息"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF 信息"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG 信息"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM 信息"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript、PDF 和 DVI 文件"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript 信息"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW 相机文件"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI 图像(RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa 信息"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF 文件元信息"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM 信息"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM 信息"
diff --git a/translations/desktop_files/tdefile-desktops/zh_HK.po b/translations/desktop_files/tdefile-desktops/zh_HK.po
new file mode 100644
index 00000000..9fc17f7f
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/zh_HK.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP 資訊"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw 表面資訊"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI 資訊"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR 資訊"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF 資訊"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO 資訊"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF 資訊"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX 檔案 Meta 資訊"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF 資訊"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG 資訊"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM 資訊"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript 、PDF 及 DVI 檔案"
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript 資訊"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "RAW 相機檔案"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI 圖像 (RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa 資訊"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF 檔案 Meta 資訊"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM 資訊"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM 資訊"
diff --git a/translations/desktop_files/tdefile-desktops/zh_TW.po b/translations/desktop_files/tdefile-desktops/zh_TW.po
new file mode 100644
index 00000000..a5657fe3
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/zh_TW.po
@@ -0,0 +1,112 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "BMP 資訊"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr "DirectDraw Surface 資訊"
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+msgid "DVI Info"
+msgstr "DVI 資訊"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+msgid "EXR Info"
+msgstr "EXR 資訊"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "GIF 資訊"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "ICO 資訊"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "JPEG EXIF 資訊"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+msgid "PCX File Meta Info"
+msgstr "PCX 檔案 Meta 資訊"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "PDF 資訊"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "PNG 資訊"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+msgid "PNM Info"
+msgstr "PNM 資訊"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr "PostScript,PDF 與 DVI 檔 "
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "PostScript 資訊"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr "原始相機檔"
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr "SGI 影像(RGB)"
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Truevision Targa 資訊"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "TIFF 檔案 Meta 資訊"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "XBM 資訊"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+msgid "XPM Info"
+msgstr "XPM 資訊"
diff --git a/translations/desktop_files/tdefile-desktops/zu.po b/translations/desktop_files/tdefile-desktops/zu.po
new file mode 100644
index 00000000..36110996
--- /dev/null
+++ b/translations/desktop_files/tdefile-desktops/zu.po
@@ -0,0 +1,117 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:47+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Name
+#: bmp/tdefile_bmp.desktop:3
+msgid "BMP Info"
+msgstr "Ulwazi lwe-BMP"
+
+#. Name
+#: dds/tdefile_dds.desktop:3
+msgid "DirectDraw Surface Info"
+msgstr ""
+
+#. Name
+#: dvi/tdefile_dvi.desktop:4
+#, fuzzy
+msgid "DVI Info"
+msgstr "Ulwazi lwe-GIF"
+
+#. Name
+#: exr/tdefile_exr.desktop:3
+#, fuzzy
+msgid "EXR Info"
+msgstr "Ulwazi lwe-XBM"
+
+#. Name
+#: gif/tdefile_gif.desktop:3
+msgid "GIF Info"
+msgstr "Ulwazi lwe-GIF"
+
+#. Name
+#: ico/tdefile_ico.desktop:3
+msgid "ICO Info"
+msgstr "Ulwazi lwe-ICO"
+
+#. Name
+#: jpeg/tdefile_jpeg.desktop:3
+msgid "JPEG EXIF Info"
+msgstr "Ulwazi lwe-JPEG EXIF"
+
+#. Name
+#: pcx/tdefile_pcx.desktop:3
+#, fuzzy
+msgid "PCX File Meta Info"
+msgstr "Ulwazi Lwefayela yemeta ye-TIFF"
+
+#. Name
+#: pdf/tdefile_pdf.desktop:3
+msgid "PDF Info"
+msgstr "Ulwazi lwe-PDF"
+
+#. Name
+#: png/tdefile_png.desktop:3
+msgid "PNG Info"
+msgstr "Ulwazi lwe-PNG"
+
+#. Name
+#: pnm/tdefile_pnm.desktop:3
+#, fuzzy
+msgid "PNM Info"
+msgstr "Ulwazi lwe-PNG"
+
+#. Name
+#: ps/gsthumbnail.desktop:3
+msgid "PostScript, PDF and DVI Files"
+msgstr ""
+
+#. Name
+#: ps/tdefile_ps.desktop:3
+msgid "PostScript Info"
+msgstr "Ulwazi Lwesi-PostScript"
+
+#. Name
+#: raw/tdefile_raw.desktop:3
+msgid "RAW Camera Files"
+msgstr ""
+
+#. Name
+#: rgb/tdefile_rgb.desktop:3
+msgid "SGI Image (RGB)"
+msgstr ""
+
+#. Name
+#: tga/tdefile_tga.desktop:3
+msgid "Truevision Targa Info"
+msgstr "Ulwazi lwe-Truevision Targa"
+
+#. Name
+#: tiff/tdefile_tiff.desktop:3
+msgid "TIFF File Meta Info"
+msgstr "Ulwazi Lwefayela yemeta ye-TIFF"
+
+#. Name
+#: xbm/tdefile_xbm.desktop:3
+msgid "XBM Info"
+msgstr "Ulwazi lwe-XBM"
+
+#. Name
+#: xpm/tdefile_xpm.desktop:3
+#, fuzzy
+msgid "XPM Info"
+msgstr "Ulwazi lwe-XBM"
diff --git a/translations/desktop_files/tdeiconedit.desktop/af.po b/translations/desktop_files/tdeiconedit.desktop/af.po
new file mode 100644
index 00000000..fbeb7069
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/af.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikoon Redigeerder"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "TDE-ikoon-redigeer"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ar.po b/translations/desktop_files/tdeiconedit.desktop/ar.po
new file mode 100644
index 00000000..c14f1cc3
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ar.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "محرر الإيقونات"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "برنامج TDEIconEdit"
diff --git a/translations/desktop_files/tdeiconedit.desktop/bg.po b/translations/desktop_files/tdeiconedit.desktop/bg.po
new file mode 100644
index 00000000..861d479c
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/bg.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Редактор на икони"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Редактор на икони"
diff --git a/translations/desktop_files/tdeiconedit.desktop/br.po b/translations/desktop_files/tdeiconedit.desktop/br.po
new file mode 100644
index 00000000..b6ad7f0b
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/br.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: br\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Aozer arlunioù"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Aozer arlunioù"
diff --git a/translations/desktop_files/tdeiconedit.desktop/bs.po b/translations/desktop_files/tdeiconedit.desktop/bs.po
new file mode 100644
index 00000000..ae49728c
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/bs.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor ikona"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor ikona"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ca.po b/translations/desktop_files/tdeiconedit.desktop/ca.po
new file mode 100644
index 00000000..bb412758
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ca.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor d'icones"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor d'icones"
diff --git a/translations/desktop_files/tdeiconedit.desktop/cs.po b/translations/desktop_files/tdeiconedit.desktop/cs.po
new file mode 100644
index 00000000..2a6337a2
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/cs.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor ikon"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor ikon"
diff --git a/translations/desktop_files/tdeiconedit.desktop/cy.po b/translations/desktop_files/tdeiconedit.desktop/cy.po
new file mode 100644
index 00000000..34052778
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/cy.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: cy\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Golygydd Eiconau"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "KGolyguEicon"
diff --git a/translations/desktop_files/tdeiconedit.desktop/da.po b/translations/desktop_files/tdeiconedit.desktop/da.po
new file mode 100644
index 00000000..6e099c3c
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/da.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikoneditor"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ikoneditor"
diff --git a/translations/desktop_files/tdeiconedit.desktop/de.po b/translations/desktop_files/tdeiconedit.desktop/de.po
new file mode 100644
index 00000000..8d58bbfb
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/de.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor für Arbeitsflächensymbole"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor für Arbeitsflächensymbole"
diff --git a/translations/desktop_files/tdeiconedit.desktop/el.po b/translations/desktop_files/tdeiconedit.desktop/el.po
new file mode 100644
index 00000000..a61f3a91
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/el.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Επεξεργαστής εικονιδίων"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Επεξεργαστής εικονιδίων"
diff --git a/translations/desktop_files/tdeiconedit.desktop/eo.po b/translations/desktop_files/tdeiconedit.desktop/eo.po
new file mode 100644
index 00000000..7cf6a6d4
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/eo.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ilo por pentri kaj redakti piktogramojn"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "Piktogramredaktilo"
diff --git a/translations/desktop_files/tdeiconedit.desktop/es.po b/translations/desktop_files/tdeiconedit.desktop/es.po
new file mode 100644
index 00000000..b1f06be8
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/es.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor de iconos"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor de iconos"
diff --git a/translations/desktop_files/tdeiconedit.desktop/et.po b/translations/desktop_files/tdeiconedit.desktop/et.po
new file mode 100644
index 00000000..eb2816c2
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/et.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikoonide redaktor"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ikoonide redaktor"
diff --git a/translations/desktop_files/tdeiconedit.desktop/eu.po b/translations/desktop_files/tdeiconedit.desktop/eu.po
new file mode 100644
index 00000000..5f238c62
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/eu.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikono editorea"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ikono editorea"
diff --git a/translations/desktop_files/tdeiconedit.desktop/fa.po b/translations/desktop_files/tdeiconedit.desktop/fa.po
new file mode 100644
index 00000000..6e1b5ecb
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/fa.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "ویرایشگر شمایل"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "ویرایشگر شمایل"
diff --git a/translations/desktop_files/tdeiconedit.desktop/fi.po b/translations/desktop_files/tdeiconedit.desktop/fi.po
new file mode 100644
index 00000000..d93e44f2
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/fi.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Kuvakemuokkain"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Kuvakemuokkain"
diff --git a/translations/desktop_files/tdeiconedit.desktop/fr.po b/translations/desktop_files/tdeiconedit.desktop/fr.po
new file mode 100644
index 00000000..e32a8b4e
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/fr.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Éditeur d'icônes"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Éditeur d'icônes"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ga.po b/translations/desktop_files/tdeiconedit.desktop/ga.po
new file mode 100644
index 00000000..5395a152
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ga.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Eagarthóir Deilbhíní"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Eagarthóir Deilbhíní"
diff --git a/translations/desktop_files/tdeiconedit.desktop/gl.po b/translations/desktop_files/tdeiconedit.desktop/gl.po
new file mode 100644
index 00000000..f38df413
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/gl.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor de iconas"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor de iconas"
diff --git a/translations/desktop_files/tdeiconedit.desktop/he.po b/translations/desktop_files/tdeiconedit.desktop/he.po
new file mode 100644
index 00000000..452e3f68
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/he.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "עורך סמלים"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "עורך סמלים"
diff --git a/translations/desktop_files/tdeiconedit.desktop/hi.po b/translations/desktop_files/tdeiconedit.desktop/hi.po
new file mode 100644
index 00000000..a82e66e2
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/hi.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "प्रतीक (आइकॉन) संपादक"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "के-आइकॉन-एडिट"
diff --git a/translations/desktop_files/tdeiconedit.desktop/hr.po b/translations/desktop_files/tdeiconedit.desktop/hr.po
new file mode 100644
index 00000000..e56a732f
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/hr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Uređivač ikona"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "Uređivač ikona"
diff --git a/translations/desktop_files/tdeiconedit.desktop/hu.po b/translations/desktop_files/tdeiconedit.desktop/hu.po
new file mode 100644
index 00000000..f5fec353
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/hu.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikonszerkesztő"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ikonszerkesztő"
diff --git a/translations/desktop_files/tdeiconedit.desktop/is.po b/translations/desktop_files/tdeiconedit.desktop/is.po
new file mode 100644
index 00000000..63dcea08
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/is.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: is\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Táknmyndaritill"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "Táknmyndaritill"
diff --git a/translations/desktop_files/tdeiconedit.desktop/it.po b/translations/desktop_files/tdeiconedit.desktop/it.po
new file mode 100644
index 00000000..f769a098
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/it.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Michele Calgaro <michele.calgaro@yahoo.it>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: 2021-05-28 07:07+0000\n"
+"Last-Translator: Michele Calgaro <michele.calgaro@yahoo.it>\n"
+"Language-Team: Italian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/tdeiconedit-tdeiconeditdesktop/it/>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.6.2\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor di icone"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "TDEIconEdit"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ja.po b/translations/desktop_files/tdeiconedit.desktop/ja.po
new file mode 100644
index 00000000..e1b925ae
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ja.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "アイコンエディタ"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "アイコンエディタ"
diff --git a/translations/desktop_files/tdeiconedit.desktop/kk.po b/translations/desktop_files/tdeiconedit.desktop/kk.po
new file mode 100644
index 00000000..2a003909
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/kk.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: kk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Таңбаша өңдегіші"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Таңбаша өңдегіші"
diff --git a/translations/desktop_files/tdeiconedit.desktop/km.po b/translations/desktop_files/tdeiconedit.desktop/km.po
new file mode 100644
index 00000000..7778ccd8
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/km.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: km\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "កម្មវិធី​និពន្ធ​រូបតំណាង"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "កម្មវិធី​និពន្ធ​រូបតំណាង"
diff --git a/translations/desktop_files/tdeiconedit.desktop/lt.po b/translations/desktop_files/tdeiconedit.desktop/lt.po
new file mode 100644
index 00000000..858087aa
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/lt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ženkliukų redaktorius"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ženkliukų redaktorius"
diff --git a/translations/desktop_files/tdeiconedit.desktop/lv.po b/translations/desktop_files/tdeiconedit.desktop/lv.po
new file mode 100644
index 00000000..39af61a5
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/lv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikonu Redaktors"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "KIkonuRedaktors"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ms.po b/translations/desktop_files/tdeiconedit.desktop/ms.po
new file mode 100644
index 00000000..86a2187b
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ms.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ms\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor Ikon"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "KIkonEdit"
diff --git a/translations/desktop_files/tdeiconedit.desktop/nb.po b/translations/desktop_files/tdeiconedit.desktop/nb.po
new file mode 100644
index 00000000..1421587a
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/nb.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nb\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikonredigerer"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ikonredigerer"
diff --git a/translations/desktop_files/tdeiconedit.desktop/nds.po b/translations/desktop_files/tdeiconedit.desktop/nds.po
new file mode 100644
index 00000000..a8dd7f18
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/nds.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nds\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Lüttbildeditor"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Lüttbildeditor"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ne.po b/translations/desktop_files/tdeiconedit.desktop/ne.po
new file mode 100644
index 00000000..645c0d0f
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ne.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ne\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "प्रतिमा सम्पादक"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "केडीई प्रतिमा सम्पादन"
diff --git a/translations/desktop_files/tdeiconedit.desktop/nl.po b/translations/desktop_files/tdeiconedit.desktop/nl.po
new file mode 100644
index 00000000..6b8f63f7
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/nl.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Pictogrambewerker"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Pictogrambewerker"
diff --git a/translations/desktop_files/tdeiconedit.desktop/nn.po b/translations/desktop_files/tdeiconedit.desktop/nn.po
new file mode 100644
index 00000000..edd6625a
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/nn.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikonredigering"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Ikonredigering"
diff --git a/translations/desktop_files/tdeiconedit.desktop/nso.po b/translations/desktop_files/tdeiconedit.desktop/nso.po
new file mode 100644
index 00000000..5178bc36
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/nso.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: nso\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Mofetosi wa Seemedi"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Mofetosi wa Seemedi"
diff --git a/translations/desktop_files/tdeiconedit.desktop/pa.po b/translations/desktop_files/tdeiconedit.desktop/pa.po
new file mode 100644
index 00000000..5f9b2c2c
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/pa.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "ਆਈਕਾਨ ਸੰਪਾਦਕ"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "ਆਈਕਾਨ ਸੰਪਾਦਕ"
diff --git a/translations/desktop_files/tdeiconedit.desktop/pl.po b/translations/desktop_files/tdeiconedit.desktop/pl.po
new file mode 100644
index 00000000..fb9bddaf
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/pl.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Edytor ikon"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "Edytor ikon"
diff --git a/translations/desktop_files/tdeiconedit.desktop/pt.po b/translations/desktop_files/tdeiconedit.desktop/pt.po
new file mode 100644
index 00000000..9be428ee
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/pt.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Hugo Carvalho <hugokarvalho@hotmail.com>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: 2021-12-02 19:03+0000\n"
+"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\n"
+"Language-Team: Portuguese <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/tdeiconedit-tdeiconeditdesktop/pt/>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.9.1\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor de Ícones"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "TDEIconEdit"
diff --git a/translations/desktop_files/tdeiconedit.desktop/pt_BR.po b/translations/desktop_files/tdeiconedit.desktop/pt_BR.po
new file mode 100644
index 00000000..fcf1fecf
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/pt_BR.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor de Ícones"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "KEditor de Ícones"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ro.po b/translations/desktop_files/tdeiconedit.desktop/ro.po
new file mode 100644
index 00000000..c61f70d2
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ro.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor de iconiţe"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "Editor iconiţe"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ru.po b/translations/desktop_files/tdeiconedit.desktop/ru.po
new file mode 100644
index 00000000..8726db57
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ru.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Редактор пиктограмм"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Редактор пиктограмм"
diff --git a/translations/desktop_files/tdeiconedit.desktop/se.po b/translations/desktop_files/tdeiconedit.desktop/se.po
new file mode 100644
index 00000000..26ec5a5d
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/se.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: se\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Govašdoaimmaheaddji"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Govašdoaimmaheaddji"
diff --git a/translations/desktop_files/tdeiconedit.desktop/sk.po b/translations/desktop_files/tdeiconedit.desktop/sk.po
new file mode 100644
index 00000000..2c441a31
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/sk.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Editor ikon"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Editor ikon"
diff --git a/translations/desktop_files/tdeiconedit.desktop/sl.po b/translations/desktop_files/tdeiconedit.desktop/sl.po
new file mode 100644
index 00000000..69a0fd67
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/sl.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Urejevalnik ikon"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Urejevalnik ikon"
diff --git a/translations/desktop_files/tdeiconedit.desktop/sr.po b/translations/desktop_files/tdeiconedit.desktop/sr.po
new file mode 100644
index 00000000..4de18b10
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/sr.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Уређивач икона"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Уређивач икона"
diff --git a/translations/desktop_files/tdeiconedit.desktop/sr@Latn.po b/translations/desktop_files/tdeiconedit.desktop/sr@Latn.po
new file mode 100644
index 00000000..264ede82
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/sr@Latn.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sr@Latn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Uređivač ikona"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Uređivač ikona"
diff --git a/translations/desktop_files/tdeiconedit.desktop/sv.po b/translations/desktop_files/tdeiconedit.desktop/sv.po
new file mode 100644
index 00000000..01d053db
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/sv.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Ikoneditor"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "TDEiconedit"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ta.po b/translations/desktop_files/tdeiconedit.desktop/ta.po
new file mode 100644
index 00000000..63874dbc
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ta.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ta\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "கேசின்னம் திருத்தி"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "கேசின்னம் திருத்து"
diff --git a/translations/desktop_files/tdeiconedit.desktop/tdeiconedit.desktop.pot b/translations/desktop_files/tdeiconedit.desktop/tdeiconedit.desktop.pot
new file mode 100644
index 00000000..62f83e34
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/tdeiconedit.desktop.pot
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr ""
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr ""
diff --git a/translations/desktop_files/tdeiconedit.desktop/tg.po b/translations/desktop_files/tdeiconedit.desktop/tg.po
new file mode 100644
index 00000000..9a19fc57
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/tg.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Муҳаррири ишорот"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Муҳаррири ишорот"
diff --git a/translations/desktop_files/tdeiconedit.desktop/th.po b/translations/desktop_files/tdeiconedit.desktop/th.po
new file mode 100644
index 00000000..c6593668
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/th.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "เครื่องมือแก้ไขไอคอน"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "เครื่องมือแก้ไขไอคอน"
diff --git a/translations/desktop_files/tdeiconedit.desktop/tr.po b/translations/desktop_files/tdeiconedit.desktop/tr.po
new file mode 100644
index 00000000..10802de5
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/tr.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Simge Düzenleyici"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "K Icon Düzenleyici"
diff --git a/translations/desktop_files/tdeiconedit.desktop/uk.po b/translations/desktop_files/tdeiconedit.desktop/uk.po
new file mode 100644
index 00000000..c4553a8a
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/uk.po
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# Roman Savochenko <roman@oscada.org>, 2020.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: 2020-09-01 05:31+0000\n"
+"Last-Translator: Roman Savochenko <roman@oscada.org>\n"
+"Language-Team: Ukrainian <https://mirror.git.trinitydesktop.org/weblate/"
+"projects/tdegraphics/tdeiconedit-tdeiconeditdesktop/uk/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 4.1.1\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Редактор піктограм"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "TDEIconEdit"
diff --git a/translations/desktop_files/tdeiconedit.desktop/uz.po b/translations/desktop_files/tdeiconedit.desktop/uz.po
new file mode 100644
index 00000000..1b8d8486
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/uz.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Nishoncha tahrirchi"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Nishoncha tahrirchi"
diff --git a/translations/desktop_files/tdeiconedit.desktop/uz@cyrillic.po b/translations/desktop_files/tdeiconedit.desktop/uz@cyrillic.po
new file mode 100644
index 00000000..30287689
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/uz@cyrillic.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: uz@cyrillic\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Нишонча таҳрирчи"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Нишонча таҳрирчи"
diff --git a/translations/desktop_files/tdeiconedit.desktop/ven.po b/translations/desktop_files/tdeiconedit.desktop/ven.po
new file mode 100644
index 00000000..de2ee8ef
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/ven.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: ven\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Musengulusi wa Aikhono"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "U sengulusa ha aikhono ya K"
diff --git a/translations/desktop_files/tdeiconedit.desktop/wa.po b/translations/desktop_files/tdeiconedit.desktop/wa.po
new file mode 100644
index 00000000..3fce4fc1
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/wa.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: wa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Aspougneu d' imådjetes"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Aspougneu d' imådjetes"
diff --git a/translations/desktop_files/tdeiconedit.desktop/xh.po b/translations/desktop_files/tdeiconedit.desktop/xh.po
new file mode 100644
index 00000000..a55b9e84
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/xh.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: xh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Umhleli we Icon"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Umhleli we Icon"
diff --git a/translations/desktop_files/tdeiconedit.desktop/zh_CN.po b/translations/desktop_files/tdeiconedit.desktop/zh_CN.po
new file mode 100644
index 00000000..2938d4c9
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/zh_CN.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "图标编辑器"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "图标编辑器"
diff --git a/translations/desktop_files/tdeiconedit.desktop/zh_HK.po b/translations/desktop_files/tdeiconedit.desktop/zh_HK.po
new file mode 100644
index 00000000..6b90ffe0
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/zh_HK.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_HK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "圖示編輯器"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "圖示編輯器"
diff --git a/translations/desktop_files/tdeiconedit.desktop/zh_TW.po b/translations/desktop_files/tdeiconedit.desktop/zh_TW.po
new file mode 100644
index 00000000..2ff27024
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/zh_TW.po
@@ -0,0 +1,27 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "圖示編輯器"
+
+#. Name
+#: tdeiconedit.desktop:3
+msgid "TDEIconEdit"
+msgstr "TDEIconEdit 圖示編輯器"
diff --git a/translations/desktop_files/tdeiconedit.desktop/zu.po b/translations/desktop_files/tdeiconedit.desktop/zu.po
new file mode 100644
index 00000000..db7226c1
--- /dev/null
+++ b/translations/desktop_files/tdeiconedit.desktop/zu.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-06-09 16:51+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: zu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. GenericName
+#: tdeiconedit.desktop:2
+msgid "Icon Editor"
+msgstr "Umhleli we Icon"
+
+#. Name
+#: tdeiconedit.desktop:3
+#, fuzzy
+msgid "TDEIconEdit"
+msgstr "Umhleli we Icon"